backend.js 580 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else if(typeof exports === 'object')
  7. exports["ReactDevToolsBackend"] = factory();
  8. else
  9. root["ReactDevToolsBackend"] = factory();
  10. })(window, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = 31);
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ([
  98. /* 0 */
  99. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100. "use strict";
  101. /* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export alphaSortKeys */
  102. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getAllEnumerableKeys; });
  103. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return getWrappedDisplayName; });
  104. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return getDisplayName; });
  105. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return getUID; });
  106. /* unused harmony export utfDecodeString */
  107. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return utfEncodeString; });
  108. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return printOperationsArray; });
  109. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getDefaultComponentFilters; });
  110. /* unused harmony export getSavedComponentFilters */
  111. /* unused harmony export setSavedComponentFilters */
  112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return castBool; });
  113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return castBrowserTheme; });
  114. /* unused harmony export getAppendComponentStack */
  115. /* unused harmony export getBreakOnConsoleErrors */
  116. /* unused harmony export getHideConsoleLogsInStrictMode */
  117. /* unused harmony export getShowInlineWarningsAndErrors */
  118. /* unused harmony export getDefaultOpenInEditorURL */
  119. /* unused harmony export getOpenInEditorURL */
  120. /* unused harmony export separateDisplayNameAndHOCs */
  121. /* unused harmony export shallowDiffers */
  122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return getInObject; });
  123. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return deletePathInObject; });
  124. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return renamePathInObject; });
  125. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return setInObject; });
  126. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getDataType; });
  127. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return getDisplayNameForReactElement; });
  128. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return formatDataForPreview; });
  129. /* harmony import */ var lru_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19);
  130. /* harmony import */ var lru_cache__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lru_cache__WEBPACK_IMPORTED_MODULE_0__);
  131. /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
  132. /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_is__WEBPACK_IMPORTED_MODULE_1__);
  133. /* harmony import */ var shared_ReactSymbols__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
  134. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2);
  135. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1);
  136. /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5);
  137. /* harmony import */ var _hydration__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(10);
  138. /* harmony import */ var _isArray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6);
  139. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  140. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  141. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  142. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  143. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
  144. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
  145. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  146. /**
  147. * Copyright (c) Meta Platforms, Inc. and affiliates.
  148. *
  149. * This source code is licensed under the MIT license found in the
  150. * LICENSE file in the root directory of this source tree.
  151. *
  152. *
  153. */
  154. // $FlowFixMe[method-unbinding]
  155. var hasOwnProperty = Object.prototype.hasOwnProperty;
  156. var cachedDisplayNames = new WeakMap(); // On large trees, encoding takes significant time.
  157. // Try to reuse the already encoded strings.
  158. var encodedStringCache = new lru_cache__WEBPACK_IMPORTED_MODULE_0___default.a({
  159. max: 1000
  160. });
  161. function alphaSortKeys(a, b) {
  162. if (a.toString() > b.toString()) {
  163. return 1;
  164. } else if (b.toString() > a.toString()) {
  165. return -1;
  166. } else {
  167. return 0;
  168. }
  169. }
  170. function getAllEnumerableKeys(obj) {
  171. var keys = new Set();
  172. var current = obj;
  173. var _loop = function _loop() {
  174. var currentKeys = [].concat(_toConsumableArray(Object.keys(current)), _toConsumableArray(Object.getOwnPropertySymbols(current)));
  175. var descriptors = Object.getOwnPropertyDescriptors(current);
  176. currentKeys.forEach(function (key) {
  177. // $FlowFixMe: key can be a Symbol https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor
  178. if (descriptors[key].enumerable) {
  179. keys.add(key);
  180. }
  181. });
  182. current = Object.getPrototypeOf(current);
  183. };
  184. while (current != null) {
  185. _loop();
  186. }
  187. return keys;
  188. } // Mirror https://github.com/facebook/react/blob/7c21bf72ace77094fd1910cc350a548287ef8350/packages/shared/getComponentName.js#L27-L37
  189. function getWrappedDisplayName(outerType, innerType, wrapperName, fallbackName) {
  190. var displayName = outerType.displayName;
  191. return displayName || "".concat(wrapperName, "(").concat(getDisplayName(innerType, fallbackName), ")");
  192. }
  193. function getDisplayName(type) {
  194. var fallbackName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Anonymous';
  195. var nameFromCache = cachedDisplayNames.get(type);
  196. if (nameFromCache != null) {
  197. return nameFromCache;
  198. }
  199. var displayName = fallbackName; // The displayName property is not guaranteed to be a string.
  200. // It's only safe to use for our purposes if it's a string.
  201. // github.com/facebook/react-devtools/issues/803
  202. if (typeof type.displayName === 'string') {
  203. displayName = type.displayName;
  204. } else if (typeof type.name === 'string' && type.name !== '') {
  205. displayName = type.name;
  206. }
  207. cachedDisplayNames.set(type, displayName);
  208. return displayName;
  209. }
  210. var uidCounter = 0;
  211. function getUID() {
  212. return ++uidCounter;
  213. }
  214. function utfDecodeString(array) {
  215. // Avoid spreading the array (e.g. String.fromCodePoint(...array))
  216. // Functions arguments are first placed on the stack before the function is called
  217. // which throws a RangeError for large arrays.
  218. // See github.com/facebook/react/issues/22293
  219. var string = '';
  220. for (var i = 0; i < array.length; i++) {
  221. var char = array[i];
  222. string += String.fromCodePoint(char);
  223. }
  224. return string;
  225. }
  226. function surrogatePairToCodePoint(charCode1, charCode2) {
  227. return ((charCode1 & 0x3ff) << 10) + (charCode2 & 0x3ff) + 0x10000;
  228. } // Credit for this encoding approach goes to Tim Down:
  229. // https://stackoverflow.com/questions/4877326/how-can-i-tell-if-a-string-contains-multibyte-characters-in-javascript
  230. function utfEncodeString(string) {
  231. var cached = encodedStringCache.get(string);
  232. if (cached !== undefined) {
  233. return cached;
  234. }
  235. var encoded = [];
  236. var i = 0;
  237. var charCode;
  238. while (i < string.length) {
  239. charCode = string.charCodeAt(i); // Handle multibyte unicode characters (like emoji).
  240. if ((charCode & 0xf800) === 0xd800) {
  241. encoded.push(surrogatePairToCodePoint(charCode, string.charCodeAt(++i)));
  242. } else {
  243. encoded.push(charCode);
  244. }
  245. ++i;
  246. }
  247. encodedStringCache.set(string, encoded);
  248. return encoded;
  249. }
  250. function printOperationsArray(operations) {
  251. // The first two values are always rendererID and rootID
  252. var rendererID = operations[0];
  253. var rootID = operations[1];
  254. var logs = ["operations for renderer:".concat(rendererID, " and root:").concat(rootID)];
  255. var i = 2; // Reassemble the string table.
  256. var stringTable = [null // ID = 0 corresponds to the null string.
  257. ];
  258. var stringTableSize = operations[i++];
  259. var stringTableEnd = i + stringTableSize;
  260. while (i < stringTableEnd) {
  261. var nextLength = operations[i++];
  262. var nextString = utfDecodeString(operations.slice(i, i + nextLength));
  263. stringTable.push(nextString);
  264. i += nextLength;
  265. }
  266. while (i < operations.length) {
  267. var operation = operations[i];
  268. switch (operation) {
  269. case _constants__WEBPACK_IMPORTED_MODULE_3__[/* TREE_OPERATION_ADD */ "l"]:
  270. {
  271. var _id = operations[i + 1];
  272. var type = operations[i + 2];
  273. i += 3;
  274. if (type === _types__WEBPACK_IMPORTED_MODULE_4__[/* ElementTypeRoot */ "m"]) {
  275. logs.push("Add new root node ".concat(_id));
  276. i++; // isStrictModeCompliant
  277. i++; // supportsProfiling
  278. i++; // supportsStrictMode
  279. i++; // hasOwnerMetadata
  280. } else {
  281. var parentID = operations[i];
  282. i++;
  283. i++; // ownerID
  284. var displayNameStringID = operations[i];
  285. var displayName = stringTable[displayNameStringID];
  286. i++;
  287. i++; // key
  288. logs.push("Add node ".concat(_id, " (").concat(displayName || 'null', ") as child of ").concat(parentID));
  289. }
  290. break;
  291. }
  292. case _constants__WEBPACK_IMPORTED_MODULE_3__[/* TREE_OPERATION_REMOVE */ "m"]:
  293. {
  294. var removeLength = operations[i + 1];
  295. i += 2;
  296. for (var removeIndex = 0; removeIndex < removeLength; removeIndex++) {
  297. var _id2 = operations[i];
  298. i += 1;
  299. logs.push("Remove node ".concat(_id2));
  300. }
  301. break;
  302. }
  303. case _constants__WEBPACK_IMPORTED_MODULE_3__[/* TREE_OPERATION_REMOVE_ROOT */ "n"]:
  304. {
  305. i += 1;
  306. logs.push("Remove root ".concat(rootID));
  307. break;
  308. }
  309. case _constants__WEBPACK_IMPORTED_MODULE_3__[/* TREE_OPERATION_SET_SUBTREE_MODE */ "p"]:
  310. {
  311. var _id3 = operations[i + 1];
  312. var mode = operations[i + 1];
  313. i += 3;
  314. logs.push("Mode ".concat(mode, " set for subtree with root ").concat(_id3));
  315. break;
  316. }
  317. case _constants__WEBPACK_IMPORTED_MODULE_3__[/* TREE_OPERATION_REORDER_CHILDREN */ "o"]:
  318. {
  319. var _id4 = operations[i + 1];
  320. var numChildren = operations[i + 2];
  321. i += 3;
  322. var children = operations.slice(i, i + numChildren);
  323. i += numChildren;
  324. logs.push("Re-order node ".concat(_id4, " children ").concat(children.join(',')));
  325. break;
  326. }
  327. case _constants__WEBPACK_IMPORTED_MODULE_3__[/* TREE_OPERATION_UPDATE_TREE_BASE_DURATION */ "r"]:
  328. // Base duration updates are only sent while profiling is in progress.
  329. // We can ignore them at this point.
  330. // The profiler UI uses them lazily in order to generate the tree.
  331. i += 3;
  332. break;
  333. case _constants__WEBPACK_IMPORTED_MODULE_3__[/* TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS */ "q"]:
  334. var id = operations[i + 1];
  335. var numErrors = operations[i + 2];
  336. var numWarnings = operations[i + 3];
  337. i += 4;
  338. logs.push("Node ".concat(id, " has ").concat(numErrors, " errors and ").concat(numWarnings, " warnings"));
  339. break;
  340. default:
  341. throw Error("Unsupported Bridge operation \"".concat(operation, "\""));
  342. }
  343. }
  344. console.log(logs.join('\n '));
  345. }
  346. function getDefaultComponentFilters() {
  347. return [{
  348. type: _types__WEBPACK_IMPORTED_MODULE_4__[/* ComponentFilterElementType */ "b"],
  349. value: _types__WEBPACK_IMPORTED_MODULE_4__[/* ElementTypeHostComponent */ "i"],
  350. isEnabled: true
  351. }];
  352. }
  353. function getSavedComponentFilters() {
  354. try {
  355. var raw = Object(_storage__WEBPACK_IMPORTED_MODULE_5__[/* localStorageGetItem */ "a"])(_constants__WEBPACK_IMPORTED_MODULE_3__[/* LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY */ "a"]);
  356. if (raw != null) {
  357. return JSON.parse(raw);
  358. }
  359. } catch (error) {}
  360. return getDefaultComponentFilters();
  361. }
  362. function setSavedComponentFilters(componentFilters) {
  363. Object(_storage__WEBPACK_IMPORTED_MODULE_5__[/* localStorageSetItem */ "b"])(_constants__WEBPACK_IMPORTED_MODULE_3__[/* LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY */ "a"], JSON.stringify(componentFilters));
  364. }
  365. function parseBool(s) {
  366. if (s === 'true') {
  367. return true;
  368. }
  369. if (s === 'false') {
  370. return false;
  371. }
  372. }
  373. function castBool(v) {
  374. if (v === true || v === false) {
  375. return v;
  376. }
  377. }
  378. function castBrowserTheme(v) {
  379. if (v === 'light' || v === 'dark' || v === 'auto') {
  380. return v;
  381. }
  382. }
  383. function getAppendComponentStack() {
  384. var _parseBool;
  385. var raw = Object(_storage__WEBPACK_IMPORTED_MODULE_5__[/* localStorageGetItem */ "a"])(_constants__WEBPACK_IMPORTED_MODULE_3__[/* LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY */ "d"]);
  386. return (_parseBool = parseBool(raw)) !== null && _parseBool !== void 0 ? _parseBool : true;
  387. }
  388. function getBreakOnConsoleErrors() {
  389. var _parseBool2;
  390. var raw = Object(_storage__WEBPACK_IMPORTED_MODULE_5__[/* localStorageGetItem */ "a"])(_constants__WEBPACK_IMPORTED_MODULE_3__[/* LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS */ "e"]);
  391. return (_parseBool2 = parseBool(raw)) !== null && _parseBool2 !== void 0 ? _parseBool2 : false;
  392. }
  393. function getHideConsoleLogsInStrictMode() {
  394. var _parseBool3;
  395. var raw = Object(_storage__WEBPACK_IMPORTED_MODULE_5__[/* localStorageGetItem */ "a"])(_constants__WEBPACK_IMPORTED_MODULE_3__[/* LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE */ "b"]);
  396. return (_parseBool3 = parseBool(raw)) !== null && _parseBool3 !== void 0 ? _parseBool3 : false;
  397. }
  398. function getShowInlineWarningsAndErrors() {
  399. var _parseBool4;
  400. var raw = Object(_storage__WEBPACK_IMPORTED_MODULE_5__[/* localStorageGetItem */ "a"])(_constants__WEBPACK_IMPORTED_MODULE_3__[/* LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY */ "f"]);
  401. return (_parseBool4 = parseBool(raw)) !== null && _parseBool4 !== void 0 ? _parseBool4 : true;
  402. }
  403. function getDefaultOpenInEditorURL() {
  404. return typeof process.env.EDITOR_URL === 'string' ? process.env.EDITOR_URL : '';
  405. }
  406. function getOpenInEditorURL() {
  407. try {
  408. var raw = Object(_storage__WEBPACK_IMPORTED_MODULE_5__[/* localStorageGetItem */ "a"])(_constants__WEBPACK_IMPORTED_MODULE_3__[/* LOCAL_STORAGE_OPEN_IN_EDITOR_URL */ "c"]);
  409. if (raw != null) {
  410. return JSON.parse(raw);
  411. }
  412. } catch (error) {}
  413. return getDefaultOpenInEditorURL();
  414. }
  415. function separateDisplayNameAndHOCs(displayName, type) {
  416. if (displayName === null) {
  417. return [null, null];
  418. }
  419. var hocDisplayNames = null;
  420. switch (type) {
  421. case _types__WEBPACK_IMPORTED_MODULE_4__[/* ElementTypeClass */ "e"]:
  422. case _types__WEBPACK_IMPORTED_MODULE_4__[/* ElementTypeForwardRef */ "g"]:
  423. case _types__WEBPACK_IMPORTED_MODULE_4__[/* ElementTypeFunction */ "h"]:
  424. case _types__WEBPACK_IMPORTED_MODULE_4__[/* ElementTypeMemo */ "j"]:
  425. if (displayName.indexOf('(') >= 0) {
  426. var matches = displayName.match(/[^()]+/g);
  427. if (matches != null) {
  428. displayName = matches.pop();
  429. hocDisplayNames = matches;
  430. }
  431. }
  432. break;
  433. default:
  434. break;
  435. }
  436. return [displayName, hocDisplayNames];
  437. } // Pulled from react-compat
  438. // https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349
  439. function shallowDiffers(prev, next) {
  440. for (var attribute in prev) {
  441. if (!(attribute in next)) {
  442. return true;
  443. }
  444. }
  445. for (var _attribute in next) {
  446. if (prev[_attribute] !== next[_attribute]) {
  447. return true;
  448. }
  449. }
  450. return false;
  451. }
  452. function getInObject(object, path) {
  453. return path.reduce(function (reduced, attr) {
  454. if (reduced) {
  455. if (hasOwnProperty.call(reduced, attr)) {
  456. return reduced[attr];
  457. }
  458. if (typeof reduced[Symbol.iterator] === 'function') {
  459. // Convert iterable to array and return array[index]
  460. //
  461. // TRICKY
  462. // Don't use [...spread] syntax for this purpose.
  463. // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values.
  464. // Other types (e.g. typed arrays, Sets) will not spread correctly.
  465. return Array.from(reduced)[attr];
  466. }
  467. }
  468. return null;
  469. }, object);
  470. }
  471. function deletePathInObject(object, path) {
  472. var length = path.length;
  473. var last = path[length - 1];
  474. if (object != null) {
  475. var parent = getInObject(object, path.slice(0, length - 1));
  476. if (parent) {
  477. if (Object(_isArray__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(parent)) {
  478. parent.splice(last, 1);
  479. } else {
  480. delete parent[last];
  481. }
  482. }
  483. }
  484. }
  485. function renamePathInObject(object, oldPath, newPath) {
  486. var length = oldPath.length;
  487. if (object != null) {
  488. var parent = getInObject(object, oldPath.slice(0, length - 1));
  489. if (parent) {
  490. var lastOld = oldPath[length - 1];
  491. var lastNew = newPath[length - 1];
  492. parent[lastNew] = parent[lastOld];
  493. if (Object(_isArray__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(parent)) {
  494. parent.splice(lastOld, 1);
  495. } else {
  496. delete parent[lastOld];
  497. }
  498. }
  499. }
  500. }
  501. function setInObject(object, path, value) {
  502. var length = path.length;
  503. var last = path[length - 1];
  504. if (object != null) {
  505. var parent = getInObject(object, path.slice(0, length - 1));
  506. if (parent) {
  507. parent[last] = value;
  508. }
  509. }
  510. }
  511. /**
  512. * Get a enhanced/artificial type string based on the object instance
  513. */
  514. function getDataType(data) {
  515. if (data === null) {
  516. return 'null';
  517. } else if (data === undefined) {
  518. return 'undefined';
  519. }
  520. if (Object(react_is__WEBPACK_IMPORTED_MODULE_1__["isElement"])(data)) {
  521. return 'react_element';
  522. }
  523. if (typeof HTMLElement !== 'undefined' && data instanceof HTMLElement) {
  524. return 'html_element';
  525. }
  526. var type = _typeof(data);
  527. switch (type) {
  528. case 'bigint':
  529. return 'bigint';
  530. case 'boolean':
  531. return 'boolean';
  532. case 'function':
  533. return 'function';
  534. case 'number':
  535. if (Number.isNaN(data)) {
  536. return 'nan';
  537. } else if (!Number.isFinite(data)) {
  538. return 'infinity';
  539. } else {
  540. return 'number';
  541. }
  542. case 'object':
  543. if (Object(_isArray__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(data)) {
  544. return 'array';
  545. } else if (ArrayBuffer.isView(data)) {
  546. return hasOwnProperty.call(data.constructor, 'BYTES_PER_ELEMENT') ? 'typed_array' : 'data_view';
  547. } else if (data.constructor && data.constructor.name === 'ArrayBuffer') {
  548. // HACK This ArrayBuffer check is gross; is there a better way?
  549. // We could try to create a new DataView with the value.
  550. // If it doesn't error, we know it's an ArrayBuffer,
  551. // but this seems kind of awkward and expensive.
  552. return 'array_buffer';
  553. } else if (typeof data[Symbol.iterator] === 'function') {
  554. var iterator = data[Symbol.iterator]();
  555. if (!iterator) {// Proxies might break assumptoins about iterators.
  556. // See github.com/facebook/react/issues/21654
  557. } else {
  558. return iterator === data ? 'opaque_iterator' : 'iterator';
  559. }
  560. } else if (data.constructor && data.constructor.name === 'RegExp') {
  561. return 'regexp';
  562. } else {
  563. // $FlowFixMe[method-unbinding]
  564. var toStringValue = Object.prototype.toString.call(data);
  565. if (toStringValue === '[object Date]') {
  566. return 'date';
  567. } else if (toStringValue === '[object HTMLAllCollection]') {
  568. return 'html_all_collection';
  569. }
  570. }
  571. return 'object';
  572. case 'string':
  573. return 'string';
  574. case 'symbol':
  575. return 'symbol';
  576. case 'undefined':
  577. if ( // $FlowFixMe[method-unbinding]
  578. Object.prototype.toString.call(data) === '[object HTMLAllCollection]') {
  579. return 'html_all_collection';
  580. }
  581. return 'undefined';
  582. default:
  583. return 'unknown';
  584. }
  585. }
  586. function getDisplayNameForReactElement(element) {
  587. var elementType = Object(react_is__WEBPACK_IMPORTED_MODULE_1__["typeOf"])(element);
  588. switch (elementType) {
  589. case react_is__WEBPACK_IMPORTED_MODULE_1__["ContextConsumer"]:
  590. return 'ContextConsumer';
  591. case react_is__WEBPACK_IMPORTED_MODULE_1__["ContextProvider"]:
  592. return 'ContextProvider';
  593. case react_is__WEBPACK_IMPORTED_MODULE_1__["ForwardRef"]:
  594. return 'ForwardRef';
  595. case react_is__WEBPACK_IMPORTED_MODULE_1__["Fragment"]:
  596. return 'Fragment';
  597. case react_is__WEBPACK_IMPORTED_MODULE_1__["Lazy"]:
  598. return 'Lazy';
  599. case react_is__WEBPACK_IMPORTED_MODULE_1__["Memo"]:
  600. return 'Memo';
  601. case react_is__WEBPACK_IMPORTED_MODULE_1__["Portal"]:
  602. return 'Portal';
  603. case react_is__WEBPACK_IMPORTED_MODULE_1__["Profiler"]:
  604. return 'Profiler';
  605. case react_is__WEBPACK_IMPORTED_MODULE_1__["StrictMode"]:
  606. return 'StrictMode';
  607. case react_is__WEBPACK_IMPORTED_MODULE_1__["Suspense"]:
  608. return 'Suspense';
  609. case shared_ReactSymbols__WEBPACK_IMPORTED_MODULE_2__[/* REACT_SUSPENSE_LIST_TYPE */ "a"]:
  610. return 'SuspenseList';
  611. case shared_ReactSymbols__WEBPACK_IMPORTED_MODULE_2__[/* REACT_TRACING_MARKER_TYPE */ "b"]:
  612. return 'TracingMarker';
  613. default:
  614. var type = element.type;
  615. if (typeof type === 'string') {
  616. return type;
  617. } else if (typeof type === 'function') {
  618. return getDisplayName(type, 'Anonymous');
  619. } else if (type != null) {
  620. return 'NotImplementedInDevtools';
  621. } else {
  622. return 'Element';
  623. }
  624. }
  625. }
  626. var MAX_PREVIEW_STRING_LENGTH = 50;
  627. function truncateForDisplay(string) {
  628. var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : MAX_PREVIEW_STRING_LENGTH;
  629. if (string.length > length) {
  630. return string.substr(0, length) + '…';
  631. } else {
  632. return string;
  633. }
  634. } // Attempts to mimic Chrome's inline preview for values.
  635. // For example, the following value...
  636. // {
  637. // foo: 123,
  638. // bar: "abc",
  639. // baz: [true, false],
  640. // qux: { ab: 1, cd: 2 }
  641. // };
  642. //
  643. // Would show a preview of...
  644. // {foo: 123, bar: "abc", baz: Array(2), qux: {…}}
  645. //
  646. // And the following value...
  647. // [
  648. // 123,
  649. // "abc",
  650. // [true, false],
  651. // { foo: 123, bar: "abc" }
  652. // ];
  653. //
  654. // Would show a preview of...
  655. // [123, "abc", Array(2), {…}]
  656. function formatDataForPreview(data, showFormattedValue) {
  657. if (data != null && hasOwnProperty.call(data, _hydration__WEBPACK_IMPORTED_MODULE_6__[/* meta */ "b"].type)) {
  658. return showFormattedValue ? data[_hydration__WEBPACK_IMPORTED_MODULE_6__[/* meta */ "b"].preview_long] : data[_hydration__WEBPACK_IMPORTED_MODULE_6__[/* meta */ "b"].preview_short];
  659. }
  660. var type = getDataType(data);
  661. switch (type) {
  662. case 'html_element':
  663. return "<".concat(truncateForDisplay(data.tagName.toLowerCase()), " />");
  664. case 'function':
  665. return truncateForDisplay("\u0192 ".concat(typeof data.name === 'function' ? '' : data.name, "() {}"));
  666. case 'string':
  667. return "\"".concat(data, "\"");
  668. case 'bigint':
  669. return truncateForDisplay(data.toString() + 'n');
  670. case 'regexp':
  671. return truncateForDisplay(data.toString());
  672. case 'symbol':
  673. return truncateForDisplay(data.toString());
  674. case 'react_element':
  675. return "<".concat(truncateForDisplay(getDisplayNameForReactElement(data) || 'Unknown'), " />");
  676. case 'array_buffer':
  677. return "ArrayBuffer(".concat(data.byteLength, ")");
  678. case 'data_view':
  679. return "DataView(".concat(data.buffer.byteLength, ")");
  680. case 'array':
  681. if (showFormattedValue) {
  682. var formatted = '';
  683. for (var i = 0; i < data.length; i++) {
  684. if (i > 0) {
  685. formatted += ', ';
  686. }
  687. formatted += formatDataForPreview(data[i], false);
  688. if (formatted.length > MAX_PREVIEW_STRING_LENGTH) {
  689. // Prevent doing a lot of unnecessary iteration...
  690. break;
  691. }
  692. }
  693. return "[".concat(truncateForDisplay(formatted), "]");
  694. } else {
  695. var length = hasOwnProperty.call(data, _hydration__WEBPACK_IMPORTED_MODULE_6__[/* meta */ "b"].size) ? data[_hydration__WEBPACK_IMPORTED_MODULE_6__[/* meta */ "b"].size] : data.length;
  696. return "Array(".concat(length, ")");
  697. }
  698. case 'typed_array':
  699. var shortName = "".concat(data.constructor.name, "(").concat(data.length, ")");
  700. if (showFormattedValue) {
  701. var _formatted = '';
  702. for (var _i = 0; _i < data.length; _i++) {
  703. if (_i > 0) {
  704. _formatted += ', ';
  705. }
  706. _formatted += data[_i];
  707. if (_formatted.length > MAX_PREVIEW_STRING_LENGTH) {
  708. // Prevent doing a lot of unnecessary iteration...
  709. break;
  710. }
  711. }
  712. return "".concat(shortName, " [").concat(truncateForDisplay(_formatted), "]");
  713. } else {
  714. return shortName;
  715. }
  716. case 'iterator':
  717. var name = data.constructor.name;
  718. if (showFormattedValue) {
  719. // TRICKY
  720. // Don't use [...spread] syntax for this purpose.
  721. // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values.
  722. // Other types (e.g. typed arrays, Sets) will not spread correctly.
  723. var array = Array.from(data);
  724. var _formatted2 = '';
  725. for (var _i2 = 0; _i2 < array.length; _i2++) {
  726. var entryOrEntries = array[_i2];
  727. if (_i2 > 0) {
  728. _formatted2 += ', ';
  729. } // TRICKY
  730. // Browsers display Maps and Sets differently.
  731. // To mimic their behavior, detect if we've been given an entries tuple.
  732. // Map(2) {"abc" => 123, "def" => 123}
  733. // Set(2) {"abc", 123}
  734. if (Object(_isArray__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(entryOrEntries)) {
  735. var key = formatDataForPreview(entryOrEntries[0], true);
  736. var value = formatDataForPreview(entryOrEntries[1], false);
  737. _formatted2 += "".concat(key, " => ").concat(value);
  738. } else {
  739. _formatted2 += formatDataForPreview(entryOrEntries, false);
  740. }
  741. if (_formatted2.length > MAX_PREVIEW_STRING_LENGTH) {
  742. // Prevent doing a lot of unnecessary iteration...
  743. break;
  744. }
  745. }
  746. return "".concat(name, "(").concat(data.size, ") {").concat(truncateForDisplay(_formatted2), "}");
  747. } else {
  748. return "".concat(name, "(").concat(data.size, ")");
  749. }
  750. case 'opaque_iterator':
  751. {
  752. return data[Symbol.toStringTag];
  753. }
  754. case 'date':
  755. return data.toString();
  756. case 'object':
  757. if (showFormattedValue) {
  758. var keys = Array.from(getAllEnumerableKeys(data)).sort(alphaSortKeys);
  759. var _formatted3 = '';
  760. for (var _i3 = 0; _i3 < keys.length; _i3++) {
  761. var _key = keys[_i3];
  762. if (_i3 > 0) {
  763. _formatted3 += ', ';
  764. }
  765. _formatted3 += "".concat(_key.toString(), ": ").concat(formatDataForPreview(data[_key], false));
  766. if (_formatted3.length > MAX_PREVIEW_STRING_LENGTH) {
  767. // Prevent doing a lot of unnecessary iteration...
  768. break;
  769. }
  770. }
  771. return "{".concat(truncateForDisplay(_formatted3), "}");
  772. } else {
  773. return '{…}';
  774. }
  775. case 'boolean':
  776. case 'number':
  777. case 'infinity':
  778. case 'nan':
  779. case 'null':
  780. case 'undefined':
  781. return data;
  782. default:
  783. try {
  784. return truncateForDisplay(String(data));
  785. } catch (error) {
  786. return 'unserializable';
  787. }
  788. }
  789. }
  790. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(17)))
  791. /***/ }),
  792. /* 1 */
  793. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  794. "use strict";
  795. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return ElementTypeClass; });
  796. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return ElementTypeContext; });
  797. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return ElementTypeFunction; });
  798. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return ElementTypeForwardRef; });
  799. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return ElementTypeHostComponent; });
  800. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return ElementTypeMemo; });
  801. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return ElementTypeOtherOrUnknown; });
  802. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return ElementTypeProfiler; });
  803. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return ElementTypeRoot; });
  804. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return ElementTypeSuspense; });
  805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return ElementTypeSuspenseList; });
  806. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return ElementTypeTracingMarker; });
  807. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ComponentFilterElementType; });
  808. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ComponentFilterDisplayName; });
  809. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ComponentFilterLocation; });
  810. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ComponentFilterHOC; });
  811. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return StrictMode; });
  812. /**
  813. * Copyright (c) Meta Platforms, Inc. and affiliates.
  814. *
  815. * This source code is licensed under the MIT license found in the
  816. * LICENSE file in the root directory of this source tree.
  817. *
  818. *
  819. */
  820. // WARNING
  821. // The values below are referenced by ComponentFilters (which are saved via localStorage).
  822. // Do not change them or it will break previously saved user customizations.
  823. // If new element types are added, use new numbers rather than re-ordering existing ones.
  824. //
  825. // Changing these types is also a backwards breaking change for the standalone shell,
  826. // since the frontend and backend must share the same values-
  827. // and the backend is embedded in certain environments (like React Native).
  828. var ElementTypeClass = 1;
  829. var ElementTypeContext = 2;
  830. var ElementTypeFunction = 5;
  831. var ElementTypeForwardRef = 6;
  832. var ElementTypeHostComponent = 7;
  833. var ElementTypeMemo = 8;
  834. var ElementTypeOtherOrUnknown = 9;
  835. var ElementTypeProfiler = 10;
  836. var ElementTypeRoot = 11;
  837. var ElementTypeSuspense = 12;
  838. var ElementTypeSuspenseList = 13;
  839. var ElementTypeTracingMarker = 14; // Different types of elements displayed in the Elements tree.
  840. // These types may be used to visually distinguish types,
  841. // or to enable/disable certain functionality.
  842. // WARNING
  843. // The values below are referenced by ComponentFilters (which are saved via localStorage).
  844. // Do not change them or it will break previously saved user customizations.
  845. // If new filter types are added, use new numbers rather than re-ordering existing ones.
  846. var ComponentFilterElementType = 1;
  847. var ComponentFilterDisplayName = 2;
  848. var ComponentFilterLocation = 3;
  849. var ComponentFilterHOC = 4;
  850. var StrictMode = 1;
  851. /***/ }),
  852. /* 2 */
  853. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  854. "use strict";
  855. /* unused harmony export CHROME_WEBSTORE_EXTENSION_ID */
  856. /* unused harmony export INTERNAL_EXTENSION_ID */
  857. /* unused harmony export LOCAL_EXTENSION_ID */
  858. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return __DEBUG__; });
  859. /* unused harmony export __PERFORMANCE_PROFILE__ */
  860. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return TREE_OPERATION_ADD; });
  861. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return TREE_OPERATION_REMOVE; });
  862. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return TREE_OPERATION_REORDER_CHILDREN; });
  863. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return TREE_OPERATION_UPDATE_TREE_BASE_DURATION; });
  864. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS; });
  865. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return TREE_OPERATION_REMOVE_ROOT; });
  866. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return TREE_OPERATION_SET_SUBTREE_MODE; });
  867. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return PROFILING_FLAG_BASIC_SUPPORT; });
  868. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return PROFILING_FLAG_TIMELINE_SUPPORT; });
  869. /* unused harmony export LOCAL_STORAGE_DEFAULT_TAB_KEY */
  870. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY; });
  871. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return SESSION_STORAGE_LAST_SELECTION_KEY; });
  872. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return LOCAL_STORAGE_OPEN_IN_EDITOR_URL; });
  873. /* unused harmony export LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY */
  874. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY; });
  875. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return SESSION_STORAGE_RELOAD_AND_PROFILE_KEY; });
  876. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS; });
  877. /* unused harmony export LOCAL_STORAGE_BROWSER_THEME */
  878. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY; });
  879. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY; });
  880. /* unused harmony export LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY */
  881. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE; });
  882. /* unused harmony export PROFILER_EXPORT_VERSION */
  883. /* unused harmony export CHANGE_LOG_URL */
  884. /* unused harmony export UNSUPPORTED_VERSION_URL */
  885. /* unused harmony export REACT_DEVTOOLS_WORKPLACE_URL */
  886. /* unused harmony export THEME_STYLES */
  887. /* unused harmony export COMFORTABLE_LINE_HEIGHT */
  888. /* unused harmony export COMPACT_LINE_HEIGHT */
  889. /**
  890. * Copyright (c) Meta Platforms, Inc. and affiliates.
  891. *
  892. * This source code is licensed under the MIT license found in the
  893. * LICENSE file in the root directory of this source tree.
  894. *
  895. *
  896. */
  897. var CHROME_WEBSTORE_EXTENSION_ID = 'fmkadmapgofadopljbjfkapdkoienihi';
  898. var INTERNAL_EXTENSION_ID = 'dnjnjgbfilfphmojnmhliehogmojhclc';
  899. var LOCAL_EXTENSION_ID = 'ikiahnapldjmdmpkmfhjdjilojjhgcbf'; // Flip this flag to true to enable verbose console debug logging.
  900. var __DEBUG__ = false; // Flip this flag to true to enable performance.mark() and performance.measure() timings.
  901. var __PERFORMANCE_PROFILE__ = false;
  902. var TREE_OPERATION_ADD = 1;
  903. var TREE_OPERATION_REMOVE = 2;
  904. var TREE_OPERATION_REORDER_CHILDREN = 3;
  905. var TREE_OPERATION_UPDATE_TREE_BASE_DURATION = 4;
  906. var TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS = 5;
  907. var TREE_OPERATION_REMOVE_ROOT = 6;
  908. var TREE_OPERATION_SET_SUBTREE_MODE = 7;
  909. var PROFILING_FLAG_BASIC_SUPPORT = 1;
  910. var PROFILING_FLAG_TIMELINE_SUPPORT = 2;
  911. var LOCAL_STORAGE_DEFAULT_TAB_KEY = 'React::DevTools::defaultTab';
  912. var LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY = 'React::DevTools::componentFilters';
  913. var SESSION_STORAGE_LAST_SELECTION_KEY = 'React::DevTools::lastSelection';
  914. var LOCAL_STORAGE_OPEN_IN_EDITOR_URL = 'React::DevTools::openInEditorUrl';
  915. var LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY = 'React::DevTools::parseHookNames';
  916. var SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY = 'React::DevTools::recordChangeDescriptions';
  917. var SESSION_STORAGE_RELOAD_AND_PROFILE_KEY = 'React::DevTools::reloadAndProfile';
  918. var LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS = 'React::DevTools::breakOnConsoleErrors';
  919. var LOCAL_STORAGE_BROWSER_THEME = 'React::DevTools::theme';
  920. var LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY = 'React::DevTools::appendComponentStack';
  921. var LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY = 'React::DevTools::showInlineWarningsAndErrors';
  922. var LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY = 'React::DevTools::traceUpdatesEnabled';
  923. var LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE = 'React::DevTools::hideConsoleLogsInStrictMode';
  924. var PROFILER_EXPORT_VERSION = 5;
  925. var CHANGE_LOG_URL = 'https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md';
  926. var UNSUPPORTED_VERSION_URL = 'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back';
  927. var REACT_DEVTOOLS_WORKPLACE_URL = 'https://fburl.com/react-devtools-workplace-group';
  928. var THEME_STYLES = {
  929. light: {
  930. '--color-attribute-name': '#ef6632',
  931. '--color-attribute-name-not-editable': '#23272f',
  932. '--color-attribute-name-inverted': 'rgba(255, 255, 255, 0.7)',
  933. '--color-attribute-value': '#1a1aa6',
  934. '--color-attribute-value-inverted': '#ffffff',
  935. '--color-attribute-editable-value': '#1a1aa6',
  936. '--color-background': '#ffffff',
  937. '--color-background-hover': 'rgba(0, 136, 250, 0.1)',
  938. '--color-background-inactive': '#e5e5e5',
  939. '--color-background-invalid': '#fff0f0',
  940. '--color-background-selected': '#0088fa',
  941. '--color-button-background': '#ffffff',
  942. '--color-button-background-focus': '#ededed',
  943. '--color-button': '#5f6673',
  944. '--color-button-disabled': '#cfd1d5',
  945. '--color-button-active': '#0088fa',
  946. '--color-button-focus': '#23272f',
  947. '--color-button-hover': '#23272f',
  948. '--color-border': '#eeeeee',
  949. '--color-commit-did-not-render-fill': '#cfd1d5',
  950. '--color-commit-did-not-render-fill-text': '#000000',
  951. '--color-commit-did-not-render-pattern': '#cfd1d5',
  952. '--color-commit-did-not-render-pattern-text': '#333333',
  953. '--color-commit-gradient-0': '#37afa9',
  954. '--color-commit-gradient-1': '#63b19e',
  955. '--color-commit-gradient-2': '#80b393',
  956. '--color-commit-gradient-3': '#97b488',
  957. '--color-commit-gradient-4': '#abb67d',
  958. '--color-commit-gradient-5': '#beb771',
  959. '--color-commit-gradient-6': '#cfb965',
  960. '--color-commit-gradient-7': '#dfba57',
  961. '--color-commit-gradient-8': '#efbb49',
  962. '--color-commit-gradient-9': '#febc38',
  963. '--color-commit-gradient-text': '#000000',
  964. '--color-component-name': '#6a51b2',
  965. '--color-component-name-inverted': '#ffffff',
  966. '--color-component-badge-background': 'rgba(0, 0, 0, 0.1)',
  967. '--color-component-badge-background-inverted': 'rgba(255, 255, 255, 0.25)',
  968. '--color-component-badge-count': '#777d88',
  969. '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)',
  970. '--color-console-error-badge-text': '#ffffff',
  971. '--color-console-error-background': '#fff0f0',
  972. '--color-console-error-border': '#ffd6d6',
  973. '--color-console-error-icon': '#eb3941',
  974. '--color-console-error-text': '#fe2e31',
  975. '--color-console-warning-badge-text': '#000000',
  976. '--color-console-warning-background': '#fffbe5',
  977. '--color-console-warning-border': '#fff5c1',
  978. '--color-console-warning-icon': '#f4bd00',
  979. '--color-console-warning-text': '#64460c',
  980. '--color-context-background': 'rgba(0,0,0,.9)',
  981. '--color-context-background-hover': 'rgba(255, 255, 255, 0.1)',
  982. '--color-context-background-selected': '#178fb9',
  983. '--color-context-border': '#3d424a',
  984. '--color-context-text': '#ffffff',
  985. '--color-context-text-selected': '#ffffff',
  986. '--color-dim': '#777d88',
  987. '--color-dimmer': '#cfd1d5',
  988. '--color-dimmest': '#eff0f1',
  989. '--color-error-background': 'hsl(0, 100%, 97%)',
  990. '--color-error-border': 'hsl(0, 100%, 92%)',
  991. '--color-error-text': '#ff0000',
  992. '--color-expand-collapse-toggle': '#777d88',
  993. '--color-link': '#0000ff',
  994. '--color-modal-background': 'rgba(255, 255, 255, 0.75)',
  995. '--color-bridge-version-npm-background': '#eff0f1',
  996. '--color-bridge-version-npm-text': '#000000',
  997. '--color-bridge-version-number': '#0088fa',
  998. '--color-primitive-hook-badge-background': '#e5e5e5',
  999. '--color-primitive-hook-badge-text': '#5f6673',
  1000. '--color-record-active': '#fc3a4b',
  1001. '--color-record-hover': '#3578e5',
  1002. '--color-record-inactive': '#0088fa',
  1003. '--color-resize-bar': '#eeeeee',
  1004. '--color-resize-bar-active': '#dcdcdc',
  1005. '--color-resize-bar-border': '#d1d1d1',
  1006. '--color-resize-bar-dot': '#333333',
  1007. '--color-timeline-internal-module': '#d1d1d1',
  1008. '--color-timeline-internal-module-hover': '#c9c9c9',
  1009. '--color-timeline-internal-module-text': '#444',
  1010. '--color-timeline-native-event': '#ccc',
  1011. '--color-timeline-native-event-hover': '#aaa',
  1012. '--color-timeline-network-primary': '#fcf3dc',
  1013. '--color-timeline-network-primary-hover': '#f0e7d1',
  1014. '--color-timeline-network-secondary': '#efc457',
  1015. '--color-timeline-network-secondary-hover': '#e3ba52',
  1016. '--color-timeline-priority-background': '#f6f6f6',
  1017. '--color-timeline-priority-border': '#eeeeee',
  1018. '--color-timeline-user-timing': '#c9cacd',
  1019. '--color-timeline-user-timing-hover': '#93959a',
  1020. '--color-timeline-react-idle': '#d3e5f6',
  1021. '--color-timeline-react-idle-hover': '#c3d9ef',
  1022. '--color-timeline-react-render': '#9fc3f3',
  1023. '--color-timeline-react-render-hover': '#83afe9',
  1024. '--color-timeline-react-render-text': '#11365e',
  1025. '--color-timeline-react-commit': '#c88ff0',
  1026. '--color-timeline-react-commit-hover': '#b281d6',
  1027. '--color-timeline-react-commit-text': '#3e2c4a',
  1028. '--color-timeline-react-layout-effects': '#b281d6',
  1029. '--color-timeline-react-layout-effects-hover': '#9d71bd',
  1030. '--color-timeline-react-layout-effects-text': '#3e2c4a',
  1031. '--color-timeline-react-passive-effects': '#b281d6',
  1032. '--color-timeline-react-passive-effects-hover': '#9d71bd',
  1033. '--color-timeline-react-passive-effects-text': '#3e2c4a',
  1034. '--color-timeline-react-schedule': '#9fc3f3',
  1035. '--color-timeline-react-schedule-hover': '#2683E2',
  1036. '--color-timeline-react-suspense-rejected': '#f1cc14',
  1037. '--color-timeline-react-suspense-rejected-hover': '#ffdf37',
  1038. '--color-timeline-react-suspense-resolved': '#a6e59f',
  1039. '--color-timeline-react-suspense-resolved-hover': '#89d281',
  1040. '--color-timeline-react-suspense-unresolved': '#c9cacd',
  1041. '--color-timeline-react-suspense-unresolved-hover': '#93959a',
  1042. '--color-timeline-thrown-error': '#ee1638',
  1043. '--color-timeline-thrown-error-hover': '#da1030',
  1044. '--color-timeline-text-color': '#000000',
  1045. '--color-timeline-text-dim-color': '#ccc',
  1046. '--color-timeline-react-work-border': '#eeeeee',
  1047. '--color-search-match': 'yellow',
  1048. '--color-search-match-current': '#f7923b',
  1049. '--color-selected-tree-highlight-active': 'rgba(0, 136, 250, 0.1)',
  1050. '--color-selected-tree-highlight-inactive': 'rgba(0, 0, 0, 0.05)',
  1051. '--color-scroll-caret': 'rgba(150, 150, 150, 0.5)',
  1052. '--color-tab-selected-border': '#0088fa',
  1053. '--color-text': '#000000',
  1054. '--color-text-invalid': '#ff0000',
  1055. '--color-text-selected': '#ffffff',
  1056. '--color-toggle-background-invalid': '#fc3a4b',
  1057. '--color-toggle-background-on': '#0088fa',
  1058. '--color-toggle-background-off': '#cfd1d5',
  1059. '--color-toggle-text': '#ffffff',
  1060. '--color-warning-background': '#fb3655',
  1061. '--color-warning-background-hover': '#f82042',
  1062. '--color-warning-text-color': '#ffffff',
  1063. '--color-warning-text-color-inverted': '#fd4d69',
  1064. // The styles below should be kept in sync with 'root.css'
  1065. // They are repeated there because they're used by e.g. tooltips or context menus
  1066. // which get rendered outside of the DOM subtree (where normal theme/styles are written).
  1067. '--color-scroll-thumb': '#c2c2c2',
  1068. '--color-scroll-track': '#fafafa',
  1069. '--color-tooltip-background': 'rgba(0, 0, 0, 0.9)',
  1070. '--color-tooltip-text': '#ffffff'
  1071. },
  1072. dark: {
  1073. '--color-attribute-name': '#9d87d2',
  1074. '--color-attribute-name-not-editable': '#ededed',
  1075. '--color-attribute-name-inverted': '#282828',
  1076. '--color-attribute-value': '#cedae0',
  1077. '--color-attribute-value-inverted': '#ffffff',
  1078. '--color-attribute-editable-value': 'yellow',
  1079. '--color-background': '#282c34',
  1080. '--color-background-hover': 'rgba(255, 255, 255, 0.1)',
  1081. '--color-background-inactive': '#3d424a',
  1082. '--color-background-invalid': '#5c0000',
  1083. '--color-background-selected': '#178fb9',
  1084. '--color-button-background': '#282c34',
  1085. '--color-button-background-focus': '#3d424a',
  1086. '--color-button': '#afb3b9',
  1087. '--color-button-active': '#61dafb',
  1088. '--color-button-disabled': '#4f5766',
  1089. '--color-button-focus': '#a2e9fc',
  1090. '--color-button-hover': '#ededed',
  1091. '--color-border': '#3d424a',
  1092. '--color-commit-did-not-render-fill': '#777d88',
  1093. '--color-commit-did-not-render-fill-text': '#000000',
  1094. '--color-commit-did-not-render-pattern': '#666c77',
  1095. '--color-commit-did-not-render-pattern-text': '#ffffff',
  1096. '--color-commit-gradient-0': '#37afa9',
  1097. '--color-commit-gradient-1': '#63b19e',
  1098. '--color-commit-gradient-2': '#80b393',
  1099. '--color-commit-gradient-3': '#97b488',
  1100. '--color-commit-gradient-4': '#abb67d',
  1101. '--color-commit-gradient-5': '#beb771',
  1102. '--color-commit-gradient-6': '#cfb965',
  1103. '--color-commit-gradient-7': '#dfba57',
  1104. '--color-commit-gradient-8': '#efbb49',
  1105. '--color-commit-gradient-9': '#febc38',
  1106. '--color-commit-gradient-text': '#000000',
  1107. '--color-component-name': '#61dafb',
  1108. '--color-component-name-inverted': '#282828',
  1109. '--color-component-badge-background': 'rgba(255, 255, 255, 0.25)',
  1110. '--color-component-badge-background-inverted': 'rgba(0, 0, 0, 0.25)',
  1111. '--color-component-badge-count': '#8f949d',
  1112. '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)',
  1113. '--color-console-error-badge-text': '#000000',
  1114. '--color-console-error-background': '#290000',
  1115. '--color-console-error-border': '#5c0000',
  1116. '--color-console-error-icon': '#eb3941',
  1117. '--color-console-error-text': '#fc7f7f',
  1118. '--color-console-warning-badge-text': '#000000',
  1119. '--color-console-warning-background': '#332b00',
  1120. '--color-console-warning-border': '#665500',
  1121. '--color-console-warning-icon': '#f4bd00',
  1122. '--color-console-warning-text': '#f5f2ed',
  1123. '--color-context-background': 'rgba(255,255,255,.95)',
  1124. '--color-context-background-hover': 'rgba(0, 136, 250, 0.1)',
  1125. '--color-context-background-selected': '#0088fa',
  1126. '--color-context-border': '#eeeeee',
  1127. '--color-context-text': '#000000',
  1128. '--color-context-text-selected': '#ffffff',
  1129. '--color-dim': '#8f949d',
  1130. '--color-dimmer': '#777d88',
  1131. '--color-dimmest': '#4f5766',
  1132. '--color-error-background': '#200',
  1133. '--color-error-border': '#900',
  1134. '--color-error-text': '#f55',
  1135. '--color-expand-collapse-toggle': '#8f949d',
  1136. '--color-link': '#61dafb',
  1137. '--color-modal-background': 'rgba(0, 0, 0, 0.75)',
  1138. '--color-bridge-version-npm-background': 'rgba(0, 0, 0, 0.25)',
  1139. '--color-bridge-version-npm-text': '#ffffff',
  1140. '--color-bridge-version-number': 'yellow',
  1141. '--color-primitive-hook-badge-background': 'rgba(0, 0, 0, 0.25)',
  1142. '--color-primitive-hook-badge-text': 'rgba(255, 255, 255, 0.7)',
  1143. '--color-record-active': '#fc3a4b',
  1144. '--color-record-hover': '#a2e9fc',
  1145. '--color-record-inactive': '#61dafb',
  1146. '--color-resize-bar': '#282c34',
  1147. '--color-resize-bar-active': '#31363f',
  1148. '--color-resize-bar-border': '#3d424a',
  1149. '--color-resize-bar-dot': '#cfd1d5',
  1150. '--color-timeline-internal-module': '#303542',
  1151. '--color-timeline-internal-module-hover': '#363b4a',
  1152. '--color-timeline-internal-module-text': '#7f8899',
  1153. '--color-timeline-native-event': '#b2b2b2',
  1154. '--color-timeline-native-event-hover': '#949494',
  1155. '--color-timeline-network-primary': '#fcf3dc',
  1156. '--color-timeline-network-primary-hover': '#e3dbc5',
  1157. '--color-timeline-network-secondary': '#efc457',
  1158. '--color-timeline-network-secondary-hover': '#d6af4d',
  1159. '--color-timeline-priority-background': '#1d2129',
  1160. '--color-timeline-priority-border': '#282c34',
  1161. '--color-timeline-user-timing': '#c9cacd',
  1162. '--color-timeline-user-timing-hover': '#93959a',
  1163. '--color-timeline-react-idle': '#3d485b',
  1164. '--color-timeline-react-idle-hover': '#465269',
  1165. '--color-timeline-react-render': '#2683E2',
  1166. '--color-timeline-react-render-hover': '#1a76d4',
  1167. '--color-timeline-react-render-text': '#11365e',
  1168. '--color-timeline-react-commit': '#731fad',
  1169. '--color-timeline-react-commit-hover': '#611b94',
  1170. '--color-timeline-react-commit-text': '#e5c1ff',
  1171. '--color-timeline-react-layout-effects': '#611b94',
  1172. '--color-timeline-react-layout-effects-hover': '#51167a',
  1173. '--color-timeline-react-layout-effects-text': '#e5c1ff',
  1174. '--color-timeline-react-passive-effects': '#611b94',
  1175. '--color-timeline-react-passive-effects-hover': '#51167a',
  1176. '--color-timeline-react-passive-effects-text': '#e5c1ff',
  1177. '--color-timeline-react-schedule': '#2683E2',
  1178. '--color-timeline-react-schedule-hover': '#1a76d4',
  1179. '--color-timeline-react-suspense-rejected': '#f1cc14',
  1180. '--color-timeline-react-suspense-rejected-hover': '#e4c00f',
  1181. '--color-timeline-react-suspense-resolved': '#a6e59f',
  1182. '--color-timeline-react-suspense-resolved-hover': '#89d281',
  1183. '--color-timeline-react-suspense-unresolved': '#c9cacd',
  1184. '--color-timeline-react-suspense-unresolved-hover': '#93959a',
  1185. '--color-timeline-thrown-error': '#fb3655',
  1186. '--color-timeline-thrown-error-hover': '#f82042',
  1187. '--color-timeline-text-color': '#282c34',
  1188. '--color-timeline-text-dim-color': '#555b66',
  1189. '--color-timeline-react-work-border': '#3d424a',
  1190. '--color-search-match': 'yellow',
  1191. '--color-search-match-current': '#f7923b',
  1192. '--color-selected-tree-highlight-active': 'rgba(23, 143, 185, 0.15)',
  1193. '--color-selected-tree-highlight-inactive': 'rgba(255, 255, 255, 0.05)',
  1194. '--color-scroll-caret': '#4f5766',
  1195. '--color-shadow': 'rgba(0, 0, 0, 0.5)',
  1196. '--color-tab-selected-border': '#178fb9',
  1197. '--color-text': '#ffffff',
  1198. '--color-text-invalid': '#ff8080',
  1199. '--color-text-selected': '#ffffff',
  1200. '--color-toggle-background-invalid': '#fc3a4b',
  1201. '--color-toggle-background-on': '#178fb9',
  1202. '--color-toggle-background-off': '#777d88',
  1203. '--color-toggle-text': '#ffffff',
  1204. '--color-warning-background': '#ee1638',
  1205. '--color-warning-background-hover': '#da1030',
  1206. '--color-warning-text-color': '#ffffff',
  1207. '--color-warning-text-color-inverted': '#ee1638',
  1208. // The styles below should be kept in sync with 'root.css'
  1209. // They are repeated there because they're used by e.g. tooltips or context menus
  1210. // which get rendered outside of the DOM subtree (where normal theme/styles are written).
  1211. '--color-scroll-thumb': '#afb3b9',
  1212. '--color-scroll-track': '#313640',
  1213. '--color-tooltip-background': 'rgba(255, 255, 255, 0.95)',
  1214. '--color-tooltip-text': '#000000'
  1215. },
  1216. compact: {
  1217. '--font-size-monospace-small': '9px',
  1218. '--font-size-monospace-normal': '11px',
  1219. '--font-size-monospace-large': '15px',
  1220. '--font-size-sans-small': '10px',
  1221. '--font-size-sans-normal': '12px',
  1222. '--font-size-sans-large': '14px',
  1223. '--line-height-data': '18px'
  1224. },
  1225. comfortable: {
  1226. '--font-size-monospace-small': '10px',
  1227. '--font-size-monospace-normal': '13px',
  1228. '--font-size-monospace-large': '17px',
  1229. '--font-size-sans-small': '12px',
  1230. '--font-size-sans-normal': '14px',
  1231. '--font-size-sans-large': '16px',
  1232. '--line-height-data': '22px'
  1233. }
  1234. }; // HACK
  1235. //
  1236. // Sometimes the inline target is rendered before root styles are applied,
  1237. // which would result in e.g. NaN itemSize being passed to react-window list.
  1238. var COMFORTABLE_LINE_HEIGHT = parseInt(THEME_STYLES.comfortable['--line-height-data'], 10);
  1239. var COMPACT_LINE_HEIGHT = parseInt(THEME_STYLES.compact['--line-height-data'], 10);
  1240. /***/ }),
  1241. /* 3 */
  1242. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1243. "use strict";
  1244. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CONCURRENT_MODE_NUMBER; });
  1245. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CONCURRENT_MODE_SYMBOL_STRING; });
  1246. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return CONTEXT_NUMBER; });
  1247. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return CONTEXT_SYMBOL_STRING; });
  1248. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return SERVER_CONTEXT_SYMBOL_STRING; });
  1249. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return DEPRECATED_ASYNC_MODE_SYMBOL_STRING; });
  1250. /* unused harmony export ELEMENT_NUMBER */
  1251. /* unused harmony export ELEMENT_SYMBOL_STRING */
  1252. /* unused harmony export DEBUG_TRACING_MODE_NUMBER */
  1253. /* unused harmony export DEBUG_TRACING_MODE_SYMBOL_STRING */
  1254. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return FORWARD_REF_NUMBER; });
  1255. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return FORWARD_REF_SYMBOL_STRING; });
  1256. /* unused harmony export FRAGMENT_NUMBER */
  1257. /* unused harmony export FRAGMENT_SYMBOL_STRING */
  1258. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return LAZY_NUMBER; });
  1259. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return LAZY_SYMBOL_STRING; });
  1260. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return MEMO_NUMBER; });
  1261. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return MEMO_SYMBOL_STRING; });
  1262. /* unused harmony export PORTAL_NUMBER */
  1263. /* unused harmony export PORTAL_SYMBOL_STRING */
  1264. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return PROFILER_NUMBER; });
  1265. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return PROFILER_SYMBOL_STRING; });
  1266. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return PROVIDER_NUMBER; });
  1267. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return PROVIDER_SYMBOL_STRING; });
  1268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return SCOPE_NUMBER; });
  1269. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return SCOPE_SYMBOL_STRING; });
  1270. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return STRICT_MODE_NUMBER; });
  1271. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return STRICT_MODE_SYMBOL_STRING; });
  1272. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return SUSPENSE_NUMBER; });
  1273. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return SUSPENSE_SYMBOL_STRING; });
  1274. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return SUSPENSE_LIST_NUMBER; });
  1275. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return SUSPENSE_LIST_SYMBOL_STRING; });
  1276. /* unused harmony export SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED_SYMBOL_STRING */
  1277. /**
  1278. * Copyright (c) Meta Platforms, Inc. and affiliates.
  1279. *
  1280. * This source code is licensed under the MIT license found in the
  1281. * LICENSE file in the root directory of this source tree.
  1282. *
  1283. *
  1284. */
  1285. // This list should be kept updated to reflect additions to 'shared/ReactSymbols'.
  1286. // DevTools can't import symbols from 'shared/ReactSymbols' directly for two reasons:
  1287. // 1. DevTools requires symbols which may have been deleted in more recent versions (e.g. concurrent mode)
  1288. // 2. DevTools must support both Symbol and numeric forms of each symbol;
  1289. // Since e.g. standalone DevTools runs in a separate process, it can't rely on its own ES capabilities.
  1290. var CONCURRENT_MODE_NUMBER = 0xeacf;
  1291. var CONCURRENT_MODE_SYMBOL_STRING = 'Symbol(react.concurrent_mode)';
  1292. var CONTEXT_NUMBER = 0xeace;
  1293. var CONTEXT_SYMBOL_STRING = 'Symbol(react.context)';
  1294. var SERVER_CONTEXT_SYMBOL_STRING = 'Symbol(react.server_context)';
  1295. var DEPRECATED_ASYNC_MODE_SYMBOL_STRING = 'Symbol(react.async_mode)';
  1296. var ELEMENT_NUMBER = 0xeac7;
  1297. var ELEMENT_SYMBOL_STRING = 'Symbol(react.element)';
  1298. var DEBUG_TRACING_MODE_NUMBER = 0xeae1;
  1299. var DEBUG_TRACING_MODE_SYMBOL_STRING = 'Symbol(react.debug_trace_mode)';
  1300. var FORWARD_REF_NUMBER = 0xead0;
  1301. var FORWARD_REF_SYMBOL_STRING = 'Symbol(react.forward_ref)';
  1302. var FRAGMENT_NUMBER = 0xeacb;
  1303. var FRAGMENT_SYMBOL_STRING = 'Symbol(react.fragment)';
  1304. var LAZY_NUMBER = 0xead4;
  1305. var LAZY_SYMBOL_STRING = 'Symbol(react.lazy)';
  1306. var MEMO_NUMBER = 0xead3;
  1307. var MEMO_SYMBOL_STRING = 'Symbol(react.memo)';
  1308. var PORTAL_NUMBER = 0xeaca;
  1309. var PORTAL_SYMBOL_STRING = 'Symbol(react.portal)';
  1310. var PROFILER_NUMBER = 0xead2;
  1311. var PROFILER_SYMBOL_STRING = 'Symbol(react.profiler)';
  1312. var PROVIDER_NUMBER = 0xeacd;
  1313. var PROVIDER_SYMBOL_STRING = 'Symbol(react.provider)';
  1314. var SCOPE_NUMBER = 0xead7;
  1315. var SCOPE_SYMBOL_STRING = 'Symbol(react.scope)';
  1316. var STRICT_MODE_NUMBER = 0xeacc;
  1317. var STRICT_MODE_SYMBOL_STRING = 'Symbol(react.strict_mode)';
  1318. var SUSPENSE_NUMBER = 0xead1;
  1319. var SUSPENSE_SYMBOL_STRING = 'Symbol(react.suspense)';
  1320. var SUSPENSE_LIST_NUMBER = 0xead8;
  1321. var SUSPENSE_LIST_SYMBOL_STRING = 'Symbol(react.suspense_list)';
  1322. var SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED_SYMBOL_STRING = 'Symbol(react.server_context.defaultValue)';
  1323. /***/ }),
  1324. /* 4 */
  1325. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1326. "use strict";
  1327. // EXPORTS
  1328. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ cleanForBridge; });
  1329. __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ copyToClipboard; });
  1330. __webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ copyWithDelete; });
  1331. __webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ copyWithRename; });
  1332. __webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ copyWithSet; });
  1333. __webpack_require__.d(__webpack_exports__, "h", function() { return /* binding */ getEffectDurations; });
  1334. __webpack_require__.d(__webpack_exports__, "g", function() { return /* binding */ formatWithStyles; });
  1335. __webpack_require__.d(__webpack_exports__, "f", function() { return /* binding */ format; });
  1336. __webpack_require__.d(__webpack_exports__, "k", function() { return /* binding */ isSynchronousXHRSupported; });
  1337. __webpack_require__.d(__webpack_exports__, "i", function() { return /* binding */ gt; });
  1338. __webpack_require__.d(__webpack_exports__, "j", function() { return /* binding */ gte; });
  1339. // UNUSED EXPORTS: serializeToString
  1340. // EXTERNAL MODULE: /Users/xch/dev/react/node_modules/clipboard-js/clipboard.js
  1341. var clipboard = __webpack_require__(18);
  1342. // CONCATENATED MODULE: /Users/xch/dev/react/node_modules/compare-versions/lib/esm/index.js
  1343. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1344. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  1345. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  1346. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  1347. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  1348. function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 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; }
  1349. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  1350. /**
  1351. * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
  1352. * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.
  1353. * @param v1 - First version to compare
  1354. * @param v2 - Second version to compare
  1355. * @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).
  1356. */
  1357. var compareVersions = function compareVersions(v1, v2) {
  1358. // validate input and split into segments
  1359. var n1 = validateAndParse(v1);
  1360. var n2 = validateAndParse(v2); // pop off the patch
  1361. var p1 = n1.pop();
  1362. var p2 = n2.pop(); // validate numbers
  1363. var r = compareSegments(n1, n2);
  1364. if (r !== 0) return r; // validate pre-release
  1365. if (p1 && p2) {
  1366. return compareSegments(p1.split('.'), p2.split('.'));
  1367. } else if (p1 || p2) {
  1368. return p1 ? -1 : 1;
  1369. }
  1370. return 0;
  1371. };
  1372. /**
  1373. * Validate [semver](https://semver.org/) version strings.
  1374. *
  1375. * @param version Version number to validate
  1376. * @returns `true` if the version number is a valid semver version number, `false` otherwise.
  1377. *
  1378. * @example
  1379. * ```
  1380. * validate('1.0.0-rc.1'); // return true
  1381. * validate('1.0-rc.1'); // return false
  1382. * validate('foo'); // return false
  1383. * ```
  1384. */
  1385. var validate = function validate(version) {
  1386. return typeof version === 'string' && /^[v\d]/.test(version) && semver.test(version);
  1387. };
  1388. /**
  1389. * Compare [semver](https://semver.org/) version strings using the specified operator.
  1390. *
  1391. * @param v1 First version to compare
  1392. * @param v2 Second version to compare
  1393. * @param operator Allowed arithmetic operator to use
  1394. * @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise.
  1395. *
  1396. * @example
  1397. * ```
  1398. * compare('10.1.8', '10.0.4', '>'); // return true
  1399. * compare('10.0.1', '10.0.1', '='); // return true
  1400. * compare('10.1.1', '10.2.2', '<'); // return true
  1401. * compare('10.1.1', '10.2.2', '<='); // return true
  1402. * compare('10.1.1', '10.2.2', '>='); // return false
  1403. * ```
  1404. */
  1405. var compare = function compare(v1, v2, operator) {
  1406. // validate input operator
  1407. assertValidOperator(operator); // since result of compareVersions can only be -1 or 0 or 1
  1408. // a simple map can be used to replace switch
  1409. var res = compareVersions(v1, v2);
  1410. return operatorResMap[operator].includes(res);
  1411. };
  1412. /**
  1413. * Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.
  1414. *
  1415. * @param version Version number to match
  1416. * @param range Range pattern for version
  1417. * @returns `true` if the version number is within the range, `false` otherwise.
  1418. *
  1419. * @example
  1420. * ```
  1421. * satisfies('1.1.0', '^1.0.0'); // return true
  1422. * satisfies('1.1.0', '~1.0.0'); // return false
  1423. * ```
  1424. */
  1425. var satisfies = function satisfies(version, range) {
  1426. // if no range operator then "="
  1427. var m = range.match(/^([<>=~^]+)/);
  1428. var op = m ? m[1] : '='; // if gt/lt/eq then operator compare
  1429. if (op !== '^' && op !== '~') return compare(version, range, op); // else range of either "~" or "^" is assumed
  1430. var _validateAndParse = validateAndParse(version),
  1431. _validateAndParse2 = _slicedToArray(_validateAndParse, 5),
  1432. v1 = _validateAndParse2[0],
  1433. v2 = _validateAndParse2[1],
  1434. v3 = _validateAndParse2[2],
  1435. vp = _validateAndParse2[4];
  1436. var _validateAndParse3 = validateAndParse(range),
  1437. _validateAndParse4 = _slicedToArray(_validateAndParse3, 5),
  1438. r1 = _validateAndParse4[0],
  1439. r2 = _validateAndParse4[1],
  1440. r3 = _validateAndParse4[2],
  1441. rp = _validateAndParse4[4];
  1442. var v = [v1, v2, v3];
  1443. var r = [r1, r2 !== null && r2 !== void 0 ? r2 : 'x', r3 !== null && r3 !== void 0 ? r3 : 'x']; // validate pre-release
  1444. if (rp) {
  1445. if (!vp) return false;
  1446. if (compareSegments(v, r) !== 0) return false;
  1447. if (compareSegments(vp.split('.'), rp.split('.')) === -1) return false;
  1448. } // first non-zero number
  1449. var nonZero = r.findIndex(function (v) {
  1450. return v !== '0';
  1451. }) + 1; // pointer to where segments can be >=
  1452. var i = op === '~' ? 2 : nonZero > 1 ? nonZero : 1; // before pointer must be equal
  1453. if (compareSegments(v.slice(0, i), r.slice(0, i)) !== 0) return false; // after pointer must be >=
  1454. if (compareSegments(v.slice(i), r.slice(i)) === -1) return false;
  1455. return true;
  1456. };
  1457. var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
  1458. var validateAndParse = function validateAndParse(version) {
  1459. if (typeof version !== 'string') {
  1460. throw new TypeError('Invalid argument expected string');
  1461. }
  1462. var match = version.match(semver);
  1463. if (!match) {
  1464. throw new Error("Invalid argument not valid semver ('".concat(version, "' received)"));
  1465. }
  1466. match.shift();
  1467. return match;
  1468. };
  1469. var isWildcard = function isWildcard(s) {
  1470. return s === '*' || s === 'x' || s === 'X';
  1471. };
  1472. var tryParse = function tryParse(v) {
  1473. var n = parseInt(v, 10);
  1474. return isNaN(n) ? v : n;
  1475. };
  1476. var forceType = function forceType(a, b) {
  1477. return _typeof(a) !== _typeof(b) ? [String(a), String(b)] : [a, b];
  1478. };
  1479. var compareStrings = function compareStrings(a, b) {
  1480. if (isWildcard(a) || isWildcard(b)) return 0;
  1481. var _forceType = forceType(tryParse(a), tryParse(b)),
  1482. _forceType2 = _slicedToArray(_forceType, 2),
  1483. ap = _forceType2[0],
  1484. bp = _forceType2[1];
  1485. if (ap > bp) return 1;
  1486. if (ap < bp) return -1;
  1487. return 0;
  1488. };
  1489. var compareSegments = function compareSegments(a, b) {
  1490. for (var i = 0; i < Math.max(a.length, b.length); i++) {
  1491. var r = compareStrings(a[i] || '0', b[i] || '0');
  1492. if (r !== 0) return r;
  1493. }
  1494. return 0;
  1495. };
  1496. var operatorResMap = {
  1497. '>': [1],
  1498. '>=': [0, 1],
  1499. '=': [0],
  1500. '<=': [-1, 0],
  1501. '<': [-1]
  1502. };
  1503. var allowedOperators = Object.keys(operatorResMap);
  1504. var assertValidOperator = function assertValidOperator(op) {
  1505. if (typeof op !== 'string') {
  1506. throw new TypeError("Invalid operator type, expected string but got ".concat(_typeof(op)));
  1507. }
  1508. if (allowedOperators.indexOf(op) === -1) {
  1509. throw new Error("Invalid operator, expected one of ".concat(allowedOperators.join('|')));
  1510. }
  1511. };
  1512. // EXTERNAL MODULE: ../react-devtools-shared/src/hydration.js
  1513. var hydration = __webpack_require__(10);
  1514. // EXTERNAL MODULE: ../shared/isArray.js
  1515. var isArray = __webpack_require__(9);
  1516. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/utils.js
  1517. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || utils_unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  1518. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  1519. function utils_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return utils_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return utils_arrayLikeToArray(o, minLen); }
  1520. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
  1521. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return utils_arrayLikeToArray(arr); }
  1522. function utils_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  1523. function utils_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { utils_typeof = function _typeof(obj) { return typeof obj; }; } else { utils_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return utils_typeof(obj); }
  1524. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  1525. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  1526. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  1527. /**
  1528. /**
  1529. * Copyright (c) Meta Platforms, Inc. and affiliates.
  1530. *
  1531. * This source code is licensed under the MIT license found in the
  1532. * LICENSE file in the root directory of this source tree.
  1533. *
  1534. *
  1535. */
  1536. function cleanForBridge(data, isPathAllowed) {
  1537. var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1538. if (data !== null) {
  1539. var cleanedPaths = [];
  1540. var unserializablePaths = [];
  1541. var cleanedData = Object(hydration["a" /* dehydrate */])(data, cleanedPaths, unserializablePaths, path, isPathAllowed);
  1542. return {
  1543. data: cleanedData,
  1544. cleaned: cleanedPaths,
  1545. unserializable: unserializablePaths
  1546. };
  1547. } else {
  1548. return null;
  1549. }
  1550. }
  1551. function copyToClipboard(value) {
  1552. var safeToCopy = serializeToString(value);
  1553. var text = safeToCopy === undefined ? 'undefined' : safeToCopy;
  1554. var clipboardCopyText = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.clipboardCopyText; // On Firefox navigator.clipboard.writeText has to be called from
  1555. // the content script js code (because it requires the clipboardWrite
  1556. // permission to be allowed out of a "user handling" callback),
  1557. // clipboardCopyText is an helper injected into the page from.
  1558. // injectGlobalHook.
  1559. if (typeof clipboardCopyText === 'function') {
  1560. clipboardCopyText(text).catch(function (err) {});
  1561. } else {
  1562. Object(clipboard["copy"])(text);
  1563. }
  1564. }
  1565. function copyWithDelete(obj, path) {
  1566. var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  1567. var key = path[index];
  1568. var updated = Object(isArray["a" /* default */])(obj) ? obj.slice() : _objectSpread({}, obj);
  1569. if (index + 1 === path.length) {
  1570. if (Object(isArray["a" /* default */])(updated)) {
  1571. updated.splice(key, 1);
  1572. } else {
  1573. delete updated[key];
  1574. }
  1575. } else {
  1576. // $FlowFixMe number or string is fine here
  1577. updated[key] = copyWithDelete(obj[key], path, index + 1);
  1578. }
  1579. return updated;
  1580. } // This function expects paths to be the same except for the final value.
  1581. // e.g. ['path', 'to', 'foo'] and ['path', 'to', 'bar']
  1582. function copyWithRename(obj, oldPath, newPath) {
  1583. var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  1584. var oldKey = oldPath[index];
  1585. var updated = Object(isArray["a" /* default */])(obj) ? obj.slice() : _objectSpread({}, obj);
  1586. if (index + 1 === oldPath.length) {
  1587. var newKey = newPath[index]; // $FlowFixMe number or string is fine here
  1588. updated[newKey] = updated[oldKey];
  1589. if (Object(isArray["a" /* default */])(updated)) {
  1590. updated.splice(oldKey, 1);
  1591. } else {
  1592. delete updated[oldKey];
  1593. }
  1594. } else {
  1595. // $FlowFixMe number or string is fine here
  1596. updated[oldKey] = copyWithRename(obj[oldKey], oldPath, newPath, index + 1);
  1597. }
  1598. return updated;
  1599. }
  1600. function copyWithSet(obj, path, value) {
  1601. var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  1602. if (index >= path.length) {
  1603. return value;
  1604. }
  1605. var key = path[index];
  1606. var updated = Object(isArray["a" /* default */])(obj) ? obj.slice() : _objectSpread({}, obj); // $FlowFixMe number or string is fine here
  1607. updated[key] = copyWithSet(obj[key], path, value, index + 1);
  1608. return updated;
  1609. }
  1610. function getEffectDurations(root) {
  1611. // Profiling durations are only available for certain builds.
  1612. // If available, they'll be stored on the HostRoot.
  1613. var effectDuration = null;
  1614. var passiveEffectDuration = null;
  1615. var hostRoot = root.current;
  1616. if (hostRoot != null) {
  1617. var stateNode = hostRoot.stateNode;
  1618. if (stateNode != null) {
  1619. effectDuration = stateNode.effectDuration != null ? stateNode.effectDuration : null;
  1620. passiveEffectDuration = stateNode.passiveEffectDuration != null ? stateNode.passiveEffectDuration : null;
  1621. }
  1622. }
  1623. return {
  1624. effectDuration: effectDuration,
  1625. passiveEffectDuration: passiveEffectDuration
  1626. };
  1627. }
  1628. function serializeToString(data) {
  1629. var cache = new Set(); // Use a custom replacer function to protect against circular references.
  1630. return JSON.stringify(data, function (key, value) {
  1631. if (utils_typeof(value) === 'object' && value !== null) {
  1632. if (cache.has(value)) {
  1633. return;
  1634. }
  1635. cache.add(value);
  1636. }
  1637. if (typeof value === 'bigint') {
  1638. return value.toString() + 'n';
  1639. }
  1640. return value;
  1641. });
  1642. } // Formats an array of args with a style for console methods, using
  1643. // the following algorithm:
  1644. // 1. The first param is a string that contains %c
  1645. // - Bail out and return the args without modifying the styles.
  1646. // We don't want to affect styles that the developer deliberately set.
  1647. // 2. The first param is a string that doesn't contain %c but contains
  1648. // string formatting
  1649. // - [`%c${args[0]}`, style, ...args.slice(1)]
  1650. // - Note: we assume that the string formatting that the developer uses
  1651. // is correct.
  1652. // 3. The first param is a string that doesn't contain string formatting
  1653. // OR is not a string
  1654. // - Create a formatting string where:
  1655. // boolean, string, symbol -> %s
  1656. // number -> %f OR %i depending on if it's an int or float
  1657. // default -> %o
  1658. function formatWithStyles(inputArgs, style) {
  1659. if (inputArgs === undefined || inputArgs === null || inputArgs.length === 0 || // Matches any of %c but not %%c
  1660. typeof inputArgs[0] === 'string' && inputArgs[0].match(/([^%]|^)(%c)/g) || style === undefined) {
  1661. return inputArgs;
  1662. } // Matches any of %(o|O|d|i|s|f), but not %%(o|O|d|i|s|f)
  1663. var REGEXP = /([^%]|^)((%%)*)(%([oOdisf]))/g;
  1664. if (typeof inputArgs[0] === 'string' && inputArgs[0].match(REGEXP)) {
  1665. return ["%c".concat(inputArgs[0]), style].concat(_toConsumableArray(inputArgs.slice(1)));
  1666. } else {
  1667. var firstArg = inputArgs.reduce(function (formatStr, elem, i) {
  1668. if (i > 0) {
  1669. formatStr += ' ';
  1670. }
  1671. switch (utils_typeof(elem)) {
  1672. case 'string':
  1673. case 'boolean':
  1674. case 'symbol':
  1675. return formatStr += '%s';
  1676. case 'number':
  1677. var formatting = Number.isInteger(elem) ? '%i' : '%f';
  1678. return formatStr += formatting;
  1679. default:
  1680. return formatStr += '%o';
  1681. }
  1682. }, '%c');
  1683. return [firstArg, style].concat(_toConsumableArray(inputArgs));
  1684. }
  1685. } // based on https://github.com/tmpfs/format-util/blob/0e62d430efb0a1c51448709abd3e2406c14d8401/format.js#L1
  1686. // based on https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions
  1687. // Implements s, d, i and f placeholders
  1688. // NOTE: KEEP IN SYNC with src/hook.js
  1689. function format(maybeMessage) {
  1690. for (var _len = arguments.length, inputArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1691. inputArgs[_key - 1] = arguments[_key];
  1692. }
  1693. var args = inputArgs.slice();
  1694. var formatted = String(maybeMessage); // If the first argument is a string, check for substitutions.
  1695. if (typeof maybeMessage === 'string') {
  1696. if (args.length) {
  1697. var REGEXP = /(%?)(%([jds]))/g;
  1698. formatted = formatted.replace(REGEXP, function (match, escaped, ptn, flag) {
  1699. var arg = args.shift();
  1700. switch (flag) {
  1701. case 's':
  1702. arg += '';
  1703. break;
  1704. case 'd':
  1705. case 'i':
  1706. arg = parseInt(arg, 10).toString();
  1707. break;
  1708. case 'f':
  1709. arg = parseFloat(arg).toString();
  1710. break;
  1711. }
  1712. if (!escaped) {
  1713. return arg;
  1714. }
  1715. args.unshift(arg);
  1716. return match;
  1717. });
  1718. }
  1719. } // Arguments that remain after formatting.
  1720. if (args.length) {
  1721. for (var i = 0; i < args.length; i++) {
  1722. formatted += ' ' + String(args[i]);
  1723. }
  1724. } // Update escaped %% values.
  1725. formatted = formatted.replace(/%{2,2}/g, '%');
  1726. return String(formatted);
  1727. }
  1728. function isSynchronousXHRSupported() {
  1729. return !!(window.document && window.document.featurePolicy && window.document.featurePolicy.allowsFeature('sync-xhr'));
  1730. }
  1731. function gt() {
  1732. var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  1733. var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  1734. return compareVersions(a, b) === 1;
  1735. }
  1736. function gte() {
  1737. var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  1738. var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  1739. return compareVersions(a, b) > -1;
  1740. }
  1741. /***/ }),
  1742. /* 5 */
  1743. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1744. "use strict";
  1745. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return localStorageGetItem; });
  1746. /* unused harmony export localStorageRemoveItem */
  1747. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return localStorageSetItem; });
  1748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return sessionStorageGetItem; });
  1749. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return sessionStorageRemoveItem; });
  1750. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return sessionStorageSetItem; });
  1751. /**
  1752. * Copyright (c) Meta Platforms, Inc. and affiliates.
  1753. *
  1754. * This source code is licensed under the MIT license found in the
  1755. * LICENSE file in the root directory of this source tree.
  1756. *
  1757. *
  1758. */
  1759. function localStorageGetItem(key) {
  1760. try {
  1761. return localStorage.getItem(key);
  1762. } catch (error) {
  1763. return null;
  1764. }
  1765. }
  1766. function localStorageRemoveItem(key) {
  1767. try {
  1768. localStorage.removeItem(key);
  1769. } catch (error) {}
  1770. }
  1771. function localStorageSetItem(key, value) {
  1772. try {
  1773. return localStorage.setItem(key, value);
  1774. } catch (error) {}
  1775. }
  1776. function sessionStorageGetItem(key) {
  1777. try {
  1778. return sessionStorage.getItem(key);
  1779. } catch (error) {
  1780. return null;
  1781. }
  1782. }
  1783. function sessionStorageRemoveItem(key) {
  1784. try {
  1785. sessionStorage.removeItem(key);
  1786. } catch (error) {}
  1787. }
  1788. function sessionStorageSetItem(key, value) {
  1789. try {
  1790. return sessionStorage.setItem(key, value);
  1791. } catch (error) {}
  1792. }
  1793. /***/ }),
  1794. /* 6 */
  1795. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1796. "use strict";
  1797. /**
  1798. * Copyright (c) Meta Platforms, Inc. and affiliates.
  1799. *
  1800. * This source code is licensed under the MIT license found in the
  1801. * LICENSE file in the root directory of this source tree.
  1802. *
  1803. *
  1804. */
  1805. var isArray = Array.isArray;
  1806. /* harmony default export */ __webpack_exports__["a"] = (isArray);
  1807. /***/ }),
  1808. /* 7 */
  1809. /***/ (function(module, exports, __webpack_require__) {
  1810. "use strict";
  1811. if (true) {
  1812. module.exports = __webpack_require__(25);
  1813. } else {}
  1814. /***/ }),
  1815. /* 8 */
  1816. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1817. "use strict";
  1818. /* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export isStringComponentStack */
  1819. /* unused harmony export dangerous_setTargetConsoleForTesting */
  1820. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return registerRenderer; });
  1821. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return patch; });
  1822. /* unused harmony export unpatch */
  1823. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return patchForStrictMode; });
  1824. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return unpatchForStrictMode; });
  1825. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return patchConsoleUsingWindowValues; });
  1826. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return writeConsolePatchSettingsToWindow; });
  1827. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
  1828. /* harmony import */ var _renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
  1829. /* harmony import */ var _DevToolsFiberComponentStack__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15);
  1830. /* harmony import */ var react_devtools_feature_flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11);
  1831. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(0);
  1832. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  1833. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  1834. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
  1835. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
  1836. function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  1837. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  1838. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  1839. /**
  1840. * Copyright (c) Meta Platforms, Inc. and affiliates.
  1841. *
  1842. * This source code is licensed under the MIT license found in the
  1843. * LICENSE file in the root directory of this source tree.
  1844. *
  1845. *
  1846. */
  1847. var OVERRIDE_CONSOLE_METHODS = ['error', 'trace', 'warn'];
  1848. var DIMMED_NODE_CONSOLE_COLOR = '\x1b[2m%s\x1b[0m'; // React's custom built component stack strings match "\s{4}in"
  1849. // Chrome's prefix matches "\s{4}at"
  1850. var PREFIX_REGEX = /\s{4}(in|at)\s{1}/; // Firefox and Safari have no prefix ("")
  1851. // but we can fallback to looking for location info (e.g. "foo.js:12:345")
  1852. var ROW_COLUMN_NUMBER_REGEX = /:\d+:\d+(\n|$)/;
  1853. function isStringComponentStack(text) {
  1854. return PREFIX_REGEX.test(text) || ROW_COLUMN_NUMBER_REGEX.test(text);
  1855. }
  1856. var STYLE_DIRECTIVE_REGEX = /^%c/; // This function tells whether or not the arguments for a console
  1857. // method has been overridden by the patchForStrictMode function.
  1858. // If it has we'll need to do some special formatting of the arguments
  1859. // so the console color stays consistent
  1860. function isStrictModeOverride(args, method) {
  1861. return args.length >= 2 && STYLE_DIRECTIVE_REGEX.test(args[0]) && args[1] === "color: ".concat(getConsoleColor(method) || '');
  1862. }
  1863. function getConsoleColor(method) {
  1864. switch (method) {
  1865. case 'warn':
  1866. return consoleSettingsRef.browserTheme === 'light' ? "rgba(250, 180, 50, 0.75)" : "rgba(250, 180, 50, 0.5)";
  1867. case 'error':
  1868. return consoleSettingsRef.browserTheme === 'light' ? "rgba(250, 123, 130, 0.75)" : "rgba(250, 123, 130, 0.5)";
  1869. case 'log':
  1870. default:
  1871. return consoleSettingsRef.browserTheme === 'light' ? "rgba(125, 125, 125, 0.75)" : "rgba(125, 125, 125, 0.5)";
  1872. }
  1873. }
  1874. var injectedRenderers = new Map();
  1875. var targetConsole = console;
  1876. var targetConsoleMethods = {};
  1877. for (var method in console) {
  1878. targetConsoleMethods[method] = console[method];
  1879. }
  1880. var unpatchFn = null;
  1881. var isNode = false;
  1882. try {
  1883. isNode = undefined === global;
  1884. } catch (error) {} // Enables e.g. Jest tests to inject a mock console object.
  1885. function dangerous_setTargetConsoleForTesting(targetConsoleForTesting) {
  1886. targetConsole = targetConsoleForTesting;
  1887. targetConsoleMethods = {};
  1888. for (var _method in targetConsole) {
  1889. targetConsoleMethods[_method] = console[_method];
  1890. }
  1891. } // v16 renderers should use this method to inject internals necessary to generate a component stack.
  1892. // These internals will be used if the console is patched.
  1893. // Injecting them separately allows the console to easily be patched or un-patched later (at runtime).
  1894. function registerRenderer(renderer, onErrorOrWarning) {
  1895. var currentDispatcherRef = renderer.currentDispatcherRef,
  1896. getCurrentFiber = renderer.getCurrentFiber,
  1897. findFiberByHostInstance = renderer.findFiberByHostInstance,
  1898. version = renderer.version; // Ignore React v15 and older because they don't expose a component stack anyway.
  1899. if (typeof findFiberByHostInstance !== 'function') {
  1900. return;
  1901. } // currentDispatcherRef gets injected for v16.8+ to support hooks inspection.
  1902. // getCurrentFiber gets injected for v16.9+.
  1903. if (currentDispatcherRef != null && typeof getCurrentFiber === 'function') {
  1904. var _getInternalReactCons = Object(_renderer__WEBPACK_IMPORTED_MODULE_1__[/* getInternalReactConstants */ "b"])(version),
  1905. ReactTypeOfWork = _getInternalReactCons.ReactTypeOfWork;
  1906. injectedRenderers.set(renderer, {
  1907. currentDispatcherRef: currentDispatcherRef,
  1908. getCurrentFiber: getCurrentFiber,
  1909. workTagMap: ReactTypeOfWork,
  1910. onErrorOrWarning: onErrorOrWarning
  1911. });
  1912. }
  1913. }
  1914. var consoleSettingsRef = {
  1915. appendComponentStack: false,
  1916. breakOnConsoleErrors: false,
  1917. showInlineWarningsAndErrors: false,
  1918. hideConsoleLogsInStrictMode: false,
  1919. browserTheme: 'dark'
  1920. };
  1921. // Patches console methods to append component stack for the current fiber.
  1922. // Call unpatch() to remove the injected behavior.
  1923. function patch(_ref) {
  1924. var appendComponentStack = _ref.appendComponentStack,
  1925. breakOnConsoleErrors = _ref.breakOnConsoleErrors,
  1926. showInlineWarningsAndErrors = _ref.showInlineWarningsAndErrors,
  1927. hideConsoleLogsInStrictMode = _ref.hideConsoleLogsInStrictMode,
  1928. browserTheme = _ref.browserTheme;
  1929. // Settings may change after we've patched the console.
  1930. // Using a shared ref allows the patch function to read the latest values.
  1931. consoleSettingsRef.appendComponentStack = appendComponentStack;
  1932. consoleSettingsRef.breakOnConsoleErrors = breakOnConsoleErrors;
  1933. consoleSettingsRef.showInlineWarningsAndErrors = showInlineWarningsAndErrors;
  1934. consoleSettingsRef.hideConsoleLogsInStrictMode = hideConsoleLogsInStrictMode;
  1935. consoleSettingsRef.browserTheme = browserTheme;
  1936. if (appendComponentStack || breakOnConsoleErrors || showInlineWarningsAndErrors) {
  1937. if (unpatchFn !== null) {
  1938. // Don't patch twice.
  1939. return;
  1940. }
  1941. var originalConsoleMethods = {};
  1942. unpatchFn = function unpatchFn() {
  1943. for (var _method2 in originalConsoleMethods) {
  1944. try {
  1945. targetConsole[_method2] = originalConsoleMethods[_method2];
  1946. } catch (error) {}
  1947. }
  1948. };
  1949. OVERRIDE_CONSOLE_METHODS.forEach(function (method) {
  1950. try {
  1951. var originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__ : targetConsole[method]; // $FlowFixMe[missing-local-annot]
  1952. var overrideMethod = function overrideMethod() {
  1953. var shouldAppendWarningStack = false;
  1954. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1955. args[_key] = arguments[_key];
  1956. }
  1957. if (method !== 'log') {
  1958. if (consoleSettingsRef.appendComponentStack) {
  1959. var lastArg = args.length > 0 ? args[args.length - 1] : null;
  1960. var alreadyHasComponentStack = typeof lastArg === 'string' && isStringComponentStack(lastArg); // If we are ever called with a string that already has a component stack,
  1961. // e.g. a React error/warning, don't append a second stack.
  1962. shouldAppendWarningStack = !alreadyHasComponentStack;
  1963. }
  1964. }
  1965. var shouldShowInlineWarningsAndErrors = consoleSettingsRef.showInlineWarningsAndErrors && (method === 'error' || method === 'warn'); // Search for the first renderer that has a current Fiber.
  1966. // We don't handle the edge case of stacks for more than one (e.g. interleaved renderers?)
  1967. // eslint-disable-next-line no-for-of-loops/no-for-of-loops
  1968. var _iterator = _createForOfIteratorHelper(injectedRenderers.values()),
  1969. _step;
  1970. try {
  1971. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  1972. var _step$value = _step.value,
  1973. currentDispatcherRef = _step$value.currentDispatcherRef,
  1974. getCurrentFiber = _step$value.getCurrentFiber,
  1975. onErrorOrWarning = _step$value.onErrorOrWarning,
  1976. workTagMap = _step$value.workTagMap;
  1977. var current = getCurrentFiber();
  1978. if (current != null) {
  1979. try {
  1980. if (shouldShowInlineWarningsAndErrors) {
  1981. // patch() is called by two places: (1) the hook and (2) the renderer backend.
  1982. // The backend is what implements a message queue, so it's the only one that injects onErrorOrWarning.
  1983. if (typeof onErrorOrWarning === 'function') {
  1984. onErrorOrWarning(current, method, // Copy args before we mutate them (e.g. adding the component stack)
  1985. args.slice());
  1986. }
  1987. }
  1988. if (shouldAppendWarningStack) {
  1989. var componentStack = Object(_DevToolsFiberComponentStack__WEBPACK_IMPORTED_MODULE_2__[/* getStackByFiberInDevAndProd */ "b"])(workTagMap, current, currentDispatcherRef);
  1990. if (componentStack !== '') {
  1991. if (isStrictModeOverride(args, method)) {
  1992. args[0] = "".concat(args[0], " %s");
  1993. args.push(componentStack);
  1994. } else {
  1995. args.push(componentStack);
  1996. }
  1997. }
  1998. }
  1999. } catch (error) {
  2000. // Don't let a DevTools or React internal error interfere with logging.
  2001. setTimeout(function () {
  2002. throw error;
  2003. }, 0);
  2004. } finally {
  2005. break;
  2006. }
  2007. }
  2008. }
  2009. } catch (err) {
  2010. _iterator.e(err);
  2011. } finally {
  2012. _iterator.f();
  2013. }
  2014. if (consoleSettingsRef.breakOnConsoleErrors) {
  2015. // --- Welcome to debugging with React DevTools ---
  2016. // This debugger statement means that you've enabled the "break on warnings" feature.
  2017. // Use the browser's Call Stack panel to step out of this override function-
  2018. // to where the original warning or error was logged.
  2019. // eslint-disable-next-line no-debugger
  2020. debugger;
  2021. }
  2022. originalMethod.apply(void 0, args);
  2023. };
  2024. overrideMethod.__REACT_DEVTOOLS_ORIGINAL_METHOD__ = originalMethod;
  2025. originalMethod.__REACT_DEVTOOLS_OVERRIDE_METHOD__ = overrideMethod;
  2026. targetConsole[method] = overrideMethod;
  2027. } catch (error) {}
  2028. });
  2029. } else {
  2030. unpatch();
  2031. }
  2032. } // Removed component stack patch from console methods.
  2033. function unpatch() {
  2034. if (unpatchFn !== null) {
  2035. unpatchFn();
  2036. unpatchFn = null;
  2037. }
  2038. }
  2039. var unpatchForStrictModeFn = null; // NOTE: KEEP IN SYNC with src/hook.js:patchConsoleForInitialRenderInStrictMode
  2040. function patchForStrictMode() {
  2041. if (react_devtools_feature_flags__WEBPACK_IMPORTED_MODULE_3__[/* consoleManagedByDevToolsDuringStrictMode */ "a"]) {
  2042. var overrideConsoleMethods = ['error', 'group', 'groupCollapsed', 'info', 'log', 'trace', 'warn'];
  2043. if (unpatchForStrictModeFn !== null) {
  2044. // Don't patch twice.
  2045. return;
  2046. }
  2047. var originalConsoleMethods = {};
  2048. unpatchForStrictModeFn = function unpatchForStrictModeFn() {
  2049. for (var _method3 in originalConsoleMethods) {
  2050. try {
  2051. targetConsole[_method3] = originalConsoleMethods[_method3];
  2052. } catch (error) {}
  2053. }
  2054. };
  2055. overrideConsoleMethods.forEach(function (method) {
  2056. try {
  2057. var originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ : targetConsole[method]; // $FlowFixMe[missing-local-annot]
  2058. var overrideMethod = function overrideMethod() {
  2059. if (!consoleSettingsRef.hideConsoleLogsInStrictMode) {
  2060. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  2061. args[_key2] = arguments[_key2];
  2062. }
  2063. // Dim the text color of the double logs if we're not
  2064. // hiding them.
  2065. if (isNode) {
  2066. originalMethod(DIMMED_NODE_CONSOLE_COLOR, _utils__WEBPACK_IMPORTED_MODULE_0__[/* format */ "f"].apply(void 0, args));
  2067. } else {
  2068. var color = getConsoleColor(method);
  2069. if (color) {
  2070. originalMethod.apply(void 0, _toConsumableArray(Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatWithStyles */ "g"])(args, "color: ".concat(color))));
  2071. } else {
  2072. throw Error('Console color is not defined');
  2073. }
  2074. }
  2075. }
  2076. };
  2077. overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod;
  2078. originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod;
  2079. targetConsole[method] = overrideMethod;
  2080. } catch (error) {}
  2081. });
  2082. }
  2083. } // NOTE: KEEP IN SYNC with src/hook.js:unpatchConsoleForInitialRenderInStrictMode
  2084. function unpatchForStrictMode() {
  2085. if (react_devtools_feature_flags__WEBPACK_IMPORTED_MODULE_3__[/* consoleManagedByDevToolsDuringStrictMode */ "a"]) {
  2086. if (unpatchForStrictModeFn !== null) {
  2087. unpatchForStrictModeFn();
  2088. unpatchForStrictModeFn = null;
  2089. }
  2090. }
  2091. }
  2092. function patchConsoleUsingWindowValues() {
  2093. var _castBool, _castBool2, _castBool3, _castBool4, _castBrowserTheme;
  2094. var appendComponentStack = (_castBool = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[/* castBool */ "a"])(window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__)) !== null && _castBool !== void 0 ? _castBool : true;
  2095. var breakOnConsoleErrors = (_castBool2 = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[/* castBool */ "a"])(window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__)) !== null && _castBool2 !== void 0 ? _castBool2 : false;
  2096. var showInlineWarningsAndErrors = (_castBool3 = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[/* castBool */ "a"])(window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__)) !== null && _castBool3 !== void 0 ? _castBool3 : true;
  2097. var hideConsoleLogsInStrictMode = (_castBool4 = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[/* castBool */ "a"])(window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__)) !== null && _castBool4 !== void 0 ? _castBool4 : false;
  2098. var browserTheme = (_castBrowserTheme = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[/* castBrowserTheme */ "b"])(window.__REACT_DEVTOOLS_BROWSER_THEME__)) !== null && _castBrowserTheme !== void 0 ? _castBrowserTheme : 'dark';
  2099. patch({
  2100. appendComponentStack: appendComponentStack,
  2101. breakOnConsoleErrors: breakOnConsoleErrors,
  2102. showInlineWarningsAndErrors: showInlineWarningsAndErrors,
  2103. hideConsoleLogsInStrictMode: hideConsoleLogsInStrictMode,
  2104. browserTheme: browserTheme
  2105. });
  2106. } // After receiving cached console patch settings from React Native, we set them on window.
  2107. // When the console is initially patched (in renderer.js and hook.js), these values are read.
  2108. // The browser extension (etc.) sets these values on window, but through another method.
  2109. function writeConsolePatchSettingsToWindow(settings) {
  2110. window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ = settings.appendComponentStack;
  2111. window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ = settings.breakOnConsoleErrors;
  2112. window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ = settings.showInlineWarningsAndErrors;
  2113. window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ = settings.hideConsoleLogsInStrictMode;
  2114. window.__REACT_DEVTOOLS_BROWSER_THEME__ = settings.browserTheme;
  2115. }
  2116. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(12)))
  2117. /***/ }),
  2118. /* 9 */
  2119. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2120. "use strict";
  2121. /**
  2122. * Copyright (c) Meta Platforms, Inc. and affiliates.
  2123. *
  2124. * This source code is licensed under the MIT license found in the
  2125. * LICENSE file in the root directory of this source tree.
  2126. *
  2127. *
  2128. */
  2129. var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
  2130. function isArray(a) {
  2131. return isArrayImpl(a);
  2132. }
  2133. /* harmony default export */ __webpack_exports__["a"] = (isArray);
  2134. /***/ }),
  2135. /* 10 */
  2136. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2137. "use strict";
  2138. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return meta; });
  2139. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return dehydrate; });
  2140. /* unused harmony export fillInPath */
  2141. /* unused harmony export hydrate */
  2142. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
  2143. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  2144. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  2145. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  2146. /**
  2147. * Copyright (c) Meta Platforms, Inc. and affiliates.
  2148. *
  2149. * This source code is licensed under the MIT license found in the
  2150. * LICENSE file in the root directory of this source tree.
  2151. *
  2152. *
  2153. */
  2154. var meta = {
  2155. inspectable: Symbol('inspectable'),
  2156. inspected: Symbol('inspected'),
  2157. name: Symbol('name'),
  2158. preview_long: Symbol('preview_long'),
  2159. preview_short: Symbol('preview_short'),
  2160. readonly: Symbol('readonly'),
  2161. size: Symbol('size'),
  2162. type: Symbol('type'),
  2163. unserializable: Symbol('unserializable')
  2164. };
  2165. // This threshold determines the depth at which the bridge "dehydrates" nested data.
  2166. // Dehydration means that we don't serialize the data for e.g. postMessage or stringify,
  2167. // unless the frontend explicitly requests it (e.g. a user clicks to expand a props object).
  2168. //
  2169. // Reducing this threshold will improve the speed of initial component inspection,
  2170. // but may decrease the responsiveness of expanding objects/arrays to inspect further.
  2171. var LEVEL_THRESHOLD = 2;
  2172. /**
  2173. * Generate the dehydrated metadata for complex object instances
  2174. */
  2175. function createDehydrated(type, inspectable, data, cleaned, path) {
  2176. cleaned.push(path);
  2177. var dehydrated = {
  2178. inspectable: inspectable,
  2179. type: type,
  2180. preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true),
  2181. preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false),
  2182. name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name
  2183. };
  2184. if (type === 'array' || type === 'typed_array') {
  2185. dehydrated.size = data.length;
  2186. } else if (type === 'object') {
  2187. dehydrated.size = Object.keys(data).length;
  2188. }
  2189. if (type === 'iterator' || type === 'typed_array') {
  2190. dehydrated.readonly = true;
  2191. }
  2192. return dehydrated;
  2193. }
  2194. /**
  2195. * Strip out complex data (instances, functions, and data nested > LEVEL_THRESHOLD levels deep).
  2196. * The paths of the stripped out objects are appended to the `cleaned` list.
  2197. * On the other side of the barrier, the cleaned list is used to "re-hydrate" the cleaned representation into
  2198. * an object with symbols as attributes, so that a sanitized object can be distinguished from a normal object.
  2199. *
  2200. * Input: {"some": {"attr": fn()}, "other": AnInstance}
  2201. * Output: {
  2202. * "some": {
  2203. * "attr": {"name": the fn.name, type: "function"}
  2204. * },
  2205. * "other": {
  2206. * "name": "AnInstance",
  2207. * "type": "object",
  2208. * },
  2209. * }
  2210. * and cleaned = [["some", "attr"], ["other"]]
  2211. */
  2212. function dehydrate(data, cleaned, unserializable, path, isPathAllowed) {
  2213. var level = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  2214. var type = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getDataType */ "f"])(data);
  2215. var isPathAllowedCheck;
  2216. switch (type) {
  2217. case 'html_element':
  2218. cleaned.push(path);
  2219. return {
  2220. inspectable: false,
  2221. preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false),
  2222. preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true),
  2223. name: data.tagName,
  2224. type: type
  2225. };
  2226. case 'function':
  2227. cleaned.push(path);
  2228. return {
  2229. inspectable: false,
  2230. preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false),
  2231. preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true),
  2232. name: typeof data.name === 'function' || !data.name ? 'function' : data.name,
  2233. type: type
  2234. };
  2235. case 'string':
  2236. isPathAllowedCheck = isPathAllowed(path);
  2237. if (isPathAllowedCheck) {
  2238. return data;
  2239. } else {
  2240. return data.length <= 500 ? data : data.slice(0, 500) + '...';
  2241. }
  2242. case 'bigint':
  2243. cleaned.push(path);
  2244. return {
  2245. inspectable: false,
  2246. preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false),
  2247. preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true),
  2248. name: data.toString(),
  2249. type: type
  2250. };
  2251. case 'symbol':
  2252. cleaned.push(path);
  2253. return {
  2254. inspectable: false,
  2255. preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false),
  2256. preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true),
  2257. name: data.toString(),
  2258. type: type
  2259. };
  2260. // React Elements aren't very inspector-friendly,
  2261. // and often contain private fields or circular references.
  2262. case 'react_element':
  2263. cleaned.push(path);
  2264. return {
  2265. inspectable: false,
  2266. preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false),
  2267. preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true),
  2268. name: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getDisplayNameForReactElement */ "i"])(data) || 'Unknown',
  2269. type: type
  2270. };
  2271. // ArrayBuffers error if you try to inspect them.
  2272. case 'array_buffer':
  2273. case 'data_view':
  2274. cleaned.push(path);
  2275. return {
  2276. inspectable: false,
  2277. preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false),
  2278. preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true),
  2279. name: type === 'data_view' ? 'DataView' : 'ArrayBuffer',
  2280. size: data.byteLength,
  2281. type: type
  2282. };
  2283. case 'array':
  2284. isPathAllowedCheck = isPathAllowed(path);
  2285. if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
  2286. return createDehydrated(type, true, data, cleaned, path);
  2287. }
  2288. return data.map(function (item, i) {
  2289. return dehydrate(item, cleaned, unserializable, path.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
  2290. });
  2291. case 'html_all_collection':
  2292. case 'typed_array':
  2293. case 'iterator':
  2294. isPathAllowedCheck = isPathAllowed(path);
  2295. if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
  2296. return createDehydrated(type, true, data, cleaned, path);
  2297. } else {
  2298. var unserializableValue = {
  2299. unserializable: true,
  2300. type: type,
  2301. readonly: true,
  2302. size: type === 'typed_array' ? data.length : undefined,
  2303. preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false),
  2304. preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true),
  2305. name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name
  2306. }; // TRICKY
  2307. // Don't use [...spread] syntax for this purpose.
  2308. // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values.
  2309. // Other types (e.g. typed arrays, Sets) will not spread correctly.
  2310. Array.from(data).forEach(function (item, i) {
  2311. return (// $FlowFixMe[prop-missing] Unserializable doesn't have an index signature
  2312. unserializableValue[i] = dehydrate(item, cleaned, unserializable, path.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1)
  2313. );
  2314. });
  2315. unserializable.push(path);
  2316. return unserializableValue;
  2317. }
  2318. case 'opaque_iterator':
  2319. cleaned.push(path);
  2320. return {
  2321. inspectable: false,
  2322. preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false),
  2323. preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true),
  2324. name: data[Symbol.toStringTag],
  2325. type: type
  2326. };
  2327. case 'date':
  2328. cleaned.push(path);
  2329. return {
  2330. inspectable: false,
  2331. preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false),
  2332. preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true),
  2333. name: data.toString(),
  2334. type: type
  2335. };
  2336. case 'regexp':
  2337. cleaned.push(path);
  2338. return {
  2339. inspectable: false,
  2340. preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false),
  2341. preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true),
  2342. name: data.toString(),
  2343. type: type
  2344. };
  2345. case 'object':
  2346. isPathAllowedCheck = isPathAllowed(path);
  2347. if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
  2348. return createDehydrated(type, true, data, cleaned, path);
  2349. } else {
  2350. var object = {};
  2351. Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getAllEnumerableKeys */ "e"])(data).forEach(function (key) {
  2352. var name = key.toString();
  2353. object[name] = dehydrate(data[key], cleaned, unserializable, path.concat([name]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
  2354. });
  2355. return object;
  2356. }
  2357. case 'infinity':
  2358. case 'nan':
  2359. case 'undefined':
  2360. // Some values are lossy when sent through a WebSocket.
  2361. // We dehydrate+rehydrate them to preserve their type.
  2362. cleaned.push(path);
  2363. return {
  2364. type: type
  2365. };
  2366. default:
  2367. return data;
  2368. }
  2369. }
  2370. function fillInPath(object, data, path, value) {
  2371. var target = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */ "j"])(object, path);
  2372. if (target != null) {
  2373. if (!target[meta.unserializable]) {
  2374. delete target[meta.inspectable];
  2375. delete target[meta.inspected];
  2376. delete target[meta.name];
  2377. delete target[meta.preview_long];
  2378. delete target[meta.preview_short];
  2379. delete target[meta.readonly];
  2380. delete target[meta.size];
  2381. delete target[meta.type];
  2382. }
  2383. }
  2384. if (value !== null && data.unserializable.length > 0) {
  2385. var unserializablePath = data.unserializable[0];
  2386. var isMatch = unserializablePath.length === path.length;
  2387. for (var i = 0; i < path.length; i++) {
  2388. if (path[i] !== unserializablePath[i]) {
  2389. isMatch = false;
  2390. break;
  2391. }
  2392. }
  2393. if (isMatch) {
  2394. upgradeUnserializable(value, value);
  2395. }
  2396. }
  2397. Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* setInObject */ "o"])(object, path, value);
  2398. }
  2399. function hydrate(object, cleaned, unserializable) {
  2400. cleaned.forEach(function (path) {
  2401. var length = path.length;
  2402. var last = path[length - 1];
  2403. var parent = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */ "j"])(object, path.slice(0, length - 1));
  2404. if (!parent || !parent.hasOwnProperty(last)) {
  2405. return;
  2406. }
  2407. var value = parent[last];
  2408. if (!value) {
  2409. return;
  2410. } else if (value.type === 'infinity') {
  2411. parent[last] = Infinity;
  2412. } else if (value.type === 'nan') {
  2413. parent[last] = NaN;
  2414. } else if (value.type === 'undefined') {
  2415. parent[last] = undefined;
  2416. } else {
  2417. // Replace the string keys with Symbols so they're non-enumerable.
  2418. var replaced = {};
  2419. replaced[meta.inspectable] = !!value.inspectable;
  2420. replaced[meta.inspected] = false;
  2421. replaced[meta.name] = value.name;
  2422. replaced[meta.preview_long] = value.preview_long;
  2423. replaced[meta.preview_short] = value.preview_short;
  2424. replaced[meta.size] = value.size;
  2425. replaced[meta.readonly] = !!value.readonly;
  2426. replaced[meta.type] = value.type;
  2427. parent[last] = replaced;
  2428. }
  2429. });
  2430. unserializable.forEach(function (path) {
  2431. var length = path.length;
  2432. var last = path[length - 1];
  2433. var parent = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */ "j"])(object, path.slice(0, length - 1));
  2434. if (!parent || !parent.hasOwnProperty(last)) {
  2435. return;
  2436. }
  2437. var node = parent[last];
  2438. var replacement = _objectSpread({}, node);
  2439. upgradeUnserializable(replacement, node);
  2440. parent[last] = replacement;
  2441. });
  2442. return object;
  2443. }
  2444. function upgradeUnserializable(destination, source) {
  2445. var _Object$definePropert;
  2446. Object.defineProperties(destination, (_Object$definePropert = {}, _defineProperty(_Object$definePropert, meta.inspected, {
  2447. configurable: true,
  2448. enumerable: false,
  2449. value: !!source.inspected
  2450. }), _defineProperty(_Object$definePropert, meta.name, {
  2451. configurable: true,
  2452. enumerable: false,
  2453. value: source.name
  2454. }), _defineProperty(_Object$definePropert, meta.preview_long, {
  2455. configurable: true,
  2456. enumerable: false,
  2457. value: source.preview_long
  2458. }), _defineProperty(_Object$definePropert, meta.preview_short, {
  2459. configurable: true,
  2460. enumerable: false,
  2461. value: source.preview_short
  2462. }), _defineProperty(_Object$definePropert, meta.size, {
  2463. configurable: true,
  2464. enumerable: false,
  2465. value: source.size
  2466. }), _defineProperty(_Object$definePropert, meta.readonly, {
  2467. configurable: true,
  2468. enumerable: false,
  2469. value: !!source.readonly
  2470. }), _defineProperty(_Object$definePropert, meta.type, {
  2471. configurable: true,
  2472. enumerable: false,
  2473. value: source.type
  2474. }), _defineProperty(_Object$definePropert, meta.unserializable, {
  2475. configurable: true,
  2476. enumerable: false,
  2477. value: !!source.unserializable
  2478. }), _Object$definePropert));
  2479. delete destination.inspected;
  2480. delete destination.name;
  2481. delete destination.preview_long;
  2482. delete destination.preview_short;
  2483. delete destination.size;
  2484. delete destination.readonly;
  2485. delete destination.type;
  2486. delete destination.unserializable;
  2487. }
  2488. /***/ }),
  2489. /* 11 */
  2490. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2491. "use strict";
  2492. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return consoleManagedByDevToolsDuringStrictMode; });
  2493. /* unused harmony export enableLogger */
  2494. /* unused harmony export enableNamedHooksFeature */
  2495. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return enableProfilerChangedHookIndices; });
  2496. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return enableStyleXFeatures; });
  2497. /* unused harmony export isInternalFacebookBuild */
  2498. /* unused harmony export enableProfilerComponentTree */
  2499. /**
  2500. * Copyright (c) Meta Platforms, Inc. and affiliates.
  2501. *
  2502. * This source code is licensed under the MIT license found in the
  2503. * LICENSE file in the root directory of this source tree.
  2504. *
  2505. *
  2506. */
  2507. /************************************************************************
  2508. * This file is forked between different DevTools implementations.
  2509. * It should never be imported directly!
  2510. * It should always be imported from "react-devtools-feature-flags".
  2511. ************************************************************************/
  2512. var consoleManagedByDevToolsDuringStrictMode = false;
  2513. var enableLogger = false;
  2514. var enableNamedHooksFeature = true;
  2515. var enableProfilerChangedHookIndices = true;
  2516. var enableStyleXFeatures = false;
  2517. var isInternalFacebookBuild = false;
  2518. var enableProfilerComponentTree = true;
  2519. /************************************************************************
  2520. * Do not edit the code below.
  2521. * It ensures this fork exports the same types as the default flags file.
  2522. ************************************************************************/
  2523. // Flow magic to verify the exports of this file match the original version.
  2524. null;
  2525. /***/ }),
  2526. /* 12 */
  2527. /***/ (function(module, exports) {
  2528. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2529. var g; // This works in non-strict mode
  2530. g = function () {
  2531. return this;
  2532. }();
  2533. try {
  2534. // This works if eval is allowed (see CSP)
  2535. g = g || new Function("return this")();
  2536. } catch (e) {
  2537. // This works if the window reference is available
  2538. if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
  2539. } // g can still be undefined, but nothing to do about it...
  2540. // We return undefined, instead of nothing here, so it's
  2541. // easier to handle this case. if(!global) { ...}
  2542. module.exports = g;
  2543. /***/ }),
  2544. /* 13 */
  2545. /***/ (function(module, exports, __webpack_require__) {
  2546. /* WEBPACK VAR INJECTION */(function(global) {function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2547. /**
  2548. * lodash (Custom Build) <https://lodash.com/>
  2549. * Build: `lodash modularize exports="npm" -o ./`
  2550. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  2551. * Released under MIT license <https://lodash.com/license>
  2552. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  2553. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  2554. */
  2555. /** Used as the `TypeError` message for "Functions" methods. */
  2556. var FUNC_ERROR_TEXT = 'Expected a function';
  2557. /** Used as references for various `Number` constants. */
  2558. var NAN = 0 / 0;
  2559. /** `Object#toString` result references. */
  2560. var symbolTag = '[object Symbol]';
  2561. /** Used to match leading and trailing whitespace. */
  2562. var reTrim = /^\s+|\s+$/g;
  2563. /** Used to detect bad signed hexadecimal string values. */
  2564. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  2565. /** Used to detect binary string values. */
  2566. var reIsBinary = /^0b[01]+$/i;
  2567. /** Used to detect octal string values. */
  2568. var reIsOctal = /^0o[0-7]+$/i;
  2569. /** Built-in method references without a dependency on `root`. */
  2570. var freeParseInt = parseInt;
  2571. /** Detect free variable `global` from Node.js. */
  2572. var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof(global)) == 'object' && global && global.Object === Object && global;
  2573. /** Detect free variable `self`. */
  2574. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  2575. /** Used as a reference to the global object. */
  2576. var root = freeGlobal || freeSelf || Function('return this')();
  2577. /** Used for built-in method references. */
  2578. var objectProto = Object.prototype;
  2579. /**
  2580. * Used to resolve the
  2581. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2582. * of values.
  2583. */
  2584. var objectToString = objectProto.toString;
  2585. /* Built-in method references for those with the same name as other `lodash` methods. */
  2586. var nativeMax = Math.max,
  2587. nativeMin = Math.min;
  2588. /**
  2589. * Gets the timestamp of the number of milliseconds that have elapsed since
  2590. * the Unix epoch (1 January 1970 00:00:00 UTC).
  2591. *
  2592. * @static
  2593. * @memberOf _
  2594. * @since 2.4.0
  2595. * @category Date
  2596. * @returns {number} Returns the timestamp.
  2597. * @example
  2598. *
  2599. * _.defer(function(stamp) {
  2600. * console.log(_.now() - stamp);
  2601. * }, _.now());
  2602. * // => Logs the number of milliseconds it took for the deferred invocation.
  2603. */
  2604. var now = function now() {
  2605. return root.Date.now();
  2606. };
  2607. /**
  2608. * Creates a debounced function that delays invoking `func` until after `wait`
  2609. * milliseconds have elapsed since the last time the debounced function was
  2610. * invoked. The debounced function comes with a `cancel` method to cancel
  2611. * delayed `func` invocations and a `flush` method to immediately invoke them.
  2612. * Provide `options` to indicate whether `func` should be invoked on the
  2613. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  2614. * with the last arguments provided to the debounced function. Subsequent
  2615. * calls to the debounced function return the result of the last `func`
  2616. * invocation.
  2617. *
  2618. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  2619. * invoked on the trailing edge of the timeout only if the debounced function
  2620. * is invoked more than once during the `wait` timeout.
  2621. *
  2622. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  2623. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  2624. *
  2625. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  2626. * for details over the differences between `_.debounce` and `_.throttle`.
  2627. *
  2628. * @static
  2629. * @memberOf _
  2630. * @since 0.1.0
  2631. * @category Function
  2632. * @param {Function} func The function to debounce.
  2633. * @param {number} [wait=0] The number of milliseconds to delay.
  2634. * @param {Object} [options={}] The options object.
  2635. * @param {boolean} [options.leading=false]
  2636. * Specify invoking on the leading edge of the timeout.
  2637. * @param {number} [options.maxWait]
  2638. * The maximum time `func` is allowed to be delayed before it's invoked.
  2639. * @param {boolean} [options.trailing=true]
  2640. * Specify invoking on the trailing edge of the timeout.
  2641. * @returns {Function} Returns the new debounced function.
  2642. * @example
  2643. *
  2644. * // Avoid costly calculations while the window size is in flux.
  2645. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  2646. *
  2647. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  2648. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  2649. * 'leading': true,
  2650. * 'trailing': false
  2651. * }));
  2652. *
  2653. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  2654. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  2655. * var source = new EventSource('/stream');
  2656. * jQuery(source).on('message', debounced);
  2657. *
  2658. * // Cancel the trailing debounced invocation.
  2659. * jQuery(window).on('popstate', debounced.cancel);
  2660. */
  2661. function debounce(func, wait, options) {
  2662. var lastArgs,
  2663. lastThis,
  2664. maxWait,
  2665. result,
  2666. timerId,
  2667. lastCallTime,
  2668. lastInvokeTime = 0,
  2669. leading = false,
  2670. maxing = false,
  2671. trailing = true;
  2672. if (typeof func != 'function') {
  2673. throw new TypeError(FUNC_ERROR_TEXT);
  2674. }
  2675. wait = toNumber(wait) || 0;
  2676. if (isObject(options)) {
  2677. leading = !!options.leading;
  2678. maxing = 'maxWait' in options;
  2679. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  2680. trailing = 'trailing' in options ? !!options.trailing : trailing;
  2681. }
  2682. function invokeFunc(time) {
  2683. var args = lastArgs,
  2684. thisArg = lastThis;
  2685. lastArgs = lastThis = undefined;
  2686. lastInvokeTime = time;
  2687. result = func.apply(thisArg, args);
  2688. return result;
  2689. }
  2690. function leadingEdge(time) {
  2691. // Reset any `maxWait` timer.
  2692. lastInvokeTime = time; // Start the timer for the trailing edge.
  2693. timerId = setTimeout(timerExpired, wait); // Invoke the leading edge.
  2694. return leading ? invokeFunc(time) : result;
  2695. }
  2696. function remainingWait(time) {
  2697. var timeSinceLastCall = time - lastCallTime,
  2698. timeSinceLastInvoke = time - lastInvokeTime,
  2699. result = wait - timeSinceLastCall;
  2700. return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
  2701. }
  2702. function shouldInvoke(time) {
  2703. var timeSinceLastCall = time - lastCallTime,
  2704. timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the
  2705. // trailing edge, the system time has gone backwards and we're treating
  2706. // it as the trailing edge, or we've hit the `maxWait` limit.
  2707. return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  2708. }
  2709. function timerExpired() {
  2710. var time = now();
  2711. if (shouldInvoke(time)) {
  2712. return trailingEdge(time);
  2713. } // Restart the timer.
  2714. timerId = setTimeout(timerExpired, remainingWait(time));
  2715. }
  2716. function trailingEdge(time) {
  2717. timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been
  2718. // debounced at least once.
  2719. if (trailing && lastArgs) {
  2720. return invokeFunc(time);
  2721. }
  2722. lastArgs = lastThis = undefined;
  2723. return result;
  2724. }
  2725. function cancel() {
  2726. if (timerId !== undefined) {
  2727. clearTimeout(timerId);
  2728. }
  2729. lastInvokeTime = 0;
  2730. lastArgs = lastCallTime = lastThis = timerId = undefined;
  2731. }
  2732. function flush() {
  2733. return timerId === undefined ? result : trailingEdge(now());
  2734. }
  2735. function debounced() {
  2736. var time = now(),
  2737. isInvoking = shouldInvoke(time);
  2738. lastArgs = arguments;
  2739. lastThis = this;
  2740. lastCallTime = time;
  2741. if (isInvoking) {
  2742. if (timerId === undefined) {
  2743. return leadingEdge(lastCallTime);
  2744. }
  2745. if (maxing) {
  2746. // Handle invocations in a tight loop.
  2747. timerId = setTimeout(timerExpired, wait);
  2748. return invokeFunc(lastCallTime);
  2749. }
  2750. }
  2751. if (timerId === undefined) {
  2752. timerId = setTimeout(timerExpired, wait);
  2753. }
  2754. return result;
  2755. }
  2756. debounced.cancel = cancel;
  2757. debounced.flush = flush;
  2758. return debounced;
  2759. }
  2760. /**
  2761. * Creates a throttled function that only invokes `func` at most once per
  2762. * every `wait` milliseconds. The throttled function comes with a `cancel`
  2763. * method to cancel delayed `func` invocations and a `flush` method to
  2764. * immediately invoke them. Provide `options` to indicate whether `func`
  2765. * should be invoked on the leading and/or trailing edge of the `wait`
  2766. * timeout. The `func` is invoked with the last arguments provided to the
  2767. * throttled function. Subsequent calls to the throttled function return the
  2768. * result of the last `func` invocation.
  2769. *
  2770. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  2771. * invoked on the trailing edge of the timeout only if the throttled function
  2772. * is invoked more than once during the `wait` timeout.
  2773. *
  2774. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  2775. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  2776. *
  2777. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  2778. * for details over the differences between `_.throttle` and `_.debounce`.
  2779. *
  2780. * @static
  2781. * @memberOf _
  2782. * @since 0.1.0
  2783. * @category Function
  2784. * @param {Function} func The function to throttle.
  2785. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  2786. * @param {Object} [options={}] The options object.
  2787. * @param {boolean} [options.leading=true]
  2788. * Specify invoking on the leading edge of the timeout.
  2789. * @param {boolean} [options.trailing=true]
  2790. * Specify invoking on the trailing edge of the timeout.
  2791. * @returns {Function} Returns the new throttled function.
  2792. * @example
  2793. *
  2794. * // Avoid excessively updating the position while scrolling.
  2795. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  2796. *
  2797. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  2798. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  2799. * jQuery(element).on('click', throttled);
  2800. *
  2801. * // Cancel the trailing throttled invocation.
  2802. * jQuery(window).on('popstate', throttled.cancel);
  2803. */
  2804. function throttle(func, wait, options) {
  2805. var leading = true,
  2806. trailing = true;
  2807. if (typeof func != 'function') {
  2808. throw new TypeError(FUNC_ERROR_TEXT);
  2809. }
  2810. if (isObject(options)) {
  2811. leading = 'leading' in options ? !!options.leading : leading;
  2812. trailing = 'trailing' in options ? !!options.trailing : trailing;
  2813. }
  2814. return debounce(func, wait, {
  2815. 'leading': leading,
  2816. 'maxWait': wait,
  2817. 'trailing': trailing
  2818. });
  2819. }
  2820. /**
  2821. * Checks if `value` is the
  2822. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2823. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2824. *
  2825. * @static
  2826. * @memberOf _
  2827. * @since 0.1.0
  2828. * @category Lang
  2829. * @param {*} value The value to check.
  2830. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2831. * @example
  2832. *
  2833. * _.isObject({});
  2834. * // => true
  2835. *
  2836. * _.isObject([1, 2, 3]);
  2837. * // => true
  2838. *
  2839. * _.isObject(_.noop);
  2840. * // => true
  2841. *
  2842. * _.isObject(null);
  2843. * // => false
  2844. */
  2845. function isObject(value) {
  2846. var type = _typeof(value);
  2847. return !!value && (type == 'object' || type == 'function');
  2848. }
  2849. /**
  2850. * Checks if `value` is object-like. A value is object-like if it's not `null`
  2851. * and has a `typeof` result of "object".
  2852. *
  2853. * @static
  2854. * @memberOf _
  2855. * @since 4.0.0
  2856. * @category Lang
  2857. * @param {*} value The value to check.
  2858. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  2859. * @example
  2860. *
  2861. * _.isObjectLike({});
  2862. * // => true
  2863. *
  2864. * _.isObjectLike([1, 2, 3]);
  2865. * // => true
  2866. *
  2867. * _.isObjectLike(_.noop);
  2868. * // => false
  2869. *
  2870. * _.isObjectLike(null);
  2871. * // => false
  2872. */
  2873. function isObjectLike(value) {
  2874. return !!value && _typeof(value) == 'object';
  2875. }
  2876. /**
  2877. * Checks if `value` is classified as a `Symbol` primitive or object.
  2878. *
  2879. * @static
  2880. * @memberOf _
  2881. * @since 4.0.0
  2882. * @category Lang
  2883. * @param {*} value The value to check.
  2884. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  2885. * @example
  2886. *
  2887. * _.isSymbol(Symbol.iterator);
  2888. * // => true
  2889. *
  2890. * _.isSymbol('abc');
  2891. * // => false
  2892. */
  2893. function isSymbol(value) {
  2894. return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
  2895. }
  2896. /**
  2897. * Converts `value` to a number.
  2898. *
  2899. * @static
  2900. * @memberOf _
  2901. * @since 4.0.0
  2902. * @category Lang
  2903. * @param {*} value The value to process.
  2904. * @returns {number} Returns the number.
  2905. * @example
  2906. *
  2907. * _.toNumber(3.2);
  2908. * // => 3.2
  2909. *
  2910. * _.toNumber(Number.MIN_VALUE);
  2911. * // => 5e-324
  2912. *
  2913. * _.toNumber(Infinity);
  2914. * // => Infinity
  2915. *
  2916. * _.toNumber('3.2');
  2917. * // => 3.2
  2918. */
  2919. function toNumber(value) {
  2920. if (typeof value == 'number') {
  2921. return value;
  2922. }
  2923. if (isSymbol(value)) {
  2924. return NAN;
  2925. }
  2926. if (isObject(value)) {
  2927. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  2928. value = isObject(other) ? other + '' : other;
  2929. }
  2930. if (typeof value != 'string') {
  2931. return value === 0 ? value : +value;
  2932. }
  2933. value = value.replace(reTrim, '');
  2934. var isBinary = reIsBinary.test(value);
  2935. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  2936. }
  2937. module.exports = throttle;
  2938. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(12)))
  2939. /***/ }),
  2940. /* 14 */
  2941. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2942. "use strict";
  2943. // EXPORTS
  2944. __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ getInternalReactConstants; });
  2945. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ attach; });
  2946. // EXTERNAL MODULE: ../react-devtools-shared/src/types.js
  2947. var types = __webpack_require__(1);
  2948. // EXTERNAL MODULE: ../react-devtools-shared/src/utils.js
  2949. var utils = __webpack_require__(0);
  2950. // EXTERNAL MODULE: ../react-devtools-shared/src/storage.js
  2951. var storage = __webpack_require__(5);
  2952. // EXTERNAL MODULE: ../react-devtools-shared/src/backend/utils.js + 1 modules
  2953. var backend_utils = __webpack_require__(4);
  2954. // EXTERNAL MODULE: ../react-devtools-shared/src/constants.js
  2955. var constants = __webpack_require__(2);
  2956. // EXTERNAL MODULE: /Users/xch/dev/react/build/oss-experimental/react-debug-tools/index.js
  2957. var react_debug_tools = __webpack_require__(20);
  2958. // EXTERNAL MODULE: ../react-devtools-shared/src/backend/console.js
  2959. var backend_console = __webpack_require__(8);
  2960. // EXTERNAL MODULE: ../react-devtools-shared/src/backend/ReactSymbols.js
  2961. var ReactSymbols = __webpack_require__(3);
  2962. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/ReactFiberFlags.js
  2963. /**
  2964. * Copyright (c) Meta Platforms, Inc. and affiliates.
  2965. *
  2966. * This source code is licensed under the MIT license found in the
  2967. * LICENSE file in the root directory of this source tree.
  2968. *
  2969. *
  2970. */
  2971. // This list of flags must be synced with the following file:
  2972. // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberFlags.js
  2973. var NoFlags =
  2974. /* */
  2975. 0;
  2976. var PerformedWork =
  2977. /* */
  2978. 1;
  2979. var Placement =
  2980. /* */
  2981. 2;
  2982. var DidCapture =
  2983. /* */
  2984. 128;
  2985. var Hydrating =
  2986. /* */
  2987. 4096;
  2988. // EXTERNAL MODULE: ../react-devtools-shared/src/config/DevToolsFeatureFlags.core-oss.js
  2989. var DevToolsFeatureFlags_core_oss = __webpack_require__(11);
  2990. // CONCATENATED MODULE: ../shared/objectIs.js
  2991. /**
  2992. * Copyright (c) Meta Platforms, Inc. and affiliates.
  2993. *
  2994. * This source code is licensed under the MIT license found in the
  2995. * LICENSE file in the root directory of this source tree.
  2996. *
  2997. *
  2998. */
  2999. /**
  3000. * inlined Object.is polyfill to avoid requiring consumers ship their own
  3001. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  3002. */
  3003. function is(x, y) {
  3004. return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
  3005. ;
  3006. }
  3007. var objectIs = // $FlowFixMe[method-unbinding]
  3008. typeof Object.is === 'function' ? Object.is : is;
  3009. /* harmony default export */ var shared_objectIs = (objectIs);
  3010. // CONCATENATED MODULE: ../shared/hasOwnProperty.js
  3011. /**
  3012. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3013. *
  3014. * This source code is licensed under the MIT license found in the
  3015. * LICENSE file in the root directory of this source tree.
  3016. *
  3017. *
  3018. */
  3019. // $FlowFixMe[method-unbinding]
  3020. var hasOwnProperty_hasOwnProperty = Object.prototype.hasOwnProperty;
  3021. /* harmony default export */ var shared_hasOwnProperty = (hasOwnProperty_hasOwnProperty);
  3022. // EXTERNAL MODULE: ../react-devtools-shared/src/isArray.js
  3023. var isArray = __webpack_require__(6);
  3024. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/StyleX/utils.js
  3025. /**
  3026. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3027. *
  3028. * This source code is licensed under the MIT license found in the
  3029. * LICENSE file in the root directory of this source tree.
  3030. *
  3031. *
  3032. */
  3033. var cachedStyleNameToValueMap = new Map();
  3034. function getStyleXData(data) {
  3035. var sources = new Set();
  3036. var resolvedStyles = {};
  3037. crawlData(data, sources, resolvedStyles);
  3038. return {
  3039. sources: Array.from(sources).sort(),
  3040. resolvedStyles: resolvedStyles
  3041. };
  3042. }
  3043. function crawlData(data, sources, resolvedStyles) {
  3044. if (data == null) {
  3045. return;
  3046. }
  3047. if (Object(isArray["a" /* default */])(data)) {
  3048. data.forEach(function (entry) {
  3049. if (entry == null) {
  3050. return;
  3051. }
  3052. if (Object(isArray["a" /* default */])(entry)) {
  3053. crawlData(entry, sources, resolvedStyles);
  3054. } else {
  3055. crawlObjectProperties(entry, sources, resolvedStyles);
  3056. }
  3057. });
  3058. } else {
  3059. crawlObjectProperties(data, sources, resolvedStyles);
  3060. }
  3061. resolvedStyles = Object.fromEntries(Object.entries(resolvedStyles).sort());
  3062. }
  3063. function crawlObjectProperties(entry, sources, resolvedStyles) {
  3064. var keys = Object.keys(entry);
  3065. keys.forEach(function (key) {
  3066. var value = entry[key];
  3067. if (typeof value === 'string') {
  3068. if (key === value) {
  3069. // Special case; this key is the name of the style's source/file/module.
  3070. sources.add(key);
  3071. } else {
  3072. resolvedStyles[key] = getPropertyValueForStyleName(value);
  3073. }
  3074. } else {
  3075. var nestedStyle = {};
  3076. resolvedStyles[key] = nestedStyle;
  3077. crawlData([value], sources, nestedStyle);
  3078. }
  3079. });
  3080. }
  3081. function getPropertyValueForStyleName(styleName) {
  3082. if (cachedStyleNameToValueMap.has(styleName)) {
  3083. return cachedStyleNameToValueMap.get(styleName);
  3084. }
  3085. for (var styleSheetIndex = 0; styleSheetIndex < document.styleSheets.length; styleSheetIndex++) {
  3086. var styleSheet = document.styleSheets[styleSheetIndex]; // $FlowFixMe Flow doesn't konw about these properties
  3087. var rules = styleSheet.rules || styleSheet.cssRules; // $FlowFixMe `rules` is mixed
  3088. for (var ruleIndex = 0; ruleIndex < rules.length; ruleIndex++) {
  3089. // $FlowFixMe `rules` is mixed
  3090. var rule = rules[ruleIndex]; // $FlowFixMe Flow doesn't konw about these properties
  3091. var cssText = rule.cssText,
  3092. selectorText = rule.selectorText,
  3093. style = rule.style;
  3094. if (selectorText != null) {
  3095. if (selectorText.startsWith(".".concat(styleName))) {
  3096. var match = cssText.match(/{ *([a-z\-]+):/);
  3097. if (match !== null) {
  3098. var property = match[1];
  3099. var value = style.getPropertyValue(property);
  3100. cachedStyleNameToValueMap.set(styleName, value);
  3101. return value;
  3102. } else {
  3103. return null;
  3104. }
  3105. }
  3106. }
  3107. }
  3108. }
  3109. return null;
  3110. }
  3111. // EXTERNAL MODULE: ../shared/isArray.js
  3112. var shared_isArray = __webpack_require__(9);
  3113. // CONCATENATED MODULE: ../react-devtools-timeline/src/constants.js
  3114. /**
  3115. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3116. *
  3117. * This source code is licensed under the MIT license found in the
  3118. * LICENSE file in the root directory of this source tree.
  3119. *
  3120. *
  3121. */
  3122. var REACT_TOTAL_NUM_LANES = 31; // Increment this number any time a backwards breaking change is made to the profiler metadata.
  3123. var SCHEDULING_PROFILER_VERSION = 1;
  3124. var SNAPSHOT_MAX_HEIGHT = 60;
  3125. // EXTERNAL MODULE: ../react-devtools-shared/src/backend/DevToolsFiberComponentStack.js + 2 modules
  3126. var DevToolsFiberComponentStack = __webpack_require__(15);
  3127. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/profilingHooks.js
  3128. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  3129. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  3130. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  3131. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  3132. function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 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; }
  3133. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  3134. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3135. /**
  3136. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3137. *
  3138. * This source code is licensed under the MIT license found in the
  3139. * LICENSE file in the root directory of this source tree.
  3140. *
  3141. *
  3142. */
  3143. // Add padding to the start/stop time of the profile.
  3144. // This makes the UI nicer to use.
  3145. var TIME_OFFSET = 10;
  3146. var performanceTarget = null; // If performance exists and supports the subset of the User Timing API that we require.
  3147. var supportsUserTiming = typeof performance !== 'undefined' && // $FlowFixMe[method-unbinding]
  3148. typeof performance.mark === 'function' && // $FlowFixMe[method-unbinding]
  3149. typeof performance.clearMarks === 'function';
  3150. var supportsUserTimingV3 = false;
  3151. if (supportsUserTiming) {
  3152. var CHECK_V3_MARK = '__v3';
  3153. var markOptions = {};
  3154. Object.defineProperty(markOptions, 'startTime', {
  3155. get: function get() {
  3156. supportsUserTimingV3 = true;
  3157. return 0;
  3158. },
  3159. set: function set() {}
  3160. });
  3161. try {
  3162. // $FlowFixMe: Flow expects the User Timing level 2 API.
  3163. performance.mark(CHECK_V3_MARK, markOptions);
  3164. } catch (error) {// Ignore
  3165. } finally {
  3166. performance.clearMarks(CHECK_V3_MARK);
  3167. }
  3168. }
  3169. if (supportsUserTimingV3) {
  3170. performanceTarget = performance;
  3171. } // Some environments (e.g. React Native / Hermes) don't support the performance API yet.
  3172. var getCurrentTime = // $FlowFixMe[method-unbinding]
  3173. (typeof performance === "undefined" ? "undefined" : _typeof(performance)) === 'object' && typeof performance.now === 'function' ? function () {
  3174. return performance.now();
  3175. } : function () {
  3176. return Date.now();
  3177. }; // Mocking the Performance Object (and User Timing APIs) for testing is fragile.
  3178. // This API allows tests to directly override the User Timing APIs.
  3179. function setPerformanceMock_ONLY_FOR_TESTING(performanceMock) {
  3180. performanceTarget = performanceMock;
  3181. supportsUserTiming = performanceMock !== null;
  3182. supportsUserTimingV3 = performanceMock !== null;
  3183. }
  3184. function createProfilingHooks(_ref) {
  3185. var getDisplayNameForFiber = _ref.getDisplayNameForFiber,
  3186. getIsProfiling = _ref.getIsProfiling,
  3187. getLaneLabelMap = _ref.getLaneLabelMap,
  3188. workTagMap = _ref.workTagMap,
  3189. currentDispatcherRef = _ref.currentDispatcherRef,
  3190. reactVersion = _ref.reactVersion;
  3191. var currentBatchUID = 0;
  3192. var currentReactComponentMeasure = null;
  3193. var currentReactMeasuresStack = [];
  3194. var currentTimelineData = null;
  3195. var currentFiberStacks = new Map();
  3196. var isProfiling = false;
  3197. var nextRenderShouldStartNewBatch = false;
  3198. function getRelativeTime() {
  3199. var currentTime = getCurrentTime();
  3200. if (currentTimelineData) {
  3201. if (currentTimelineData.startTime === 0) {
  3202. currentTimelineData.startTime = currentTime - TIME_OFFSET;
  3203. }
  3204. return currentTime - currentTimelineData.startTime;
  3205. }
  3206. return 0;
  3207. }
  3208. function getInternalModuleRanges() {
  3209. /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
  3210. if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges === 'function') {
  3211. // Ask the DevTools hook for module ranges that may have been reported by the current renderer(s).
  3212. // Don't do this eagerly like the laneToLabelMap,
  3213. // because some modules might not yet have registered their boundaries when the renderer is injected.
  3214. var ranges = __REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges(); // This check would not be required,
  3215. // except that it's possible for things to override __REACT_DEVTOOLS_GLOBAL_HOOK__.
  3216. if (Object(shared_isArray["a" /* default */])(ranges)) {
  3217. return ranges;
  3218. }
  3219. }
  3220. return null;
  3221. }
  3222. function getTimelineData() {
  3223. return currentTimelineData;
  3224. }
  3225. function laneToLanesArray(lanes) {
  3226. var lanesArray = [];
  3227. var lane = 1;
  3228. for (var index = 0; index < REACT_TOTAL_NUM_LANES; index++) {
  3229. if (lane & lanes) {
  3230. lanesArray.push(lane);
  3231. }
  3232. lane *= 2;
  3233. }
  3234. return lanesArray;
  3235. }
  3236. var laneToLabelMap = typeof getLaneLabelMap === 'function' ? getLaneLabelMap() : null;
  3237. function markMetadata() {
  3238. markAndClear("--react-version-".concat(reactVersion));
  3239. markAndClear("--profiler-version-".concat(SCHEDULING_PROFILER_VERSION));
  3240. var ranges = getInternalModuleRanges();
  3241. if (ranges) {
  3242. for (var i = 0; i < ranges.length; i++) {
  3243. var range = ranges[i];
  3244. if (Object(shared_isArray["a" /* default */])(range) && range.length === 2) {
  3245. var _ranges$i = _slicedToArray(ranges[i], 2),
  3246. startStackFrame = _ranges$i[0],
  3247. stopStackFrame = _ranges$i[1];
  3248. markAndClear("--react-internal-module-start-".concat(startStackFrame));
  3249. markAndClear("--react-internal-module-stop-".concat(stopStackFrame));
  3250. }
  3251. }
  3252. }
  3253. if (laneToLabelMap != null) {
  3254. var labels = Array.from(laneToLabelMap.values()).join(',');
  3255. markAndClear("--react-lane-labels-".concat(labels));
  3256. }
  3257. }
  3258. function markAndClear(markName) {
  3259. // This method won't be called unless these functions are defined, so we can skip the extra typeof check.
  3260. performanceTarget.mark(markName);
  3261. performanceTarget.clearMarks(markName);
  3262. }
  3263. function recordReactMeasureStarted(type, lanes) {
  3264. // Decide what depth thi work should be rendered at, based on what's on the top of the stack.
  3265. // It's okay to render over top of "idle" work but everything else should be on its own row.
  3266. var depth = 0;
  3267. if (currentReactMeasuresStack.length > 0) {
  3268. var top = currentReactMeasuresStack[currentReactMeasuresStack.length - 1];
  3269. depth = top.type === 'render-idle' ? top.depth : top.depth + 1;
  3270. }
  3271. var lanesArray = laneToLanesArray(lanes);
  3272. var reactMeasure = {
  3273. type: type,
  3274. batchUID: currentBatchUID,
  3275. depth: depth,
  3276. lanes: lanesArray,
  3277. timestamp: getRelativeTime(),
  3278. duration: 0
  3279. };
  3280. currentReactMeasuresStack.push(reactMeasure);
  3281. if (currentTimelineData) {
  3282. var _currentTimelineData = currentTimelineData,
  3283. batchUIDToMeasuresMap = _currentTimelineData.batchUIDToMeasuresMap,
  3284. laneToReactMeasureMap = _currentTimelineData.laneToReactMeasureMap;
  3285. var reactMeasures = batchUIDToMeasuresMap.get(currentBatchUID);
  3286. if (reactMeasures != null) {
  3287. reactMeasures.push(reactMeasure);
  3288. } else {
  3289. batchUIDToMeasuresMap.set(currentBatchUID, [reactMeasure]);
  3290. }
  3291. lanesArray.forEach(function (lane) {
  3292. reactMeasures = laneToReactMeasureMap.get(lane);
  3293. if (reactMeasures) {
  3294. reactMeasures.push(reactMeasure);
  3295. }
  3296. });
  3297. }
  3298. }
  3299. function recordReactMeasureCompleted(type) {
  3300. var currentTime = getRelativeTime();
  3301. if (currentReactMeasuresStack.length === 0) {
  3302. console.error('Unexpected type "%s" completed at %sms while currentReactMeasuresStack is empty.', type, currentTime); // Ignore work "completion" user timing mark that doesn't complete anything
  3303. return;
  3304. }
  3305. var top = currentReactMeasuresStack.pop();
  3306. if (top.type !== type) {
  3307. console.error('Unexpected type "%s" completed at %sms before "%s" completed.', type, currentTime, top.type);
  3308. } // $FlowFixMe This property should not be writable outside of this function.
  3309. top.duration = currentTime - top.timestamp;
  3310. if (currentTimelineData) {
  3311. currentTimelineData.duration = getRelativeTime() + TIME_OFFSET;
  3312. }
  3313. }
  3314. function markCommitStarted(lanes) {
  3315. if (isProfiling) {
  3316. recordReactMeasureStarted('commit', lanes); // TODO (timeline) Re-think this approach to "batching"; I don't think it works for Suspense or pre-rendering.
  3317. // This issue applies to the User Timing data also.
  3318. nextRenderShouldStartNewBatch = true;
  3319. }
  3320. if (supportsUserTimingV3) {
  3321. markAndClear("--commit-start-".concat(lanes)); // Some metadata only needs to be logged once per session,
  3322. // but if profiling information is being recorded via the Performance tab,
  3323. // DevTools has no way of knowing when the recording starts.
  3324. // Because of that, we log thie type of data periodically (once per commit).
  3325. markMetadata();
  3326. }
  3327. }
  3328. function markCommitStopped() {
  3329. if (isProfiling) {
  3330. recordReactMeasureCompleted('commit');
  3331. recordReactMeasureCompleted('render-idle');
  3332. }
  3333. if (supportsUserTimingV3) {
  3334. markAndClear('--commit-stop');
  3335. }
  3336. }
  3337. function markComponentRenderStarted(fiber) {
  3338. if (isProfiling || supportsUserTimingV3) {
  3339. var componentName = getDisplayNameForFiber(fiber) || 'Unknown';
  3340. if (isProfiling) {
  3341. // TODO (timeline) Record and cache component stack
  3342. if (isProfiling) {
  3343. currentReactComponentMeasure = {
  3344. componentName: componentName,
  3345. duration: 0,
  3346. timestamp: getRelativeTime(),
  3347. type: 'render',
  3348. warning: null
  3349. };
  3350. }
  3351. }
  3352. if (supportsUserTimingV3) {
  3353. markAndClear("--component-render-start-".concat(componentName));
  3354. }
  3355. }
  3356. }
  3357. function markComponentRenderStopped() {
  3358. if (isProfiling) {
  3359. if (currentReactComponentMeasure) {
  3360. if (currentTimelineData) {
  3361. currentTimelineData.componentMeasures.push(currentReactComponentMeasure);
  3362. } // $FlowFixMe[incompatible-use] found when upgrading Flow
  3363. currentReactComponentMeasure.duration = // $FlowFixMe[incompatible-use] found when upgrading Flow
  3364. getRelativeTime() - currentReactComponentMeasure.timestamp;
  3365. currentReactComponentMeasure = null;
  3366. }
  3367. }
  3368. if (supportsUserTimingV3) {
  3369. markAndClear('--component-render-stop');
  3370. }
  3371. }
  3372. function markComponentLayoutEffectMountStarted(fiber) {
  3373. if (isProfiling || supportsUserTimingV3) {
  3374. var componentName = getDisplayNameForFiber(fiber) || 'Unknown';
  3375. if (isProfiling) {
  3376. // TODO (timeline) Record and cache component stack
  3377. if (isProfiling) {
  3378. currentReactComponentMeasure = {
  3379. componentName: componentName,
  3380. duration: 0,
  3381. timestamp: getRelativeTime(),
  3382. type: 'layout-effect-mount',
  3383. warning: null
  3384. };
  3385. }
  3386. }
  3387. if (supportsUserTimingV3) {
  3388. markAndClear("--component-layout-effect-mount-start-".concat(componentName));
  3389. }
  3390. }
  3391. }
  3392. function markComponentLayoutEffectMountStopped() {
  3393. if (isProfiling) {
  3394. if (currentReactComponentMeasure) {
  3395. if (currentTimelineData) {
  3396. currentTimelineData.componentMeasures.push(currentReactComponentMeasure);
  3397. } // $FlowFixMe[incompatible-use] found when upgrading Flow
  3398. currentReactComponentMeasure.duration = // $FlowFixMe[incompatible-use] found when upgrading Flow
  3399. getRelativeTime() - currentReactComponentMeasure.timestamp;
  3400. currentReactComponentMeasure = null;
  3401. }
  3402. }
  3403. if (supportsUserTimingV3) {
  3404. markAndClear('--component-layout-effect-mount-stop');
  3405. }
  3406. }
  3407. function markComponentLayoutEffectUnmountStarted(fiber) {
  3408. if (isProfiling || supportsUserTimingV3) {
  3409. var componentName = getDisplayNameForFiber(fiber) || 'Unknown';
  3410. if (isProfiling) {
  3411. // TODO (timeline) Record and cache component stack
  3412. if (isProfiling) {
  3413. currentReactComponentMeasure = {
  3414. componentName: componentName,
  3415. duration: 0,
  3416. timestamp: getRelativeTime(),
  3417. type: 'layout-effect-unmount',
  3418. warning: null
  3419. };
  3420. }
  3421. }
  3422. if (supportsUserTimingV3) {
  3423. markAndClear("--component-layout-effect-unmount-start-".concat(componentName));
  3424. }
  3425. }
  3426. }
  3427. function markComponentLayoutEffectUnmountStopped() {
  3428. if (isProfiling) {
  3429. if (currentReactComponentMeasure) {
  3430. if (currentTimelineData) {
  3431. currentTimelineData.componentMeasures.push(currentReactComponentMeasure);
  3432. } // $FlowFixMe[incompatible-use] found when upgrading Flow
  3433. currentReactComponentMeasure.duration = // $FlowFixMe[incompatible-use] found when upgrading Flow
  3434. getRelativeTime() - currentReactComponentMeasure.timestamp;
  3435. currentReactComponentMeasure = null;
  3436. }
  3437. }
  3438. if (supportsUserTimingV3) {
  3439. markAndClear('--component-layout-effect-unmount-stop');
  3440. }
  3441. }
  3442. function markComponentPassiveEffectMountStarted(fiber) {
  3443. if (isProfiling || supportsUserTimingV3) {
  3444. var componentName = getDisplayNameForFiber(fiber) || 'Unknown';
  3445. if (isProfiling) {
  3446. // TODO (timeline) Record and cache component stack
  3447. if (isProfiling) {
  3448. currentReactComponentMeasure = {
  3449. componentName: componentName,
  3450. duration: 0,
  3451. timestamp: getRelativeTime(),
  3452. type: 'passive-effect-mount',
  3453. warning: null
  3454. };
  3455. }
  3456. }
  3457. if (supportsUserTimingV3) {
  3458. markAndClear("--component-passive-effect-mount-start-".concat(componentName));
  3459. }
  3460. }
  3461. }
  3462. function markComponentPassiveEffectMountStopped() {
  3463. if (isProfiling) {
  3464. if (currentReactComponentMeasure) {
  3465. if (currentTimelineData) {
  3466. currentTimelineData.componentMeasures.push(currentReactComponentMeasure);
  3467. } // $FlowFixMe[incompatible-use] found when upgrading Flow
  3468. currentReactComponentMeasure.duration = // $FlowFixMe[incompatible-use] found when upgrading Flow
  3469. getRelativeTime() - currentReactComponentMeasure.timestamp;
  3470. currentReactComponentMeasure = null;
  3471. }
  3472. }
  3473. if (supportsUserTimingV3) {
  3474. markAndClear('--component-passive-effect-mount-stop');
  3475. }
  3476. }
  3477. function markComponentPassiveEffectUnmountStarted(fiber) {
  3478. if (isProfiling || supportsUserTimingV3) {
  3479. var componentName = getDisplayNameForFiber(fiber) || 'Unknown';
  3480. if (isProfiling) {
  3481. // TODO (timeline) Record and cache component stack
  3482. if (isProfiling) {
  3483. currentReactComponentMeasure = {
  3484. componentName: componentName,
  3485. duration: 0,
  3486. timestamp: getRelativeTime(),
  3487. type: 'passive-effect-unmount',
  3488. warning: null
  3489. };
  3490. }
  3491. }
  3492. if (supportsUserTimingV3) {
  3493. markAndClear("--component-passive-effect-unmount-start-".concat(componentName));
  3494. }
  3495. }
  3496. }
  3497. function markComponentPassiveEffectUnmountStopped() {
  3498. if (isProfiling) {
  3499. if (currentReactComponentMeasure) {
  3500. if (currentTimelineData) {
  3501. currentTimelineData.componentMeasures.push(currentReactComponentMeasure);
  3502. } // $FlowFixMe[incompatible-use] found when upgrading Flow
  3503. currentReactComponentMeasure.duration = // $FlowFixMe[incompatible-use] found when upgrading Flow
  3504. getRelativeTime() - currentReactComponentMeasure.timestamp;
  3505. currentReactComponentMeasure = null;
  3506. }
  3507. }
  3508. if (supportsUserTimingV3) {
  3509. markAndClear('--component-passive-effect-unmount-stop');
  3510. }
  3511. }
  3512. function markComponentErrored(fiber, thrownValue, lanes) {
  3513. if (isProfiling || supportsUserTimingV3) {
  3514. var componentName = getDisplayNameForFiber(fiber) || 'Unknown';
  3515. var phase = fiber.alternate === null ? 'mount' : 'update';
  3516. var message = '';
  3517. if (thrownValue !== null && _typeof(thrownValue) === 'object' && typeof thrownValue.message === 'string') {
  3518. message = thrownValue.message;
  3519. } else if (typeof thrownValue === 'string') {
  3520. message = thrownValue;
  3521. }
  3522. if (isProfiling) {
  3523. // TODO (timeline) Record and cache component stack
  3524. if (currentTimelineData) {
  3525. currentTimelineData.thrownErrors.push({
  3526. componentName: componentName,
  3527. message: message,
  3528. phase: phase,
  3529. timestamp: getRelativeTime(),
  3530. type: 'thrown-error'
  3531. });
  3532. }
  3533. }
  3534. if (supportsUserTimingV3) {
  3535. markAndClear("--error-".concat(componentName, "-").concat(phase, "-").concat(message));
  3536. }
  3537. }
  3538. }
  3539. var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // $FlowFixMe: Flow cannot handle polymorphic WeakMaps
  3540. var wakeableIDs = new PossiblyWeakMap();
  3541. var wakeableID = 0;
  3542. function getWakeableID(wakeable) {
  3543. if (!wakeableIDs.has(wakeable)) {
  3544. wakeableIDs.set(wakeable, wakeableID++);
  3545. }
  3546. return wakeableIDs.get(wakeable);
  3547. }
  3548. function markComponentSuspended(fiber, wakeable, lanes) {
  3549. if (isProfiling || supportsUserTimingV3) {
  3550. var eventType = wakeableIDs.has(wakeable) ? 'resuspend' : 'suspend';
  3551. var id = getWakeableID(wakeable);
  3552. var componentName = getDisplayNameForFiber(fiber) || 'Unknown';
  3553. var phase = fiber.alternate === null ? 'mount' : 'update'; // Following the non-standard fn.displayName convention,
  3554. // frameworks like Relay may also annotate Promises with a displayName,
  3555. // describing what operation/data the thrown Promise is related to.
  3556. // When this is available we should pass it along to the Timeline.
  3557. var displayName = wakeable.displayName || '';
  3558. var suspenseEvent = null;
  3559. if (isProfiling) {
  3560. // TODO (timeline) Record and cache component stack
  3561. suspenseEvent = {
  3562. componentName: componentName,
  3563. depth: 0,
  3564. duration: 0,
  3565. id: "".concat(id),
  3566. phase: phase,
  3567. promiseName: displayName,
  3568. resolution: 'unresolved',
  3569. timestamp: getRelativeTime(),
  3570. type: 'suspense',
  3571. warning: null
  3572. };
  3573. if (currentTimelineData) {
  3574. currentTimelineData.suspenseEvents.push(suspenseEvent);
  3575. }
  3576. }
  3577. if (supportsUserTimingV3) {
  3578. markAndClear("--suspense-".concat(eventType, "-").concat(id, "-").concat(componentName, "-").concat(phase, "-").concat(lanes, "-").concat(displayName));
  3579. }
  3580. wakeable.then(function () {
  3581. if (suspenseEvent) {
  3582. suspenseEvent.duration = getRelativeTime() - suspenseEvent.timestamp;
  3583. suspenseEvent.resolution = 'resolved';
  3584. }
  3585. if (supportsUserTimingV3) {
  3586. markAndClear("--suspense-resolved-".concat(id, "-").concat(componentName));
  3587. }
  3588. }, function () {
  3589. if (suspenseEvent) {
  3590. suspenseEvent.duration = getRelativeTime() - suspenseEvent.timestamp;
  3591. suspenseEvent.resolution = 'rejected';
  3592. }
  3593. if (supportsUserTimingV3) {
  3594. markAndClear("--suspense-rejected-".concat(id, "-").concat(componentName));
  3595. }
  3596. });
  3597. }
  3598. }
  3599. function markLayoutEffectsStarted(lanes) {
  3600. if (isProfiling) {
  3601. recordReactMeasureStarted('layout-effects', lanes);
  3602. }
  3603. if (supportsUserTimingV3) {
  3604. markAndClear("--layout-effects-start-".concat(lanes));
  3605. }
  3606. }
  3607. function markLayoutEffectsStopped() {
  3608. if (isProfiling) {
  3609. recordReactMeasureCompleted('layout-effects');
  3610. }
  3611. if (supportsUserTimingV3) {
  3612. markAndClear('--layout-effects-stop');
  3613. }
  3614. }
  3615. function markPassiveEffectsStarted(lanes) {
  3616. if (isProfiling) {
  3617. recordReactMeasureStarted('passive-effects', lanes);
  3618. }
  3619. if (supportsUserTimingV3) {
  3620. markAndClear("--passive-effects-start-".concat(lanes));
  3621. }
  3622. }
  3623. function markPassiveEffectsStopped() {
  3624. if (isProfiling) {
  3625. recordReactMeasureCompleted('passive-effects');
  3626. }
  3627. if (supportsUserTimingV3) {
  3628. markAndClear('--passive-effects-stop');
  3629. }
  3630. }
  3631. function markRenderStarted(lanes) {
  3632. if (isProfiling) {
  3633. if (nextRenderShouldStartNewBatch) {
  3634. nextRenderShouldStartNewBatch = false;
  3635. currentBatchUID++;
  3636. } // If this is a new batch of work, wrap an "idle" measure around it.
  3637. // Log it before the "render" measure to preserve the stack ordering.
  3638. if (currentReactMeasuresStack.length === 0 || currentReactMeasuresStack[currentReactMeasuresStack.length - 1].type !== 'render-idle') {
  3639. recordReactMeasureStarted('render-idle', lanes);
  3640. }
  3641. recordReactMeasureStarted('render', lanes);
  3642. }
  3643. if (supportsUserTimingV3) {
  3644. markAndClear("--render-start-".concat(lanes));
  3645. }
  3646. }
  3647. function markRenderYielded() {
  3648. if (isProfiling) {
  3649. recordReactMeasureCompleted('render');
  3650. }
  3651. if (supportsUserTimingV3) {
  3652. markAndClear('--render-yield');
  3653. }
  3654. }
  3655. function markRenderStopped() {
  3656. if (isProfiling) {
  3657. recordReactMeasureCompleted('render');
  3658. }
  3659. if (supportsUserTimingV3) {
  3660. markAndClear('--render-stop');
  3661. }
  3662. }
  3663. function markRenderScheduled(lane) {
  3664. if (isProfiling) {
  3665. if (currentTimelineData) {
  3666. currentTimelineData.schedulingEvents.push({
  3667. lanes: laneToLanesArray(lane),
  3668. timestamp: getRelativeTime(),
  3669. type: 'schedule-render',
  3670. warning: null
  3671. });
  3672. }
  3673. }
  3674. if (supportsUserTimingV3) {
  3675. markAndClear("--schedule-render-".concat(lane));
  3676. }
  3677. }
  3678. function markForceUpdateScheduled(fiber, lane) {
  3679. if (isProfiling || supportsUserTimingV3) {
  3680. var componentName = getDisplayNameForFiber(fiber) || 'Unknown';
  3681. if (isProfiling) {
  3682. // TODO (timeline) Record and cache component stack
  3683. if (currentTimelineData) {
  3684. currentTimelineData.schedulingEvents.push({
  3685. componentName: componentName,
  3686. lanes: laneToLanesArray(lane),
  3687. timestamp: getRelativeTime(),
  3688. type: 'schedule-force-update',
  3689. warning: null
  3690. });
  3691. }
  3692. }
  3693. if (supportsUserTimingV3) {
  3694. markAndClear("--schedule-forced-update-".concat(lane, "-").concat(componentName));
  3695. }
  3696. }
  3697. }
  3698. function getParentFibers(fiber) {
  3699. var parents = [];
  3700. var parent = fiber;
  3701. while (parent !== null) {
  3702. parents.push(parent);
  3703. parent = parent.return;
  3704. }
  3705. return parents;
  3706. }
  3707. function markStateUpdateScheduled(fiber, lane) {
  3708. if (isProfiling || supportsUserTimingV3) {
  3709. var componentName = getDisplayNameForFiber(fiber) || 'Unknown';
  3710. if (isProfiling) {
  3711. // TODO (timeline) Record and cache component stack
  3712. if (currentTimelineData) {
  3713. var event = {
  3714. componentName: componentName,
  3715. // Store the parent fibers so we can post process
  3716. // them after we finish profiling
  3717. lanes: laneToLanesArray(lane),
  3718. timestamp: getRelativeTime(),
  3719. type: 'schedule-state-update',
  3720. warning: null
  3721. };
  3722. currentFiberStacks.set(event, getParentFibers(fiber)); // $FlowFixMe[incompatible-use] found when upgrading Flow
  3723. currentTimelineData.schedulingEvents.push(event);
  3724. }
  3725. }
  3726. if (supportsUserTimingV3) {
  3727. markAndClear("--schedule-state-update-".concat(lane, "-").concat(componentName));
  3728. }
  3729. }
  3730. }
  3731. function toggleProfilingStatus(value) {
  3732. if (isProfiling !== value) {
  3733. isProfiling = value;
  3734. if (isProfiling) {
  3735. var internalModuleSourceToRanges = new Map();
  3736. if (supportsUserTimingV3) {
  3737. var ranges = getInternalModuleRanges();
  3738. if (ranges) {
  3739. for (var i = 0; i < ranges.length; i++) {
  3740. var range = ranges[i];
  3741. if (Object(shared_isArray["a" /* default */])(range) && range.length === 2) {
  3742. var _ranges$i2 = _slicedToArray(ranges[i], 2),
  3743. startStackFrame = _ranges$i2[0],
  3744. stopStackFrame = _ranges$i2[1];
  3745. markAndClear("--react-internal-module-start-".concat(startStackFrame));
  3746. markAndClear("--react-internal-module-stop-".concat(stopStackFrame));
  3747. }
  3748. }
  3749. }
  3750. }
  3751. var laneToReactMeasureMap = new Map();
  3752. var lane = 1;
  3753. for (var index = 0; index < REACT_TOTAL_NUM_LANES; index++) {
  3754. laneToReactMeasureMap.set(lane, []);
  3755. lane *= 2;
  3756. }
  3757. currentBatchUID = 0;
  3758. currentReactComponentMeasure = null;
  3759. currentReactMeasuresStack = [];
  3760. currentFiberStacks = new Map();
  3761. currentTimelineData = {
  3762. // Session wide metadata; only collected once.
  3763. internalModuleSourceToRanges: internalModuleSourceToRanges,
  3764. laneToLabelMap: laneToLabelMap || new Map(),
  3765. reactVersion: reactVersion,
  3766. // Data logged by React during profiling session.
  3767. componentMeasures: [],
  3768. schedulingEvents: [],
  3769. suspenseEvents: [],
  3770. thrownErrors: [],
  3771. // Data inferred based on what React logs.
  3772. batchUIDToMeasuresMap: new Map(),
  3773. duration: 0,
  3774. laneToReactMeasureMap: laneToReactMeasureMap,
  3775. startTime: 0,
  3776. // Data only available in Chrome profiles.
  3777. flamechart: [],
  3778. nativeEvents: [],
  3779. networkMeasures: [],
  3780. otherUserTimingMarks: [],
  3781. snapshots: [],
  3782. snapshotHeight: 0
  3783. };
  3784. nextRenderShouldStartNewBatch = true;
  3785. } else {
  3786. // Postprocess Profile data
  3787. if (currentTimelineData !== null) {
  3788. currentTimelineData.schedulingEvents.forEach(function (event) {
  3789. if (event.type === 'schedule-state-update') {
  3790. // TODO(luna): We can optimize this by creating a map of
  3791. // fiber to component stack instead of generating the stack
  3792. // for every fiber every time
  3793. var fiberStack = currentFiberStacks.get(event);
  3794. if (fiberStack && currentDispatcherRef != null) {
  3795. event.componentStack = fiberStack.reduce(function (trace, fiber) {
  3796. return trace + Object(DevToolsFiberComponentStack["a" /* describeFiber */])(workTagMap, fiber, currentDispatcherRef);
  3797. }, '');
  3798. }
  3799. }
  3800. });
  3801. } // Clear the current fiber stacks so we don't hold onto the fibers
  3802. // in memory after profiling finishes
  3803. currentFiberStacks.clear();
  3804. }
  3805. }
  3806. }
  3807. return {
  3808. getTimelineData: getTimelineData,
  3809. profilingHooks: {
  3810. markCommitStarted: markCommitStarted,
  3811. markCommitStopped: markCommitStopped,
  3812. markComponentRenderStarted: markComponentRenderStarted,
  3813. markComponentRenderStopped: markComponentRenderStopped,
  3814. markComponentPassiveEffectMountStarted: markComponentPassiveEffectMountStarted,
  3815. markComponentPassiveEffectMountStopped: markComponentPassiveEffectMountStopped,
  3816. markComponentPassiveEffectUnmountStarted: markComponentPassiveEffectUnmountStarted,
  3817. markComponentPassiveEffectUnmountStopped: markComponentPassiveEffectUnmountStopped,
  3818. markComponentLayoutEffectMountStarted: markComponentLayoutEffectMountStarted,
  3819. markComponentLayoutEffectMountStopped: markComponentLayoutEffectMountStopped,
  3820. markComponentLayoutEffectUnmountStarted: markComponentLayoutEffectUnmountStarted,
  3821. markComponentLayoutEffectUnmountStopped: markComponentLayoutEffectUnmountStopped,
  3822. markComponentErrored: markComponentErrored,
  3823. markComponentSuspended: markComponentSuspended,
  3824. markLayoutEffectsStarted: markLayoutEffectsStarted,
  3825. markLayoutEffectsStopped: markLayoutEffectsStopped,
  3826. markPassiveEffectsStarted: markPassiveEffectsStarted,
  3827. markPassiveEffectsStopped: markPassiveEffectsStopped,
  3828. markRenderStarted: markRenderStarted,
  3829. markRenderYielded: markRenderYielded,
  3830. markRenderStopped: markRenderStopped,
  3831. markRenderScheduled: markRenderScheduled,
  3832. markForceUpdateScheduled: markForceUpdateScheduled,
  3833. markStateUpdateScheduled: markStateUpdateScheduled
  3834. },
  3835. toggleProfilingStatus: toggleProfilingStatus
  3836. };
  3837. }
  3838. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/renderer.js
  3839. function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
  3840. 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; }
  3841. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  3842. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  3843. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  3844. function renderer_slicedToArray(arr, i) { return renderer_arrayWithHoles(arr) || renderer_iterableToArrayLimit(arr, i) || renderer_unsupportedIterableToArray(arr, i) || renderer_nonIterableRest(); }
  3845. function renderer_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  3846. function renderer_iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 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; }
  3847. function renderer_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  3848. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || renderer_unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  3849. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  3850. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
  3851. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return renderer_arrayLikeToArray(arr); }
  3852. function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = renderer_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  3853. function renderer_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return renderer_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return renderer_arrayLikeToArray(o, minLen); }
  3854. function renderer_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  3855. function renderer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { renderer_typeof = function _typeof(obj) { return typeof obj; }; } else { renderer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return renderer_typeof(obj); }
  3856. /**
  3857. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3858. *
  3859. * This source code is licensed under the MIT license found in the
  3860. * LICENSE file in the root directory of this source tree.
  3861. *
  3862. *
  3863. */
  3864. function getFiberFlags(fiber) {
  3865. // The name of this field changed from "effectTag" to "flags"
  3866. return fiber.flags !== undefined ? fiber.flags : fiber.effectTag;
  3867. } // Some environments (e.g. React Native / Hermes) don't support the performance API yet.
  3868. var renderer_getCurrentTime = // $FlowFixMe[method-unbinding]
  3869. (typeof performance === "undefined" ? "undefined" : renderer_typeof(performance)) === 'object' && typeof performance.now === 'function' ? function () {
  3870. return performance.now();
  3871. } : function () {
  3872. return Date.now();
  3873. };
  3874. function getInternalReactConstants(version) {
  3875. // **********************************************************
  3876. // The section below is copied from files in React repo.
  3877. // Keep it in sync, and add version guards if it changes.
  3878. //
  3879. // Technically these priority levels are invalid for versions before 16.9,
  3880. // but 16.9 is the first version to report priority level to DevTools,
  3881. // so we can avoid checking for earlier versions and support pre-16.9 canary releases in the process.
  3882. var ReactPriorityLevels = {
  3883. ImmediatePriority: 99,
  3884. UserBlockingPriority: 98,
  3885. NormalPriority: 97,
  3886. LowPriority: 96,
  3887. IdlePriority: 95,
  3888. NoPriority: 90
  3889. };
  3890. if (Object(backend_utils["i" /* gt */])(version, '17.0.2')) {
  3891. ReactPriorityLevels = {
  3892. ImmediatePriority: 1,
  3893. UserBlockingPriority: 2,
  3894. NormalPriority: 3,
  3895. LowPriority: 4,
  3896. IdlePriority: 5,
  3897. NoPriority: 0
  3898. };
  3899. }
  3900. var StrictModeBits = 0;
  3901. if (Object(backend_utils["j" /* gte */])(version, '18.0.0-alpha')) {
  3902. // 18+
  3903. StrictModeBits = 24;
  3904. } else if (Object(backend_utils["j" /* gte */])(version, '16.9.0')) {
  3905. // 16.9 - 17
  3906. StrictModeBits = 1;
  3907. } else if (Object(backend_utils["j" /* gte */])(version, '16.3.0')) {
  3908. // 16.3 - 16.8
  3909. StrictModeBits = 2;
  3910. }
  3911. var ReactTypeOfWork = null; // **********************************************************
  3912. // The section below is copied from files in React repo.
  3913. // Keep it in sync, and add version guards if it changes.
  3914. //
  3915. // TODO Update the gt() check below to be gte() whichever the next version number is.
  3916. // Currently the version in Git is 17.0.2 (but that version has not been/may not end up being released).
  3917. if (Object(backend_utils["i" /* gt */])(version, '17.0.1')) {
  3918. ReactTypeOfWork = {
  3919. CacheComponent: 24,
  3920. // Experimental
  3921. ClassComponent: 1,
  3922. ContextConsumer: 9,
  3923. ContextProvider: 10,
  3924. CoroutineComponent: -1,
  3925. // Removed
  3926. CoroutineHandlerPhase: -1,
  3927. // Removed
  3928. DehydratedSuspenseComponent: 18,
  3929. // Behind a flag
  3930. ForwardRef: 11,
  3931. Fragment: 7,
  3932. FunctionComponent: 0,
  3933. HostComponent: 5,
  3934. HostPortal: 4,
  3935. HostRoot: 3,
  3936. HostResource: 26,
  3937. // In reality, 18.2+. But doesn't hurt to include it here
  3938. HostSingleton: 27,
  3939. // Same as above
  3940. HostText: 6,
  3941. IncompleteClassComponent: 17,
  3942. IndeterminateComponent: 2,
  3943. LazyComponent: 16,
  3944. LegacyHiddenComponent: 23,
  3945. MemoComponent: 14,
  3946. Mode: 8,
  3947. OffscreenComponent: 22,
  3948. // Experimental
  3949. Profiler: 12,
  3950. ScopeComponent: 21,
  3951. // Experimental
  3952. SimpleMemoComponent: 15,
  3953. SuspenseComponent: 13,
  3954. SuspenseListComponent: 19,
  3955. // Experimental
  3956. TracingMarkerComponent: 25,
  3957. // Experimental - This is technically in 18 but we don't
  3958. // want to fork again so we're adding it here instead
  3959. YieldComponent: -1 // Removed
  3960. };
  3961. } else if (Object(backend_utils["j" /* gte */])(version, '17.0.0-alpha')) {
  3962. ReactTypeOfWork = {
  3963. CacheComponent: -1,
  3964. // Doesn't exist yet
  3965. ClassComponent: 1,
  3966. ContextConsumer: 9,
  3967. ContextProvider: 10,
  3968. CoroutineComponent: -1,
  3969. // Removed
  3970. CoroutineHandlerPhase: -1,
  3971. // Removed
  3972. DehydratedSuspenseComponent: 18,
  3973. // Behind a flag
  3974. ForwardRef: 11,
  3975. Fragment: 7,
  3976. FunctionComponent: 0,
  3977. HostComponent: 5,
  3978. HostPortal: 4,
  3979. HostRoot: 3,
  3980. HostResource: -1,
  3981. // Doesn't exist yet
  3982. HostSingleton: -1,
  3983. // Doesn't exist yet
  3984. HostText: 6,
  3985. IncompleteClassComponent: 17,
  3986. IndeterminateComponent: 2,
  3987. LazyComponent: 16,
  3988. LegacyHiddenComponent: 24,
  3989. MemoComponent: 14,
  3990. Mode: 8,
  3991. OffscreenComponent: 23,
  3992. // Experimental
  3993. Profiler: 12,
  3994. ScopeComponent: 21,
  3995. // Experimental
  3996. SimpleMemoComponent: 15,
  3997. SuspenseComponent: 13,
  3998. SuspenseListComponent: 19,
  3999. // Experimental
  4000. TracingMarkerComponent: -1,
  4001. // Doesn't exist yet
  4002. YieldComponent: -1 // Removed
  4003. };
  4004. } else if (Object(backend_utils["j" /* gte */])(version, '16.6.0-beta.0')) {
  4005. ReactTypeOfWork = {
  4006. CacheComponent: -1,
  4007. // Doesn't exist yet
  4008. ClassComponent: 1,
  4009. ContextConsumer: 9,
  4010. ContextProvider: 10,
  4011. CoroutineComponent: -1,
  4012. // Removed
  4013. CoroutineHandlerPhase: -1,
  4014. // Removed
  4015. DehydratedSuspenseComponent: 18,
  4016. // Behind a flag
  4017. ForwardRef: 11,
  4018. Fragment: 7,
  4019. FunctionComponent: 0,
  4020. HostComponent: 5,
  4021. HostPortal: 4,
  4022. HostRoot: 3,
  4023. HostResource: -1,
  4024. // Doesn't exist yet
  4025. HostSingleton: -1,
  4026. // Doesn't exist yet
  4027. HostText: 6,
  4028. IncompleteClassComponent: 17,
  4029. IndeterminateComponent: 2,
  4030. LazyComponent: 16,
  4031. LegacyHiddenComponent: -1,
  4032. MemoComponent: 14,
  4033. Mode: 8,
  4034. OffscreenComponent: -1,
  4035. // Experimental
  4036. Profiler: 12,
  4037. ScopeComponent: -1,
  4038. // Experimental
  4039. SimpleMemoComponent: 15,
  4040. SuspenseComponent: 13,
  4041. SuspenseListComponent: 19,
  4042. // Experimental
  4043. TracingMarkerComponent: -1,
  4044. // Doesn't exist yet
  4045. YieldComponent: -1 // Removed
  4046. };
  4047. } else if (Object(backend_utils["j" /* gte */])(version, '16.4.3-alpha')) {
  4048. ReactTypeOfWork = {
  4049. CacheComponent: -1,
  4050. // Doesn't exist yet
  4051. ClassComponent: 2,
  4052. ContextConsumer: 11,
  4053. ContextProvider: 12,
  4054. CoroutineComponent: -1,
  4055. // Removed
  4056. CoroutineHandlerPhase: -1,
  4057. // Removed
  4058. DehydratedSuspenseComponent: -1,
  4059. // Doesn't exist yet
  4060. ForwardRef: 13,
  4061. Fragment: 9,
  4062. FunctionComponent: 0,
  4063. HostComponent: 7,
  4064. HostPortal: 6,
  4065. HostRoot: 5,
  4066. HostResource: -1,
  4067. // Doesn't exist yet
  4068. HostSingleton: -1,
  4069. // Doesn't exist yet
  4070. HostText: 8,
  4071. IncompleteClassComponent: -1,
  4072. // Doesn't exist yet
  4073. IndeterminateComponent: 4,
  4074. LazyComponent: -1,
  4075. // Doesn't exist yet
  4076. LegacyHiddenComponent: -1,
  4077. MemoComponent: -1,
  4078. // Doesn't exist yet
  4079. Mode: 10,
  4080. OffscreenComponent: -1,
  4081. // Experimental
  4082. Profiler: 15,
  4083. ScopeComponent: -1,
  4084. // Experimental
  4085. SimpleMemoComponent: -1,
  4086. // Doesn't exist yet
  4087. SuspenseComponent: 16,
  4088. SuspenseListComponent: -1,
  4089. // Doesn't exist yet
  4090. TracingMarkerComponent: -1,
  4091. // Doesn't exist yet
  4092. YieldComponent: -1 // Removed
  4093. };
  4094. } else {
  4095. ReactTypeOfWork = {
  4096. CacheComponent: -1,
  4097. // Doesn't exist yet
  4098. ClassComponent: 2,
  4099. ContextConsumer: 12,
  4100. ContextProvider: 13,
  4101. CoroutineComponent: 7,
  4102. CoroutineHandlerPhase: 8,
  4103. DehydratedSuspenseComponent: -1,
  4104. // Doesn't exist yet
  4105. ForwardRef: 14,
  4106. Fragment: 10,
  4107. FunctionComponent: 1,
  4108. HostComponent: 5,
  4109. HostPortal: 4,
  4110. HostRoot: 3,
  4111. HostResource: -1,
  4112. // Doesn't exist yet
  4113. HostSingleton: -1,
  4114. // Doesn't exist yet
  4115. HostText: 6,
  4116. IncompleteClassComponent: -1,
  4117. // Doesn't exist yet
  4118. IndeterminateComponent: 0,
  4119. LazyComponent: -1,
  4120. // Doesn't exist yet
  4121. LegacyHiddenComponent: -1,
  4122. MemoComponent: -1,
  4123. // Doesn't exist yet
  4124. Mode: 11,
  4125. OffscreenComponent: -1,
  4126. // Experimental
  4127. Profiler: 15,
  4128. ScopeComponent: -1,
  4129. // Experimental
  4130. SimpleMemoComponent: -1,
  4131. // Doesn't exist yet
  4132. SuspenseComponent: 16,
  4133. SuspenseListComponent: -1,
  4134. // Doesn't exist yet
  4135. TracingMarkerComponent: -1,
  4136. // Doesn't exist yet
  4137. YieldComponent: 9
  4138. };
  4139. } // **********************************************************
  4140. // End of copied code.
  4141. // **********************************************************
  4142. function getTypeSymbol(type) {
  4143. var symbolOrNumber = renderer_typeof(type) === 'object' && type !== null ? type.$$typeof : type;
  4144. return renderer_typeof(symbolOrNumber) === 'symbol' ? // $FlowFixMe `toString()` doesn't match the type signature?
  4145. symbolOrNumber.toString() : symbolOrNumber;
  4146. }
  4147. var _ReactTypeOfWork = ReactTypeOfWork,
  4148. CacheComponent = _ReactTypeOfWork.CacheComponent,
  4149. ClassComponent = _ReactTypeOfWork.ClassComponent,
  4150. IncompleteClassComponent = _ReactTypeOfWork.IncompleteClassComponent,
  4151. FunctionComponent = _ReactTypeOfWork.FunctionComponent,
  4152. IndeterminateComponent = _ReactTypeOfWork.IndeterminateComponent,
  4153. ForwardRef = _ReactTypeOfWork.ForwardRef,
  4154. HostRoot = _ReactTypeOfWork.HostRoot,
  4155. HostResource = _ReactTypeOfWork.HostResource,
  4156. HostSingleton = _ReactTypeOfWork.HostSingleton,
  4157. HostComponent = _ReactTypeOfWork.HostComponent,
  4158. HostPortal = _ReactTypeOfWork.HostPortal,
  4159. HostText = _ReactTypeOfWork.HostText,
  4160. Fragment = _ReactTypeOfWork.Fragment,
  4161. LazyComponent = _ReactTypeOfWork.LazyComponent,
  4162. LegacyHiddenComponent = _ReactTypeOfWork.LegacyHiddenComponent,
  4163. MemoComponent = _ReactTypeOfWork.MemoComponent,
  4164. OffscreenComponent = _ReactTypeOfWork.OffscreenComponent,
  4165. Profiler = _ReactTypeOfWork.Profiler,
  4166. ScopeComponent = _ReactTypeOfWork.ScopeComponent,
  4167. SimpleMemoComponent = _ReactTypeOfWork.SimpleMemoComponent,
  4168. SuspenseComponent = _ReactTypeOfWork.SuspenseComponent,
  4169. SuspenseListComponent = _ReactTypeOfWork.SuspenseListComponent,
  4170. TracingMarkerComponent = _ReactTypeOfWork.TracingMarkerComponent;
  4171. function resolveFiberType(type) {
  4172. var typeSymbol = getTypeSymbol(type);
  4173. switch (typeSymbol) {
  4174. case ReactSymbols["j" /* MEMO_NUMBER */]:
  4175. case ReactSymbols["k" /* MEMO_SYMBOL_STRING */]:
  4176. // recursively resolving memo type in case of memo(forwardRef(Component))
  4177. return resolveFiberType(type.type);
  4178. case ReactSymbols["f" /* FORWARD_REF_NUMBER */]:
  4179. case ReactSymbols["g" /* FORWARD_REF_SYMBOL_STRING */]:
  4180. return type.render;
  4181. default:
  4182. return type;
  4183. }
  4184. } // NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods
  4185. function getDisplayNameForFiber(fiber) {
  4186. var elementType = fiber.elementType,
  4187. type = fiber.type,
  4188. tag = fiber.tag;
  4189. var resolvedType = type;
  4190. if (renderer_typeof(type) === 'object' && type !== null) {
  4191. resolvedType = resolveFiberType(type);
  4192. }
  4193. var resolvedContext = null;
  4194. switch (tag) {
  4195. case CacheComponent:
  4196. return 'Cache';
  4197. case ClassComponent:
  4198. case IncompleteClassComponent:
  4199. return Object(utils["h" /* getDisplayName */])(resolvedType);
  4200. case FunctionComponent:
  4201. case IndeterminateComponent:
  4202. return Object(utils["h" /* getDisplayName */])(resolvedType);
  4203. case ForwardRef:
  4204. return Object(utils["l" /* getWrappedDisplayName */])(elementType, resolvedType, 'ForwardRef', 'Anonymous');
  4205. case HostRoot:
  4206. var fiberRoot = fiber.stateNode;
  4207. if (fiberRoot != null && fiberRoot._debugRootType !== null) {
  4208. return fiberRoot._debugRootType;
  4209. }
  4210. return null;
  4211. case HostComponent:
  4212. case HostSingleton:
  4213. case HostResource:
  4214. return type;
  4215. case HostPortal:
  4216. case HostText:
  4217. return null;
  4218. case Fragment:
  4219. return 'Fragment';
  4220. case LazyComponent:
  4221. // This display name will not be user visible.
  4222. // Once a Lazy component loads its inner component, React replaces the tag and type.
  4223. // This display name will only show up in console logs when DevTools DEBUG mode is on.
  4224. return 'Lazy';
  4225. case MemoComponent:
  4226. case SimpleMemoComponent:
  4227. // Display name in React does not use `Memo` as a wrapper but fallback name.
  4228. return Object(utils["l" /* getWrappedDisplayName */])(elementType, resolvedType, 'Memo', 'Anonymous');
  4229. case SuspenseComponent:
  4230. return 'Suspense';
  4231. case LegacyHiddenComponent:
  4232. return 'LegacyHidden';
  4233. case OffscreenComponent:
  4234. return 'Offscreen';
  4235. case ScopeComponent:
  4236. return 'Scope';
  4237. case SuspenseListComponent:
  4238. return 'SuspenseList';
  4239. case Profiler:
  4240. return 'Profiler';
  4241. case TracingMarkerComponent:
  4242. return 'TracingMarker';
  4243. default:
  4244. var typeSymbol = getTypeSymbol(type);
  4245. switch (typeSymbol) {
  4246. case ReactSymbols["a" /* CONCURRENT_MODE_NUMBER */]:
  4247. case ReactSymbols["b" /* CONCURRENT_MODE_SYMBOL_STRING */]:
  4248. case ReactSymbols["e" /* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */]:
  4249. return null;
  4250. case ReactSymbols["n" /* PROVIDER_NUMBER */]:
  4251. case ReactSymbols["o" /* PROVIDER_SYMBOL_STRING */]:
  4252. // 16.3.0 exposed the context object as "context"
  4253. // PR #12501 changed it to "_context" for 16.3.1+
  4254. // NOTE Keep in sync with inspectElementRaw()
  4255. resolvedContext = fiber.type._context || fiber.type.context;
  4256. return "".concat(resolvedContext.displayName || 'Context', ".Provider");
  4257. case ReactSymbols["c" /* CONTEXT_NUMBER */]:
  4258. case ReactSymbols["d" /* CONTEXT_SYMBOL_STRING */]:
  4259. case ReactSymbols["r" /* SERVER_CONTEXT_SYMBOL_STRING */]:
  4260. // 16.3-16.5 read from "type" because the Consumer is the actual context object.
  4261. // 16.6+ should read from "type._context" because Consumer can be different (in DEV).
  4262. // NOTE Keep in sync with inspectElementRaw()
  4263. resolvedContext = fiber.type._context || fiber.type; // NOTE: TraceUpdatesBackendManager depends on the name ending in '.Consumer'
  4264. // If you change the name, figure out a more resilient way to detect it.
  4265. return "".concat(resolvedContext.displayName || 'Context', ".Consumer");
  4266. case ReactSymbols["s" /* STRICT_MODE_NUMBER */]:
  4267. case ReactSymbols["t" /* STRICT_MODE_SYMBOL_STRING */]:
  4268. return null;
  4269. case ReactSymbols["l" /* PROFILER_NUMBER */]:
  4270. case ReactSymbols["m" /* PROFILER_SYMBOL_STRING */]:
  4271. return "Profiler(".concat(fiber.memoizedProps.id, ")");
  4272. case ReactSymbols["p" /* SCOPE_NUMBER */]:
  4273. case ReactSymbols["q" /* SCOPE_SYMBOL_STRING */]:
  4274. return 'Scope';
  4275. default:
  4276. // Unknown element type.
  4277. // This may mean a new element type that has not yet been added to DevTools.
  4278. return null;
  4279. }
  4280. }
  4281. }
  4282. return {
  4283. getDisplayNameForFiber: getDisplayNameForFiber,
  4284. getTypeSymbol: getTypeSymbol,
  4285. ReactPriorityLevels: ReactPriorityLevels,
  4286. ReactTypeOfWork: ReactTypeOfWork,
  4287. StrictModeBits: StrictModeBits
  4288. };
  4289. } // Map of one or more Fibers in a pair to their unique id number.
  4290. // We track both Fibers to support Fast Refresh,
  4291. // which may forcefully replace one of the pair as part of hot reloading.
  4292. // In that case it's still important to be able to locate the previous ID during subsequent renders.
  4293. var fiberToIDMap = new Map(); // Map of id to one (arbitrary) Fiber in a pair.
  4294. // This Map is used to e.g. get the display name for a Fiber or schedule an update,
  4295. // operations that should be the same whether the current and work-in-progress Fiber is used.
  4296. var idToArbitraryFiberMap = new Map();
  4297. function attach(hook, rendererID, renderer, global) {
  4298. // Newer versions of the reconciler package also specific reconciler version.
  4299. // If that version number is present, use it.
  4300. // Third party renderer versions may not match the reconciler version,
  4301. // and the latter is what's important in terms of tags and symbols.
  4302. var version = renderer.reconcilerVersion || renderer.version;
  4303. var _getInternalReactCons = getInternalReactConstants(version),
  4304. getDisplayNameForFiber = _getInternalReactCons.getDisplayNameForFiber,
  4305. getTypeSymbol = _getInternalReactCons.getTypeSymbol,
  4306. ReactPriorityLevels = _getInternalReactCons.ReactPriorityLevels,
  4307. ReactTypeOfWork = _getInternalReactCons.ReactTypeOfWork,
  4308. StrictModeBits = _getInternalReactCons.StrictModeBits;
  4309. var CacheComponent = ReactTypeOfWork.CacheComponent,
  4310. ClassComponent = ReactTypeOfWork.ClassComponent,
  4311. ContextConsumer = ReactTypeOfWork.ContextConsumer,
  4312. DehydratedSuspenseComponent = ReactTypeOfWork.DehydratedSuspenseComponent,
  4313. ForwardRef = ReactTypeOfWork.ForwardRef,
  4314. Fragment = ReactTypeOfWork.Fragment,
  4315. FunctionComponent = ReactTypeOfWork.FunctionComponent,
  4316. HostRoot = ReactTypeOfWork.HostRoot,
  4317. HostResource = ReactTypeOfWork.HostResource,
  4318. HostSingleton = ReactTypeOfWork.HostSingleton,
  4319. HostPortal = ReactTypeOfWork.HostPortal,
  4320. HostComponent = ReactTypeOfWork.HostComponent,
  4321. HostText = ReactTypeOfWork.HostText,
  4322. IncompleteClassComponent = ReactTypeOfWork.IncompleteClassComponent,
  4323. IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
  4324. LegacyHiddenComponent = ReactTypeOfWork.LegacyHiddenComponent,
  4325. MemoComponent = ReactTypeOfWork.MemoComponent,
  4326. OffscreenComponent = ReactTypeOfWork.OffscreenComponent,
  4327. SimpleMemoComponent = ReactTypeOfWork.SimpleMemoComponent,
  4328. SuspenseComponent = ReactTypeOfWork.SuspenseComponent,
  4329. SuspenseListComponent = ReactTypeOfWork.SuspenseListComponent,
  4330. TracingMarkerComponent = ReactTypeOfWork.TracingMarkerComponent;
  4331. var ImmediatePriority = ReactPriorityLevels.ImmediatePriority,
  4332. UserBlockingPriority = ReactPriorityLevels.UserBlockingPriority,
  4333. NormalPriority = ReactPriorityLevels.NormalPriority,
  4334. LowPriority = ReactPriorityLevels.LowPriority,
  4335. IdlePriority = ReactPriorityLevels.IdlePriority,
  4336. NoPriority = ReactPriorityLevels.NoPriority;
  4337. var getLaneLabelMap = renderer.getLaneLabelMap,
  4338. injectProfilingHooks = renderer.injectProfilingHooks,
  4339. overrideHookState = renderer.overrideHookState,
  4340. overrideHookStateDeletePath = renderer.overrideHookStateDeletePath,
  4341. overrideHookStateRenamePath = renderer.overrideHookStateRenamePath,
  4342. overrideProps = renderer.overrideProps,
  4343. overridePropsDeletePath = renderer.overridePropsDeletePath,
  4344. overridePropsRenamePath = renderer.overridePropsRenamePath,
  4345. scheduleRefresh = renderer.scheduleRefresh,
  4346. setErrorHandler = renderer.setErrorHandler,
  4347. setSuspenseHandler = renderer.setSuspenseHandler,
  4348. scheduleUpdate = renderer.scheduleUpdate;
  4349. var supportsTogglingError = typeof setErrorHandler === 'function' && typeof scheduleUpdate === 'function';
  4350. var supportsTogglingSuspense = typeof setSuspenseHandler === 'function' && typeof scheduleUpdate === 'function';
  4351. if (typeof scheduleRefresh === 'function') {
  4352. // When Fast Refresh updates a component, the frontend may need to purge cached information.
  4353. // For example, ASTs cached for the component (for named hooks) may no longer be valid.
  4354. // Send a signal to the frontend to purge this cached information.
  4355. // The "fastRefreshScheduled" dispatched is global (not Fiber or even Renderer specific).
  4356. // This is less effecient since it means the front-end will need to purge the entire cache,
  4357. // but this is probably an okay trade off in order to reduce coupling between the DevTools and Fast Refresh.
  4358. renderer.scheduleRefresh = function () {
  4359. try {
  4360. hook.emit('fastRefreshScheduled');
  4361. } finally {
  4362. return scheduleRefresh.apply(void 0, arguments);
  4363. }
  4364. };
  4365. }
  4366. var getTimelineData = null;
  4367. var toggleProfilingStatus = null;
  4368. if (typeof injectProfilingHooks === 'function') {
  4369. var response = createProfilingHooks({
  4370. getDisplayNameForFiber: getDisplayNameForFiber,
  4371. getIsProfiling: function getIsProfiling() {
  4372. return isProfiling;
  4373. },
  4374. getLaneLabelMap: getLaneLabelMap,
  4375. currentDispatcherRef: renderer.currentDispatcherRef,
  4376. workTagMap: ReactTypeOfWork,
  4377. reactVersion: version
  4378. }); // Pass the Profiling hooks to the reconciler for it to call during render.
  4379. injectProfilingHooks(response.profilingHooks); // Hang onto this toggle so we can notify the external methods of profiling status changes.
  4380. getTimelineData = response.getTimelineData;
  4381. toggleProfilingStatus = response.toggleProfilingStatus;
  4382. } // Tracks Fibers with recently changed number of error/warning messages.
  4383. // These collections store the Fiber rather than the ID,
  4384. // in order to avoid generating an ID for Fibers that never get mounted
  4385. // (due to e.g. Suspense or error boundaries).
  4386. // onErrorOrWarning() adds Fibers and recordPendingErrorsAndWarnings() later clears them.
  4387. var fibersWithChangedErrorOrWarningCounts = new Set();
  4388. var pendingFiberToErrorsMap = new Map();
  4389. var pendingFiberToWarningsMap = new Map(); // Mapping of fiber IDs to error/warning messages and counts.
  4390. var fiberIDToErrorsMap = new Map();
  4391. var fiberIDToWarningsMap = new Map();
  4392. function clearErrorsAndWarnings() {
  4393. // eslint-disable-next-line no-for-of-loops/no-for-of-loops
  4394. var _iterator = _createForOfIteratorHelper(fiberIDToErrorsMap.keys()),
  4395. _step;
  4396. try {
  4397. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  4398. var id = _step.value;
  4399. var _fiber = idToArbitraryFiberMap.get(id);
  4400. if (_fiber != null) {
  4401. fibersWithChangedErrorOrWarningCounts.add(_fiber);
  4402. updateMostRecentlyInspectedElementIfNecessary(id);
  4403. }
  4404. } // eslint-disable-next-line no-for-of-loops/no-for-of-loops
  4405. } catch (err) {
  4406. _iterator.e(err);
  4407. } finally {
  4408. _iterator.f();
  4409. }
  4410. var _iterator2 = _createForOfIteratorHelper(fiberIDToWarningsMap.keys()),
  4411. _step2;
  4412. try {
  4413. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  4414. var _id = _step2.value;
  4415. var _fiber2 = idToArbitraryFiberMap.get(_id);
  4416. if (_fiber2 != null) {
  4417. fibersWithChangedErrorOrWarningCounts.add(_fiber2);
  4418. updateMostRecentlyInspectedElementIfNecessary(_id);
  4419. }
  4420. }
  4421. } catch (err) {
  4422. _iterator2.e(err);
  4423. } finally {
  4424. _iterator2.f();
  4425. }
  4426. fiberIDToErrorsMap.clear();
  4427. fiberIDToWarningsMap.clear();
  4428. flushPendingEvents();
  4429. }
  4430. function clearMessageCountHelper(fiberID, pendingFiberToMessageCountMap, fiberIDToMessageCountMap) {
  4431. var fiber = idToArbitraryFiberMap.get(fiberID);
  4432. if (fiber != null) {
  4433. // Throw out any pending changes.
  4434. pendingFiberToErrorsMap.delete(fiber);
  4435. if (fiberIDToMessageCountMap.has(fiberID)) {
  4436. fiberIDToMessageCountMap.delete(fiberID); // If previous flushed counts have changed, schedule an update too.
  4437. fibersWithChangedErrorOrWarningCounts.add(fiber);
  4438. flushPendingEvents();
  4439. updateMostRecentlyInspectedElementIfNecessary(fiberID);
  4440. } else {
  4441. fibersWithChangedErrorOrWarningCounts.delete(fiber);
  4442. }
  4443. }
  4444. }
  4445. function clearErrorsForFiberID(fiberID) {
  4446. clearMessageCountHelper(fiberID, pendingFiberToErrorsMap, fiberIDToErrorsMap);
  4447. }
  4448. function clearWarningsForFiberID(fiberID) {
  4449. clearMessageCountHelper(fiberID, pendingFiberToWarningsMap, fiberIDToWarningsMap);
  4450. }
  4451. function updateMostRecentlyInspectedElementIfNecessary(fiberID) {
  4452. if (mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === fiberID) {
  4453. hasElementUpdatedSinceLastInspected = true;
  4454. }
  4455. } // Called when an error or warning is logged during render, commit, or passive (including unmount functions).
  4456. function onErrorOrWarning(fiber, type, args) {
  4457. if (type === 'error') {
  4458. var maybeID = getFiberIDUnsafe(fiber); // if this is an error simulated by us to trigger error boundary, ignore
  4459. if (maybeID != null && forceErrorForFiberIDs.get(maybeID) === true) {
  4460. return;
  4461. }
  4462. }
  4463. var message = backend_utils["f" /* format */].apply(void 0, _toConsumableArray(args));
  4464. if (constants["s" /* __DEBUG__ */]) {
  4465. debug('onErrorOrWarning', fiber, null, "".concat(type, ": \"").concat(message, "\""));
  4466. } // Mark this Fiber as needed its warning/error count updated during the next flush.
  4467. fibersWithChangedErrorOrWarningCounts.add(fiber); // Track the warning/error for later.
  4468. var fiberMap = type === 'error' ? pendingFiberToErrorsMap : pendingFiberToWarningsMap;
  4469. var messageMap = fiberMap.get(fiber);
  4470. if (messageMap != null) {
  4471. var count = messageMap.get(message) || 0;
  4472. messageMap.set(message, count + 1);
  4473. } else {
  4474. fiberMap.set(fiber, new Map([[message, 1]]));
  4475. } // Passive effects may trigger errors or warnings too;
  4476. // In this case, we should wait until the rest of the passive effects have run,
  4477. // but we shouldn't wait until the next commit because that might be a long time.
  4478. // This would also cause "tearing" between an inspected Component and the tree view.
  4479. // Then again we don't want to flush too soon because this could be an error during async rendering.
  4480. // Use a debounce technique to ensure that we'll eventually flush.
  4481. flushPendingErrorsAndWarningsAfterDelay();
  4482. } // Patching the console enables DevTools to do a few useful things:
  4483. // * Append component stacks to warnings and error messages
  4484. // * Disable logging during re-renders to inspect hooks (see inspectHooksOfFiber)
  4485. Object(backend_console["d" /* registerRenderer */])(renderer, onErrorOrWarning); // The renderer interface can't read these preferences directly,
  4486. // because it is stored in localStorage within the context of the extension.
  4487. // It relies on the extension to pass the preference through via the global.
  4488. Object(backend_console["b" /* patchConsoleUsingWindowValues */])();
  4489. var debug = function debug(name, fiber, parentFiber) {
  4490. var extraString = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
  4491. if (constants["s" /* __DEBUG__ */]) {
  4492. var displayName = fiber.tag + ':' + (getDisplayNameForFiber(fiber) || 'null');
  4493. var maybeID = getFiberIDUnsafe(fiber) || '<no id>';
  4494. var parentDisplayName = parentFiber ? parentFiber.tag + ':' + (getDisplayNameForFiber(parentFiber) || 'null') : '';
  4495. var maybeParentID = parentFiber ? getFiberIDUnsafe(parentFiber) || '<no-id>' : '';
  4496. console.groupCollapsed("[renderer] %c".concat(name, " %c").concat(displayName, " (").concat(maybeID, ") %c").concat(parentFiber ? "".concat(parentDisplayName, " (").concat(maybeParentID, ")") : '', " %c").concat(extraString), 'color: red; font-weight: bold;', 'color: blue;', 'color: purple;', 'color: black;');
  4497. console.log(new Error().stack.split('\n').slice(1).join('\n'));
  4498. console.groupEnd();
  4499. }
  4500. }; // Configurable Components tree filters.
  4501. var hideElementsWithDisplayNames = new Set();
  4502. var hideElementsWithPaths = new Set();
  4503. var hideElementsWithTypes = new Set(); // Highlight updates
  4504. var traceUpdatesEnabled = false;
  4505. var traceUpdatesForNodes = new Set();
  4506. function applyComponentFilters(componentFilters) {
  4507. hideElementsWithTypes.clear();
  4508. hideElementsWithDisplayNames.clear();
  4509. hideElementsWithPaths.clear();
  4510. componentFilters.forEach(function (componentFilter) {
  4511. if (!componentFilter.isEnabled) {
  4512. return;
  4513. }
  4514. switch (componentFilter.type) {
  4515. case types["a" /* ComponentFilterDisplayName */]:
  4516. if (componentFilter.isValid && componentFilter.value !== '') {
  4517. hideElementsWithDisplayNames.add(new RegExp(componentFilter.value, 'i'));
  4518. }
  4519. break;
  4520. case types["b" /* ComponentFilterElementType */]:
  4521. hideElementsWithTypes.add(componentFilter.value);
  4522. break;
  4523. case types["d" /* ComponentFilterLocation */]:
  4524. if (componentFilter.isValid && componentFilter.value !== '') {
  4525. hideElementsWithPaths.add(new RegExp(componentFilter.value, 'i'));
  4526. }
  4527. break;
  4528. case types["c" /* ComponentFilterHOC */]:
  4529. hideElementsWithDisplayNames.add(new RegExp('\\('));
  4530. break;
  4531. default:
  4532. console.warn("Invalid component filter type \"".concat(componentFilter.type, "\""));
  4533. break;
  4534. }
  4535. });
  4536. } // The renderer interface can't read saved component filters directly,
  4537. // because they are stored in localStorage within the context of the extension.
  4538. // Instead it relies on the extension to pass filters through.
  4539. if (window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ != null) {
  4540. applyComponentFilters(window.__REACT_DEVTOOLS_COMPONENT_FILTERS__);
  4541. } else {
  4542. // Unfortunately this feature is not expected to work for React Native for now.
  4543. // It would be annoying for us to spam YellowBox warnings with unactionable stuff,
  4544. // so for now just skip this message...
  4545. //console.warn('⚛️ DevTools: Could not locate saved component filters');
  4546. // Fallback to assuming the default filters in this case.
  4547. applyComponentFilters(Object(utils["g" /* getDefaultComponentFilters */])());
  4548. } // If necessary, we can revisit optimizing this operation.
  4549. // For example, we could add a new recursive unmount tree operation.
  4550. // The unmount operations are already significantly smaller than mount operations though.
  4551. // This is something to keep in mind for later.
  4552. function updateComponentFilters(componentFilters) {
  4553. if (isProfiling) {
  4554. // Re-mounting a tree while profiling is in progress might break a lot of assumptions.
  4555. // If necessary, we could support this- but it doesn't seem like a necessary use case.
  4556. throw Error('Cannot modify filter preferences while profiling');
  4557. } // Recursively unmount all roots.
  4558. hook.getFiberRoots(rendererID).forEach(function (root) {
  4559. currentRootID = getOrGenerateFiberID(root.current); // The TREE_OPERATION_REMOVE_ROOT operation serves two purposes:
  4560. // 1. It avoids sending unnecessary bridge traffic to clear a root.
  4561. // 2. It preserves Fiber IDs when remounting (below) which in turn ID to error/warning mapping.
  4562. pushOperation(constants["n" /* TREE_OPERATION_REMOVE_ROOT */]);
  4563. flushPendingEvents(root);
  4564. currentRootID = -1;
  4565. });
  4566. applyComponentFilters(componentFilters); // Reset pseudo counters so that new path selections will be persisted.
  4567. rootDisplayNameCounter.clear(); // Recursively re-mount all roots with new filter criteria applied.
  4568. hook.getFiberRoots(rendererID).forEach(function (root) {
  4569. currentRootID = getOrGenerateFiberID(root.current);
  4570. setRootPseudoKey(currentRootID, root.current);
  4571. mountFiberRecursively(root.current, null, false, false);
  4572. flushPendingEvents(root);
  4573. currentRootID = -1;
  4574. }); // Also re-evaluate all error and warning counts given the new filters.
  4575. reevaluateErrorsAndWarnings();
  4576. flushPendingEvents();
  4577. } // NOTICE Keep in sync with get*ForFiber methods
  4578. function shouldFilterFiber(fiber) {
  4579. var _debugSource = fiber._debugSource,
  4580. tag = fiber.tag,
  4581. type = fiber.type,
  4582. key = fiber.key;
  4583. switch (tag) {
  4584. case DehydratedSuspenseComponent:
  4585. // TODO: ideally we would show dehydrated Suspense immediately.
  4586. // However, it has some special behavior (like disconnecting
  4587. // an alternate and turning into real Suspense) which breaks DevTools.
  4588. // For now, ignore it, and only show it once it gets hydrated.
  4589. // https://github.com/bvaughn/react-devtools-experimental/issues/197
  4590. return true;
  4591. case HostPortal:
  4592. case HostText:
  4593. case LegacyHiddenComponent:
  4594. case OffscreenComponent:
  4595. return true;
  4596. case HostRoot:
  4597. // It is never valid to filter the root element.
  4598. return false;
  4599. case Fragment:
  4600. return key === null;
  4601. default:
  4602. var typeSymbol = getTypeSymbol(type);
  4603. switch (typeSymbol) {
  4604. case ReactSymbols["a" /* CONCURRENT_MODE_NUMBER */]:
  4605. case ReactSymbols["b" /* CONCURRENT_MODE_SYMBOL_STRING */]:
  4606. case ReactSymbols["e" /* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */]:
  4607. case ReactSymbols["s" /* STRICT_MODE_NUMBER */]:
  4608. case ReactSymbols["t" /* STRICT_MODE_SYMBOL_STRING */]:
  4609. return true;
  4610. default:
  4611. break;
  4612. }
  4613. }
  4614. var elementType = getElementTypeForFiber(fiber);
  4615. if (hideElementsWithTypes.has(elementType)) {
  4616. return true;
  4617. }
  4618. if (hideElementsWithDisplayNames.size > 0) {
  4619. var displayName = getDisplayNameForFiber(fiber);
  4620. if (displayName != null) {
  4621. // eslint-disable-next-line no-for-of-loops/no-for-of-loops
  4622. var _iterator3 = _createForOfIteratorHelper(hideElementsWithDisplayNames),
  4623. _step3;
  4624. try {
  4625. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  4626. var displayNameRegExp = _step3.value;
  4627. if (displayNameRegExp.test(displayName)) {
  4628. return true;
  4629. }
  4630. }
  4631. } catch (err) {
  4632. _iterator3.e(err);
  4633. } finally {
  4634. _iterator3.f();
  4635. }
  4636. }
  4637. }
  4638. if (_debugSource != null && hideElementsWithPaths.size > 0) {
  4639. var fileName = _debugSource.fileName; // eslint-disable-next-line no-for-of-loops/no-for-of-loops
  4640. var _iterator4 = _createForOfIteratorHelper(hideElementsWithPaths),
  4641. _step4;
  4642. try {
  4643. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  4644. var pathRegExp = _step4.value;
  4645. if (pathRegExp.test(fileName)) {
  4646. return true;
  4647. }
  4648. }
  4649. } catch (err) {
  4650. _iterator4.e(err);
  4651. } finally {
  4652. _iterator4.f();
  4653. }
  4654. }
  4655. return false;
  4656. } // NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods
  4657. function getElementTypeForFiber(fiber) {
  4658. var type = fiber.type,
  4659. tag = fiber.tag;
  4660. switch (tag) {
  4661. case ClassComponent:
  4662. case IncompleteClassComponent:
  4663. return types["e" /* ElementTypeClass */];
  4664. case FunctionComponent:
  4665. case IndeterminateComponent:
  4666. return types["h" /* ElementTypeFunction */];
  4667. case ForwardRef:
  4668. return types["g" /* ElementTypeForwardRef */];
  4669. case HostRoot:
  4670. return types["m" /* ElementTypeRoot */];
  4671. case HostComponent:
  4672. case HostResource:
  4673. case HostSingleton:
  4674. return types["i" /* ElementTypeHostComponent */];
  4675. case HostPortal:
  4676. case HostText:
  4677. case Fragment:
  4678. return types["k" /* ElementTypeOtherOrUnknown */];
  4679. case MemoComponent:
  4680. case SimpleMemoComponent:
  4681. return types["j" /* ElementTypeMemo */];
  4682. case SuspenseComponent:
  4683. return types["n" /* ElementTypeSuspense */];
  4684. case SuspenseListComponent:
  4685. return types["o" /* ElementTypeSuspenseList */];
  4686. case TracingMarkerComponent:
  4687. return types["p" /* ElementTypeTracingMarker */];
  4688. default:
  4689. var typeSymbol = getTypeSymbol(type);
  4690. switch (typeSymbol) {
  4691. case ReactSymbols["a" /* CONCURRENT_MODE_NUMBER */]:
  4692. case ReactSymbols["b" /* CONCURRENT_MODE_SYMBOL_STRING */]:
  4693. case ReactSymbols["e" /* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */]:
  4694. return types["k" /* ElementTypeOtherOrUnknown */];
  4695. case ReactSymbols["n" /* PROVIDER_NUMBER */]:
  4696. case ReactSymbols["o" /* PROVIDER_SYMBOL_STRING */]:
  4697. return types["f" /* ElementTypeContext */];
  4698. case ReactSymbols["c" /* CONTEXT_NUMBER */]:
  4699. case ReactSymbols["d" /* CONTEXT_SYMBOL_STRING */]:
  4700. return types["f" /* ElementTypeContext */];
  4701. case ReactSymbols["s" /* STRICT_MODE_NUMBER */]:
  4702. case ReactSymbols["t" /* STRICT_MODE_SYMBOL_STRING */]:
  4703. return types["k" /* ElementTypeOtherOrUnknown */];
  4704. case ReactSymbols["l" /* PROFILER_NUMBER */]:
  4705. case ReactSymbols["m" /* PROFILER_SYMBOL_STRING */]:
  4706. return types["l" /* ElementTypeProfiler */];
  4707. default:
  4708. return types["k" /* ElementTypeOtherOrUnknown */];
  4709. }
  4710. }
  4711. } // When profiling is supported, we store the latest tree base durations for each Fiber.
  4712. // This is so that we can quickly capture a snapshot of those values if profiling starts.
  4713. // If we didn't store these values, we'd have to crawl the tree when profiling started,
  4714. // and use a slow path to find each of the current Fibers.
  4715. var idToTreeBaseDurationMap = new Map(); // When profiling is supported, we store the latest tree base durations for each Fiber.
  4716. // This map enables us to filter these times by root when sending them to the frontend.
  4717. var idToRootMap = new Map(); // When a mount or update is in progress, this value tracks the root that is being operated on.
  4718. var currentRootID = -1; // Returns the unique ID for a Fiber or generates and caches a new one if the Fiber hasn't been seen before.
  4719. // Once this method has been called for a Fiber, untrackFiberID() should always be called later to avoid leaking.
  4720. function getOrGenerateFiberID(fiber) {
  4721. var id = null;
  4722. if (fiberToIDMap.has(fiber)) {
  4723. id = fiberToIDMap.get(fiber);
  4724. } else {
  4725. var _alternate = fiber.alternate;
  4726. if (_alternate !== null && fiberToIDMap.has(_alternate)) {
  4727. id = fiberToIDMap.get(_alternate);
  4728. }
  4729. }
  4730. var didGenerateID = false;
  4731. if (id === null) {
  4732. didGenerateID = true;
  4733. id = Object(utils["k" /* getUID */])();
  4734. } // This refinement is for Flow purposes only.
  4735. var refinedID = id; // Make sure we're tracking this Fiber
  4736. // e.g. if it just mounted or an error was logged during initial render.
  4737. if (!fiberToIDMap.has(fiber)) {
  4738. fiberToIDMap.set(fiber, refinedID);
  4739. idToArbitraryFiberMap.set(refinedID, fiber);
  4740. } // Also make sure we're tracking its alternate,
  4741. // e.g. in case this is the first update after mount.
  4742. var alternate = fiber.alternate;
  4743. if (alternate !== null) {
  4744. if (!fiberToIDMap.has(alternate)) {
  4745. fiberToIDMap.set(alternate, refinedID);
  4746. }
  4747. }
  4748. if (constants["s" /* __DEBUG__ */]) {
  4749. if (didGenerateID) {
  4750. debug('getOrGenerateFiberID()', fiber, fiber.return, 'Generated a new UID');
  4751. }
  4752. }
  4753. return refinedID;
  4754. } // Returns an ID if one has already been generated for the Fiber or throws.
  4755. function getFiberIDThrows(fiber) {
  4756. var maybeID = getFiberIDUnsafe(fiber);
  4757. if (maybeID !== null) {
  4758. return maybeID;
  4759. }
  4760. throw Error("Could not find ID for Fiber \"".concat(getDisplayNameForFiber(fiber) || '', "\""));
  4761. } // Returns an ID if one has already been generated for the Fiber or null if one has not been generated.
  4762. // Use this method while e.g. logging to avoid over-retaining Fibers.
  4763. function getFiberIDUnsafe(fiber) {
  4764. if (fiberToIDMap.has(fiber)) {
  4765. return fiberToIDMap.get(fiber);
  4766. } else {
  4767. var alternate = fiber.alternate;
  4768. if (alternate !== null && fiberToIDMap.has(alternate)) {
  4769. return fiberToIDMap.get(alternate);
  4770. }
  4771. }
  4772. return null;
  4773. } // Removes a Fiber (and its alternate) from the Maps used to track their id.
  4774. // This method should always be called when a Fiber is unmounting.
  4775. function untrackFiberID(fiber) {
  4776. if (constants["s" /* __DEBUG__ */]) {
  4777. debug('untrackFiberID()', fiber, fiber.return, 'schedule after delay');
  4778. } // Untrack Fibers after a slight delay in order to support a Fast Refresh edge case:
  4779. // 1. Component type is updated and Fast Refresh schedules an update+remount.
  4780. // 2. flushPendingErrorsAndWarningsAfterDelay() runs, sees the old Fiber is no longer mounted
  4781. // (it's been disconnected by Fast Refresh), and calls untrackFiberID() to clear it from the Map.
  4782. // 3. React flushes pending passive effects before it runs the next render,
  4783. // which logs an error or warning, which causes a new ID to be generated for this Fiber.
  4784. // 4. DevTools now tries to unmount the old Component with the new ID.
  4785. //
  4786. // The underlying problem here is the premature clearing of the Fiber ID,
  4787. // but DevTools has no way to detect that a given Fiber has been scheduled for Fast Refresh.
  4788. // (The "_debugNeedsRemount" flag won't necessarily be set.)
  4789. //
  4790. // The best we can do is to delay untracking by a small amount,
  4791. // and give React time to process the Fast Refresh delay.
  4792. untrackFibersSet.add(fiber); // React may detach alternate pointers during unmount;
  4793. // Since our untracking code is async, we should explicily track the pending alternate here as well.
  4794. var alternate = fiber.alternate;
  4795. if (alternate !== null) {
  4796. untrackFibersSet.add(alternate);
  4797. }
  4798. if (untrackFibersTimeoutID === null) {
  4799. untrackFibersTimeoutID = setTimeout(untrackFibers, 1000);
  4800. }
  4801. }
  4802. var untrackFibersSet = new Set();
  4803. var untrackFibersTimeoutID = null;
  4804. function untrackFibers() {
  4805. if (untrackFibersTimeoutID !== null) {
  4806. clearTimeout(untrackFibersTimeoutID);
  4807. untrackFibersTimeoutID = null;
  4808. }
  4809. untrackFibersSet.forEach(function (fiber) {
  4810. var fiberID = getFiberIDUnsafe(fiber);
  4811. if (fiberID !== null) {
  4812. idToArbitraryFiberMap.delete(fiberID); // Also clear any errors/warnings associated with this fiber.
  4813. clearErrorsForFiberID(fiberID);
  4814. clearWarningsForFiberID(fiberID);
  4815. }
  4816. fiberToIDMap.delete(fiber);
  4817. var alternate = fiber.alternate;
  4818. if (alternate !== null) {
  4819. fiberToIDMap.delete(alternate);
  4820. }
  4821. if (forceErrorForFiberIDs.has(fiberID)) {
  4822. forceErrorForFiberIDs.delete(fiberID);
  4823. if (forceErrorForFiberIDs.size === 0 && setErrorHandler != null) {
  4824. setErrorHandler(shouldErrorFiberAlwaysNull);
  4825. }
  4826. }
  4827. });
  4828. untrackFibersSet.clear();
  4829. }
  4830. function getChangeDescription(prevFiber, nextFiber) {
  4831. switch (getElementTypeForFiber(nextFiber)) {
  4832. case types["e" /* ElementTypeClass */]:
  4833. case types["h" /* ElementTypeFunction */]:
  4834. case types["j" /* ElementTypeMemo */]:
  4835. case types["g" /* ElementTypeForwardRef */]:
  4836. if (prevFiber === null) {
  4837. return {
  4838. context: null,
  4839. didHooksChange: false,
  4840. isFirstMount: true,
  4841. props: null,
  4842. state: null
  4843. };
  4844. } else {
  4845. var data = {
  4846. context: getContextChangedKeys(nextFiber),
  4847. didHooksChange: false,
  4848. isFirstMount: false,
  4849. props: getChangedKeys(prevFiber.memoizedProps, nextFiber.memoizedProps),
  4850. state: getChangedKeys(prevFiber.memoizedState, nextFiber.memoizedState)
  4851. }; // Only traverse the hooks list once, depending on what info we're returning.
  4852. if (DevToolsFeatureFlags_core_oss["b" /* enableProfilerChangedHookIndices */]) {
  4853. var indices = getChangedHooksIndices(prevFiber.memoizedState, nextFiber.memoizedState);
  4854. data.hooks = indices;
  4855. data.didHooksChange = indices !== null && indices.length > 0;
  4856. } else {
  4857. data.didHooksChange = didHooksChange(prevFiber.memoizedState, nextFiber.memoizedState);
  4858. }
  4859. return data;
  4860. }
  4861. default:
  4862. return null;
  4863. }
  4864. }
  4865. function updateContextsForFiber(fiber) {
  4866. switch (getElementTypeForFiber(fiber)) {
  4867. case types["e" /* ElementTypeClass */]:
  4868. case types["g" /* ElementTypeForwardRef */]:
  4869. case types["h" /* ElementTypeFunction */]:
  4870. case types["j" /* ElementTypeMemo */]:
  4871. if (idToContextsMap !== null) {
  4872. var id = getFiberIDThrows(fiber);
  4873. var contexts = getContextsForFiber(fiber);
  4874. if (contexts !== null) {
  4875. // $FlowFixMe[incompatible-use] found when upgrading Flow
  4876. idToContextsMap.set(id, contexts);
  4877. }
  4878. }
  4879. break;
  4880. default:
  4881. break;
  4882. }
  4883. } // Differentiates between a null context value and no context.
  4884. var NO_CONTEXT = {};
  4885. function getContextsForFiber(fiber) {
  4886. var legacyContext = NO_CONTEXT;
  4887. var modernContext = NO_CONTEXT;
  4888. switch (getElementTypeForFiber(fiber)) {
  4889. case types["e" /* ElementTypeClass */]:
  4890. var instance = fiber.stateNode;
  4891. if (instance != null) {
  4892. if (instance.constructor && instance.constructor.contextType != null) {
  4893. modernContext = instance.context;
  4894. } else {
  4895. legacyContext = instance.context;
  4896. if (legacyContext && Object.keys(legacyContext).length === 0) {
  4897. legacyContext = NO_CONTEXT;
  4898. }
  4899. }
  4900. }
  4901. return [legacyContext, modernContext];
  4902. case types["g" /* ElementTypeForwardRef */]:
  4903. case types["h" /* ElementTypeFunction */]:
  4904. case types["j" /* ElementTypeMemo */]:
  4905. var dependencies = fiber.dependencies;
  4906. if (dependencies && dependencies.firstContext) {
  4907. modernContext = dependencies.firstContext;
  4908. }
  4909. return [legacyContext, modernContext];
  4910. default:
  4911. return null;
  4912. }
  4913. } // Record all contexts at the time profiling is started.
  4914. // Fibers only store the current context value,
  4915. // so we need to track them separately in order to determine changed keys.
  4916. function crawlToInitializeContextsMap(fiber) {
  4917. var id = getFiberIDUnsafe(fiber); // Not all Fibers in the subtree have mounted yet.
  4918. // For example, Offscreen (hidden) or Suspense (suspended) subtrees won't yet be tracked.
  4919. // We can safely skip these subtrees.
  4920. if (id !== null) {
  4921. updateContextsForFiber(fiber);
  4922. var current = fiber.child;
  4923. while (current !== null) {
  4924. crawlToInitializeContextsMap(current);
  4925. current = current.sibling;
  4926. }
  4927. }
  4928. }
  4929. function getContextChangedKeys(fiber) {
  4930. if (idToContextsMap !== null) {
  4931. var id = getFiberIDThrows(fiber); // $FlowFixMe[incompatible-use] found when upgrading Flow
  4932. var prevContexts = idToContextsMap.has(id) ? // $FlowFixMe[incompatible-use] found when upgrading Flow
  4933. idToContextsMap.get(id) : null;
  4934. var nextContexts = getContextsForFiber(fiber);
  4935. if (prevContexts == null || nextContexts == null) {
  4936. return null;
  4937. }
  4938. var _prevContexts = renderer_slicedToArray(prevContexts, 2),
  4939. prevLegacyContext = _prevContexts[0],
  4940. prevModernContext = _prevContexts[1];
  4941. var _nextContexts = renderer_slicedToArray(nextContexts, 2),
  4942. nextLegacyContext = _nextContexts[0],
  4943. nextModernContext = _nextContexts[1];
  4944. switch (getElementTypeForFiber(fiber)) {
  4945. case types["e" /* ElementTypeClass */]:
  4946. if (prevContexts && nextContexts) {
  4947. if (nextLegacyContext !== NO_CONTEXT) {
  4948. return getChangedKeys(prevLegacyContext, nextLegacyContext);
  4949. } else if (nextModernContext !== NO_CONTEXT) {
  4950. return prevModernContext !== nextModernContext;
  4951. }
  4952. }
  4953. break;
  4954. case types["g" /* ElementTypeForwardRef */]:
  4955. case types["h" /* ElementTypeFunction */]:
  4956. case types["j" /* ElementTypeMemo */]:
  4957. if (nextModernContext !== NO_CONTEXT) {
  4958. var prevContext = prevModernContext;
  4959. var nextContext = nextModernContext;
  4960. while (prevContext && nextContext) {
  4961. // Note this only works for versions of React that support this key (e.v. 18+)
  4962. // For older versions, there's no good way to read the current context value after render has completed.
  4963. // This is because React maintains a stack of context values during render,
  4964. // but by the time DevTools is called, render has finished and the stack is empty.
  4965. if (!shared_objectIs(prevContext.memoizedValue, nextContext.memoizedValue)) {
  4966. return true;
  4967. }
  4968. prevContext = prevContext.next;
  4969. nextContext = nextContext.next;
  4970. }
  4971. return false;
  4972. }
  4973. break;
  4974. default:
  4975. break;
  4976. }
  4977. }
  4978. return null;
  4979. }
  4980. function isHookThatCanScheduleUpdate(hookObject) {
  4981. var queue = hookObject.queue;
  4982. if (!queue) {
  4983. return false;
  4984. }
  4985. var boundHasOwnProperty = shared_hasOwnProperty.bind(queue); // Detect the shape of useState() or useReducer()
  4986. // using the attributes that are unique to these hooks
  4987. // but also stable (e.g. not tied to current Lanes implementation)
  4988. var isStateOrReducer = boundHasOwnProperty('pending') && boundHasOwnProperty('dispatch') && typeof queue.dispatch === 'function'; // Detect useSyncExternalStore()
  4989. var isSyncExternalStore = boundHasOwnProperty('value') && boundHasOwnProperty('getSnapshot') && typeof queue.getSnapshot === 'function'; // These are the only types of hooks that can schedule an update.
  4990. return isStateOrReducer || isSyncExternalStore;
  4991. }
  4992. function didStatefulHookChange(prev, next) {
  4993. var prevMemoizedState = prev.memoizedState;
  4994. var nextMemoizedState = next.memoizedState;
  4995. if (isHookThatCanScheduleUpdate(prev)) {
  4996. return prevMemoizedState !== nextMemoizedState;
  4997. }
  4998. return false;
  4999. }
  5000. function didHooksChange(prev, next) {
  5001. if (prev == null || next == null) {
  5002. return false;
  5003. } // We can't report anything meaningful for hooks changes.
  5004. if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) {
  5005. while (next !== null) {
  5006. if (didStatefulHookChange(prev, next)) {
  5007. return true;
  5008. } else {
  5009. next = next.next;
  5010. prev = prev.next;
  5011. }
  5012. }
  5013. }
  5014. return false;
  5015. }
  5016. function getChangedHooksIndices(prev, next) {
  5017. if (DevToolsFeatureFlags_core_oss["b" /* enableProfilerChangedHookIndices */]) {
  5018. if (prev == null || next == null) {
  5019. return null;
  5020. }
  5021. var indices = [];
  5022. var index = 0;
  5023. if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) {
  5024. while (next !== null) {
  5025. if (didStatefulHookChange(prev, next)) {
  5026. indices.push(index);
  5027. }
  5028. next = next.next;
  5029. prev = prev.next;
  5030. index++;
  5031. }
  5032. }
  5033. return indices;
  5034. }
  5035. return null;
  5036. }
  5037. function getChangedKeys(prev, next) {
  5038. if (prev == null || next == null) {
  5039. return null;
  5040. } // We can't report anything meaningful for hooks changes.
  5041. if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) {
  5042. return null;
  5043. }
  5044. var keys = new Set([].concat(_toConsumableArray(Object.keys(prev)), _toConsumableArray(Object.keys(next))));
  5045. var changedKeys = []; // eslint-disable-next-line no-for-of-loops/no-for-of-loops
  5046. var _iterator5 = _createForOfIteratorHelper(keys),
  5047. _step5;
  5048. try {
  5049. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  5050. var key = _step5.value;
  5051. if (prev[key] !== next[key]) {
  5052. changedKeys.push(key);
  5053. }
  5054. }
  5055. } catch (err) {
  5056. _iterator5.e(err);
  5057. } finally {
  5058. _iterator5.f();
  5059. }
  5060. return changedKeys;
  5061. } // eslint-disable-next-line no-unused-vars
  5062. function didFiberRender(prevFiber, nextFiber) {
  5063. switch (nextFiber.tag) {
  5064. case ClassComponent:
  5065. case FunctionComponent:
  5066. case ContextConsumer:
  5067. case MemoComponent:
  5068. case SimpleMemoComponent:
  5069. case ForwardRef:
  5070. // For types that execute user code, we check PerformedWork effect.
  5071. // We don't reflect bailouts (either referential or sCU) in DevTools.
  5072. // eslint-disable-next-line no-bitwise
  5073. return (getFiberFlags(nextFiber) & PerformedWork) === PerformedWork;
  5074. // Note: ContextConsumer only gets PerformedWork effect in 16.3.3+
  5075. // so it won't get highlighted with React 16.3.0 to 16.3.2.
  5076. default:
  5077. // For host components and other types, we compare inputs
  5078. // to determine whether something is an update.
  5079. return prevFiber.memoizedProps !== nextFiber.memoizedProps || prevFiber.memoizedState !== nextFiber.memoizedState || prevFiber.ref !== nextFiber.ref;
  5080. }
  5081. }
  5082. var pendingOperations = [];
  5083. var pendingRealUnmountedIDs = [];
  5084. var pendingSimulatedUnmountedIDs = [];
  5085. var pendingOperationsQueue = [];
  5086. var pendingStringTable = new Map();
  5087. var pendingStringTableLength = 0;
  5088. var pendingUnmountedRootID = null;
  5089. function pushOperation(op) {
  5090. if (false) {}
  5091. pendingOperations.push(op);
  5092. }
  5093. function shouldBailoutWithPendingOperations() {
  5094. if (isProfiling) {
  5095. if (currentCommitProfilingMetadata != null && currentCommitProfilingMetadata.durations.length > 0) {
  5096. return false;
  5097. }
  5098. }
  5099. return pendingOperations.length === 0 && pendingRealUnmountedIDs.length === 0 && pendingSimulatedUnmountedIDs.length === 0 && pendingUnmountedRootID === null;
  5100. }
  5101. function flushOrQueueOperations(operations) {
  5102. if (shouldBailoutWithPendingOperations()) {
  5103. return;
  5104. }
  5105. if (pendingOperationsQueue !== null) {
  5106. pendingOperationsQueue.push(operations);
  5107. } else {
  5108. hook.emit('operations', operations);
  5109. }
  5110. }
  5111. var flushPendingErrorsAndWarningsAfterDelayTimeoutID = null;
  5112. function clearPendingErrorsAndWarningsAfterDelay() {
  5113. if (flushPendingErrorsAndWarningsAfterDelayTimeoutID !== null) {
  5114. clearTimeout(flushPendingErrorsAndWarningsAfterDelayTimeoutID);
  5115. flushPendingErrorsAndWarningsAfterDelayTimeoutID = null;
  5116. }
  5117. }
  5118. function flushPendingErrorsAndWarningsAfterDelay() {
  5119. clearPendingErrorsAndWarningsAfterDelay();
  5120. flushPendingErrorsAndWarningsAfterDelayTimeoutID = setTimeout(function () {
  5121. flushPendingErrorsAndWarningsAfterDelayTimeoutID = null;
  5122. if (pendingOperations.length > 0) {
  5123. // On the off chance that something else has pushed pending operations,
  5124. // we should bail on warnings; it's probably not safe to push midway.
  5125. return;
  5126. }
  5127. recordPendingErrorsAndWarnings();
  5128. if (shouldBailoutWithPendingOperations()) {
  5129. // No warnings or errors to flush; we can bail out early here too.
  5130. return;
  5131. } // We can create a smaller operations array than flushPendingEvents()
  5132. // because we only need to flush warning and error counts.
  5133. // Only a few pieces of fixed information are required up front.
  5134. var operations = new Array(3 + pendingOperations.length);
  5135. operations[0] = rendererID;
  5136. operations[1] = currentRootID;
  5137. operations[2] = 0; // String table size
  5138. for (var j = 0; j < pendingOperations.length; j++) {
  5139. operations[3 + j] = pendingOperations[j];
  5140. }
  5141. flushOrQueueOperations(operations);
  5142. pendingOperations.length = 0;
  5143. }, 1000);
  5144. }
  5145. function reevaluateErrorsAndWarnings() {
  5146. fibersWithChangedErrorOrWarningCounts.clear();
  5147. fiberIDToErrorsMap.forEach(function (countMap, fiberID) {
  5148. var fiber = idToArbitraryFiberMap.get(fiberID);
  5149. if (fiber != null) {
  5150. fibersWithChangedErrorOrWarningCounts.add(fiber);
  5151. }
  5152. });
  5153. fiberIDToWarningsMap.forEach(function (countMap, fiberID) {
  5154. var fiber = idToArbitraryFiberMap.get(fiberID);
  5155. if (fiber != null) {
  5156. fibersWithChangedErrorOrWarningCounts.add(fiber);
  5157. }
  5158. });
  5159. recordPendingErrorsAndWarnings();
  5160. }
  5161. function mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToMessageCountMap, fiberIDToMessageCountMap) {
  5162. var newCount = 0;
  5163. var messageCountMap = fiberIDToMessageCountMap.get(fiberID);
  5164. var pendingMessageCountMap = pendingFiberToMessageCountMap.get(fiber);
  5165. if (pendingMessageCountMap != null) {
  5166. if (messageCountMap == null) {
  5167. messageCountMap = pendingMessageCountMap;
  5168. fiberIDToMessageCountMap.set(fiberID, pendingMessageCountMap);
  5169. } else {
  5170. // This Flow refinement should not be necessary and yet...
  5171. var refinedMessageCountMap = messageCountMap;
  5172. pendingMessageCountMap.forEach(function (pendingCount, message) {
  5173. var previousCount = refinedMessageCountMap.get(message) || 0;
  5174. refinedMessageCountMap.set(message, previousCount + pendingCount);
  5175. });
  5176. }
  5177. }
  5178. if (!shouldFilterFiber(fiber)) {
  5179. if (messageCountMap != null) {
  5180. messageCountMap.forEach(function (count) {
  5181. newCount += count;
  5182. });
  5183. }
  5184. }
  5185. pendingFiberToMessageCountMap.delete(fiber);
  5186. return newCount;
  5187. }
  5188. function recordPendingErrorsAndWarnings() {
  5189. clearPendingErrorsAndWarningsAfterDelay();
  5190. fibersWithChangedErrorOrWarningCounts.forEach(function (fiber) {
  5191. var fiberID = getFiberIDUnsafe(fiber);
  5192. if (fiberID === null) {// Don't send updates for Fibers that didn't mount due to e.g. Suspense or an error boundary.
  5193. } else {
  5194. var errorCount = mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToErrorsMap, fiberIDToErrorsMap);
  5195. var warningCount = mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToWarningsMap, fiberIDToWarningsMap);
  5196. pushOperation(constants["q" /* TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS */]);
  5197. pushOperation(fiberID);
  5198. pushOperation(errorCount);
  5199. pushOperation(warningCount);
  5200. } // Always clean up so that we don't leak.
  5201. pendingFiberToErrorsMap.delete(fiber);
  5202. pendingFiberToWarningsMap.delete(fiber);
  5203. });
  5204. fibersWithChangedErrorOrWarningCounts.clear();
  5205. }
  5206. function flushPendingEvents(root) {
  5207. // Add any pending errors and warnings to the operations array.
  5208. // We do this just before flushing, so we can ignore errors for no-longer-mounted Fibers.
  5209. recordPendingErrorsAndWarnings();
  5210. if (shouldBailoutWithPendingOperations()) {
  5211. // If we aren't profiling, we can just bail out here.
  5212. // No use sending an empty update over the bridge.
  5213. //
  5214. // The Profiler stores metadata for each commit and reconstructs the app tree per commit using:
  5215. // (1) an initial tree snapshot and
  5216. // (2) the operations array for each commit
  5217. // Because of this, it's important that the operations and metadata arrays align,
  5218. // So it's important not to omit even empty operations while profiling is active.
  5219. return;
  5220. }
  5221. var numUnmountIDs = pendingRealUnmountedIDs.length + pendingSimulatedUnmountedIDs.length + (pendingUnmountedRootID === null ? 0 : 1);
  5222. var operations = new Array( // Identify which renderer this update is coming from.
  5223. 2 + // [rendererID, rootFiberID]
  5224. // How big is the string table?
  5225. 1 + // [stringTableLength]
  5226. // Then goes the actual string table.
  5227. pendingStringTableLength + ( // All unmounts are batched in a single message.
  5228. // [TREE_OPERATION_REMOVE, removedIDLength, ...ids]
  5229. numUnmountIDs > 0 ? 2 + numUnmountIDs : 0) + // Regular operations
  5230. pendingOperations.length); // Identify which renderer this update is coming from.
  5231. // This enables roots to be mapped to renderers,
  5232. // Which in turn enables fiber props, states, and hooks to be inspected.
  5233. var i = 0;
  5234. operations[i++] = rendererID;
  5235. operations[i++] = currentRootID; // Now fill in the string table.
  5236. // [stringTableLength, str1Length, ...str1, str2Length, ...str2, ...]
  5237. operations[i++] = pendingStringTableLength;
  5238. pendingStringTable.forEach(function (entry, stringKey) {
  5239. var encodedString = entry.encodedString; // Don't use the string length.
  5240. // It won't work for multibyte characters (like emoji).
  5241. var length = encodedString.length;
  5242. operations[i++] = length;
  5243. for (var j = 0; j < length; j++) {
  5244. operations[i + j] = encodedString[j];
  5245. }
  5246. i += length;
  5247. });
  5248. if (numUnmountIDs > 0) {
  5249. // All unmounts except roots are batched in a single message.
  5250. operations[i++] = constants["m" /* TREE_OPERATION_REMOVE */]; // The first number is how many unmounted IDs we're gonna send.
  5251. operations[i++] = numUnmountIDs; // Fill in the real unmounts in the reverse order.
  5252. // They were inserted parents-first by React, but we want children-first.
  5253. // So we traverse our array backwards.
  5254. for (var j = pendingRealUnmountedIDs.length - 1; j >= 0; j--) {
  5255. operations[i++] = pendingRealUnmountedIDs[j];
  5256. } // Fill in the simulated unmounts (hidden Suspense subtrees) in their order.
  5257. // (We want children to go before parents.)
  5258. // They go *after* the real unmounts because we know for sure they won't be
  5259. // children of already pushed "real" IDs. If they were, we wouldn't be able
  5260. // to discover them during the traversal, as they would have been deleted.
  5261. for (var _j = 0; _j < pendingSimulatedUnmountedIDs.length; _j++) {
  5262. operations[i + _j] = pendingSimulatedUnmountedIDs[_j];
  5263. }
  5264. i += pendingSimulatedUnmountedIDs.length; // The root ID should always be unmounted last.
  5265. if (pendingUnmountedRootID !== null) {
  5266. operations[i] = pendingUnmountedRootID;
  5267. i++;
  5268. }
  5269. } // Fill in the rest of the operations.
  5270. for (var _j2 = 0; _j2 < pendingOperations.length; _j2++) {
  5271. operations[i + _j2] = pendingOperations[_j2];
  5272. }
  5273. i += pendingOperations.length; // Let the frontend know about tree operations.
  5274. flushOrQueueOperations(operations); // Reset all of the pending state now that we've told the frontend about it.
  5275. pendingOperations.length = 0;
  5276. pendingRealUnmountedIDs.length = 0;
  5277. pendingSimulatedUnmountedIDs.length = 0;
  5278. pendingUnmountedRootID = null;
  5279. pendingStringTable.clear();
  5280. pendingStringTableLength = 0;
  5281. }
  5282. function getStringID(string) {
  5283. if (string === null) {
  5284. return 0;
  5285. }
  5286. var existingEntry = pendingStringTable.get(string);
  5287. if (existingEntry !== undefined) {
  5288. return existingEntry.id;
  5289. }
  5290. var id = pendingStringTable.size + 1;
  5291. var encodedString = Object(utils["p" /* utfEncodeString */])(string);
  5292. pendingStringTable.set(string, {
  5293. encodedString: encodedString,
  5294. id: id
  5295. }); // The string table total length needs to account both for the string length,
  5296. // and for the array item that contains the length itself.
  5297. //
  5298. // Don't use string length for this table.
  5299. // It won't work for multibyte characters (like emoji).
  5300. pendingStringTableLength += encodedString.length + 1;
  5301. return id;
  5302. }
  5303. function recordMount(fiber, parentFiber) {
  5304. var isRoot = fiber.tag === HostRoot;
  5305. var id = getOrGenerateFiberID(fiber);
  5306. if (constants["s" /* __DEBUG__ */]) {
  5307. debug('recordMount()', fiber, parentFiber);
  5308. }
  5309. var hasOwnerMetadata = fiber.hasOwnProperty('_debugOwner');
  5310. var isProfilingSupported = fiber.hasOwnProperty('treeBaseDuration'); // Adding a new field here would require a bridge protocol version bump (a backwads breaking change).
  5311. // Instead let's re-purpose a pre-existing field to carry more information.
  5312. var profilingFlags = 0;
  5313. if (isProfilingSupported) {
  5314. profilingFlags = constants["g" /* PROFILING_FLAG_BASIC_SUPPORT */];
  5315. if (typeof injectProfilingHooks === 'function') {
  5316. profilingFlags |= constants["h" /* PROFILING_FLAG_TIMELINE_SUPPORT */];
  5317. }
  5318. }
  5319. if (isRoot) {
  5320. pushOperation(constants["l" /* TREE_OPERATION_ADD */]);
  5321. pushOperation(id);
  5322. pushOperation(types["m" /* ElementTypeRoot */]);
  5323. pushOperation((fiber.mode & StrictModeBits) !== 0 ? 1 : 0);
  5324. pushOperation(profilingFlags);
  5325. pushOperation(StrictModeBits !== 0 ? 1 : 0);
  5326. pushOperation(hasOwnerMetadata ? 1 : 0);
  5327. if (isProfiling) {
  5328. if (displayNamesByRootID !== null) {
  5329. displayNamesByRootID.set(id, getDisplayNameForRoot(fiber));
  5330. }
  5331. }
  5332. } else {
  5333. var key = fiber.key;
  5334. var displayName = getDisplayNameForFiber(fiber);
  5335. var elementType = getElementTypeForFiber(fiber);
  5336. var _debugOwner = fiber._debugOwner; // Ideally we should call getFiberIDThrows() for _debugOwner,
  5337. // since owners are almost always higher in the tree (and so have already been processed),
  5338. // but in some (rare) instances reported in open source, a descendant mounts before an owner.
  5339. // Since this is a DEV only field it's probably okay to also just lazily generate and ID here if needed.
  5340. // See https://github.com/facebook/react/issues/21445
  5341. var ownerID = _debugOwner != null ? getOrGenerateFiberID(_debugOwner) : 0;
  5342. var parentID = parentFiber ? getFiberIDThrows(parentFiber) : 0;
  5343. var displayNameStringID = getStringID(displayName); // This check is a guard to handle a React element that has been modified
  5344. // in such a way as to bypass the default stringification of the "key" property.
  5345. var keyString = key === null ? null : String(key);
  5346. var keyStringID = getStringID(keyString);
  5347. pushOperation(constants["l" /* TREE_OPERATION_ADD */]);
  5348. pushOperation(id);
  5349. pushOperation(elementType);
  5350. pushOperation(parentID);
  5351. pushOperation(ownerID);
  5352. pushOperation(displayNameStringID);
  5353. pushOperation(keyStringID); // If this subtree has a new mode, let the frontend know.
  5354. if ((fiber.mode & StrictModeBits) !== 0 && (parentFiber.mode & StrictModeBits) === 0) {
  5355. pushOperation(constants["p" /* TREE_OPERATION_SET_SUBTREE_MODE */]);
  5356. pushOperation(id);
  5357. pushOperation(types["q" /* StrictMode */]);
  5358. }
  5359. }
  5360. if (isProfilingSupported) {
  5361. idToRootMap.set(id, currentRootID);
  5362. recordProfilingDurations(fiber);
  5363. }
  5364. }
  5365. function recordUnmount(fiber, isSimulated) {
  5366. if (constants["s" /* __DEBUG__ */]) {
  5367. debug('recordUnmount()', fiber, null, isSimulated ? 'unmount is simulated' : '');
  5368. }
  5369. if (trackedPathMatchFiber !== null) {
  5370. // We're in the process of trying to restore previous selection.
  5371. // If this fiber matched but is being unmounted, there's no use trying.
  5372. // Reset the state so we don't keep holding onto it.
  5373. if (fiber === trackedPathMatchFiber || fiber === trackedPathMatchFiber.alternate) {
  5374. setTrackedPath(null);
  5375. }
  5376. }
  5377. var unsafeID = getFiberIDUnsafe(fiber);
  5378. if (unsafeID === null) {
  5379. // If we've never seen this Fiber, it might be inside of a legacy render Suspense fragment (so the store is not even aware of it).
  5380. // In that case we can just ignore it or it will cause errors later on.
  5381. // One example of this is a Lazy component that never resolves before being unmounted.
  5382. //
  5383. // This also might indicate a Fast Refresh force-remount scenario.
  5384. //
  5385. // TODO: This is fragile and can obscure actual bugs.
  5386. return;
  5387. } // Flow refinement.
  5388. var id = unsafeID;
  5389. var isRoot = fiber.tag === HostRoot;
  5390. if (isRoot) {
  5391. // Roots must be removed only after all children (pending and simulated) have been removed.
  5392. // So we track it separately.
  5393. pendingUnmountedRootID = id;
  5394. } else if (!shouldFilterFiber(fiber)) {
  5395. // To maintain child-first ordering,
  5396. // we'll push it into one of these queues,
  5397. // and later arrange them in the correct order.
  5398. if (isSimulated) {
  5399. pendingSimulatedUnmountedIDs.push(id);
  5400. } else {
  5401. pendingRealUnmountedIDs.push(id);
  5402. }
  5403. }
  5404. if (!fiber._debugNeedsRemount) {
  5405. untrackFiberID(fiber);
  5406. var isProfilingSupported = fiber.hasOwnProperty('treeBaseDuration');
  5407. if (isProfilingSupported) {
  5408. idToRootMap.delete(id);
  5409. idToTreeBaseDurationMap.delete(id);
  5410. }
  5411. }
  5412. }
  5413. function mountFiberRecursively(firstChild, parentFiber, traverseSiblings, traceNearestHostComponentUpdate) {
  5414. // Iterate over siblings rather than recursing.
  5415. // This reduces the chance of stack overflow for wide trees (e.g. lists with many items).
  5416. var fiber = firstChild;
  5417. while (fiber !== null) {
  5418. // Generate an ID even for filtered Fibers, in case it's needed later (e.g. for Profiling).
  5419. getOrGenerateFiberID(fiber);
  5420. if (constants["s" /* __DEBUG__ */]) {
  5421. debug('mountFiberRecursively()', fiber, parentFiber);
  5422. } // If we have the tree selection from previous reload, try to match this Fiber.
  5423. // Also remember whether to do the same for siblings.
  5424. var mightSiblingsBeOnTrackedPath = updateTrackedPathStateBeforeMount(fiber);
  5425. var shouldIncludeInTree = !shouldFilterFiber(fiber);
  5426. if (shouldIncludeInTree) {
  5427. recordMount(fiber, parentFiber);
  5428. }
  5429. if (traceUpdatesEnabled) {
  5430. if (traceNearestHostComponentUpdate) {
  5431. var elementType = getElementTypeForFiber(fiber); // If an ancestor updated, we should mark the nearest host nodes for highlighting.
  5432. if (elementType === types["i" /* ElementTypeHostComponent */]) {
  5433. traceUpdatesForNodes.add(fiber.stateNode);
  5434. traceNearestHostComponentUpdate = false;
  5435. }
  5436. } // We intentionally do not re-enable the traceNearestHostComponentUpdate flag in this branch,
  5437. // because we don't want to highlight every host node inside of a newly mounted subtree.
  5438. }
  5439. var isSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent;
  5440. if (isSuspense) {
  5441. var isTimedOut = fiber.memoizedState !== null;
  5442. if (isTimedOut) {
  5443. // Special case: if Suspense mounts in a timed-out state,
  5444. // get the fallback child from the inner fragment and mount
  5445. // it as if it was our own child. Updates handle this too.
  5446. var primaryChildFragment = fiber.child;
  5447. var fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null;
  5448. var fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null;
  5449. if (fallbackChild !== null) {
  5450. mountFiberRecursively(fallbackChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate);
  5451. }
  5452. } else {
  5453. var primaryChild = null;
  5454. var areSuspenseChildrenConditionallyWrapped = OffscreenComponent === -1;
  5455. if (areSuspenseChildrenConditionallyWrapped) {
  5456. primaryChild = fiber.child;
  5457. } else if (fiber.child !== null) {
  5458. primaryChild = fiber.child.child;
  5459. }
  5460. if (primaryChild !== null) {
  5461. mountFiberRecursively(primaryChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate);
  5462. }
  5463. }
  5464. } else {
  5465. if (fiber.child !== null) {
  5466. mountFiberRecursively(fiber.child, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate);
  5467. }
  5468. } // We're exiting this Fiber now, and entering its siblings.
  5469. // If we have selection to restore, we might need to re-activate tracking.
  5470. updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath);
  5471. fiber = traverseSiblings ? fiber.sibling : null;
  5472. }
  5473. } // We use this to simulate unmounting for Suspense trees
  5474. // when we switch from primary to fallback.
  5475. function unmountFiberChildrenRecursively(fiber) {
  5476. if (constants["s" /* __DEBUG__ */]) {
  5477. debug('unmountFiberChildrenRecursively()', fiber);
  5478. } // We might meet a nested Suspense on our way.
  5479. var isTimedOutSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent && fiber.memoizedState !== null;
  5480. var child = fiber.child;
  5481. if (isTimedOutSuspense) {
  5482. // If it's showing fallback tree, let's traverse it instead.
  5483. var primaryChildFragment = fiber.child;
  5484. var fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; // Skip over to the real Fiber child.
  5485. child = fallbackChildFragment ? fallbackChildFragment.child : null;
  5486. }
  5487. while (child !== null) {
  5488. // Record simulated unmounts children-first.
  5489. // We skip nodes without return because those are real unmounts.
  5490. if (child.return !== null) {
  5491. unmountFiberChildrenRecursively(child);
  5492. recordUnmount(child, true);
  5493. }
  5494. child = child.sibling;
  5495. }
  5496. }
  5497. function recordProfilingDurations(fiber) {
  5498. var id = getFiberIDThrows(fiber);
  5499. var actualDuration = fiber.actualDuration,
  5500. treeBaseDuration = fiber.treeBaseDuration;
  5501. idToTreeBaseDurationMap.set(id, treeBaseDuration || 0);
  5502. if (isProfiling) {
  5503. var alternate = fiber.alternate; // It's important to update treeBaseDuration even if the current Fiber did not render,
  5504. // because it's possible that one of its descendants did.
  5505. if (alternate == null || treeBaseDuration !== alternate.treeBaseDuration) {
  5506. // Tree base duration updates are included in the operations typed array.
  5507. // So we have to convert them from milliseconds to microseconds so we can send them as ints.
  5508. var convertedTreeBaseDuration = Math.floor((treeBaseDuration || 0) * 1000);
  5509. pushOperation(constants["r" /* TREE_OPERATION_UPDATE_TREE_BASE_DURATION */]);
  5510. pushOperation(id);
  5511. pushOperation(convertedTreeBaseDuration);
  5512. }
  5513. if (alternate == null || didFiberRender(alternate, fiber)) {
  5514. if (actualDuration != null) {
  5515. // The actual duration reported by React includes time spent working on children.
  5516. // This is useful information, but it's also useful to be able to exclude child durations.
  5517. // The frontend can't compute this, since the immediate children may have been filtered out.
  5518. // So we need to do this on the backend.
  5519. // Note that this calculated self duration is not the same thing as the base duration.
  5520. // The two are calculated differently (tree duration does not accumulate).
  5521. var selfDuration = actualDuration;
  5522. var child = fiber.child;
  5523. while (child !== null) {
  5524. selfDuration -= child.actualDuration || 0;
  5525. child = child.sibling;
  5526. } // If profiling is active, store durations for elements that were rendered during the commit.
  5527. // Note that we should do this for any fiber we performed work on, regardless of its actualDuration value.
  5528. // In some cases actualDuration might be 0 for fibers we worked on (particularly if we're using Date.now)
  5529. // In other cases (e.g. Memo) actualDuration might be greater than 0 even if we "bailed out".
  5530. var metadata = currentCommitProfilingMetadata;
  5531. metadata.durations.push(id, actualDuration, selfDuration);
  5532. metadata.maxActualDuration = Math.max(metadata.maxActualDuration, actualDuration);
  5533. if (recordChangeDescriptions) {
  5534. var changeDescription = getChangeDescription(alternate, fiber);
  5535. if (changeDescription !== null) {
  5536. if (metadata.changeDescriptions !== null) {
  5537. metadata.changeDescriptions.set(id, changeDescription);
  5538. }
  5539. }
  5540. updateContextsForFiber(fiber);
  5541. }
  5542. }
  5543. }
  5544. }
  5545. }
  5546. function recordResetChildren(fiber, childSet) {
  5547. if (constants["s" /* __DEBUG__ */]) {
  5548. debug('recordResetChildren()', childSet, fiber);
  5549. } // The frontend only really cares about the displayName, key, and children.
  5550. // The first two don't really change, so we are only concerned with the order of children here.
  5551. // This is trickier than a simple comparison though, since certain types of fibers are filtered.
  5552. var nextChildren = []; // This is a naive implementation that shallowly recourses children.
  5553. // We might want to revisit this if it proves to be too inefficient.
  5554. var child = childSet;
  5555. while (child !== null) {
  5556. findReorderedChildrenRecursively(child, nextChildren);
  5557. child = child.sibling;
  5558. }
  5559. var numChildren = nextChildren.length;
  5560. if (numChildren < 2) {
  5561. // No need to reorder.
  5562. return;
  5563. }
  5564. pushOperation(constants["o" /* TREE_OPERATION_REORDER_CHILDREN */]);
  5565. pushOperation(getFiberIDThrows(fiber));
  5566. pushOperation(numChildren);
  5567. for (var i = 0; i < nextChildren.length; i++) {
  5568. pushOperation(nextChildren[i]);
  5569. }
  5570. }
  5571. function findReorderedChildrenRecursively(fiber, nextChildren) {
  5572. if (!shouldFilterFiber(fiber)) {
  5573. nextChildren.push(getFiberIDThrows(fiber));
  5574. } else {
  5575. var child = fiber.child;
  5576. var isTimedOutSuspense = fiber.tag === SuspenseComponent && fiber.memoizedState !== null;
  5577. if (isTimedOutSuspense) {
  5578. // Special case: if Suspense mounts in a timed-out state,
  5579. // get the fallback child from the inner fragment,
  5580. // and skip over the primary child.
  5581. var primaryChildFragment = fiber.child;
  5582. var fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null;
  5583. var fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null;
  5584. if (fallbackChild !== null) {
  5585. child = fallbackChild;
  5586. }
  5587. }
  5588. while (child !== null) {
  5589. findReorderedChildrenRecursively(child, nextChildren);
  5590. child = child.sibling;
  5591. }
  5592. }
  5593. } // Returns whether closest unfiltered fiber parent needs to reset its child list.
  5594. function updateFiberRecursively(nextFiber, prevFiber, parentFiber, traceNearestHostComponentUpdate) {
  5595. var id = getOrGenerateFiberID(nextFiber);
  5596. if (constants["s" /* __DEBUG__ */]) {
  5597. debug('updateFiberRecursively()', nextFiber, parentFiber);
  5598. }
  5599. if (traceUpdatesEnabled) {
  5600. var elementType = getElementTypeForFiber(nextFiber);
  5601. if (traceNearestHostComponentUpdate) {
  5602. // If an ancestor updated, we should mark the nearest host nodes for highlighting.
  5603. if (elementType === types["i" /* ElementTypeHostComponent */]) {
  5604. traceUpdatesForNodes.add(nextFiber.stateNode);
  5605. traceNearestHostComponentUpdate = false;
  5606. }
  5607. } else {
  5608. if (elementType === types["h" /* ElementTypeFunction */] || elementType === types["e" /* ElementTypeClass */] || elementType === types["f" /* ElementTypeContext */] || elementType === types["j" /* ElementTypeMemo */] || elementType === types["g" /* ElementTypeForwardRef */]) {
  5609. // Otherwise if this is a traced ancestor, flag for the nearest host descendant(s).
  5610. traceNearestHostComponentUpdate = didFiberRender(prevFiber, nextFiber);
  5611. }
  5612. }
  5613. }
  5614. if (mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === id && didFiberRender(prevFiber, nextFiber)) {
  5615. // If this Fiber has updated, clear cached inspected data.
  5616. // If it is inspected again, it may need to be re-run to obtain updated hooks values.
  5617. hasElementUpdatedSinceLastInspected = true;
  5618. }
  5619. var shouldIncludeInTree = !shouldFilterFiber(nextFiber);
  5620. var isSuspense = nextFiber.tag === SuspenseComponent;
  5621. var shouldResetChildren = false; // The behavior of timed-out Suspense trees is unique.
  5622. // Rather than unmount the timed out content (and possibly lose important state),
  5623. // React re-parents this content within a hidden Fragment while the fallback is showing.
  5624. // This behavior doesn't need to be observable in the DevTools though.
  5625. // It might even result in a bad user experience for e.g. node selection in the Elements panel.
  5626. // The easiest fix is to strip out the intermediate Fragment fibers,
  5627. // so the Elements panel and Profiler don't need to special case them.
  5628. // Suspense components only have a non-null memoizedState if they're timed-out.
  5629. var prevDidTimeout = isSuspense && prevFiber.memoizedState !== null;
  5630. var nextDidTimeOut = isSuspense && nextFiber.memoizedState !== null; // The logic below is inspired by the code paths in updateSuspenseComponent()
  5631. // inside ReactFiberBeginWork in the React source code.
  5632. if (prevDidTimeout && nextDidTimeOut) {
  5633. // Fallback -> Fallback:
  5634. // 1. Reconcile fallback set.
  5635. var nextFiberChild = nextFiber.child;
  5636. var nextFallbackChildSet = nextFiberChild ? nextFiberChild.sibling : null; // Note: We can't use nextFiber.child.sibling.alternate
  5637. // because the set is special and alternate may not exist.
  5638. var prevFiberChild = prevFiber.child;
  5639. var prevFallbackChildSet = prevFiberChild ? prevFiberChild.sibling : null;
  5640. if (nextFallbackChildSet != null && prevFallbackChildSet != null && updateFiberRecursively(nextFallbackChildSet, prevFallbackChildSet, nextFiber, traceNearestHostComponentUpdate)) {
  5641. shouldResetChildren = true;
  5642. }
  5643. } else if (prevDidTimeout && !nextDidTimeOut) {
  5644. // Fallback -> Primary:
  5645. // 1. Unmount fallback set
  5646. // Note: don't emulate fallback unmount because React actually did it.
  5647. // 2. Mount primary set
  5648. var nextPrimaryChildSet = nextFiber.child;
  5649. if (nextPrimaryChildSet !== null) {
  5650. mountFiberRecursively(nextPrimaryChildSet, shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate);
  5651. }
  5652. shouldResetChildren = true;
  5653. } else if (!prevDidTimeout && nextDidTimeOut) {
  5654. // Primary -> Fallback:
  5655. // 1. Hide primary set
  5656. // This is not a real unmount, so it won't get reported by React.
  5657. // We need to manually walk the previous tree and record unmounts.
  5658. unmountFiberChildrenRecursively(prevFiber); // 2. Mount fallback set
  5659. var _nextFiberChild = nextFiber.child;
  5660. var _nextFallbackChildSet = _nextFiberChild ? _nextFiberChild.sibling : null;
  5661. if (_nextFallbackChildSet != null) {
  5662. mountFiberRecursively(_nextFallbackChildSet, shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate);
  5663. shouldResetChildren = true;
  5664. }
  5665. } else {
  5666. // Common case: Primary -> Primary.
  5667. // This is the same code path as for non-Suspense fibers.
  5668. if (nextFiber.child !== prevFiber.child) {
  5669. // If the first child is different, we need to traverse them.
  5670. // Each next child will be either a new child (mount) or an alternate (update).
  5671. var nextChild = nextFiber.child;
  5672. var prevChildAtSameIndex = prevFiber.child;
  5673. while (nextChild) {
  5674. // We already know children will be referentially different because
  5675. // they are either new mounts or alternates of previous children.
  5676. // Schedule updates and mounts depending on whether alternates exist.
  5677. // We don't track deletions here because they are reported separately.
  5678. if (nextChild.alternate) {
  5679. var prevChild = nextChild.alternate;
  5680. if (updateFiberRecursively(nextChild, prevChild, shouldIncludeInTree ? nextFiber : parentFiber, traceNearestHostComponentUpdate)) {
  5681. // If a nested tree child order changed but it can't handle its own
  5682. // child order invalidation (e.g. because it's filtered out like host nodes),
  5683. // propagate the need to reset child order upwards to this Fiber.
  5684. shouldResetChildren = true;
  5685. } // However we also keep track if the order of the children matches
  5686. // the previous order. They are always different referentially, but
  5687. // if the instances line up conceptually we'll want to know that.
  5688. if (prevChild !== prevChildAtSameIndex) {
  5689. shouldResetChildren = true;
  5690. }
  5691. } else {
  5692. mountFiberRecursively(nextChild, shouldIncludeInTree ? nextFiber : parentFiber, false, traceNearestHostComponentUpdate);
  5693. shouldResetChildren = true;
  5694. } // Try the next child.
  5695. nextChild = nextChild.sibling; // Advance the pointer in the previous list so that we can
  5696. // keep comparing if they line up.
  5697. if (!shouldResetChildren && prevChildAtSameIndex !== null) {
  5698. prevChildAtSameIndex = prevChildAtSameIndex.sibling;
  5699. }
  5700. } // If we have no more children, but used to, they don't line up.
  5701. if (prevChildAtSameIndex !== null) {
  5702. shouldResetChildren = true;
  5703. }
  5704. } else {
  5705. if (traceUpdatesEnabled) {
  5706. // If we're tracing updates and we've bailed out before reaching a host node,
  5707. // we should fall back to recursively marking the nearest host descendants for highlight.
  5708. if (traceNearestHostComponentUpdate) {
  5709. var hostFibers = findAllCurrentHostFibers(getFiberIDThrows(nextFiber));
  5710. hostFibers.forEach(function (hostFiber) {
  5711. traceUpdatesForNodes.add(hostFiber.stateNode);
  5712. });
  5713. }
  5714. }
  5715. }
  5716. }
  5717. if (shouldIncludeInTree) {
  5718. var isProfilingSupported = nextFiber.hasOwnProperty('treeBaseDuration');
  5719. if (isProfilingSupported) {
  5720. recordProfilingDurations(nextFiber);
  5721. }
  5722. }
  5723. if (shouldResetChildren) {
  5724. // We need to crawl the subtree for closest non-filtered Fibers
  5725. // so that we can display them in a flat children set.
  5726. if (shouldIncludeInTree) {
  5727. // Normally, search for children from the rendered child.
  5728. var nextChildSet = nextFiber.child;
  5729. if (nextDidTimeOut) {
  5730. // Special case: timed-out Suspense renders the fallback set.
  5731. var _nextFiberChild2 = nextFiber.child;
  5732. nextChildSet = _nextFiberChild2 ? _nextFiberChild2.sibling : null;
  5733. }
  5734. if (nextChildSet != null) {
  5735. recordResetChildren(nextFiber, nextChildSet);
  5736. } // We've handled the child order change for this Fiber.
  5737. // Since it's included, there's no need to invalidate parent child order.
  5738. return false;
  5739. } else {
  5740. // Let the closest unfiltered parent Fiber reset its child order instead.
  5741. return true;
  5742. }
  5743. } else {
  5744. return false;
  5745. }
  5746. }
  5747. function cleanup() {// We don't patch any methods so there is no cleanup.
  5748. }
  5749. function rootSupportsProfiling(root) {
  5750. if (root.memoizedInteractions != null) {
  5751. // v16 builds include this field for the scheduler/tracing API.
  5752. return true;
  5753. } else if (root.current != null && root.current.hasOwnProperty('treeBaseDuration')) {
  5754. // The scheduler/tracing API was removed in v17 though
  5755. // so we need to check a non-root Fiber.
  5756. return true;
  5757. } else {
  5758. return false;
  5759. }
  5760. }
  5761. function flushInitialOperations() {
  5762. var localPendingOperationsQueue = pendingOperationsQueue;
  5763. pendingOperationsQueue = null;
  5764. if (localPendingOperationsQueue !== null && localPendingOperationsQueue.length > 0) {
  5765. // We may have already queued up some operations before the frontend connected
  5766. // If so, let the frontend know about them.
  5767. localPendingOperationsQueue.forEach(function (operations) {
  5768. hook.emit('operations', operations);
  5769. });
  5770. } else {
  5771. // Before the traversals, remember to start tracking
  5772. // our path in case we have selection to restore.
  5773. if (trackedPath !== null) {
  5774. mightBeOnTrackedPath = true;
  5775. } // If we have not been profiling, then we can just walk the tree and build up its current state as-is.
  5776. hook.getFiberRoots(rendererID).forEach(function (root) {
  5777. currentRootID = getOrGenerateFiberID(root.current);
  5778. setRootPseudoKey(currentRootID, root.current); // Handle multi-renderer edge-case where only some v16 renderers support profiling.
  5779. if (isProfiling && rootSupportsProfiling(root)) {
  5780. // If profiling is active, store commit time and duration.
  5781. // The frontend may request this information after profiling has stopped.
  5782. currentCommitProfilingMetadata = {
  5783. changeDescriptions: recordChangeDescriptions ? new Map() : null,
  5784. durations: [],
  5785. commitTime: renderer_getCurrentTime() - profilingStartTime,
  5786. maxActualDuration: 0,
  5787. priorityLevel: null,
  5788. updaters: getUpdatersList(root),
  5789. effectDuration: null,
  5790. passiveEffectDuration: null
  5791. };
  5792. }
  5793. mountFiberRecursively(root.current, null, false, false);
  5794. flushPendingEvents(root);
  5795. currentRootID = -1;
  5796. });
  5797. }
  5798. }
  5799. function getUpdatersList(root) {
  5800. return root.memoizedUpdaters != null ? Array.from(root.memoizedUpdaters).filter(function (fiber) {
  5801. return getFiberIDUnsafe(fiber) !== null;
  5802. }).map(fiberToSerializedElement) : null;
  5803. }
  5804. function handleCommitFiberUnmount(fiber) {
  5805. // If the untrackFiberSet already has the unmounted Fiber, this means we've already
  5806. // recordedUnmount, so we don't need to do it again. If we don't do this, we might
  5807. // end up double-deleting Fibers in some cases (like Legacy Suspense).
  5808. if (!untrackFibersSet.has(fiber)) {
  5809. // This is not recursive.
  5810. // We can't traverse fibers after unmounting so instead
  5811. // we rely on React telling us about each unmount.
  5812. recordUnmount(fiber, false);
  5813. }
  5814. }
  5815. function handlePostCommitFiberRoot(root) {
  5816. if (isProfiling && rootSupportsProfiling(root)) {
  5817. if (currentCommitProfilingMetadata !== null) {
  5818. var _getEffectDurations = Object(backend_utils["h" /* getEffectDurations */])(root),
  5819. effectDuration = _getEffectDurations.effectDuration,
  5820. passiveEffectDuration = _getEffectDurations.passiveEffectDuration; // $FlowFixMe[incompatible-use] found when upgrading Flow
  5821. currentCommitProfilingMetadata.effectDuration = effectDuration; // $FlowFixMe[incompatible-use] found when upgrading Flow
  5822. currentCommitProfilingMetadata.passiveEffectDuration = passiveEffectDuration;
  5823. }
  5824. }
  5825. }
  5826. function handleCommitFiberRoot(root, priorityLevel) {
  5827. var current = root.current;
  5828. var alternate = current.alternate; // Flush any pending Fibers that we are untracking before processing the new commit.
  5829. // If we don't do this, we might end up double-deleting Fibers in some cases (like Legacy Suspense).
  5830. untrackFibers();
  5831. currentRootID = getOrGenerateFiberID(current); // Before the traversals, remember to start tracking
  5832. // our path in case we have selection to restore.
  5833. if (trackedPath !== null) {
  5834. mightBeOnTrackedPath = true;
  5835. }
  5836. if (traceUpdatesEnabled) {
  5837. traceUpdatesForNodes.clear();
  5838. } // Handle multi-renderer edge-case where only some v16 renderers support profiling.
  5839. var isProfilingSupported = rootSupportsProfiling(root);
  5840. if (isProfiling && isProfilingSupported) {
  5841. // If profiling is active, store commit time and duration.
  5842. // The frontend may request this information after profiling has stopped.
  5843. currentCommitProfilingMetadata = {
  5844. changeDescriptions: recordChangeDescriptions ? new Map() : null,
  5845. durations: [],
  5846. commitTime: renderer_getCurrentTime() - profilingStartTime,
  5847. maxActualDuration: 0,
  5848. priorityLevel: priorityLevel == null ? null : formatPriorityLevel(priorityLevel),
  5849. updaters: getUpdatersList(root),
  5850. // Initialize to null; if new enough React version is running,
  5851. // these values will be read during separate handlePostCommitFiberRoot() call.
  5852. effectDuration: null,
  5853. passiveEffectDuration: null
  5854. };
  5855. }
  5856. if (alternate) {
  5857. // TODO: relying on this seems a bit fishy.
  5858. var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && // A dehydrated root is not considered mounted
  5859. alternate.memoizedState.isDehydrated !== true;
  5860. var isMounted = current.memoizedState != null && current.memoizedState.element != null && // A dehydrated root is not considered mounted
  5861. current.memoizedState.isDehydrated !== true;
  5862. if (!wasMounted && isMounted) {
  5863. // Mount a new root.
  5864. setRootPseudoKey(currentRootID, current);
  5865. mountFiberRecursively(current, null, false, false);
  5866. } else if (wasMounted && isMounted) {
  5867. // Update an existing root.
  5868. updateFiberRecursively(current, alternate, null, false);
  5869. } else if (wasMounted && !isMounted) {
  5870. // Unmount an existing root.
  5871. removeRootPseudoKey(currentRootID);
  5872. recordUnmount(current, false);
  5873. }
  5874. } else {
  5875. // Mount a new root.
  5876. setRootPseudoKey(currentRootID, current);
  5877. mountFiberRecursively(current, null, false, false);
  5878. }
  5879. if (isProfiling && isProfilingSupported) {
  5880. if (!shouldBailoutWithPendingOperations()) {
  5881. var commitProfilingMetadata = rootToCommitProfilingMetadataMap.get(currentRootID);
  5882. if (commitProfilingMetadata != null) {
  5883. commitProfilingMetadata.push(currentCommitProfilingMetadata);
  5884. } else {
  5885. rootToCommitProfilingMetadataMap.set(currentRootID, [currentCommitProfilingMetadata]);
  5886. }
  5887. }
  5888. } // We're done here.
  5889. flushPendingEvents(root);
  5890. if (traceUpdatesEnabled) {
  5891. hook.emit('traceUpdates', traceUpdatesForNodes);
  5892. }
  5893. currentRootID = -1;
  5894. }
  5895. function findAllCurrentHostFibers(id) {
  5896. var fibers = [];
  5897. var fiber = findCurrentFiberUsingSlowPathById(id);
  5898. if (!fiber) {
  5899. return fibers;
  5900. } // Next we'll drill down this component to find all HostComponent/Text.
  5901. var node = fiber;
  5902. while (true) {
  5903. if (node.tag === HostComponent || node.tag === HostText) {
  5904. fibers.push(node);
  5905. } else if (node.child) {
  5906. node.child.return = node;
  5907. node = node.child;
  5908. continue;
  5909. }
  5910. if (node === fiber) {
  5911. return fibers;
  5912. }
  5913. while (!node.sibling) {
  5914. if (!node.return || node.return === fiber) {
  5915. return fibers;
  5916. }
  5917. node = node.return;
  5918. }
  5919. node.sibling.return = node.return;
  5920. node = node.sibling;
  5921. } // Flow needs the return here, but ESLint complains about it.
  5922. // eslint-disable-next-line no-unreachable
  5923. return fibers;
  5924. }
  5925. function findNativeNodesForFiberID(id) {
  5926. try {
  5927. var _fiber3 = findCurrentFiberUsingSlowPathById(id);
  5928. if (_fiber3 === null) {
  5929. return null;
  5930. } // Special case for a timed-out Suspense.
  5931. var isTimedOutSuspense = _fiber3.tag === SuspenseComponent && _fiber3.memoizedState !== null;
  5932. if (isTimedOutSuspense) {
  5933. // A timed-out Suspense's findDOMNode is useless.
  5934. // Try our best to find the fallback directly.
  5935. var maybeFallbackFiber = _fiber3.child && _fiber3.child.sibling;
  5936. if (maybeFallbackFiber != null) {
  5937. _fiber3 = maybeFallbackFiber;
  5938. }
  5939. }
  5940. var hostFibers = findAllCurrentHostFibers(id);
  5941. return hostFibers.map(function (hostFiber) {
  5942. return hostFiber.stateNode;
  5943. }).filter(Boolean);
  5944. } catch (err) {
  5945. // The fiber might have unmounted by now.
  5946. return null;
  5947. }
  5948. }
  5949. function getDisplayNameForFiberID(id) {
  5950. var fiber = idToArbitraryFiberMap.get(id);
  5951. return fiber != null ? getDisplayNameForFiber(fiber) : null;
  5952. }
  5953. function getFiberForNative(hostInstance) {
  5954. return renderer.findFiberByHostInstance(hostInstance);
  5955. }
  5956. function getFiberIDForNative(hostInstance) {
  5957. var findNearestUnfilteredAncestor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5958. var fiber = renderer.findFiberByHostInstance(hostInstance);
  5959. if (fiber != null) {
  5960. if (findNearestUnfilteredAncestor) {
  5961. while (fiber !== null && shouldFilterFiber(fiber)) {
  5962. fiber = fiber.return;
  5963. }
  5964. }
  5965. return getFiberIDThrows(fiber);
  5966. }
  5967. return null;
  5968. } // This function is copied from React and should be kept in sync:
  5969. // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js
  5970. function assertIsMounted(fiber) {
  5971. if (getNearestMountedFiber(fiber) !== fiber) {
  5972. throw new Error('Unable to find node on an unmounted component.');
  5973. }
  5974. } // This function is copied from React and should be kept in sync:
  5975. // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js
  5976. function getNearestMountedFiber(fiber) {
  5977. var node = fiber;
  5978. var nearestMounted = fiber;
  5979. if (!fiber.alternate) {
  5980. // If there is no alternate, this might be a new tree that isn't inserted
  5981. // yet. If it is, then it will have a pending insertion effect on it.
  5982. var nextNode = node;
  5983. do {
  5984. node = nextNode;
  5985. if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
  5986. // This is an insertion or in-progress hydration. The nearest possible
  5987. // mounted fiber is the parent but we need to continue to figure out
  5988. // if that one is still mounted.
  5989. nearestMounted = node.return;
  5990. } // $FlowFixMe[incompatible-type] we bail out when we get a null
  5991. nextNode = node.return;
  5992. } while (nextNode);
  5993. } else {
  5994. while (node.return) {
  5995. node = node.return;
  5996. }
  5997. }
  5998. if (node.tag === HostRoot) {
  5999. // TODO: Check if this was a nested HostRoot when used with
  6000. // renderContainerIntoSubtree.
  6001. return nearestMounted;
  6002. } // If we didn't hit the root, that means that we're in an disconnected tree
  6003. // that has been unmounted.
  6004. return null;
  6005. } // This function is copied from React and should be kept in sync:
  6006. // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js
  6007. // It would be nice if we updated React to inject this function directly (vs just indirectly via findDOMNode).
  6008. // BEGIN copied code
  6009. function findCurrentFiberUsingSlowPathById(id) {
  6010. var fiber = idToArbitraryFiberMap.get(id);
  6011. if (fiber == null) {
  6012. console.warn("Could not find Fiber with id \"".concat(id, "\""));
  6013. return null;
  6014. }
  6015. var alternate = fiber.alternate;
  6016. if (!alternate) {
  6017. // If there is no alternate, then we only need to check if it is mounted.
  6018. var nearestMounted = getNearestMountedFiber(fiber);
  6019. if (nearestMounted === null) {
  6020. throw new Error('Unable to find node on an unmounted component.');
  6021. }
  6022. if (nearestMounted !== fiber) {
  6023. return null;
  6024. }
  6025. return fiber;
  6026. } // If we have two possible branches, we'll walk backwards up to the root
  6027. // to see what path the root points to. On the way we may hit one of the
  6028. // special cases and we'll deal with them.
  6029. var a = fiber;
  6030. var b = alternate;
  6031. while (true) {
  6032. var parentA = a.return;
  6033. if (parentA === null) {
  6034. // We're at the root.
  6035. break;
  6036. }
  6037. var parentB = parentA.alternate;
  6038. if (parentB === null) {
  6039. // There is no alternate. This is an unusual case. Currently, it only
  6040. // happens when a Suspense component is hidden. An extra fragment fiber
  6041. // is inserted in between the Suspense fiber and its children. Skip
  6042. // over this extra fragment fiber and proceed to the next parent.
  6043. var nextParent = parentA.return;
  6044. if (nextParent !== null) {
  6045. a = b = nextParent;
  6046. continue;
  6047. } // If there's no parent, we're at the root.
  6048. break;
  6049. } // If both copies of the parent fiber point to the same child, we can
  6050. // assume that the child is current. This happens when we bailout on low
  6051. // priority: the bailed out fiber's child reuses the current child.
  6052. if (parentA.child === parentB.child) {
  6053. var child = parentA.child;
  6054. while (child) {
  6055. if (child === a) {
  6056. // We've determined that A is the current branch.
  6057. assertIsMounted(parentA);
  6058. return fiber;
  6059. }
  6060. if (child === b) {
  6061. // We've determined that B is the current branch.
  6062. assertIsMounted(parentA);
  6063. return alternate;
  6064. }
  6065. child = child.sibling;
  6066. } // We should never have an alternate for any mounting node. So the only
  6067. // way this could possibly happen is if this was unmounted, if at all.
  6068. throw new Error('Unable to find node on an unmounted component.');
  6069. }
  6070. if (a.return !== b.return) {
  6071. // The return pointer of A and the return pointer of B point to different
  6072. // fibers. We assume that return pointers never criss-cross, so A must
  6073. // belong to the child set of A.return, and B must belong to the child
  6074. // set of B.return.
  6075. a = parentA;
  6076. b = parentB;
  6077. } else {
  6078. // The return pointers point to the same fiber. We'll have to use the
  6079. // default, slow path: scan the child sets of each parent alternate to see
  6080. // which child belongs to which set.
  6081. //
  6082. // Search parent A's child set
  6083. var didFindChild = false;
  6084. var _child = parentA.child;
  6085. while (_child) {
  6086. if (_child === a) {
  6087. didFindChild = true;
  6088. a = parentA;
  6089. b = parentB;
  6090. break;
  6091. }
  6092. if (_child === b) {
  6093. didFindChild = true;
  6094. b = parentA;
  6095. a = parentB;
  6096. break;
  6097. }
  6098. _child = _child.sibling;
  6099. }
  6100. if (!didFindChild) {
  6101. // Search parent B's child set
  6102. _child = parentB.child;
  6103. while (_child) {
  6104. if (_child === a) {
  6105. didFindChild = true;
  6106. a = parentB;
  6107. b = parentA;
  6108. break;
  6109. }
  6110. if (_child === b) {
  6111. didFindChild = true;
  6112. b = parentB;
  6113. a = parentA;
  6114. break;
  6115. }
  6116. _child = _child.sibling;
  6117. }
  6118. if (!didFindChild) {
  6119. throw new Error('Child was not found in either parent set. This indicates a bug ' + 'in React related to the return pointer. Please file an issue.');
  6120. }
  6121. }
  6122. }
  6123. if (a.alternate !== b) {
  6124. throw new Error("Return fibers should always be each others' alternates. " + 'This error is likely caused by a bug in React. Please file an issue.');
  6125. }
  6126. } // If the root is not a host container, we're in a disconnected tree. I.e.
  6127. // unmounted.
  6128. if (a.tag !== HostRoot) {
  6129. throw new Error('Unable to find node on an unmounted component.');
  6130. }
  6131. if (a.stateNode.current === a) {
  6132. // We've determined that A is the current branch.
  6133. return fiber;
  6134. } // Otherwise B has to be current branch.
  6135. return alternate;
  6136. } // END copied code
  6137. function prepareViewAttributeSource(id, path) {
  6138. if (isMostRecentlyInspectedElement(id)) {
  6139. window.$attribute = Object(utils["j" /* getInObject */])(mostRecentlyInspectedElement, path);
  6140. }
  6141. }
  6142. function prepareViewElementSource(id) {
  6143. var fiber = idToArbitraryFiberMap.get(id);
  6144. if (fiber == null) {
  6145. console.warn("Could not find Fiber with id \"".concat(id, "\""));
  6146. return;
  6147. }
  6148. var elementType = fiber.elementType,
  6149. tag = fiber.tag,
  6150. type = fiber.type;
  6151. switch (tag) {
  6152. case ClassComponent:
  6153. case IncompleteClassComponent:
  6154. case IndeterminateComponent:
  6155. case FunctionComponent:
  6156. global.$type = type;
  6157. break;
  6158. case ForwardRef:
  6159. global.$type = type.render;
  6160. break;
  6161. case MemoComponent:
  6162. case SimpleMemoComponent:
  6163. global.$type = elementType != null && elementType.type != null ? elementType.type : type;
  6164. break;
  6165. default:
  6166. global.$type = null;
  6167. break;
  6168. }
  6169. }
  6170. function fiberToSerializedElement(fiber) {
  6171. return {
  6172. displayName: getDisplayNameForFiber(fiber) || 'Anonymous',
  6173. id: getFiberIDThrows(fiber),
  6174. key: fiber.key,
  6175. type: getElementTypeForFiber(fiber)
  6176. };
  6177. }
  6178. function getOwnersList(id) {
  6179. var fiber = findCurrentFiberUsingSlowPathById(id);
  6180. if (fiber == null) {
  6181. return null;
  6182. }
  6183. var _debugOwner = fiber._debugOwner;
  6184. var owners = [fiberToSerializedElement(fiber)];
  6185. if (_debugOwner) {
  6186. var owner = _debugOwner;
  6187. while (owner !== null) {
  6188. owners.unshift(fiberToSerializedElement(owner));
  6189. owner = owner._debugOwner || null;
  6190. }
  6191. }
  6192. return owners;
  6193. } // Fast path props lookup for React Native style editor.
  6194. // Could use inspectElementRaw() but that would require shallow rendering hooks components,
  6195. // and could also mess with memoization.
  6196. function getInstanceAndStyle(id) {
  6197. var instance = null;
  6198. var style = null;
  6199. var fiber = findCurrentFiberUsingSlowPathById(id);
  6200. if (fiber !== null) {
  6201. instance = fiber.stateNode;
  6202. if (fiber.memoizedProps !== null) {
  6203. style = fiber.memoizedProps.style;
  6204. }
  6205. }
  6206. return {
  6207. instance: instance,
  6208. style: style
  6209. };
  6210. }
  6211. function isErrorBoundary(fiber) {
  6212. var tag = fiber.tag,
  6213. type = fiber.type;
  6214. switch (tag) {
  6215. case ClassComponent:
  6216. case IncompleteClassComponent:
  6217. var instance = fiber.stateNode;
  6218. return typeof type.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function';
  6219. default:
  6220. return false;
  6221. }
  6222. }
  6223. function getNearestErrorBoundaryID(fiber) {
  6224. var parent = fiber.return;
  6225. while (parent !== null) {
  6226. if (isErrorBoundary(parent)) {
  6227. return getFiberIDUnsafe(parent);
  6228. }
  6229. parent = parent.return;
  6230. }
  6231. return null;
  6232. }
  6233. function inspectElementRaw(id) {
  6234. var fiber = findCurrentFiberUsingSlowPathById(id);
  6235. if (fiber == null) {
  6236. return null;
  6237. }
  6238. var _debugOwner = fiber._debugOwner,
  6239. _debugSource = fiber._debugSource,
  6240. stateNode = fiber.stateNode,
  6241. key = fiber.key,
  6242. memoizedProps = fiber.memoizedProps,
  6243. memoizedState = fiber.memoizedState,
  6244. dependencies = fiber.dependencies,
  6245. tag = fiber.tag,
  6246. type = fiber.type;
  6247. var elementType = getElementTypeForFiber(fiber);
  6248. var usesHooks = (tag === FunctionComponent || tag === SimpleMemoComponent || tag === ForwardRef) && (!!memoizedState || !!dependencies); // TODO Show custom UI for Cache like we do for Suspense
  6249. // For now, just hide state data entirely since it's not meant to be inspected.
  6250. var showState = !usesHooks && tag !== CacheComponent;
  6251. var typeSymbol = getTypeSymbol(type);
  6252. var canViewSource = false;
  6253. var context = null;
  6254. if (tag === ClassComponent || tag === FunctionComponent || tag === IncompleteClassComponent || tag === IndeterminateComponent || tag === MemoComponent || tag === ForwardRef || tag === SimpleMemoComponent) {
  6255. canViewSource = true;
  6256. if (stateNode && stateNode.context != null) {
  6257. // Don't show an empty context object for class components that don't use the context API.
  6258. var shouldHideContext = elementType === types["e" /* ElementTypeClass */] && !(type.contextTypes || type.contextType);
  6259. if (!shouldHideContext) {
  6260. context = stateNode.context;
  6261. }
  6262. }
  6263. } else if (typeSymbol === ReactSymbols["c" /* CONTEXT_NUMBER */] || typeSymbol === ReactSymbols["d" /* CONTEXT_SYMBOL_STRING */]) {
  6264. // 16.3-16.5 read from "type" because the Consumer is the actual context object.
  6265. // 16.6+ should read from "type._context" because Consumer can be different (in DEV).
  6266. // NOTE Keep in sync with getDisplayNameForFiber()
  6267. var consumerResolvedContext = type._context || type; // Global context value.
  6268. context = consumerResolvedContext._currentValue || null; // Look for overridden value.
  6269. var _current = fiber.return;
  6270. while (_current !== null) {
  6271. var currentType = _current.type;
  6272. var currentTypeSymbol = getTypeSymbol(currentType);
  6273. if (currentTypeSymbol === ReactSymbols["n" /* PROVIDER_NUMBER */] || currentTypeSymbol === ReactSymbols["o" /* PROVIDER_SYMBOL_STRING */]) {
  6274. // 16.3.0 exposed the context object as "context"
  6275. // PR #12501 changed it to "_context" for 16.3.1+
  6276. // NOTE Keep in sync with getDisplayNameForFiber()
  6277. var providerResolvedContext = currentType._context || currentType.context;
  6278. if (providerResolvedContext === consumerResolvedContext) {
  6279. context = _current.memoizedProps.value;
  6280. break;
  6281. }
  6282. }
  6283. _current = _current.return;
  6284. }
  6285. }
  6286. var hasLegacyContext = false;
  6287. if (context !== null) {
  6288. hasLegacyContext = !!type.contextTypes; // To simplify hydration and display logic for context, wrap in a value object.
  6289. // Otherwise simple values (e.g. strings, booleans) become harder to handle.
  6290. context = {
  6291. value: context
  6292. };
  6293. }
  6294. var owners = null;
  6295. if (_debugOwner) {
  6296. owners = [];
  6297. var owner = _debugOwner;
  6298. while (owner !== null) {
  6299. owners.push(fiberToSerializedElement(owner));
  6300. owner = owner._debugOwner || null;
  6301. }
  6302. }
  6303. var isTimedOutSuspense = tag === SuspenseComponent && memoizedState !== null;
  6304. var hooks = null;
  6305. if (usesHooks) {
  6306. var originalConsoleMethods = {}; // Temporarily disable all console logging before re-running the hook.
  6307. for (var method in console) {
  6308. try {
  6309. originalConsoleMethods[method] = console[method]; // $FlowFixMe[prop-missing]
  6310. console[method] = function () {};
  6311. } catch (error) {}
  6312. }
  6313. try {
  6314. hooks = Object(react_debug_tools["inspectHooksOfFiber"])(fiber, renderer.currentDispatcherRef, true // Include source location info for hooks
  6315. );
  6316. } finally {
  6317. // Restore original console functionality.
  6318. for (var _method in originalConsoleMethods) {
  6319. try {
  6320. // $FlowFixMe[prop-missing]
  6321. console[_method] = originalConsoleMethods[_method];
  6322. } catch (error) {}
  6323. }
  6324. }
  6325. }
  6326. var rootType = null;
  6327. var current = fiber;
  6328. while (current.return !== null) {
  6329. current = current.return;
  6330. }
  6331. var fiberRoot = current.stateNode;
  6332. if (fiberRoot != null && fiberRoot._debugRootType !== null) {
  6333. rootType = fiberRoot._debugRootType;
  6334. }
  6335. var errors = fiberIDToErrorsMap.get(id) || new Map();
  6336. var warnings = fiberIDToWarningsMap.get(id) || new Map();
  6337. var isErrored = (fiber.flags & DidCapture) !== NoFlags || forceErrorForFiberIDs.get(id) === true;
  6338. var targetErrorBoundaryID;
  6339. if (isErrorBoundary(fiber)) {
  6340. // if the current inspected element is an error boundary,
  6341. // either that we want to use it to toggle off error state
  6342. // or that we allow to force error state on it if it's within another
  6343. // error boundary
  6344. targetErrorBoundaryID = isErrored ? id : getNearestErrorBoundaryID(fiber);
  6345. } else {
  6346. targetErrorBoundaryID = getNearestErrorBoundaryID(fiber);
  6347. }
  6348. var plugins = {
  6349. stylex: null
  6350. };
  6351. if (DevToolsFeatureFlags_core_oss["c" /* enableStyleXFeatures */]) {
  6352. if (memoizedProps.hasOwnProperty('xstyle')) {
  6353. plugins.stylex = getStyleXData(memoizedProps.xstyle);
  6354. }
  6355. }
  6356. return {
  6357. id: id,
  6358. // Does the current renderer support editable hooks and function props?
  6359. canEditHooks: typeof overrideHookState === 'function',
  6360. canEditFunctionProps: typeof overrideProps === 'function',
  6361. // Does the current renderer support advanced editing interface?
  6362. canEditHooksAndDeletePaths: typeof overrideHookStateDeletePath === 'function',
  6363. canEditHooksAndRenamePaths: typeof overrideHookStateRenamePath === 'function',
  6364. canEditFunctionPropsDeletePaths: typeof overridePropsDeletePath === 'function',
  6365. canEditFunctionPropsRenamePaths: typeof overridePropsRenamePath === 'function',
  6366. canToggleError: supportsTogglingError && targetErrorBoundaryID != null,
  6367. // Is this error boundary in error state.
  6368. isErrored: isErrored,
  6369. targetErrorBoundaryID: targetErrorBoundaryID,
  6370. canToggleSuspense: supportsTogglingSuspense && ( // If it's showing the real content, we can always flip fallback.
  6371. !isTimedOutSuspense || // If it's showing fallback because we previously forced it to,
  6372. // allow toggling it back to remove the fallback override.
  6373. forceFallbackForSuspenseIDs.has(id)),
  6374. // Can view component source location.
  6375. canViewSource: canViewSource,
  6376. // Does the component have legacy context attached to it.
  6377. hasLegacyContext: hasLegacyContext,
  6378. key: key != null ? key : null,
  6379. displayName: getDisplayNameForFiber(fiber),
  6380. type: elementType,
  6381. // Inspectable properties.
  6382. // TODO Review sanitization approach for the below inspectable values.
  6383. context: context,
  6384. hooks: hooks,
  6385. props: memoizedProps,
  6386. state: showState ? memoizedState : null,
  6387. errors: Array.from(errors.entries()),
  6388. warnings: Array.from(warnings.entries()),
  6389. // List of owners
  6390. owners: owners,
  6391. // Location of component in source code.
  6392. source: _debugSource || null,
  6393. rootType: rootType,
  6394. rendererPackageName: renderer.rendererPackageName,
  6395. rendererVersion: renderer.version,
  6396. plugins: plugins
  6397. };
  6398. }
  6399. var mostRecentlyInspectedElement = null;
  6400. var hasElementUpdatedSinceLastInspected = false;
  6401. var currentlyInspectedPaths = {};
  6402. function isMostRecentlyInspectedElement(id) {
  6403. return mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === id;
  6404. }
  6405. function isMostRecentlyInspectedElementCurrent(id) {
  6406. return isMostRecentlyInspectedElement(id) && !hasElementUpdatedSinceLastInspected;
  6407. } // Track the intersection of currently inspected paths,
  6408. // so that we can send their data along if the element is re-rendered.
  6409. function mergeInspectedPaths(path) {
  6410. var current = currentlyInspectedPaths;
  6411. path.forEach(function (key) {
  6412. if (!current[key]) {
  6413. current[key] = {};
  6414. }
  6415. current = current[key];
  6416. });
  6417. }
  6418. function createIsPathAllowed(key, secondaryCategory) {
  6419. // This function helps prevent previously-inspected paths from being dehydrated in updates.
  6420. // This is important to avoid a bad user experience where expanded toggles collapse on update.
  6421. return function isPathAllowed(path) {
  6422. switch (secondaryCategory) {
  6423. case 'hooks':
  6424. if (path.length === 1) {
  6425. // Never dehydrate the "hooks" object at the top levels.
  6426. return true;
  6427. }
  6428. if (path[path.length - 2] === 'hookSource' && path[path.length - 1] === 'fileName') {
  6429. // It's important to preserve the full file name (URL) for hook sources
  6430. // in case the user has enabled the named hooks feature.
  6431. // Otherwise the frontend may end up with a partial URL which it can't load.
  6432. return true;
  6433. }
  6434. if (path[path.length - 1] === 'subHooks' || path[path.length - 2] === 'subHooks') {
  6435. // Dehydrating the 'subHooks' property makes the HooksTree UI a lot more complicated,
  6436. // so it's easiest for now if we just don't break on this boundary.
  6437. // We can always dehydrate a level deeper (in the value object).
  6438. return true;
  6439. }
  6440. break;
  6441. default:
  6442. break;
  6443. }
  6444. var current = key === null ? currentlyInspectedPaths : currentlyInspectedPaths[key];
  6445. if (!current) {
  6446. return false;
  6447. }
  6448. for (var i = 0; i < path.length; i++) {
  6449. current = current[path[i]];
  6450. if (!current) {
  6451. return false;
  6452. }
  6453. }
  6454. return true;
  6455. };
  6456. }
  6457. function updateSelectedElement(inspectedElement) {
  6458. var hooks = inspectedElement.hooks,
  6459. id = inspectedElement.id,
  6460. props = inspectedElement.props;
  6461. var fiber = idToArbitraryFiberMap.get(id);
  6462. if (fiber == null) {
  6463. console.warn("Could not find Fiber with id \"".concat(id, "\""));
  6464. return;
  6465. }
  6466. var elementType = fiber.elementType,
  6467. stateNode = fiber.stateNode,
  6468. tag = fiber.tag,
  6469. type = fiber.type;
  6470. switch (tag) {
  6471. case ClassComponent:
  6472. case IncompleteClassComponent:
  6473. case IndeterminateComponent:
  6474. global.$r = stateNode;
  6475. break;
  6476. case FunctionComponent:
  6477. global.$r = {
  6478. hooks: hooks,
  6479. props: props,
  6480. type: type
  6481. };
  6482. break;
  6483. case ForwardRef:
  6484. global.$r = {
  6485. hooks: hooks,
  6486. props: props,
  6487. type: type.render
  6488. };
  6489. break;
  6490. case MemoComponent:
  6491. case SimpleMemoComponent:
  6492. global.$r = {
  6493. hooks: hooks,
  6494. props: props,
  6495. type: elementType != null && elementType.type != null ? elementType.type : type
  6496. };
  6497. break;
  6498. default:
  6499. global.$r = null;
  6500. break;
  6501. }
  6502. }
  6503. function storeAsGlobal(id, path, count) {
  6504. if (isMostRecentlyInspectedElement(id)) {
  6505. var value = Object(utils["j" /* getInObject */])(mostRecentlyInspectedElement, path);
  6506. var key = "$reactTemp".concat(count);
  6507. window[key] = value;
  6508. console.log(key);
  6509. console.log(value);
  6510. }
  6511. }
  6512. function copyElementPath(id, path) {
  6513. if (isMostRecentlyInspectedElement(id)) {
  6514. Object(backend_utils["b" /* copyToClipboard */])(Object(utils["j" /* getInObject */])(mostRecentlyInspectedElement, path));
  6515. }
  6516. }
  6517. function inspectElement(requestID, id, path, forceFullData) {
  6518. if (path !== null) {
  6519. mergeInspectedPaths(path);
  6520. }
  6521. if (isMostRecentlyInspectedElement(id) && !forceFullData) {
  6522. if (!hasElementUpdatedSinceLastInspected) {
  6523. if (path !== null) {
  6524. var secondaryCategory = null;
  6525. if (path[0] === 'hooks') {
  6526. secondaryCategory = 'hooks';
  6527. } // If this element has not been updated since it was last inspected,
  6528. // we can just return the subset of data in the newly-inspected path.
  6529. return {
  6530. id: id,
  6531. responseID: requestID,
  6532. type: 'hydrated-path',
  6533. path: path,
  6534. value: Object(backend_utils["a" /* cleanForBridge */])(Object(utils["j" /* getInObject */])(mostRecentlyInspectedElement, path), createIsPathAllowed(null, secondaryCategory), path)
  6535. };
  6536. } else {
  6537. // If this element has not been updated since it was last inspected, we don't need to return it.
  6538. // Instead we can just return the ID to indicate that it has not changed.
  6539. return {
  6540. id: id,
  6541. responseID: requestID,
  6542. type: 'no-change'
  6543. };
  6544. }
  6545. }
  6546. } else {
  6547. currentlyInspectedPaths = {};
  6548. }
  6549. hasElementUpdatedSinceLastInspected = false;
  6550. try {
  6551. mostRecentlyInspectedElement = inspectElementRaw(id);
  6552. } catch (error) {
  6553. // the error name is synced with ReactDebugHooks
  6554. if (error.name === 'ReactDebugToolsRenderError') {
  6555. var message = 'Error rendering inspected element.';
  6556. var stack; // Log error & cause for user to debug
  6557. console.error(message + '\n\n', error);
  6558. if (error.cause != null) {
  6559. var _fiber4 = findCurrentFiberUsingSlowPathById(id);
  6560. var componentName = _fiber4 != null ? getDisplayNameForFiber(_fiber4) : null;
  6561. console.error('React DevTools encountered an error while trying to inspect hooks. ' + 'This is most likely caused by an error in current inspected component' + (componentName != null ? ": \"".concat(componentName, "\".") : '.') + '\nThe error thrown in the component is: \n\n', error.cause);
  6562. if (error.cause instanceof Error) {
  6563. message = error.cause.message || message;
  6564. stack = error.cause.stack;
  6565. }
  6566. }
  6567. return {
  6568. type: 'error',
  6569. errorType: 'user',
  6570. id: id,
  6571. responseID: requestID,
  6572. message: message,
  6573. stack: stack
  6574. };
  6575. } // the error name is synced with ReactDebugHooks
  6576. if (error.name === 'ReactDebugToolsUnsupportedHookError') {
  6577. return {
  6578. type: 'error',
  6579. errorType: 'unknown-hook',
  6580. id: id,
  6581. responseID: requestID,
  6582. message: 'Unsupported hook in the react-debug-tools package: ' + error.message
  6583. };
  6584. } // Log Uncaught Error
  6585. console.error('Error inspecting element.\n\n', error);
  6586. return {
  6587. type: 'error',
  6588. errorType: 'uncaught',
  6589. id: id,
  6590. responseID: requestID,
  6591. message: error.message,
  6592. stack: error.stack
  6593. };
  6594. }
  6595. if (mostRecentlyInspectedElement === null) {
  6596. return {
  6597. id: id,
  6598. responseID: requestID,
  6599. type: 'not-found'
  6600. };
  6601. } // Any time an inspected element has an update,
  6602. // we should update the selected $r value as wel.
  6603. // Do this before dehydration (cleanForBridge).
  6604. updateSelectedElement(mostRecentlyInspectedElement); // Clone before cleaning so that we preserve the full data.
  6605. // This will enable us to send patches without re-inspecting if hydrated paths are requested.
  6606. // (Reducing how often we shallow-render is a better DX for function components that use hooks.)
  6607. var cleanedInspectedElement = _objectSpread({}, mostRecentlyInspectedElement); // $FlowFixMe[prop-missing] found when upgrading Flow
  6608. cleanedInspectedElement.context = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.context, createIsPathAllowed('context', null)); // $FlowFixMe[prop-missing] found when upgrading Flow
  6609. cleanedInspectedElement.hooks = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.hooks, createIsPathAllowed('hooks', 'hooks')); // $FlowFixMe[prop-missing] found when upgrading Flow
  6610. cleanedInspectedElement.props = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.props, createIsPathAllowed('props', null)); // $FlowFixMe[prop-missing] found when upgrading Flow
  6611. cleanedInspectedElement.state = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.state, createIsPathAllowed('state', null));
  6612. return {
  6613. id: id,
  6614. responseID: requestID,
  6615. type: 'full-data',
  6616. // $FlowFixMe[prop-missing] found when upgrading Flow
  6617. value: cleanedInspectedElement
  6618. };
  6619. }
  6620. function logElementToConsole(id) {
  6621. var result = isMostRecentlyInspectedElementCurrent(id) ? mostRecentlyInspectedElement : inspectElementRaw(id);
  6622. if (result === null) {
  6623. console.warn("Could not find Fiber with id \"".concat(id, "\""));
  6624. return;
  6625. }
  6626. var supportsGroup = typeof console.groupCollapsed === 'function';
  6627. if (supportsGroup) {
  6628. console.groupCollapsed("[Click to expand] %c<".concat(result.displayName || 'Component', " />"), // --dom-tag-name-color is the CSS variable Chrome styles HTML elements with in the console.
  6629. 'color: var(--dom-tag-name-color); font-weight: normal;');
  6630. }
  6631. if (result.props !== null) {
  6632. console.log('Props:', result.props);
  6633. }
  6634. if (result.state !== null) {
  6635. console.log('State:', result.state);
  6636. }
  6637. if (result.hooks !== null) {
  6638. console.log('Hooks:', result.hooks);
  6639. }
  6640. var nativeNodes = findNativeNodesForFiberID(id);
  6641. if (nativeNodes !== null) {
  6642. console.log('Nodes:', nativeNodes);
  6643. }
  6644. if (result.source !== null) {
  6645. console.log('Location:', result.source);
  6646. }
  6647. if (window.chrome || /firefox/i.test(navigator.userAgent)) {
  6648. console.log('Right-click any value to save it as a global variable for further inspection.');
  6649. }
  6650. if (supportsGroup) {
  6651. console.groupEnd();
  6652. }
  6653. }
  6654. function deletePath(type, id, hookID, path) {
  6655. var fiber = findCurrentFiberUsingSlowPathById(id);
  6656. if (fiber !== null) {
  6657. var instance = fiber.stateNode;
  6658. switch (type) {
  6659. case 'context':
  6660. // To simplify hydration and display of primitive context values (e.g. number, string)
  6661. // the inspectElement() method wraps context in a {value: ...} object.
  6662. // We need to remove the first part of the path (the "value") before continuing.
  6663. path = path.slice(1);
  6664. switch (fiber.tag) {
  6665. case ClassComponent:
  6666. if (path.length === 0) {// Simple context value (noop)
  6667. } else {
  6668. Object(utils["c" /* deletePathInObject */])(instance.context, path);
  6669. }
  6670. instance.forceUpdate();
  6671. break;
  6672. case FunctionComponent:
  6673. // Function components using legacy context are not editable
  6674. // because there's no instance on which to create a cloned, mutated context.
  6675. break;
  6676. }
  6677. break;
  6678. case 'hooks':
  6679. if (typeof overrideHookStateDeletePath === 'function') {
  6680. overrideHookStateDeletePath(fiber, hookID, path);
  6681. }
  6682. break;
  6683. case 'props':
  6684. if (instance === null) {
  6685. if (typeof overridePropsDeletePath === 'function') {
  6686. overridePropsDeletePath(fiber, path);
  6687. }
  6688. } else {
  6689. fiber.pendingProps = Object(backend_utils["c" /* copyWithDelete */])(instance.props, path);
  6690. instance.forceUpdate();
  6691. }
  6692. break;
  6693. case 'state':
  6694. Object(utils["c" /* deletePathInObject */])(instance.state, path);
  6695. instance.forceUpdate();
  6696. break;
  6697. }
  6698. }
  6699. }
  6700. function renamePath(type, id, hookID, oldPath, newPath) {
  6701. var fiber = findCurrentFiberUsingSlowPathById(id);
  6702. if (fiber !== null) {
  6703. var instance = fiber.stateNode;
  6704. switch (type) {
  6705. case 'context':
  6706. // To simplify hydration and display of primitive context values (e.g. number, string)
  6707. // the inspectElement() method wraps context in a {value: ...} object.
  6708. // We need to remove the first part of the path (the "value") before continuing.
  6709. oldPath = oldPath.slice(1);
  6710. newPath = newPath.slice(1);
  6711. switch (fiber.tag) {
  6712. case ClassComponent:
  6713. if (oldPath.length === 0) {// Simple context value (noop)
  6714. } else {
  6715. Object(utils["n" /* renamePathInObject */])(instance.context, oldPath, newPath);
  6716. }
  6717. instance.forceUpdate();
  6718. break;
  6719. case FunctionComponent:
  6720. // Function components using legacy context are not editable
  6721. // because there's no instance on which to create a cloned, mutated context.
  6722. break;
  6723. }
  6724. break;
  6725. case 'hooks':
  6726. if (typeof overrideHookStateRenamePath === 'function') {
  6727. overrideHookStateRenamePath(fiber, hookID, oldPath, newPath);
  6728. }
  6729. break;
  6730. case 'props':
  6731. if (instance === null) {
  6732. if (typeof overridePropsRenamePath === 'function') {
  6733. overridePropsRenamePath(fiber, oldPath, newPath);
  6734. }
  6735. } else {
  6736. fiber.pendingProps = Object(backend_utils["d" /* copyWithRename */])(instance.props, oldPath, newPath);
  6737. instance.forceUpdate();
  6738. }
  6739. break;
  6740. case 'state':
  6741. Object(utils["n" /* renamePathInObject */])(instance.state, oldPath, newPath);
  6742. instance.forceUpdate();
  6743. break;
  6744. }
  6745. }
  6746. }
  6747. function overrideValueAtPath(type, id, hookID, path, value) {
  6748. var fiber = findCurrentFiberUsingSlowPathById(id);
  6749. if (fiber !== null) {
  6750. var instance = fiber.stateNode;
  6751. switch (type) {
  6752. case 'context':
  6753. // To simplify hydration and display of primitive context values (e.g. number, string)
  6754. // the inspectElement() method wraps context in a {value: ...} object.
  6755. // We need to remove the first part of the path (the "value") before continuing.
  6756. path = path.slice(1);
  6757. switch (fiber.tag) {
  6758. case ClassComponent:
  6759. if (path.length === 0) {
  6760. // Simple context value
  6761. instance.context = value;
  6762. } else {
  6763. Object(utils["o" /* setInObject */])(instance.context, path, value);
  6764. }
  6765. instance.forceUpdate();
  6766. break;
  6767. case FunctionComponent:
  6768. // Function components using legacy context are not editable
  6769. // because there's no instance on which to create a cloned, mutated context.
  6770. break;
  6771. }
  6772. break;
  6773. case 'hooks':
  6774. if (typeof overrideHookState === 'function') {
  6775. overrideHookState(fiber, hookID, path, value);
  6776. }
  6777. break;
  6778. case 'props':
  6779. switch (fiber.tag) {
  6780. case ClassComponent:
  6781. fiber.pendingProps = Object(backend_utils["e" /* copyWithSet */])(instance.props, path, value);
  6782. instance.forceUpdate();
  6783. break;
  6784. default:
  6785. if (typeof overrideProps === 'function') {
  6786. overrideProps(fiber, path, value);
  6787. }
  6788. break;
  6789. }
  6790. break;
  6791. case 'state':
  6792. switch (fiber.tag) {
  6793. case ClassComponent:
  6794. Object(utils["o" /* setInObject */])(instance.state, path, value);
  6795. instance.forceUpdate();
  6796. break;
  6797. }
  6798. break;
  6799. }
  6800. }
  6801. }
  6802. var currentCommitProfilingMetadata = null;
  6803. var displayNamesByRootID = null;
  6804. var idToContextsMap = null;
  6805. var initialTreeBaseDurationsMap = null;
  6806. var initialIDToRootMap = null;
  6807. var isProfiling = false;
  6808. var profilingStartTime = 0;
  6809. var recordChangeDescriptions = false;
  6810. var rootToCommitProfilingMetadataMap = null;
  6811. function getProfilingData() {
  6812. var dataForRoots = [];
  6813. if (rootToCommitProfilingMetadataMap === null) {
  6814. throw Error('getProfilingData() called before any profiling data was recorded');
  6815. }
  6816. rootToCommitProfilingMetadataMap.forEach(function (commitProfilingMetadata, rootID) {
  6817. var commitData = [];
  6818. var initialTreeBaseDurations = [];
  6819. var displayName = displayNamesByRootID !== null && displayNamesByRootID.get(rootID) || 'Unknown';
  6820. if (initialTreeBaseDurationsMap != null) {
  6821. initialTreeBaseDurationsMap.forEach(function (treeBaseDuration, id) {
  6822. if (initialIDToRootMap != null && initialIDToRootMap.get(id) === rootID) {
  6823. // We don't need to convert milliseconds to microseconds in this case,
  6824. // because the profiling summary is JSON serialized.
  6825. initialTreeBaseDurations.push([id, treeBaseDuration]);
  6826. }
  6827. });
  6828. }
  6829. commitProfilingMetadata.forEach(function (commitProfilingData, commitIndex) {
  6830. var changeDescriptions = commitProfilingData.changeDescriptions,
  6831. durations = commitProfilingData.durations,
  6832. effectDuration = commitProfilingData.effectDuration,
  6833. maxActualDuration = commitProfilingData.maxActualDuration,
  6834. passiveEffectDuration = commitProfilingData.passiveEffectDuration,
  6835. priorityLevel = commitProfilingData.priorityLevel,
  6836. commitTime = commitProfilingData.commitTime,
  6837. updaters = commitProfilingData.updaters;
  6838. var fiberActualDurations = [];
  6839. var fiberSelfDurations = [];
  6840. for (var i = 0; i < durations.length; i += 3) {
  6841. var fiberID = durations[i];
  6842. fiberActualDurations.push([fiberID, durations[i + 1]]);
  6843. fiberSelfDurations.push([fiberID, durations[i + 2]]);
  6844. }
  6845. commitData.push({
  6846. changeDescriptions: changeDescriptions !== null ? Array.from(changeDescriptions.entries()) : null,
  6847. duration: maxActualDuration,
  6848. effectDuration: effectDuration,
  6849. fiberActualDurations: fiberActualDurations,
  6850. fiberSelfDurations: fiberSelfDurations,
  6851. passiveEffectDuration: passiveEffectDuration,
  6852. priorityLevel: priorityLevel,
  6853. timestamp: commitTime,
  6854. updaters: updaters
  6855. });
  6856. });
  6857. dataForRoots.push({
  6858. commitData: commitData,
  6859. displayName: displayName,
  6860. initialTreeBaseDurations: initialTreeBaseDurations,
  6861. rootID: rootID
  6862. });
  6863. });
  6864. var timelineData = null;
  6865. if (typeof getTimelineData === 'function') {
  6866. var currentTimelineData = getTimelineData();
  6867. if (currentTimelineData) {
  6868. var batchUIDToMeasuresMap = currentTimelineData.batchUIDToMeasuresMap,
  6869. internalModuleSourceToRanges = currentTimelineData.internalModuleSourceToRanges,
  6870. laneToLabelMap = currentTimelineData.laneToLabelMap,
  6871. laneToReactMeasureMap = currentTimelineData.laneToReactMeasureMap,
  6872. rest = _objectWithoutProperties(currentTimelineData, ["batchUIDToMeasuresMap", "internalModuleSourceToRanges", "laneToLabelMap", "laneToReactMeasureMap"]);
  6873. timelineData = _objectSpread(_objectSpread({}, rest), {}, {
  6874. // Most of the data is safe to parse as-is,
  6875. // but we need to convert the nested Arrays back to Maps.
  6876. // Most of the data is safe to serialize as-is,
  6877. // but we need to convert the Maps to nested Arrays.
  6878. batchUIDToMeasuresKeyValueArray: Array.from(batchUIDToMeasuresMap.entries()),
  6879. internalModuleSourceToRanges: Array.from(internalModuleSourceToRanges.entries()),
  6880. laneToLabelKeyValueArray: Array.from(laneToLabelMap.entries()),
  6881. laneToReactMeasureKeyValueArray: Array.from(laneToReactMeasureMap.entries())
  6882. });
  6883. }
  6884. }
  6885. return {
  6886. dataForRoots: dataForRoots,
  6887. rendererID: rendererID,
  6888. timelineData: timelineData
  6889. };
  6890. }
  6891. function startProfiling(shouldRecordChangeDescriptions) {
  6892. if (isProfiling) {
  6893. return;
  6894. }
  6895. recordChangeDescriptions = shouldRecordChangeDescriptions; // Capture initial values as of the time profiling starts.
  6896. // It's important we snapshot both the durations and the id-to-root map,
  6897. // since either of these may change during the profiling session
  6898. // (e.g. when a fiber is re-rendered or when a fiber gets removed).
  6899. displayNamesByRootID = new Map();
  6900. initialTreeBaseDurationsMap = new Map(idToTreeBaseDurationMap);
  6901. initialIDToRootMap = new Map(idToRootMap);
  6902. idToContextsMap = new Map();
  6903. hook.getFiberRoots(rendererID).forEach(function (root) {
  6904. var rootID = getFiberIDThrows(root.current);
  6905. displayNamesByRootID.set(rootID, getDisplayNameForRoot(root.current));
  6906. if (shouldRecordChangeDescriptions) {
  6907. // Record all contexts at the time profiling is started.
  6908. // Fibers only store the current context value,
  6909. // so we need to track them separately in order to determine changed keys.
  6910. crawlToInitializeContextsMap(root.current);
  6911. }
  6912. });
  6913. isProfiling = true;
  6914. profilingStartTime = renderer_getCurrentTime();
  6915. rootToCommitProfilingMetadataMap = new Map();
  6916. if (toggleProfilingStatus !== null) {
  6917. toggleProfilingStatus(true);
  6918. }
  6919. }
  6920. function stopProfiling() {
  6921. isProfiling = false;
  6922. recordChangeDescriptions = false;
  6923. if (toggleProfilingStatus !== null) {
  6924. toggleProfilingStatus(false);
  6925. }
  6926. } // Automatically start profiling so that we don't miss timing info from initial "mount".
  6927. if (Object(storage["c" /* sessionStorageGetItem */])(constants["k" /* SESSION_STORAGE_RELOAD_AND_PROFILE_KEY */]) === 'true') {
  6928. startProfiling(Object(storage["c" /* sessionStorageGetItem */])(constants["j" /* SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY */]) === 'true');
  6929. } // React will switch between these implementations depending on whether
  6930. // we have any manually suspended/errored-out Fibers or not.
  6931. function shouldErrorFiberAlwaysNull() {
  6932. return null;
  6933. } // Map of id and its force error status: true (error), false (toggled off),
  6934. // null (do nothing)
  6935. var forceErrorForFiberIDs = new Map();
  6936. function shouldErrorFiberAccordingToMap(fiber) {
  6937. if (typeof setErrorHandler !== 'function') {
  6938. throw new Error('Expected overrideError() to not get called for earlier React versions.');
  6939. }
  6940. var id = getFiberIDUnsafe(fiber);
  6941. if (id === null) {
  6942. return null;
  6943. }
  6944. var status = null;
  6945. if (forceErrorForFiberIDs.has(id)) {
  6946. status = forceErrorForFiberIDs.get(id);
  6947. if (status === false) {
  6948. // TRICKY overrideError adds entries to this Map,
  6949. // so ideally it would be the method that clears them too,
  6950. // but that would break the functionality of the feature,
  6951. // since DevTools needs to tell React to act differently than it normally would
  6952. // (don't just re-render the failed boundary, but reset its errored state too).
  6953. // So we can only clear it after telling React to reset the state.
  6954. // Technically this is premature and we should schedule it for later,
  6955. // since the render could always fail without committing the updated error boundary,
  6956. // but since this is a DEV-only feature, the simplicity is worth the trade off.
  6957. forceErrorForFiberIDs.delete(id);
  6958. if (forceErrorForFiberIDs.size === 0) {
  6959. // Last override is gone. Switch React back to fast path.
  6960. setErrorHandler(shouldErrorFiberAlwaysNull);
  6961. }
  6962. }
  6963. }
  6964. return status;
  6965. }
  6966. function overrideError(id, forceError) {
  6967. if (typeof setErrorHandler !== 'function' || typeof scheduleUpdate !== 'function') {
  6968. throw new Error('Expected overrideError() to not get called for earlier React versions.');
  6969. }
  6970. forceErrorForFiberIDs.set(id, forceError);
  6971. if (forceErrorForFiberIDs.size === 1) {
  6972. // First override is added. Switch React to slower path.
  6973. setErrorHandler(shouldErrorFiberAccordingToMap);
  6974. }
  6975. var fiber = idToArbitraryFiberMap.get(id);
  6976. if (fiber != null) {
  6977. scheduleUpdate(fiber);
  6978. }
  6979. }
  6980. function shouldSuspendFiberAlwaysFalse() {
  6981. return false;
  6982. }
  6983. var forceFallbackForSuspenseIDs = new Set();
  6984. function shouldSuspendFiberAccordingToSet(fiber) {
  6985. var maybeID = getFiberIDUnsafe(fiber);
  6986. return maybeID !== null && forceFallbackForSuspenseIDs.has(maybeID);
  6987. }
  6988. function overrideSuspense(id, forceFallback) {
  6989. if (typeof setSuspenseHandler !== 'function' || typeof scheduleUpdate !== 'function') {
  6990. throw new Error('Expected overrideSuspense() to not get called for earlier React versions.');
  6991. }
  6992. if (forceFallback) {
  6993. forceFallbackForSuspenseIDs.add(id);
  6994. if (forceFallbackForSuspenseIDs.size === 1) {
  6995. // First override is added. Switch React to slower path.
  6996. setSuspenseHandler(shouldSuspendFiberAccordingToSet);
  6997. }
  6998. } else {
  6999. forceFallbackForSuspenseIDs.delete(id);
  7000. if (forceFallbackForSuspenseIDs.size === 0) {
  7001. // Last override is gone. Switch React back to fast path.
  7002. setSuspenseHandler(shouldSuspendFiberAlwaysFalse);
  7003. }
  7004. }
  7005. var fiber = idToArbitraryFiberMap.get(id);
  7006. if (fiber != null) {
  7007. scheduleUpdate(fiber);
  7008. }
  7009. } // Remember if we're trying to restore the selection after reload.
  7010. // In that case, we'll do some extra checks for matching mounts.
  7011. var trackedPath = null;
  7012. var trackedPathMatchFiber = null;
  7013. var trackedPathMatchDepth = -1;
  7014. var mightBeOnTrackedPath = false;
  7015. function setTrackedPath(path) {
  7016. if (path === null) {
  7017. trackedPathMatchFiber = null;
  7018. trackedPathMatchDepth = -1;
  7019. mightBeOnTrackedPath = false;
  7020. }
  7021. trackedPath = path;
  7022. } // We call this before traversing a new mount.
  7023. // It remembers whether this Fiber is the next best match for tracked path.
  7024. // The return value signals whether we should keep matching siblings or not.
  7025. function updateTrackedPathStateBeforeMount(fiber) {
  7026. if (trackedPath === null || !mightBeOnTrackedPath) {
  7027. // Fast path: there's nothing to track so do nothing and ignore siblings.
  7028. return false;
  7029. }
  7030. var returnFiber = fiber.return;
  7031. var returnAlternate = returnFiber !== null ? returnFiber.alternate : null; // By now we know there's some selection to restore, and this is a new Fiber.
  7032. // Is this newly mounted Fiber a direct child of the current best match?
  7033. // (This will also be true for new roots if we haven't matched anything yet.)
  7034. if (trackedPathMatchFiber === returnFiber || trackedPathMatchFiber === returnAlternate && returnAlternate !== null) {
  7035. // Is this the next Fiber we should select? Let's compare the frames.
  7036. var actualFrame = getPathFrame(fiber); // $FlowFixMe[incompatible-use] found when upgrading Flow
  7037. var expectedFrame = trackedPath[trackedPathMatchDepth + 1];
  7038. if (expectedFrame === undefined) {
  7039. throw new Error('Expected to see a frame at the next depth.');
  7040. }
  7041. if (actualFrame.index === expectedFrame.index && actualFrame.key === expectedFrame.key && actualFrame.displayName === expectedFrame.displayName) {
  7042. // We have our next match.
  7043. trackedPathMatchFiber = fiber;
  7044. trackedPathMatchDepth++; // Are we out of frames to match?
  7045. // $FlowFixMe[incompatible-use] found when upgrading Flow
  7046. if (trackedPathMatchDepth === trackedPath.length - 1) {
  7047. // There's nothing that can possibly match afterwards.
  7048. // Don't check the children.
  7049. mightBeOnTrackedPath = false;
  7050. } else {
  7051. // Check the children, as they might reveal the next match.
  7052. mightBeOnTrackedPath = true;
  7053. } // In either case, since we have a match, we don't need
  7054. // to check the siblings. They'll never match.
  7055. return false;
  7056. }
  7057. } // This Fiber's parent is on the path, but this Fiber itself isn't.
  7058. // There's no need to check its children--they won't be on the path either.
  7059. mightBeOnTrackedPath = false; // However, one of its siblings may be on the path so keep searching.
  7060. return true;
  7061. }
  7062. function updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath) {
  7063. // updateTrackedPathStateBeforeMount() told us whether to match siblings.
  7064. // Now that we're entering siblings, let's use that information.
  7065. mightBeOnTrackedPath = mightSiblingsBeOnTrackedPath;
  7066. } // Roots don't have a real persistent identity.
  7067. // A root's "pseudo key" is "childDisplayName:indexWithThatName".
  7068. // For example, "App:0" or, in case of similar roots, "Story:0", "Story:1", etc.
  7069. // We will use this to try to disambiguate roots when restoring selection between reloads.
  7070. var rootPseudoKeys = new Map();
  7071. var rootDisplayNameCounter = new Map();
  7072. function setRootPseudoKey(id, fiber) {
  7073. var name = getDisplayNameForRoot(fiber);
  7074. var counter = rootDisplayNameCounter.get(name) || 0;
  7075. rootDisplayNameCounter.set(name, counter + 1);
  7076. var pseudoKey = "".concat(name, ":").concat(counter);
  7077. rootPseudoKeys.set(id, pseudoKey);
  7078. }
  7079. function removeRootPseudoKey(id) {
  7080. var pseudoKey = rootPseudoKeys.get(id);
  7081. if (pseudoKey === undefined) {
  7082. throw new Error('Expected root pseudo key to be known.');
  7083. }
  7084. var name = pseudoKey.substring(0, pseudoKey.lastIndexOf(':'));
  7085. var counter = rootDisplayNameCounter.get(name);
  7086. if (counter === undefined) {
  7087. throw new Error('Expected counter to be known.');
  7088. }
  7089. if (counter > 1) {
  7090. rootDisplayNameCounter.set(name, counter - 1);
  7091. } else {
  7092. rootDisplayNameCounter.delete(name);
  7093. }
  7094. rootPseudoKeys.delete(id);
  7095. }
  7096. function getDisplayNameForRoot(fiber) {
  7097. var preferredDisplayName = null;
  7098. var fallbackDisplayName = null;
  7099. var child = fiber.child; // Go at most three levels deep into direct children
  7100. // while searching for a child that has a displayName.
  7101. for (var i = 0; i < 3; i++) {
  7102. if (child === null) {
  7103. break;
  7104. }
  7105. var displayName = getDisplayNameForFiber(child);
  7106. if (displayName !== null) {
  7107. // Prefer display names that we get from user-defined components.
  7108. // We want to avoid using e.g. 'Suspense' unless we find nothing else.
  7109. if (typeof child.type === 'function') {
  7110. // There's a few user-defined tags, but we'll prefer the ones
  7111. // that are usually explicitly named (function or class components).
  7112. preferredDisplayName = displayName;
  7113. } else if (fallbackDisplayName === null) {
  7114. fallbackDisplayName = displayName;
  7115. }
  7116. }
  7117. if (preferredDisplayName !== null) {
  7118. break;
  7119. }
  7120. child = child.child;
  7121. }
  7122. return preferredDisplayName || fallbackDisplayName || 'Anonymous';
  7123. }
  7124. function getPathFrame(fiber) {
  7125. var key = fiber.key;
  7126. var displayName = getDisplayNameForFiber(fiber);
  7127. var index = fiber.index;
  7128. switch (fiber.tag) {
  7129. case HostRoot:
  7130. // Roots don't have a real displayName, index, or key.
  7131. // Instead, we'll use the pseudo key (childDisplayName:indexWithThatName).
  7132. var id = getFiberIDThrows(fiber);
  7133. var pseudoKey = rootPseudoKeys.get(id);
  7134. if (pseudoKey === undefined) {
  7135. throw new Error('Expected mounted root to have known pseudo key.');
  7136. }
  7137. displayName = pseudoKey;
  7138. break;
  7139. case HostComponent:
  7140. displayName = fiber.type;
  7141. break;
  7142. default:
  7143. break;
  7144. }
  7145. return {
  7146. displayName: displayName,
  7147. key: key,
  7148. index: index
  7149. };
  7150. } // Produces a serializable representation that does a best effort
  7151. // of identifying a particular Fiber between page reloads.
  7152. // The return path will contain Fibers that are "invisible" to the store
  7153. // because their keys and indexes are important to restoring the selection.
  7154. function getPathForElement(id) {
  7155. var fiber = idToArbitraryFiberMap.get(id);
  7156. if (fiber == null) {
  7157. return null;
  7158. }
  7159. var keyPath = [];
  7160. while (fiber !== null) {
  7161. // $FlowFixMe[incompatible-call] found when upgrading Flow
  7162. keyPath.push(getPathFrame(fiber)); // $FlowFixMe[incompatible-use] found when upgrading Flow
  7163. fiber = fiber.return;
  7164. }
  7165. keyPath.reverse();
  7166. return keyPath;
  7167. }
  7168. function getBestMatchForTrackedPath() {
  7169. if (trackedPath === null) {
  7170. // Nothing to match.
  7171. return null;
  7172. }
  7173. if (trackedPathMatchFiber === null) {
  7174. // We didn't find anything.
  7175. return null;
  7176. } // Find the closest Fiber store is aware of.
  7177. var fiber = trackedPathMatchFiber;
  7178. while (fiber !== null && shouldFilterFiber(fiber)) {
  7179. fiber = fiber.return;
  7180. }
  7181. if (fiber === null) {
  7182. return null;
  7183. }
  7184. return {
  7185. id: getFiberIDThrows(fiber),
  7186. // $FlowFixMe[incompatible-use] found when upgrading Flow
  7187. isFullMatch: trackedPathMatchDepth === trackedPath.length - 1
  7188. };
  7189. }
  7190. var formatPriorityLevel = function formatPriorityLevel(priorityLevel) {
  7191. if (priorityLevel == null) {
  7192. return 'Unknown';
  7193. }
  7194. switch (priorityLevel) {
  7195. case ImmediatePriority:
  7196. return 'Immediate';
  7197. case UserBlockingPriority:
  7198. return 'User-Blocking';
  7199. case NormalPriority:
  7200. return 'Normal';
  7201. case LowPriority:
  7202. return 'Low';
  7203. case IdlePriority:
  7204. return 'Idle';
  7205. case NoPriority:
  7206. default:
  7207. return 'Unknown';
  7208. }
  7209. };
  7210. function setTraceUpdatesEnabled(isEnabled) {
  7211. traceUpdatesEnabled = isEnabled;
  7212. }
  7213. return {
  7214. cleanup: cleanup,
  7215. clearErrorsAndWarnings: clearErrorsAndWarnings,
  7216. clearErrorsForFiberID: clearErrorsForFiberID,
  7217. clearWarningsForFiberID: clearWarningsForFiberID,
  7218. copyElementPath: copyElementPath,
  7219. deletePath: deletePath,
  7220. findNativeNodesForFiberID: findNativeNodesForFiberID,
  7221. flushInitialOperations: flushInitialOperations,
  7222. getBestMatchForTrackedPath: getBestMatchForTrackedPath,
  7223. getDisplayNameForFiberID: getDisplayNameForFiberID,
  7224. getFiberForNative: getFiberForNative,
  7225. getFiberIDForNative: getFiberIDForNative,
  7226. getInstanceAndStyle: getInstanceAndStyle,
  7227. getOwnersList: getOwnersList,
  7228. getPathForElement: getPathForElement,
  7229. getProfilingData: getProfilingData,
  7230. handleCommitFiberRoot: handleCommitFiberRoot,
  7231. handleCommitFiberUnmount: handleCommitFiberUnmount,
  7232. handlePostCommitFiberRoot: handlePostCommitFiberRoot,
  7233. inspectElement: inspectElement,
  7234. logElementToConsole: logElementToConsole,
  7235. patchConsoleForStrictMode: backend_console["c" /* patchForStrictMode */],
  7236. prepareViewAttributeSource: prepareViewAttributeSource,
  7237. prepareViewElementSource: prepareViewElementSource,
  7238. overrideError: overrideError,
  7239. overrideSuspense: overrideSuspense,
  7240. overrideValueAtPath: overrideValueAtPath,
  7241. renamePath: renamePath,
  7242. renderer: renderer,
  7243. setTraceUpdatesEnabled: setTraceUpdatesEnabled,
  7244. setTrackedPath: setTrackedPath,
  7245. startProfiling: startProfiling,
  7246. stopProfiling: stopProfiling,
  7247. storeAsGlobal: storeAsGlobal,
  7248. unpatchConsoleForStrictMode: backend_console["e" /* unpatchForStrictMode */],
  7249. updateComponentFilters: updateComponentFilters
  7250. };
  7251. }
  7252. /***/ }),
  7253. /* 15 */
  7254. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7255. "use strict";
  7256. // EXPORTS
  7257. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ describeFiber; });
  7258. __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ getStackByFiberInDevAndProd; });
  7259. // EXTERNAL MODULE: ../react-devtools-shared/src/backend/ReactSymbols.js
  7260. var ReactSymbols = __webpack_require__(3);
  7261. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsConsolePatching.js
  7262. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  7263. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  7264. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  7265. /**
  7266. * Copyright (c) Meta Platforms, Inc. and affiliates.
  7267. *
  7268. * This source code is licensed under the MIT license found in the
  7269. * LICENSE file in the root directory of this source tree.
  7270. *
  7271. *
  7272. */
  7273. // This is a DevTools fork of shared/ConsolePatchingDev.
  7274. // The shared console patching code is DEV-only.
  7275. // We can't use it since DevTools only ships production builds.
  7276. // Helpers to patch console.logs to avoid logging during side-effect free
  7277. // replaying on render function. This currently only patches the object
  7278. // lazily which won't cover if the log function was extracted eagerly.
  7279. // We could also eagerly patch the method.
  7280. var disabledDepth = 0;
  7281. var prevLog;
  7282. var prevInfo;
  7283. var prevWarn;
  7284. var prevError;
  7285. var prevGroup;
  7286. var prevGroupCollapsed;
  7287. var prevGroupEnd;
  7288. function disabledLog() {}
  7289. disabledLog.__reactDisabledLog = true;
  7290. function disableLogs() {
  7291. if (disabledDepth === 0) {
  7292. /* eslint-disable react-internal/no-production-logging */
  7293. prevLog = console.log;
  7294. prevInfo = console.info;
  7295. prevWarn = console.warn;
  7296. prevError = console.error;
  7297. prevGroup = console.group;
  7298. prevGroupCollapsed = console.groupCollapsed;
  7299. prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
  7300. var props = {
  7301. configurable: true,
  7302. enumerable: true,
  7303. value: disabledLog,
  7304. writable: true
  7305. }; // $FlowFixMe Flow thinks console is immutable.
  7306. Object.defineProperties(console, {
  7307. info: props,
  7308. log: props,
  7309. warn: props,
  7310. error: props,
  7311. group: props,
  7312. groupCollapsed: props,
  7313. groupEnd: props
  7314. });
  7315. /* eslint-enable react-internal/no-production-logging */
  7316. }
  7317. disabledDepth++;
  7318. }
  7319. function reenableLogs() {
  7320. disabledDepth--;
  7321. if (disabledDepth === 0) {
  7322. /* eslint-disable react-internal/no-production-logging */
  7323. var props = {
  7324. configurable: true,
  7325. enumerable: true,
  7326. writable: true
  7327. }; // $FlowFixMe Flow thinks console is immutable.
  7328. Object.defineProperties(console, {
  7329. log: _objectSpread(_objectSpread({}, props), {}, {
  7330. value: prevLog
  7331. }),
  7332. info: _objectSpread(_objectSpread({}, props), {}, {
  7333. value: prevInfo
  7334. }),
  7335. warn: _objectSpread(_objectSpread({}, props), {}, {
  7336. value: prevWarn
  7337. }),
  7338. error: _objectSpread(_objectSpread({}, props), {}, {
  7339. value: prevError
  7340. }),
  7341. group: _objectSpread(_objectSpread({}, props), {}, {
  7342. value: prevGroup
  7343. }),
  7344. groupCollapsed: _objectSpread(_objectSpread({}, props), {}, {
  7345. value: prevGroupCollapsed
  7346. }),
  7347. groupEnd: _objectSpread(_objectSpread({}, props), {}, {
  7348. value: prevGroupEnd
  7349. })
  7350. });
  7351. /* eslint-enable react-internal/no-production-logging */
  7352. }
  7353. if (disabledDepth < 0) {
  7354. console.error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
  7355. }
  7356. }
  7357. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsComponentStackFrame.js
  7358. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7359. /**
  7360. * Copyright (c) Meta Platforms, Inc. and affiliates.
  7361. *
  7362. * This source code is licensed under the MIT license found in the
  7363. * LICENSE file in the root directory of this source tree.
  7364. *
  7365. *
  7366. */
  7367. // This is a DevTools fork of ReactComponentStackFrame.
  7368. // This fork enables DevTools to use the same "native" component stack format,
  7369. // while still maintaining support for multiple renderer versions
  7370. // (which use different values for ReactTypeOfWork).
  7371. // The shared console patching code is DEV-only.
  7372. // We can't use it since DevTools only ships production builds.
  7373. var prefix;
  7374. function describeBuiltInComponentFrame(name, ownerFn) {
  7375. if (prefix === undefined) {
  7376. // Extract the VM specific prefix used by each line.
  7377. try {
  7378. throw Error();
  7379. } catch (x) {
  7380. var match = x.stack.trim().match(/\n( *(at )?)/);
  7381. prefix = match && match[1] || '';
  7382. }
  7383. } // We use the prefix to ensure our stacks line up with native stack frames.
  7384. return '\n' + prefix + name;
  7385. }
  7386. var reentry = false;
  7387. var componentFrameCache;
  7388. if (false) { var PossiblyWeakMap; }
  7389. function describeNativeComponentFrame(fn, construct, currentDispatcherRef) {
  7390. // If something asked for a stack inside a fake render, it should get ignored.
  7391. if (!fn || reentry) {
  7392. return '';
  7393. }
  7394. if (false) { var frame; }
  7395. var control;
  7396. var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
  7397. Error.prepareStackTrace = undefined;
  7398. reentry = true; // Override the dispatcher so effects scheduled by this shallow render are thrown away.
  7399. //
  7400. // Note that unlike the code this was forked from (in ReactComponentStackFrame)
  7401. // DevTools should override the dispatcher even when DevTools is compiled in production mode,
  7402. // because the app itself may be in development mode and log errors/warnings.
  7403. var previousDispatcher = currentDispatcherRef.current;
  7404. currentDispatcherRef.current = null;
  7405. disableLogs();
  7406. try {
  7407. // This should throw.
  7408. if (construct) {
  7409. // Something should be setting the props in the constructor.
  7410. var Fake = function Fake() {
  7411. throw Error();
  7412. }; // $FlowFixMe
  7413. Object.defineProperty(Fake.prototype, 'props', {
  7414. set: function set() {
  7415. // We use a throwing setter instead of frozen or non-writable props
  7416. // because that won't throw in a non-strict mode function.
  7417. throw Error();
  7418. }
  7419. });
  7420. if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === 'object' && Reflect.construct) {
  7421. // We construct a different control for this case to include any extra
  7422. // frames added by the construct call.
  7423. try {
  7424. Reflect.construct(Fake, []);
  7425. } catch (x) {
  7426. control = x;
  7427. }
  7428. Reflect.construct(fn, [], Fake);
  7429. } else {
  7430. try {
  7431. Fake.call();
  7432. } catch (x) {
  7433. control = x;
  7434. } // $FlowFixMe[prop-missing] found when upgrading Flow
  7435. fn.call(Fake.prototype);
  7436. }
  7437. } else {
  7438. try {
  7439. throw Error();
  7440. } catch (x) {
  7441. control = x;
  7442. }
  7443. fn();
  7444. }
  7445. } catch (sample) {
  7446. // This is inlined manually because closure doesn't do it for us.
  7447. if (sample && control && typeof sample.stack === 'string') {
  7448. // This extracts the first frame from the sample that isn't also in the control.
  7449. // Skipping one frame that we assume is the frame that calls the two.
  7450. var sampleLines = sample.stack.split('\n');
  7451. var controlLines = control.stack.split('\n');
  7452. var s = sampleLines.length - 1;
  7453. var c = controlLines.length - 1;
  7454. while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
  7455. // We expect at least one stack frame to be shared.
  7456. // Typically this will be the root most one. However, stack frames may be
  7457. // cut off due to maximum stack limits. In this case, one maybe cut off
  7458. // earlier than the other. We assume that the sample is longer or the same
  7459. // and there for cut off earlier. So we should find the root most frame in
  7460. // the sample somewhere in the control.
  7461. c--;
  7462. }
  7463. for (; s >= 1 && c >= 0; s--, c--) {
  7464. // Next we find the first one that isn't the same which should be the
  7465. // frame that called our sample function and the control.
  7466. if (sampleLines[s] !== controlLines[c]) {
  7467. // In V8, the first line is describing the message but other VMs don't.
  7468. // If we're about to return the first line, and the control is also on the same
  7469. // line, that's a pretty good indicator that our sample threw at same line as
  7470. // the control. I.e. before we entered the sample frame. So we ignore this result.
  7471. // This can happen if you passed a class to function component, or non-function.
  7472. if (s !== 1 || c !== 1) {
  7473. do {
  7474. s--;
  7475. c--; // We may still have similar intermediate frames from the construct call.
  7476. // The next one that isn't the same should be our match though.
  7477. if (c < 0 || sampleLines[s] !== controlLines[c]) {
  7478. // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
  7479. var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
  7480. if (false) {} // Return the line we found.
  7481. return _frame;
  7482. }
  7483. } while (s >= 1 && c >= 0);
  7484. }
  7485. break;
  7486. }
  7487. }
  7488. }
  7489. } finally {
  7490. reentry = false;
  7491. Error.prepareStackTrace = previousPrepareStackTrace;
  7492. currentDispatcherRef.current = previousDispatcher;
  7493. reenableLogs();
  7494. } // Fallback to just using the name if we couldn't make it throw.
  7495. var name = fn ? fn.displayName || fn.name : '';
  7496. var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
  7497. if (false) {}
  7498. return syntheticFrame;
  7499. }
  7500. function describeClassComponentFrame(ctor, ownerFn, currentDispatcherRef) {
  7501. return describeNativeComponentFrame(ctor, true, currentDispatcherRef);
  7502. }
  7503. function describeFunctionComponentFrame(fn, ownerFn, currentDispatcherRef) {
  7504. return describeNativeComponentFrame(fn, false, currentDispatcherRef);
  7505. }
  7506. function shouldConstruct(Component) {
  7507. var prototype = Component.prototype;
  7508. return !!(prototype && prototype.isReactComponent);
  7509. }
  7510. function describeUnknownElementTypeFrameInDEV(type, ownerFn, currentDispatcherRef) {
  7511. if (true) {
  7512. return '';
  7513. }
  7514. if (type == null) {
  7515. return '';
  7516. }
  7517. if (typeof type === 'function') {
  7518. return describeNativeComponentFrame(type, shouldConstruct(type), currentDispatcherRef);
  7519. }
  7520. if (typeof type === 'string') {
  7521. return describeBuiltInComponentFrame(type, ownerFn);
  7522. }
  7523. switch (type) {
  7524. case ReactSymbols["w" /* SUSPENSE_NUMBER */]:
  7525. case ReactSymbols["x" /* SUSPENSE_SYMBOL_STRING */]:
  7526. return describeBuiltInComponentFrame('Suspense', ownerFn);
  7527. case ReactSymbols["u" /* SUSPENSE_LIST_NUMBER */]:
  7528. case ReactSymbols["v" /* SUSPENSE_LIST_SYMBOL_STRING */]:
  7529. return describeBuiltInComponentFrame('SuspenseList', ownerFn);
  7530. }
  7531. if (_typeof(type) === 'object') {
  7532. switch (type.$$typeof) {
  7533. case ReactSymbols["f" /* FORWARD_REF_NUMBER */]:
  7534. case ReactSymbols["g" /* FORWARD_REF_SYMBOL_STRING */]:
  7535. return describeFunctionComponentFrame(type.render, ownerFn, currentDispatcherRef);
  7536. case ReactSymbols["j" /* MEMO_NUMBER */]:
  7537. case ReactSymbols["k" /* MEMO_SYMBOL_STRING */]:
  7538. // Memo may contain any component type so we recursively resolve it.
  7539. return describeUnknownElementTypeFrameInDEV(type.type, ownerFn, currentDispatcherRef);
  7540. case ReactSymbols["h" /* LAZY_NUMBER */]:
  7541. case ReactSymbols["i" /* LAZY_SYMBOL_STRING */]:
  7542. {
  7543. var lazyComponent = type;
  7544. var payload = lazyComponent._payload;
  7545. var init = lazyComponent._init;
  7546. try {
  7547. // Lazy may contain any component type so we recursively resolve it.
  7548. return describeUnknownElementTypeFrameInDEV(init(payload), ownerFn, currentDispatcherRef);
  7549. } catch (x) {}
  7550. }
  7551. }
  7552. }
  7553. return '';
  7554. }
  7555. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsFiberComponentStack.js
  7556. /**
  7557. * Copyright (c) Meta Platforms, Inc. and affiliates.
  7558. *
  7559. * This source code is licensed under the MIT license found in the
  7560. * LICENSE file in the root directory of this source tree.
  7561. *
  7562. *
  7563. */
  7564. // This is a DevTools fork of ReactFiberComponentStack.
  7565. // This fork enables DevTools to use the same "native" component stack format,
  7566. // while still maintaining support for multiple renderer versions
  7567. // (which use different values for ReactTypeOfWork).
  7568. function describeFiber(workTagMap, workInProgress, currentDispatcherRef) {
  7569. var HostComponent = workTagMap.HostComponent,
  7570. LazyComponent = workTagMap.LazyComponent,
  7571. SuspenseComponent = workTagMap.SuspenseComponent,
  7572. SuspenseListComponent = workTagMap.SuspenseListComponent,
  7573. FunctionComponent = workTagMap.FunctionComponent,
  7574. IndeterminateComponent = workTagMap.IndeterminateComponent,
  7575. SimpleMemoComponent = workTagMap.SimpleMemoComponent,
  7576. ForwardRef = workTagMap.ForwardRef,
  7577. ClassComponent = workTagMap.ClassComponent;
  7578. var owner = false ? undefined : null;
  7579. switch (workInProgress.tag) {
  7580. case HostComponent:
  7581. return describeBuiltInComponentFrame(workInProgress.type, owner);
  7582. case LazyComponent:
  7583. return describeBuiltInComponentFrame('Lazy', owner);
  7584. case SuspenseComponent:
  7585. return describeBuiltInComponentFrame('Suspense', owner);
  7586. case SuspenseListComponent:
  7587. return describeBuiltInComponentFrame('SuspenseList', owner);
  7588. case FunctionComponent:
  7589. case IndeterminateComponent:
  7590. case SimpleMemoComponent:
  7591. return describeFunctionComponentFrame(workInProgress.type, owner, currentDispatcherRef);
  7592. case ForwardRef:
  7593. return describeFunctionComponentFrame(workInProgress.type.render, owner, currentDispatcherRef);
  7594. case ClassComponent:
  7595. return describeClassComponentFrame(workInProgress.type, owner, currentDispatcherRef);
  7596. default:
  7597. return '';
  7598. }
  7599. }
  7600. function getStackByFiberInDevAndProd(workTagMap, workInProgress, currentDispatcherRef) {
  7601. try {
  7602. var info = '';
  7603. var node = workInProgress;
  7604. do {
  7605. info += describeFiber(workTagMap, node, currentDispatcherRef); // $FlowFixMe[incompatible-type] we bail out when we get a null
  7606. node = node.return;
  7607. } while (node);
  7608. return info;
  7609. } catch (x) {
  7610. return '\nError generating stack: ' + x.message + '\n' + x.stack;
  7611. }
  7612. }
  7613. /***/ }),
  7614. /* 16 */
  7615. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7616. "use strict";
  7617. /* unused harmony export REACT_ELEMENT_TYPE */
  7618. /* unused harmony export REACT_PORTAL_TYPE */
  7619. /* unused harmony export REACT_FRAGMENT_TYPE */
  7620. /* unused harmony export REACT_STRICT_MODE_TYPE */
  7621. /* unused harmony export REACT_PROFILER_TYPE */
  7622. /* unused harmony export REACT_PROVIDER_TYPE */
  7623. /* unused harmony export REACT_CONTEXT_TYPE */
  7624. /* unused harmony export REACT_SERVER_CONTEXT_TYPE */
  7625. /* unused harmony export REACT_FORWARD_REF_TYPE */
  7626. /* unused harmony export REACT_SUSPENSE_TYPE */
  7627. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return REACT_SUSPENSE_LIST_TYPE; });
  7628. /* unused harmony export REACT_MEMO_TYPE */
  7629. /* unused harmony export REACT_LAZY_TYPE */
  7630. /* unused harmony export REACT_SCOPE_TYPE */
  7631. /* unused harmony export REACT_DEBUG_TRACING_MODE_TYPE */
  7632. /* unused harmony export REACT_OFFSCREEN_TYPE */
  7633. /* unused harmony export REACT_LEGACY_HIDDEN_TYPE */
  7634. /* unused harmony export REACT_CACHE_TYPE */
  7635. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return REACT_TRACING_MARKER_TYPE; });
  7636. /* unused harmony export REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED */
  7637. /* unused harmony export REACT_MEMO_CACHE_SENTINEL */
  7638. /* unused harmony export getIteratorFn */
  7639. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7640. /**
  7641. * Copyright (c) Meta Platforms, Inc. and affiliates.
  7642. *
  7643. * This source code is licensed under the MIT license found in the
  7644. * LICENSE file in the root directory of this source tree.
  7645. *
  7646. *
  7647. */
  7648. // ATTENTION
  7649. // When adding new symbols to this file,
  7650. // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
  7651. // The Symbol used to tag the ReactElement-like types.
  7652. var REACT_ELEMENT_TYPE = Symbol.for('react.element');
  7653. var REACT_PORTAL_TYPE = Symbol.for('react.portal');
  7654. var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
  7655. var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
  7656. var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
  7657. var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
  7658. var REACT_CONTEXT_TYPE = Symbol.for('react.context');
  7659. var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
  7660. var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
  7661. var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
  7662. var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
  7663. var REACT_MEMO_TYPE = Symbol.for('react.memo');
  7664. var REACT_LAZY_TYPE = Symbol.for('react.lazy');
  7665. var REACT_SCOPE_TYPE = Symbol.for('react.scope');
  7666. var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode');
  7667. var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
  7668. var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden');
  7669. var REACT_CACHE_TYPE = Symbol.for('react.cache');
  7670. var REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker');
  7671. var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
  7672. var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel');
  7673. var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
  7674. var FAUX_ITERATOR_SYMBOL = '@@iterator';
  7675. function getIteratorFn(maybeIterable) {
  7676. if (maybeIterable === null || _typeof(maybeIterable) !== 'object') {
  7677. return null;
  7678. }
  7679. var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
  7680. if (typeof maybeIterator === 'function') {
  7681. return maybeIterator;
  7682. }
  7683. return null;
  7684. }
  7685. /***/ }),
  7686. /* 17 */
  7687. /***/ (function(module, exports) {
  7688. // shim for using process in browser
  7689. var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
  7690. // don't break things. But we need to wrap it in a try catch in case it is
  7691. // wrapped in strict mode code which doesn't define any globals. It's inside a
  7692. // function because try/catches deoptimize in certain engines.
  7693. var cachedSetTimeout;
  7694. var cachedClearTimeout;
  7695. function defaultSetTimout() {
  7696. throw new Error('setTimeout has not been defined');
  7697. }
  7698. function defaultClearTimeout() {
  7699. throw new Error('clearTimeout has not been defined');
  7700. }
  7701. (function () {
  7702. try {
  7703. if (typeof setTimeout === 'function') {
  7704. cachedSetTimeout = setTimeout;
  7705. } else {
  7706. cachedSetTimeout = defaultSetTimout;
  7707. }
  7708. } catch (e) {
  7709. cachedSetTimeout = defaultSetTimout;
  7710. }
  7711. try {
  7712. if (typeof clearTimeout === 'function') {
  7713. cachedClearTimeout = clearTimeout;
  7714. } else {
  7715. cachedClearTimeout = defaultClearTimeout;
  7716. }
  7717. } catch (e) {
  7718. cachedClearTimeout = defaultClearTimeout;
  7719. }
  7720. })();
  7721. function runTimeout(fun) {
  7722. if (cachedSetTimeout === setTimeout) {
  7723. //normal enviroments in sane situations
  7724. return setTimeout(fun, 0);
  7725. } // if setTimeout wasn't available but was latter defined
  7726. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  7727. cachedSetTimeout = setTimeout;
  7728. return setTimeout(fun, 0);
  7729. }
  7730. try {
  7731. // when when somebody has screwed with setTimeout but no I.E. maddness
  7732. return cachedSetTimeout(fun, 0);
  7733. } catch (e) {
  7734. try {
  7735. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  7736. return cachedSetTimeout.call(null, fun, 0);
  7737. } catch (e) {
  7738. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  7739. return cachedSetTimeout.call(this, fun, 0);
  7740. }
  7741. }
  7742. }
  7743. function runClearTimeout(marker) {
  7744. if (cachedClearTimeout === clearTimeout) {
  7745. //normal enviroments in sane situations
  7746. return clearTimeout(marker);
  7747. } // if clearTimeout wasn't available but was latter defined
  7748. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  7749. cachedClearTimeout = clearTimeout;
  7750. return clearTimeout(marker);
  7751. }
  7752. try {
  7753. // when when somebody has screwed with setTimeout but no I.E. maddness
  7754. return cachedClearTimeout(marker);
  7755. } catch (e) {
  7756. try {
  7757. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  7758. return cachedClearTimeout.call(null, marker);
  7759. } catch (e) {
  7760. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  7761. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  7762. return cachedClearTimeout.call(this, marker);
  7763. }
  7764. }
  7765. }
  7766. var queue = [];
  7767. var draining = false;
  7768. var currentQueue;
  7769. var queueIndex = -1;
  7770. function cleanUpNextTick() {
  7771. if (!draining || !currentQueue) {
  7772. return;
  7773. }
  7774. draining = false;
  7775. if (currentQueue.length) {
  7776. queue = currentQueue.concat(queue);
  7777. } else {
  7778. queueIndex = -1;
  7779. }
  7780. if (queue.length) {
  7781. drainQueue();
  7782. }
  7783. }
  7784. function drainQueue() {
  7785. if (draining) {
  7786. return;
  7787. }
  7788. var timeout = runTimeout(cleanUpNextTick);
  7789. draining = true;
  7790. var len = queue.length;
  7791. while (len) {
  7792. currentQueue = queue;
  7793. queue = [];
  7794. while (++queueIndex < len) {
  7795. if (currentQueue) {
  7796. currentQueue[queueIndex].run();
  7797. }
  7798. }
  7799. queueIndex = -1;
  7800. len = queue.length;
  7801. }
  7802. currentQueue = null;
  7803. draining = false;
  7804. runClearTimeout(timeout);
  7805. }
  7806. process.nextTick = function (fun) {
  7807. var args = new Array(arguments.length - 1);
  7808. if (arguments.length > 1) {
  7809. for (var i = 1; i < arguments.length; i++) {
  7810. args[i - 1] = arguments[i];
  7811. }
  7812. }
  7813. queue.push(new Item(fun, args));
  7814. if (queue.length === 1 && !draining) {
  7815. runTimeout(drainQueue);
  7816. }
  7817. }; // v8 likes predictible objects
  7818. function Item(fun, array) {
  7819. this.fun = fun;
  7820. this.array = array;
  7821. }
  7822. Item.prototype.run = function () {
  7823. this.fun.apply(null, this.array);
  7824. };
  7825. process.title = 'browser';
  7826. process.browser = true;
  7827. process.env = {};
  7828. process.argv = [];
  7829. process.version = ''; // empty string to avoid regexp issues
  7830. process.versions = {};
  7831. function noop() {}
  7832. process.on = noop;
  7833. process.addListener = noop;
  7834. process.once = noop;
  7835. process.off = noop;
  7836. process.removeListener = noop;
  7837. process.removeAllListeners = noop;
  7838. process.emit = noop;
  7839. process.prependListener = noop;
  7840. process.prependOnceListener = noop;
  7841. process.listeners = function (name) {
  7842. return [];
  7843. };
  7844. process.binding = function (name) {
  7845. throw new Error('process.binding is not supported');
  7846. };
  7847. process.cwd = function () {
  7848. return '/';
  7849. };
  7850. process.chdir = function (dir) {
  7851. throw new Error('process.chdir is not supported');
  7852. };
  7853. process.umask = function () {
  7854. return 0;
  7855. };
  7856. /***/ }),
  7857. /* 18 */
  7858. /***/ (function(module, exports, __webpack_require__) {
  7859. /* WEBPACK VAR INJECTION */(function(setImmediate) {function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7860. // Import support https://stackoverflow.com/questions/13673346/supporting-both-commonjs-and-amd
  7861. (function (name, definition) {
  7862. if (true) {
  7863. module.exports = definition();
  7864. } else {}
  7865. })("clipboard", function () {
  7866. if (typeof document === 'undefined' || !document.addEventListener) {
  7867. return null;
  7868. }
  7869. var clipboard = {};
  7870. clipboard.copy = function () {
  7871. var _intercept = false;
  7872. var _data = null; // Map from data type (e.g. "text/html") to value.
  7873. var _bogusSelection = false;
  7874. function cleanup() {
  7875. _intercept = false;
  7876. _data = null;
  7877. if (_bogusSelection) {
  7878. window.getSelection().removeAllRanges();
  7879. }
  7880. _bogusSelection = false;
  7881. }
  7882. document.addEventListener("copy", function (e) {
  7883. if (_intercept) {
  7884. for (var key in _data) {
  7885. e.clipboardData.setData(key, _data[key]);
  7886. }
  7887. e.preventDefault();
  7888. }
  7889. }); // Workaround for Safari: https://bugs.webkit.org/show_bug.cgi?id=156529
  7890. function bogusSelect() {
  7891. var sel = document.getSelection(); // If "nothing" is selected...
  7892. if (!document.queryCommandEnabled("copy") && sel.isCollapsed) {
  7893. // ... temporarily select the entire body.
  7894. //
  7895. // We select the entire body because:
  7896. // - it's guaranteed to exist,
  7897. // - it works (unlike, say, document.head, or phantom element that is
  7898. // not inserted into the DOM),
  7899. // - it doesn't seem to flicker (due to the synchronous copy event), and
  7900. // - it avoids modifying the DOM (can trigger mutation observers).
  7901. //
  7902. // Because we can't do proper feature detection (we already checked
  7903. // document.queryCommandEnabled("copy") , which actually gives a false
  7904. // negative for Blink when nothing is selected) and UA sniffing is not
  7905. // reliable (a lot of UA strings contain "Safari"), this will also
  7906. // happen for some browsers other than Safari. :-()
  7907. var range = document.createRange();
  7908. range.selectNodeContents(document.body);
  7909. sel.removeAllRanges();
  7910. sel.addRange(range);
  7911. _bogusSelection = true;
  7912. }
  7913. }
  7914. ;
  7915. return function (data) {
  7916. return new Promise(function (resolve, reject) {
  7917. _intercept = true;
  7918. if (typeof data === "string") {
  7919. _data = {
  7920. "text/plain": data
  7921. };
  7922. } else if (data instanceof Node) {
  7923. _data = {
  7924. "text/html": new XMLSerializer().serializeToString(data)
  7925. };
  7926. } else if (data instanceof Object) {
  7927. _data = data;
  7928. } else {
  7929. reject("Invalid data type. Must be string, DOM node, or an object mapping MIME types to strings.");
  7930. }
  7931. function triggerCopy(tryBogusSelect) {
  7932. try {
  7933. if (document.execCommand("copy")) {
  7934. // document.execCommand is synchronous: http://www.w3.org/TR/2015/WD-clipboard-apis-20150421/#integration-with-rich-text-editing-apis
  7935. // So we can call resolve() back here.
  7936. cleanup();
  7937. resolve();
  7938. } else {
  7939. if (!tryBogusSelect) {
  7940. bogusSelect();
  7941. triggerCopy(true);
  7942. } else {
  7943. cleanup();
  7944. throw new Error("Unable to copy. Perhaps it's not available in your browser?");
  7945. }
  7946. }
  7947. } catch (e) {
  7948. cleanup();
  7949. reject(e);
  7950. }
  7951. }
  7952. triggerCopy(false);
  7953. });
  7954. };
  7955. }();
  7956. clipboard.paste = function () {
  7957. var _intercept = false;
  7958. var _resolve;
  7959. var _dataType;
  7960. document.addEventListener("paste", function (e) {
  7961. if (_intercept) {
  7962. _intercept = false;
  7963. e.preventDefault();
  7964. var resolve = _resolve;
  7965. _resolve = null;
  7966. resolve(e.clipboardData.getData(_dataType));
  7967. }
  7968. });
  7969. return function (dataType) {
  7970. return new Promise(function (resolve, reject) {
  7971. _intercept = true;
  7972. _resolve = resolve;
  7973. _dataType = dataType || "text/plain";
  7974. try {
  7975. if (!document.execCommand("paste")) {
  7976. _intercept = false;
  7977. reject(new Error("Unable to paste. Pasting only works in Internet Explorer at the moment."));
  7978. }
  7979. } catch (e) {
  7980. _intercept = false;
  7981. reject(new Error(e));
  7982. }
  7983. });
  7984. };
  7985. }(); // Handle IE behaviour.
  7986. if (typeof ClipboardEvent === "undefined" && typeof window.clipboardData !== "undefined" && typeof window.clipboardData.setData !== "undefined") {
  7987. /*! promise-polyfill 2.0.1 */
  7988. (function (a) {
  7989. function b(a, b) {
  7990. return function () {
  7991. a.apply(b, arguments);
  7992. };
  7993. }
  7994. function c(a) {
  7995. if ("object" != _typeof(this)) throw new TypeError("Promises must be constructed via new");
  7996. if ("function" != typeof a) throw new TypeError("not a function");
  7997. this._state = null, this._value = null, this._deferreds = [], i(a, b(e, this), b(f, this));
  7998. }
  7999. function d(a) {
  8000. var b = this;
  8001. return null === this._state ? void this._deferreds.push(a) : void j(function () {
  8002. var c = b._state ? a.onFulfilled : a.onRejected;
  8003. if (null === c) return void (b._state ? a.resolve : a.reject)(b._value);
  8004. var d;
  8005. try {
  8006. d = c(b._value);
  8007. } catch (e) {
  8008. return void a.reject(e);
  8009. }
  8010. a.resolve(d);
  8011. });
  8012. }
  8013. function e(a) {
  8014. try {
  8015. if (a === this) throw new TypeError("A promise cannot be resolved with itself.");
  8016. if (a && ("object" == _typeof(a) || "function" == typeof a)) {
  8017. var c = a.then;
  8018. if ("function" == typeof c) return void i(b(c, a), b(e, this), b(f, this));
  8019. }
  8020. this._state = !0, this._value = a, g.call(this);
  8021. } catch (d) {
  8022. f.call(this, d);
  8023. }
  8024. }
  8025. function f(a) {
  8026. this._state = !1, this._value = a, g.call(this);
  8027. }
  8028. function g() {
  8029. for (var a = 0, b = this._deferreds.length; b > a; a++) {
  8030. d.call(this, this._deferreds[a]);
  8031. }
  8032. this._deferreds = null;
  8033. }
  8034. function h(a, b, c, d) {
  8035. this.onFulfilled = "function" == typeof a ? a : null, this.onRejected = "function" == typeof b ? b : null, this.resolve = c, this.reject = d;
  8036. }
  8037. function i(a, b, c) {
  8038. var d = !1;
  8039. try {
  8040. a(function (a) {
  8041. d || (d = !0, b(a));
  8042. }, function (a) {
  8043. d || (d = !0, c(a));
  8044. });
  8045. } catch (e) {
  8046. if (d) return;
  8047. d = !0, c(e);
  8048. }
  8049. }
  8050. var j = c.immediateFn || "function" == typeof setImmediate && setImmediate || function (a) {
  8051. setTimeout(a, 1);
  8052. },
  8053. k = Array.isArray || function (a) {
  8054. return "[object Array]" === Object.prototype.toString.call(a);
  8055. };
  8056. c.prototype["catch"] = function (a) {
  8057. return this.then(null, a);
  8058. }, c.prototype.then = function (a, b) {
  8059. var e = this;
  8060. return new c(function (c, f) {
  8061. d.call(e, new h(a, b, c, f));
  8062. });
  8063. }, c.all = function () {
  8064. var a = Array.prototype.slice.call(1 === arguments.length && k(arguments[0]) ? arguments[0] : arguments);
  8065. return new c(function (b, c) {
  8066. function d(f, g) {
  8067. try {
  8068. if (g && ("object" == _typeof(g) || "function" == typeof g)) {
  8069. var h = g.then;
  8070. if ("function" == typeof h) return void h.call(g, function (a) {
  8071. d(f, a);
  8072. }, c);
  8073. }
  8074. a[f] = g, 0 === --e && b(a);
  8075. } catch (i) {
  8076. c(i);
  8077. }
  8078. }
  8079. if (0 === a.length) return b([]);
  8080. for (var e = a.length, f = 0; f < a.length; f++) {
  8081. d(f, a[f]);
  8082. }
  8083. });
  8084. }, c.resolve = function (a) {
  8085. return a && "object" == _typeof(a) && a.constructor === c ? a : new c(function (b) {
  8086. b(a);
  8087. });
  8088. }, c.reject = function (a) {
  8089. return new c(function (b, c) {
  8090. c(a);
  8091. });
  8092. }, c.race = function (a) {
  8093. return new c(function (b, c) {
  8094. for (var d = 0, e = a.length; e > d; d++) {
  8095. a[d].then(b, c);
  8096. }
  8097. });
  8098. }, true && module.exports ? module.exports = c : a.Promise || (a.Promise = c);
  8099. })(this);
  8100. clipboard.copy = function (data) {
  8101. return new Promise(function (resolve, reject) {
  8102. // IE supports string and URL types: https://msdn.microsoft.com/en-us/library/ms536744(v=vs.85).aspx
  8103. // We only support the string type for now.
  8104. if (typeof data !== "string" && !("text/plain" in data)) {
  8105. throw new Error("You must provide a text/plain type.");
  8106. }
  8107. var strData = typeof data === "string" ? data : data["text/plain"];
  8108. var copySucceeded = window.clipboardData.setData("Text", strData);
  8109. if (copySucceeded) {
  8110. resolve();
  8111. } else {
  8112. reject(new Error("Copying was rejected."));
  8113. }
  8114. });
  8115. };
  8116. clipboard.paste = function () {
  8117. return new Promise(function (resolve, reject) {
  8118. var strData = window.clipboardData.getData("Text");
  8119. if (strData) {
  8120. resolve(strData);
  8121. } else {
  8122. // The user rejected the paste request.
  8123. reject(new Error("Pasting was rejected."));
  8124. }
  8125. });
  8126. };
  8127. }
  8128. return clipboard;
  8129. });
  8130. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(21).setImmediate))
  8131. /***/ }),
  8132. /* 19 */
  8133. /***/ (function(module, exports, __webpack_require__) {
  8134. "use strict";
  8135. // A linked list to keep track of recently-used-ness
  8136. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8137. 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); } }
  8138. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  8139. var Yallist = __webpack_require__(23);
  8140. var MAX = Symbol('max');
  8141. var LENGTH = Symbol('length');
  8142. var LENGTH_CALCULATOR = Symbol('lengthCalculator');
  8143. var ALLOW_STALE = Symbol('allowStale');
  8144. var MAX_AGE = Symbol('maxAge');
  8145. var DISPOSE = Symbol('dispose');
  8146. var NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
  8147. var LRU_LIST = Symbol('lruList');
  8148. var CACHE = Symbol('cache');
  8149. var UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
  8150. var naiveLength = function naiveLength() {
  8151. return 1;
  8152. }; // lruList is a yallist where the head is the youngest
  8153. // item, and the tail is the oldest. the list contains the Hit
  8154. // objects as the entries.
  8155. // Each Hit object has a reference to its Yallist.Node. This
  8156. // never changes.
  8157. //
  8158. // cache is a Map (or PseudoMap) that matches the keys to
  8159. // the Yallist.Node object.
  8160. var LRUCache = /*#__PURE__*/function () {
  8161. function LRUCache(options) {
  8162. _classCallCheck(this, LRUCache);
  8163. if (typeof options === 'number') options = {
  8164. max: options
  8165. };
  8166. if (!options) options = {};
  8167. if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number'); // Kind of weird to have a default max of Infinity, but oh well.
  8168. var max = this[MAX] = options.max || Infinity;
  8169. var lc = options.length || naiveLength;
  8170. this[LENGTH_CALCULATOR] = typeof lc !== 'function' ? naiveLength : lc;
  8171. this[ALLOW_STALE] = options.stale || false;
  8172. if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number');
  8173. this[MAX_AGE] = options.maxAge || 0;
  8174. this[DISPOSE] = options.dispose;
  8175. this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
  8176. this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
  8177. this.reset();
  8178. } // resize the cache when the max changes.
  8179. _createClass(LRUCache, [{
  8180. key: "rforEach",
  8181. value: function rforEach(fn, thisp) {
  8182. thisp = thisp || this;
  8183. for (var walker = this[LRU_LIST].tail; walker !== null;) {
  8184. var prev = walker.prev;
  8185. forEachStep(this, fn, walker, thisp);
  8186. walker = prev;
  8187. }
  8188. }
  8189. }, {
  8190. key: "forEach",
  8191. value: function forEach(fn, thisp) {
  8192. thisp = thisp || this;
  8193. for (var walker = this[LRU_LIST].head; walker !== null;) {
  8194. var next = walker.next;
  8195. forEachStep(this, fn, walker, thisp);
  8196. walker = next;
  8197. }
  8198. }
  8199. }, {
  8200. key: "keys",
  8201. value: function keys() {
  8202. return this[LRU_LIST].toArray().map(function (k) {
  8203. return k.key;
  8204. });
  8205. }
  8206. }, {
  8207. key: "values",
  8208. value: function values() {
  8209. return this[LRU_LIST].toArray().map(function (k) {
  8210. return k.value;
  8211. });
  8212. }
  8213. }, {
  8214. key: "reset",
  8215. value: function reset() {
  8216. var _this = this;
  8217. if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
  8218. this[LRU_LIST].forEach(function (hit) {
  8219. return _this[DISPOSE](hit.key, hit.value);
  8220. });
  8221. }
  8222. this[CACHE] = new Map(); // hash of items by key
  8223. this[LRU_LIST] = new Yallist(); // list of items in order of use recency
  8224. this[LENGTH] = 0; // length of items in the list
  8225. }
  8226. }, {
  8227. key: "dump",
  8228. value: function dump() {
  8229. var _this2 = this;
  8230. return this[LRU_LIST].map(function (hit) {
  8231. return isStale(_this2, hit) ? false : {
  8232. k: hit.key,
  8233. v: hit.value,
  8234. e: hit.now + (hit.maxAge || 0)
  8235. };
  8236. }).toArray().filter(function (h) {
  8237. return h;
  8238. });
  8239. }
  8240. }, {
  8241. key: "dumpLru",
  8242. value: function dumpLru() {
  8243. return this[LRU_LIST];
  8244. }
  8245. }, {
  8246. key: "set",
  8247. value: function set(key, value, maxAge) {
  8248. maxAge = maxAge || this[MAX_AGE];
  8249. if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number');
  8250. var now = maxAge ? Date.now() : 0;
  8251. var len = this[LENGTH_CALCULATOR](value, key);
  8252. if (this[CACHE].has(key)) {
  8253. if (len > this[MAX]) {
  8254. _del(this, this[CACHE].get(key));
  8255. return false;
  8256. }
  8257. var node = this[CACHE].get(key);
  8258. var item = node.value; // dispose of the old one before overwriting
  8259. // split out into 2 ifs for better coverage tracking
  8260. if (this[DISPOSE]) {
  8261. if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value);
  8262. }
  8263. item.now = now;
  8264. item.maxAge = maxAge;
  8265. item.value = value;
  8266. this[LENGTH] += len - item.length;
  8267. item.length = len;
  8268. this.get(key);
  8269. trim(this);
  8270. return true;
  8271. }
  8272. var hit = new Entry(key, value, len, now, maxAge); // oversized objects fall out of cache automatically.
  8273. if (hit.length > this[MAX]) {
  8274. if (this[DISPOSE]) this[DISPOSE](key, value);
  8275. return false;
  8276. }
  8277. this[LENGTH] += hit.length;
  8278. this[LRU_LIST].unshift(hit);
  8279. this[CACHE].set(key, this[LRU_LIST].head);
  8280. trim(this);
  8281. return true;
  8282. }
  8283. }, {
  8284. key: "has",
  8285. value: function has(key) {
  8286. if (!this[CACHE].has(key)) return false;
  8287. var hit = this[CACHE].get(key).value;
  8288. return !isStale(this, hit);
  8289. }
  8290. }, {
  8291. key: "get",
  8292. value: function get(key) {
  8293. return _get(this, key, true);
  8294. }
  8295. }, {
  8296. key: "peek",
  8297. value: function peek(key) {
  8298. return _get(this, key, false);
  8299. }
  8300. }, {
  8301. key: "pop",
  8302. value: function pop() {
  8303. var node = this[LRU_LIST].tail;
  8304. if (!node) return null;
  8305. _del(this, node);
  8306. return node.value;
  8307. }
  8308. }, {
  8309. key: "del",
  8310. value: function del(key) {
  8311. _del(this, this[CACHE].get(key));
  8312. }
  8313. }, {
  8314. key: "load",
  8315. value: function load(arr) {
  8316. // reset the cache
  8317. this.reset();
  8318. var now = Date.now(); // A previous serialized cache has the most recent items first
  8319. for (var l = arr.length - 1; l >= 0; l--) {
  8320. var hit = arr[l];
  8321. var expiresAt = hit.e || 0;
  8322. if (expiresAt === 0) // the item was created without expiration in a non aged cache
  8323. this.set(hit.k, hit.v);else {
  8324. var maxAge = expiresAt - now; // dont add already expired items
  8325. if (maxAge > 0) {
  8326. this.set(hit.k, hit.v, maxAge);
  8327. }
  8328. }
  8329. }
  8330. }
  8331. }, {
  8332. key: "prune",
  8333. value: function prune() {
  8334. var _this3 = this;
  8335. this[CACHE].forEach(function (value, key) {
  8336. return _get(_this3, key, false);
  8337. });
  8338. }
  8339. }, {
  8340. key: "max",
  8341. set: function set(mL) {
  8342. if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number');
  8343. this[MAX] = mL || Infinity;
  8344. trim(this);
  8345. },
  8346. get: function get() {
  8347. return this[MAX];
  8348. }
  8349. }, {
  8350. key: "allowStale",
  8351. set: function set(allowStale) {
  8352. this[ALLOW_STALE] = !!allowStale;
  8353. },
  8354. get: function get() {
  8355. return this[ALLOW_STALE];
  8356. }
  8357. }, {
  8358. key: "maxAge",
  8359. set: function set(mA) {
  8360. if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number');
  8361. this[MAX_AGE] = mA;
  8362. trim(this);
  8363. },
  8364. get: function get() {
  8365. return this[MAX_AGE];
  8366. } // resize the cache when the lengthCalculator changes.
  8367. }, {
  8368. key: "lengthCalculator",
  8369. set: function set(lC) {
  8370. var _this4 = this;
  8371. if (typeof lC !== 'function') lC = naiveLength;
  8372. if (lC !== this[LENGTH_CALCULATOR]) {
  8373. this[LENGTH_CALCULATOR] = lC;
  8374. this[LENGTH] = 0;
  8375. this[LRU_LIST].forEach(function (hit) {
  8376. hit.length = _this4[LENGTH_CALCULATOR](hit.value, hit.key);
  8377. _this4[LENGTH] += hit.length;
  8378. });
  8379. }
  8380. trim(this);
  8381. },
  8382. get: function get() {
  8383. return this[LENGTH_CALCULATOR];
  8384. }
  8385. }, {
  8386. key: "length",
  8387. get: function get() {
  8388. return this[LENGTH];
  8389. }
  8390. }, {
  8391. key: "itemCount",
  8392. get: function get() {
  8393. return this[LRU_LIST].length;
  8394. }
  8395. }]);
  8396. return LRUCache;
  8397. }();
  8398. var _get = function _get(self, key, doUse) {
  8399. var node = self[CACHE].get(key);
  8400. if (node) {
  8401. var hit = node.value;
  8402. if (isStale(self, hit)) {
  8403. _del(self, node);
  8404. if (!self[ALLOW_STALE]) return undefined;
  8405. } else {
  8406. if (doUse) {
  8407. if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now();
  8408. self[LRU_LIST].unshiftNode(node);
  8409. }
  8410. }
  8411. return hit.value;
  8412. }
  8413. };
  8414. var isStale = function isStale(self, hit) {
  8415. if (!hit || !hit.maxAge && !self[MAX_AGE]) return false;
  8416. var diff = Date.now() - hit.now;
  8417. return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
  8418. };
  8419. var trim = function trim(self) {
  8420. if (self[LENGTH] > self[MAX]) {
  8421. for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) {
  8422. // We know that we're about to delete this one, and also
  8423. // what the next least recently used key will be, so just
  8424. // go ahead and set it now.
  8425. var prev = walker.prev;
  8426. _del(self, walker);
  8427. walker = prev;
  8428. }
  8429. }
  8430. };
  8431. var _del = function _del(self, node) {
  8432. if (node) {
  8433. var hit = node.value;
  8434. if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value);
  8435. self[LENGTH] -= hit.length;
  8436. self[CACHE].delete(hit.key);
  8437. self[LRU_LIST].removeNode(node);
  8438. }
  8439. };
  8440. var Entry = function Entry(key, value, length, now, maxAge) {
  8441. _classCallCheck(this, Entry);
  8442. this.key = key;
  8443. this.value = value;
  8444. this.length = length;
  8445. this.now = now;
  8446. this.maxAge = maxAge || 0;
  8447. };
  8448. var forEachStep = function forEachStep(self, fn, node, thisp) {
  8449. var hit = node.value;
  8450. if (isStale(self, hit)) {
  8451. _del(self, node);
  8452. if (!self[ALLOW_STALE]) hit = undefined;
  8453. }
  8454. if (hit) fn.call(thisp, hit.value, hit.key, self);
  8455. };
  8456. module.exports = LRUCache;
  8457. /***/ }),
  8458. /* 20 */
  8459. /***/ (function(module, exports, __webpack_require__) {
  8460. "use strict";
  8461. if (true) {
  8462. module.exports = __webpack_require__(26);
  8463. } else {}
  8464. /***/ }),
  8465. /* 21 */
  8466. /***/ (function(module, exports, __webpack_require__) {
  8467. /* WEBPACK VAR INJECTION */(function(global) {var scope = typeof global !== "undefined" && global || typeof self !== "undefined" && self || window;
  8468. var apply = Function.prototype.apply; // DOM APIs, for completeness
  8469. exports.setTimeout = function () {
  8470. return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  8471. };
  8472. exports.setInterval = function () {
  8473. return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  8474. };
  8475. exports.clearTimeout = exports.clearInterval = function (timeout) {
  8476. if (timeout) {
  8477. timeout.close();
  8478. }
  8479. };
  8480. function Timeout(id, clearFn) {
  8481. this._id = id;
  8482. this._clearFn = clearFn;
  8483. }
  8484. Timeout.prototype.unref = Timeout.prototype.ref = function () {};
  8485. Timeout.prototype.close = function () {
  8486. this._clearFn.call(scope, this._id);
  8487. }; // Does not start the time, just sets up the members needed.
  8488. exports.enroll = function (item, msecs) {
  8489. clearTimeout(item._idleTimeoutId);
  8490. item._idleTimeout = msecs;
  8491. };
  8492. exports.unenroll = function (item) {
  8493. clearTimeout(item._idleTimeoutId);
  8494. item._idleTimeout = -1;
  8495. };
  8496. exports._unrefActive = exports.active = function (item) {
  8497. clearTimeout(item._idleTimeoutId);
  8498. var msecs = item._idleTimeout;
  8499. if (msecs >= 0) {
  8500. item._idleTimeoutId = setTimeout(function onTimeout() {
  8501. if (item._onTimeout) item._onTimeout();
  8502. }, msecs);
  8503. }
  8504. }; // setimmediate attaches itself to the global object
  8505. __webpack_require__(22); // On some exotic environments, it's not clear which object `setimmediate` was
  8506. // able to install onto. Search each possibility in the same order as the
  8507. // `setimmediate` library.
  8508. exports.setImmediate = typeof self !== "undefined" && self.setImmediate || typeof global !== "undefined" && global.setImmediate || this && this.setImmediate;
  8509. exports.clearImmediate = typeof self !== "undefined" && self.clearImmediate || typeof global !== "undefined" && global.clearImmediate || this && this.clearImmediate;
  8510. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(12)))
  8511. /***/ }),
  8512. /* 22 */
  8513. /***/ (function(module, exports, __webpack_require__) {
  8514. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  8515. "use strict";
  8516. if (global.setImmediate) {
  8517. return;
  8518. }
  8519. var nextHandle = 1; // Spec says greater than zero
  8520. var tasksByHandle = {};
  8521. var currentlyRunningATask = false;
  8522. var doc = global.document;
  8523. var registerImmediate;
  8524. function setImmediate(callback) {
  8525. // Callback can either be a function or a string
  8526. if (typeof callback !== "function") {
  8527. callback = new Function("" + callback);
  8528. } // Copy function arguments
  8529. var args = new Array(arguments.length - 1);
  8530. for (var i = 0; i < args.length; i++) {
  8531. args[i] = arguments[i + 1];
  8532. } // Store and register the task
  8533. var task = {
  8534. callback: callback,
  8535. args: args
  8536. };
  8537. tasksByHandle[nextHandle] = task;
  8538. registerImmediate(nextHandle);
  8539. return nextHandle++;
  8540. }
  8541. function clearImmediate(handle) {
  8542. delete tasksByHandle[handle];
  8543. }
  8544. function run(task) {
  8545. var callback = task.callback;
  8546. var args = task.args;
  8547. switch (args.length) {
  8548. case 0:
  8549. callback();
  8550. break;
  8551. case 1:
  8552. callback(args[0]);
  8553. break;
  8554. case 2:
  8555. callback(args[0], args[1]);
  8556. break;
  8557. case 3:
  8558. callback(args[0], args[1], args[2]);
  8559. break;
  8560. default:
  8561. callback.apply(undefined, args);
  8562. break;
  8563. }
  8564. }
  8565. function runIfPresent(handle) {
  8566. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  8567. // So if we're currently running a task, we'll need to delay this invocation.
  8568. if (currentlyRunningATask) {
  8569. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  8570. // "too much recursion" error.
  8571. setTimeout(runIfPresent, 0, handle);
  8572. } else {
  8573. var task = tasksByHandle[handle];
  8574. if (task) {
  8575. currentlyRunningATask = true;
  8576. try {
  8577. run(task);
  8578. } finally {
  8579. clearImmediate(handle);
  8580. currentlyRunningATask = false;
  8581. }
  8582. }
  8583. }
  8584. }
  8585. function installNextTickImplementation() {
  8586. registerImmediate = function registerImmediate(handle) {
  8587. process.nextTick(function () {
  8588. runIfPresent(handle);
  8589. });
  8590. };
  8591. }
  8592. function canUsePostMessage() {
  8593. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  8594. // where `global.postMessage` means something completely different and can't be used for this purpose.
  8595. if (global.postMessage && !global.importScripts) {
  8596. var postMessageIsAsynchronous = true;
  8597. var oldOnMessage = global.onmessage;
  8598. global.onmessage = function () {
  8599. postMessageIsAsynchronous = false;
  8600. };
  8601. global.postMessage("", "*");
  8602. global.onmessage = oldOnMessage;
  8603. return postMessageIsAsynchronous;
  8604. }
  8605. }
  8606. function installPostMessageImplementation() {
  8607. // Installs an event handler on `global` for the `message` event: see
  8608. // * https://developer.mozilla.org/en/DOM/window.postMessage
  8609. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  8610. var messagePrefix = "setImmediate$" + Math.random() + "$";
  8611. var onGlobalMessage = function onGlobalMessage(event) {
  8612. if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) {
  8613. runIfPresent(+event.data.slice(messagePrefix.length));
  8614. }
  8615. };
  8616. if (global.addEventListener) {
  8617. global.addEventListener("message", onGlobalMessage, false);
  8618. } else {
  8619. global.attachEvent("onmessage", onGlobalMessage);
  8620. }
  8621. registerImmediate = function registerImmediate(handle) {
  8622. global.postMessage(messagePrefix + handle, "*");
  8623. };
  8624. }
  8625. function installMessageChannelImplementation() {
  8626. var channel = new MessageChannel();
  8627. channel.port1.onmessage = function (event) {
  8628. var handle = event.data;
  8629. runIfPresent(handle);
  8630. };
  8631. registerImmediate = function registerImmediate(handle) {
  8632. channel.port2.postMessage(handle);
  8633. };
  8634. }
  8635. function installReadyStateChangeImplementation() {
  8636. var html = doc.documentElement;
  8637. registerImmediate = function registerImmediate(handle) {
  8638. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  8639. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  8640. var script = doc.createElement("script");
  8641. script.onreadystatechange = function () {
  8642. runIfPresent(handle);
  8643. script.onreadystatechange = null;
  8644. html.removeChild(script);
  8645. script = null;
  8646. };
  8647. html.appendChild(script);
  8648. };
  8649. }
  8650. function installSetTimeoutImplementation() {
  8651. registerImmediate = function registerImmediate(handle) {
  8652. setTimeout(runIfPresent, 0, handle);
  8653. };
  8654. } // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  8655. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  8656. attachTo = attachTo && attachTo.setTimeout ? attachTo : global; // Don't get fooled by e.g. browserify environments.
  8657. if ({}.toString.call(global.process) === "[object process]") {
  8658. // For Node.js before 0.9
  8659. installNextTickImplementation();
  8660. } else if (canUsePostMessage()) {
  8661. // For non-IE10 modern browsers
  8662. installPostMessageImplementation();
  8663. } else if (global.MessageChannel) {
  8664. // For web workers, where supported
  8665. installMessageChannelImplementation();
  8666. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  8667. // For IE 6–8
  8668. installReadyStateChangeImplementation();
  8669. } else {
  8670. // For older browsers
  8671. installSetTimeoutImplementation();
  8672. }
  8673. attachTo.setImmediate = setImmediate;
  8674. attachTo.clearImmediate = clearImmediate;
  8675. })(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self);
  8676. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(12), __webpack_require__(17)))
  8677. /***/ }),
  8678. /* 23 */
  8679. /***/ (function(module, exports, __webpack_require__) {
  8680. "use strict";
  8681. module.exports = Yallist;
  8682. Yallist.Node = Node;
  8683. Yallist.create = Yallist;
  8684. function Yallist(list) {
  8685. var self = this;
  8686. if (!(self instanceof Yallist)) {
  8687. self = new Yallist();
  8688. }
  8689. self.tail = null;
  8690. self.head = null;
  8691. self.length = 0;
  8692. if (list && typeof list.forEach === 'function') {
  8693. list.forEach(function (item) {
  8694. self.push(item);
  8695. });
  8696. } else if (arguments.length > 0) {
  8697. for (var i = 0, l = arguments.length; i < l; i++) {
  8698. self.push(arguments[i]);
  8699. }
  8700. }
  8701. return self;
  8702. }
  8703. Yallist.prototype.removeNode = function (node) {
  8704. if (node.list !== this) {
  8705. throw new Error('removing node which does not belong to this list');
  8706. }
  8707. var next = node.next;
  8708. var prev = node.prev;
  8709. if (next) {
  8710. next.prev = prev;
  8711. }
  8712. if (prev) {
  8713. prev.next = next;
  8714. }
  8715. if (node === this.head) {
  8716. this.head = next;
  8717. }
  8718. if (node === this.tail) {
  8719. this.tail = prev;
  8720. }
  8721. node.list.length--;
  8722. node.next = null;
  8723. node.prev = null;
  8724. node.list = null;
  8725. return next;
  8726. };
  8727. Yallist.prototype.unshiftNode = function (node) {
  8728. if (node === this.head) {
  8729. return;
  8730. }
  8731. if (node.list) {
  8732. node.list.removeNode(node);
  8733. }
  8734. var head = this.head;
  8735. node.list = this;
  8736. node.next = head;
  8737. if (head) {
  8738. head.prev = node;
  8739. }
  8740. this.head = node;
  8741. if (!this.tail) {
  8742. this.tail = node;
  8743. }
  8744. this.length++;
  8745. };
  8746. Yallist.prototype.pushNode = function (node) {
  8747. if (node === this.tail) {
  8748. return;
  8749. }
  8750. if (node.list) {
  8751. node.list.removeNode(node);
  8752. }
  8753. var tail = this.tail;
  8754. node.list = this;
  8755. node.prev = tail;
  8756. if (tail) {
  8757. tail.next = node;
  8758. }
  8759. this.tail = node;
  8760. if (!this.head) {
  8761. this.head = node;
  8762. }
  8763. this.length++;
  8764. };
  8765. Yallist.prototype.push = function () {
  8766. for (var i = 0, l = arguments.length; i < l; i++) {
  8767. push(this, arguments[i]);
  8768. }
  8769. return this.length;
  8770. };
  8771. Yallist.prototype.unshift = function () {
  8772. for (var i = 0, l = arguments.length; i < l; i++) {
  8773. unshift(this, arguments[i]);
  8774. }
  8775. return this.length;
  8776. };
  8777. Yallist.prototype.pop = function () {
  8778. if (!this.tail) {
  8779. return undefined;
  8780. }
  8781. var res = this.tail.value;
  8782. this.tail = this.tail.prev;
  8783. if (this.tail) {
  8784. this.tail.next = null;
  8785. } else {
  8786. this.head = null;
  8787. }
  8788. this.length--;
  8789. return res;
  8790. };
  8791. Yallist.prototype.shift = function () {
  8792. if (!this.head) {
  8793. return undefined;
  8794. }
  8795. var res = this.head.value;
  8796. this.head = this.head.next;
  8797. if (this.head) {
  8798. this.head.prev = null;
  8799. } else {
  8800. this.tail = null;
  8801. }
  8802. this.length--;
  8803. return res;
  8804. };
  8805. Yallist.prototype.forEach = function (fn, thisp) {
  8806. thisp = thisp || this;
  8807. for (var walker = this.head, i = 0; walker !== null; i++) {
  8808. fn.call(thisp, walker.value, i, this);
  8809. walker = walker.next;
  8810. }
  8811. };
  8812. Yallist.prototype.forEachReverse = function (fn, thisp) {
  8813. thisp = thisp || this;
  8814. for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
  8815. fn.call(thisp, walker.value, i, this);
  8816. walker = walker.prev;
  8817. }
  8818. };
  8819. Yallist.prototype.get = function (n) {
  8820. for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
  8821. // abort out of the list early if we hit a cycle
  8822. walker = walker.next;
  8823. }
  8824. if (i === n && walker !== null) {
  8825. return walker.value;
  8826. }
  8827. };
  8828. Yallist.prototype.getReverse = function (n) {
  8829. for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
  8830. // abort out of the list early if we hit a cycle
  8831. walker = walker.prev;
  8832. }
  8833. if (i === n && walker !== null) {
  8834. return walker.value;
  8835. }
  8836. };
  8837. Yallist.prototype.map = function (fn, thisp) {
  8838. thisp = thisp || this;
  8839. var res = new Yallist();
  8840. for (var walker = this.head; walker !== null;) {
  8841. res.push(fn.call(thisp, walker.value, this));
  8842. walker = walker.next;
  8843. }
  8844. return res;
  8845. };
  8846. Yallist.prototype.mapReverse = function (fn, thisp) {
  8847. thisp = thisp || this;
  8848. var res = new Yallist();
  8849. for (var walker = this.tail; walker !== null;) {
  8850. res.push(fn.call(thisp, walker.value, this));
  8851. walker = walker.prev;
  8852. }
  8853. return res;
  8854. };
  8855. Yallist.prototype.reduce = function (fn, initial) {
  8856. var acc;
  8857. var walker = this.head;
  8858. if (arguments.length > 1) {
  8859. acc = initial;
  8860. } else if (this.head) {
  8861. walker = this.head.next;
  8862. acc = this.head.value;
  8863. } else {
  8864. throw new TypeError('Reduce of empty list with no initial value');
  8865. }
  8866. for (var i = 0; walker !== null; i++) {
  8867. acc = fn(acc, walker.value, i);
  8868. walker = walker.next;
  8869. }
  8870. return acc;
  8871. };
  8872. Yallist.prototype.reduceReverse = function (fn, initial) {
  8873. var acc;
  8874. var walker = this.tail;
  8875. if (arguments.length > 1) {
  8876. acc = initial;
  8877. } else if (this.tail) {
  8878. walker = this.tail.prev;
  8879. acc = this.tail.value;
  8880. } else {
  8881. throw new TypeError('Reduce of empty list with no initial value');
  8882. }
  8883. for (var i = this.length - 1; walker !== null; i--) {
  8884. acc = fn(acc, walker.value, i);
  8885. walker = walker.prev;
  8886. }
  8887. return acc;
  8888. };
  8889. Yallist.prototype.toArray = function () {
  8890. var arr = new Array(this.length);
  8891. for (var i = 0, walker = this.head; walker !== null; i++) {
  8892. arr[i] = walker.value;
  8893. walker = walker.next;
  8894. }
  8895. return arr;
  8896. };
  8897. Yallist.prototype.toArrayReverse = function () {
  8898. var arr = new Array(this.length);
  8899. for (var i = 0, walker = this.tail; walker !== null; i++) {
  8900. arr[i] = walker.value;
  8901. walker = walker.prev;
  8902. }
  8903. return arr;
  8904. };
  8905. Yallist.prototype.slice = function (from, to) {
  8906. to = to || this.length;
  8907. if (to < 0) {
  8908. to += this.length;
  8909. }
  8910. from = from || 0;
  8911. if (from < 0) {
  8912. from += this.length;
  8913. }
  8914. var ret = new Yallist();
  8915. if (to < from || to < 0) {
  8916. return ret;
  8917. }
  8918. if (from < 0) {
  8919. from = 0;
  8920. }
  8921. if (to > this.length) {
  8922. to = this.length;
  8923. }
  8924. for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
  8925. walker = walker.next;
  8926. }
  8927. for (; walker !== null && i < to; i++, walker = walker.next) {
  8928. ret.push(walker.value);
  8929. }
  8930. return ret;
  8931. };
  8932. Yallist.prototype.sliceReverse = function (from, to) {
  8933. to = to || this.length;
  8934. if (to < 0) {
  8935. to += this.length;
  8936. }
  8937. from = from || 0;
  8938. if (from < 0) {
  8939. from += this.length;
  8940. }
  8941. var ret = new Yallist();
  8942. if (to < from || to < 0) {
  8943. return ret;
  8944. }
  8945. if (from < 0) {
  8946. from = 0;
  8947. }
  8948. if (to > this.length) {
  8949. to = this.length;
  8950. }
  8951. for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
  8952. walker = walker.prev;
  8953. }
  8954. for (; walker !== null && i > from; i--, walker = walker.prev) {
  8955. ret.push(walker.value);
  8956. }
  8957. return ret;
  8958. };
  8959. Yallist.prototype.splice = function (start, deleteCount
  8960. /*, ...nodes */
  8961. ) {
  8962. if (start > this.length) {
  8963. start = this.length - 1;
  8964. }
  8965. if (start < 0) {
  8966. start = this.length + start;
  8967. }
  8968. for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
  8969. walker = walker.next;
  8970. }
  8971. var ret = [];
  8972. for (var i = 0; walker && i < deleteCount; i++) {
  8973. ret.push(walker.value);
  8974. walker = this.removeNode(walker);
  8975. }
  8976. if (walker === null) {
  8977. walker = this.tail;
  8978. }
  8979. if (walker !== this.head && walker !== this.tail) {
  8980. walker = walker.prev;
  8981. }
  8982. for (var i = 2; i < arguments.length; i++) {
  8983. walker = insert(this, walker, arguments[i]);
  8984. }
  8985. return ret;
  8986. };
  8987. Yallist.prototype.reverse = function () {
  8988. var head = this.head;
  8989. var tail = this.tail;
  8990. for (var walker = head; walker !== null; walker = walker.prev) {
  8991. var p = walker.prev;
  8992. walker.prev = walker.next;
  8993. walker.next = p;
  8994. }
  8995. this.head = tail;
  8996. this.tail = head;
  8997. return this;
  8998. };
  8999. function insert(self, node, value) {
  9000. var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);
  9001. if (inserted.next === null) {
  9002. self.tail = inserted;
  9003. }
  9004. if (inserted.prev === null) {
  9005. self.head = inserted;
  9006. }
  9007. self.length++;
  9008. return inserted;
  9009. }
  9010. function push(self, item) {
  9011. self.tail = new Node(item, self.tail, null, self);
  9012. if (!self.head) {
  9013. self.head = self.tail;
  9014. }
  9015. self.length++;
  9016. }
  9017. function unshift(self, item) {
  9018. self.head = new Node(item, null, self.head, self);
  9019. if (!self.tail) {
  9020. self.tail = self.head;
  9021. }
  9022. self.length++;
  9023. }
  9024. function Node(value, prev, next, list) {
  9025. if (!(this instanceof Node)) {
  9026. return new Node(value, prev, next, list);
  9027. }
  9028. this.list = list;
  9029. this.value = value;
  9030. if (prev) {
  9031. prev.next = this;
  9032. this.prev = prev;
  9033. } else {
  9034. this.prev = null;
  9035. }
  9036. if (next) {
  9037. next.prev = this;
  9038. this.next = next;
  9039. } else {
  9040. this.next = null;
  9041. }
  9042. }
  9043. try {
  9044. // add if support for Symbol.iterator is present
  9045. __webpack_require__(24)(Yallist);
  9046. } catch (er) {}
  9047. /***/ }),
  9048. /* 24 */
  9049. /***/ (function(module, exports, __webpack_require__) {
  9050. "use strict";
  9051. module.exports = function (Yallist) {
  9052. Yallist.prototype[Symbol.iterator] = /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
  9053. var walker;
  9054. return regeneratorRuntime.wrap(function _callee$(_context) {
  9055. while (1) {
  9056. switch (_context.prev = _context.next) {
  9057. case 0:
  9058. walker = this.head;
  9059. case 1:
  9060. if (!walker) {
  9061. _context.next = 7;
  9062. break;
  9063. }
  9064. _context.next = 4;
  9065. return walker.value;
  9066. case 4:
  9067. walker = walker.next;
  9068. _context.next = 1;
  9069. break;
  9070. case 7:
  9071. case "end":
  9072. return _context.stop();
  9073. }
  9074. }
  9075. }, _callee, this);
  9076. });
  9077. };
  9078. /***/ }),
  9079. /* 25 */
  9080. /***/ (function(module, exports, __webpack_require__) {
  9081. "use strict";
  9082. /**
  9083. * @license React
  9084. * react-is.production.min.js
  9085. *
  9086. * Copyright (c) Meta Platforms, Inc. and affiliates.
  9087. *
  9088. * This source code is licensed under the MIT license found in the
  9089. * LICENSE file in the root directory of this source tree.
  9090. */
  9091. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  9092. var b = Symbol.for("react.element"),
  9093. c = Symbol.for("react.portal"),
  9094. d = Symbol.for("react.fragment"),
  9095. e = Symbol.for("react.strict_mode"),
  9096. f = Symbol.for("react.profiler"),
  9097. g = Symbol.for("react.provider"),
  9098. h = Symbol.for("react.context"),
  9099. k = Symbol.for("react.server_context"),
  9100. l = Symbol.for("react.forward_ref"),
  9101. m = Symbol.for("react.suspense"),
  9102. n = Symbol.for("react.suspense_list"),
  9103. p = Symbol.for("react.memo"),
  9104. q = Symbol.for("react.lazy"),
  9105. t = Symbol.for("react.offscreen"),
  9106. u = Symbol.for("react.cache"),
  9107. v = Symbol.for("react.client.reference");
  9108. function w(a) {
  9109. if ("object" === _typeof(a) && null !== a) {
  9110. var r = a.$$typeof;
  9111. switch (r) {
  9112. case b:
  9113. switch (a = a.type, a) {
  9114. case d:
  9115. case f:
  9116. case e:
  9117. case m:
  9118. case n:
  9119. return a;
  9120. default:
  9121. switch (a = a && a.$$typeof, a) {
  9122. case k:
  9123. case h:
  9124. case l:
  9125. case q:
  9126. case p:
  9127. case g:
  9128. return a;
  9129. default:
  9130. return r;
  9131. }
  9132. }
  9133. case c:
  9134. return r;
  9135. }
  9136. }
  9137. }
  9138. exports.ContextConsumer = h;
  9139. exports.ContextProvider = g;
  9140. exports.Element = b;
  9141. exports.ForwardRef = l;
  9142. exports.Fragment = d;
  9143. exports.Lazy = q;
  9144. exports.Memo = p;
  9145. exports.Portal = c;
  9146. exports.Profiler = f;
  9147. exports.StrictMode = e;
  9148. exports.Suspense = m;
  9149. exports.SuspenseList = n;
  9150. exports.isAsyncMode = function () {
  9151. return !1;
  9152. };
  9153. exports.isConcurrentMode = function () {
  9154. return !1;
  9155. };
  9156. exports.isContextConsumer = function (a) {
  9157. return w(a) === h;
  9158. };
  9159. exports.isContextProvider = function (a) {
  9160. return w(a) === g;
  9161. };
  9162. exports.isElement = function (a) {
  9163. return "object" === _typeof(a) && null !== a && a.$$typeof === b;
  9164. };
  9165. exports.isForwardRef = function (a) {
  9166. return w(a) === l;
  9167. };
  9168. exports.isFragment = function (a) {
  9169. return w(a) === d;
  9170. };
  9171. exports.isLazy = function (a) {
  9172. return w(a) === q;
  9173. };
  9174. exports.isMemo = function (a) {
  9175. return w(a) === p;
  9176. };
  9177. exports.isPortal = function (a) {
  9178. return w(a) === c;
  9179. };
  9180. exports.isProfiler = function (a) {
  9181. return w(a) === f;
  9182. };
  9183. exports.isStrictMode = function (a) {
  9184. return w(a) === e;
  9185. };
  9186. exports.isSuspense = function (a) {
  9187. return w(a) === m;
  9188. };
  9189. exports.isSuspenseList = function (a) {
  9190. return w(a) === n;
  9191. };
  9192. exports.isValidElementType = function (a) {
  9193. return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || a === u || "object" === _typeof(a) && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === v || void 0 !== a.getModuleId) ? !0 : !1;
  9194. };
  9195. exports.typeOf = w;
  9196. /***/ }),
  9197. /* 26 */
  9198. /***/ (function(module, exports, __webpack_require__) {
  9199. "use strict";
  9200. /**
  9201. * @license React
  9202. * react-debug-tools.production.min.js
  9203. *
  9204. * Copyright (c) Meta Platforms, Inc. and affiliates.
  9205. *
  9206. * This source code is licensed under the MIT license found in the
  9207. * LICENSE file in the root directory of this source tree.
  9208. */
  9209. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  9210. var h = __webpack_require__(27),
  9211. p = __webpack_require__(29),
  9212. q = Object.assign,
  9213. w = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
  9214. x = [],
  9215. y = null;
  9216. function z() {
  9217. if (null === y) {
  9218. var a = new Map();
  9219. try {
  9220. A.useContext({
  9221. _currentValue: null
  9222. }), A.useState(null), A.useReducer(function (a) {
  9223. return a;
  9224. }, null), A.useRef(null), "function" === typeof A.useCacheRefresh && A.useCacheRefresh(), A.useLayoutEffect(function () {}), A.useInsertionEffect(function () {}), A.useEffect(function () {}), A.useImperativeHandle(void 0, function () {
  9225. return null;
  9226. }), A.useDebugValue(null), A.useCallback(function () {}), A.useMemo(function () {
  9227. return null;
  9228. });
  9229. } finally {
  9230. var b = x;
  9231. x = [];
  9232. }
  9233. for (var e = 0; e < b.length; e++) {
  9234. var g = b[e];
  9235. a.set(g.primitive, h.parse(g.stackError));
  9236. }
  9237. y = a;
  9238. }
  9239. return y;
  9240. }
  9241. var B = null;
  9242. function C() {
  9243. var a = B;
  9244. null !== a && (B = a.next);
  9245. return a;
  9246. }
  9247. var A = {
  9248. readContext: function readContext(a) {
  9249. return a._currentValue;
  9250. },
  9251. useCacheRefresh: function useCacheRefresh() {
  9252. var a = C();
  9253. x.push({
  9254. primitive: "CacheRefresh",
  9255. stackError: Error(),
  9256. value: null !== a ? a.memoizedState : function () {}
  9257. });
  9258. return function () {};
  9259. },
  9260. useCallback: function useCallback(a) {
  9261. var b = C();
  9262. x.push({
  9263. primitive: "Callback",
  9264. stackError: Error(),
  9265. value: null !== b ? b.memoizedState[0] : a
  9266. });
  9267. return a;
  9268. },
  9269. useContext: function useContext(a) {
  9270. x.push({
  9271. primitive: "Context",
  9272. stackError: Error(),
  9273. value: a._currentValue
  9274. });
  9275. return a._currentValue;
  9276. },
  9277. useEffect: function useEffect(a) {
  9278. C();
  9279. x.push({
  9280. primitive: "Effect",
  9281. stackError: Error(),
  9282. value: a
  9283. });
  9284. },
  9285. useImperativeHandle: function useImperativeHandle(a) {
  9286. C();
  9287. var b = void 0;
  9288. null !== a && "object" === _typeof(a) && (b = a.current);
  9289. x.push({
  9290. primitive: "ImperativeHandle",
  9291. stackError: Error(),
  9292. value: b
  9293. });
  9294. },
  9295. useDebugValue: function useDebugValue(a, b) {
  9296. x.push({
  9297. primitive: "DebugValue",
  9298. stackError: Error(),
  9299. value: "function" === typeof b ? b(a) : a
  9300. });
  9301. },
  9302. useLayoutEffect: function useLayoutEffect(a) {
  9303. C();
  9304. x.push({
  9305. primitive: "LayoutEffect",
  9306. stackError: Error(),
  9307. value: a
  9308. });
  9309. },
  9310. useInsertionEffect: function useInsertionEffect(a) {
  9311. C();
  9312. x.push({
  9313. primitive: "InsertionEffect",
  9314. stackError: Error(),
  9315. value: a
  9316. });
  9317. },
  9318. useMemo: function useMemo(a) {
  9319. var b = C();
  9320. a = null !== b ? b.memoizedState[0] : a();
  9321. x.push({
  9322. primitive: "Memo",
  9323. stackError: Error(),
  9324. value: a
  9325. });
  9326. return a;
  9327. },
  9328. useReducer: function useReducer(a, b, e) {
  9329. a = C();
  9330. b = null !== a ? a.memoizedState : void 0 !== e ? e(b) : b;
  9331. x.push({
  9332. primitive: "Reducer",
  9333. stackError: Error(),
  9334. value: b
  9335. });
  9336. return [b, function () {}];
  9337. },
  9338. useRef: function useRef(a) {
  9339. var b = C();
  9340. a = null !== b ? b.memoizedState : {
  9341. current: a
  9342. };
  9343. x.push({
  9344. primitive: "Ref",
  9345. stackError: Error(),
  9346. value: a.current
  9347. });
  9348. return a;
  9349. },
  9350. useState: function useState(a) {
  9351. var b = C();
  9352. a = null !== b ? b.memoizedState : "function" === typeof a ? a() : a;
  9353. x.push({
  9354. primitive: "State",
  9355. stackError: Error(),
  9356. value: a
  9357. });
  9358. return [a, function () {}];
  9359. },
  9360. useTransition: function useTransition() {
  9361. C();
  9362. C();
  9363. x.push({
  9364. primitive: "Transition",
  9365. stackError: Error(),
  9366. value: void 0
  9367. });
  9368. return [!1, function () {}];
  9369. },
  9370. useMutableSource: function useMutableSource(a, b) {
  9371. C();
  9372. C();
  9373. C();
  9374. C();
  9375. a = b(a._source);
  9376. x.push({
  9377. primitive: "MutableSource",
  9378. stackError: Error(),
  9379. value: a
  9380. });
  9381. return a;
  9382. },
  9383. useSyncExternalStore: function useSyncExternalStore(a, b) {
  9384. C();
  9385. C();
  9386. a = b();
  9387. x.push({
  9388. primitive: "SyncExternalStore",
  9389. stackError: Error(),
  9390. value: a
  9391. });
  9392. return a;
  9393. },
  9394. useDeferredValue: function useDeferredValue(a) {
  9395. var b = C();
  9396. x.push({
  9397. primitive: "DeferredValue",
  9398. stackError: Error(),
  9399. value: null !== b ? b.memoizedState : a
  9400. });
  9401. return a;
  9402. },
  9403. useId: function useId() {
  9404. var a = C();
  9405. a = null !== a ? a.memoizedState : "";
  9406. x.push({
  9407. primitive: "Id",
  9408. stackError: Error(),
  9409. value: a
  9410. });
  9411. return a;
  9412. }
  9413. },
  9414. D = {
  9415. get: function get(a, b) {
  9416. if (a.hasOwnProperty(b)) return a[b];
  9417. a = Error("Missing method in Dispatcher: " + b);
  9418. a.name = "ReactDebugToolsUnsupportedHookError";
  9419. throw a;
  9420. }
  9421. },
  9422. E = "undefined" === typeof Proxy ? A : new Proxy(A, D),
  9423. F = 0;
  9424. function G(a, b, e) {
  9425. var g = b[e].source,
  9426. c = 0;
  9427. a: for (; c < a.length; c++) {
  9428. if (a[c].source === g) {
  9429. for (var l = e + 1, r = c + 1; l < b.length && r < a.length; l++, r++) {
  9430. if (a[r].source !== b[l].source) continue a;
  9431. }
  9432. return c;
  9433. }
  9434. }
  9435. return -1;
  9436. }
  9437. function H(a, b) {
  9438. if (!a) return !1;
  9439. b = "use" + b;
  9440. return a.length < b.length ? !1 : a.lastIndexOf(b) === a.length - b.length;
  9441. }
  9442. function I(a, b, e) {
  9443. for (var g = [], c = null, l = g, r = 0, t = [], v = 0; v < b.length; v++) {
  9444. var u = b[v];
  9445. var d = a;
  9446. var k = h.parse(u.stackError);
  9447. b: {
  9448. var m = k,
  9449. n = G(m, d, F);
  9450. if (-1 !== n) d = n;else {
  9451. for (var f = 0; f < d.length && 5 > f; f++) {
  9452. if (n = G(m, d, f), -1 !== n) {
  9453. F = f;
  9454. d = n;
  9455. break b;
  9456. }
  9457. }
  9458. d = -1;
  9459. }
  9460. }
  9461. b: {
  9462. m = k;
  9463. n = z().get(u.primitive);
  9464. if (void 0 !== n) for (f = 0; f < n.length && f < m.length; f++) {
  9465. if (n[f].source !== m[f].source) {
  9466. f < m.length - 1 && H(m[f].functionName, u.primitive) && f++;
  9467. f < m.length - 1 && H(m[f].functionName, u.primitive) && f++;
  9468. m = f;
  9469. break b;
  9470. }
  9471. }
  9472. m = -1;
  9473. }
  9474. k = -1 === d || -1 === m || 2 > d - m ? null : k.slice(m, d - 1);
  9475. if (null !== k) {
  9476. d = 0;
  9477. if (null !== c) {
  9478. for (; d < k.length && d < c.length && k[k.length - d - 1].source === c[c.length - d - 1].source;) {
  9479. d++;
  9480. }
  9481. for (c = c.length - 1; c > d; c--) {
  9482. l = t.pop();
  9483. }
  9484. }
  9485. for (c = k.length - d - 1; 1 <= c; c--) {
  9486. d = [], m = k[c], (n = k[c - 1].functionName) ? (f = n.lastIndexOf("."), -1 === f && (f = 0), "use" === n.substr(f, 3) && (f += 3), n = n.substr(f)) : n = "", n = {
  9487. id: null,
  9488. isStateEditable: !1,
  9489. name: n,
  9490. value: void 0,
  9491. subHooks: d
  9492. }, e && (n.hookSource = {
  9493. lineNumber: m.lineNumber,
  9494. columnNumber: m.columnNumber,
  9495. functionName: m.functionName,
  9496. fileName: m.fileName
  9497. }), l.push(n), t.push(l), l = d;
  9498. }
  9499. c = k;
  9500. }
  9501. d = u.primitive;
  9502. u = {
  9503. id: "Context" === d || "DebugValue" === d ? null : r++,
  9504. isStateEditable: "Reducer" === d || "State" === d,
  9505. name: d,
  9506. value: u.value,
  9507. subHooks: []
  9508. };
  9509. e && (d = {
  9510. lineNumber: null,
  9511. functionName: null,
  9512. fileName: null,
  9513. columnNumber: null
  9514. }, k && 1 <= k.length && (k = k[0], d.lineNumber = k.lineNumber, d.functionName = k.functionName, d.fileName = k.fileName, d.columnNumber = k.columnNumber), u.hookSource = d);
  9515. l.push(u);
  9516. }
  9517. J(g, null);
  9518. return g;
  9519. }
  9520. function J(a, b) {
  9521. for (var e = [], g = 0; g < a.length; g++) {
  9522. var c = a[g];
  9523. "DebugValue" === c.name && 0 === c.subHooks.length ? (a.splice(g, 1), g--, e.push(c)) : J(c.subHooks, c);
  9524. }
  9525. null !== b && (1 === e.length ? b.value = e[0].value : 1 < e.length && (b.value = e.map(function (a) {
  9526. return a.value;
  9527. })));
  9528. }
  9529. function K(a) {
  9530. if (a instanceof Error && "ReactDebugToolsUnsupportedHookError" === a.name) throw a;
  9531. var b = Error("Error rendering inspected component", {
  9532. cause: a
  9533. });
  9534. b.name = "ReactDebugToolsRenderError";
  9535. b.cause = a;
  9536. throw b;
  9537. }
  9538. function L(a, b, e) {
  9539. var g = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : !1;
  9540. null == e && (e = w.ReactCurrentDispatcher);
  9541. var c = e.current;
  9542. e.current = E;
  9543. try {
  9544. var l = Error();
  9545. a(b);
  9546. } catch (t) {
  9547. K(t);
  9548. } finally {
  9549. var r = x;
  9550. x = [];
  9551. e.current = c;
  9552. }
  9553. c = h.parse(l);
  9554. return I(c, r, g);
  9555. }
  9556. function M(a) {
  9557. a.forEach(function (a, e) {
  9558. return e._currentValue = a;
  9559. });
  9560. }
  9561. exports.inspectHooks = L;
  9562. exports.inspectHooksOfFiber = function (a, b) {
  9563. var e = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : !1;
  9564. null == b && (b = w.ReactCurrentDispatcher);
  9565. if (0 !== a.tag && 15 !== a.tag && 11 !== a.tag) throw Error("Unknown Fiber. Needs to be a function component to inspect hooks.");
  9566. z();
  9567. var g = a.type,
  9568. c = a.memoizedProps;
  9569. if (g !== a.elementType && g && g.defaultProps) {
  9570. c = q({}, c);
  9571. var l = g.defaultProps;
  9572. for (r in l) {
  9573. void 0 === c[r] && (c[r] = l[r]);
  9574. }
  9575. }
  9576. B = a.memoizedState;
  9577. var r = new Map();
  9578. try {
  9579. for (l = a; l;) {
  9580. if (10 === l.tag) {
  9581. var t = l.type._context;
  9582. r.has(t) || (r.set(t, t._currentValue), t._currentValue = l.memoizedProps.value);
  9583. }
  9584. l = l.return;
  9585. }
  9586. if (11 === a.tag) {
  9587. var v = g.render;
  9588. g = c;
  9589. var u = a.ref;
  9590. t = b;
  9591. var d = t.current;
  9592. t.current = E;
  9593. try {
  9594. var k = Error();
  9595. v(g, u);
  9596. } catch (f) {
  9597. K(f);
  9598. } finally {
  9599. var m = x;
  9600. x = [];
  9601. t.current = d;
  9602. }
  9603. var n = h.parse(k);
  9604. return I(n, m, e);
  9605. }
  9606. return L(g, c, b, e);
  9607. } finally {
  9608. B = null, M(r);
  9609. }
  9610. };
  9611. /***/ }),
  9612. /* 27 */
  9613. /***/ (function(module, exports, __webpack_require__) {
  9614. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  9615. (function (root, factory) {
  9616. 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.
  9617. /* istanbul ignore next */
  9618. if (true) {
  9619. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(28)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  9620. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  9621. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  9622. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  9623. } else {}
  9624. })(this, function ErrorStackParser(StackFrame) {
  9625. 'use strict';
  9626. var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
  9627. var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
  9628. var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
  9629. return {
  9630. /**
  9631. * Given an Error object, extract the most information from it.
  9632. *
  9633. * @param {Error} error object
  9634. * @return {Array} of StackFrames
  9635. */
  9636. parse: function ErrorStackParser$$parse(error) {
  9637. if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {
  9638. return this.parseOpera(error);
  9639. } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {
  9640. return this.parseV8OrIE(error);
  9641. } else if (error.stack) {
  9642. return this.parseFFOrSafari(error);
  9643. } else {
  9644. throw new Error('Cannot parse given Error object');
  9645. }
  9646. },
  9647. // Separate line and column numbers from a string of the form: (URI:Line:Column)
  9648. extractLocation: function ErrorStackParser$$extractLocation(urlLike) {
  9649. // Fail-fast but return locations like "(native)"
  9650. if (urlLike.indexOf(':') === -1) {
  9651. return [urlLike];
  9652. }
  9653. var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
  9654. var parts = regExp.exec(urlLike.replace(/[()]/g, ''));
  9655. return [parts[1], parts[2] || undefined, parts[3] || undefined];
  9656. },
  9657. parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {
  9658. var filtered = error.stack.split('\n').filter(function (line) {
  9659. return !!line.match(CHROME_IE_STACK_REGEXP);
  9660. }, this);
  9661. return filtered.map(function (line) {
  9662. if (line.indexOf('(eval ') > -1) {
  9663. // Throw away eval information until we implement stacktrace.js/stackframe#8
  9664. line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
  9665. }
  9666. var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '('); // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in
  9667. // case it has spaces in it, as the string is split on \s+ later on
  9668. var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/); // remove the parenthesized location from the line, if it was matched
  9669. sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;
  9670. var tokens = sanitizedLine.split(/\s+/).slice(1); // if a location was matched, pass it to extractLocation() otherwise pop the last token
  9671. var locationParts = this.extractLocation(location ? location[1] : tokens.pop());
  9672. var functionName = tokens.join(' ') || undefined;
  9673. var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];
  9674. return new StackFrame({
  9675. functionName: functionName,
  9676. fileName: fileName,
  9677. lineNumber: locationParts[1],
  9678. columnNumber: locationParts[2],
  9679. source: line
  9680. });
  9681. }, this);
  9682. },
  9683. parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {
  9684. var filtered = error.stack.split('\n').filter(function (line) {
  9685. return !line.match(SAFARI_NATIVE_CODE_REGEXP);
  9686. }, this);
  9687. return filtered.map(function (line) {
  9688. // Throw away eval information until we implement stacktrace.js/stackframe#8
  9689. if (line.indexOf(' > eval') > -1) {
  9690. line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1');
  9691. }
  9692. if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {
  9693. // Safari eval frames only have function names and nothing else
  9694. return new StackFrame({
  9695. functionName: line
  9696. });
  9697. } else {
  9698. var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
  9699. var matches = line.match(functionNameRegex);
  9700. var functionName = matches && matches[1] ? matches[1] : undefined;
  9701. var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));
  9702. return new StackFrame({
  9703. functionName: functionName,
  9704. fileName: locationParts[0],
  9705. lineNumber: locationParts[1],
  9706. columnNumber: locationParts[2],
  9707. source: line
  9708. });
  9709. }
  9710. }, this);
  9711. },
  9712. parseOpera: function ErrorStackParser$$parseOpera(e) {
  9713. if (!e.stacktrace || e.message.indexOf('\n') > -1 && e.message.split('\n').length > e.stacktrace.split('\n').length) {
  9714. return this.parseOpera9(e);
  9715. } else if (!e.stack) {
  9716. return this.parseOpera10(e);
  9717. } else {
  9718. return this.parseOpera11(e);
  9719. }
  9720. },
  9721. parseOpera9: function ErrorStackParser$$parseOpera9(e) {
  9722. var lineRE = /Line (\d+).*script (?:in )?(\S+)/i;
  9723. var lines = e.message.split('\n');
  9724. var result = [];
  9725. for (var i = 2, len = lines.length; i < len; i += 2) {
  9726. var match = lineRE.exec(lines[i]);
  9727. if (match) {
  9728. result.push(new StackFrame({
  9729. fileName: match[2],
  9730. lineNumber: match[1],
  9731. source: lines[i]
  9732. }));
  9733. }
  9734. }
  9735. return result;
  9736. },
  9737. parseOpera10: function ErrorStackParser$$parseOpera10(e) {
  9738. var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i;
  9739. var lines = e.stacktrace.split('\n');
  9740. var result = [];
  9741. for (var i = 0, len = lines.length; i < len; i += 2) {
  9742. var match = lineRE.exec(lines[i]);
  9743. if (match) {
  9744. result.push(new StackFrame({
  9745. functionName: match[3] || undefined,
  9746. fileName: match[2],
  9747. lineNumber: match[1],
  9748. source: lines[i]
  9749. }));
  9750. }
  9751. }
  9752. return result;
  9753. },
  9754. // Opera 10.65+ Error.stack very similar to FF/Safari
  9755. parseOpera11: function ErrorStackParser$$parseOpera11(error) {
  9756. var filtered = error.stack.split('\n').filter(function (line) {
  9757. return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);
  9758. }, this);
  9759. return filtered.map(function (line) {
  9760. var tokens = line.split('@');
  9761. var locationParts = this.extractLocation(tokens.pop());
  9762. var functionCall = tokens.shift() || '';
  9763. var functionName = functionCall.replace(/<anonymous function(: (\w+))?>/, '$2').replace(/\([^)]*\)/g, '') || undefined;
  9764. var argsRaw;
  9765. if (functionCall.match(/\(([^)]*)\)/)) {
  9766. argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1');
  9767. }
  9768. var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(',');
  9769. return new StackFrame({
  9770. functionName: functionName,
  9771. args: args,
  9772. fileName: locationParts[0],
  9773. lineNumber: locationParts[1],
  9774. columnNumber: locationParts[2],
  9775. source: line
  9776. });
  9777. }, this);
  9778. }
  9779. };
  9780. });
  9781. /***/ }),
  9782. /* 28 */
  9783. /***/ (function(module, exports, __webpack_require__) {
  9784. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  9785. (function (root, factory) {
  9786. 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.
  9787. /* istanbul ignore next */
  9788. if (true) {
  9789. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  9790. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  9791. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  9792. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  9793. } else {}
  9794. })(this, function () {
  9795. 'use strict';
  9796. function _isNumber(n) {
  9797. return !isNaN(parseFloat(n)) && isFinite(n);
  9798. }
  9799. function _capitalize(str) {
  9800. return str.charAt(0).toUpperCase() + str.substring(1);
  9801. }
  9802. function _getter(p) {
  9803. return function () {
  9804. return this[p];
  9805. };
  9806. }
  9807. var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel'];
  9808. var numericProps = ['columnNumber', 'lineNumber'];
  9809. var stringProps = ['fileName', 'functionName', 'source'];
  9810. var arrayProps = ['args'];
  9811. var props = booleanProps.concat(numericProps, stringProps, arrayProps);
  9812. function StackFrame(obj) {
  9813. if (!obj) return;
  9814. for (var i = 0; i < props.length; i++) {
  9815. if (obj[props[i]] !== undefined) {
  9816. this['set' + _capitalize(props[i])](obj[props[i]]);
  9817. }
  9818. }
  9819. }
  9820. StackFrame.prototype = {
  9821. getArgs: function getArgs() {
  9822. return this.args;
  9823. },
  9824. setArgs: function setArgs(v) {
  9825. if (Object.prototype.toString.call(v) !== '[object Array]') {
  9826. throw new TypeError('Args must be an Array');
  9827. }
  9828. this.args = v;
  9829. },
  9830. getEvalOrigin: function getEvalOrigin() {
  9831. return this.evalOrigin;
  9832. },
  9833. setEvalOrigin: function setEvalOrigin(v) {
  9834. if (v instanceof StackFrame) {
  9835. this.evalOrigin = v;
  9836. } else if (v instanceof Object) {
  9837. this.evalOrigin = new StackFrame(v);
  9838. } else {
  9839. throw new TypeError('Eval Origin must be an Object or StackFrame');
  9840. }
  9841. },
  9842. toString: function toString() {
  9843. var fileName = this.getFileName() || '';
  9844. var lineNumber = this.getLineNumber() || '';
  9845. var columnNumber = this.getColumnNumber() || '';
  9846. var functionName = this.getFunctionName() || '';
  9847. if (this.getIsEval()) {
  9848. if (fileName) {
  9849. return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';
  9850. }
  9851. return '[eval]:' + lineNumber + ':' + columnNumber;
  9852. }
  9853. if (functionName) {
  9854. return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';
  9855. }
  9856. return fileName + ':' + lineNumber + ':' + columnNumber;
  9857. }
  9858. };
  9859. StackFrame.fromString = function StackFrame$$fromString(str) {
  9860. var argsStartIndex = str.indexOf('(');
  9861. var argsEndIndex = str.lastIndexOf(')');
  9862. var functionName = str.substring(0, argsStartIndex);
  9863. var args = str.substring(argsStartIndex + 1, argsEndIndex).split(',');
  9864. var locationString = str.substring(argsEndIndex + 1);
  9865. if (locationString.indexOf('@') === 0) {
  9866. var parts = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(locationString, '');
  9867. var fileName = parts[1];
  9868. var lineNumber = parts[2];
  9869. var columnNumber = parts[3];
  9870. }
  9871. return new StackFrame({
  9872. functionName: functionName,
  9873. args: args || undefined,
  9874. fileName: fileName,
  9875. lineNumber: lineNumber || undefined,
  9876. columnNumber: columnNumber || undefined
  9877. });
  9878. };
  9879. for (var i = 0; i < booleanProps.length; i++) {
  9880. StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);
  9881. StackFrame.prototype['set' + _capitalize(booleanProps[i])] = function (p) {
  9882. return function (v) {
  9883. this[p] = Boolean(v);
  9884. };
  9885. }(booleanProps[i]);
  9886. }
  9887. for (var j = 0; j < numericProps.length; j++) {
  9888. StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]);
  9889. StackFrame.prototype['set' + _capitalize(numericProps[j])] = function (p) {
  9890. return function (v) {
  9891. if (!_isNumber(v)) {
  9892. throw new TypeError(p + ' must be a Number');
  9893. }
  9894. this[p] = Number(v);
  9895. };
  9896. }(numericProps[j]);
  9897. }
  9898. for (var k = 0; k < stringProps.length; k++) {
  9899. StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]);
  9900. StackFrame.prototype['set' + _capitalize(stringProps[k])] = function (p) {
  9901. return function (v) {
  9902. this[p] = String(v);
  9903. };
  9904. }(stringProps[k]);
  9905. }
  9906. return StackFrame;
  9907. });
  9908. /***/ }),
  9909. /* 29 */
  9910. /***/ (function(module, exports, __webpack_require__) {
  9911. "use strict";
  9912. if (true) {
  9913. module.exports = __webpack_require__(30);
  9914. } else {}
  9915. /***/ }),
  9916. /* 30 */
  9917. /***/ (function(module, exports, __webpack_require__) {
  9918. "use strict";
  9919. /**
  9920. * @license React
  9921. * react.production.min.js
  9922. *
  9923. * Copyright (c) Meta Platforms, Inc. and affiliates.
  9924. *
  9925. * This source code is licensed under the MIT license found in the
  9926. * LICENSE file in the root directory of this source tree.
  9927. */
  9928. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  9929. var l = Symbol.for("react.element"),
  9930. n = Symbol.for("react.portal"),
  9931. p = Symbol.for("react.fragment"),
  9932. q = Symbol.for("react.strict_mode"),
  9933. r = Symbol.for("react.profiler"),
  9934. t = Symbol.for("react.provider"),
  9935. u = Symbol.for("react.context"),
  9936. v = Symbol.for("react.server_context"),
  9937. w = Symbol.for("react.forward_ref"),
  9938. x = Symbol.for("react.suspense"),
  9939. y = Symbol.for("react.suspense_list"),
  9940. z = Symbol.for("react.memo"),
  9941. A = Symbol.for("react.lazy"),
  9942. aa = Symbol.for("react.debug_trace_mode"),
  9943. ba = Symbol.for("react.offscreen"),
  9944. ca = Symbol.for("react.cache"),
  9945. B = Symbol.for("react.default_value"),
  9946. C = Symbol.iterator;
  9947. function da(a) {
  9948. if (null === a || "object" !== _typeof(a)) return null;
  9949. a = C && a[C] || a["@@iterator"];
  9950. return "function" === typeof a ? a : null;
  9951. }
  9952. var D = {
  9953. isMounted: function isMounted() {
  9954. return !1;
  9955. },
  9956. enqueueForceUpdate: function enqueueForceUpdate() {},
  9957. enqueueReplaceState: function enqueueReplaceState() {},
  9958. enqueueSetState: function enqueueSetState() {}
  9959. },
  9960. E = Object.assign,
  9961. F = {};
  9962. function G(a, b, d) {
  9963. this.props = a;
  9964. this.context = b;
  9965. this.refs = F;
  9966. this.updater = d || D;
  9967. }
  9968. G.prototype.isReactComponent = {};
  9969. G.prototype.setState = function (a, b) {
  9970. if ("object" !== _typeof(a) && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
  9971. this.updater.enqueueSetState(this, a, b, "setState");
  9972. };
  9973. G.prototype.forceUpdate = function (a) {
  9974. this.updater.enqueueForceUpdate(this, a, "forceUpdate");
  9975. };
  9976. function H() {}
  9977. H.prototype = G.prototype;
  9978. function I(a, b, d) {
  9979. this.props = a;
  9980. this.context = b;
  9981. this.refs = F;
  9982. this.updater = d || D;
  9983. }
  9984. var J = I.prototype = new H();
  9985. J.constructor = I;
  9986. E(J, G.prototype);
  9987. J.isPureReactComponent = !0;
  9988. var K = Array.isArray,
  9989. L = Object.prototype.hasOwnProperty,
  9990. M = {
  9991. current: null
  9992. },
  9993. N = {
  9994. key: !0,
  9995. ref: !0,
  9996. __self: !0,
  9997. __source: !0
  9998. };
  9999. function O(a, b, d) {
  10000. var c,
  10001. e = {},
  10002. f = null,
  10003. g = null;
  10004. if (null != b) for (c in void 0 !== b.ref && (g = b.ref), void 0 !== b.key && (f = "" + b.key), b) {
  10005. L.call(b, c) && !N.hasOwnProperty(c) && (e[c] = b[c]);
  10006. }
  10007. var h = arguments.length - 2;
  10008. if (1 === h) e.children = d;else if (1 < h) {
  10009. for (var k = Array(h), m = 0; m < h; m++) {
  10010. k[m] = arguments[m + 2];
  10011. }
  10012. e.children = k;
  10013. }
  10014. if (a && a.defaultProps) for (c in h = a.defaultProps, h) {
  10015. void 0 === e[c] && (e[c] = h[c]);
  10016. }
  10017. return {
  10018. $$typeof: l,
  10019. type: a,
  10020. key: f,
  10021. ref: g,
  10022. props: e,
  10023. _owner: M.current
  10024. };
  10025. }
  10026. function ea(a, b) {
  10027. return {
  10028. $$typeof: l,
  10029. type: a.type,
  10030. key: b,
  10031. ref: a.ref,
  10032. props: a.props,
  10033. _owner: a._owner
  10034. };
  10035. }
  10036. function P(a) {
  10037. return "object" === _typeof(a) && null !== a && a.$$typeof === l;
  10038. }
  10039. function escape(a) {
  10040. var b = {
  10041. "=": "=0",
  10042. ":": "=2"
  10043. };
  10044. return "$" + a.replace(/[=:]/g, function (a) {
  10045. return b[a];
  10046. });
  10047. }
  10048. var Q = /\/+/g;
  10049. function R(a, b) {
  10050. return "object" === _typeof(a) && null !== a && null != a.key ? escape("" + a.key) : b.toString(36);
  10051. }
  10052. function S(a, b, d, c, e) {
  10053. var f = _typeof(a);
  10054. if ("undefined" === f || "boolean" === f) a = null;
  10055. var g = !1;
  10056. if (null === a) g = !0;else switch (f) {
  10057. case "string":
  10058. case "number":
  10059. g = !0;
  10060. break;
  10061. case "object":
  10062. switch (a.$$typeof) {
  10063. case l:
  10064. case n:
  10065. g = !0;
  10066. }
  10067. }
  10068. if (g) return g = a, e = e(g), a = "" === c ? "." + R(g, 0) : c, K(e) ? (d = "", null != a && (d = a.replace(Q, "$&/") + "/"), S(e, b, d, "", function (a) {
  10069. return a;
  10070. })) : null != e && (P(e) && (e = ea(e, d + (!e.key || g && g.key === e.key ? "" : ("" + e.key).replace(Q, "$&/") + "/") + a)), b.push(e)), 1;
  10071. g = 0;
  10072. c = "" === c ? "." : c + ":";
  10073. if (K(a)) for (var h = 0; h < a.length; h++) {
  10074. f = a[h];
  10075. var k = c + R(f, h);
  10076. g += S(f, b, d, k, e);
  10077. } else if (k = da(a), "function" === typeof k) for (a = k.call(a), h = 0; !(f = a.next()).done;) {
  10078. f = f.value, k = c + R(f, h++), g += S(f, b, d, k, e);
  10079. } else if ("object" === f) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead.");
  10080. return g;
  10081. }
  10082. function T(a, b, d) {
  10083. if (null == a) return a;
  10084. var c = [],
  10085. e = 0;
  10086. S(a, c, "", "", function (a) {
  10087. return b.call(d, a, e++);
  10088. });
  10089. return c;
  10090. }
  10091. function fa(a) {
  10092. if (-1 === a._status) {
  10093. var b = a._result;
  10094. b = b();
  10095. b.then(function (b) {
  10096. if (0 === a._status || -1 === a._status) a._status = 1, a._result = b;
  10097. }, function (b) {
  10098. if (0 === a._status || -1 === a._status) a._status = 2, a._result = b;
  10099. });
  10100. -1 === a._status && (a._status = 0, a._result = b);
  10101. }
  10102. if (1 === a._status) return a._result.default;
  10103. throw a._result;
  10104. }
  10105. var U = {
  10106. current: null
  10107. };
  10108. function ha() {
  10109. return new WeakMap();
  10110. }
  10111. function V() {
  10112. return {
  10113. s: 0,
  10114. v: void 0,
  10115. o: null,
  10116. p: null
  10117. };
  10118. }
  10119. var W = {
  10120. current: null
  10121. },
  10122. X = {
  10123. transition: null
  10124. },
  10125. Y = {
  10126. ReactCurrentDispatcher: W,
  10127. ReactCurrentCache: U,
  10128. ReactCurrentBatchConfig: X,
  10129. ReactCurrentOwner: M,
  10130. ContextRegistry: {}
  10131. },
  10132. Z = Y.ContextRegistry;
  10133. exports.Children = {
  10134. map: T,
  10135. forEach: function forEach(a, b, d) {
  10136. T(a, function () {
  10137. b.apply(this, arguments);
  10138. }, d);
  10139. },
  10140. count: function count(a) {
  10141. var b = 0;
  10142. T(a, function () {
  10143. b++;
  10144. });
  10145. return b;
  10146. },
  10147. toArray: function toArray(a) {
  10148. return T(a, function (a) {
  10149. return a;
  10150. }) || [];
  10151. },
  10152. only: function only(a) {
  10153. if (!P(a)) throw Error("React.Children.only expected to receive a single React element child.");
  10154. return a;
  10155. }
  10156. };
  10157. exports.Component = G;
  10158. exports.Fragment = p;
  10159. exports.Profiler = r;
  10160. exports.PureComponent = I;
  10161. exports.StrictMode = q;
  10162. exports.Suspense = x;
  10163. exports.SuspenseList = y;
  10164. exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Y;
  10165. exports.cache = function (a) {
  10166. return function () {
  10167. var b = U.current;
  10168. if (!b) return a.apply(null, arguments);
  10169. var d = b.getCacheForType(ha);
  10170. b = d.get(a);
  10171. void 0 === b && (b = V(), d.set(a, b));
  10172. d = 0;
  10173. for (var c = arguments.length; d < c; d++) {
  10174. var e = arguments[d];
  10175. if ("function" === typeof e || "object" === _typeof(e) && null !== e) {
  10176. var f = b.o;
  10177. null === f && (b.o = f = new WeakMap());
  10178. b = f.get(e);
  10179. void 0 === b && (b = V(), f.set(e, b));
  10180. } else f = b.p, null === f && (b.p = f = new Map()), b = f.get(e), void 0 === b && (b = V(), f.set(e, b));
  10181. }
  10182. if (1 === b.s) return b.v;
  10183. if (2 === b.s) throw b.v;
  10184. try {
  10185. var g = a.apply(null, arguments);
  10186. d = b;
  10187. d.s = 1;
  10188. return d.v = g;
  10189. } catch (h) {
  10190. throw g = b, g.s = 2, g.v = h, h;
  10191. }
  10192. };
  10193. };
  10194. exports.cloneElement = function (a, b, d) {
  10195. if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
  10196. var c = E({}, a.props),
  10197. e = a.key,
  10198. f = a.ref,
  10199. g = a._owner;
  10200. if (null != b) {
  10201. void 0 !== b.ref && (f = b.ref, g = M.current);
  10202. void 0 !== b.key && (e = "" + b.key);
  10203. if (a.type && a.type.defaultProps) var h = a.type.defaultProps;
  10204. for (k in b) {
  10205. L.call(b, k) && !N.hasOwnProperty(k) && (c[k] = void 0 === b[k] && void 0 !== h ? h[k] : b[k]);
  10206. }
  10207. }
  10208. var k = arguments.length - 2;
  10209. if (1 === k) c.children = d;else if (1 < k) {
  10210. h = Array(k);
  10211. for (var m = 0; m < k; m++) {
  10212. h[m] = arguments[m + 2];
  10213. }
  10214. c.children = h;
  10215. }
  10216. return {
  10217. $$typeof: l,
  10218. type: a.type,
  10219. key: e,
  10220. ref: f,
  10221. props: c,
  10222. _owner: g
  10223. };
  10224. };
  10225. exports.createContext = function (a) {
  10226. a = {
  10227. $$typeof: u,
  10228. _currentValue: a,
  10229. _currentValue2: a,
  10230. _threadCount: 0,
  10231. Provider: null,
  10232. Consumer: null,
  10233. _defaultValue: null,
  10234. _globalName: null
  10235. };
  10236. a.Provider = {
  10237. $$typeof: t,
  10238. _context: a
  10239. };
  10240. return a.Consumer = a;
  10241. };
  10242. exports.createElement = O;
  10243. exports.createFactory = function (a) {
  10244. var b = O.bind(null, a);
  10245. b.type = a;
  10246. return b;
  10247. };
  10248. exports.createRef = function () {
  10249. return {
  10250. current: null
  10251. };
  10252. };
  10253. exports.createServerContext = function (a, b) {
  10254. var d = !0;
  10255. if (!Z[a]) {
  10256. d = !1;
  10257. var c = {
  10258. $$typeof: v,
  10259. _currentValue: b,
  10260. _currentValue2: b,
  10261. _defaultValue: b,
  10262. _threadCount: 0,
  10263. Provider: null,
  10264. Consumer: null,
  10265. _globalName: a
  10266. };
  10267. c.Provider = {
  10268. $$typeof: t,
  10269. _context: c
  10270. };
  10271. Z[a] = c;
  10272. }
  10273. c = Z[a];
  10274. if (c._defaultValue === B) c._defaultValue = b, c._currentValue === B && (c._currentValue = b), c._currentValue2 === B && (c._currentValue2 = b);else if (d) throw Error("ServerContext: " + a + " already defined");
  10275. return c;
  10276. };
  10277. exports.experimental_useEffectEvent = function (a) {
  10278. return W.current.useEffectEvent(a);
  10279. };
  10280. exports.forwardRef = function (a) {
  10281. return {
  10282. $$typeof: w,
  10283. render: a
  10284. };
  10285. };
  10286. exports.isValidElement = P;
  10287. exports.lazy = function (a) {
  10288. return {
  10289. $$typeof: A,
  10290. _payload: {
  10291. _status: -1,
  10292. _result: a
  10293. },
  10294. _init: fa
  10295. };
  10296. };
  10297. exports.memo = function (a, b) {
  10298. return {
  10299. $$typeof: z,
  10300. type: a,
  10301. compare: void 0 === b ? null : b
  10302. };
  10303. };
  10304. exports.startTransition = function (a) {
  10305. var b = X.transition;
  10306. X.transition = {};
  10307. try {
  10308. a();
  10309. } finally {
  10310. X.transition = b;
  10311. }
  10312. };
  10313. exports.unstable_Cache = ca;
  10314. exports.unstable_DebugTracingMode = aa;
  10315. exports.unstable_Offscreen = ba;
  10316. exports.unstable_act = function () {
  10317. throw Error("act(...) is not supported in production builds of React.");
  10318. };
  10319. exports.unstable_getCacheForType = function (a) {
  10320. var b = U.current;
  10321. return b ? b.getCacheForType(a) : a();
  10322. };
  10323. exports.unstable_getCacheSignal = function () {
  10324. var a = U.current;
  10325. return a ? a.getCacheSignal() : (a = new AbortController(), a.abort(Error("This CacheSignal was requested outside React which means that it is immediately aborted.")), a.signal);
  10326. };
  10327. exports.unstable_useCacheRefresh = function () {
  10328. return W.current.useCacheRefresh();
  10329. };
  10330. exports.unstable_useMemoCache = function (a) {
  10331. return W.current.useMemoCache(a);
  10332. };
  10333. exports.use = function (a) {
  10334. return W.current.use(a);
  10335. };
  10336. exports.useCallback = function (a, b) {
  10337. return W.current.useCallback(a, b);
  10338. };
  10339. exports.useContext = function (a) {
  10340. return W.current.useContext(a);
  10341. };
  10342. exports.useDebugValue = function () {};
  10343. exports.useDeferredValue = function (a) {
  10344. return W.current.useDeferredValue(a);
  10345. };
  10346. exports.useEffect = function (a, b) {
  10347. return W.current.useEffect(a, b);
  10348. };
  10349. exports.useId = function () {
  10350. return W.current.useId();
  10351. };
  10352. exports.useImperativeHandle = function (a, b, d) {
  10353. return W.current.useImperativeHandle(a, b, d);
  10354. };
  10355. exports.useInsertionEffect = function (a, b) {
  10356. return W.current.useInsertionEffect(a, b);
  10357. };
  10358. exports.useLayoutEffect = function (a, b) {
  10359. return W.current.useLayoutEffect(a, b);
  10360. };
  10361. exports.useMemo = function (a, b) {
  10362. return W.current.useMemo(a, b);
  10363. };
  10364. exports.useReducer = function (a, b, d) {
  10365. return W.current.useReducer(a, b, d);
  10366. };
  10367. exports.useRef = function (a) {
  10368. return W.current.useRef(a);
  10369. };
  10370. exports.useState = function (a) {
  10371. return W.current.useState(a);
  10372. };
  10373. exports.useSyncExternalStore = function (a, b, d) {
  10374. return W.current.useSyncExternalStore(a, b, d);
  10375. };
  10376. exports.useTransition = function () {
  10377. return W.current.useTransition();
  10378. };
  10379. exports.version = "18.3.0-experimental-53b1f69ba-20230209";
  10380. /***/ }),
  10381. /* 31 */
  10382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10383. "use strict";
  10384. // ESM COMPAT FLAG
  10385. __webpack_require__.r(__webpack_exports__);
  10386. // EXPORTS
  10387. __webpack_require__.d(__webpack_exports__, "connectToDevTools", function() { return /* binding */ connectToDevTools; });
  10388. // CONCATENATED MODULE: ../react-devtools-shared/src/events.js
  10389. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10390. 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); } }
  10391. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  10392. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  10393. /**
  10394. * Copyright (c) Meta Platforms, Inc. and affiliates.
  10395. *
  10396. * This source code is licensed under the MIT license found in the
  10397. * LICENSE file in the root directory of this source tree.
  10398. *
  10399. *
  10400. */
  10401. var EventEmitter = /*#__PURE__*/function () {
  10402. function EventEmitter() {
  10403. _classCallCheck(this, EventEmitter);
  10404. _defineProperty(this, "listenersMap", new Map());
  10405. }
  10406. _createClass(EventEmitter, [{
  10407. key: "addListener",
  10408. value: function addListener(event, listener) {
  10409. var listeners = this.listenersMap.get(event);
  10410. if (listeners === undefined) {
  10411. this.listenersMap.set(event, [listener]);
  10412. } else {
  10413. var index = listeners.indexOf(listener);
  10414. if (index < 0) {
  10415. listeners.push(listener);
  10416. }
  10417. }
  10418. }
  10419. }, {
  10420. key: "emit",
  10421. value: function emit(event) {
  10422. var listeners = this.listenersMap.get(event);
  10423. if (listeners !== undefined) {
  10424. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  10425. args[_key - 1] = arguments[_key];
  10426. }
  10427. if (listeners.length === 1) {
  10428. // No need to clone or try/catch
  10429. var listener = listeners[0];
  10430. listener.apply(null, args);
  10431. } else {
  10432. var didThrow = false;
  10433. var caughtError = null;
  10434. var clonedListeners = Array.from(listeners);
  10435. for (var i = 0; i < clonedListeners.length; i++) {
  10436. var _listener = clonedListeners[i];
  10437. try {
  10438. _listener.apply(null, args);
  10439. } catch (error) {
  10440. if (caughtError === null) {
  10441. didThrow = true;
  10442. caughtError = error;
  10443. }
  10444. }
  10445. }
  10446. if (didThrow) {
  10447. throw caughtError;
  10448. }
  10449. }
  10450. }
  10451. }
  10452. }, {
  10453. key: "removeAllListeners",
  10454. value: function removeAllListeners() {
  10455. this.listenersMap.clear();
  10456. }
  10457. }, {
  10458. key: "removeListener",
  10459. value: function removeListener(event, listener) {
  10460. var listeners = this.listenersMap.get(event);
  10461. if (listeners !== undefined) {
  10462. var index = listeners.indexOf(listener);
  10463. if (index >= 0) {
  10464. listeners.splice(index, 1);
  10465. }
  10466. }
  10467. }
  10468. }]);
  10469. return EventEmitter;
  10470. }();
  10471. // EXTERNAL MODULE: /Users/xch/dev/react/node_modules/lodash.throttle/index.js
  10472. var lodash_throttle = __webpack_require__(13);
  10473. var lodash_throttle_default = /*#__PURE__*/__webpack_require__.n(lodash_throttle);
  10474. // EXTERNAL MODULE: ../react-devtools-shared/src/constants.js
  10475. var constants = __webpack_require__(2);
  10476. // EXTERNAL MODULE: ../react-devtools-shared/src/storage.js
  10477. var storage = __webpack_require__(5);
  10478. // CONCATENATED MODULE: /Users/xch/dev/react/node_modules/memoize-one/esm/index.js
  10479. var simpleIsEqual = function simpleIsEqual(a, b) {
  10480. return a === b;
  10481. };
  10482. /* harmony default export */ var esm = (function (resultFn) {
  10483. var isEqual = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : simpleIsEqual;
  10484. var lastThis = void 0;
  10485. var lastArgs = [];
  10486. var lastResult = void 0;
  10487. var calledOnce = false;
  10488. var isNewArgEqualToLast = function isNewArgEqualToLast(newArg, index) {
  10489. return isEqual(newArg, lastArgs[index]);
  10490. };
  10491. var result = function result() {
  10492. for (var _len = arguments.length, newArgs = Array(_len), _key = 0; _key < _len; _key++) {
  10493. newArgs[_key] = arguments[_key];
  10494. }
  10495. if (calledOnce && lastThis === this && newArgs.length === lastArgs.length && newArgs.every(isNewArgEqualToLast)) {
  10496. return lastResult;
  10497. }
  10498. calledOnce = true;
  10499. lastThis = this;
  10500. lastArgs = newArgs;
  10501. lastResult = resultFn.apply(this, newArgs);
  10502. return lastResult;
  10503. };
  10504. return result;
  10505. });
  10506. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/utils.js
  10507. /**
  10508. * Copyright (c) Meta Platforms, Inc. and affiliates.
  10509. *
  10510. * This source code is licensed under the MIT license found in the
  10511. * LICENSE file in the root directory of this source tree.
  10512. *
  10513. *
  10514. */
  10515. // Get the window object for the document that a node belongs to,
  10516. // or return null if it cannot be found (node not attached to DOM,
  10517. // etc).
  10518. function getOwnerWindow(node) {
  10519. if (!node.ownerDocument) {
  10520. return null;
  10521. }
  10522. return node.ownerDocument.defaultView;
  10523. } // Get the iframe containing a node, or return null if it cannot
  10524. // be found (node not within iframe, etc).
  10525. function getOwnerIframe(node) {
  10526. var nodeWindow = getOwnerWindow(node);
  10527. if (nodeWindow) {
  10528. return nodeWindow.frameElement;
  10529. }
  10530. return null;
  10531. } // Get a bounding client rect for a node, with an
  10532. // offset added to compensate for its border.
  10533. function getBoundingClientRectWithBorderOffset(node) {
  10534. var dimensions = getElementDimensions(node);
  10535. return mergeRectOffsets([node.getBoundingClientRect(), {
  10536. top: dimensions.borderTop,
  10537. left: dimensions.borderLeft,
  10538. bottom: dimensions.borderBottom,
  10539. right: dimensions.borderRight,
  10540. // This width and height won't get used by mergeRectOffsets (since this
  10541. // is not the first rect in the array), but we set them so that this
  10542. // object type checks as a ClientRect.
  10543. width: 0,
  10544. height: 0
  10545. }]);
  10546. } // Add together the top, left, bottom, and right properties of
  10547. // each ClientRect, but keep the width and height of the first one.
  10548. function mergeRectOffsets(rects) {
  10549. return rects.reduce(function (previousRect, rect) {
  10550. if (previousRect == null) {
  10551. return rect;
  10552. }
  10553. return {
  10554. top: previousRect.top + rect.top,
  10555. left: previousRect.left + rect.left,
  10556. width: previousRect.width,
  10557. height: previousRect.height,
  10558. bottom: previousRect.bottom + rect.bottom,
  10559. right: previousRect.right + rect.right
  10560. };
  10561. });
  10562. } // Calculate a boundingClientRect for a node relative to boundaryWindow,
  10563. // taking into account any offsets caused by intermediate iframes.
  10564. function getNestedBoundingClientRect(node, boundaryWindow) {
  10565. var ownerIframe = getOwnerIframe(node);
  10566. if (ownerIframe && ownerIframe !== boundaryWindow) {
  10567. var rects = [node.getBoundingClientRect()];
  10568. var currentIframe = ownerIframe;
  10569. var onlyOneMore = false;
  10570. while (currentIframe) {
  10571. var rect = getBoundingClientRectWithBorderOffset(currentIframe);
  10572. rects.push(rect);
  10573. currentIframe = getOwnerIframe(currentIframe);
  10574. if (onlyOneMore) {
  10575. break;
  10576. } // We don't want to calculate iframe offsets upwards beyond
  10577. // the iframe containing the boundaryWindow, but we
  10578. // need to calculate the offset relative to the boundaryWindow.
  10579. if (currentIframe && getOwnerWindow(currentIframe) === boundaryWindow) {
  10580. onlyOneMore = true;
  10581. }
  10582. }
  10583. return mergeRectOffsets(rects);
  10584. } else {
  10585. return node.getBoundingClientRect();
  10586. }
  10587. }
  10588. function getElementDimensions(domElement) {
  10589. var calculatedStyle = window.getComputedStyle(domElement);
  10590. return {
  10591. borderLeft: parseInt(calculatedStyle.borderLeftWidth, 10),
  10592. borderRight: parseInt(calculatedStyle.borderRightWidth, 10),
  10593. borderTop: parseInt(calculatedStyle.borderTopWidth, 10),
  10594. borderBottom: parseInt(calculatedStyle.borderBottomWidth, 10),
  10595. marginLeft: parseInt(calculatedStyle.marginLeft, 10),
  10596. marginRight: parseInt(calculatedStyle.marginRight, 10),
  10597. marginTop: parseInt(calculatedStyle.marginTop, 10),
  10598. marginBottom: parseInt(calculatedStyle.marginBottom, 10),
  10599. paddingLeft: parseInt(calculatedStyle.paddingLeft, 10),
  10600. paddingRight: parseInt(calculatedStyle.paddingRight, 10),
  10601. paddingTop: parseInt(calculatedStyle.paddingTop, 10),
  10602. paddingBottom: parseInt(calculatedStyle.paddingBottom, 10)
  10603. };
  10604. }
  10605. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/Highlighter/Overlay.js
  10606. function Overlay_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10607. function Overlay_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); } }
  10608. function Overlay_createClass(Constructor, protoProps, staticProps) { if (protoProps) Overlay_defineProperties(Constructor.prototype, protoProps); if (staticProps) Overlay_defineProperties(Constructor, staticProps); return Constructor; }
  10609. /**
  10610. * Copyright (c) Meta Platforms, Inc. and affiliates.
  10611. *
  10612. * This source code is licensed under the MIT license found in the
  10613. * LICENSE file in the root directory of this source tree.
  10614. *
  10615. *
  10616. */
  10617. var Overlay_assign = Object.assign; // Note that the Overlay components are not affected by the active Theme,
  10618. // because they highlight elements in the main Chrome window (outside of devtools).
  10619. // The colors below were chosen to roughly match those used by Chrome devtools.
  10620. var OverlayRect = /*#__PURE__*/function () {
  10621. function OverlayRect(doc, container) {
  10622. Overlay_classCallCheck(this, OverlayRect);
  10623. this.node = doc.createElement('div');
  10624. this.border = doc.createElement('div');
  10625. this.padding = doc.createElement('div');
  10626. this.content = doc.createElement('div');
  10627. this.border.style.borderColor = overlayStyles.border;
  10628. this.padding.style.borderColor = overlayStyles.padding;
  10629. this.content.style.backgroundColor = overlayStyles.background;
  10630. Overlay_assign(this.node.style, {
  10631. borderColor: overlayStyles.margin,
  10632. pointerEvents: 'none',
  10633. position: 'fixed'
  10634. });
  10635. this.node.style.zIndex = '10000000';
  10636. this.node.appendChild(this.border);
  10637. this.border.appendChild(this.padding);
  10638. this.padding.appendChild(this.content);
  10639. container.appendChild(this.node);
  10640. }
  10641. Overlay_createClass(OverlayRect, [{
  10642. key: "remove",
  10643. value: function remove() {
  10644. if (this.node.parentNode) {
  10645. this.node.parentNode.removeChild(this.node);
  10646. }
  10647. }
  10648. }, {
  10649. key: "update",
  10650. value: function update(box, dims) {
  10651. boxWrap(dims, 'margin', this.node);
  10652. boxWrap(dims, 'border', this.border);
  10653. boxWrap(dims, 'padding', this.padding);
  10654. Overlay_assign(this.content.style, {
  10655. height: box.height - dims.borderTop - dims.borderBottom - dims.paddingTop - dims.paddingBottom + 'px',
  10656. width: box.width - dims.borderLeft - dims.borderRight - dims.paddingLeft - dims.paddingRight + 'px'
  10657. });
  10658. Overlay_assign(this.node.style, {
  10659. top: box.top - dims.marginTop + 'px',
  10660. left: box.left - dims.marginLeft + 'px'
  10661. });
  10662. }
  10663. }]);
  10664. return OverlayRect;
  10665. }();
  10666. var OverlayTip = /*#__PURE__*/function () {
  10667. function OverlayTip(doc, container) {
  10668. Overlay_classCallCheck(this, OverlayTip);
  10669. this.tip = doc.createElement('div');
  10670. Overlay_assign(this.tip.style, {
  10671. display: 'flex',
  10672. flexFlow: 'row nowrap',
  10673. backgroundColor: '#333740',
  10674. borderRadius: '2px',
  10675. fontFamily: '"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace',
  10676. fontWeight: 'bold',
  10677. padding: '3px 5px',
  10678. pointerEvents: 'none',
  10679. position: 'fixed',
  10680. fontSize: '12px',
  10681. whiteSpace: 'nowrap'
  10682. });
  10683. this.nameSpan = doc.createElement('span');
  10684. this.tip.appendChild(this.nameSpan);
  10685. Overlay_assign(this.nameSpan.style, {
  10686. color: '#ee78e6',
  10687. borderRight: '1px solid #aaaaaa',
  10688. paddingRight: '0.5rem',
  10689. marginRight: '0.5rem'
  10690. });
  10691. this.dimSpan = doc.createElement('span');
  10692. this.tip.appendChild(this.dimSpan);
  10693. Overlay_assign(this.dimSpan.style, {
  10694. color: '#d7d7d7'
  10695. });
  10696. this.tip.style.zIndex = '10000000';
  10697. container.appendChild(this.tip);
  10698. }
  10699. Overlay_createClass(OverlayTip, [{
  10700. key: "remove",
  10701. value: function remove() {
  10702. if (this.tip.parentNode) {
  10703. this.tip.parentNode.removeChild(this.tip);
  10704. }
  10705. }
  10706. }, {
  10707. key: "updateText",
  10708. value: function updateText(name, width, height) {
  10709. this.nameSpan.textContent = name;
  10710. this.dimSpan.textContent = Math.round(width) + 'px × ' + Math.round(height) + 'px';
  10711. }
  10712. }, {
  10713. key: "updatePosition",
  10714. value: function updatePosition(dims, bounds) {
  10715. var tipRect = this.tip.getBoundingClientRect();
  10716. var tipPos = findTipPos(dims, bounds, {
  10717. width: tipRect.width,
  10718. height: tipRect.height
  10719. });
  10720. Overlay_assign(this.tip.style, tipPos.style);
  10721. }
  10722. }]);
  10723. return OverlayTip;
  10724. }();
  10725. var Overlay_Overlay = /*#__PURE__*/function () {
  10726. function Overlay(agent) {
  10727. Overlay_classCallCheck(this, Overlay);
  10728. // Find the root window, because overlays are positioned relative to it.
  10729. var currentWindow = window.__REACT_DEVTOOLS_TARGET_WINDOW__ || window;
  10730. this.window = currentWindow; // When opened in shells/dev, the tooltip should be bound by the app iframe, not by the topmost window.
  10731. var tipBoundsWindow = window.__REACT_DEVTOOLS_TARGET_WINDOW__ || window;
  10732. this.tipBoundsWindow = tipBoundsWindow;
  10733. var doc = currentWindow.document;
  10734. this.container = doc.createElement('div');
  10735. this.container.style.zIndex = '10000000';
  10736. this.tip = new OverlayTip(doc, this.container);
  10737. this.rects = [];
  10738. this.agent = agent;
  10739. doc.body.appendChild(this.container);
  10740. }
  10741. Overlay_createClass(Overlay, [{
  10742. key: "remove",
  10743. value: function remove() {
  10744. this.tip.remove();
  10745. this.rects.forEach(function (rect) {
  10746. rect.remove();
  10747. });
  10748. this.rects.length = 0;
  10749. if (this.container.parentNode) {
  10750. this.container.parentNode.removeChild(this.container);
  10751. }
  10752. }
  10753. }, {
  10754. key: "inspect",
  10755. value: function inspect(nodes, name) {
  10756. var _this = this;
  10757. // We can't get the size of text nodes or comment nodes. React as of v15
  10758. // heavily uses comment nodes to delimit text.
  10759. var elements = nodes.filter(function (node) {
  10760. return node.nodeType === Node.ELEMENT_NODE;
  10761. });
  10762. while (this.rects.length > elements.length) {
  10763. var rect = this.rects.pop();
  10764. rect.remove();
  10765. }
  10766. if (elements.length === 0) {
  10767. return;
  10768. }
  10769. while (this.rects.length < elements.length) {
  10770. this.rects.push(new OverlayRect(this.window.document, this.container));
  10771. }
  10772. var outerBox = {
  10773. top: Number.POSITIVE_INFINITY,
  10774. right: Number.NEGATIVE_INFINITY,
  10775. bottom: Number.NEGATIVE_INFINITY,
  10776. left: Number.POSITIVE_INFINITY
  10777. };
  10778. elements.forEach(function (element, index) {
  10779. var box = getNestedBoundingClientRect(element, _this.window);
  10780. var dims = getElementDimensions(element);
  10781. outerBox.top = Math.min(outerBox.top, box.top - dims.marginTop);
  10782. outerBox.right = Math.max(outerBox.right, box.left + box.width + dims.marginRight);
  10783. outerBox.bottom = Math.max(outerBox.bottom, box.top + box.height + dims.marginBottom);
  10784. outerBox.left = Math.min(outerBox.left, box.left - dims.marginLeft);
  10785. var rect = _this.rects[index];
  10786. rect.update(box, dims);
  10787. });
  10788. if (!name) {
  10789. name = elements[0].nodeName.toLowerCase();
  10790. var node = elements[0];
  10791. var rendererInterface = this.agent.getBestMatchingRendererInterface(node);
  10792. if (rendererInterface) {
  10793. var id = rendererInterface.getFiberIDForNative(node, true);
  10794. if (id) {
  10795. var ownerName = rendererInterface.getDisplayNameForFiberID(id, true);
  10796. if (ownerName) {
  10797. name += ' (in ' + ownerName + ')';
  10798. }
  10799. }
  10800. }
  10801. }
  10802. this.tip.updateText(name, outerBox.right - outerBox.left, outerBox.bottom - outerBox.top);
  10803. var tipBounds = getNestedBoundingClientRect(this.tipBoundsWindow.document.documentElement, this.window);
  10804. this.tip.updatePosition({
  10805. top: outerBox.top,
  10806. left: outerBox.left,
  10807. height: outerBox.bottom - outerBox.top,
  10808. width: outerBox.right - outerBox.left
  10809. }, {
  10810. top: tipBounds.top + this.tipBoundsWindow.scrollY,
  10811. left: tipBounds.left + this.tipBoundsWindow.scrollX,
  10812. height: this.tipBoundsWindow.innerHeight,
  10813. width: this.tipBoundsWindow.innerWidth
  10814. });
  10815. }
  10816. }]);
  10817. return Overlay;
  10818. }();
  10819. function findTipPos(dims, bounds, tipSize) {
  10820. var tipHeight = Math.max(tipSize.height, 20);
  10821. var tipWidth = Math.max(tipSize.width, 60);
  10822. var margin = 5;
  10823. var top;
  10824. if (dims.top + dims.height + tipHeight <= bounds.top + bounds.height) {
  10825. if (dims.top + dims.height < bounds.top + 0) {
  10826. top = bounds.top + margin;
  10827. } else {
  10828. top = dims.top + dims.height + margin;
  10829. }
  10830. } else if (dims.top - tipHeight <= bounds.top + bounds.height) {
  10831. if (dims.top - tipHeight - margin < bounds.top + margin) {
  10832. top = bounds.top + margin;
  10833. } else {
  10834. top = dims.top - tipHeight - margin;
  10835. }
  10836. } else {
  10837. top = bounds.top + bounds.height - tipHeight - margin;
  10838. }
  10839. var left = dims.left + margin;
  10840. if (dims.left < bounds.left) {
  10841. left = bounds.left + margin;
  10842. }
  10843. if (dims.left + tipWidth > bounds.left + bounds.width) {
  10844. left = bounds.left + bounds.width - tipWidth - margin;
  10845. }
  10846. top += 'px';
  10847. left += 'px';
  10848. return {
  10849. style: {
  10850. top: top,
  10851. left: left
  10852. }
  10853. };
  10854. }
  10855. function boxWrap(dims, what, node) {
  10856. Overlay_assign(node.style, {
  10857. borderTopWidth: dims[what + 'Top'] + 'px',
  10858. borderLeftWidth: dims[what + 'Left'] + 'px',
  10859. borderRightWidth: dims[what + 'Right'] + 'px',
  10860. borderBottomWidth: dims[what + 'Bottom'] + 'px',
  10861. borderStyle: 'solid'
  10862. });
  10863. }
  10864. var overlayStyles = {
  10865. background: 'rgba(120, 170, 210, 0.7)',
  10866. padding: 'rgba(77, 200, 0, 0.3)',
  10867. margin: 'rgba(255, 155, 0, 0.3)',
  10868. border: 'rgba(255, 200, 50, 0.3)'
  10869. };
  10870. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/Highlighter/Highlighter.js
  10871. /**
  10872. * Copyright (c) Meta Platforms, Inc. and affiliates.
  10873. *
  10874. * This source code is licensed under the MIT license found in the
  10875. * LICENSE file in the root directory of this source tree.
  10876. *
  10877. *
  10878. */
  10879. var SHOW_DURATION = 2000;
  10880. var timeoutID = null;
  10881. var overlay = null;
  10882. function hideOverlay(agent) {
  10883. if (window.document == null) {
  10884. agent.emit('hideNativeHighlight');
  10885. return;
  10886. }
  10887. timeoutID = null;
  10888. if (overlay !== null) {
  10889. overlay.remove();
  10890. overlay = null;
  10891. }
  10892. }
  10893. function showOverlay(elements, componentName, agent, hideAfterTimeout) {
  10894. if (window.document == null) {
  10895. if (elements != null && elements[0] != null) {
  10896. agent.emit('showNativeHighlight', elements[0]);
  10897. }
  10898. return;
  10899. }
  10900. if (timeoutID !== null) {
  10901. clearTimeout(timeoutID);
  10902. }
  10903. if (elements == null) {
  10904. return;
  10905. }
  10906. if (overlay === null) {
  10907. overlay = new Overlay_Overlay(agent);
  10908. }
  10909. overlay.inspect(elements, componentName);
  10910. if (hideAfterTimeout) {
  10911. timeoutID = setTimeout(function () {
  10912. return hideOverlay(agent);
  10913. }, SHOW_DURATION);
  10914. }
  10915. }
  10916. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/Highlighter/index.js
  10917. /**
  10918. * Copyright (c) Meta Platforms, Inc. and affiliates.
  10919. *
  10920. * This source code is licensed under the MIT license found in the
  10921. * LICENSE file in the root directory of this source tree.
  10922. *
  10923. *
  10924. */
  10925. // This plug-in provides in-page highlighting of the selected element.
  10926. // It is used by the browser extension and the standalone DevTools shell (when connected to a browser).
  10927. // It is not currently the mechanism used to highlight React Native views.
  10928. // That is done by the React Native Inspector component.
  10929. var iframesListeningTo = new Set();
  10930. function setupHighlighter(bridge, agent) {
  10931. bridge.addListener('clearNativeElementHighlight', clearNativeElementHighlight);
  10932. bridge.addListener('highlightNativeElement', highlightNativeElement);
  10933. bridge.addListener('shutdown', stopInspectingNative);
  10934. bridge.addListener('startInspectingNative', startInspectingNative);
  10935. bridge.addListener('stopInspectingNative', stopInspectingNative);
  10936. function startInspectingNative() {
  10937. registerListenersOnWindow(window);
  10938. }
  10939. function registerListenersOnWindow(window) {
  10940. // This plug-in may run in non-DOM environments (e.g. React Native).
  10941. if (window && typeof window.addEventListener === 'function') {
  10942. window.addEventListener('click', onClick, true);
  10943. window.addEventListener('mousedown', onMouseEvent, true);
  10944. window.addEventListener('mouseover', onMouseEvent, true);
  10945. window.addEventListener('mouseup', onMouseEvent, true);
  10946. window.addEventListener('pointerdown', onPointerDown, true);
  10947. window.addEventListener('pointerover', onPointerOver, true);
  10948. window.addEventListener('pointerup', onPointerUp, true);
  10949. } else {
  10950. agent.emit('startInspectingNative');
  10951. }
  10952. }
  10953. function stopInspectingNative() {
  10954. hideOverlay(agent);
  10955. removeListenersOnWindow(window);
  10956. iframesListeningTo.forEach(function (frame) {
  10957. try {
  10958. removeListenersOnWindow(frame.contentWindow);
  10959. } catch (error) {// This can error when the iframe is on a cross-origin.
  10960. }
  10961. });
  10962. iframesListeningTo = new Set();
  10963. }
  10964. function removeListenersOnWindow(window) {
  10965. // This plug-in may run in non-DOM environments (e.g. React Native).
  10966. if (window && typeof window.removeEventListener === 'function') {
  10967. window.removeEventListener('click', onClick, true);
  10968. window.removeEventListener('mousedown', onMouseEvent, true);
  10969. window.removeEventListener('mouseover', onMouseEvent, true);
  10970. window.removeEventListener('mouseup', onMouseEvent, true);
  10971. window.removeEventListener('pointerdown', onPointerDown, true);
  10972. window.removeEventListener('pointerover', onPointerOver, true);
  10973. window.removeEventListener('pointerup', onPointerUp, true);
  10974. } else {
  10975. agent.emit('stopInspectingNative');
  10976. }
  10977. }
  10978. function clearNativeElementHighlight() {
  10979. hideOverlay(agent);
  10980. }
  10981. function highlightNativeElement(_ref) {
  10982. var displayName = _ref.displayName,
  10983. hideAfterTimeout = _ref.hideAfterTimeout,
  10984. id = _ref.id,
  10985. openNativeElementsPanel = _ref.openNativeElementsPanel,
  10986. rendererID = _ref.rendererID,
  10987. scrollIntoView = _ref.scrollIntoView;
  10988. var renderer = agent.rendererInterfaces[rendererID];
  10989. if (renderer == null) {
  10990. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  10991. }
  10992. var nodes = null;
  10993. if (renderer != null) {
  10994. nodes = renderer.findNativeNodesForFiberID(id);
  10995. }
  10996. if (nodes != null && nodes[0] != null) {
  10997. var node = nodes[0]; // $FlowFixMe[method-unbinding]
  10998. if (scrollIntoView && typeof node.scrollIntoView === 'function') {
  10999. // If the node isn't visible show it before highlighting it.
  11000. // We may want to reconsider this; it might be a little disruptive.
  11001. node.scrollIntoView({
  11002. block: 'nearest',
  11003. inline: 'nearest'
  11004. });
  11005. }
  11006. showOverlay(nodes, displayName, agent, hideAfterTimeout);
  11007. if (openNativeElementsPanel) {
  11008. window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0 = node;
  11009. bridge.send('syncSelectionToNativeElementsPanel');
  11010. }
  11011. } else {
  11012. hideOverlay(agent);
  11013. }
  11014. }
  11015. function onClick(event) {
  11016. event.preventDefault();
  11017. event.stopPropagation();
  11018. stopInspectingNative();
  11019. bridge.send('stopInspectingNative', true);
  11020. }
  11021. function onMouseEvent(event) {
  11022. event.preventDefault();
  11023. event.stopPropagation();
  11024. }
  11025. function onPointerDown(event) {
  11026. event.preventDefault();
  11027. event.stopPropagation();
  11028. selectFiberForNode(event.target);
  11029. }
  11030. function onPointerOver(event) {
  11031. event.preventDefault();
  11032. event.stopPropagation();
  11033. var target = event.target;
  11034. if (target.tagName === 'IFRAME') {
  11035. var iframe = target;
  11036. try {
  11037. if (!iframesListeningTo.has(iframe)) {
  11038. var _window = iframe.contentWindow;
  11039. registerListenersOnWindow(_window);
  11040. iframesListeningTo.add(iframe);
  11041. }
  11042. } catch (error) {// This can error when the iframe is on a cross-origin.
  11043. }
  11044. } // Don't pass the name explicitly.
  11045. // It will be inferred from DOM tag and Fiber owner.
  11046. showOverlay([target], null, agent, false);
  11047. selectFiberForNode(target);
  11048. }
  11049. function onPointerUp(event) {
  11050. event.preventDefault();
  11051. event.stopPropagation();
  11052. }
  11053. var selectFiberForNode = lodash_throttle_default()(esm(function (node) {
  11054. var id = agent.getIDForNode(node);
  11055. if (id !== null) {
  11056. bridge.send('selectFiber', id);
  11057. }
  11058. }), 200, // Don't change the selection in the very first 200ms
  11059. // because those are usually unintentional as you lift the cursor.
  11060. {
  11061. leading: false
  11062. });
  11063. }
  11064. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/TraceUpdates/canvas.js
  11065. /**
  11066. * Copyright (c) Meta Platforms, Inc. and affiliates.
  11067. *
  11068. * This source code is licensed under the MIT license found in the
  11069. * LICENSE file in the root directory of this source tree.
  11070. *
  11071. *
  11072. */
  11073. var OUTLINE_COLOR = '#f0f0f0'; // Note these colors are in sync with DevTools Profiler chart colors.
  11074. var COLORS = ['#37afa9', '#63b19e', '#80b393', '#97b488', '#abb67d', '#beb771', '#cfb965', '#dfba57', '#efbb49', '#febc38'];
  11075. var canvas = null;
  11076. function draw(nodeToData, agent) {
  11077. if (window.document == null) {
  11078. var nodesToDraw = [];
  11079. iterateNodes(nodeToData, function (_, color, node) {
  11080. nodesToDraw.push({
  11081. node: node,
  11082. color: color
  11083. });
  11084. });
  11085. agent.emit('drawTraceUpdates', nodesToDraw);
  11086. return;
  11087. }
  11088. if (canvas === null) {
  11089. initialize();
  11090. }
  11091. var canvasFlow = canvas;
  11092. canvasFlow.width = window.innerWidth;
  11093. canvasFlow.height = window.innerHeight;
  11094. var context = canvasFlow.getContext('2d');
  11095. context.clearRect(0, 0, canvasFlow.width, canvasFlow.height);
  11096. iterateNodes(nodeToData, function (rect, color) {
  11097. if (rect !== null) {
  11098. drawBorder(context, rect, color);
  11099. }
  11100. });
  11101. }
  11102. function iterateNodes(nodeToData, execute) {
  11103. nodeToData.forEach(function (_ref, node) {
  11104. var count = _ref.count,
  11105. rect = _ref.rect;
  11106. var colorIndex = Math.min(COLORS.length - 1, count - 1);
  11107. var color = COLORS[colorIndex];
  11108. execute(rect, color, node);
  11109. });
  11110. }
  11111. function drawBorder(context, rect, color) {
  11112. var height = rect.height,
  11113. left = rect.left,
  11114. top = rect.top,
  11115. width = rect.width; // outline
  11116. context.lineWidth = 1;
  11117. context.strokeStyle = OUTLINE_COLOR;
  11118. context.strokeRect(left - 1, top - 1, width + 2, height + 2); // inset
  11119. context.lineWidth = 1;
  11120. context.strokeStyle = OUTLINE_COLOR;
  11121. context.strokeRect(left + 1, top + 1, width - 1, height - 1);
  11122. context.strokeStyle = color;
  11123. context.setLineDash([0]); // border
  11124. context.lineWidth = 1;
  11125. context.strokeRect(left, top, width - 1, height - 1);
  11126. context.setLineDash([0]);
  11127. }
  11128. function destroy(agent) {
  11129. if (window.document == null) {
  11130. agent.emit('disableTraceUpdates');
  11131. return;
  11132. }
  11133. if (canvas !== null) {
  11134. if (canvas.parentNode != null) {
  11135. canvas.parentNode.removeChild(canvas);
  11136. }
  11137. canvas = null;
  11138. }
  11139. }
  11140. function initialize() {
  11141. canvas = window.document.createElement('canvas');
  11142. canvas.style.cssText = "\n xx-background-color: red;\n xx-opacity: 0.5;\n bottom: 0;\n left: 0;\n pointer-events: none;\n position: fixed;\n right: 0;\n top: 0;\n z-index: 1000000000;\n ";
  11143. var root = window.document.documentElement;
  11144. root.insertBefore(canvas, root.firstChild);
  11145. }
  11146. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/TraceUpdates/index.js
  11147. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  11148. /**
  11149. * Copyright (c) Meta Platforms, Inc. and affiliates.
  11150. *
  11151. * This source code is licensed under the MIT license found in the
  11152. * LICENSE file in the root directory of this source tree.
  11153. *
  11154. *
  11155. */
  11156. // How long the rect should be shown for?
  11157. var DISPLAY_DURATION = 250; // What's the longest we are willing to show the overlay for?
  11158. // This can be important if we're getting a flurry of events (e.g. scroll update).
  11159. var MAX_DISPLAY_DURATION = 3000; // How long should a rect be considered valid for?
  11160. var REMEASUREMENT_AFTER_DURATION = 250; // Some environments (e.g. React Native / Hermes) don't support the performance API yet.
  11161. var getCurrentTime = // $FlowFixMe[method-unbinding]
  11162. (typeof performance === "undefined" ? "undefined" : _typeof(performance)) === 'object' && typeof performance.now === 'function' ? function () {
  11163. return performance.now();
  11164. } : function () {
  11165. return Date.now();
  11166. };
  11167. var nodeToData = new Map();
  11168. var TraceUpdates_agent = null;
  11169. var drawAnimationFrameID = null;
  11170. var isEnabled = false;
  11171. var redrawTimeoutID = null;
  11172. function TraceUpdates_initialize(injectedAgent) {
  11173. TraceUpdates_agent = injectedAgent;
  11174. TraceUpdates_agent.addListener('traceUpdates', traceUpdates);
  11175. }
  11176. function toggleEnabled(value) {
  11177. isEnabled = value;
  11178. if (!isEnabled) {
  11179. nodeToData.clear();
  11180. if (drawAnimationFrameID !== null) {
  11181. cancelAnimationFrame(drawAnimationFrameID);
  11182. drawAnimationFrameID = null;
  11183. }
  11184. if (redrawTimeoutID !== null) {
  11185. clearTimeout(redrawTimeoutID);
  11186. redrawTimeoutID = null;
  11187. }
  11188. destroy(TraceUpdates_agent);
  11189. }
  11190. }
  11191. function traceUpdates(nodes) {
  11192. if (!isEnabled) {
  11193. return;
  11194. }
  11195. nodes.forEach(function (node) {
  11196. var data = nodeToData.get(node);
  11197. var now = getCurrentTime();
  11198. var lastMeasuredAt = data != null ? data.lastMeasuredAt : 0;
  11199. var rect = data != null ? data.rect : null;
  11200. if (rect === null || lastMeasuredAt + REMEASUREMENT_AFTER_DURATION < now) {
  11201. lastMeasuredAt = now;
  11202. rect = measureNode(node);
  11203. }
  11204. nodeToData.set(node, {
  11205. count: data != null ? data.count + 1 : 1,
  11206. expirationTime: data != null ? Math.min(now + MAX_DISPLAY_DURATION, data.expirationTime + DISPLAY_DURATION) : now + DISPLAY_DURATION,
  11207. lastMeasuredAt: lastMeasuredAt,
  11208. rect: rect
  11209. });
  11210. });
  11211. if (redrawTimeoutID !== null) {
  11212. clearTimeout(redrawTimeoutID);
  11213. redrawTimeoutID = null;
  11214. }
  11215. if (drawAnimationFrameID === null) {
  11216. drawAnimationFrameID = requestAnimationFrame(prepareToDraw);
  11217. }
  11218. }
  11219. function prepareToDraw() {
  11220. drawAnimationFrameID = null;
  11221. redrawTimeoutID = null;
  11222. var now = getCurrentTime();
  11223. var earliestExpiration = Number.MAX_VALUE; // Remove any items that have already expired.
  11224. nodeToData.forEach(function (data, node) {
  11225. if (data.expirationTime < now) {
  11226. nodeToData.delete(node);
  11227. } else {
  11228. earliestExpiration = Math.min(earliestExpiration, data.expirationTime);
  11229. }
  11230. });
  11231. draw(nodeToData, TraceUpdates_agent);
  11232. if (earliestExpiration !== Number.MAX_VALUE) {
  11233. redrawTimeoutID = setTimeout(prepareToDraw, earliestExpiration - now);
  11234. }
  11235. }
  11236. function measureNode(node) {
  11237. if (!node || typeof node.getBoundingClientRect !== 'function') {
  11238. return null;
  11239. }
  11240. var currentWindow = window.__REACT_DEVTOOLS_TARGET_WINDOW__ || window;
  11241. return getNestedBoundingClientRect(node, currentWindow);
  11242. }
  11243. // EXTERNAL MODULE: ../react-devtools-shared/src/backend/console.js
  11244. var backend_console = __webpack_require__(8);
  11245. // CONCATENATED MODULE: ../react-devtools-shared/src/bridge.js
  11246. function bridge_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { bridge_typeof = function _typeof(obj) { return typeof obj; }; } else { bridge_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return bridge_typeof(obj); }
  11247. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  11248. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  11249. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  11250. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
  11251. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
  11252. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  11253. function bridge_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11254. function bridge_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); } }
  11255. function bridge_createClass(Constructor, protoProps, staticProps) { if (protoProps) bridge_defineProperties(Constructor.prototype, protoProps); if (staticProps) bridge_defineProperties(Constructor, staticProps); return Constructor; }
  11256. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  11257. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  11258. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  11259. function _possibleConstructorReturn(self, call) { if (call && (bridge_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  11260. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11261. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  11262. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  11263. function bridge_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  11264. /**
  11265. * Copyright (c) Meta Platforms, Inc. and affiliates.
  11266. *
  11267. * This source code is licensed under the MIT license found in the
  11268. * LICENSE file in the root directory of this source tree.
  11269. *
  11270. *
  11271. */
  11272. var BATCH_DURATION = 100; // This message specifies the version of the DevTools protocol currently supported by the backend,
  11273. // as well as the earliest NPM version (e.g. "4.13.0") that protocol is supported by on the frontend.
  11274. // This enables an older frontend to display an upgrade message to users for a newer, unsupported backend.
  11275. // Bump protocol version whenever a backwards breaking change is made
  11276. // in the messages sent between BackendBridge and FrontendBridge.
  11277. // This mapping is embedded in both frontend and backend builds.
  11278. //
  11279. // The backend protocol will always be the latest entry in the BRIDGE_PROTOCOL array.
  11280. //
  11281. // When an older frontend connects to a newer backend,
  11282. // the backend can send the minNpmVersion and the frontend can display an NPM upgrade prompt.
  11283. //
  11284. // When a newer frontend connects with an older protocol version,
  11285. // the frontend can use the embedded minNpmVersion/maxNpmVersion values to display a downgrade prompt.
  11286. var BRIDGE_PROTOCOL = [// This version technically never existed,
  11287. // but a backwards breaking change was added in 4.11,
  11288. // so the safest guess to downgrade the frontend would be to version 4.10.
  11289. {
  11290. version: 0,
  11291. minNpmVersion: '"<4.11.0"',
  11292. maxNpmVersion: '"<4.11.0"'
  11293. }, // Versions 4.11.x – 4.12.x contained the backwards breaking change,
  11294. // but we didn't add the "fix" of checking the protocol version until 4.13,
  11295. // so we don't recommend downgrading to 4.11 or 4.12.
  11296. {
  11297. version: 1,
  11298. minNpmVersion: '4.13.0',
  11299. maxNpmVersion: '4.21.0'
  11300. }, // Version 2 adds a StrictMode-enabled and supports-StrictMode bits to add-root operation.
  11301. {
  11302. version: 2,
  11303. minNpmVersion: '4.22.0',
  11304. maxNpmVersion: null
  11305. }];
  11306. var currentBridgeProtocol = BRIDGE_PROTOCOL[BRIDGE_PROTOCOL.length - 1];
  11307. var Bridge = /*#__PURE__*/function (_EventEmitter) {
  11308. _inherits(Bridge, _EventEmitter);
  11309. var _super = _createSuper(Bridge);
  11310. function Bridge(wall) {
  11311. var _this;
  11312. bridge_classCallCheck(this, Bridge);
  11313. _this = _super.call(this);
  11314. bridge_defineProperty(_assertThisInitialized(_this), "_isShutdown", false);
  11315. bridge_defineProperty(_assertThisInitialized(_this), "_messageQueue", []);
  11316. bridge_defineProperty(_assertThisInitialized(_this), "_timeoutID", null);
  11317. bridge_defineProperty(_assertThisInitialized(_this), "_wallUnlisten", null);
  11318. bridge_defineProperty(_assertThisInitialized(_this), "_flush", function () {
  11319. // This method is used after the bridge is marked as destroyed in shutdown sequence,
  11320. // so we do not bail out if the bridge marked as destroyed.
  11321. // It is a private method that the bridge ensures is only called at the right times.
  11322. if (_this._timeoutID !== null) {
  11323. clearTimeout(_this._timeoutID);
  11324. _this._timeoutID = null;
  11325. }
  11326. if (_this._messageQueue.length) {
  11327. for (var i = 0; i < _this._messageQueue.length; i += 2) {
  11328. var _this$_wall;
  11329. (_this$_wall = _this._wall).send.apply(_this$_wall, [_this._messageQueue[i]].concat(_toConsumableArray(_this._messageQueue[i + 1])));
  11330. }
  11331. _this._messageQueue.length = 0; // Check again for queued messages in BATCH_DURATION ms. This will keep
  11332. // flushing in a loop as long as messages continue to be added. Once no
  11333. // more are, the timer expires.
  11334. _this._timeoutID = setTimeout(_this._flush, BATCH_DURATION);
  11335. }
  11336. });
  11337. bridge_defineProperty(_assertThisInitialized(_this), "overrideValueAtPath", function (_ref) {
  11338. var id = _ref.id,
  11339. path = _ref.path,
  11340. rendererID = _ref.rendererID,
  11341. type = _ref.type,
  11342. value = _ref.value;
  11343. switch (type) {
  11344. case 'context':
  11345. _this.send('overrideContext', {
  11346. id: id,
  11347. path: path,
  11348. rendererID: rendererID,
  11349. wasForwarded: true,
  11350. value: value
  11351. });
  11352. break;
  11353. case 'hooks':
  11354. _this.send('overrideHookState', {
  11355. id: id,
  11356. path: path,
  11357. rendererID: rendererID,
  11358. wasForwarded: true,
  11359. value: value
  11360. });
  11361. break;
  11362. case 'props':
  11363. _this.send('overrideProps', {
  11364. id: id,
  11365. path: path,
  11366. rendererID: rendererID,
  11367. wasForwarded: true,
  11368. value: value
  11369. });
  11370. break;
  11371. case 'state':
  11372. _this.send('overrideState', {
  11373. id: id,
  11374. path: path,
  11375. rendererID: rendererID,
  11376. wasForwarded: true,
  11377. value: value
  11378. });
  11379. break;
  11380. }
  11381. });
  11382. _this._wall = wall;
  11383. _this._wallUnlisten = wall.listen(function (message) {
  11384. if (message && message.event) {
  11385. _assertThisInitialized(_this).emit(message.event, message.payload);
  11386. }
  11387. }) || null; // Temporarily support older standalone front-ends sending commands to newer embedded backends.
  11388. // We do this because React Native embeds the React DevTools backend,
  11389. // but cannot control which version of the frontend users use.
  11390. _this.addListener('overrideValueAtPath', _this.overrideValueAtPath);
  11391. return _this;
  11392. } // Listening directly to the wall isn't advised.
  11393. // It can be used to listen for legacy (v3) messages (since they use a different format).
  11394. bridge_createClass(Bridge, [{
  11395. key: "send",
  11396. value: function send(event) {
  11397. if (this._isShutdown) {
  11398. console.warn("Cannot send message \"".concat(event, "\" through a Bridge that has been shutdown."));
  11399. return;
  11400. } // When we receive a message:
  11401. // - we add it to our queue of messages to be sent
  11402. // - if there hasn't been a message recently, we set a timer for 0 ms in
  11403. // the future, allowing all messages created in the same tick to be sent
  11404. // together
  11405. // - if there *has* been a message flushed in the last BATCH_DURATION ms
  11406. // (or we're waiting for our setTimeout-0 to fire), then _timeoutID will
  11407. // be set, and we'll simply add to the queue and wait for that
  11408. for (var _len = arguments.length, payload = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  11409. payload[_key - 1] = arguments[_key];
  11410. }
  11411. this._messageQueue.push(event, payload);
  11412. if (!this._timeoutID) {
  11413. this._timeoutID = setTimeout(this._flush, 0);
  11414. }
  11415. }
  11416. }, {
  11417. key: "shutdown",
  11418. value: function shutdown() {
  11419. if (this._isShutdown) {
  11420. console.warn('Bridge was already shutdown.');
  11421. return;
  11422. } // Queue the shutdown outgoing message for subscribers.
  11423. this.send('shutdown'); // Mark this bridge as destroyed, i.e. disable its public API.
  11424. this._isShutdown = true; // Disable the API inherited from EventEmitter that can add more listeners and send more messages.
  11425. // $FlowFixMe This property is not writable.
  11426. this.addListener = function () {}; // $FlowFixMe This property is not writable.
  11427. this.emit = function () {}; // NOTE: There's also EventEmitter API like `on` and `prependListener` that we didn't add to our Flow type of EventEmitter.
  11428. // Unsubscribe this bridge incoming message listeners to be sure, and so they don't have to do that.
  11429. this.removeAllListeners(); // Stop accepting and emitting incoming messages from the wall.
  11430. var wallUnlisten = this._wallUnlisten;
  11431. if (wallUnlisten) {
  11432. wallUnlisten();
  11433. } // Synchronously flush all queued outgoing messages.
  11434. // At this step the subscribers' code may run in this call stack.
  11435. do {
  11436. this._flush();
  11437. } while (this._messageQueue.length); // Make sure once again that there is no dangling timer.
  11438. if (this._timeoutID !== null) {
  11439. clearTimeout(this._timeoutID);
  11440. this._timeoutID = null;
  11441. }
  11442. }
  11443. }, {
  11444. key: "wall",
  11445. get: function get() {
  11446. return this._wall;
  11447. }
  11448. }]);
  11449. return Bridge;
  11450. }(EventEmitter);
  11451. /* harmony default export */ var src_bridge = (Bridge);
  11452. // EXTERNAL MODULE: ../react-devtools-shared/src/backend/utils.js + 1 modules
  11453. var utils = __webpack_require__(4);
  11454. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/agent.js
  11455. function agent_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { agent_typeof = function _typeof(obj) { return typeof obj; }; } else { agent_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return agent_typeof(obj); }
  11456. function agent_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11457. function agent_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); } }
  11458. function agent_createClass(Constructor, protoProps, staticProps) { if (protoProps) agent_defineProperties(Constructor.prototype, protoProps); if (staticProps) agent_defineProperties(Constructor, staticProps); return Constructor; }
  11459. function agent_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) agent_setPrototypeOf(subClass, superClass); }
  11460. function agent_setPrototypeOf(o, p) { agent_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return agent_setPrototypeOf(o, p); }
  11461. function agent_createSuper(Derived) { var hasNativeReflectConstruct = agent_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = agent_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = agent_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return agent_possibleConstructorReturn(this, result); }; }
  11462. function agent_possibleConstructorReturn(self, call) { if (call && (agent_typeof(call) === "object" || typeof call === "function")) { return call; } return agent_assertThisInitialized(self); }
  11463. function agent_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11464. function agent_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  11465. function agent_getPrototypeOf(o) { agent_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return agent_getPrototypeOf(o); }
  11466. function agent_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  11467. /**
  11468. * Copyright (c) Meta Platforms, Inc. and affiliates.
  11469. *
  11470. * This source code is licensed under the MIT license found in the
  11471. * LICENSE file in the root directory of this source tree.
  11472. *
  11473. *
  11474. */
  11475. var agent_debug = function debug(methodName) {
  11476. if (constants["s" /* __DEBUG__ */]) {
  11477. var _console;
  11478. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  11479. args[_key - 1] = arguments[_key];
  11480. }
  11481. (_console = console).log.apply(_console, ["%cAgent %c".concat(methodName), 'color: purple; font-weight: bold;', 'font-weight: bold;'].concat(args));
  11482. }
  11483. };
  11484. var agent_Agent = /*#__PURE__*/function (_EventEmitter) {
  11485. agent_inherits(Agent, _EventEmitter);
  11486. var _super = agent_createSuper(Agent);
  11487. function Agent(bridge) {
  11488. var _this;
  11489. agent_classCallCheck(this, Agent);
  11490. _this = _super.call(this);
  11491. agent_defineProperty(agent_assertThisInitialized(_this), "_isProfiling", false);
  11492. agent_defineProperty(agent_assertThisInitialized(_this), "_recordChangeDescriptions", false);
  11493. agent_defineProperty(agent_assertThisInitialized(_this), "_rendererInterfaces", {});
  11494. agent_defineProperty(agent_assertThisInitialized(_this), "_persistedSelection", null);
  11495. agent_defineProperty(agent_assertThisInitialized(_this), "_persistedSelectionMatch", null);
  11496. agent_defineProperty(agent_assertThisInitialized(_this), "_traceUpdatesEnabled", false);
  11497. agent_defineProperty(agent_assertThisInitialized(_this), "clearErrorsAndWarnings", function (_ref) {
  11498. var rendererID = _ref.rendererID;
  11499. var renderer = _this._rendererInterfaces[rendererID];
  11500. if (renderer == null) {
  11501. console.warn("Invalid renderer id \"".concat(rendererID, "\""));
  11502. } else {
  11503. renderer.clearErrorsAndWarnings();
  11504. }
  11505. });
  11506. agent_defineProperty(agent_assertThisInitialized(_this), "clearErrorsForFiberID", function (_ref2) {
  11507. var id = _ref2.id,
  11508. rendererID = _ref2.rendererID;
  11509. var renderer = _this._rendererInterfaces[rendererID];
  11510. if (renderer == null) {
  11511. console.warn("Invalid renderer id \"".concat(rendererID, "\""));
  11512. } else {
  11513. renderer.clearErrorsForFiberID(id);
  11514. }
  11515. });
  11516. agent_defineProperty(agent_assertThisInitialized(_this), "clearWarningsForFiberID", function (_ref3) {
  11517. var id = _ref3.id,
  11518. rendererID = _ref3.rendererID;
  11519. var renderer = _this._rendererInterfaces[rendererID];
  11520. if (renderer == null) {
  11521. console.warn("Invalid renderer id \"".concat(rendererID, "\""));
  11522. } else {
  11523. renderer.clearWarningsForFiberID(id);
  11524. }
  11525. });
  11526. agent_defineProperty(agent_assertThisInitialized(_this), "copyElementPath", function (_ref4) {
  11527. var id = _ref4.id,
  11528. path = _ref4.path,
  11529. rendererID = _ref4.rendererID;
  11530. var renderer = _this._rendererInterfaces[rendererID];
  11531. if (renderer == null) {
  11532. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11533. } else {
  11534. renderer.copyElementPath(id, path);
  11535. }
  11536. });
  11537. agent_defineProperty(agent_assertThisInitialized(_this), "deletePath", function (_ref5) {
  11538. var hookID = _ref5.hookID,
  11539. id = _ref5.id,
  11540. path = _ref5.path,
  11541. rendererID = _ref5.rendererID,
  11542. type = _ref5.type;
  11543. var renderer = _this._rendererInterfaces[rendererID];
  11544. if (renderer == null) {
  11545. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11546. } else {
  11547. renderer.deletePath(type, id, hookID, path);
  11548. }
  11549. });
  11550. agent_defineProperty(agent_assertThisInitialized(_this), "getBackendVersion", function () {
  11551. var version = "4.27.2-7f747b80e";
  11552. if (version) {
  11553. _this._bridge.send('backendVersion', version);
  11554. }
  11555. });
  11556. agent_defineProperty(agent_assertThisInitialized(_this), "getBridgeProtocol", function () {
  11557. _this._bridge.send('bridgeProtocol', currentBridgeProtocol);
  11558. });
  11559. agent_defineProperty(agent_assertThisInitialized(_this), "getProfilingData", function (_ref6) {
  11560. var rendererID = _ref6.rendererID;
  11561. var renderer = _this._rendererInterfaces[rendererID];
  11562. if (renderer == null) {
  11563. console.warn("Invalid renderer id \"".concat(rendererID, "\""));
  11564. }
  11565. _this._bridge.send('profilingData', renderer.getProfilingData());
  11566. });
  11567. agent_defineProperty(agent_assertThisInitialized(_this), "getProfilingStatus", function () {
  11568. _this._bridge.send('profilingStatus', _this._isProfiling);
  11569. });
  11570. agent_defineProperty(agent_assertThisInitialized(_this), "getOwnersList", function (_ref7) {
  11571. var id = _ref7.id,
  11572. rendererID = _ref7.rendererID;
  11573. var renderer = _this._rendererInterfaces[rendererID];
  11574. if (renderer == null) {
  11575. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11576. } else {
  11577. var owners = renderer.getOwnersList(id);
  11578. _this._bridge.send('ownersList', {
  11579. id: id,
  11580. owners: owners
  11581. });
  11582. }
  11583. });
  11584. agent_defineProperty(agent_assertThisInitialized(_this), "inspectElement", function (_ref8) {
  11585. var forceFullData = _ref8.forceFullData,
  11586. id = _ref8.id,
  11587. path = _ref8.path,
  11588. rendererID = _ref8.rendererID,
  11589. requestID = _ref8.requestID;
  11590. var renderer = _this._rendererInterfaces[rendererID];
  11591. if (renderer == null) {
  11592. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11593. } else {
  11594. _this._bridge.send('inspectedElement', renderer.inspectElement(requestID, id, path, forceFullData)); // When user selects an element, stop trying to restore the selection,
  11595. // and instead remember the current selection for the next reload.
  11596. if (_this._persistedSelectionMatch === null || _this._persistedSelectionMatch.id !== id) {
  11597. _this._persistedSelection = null;
  11598. _this._persistedSelectionMatch = null;
  11599. renderer.setTrackedPath(null);
  11600. _this._throttledPersistSelection(rendererID, id);
  11601. } // TODO: If there was a way to change the selected DOM element
  11602. // in native Elements tab without forcing a switch to it, we'd do it here.
  11603. // For now, it doesn't seem like there is a way to do that:
  11604. // https://github.com/bvaughn/react-devtools-experimental/issues/102
  11605. // (Setting $0 doesn't work, and calling inspect() switches the tab.)
  11606. }
  11607. });
  11608. agent_defineProperty(agent_assertThisInitialized(_this), "logElementToConsole", function (_ref9) {
  11609. var id = _ref9.id,
  11610. rendererID = _ref9.rendererID;
  11611. var renderer = _this._rendererInterfaces[rendererID];
  11612. if (renderer == null) {
  11613. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11614. } else {
  11615. renderer.logElementToConsole(id);
  11616. }
  11617. });
  11618. agent_defineProperty(agent_assertThisInitialized(_this), "overrideError", function (_ref10) {
  11619. var id = _ref10.id,
  11620. rendererID = _ref10.rendererID,
  11621. forceError = _ref10.forceError;
  11622. var renderer = _this._rendererInterfaces[rendererID];
  11623. if (renderer == null) {
  11624. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11625. } else {
  11626. renderer.overrideError(id, forceError);
  11627. }
  11628. });
  11629. agent_defineProperty(agent_assertThisInitialized(_this), "overrideSuspense", function (_ref11) {
  11630. var id = _ref11.id,
  11631. rendererID = _ref11.rendererID,
  11632. forceFallback = _ref11.forceFallback;
  11633. var renderer = _this._rendererInterfaces[rendererID];
  11634. if (renderer == null) {
  11635. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11636. } else {
  11637. renderer.overrideSuspense(id, forceFallback);
  11638. }
  11639. });
  11640. agent_defineProperty(agent_assertThisInitialized(_this), "overrideValueAtPath", function (_ref12) {
  11641. var hookID = _ref12.hookID,
  11642. id = _ref12.id,
  11643. path = _ref12.path,
  11644. rendererID = _ref12.rendererID,
  11645. type = _ref12.type,
  11646. value = _ref12.value;
  11647. var renderer = _this._rendererInterfaces[rendererID];
  11648. if (renderer == null) {
  11649. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11650. } else {
  11651. renderer.overrideValueAtPath(type, id, hookID, path, value);
  11652. }
  11653. });
  11654. agent_defineProperty(agent_assertThisInitialized(_this), "overrideContext", function (_ref13) {
  11655. var id = _ref13.id,
  11656. path = _ref13.path,
  11657. rendererID = _ref13.rendererID,
  11658. wasForwarded = _ref13.wasForwarded,
  11659. value = _ref13.value;
  11660. // Don't forward a message that's already been forwarded by the front-end Bridge.
  11661. // We only need to process the override command once!
  11662. if (!wasForwarded) {
  11663. _this.overrideValueAtPath({
  11664. id: id,
  11665. path: path,
  11666. rendererID: rendererID,
  11667. type: 'context',
  11668. value: value
  11669. });
  11670. }
  11671. });
  11672. agent_defineProperty(agent_assertThisInitialized(_this), "overrideHookState", function (_ref14) {
  11673. var id = _ref14.id,
  11674. hookID = _ref14.hookID,
  11675. path = _ref14.path,
  11676. rendererID = _ref14.rendererID,
  11677. wasForwarded = _ref14.wasForwarded,
  11678. value = _ref14.value;
  11679. // Don't forward a message that's already been forwarded by the front-end Bridge.
  11680. // We only need to process the override command once!
  11681. if (!wasForwarded) {
  11682. _this.overrideValueAtPath({
  11683. id: id,
  11684. path: path,
  11685. rendererID: rendererID,
  11686. type: 'hooks',
  11687. value: value
  11688. });
  11689. }
  11690. });
  11691. agent_defineProperty(agent_assertThisInitialized(_this), "overrideProps", function (_ref15) {
  11692. var id = _ref15.id,
  11693. path = _ref15.path,
  11694. rendererID = _ref15.rendererID,
  11695. wasForwarded = _ref15.wasForwarded,
  11696. value = _ref15.value;
  11697. // Don't forward a message that's already been forwarded by the front-end Bridge.
  11698. // We only need to process the override command once!
  11699. if (!wasForwarded) {
  11700. _this.overrideValueAtPath({
  11701. id: id,
  11702. path: path,
  11703. rendererID: rendererID,
  11704. type: 'props',
  11705. value: value
  11706. });
  11707. }
  11708. });
  11709. agent_defineProperty(agent_assertThisInitialized(_this), "overrideState", function (_ref16) {
  11710. var id = _ref16.id,
  11711. path = _ref16.path,
  11712. rendererID = _ref16.rendererID,
  11713. wasForwarded = _ref16.wasForwarded,
  11714. value = _ref16.value;
  11715. // Don't forward a message that's already been forwarded by the front-end Bridge.
  11716. // We only need to process the override command once!
  11717. if (!wasForwarded) {
  11718. _this.overrideValueAtPath({
  11719. id: id,
  11720. path: path,
  11721. rendererID: rendererID,
  11722. type: 'state',
  11723. value: value
  11724. });
  11725. }
  11726. });
  11727. agent_defineProperty(agent_assertThisInitialized(_this), "reloadAndProfile", function (recordChangeDescriptions) {
  11728. Object(storage["e" /* sessionStorageSetItem */])(constants["k" /* SESSION_STORAGE_RELOAD_AND_PROFILE_KEY */], 'true');
  11729. Object(storage["e" /* sessionStorageSetItem */])(constants["j" /* SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY */], recordChangeDescriptions ? 'true' : 'false'); // This code path should only be hit if the shell has explicitly told the Store that it supports profiling.
  11730. // In that case, the shell must also listen for this specific message to know when it needs to reload the app.
  11731. // The agent can't do this in a way that is renderer agnostic.
  11732. _this._bridge.send('reloadAppForProfiling');
  11733. });
  11734. agent_defineProperty(agent_assertThisInitialized(_this), "renamePath", function (_ref17) {
  11735. var hookID = _ref17.hookID,
  11736. id = _ref17.id,
  11737. newPath = _ref17.newPath,
  11738. oldPath = _ref17.oldPath,
  11739. rendererID = _ref17.rendererID,
  11740. type = _ref17.type;
  11741. var renderer = _this._rendererInterfaces[rendererID];
  11742. if (renderer == null) {
  11743. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11744. } else {
  11745. renderer.renamePath(type, id, hookID, oldPath, newPath);
  11746. }
  11747. });
  11748. agent_defineProperty(agent_assertThisInitialized(_this), "setTraceUpdatesEnabled", function (traceUpdatesEnabled) {
  11749. _this._traceUpdatesEnabled = traceUpdatesEnabled;
  11750. toggleEnabled(traceUpdatesEnabled);
  11751. for (var rendererID in _this._rendererInterfaces) {
  11752. var renderer = _this._rendererInterfaces[rendererID];
  11753. renderer.setTraceUpdatesEnabled(traceUpdatesEnabled);
  11754. }
  11755. });
  11756. agent_defineProperty(agent_assertThisInitialized(_this), "syncSelectionFromNativeElementsPanel", function () {
  11757. var target = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0;
  11758. if (target == null) {
  11759. return;
  11760. }
  11761. _this.selectNode(target);
  11762. });
  11763. agent_defineProperty(agent_assertThisInitialized(_this), "shutdown", function () {
  11764. // Clean up the overlay if visible, and associated events.
  11765. _this.emit('shutdown');
  11766. });
  11767. agent_defineProperty(agent_assertThisInitialized(_this), "startProfiling", function (recordChangeDescriptions) {
  11768. _this._recordChangeDescriptions = recordChangeDescriptions;
  11769. _this._isProfiling = true;
  11770. for (var rendererID in _this._rendererInterfaces) {
  11771. var renderer = _this._rendererInterfaces[rendererID];
  11772. renderer.startProfiling(recordChangeDescriptions);
  11773. }
  11774. _this._bridge.send('profilingStatus', _this._isProfiling);
  11775. });
  11776. agent_defineProperty(agent_assertThisInitialized(_this), "stopProfiling", function () {
  11777. _this._isProfiling = false;
  11778. _this._recordChangeDescriptions = false;
  11779. for (var rendererID in _this._rendererInterfaces) {
  11780. var renderer = _this._rendererInterfaces[rendererID];
  11781. renderer.stopProfiling();
  11782. }
  11783. _this._bridge.send('profilingStatus', _this._isProfiling);
  11784. });
  11785. agent_defineProperty(agent_assertThisInitialized(_this), "stopInspectingNative", function (selected) {
  11786. _this._bridge.send('stopInspectingNative', selected);
  11787. });
  11788. agent_defineProperty(agent_assertThisInitialized(_this), "storeAsGlobal", function (_ref18) {
  11789. var count = _ref18.count,
  11790. id = _ref18.id,
  11791. path = _ref18.path,
  11792. rendererID = _ref18.rendererID;
  11793. var renderer = _this._rendererInterfaces[rendererID];
  11794. if (renderer == null) {
  11795. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11796. } else {
  11797. renderer.storeAsGlobal(id, path, count);
  11798. }
  11799. });
  11800. agent_defineProperty(agent_assertThisInitialized(_this), "updateConsolePatchSettings", function (_ref19) {
  11801. var appendComponentStack = _ref19.appendComponentStack,
  11802. breakOnConsoleErrors = _ref19.breakOnConsoleErrors,
  11803. showInlineWarningsAndErrors = _ref19.showInlineWarningsAndErrors,
  11804. hideConsoleLogsInStrictMode = _ref19.hideConsoleLogsInStrictMode,
  11805. browserTheme = _ref19.browserTheme;
  11806. // If the frontend preferences have changed,
  11807. // or in the case of React Native- if the backend is just finding out the preferences-
  11808. // then reinstall the console overrides.
  11809. // It's safe to call `patchConsole` multiple times.
  11810. Object(backend_console["a" /* patch */])({
  11811. appendComponentStack: appendComponentStack,
  11812. breakOnConsoleErrors: breakOnConsoleErrors,
  11813. showInlineWarningsAndErrors: showInlineWarningsAndErrors,
  11814. hideConsoleLogsInStrictMode: hideConsoleLogsInStrictMode,
  11815. browserTheme: browserTheme
  11816. });
  11817. });
  11818. agent_defineProperty(agent_assertThisInitialized(_this), "updateComponentFilters", function (componentFilters) {
  11819. for (var rendererID in _this._rendererInterfaces) {
  11820. var renderer = _this._rendererInterfaces[rendererID];
  11821. renderer.updateComponentFilters(componentFilters);
  11822. }
  11823. });
  11824. agent_defineProperty(agent_assertThisInitialized(_this), "viewAttributeSource", function (_ref20) {
  11825. var id = _ref20.id,
  11826. path = _ref20.path,
  11827. rendererID = _ref20.rendererID;
  11828. var renderer = _this._rendererInterfaces[rendererID];
  11829. if (renderer == null) {
  11830. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11831. } else {
  11832. renderer.prepareViewAttributeSource(id, path);
  11833. }
  11834. });
  11835. agent_defineProperty(agent_assertThisInitialized(_this), "viewElementSource", function (_ref21) {
  11836. var id = _ref21.id,
  11837. rendererID = _ref21.rendererID;
  11838. var renderer = _this._rendererInterfaces[rendererID];
  11839. if (renderer == null) {
  11840. console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\""));
  11841. } else {
  11842. renderer.prepareViewElementSource(id);
  11843. }
  11844. });
  11845. agent_defineProperty(agent_assertThisInitialized(_this), "onTraceUpdates", function (nodes) {
  11846. _this.emit('traceUpdates', nodes);
  11847. });
  11848. agent_defineProperty(agent_assertThisInitialized(_this), "onFastRefreshScheduled", function () {
  11849. if (constants["s" /* __DEBUG__ */]) {
  11850. agent_debug('onFastRefreshScheduled');
  11851. }
  11852. _this._bridge.send('fastRefreshScheduled');
  11853. });
  11854. agent_defineProperty(agent_assertThisInitialized(_this), "onHookOperations", function (operations) {
  11855. if (constants["s" /* __DEBUG__ */]) {
  11856. agent_debug('onHookOperations', "(".concat(operations.length, ") [").concat(operations.join(', '), "]"));
  11857. } // TODO:
  11858. // The chrome.runtime does not currently support transferables; it forces JSON serialization.
  11859. // See bug https://bugs.chromium.org/p/chromium/issues/detail?id=927134
  11860. //
  11861. // Regarding transferables, the postMessage doc states:
  11862. // If the ownership of an object is transferred, it becomes unusable (neutered)
  11863. // in the context it was sent from and becomes available only to the worker it was sent to.
  11864. //
  11865. // Even though Chrome is eventually JSON serializing the array buffer,
  11866. // using the transferable approach also sometimes causes it to throw:
  11867. // DOMException: Failed to execute 'postMessage' on 'Window': ArrayBuffer at index 0 is already neutered.
  11868. //
  11869. // See bug https://github.com/bvaughn/react-devtools-experimental/issues/25
  11870. //
  11871. // The Store has a fallback in place that parses the message as JSON if the type isn't an array.
  11872. // For now the simplest fix seems to be to not transfer the array.
  11873. // This will negatively impact performance on Firefox so it's unfortunate,
  11874. // but until we're able to fix the Chrome error mentioned above, it seems necessary.
  11875. //
  11876. // this._bridge.send('operations', operations, [operations.buffer]);
  11877. _this._bridge.send('operations', operations);
  11878. if (_this._persistedSelection !== null) {
  11879. var rendererID = operations[0];
  11880. if (_this._persistedSelection.rendererID === rendererID) {
  11881. // Check if we can select a deeper match for the persisted selection.
  11882. var renderer = _this._rendererInterfaces[rendererID];
  11883. if (renderer == null) {
  11884. console.warn("Invalid renderer id \"".concat(rendererID, "\""));
  11885. } else {
  11886. var prevMatch = _this._persistedSelectionMatch;
  11887. var nextMatch = renderer.getBestMatchForTrackedPath();
  11888. _this._persistedSelectionMatch = nextMatch;
  11889. var prevMatchID = prevMatch !== null ? prevMatch.id : null;
  11890. var nextMatchID = nextMatch !== null ? nextMatch.id : null;
  11891. if (prevMatchID !== nextMatchID) {
  11892. if (nextMatchID !== null) {
  11893. // We moved forward, unlocking a deeper node.
  11894. _this._bridge.send('selectFiber', nextMatchID);
  11895. }
  11896. }
  11897. if (nextMatch !== null && nextMatch.isFullMatch) {
  11898. // We've just unlocked the innermost selected node.
  11899. // There's no point tracking it further.
  11900. _this._persistedSelection = null;
  11901. _this._persistedSelectionMatch = null;
  11902. renderer.setTrackedPath(null);
  11903. }
  11904. }
  11905. }
  11906. }
  11907. });
  11908. agent_defineProperty(agent_assertThisInitialized(_this), "_throttledPersistSelection", lodash_throttle_default()(function (rendererID, id) {
  11909. // This is throttled, so both renderer and selected ID
  11910. // might not be available by the time we read them.
  11911. // This is why we need the defensive checks here.
  11912. var renderer = _this._rendererInterfaces[rendererID];
  11913. var path = renderer != null ? renderer.getPathForElement(id) : null;
  11914. if (path !== null) {
  11915. Object(storage["e" /* sessionStorageSetItem */])(constants["i" /* SESSION_STORAGE_LAST_SELECTION_KEY */], JSON.stringify({
  11916. rendererID: rendererID,
  11917. path: path
  11918. }));
  11919. } else {
  11920. Object(storage["d" /* sessionStorageRemoveItem */])(constants["i" /* SESSION_STORAGE_LAST_SELECTION_KEY */]);
  11921. }
  11922. }, 1000));
  11923. if (Object(storage["c" /* sessionStorageGetItem */])(constants["k" /* SESSION_STORAGE_RELOAD_AND_PROFILE_KEY */]) === 'true') {
  11924. _this._recordChangeDescriptions = Object(storage["c" /* sessionStorageGetItem */])(constants["j" /* SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY */]) === 'true';
  11925. _this._isProfiling = true;
  11926. Object(storage["d" /* sessionStorageRemoveItem */])(constants["j" /* SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY */]);
  11927. Object(storage["d" /* sessionStorageRemoveItem */])(constants["k" /* SESSION_STORAGE_RELOAD_AND_PROFILE_KEY */]);
  11928. }
  11929. var persistedSelectionString = Object(storage["c" /* sessionStorageGetItem */])(constants["i" /* SESSION_STORAGE_LAST_SELECTION_KEY */]);
  11930. if (persistedSelectionString != null) {
  11931. _this._persistedSelection = JSON.parse(persistedSelectionString);
  11932. }
  11933. _this._bridge = bridge;
  11934. bridge.addListener('clearErrorsAndWarnings', _this.clearErrorsAndWarnings);
  11935. bridge.addListener('clearErrorsForFiberID', _this.clearErrorsForFiberID);
  11936. bridge.addListener('clearWarningsForFiberID', _this.clearWarningsForFiberID);
  11937. bridge.addListener('copyElementPath', _this.copyElementPath);
  11938. bridge.addListener('deletePath', _this.deletePath);
  11939. bridge.addListener('getBackendVersion', _this.getBackendVersion);
  11940. bridge.addListener('getBridgeProtocol', _this.getBridgeProtocol);
  11941. bridge.addListener('getProfilingData', _this.getProfilingData);
  11942. bridge.addListener('getProfilingStatus', _this.getProfilingStatus);
  11943. bridge.addListener('getOwnersList', _this.getOwnersList);
  11944. bridge.addListener('inspectElement', _this.inspectElement);
  11945. bridge.addListener('logElementToConsole', _this.logElementToConsole);
  11946. bridge.addListener('overrideError', _this.overrideError);
  11947. bridge.addListener('overrideSuspense', _this.overrideSuspense);
  11948. bridge.addListener('overrideValueAtPath', _this.overrideValueAtPath);
  11949. bridge.addListener('reloadAndProfile', _this.reloadAndProfile);
  11950. bridge.addListener('renamePath', _this.renamePath);
  11951. bridge.addListener('setTraceUpdatesEnabled', _this.setTraceUpdatesEnabled);
  11952. bridge.addListener('startProfiling', _this.startProfiling);
  11953. bridge.addListener('stopProfiling', _this.stopProfiling);
  11954. bridge.addListener('storeAsGlobal', _this.storeAsGlobal);
  11955. bridge.addListener('syncSelectionFromNativeElementsPanel', _this.syncSelectionFromNativeElementsPanel);
  11956. bridge.addListener('shutdown', _this.shutdown);
  11957. bridge.addListener('updateConsolePatchSettings', _this.updateConsolePatchSettings);
  11958. bridge.addListener('updateComponentFilters', _this.updateComponentFilters);
  11959. bridge.addListener('viewAttributeSource', _this.viewAttributeSource);
  11960. bridge.addListener('viewElementSource', _this.viewElementSource); // Temporarily support older standalone front-ends sending commands to newer embedded backends.
  11961. // We do this because React Native embeds the React DevTools backend,
  11962. // but cannot control which version of the frontend users use.
  11963. bridge.addListener('overrideContext', _this.overrideContext);
  11964. bridge.addListener('overrideHookState', _this.overrideHookState);
  11965. bridge.addListener('overrideProps', _this.overrideProps);
  11966. bridge.addListener('overrideState', _this.overrideState);
  11967. if (_this._isProfiling) {
  11968. bridge.send('profilingStatus', true);
  11969. } // Send the Bridge protocol and backend versions, after initialization, in case the frontend has already requested it.
  11970. // The Store may be instantiated beore the agent.
  11971. var _version = "4.27.2-7f747b80e";
  11972. if (_version) {
  11973. _this._bridge.send('backendVersion', _version);
  11974. }
  11975. _this._bridge.send('bridgeProtocol', currentBridgeProtocol); // Notify the frontend if the backend supports the Storage API (e.g. localStorage).
  11976. // If not, features like reload-and-profile will not work correctly and must be disabled.
  11977. var isBackendStorageAPISupported = false;
  11978. try {
  11979. localStorage.getItem('test');
  11980. isBackendStorageAPISupported = true;
  11981. } catch (error) {}
  11982. bridge.send('isBackendStorageAPISupported', isBackendStorageAPISupported);
  11983. bridge.send('isSynchronousXHRSupported', Object(utils["k" /* isSynchronousXHRSupported */])());
  11984. setupHighlighter(bridge, agent_assertThisInitialized(_this));
  11985. TraceUpdates_initialize(agent_assertThisInitialized(_this));
  11986. return _this;
  11987. }
  11988. agent_createClass(Agent, [{
  11989. key: "getInstanceAndStyle",
  11990. value: function getInstanceAndStyle(_ref22) {
  11991. var id = _ref22.id,
  11992. rendererID = _ref22.rendererID;
  11993. var renderer = this._rendererInterfaces[rendererID];
  11994. if (renderer == null) {
  11995. console.warn("Invalid renderer id \"".concat(rendererID, "\""));
  11996. return null;
  11997. }
  11998. return renderer.getInstanceAndStyle(id);
  11999. }
  12000. }, {
  12001. key: "getBestMatchingRendererInterface",
  12002. value: function getBestMatchingRendererInterface(node) {
  12003. var bestMatch = null;
  12004. for (var rendererID in this._rendererInterfaces) {
  12005. var renderer = this._rendererInterfaces[rendererID];
  12006. var fiber = renderer.getFiberForNative(node);
  12007. if (fiber !== null) {
  12008. // check if fiber.stateNode is matching the original hostInstance
  12009. if (fiber.stateNode === node) {
  12010. return renderer;
  12011. } else if (bestMatch === null) {
  12012. bestMatch = renderer;
  12013. }
  12014. }
  12015. } // if an exact match is not found, return the first valid renderer as fallback
  12016. return bestMatch;
  12017. }
  12018. }, {
  12019. key: "getIDForNode",
  12020. value: function getIDForNode(node) {
  12021. var rendererInterface = this.getBestMatchingRendererInterface(node);
  12022. if (rendererInterface != null) {
  12023. try {
  12024. return rendererInterface.getFiberIDForNative(node, true);
  12025. } catch (error) {// Some old React versions might throw if they can't find a match.
  12026. // If so we should ignore it...
  12027. }
  12028. }
  12029. return null;
  12030. }
  12031. }, {
  12032. key: "selectNode",
  12033. value: function selectNode(target) {
  12034. var id = this.getIDForNode(target);
  12035. if (id !== null) {
  12036. this._bridge.send('selectFiber', id);
  12037. }
  12038. }
  12039. }, {
  12040. key: "setRendererInterface",
  12041. value: function setRendererInterface(rendererID, rendererInterface) {
  12042. this._rendererInterfaces[rendererID] = rendererInterface;
  12043. if (this._isProfiling) {
  12044. rendererInterface.startProfiling(this._recordChangeDescriptions);
  12045. }
  12046. rendererInterface.setTraceUpdatesEnabled(this._traceUpdatesEnabled); // When the renderer is attached, we need to tell it whether
  12047. // we remember the previous selection that we'd like to restore.
  12048. // It'll start tracking mounts for matches to the last selection path.
  12049. var selection = this._persistedSelection;
  12050. if (selection !== null && selection.rendererID === rendererID) {
  12051. rendererInterface.setTrackedPath(selection.path);
  12052. }
  12053. }
  12054. }, {
  12055. key: "onUnsupportedRenderer",
  12056. value: function onUnsupportedRenderer(rendererID) {
  12057. this._bridge.send('unsupportedRendererVersion', rendererID);
  12058. }
  12059. }, {
  12060. key: "rendererInterfaces",
  12061. get: function get() {
  12062. return this._rendererInterfaces;
  12063. }
  12064. }]);
  12065. return Agent;
  12066. }(EventEmitter);
  12067. // CONCATENATED MODULE: ../react-devtools-shared/src/hook.js
  12068. function hook_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { hook_typeof = function _typeof(obj) { return typeof obj; }; } else { hook_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return hook_typeof(obj); }
  12069. function hook_toConsumableArray(arr) { return hook_arrayWithoutHoles(arr) || hook_iterableToArray(arr) || hook_unsupportedIterableToArray(arr) || hook_nonIterableSpread(); }
  12070. function hook_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  12071. function hook_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return hook_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return hook_arrayLikeToArray(o, minLen); }
  12072. function hook_iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
  12073. function hook_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return hook_arrayLikeToArray(arr); }
  12074. function hook_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  12075. /**
  12076. * Install the hook on window, which is an event emitter.
  12077. * Note because Chrome content scripts cannot directly modify the window object,
  12078. * we are evaling this function by inserting a script tag.
  12079. * That's why we have to inline the whole event emitter implementation,
  12080. * the string format implementation, and part of the console implementation here.
  12081. *
  12082. *
  12083. */
  12084. function installHook(target) {
  12085. if (target.hasOwnProperty('__REACT_DEVTOOLS_GLOBAL_HOOK__')) {
  12086. return null;
  12087. }
  12088. var targetConsole = console;
  12089. var targetConsoleMethods = {};
  12090. for (var method in console) {
  12091. targetConsoleMethods[method] = console[method];
  12092. }
  12093. function dangerous_setTargetConsoleForTesting(targetConsoleForTesting) {
  12094. targetConsole = targetConsoleForTesting;
  12095. targetConsoleMethods = {};
  12096. for (var _method in targetConsole) {
  12097. targetConsoleMethods[_method] = console[_method];
  12098. }
  12099. }
  12100. function detectReactBuildType(renderer) {
  12101. try {
  12102. if (typeof renderer.version === 'string') {
  12103. // React DOM Fiber (16+)
  12104. if (renderer.bundleType > 0) {
  12105. // This is not a production build.
  12106. // We are currently only using 0 (PROD) and 1 (DEV)
  12107. // but might add 2 (PROFILE) in the future.
  12108. return 'development';
  12109. } // React 16 uses flat bundles. If we report the bundle as production
  12110. // version, it means we also minified and envified it ourselves.
  12111. return 'production'; // Note: There is still a risk that the CommonJS entry point has not
  12112. // been envified or uglified. In this case the user would have *both*
  12113. // development and production bundle, but only the prod one would run.
  12114. // This would be really bad. We have a separate check for this because
  12115. // it happens *outside* of the renderer injection. See `checkDCE` below.
  12116. } // $FlowFixMe[method-unbinding]
  12117. var _toString = Function.prototype.toString;
  12118. if (renderer.Mount && renderer.Mount._renderNewRootComponent) {
  12119. // React DOM Stack
  12120. var renderRootCode = _toString.call(renderer.Mount._renderNewRootComponent); // Filter out bad results (if that is even possible):
  12121. if (renderRootCode.indexOf('function') !== 0) {
  12122. // Hope for the best if we're not sure.
  12123. return 'production';
  12124. } // Check for React DOM Stack < 15.1.0 in development.
  12125. // If it contains "storedMeasure" call, it's wrapped in ReactPerf (DEV only).
  12126. // This would be true even if it's minified, as method name still matches.
  12127. if (renderRootCode.indexOf('storedMeasure') !== -1) {
  12128. return 'development';
  12129. } // For other versions (and configurations) it's not so easy.
  12130. // Let's quickly exclude proper production builds.
  12131. // If it contains a warning message, it's either a DEV build,
  12132. // or an PROD build without proper dead code elimination.
  12133. if (renderRootCode.indexOf('should be a pure function') !== -1) {
  12134. // Now how do we tell a DEV build from a bad PROD build?
  12135. // If we see NODE_ENV, we're going to assume this is a dev build
  12136. // because most likely it is referring to an empty shim.
  12137. if (renderRootCode.indexOf('NODE_ENV') !== -1) {
  12138. return 'development';
  12139. } // If we see "development", we're dealing with an envified DEV build
  12140. // (such as the official React DEV UMD).
  12141. if (renderRootCode.indexOf('development') !== -1) {
  12142. return 'development';
  12143. } // I've seen process.env.NODE_ENV !== 'production' being smartly
  12144. // replaced by `true` in DEV by Webpack. I don't know how that
  12145. // works but we can safely guard against it because `true` was
  12146. // never used in the function source since it was written.
  12147. if (renderRootCode.indexOf('true') !== -1) {
  12148. return 'development';
  12149. } // By now either it is a production build that has not been minified,
  12150. // or (worse) this is a minified development build using non-standard
  12151. // environment (e.g. "staging"). We're going to look at whether
  12152. // the function argument name is mangled:
  12153. if ( // 0.13 to 15
  12154. renderRootCode.indexOf('nextElement') !== -1 || // 0.12
  12155. renderRootCode.indexOf('nextComponent') !== -1) {
  12156. // We can't be certain whether this is a development build or not,
  12157. // but it is definitely unminified.
  12158. return 'unminified';
  12159. } else {
  12160. // This is likely a minified development build.
  12161. return 'development';
  12162. }
  12163. } // By now we know that it's envified and dead code elimination worked,
  12164. // but what if it's still not minified? (Is this even possible?)
  12165. // Let's check matches for the first argument name.
  12166. if ( // 0.13 to 15
  12167. renderRootCode.indexOf('nextElement') !== -1 || // 0.12
  12168. renderRootCode.indexOf('nextComponent') !== -1) {
  12169. return 'unminified';
  12170. } // Seems like we're using the production version.
  12171. // However, the branch above is Stack-only so this is 15 or earlier.
  12172. return 'outdated';
  12173. }
  12174. } catch (err) {// Weird environments may exist.
  12175. // This code needs a higher fault tolerance
  12176. // because it runs even with closed DevTools.
  12177. // TODO: should we catch errors in all injected code, and not just this part?
  12178. }
  12179. return 'production';
  12180. }
  12181. function checkDCE(fn) {
  12182. // This runs for production versions of React.
  12183. // Needs to be super safe.
  12184. try {
  12185. // $FlowFixMe[method-unbinding]
  12186. var _toString2 = Function.prototype.toString;
  12187. var code = _toString2.call(fn); // This is a string embedded in the passed function under DEV-only
  12188. // condition. However the function executes only in PROD. Therefore,
  12189. // if we see it, dead code elimination did not work.
  12190. if (code.indexOf('^_^') > -1) {
  12191. // Remember to report during next injection.
  12192. hasDetectedBadDCE = true; // Bonus: throw an exception hoping that it gets picked up by a reporting system.
  12193. // Not synchronously so that it doesn't break the calling code.
  12194. setTimeout(function () {
  12195. throw new Error('React is running in production mode, but dead code ' + 'elimination has not been applied. Read how to correctly ' + 'configure React for production: ' + 'https://reactjs.org/link/perf-use-production-build');
  12196. });
  12197. }
  12198. } catch (err) {}
  12199. } // NOTE: KEEP IN SYNC with src/backend/utils.js
  12200. function formatWithStyles(inputArgs, style) {
  12201. if (inputArgs === undefined || inputArgs === null || inputArgs.length === 0 || // Matches any of %c but not %%c
  12202. typeof inputArgs[0] === 'string' && inputArgs[0].match(/([^%]|^)(%c)/g) || style === undefined) {
  12203. return inputArgs;
  12204. } // Matches any of %(o|O|d|i|s|f), but not %%(o|O|d|i|s|f)
  12205. var REGEXP = /([^%]|^)((%%)*)(%([oOdisf]))/g;
  12206. if (typeof inputArgs[0] === 'string' && inputArgs[0].match(REGEXP)) {
  12207. return ["%c".concat(inputArgs[0]), style].concat(hook_toConsumableArray(inputArgs.slice(1)));
  12208. } else {
  12209. var firstArg = inputArgs.reduce(function (formatStr, elem, i) {
  12210. if (i > 0) {
  12211. formatStr += ' ';
  12212. }
  12213. switch (hook_typeof(elem)) {
  12214. case 'string':
  12215. case 'boolean':
  12216. case 'symbol':
  12217. return formatStr += '%s';
  12218. case 'number':
  12219. var formatting = Number.isInteger(elem) ? '%i' : '%f';
  12220. return formatStr += formatting;
  12221. default:
  12222. return formatStr += '%o';
  12223. }
  12224. }, '%c');
  12225. return [firstArg, style].concat(hook_toConsumableArray(inputArgs));
  12226. }
  12227. }
  12228. var unpatchFn = null; // NOTE: KEEP IN SYNC with src/backend/console.js:patchForStrictMode
  12229. // This function hides or dims console logs during the initial double renderer
  12230. // in Strict Mode. We need this function because during initial render,
  12231. // React and DevTools are connecting and the renderer interface isn't avaiable
  12232. // and we want to be able to have consistent logging behavior for double logs
  12233. // during the initial renderer.
  12234. function patchConsoleForInitialRenderInStrictMode(_ref) {
  12235. var hideConsoleLogsInStrictMode = _ref.hideConsoleLogsInStrictMode,
  12236. browserTheme = _ref.browserTheme;
  12237. var overrideConsoleMethods = ['error', 'group', 'groupCollapsed', 'info', 'log', 'trace', 'warn'];
  12238. if (unpatchFn !== null) {
  12239. // Don't patch twice.
  12240. return;
  12241. }
  12242. var originalConsoleMethods = {};
  12243. unpatchFn = function unpatchFn() {
  12244. for (var _method2 in originalConsoleMethods) {
  12245. try {
  12246. targetConsole[_method2] = originalConsoleMethods[_method2];
  12247. } catch (error) {}
  12248. }
  12249. };
  12250. overrideConsoleMethods.forEach(function (method) {
  12251. try {
  12252. var originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ : targetConsole[method];
  12253. var overrideMethod = function overrideMethod() {
  12254. if (!hideConsoleLogsInStrictMode) {
  12255. // Dim the text color of the double logs if we're not
  12256. // hiding them.
  12257. var color;
  12258. switch (method) {
  12259. case 'warn':
  12260. color = browserTheme === 'light' ? "rgba(250, 180, 50, 0.75)" : "rgba(250, 180, 50, 0.5)";
  12261. break;
  12262. case 'error':
  12263. color = browserTheme === 'light' ? "rgba(250, 123, 130, 0.75)" : "rgba(250, 123, 130, 0.5)";
  12264. break;
  12265. case 'log':
  12266. default:
  12267. color = browserTheme === 'light' ? "rgba(125, 125, 125, 0.75)" : "rgba(125, 125, 125, 0.5)";
  12268. break;
  12269. }
  12270. if (color) {
  12271. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  12272. args[_key] = arguments[_key];
  12273. }
  12274. originalMethod.apply(void 0, hook_toConsumableArray(formatWithStyles(args, "color: ".concat(color))));
  12275. } else {
  12276. throw Error('Console color is not defined');
  12277. }
  12278. }
  12279. };
  12280. overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod;
  12281. originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod;
  12282. targetConsole[method] = overrideMethod;
  12283. } catch (error) {}
  12284. });
  12285. } // NOTE: KEEP IN SYNC with src/backend/console.js:unpatchForStrictMode
  12286. function unpatchConsoleForInitialRenderInStrictMode() {
  12287. if (unpatchFn !== null) {
  12288. unpatchFn();
  12289. unpatchFn = null;
  12290. }
  12291. }
  12292. var uidCounter = 0;
  12293. function inject(renderer) {
  12294. var id = ++uidCounter;
  12295. renderers.set(id, renderer);
  12296. var reactBuildType = hasDetectedBadDCE ? 'deadcode' : detectReactBuildType(renderer); // Patching the console enables DevTools to do a few useful things:
  12297. // * Append component stacks to warnings and error messages
  12298. // * Disabling or marking logs during a double render in Strict Mode
  12299. // * Disable logging during re-renders to inspect hooks (see inspectHooksOfFiber)
  12300. //
  12301. // For React Native, we intentionally patch early (during injection).
  12302. // This provides React Native developers with components stacks even if they don't run DevTools.
  12303. //
  12304. // This won't work for DOM though, since this entire file is eval'ed and inserted as a script tag.
  12305. // In that case, we'll only patch parts of the console that are needed during the first render
  12306. // and patch everything else later (when the frontend attaches).
  12307. //
  12308. // Don't patch in test environments because we don't want to interfere with Jest's own console overrides.
  12309. //
  12310. // Note that because this function is inlined, this conditional check must only use static booleans.
  12311. // Otherwise the extension will throw with an undefined error.
  12312. // (See comments in the try/catch below for more context on inlining.)
  12313. if (true) {
  12314. try {
  12315. // The installHook() function is injected by being stringified in the browser,
  12316. // so imports outside of this function do not get included.
  12317. //
  12318. // Normally we could check "typeof patchConsole === 'function'",
  12319. // but Webpack wraps imports with an object (e.g. _backend_console__WEBPACK_IMPORTED_MODULE_0__)
  12320. // and the object itself will be undefined as well for the reasons mentioned above,
  12321. // so we use try/catch instead.
  12322. Object(backend_console["d" /* registerRenderer */])(renderer);
  12323. Object(backend_console["b" /* patchConsoleUsingWindowValues */])();
  12324. } catch (error) {}
  12325. } // If we have just reloaded to profile, we need to inject the renderer interface before the app loads.
  12326. // Otherwise the renderer won't yet exist and we can skip this step.
  12327. var attach = target.__REACT_DEVTOOLS_ATTACH__;
  12328. if (typeof attach === 'function') {
  12329. var rendererInterface = attach(hook, id, renderer, target);
  12330. hook.rendererInterfaces.set(id, rendererInterface);
  12331. }
  12332. hook.emit('renderer', {
  12333. id: id,
  12334. renderer: renderer,
  12335. reactBuildType: reactBuildType
  12336. });
  12337. return id;
  12338. }
  12339. var hasDetectedBadDCE = false;
  12340. function sub(event, fn) {
  12341. hook.on(event, fn);
  12342. return function () {
  12343. return hook.off(event, fn);
  12344. };
  12345. }
  12346. function on(event, fn) {
  12347. if (!listeners[event]) {
  12348. listeners[event] = [];
  12349. }
  12350. listeners[event].push(fn);
  12351. }
  12352. function off(event, fn) {
  12353. if (!listeners[event]) {
  12354. return;
  12355. }
  12356. var index = listeners[event].indexOf(fn);
  12357. if (index !== -1) {
  12358. listeners[event].splice(index, 1);
  12359. }
  12360. if (!listeners[event].length) {
  12361. delete listeners[event];
  12362. }
  12363. }
  12364. function emit(event, data) {
  12365. if (listeners[event]) {
  12366. listeners[event].map(function (fn) {
  12367. return fn(data);
  12368. });
  12369. }
  12370. }
  12371. function getFiberRoots(rendererID) {
  12372. var roots = fiberRoots;
  12373. if (!roots[rendererID]) {
  12374. roots[rendererID] = new Set();
  12375. }
  12376. return roots[rendererID];
  12377. }
  12378. function onCommitFiberUnmount(rendererID, fiber) {
  12379. var rendererInterface = rendererInterfaces.get(rendererID);
  12380. if (rendererInterface != null) {
  12381. rendererInterface.handleCommitFiberUnmount(fiber);
  12382. }
  12383. }
  12384. function onCommitFiberRoot(rendererID, root, priorityLevel) {
  12385. var mountedRoots = hook.getFiberRoots(rendererID);
  12386. var current = root.current;
  12387. var isKnownRoot = mountedRoots.has(root);
  12388. var isUnmounting = current.memoizedState == null || current.memoizedState.element == null; // Keep track of mounted roots so we can hydrate when DevTools connect.
  12389. if (!isKnownRoot && !isUnmounting) {
  12390. mountedRoots.add(root);
  12391. } else if (isKnownRoot && isUnmounting) {
  12392. mountedRoots.delete(root);
  12393. }
  12394. var rendererInterface = rendererInterfaces.get(rendererID);
  12395. if (rendererInterface != null) {
  12396. rendererInterface.handleCommitFiberRoot(root, priorityLevel);
  12397. }
  12398. }
  12399. function onPostCommitFiberRoot(rendererID, root) {
  12400. var rendererInterface = rendererInterfaces.get(rendererID);
  12401. if (rendererInterface != null) {
  12402. rendererInterface.handlePostCommitFiberRoot(root);
  12403. }
  12404. }
  12405. function setStrictMode(rendererID, isStrictMode) {
  12406. var rendererInterface = rendererInterfaces.get(rendererID);
  12407. if (rendererInterface != null) {
  12408. if (isStrictMode) {
  12409. rendererInterface.patchConsoleForStrictMode();
  12410. } else {
  12411. rendererInterface.unpatchConsoleForStrictMode();
  12412. }
  12413. } else {
  12414. // This should only happen during initial render in the extension before DevTools
  12415. // finishes its handshake with the injected renderer
  12416. if (isStrictMode) {
  12417. var hideConsoleLogsInStrictMode = window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ === true;
  12418. var browserTheme = window.__REACT_DEVTOOLS_BROWSER_THEME__;
  12419. patchConsoleForInitialRenderInStrictMode({
  12420. hideConsoleLogsInStrictMode: hideConsoleLogsInStrictMode,
  12421. browserTheme: browserTheme
  12422. });
  12423. } else {
  12424. unpatchConsoleForInitialRenderInStrictMode();
  12425. }
  12426. }
  12427. }
  12428. var openModuleRangesStack = [];
  12429. var moduleRanges = [];
  12430. function getTopStackFrameString(error) {
  12431. var frames = error.stack.split('\n');
  12432. var frame = frames.length > 1 ? frames[1] : null;
  12433. return frame;
  12434. }
  12435. function getInternalModuleRanges() {
  12436. return moduleRanges;
  12437. }
  12438. function registerInternalModuleStart(error) {
  12439. var startStackFrame = getTopStackFrameString(error);
  12440. if (startStackFrame !== null) {
  12441. openModuleRangesStack.push(startStackFrame);
  12442. }
  12443. }
  12444. function registerInternalModuleStop(error) {
  12445. if (openModuleRangesStack.length > 0) {
  12446. var startStackFrame = openModuleRangesStack.pop();
  12447. var stopStackFrame = getTopStackFrameString(error);
  12448. if (stopStackFrame !== null) {
  12449. moduleRanges.push([startStackFrame, stopStackFrame]);
  12450. }
  12451. }
  12452. } // TODO: More meaningful names for "rendererInterfaces" and "renderers".
  12453. var fiberRoots = {};
  12454. var rendererInterfaces = new Map();
  12455. var listeners = {};
  12456. var renderers = new Map();
  12457. var hook = {
  12458. rendererInterfaces: rendererInterfaces,
  12459. listeners: listeners,
  12460. // Fast Refresh for web relies on this.
  12461. renderers: renderers,
  12462. emit: emit,
  12463. getFiberRoots: getFiberRoots,
  12464. inject: inject,
  12465. on: on,
  12466. off: off,
  12467. sub: sub,
  12468. // This is a legacy flag.
  12469. // React v16 checks the hook for this to ensure DevTools is new enough.
  12470. supportsFiber: true,
  12471. // React calls these methods.
  12472. checkDCE: checkDCE,
  12473. onCommitFiberUnmount: onCommitFiberUnmount,
  12474. onCommitFiberRoot: onCommitFiberRoot,
  12475. onPostCommitFiberRoot: onPostCommitFiberRoot,
  12476. setStrictMode: setStrictMode,
  12477. // Schedule Profiler runtime helpers.
  12478. // These internal React modules to report their own boundaries
  12479. // which in turn enables the profiler to dim or filter internal frames.
  12480. getInternalModuleRanges: getInternalModuleRanges,
  12481. registerInternalModuleStart: registerInternalModuleStart,
  12482. registerInternalModuleStop: registerInternalModuleStop
  12483. };
  12484. if (false) {}
  12485. Object.defineProperty(target, '__REACT_DEVTOOLS_GLOBAL_HOOK__', {
  12486. // This property needs to be configurable for the test environment,
  12487. // else we won't be able to delete and recreate it between tests.
  12488. configurable: false,
  12489. enumerable: false,
  12490. get: function get() {
  12491. return hook;
  12492. }
  12493. });
  12494. return hook;
  12495. }
  12496. // EXTERNAL MODULE: ../react-devtools-shared/src/backend/renderer.js + 6 modules
  12497. var backend_renderer = __webpack_require__(14);
  12498. // EXTERNAL MODULE: ../react-devtools-shared/src/types.js
  12499. var types = __webpack_require__(1);
  12500. // EXTERNAL MODULE: ../react-devtools-shared/src/utils.js
  12501. var src_utils = __webpack_require__(0);
  12502. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/legacy/utils.js
  12503. /**
  12504. * Copyright (c) Meta Platforms, Inc. and affiliates.
  12505. *
  12506. * This source code is licensed under the MIT license found in the
  12507. * LICENSE file in the root directory of this source tree.
  12508. *
  12509. *
  12510. */
  12511. function decorate(object, attr, fn) {
  12512. var old = object[attr]; // $FlowFixMe[missing-this-annot] webpack config needs to be updated to allow `this` type annotations
  12513. object[attr] = function (instance) {
  12514. return fn.call(this, old, arguments);
  12515. };
  12516. return old;
  12517. }
  12518. function decorateMany(source, fns) {
  12519. var olds = {};
  12520. for (var name in fns) {
  12521. olds[name] = decorate(source, name, fns[name]);
  12522. }
  12523. return olds;
  12524. }
  12525. function restoreMany(source, olds) {
  12526. for (var name in olds) {
  12527. source[name] = olds[name];
  12528. }
  12529. } // $FlowFixMe[missing-this-annot] webpack config needs to be updated to allow `this` type annotations
  12530. function forceUpdate(instance) {
  12531. if (typeof instance.forceUpdate === 'function') {
  12532. instance.forceUpdate();
  12533. } else if (instance.updater != null && typeof instance.updater.enqueueForceUpdate === 'function') {
  12534. instance.updater.enqueueForceUpdate(this, function () {}, 'forceUpdate');
  12535. }
  12536. }
  12537. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/legacy/renderer.js
  12538. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  12539. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { renderer_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  12540. function renderer_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  12541. function renderer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { renderer_typeof = function _typeof(obj) { return typeof obj; }; } else { renderer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return renderer_typeof(obj); }
  12542. /**
  12543. * Copyright (c) Meta Platforms, Inc. and affiliates.
  12544. *
  12545. * This source code is licensed under the MIT license found in the
  12546. * LICENSE file in the root directory of this source tree.
  12547. *
  12548. *
  12549. */
  12550. function getData(internalInstance) {
  12551. var displayName = null;
  12552. var key = null; // != used deliberately here to catch undefined and null
  12553. if (internalInstance._currentElement != null) {
  12554. if (internalInstance._currentElement.key) {
  12555. key = String(internalInstance._currentElement.key);
  12556. }
  12557. var elementType = internalInstance._currentElement.type;
  12558. if (typeof elementType === 'string') {
  12559. displayName = elementType;
  12560. } else if (typeof elementType === 'function') {
  12561. displayName = Object(src_utils["h" /* getDisplayName */])(elementType);
  12562. }
  12563. }
  12564. return {
  12565. displayName: displayName,
  12566. key: key
  12567. };
  12568. }
  12569. function getElementType(internalInstance) {
  12570. // != used deliberately here to catch undefined and null
  12571. if (internalInstance._currentElement != null) {
  12572. var elementType = internalInstance._currentElement.type;
  12573. if (typeof elementType === 'function') {
  12574. var publicInstance = internalInstance.getPublicInstance();
  12575. if (publicInstance !== null) {
  12576. return types["e" /* ElementTypeClass */];
  12577. } else {
  12578. return types["h" /* ElementTypeFunction */];
  12579. }
  12580. } else if (typeof elementType === 'string') {
  12581. return types["i" /* ElementTypeHostComponent */];
  12582. }
  12583. }
  12584. return types["k" /* ElementTypeOtherOrUnknown */];
  12585. }
  12586. function getChildren(internalInstance) {
  12587. var children = []; // If the parent is a native node without rendered children, but with
  12588. // multiple string children, then the `element` that gets passed in here is
  12589. // a plain value -- a string or number.
  12590. if (renderer_typeof(internalInstance) !== 'object') {// No children
  12591. } else if (internalInstance._currentElement === null || internalInstance._currentElement === false) {// No children
  12592. } else if (internalInstance._renderedComponent) {
  12593. var child = internalInstance._renderedComponent;
  12594. if (getElementType(child) !== types["k" /* ElementTypeOtherOrUnknown */]) {
  12595. children.push(child);
  12596. }
  12597. } else if (internalInstance._renderedChildren) {
  12598. var renderedChildren = internalInstance._renderedChildren;
  12599. for (var name in renderedChildren) {
  12600. var _child = renderedChildren[name];
  12601. if (getElementType(_child) !== types["k" /* ElementTypeOtherOrUnknown */]) {
  12602. children.push(_child);
  12603. }
  12604. }
  12605. } // Note: we skip the case where children are just strings or numbers
  12606. // because the new DevTools skips over host text nodes anyway.
  12607. return children;
  12608. }
  12609. function renderer_attach(hook, rendererID, renderer, global) {
  12610. var idToInternalInstanceMap = new Map();
  12611. var internalInstanceToIDMap = new WeakMap();
  12612. var internalInstanceToRootIDMap = new WeakMap();
  12613. var getInternalIDForNative = null;
  12614. var findNativeNodeForInternalID;
  12615. var getFiberForNative = function getFiberForNative(node) {
  12616. // Not implemented.
  12617. return null;
  12618. };
  12619. if (renderer.ComponentTree) {
  12620. getInternalIDForNative = function getInternalIDForNative(node, findNearestUnfilteredAncestor) {
  12621. var internalInstance = renderer.ComponentTree.getClosestInstanceFromNode(node);
  12622. return internalInstanceToIDMap.get(internalInstance) || null;
  12623. };
  12624. findNativeNodeForInternalID = function findNativeNodeForInternalID(id) {
  12625. var internalInstance = idToInternalInstanceMap.get(id);
  12626. return renderer.ComponentTree.getNodeFromInstance(internalInstance);
  12627. };
  12628. getFiberForNative = function getFiberForNative(node) {
  12629. return renderer.ComponentTree.getClosestInstanceFromNode(node);
  12630. };
  12631. } else if (renderer.Mount.getID && renderer.Mount.getNode) {
  12632. getInternalIDForNative = function getInternalIDForNative(node, findNearestUnfilteredAncestor) {
  12633. // Not implemented.
  12634. return null;
  12635. };
  12636. findNativeNodeForInternalID = function findNativeNodeForInternalID(id) {
  12637. // Not implemented.
  12638. return null;
  12639. };
  12640. }
  12641. function getDisplayNameForFiberID(id) {
  12642. var internalInstance = idToInternalInstanceMap.get(id);
  12643. return internalInstance ? getData(internalInstance).displayName : null;
  12644. }
  12645. function getID(internalInstance) {
  12646. if (renderer_typeof(internalInstance) !== 'object' || internalInstance === null) {
  12647. throw new Error('Invalid internal instance: ' + internalInstance);
  12648. }
  12649. if (!internalInstanceToIDMap.has(internalInstance)) {
  12650. var _id = Object(src_utils["k" /* getUID */])();
  12651. internalInstanceToIDMap.set(internalInstance, _id);
  12652. idToInternalInstanceMap.set(_id, internalInstance);
  12653. }
  12654. return internalInstanceToIDMap.get(internalInstance);
  12655. }
  12656. function areEqualArrays(a, b) {
  12657. if (a.length !== b.length) {
  12658. return false;
  12659. }
  12660. for (var i = 0; i < a.length; i++) {
  12661. if (a[i] !== b[i]) {
  12662. return false;
  12663. }
  12664. }
  12665. return true;
  12666. } // This is shared mutable state that lets us keep track of where we are.
  12667. var parentIDStack = [];
  12668. var oldReconcilerMethods = null;
  12669. if (renderer.Reconciler) {
  12670. // React 15
  12671. oldReconcilerMethods = decorateMany(renderer.Reconciler, {
  12672. mountComponent: function mountComponent(fn, args) {
  12673. var internalInstance = args[0];
  12674. var hostContainerInfo = args[3];
  12675. if (getElementType(internalInstance) === types["k" /* ElementTypeOtherOrUnknown */]) {
  12676. // $FlowFixMe[object-this-reference] found when upgrading Flow
  12677. return fn.apply(this, args);
  12678. }
  12679. if (hostContainerInfo._topLevelWrapper === undefined) {
  12680. // SSR
  12681. // $FlowFixMe[object-this-reference] found when upgrading Flow
  12682. return fn.apply(this, args);
  12683. }
  12684. var id = getID(internalInstance); // Push the operation.
  12685. var parentID = parentIDStack.length > 0 ? parentIDStack[parentIDStack.length - 1] : 0;
  12686. recordMount(internalInstance, id, parentID);
  12687. parentIDStack.push(id); // Remember the root.
  12688. internalInstanceToRootIDMap.set(internalInstance, getID(hostContainerInfo._topLevelWrapper));
  12689. try {
  12690. // $FlowFixMe[object-this-reference] found when upgrading Flow
  12691. var result = fn.apply(this, args);
  12692. parentIDStack.pop();
  12693. return result;
  12694. } catch (err) {
  12695. // $FlowFixMe[incompatible-type] found when upgrading Flow
  12696. parentIDStack = [];
  12697. throw err;
  12698. } finally {
  12699. if (parentIDStack.length === 0) {
  12700. var rootID = internalInstanceToRootIDMap.get(internalInstance);
  12701. if (rootID === undefined) {
  12702. throw new Error('Expected to find root ID.');
  12703. }
  12704. flushPendingEvents(rootID);
  12705. }
  12706. }
  12707. },
  12708. performUpdateIfNecessary: function performUpdateIfNecessary(fn, args) {
  12709. var internalInstance = args[0];
  12710. if (getElementType(internalInstance) === types["k" /* ElementTypeOtherOrUnknown */]) {
  12711. // $FlowFixMe[object-this-reference] found when upgrading Flow
  12712. return fn.apply(this, args);
  12713. }
  12714. var id = getID(internalInstance);
  12715. parentIDStack.push(id);
  12716. var prevChildren = getChildren(internalInstance);
  12717. try {
  12718. // $FlowFixMe[object-this-reference] found when upgrading Flow
  12719. var result = fn.apply(this, args);
  12720. var nextChildren = getChildren(internalInstance);
  12721. if (!areEqualArrays(prevChildren, nextChildren)) {
  12722. // Push the operation
  12723. recordReorder(internalInstance, id, nextChildren);
  12724. }
  12725. parentIDStack.pop();
  12726. return result;
  12727. } catch (err) {
  12728. // $FlowFixMe[incompatible-type] found when upgrading Flow
  12729. parentIDStack = [];
  12730. throw err;
  12731. } finally {
  12732. if (parentIDStack.length === 0) {
  12733. var rootID = internalInstanceToRootIDMap.get(internalInstance);
  12734. if (rootID === undefined) {
  12735. throw new Error('Expected to find root ID.');
  12736. }
  12737. flushPendingEvents(rootID);
  12738. }
  12739. }
  12740. },
  12741. receiveComponent: function receiveComponent(fn, args) {
  12742. var internalInstance = args[0];
  12743. if (getElementType(internalInstance) === types["k" /* ElementTypeOtherOrUnknown */]) {
  12744. // $FlowFixMe[object-this-reference] found when upgrading Flow
  12745. return fn.apply(this, args);
  12746. }
  12747. var id = getID(internalInstance);
  12748. parentIDStack.push(id);
  12749. var prevChildren = getChildren(internalInstance);
  12750. try {
  12751. // $FlowFixMe[object-this-reference] found when upgrading Flow
  12752. var result = fn.apply(this, args);
  12753. var nextChildren = getChildren(internalInstance);
  12754. if (!areEqualArrays(prevChildren, nextChildren)) {
  12755. // Push the operation
  12756. recordReorder(internalInstance, id, nextChildren);
  12757. }
  12758. parentIDStack.pop();
  12759. return result;
  12760. } catch (err) {
  12761. // $FlowFixMe[incompatible-type] found when upgrading Flow
  12762. parentIDStack = [];
  12763. throw err;
  12764. } finally {
  12765. if (parentIDStack.length === 0) {
  12766. var rootID = internalInstanceToRootIDMap.get(internalInstance);
  12767. if (rootID === undefined) {
  12768. throw new Error('Expected to find root ID.');
  12769. }
  12770. flushPendingEvents(rootID);
  12771. }
  12772. }
  12773. },
  12774. unmountComponent: function unmountComponent(fn, args) {
  12775. var internalInstance = args[0];
  12776. if (getElementType(internalInstance) === types["k" /* ElementTypeOtherOrUnknown */]) {
  12777. // $FlowFixMe[object-this-reference] found when upgrading Flow
  12778. return fn.apply(this, args);
  12779. }
  12780. var id = getID(internalInstance);
  12781. parentIDStack.push(id);
  12782. try {
  12783. // $FlowFixMe[object-this-reference] found when upgrading Flow
  12784. var result = fn.apply(this, args);
  12785. parentIDStack.pop(); // Push the operation.
  12786. recordUnmount(internalInstance, id);
  12787. return result;
  12788. } catch (err) {
  12789. // $FlowFixMe[incompatible-type] found when upgrading Flow
  12790. parentIDStack = [];
  12791. throw err;
  12792. } finally {
  12793. if (parentIDStack.length === 0) {
  12794. var rootID = internalInstanceToRootIDMap.get(internalInstance);
  12795. if (rootID === undefined) {
  12796. throw new Error('Expected to find root ID.');
  12797. }
  12798. flushPendingEvents(rootID);
  12799. }
  12800. }
  12801. }
  12802. });
  12803. }
  12804. function cleanup() {
  12805. if (oldReconcilerMethods !== null) {
  12806. if (renderer.Component) {
  12807. restoreMany(renderer.Component.Mixin, oldReconcilerMethods);
  12808. } else {
  12809. restoreMany(renderer.Reconciler, oldReconcilerMethods);
  12810. }
  12811. }
  12812. oldReconcilerMethods = null;
  12813. }
  12814. function recordMount(internalInstance, id, parentID) {
  12815. var isRoot = parentID === 0;
  12816. if (constants["s" /* __DEBUG__ */]) {
  12817. console.log('%crecordMount()', 'color: green; font-weight: bold;', id, getData(internalInstance).displayName);
  12818. }
  12819. if (isRoot) {
  12820. // TODO Is this right? For all versions?
  12821. var hasOwnerMetadata = internalInstance._currentElement != null && internalInstance._currentElement._owner != null;
  12822. pushOperation(constants["l" /* TREE_OPERATION_ADD */]);
  12823. pushOperation(id);
  12824. pushOperation(types["m" /* ElementTypeRoot */]);
  12825. pushOperation(0); // StrictMode compliant?
  12826. pushOperation(0); // Profiling flag
  12827. pushOperation(0); // StrictMode supported?
  12828. pushOperation(hasOwnerMetadata ? 1 : 0);
  12829. } else {
  12830. var type = getElementType(internalInstance);
  12831. var _getData = getData(internalInstance),
  12832. displayName = _getData.displayName,
  12833. key = _getData.key;
  12834. var ownerID = internalInstance._currentElement != null && internalInstance._currentElement._owner != null ? getID(internalInstance._currentElement._owner) : 0;
  12835. var displayNameStringID = getStringID(displayName);
  12836. var keyStringID = getStringID(key);
  12837. pushOperation(constants["l" /* TREE_OPERATION_ADD */]);
  12838. pushOperation(id);
  12839. pushOperation(type);
  12840. pushOperation(parentID);
  12841. pushOperation(ownerID);
  12842. pushOperation(displayNameStringID);
  12843. pushOperation(keyStringID);
  12844. }
  12845. }
  12846. function recordReorder(internalInstance, id, nextChildren) {
  12847. pushOperation(constants["o" /* TREE_OPERATION_REORDER_CHILDREN */]);
  12848. pushOperation(id);
  12849. var nextChildIDs = nextChildren.map(getID);
  12850. pushOperation(nextChildIDs.length);
  12851. for (var i = 0; i < nextChildIDs.length; i++) {
  12852. pushOperation(nextChildIDs[i]);
  12853. }
  12854. }
  12855. function recordUnmount(internalInstance, id) {
  12856. pendingUnmountedIDs.push(id);
  12857. idToInternalInstanceMap.delete(id);
  12858. }
  12859. function crawlAndRecordInitialMounts(id, parentID, rootID) {
  12860. if (constants["s" /* __DEBUG__ */]) {
  12861. console.group('crawlAndRecordInitialMounts() id:', id);
  12862. }
  12863. var internalInstance = idToInternalInstanceMap.get(id);
  12864. if (internalInstance != null) {
  12865. internalInstanceToRootIDMap.set(internalInstance, rootID);
  12866. recordMount(internalInstance, id, parentID);
  12867. getChildren(internalInstance).forEach(function (child) {
  12868. return crawlAndRecordInitialMounts(getID(child), id, rootID);
  12869. });
  12870. }
  12871. if (constants["s" /* __DEBUG__ */]) {
  12872. console.groupEnd();
  12873. }
  12874. }
  12875. function flushInitialOperations() {
  12876. // Crawl roots though and register any nodes that mounted before we were injected.
  12877. var roots = renderer.Mount._instancesByReactRootID || renderer.Mount._instancesByContainerID;
  12878. for (var key in roots) {
  12879. var internalInstance = roots[key];
  12880. var _id2 = getID(internalInstance);
  12881. crawlAndRecordInitialMounts(_id2, 0, _id2);
  12882. flushPendingEvents(_id2);
  12883. }
  12884. }
  12885. var pendingOperations = [];
  12886. var pendingStringTable = new Map();
  12887. var pendingUnmountedIDs = [];
  12888. var pendingStringTableLength = 0;
  12889. var pendingUnmountedRootID = null;
  12890. function flushPendingEvents(rootID) {
  12891. if (pendingOperations.length === 0 && pendingUnmountedIDs.length === 0 && pendingUnmountedRootID === null) {
  12892. return;
  12893. }
  12894. var numUnmountIDs = pendingUnmountedIDs.length + (pendingUnmountedRootID === null ? 0 : 1);
  12895. var operations = new Array( // Identify which renderer this update is coming from.
  12896. 2 + // [rendererID, rootFiberID]
  12897. // How big is the string table?
  12898. 1 + // [stringTableLength]
  12899. // Then goes the actual string table.
  12900. pendingStringTableLength + ( // All unmounts are batched in a single message.
  12901. // [TREE_OPERATION_REMOVE, removedIDLength, ...ids]
  12902. numUnmountIDs > 0 ? 2 + numUnmountIDs : 0) + // Mount operations
  12903. pendingOperations.length); // Identify which renderer this update is coming from.
  12904. // This enables roots to be mapped to renderers,
  12905. // Which in turn enables fiber properations, states, and hooks to be inspected.
  12906. var i = 0;
  12907. operations[i++] = rendererID;
  12908. operations[i++] = rootID; // Now fill in the string table.
  12909. // [stringTableLength, str1Length, ...str1, str2Length, ...str2, ...]
  12910. operations[i++] = pendingStringTableLength;
  12911. pendingStringTable.forEach(function (value, key) {
  12912. operations[i++] = key.length;
  12913. var encodedKey = Object(src_utils["p" /* utfEncodeString */])(key);
  12914. for (var j = 0; j < encodedKey.length; j++) {
  12915. operations[i + j] = encodedKey[j];
  12916. }
  12917. i += key.length;
  12918. });
  12919. if (numUnmountIDs > 0) {
  12920. // All unmounts except roots are batched in a single message.
  12921. operations[i++] = constants["m" /* TREE_OPERATION_REMOVE */]; // The first number is how many unmounted IDs we're gonna send.
  12922. operations[i++] = numUnmountIDs; // Fill in the unmounts
  12923. for (var j = 0; j < pendingUnmountedIDs.length; j++) {
  12924. operations[i++] = pendingUnmountedIDs[j];
  12925. } // The root ID should always be unmounted last.
  12926. if (pendingUnmountedRootID !== null) {
  12927. operations[i] = pendingUnmountedRootID;
  12928. i++;
  12929. }
  12930. } // Fill in the rest of the operations.
  12931. for (var _j = 0; _j < pendingOperations.length; _j++) {
  12932. operations[i + _j] = pendingOperations[_j];
  12933. }
  12934. i += pendingOperations.length;
  12935. if (constants["s" /* __DEBUG__ */]) {
  12936. Object(src_utils["m" /* printOperationsArray */])(operations);
  12937. } // If we've already connected to the frontend, just pass the operations through.
  12938. hook.emit('operations', operations);
  12939. pendingOperations.length = 0;
  12940. pendingUnmountedIDs = [];
  12941. pendingUnmountedRootID = null;
  12942. pendingStringTable.clear();
  12943. pendingStringTableLength = 0;
  12944. }
  12945. function pushOperation(op) {
  12946. if (false) {}
  12947. pendingOperations.push(op);
  12948. }
  12949. function getStringID(str) {
  12950. if (str === null) {
  12951. return 0;
  12952. }
  12953. var existingID = pendingStringTable.get(str);
  12954. if (existingID !== undefined) {
  12955. return existingID;
  12956. }
  12957. var stringID = pendingStringTable.size + 1;
  12958. pendingStringTable.set(str, stringID); // The string table total length needs to account
  12959. // both for the string length, and for the array item
  12960. // that contains the length itself. Hence + 1.
  12961. pendingStringTableLength += str.length + 1;
  12962. return stringID;
  12963. }
  12964. var currentlyInspectedElementID = null;
  12965. var currentlyInspectedPaths = {}; // Track the intersection of currently inspected paths,
  12966. // so that we can send their data along if the element is re-rendered.
  12967. function mergeInspectedPaths(path) {
  12968. var current = currentlyInspectedPaths;
  12969. path.forEach(function (key) {
  12970. if (!current[key]) {
  12971. current[key] = {};
  12972. }
  12973. current = current[key];
  12974. });
  12975. }
  12976. function createIsPathAllowed(key) {
  12977. // This function helps prevent previously-inspected paths from being dehydrated in updates.
  12978. // This is important to avoid a bad user experience where expanded toggles collapse on update.
  12979. return function isPathAllowed(path) {
  12980. var current = currentlyInspectedPaths[key];
  12981. if (!current) {
  12982. return false;
  12983. }
  12984. for (var i = 0; i < path.length; i++) {
  12985. current = current[path[i]];
  12986. if (!current) {
  12987. return false;
  12988. }
  12989. }
  12990. return true;
  12991. };
  12992. } // Fast path props lookup for React Native style editor.
  12993. function getInstanceAndStyle(id) {
  12994. var instance = null;
  12995. var style = null;
  12996. var internalInstance = idToInternalInstanceMap.get(id);
  12997. if (internalInstance != null) {
  12998. instance = internalInstance._instance || null;
  12999. var element = internalInstance._currentElement;
  13000. if (element != null && element.props != null) {
  13001. style = element.props.style || null;
  13002. }
  13003. }
  13004. return {
  13005. instance: instance,
  13006. style: style
  13007. };
  13008. }
  13009. function updateSelectedElement(id) {
  13010. var internalInstance = idToInternalInstanceMap.get(id);
  13011. if (internalInstance == null) {
  13012. console.warn("Could not find instance with id \"".concat(id, "\""));
  13013. return;
  13014. }
  13015. switch (getElementType(internalInstance)) {
  13016. case types["e" /* ElementTypeClass */]:
  13017. global.$r = internalInstance._instance;
  13018. break;
  13019. case types["h" /* ElementTypeFunction */]:
  13020. var element = internalInstance._currentElement;
  13021. if (element == null) {
  13022. console.warn("Could not find element with id \"".concat(id, "\""));
  13023. return;
  13024. }
  13025. global.$r = {
  13026. props: element.props,
  13027. type: element.type
  13028. };
  13029. break;
  13030. default:
  13031. global.$r = null;
  13032. break;
  13033. }
  13034. }
  13035. function storeAsGlobal(id, path, count) {
  13036. var inspectedElement = inspectElementRaw(id);
  13037. if (inspectedElement !== null) {
  13038. var value = Object(src_utils["j" /* getInObject */])(inspectedElement, path);
  13039. var key = "$reactTemp".concat(count);
  13040. window[key] = value;
  13041. console.log(key);
  13042. console.log(value);
  13043. }
  13044. }
  13045. function copyElementPath(id, path) {
  13046. var inspectedElement = inspectElementRaw(id);
  13047. if (inspectedElement !== null) {
  13048. Object(utils["b" /* copyToClipboard */])(Object(src_utils["j" /* getInObject */])(inspectedElement, path));
  13049. }
  13050. }
  13051. function inspectElement(requestID, id, path, forceFullData) {
  13052. if (forceFullData || currentlyInspectedElementID !== id) {
  13053. currentlyInspectedElementID = id;
  13054. currentlyInspectedPaths = {};
  13055. }
  13056. var inspectedElement = inspectElementRaw(id);
  13057. if (inspectedElement === null) {
  13058. return {
  13059. id: id,
  13060. responseID: requestID,
  13061. type: 'not-found'
  13062. };
  13063. }
  13064. if (path !== null) {
  13065. mergeInspectedPaths(path);
  13066. } // Any time an inspected element has an update,
  13067. // we should update the selected $r value as wel.
  13068. // Do this before dehydration (cleanForBridge).
  13069. updateSelectedElement(id);
  13070. inspectedElement.context = Object(utils["a" /* cleanForBridge */])(inspectedElement.context, createIsPathAllowed('context'));
  13071. inspectedElement.props = Object(utils["a" /* cleanForBridge */])(inspectedElement.props, createIsPathAllowed('props'));
  13072. inspectedElement.state = Object(utils["a" /* cleanForBridge */])(inspectedElement.state, createIsPathAllowed('state'));
  13073. return {
  13074. id: id,
  13075. responseID: requestID,
  13076. type: 'full-data',
  13077. value: inspectedElement
  13078. };
  13079. }
  13080. function inspectElementRaw(id) {
  13081. var internalInstance = idToInternalInstanceMap.get(id);
  13082. if (internalInstance == null) {
  13083. return null;
  13084. }
  13085. var _getData2 = getData(internalInstance),
  13086. displayName = _getData2.displayName,
  13087. key = _getData2.key;
  13088. var type = getElementType(internalInstance);
  13089. var context = null;
  13090. var owners = null;
  13091. var props = null;
  13092. var state = null;
  13093. var source = null;
  13094. var element = internalInstance._currentElement;
  13095. if (element !== null) {
  13096. props = element.props;
  13097. source = element._source != null ? element._source : null;
  13098. var owner = element._owner;
  13099. if (owner) {
  13100. owners = [];
  13101. while (owner != null) {
  13102. owners.push({
  13103. displayName: getData(owner).displayName || 'Unknown',
  13104. id: getID(owner),
  13105. key: element.key,
  13106. type: getElementType(owner)
  13107. });
  13108. if (owner._currentElement) {
  13109. owner = owner._currentElement._owner;
  13110. }
  13111. }
  13112. }
  13113. }
  13114. var publicInstance = internalInstance._instance;
  13115. if (publicInstance != null) {
  13116. context = publicInstance.context || null;
  13117. state = publicInstance.state || null;
  13118. } // Not implemented
  13119. var errors = [];
  13120. var warnings = [];
  13121. return {
  13122. id: id,
  13123. // Does the current renderer support editable hooks and function props?
  13124. canEditHooks: false,
  13125. canEditFunctionProps: false,
  13126. // Does the current renderer support advanced editing interface?
  13127. canEditHooksAndDeletePaths: false,
  13128. canEditHooksAndRenamePaths: false,
  13129. canEditFunctionPropsDeletePaths: false,
  13130. canEditFunctionPropsRenamePaths: false,
  13131. // Toggle error boundary did not exist in legacy versions
  13132. canToggleError: false,
  13133. isErrored: false,
  13134. targetErrorBoundaryID: null,
  13135. // Suspense did not exist in legacy versions
  13136. canToggleSuspense: false,
  13137. // Can view component source location.
  13138. canViewSource: type === types["e" /* ElementTypeClass */] || type === types["h" /* ElementTypeFunction */],
  13139. // Only legacy context exists in legacy versions.
  13140. hasLegacyContext: true,
  13141. displayName: displayName,
  13142. type: type,
  13143. key: key != null ? key : null,
  13144. // Inspectable properties.
  13145. context: context,
  13146. hooks: null,
  13147. props: props,
  13148. state: state,
  13149. errors: errors,
  13150. warnings: warnings,
  13151. // List of owners
  13152. owners: owners,
  13153. // Location of component in source code.
  13154. source: source,
  13155. rootType: null,
  13156. rendererPackageName: null,
  13157. rendererVersion: null,
  13158. plugins: {
  13159. stylex: null
  13160. }
  13161. };
  13162. }
  13163. function logElementToConsole(id) {
  13164. var result = inspectElementRaw(id);
  13165. if (result === null) {
  13166. console.warn("Could not find element with id \"".concat(id, "\""));
  13167. return;
  13168. }
  13169. var supportsGroup = typeof console.groupCollapsed === 'function';
  13170. if (supportsGroup) {
  13171. console.groupCollapsed("[Click to expand] %c<".concat(result.displayName || 'Component', " />"), // --dom-tag-name-color is the CSS variable Chrome styles HTML elements with in the console.
  13172. 'color: var(--dom-tag-name-color); font-weight: normal;');
  13173. }
  13174. if (result.props !== null) {
  13175. console.log('Props:', result.props);
  13176. }
  13177. if (result.state !== null) {
  13178. console.log('State:', result.state);
  13179. }
  13180. if (result.context !== null) {
  13181. console.log('Context:', result.context);
  13182. }
  13183. var nativeNode = findNativeNodeForInternalID(id);
  13184. if (nativeNode !== null) {
  13185. console.log('Node:', nativeNode);
  13186. }
  13187. if (window.chrome || /firefox/i.test(navigator.userAgent)) {
  13188. console.log('Right-click any value to save it as a global variable for further inspection.');
  13189. }
  13190. if (supportsGroup) {
  13191. console.groupEnd();
  13192. }
  13193. }
  13194. function prepareViewAttributeSource(id, path) {
  13195. var inspectedElement = inspectElementRaw(id);
  13196. if (inspectedElement !== null) {
  13197. window.$attribute = Object(src_utils["j" /* getInObject */])(inspectedElement, path);
  13198. }
  13199. }
  13200. function prepareViewElementSource(id) {
  13201. var internalInstance = idToInternalInstanceMap.get(id);
  13202. if (internalInstance == null) {
  13203. console.warn("Could not find instance with id \"".concat(id, "\""));
  13204. return;
  13205. }
  13206. var element = internalInstance._currentElement;
  13207. if (element == null) {
  13208. console.warn("Could not find element with id \"".concat(id, "\""));
  13209. return;
  13210. }
  13211. global.$type = element.type;
  13212. }
  13213. function deletePath(type, id, hookID, path) {
  13214. var internalInstance = idToInternalInstanceMap.get(id);
  13215. if (internalInstance != null) {
  13216. var publicInstance = internalInstance._instance;
  13217. if (publicInstance != null) {
  13218. switch (type) {
  13219. case 'context':
  13220. Object(src_utils["c" /* deletePathInObject */])(publicInstance.context, path);
  13221. forceUpdate(publicInstance);
  13222. break;
  13223. case 'hooks':
  13224. throw new Error('Hooks not supported by this renderer');
  13225. case 'props':
  13226. var element = internalInstance._currentElement;
  13227. internalInstance._currentElement = _objectSpread(_objectSpread({}, element), {}, {
  13228. props: Object(utils["c" /* copyWithDelete */])(element.props, path)
  13229. });
  13230. forceUpdate(publicInstance);
  13231. break;
  13232. case 'state':
  13233. Object(src_utils["c" /* deletePathInObject */])(publicInstance.state, path);
  13234. forceUpdate(publicInstance);
  13235. break;
  13236. }
  13237. }
  13238. }
  13239. }
  13240. function renamePath(type, id, hookID, oldPath, newPath) {
  13241. var internalInstance = idToInternalInstanceMap.get(id);
  13242. if (internalInstance != null) {
  13243. var publicInstance = internalInstance._instance;
  13244. if (publicInstance != null) {
  13245. switch (type) {
  13246. case 'context':
  13247. Object(src_utils["n" /* renamePathInObject */])(publicInstance.context, oldPath, newPath);
  13248. forceUpdate(publicInstance);
  13249. break;
  13250. case 'hooks':
  13251. throw new Error('Hooks not supported by this renderer');
  13252. case 'props':
  13253. var element = internalInstance._currentElement;
  13254. internalInstance._currentElement = _objectSpread(_objectSpread({}, element), {}, {
  13255. props: Object(utils["d" /* copyWithRename */])(element.props, oldPath, newPath)
  13256. });
  13257. forceUpdate(publicInstance);
  13258. break;
  13259. case 'state':
  13260. Object(src_utils["n" /* renamePathInObject */])(publicInstance.state, oldPath, newPath);
  13261. forceUpdate(publicInstance);
  13262. break;
  13263. }
  13264. }
  13265. }
  13266. }
  13267. function overrideValueAtPath(type, id, hookID, path, value) {
  13268. var internalInstance = idToInternalInstanceMap.get(id);
  13269. if (internalInstance != null) {
  13270. var publicInstance = internalInstance._instance;
  13271. if (publicInstance != null) {
  13272. switch (type) {
  13273. case 'context':
  13274. Object(src_utils["o" /* setInObject */])(publicInstance.context, path, value);
  13275. forceUpdate(publicInstance);
  13276. break;
  13277. case 'hooks':
  13278. throw new Error('Hooks not supported by this renderer');
  13279. case 'props':
  13280. var element = internalInstance._currentElement;
  13281. internalInstance._currentElement = _objectSpread(_objectSpread({}, element), {}, {
  13282. props: Object(utils["e" /* copyWithSet */])(element.props, path, value)
  13283. });
  13284. forceUpdate(publicInstance);
  13285. break;
  13286. case 'state':
  13287. Object(src_utils["o" /* setInObject */])(publicInstance.state, path, value);
  13288. forceUpdate(publicInstance);
  13289. break;
  13290. }
  13291. }
  13292. }
  13293. } // v16+ only features
  13294. var getProfilingData = function getProfilingData() {
  13295. throw new Error('getProfilingData not supported by this renderer');
  13296. };
  13297. var handleCommitFiberRoot = function handleCommitFiberRoot() {
  13298. throw new Error('handleCommitFiberRoot not supported by this renderer');
  13299. };
  13300. var handleCommitFiberUnmount = function handleCommitFiberUnmount() {
  13301. throw new Error('handleCommitFiberUnmount not supported by this renderer');
  13302. };
  13303. var handlePostCommitFiberRoot = function handlePostCommitFiberRoot() {
  13304. throw new Error('handlePostCommitFiberRoot not supported by this renderer');
  13305. };
  13306. var overrideError = function overrideError() {
  13307. throw new Error('overrideError not supported by this renderer');
  13308. };
  13309. var overrideSuspense = function overrideSuspense() {
  13310. throw new Error('overrideSuspense not supported by this renderer');
  13311. };
  13312. var startProfiling = function startProfiling() {// Do not throw, since this would break a multi-root scenario where v15 and v16 were both present.
  13313. };
  13314. var stopProfiling = function stopProfiling() {// Do not throw, since this would break a multi-root scenario where v15 and v16 were both present.
  13315. };
  13316. function getBestMatchForTrackedPath() {
  13317. // Not implemented.
  13318. return null;
  13319. }
  13320. function getPathForElement(id) {
  13321. // Not implemented.
  13322. return null;
  13323. }
  13324. function updateComponentFilters(componentFilters) {// Not implemented.
  13325. }
  13326. function setTraceUpdatesEnabled(enabled) {// Not implemented.
  13327. }
  13328. function setTrackedPath(path) {// Not implemented.
  13329. }
  13330. function getOwnersList(id) {
  13331. // Not implemented.
  13332. return null;
  13333. }
  13334. function clearErrorsAndWarnings() {// Not implemented
  13335. }
  13336. function clearErrorsForFiberID(id) {// Not implemented
  13337. }
  13338. function clearWarningsForFiberID(id) {// Not implemented
  13339. }
  13340. function patchConsoleForStrictMode() {}
  13341. function unpatchConsoleForStrictMode() {}
  13342. return {
  13343. clearErrorsAndWarnings: clearErrorsAndWarnings,
  13344. clearErrorsForFiberID: clearErrorsForFiberID,
  13345. clearWarningsForFiberID: clearWarningsForFiberID,
  13346. cleanup: cleanup,
  13347. copyElementPath: copyElementPath,
  13348. deletePath: deletePath,
  13349. flushInitialOperations: flushInitialOperations,
  13350. getBestMatchForTrackedPath: getBestMatchForTrackedPath,
  13351. getDisplayNameForFiberID: getDisplayNameForFiberID,
  13352. getFiberForNative: getFiberForNative,
  13353. getFiberIDForNative: getInternalIDForNative,
  13354. getInstanceAndStyle: getInstanceAndStyle,
  13355. findNativeNodesForFiberID: function findNativeNodesForFiberID(id) {
  13356. var nativeNode = findNativeNodeForInternalID(id);
  13357. return nativeNode == null ? null : [nativeNode];
  13358. },
  13359. getOwnersList: getOwnersList,
  13360. getPathForElement: getPathForElement,
  13361. getProfilingData: getProfilingData,
  13362. handleCommitFiberRoot: handleCommitFiberRoot,
  13363. handleCommitFiberUnmount: handleCommitFiberUnmount,
  13364. handlePostCommitFiberRoot: handlePostCommitFiberRoot,
  13365. inspectElement: inspectElement,
  13366. logElementToConsole: logElementToConsole,
  13367. overrideError: overrideError,
  13368. overrideSuspense: overrideSuspense,
  13369. overrideValueAtPath: overrideValueAtPath,
  13370. renamePath: renamePath,
  13371. patchConsoleForStrictMode: patchConsoleForStrictMode,
  13372. prepareViewAttributeSource: prepareViewAttributeSource,
  13373. prepareViewElementSource: prepareViewElementSource,
  13374. renderer: renderer,
  13375. setTraceUpdatesEnabled: setTraceUpdatesEnabled,
  13376. setTrackedPath: setTrackedPath,
  13377. startProfiling: startProfiling,
  13378. stopProfiling: stopProfiling,
  13379. storeAsGlobal: storeAsGlobal,
  13380. unpatchConsoleForStrictMode: unpatchConsoleForStrictMode,
  13381. updateComponentFilters: updateComponentFilters
  13382. };
  13383. }
  13384. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/index.js
  13385. /**
  13386. * Copyright (c) Meta Platforms, Inc. and affiliates.
  13387. *
  13388. * This source code is licensed under the MIT license found in the
  13389. * LICENSE file in the root directory of this source tree.
  13390. *
  13391. *
  13392. */
  13393. function initBackend(hook, agent, global) {
  13394. if (hook == null) {
  13395. // DevTools didn't get injected into this page (maybe b'c of the contentType).
  13396. return function () {};
  13397. }
  13398. var subs = [hook.sub('renderer-attached', function (_ref) {
  13399. var id = _ref.id,
  13400. renderer = _ref.renderer,
  13401. rendererInterface = _ref.rendererInterface;
  13402. agent.setRendererInterface(id, rendererInterface); // Now that the Store and the renderer interface are connected,
  13403. // it's time to flush the pending operation codes to the frontend.
  13404. rendererInterface.flushInitialOperations();
  13405. }), hook.sub('unsupported-renderer-version', function (id) {
  13406. agent.onUnsupportedRenderer(id);
  13407. }), hook.sub('fastRefreshScheduled', agent.onFastRefreshScheduled), hook.sub('operations', agent.onHookOperations), hook.sub('traceUpdates', agent.onTraceUpdates) // TODO Add additional subscriptions required for profiling mode
  13408. ];
  13409. var attachRenderer = function attachRenderer(id, renderer) {
  13410. var rendererInterface = hook.rendererInterfaces.get(id); // Inject any not-yet-injected renderers (if we didn't reload-and-profile)
  13411. if (rendererInterface == null) {
  13412. if (typeof renderer.findFiberByHostInstance === 'function') {
  13413. // react-reconciler v16+
  13414. rendererInterface = Object(backend_renderer["a" /* attach */])(hook, id, renderer, global);
  13415. } else if (renderer.ComponentTree) {
  13416. // react-dom v15
  13417. rendererInterface = renderer_attach(hook, id, renderer, global);
  13418. } else {// Older react-dom or other unsupported renderer version
  13419. }
  13420. if (rendererInterface != null) {
  13421. hook.rendererInterfaces.set(id, rendererInterface);
  13422. }
  13423. } // Notify the DevTools frontend about new renderers.
  13424. // This includes any that were attached early (via __REACT_DEVTOOLS_ATTACH__).
  13425. if (rendererInterface != null) {
  13426. hook.emit('renderer-attached', {
  13427. id: id,
  13428. renderer: renderer,
  13429. rendererInterface: rendererInterface
  13430. });
  13431. } else {
  13432. hook.emit('unsupported-renderer-version', id);
  13433. }
  13434. }; // Connect renderers that have already injected themselves.
  13435. hook.renderers.forEach(function (renderer, id) {
  13436. attachRenderer(id, renderer);
  13437. }); // Connect any new renderers that injected themselves.
  13438. subs.push(hook.sub('renderer', function (_ref2) {
  13439. var id = _ref2.id,
  13440. renderer = _ref2.renderer;
  13441. attachRenderer(id, renderer);
  13442. }));
  13443. hook.emit('react-devtools', agent);
  13444. hook.reactDevtoolsAgent = agent;
  13445. var onAgentShutdown = function onAgentShutdown() {
  13446. subs.forEach(function (fn) {
  13447. return fn();
  13448. });
  13449. hook.rendererInterfaces.forEach(function (rendererInterface) {
  13450. rendererInterface.cleanup();
  13451. });
  13452. hook.reactDevtoolsAgent = null;
  13453. };
  13454. agent.addListener('shutdown', onAgentShutdown);
  13455. subs.push(function () {
  13456. agent.removeListener('shutdown', onAgentShutdown);
  13457. });
  13458. return function () {
  13459. subs.forEach(function (fn) {
  13460. return fn();
  13461. });
  13462. };
  13463. }
  13464. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/NativeStyleEditor/resolveBoxStyle.js
  13465. /**
  13466. * Copyright (c) Meta Platforms, Inc. and affiliates.
  13467. *
  13468. * This source code is licensed under the MIT license found in the
  13469. * LICENSE file in the root directory of this source tree.
  13470. *
  13471. *
  13472. */
  13473. /**
  13474. * This mirrors react-native/Libraries/Inspector/resolveBoxStyle.js (but without RTL support).
  13475. *
  13476. * Resolve a style property into it's component parts, e.g.
  13477. *
  13478. * resolveBoxStyle('margin', {margin: 5, marginBottom: 10})
  13479. * -> {top: 5, left: 5, right: 5, bottom: 10}
  13480. */
  13481. function resolveBoxStyle(prefix, style) {
  13482. var hasParts = false;
  13483. var result = {
  13484. bottom: 0,
  13485. left: 0,
  13486. right: 0,
  13487. top: 0
  13488. };
  13489. var styleForAll = style[prefix];
  13490. if (styleForAll != null) {
  13491. // eslint-disable-next-line no-for-of-loops/no-for-of-loops
  13492. for (var _i = 0, _Object$keys = Object.keys(result); _i < _Object$keys.length; _i++) {
  13493. var key = _Object$keys[_i];
  13494. result[key] = styleForAll;
  13495. }
  13496. hasParts = true;
  13497. }
  13498. var styleForHorizontal = style[prefix + 'Horizontal'];
  13499. if (styleForHorizontal != null) {
  13500. result.left = styleForHorizontal;
  13501. result.right = styleForHorizontal;
  13502. hasParts = true;
  13503. } else {
  13504. var styleForLeft = style[prefix + 'Left'];
  13505. if (styleForLeft != null) {
  13506. result.left = styleForLeft;
  13507. hasParts = true;
  13508. }
  13509. var styleForRight = style[prefix + 'Right'];
  13510. if (styleForRight != null) {
  13511. result.right = styleForRight;
  13512. hasParts = true;
  13513. }
  13514. var styleForEnd = style[prefix + 'End'];
  13515. if (styleForEnd != null) {
  13516. // TODO RTL support
  13517. result.right = styleForEnd;
  13518. hasParts = true;
  13519. }
  13520. var styleForStart = style[prefix + 'Start'];
  13521. if (styleForStart != null) {
  13522. // TODO RTL support
  13523. result.left = styleForStart;
  13524. hasParts = true;
  13525. }
  13526. }
  13527. var styleForVertical = style[prefix + 'Vertical'];
  13528. if (styleForVertical != null) {
  13529. result.bottom = styleForVertical;
  13530. result.top = styleForVertical;
  13531. hasParts = true;
  13532. } else {
  13533. var styleForBottom = style[prefix + 'Bottom'];
  13534. if (styleForBottom != null) {
  13535. result.bottom = styleForBottom;
  13536. hasParts = true;
  13537. }
  13538. var styleForTop = style[prefix + 'Top'];
  13539. if (styleForTop != null) {
  13540. result.top = styleForTop;
  13541. hasParts = true;
  13542. }
  13543. }
  13544. return hasParts ? result : null;
  13545. }
  13546. // EXTERNAL MODULE: ../react-devtools-shared/src/isArray.js
  13547. var isArray = __webpack_require__(6);
  13548. // CONCATENATED MODULE: ../react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor.js
  13549. function setupNativeStyleEditor_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { setupNativeStyleEditor_typeof = function _typeof(obj) { return typeof obj; }; } else { setupNativeStyleEditor_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return setupNativeStyleEditor_typeof(obj); }
  13550. function setupNativeStyleEditor_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  13551. /**
  13552. * Copyright (c) Meta Platforms, Inc. and affiliates.
  13553. *
  13554. * This source code is licensed under the MIT license found in the
  13555. * LICENSE file in the root directory of this source tree.
  13556. *
  13557. *
  13558. */
  13559. function setupNativeStyleEditor(bridge, agent, resolveNativeStyle, validAttributes) {
  13560. bridge.addListener('NativeStyleEditor_measure', function (_ref) {
  13561. var id = _ref.id,
  13562. rendererID = _ref.rendererID;
  13563. measureStyle(agent, bridge, resolveNativeStyle, id, rendererID);
  13564. });
  13565. bridge.addListener('NativeStyleEditor_renameAttribute', function (_ref2) {
  13566. var id = _ref2.id,
  13567. rendererID = _ref2.rendererID,
  13568. oldName = _ref2.oldName,
  13569. newName = _ref2.newName,
  13570. value = _ref2.value;
  13571. renameStyle(agent, id, rendererID, oldName, newName, value);
  13572. setTimeout(function () {
  13573. return measureStyle(agent, bridge, resolveNativeStyle, id, rendererID);
  13574. });
  13575. });
  13576. bridge.addListener('NativeStyleEditor_setValue', function (_ref3) {
  13577. var id = _ref3.id,
  13578. rendererID = _ref3.rendererID,
  13579. name = _ref3.name,
  13580. value = _ref3.value;
  13581. setStyle(agent, id, rendererID, name, value);
  13582. setTimeout(function () {
  13583. return measureStyle(agent, bridge, resolveNativeStyle, id, rendererID);
  13584. });
  13585. });
  13586. bridge.send('isNativeStyleEditorSupported', {
  13587. isSupported: true,
  13588. validAttributes: validAttributes
  13589. });
  13590. }
  13591. var EMPTY_BOX_STYLE = {
  13592. top: 0,
  13593. left: 0,
  13594. right: 0,
  13595. bottom: 0
  13596. };
  13597. var componentIDToStyleOverrides = new Map();
  13598. function measureStyle(agent, bridge, resolveNativeStyle, id, rendererID) {
  13599. var data = agent.getInstanceAndStyle({
  13600. id: id,
  13601. rendererID: rendererID
  13602. });
  13603. if (!data || !data.style) {
  13604. bridge.send('NativeStyleEditor_styleAndLayout', {
  13605. id: id,
  13606. layout: null,
  13607. style: null
  13608. });
  13609. return;
  13610. }
  13611. var instance = data.instance,
  13612. style = data.style;
  13613. var resolvedStyle = resolveNativeStyle(style); // If it's a host component we edited before, amend styles.
  13614. var styleOverrides = componentIDToStyleOverrides.get(id);
  13615. if (styleOverrides != null) {
  13616. resolvedStyle = Object.assign({}, resolvedStyle, styleOverrides);
  13617. }
  13618. if (!instance || typeof instance.measure !== 'function') {
  13619. bridge.send('NativeStyleEditor_styleAndLayout', {
  13620. id: id,
  13621. layout: null,
  13622. style: resolvedStyle || null
  13623. });
  13624. return;
  13625. }
  13626. instance.measure(function (x, y, width, height, left, top) {
  13627. // RN Android sometimes returns undefined here. Don't send measurements in this case.
  13628. // https://github.com/jhen0409/react-native-debugger/issues/84#issuecomment-304611817
  13629. if (typeof x !== 'number') {
  13630. bridge.send('NativeStyleEditor_styleAndLayout', {
  13631. id: id,
  13632. layout: null,
  13633. style: resolvedStyle || null
  13634. });
  13635. return;
  13636. }
  13637. var margin = resolvedStyle != null && resolveBoxStyle('margin', resolvedStyle) || EMPTY_BOX_STYLE;
  13638. var padding = resolvedStyle != null && resolveBoxStyle('padding', resolvedStyle) || EMPTY_BOX_STYLE;
  13639. bridge.send('NativeStyleEditor_styleAndLayout', {
  13640. id: id,
  13641. layout: {
  13642. x: x,
  13643. y: y,
  13644. width: width,
  13645. height: height,
  13646. left: left,
  13647. top: top,
  13648. margin: margin,
  13649. padding: padding
  13650. },
  13651. style: resolvedStyle || null
  13652. });
  13653. });
  13654. }
  13655. function shallowClone(object) {
  13656. var cloned = {};
  13657. for (var n in object) {
  13658. cloned[n] = object[n];
  13659. }
  13660. return cloned;
  13661. }
  13662. function renameStyle(agent, id, rendererID, oldName, newName, value) {
  13663. var _ref4;
  13664. var data = agent.getInstanceAndStyle({
  13665. id: id,
  13666. rendererID: rendererID
  13667. });
  13668. if (!data || !data.style) {
  13669. return;
  13670. }
  13671. var instance = data.instance,
  13672. style = data.style;
  13673. var newStyle = newName ? (_ref4 = {}, setupNativeStyleEditor_defineProperty(_ref4, oldName, undefined), setupNativeStyleEditor_defineProperty(_ref4, newName, value), _ref4) : setupNativeStyleEditor_defineProperty({}, oldName, undefined);
  13674. var customStyle; // TODO It would be nice if the renderer interface abstracted this away somehow.
  13675. if (instance !== null && typeof instance.setNativeProps === 'function') {
  13676. // In the case of a host component, we need to use setNativeProps().
  13677. // Remember to "correct" resolved styles when we read them next time.
  13678. var styleOverrides = componentIDToStyleOverrides.get(id);
  13679. if (!styleOverrides) {
  13680. componentIDToStyleOverrides.set(id, newStyle);
  13681. } else {
  13682. Object.assign(styleOverrides, newStyle);
  13683. } // TODO Fabric does not support setNativeProps; chat with Sebastian or Eli
  13684. instance.setNativeProps({
  13685. style: newStyle
  13686. });
  13687. } else if (Object(isArray["a" /* default */])(style)) {
  13688. var lastIndex = style.length - 1;
  13689. if (setupNativeStyleEditor_typeof(style[lastIndex]) === 'object' && !Object(isArray["a" /* default */])(style[lastIndex])) {
  13690. customStyle = shallowClone(style[lastIndex]);
  13691. delete customStyle[oldName];
  13692. if (newName) {
  13693. customStyle[newName] = value;
  13694. } else {
  13695. customStyle[oldName] = undefined;
  13696. }
  13697. agent.overrideValueAtPath({
  13698. type: 'props',
  13699. id: id,
  13700. rendererID: rendererID,
  13701. path: ['style', lastIndex],
  13702. value: customStyle
  13703. });
  13704. } else {
  13705. agent.overrideValueAtPath({
  13706. type: 'props',
  13707. id: id,
  13708. rendererID: rendererID,
  13709. path: ['style'],
  13710. value: style.concat([newStyle])
  13711. });
  13712. }
  13713. } else if (setupNativeStyleEditor_typeof(style) === 'object') {
  13714. customStyle = shallowClone(style);
  13715. delete customStyle[oldName];
  13716. if (newName) {
  13717. customStyle[newName] = value;
  13718. } else {
  13719. customStyle[oldName] = undefined;
  13720. }
  13721. agent.overrideValueAtPath({
  13722. type: 'props',
  13723. id: id,
  13724. rendererID: rendererID,
  13725. path: ['style'],
  13726. value: customStyle
  13727. });
  13728. } else {
  13729. agent.overrideValueAtPath({
  13730. type: 'props',
  13731. id: id,
  13732. rendererID: rendererID,
  13733. path: ['style'],
  13734. value: [style, newStyle]
  13735. });
  13736. }
  13737. agent.emit('hideNativeHighlight');
  13738. }
  13739. function setStyle(agent, id, rendererID, name, value) {
  13740. var data = agent.getInstanceAndStyle({
  13741. id: id,
  13742. rendererID: rendererID
  13743. });
  13744. if (!data || !data.style) {
  13745. return;
  13746. }
  13747. var instance = data.instance,
  13748. style = data.style;
  13749. var newStyle = setupNativeStyleEditor_defineProperty({}, name, value); // TODO It would be nice if the renderer interface abstracted this away somehow.
  13750. if (instance !== null && typeof instance.setNativeProps === 'function') {
  13751. // In the case of a host component, we need to use setNativeProps().
  13752. // Remember to "correct" resolved styles when we read them next time.
  13753. var styleOverrides = componentIDToStyleOverrides.get(id);
  13754. if (!styleOverrides) {
  13755. componentIDToStyleOverrides.set(id, newStyle);
  13756. } else {
  13757. Object.assign(styleOverrides, newStyle);
  13758. } // TODO Fabric does not support setNativeProps; chat with Sebastian or Eli
  13759. instance.setNativeProps({
  13760. style: newStyle
  13761. });
  13762. } else if (Object(isArray["a" /* default */])(style)) {
  13763. var lastLength = style.length - 1;
  13764. if (setupNativeStyleEditor_typeof(style[lastLength]) === 'object' && !Object(isArray["a" /* default */])(style[lastLength])) {
  13765. agent.overrideValueAtPath({
  13766. type: 'props',
  13767. id: id,
  13768. rendererID: rendererID,
  13769. path: ['style', lastLength, name],
  13770. value: value
  13771. });
  13772. } else {
  13773. agent.overrideValueAtPath({
  13774. type: 'props',
  13775. id: id,
  13776. rendererID: rendererID,
  13777. path: ['style'],
  13778. value: style.concat([newStyle])
  13779. });
  13780. }
  13781. } else {
  13782. agent.overrideValueAtPath({
  13783. type: 'props',
  13784. id: id,
  13785. rendererID: rendererID,
  13786. path: ['style'],
  13787. value: [style, newStyle]
  13788. });
  13789. }
  13790. agent.emit('hideNativeHighlight');
  13791. }
  13792. // CONCATENATED MODULE: ./src/cachedSettings.js
  13793. /**
  13794. * Copyright (c) Facebook, Inc. and its affiliates.
  13795. *
  13796. * This source code is licensed under the MIT license found in the
  13797. * LICENSE file in the root directory of this source tree.
  13798. *
  13799. *
  13800. */
  13801. // Note: all keys should be optional in this type, because users can use newer
  13802. // versions of React DevTools with older versions of React Native, and the object
  13803. // provided by React Native may not include all of this type's fields.
  13804. function initializeUsingCachedSettings(devToolsSettingsManager) {
  13805. initializeConsolePatchSettings(devToolsSettingsManager);
  13806. }
  13807. function initializeConsolePatchSettings(devToolsSettingsManager) {
  13808. if (devToolsSettingsManager.getConsolePatchSettings == null) {
  13809. return;
  13810. }
  13811. var consolePatchSettingsString = devToolsSettingsManager.getConsolePatchSettings();
  13812. if (consolePatchSettingsString == null) {
  13813. return;
  13814. }
  13815. var parsedConsolePatchSettings = parseConsolePatchSettings(consolePatchSettingsString);
  13816. if (parsedConsolePatchSettings == null) {
  13817. return;
  13818. }
  13819. Object(backend_console["f" /* writeConsolePatchSettingsToWindow */])(parsedConsolePatchSettings);
  13820. }
  13821. function parseConsolePatchSettings(consolePatchSettingsString) {
  13822. var _castBool, _castBool2, _castBool3, _castBool4, _castBrowserTheme;
  13823. var parsedValue = JSON.parse(consolePatchSettingsString !== null && consolePatchSettingsString !== void 0 ? consolePatchSettingsString : '{}');
  13824. var appendComponentStack = parsedValue.appendComponentStack,
  13825. breakOnConsoleErrors = parsedValue.breakOnConsoleErrors,
  13826. showInlineWarningsAndErrors = parsedValue.showInlineWarningsAndErrors,
  13827. hideConsoleLogsInStrictMode = parsedValue.hideConsoleLogsInStrictMode,
  13828. browserTheme = parsedValue.browserTheme;
  13829. return {
  13830. appendComponentStack: (_castBool = Object(src_utils["a" /* castBool */])(appendComponentStack)) !== null && _castBool !== void 0 ? _castBool : true,
  13831. breakOnConsoleErrors: (_castBool2 = Object(src_utils["a" /* castBool */])(breakOnConsoleErrors)) !== null && _castBool2 !== void 0 ? _castBool2 : false,
  13832. showInlineWarningsAndErrors: (_castBool3 = Object(src_utils["a" /* castBool */])(showInlineWarningsAndErrors)) !== null && _castBool3 !== void 0 ? _castBool3 : true,
  13833. hideConsoleLogsInStrictMode: (_castBool4 = Object(src_utils["a" /* castBool */])(hideConsoleLogsInStrictMode)) !== null && _castBool4 !== void 0 ? _castBool4 : false,
  13834. browserTheme: (_castBrowserTheme = Object(src_utils["b" /* castBrowserTheme */])(browserTheme)) !== null && _castBrowserTheme !== void 0 ? _castBrowserTheme : 'dark'
  13835. };
  13836. }
  13837. function cacheConsolePatchSettings(devToolsSettingsManager, value) {
  13838. if (devToolsSettingsManager.setConsolePatchSettings == null) {
  13839. return;
  13840. }
  13841. devToolsSettingsManager.setConsolePatchSettings(JSON.stringify(value));
  13842. }
  13843. // CONCATENATED MODULE: ./src/backend.js
  13844. /**
  13845. * Copyright (c) Meta Platforms, Inc. and affiliates.
  13846. *
  13847. * This source code is licensed under the MIT license found in the
  13848. * LICENSE file in the root directory of this source tree.
  13849. *
  13850. *
  13851. */
  13852. installHook(window);
  13853. var backend_hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
  13854. var savedComponentFilters = Object(src_utils["g" /* getDefaultComponentFilters */])();
  13855. function backend_debug(methodName) {
  13856. if (constants["s" /* __DEBUG__ */]) {
  13857. var _console;
  13858. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  13859. args[_key - 1] = arguments[_key];
  13860. }
  13861. (_console = console).log.apply(_console, ["%c[core/backend] %c".concat(methodName), 'color: teal; font-weight: bold;', 'font-weight: bold;'].concat(args));
  13862. }
  13863. }
  13864. function connectToDevTools(options) {
  13865. if (backend_hook == null) {
  13866. // DevTools didn't get injected into this page (maybe b'c of the contentType).
  13867. return;
  13868. }
  13869. var _ref = options || {},
  13870. _ref$host = _ref.host,
  13871. host = _ref$host === void 0 ? 'localhost' : _ref$host,
  13872. nativeStyleEditorValidAttributes = _ref.nativeStyleEditorValidAttributes,
  13873. _ref$useHttps = _ref.useHttps,
  13874. useHttps = _ref$useHttps === void 0 ? false : _ref$useHttps,
  13875. _ref$port = _ref.port,
  13876. port = _ref$port === void 0 ? 8097 : _ref$port,
  13877. websocket = _ref.websocket,
  13878. _ref$resolveRNStyle = _ref.resolveRNStyle,
  13879. resolveRNStyle = _ref$resolveRNStyle === void 0 ? null : _ref$resolveRNStyle,
  13880. _ref$retryConnectionD = _ref.retryConnectionDelay,
  13881. retryConnectionDelay = _ref$retryConnectionD === void 0 ? 2000 : _ref$retryConnectionD,
  13882. _ref$isAppActive = _ref.isAppActive,
  13883. isAppActive = _ref$isAppActive === void 0 ? function () {
  13884. return true;
  13885. } : _ref$isAppActive,
  13886. devToolsSettingsManager = _ref.devToolsSettingsManager;
  13887. var protocol = useHttps ? 'wss' : 'ws';
  13888. var retryTimeoutID = null;
  13889. function scheduleRetry() {
  13890. if (retryTimeoutID === null) {
  13891. // Two seconds because RN had issues with quick retries.
  13892. retryTimeoutID = setTimeout(function () {
  13893. return connectToDevTools(options);
  13894. }, retryConnectionDelay);
  13895. }
  13896. }
  13897. if (devToolsSettingsManager != null) {
  13898. try {
  13899. initializeUsingCachedSettings(devToolsSettingsManager);
  13900. } catch (e) {
  13901. // If we call a method on devToolsSettingsManager that throws, or if
  13902. // is invalid data read out, don't throw and don't interrupt initialization
  13903. console.error(e);
  13904. }
  13905. }
  13906. if (!isAppActive()) {
  13907. // If the app is in background, maybe retry later.
  13908. // Don't actually attempt to connect until we're in foreground.
  13909. scheduleRetry();
  13910. return;
  13911. }
  13912. var bridge = null;
  13913. var messageListeners = [];
  13914. var uri = protocol + '://' + host + ':' + port; // If existing websocket is passed, use it.
  13915. // This is necessary to support our custom integrations.
  13916. // See D6251744.
  13917. var ws = websocket ? websocket : new window.WebSocket(uri);
  13918. ws.onclose = handleClose;
  13919. ws.onerror = handleFailed;
  13920. ws.onmessage = handleMessage;
  13921. ws.onopen = function () {
  13922. bridge = new src_bridge({
  13923. listen: function listen(fn) {
  13924. messageListeners.push(fn);
  13925. return function () {
  13926. var index = messageListeners.indexOf(fn);
  13927. if (index >= 0) {
  13928. messageListeners.splice(index, 1);
  13929. }
  13930. };
  13931. },
  13932. send: function send(event, payload, transferable) {
  13933. if (ws.readyState === ws.OPEN) {
  13934. if (constants["s" /* __DEBUG__ */]) {
  13935. backend_debug('wall.send()', event, payload);
  13936. }
  13937. ws.send(JSON.stringify({
  13938. event: event,
  13939. payload: payload
  13940. }));
  13941. } else {
  13942. if (constants["s" /* __DEBUG__ */]) {
  13943. backend_debug('wall.send()', 'Shutting down bridge because of closed WebSocket connection');
  13944. }
  13945. if (bridge !== null) {
  13946. bridge.shutdown();
  13947. }
  13948. scheduleRetry();
  13949. }
  13950. }
  13951. });
  13952. bridge.addListener('updateComponentFilters', function (componentFilters) {
  13953. // Save filter changes in memory, in case DevTools is reloaded.
  13954. // In that case, the renderer will already be using the updated values.
  13955. // We'll lose these in between backend reloads but that can't be helped.
  13956. savedComponentFilters = componentFilters;
  13957. });
  13958. if (devToolsSettingsManager != null && bridge != null) {
  13959. bridge.addListener('updateConsolePatchSettings', function (consolePatchSettings) {
  13960. return cacheConsolePatchSettings(devToolsSettingsManager, consolePatchSettings);
  13961. });
  13962. } // The renderer interface doesn't read saved component filters directly,
  13963. // because they are generally stored in localStorage within the context of the extension.
  13964. // Because of this it relies on the extension to pass filters.
  13965. // In the case of the standalone DevTools being used with a website,
  13966. // saved filters are injected along with the backend script tag so we shouldn't override them here.
  13967. // This injection strategy doesn't work for React Native though.
  13968. // Ideally the backend would save the filters itself, but RN doesn't provide a sync storage solution.
  13969. // So for now we just fall back to using the default filters...
  13970. if (window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ == null) {
  13971. // $FlowFixMe[incompatible-use] found when upgrading Flow
  13972. bridge.send('overrideComponentFilters', savedComponentFilters);
  13973. } // TODO (npm-packages) Warn if "isBackendStorageAPISupported"
  13974. // $FlowFixMe[incompatible-call] found when upgrading Flow
  13975. var agent = new agent_Agent(bridge);
  13976. agent.addListener('shutdown', function () {
  13977. // If we received 'shutdown' from `agent`, we assume the `bridge` is already shutting down,
  13978. // and that caused the 'shutdown' event on the `agent`, so we don't need to call `bridge.shutdown()` here.
  13979. backend_hook.emit('shutdown');
  13980. });
  13981. initBackend(backend_hook, agent, window); // Setup React Native style editor if the environment supports it.
  13982. if (resolveRNStyle != null || backend_hook.resolveRNStyle != null) {
  13983. setupNativeStyleEditor( // $FlowFixMe[incompatible-call] found when upgrading Flow
  13984. bridge, agent, resolveRNStyle || backend_hook.resolveRNStyle, nativeStyleEditorValidAttributes || backend_hook.nativeStyleEditorValidAttributes || null);
  13985. } else {
  13986. // Otherwise listen to detect if the environment later supports it.
  13987. // For example, Flipper does not eagerly inject these values.
  13988. // Instead it relies on the React Native Inspector to lazily inject them.
  13989. var lazyResolveRNStyle;
  13990. var lazyNativeStyleEditorValidAttributes;
  13991. var initAfterTick = function initAfterTick() {
  13992. if (bridge !== null) {
  13993. setupNativeStyleEditor(bridge, agent, lazyResolveRNStyle, lazyNativeStyleEditorValidAttributes);
  13994. }
  13995. };
  13996. if (!backend_hook.hasOwnProperty('resolveRNStyle')) {
  13997. Object.defineProperty(backend_hook, 'resolveRNStyle', {
  13998. enumerable: false,
  13999. get: function get() {
  14000. return lazyResolveRNStyle;
  14001. },
  14002. set: function set(value) {
  14003. lazyResolveRNStyle = value;
  14004. initAfterTick();
  14005. }
  14006. });
  14007. }
  14008. if (!backend_hook.hasOwnProperty('nativeStyleEditorValidAttributes')) {
  14009. Object.defineProperty(backend_hook, 'nativeStyleEditorValidAttributes', {
  14010. enumerable: false,
  14011. get: function get() {
  14012. return lazyNativeStyleEditorValidAttributes;
  14013. },
  14014. set: function set(value) {
  14015. lazyNativeStyleEditorValidAttributes = value;
  14016. initAfterTick();
  14017. }
  14018. });
  14019. }
  14020. }
  14021. };
  14022. function handleClose() {
  14023. if (constants["s" /* __DEBUG__ */]) {
  14024. backend_debug('WebSocket.onclose');
  14025. }
  14026. if (bridge !== null) {
  14027. bridge.emit('shutdown');
  14028. }
  14029. scheduleRetry();
  14030. }
  14031. function handleFailed() {
  14032. if (constants["s" /* __DEBUG__ */]) {
  14033. backend_debug('WebSocket.onerror');
  14034. }
  14035. scheduleRetry();
  14036. }
  14037. function handleMessage(event) {
  14038. var data;
  14039. try {
  14040. if (typeof event.data === 'string') {
  14041. data = JSON.parse(event.data);
  14042. if (constants["s" /* __DEBUG__ */]) {
  14043. backend_debug('WebSocket.onmessage', data);
  14044. }
  14045. } else {
  14046. throw Error();
  14047. }
  14048. } catch (e) {
  14049. console.error('[React DevTools] Failed to parse JSON: ' + event.data);
  14050. return;
  14051. }
  14052. messageListeners.forEach(function (fn) {
  14053. try {
  14054. fn(data);
  14055. } catch (error) {
  14056. // jsc doesn't play so well with tracebacks that go into eval'd code,
  14057. // so the stack trace here will stop at the `eval()` call. Getting the
  14058. // message that caused the error is the best we can do for now.
  14059. console.log('[React DevTools] Error calling listener', data);
  14060. console.log('error:', error);
  14061. throw error;
  14062. }
  14063. });
  14064. }
  14065. }
  14066. /***/ })
  14067. /******/ ]);
  14068. });
  14069. //# sourceMappingURL=backend.js.map