ReactFabric-profiling.js 264 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @noflow
  8. * @nolint
  9. * @providesModule ReactFabric-profiling
  10. * @preventMunge
  11. * @generated
  12. */
  13. "use strict";
  14. require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore");
  15. var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"),
  16. React = require("react"),
  17. Scheduler = require("scheduler"),
  18. tracing = require("scheduler/tracing");
  19. function getParent(inst) {
  20. do inst = inst.return;
  21. while (inst && 5 !== inst.tag);
  22. return inst ? inst : null;
  23. }
  24. function traverseTwoPhase(inst, fn, arg) {
  25. for (var path = []; inst; ) path.push(inst), (inst = getParent(inst));
  26. for (inst = path.length; 0 < inst--; ) fn(path[inst], "captured", arg);
  27. for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg);
  28. }
  29. function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) {
  30. var funcArgs = Array.prototype.slice.call(arguments, 3);
  31. try {
  32. func.apply(context, funcArgs);
  33. } catch (error) {
  34. this.onError(error);
  35. }
  36. }
  37. var hasError = !1,
  38. caughtError = null,
  39. hasRethrowError = !1,
  40. rethrowError = null,
  41. reporter = {
  42. onError: function(error) {
  43. hasError = !0;
  44. caughtError = error;
  45. }
  46. };
  47. function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
  48. hasError = !1;
  49. caughtError = null;
  50. invokeGuardedCallbackImpl.apply(reporter, arguments);
  51. }
  52. function invokeGuardedCallbackAndCatchFirstError(
  53. name,
  54. func,
  55. context,
  56. a,
  57. b,
  58. c,
  59. d,
  60. e,
  61. f
  62. ) {
  63. invokeGuardedCallback.apply(this, arguments);
  64. if (hasError) {
  65. if (hasError) {
  66. var error = caughtError;
  67. hasError = !1;
  68. caughtError = null;
  69. } else
  70. throw Error(
  71. "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."
  72. );
  73. hasRethrowError || ((hasRethrowError = !0), (rethrowError = error));
  74. }
  75. }
  76. var getFiberCurrentPropsFromNode = null,
  77. getInstanceFromNode = null,
  78. getNodeFromInstance = null;
  79. function executeDispatch(event, listener, inst) {
  80. var type = event.type || "unknown-event";
  81. event.currentTarget = getNodeFromInstance(inst);
  82. invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
  83. event.currentTarget = null;
  84. }
  85. function executeDirectDispatch(event) {
  86. var dispatchListener = event._dispatchListeners,
  87. dispatchInstance = event._dispatchInstances;
  88. if (Array.isArray(dispatchListener))
  89. throw Error("executeDirectDispatch(...): Invalid `event`.");
  90. event.currentTarget = dispatchListener
  91. ? getNodeFromInstance(dispatchInstance)
  92. : null;
  93. dispatchListener = dispatchListener ? dispatchListener(event) : null;
  94. event.currentTarget = null;
  95. event._dispatchListeners = null;
  96. event._dispatchInstances = null;
  97. return dispatchListener;
  98. }
  99. function getListener(inst, registrationName) {
  100. var listener = inst.stateNode;
  101. if (!listener) return null;
  102. var props = getFiberCurrentPropsFromNode(listener);
  103. if (!props) return null;
  104. listener = props[registrationName];
  105. a: switch (registrationName) {
  106. case "onClick":
  107. case "onClickCapture":
  108. case "onDoubleClick":
  109. case "onDoubleClickCapture":
  110. case "onMouseDown":
  111. case "onMouseDownCapture":
  112. case "onMouseMove":
  113. case "onMouseMoveCapture":
  114. case "onMouseUp":
  115. case "onMouseUpCapture":
  116. case "onMouseEnter":
  117. (props = !props.disabled) ||
  118. ((inst = inst.type),
  119. (props = !(
  120. "button" === inst ||
  121. "input" === inst ||
  122. "select" === inst ||
  123. "textarea" === inst
  124. )));
  125. inst = !props;
  126. break a;
  127. default:
  128. inst = !1;
  129. }
  130. if (inst) return null;
  131. if (listener && "function" !== typeof listener)
  132. throw Error(
  133. "Expected `" +
  134. registrationName +
  135. "` listener to be a function, instead got a value of `" +
  136. typeof listener +
  137. "` type."
  138. );
  139. return listener;
  140. }
  141. function accumulateInto(current, next) {
  142. if (null == next)
  143. throw Error(
  144. "accumulateInto(...): Accumulated items must not be null or undefined."
  145. );
  146. if (null == current) return next;
  147. if (Array.isArray(current)) {
  148. if (Array.isArray(next)) return current.push.apply(current, next), current;
  149. current.push(next);
  150. return current;
  151. }
  152. return Array.isArray(next) ? [current].concat(next) : [current, next];
  153. }
  154. function forEachAccumulated(arr, cb, scope) {
  155. Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr);
  156. }
  157. function accumulateDirectionalDispatches(inst, phase, event) {
  158. if (
  159. (phase = getListener(
  160. inst,
  161. event.dispatchConfig.phasedRegistrationNames[phase]
  162. ))
  163. )
  164. (event._dispatchListeners = accumulateInto(
  165. event._dispatchListeners,
  166. phase
  167. )),
  168. (event._dispatchInstances = accumulateInto(
  169. event._dispatchInstances,
  170. inst
  171. ));
  172. }
  173. function accumulateTwoPhaseDispatchesSingle(event) {
  174. event &&
  175. event.dispatchConfig.phasedRegistrationNames &&
  176. traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
  177. }
  178. function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
  179. if (event && event.dispatchConfig.phasedRegistrationNames) {
  180. var targetInst = event._targetInst;
  181. targetInst = targetInst ? getParent(targetInst) : null;
  182. traverseTwoPhase(targetInst, accumulateDirectionalDispatches, event);
  183. }
  184. }
  185. function accumulateDirectDispatchesSingle(event) {
  186. if (event && event.dispatchConfig.registrationName) {
  187. var inst = event._targetInst;
  188. if (inst && event && event.dispatchConfig.registrationName) {
  189. var listener = getListener(inst, event.dispatchConfig.registrationName);
  190. listener &&
  191. ((event._dispatchListeners = accumulateInto(
  192. event._dispatchListeners,
  193. listener
  194. )),
  195. (event._dispatchInstances = accumulateInto(
  196. event._dispatchInstances,
  197. inst
  198. )));
  199. }
  200. }
  201. }
  202. function functionThatReturnsTrue() {
  203. return !0;
  204. }
  205. function functionThatReturnsFalse() {
  206. return !1;
  207. }
  208. function SyntheticEvent(
  209. dispatchConfig,
  210. targetInst,
  211. nativeEvent,
  212. nativeEventTarget
  213. ) {
  214. this.dispatchConfig = dispatchConfig;
  215. this._targetInst = targetInst;
  216. this.nativeEvent = nativeEvent;
  217. dispatchConfig = this.constructor.Interface;
  218. for (var propName in dispatchConfig)
  219. dispatchConfig.hasOwnProperty(propName) &&
  220. ((targetInst = dispatchConfig[propName])
  221. ? (this[propName] = targetInst(nativeEvent))
  222. : "target" === propName
  223. ? (this.target = nativeEventTarget)
  224. : (this[propName] = nativeEvent[propName]));
  225. this.isDefaultPrevented = (null != nativeEvent.defaultPrevented
  226. ? nativeEvent.defaultPrevented
  227. : !1 === nativeEvent.returnValue)
  228. ? functionThatReturnsTrue
  229. : functionThatReturnsFalse;
  230. this.isPropagationStopped = functionThatReturnsFalse;
  231. return this;
  232. }
  233. Object.assign(SyntheticEvent.prototype, {
  234. preventDefault: function() {
  235. this.defaultPrevented = !0;
  236. var event = this.nativeEvent;
  237. event &&
  238. (event.preventDefault
  239. ? event.preventDefault()
  240. : "unknown" !== typeof event.returnValue && (event.returnValue = !1),
  241. (this.isDefaultPrevented = functionThatReturnsTrue));
  242. },
  243. stopPropagation: function() {
  244. var event = this.nativeEvent;
  245. event &&
  246. (event.stopPropagation
  247. ? event.stopPropagation()
  248. : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = !0),
  249. (this.isPropagationStopped = functionThatReturnsTrue));
  250. },
  251. persist: function() {
  252. this.isPersistent = functionThatReturnsTrue;
  253. },
  254. isPersistent: functionThatReturnsFalse,
  255. destructor: function() {
  256. var Interface = this.constructor.Interface,
  257. propName;
  258. for (propName in Interface) this[propName] = null;
  259. this.nativeEvent = this._targetInst = this.dispatchConfig = null;
  260. this.isPropagationStopped = this.isDefaultPrevented = functionThatReturnsFalse;
  261. this._dispatchInstances = this._dispatchListeners = null;
  262. }
  263. });
  264. SyntheticEvent.Interface = {
  265. type: null,
  266. target: null,
  267. currentTarget: function() {
  268. return null;
  269. },
  270. eventPhase: null,
  271. bubbles: null,
  272. cancelable: null,
  273. timeStamp: function(event) {
  274. return event.timeStamp || Date.now();
  275. },
  276. defaultPrevented: null,
  277. isTrusted: null
  278. };
  279. SyntheticEvent.extend = function(Interface) {
  280. function E() {}
  281. function Class() {
  282. return Super.apply(this, arguments);
  283. }
  284. var Super = this;
  285. E.prototype = Super.prototype;
  286. var prototype = new E();
  287. Object.assign(prototype, Class.prototype);
  288. Class.prototype = prototype;
  289. Class.prototype.constructor = Class;
  290. Class.Interface = Object.assign({}, Super.Interface, Interface);
  291. Class.extend = Super.extend;
  292. addEventPoolingTo(Class);
  293. return Class;
  294. };
  295. addEventPoolingTo(SyntheticEvent);
  296. function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
  297. if (this.eventPool.length) {
  298. var instance = this.eventPool.pop();
  299. this.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
  300. return instance;
  301. }
  302. return new this(dispatchConfig, targetInst, nativeEvent, nativeInst);
  303. }
  304. function releasePooledEvent(event) {
  305. if (!(event instanceof this))
  306. throw Error(
  307. "Trying to release an event instance into a pool of a different type."
  308. );
  309. event.destructor();
  310. 10 > this.eventPool.length && this.eventPool.push(event);
  311. }
  312. function addEventPoolingTo(EventConstructor) {
  313. EventConstructor.eventPool = [];
  314. EventConstructor.getPooled = getPooledEvent;
  315. EventConstructor.release = releasePooledEvent;
  316. }
  317. var ResponderSyntheticEvent = SyntheticEvent.extend({
  318. touchHistory: function() {
  319. return null;
  320. }
  321. });
  322. function isStartish(topLevelType) {
  323. return "topTouchStart" === topLevelType;
  324. }
  325. function isMoveish(topLevelType) {
  326. return "topTouchMove" === topLevelType;
  327. }
  328. var startDependencies = ["topTouchStart"],
  329. moveDependencies = ["topTouchMove"],
  330. endDependencies = ["topTouchCancel", "topTouchEnd"],
  331. touchBank = [],
  332. touchHistory = {
  333. touchBank: touchBank,
  334. numberActiveTouches: 0,
  335. indexOfSingleActiveTouch: -1,
  336. mostRecentTimeStamp: 0
  337. };
  338. function timestampForTouch(touch) {
  339. return touch.timeStamp || touch.timestamp;
  340. }
  341. function getTouchIdentifier(_ref) {
  342. _ref = _ref.identifier;
  343. if (null == _ref) throw Error("Touch object is missing identifier.");
  344. return _ref;
  345. }
  346. function recordTouchStart(touch) {
  347. var identifier = getTouchIdentifier(touch),
  348. touchRecord = touchBank[identifier];
  349. touchRecord
  350. ? ((touchRecord.touchActive = !0),
  351. (touchRecord.startPageX = touch.pageX),
  352. (touchRecord.startPageY = touch.pageY),
  353. (touchRecord.startTimeStamp = timestampForTouch(touch)),
  354. (touchRecord.currentPageX = touch.pageX),
  355. (touchRecord.currentPageY = touch.pageY),
  356. (touchRecord.currentTimeStamp = timestampForTouch(touch)),
  357. (touchRecord.previousPageX = touch.pageX),
  358. (touchRecord.previousPageY = touch.pageY),
  359. (touchRecord.previousTimeStamp = timestampForTouch(touch)))
  360. : ((touchRecord = {
  361. touchActive: !0,
  362. startPageX: touch.pageX,
  363. startPageY: touch.pageY,
  364. startTimeStamp: timestampForTouch(touch),
  365. currentPageX: touch.pageX,
  366. currentPageY: touch.pageY,
  367. currentTimeStamp: timestampForTouch(touch),
  368. previousPageX: touch.pageX,
  369. previousPageY: touch.pageY,
  370. previousTimeStamp: timestampForTouch(touch)
  371. }),
  372. (touchBank[identifier] = touchRecord));
  373. touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
  374. }
  375. function recordTouchMove(touch) {
  376. var touchRecord = touchBank[getTouchIdentifier(touch)];
  377. touchRecord &&
  378. ((touchRecord.touchActive = !0),
  379. (touchRecord.previousPageX = touchRecord.currentPageX),
  380. (touchRecord.previousPageY = touchRecord.currentPageY),
  381. (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp),
  382. (touchRecord.currentPageX = touch.pageX),
  383. (touchRecord.currentPageY = touch.pageY),
  384. (touchRecord.currentTimeStamp = timestampForTouch(touch)),
  385. (touchHistory.mostRecentTimeStamp = timestampForTouch(touch)));
  386. }
  387. function recordTouchEnd(touch) {
  388. var touchRecord = touchBank[getTouchIdentifier(touch)];
  389. touchRecord &&
  390. ((touchRecord.touchActive = !1),
  391. (touchRecord.previousPageX = touchRecord.currentPageX),
  392. (touchRecord.previousPageY = touchRecord.currentPageY),
  393. (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp),
  394. (touchRecord.currentPageX = touch.pageX),
  395. (touchRecord.currentPageY = touch.pageY),
  396. (touchRecord.currentTimeStamp = timestampForTouch(touch)),
  397. (touchHistory.mostRecentTimeStamp = timestampForTouch(touch)));
  398. }
  399. var ResponderTouchHistoryStore = {
  400. recordTouchTrack: function(topLevelType, nativeEvent) {
  401. if (isMoveish(topLevelType))
  402. nativeEvent.changedTouches.forEach(recordTouchMove);
  403. else if (isStartish(topLevelType))
  404. nativeEvent.changedTouches.forEach(recordTouchStart),
  405. (touchHistory.numberActiveTouches = nativeEvent.touches.length),
  406. 1 === touchHistory.numberActiveTouches &&
  407. (touchHistory.indexOfSingleActiveTouch =
  408. nativeEvent.touches[0].identifier);
  409. else if (
  410. "topTouchEnd" === topLevelType ||
  411. "topTouchCancel" === topLevelType
  412. )
  413. if (
  414. (nativeEvent.changedTouches.forEach(recordTouchEnd),
  415. (touchHistory.numberActiveTouches = nativeEvent.touches.length),
  416. 1 === touchHistory.numberActiveTouches)
  417. )
  418. for (topLevelType = 0; topLevelType < touchBank.length; topLevelType++)
  419. if (
  420. ((nativeEvent = touchBank[topLevelType]),
  421. null != nativeEvent && nativeEvent.touchActive)
  422. ) {
  423. touchHistory.indexOfSingleActiveTouch = topLevelType;
  424. break;
  425. }
  426. },
  427. touchHistory: touchHistory
  428. };
  429. function accumulate(current, next) {
  430. if (null == next)
  431. throw Error(
  432. "accumulate(...): Accumulated items must not be null or undefined."
  433. );
  434. return null == current
  435. ? next
  436. : Array.isArray(current)
  437. ? current.concat(next)
  438. : Array.isArray(next)
  439. ? [current].concat(next)
  440. : [current, next];
  441. }
  442. var responderInst = null,
  443. trackedTouchCount = 0;
  444. function changeResponder(nextResponderInst, blockHostResponder) {
  445. var oldResponderInst = responderInst;
  446. responderInst = nextResponderInst;
  447. if (null !== ResponderEventPlugin.GlobalResponderHandler)
  448. ResponderEventPlugin.GlobalResponderHandler.onChange(
  449. oldResponderInst,
  450. nextResponderInst,
  451. blockHostResponder
  452. );
  453. }
  454. var eventTypes = {
  455. startShouldSetResponder: {
  456. phasedRegistrationNames: {
  457. bubbled: "onStartShouldSetResponder",
  458. captured: "onStartShouldSetResponderCapture"
  459. },
  460. dependencies: startDependencies
  461. },
  462. scrollShouldSetResponder: {
  463. phasedRegistrationNames: {
  464. bubbled: "onScrollShouldSetResponder",
  465. captured: "onScrollShouldSetResponderCapture"
  466. },
  467. dependencies: ["topScroll"]
  468. },
  469. selectionChangeShouldSetResponder: {
  470. phasedRegistrationNames: {
  471. bubbled: "onSelectionChangeShouldSetResponder",
  472. captured: "onSelectionChangeShouldSetResponderCapture"
  473. },
  474. dependencies: ["topSelectionChange"]
  475. },
  476. moveShouldSetResponder: {
  477. phasedRegistrationNames: {
  478. bubbled: "onMoveShouldSetResponder",
  479. captured: "onMoveShouldSetResponderCapture"
  480. },
  481. dependencies: moveDependencies
  482. },
  483. responderStart: {
  484. registrationName: "onResponderStart",
  485. dependencies: startDependencies
  486. },
  487. responderMove: {
  488. registrationName: "onResponderMove",
  489. dependencies: moveDependencies
  490. },
  491. responderEnd: {
  492. registrationName: "onResponderEnd",
  493. dependencies: endDependencies
  494. },
  495. responderRelease: {
  496. registrationName: "onResponderRelease",
  497. dependencies: endDependencies
  498. },
  499. responderTerminationRequest: {
  500. registrationName: "onResponderTerminationRequest",
  501. dependencies: []
  502. },
  503. responderGrant: { registrationName: "onResponderGrant", dependencies: [] },
  504. responderReject: {
  505. registrationName: "onResponderReject",
  506. dependencies: []
  507. },
  508. responderTerminate: {
  509. registrationName: "onResponderTerminate",
  510. dependencies: []
  511. }
  512. },
  513. ResponderEventPlugin = {
  514. _getResponder: function() {
  515. return responderInst;
  516. },
  517. eventTypes: eventTypes,
  518. extractEvents: function(
  519. topLevelType,
  520. targetInst,
  521. nativeEvent,
  522. nativeEventTarget
  523. ) {
  524. if (isStartish(topLevelType)) trackedTouchCount += 1;
  525. else if (
  526. "topTouchEnd" === topLevelType ||
  527. "topTouchCancel" === topLevelType
  528. )
  529. if (0 <= trackedTouchCount) --trackedTouchCount;
  530. else return null;
  531. ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent);
  532. if (
  533. targetInst &&
  534. (("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll) ||
  535. (0 < trackedTouchCount && "topSelectionChange" === topLevelType) ||
  536. isStartish(topLevelType) ||
  537. isMoveish(topLevelType))
  538. ) {
  539. var shouldSetEventType = isStartish(topLevelType)
  540. ? eventTypes.startShouldSetResponder
  541. : isMoveish(topLevelType)
  542. ? eventTypes.moveShouldSetResponder
  543. : "topSelectionChange" === topLevelType
  544. ? eventTypes.selectionChangeShouldSetResponder
  545. : eventTypes.scrollShouldSetResponder;
  546. if (responderInst)
  547. b: {
  548. var JSCompiler_temp = responderInst;
  549. for (
  550. var depthA = 0, tempA = JSCompiler_temp;
  551. tempA;
  552. tempA = getParent(tempA)
  553. )
  554. depthA++;
  555. tempA = 0;
  556. for (var tempB = targetInst; tempB; tempB = getParent(tempB))
  557. tempA++;
  558. for (; 0 < depthA - tempA; )
  559. (JSCompiler_temp = getParent(JSCompiler_temp)), depthA--;
  560. for (; 0 < tempA - depthA; )
  561. (targetInst = getParent(targetInst)), tempA--;
  562. for (; depthA--; ) {
  563. if (
  564. JSCompiler_temp === targetInst ||
  565. JSCompiler_temp === targetInst.alternate
  566. )
  567. break b;
  568. JSCompiler_temp = getParent(JSCompiler_temp);
  569. targetInst = getParent(targetInst);
  570. }
  571. JSCompiler_temp = null;
  572. }
  573. else JSCompiler_temp = targetInst;
  574. targetInst = JSCompiler_temp === responderInst;
  575. JSCompiler_temp = ResponderSyntheticEvent.getPooled(
  576. shouldSetEventType,
  577. JSCompiler_temp,
  578. nativeEvent,
  579. nativeEventTarget
  580. );
  581. JSCompiler_temp.touchHistory = ResponderTouchHistoryStore.touchHistory;
  582. targetInst
  583. ? forEachAccumulated(
  584. JSCompiler_temp,
  585. accumulateTwoPhaseDispatchesSingleSkipTarget
  586. )
  587. : forEachAccumulated(
  588. JSCompiler_temp,
  589. accumulateTwoPhaseDispatchesSingle
  590. );
  591. b: {
  592. shouldSetEventType = JSCompiler_temp._dispatchListeners;
  593. targetInst = JSCompiler_temp._dispatchInstances;
  594. if (Array.isArray(shouldSetEventType))
  595. for (
  596. depthA = 0;
  597. depthA < shouldSetEventType.length &&
  598. !JSCompiler_temp.isPropagationStopped();
  599. depthA++
  600. ) {
  601. if (
  602. shouldSetEventType[depthA](JSCompiler_temp, targetInst[depthA])
  603. ) {
  604. shouldSetEventType = targetInst[depthA];
  605. break b;
  606. }
  607. }
  608. else if (
  609. shouldSetEventType &&
  610. shouldSetEventType(JSCompiler_temp, targetInst)
  611. ) {
  612. shouldSetEventType = targetInst;
  613. break b;
  614. }
  615. shouldSetEventType = null;
  616. }
  617. JSCompiler_temp._dispatchInstances = null;
  618. JSCompiler_temp._dispatchListeners = null;
  619. JSCompiler_temp.isPersistent() ||
  620. JSCompiler_temp.constructor.release(JSCompiler_temp);
  621. if (shouldSetEventType && shouldSetEventType !== responderInst)
  622. if (
  623. ((JSCompiler_temp = ResponderSyntheticEvent.getPooled(
  624. eventTypes.responderGrant,
  625. shouldSetEventType,
  626. nativeEvent,
  627. nativeEventTarget
  628. )),
  629. (JSCompiler_temp.touchHistory =
  630. ResponderTouchHistoryStore.touchHistory),
  631. forEachAccumulated(
  632. JSCompiler_temp,
  633. accumulateDirectDispatchesSingle
  634. ),
  635. (targetInst = !0 === executeDirectDispatch(JSCompiler_temp)),
  636. responderInst)
  637. )
  638. if (
  639. ((depthA = ResponderSyntheticEvent.getPooled(
  640. eventTypes.responderTerminationRequest,
  641. responderInst,
  642. nativeEvent,
  643. nativeEventTarget
  644. )),
  645. (depthA.touchHistory = ResponderTouchHistoryStore.touchHistory),
  646. forEachAccumulated(depthA, accumulateDirectDispatchesSingle),
  647. (tempA =
  648. !depthA._dispatchListeners || executeDirectDispatch(depthA)),
  649. depthA.isPersistent() || depthA.constructor.release(depthA),
  650. tempA)
  651. ) {
  652. depthA = ResponderSyntheticEvent.getPooled(
  653. eventTypes.responderTerminate,
  654. responderInst,
  655. nativeEvent,
  656. nativeEventTarget
  657. );
  658. depthA.touchHistory = ResponderTouchHistoryStore.touchHistory;
  659. forEachAccumulated(depthA, accumulateDirectDispatchesSingle);
  660. var JSCompiler_temp$jscomp$0 = accumulate(
  661. JSCompiler_temp$jscomp$0,
  662. [JSCompiler_temp, depthA]
  663. );
  664. changeResponder(shouldSetEventType, targetInst);
  665. } else
  666. (shouldSetEventType = ResponderSyntheticEvent.getPooled(
  667. eventTypes.responderReject,
  668. shouldSetEventType,
  669. nativeEvent,
  670. nativeEventTarget
  671. )),
  672. (shouldSetEventType.touchHistory =
  673. ResponderTouchHistoryStore.touchHistory),
  674. forEachAccumulated(
  675. shouldSetEventType,
  676. accumulateDirectDispatchesSingle
  677. ),
  678. (JSCompiler_temp$jscomp$0 = accumulate(
  679. JSCompiler_temp$jscomp$0,
  680. shouldSetEventType
  681. ));
  682. else
  683. (JSCompiler_temp$jscomp$0 = accumulate(
  684. JSCompiler_temp$jscomp$0,
  685. JSCompiler_temp
  686. )),
  687. changeResponder(shouldSetEventType, targetInst);
  688. else JSCompiler_temp$jscomp$0 = null;
  689. } else JSCompiler_temp$jscomp$0 = null;
  690. shouldSetEventType = responderInst && isStartish(topLevelType);
  691. JSCompiler_temp = responderInst && isMoveish(topLevelType);
  692. targetInst =
  693. responderInst &&
  694. ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType);
  695. if (
  696. (shouldSetEventType = shouldSetEventType
  697. ? eventTypes.responderStart
  698. : JSCompiler_temp
  699. ? eventTypes.responderMove
  700. : targetInst
  701. ? eventTypes.responderEnd
  702. : null)
  703. )
  704. (shouldSetEventType = ResponderSyntheticEvent.getPooled(
  705. shouldSetEventType,
  706. responderInst,
  707. nativeEvent,
  708. nativeEventTarget
  709. )),
  710. (shouldSetEventType.touchHistory =
  711. ResponderTouchHistoryStore.touchHistory),
  712. forEachAccumulated(
  713. shouldSetEventType,
  714. accumulateDirectDispatchesSingle
  715. ),
  716. (JSCompiler_temp$jscomp$0 = accumulate(
  717. JSCompiler_temp$jscomp$0,
  718. shouldSetEventType
  719. ));
  720. shouldSetEventType = responderInst && "topTouchCancel" === topLevelType;
  721. if (
  722. (topLevelType =
  723. responderInst &&
  724. !shouldSetEventType &&
  725. ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType))
  726. )
  727. a: {
  728. if ((topLevelType = nativeEvent.touches) && 0 !== topLevelType.length)
  729. for (
  730. JSCompiler_temp = 0;
  731. JSCompiler_temp < topLevelType.length;
  732. JSCompiler_temp++
  733. )
  734. if (
  735. ((targetInst = topLevelType[JSCompiler_temp].target),
  736. null !== targetInst &&
  737. void 0 !== targetInst &&
  738. 0 !== targetInst)
  739. ) {
  740. depthA = getInstanceFromNode(targetInst);
  741. b: {
  742. for (targetInst = responderInst; depthA; ) {
  743. if (
  744. targetInst === depthA ||
  745. targetInst === depthA.alternate
  746. ) {
  747. targetInst = !0;
  748. break b;
  749. }
  750. depthA = getParent(depthA);
  751. }
  752. targetInst = !1;
  753. }
  754. if (targetInst) {
  755. topLevelType = !1;
  756. break a;
  757. }
  758. }
  759. topLevelType = !0;
  760. }
  761. if (
  762. (topLevelType = shouldSetEventType
  763. ? eventTypes.responderTerminate
  764. : topLevelType
  765. ? eventTypes.responderRelease
  766. : null)
  767. )
  768. (nativeEvent = ResponderSyntheticEvent.getPooled(
  769. topLevelType,
  770. responderInst,
  771. nativeEvent,
  772. nativeEventTarget
  773. )),
  774. (nativeEvent.touchHistory = ResponderTouchHistoryStore.touchHistory),
  775. forEachAccumulated(nativeEvent, accumulateDirectDispatchesSingle),
  776. (JSCompiler_temp$jscomp$0 = accumulate(
  777. JSCompiler_temp$jscomp$0,
  778. nativeEvent
  779. )),
  780. changeResponder(null);
  781. return JSCompiler_temp$jscomp$0;
  782. },
  783. GlobalResponderHandler: null,
  784. injection: {
  785. injectGlobalResponderHandler: function(GlobalResponderHandler) {
  786. ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler;
  787. }
  788. }
  789. },
  790. eventPluginOrder = null,
  791. namesToPlugins = {};
  792. function recomputePluginOrdering() {
  793. if (eventPluginOrder)
  794. for (var pluginName in namesToPlugins) {
  795. var pluginModule = namesToPlugins[pluginName],
  796. pluginIndex = eventPluginOrder.indexOf(pluginName);
  797. if (!(-1 < pluginIndex))
  798. throw Error(
  799. "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" +
  800. pluginName +
  801. "`."
  802. );
  803. if (!plugins[pluginIndex]) {
  804. if (!pluginModule.extractEvents)
  805. throw Error(
  806. "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" +
  807. pluginName +
  808. "` does not."
  809. );
  810. plugins[pluginIndex] = pluginModule;
  811. pluginIndex = pluginModule.eventTypes;
  812. for (var eventName in pluginIndex) {
  813. var JSCompiler_inline_result = void 0;
  814. var dispatchConfig = pluginIndex[eventName],
  815. pluginModule$jscomp$0 = pluginModule,
  816. eventName$jscomp$0 = eventName;
  817. if (eventNameDispatchConfigs.hasOwnProperty(eventName$jscomp$0))
  818. throw Error(
  819. "EventPluginRegistry: More than one plugin attempted to publish the same event name, `" +
  820. eventName$jscomp$0 +
  821. "`."
  822. );
  823. eventNameDispatchConfigs[eventName$jscomp$0] = dispatchConfig;
  824. var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
  825. if (phasedRegistrationNames) {
  826. for (JSCompiler_inline_result in phasedRegistrationNames)
  827. phasedRegistrationNames.hasOwnProperty(
  828. JSCompiler_inline_result
  829. ) &&
  830. publishRegistrationName(
  831. phasedRegistrationNames[JSCompiler_inline_result],
  832. pluginModule$jscomp$0,
  833. eventName$jscomp$0
  834. );
  835. JSCompiler_inline_result = !0;
  836. } else
  837. dispatchConfig.registrationName
  838. ? (publishRegistrationName(
  839. dispatchConfig.registrationName,
  840. pluginModule$jscomp$0,
  841. eventName$jscomp$0
  842. ),
  843. (JSCompiler_inline_result = !0))
  844. : (JSCompiler_inline_result = !1);
  845. if (!JSCompiler_inline_result)
  846. throw Error(
  847. "EventPluginRegistry: Failed to publish event `" +
  848. eventName +
  849. "` for plugin `" +
  850. pluginName +
  851. "`."
  852. );
  853. }
  854. }
  855. }
  856. }
  857. function publishRegistrationName(registrationName, pluginModule) {
  858. if (registrationNameModules[registrationName])
  859. throw Error(
  860. "EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" +
  861. registrationName +
  862. "`."
  863. );
  864. registrationNameModules[registrationName] = pluginModule;
  865. }
  866. var plugins = [],
  867. eventNameDispatchConfigs = {},
  868. registrationNameModules = {},
  869. customBubblingEventTypes =
  870. ReactNativePrivateInterface.ReactNativeViewConfigRegistry
  871. .customBubblingEventTypes,
  872. customDirectEventTypes =
  873. ReactNativePrivateInterface.ReactNativeViewConfigRegistry
  874. .customDirectEventTypes;
  875. if (eventPluginOrder)
  876. throw Error(
  877. "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."
  878. );
  879. eventPluginOrder = Array.prototype.slice.call([
  880. "ResponderEventPlugin",
  881. "ReactNativeBridgeEventPlugin"
  882. ]);
  883. recomputePluginOrdering();
  884. var injectedNamesToPlugins$jscomp$inline_92 = {
  885. ResponderEventPlugin: ResponderEventPlugin,
  886. ReactNativeBridgeEventPlugin: {
  887. eventTypes: {},
  888. extractEvents: function(
  889. topLevelType,
  890. targetInst,
  891. nativeEvent,
  892. nativeEventTarget
  893. ) {
  894. if (null == targetInst) return null;
  895. var bubbleDispatchConfig = customBubblingEventTypes[topLevelType],
  896. directDispatchConfig = customDirectEventTypes[topLevelType];
  897. if (!bubbleDispatchConfig && !directDispatchConfig)
  898. throw Error(
  899. 'Unsupported top level event type "' + topLevelType + '" dispatched'
  900. );
  901. topLevelType = SyntheticEvent.getPooled(
  902. bubbleDispatchConfig || directDispatchConfig,
  903. targetInst,
  904. nativeEvent,
  905. nativeEventTarget
  906. );
  907. if (bubbleDispatchConfig)
  908. forEachAccumulated(topLevelType, accumulateTwoPhaseDispatchesSingle);
  909. else if (directDispatchConfig)
  910. forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle);
  911. else return null;
  912. return topLevelType;
  913. }
  914. }
  915. },
  916. isOrderingDirty$jscomp$inline_93 = !1,
  917. pluginName$jscomp$inline_94;
  918. for (pluginName$jscomp$inline_94 in injectedNamesToPlugins$jscomp$inline_92)
  919. if (
  920. injectedNamesToPlugins$jscomp$inline_92.hasOwnProperty(
  921. pluginName$jscomp$inline_94
  922. )
  923. ) {
  924. var pluginModule$jscomp$inline_95 =
  925. injectedNamesToPlugins$jscomp$inline_92[pluginName$jscomp$inline_94];
  926. if (
  927. !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_94) ||
  928. namesToPlugins[pluginName$jscomp$inline_94] !==
  929. pluginModule$jscomp$inline_95
  930. ) {
  931. if (namesToPlugins[pluginName$jscomp$inline_94])
  932. throw Error(
  933. "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" +
  934. pluginName$jscomp$inline_94 +
  935. "`."
  936. );
  937. namesToPlugins[
  938. pluginName$jscomp$inline_94
  939. ] = pluginModule$jscomp$inline_95;
  940. isOrderingDirty$jscomp$inline_93 = !0;
  941. }
  942. }
  943. isOrderingDirty$jscomp$inline_93 && recomputePluginOrdering();
  944. function getInstanceFromInstance(instanceHandle) {
  945. return instanceHandle;
  946. }
  947. getFiberCurrentPropsFromNode = function(inst) {
  948. return inst.canonical.currentProps;
  949. };
  950. getInstanceFromNode = getInstanceFromInstance;
  951. getNodeFromInstance = function(inst) {
  952. inst = inst.stateNode.canonical;
  953. if (!inst._nativeTag) throw Error("All native instances should have a tag.");
  954. return inst;
  955. };
  956. ResponderEventPlugin.injection.injectGlobalResponderHandler({
  957. onChange: function(from, to, blockNativeResponder) {
  958. null !== to
  959. ? ReactNativePrivateInterface.UIManager.setJSResponder(
  960. to.stateNode.canonical._nativeTag,
  961. blockNativeResponder
  962. )
  963. : ReactNativePrivateInterface.UIManager.clearJSResponder();
  964. }
  965. });
  966. var ReactSharedInternals =
  967. React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
  968. ReactSharedInternals.hasOwnProperty("ReactCurrentDispatcher") ||
  969. (ReactSharedInternals.ReactCurrentDispatcher = { current: null });
  970. ReactSharedInternals.hasOwnProperty("ReactCurrentBatchConfig") ||
  971. (ReactSharedInternals.ReactCurrentBatchConfig = { suspense: null });
  972. var hasSymbol = "function" === typeof Symbol && Symbol.for,
  973. REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103,
  974. REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106,
  975. REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107,
  976. REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108,
  977. REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114,
  978. REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109,
  979. REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110,
  980. REACT_CONCURRENT_MODE_TYPE = hasSymbol
  981. ? Symbol.for("react.concurrent_mode")
  982. : 60111,
  983. REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112,
  984. REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113,
  985. REACT_SUSPENSE_LIST_TYPE = hasSymbol
  986. ? Symbol.for("react.suspense_list")
  987. : 60120,
  988. REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115,
  989. REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116,
  990. REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121,
  991. MAYBE_ITERATOR_SYMBOL = "function" === typeof Symbol && Symbol.iterator;
  992. function getIteratorFn(maybeIterable) {
  993. if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
  994. maybeIterable =
  995. (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
  996. maybeIterable["@@iterator"];
  997. return "function" === typeof maybeIterable ? maybeIterable : null;
  998. }
  999. function initializeLazyComponentType(lazyComponent) {
  1000. if (-1 === lazyComponent._status) {
  1001. var ctor = lazyComponent._result;
  1002. ctor || (ctor = lazyComponent._ctor);
  1003. ctor = ctor();
  1004. lazyComponent._status = 0;
  1005. lazyComponent._result = ctor;
  1006. ctor.then(
  1007. function(moduleObject) {
  1008. 0 === lazyComponent._status &&
  1009. ((moduleObject = moduleObject.default),
  1010. (lazyComponent._status = 1),
  1011. (lazyComponent._result = moduleObject));
  1012. },
  1013. function(error) {
  1014. 0 === lazyComponent._status &&
  1015. ((lazyComponent._status = 2), (lazyComponent._result = error));
  1016. }
  1017. );
  1018. }
  1019. }
  1020. function getComponentName(type) {
  1021. if (null == type) return null;
  1022. if ("function" === typeof type) return type.displayName || type.name || null;
  1023. if ("string" === typeof type) return type;
  1024. switch (type) {
  1025. case REACT_FRAGMENT_TYPE:
  1026. return "Fragment";
  1027. case REACT_PORTAL_TYPE:
  1028. return "Portal";
  1029. case REACT_PROFILER_TYPE:
  1030. return "Profiler";
  1031. case REACT_STRICT_MODE_TYPE:
  1032. return "StrictMode";
  1033. case REACT_SUSPENSE_TYPE:
  1034. return "Suspense";
  1035. case REACT_SUSPENSE_LIST_TYPE:
  1036. return "SuspenseList";
  1037. }
  1038. if ("object" === typeof type)
  1039. switch (type.$$typeof) {
  1040. case REACT_CONTEXT_TYPE:
  1041. return (type.displayName || "Context") + ".Consumer";
  1042. case REACT_PROVIDER_TYPE:
  1043. return (type._context.displayName || "Context") + ".Provider";
  1044. case REACT_FORWARD_REF_TYPE:
  1045. var innerType = type.render;
  1046. innerType = innerType.displayName || innerType.name || "";
  1047. return (
  1048. type.displayName ||
  1049. ("" !== innerType ? "ForwardRef(" + innerType + ")" : "ForwardRef")
  1050. );
  1051. case REACT_MEMO_TYPE:
  1052. return getComponentName(type.type);
  1053. case REACT_BLOCK_TYPE:
  1054. return getComponentName(type.render);
  1055. case REACT_LAZY_TYPE:
  1056. if ((type = 1 === type._status ? type._result : null))
  1057. return getComponentName(type);
  1058. }
  1059. return null;
  1060. }
  1061. function getNearestMountedFiber(fiber) {
  1062. var node = fiber,
  1063. nearestMounted = fiber;
  1064. if (fiber.alternate) for (; node.return; ) node = node.return;
  1065. else {
  1066. fiber = node;
  1067. do
  1068. (node = fiber),
  1069. 0 !== (node.effectTag & 1026) && (nearestMounted = node.return),
  1070. (fiber = node.return);
  1071. while (fiber);
  1072. }
  1073. return 3 === node.tag ? nearestMounted : null;
  1074. }
  1075. function assertIsMounted(fiber) {
  1076. if (getNearestMountedFiber(fiber) !== fiber)
  1077. throw Error("Unable to find node on an unmounted component.");
  1078. }
  1079. function findCurrentFiberUsingSlowPath(fiber) {
  1080. var alternate = fiber.alternate;
  1081. if (!alternate) {
  1082. alternate = getNearestMountedFiber(fiber);
  1083. if (null === alternate)
  1084. throw Error("Unable to find node on an unmounted component.");
  1085. return alternate !== fiber ? null : fiber;
  1086. }
  1087. for (var a = fiber, b = alternate; ; ) {
  1088. var parentA = a.return;
  1089. if (null === parentA) break;
  1090. var parentB = parentA.alternate;
  1091. if (null === parentB) {
  1092. b = parentA.return;
  1093. if (null !== b) {
  1094. a = b;
  1095. continue;
  1096. }
  1097. break;
  1098. }
  1099. if (parentA.child === parentB.child) {
  1100. for (parentB = parentA.child; parentB; ) {
  1101. if (parentB === a) return assertIsMounted(parentA), fiber;
  1102. if (parentB === b) return assertIsMounted(parentA), alternate;
  1103. parentB = parentB.sibling;
  1104. }
  1105. throw Error("Unable to find node on an unmounted component.");
  1106. }
  1107. if (a.return !== b.return) (a = parentA), (b = parentB);
  1108. else {
  1109. for (var didFindChild = !1, _child = parentA.child; _child; ) {
  1110. if (_child === a) {
  1111. didFindChild = !0;
  1112. a = parentA;
  1113. b = parentB;
  1114. break;
  1115. }
  1116. if (_child === b) {
  1117. didFindChild = !0;
  1118. b = parentA;
  1119. a = parentB;
  1120. break;
  1121. }
  1122. _child = _child.sibling;
  1123. }
  1124. if (!didFindChild) {
  1125. for (_child = parentB.child; _child; ) {
  1126. if (_child === a) {
  1127. didFindChild = !0;
  1128. a = parentB;
  1129. b = parentA;
  1130. break;
  1131. }
  1132. if (_child === b) {
  1133. didFindChild = !0;
  1134. b = parentB;
  1135. a = parentA;
  1136. break;
  1137. }
  1138. _child = _child.sibling;
  1139. }
  1140. if (!didFindChild)
  1141. throw Error(
  1142. "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."
  1143. );
  1144. }
  1145. }
  1146. if (a.alternate !== b)
  1147. throw Error(
  1148. "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."
  1149. );
  1150. }
  1151. if (3 !== a.tag)
  1152. throw Error("Unable to find node on an unmounted component.");
  1153. return a.stateNode.current === a ? fiber : alternate;
  1154. }
  1155. function findCurrentHostFiber(parent) {
  1156. parent = findCurrentFiberUsingSlowPath(parent);
  1157. if (!parent) return null;
  1158. for (var node = parent; ; ) {
  1159. if (5 === node.tag || 6 === node.tag) return node;
  1160. if (node.child) (node.child.return = node), (node = node.child);
  1161. else {
  1162. if (node === parent) break;
  1163. for (; !node.sibling; ) {
  1164. if (!node.return || node.return === parent) return null;
  1165. node = node.return;
  1166. }
  1167. node.sibling.return = node.return;
  1168. node = node.sibling;
  1169. }
  1170. }
  1171. return null;
  1172. }
  1173. function mountSafeCallback_NOT_REALLY_SAFE(context, callback) {
  1174. return function() {
  1175. if (
  1176. callback &&
  1177. ("boolean" !== typeof context.__isMounted || context.__isMounted)
  1178. )
  1179. return callback.apply(context, arguments);
  1180. };
  1181. }
  1182. var emptyObject = {},
  1183. removedKeys = null,
  1184. removedKeyCount = 0,
  1185. deepDifferOptions = { unsafelyIgnoreFunctions: !0 };
  1186. function defaultDiffer(prevProp, nextProp) {
  1187. return "object" !== typeof nextProp || null === nextProp
  1188. ? !0
  1189. : ReactNativePrivateInterface.deepDiffer(
  1190. prevProp,
  1191. nextProp,
  1192. deepDifferOptions
  1193. );
  1194. }
  1195. function restoreDeletedValuesInNestedArray(
  1196. updatePayload,
  1197. node,
  1198. validAttributes
  1199. ) {
  1200. if (Array.isArray(node))
  1201. for (var i = node.length; i-- && 0 < removedKeyCount; )
  1202. restoreDeletedValuesInNestedArray(
  1203. updatePayload,
  1204. node[i],
  1205. validAttributes
  1206. );
  1207. else if (node && 0 < removedKeyCount)
  1208. for (i in removedKeys)
  1209. if (removedKeys[i]) {
  1210. var nextProp = node[i];
  1211. if (void 0 !== nextProp) {
  1212. var attributeConfig = validAttributes[i];
  1213. if (attributeConfig) {
  1214. "function" === typeof nextProp && (nextProp = !0);
  1215. "undefined" === typeof nextProp && (nextProp = null);
  1216. if ("object" !== typeof attributeConfig)
  1217. updatePayload[i] = nextProp;
  1218. else if (
  1219. "function" === typeof attributeConfig.diff ||
  1220. "function" === typeof attributeConfig.process
  1221. )
  1222. (nextProp =
  1223. "function" === typeof attributeConfig.process
  1224. ? attributeConfig.process(nextProp)
  1225. : nextProp),
  1226. (updatePayload[i] = nextProp);
  1227. removedKeys[i] = !1;
  1228. removedKeyCount--;
  1229. }
  1230. }
  1231. }
  1232. }
  1233. function diffNestedProperty(
  1234. updatePayload,
  1235. prevProp,
  1236. nextProp,
  1237. validAttributes
  1238. ) {
  1239. if (!updatePayload && prevProp === nextProp) return updatePayload;
  1240. if (!prevProp || !nextProp)
  1241. return nextProp
  1242. ? addNestedProperty(updatePayload, nextProp, validAttributes)
  1243. : prevProp
  1244. ? clearNestedProperty(updatePayload, prevProp, validAttributes)
  1245. : updatePayload;
  1246. if (!Array.isArray(prevProp) && !Array.isArray(nextProp))
  1247. return diffProperties(updatePayload, prevProp, nextProp, validAttributes);
  1248. if (Array.isArray(prevProp) && Array.isArray(nextProp)) {
  1249. var minLength =
  1250. prevProp.length < nextProp.length ? prevProp.length : nextProp.length,
  1251. i;
  1252. for (i = 0; i < minLength; i++)
  1253. updatePayload = diffNestedProperty(
  1254. updatePayload,
  1255. prevProp[i],
  1256. nextProp[i],
  1257. validAttributes
  1258. );
  1259. for (; i < prevProp.length; i++)
  1260. updatePayload = clearNestedProperty(
  1261. updatePayload,
  1262. prevProp[i],
  1263. validAttributes
  1264. );
  1265. for (; i < nextProp.length; i++)
  1266. updatePayload = addNestedProperty(
  1267. updatePayload,
  1268. nextProp[i],
  1269. validAttributes
  1270. );
  1271. return updatePayload;
  1272. }
  1273. return Array.isArray(prevProp)
  1274. ? diffProperties(
  1275. updatePayload,
  1276. ReactNativePrivateInterface.flattenStyle(prevProp),
  1277. nextProp,
  1278. validAttributes
  1279. )
  1280. : diffProperties(
  1281. updatePayload,
  1282. prevProp,
  1283. ReactNativePrivateInterface.flattenStyle(nextProp),
  1284. validAttributes
  1285. );
  1286. }
  1287. function addNestedProperty(updatePayload, nextProp, validAttributes) {
  1288. if (!nextProp) return updatePayload;
  1289. if (!Array.isArray(nextProp))
  1290. return diffProperties(
  1291. updatePayload,
  1292. emptyObject,
  1293. nextProp,
  1294. validAttributes
  1295. );
  1296. for (var i = 0; i < nextProp.length; i++)
  1297. updatePayload = addNestedProperty(
  1298. updatePayload,
  1299. nextProp[i],
  1300. validAttributes
  1301. );
  1302. return updatePayload;
  1303. }
  1304. function clearNestedProperty(updatePayload, prevProp, validAttributes) {
  1305. if (!prevProp) return updatePayload;
  1306. if (!Array.isArray(prevProp))
  1307. return diffProperties(
  1308. updatePayload,
  1309. prevProp,
  1310. emptyObject,
  1311. validAttributes
  1312. );
  1313. for (var i = 0; i < prevProp.length; i++)
  1314. updatePayload = clearNestedProperty(
  1315. updatePayload,
  1316. prevProp[i],
  1317. validAttributes
  1318. );
  1319. return updatePayload;
  1320. }
  1321. function diffProperties(updatePayload, prevProps, nextProps, validAttributes) {
  1322. var attributeConfig, propKey;
  1323. for (propKey in nextProps)
  1324. if ((attributeConfig = validAttributes[propKey])) {
  1325. var prevProp = prevProps[propKey];
  1326. var nextProp = nextProps[propKey];
  1327. "function" === typeof nextProp &&
  1328. ((nextProp = !0), "function" === typeof prevProp && (prevProp = !0));
  1329. "undefined" === typeof nextProp &&
  1330. ((nextProp = null),
  1331. "undefined" === typeof prevProp && (prevProp = null));
  1332. removedKeys && (removedKeys[propKey] = !1);
  1333. if (updatePayload && void 0 !== updatePayload[propKey])
  1334. if ("object" !== typeof attributeConfig)
  1335. updatePayload[propKey] = nextProp;
  1336. else {
  1337. if (
  1338. "function" === typeof attributeConfig.diff ||
  1339. "function" === typeof attributeConfig.process
  1340. )
  1341. (attributeConfig =
  1342. "function" === typeof attributeConfig.process
  1343. ? attributeConfig.process(nextProp)
  1344. : nextProp),
  1345. (updatePayload[propKey] = attributeConfig);
  1346. }
  1347. else if (prevProp !== nextProp)
  1348. if ("object" !== typeof attributeConfig)
  1349. defaultDiffer(prevProp, nextProp) &&
  1350. ((updatePayload || (updatePayload = {}))[propKey] = nextProp);
  1351. else if (
  1352. "function" === typeof attributeConfig.diff ||
  1353. "function" === typeof attributeConfig.process
  1354. ) {
  1355. if (
  1356. void 0 === prevProp ||
  1357. ("function" === typeof attributeConfig.diff
  1358. ? attributeConfig.diff(prevProp, nextProp)
  1359. : defaultDiffer(prevProp, nextProp))
  1360. )
  1361. (attributeConfig =
  1362. "function" === typeof attributeConfig.process
  1363. ? attributeConfig.process(nextProp)
  1364. : nextProp),
  1365. ((updatePayload || (updatePayload = {}))[
  1366. propKey
  1367. ] = attributeConfig);
  1368. } else
  1369. (removedKeys = null),
  1370. (removedKeyCount = 0),
  1371. (updatePayload = diffNestedProperty(
  1372. updatePayload,
  1373. prevProp,
  1374. nextProp,
  1375. attributeConfig
  1376. )),
  1377. 0 < removedKeyCount &&
  1378. updatePayload &&
  1379. (restoreDeletedValuesInNestedArray(
  1380. updatePayload,
  1381. nextProp,
  1382. attributeConfig
  1383. ),
  1384. (removedKeys = null));
  1385. }
  1386. for (var _propKey in prevProps)
  1387. void 0 === nextProps[_propKey] &&
  1388. (!(attributeConfig = validAttributes[_propKey]) ||
  1389. (updatePayload && void 0 !== updatePayload[_propKey]) ||
  1390. ((prevProp = prevProps[_propKey]),
  1391. void 0 !== prevProp &&
  1392. ("object" !== typeof attributeConfig ||
  1393. "function" === typeof attributeConfig.diff ||
  1394. "function" === typeof attributeConfig.process
  1395. ? (((updatePayload || (updatePayload = {}))[_propKey] = null),
  1396. removedKeys || (removedKeys = {}),
  1397. removedKeys[_propKey] ||
  1398. ((removedKeys[_propKey] = !0), removedKeyCount++))
  1399. : (updatePayload = clearNestedProperty(
  1400. updatePayload,
  1401. prevProp,
  1402. attributeConfig
  1403. )))));
  1404. return updatePayload;
  1405. }
  1406. function batchedUpdatesImpl(fn, bookkeeping) {
  1407. return fn(bookkeeping);
  1408. }
  1409. var isInsideEventHandler = !1;
  1410. function batchedUpdates(fn, bookkeeping) {
  1411. if (isInsideEventHandler) return fn(bookkeeping);
  1412. isInsideEventHandler = !0;
  1413. try {
  1414. return batchedUpdatesImpl(fn, bookkeeping);
  1415. } finally {
  1416. isInsideEventHandler = !1;
  1417. }
  1418. }
  1419. var eventQueue = null;
  1420. function executeDispatchesAndReleaseTopLevel(e) {
  1421. if (e) {
  1422. var dispatchListeners = e._dispatchListeners,
  1423. dispatchInstances = e._dispatchInstances;
  1424. if (Array.isArray(dispatchListeners))
  1425. for (
  1426. var i = 0;
  1427. i < dispatchListeners.length && !e.isPropagationStopped();
  1428. i++
  1429. )
  1430. executeDispatch(e, dispatchListeners[i], dispatchInstances[i]);
  1431. else
  1432. dispatchListeners &&
  1433. executeDispatch(e, dispatchListeners, dispatchInstances);
  1434. e._dispatchListeners = null;
  1435. e._dispatchInstances = null;
  1436. e.isPersistent() || e.constructor.release(e);
  1437. }
  1438. }
  1439. function dispatchEvent(target, topLevelType, nativeEvent) {
  1440. var eventTarget = null;
  1441. if (null != target) {
  1442. var stateNode = target.stateNode;
  1443. null != stateNode && (eventTarget = stateNode.canonical);
  1444. }
  1445. batchedUpdates(function() {
  1446. var events = eventTarget;
  1447. for (var events$jscomp$0 = null, i = 0; i < plugins.length; i++) {
  1448. var possiblePlugin = plugins[i];
  1449. possiblePlugin &&
  1450. (possiblePlugin = possiblePlugin.extractEvents(
  1451. topLevelType,
  1452. target,
  1453. nativeEvent,
  1454. events,
  1455. 1
  1456. )) &&
  1457. (events$jscomp$0 = accumulateInto(events$jscomp$0, possiblePlugin));
  1458. }
  1459. events = events$jscomp$0;
  1460. null !== events && (eventQueue = accumulateInto(eventQueue, events));
  1461. events = eventQueue;
  1462. eventQueue = null;
  1463. if (events) {
  1464. forEachAccumulated(events, executeDispatchesAndReleaseTopLevel);
  1465. if (eventQueue)
  1466. throw Error(
  1467. "processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."
  1468. );
  1469. if (hasRethrowError)
  1470. throw ((events = rethrowError),
  1471. (hasRethrowError = !1),
  1472. (rethrowError = null),
  1473. events);
  1474. }
  1475. });
  1476. }
  1477. function shim$1() {
  1478. throw Error(
  1479. "The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue."
  1480. );
  1481. }
  1482. var _nativeFabricUIManage = nativeFabricUIManager,
  1483. createNode = _nativeFabricUIManage.createNode,
  1484. cloneNode = _nativeFabricUIManage.cloneNode,
  1485. cloneNodeWithNewChildren = _nativeFabricUIManage.cloneNodeWithNewChildren,
  1486. cloneNodeWithNewChildrenAndProps =
  1487. _nativeFabricUIManage.cloneNodeWithNewChildrenAndProps,
  1488. cloneNodeWithNewProps = _nativeFabricUIManage.cloneNodeWithNewProps,
  1489. createChildNodeSet = _nativeFabricUIManage.createChildSet,
  1490. appendChildNode = _nativeFabricUIManage.appendChild,
  1491. appendChildNodeToSet = _nativeFabricUIManage.appendChildToSet,
  1492. completeRoot = _nativeFabricUIManage.completeRoot,
  1493. registerEventHandler = _nativeFabricUIManage.registerEventHandler,
  1494. fabricMeasure = _nativeFabricUIManage.measure,
  1495. fabricMeasureInWindow = _nativeFabricUIManage.measureInWindow,
  1496. fabricMeasureLayout = _nativeFabricUIManage.measureLayout,
  1497. getViewConfigForType =
  1498. ReactNativePrivateInterface.ReactNativeViewConfigRegistry.get,
  1499. nextReactTag = 2;
  1500. registerEventHandler && registerEventHandler(dispatchEvent);
  1501. var ReactFabricHostComponent = (function() {
  1502. function ReactFabricHostComponent(
  1503. tag,
  1504. viewConfig,
  1505. props,
  1506. internalInstanceHandle
  1507. ) {
  1508. this._nativeTag = tag;
  1509. this.viewConfig = viewConfig;
  1510. this.currentProps = props;
  1511. this._internalInstanceHandle = internalInstanceHandle;
  1512. }
  1513. var _proto = ReactFabricHostComponent.prototype;
  1514. _proto.blur = function() {
  1515. ReactNativePrivateInterface.TextInputState.blurTextInput(this);
  1516. };
  1517. _proto.focus = function() {
  1518. ReactNativePrivateInterface.TextInputState.focusTextInput(this);
  1519. };
  1520. _proto.measure = function(callback) {
  1521. fabricMeasure(
  1522. this._internalInstanceHandle.stateNode.node,
  1523. mountSafeCallback_NOT_REALLY_SAFE(this, callback)
  1524. );
  1525. };
  1526. _proto.measureInWindow = function(callback) {
  1527. fabricMeasureInWindow(
  1528. this._internalInstanceHandle.stateNode.node,
  1529. mountSafeCallback_NOT_REALLY_SAFE(this, callback)
  1530. );
  1531. };
  1532. _proto.measureLayout = function(relativeToNativeNode, onSuccess, onFail) {
  1533. "number" !== typeof relativeToNativeNode &&
  1534. relativeToNativeNode instanceof ReactFabricHostComponent &&
  1535. fabricMeasureLayout(
  1536. this._internalInstanceHandle.stateNode.node,
  1537. relativeToNativeNode._internalInstanceHandle.stateNode.node,
  1538. mountSafeCallback_NOT_REALLY_SAFE(this, onFail),
  1539. mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess)
  1540. );
  1541. };
  1542. _proto.setNativeProps = function() {};
  1543. return ReactFabricHostComponent;
  1544. })();
  1545. function createTextInstance(
  1546. text,
  1547. rootContainerInstance,
  1548. hostContext,
  1549. internalInstanceHandle
  1550. ) {
  1551. if (!hostContext.isInAParentText)
  1552. throw Error("Text strings must be rendered within a <Text> component.");
  1553. hostContext = nextReactTag;
  1554. nextReactTag += 2;
  1555. return {
  1556. node: createNode(
  1557. hostContext,
  1558. "RCTRawText",
  1559. rootContainerInstance,
  1560. { text: text },
  1561. internalInstanceHandle
  1562. )
  1563. };
  1564. }
  1565. var scheduleTimeout = setTimeout,
  1566. cancelTimeout = clearTimeout;
  1567. function cloneHiddenInstance(instance) {
  1568. var node = instance.node;
  1569. var updatePayload = diffProperties(
  1570. null,
  1571. emptyObject,
  1572. { style: { display: "none" } },
  1573. instance.canonical.viewConfig.validAttributes
  1574. );
  1575. return {
  1576. node: cloneNodeWithNewProps(node, updatePayload),
  1577. canonical: instance.canonical
  1578. };
  1579. }
  1580. var valueStack = [],
  1581. index = -1;
  1582. function pop(cursor) {
  1583. 0 > index ||
  1584. ((cursor.current = valueStack[index]), (valueStack[index] = null), index--);
  1585. }
  1586. function push(cursor, value) {
  1587. index++;
  1588. valueStack[index] = cursor.current;
  1589. cursor.current = value;
  1590. }
  1591. var emptyContextObject = {},
  1592. contextStackCursor = { current: emptyContextObject },
  1593. didPerformWorkStackCursor = { current: !1 },
  1594. previousContext = emptyContextObject;
  1595. function getMaskedContext(workInProgress, unmaskedContext) {
  1596. var contextTypes = workInProgress.type.contextTypes;
  1597. if (!contextTypes) return emptyContextObject;
  1598. var instance = workInProgress.stateNode;
  1599. if (
  1600. instance &&
  1601. instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext
  1602. )
  1603. return instance.__reactInternalMemoizedMaskedChildContext;
  1604. var context = {},
  1605. key;
  1606. for (key in contextTypes) context[key] = unmaskedContext[key];
  1607. instance &&
  1608. ((workInProgress = workInProgress.stateNode),
  1609. (workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext),
  1610. (workInProgress.__reactInternalMemoizedMaskedChildContext = context));
  1611. return context;
  1612. }
  1613. function isContextProvider(type) {
  1614. type = type.childContextTypes;
  1615. return null !== type && void 0 !== type;
  1616. }
  1617. function popContext() {
  1618. pop(didPerformWorkStackCursor);
  1619. pop(contextStackCursor);
  1620. }
  1621. function pushTopLevelContextObject(fiber, context, didChange) {
  1622. if (contextStackCursor.current !== emptyContextObject)
  1623. throw Error(
  1624. "Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue."
  1625. );
  1626. push(contextStackCursor, context);
  1627. push(didPerformWorkStackCursor, didChange);
  1628. }
  1629. function processChildContext(fiber, type, parentContext) {
  1630. var instance = fiber.stateNode;
  1631. fiber = type.childContextTypes;
  1632. if ("function" !== typeof instance.getChildContext) return parentContext;
  1633. instance = instance.getChildContext();
  1634. for (var contextKey in instance)
  1635. if (!(contextKey in fiber))
  1636. throw Error(
  1637. (getComponentName(type) || "Unknown") +
  1638. '.getChildContext(): key "' +
  1639. contextKey +
  1640. '" is not defined in childContextTypes.'
  1641. );
  1642. return Object.assign({}, parentContext, {}, instance);
  1643. }
  1644. function pushContextProvider(workInProgress) {
  1645. workInProgress =
  1646. ((workInProgress = workInProgress.stateNode) &&
  1647. workInProgress.__reactInternalMemoizedMergedChildContext) ||
  1648. emptyContextObject;
  1649. previousContext = contextStackCursor.current;
  1650. push(contextStackCursor, workInProgress);
  1651. push(didPerformWorkStackCursor, didPerformWorkStackCursor.current);
  1652. return !0;
  1653. }
  1654. function invalidateContextProvider(workInProgress, type, didChange) {
  1655. var instance = workInProgress.stateNode;
  1656. if (!instance)
  1657. throw Error(
  1658. "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue."
  1659. );
  1660. didChange
  1661. ? ((workInProgress = processChildContext(
  1662. workInProgress,
  1663. type,
  1664. previousContext
  1665. )),
  1666. (instance.__reactInternalMemoizedMergedChildContext = workInProgress),
  1667. pop(didPerformWorkStackCursor),
  1668. pop(contextStackCursor),
  1669. push(contextStackCursor, workInProgress))
  1670. : pop(didPerformWorkStackCursor);
  1671. push(didPerformWorkStackCursor, didChange);
  1672. }
  1673. var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,
  1674. Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,
  1675. Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,
  1676. Scheduler_shouldYield = Scheduler.unstable_shouldYield,
  1677. Scheduler_requestPaint = Scheduler.unstable_requestPaint,
  1678. Scheduler_now = Scheduler.unstable_now,
  1679. Scheduler_getCurrentPriorityLevel =
  1680. Scheduler.unstable_getCurrentPriorityLevel,
  1681. Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,
  1682. Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,
  1683. Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,
  1684. Scheduler_LowPriority = Scheduler.unstable_LowPriority,
  1685. Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;
  1686. if (
  1687. null == tracing.__interactionsRef ||
  1688. null == tracing.__interactionsRef.current
  1689. )
  1690. throw Error(
  1691. "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling"
  1692. );
  1693. var fakeCallbackNode = {},
  1694. requestPaint =
  1695. void 0 !== Scheduler_requestPaint ? Scheduler_requestPaint : function() {},
  1696. syncQueue = null,
  1697. immediateQueueCallbackNode = null,
  1698. isFlushingSyncQueue = !1,
  1699. initialTimeMs = Scheduler_now(),
  1700. now =
  1701. 1e4 > initialTimeMs
  1702. ? Scheduler_now
  1703. : function() {
  1704. return Scheduler_now() - initialTimeMs;
  1705. };
  1706. function getCurrentPriorityLevel() {
  1707. switch (Scheduler_getCurrentPriorityLevel()) {
  1708. case Scheduler_ImmediatePriority:
  1709. return 99;
  1710. case Scheduler_UserBlockingPriority:
  1711. return 98;
  1712. case Scheduler_NormalPriority:
  1713. return 97;
  1714. case Scheduler_LowPriority:
  1715. return 96;
  1716. case Scheduler_IdlePriority:
  1717. return 95;
  1718. default:
  1719. throw Error("Unknown priority level.");
  1720. }
  1721. }
  1722. function reactPriorityToSchedulerPriority(reactPriorityLevel) {
  1723. switch (reactPriorityLevel) {
  1724. case 99:
  1725. return Scheduler_ImmediatePriority;
  1726. case 98:
  1727. return Scheduler_UserBlockingPriority;
  1728. case 97:
  1729. return Scheduler_NormalPriority;
  1730. case 96:
  1731. return Scheduler_LowPriority;
  1732. case 95:
  1733. return Scheduler_IdlePriority;
  1734. default:
  1735. throw Error("Unknown priority level.");
  1736. }
  1737. }
  1738. function runWithPriority(reactPriorityLevel, fn) {
  1739. reactPriorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  1740. return Scheduler_runWithPriority(reactPriorityLevel, fn);
  1741. }
  1742. function scheduleCallback(reactPriorityLevel, callback, options) {
  1743. reactPriorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  1744. return Scheduler_scheduleCallback(reactPriorityLevel, callback, options);
  1745. }
  1746. function scheduleSyncCallback(callback) {
  1747. null === syncQueue
  1748. ? ((syncQueue = [callback]),
  1749. (immediateQueueCallbackNode = Scheduler_scheduleCallback(
  1750. Scheduler_ImmediatePriority,
  1751. flushSyncCallbackQueueImpl
  1752. )))
  1753. : syncQueue.push(callback);
  1754. return fakeCallbackNode;
  1755. }
  1756. function flushSyncCallbackQueue() {
  1757. if (null !== immediateQueueCallbackNode) {
  1758. var node = immediateQueueCallbackNode;
  1759. immediateQueueCallbackNode = null;
  1760. Scheduler_cancelCallback(node);
  1761. }
  1762. flushSyncCallbackQueueImpl();
  1763. }
  1764. function flushSyncCallbackQueueImpl() {
  1765. if (!isFlushingSyncQueue && null !== syncQueue) {
  1766. isFlushingSyncQueue = !0;
  1767. var i = 0;
  1768. try {
  1769. var queue = syncQueue;
  1770. runWithPriority(99, function() {
  1771. for (; i < queue.length; i++) {
  1772. var callback = queue[i];
  1773. do callback = callback(!0);
  1774. while (null !== callback);
  1775. }
  1776. });
  1777. syncQueue = null;
  1778. } catch (error) {
  1779. throw (null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)),
  1780. Scheduler_scheduleCallback(
  1781. Scheduler_ImmediatePriority,
  1782. flushSyncCallbackQueue
  1783. ),
  1784. error);
  1785. } finally {
  1786. isFlushingSyncQueue = !1;
  1787. }
  1788. }
  1789. }
  1790. function inferPriorityFromExpirationTime(currentTime, expirationTime) {
  1791. if (1073741823 === expirationTime) return 99;
  1792. if (1 === expirationTime || 2 === expirationTime) return 95;
  1793. currentTime =
  1794. 10 * (1073741821 - expirationTime) - 10 * (1073741821 - currentTime);
  1795. return 0 >= currentTime
  1796. ? 99
  1797. : 250 >= currentTime
  1798. ? 98
  1799. : 5250 >= currentTime
  1800. ? 97
  1801. : 95;
  1802. }
  1803. function is(x, y) {
  1804. return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
  1805. }
  1806. var objectIs = "function" === typeof Object.is ? Object.is : is,
  1807. hasOwnProperty = Object.prototype.hasOwnProperty;
  1808. function shallowEqual(objA, objB) {
  1809. if (objectIs(objA, objB)) return !0;
  1810. if (
  1811. "object" !== typeof objA ||
  1812. null === objA ||
  1813. "object" !== typeof objB ||
  1814. null === objB
  1815. )
  1816. return !1;
  1817. var keysA = Object.keys(objA),
  1818. keysB = Object.keys(objB);
  1819. if (keysA.length !== keysB.length) return !1;
  1820. for (keysB = 0; keysB < keysA.length; keysB++)
  1821. if (
  1822. !hasOwnProperty.call(objB, keysA[keysB]) ||
  1823. !objectIs(objA[keysA[keysB]], objB[keysA[keysB]])
  1824. )
  1825. return !1;
  1826. return !0;
  1827. }
  1828. var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
  1829. function getStackByFiberInDevAndProd(workInProgress) {
  1830. var info = "";
  1831. do {
  1832. a: switch (workInProgress.tag) {
  1833. case 3:
  1834. case 4:
  1835. case 6:
  1836. case 7:
  1837. case 10:
  1838. case 9:
  1839. var JSCompiler_inline_result = "";
  1840. break a;
  1841. default:
  1842. var owner = workInProgress._debugOwner,
  1843. source = workInProgress._debugSource,
  1844. name = getComponentName(workInProgress.type);
  1845. JSCompiler_inline_result = null;
  1846. owner && (JSCompiler_inline_result = getComponentName(owner.type));
  1847. owner = name;
  1848. name = "";
  1849. source
  1850. ? (name =
  1851. " (at " +
  1852. source.fileName.replace(BEFORE_SLASH_RE, "") +
  1853. ":" +
  1854. source.lineNumber +
  1855. ")")
  1856. : JSCompiler_inline_result &&
  1857. (name = " (created by " + JSCompiler_inline_result + ")");
  1858. JSCompiler_inline_result = "\n in " + (owner || "Unknown") + name;
  1859. }
  1860. info += JSCompiler_inline_result;
  1861. workInProgress = workInProgress.return;
  1862. } while (workInProgress);
  1863. return info;
  1864. }
  1865. function resolveDefaultProps(Component, baseProps) {
  1866. if (Component && Component.defaultProps) {
  1867. baseProps = Object.assign({}, baseProps);
  1868. Component = Component.defaultProps;
  1869. for (var propName in Component)
  1870. void 0 === baseProps[propName] &&
  1871. (baseProps[propName] = Component[propName]);
  1872. }
  1873. return baseProps;
  1874. }
  1875. var valueCursor = { current: null },
  1876. currentlyRenderingFiber = null,
  1877. lastContextDependency = null,
  1878. lastContextWithAllBitsObserved = null;
  1879. function resetContextDependencies() {
  1880. lastContextWithAllBitsObserved = lastContextDependency = currentlyRenderingFiber = null;
  1881. }
  1882. function popProvider(providerFiber) {
  1883. var currentValue = valueCursor.current;
  1884. pop(valueCursor);
  1885. providerFiber.type._context._currentValue2 = currentValue;
  1886. }
  1887. function scheduleWorkOnParentPath(parent, renderExpirationTime) {
  1888. for (; null !== parent; ) {
  1889. var alternate = parent.alternate;
  1890. if (parent.childExpirationTime < renderExpirationTime)
  1891. (parent.childExpirationTime = renderExpirationTime),
  1892. null !== alternate &&
  1893. alternate.childExpirationTime < renderExpirationTime &&
  1894. (alternate.childExpirationTime = renderExpirationTime);
  1895. else if (
  1896. null !== alternate &&
  1897. alternate.childExpirationTime < renderExpirationTime
  1898. )
  1899. alternate.childExpirationTime = renderExpirationTime;
  1900. else break;
  1901. parent = parent.return;
  1902. }
  1903. }
  1904. function prepareToReadContext(workInProgress, renderExpirationTime) {
  1905. currentlyRenderingFiber = workInProgress;
  1906. lastContextWithAllBitsObserved = lastContextDependency = null;
  1907. workInProgress = workInProgress.dependencies;
  1908. null !== workInProgress &&
  1909. null !== workInProgress.firstContext &&
  1910. (workInProgress.expirationTime >= renderExpirationTime &&
  1911. (didReceiveUpdate = !0),
  1912. (workInProgress.firstContext = null));
  1913. }
  1914. function readContext(context, observedBits) {
  1915. if (
  1916. lastContextWithAllBitsObserved !== context &&
  1917. !1 !== observedBits &&
  1918. 0 !== observedBits
  1919. ) {
  1920. if ("number" !== typeof observedBits || 1073741823 === observedBits)
  1921. (lastContextWithAllBitsObserved = context), (observedBits = 1073741823);
  1922. observedBits = { context: context, observedBits: observedBits, next: null };
  1923. if (null === lastContextDependency) {
  1924. if (null === currentlyRenderingFiber)
  1925. throw Error(
  1926. "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
  1927. );
  1928. lastContextDependency = observedBits;
  1929. currentlyRenderingFiber.dependencies = {
  1930. expirationTime: 0,
  1931. firstContext: observedBits,
  1932. responders: null
  1933. };
  1934. } else lastContextDependency = lastContextDependency.next = observedBits;
  1935. }
  1936. return context._currentValue2;
  1937. }
  1938. var hasForceUpdate = !1;
  1939. function initializeUpdateQueue(fiber) {
  1940. fiber.updateQueue = {
  1941. baseState: fiber.memoizedState,
  1942. baseQueue: null,
  1943. shared: { pending: null },
  1944. effects: null
  1945. };
  1946. }
  1947. function cloneUpdateQueue(current, workInProgress) {
  1948. current = current.updateQueue;
  1949. workInProgress.updateQueue === current &&
  1950. (workInProgress.updateQueue = {
  1951. baseState: current.baseState,
  1952. baseQueue: current.baseQueue,
  1953. shared: current.shared,
  1954. effects: current.effects
  1955. });
  1956. }
  1957. function createUpdate(expirationTime, suspenseConfig) {
  1958. expirationTime = {
  1959. expirationTime: expirationTime,
  1960. suspenseConfig: suspenseConfig,
  1961. tag: 0,
  1962. payload: null,
  1963. callback: null,
  1964. next: null
  1965. };
  1966. return (expirationTime.next = expirationTime);
  1967. }
  1968. function enqueueUpdate(fiber, update) {
  1969. fiber = fiber.updateQueue;
  1970. if (null !== fiber) {
  1971. fiber = fiber.shared;
  1972. var pending = fiber.pending;
  1973. null === pending
  1974. ? (update.next = update)
  1975. : ((update.next = pending.next), (pending.next = update));
  1976. fiber.pending = update;
  1977. }
  1978. }
  1979. function enqueueCapturedUpdate(workInProgress, update) {
  1980. var current = workInProgress.alternate;
  1981. null !== current && cloneUpdateQueue(current, workInProgress);
  1982. workInProgress = workInProgress.updateQueue;
  1983. current = workInProgress.baseQueue;
  1984. null === current
  1985. ? ((workInProgress.baseQueue = update.next = update),
  1986. (update.next = update))
  1987. : ((update.next = current.next), (current.next = update));
  1988. }
  1989. function processUpdateQueue(
  1990. workInProgress$jscomp$0,
  1991. props,
  1992. instance,
  1993. renderExpirationTime
  1994. ) {
  1995. var queue = workInProgress$jscomp$0.updateQueue;
  1996. hasForceUpdate = !1;
  1997. var baseQueue = queue.baseQueue,
  1998. pendingQueue = queue.shared.pending;
  1999. if (null !== pendingQueue) {
  2000. if (null !== baseQueue) {
  2001. var baseFirst = baseQueue.next;
  2002. baseQueue.next = pendingQueue.next;
  2003. pendingQueue.next = baseFirst;
  2004. }
  2005. baseQueue = pendingQueue;
  2006. queue.shared.pending = null;
  2007. baseFirst = workInProgress$jscomp$0.alternate;
  2008. null !== baseFirst &&
  2009. ((baseFirst = baseFirst.updateQueue),
  2010. null !== baseFirst && (baseFirst.baseQueue = pendingQueue));
  2011. }
  2012. if (null !== baseQueue) {
  2013. baseFirst = baseQueue.next;
  2014. var newState = queue.baseState,
  2015. newExpirationTime = 0,
  2016. newBaseState = null,
  2017. newBaseQueueFirst = null,
  2018. newBaseQueueLast = null;
  2019. if (null !== baseFirst) {
  2020. var update = baseFirst;
  2021. do {
  2022. pendingQueue = update.expirationTime;
  2023. if (pendingQueue < renderExpirationTime) {
  2024. var clone = {
  2025. expirationTime: update.expirationTime,
  2026. suspenseConfig: update.suspenseConfig,
  2027. tag: update.tag,
  2028. payload: update.payload,
  2029. callback: update.callback,
  2030. next: null
  2031. };
  2032. null === newBaseQueueLast
  2033. ? ((newBaseQueueFirst = newBaseQueueLast = clone),
  2034. (newBaseState = newState))
  2035. : (newBaseQueueLast = newBaseQueueLast.next = clone);
  2036. pendingQueue > newExpirationTime &&
  2037. (newExpirationTime = pendingQueue);
  2038. } else {
  2039. null !== newBaseQueueLast &&
  2040. (newBaseQueueLast = newBaseQueueLast.next = {
  2041. expirationTime: 1073741823,
  2042. suspenseConfig: update.suspenseConfig,
  2043. tag: update.tag,
  2044. payload: update.payload,
  2045. callback: update.callback,
  2046. next: null
  2047. });
  2048. markRenderEventTimeAndConfig(pendingQueue, update.suspenseConfig);
  2049. a: {
  2050. var workInProgress = workInProgress$jscomp$0,
  2051. update$jscomp$0 = update;
  2052. pendingQueue = props;
  2053. clone = instance;
  2054. switch (update$jscomp$0.tag) {
  2055. case 1:
  2056. workInProgress = update$jscomp$0.payload;
  2057. if ("function" === typeof workInProgress) {
  2058. newState = workInProgress.call(clone, newState, pendingQueue);
  2059. break a;
  2060. }
  2061. newState = workInProgress;
  2062. break a;
  2063. case 3:
  2064. workInProgress.effectTag =
  2065. (workInProgress.effectTag & -4097) | 64;
  2066. case 0:
  2067. workInProgress = update$jscomp$0.payload;
  2068. pendingQueue =
  2069. "function" === typeof workInProgress
  2070. ? workInProgress.call(clone, newState, pendingQueue)
  2071. : workInProgress;
  2072. if (null === pendingQueue || void 0 === pendingQueue) break a;
  2073. newState = Object.assign({}, newState, pendingQueue);
  2074. break a;
  2075. case 2:
  2076. hasForceUpdate = !0;
  2077. }
  2078. }
  2079. null !== update.callback &&
  2080. ((workInProgress$jscomp$0.effectTag |= 32),
  2081. (pendingQueue = queue.effects),
  2082. null === pendingQueue
  2083. ? (queue.effects = [update])
  2084. : pendingQueue.push(update));
  2085. }
  2086. update = update.next;
  2087. if (null === update || update === baseFirst)
  2088. if (((pendingQueue = queue.shared.pending), null === pendingQueue))
  2089. break;
  2090. else
  2091. (update = baseQueue.next = pendingQueue.next),
  2092. (pendingQueue.next = baseFirst),
  2093. (queue.baseQueue = baseQueue = pendingQueue),
  2094. (queue.shared.pending = null);
  2095. } while (1);
  2096. }
  2097. null === newBaseQueueLast
  2098. ? (newBaseState = newState)
  2099. : (newBaseQueueLast.next = newBaseQueueFirst);
  2100. queue.baseState = newBaseState;
  2101. queue.baseQueue = newBaseQueueLast;
  2102. markUnprocessedUpdateTime(newExpirationTime);
  2103. workInProgress$jscomp$0.expirationTime = newExpirationTime;
  2104. workInProgress$jscomp$0.memoizedState = newState;
  2105. }
  2106. }
  2107. function commitUpdateQueue(finishedWork, finishedQueue, instance) {
  2108. finishedWork = finishedQueue.effects;
  2109. finishedQueue.effects = null;
  2110. if (null !== finishedWork)
  2111. for (
  2112. finishedQueue = 0;
  2113. finishedQueue < finishedWork.length;
  2114. finishedQueue++
  2115. ) {
  2116. var effect = finishedWork[finishedQueue],
  2117. callback = effect.callback;
  2118. if (null !== callback) {
  2119. effect.callback = null;
  2120. if ("function" !== typeof callback)
  2121. throw Error(
  2122. "Invalid argument passed as callback. Expected a function. Instead received: " +
  2123. callback
  2124. );
  2125. callback.call(instance);
  2126. }
  2127. }
  2128. }
  2129. var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig,
  2130. emptyRefsObject = new React.Component().refs;
  2131. function applyDerivedStateFromProps(
  2132. workInProgress,
  2133. ctor,
  2134. getDerivedStateFromProps,
  2135. nextProps
  2136. ) {
  2137. ctor = workInProgress.memoizedState;
  2138. getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
  2139. getDerivedStateFromProps =
  2140. null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps
  2141. ? ctor
  2142. : Object.assign({}, ctor, getDerivedStateFromProps);
  2143. workInProgress.memoizedState = getDerivedStateFromProps;
  2144. 0 === workInProgress.expirationTime &&
  2145. (workInProgress.updateQueue.baseState = getDerivedStateFromProps);
  2146. }
  2147. var classComponentUpdater = {
  2148. isMounted: function(component) {
  2149. return (component = component._reactInternalFiber)
  2150. ? getNearestMountedFiber(component) === component
  2151. : !1;
  2152. },
  2153. enqueueSetState: function(inst, payload, callback) {
  2154. inst = inst._reactInternalFiber;
  2155. var currentTime = requestCurrentTimeForUpdate(),
  2156. suspenseConfig = ReactCurrentBatchConfig.suspense;
  2157. currentTime = computeExpirationForFiber(currentTime, inst, suspenseConfig);
  2158. suspenseConfig = createUpdate(currentTime, suspenseConfig);
  2159. suspenseConfig.payload = payload;
  2160. void 0 !== callback &&
  2161. null !== callback &&
  2162. (suspenseConfig.callback = callback);
  2163. enqueueUpdate(inst, suspenseConfig);
  2164. scheduleWork(inst, currentTime);
  2165. },
  2166. enqueueReplaceState: function(inst, payload, callback) {
  2167. inst = inst._reactInternalFiber;
  2168. var currentTime = requestCurrentTimeForUpdate(),
  2169. suspenseConfig = ReactCurrentBatchConfig.suspense;
  2170. currentTime = computeExpirationForFiber(currentTime, inst, suspenseConfig);
  2171. suspenseConfig = createUpdate(currentTime, suspenseConfig);
  2172. suspenseConfig.tag = 1;
  2173. suspenseConfig.payload = payload;
  2174. void 0 !== callback &&
  2175. null !== callback &&
  2176. (suspenseConfig.callback = callback);
  2177. enqueueUpdate(inst, suspenseConfig);
  2178. scheduleWork(inst, currentTime);
  2179. },
  2180. enqueueForceUpdate: function(inst, callback) {
  2181. inst = inst._reactInternalFiber;
  2182. var currentTime = requestCurrentTimeForUpdate(),
  2183. suspenseConfig = ReactCurrentBatchConfig.suspense;
  2184. currentTime = computeExpirationForFiber(currentTime, inst, suspenseConfig);
  2185. suspenseConfig = createUpdate(currentTime, suspenseConfig);
  2186. suspenseConfig.tag = 2;
  2187. void 0 !== callback &&
  2188. null !== callback &&
  2189. (suspenseConfig.callback = callback);
  2190. enqueueUpdate(inst, suspenseConfig);
  2191. scheduleWork(inst, currentTime);
  2192. }
  2193. };
  2194. function checkShouldComponentUpdate(
  2195. workInProgress,
  2196. ctor,
  2197. oldProps,
  2198. newProps,
  2199. oldState,
  2200. newState,
  2201. nextContext
  2202. ) {
  2203. workInProgress = workInProgress.stateNode;
  2204. return "function" === typeof workInProgress.shouldComponentUpdate
  2205. ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext)
  2206. : ctor.prototype && ctor.prototype.isPureReactComponent
  2207. ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
  2208. : !0;
  2209. }
  2210. function constructClassInstance(workInProgress, ctor, props) {
  2211. var isLegacyContextConsumer = !1,
  2212. unmaskedContext = emptyContextObject;
  2213. var context = ctor.contextType;
  2214. "object" === typeof context && null !== context
  2215. ? (context = readContext(context))
  2216. : ((unmaskedContext = isContextProvider(ctor)
  2217. ? previousContext
  2218. : contextStackCursor.current),
  2219. (isLegacyContextConsumer = ctor.contextTypes),
  2220. (context = (isLegacyContextConsumer =
  2221. null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer)
  2222. ? getMaskedContext(workInProgress, unmaskedContext)
  2223. : emptyContextObject));
  2224. ctor = new ctor(props, context);
  2225. workInProgress.memoizedState =
  2226. null !== ctor.state && void 0 !== ctor.state ? ctor.state : null;
  2227. ctor.updater = classComponentUpdater;
  2228. workInProgress.stateNode = ctor;
  2229. ctor._reactInternalFiber = workInProgress;
  2230. isLegacyContextConsumer &&
  2231. ((workInProgress = workInProgress.stateNode),
  2232. (workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext),
  2233. (workInProgress.__reactInternalMemoizedMaskedChildContext = context));
  2234. return ctor;
  2235. }
  2236. function callComponentWillReceiveProps(
  2237. workInProgress,
  2238. instance,
  2239. newProps,
  2240. nextContext
  2241. ) {
  2242. workInProgress = instance.state;
  2243. "function" === typeof instance.componentWillReceiveProps &&
  2244. instance.componentWillReceiveProps(newProps, nextContext);
  2245. "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
  2246. instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
  2247. instance.state !== workInProgress &&
  2248. classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  2249. }
  2250. function mountClassInstance(
  2251. workInProgress,
  2252. ctor,
  2253. newProps,
  2254. renderExpirationTime
  2255. ) {
  2256. var instance = workInProgress.stateNode;
  2257. instance.props = newProps;
  2258. instance.state = workInProgress.memoizedState;
  2259. instance.refs = emptyRefsObject;
  2260. initializeUpdateQueue(workInProgress);
  2261. var contextType = ctor.contextType;
  2262. "object" === typeof contextType && null !== contextType
  2263. ? (instance.context = readContext(contextType))
  2264. : ((contextType = isContextProvider(ctor)
  2265. ? previousContext
  2266. : contextStackCursor.current),
  2267. (instance.context = getMaskedContext(workInProgress, contextType)));
  2268. processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);
  2269. instance.state = workInProgress.memoizedState;
  2270. contextType = ctor.getDerivedStateFromProps;
  2271. "function" === typeof contextType &&
  2272. (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps),
  2273. (instance.state = workInProgress.memoizedState));
  2274. "function" === typeof ctor.getDerivedStateFromProps ||
  2275. "function" === typeof instance.getSnapshotBeforeUpdate ||
  2276. ("function" !== typeof instance.UNSAFE_componentWillMount &&
  2277. "function" !== typeof instance.componentWillMount) ||
  2278. ((ctor = instance.state),
  2279. "function" === typeof instance.componentWillMount &&
  2280. instance.componentWillMount(),
  2281. "function" === typeof instance.UNSAFE_componentWillMount &&
  2282. instance.UNSAFE_componentWillMount(),
  2283. ctor !== instance.state &&
  2284. classComponentUpdater.enqueueReplaceState(instance, instance.state, null),
  2285. processUpdateQueue(
  2286. workInProgress,
  2287. newProps,
  2288. instance,
  2289. renderExpirationTime
  2290. ),
  2291. (instance.state = workInProgress.memoizedState));
  2292. "function" === typeof instance.componentDidMount &&
  2293. (workInProgress.effectTag |= 4);
  2294. }
  2295. var isArray = Array.isArray;
  2296. function coerceRef(returnFiber, current, element) {
  2297. returnFiber = element.ref;
  2298. if (
  2299. null !== returnFiber &&
  2300. "function" !== typeof returnFiber &&
  2301. "object" !== typeof returnFiber
  2302. ) {
  2303. if (element._owner) {
  2304. element = element._owner;
  2305. if (element) {
  2306. if (1 !== element.tag)
  2307. throw Error(
  2308. "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref"
  2309. );
  2310. var inst = element.stateNode;
  2311. }
  2312. if (!inst)
  2313. throw Error(
  2314. "Missing owner for string ref " +
  2315. returnFiber +
  2316. ". This error is likely caused by a bug in React. Please file an issue."
  2317. );
  2318. var stringRef = "" + returnFiber;
  2319. if (
  2320. null !== current &&
  2321. null !== current.ref &&
  2322. "function" === typeof current.ref &&
  2323. current.ref._stringRef === stringRef
  2324. )
  2325. return current.ref;
  2326. current = function(value) {
  2327. var refs = inst.refs;
  2328. refs === emptyRefsObject && (refs = inst.refs = {});
  2329. null === value ? delete refs[stringRef] : (refs[stringRef] = value);
  2330. };
  2331. current._stringRef = stringRef;
  2332. return current;
  2333. }
  2334. if ("string" !== typeof returnFiber)
  2335. throw Error(
  2336. "Expected ref to be a function, a string, an object returned by React.createRef(), or null."
  2337. );
  2338. if (!element._owner)
  2339. throw Error(
  2340. "Element ref was specified as a string (" +
  2341. returnFiber +
  2342. ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information."
  2343. );
  2344. }
  2345. return returnFiber;
  2346. }
  2347. function throwOnInvalidObjectType(returnFiber, newChild) {
  2348. if ("textarea" !== returnFiber.type)
  2349. throw Error(
  2350. "Objects are not valid as a React child (found: " +
  2351. ("[object Object]" === Object.prototype.toString.call(newChild)
  2352. ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
  2353. : newChild) +
  2354. ")."
  2355. );
  2356. }
  2357. function ChildReconciler(shouldTrackSideEffects) {
  2358. function deleteChild(returnFiber, childToDelete) {
  2359. if (shouldTrackSideEffects) {
  2360. var last = returnFiber.lastEffect;
  2361. null !== last
  2362. ? ((last.nextEffect = childToDelete),
  2363. (returnFiber.lastEffect = childToDelete))
  2364. : (returnFiber.firstEffect = returnFiber.lastEffect = childToDelete);
  2365. childToDelete.nextEffect = null;
  2366. childToDelete.effectTag = 8;
  2367. }
  2368. }
  2369. function deleteRemainingChildren(returnFiber, currentFirstChild) {
  2370. if (!shouldTrackSideEffects) return null;
  2371. for (; null !== currentFirstChild; )
  2372. deleteChild(returnFiber, currentFirstChild),
  2373. (currentFirstChild = currentFirstChild.sibling);
  2374. return null;
  2375. }
  2376. function mapRemainingChildren(returnFiber, currentFirstChild) {
  2377. for (returnFiber = new Map(); null !== currentFirstChild; )
  2378. null !== currentFirstChild.key
  2379. ? returnFiber.set(currentFirstChild.key, currentFirstChild)
  2380. : returnFiber.set(currentFirstChild.index, currentFirstChild),
  2381. (currentFirstChild = currentFirstChild.sibling);
  2382. return returnFiber;
  2383. }
  2384. function useFiber(fiber, pendingProps) {
  2385. fiber = createWorkInProgress(fiber, pendingProps);
  2386. fiber.index = 0;
  2387. fiber.sibling = null;
  2388. return fiber;
  2389. }
  2390. function placeChild(newFiber, lastPlacedIndex, newIndex) {
  2391. newFiber.index = newIndex;
  2392. if (!shouldTrackSideEffects) return lastPlacedIndex;
  2393. newIndex = newFiber.alternate;
  2394. if (null !== newIndex)
  2395. return (
  2396. (newIndex = newIndex.index),
  2397. newIndex < lastPlacedIndex
  2398. ? ((newFiber.effectTag = 2), lastPlacedIndex)
  2399. : newIndex
  2400. );
  2401. newFiber.effectTag = 2;
  2402. return lastPlacedIndex;
  2403. }
  2404. function placeSingleChild(newFiber) {
  2405. shouldTrackSideEffects &&
  2406. null === newFiber.alternate &&
  2407. (newFiber.effectTag = 2);
  2408. return newFiber;
  2409. }
  2410. function updateTextNode(returnFiber, current, textContent, expirationTime) {
  2411. if (null === current || 6 !== current.tag)
  2412. return (
  2413. (current = createFiberFromText(
  2414. textContent,
  2415. returnFiber.mode,
  2416. expirationTime
  2417. )),
  2418. (current.return = returnFiber),
  2419. current
  2420. );
  2421. current = useFiber(current, textContent);
  2422. current.return = returnFiber;
  2423. return current;
  2424. }
  2425. function updateElement(returnFiber, current, element, expirationTime) {
  2426. if (null !== current && current.elementType === element.type)
  2427. return (
  2428. (expirationTime = useFiber(current, element.props)),
  2429. (expirationTime.ref = coerceRef(returnFiber, current, element)),
  2430. (expirationTime.return = returnFiber),
  2431. expirationTime
  2432. );
  2433. expirationTime = createFiberFromTypeAndProps(
  2434. element.type,
  2435. element.key,
  2436. element.props,
  2437. null,
  2438. returnFiber.mode,
  2439. expirationTime
  2440. );
  2441. expirationTime.ref = coerceRef(returnFiber, current, element);
  2442. expirationTime.return = returnFiber;
  2443. return expirationTime;
  2444. }
  2445. function updatePortal(returnFiber, current, portal, expirationTime) {
  2446. if (
  2447. null === current ||
  2448. 4 !== current.tag ||
  2449. current.stateNode.containerInfo !== portal.containerInfo ||
  2450. current.stateNode.implementation !== portal.implementation
  2451. )
  2452. return (
  2453. (current = createFiberFromPortal(
  2454. portal,
  2455. returnFiber.mode,
  2456. expirationTime
  2457. )),
  2458. (current.return = returnFiber),
  2459. current
  2460. );
  2461. current = useFiber(current, portal.children || []);
  2462. current.return = returnFiber;
  2463. return current;
  2464. }
  2465. function updateFragment(returnFiber, current, fragment, expirationTime, key) {
  2466. if (null === current || 7 !== current.tag)
  2467. return (
  2468. (current = createFiberFromFragment(
  2469. fragment,
  2470. returnFiber.mode,
  2471. expirationTime,
  2472. key
  2473. )),
  2474. (current.return = returnFiber),
  2475. current
  2476. );
  2477. current = useFiber(current, fragment);
  2478. current.return = returnFiber;
  2479. return current;
  2480. }
  2481. function createChild(returnFiber, newChild, expirationTime) {
  2482. if ("string" === typeof newChild || "number" === typeof newChild)
  2483. return (
  2484. (newChild = createFiberFromText(
  2485. "" + newChild,
  2486. returnFiber.mode,
  2487. expirationTime
  2488. )),
  2489. (newChild.return = returnFiber),
  2490. newChild
  2491. );
  2492. if ("object" === typeof newChild && null !== newChild) {
  2493. switch (newChild.$$typeof) {
  2494. case REACT_ELEMENT_TYPE:
  2495. return (
  2496. (expirationTime = createFiberFromTypeAndProps(
  2497. newChild.type,
  2498. newChild.key,
  2499. newChild.props,
  2500. null,
  2501. returnFiber.mode,
  2502. expirationTime
  2503. )),
  2504. (expirationTime.ref = coerceRef(returnFiber, null, newChild)),
  2505. (expirationTime.return = returnFiber),
  2506. expirationTime
  2507. );
  2508. case REACT_PORTAL_TYPE:
  2509. return (
  2510. (newChild = createFiberFromPortal(
  2511. newChild,
  2512. returnFiber.mode,
  2513. expirationTime
  2514. )),
  2515. (newChild.return = returnFiber),
  2516. newChild
  2517. );
  2518. }
  2519. if (isArray(newChild) || getIteratorFn(newChild))
  2520. return (
  2521. (newChild = createFiberFromFragment(
  2522. newChild,
  2523. returnFiber.mode,
  2524. expirationTime,
  2525. null
  2526. )),
  2527. (newChild.return = returnFiber),
  2528. newChild
  2529. );
  2530. throwOnInvalidObjectType(returnFiber, newChild);
  2531. }
  2532. return null;
  2533. }
  2534. function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
  2535. var key = null !== oldFiber ? oldFiber.key : null;
  2536. if ("string" === typeof newChild || "number" === typeof newChild)
  2537. return null !== key
  2538. ? null
  2539. : updateTextNode(returnFiber, oldFiber, "" + newChild, expirationTime);
  2540. if ("object" === typeof newChild && null !== newChild) {
  2541. switch (newChild.$$typeof) {
  2542. case REACT_ELEMENT_TYPE:
  2543. return newChild.key === key
  2544. ? newChild.type === REACT_FRAGMENT_TYPE
  2545. ? updateFragment(
  2546. returnFiber,
  2547. oldFiber,
  2548. newChild.props.children,
  2549. expirationTime,
  2550. key
  2551. )
  2552. : updateElement(returnFiber, oldFiber, newChild, expirationTime)
  2553. : null;
  2554. case REACT_PORTAL_TYPE:
  2555. return newChild.key === key
  2556. ? updatePortal(returnFiber, oldFiber, newChild, expirationTime)
  2557. : null;
  2558. }
  2559. if (isArray(newChild) || getIteratorFn(newChild))
  2560. return null !== key
  2561. ? null
  2562. : updateFragment(
  2563. returnFiber,
  2564. oldFiber,
  2565. newChild,
  2566. expirationTime,
  2567. null
  2568. );
  2569. throwOnInvalidObjectType(returnFiber, newChild);
  2570. }
  2571. return null;
  2572. }
  2573. function updateFromMap(
  2574. existingChildren,
  2575. returnFiber,
  2576. newIdx,
  2577. newChild,
  2578. expirationTime
  2579. ) {
  2580. if ("string" === typeof newChild || "number" === typeof newChild)
  2581. return (
  2582. (existingChildren = existingChildren.get(newIdx) || null),
  2583. updateTextNode(
  2584. returnFiber,
  2585. existingChildren,
  2586. "" + newChild,
  2587. expirationTime
  2588. )
  2589. );
  2590. if ("object" === typeof newChild && null !== newChild) {
  2591. switch (newChild.$$typeof) {
  2592. case REACT_ELEMENT_TYPE:
  2593. return (
  2594. (existingChildren =
  2595. existingChildren.get(
  2596. null === newChild.key ? newIdx : newChild.key
  2597. ) || null),
  2598. newChild.type === REACT_FRAGMENT_TYPE
  2599. ? updateFragment(
  2600. returnFiber,
  2601. existingChildren,
  2602. newChild.props.children,
  2603. expirationTime,
  2604. newChild.key
  2605. )
  2606. : updateElement(
  2607. returnFiber,
  2608. existingChildren,
  2609. newChild,
  2610. expirationTime
  2611. )
  2612. );
  2613. case REACT_PORTAL_TYPE:
  2614. return (
  2615. (existingChildren =
  2616. existingChildren.get(
  2617. null === newChild.key ? newIdx : newChild.key
  2618. ) || null),
  2619. updatePortal(
  2620. returnFiber,
  2621. existingChildren,
  2622. newChild,
  2623. expirationTime
  2624. )
  2625. );
  2626. }
  2627. if (isArray(newChild) || getIteratorFn(newChild))
  2628. return (
  2629. (existingChildren = existingChildren.get(newIdx) || null),
  2630. updateFragment(
  2631. returnFiber,
  2632. existingChildren,
  2633. newChild,
  2634. expirationTime,
  2635. null
  2636. )
  2637. );
  2638. throwOnInvalidObjectType(returnFiber, newChild);
  2639. }
  2640. return null;
  2641. }
  2642. function reconcileChildrenArray(
  2643. returnFiber,
  2644. currentFirstChild,
  2645. newChildren,
  2646. expirationTime
  2647. ) {
  2648. for (
  2649. var resultingFirstChild = null,
  2650. previousNewFiber = null,
  2651. oldFiber = currentFirstChild,
  2652. newIdx = (currentFirstChild = 0),
  2653. nextOldFiber = null;
  2654. null !== oldFiber && newIdx < newChildren.length;
  2655. newIdx++
  2656. ) {
  2657. oldFiber.index > newIdx
  2658. ? ((nextOldFiber = oldFiber), (oldFiber = null))
  2659. : (nextOldFiber = oldFiber.sibling);
  2660. var newFiber = updateSlot(
  2661. returnFiber,
  2662. oldFiber,
  2663. newChildren[newIdx],
  2664. expirationTime
  2665. );
  2666. if (null === newFiber) {
  2667. null === oldFiber && (oldFiber = nextOldFiber);
  2668. break;
  2669. }
  2670. shouldTrackSideEffects &&
  2671. oldFiber &&
  2672. null === newFiber.alternate &&
  2673. deleteChild(returnFiber, oldFiber);
  2674. currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
  2675. null === previousNewFiber
  2676. ? (resultingFirstChild = newFiber)
  2677. : (previousNewFiber.sibling = newFiber);
  2678. previousNewFiber = newFiber;
  2679. oldFiber = nextOldFiber;
  2680. }
  2681. if (newIdx === newChildren.length)
  2682. return (
  2683. deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild
  2684. );
  2685. if (null === oldFiber) {
  2686. for (; newIdx < newChildren.length; newIdx++)
  2687. (oldFiber = createChild(
  2688. returnFiber,
  2689. newChildren[newIdx],
  2690. expirationTime
  2691. )),
  2692. null !== oldFiber &&
  2693. ((currentFirstChild = placeChild(
  2694. oldFiber,
  2695. currentFirstChild,
  2696. newIdx
  2697. )),
  2698. null === previousNewFiber
  2699. ? (resultingFirstChild = oldFiber)
  2700. : (previousNewFiber.sibling = oldFiber),
  2701. (previousNewFiber = oldFiber));
  2702. return resultingFirstChild;
  2703. }
  2704. for (
  2705. oldFiber = mapRemainingChildren(returnFiber, oldFiber);
  2706. newIdx < newChildren.length;
  2707. newIdx++
  2708. )
  2709. (nextOldFiber = updateFromMap(
  2710. oldFiber,
  2711. returnFiber,
  2712. newIdx,
  2713. newChildren[newIdx],
  2714. expirationTime
  2715. )),
  2716. null !== nextOldFiber &&
  2717. (shouldTrackSideEffects &&
  2718. null !== nextOldFiber.alternate &&
  2719. oldFiber.delete(
  2720. null === nextOldFiber.key ? newIdx : nextOldFiber.key
  2721. ),
  2722. (currentFirstChild = placeChild(
  2723. nextOldFiber,
  2724. currentFirstChild,
  2725. newIdx
  2726. )),
  2727. null === previousNewFiber
  2728. ? (resultingFirstChild = nextOldFiber)
  2729. : (previousNewFiber.sibling = nextOldFiber),
  2730. (previousNewFiber = nextOldFiber));
  2731. shouldTrackSideEffects &&
  2732. oldFiber.forEach(function(child) {
  2733. return deleteChild(returnFiber, child);
  2734. });
  2735. return resultingFirstChild;
  2736. }
  2737. function reconcileChildrenIterator(
  2738. returnFiber,
  2739. currentFirstChild,
  2740. newChildrenIterable,
  2741. expirationTime
  2742. ) {
  2743. var iteratorFn = getIteratorFn(newChildrenIterable);
  2744. if ("function" !== typeof iteratorFn)
  2745. throw Error(
  2746. "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."
  2747. );
  2748. newChildrenIterable = iteratorFn.call(newChildrenIterable);
  2749. if (null == newChildrenIterable)
  2750. throw Error("An iterable object provided no iterator.");
  2751. for (
  2752. var previousNewFiber = (iteratorFn = null),
  2753. oldFiber = currentFirstChild,
  2754. newIdx = (currentFirstChild = 0),
  2755. nextOldFiber = null,
  2756. step = newChildrenIterable.next();
  2757. null !== oldFiber && !step.done;
  2758. newIdx++, step = newChildrenIterable.next()
  2759. ) {
  2760. oldFiber.index > newIdx
  2761. ? ((nextOldFiber = oldFiber), (oldFiber = null))
  2762. : (nextOldFiber = oldFiber.sibling);
  2763. var newFiber = updateSlot(
  2764. returnFiber,
  2765. oldFiber,
  2766. step.value,
  2767. expirationTime
  2768. );
  2769. if (null === newFiber) {
  2770. null === oldFiber && (oldFiber = nextOldFiber);
  2771. break;
  2772. }
  2773. shouldTrackSideEffects &&
  2774. oldFiber &&
  2775. null === newFiber.alternate &&
  2776. deleteChild(returnFiber, oldFiber);
  2777. currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
  2778. null === previousNewFiber
  2779. ? (iteratorFn = newFiber)
  2780. : (previousNewFiber.sibling = newFiber);
  2781. previousNewFiber = newFiber;
  2782. oldFiber = nextOldFiber;
  2783. }
  2784. if (step.done)
  2785. return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn;
  2786. if (null === oldFiber) {
  2787. for (; !step.done; newIdx++, step = newChildrenIterable.next())
  2788. (step = createChild(returnFiber, step.value, expirationTime)),
  2789. null !== step &&
  2790. ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
  2791. null === previousNewFiber
  2792. ? (iteratorFn = step)
  2793. : (previousNewFiber.sibling = step),
  2794. (previousNewFiber = step));
  2795. return iteratorFn;
  2796. }
  2797. for (
  2798. oldFiber = mapRemainingChildren(returnFiber, oldFiber);
  2799. !step.done;
  2800. newIdx++, step = newChildrenIterable.next()
  2801. )
  2802. (step = updateFromMap(
  2803. oldFiber,
  2804. returnFiber,
  2805. newIdx,
  2806. step.value,
  2807. expirationTime
  2808. )),
  2809. null !== step &&
  2810. (shouldTrackSideEffects &&
  2811. null !== step.alternate &&
  2812. oldFiber.delete(null === step.key ? newIdx : step.key),
  2813. (currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
  2814. null === previousNewFiber
  2815. ? (iteratorFn = step)
  2816. : (previousNewFiber.sibling = step),
  2817. (previousNewFiber = step));
  2818. shouldTrackSideEffects &&
  2819. oldFiber.forEach(function(child) {
  2820. return deleteChild(returnFiber, child);
  2821. });
  2822. return iteratorFn;
  2823. }
  2824. return function(returnFiber, currentFirstChild, newChild, expirationTime) {
  2825. var isUnkeyedTopLevelFragment =
  2826. "object" === typeof newChild &&
  2827. null !== newChild &&
  2828. newChild.type === REACT_FRAGMENT_TYPE &&
  2829. null === newChild.key;
  2830. isUnkeyedTopLevelFragment && (newChild = newChild.props.children);
  2831. var isObject = "object" === typeof newChild && null !== newChild;
  2832. if (isObject)
  2833. switch (newChild.$$typeof) {
  2834. case REACT_ELEMENT_TYPE:
  2835. a: {
  2836. isObject = newChild.key;
  2837. for (
  2838. isUnkeyedTopLevelFragment = currentFirstChild;
  2839. null !== isUnkeyedTopLevelFragment;
  2840. ) {
  2841. if (isUnkeyedTopLevelFragment.key === isObject) {
  2842. switch (isUnkeyedTopLevelFragment.tag) {
  2843. case 7:
  2844. if (newChild.type === REACT_FRAGMENT_TYPE) {
  2845. deleteRemainingChildren(
  2846. returnFiber,
  2847. isUnkeyedTopLevelFragment.sibling
  2848. );
  2849. currentFirstChild = useFiber(
  2850. isUnkeyedTopLevelFragment,
  2851. newChild.props.children
  2852. );
  2853. currentFirstChild.return = returnFiber;
  2854. returnFiber = currentFirstChild;
  2855. break a;
  2856. }
  2857. break;
  2858. default:
  2859. if (
  2860. isUnkeyedTopLevelFragment.elementType === newChild.type
  2861. ) {
  2862. deleteRemainingChildren(
  2863. returnFiber,
  2864. isUnkeyedTopLevelFragment.sibling
  2865. );
  2866. currentFirstChild = useFiber(
  2867. isUnkeyedTopLevelFragment,
  2868. newChild.props
  2869. );
  2870. currentFirstChild.ref = coerceRef(
  2871. returnFiber,
  2872. isUnkeyedTopLevelFragment,
  2873. newChild
  2874. );
  2875. currentFirstChild.return = returnFiber;
  2876. returnFiber = currentFirstChild;
  2877. break a;
  2878. }
  2879. }
  2880. deleteRemainingChildren(returnFiber, isUnkeyedTopLevelFragment);
  2881. break;
  2882. } else deleteChild(returnFiber, isUnkeyedTopLevelFragment);
  2883. isUnkeyedTopLevelFragment = isUnkeyedTopLevelFragment.sibling;
  2884. }
  2885. newChild.type === REACT_FRAGMENT_TYPE
  2886. ? ((currentFirstChild = createFiberFromFragment(
  2887. newChild.props.children,
  2888. returnFiber.mode,
  2889. expirationTime,
  2890. newChild.key
  2891. )),
  2892. (currentFirstChild.return = returnFiber),
  2893. (returnFiber = currentFirstChild))
  2894. : ((expirationTime = createFiberFromTypeAndProps(
  2895. newChild.type,
  2896. newChild.key,
  2897. newChild.props,
  2898. null,
  2899. returnFiber.mode,
  2900. expirationTime
  2901. )),
  2902. (expirationTime.ref = coerceRef(
  2903. returnFiber,
  2904. currentFirstChild,
  2905. newChild
  2906. )),
  2907. (expirationTime.return = returnFiber),
  2908. (returnFiber = expirationTime));
  2909. }
  2910. return placeSingleChild(returnFiber);
  2911. case REACT_PORTAL_TYPE:
  2912. a: {
  2913. for (
  2914. isUnkeyedTopLevelFragment = newChild.key;
  2915. null !== currentFirstChild;
  2916. ) {
  2917. if (currentFirstChild.key === isUnkeyedTopLevelFragment)
  2918. if (
  2919. 4 === currentFirstChild.tag &&
  2920. currentFirstChild.stateNode.containerInfo ===
  2921. newChild.containerInfo &&
  2922. currentFirstChild.stateNode.implementation ===
  2923. newChild.implementation
  2924. ) {
  2925. deleteRemainingChildren(
  2926. returnFiber,
  2927. currentFirstChild.sibling
  2928. );
  2929. currentFirstChild = useFiber(
  2930. currentFirstChild,
  2931. newChild.children || []
  2932. );
  2933. currentFirstChild.return = returnFiber;
  2934. returnFiber = currentFirstChild;
  2935. break a;
  2936. } else {
  2937. deleteRemainingChildren(returnFiber, currentFirstChild);
  2938. break;
  2939. }
  2940. else deleteChild(returnFiber, currentFirstChild);
  2941. currentFirstChild = currentFirstChild.sibling;
  2942. }
  2943. currentFirstChild = createFiberFromPortal(
  2944. newChild,
  2945. returnFiber.mode,
  2946. expirationTime
  2947. );
  2948. currentFirstChild.return = returnFiber;
  2949. returnFiber = currentFirstChild;
  2950. }
  2951. return placeSingleChild(returnFiber);
  2952. }
  2953. if ("string" === typeof newChild || "number" === typeof newChild)
  2954. return (
  2955. (newChild = "" + newChild),
  2956. null !== currentFirstChild && 6 === currentFirstChild.tag
  2957. ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
  2958. (currentFirstChild = useFiber(currentFirstChild, newChild)),
  2959. (currentFirstChild.return = returnFiber),
  2960. (returnFiber = currentFirstChild))
  2961. : (deleteRemainingChildren(returnFiber, currentFirstChild),
  2962. (currentFirstChild = createFiberFromText(
  2963. newChild,
  2964. returnFiber.mode,
  2965. expirationTime
  2966. )),
  2967. (currentFirstChild.return = returnFiber),
  2968. (returnFiber = currentFirstChild)),
  2969. placeSingleChild(returnFiber)
  2970. );
  2971. if (isArray(newChild))
  2972. return reconcileChildrenArray(
  2973. returnFiber,
  2974. currentFirstChild,
  2975. newChild,
  2976. expirationTime
  2977. );
  2978. if (getIteratorFn(newChild))
  2979. return reconcileChildrenIterator(
  2980. returnFiber,
  2981. currentFirstChild,
  2982. newChild,
  2983. expirationTime
  2984. );
  2985. isObject && throwOnInvalidObjectType(returnFiber, newChild);
  2986. if ("undefined" === typeof newChild && !isUnkeyedTopLevelFragment)
  2987. switch (returnFiber.tag) {
  2988. case 1:
  2989. case 0:
  2990. throw ((returnFiber = returnFiber.type),
  2991. Error(
  2992. (returnFiber.displayName || returnFiber.name || "Component") +
  2993. "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null."
  2994. ));
  2995. }
  2996. return deleteRemainingChildren(returnFiber, currentFirstChild);
  2997. };
  2998. }
  2999. var reconcileChildFibers = ChildReconciler(!0),
  3000. mountChildFibers = ChildReconciler(!1),
  3001. NO_CONTEXT = {},
  3002. contextStackCursor$1 = { current: NO_CONTEXT },
  3003. contextFiberStackCursor = { current: NO_CONTEXT },
  3004. rootInstanceStackCursor = { current: NO_CONTEXT };
  3005. function requiredContext(c) {
  3006. if (c === NO_CONTEXT)
  3007. throw Error(
  3008. "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."
  3009. );
  3010. return c;
  3011. }
  3012. function pushHostContainer(fiber, nextRootInstance) {
  3013. push(rootInstanceStackCursor, nextRootInstance);
  3014. push(contextFiberStackCursor, fiber);
  3015. push(contextStackCursor$1, NO_CONTEXT);
  3016. pop(contextStackCursor$1);
  3017. push(contextStackCursor$1, { isInAParentText: !1 });
  3018. }
  3019. function popHostContainer() {
  3020. pop(contextStackCursor$1);
  3021. pop(contextFiberStackCursor);
  3022. pop(rootInstanceStackCursor);
  3023. }
  3024. function pushHostContext(fiber) {
  3025. requiredContext(rootInstanceStackCursor.current);
  3026. var context = requiredContext(contextStackCursor$1.current);
  3027. var nextContext = fiber.type;
  3028. nextContext =
  3029. "AndroidTextInput" === nextContext ||
  3030. "RCTMultilineTextInputView" === nextContext ||
  3031. "RCTSinglelineTextInputView" === nextContext ||
  3032. "RCTText" === nextContext ||
  3033. "RCTVirtualText" === nextContext;
  3034. nextContext =
  3035. context.isInAParentText !== nextContext
  3036. ? { isInAParentText: nextContext }
  3037. : context;
  3038. context !== nextContext &&
  3039. (push(contextFiberStackCursor, fiber),
  3040. push(contextStackCursor$1, nextContext));
  3041. }
  3042. function popHostContext(fiber) {
  3043. contextFiberStackCursor.current === fiber &&
  3044. (pop(contextStackCursor$1), pop(contextFiberStackCursor));
  3045. }
  3046. var suspenseStackCursor = { current: 0 };
  3047. function findFirstSuspended(row) {
  3048. for (var node = row; null !== node; ) {
  3049. if (13 === node.tag) {
  3050. var state = node.memoizedState;
  3051. if (null !== state && (null === state.dehydrated || shim$1() || shim$1()))
  3052. return node;
  3053. } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) {
  3054. if (0 !== (node.effectTag & 64)) return node;
  3055. } else if (null !== node.child) {
  3056. node.child.return = node;
  3057. node = node.child;
  3058. continue;
  3059. }
  3060. if (node === row) break;
  3061. for (; null === node.sibling; ) {
  3062. if (null === node.return || node.return === row) return null;
  3063. node = node.return;
  3064. }
  3065. node.sibling.return = node.return;
  3066. node = node.sibling;
  3067. }
  3068. return null;
  3069. }
  3070. function createDeprecatedResponderListener(responder, props) {
  3071. return { responder: responder, props: props };
  3072. }
  3073. var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
  3074. ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig,
  3075. renderExpirationTime = 0,
  3076. currentlyRenderingFiber$1 = null,
  3077. currentHook = null,
  3078. workInProgressHook = null,
  3079. didScheduleRenderPhaseUpdate = !1;
  3080. function throwInvalidHookError() {
  3081. throw Error(
  3082. "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem."
  3083. );
  3084. }
  3085. function areHookInputsEqual(nextDeps, prevDeps) {
  3086. if (null === prevDeps) return !1;
  3087. for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
  3088. if (!objectIs(nextDeps[i], prevDeps[i])) return !1;
  3089. return !0;
  3090. }
  3091. function renderWithHooks(
  3092. current,
  3093. workInProgress,
  3094. Component,
  3095. props,
  3096. secondArg,
  3097. nextRenderExpirationTime
  3098. ) {
  3099. renderExpirationTime = nextRenderExpirationTime;
  3100. currentlyRenderingFiber$1 = workInProgress;
  3101. workInProgress.memoizedState = null;
  3102. workInProgress.updateQueue = null;
  3103. workInProgress.expirationTime = 0;
  3104. ReactCurrentDispatcher.current =
  3105. null === current || null === current.memoizedState
  3106. ? HooksDispatcherOnMount
  3107. : HooksDispatcherOnUpdate;
  3108. current = Component(props, secondArg);
  3109. if (workInProgress.expirationTime === renderExpirationTime) {
  3110. nextRenderExpirationTime = 0;
  3111. do {
  3112. workInProgress.expirationTime = 0;
  3113. if (!(25 > nextRenderExpirationTime))
  3114. throw Error(
  3115. "Too many re-renders. React limits the number of renders to prevent an infinite loop."
  3116. );
  3117. nextRenderExpirationTime += 1;
  3118. workInProgressHook = currentHook = null;
  3119. workInProgress.updateQueue = null;
  3120. ReactCurrentDispatcher.current = HooksDispatcherOnRerender;
  3121. current = Component(props, secondArg);
  3122. } while (workInProgress.expirationTime === renderExpirationTime);
  3123. }
  3124. ReactCurrentDispatcher.current = ContextOnlyDispatcher;
  3125. workInProgress = null !== currentHook && null !== currentHook.next;
  3126. renderExpirationTime = 0;
  3127. workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
  3128. didScheduleRenderPhaseUpdate = !1;
  3129. if (workInProgress)
  3130. throw Error(
  3131. "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
  3132. );
  3133. return current;
  3134. }
  3135. function mountWorkInProgressHook() {
  3136. var hook = {
  3137. memoizedState: null,
  3138. baseState: null,
  3139. baseQueue: null,
  3140. queue: null,
  3141. next: null
  3142. };
  3143. null === workInProgressHook
  3144. ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook)
  3145. : (workInProgressHook = workInProgressHook.next = hook);
  3146. return workInProgressHook;
  3147. }
  3148. function updateWorkInProgressHook() {
  3149. if (null === currentHook) {
  3150. var nextCurrentHook = currentlyRenderingFiber$1.alternate;
  3151. nextCurrentHook =
  3152. null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
  3153. } else nextCurrentHook = currentHook.next;
  3154. var nextWorkInProgressHook =
  3155. null === workInProgressHook
  3156. ? currentlyRenderingFiber$1.memoizedState
  3157. : workInProgressHook.next;
  3158. if (null !== nextWorkInProgressHook)
  3159. (workInProgressHook = nextWorkInProgressHook),
  3160. (currentHook = nextCurrentHook);
  3161. else {
  3162. if (null === nextCurrentHook)
  3163. throw Error("Rendered more hooks than during the previous render.");
  3164. currentHook = nextCurrentHook;
  3165. nextCurrentHook = {
  3166. memoizedState: currentHook.memoizedState,
  3167. baseState: currentHook.baseState,
  3168. baseQueue: currentHook.baseQueue,
  3169. queue: currentHook.queue,
  3170. next: null
  3171. };
  3172. null === workInProgressHook
  3173. ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = nextCurrentHook)
  3174. : (workInProgressHook = workInProgressHook.next = nextCurrentHook);
  3175. }
  3176. return workInProgressHook;
  3177. }
  3178. function basicStateReducer(state, action) {
  3179. return "function" === typeof action ? action(state) : action;
  3180. }
  3181. function updateReducer(reducer) {
  3182. var hook = updateWorkInProgressHook(),
  3183. queue = hook.queue;
  3184. if (null === queue)
  3185. throw Error(
  3186. "Should have a queue. This is likely a bug in React. Please file an issue."
  3187. );
  3188. queue.lastRenderedReducer = reducer;
  3189. var current = currentHook,
  3190. baseQueue = current.baseQueue,
  3191. pendingQueue = queue.pending;
  3192. if (null !== pendingQueue) {
  3193. if (null !== baseQueue) {
  3194. var baseFirst = baseQueue.next;
  3195. baseQueue.next = pendingQueue.next;
  3196. pendingQueue.next = baseFirst;
  3197. }
  3198. current.baseQueue = baseQueue = pendingQueue;
  3199. queue.pending = null;
  3200. }
  3201. if (null !== baseQueue) {
  3202. baseQueue = baseQueue.next;
  3203. current = current.baseState;
  3204. var newBaseQueueLast = (baseFirst = pendingQueue = null),
  3205. update = baseQueue;
  3206. do {
  3207. var updateExpirationTime = update.expirationTime;
  3208. if (updateExpirationTime < renderExpirationTime) {
  3209. var clone = {
  3210. expirationTime: update.expirationTime,
  3211. suspenseConfig: update.suspenseConfig,
  3212. action: update.action,
  3213. eagerReducer: update.eagerReducer,
  3214. eagerState: update.eagerState,
  3215. next: null
  3216. };
  3217. null === newBaseQueueLast
  3218. ? ((baseFirst = newBaseQueueLast = clone), (pendingQueue = current))
  3219. : (newBaseQueueLast = newBaseQueueLast.next = clone);
  3220. updateExpirationTime > currentlyRenderingFiber$1.expirationTime &&
  3221. ((currentlyRenderingFiber$1.expirationTime = updateExpirationTime),
  3222. markUnprocessedUpdateTime(updateExpirationTime));
  3223. } else
  3224. null !== newBaseQueueLast &&
  3225. (newBaseQueueLast = newBaseQueueLast.next = {
  3226. expirationTime: 1073741823,
  3227. suspenseConfig: update.suspenseConfig,
  3228. action: update.action,
  3229. eagerReducer: update.eagerReducer,
  3230. eagerState: update.eagerState,
  3231. next: null
  3232. }),
  3233. markRenderEventTimeAndConfig(
  3234. updateExpirationTime,
  3235. update.suspenseConfig
  3236. ),
  3237. (current =
  3238. update.eagerReducer === reducer
  3239. ? update.eagerState
  3240. : reducer(current, update.action));
  3241. update = update.next;
  3242. } while (null !== update && update !== baseQueue);
  3243. null === newBaseQueueLast
  3244. ? (pendingQueue = current)
  3245. : (newBaseQueueLast.next = baseFirst);
  3246. objectIs(current, hook.memoizedState) || (didReceiveUpdate = !0);
  3247. hook.memoizedState = current;
  3248. hook.baseState = pendingQueue;
  3249. hook.baseQueue = newBaseQueueLast;
  3250. queue.lastRenderedState = current;
  3251. }
  3252. return [hook.memoizedState, queue.dispatch];
  3253. }
  3254. function rerenderReducer(reducer) {
  3255. var hook = updateWorkInProgressHook(),
  3256. queue = hook.queue;
  3257. if (null === queue)
  3258. throw Error(
  3259. "Should have a queue. This is likely a bug in React. Please file an issue."
  3260. );
  3261. queue.lastRenderedReducer = reducer;
  3262. var dispatch = queue.dispatch,
  3263. lastRenderPhaseUpdate = queue.pending,
  3264. newState = hook.memoizedState;
  3265. if (null !== lastRenderPhaseUpdate) {
  3266. queue.pending = null;
  3267. var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);
  3268. do (newState = reducer(newState, update.action)), (update = update.next);
  3269. while (update !== lastRenderPhaseUpdate);
  3270. objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);
  3271. hook.memoizedState = newState;
  3272. null === hook.baseQueue && (hook.baseState = newState);
  3273. queue.lastRenderedState = newState;
  3274. }
  3275. return [newState, dispatch];
  3276. }
  3277. function mountState(initialState) {
  3278. var hook = mountWorkInProgressHook();
  3279. "function" === typeof initialState && (initialState = initialState());
  3280. hook.memoizedState = hook.baseState = initialState;
  3281. initialState = hook.queue = {
  3282. pending: null,
  3283. dispatch: null,
  3284. lastRenderedReducer: basicStateReducer,
  3285. lastRenderedState: initialState
  3286. };
  3287. initialState = initialState.dispatch = dispatchAction.bind(
  3288. null,
  3289. currentlyRenderingFiber$1,
  3290. initialState
  3291. );
  3292. return [hook.memoizedState, initialState];
  3293. }
  3294. function pushEffect(tag, create, destroy, deps) {
  3295. tag = { tag: tag, create: create, destroy: destroy, deps: deps, next: null };
  3296. create = currentlyRenderingFiber$1.updateQueue;
  3297. null === create
  3298. ? ((create = { lastEffect: null }),
  3299. (currentlyRenderingFiber$1.updateQueue = create),
  3300. (create.lastEffect = tag.next = tag))
  3301. : ((destroy = create.lastEffect),
  3302. null === destroy
  3303. ? (create.lastEffect = tag.next = tag)
  3304. : ((deps = destroy.next),
  3305. (destroy.next = tag),
  3306. (tag.next = deps),
  3307. (create.lastEffect = tag)));
  3308. return tag;
  3309. }
  3310. function updateRef() {
  3311. return updateWorkInProgressHook().memoizedState;
  3312. }
  3313. function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  3314. var hook = mountWorkInProgressHook();
  3315. currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
  3316. hook.memoizedState = pushEffect(
  3317. 1 | hookEffectTag,
  3318. create,
  3319. void 0,
  3320. void 0 === deps ? null : deps
  3321. );
  3322. }
  3323. function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  3324. var hook = updateWorkInProgressHook();
  3325. deps = void 0 === deps ? null : deps;
  3326. var destroy = void 0;
  3327. if (null !== currentHook) {
  3328. var prevEffect = currentHook.memoizedState;
  3329. destroy = prevEffect.destroy;
  3330. if (null !== deps && areHookInputsEqual(deps, prevEffect.deps)) {
  3331. pushEffect(hookEffectTag, create, destroy, deps);
  3332. return;
  3333. }
  3334. }
  3335. currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
  3336. hook.memoizedState = pushEffect(1 | hookEffectTag, create, destroy, deps);
  3337. }
  3338. function mountEffect(create, deps) {
  3339. return mountEffectImpl(516, 4, create, deps);
  3340. }
  3341. function updateEffect(create, deps) {
  3342. return updateEffectImpl(516, 4, create, deps);
  3343. }
  3344. function updateLayoutEffect(create, deps) {
  3345. return updateEffectImpl(4, 2, create, deps);
  3346. }
  3347. function imperativeHandleEffect(create, ref) {
  3348. if ("function" === typeof ref)
  3349. return (
  3350. (create = create()),
  3351. ref(create),
  3352. function() {
  3353. ref(null);
  3354. }
  3355. );
  3356. if (null !== ref && void 0 !== ref)
  3357. return (
  3358. (create = create()),
  3359. (ref.current = create),
  3360. function() {
  3361. ref.current = null;
  3362. }
  3363. );
  3364. }
  3365. function updateImperativeHandle(ref, create, deps) {
  3366. deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
  3367. return updateEffectImpl(
  3368. 4,
  3369. 2,
  3370. imperativeHandleEffect.bind(null, create, ref),
  3371. deps
  3372. );
  3373. }
  3374. function mountDebugValue() {}
  3375. function mountCallback(callback, deps) {
  3376. mountWorkInProgressHook().memoizedState = [
  3377. callback,
  3378. void 0 === deps ? null : deps
  3379. ];
  3380. return callback;
  3381. }
  3382. function updateCallback(callback, deps) {
  3383. var hook = updateWorkInProgressHook();
  3384. deps = void 0 === deps ? null : deps;
  3385. var prevState = hook.memoizedState;
  3386. if (
  3387. null !== prevState &&
  3388. null !== deps &&
  3389. areHookInputsEqual(deps, prevState[1])
  3390. )
  3391. return prevState[0];
  3392. hook.memoizedState = [callback, deps];
  3393. return callback;
  3394. }
  3395. function updateMemo(nextCreate, deps) {
  3396. var hook = updateWorkInProgressHook();
  3397. deps = void 0 === deps ? null : deps;
  3398. var prevState = hook.memoizedState;
  3399. if (
  3400. null !== prevState &&
  3401. null !== deps &&
  3402. areHookInputsEqual(deps, prevState[1])
  3403. )
  3404. return prevState[0];
  3405. nextCreate = nextCreate();
  3406. hook.memoizedState = [nextCreate, deps];
  3407. return nextCreate;
  3408. }
  3409. function startTransition(setPending, config, callback) {
  3410. var priorityLevel = getCurrentPriorityLevel();
  3411. runWithPriority(98 > priorityLevel ? 98 : priorityLevel, function() {
  3412. setPending(!0);
  3413. });
  3414. runWithPriority(97 < priorityLevel ? 97 : priorityLevel, function() {
  3415. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  3416. ReactCurrentBatchConfig$1.suspense = void 0 === config ? null : config;
  3417. try {
  3418. setPending(!1), callback();
  3419. } finally {
  3420. ReactCurrentBatchConfig$1.suspense = previousConfig;
  3421. }
  3422. });
  3423. }
  3424. function dispatchAction(fiber, queue, action) {
  3425. var currentTime = requestCurrentTimeForUpdate(),
  3426. suspenseConfig = ReactCurrentBatchConfig.suspense;
  3427. currentTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
  3428. suspenseConfig = {
  3429. expirationTime: currentTime,
  3430. suspenseConfig: suspenseConfig,
  3431. action: action,
  3432. eagerReducer: null,
  3433. eagerState: null,
  3434. next: null
  3435. };
  3436. var pending = queue.pending;
  3437. null === pending
  3438. ? (suspenseConfig.next = suspenseConfig)
  3439. : ((suspenseConfig.next = pending.next), (pending.next = suspenseConfig));
  3440. queue.pending = suspenseConfig;
  3441. pending = fiber.alternate;
  3442. if (
  3443. fiber === currentlyRenderingFiber$1 ||
  3444. (null !== pending && pending === currentlyRenderingFiber$1)
  3445. )
  3446. (didScheduleRenderPhaseUpdate = !0),
  3447. (suspenseConfig.expirationTime = renderExpirationTime),
  3448. (currentlyRenderingFiber$1.expirationTime = renderExpirationTime);
  3449. else {
  3450. if (
  3451. 0 === fiber.expirationTime &&
  3452. (null === pending || 0 === pending.expirationTime) &&
  3453. ((pending = queue.lastRenderedReducer), null !== pending)
  3454. )
  3455. try {
  3456. var currentState = queue.lastRenderedState,
  3457. eagerState = pending(currentState, action);
  3458. suspenseConfig.eagerReducer = pending;
  3459. suspenseConfig.eagerState = eagerState;
  3460. if (objectIs(eagerState, currentState)) return;
  3461. } catch (error) {
  3462. } finally {
  3463. }
  3464. scheduleWork(fiber, currentTime);
  3465. }
  3466. }
  3467. function updateEventListener() {}
  3468. var ContextOnlyDispatcher = {
  3469. readContext: readContext,
  3470. useCallback: throwInvalidHookError,
  3471. useContext: throwInvalidHookError,
  3472. useEffect: throwInvalidHookError,
  3473. useImperativeHandle: throwInvalidHookError,
  3474. useLayoutEffect: throwInvalidHookError,
  3475. useMemo: throwInvalidHookError,
  3476. useReducer: throwInvalidHookError,
  3477. useRef: throwInvalidHookError,
  3478. useState: throwInvalidHookError,
  3479. useDebugValue: throwInvalidHookError,
  3480. useResponder: throwInvalidHookError,
  3481. useDeferredValue: throwInvalidHookError,
  3482. useTransition: throwInvalidHookError,
  3483. useEvent: throwInvalidHookError
  3484. },
  3485. HooksDispatcherOnMount = {
  3486. readContext: readContext,
  3487. useCallback: mountCallback,
  3488. useContext: readContext,
  3489. useEffect: mountEffect,
  3490. useImperativeHandle: function(ref, create, deps) {
  3491. deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
  3492. return mountEffectImpl(
  3493. 4,
  3494. 2,
  3495. imperativeHandleEffect.bind(null, create, ref),
  3496. deps
  3497. );
  3498. },
  3499. useLayoutEffect: function(create, deps) {
  3500. return mountEffectImpl(4, 2, create, deps);
  3501. },
  3502. useMemo: function(nextCreate, deps) {
  3503. var hook = mountWorkInProgressHook();
  3504. deps = void 0 === deps ? null : deps;
  3505. nextCreate = nextCreate();
  3506. hook.memoizedState = [nextCreate, deps];
  3507. return nextCreate;
  3508. },
  3509. useReducer: function(reducer, initialArg, init) {
  3510. var hook = mountWorkInProgressHook();
  3511. initialArg = void 0 !== init ? init(initialArg) : initialArg;
  3512. hook.memoizedState = hook.baseState = initialArg;
  3513. reducer = hook.queue = {
  3514. pending: null,
  3515. dispatch: null,
  3516. lastRenderedReducer: reducer,
  3517. lastRenderedState: initialArg
  3518. };
  3519. reducer = reducer.dispatch = dispatchAction.bind(
  3520. null,
  3521. currentlyRenderingFiber$1,
  3522. reducer
  3523. );
  3524. return [hook.memoizedState, reducer];
  3525. },
  3526. useRef: function(initialValue) {
  3527. var hook = mountWorkInProgressHook();
  3528. initialValue = { current: initialValue };
  3529. return (hook.memoizedState = initialValue);
  3530. },
  3531. useState: mountState,
  3532. useDebugValue: mountDebugValue,
  3533. useResponder: createDeprecatedResponderListener,
  3534. useDeferredValue: function(value, config) {
  3535. var _mountState = mountState(value),
  3536. prevValue = _mountState[0],
  3537. setValue = _mountState[1];
  3538. mountEffect(
  3539. function() {
  3540. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  3541. ReactCurrentBatchConfig$1.suspense =
  3542. void 0 === config ? null : config;
  3543. try {
  3544. setValue(value);
  3545. } finally {
  3546. ReactCurrentBatchConfig$1.suspense = previousConfig;
  3547. }
  3548. },
  3549. [value, config]
  3550. );
  3551. return prevValue;
  3552. },
  3553. useTransition: function(config) {
  3554. var _mountState2 = mountState(!1),
  3555. isPending = _mountState2[0];
  3556. _mountState2 = _mountState2[1];
  3557. return [
  3558. mountCallback(startTransition.bind(null, _mountState2, config), [
  3559. _mountState2,
  3560. config
  3561. ]),
  3562. isPending
  3563. ];
  3564. },
  3565. useEvent: function() {}
  3566. },
  3567. HooksDispatcherOnUpdate = {
  3568. readContext: readContext,
  3569. useCallback: updateCallback,
  3570. useContext: readContext,
  3571. useEffect: updateEffect,
  3572. useImperativeHandle: updateImperativeHandle,
  3573. useLayoutEffect: updateLayoutEffect,
  3574. useMemo: updateMemo,
  3575. useReducer: updateReducer,
  3576. useRef: updateRef,
  3577. useState: function() {
  3578. return updateReducer(basicStateReducer);
  3579. },
  3580. useDebugValue: mountDebugValue,
  3581. useResponder: createDeprecatedResponderListener,
  3582. useDeferredValue: function(value, config) {
  3583. var _updateState = updateReducer(basicStateReducer),
  3584. prevValue = _updateState[0],
  3585. setValue = _updateState[1];
  3586. updateEffect(
  3587. function() {
  3588. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  3589. ReactCurrentBatchConfig$1.suspense =
  3590. void 0 === config ? null : config;
  3591. try {
  3592. setValue(value);
  3593. } finally {
  3594. ReactCurrentBatchConfig$1.suspense = previousConfig;
  3595. }
  3596. },
  3597. [value, config]
  3598. );
  3599. return prevValue;
  3600. },
  3601. useTransition: function(config) {
  3602. var _updateState2 = updateReducer(basicStateReducer),
  3603. isPending = _updateState2[0];
  3604. _updateState2 = _updateState2[1];
  3605. return [
  3606. updateCallback(startTransition.bind(null, _updateState2, config), [
  3607. _updateState2,
  3608. config
  3609. ]),
  3610. isPending
  3611. ];
  3612. },
  3613. useEvent: updateEventListener
  3614. },
  3615. HooksDispatcherOnRerender = {
  3616. readContext: readContext,
  3617. useCallback: updateCallback,
  3618. useContext: readContext,
  3619. useEffect: updateEffect,
  3620. useImperativeHandle: updateImperativeHandle,
  3621. useLayoutEffect: updateLayoutEffect,
  3622. useMemo: updateMemo,
  3623. useReducer: rerenderReducer,
  3624. useRef: updateRef,
  3625. useState: function() {
  3626. return rerenderReducer(basicStateReducer);
  3627. },
  3628. useDebugValue: mountDebugValue,
  3629. useResponder: createDeprecatedResponderListener,
  3630. useDeferredValue: function(value, config) {
  3631. var _rerenderState = rerenderReducer(basicStateReducer),
  3632. prevValue = _rerenderState[0],
  3633. setValue = _rerenderState[1];
  3634. updateEffect(
  3635. function() {
  3636. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  3637. ReactCurrentBatchConfig$1.suspense =
  3638. void 0 === config ? null : config;
  3639. try {
  3640. setValue(value);
  3641. } finally {
  3642. ReactCurrentBatchConfig$1.suspense = previousConfig;
  3643. }
  3644. },
  3645. [value, config]
  3646. );
  3647. return prevValue;
  3648. },
  3649. useTransition: function(config) {
  3650. var _rerenderState2 = rerenderReducer(basicStateReducer),
  3651. isPending = _rerenderState2[0];
  3652. _rerenderState2 = _rerenderState2[1];
  3653. return [
  3654. updateCallback(startTransition.bind(null, _rerenderState2, config), [
  3655. _rerenderState2,
  3656. config
  3657. ]),
  3658. isPending
  3659. ];
  3660. },
  3661. useEvent: updateEventListener
  3662. },
  3663. now$1 = Scheduler.unstable_now,
  3664. commitTime = 0,
  3665. profilerStartTime = -1;
  3666. function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
  3667. if (0 <= profilerStartTime) {
  3668. var elapsedTime = now$1() - profilerStartTime;
  3669. fiber.actualDuration += elapsedTime;
  3670. overrideBaseTime && (fiber.selfBaseDuration = elapsedTime);
  3671. profilerStartTime = -1;
  3672. }
  3673. }
  3674. var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner,
  3675. didReceiveUpdate = !1;
  3676. function reconcileChildren(
  3677. current,
  3678. workInProgress,
  3679. nextChildren,
  3680. renderExpirationTime
  3681. ) {
  3682. workInProgress.child =
  3683. null === current
  3684. ? mountChildFibers(
  3685. workInProgress,
  3686. null,
  3687. nextChildren,
  3688. renderExpirationTime
  3689. )
  3690. : reconcileChildFibers(
  3691. workInProgress,
  3692. current.child,
  3693. nextChildren,
  3694. renderExpirationTime
  3695. );
  3696. }
  3697. function updateForwardRef(
  3698. current,
  3699. workInProgress,
  3700. Component,
  3701. nextProps,
  3702. renderExpirationTime
  3703. ) {
  3704. Component = Component.render;
  3705. var ref = workInProgress.ref;
  3706. prepareToReadContext(workInProgress, renderExpirationTime);
  3707. nextProps = renderWithHooks(
  3708. current,
  3709. workInProgress,
  3710. Component,
  3711. nextProps,
  3712. ref,
  3713. renderExpirationTime
  3714. );
  3715. if (null !== current && !didReceiveUpdate)
  3716. return (
  3717. (workInProgress.updateQueue = current.updateQueue),
  3718. (workInProgress.effectTag &= -517),
  3719. current.expirationTime <= renderExpirationTime &&
  3720. (current.expirationTime = 0),
  3721. bailoutOnAlreadyFinishedWork(
  3722. current,
  3723. workInProgress,
  3724. renderExpirationTime
  3725. )
  3726. );
  3727. workInProgress.effectTag |= 1;
  3728. reconcileChildren(current, workInProgress, nextProps, renderExpirationTime);
  3729. return workInProgress.child;
  3730. }
  3731. function updateMemoComponent(
  3732. current,
  3733. workInProgress,
  3734. Component,
  3735. nextProps,
  3736. updateExpirationTime,
  3737. renderExpirationTime
  3738. ) {
  3739. if (null === current) {
  3740. var type = Component.type;
  3741. if (
  3742. "function" === typeof type &&
  3743. !shouldConstruct(type) &&
  3744. void 0 === type.defaultProps &&
  3745. null === Component.compare &&
  3746. void 0 === Component.defaultProps
  3747. )
  3748. return (
  3749. (workInProgress.tag = 15),
  3750. (workInProgress.type = type),
  3751. updateSimpleMemoComponent(
  3752. current,
  3753. workInProgress,
  3754. type,
  3755. nextProps,
  3756. updateExpirationTime,
  3757. renderExpirationTime
  3758. )
  3759. );
  3760. current = createFiberFromTypeAndProps(
  3761. Component.type,
  3762. null,
  3763. nextProps,
  3764. null,
  3765. workInProgress.mode,
  3766. renderExpirationTime
  3767. );
  3768. current.ref = workInProgress.ref;
  3769. current.return = workInProgress;
  3770. return (workInProgress.child = current);
  3771. }
  3772. type = current.child;
  3773. if (
  3774. updateExpirationTime < renderExpirationTime &&
  3775. ((updateExpirationTime = type.memoizedProps),
  3776. (Component = Component.compare),
  3777. (Component = null !== Component ? Component : shallowEqual),
  3778. Component(updateExpirationTime, nextProps) &&
  3779. current.ref === workInProgress.ref)
  3780. )
  3781. return bailoutOnAlreadyFinishedWork(
  3782. current,
  3783. workInProgress,
  3784. renderExpirationTime
  3785. );
  3786. workInProgress.effectTag |= 1;
  3787. current = createWorkInProgress(type, nextProps);
  3788. current.ref = workInProgress.ref;
  3789. current.return = workInProgress;
  3790. return (workInProgress.child = current);
  3791. }
  3792. function updateSimpleMemoComponent(
  3793. current,
  3794. workInProgress,
  3795. Component,
  3796. nextProps,
  3797. updateExpirationTime,
  3798. renderExpirationTime
  3799. ) {
  3800. return null !== current &&
  3801. shallowEqual(current.memoizedProps, nextProps) &&
  3802. current.ref === workInProgress.ref &&
  3803. ((didReceiveUpdate = !1), updateExpirationTime < renderExpirationTime)
  3804. ? ((workInProgress.expirationTime = current.expirationTime),
  3805. bailoutOnAlreadyFinishedWork(
  3806. current,
  3807. workInProgress,
  3808. renderExpirationTime
  3809. ))
  3810. : updateFunctionComponent(
  3811. current,
  3812. workInProgress,
  3813. Component,
  3814. nextProps,
  3815. renderExpirationTime
  3816. );
  3817. }
  3818. function markRef(current, workInProgress) {
  3819. var ref = workInProgress.ref;
  3820. if (
  3821. (null === current && null !== ref) ||
  3822. (null !== current && current.ref !== ref)
  3823. )
  3824. workInProgress.effectTag |= 128;
  3825. }
  3826. function updateFunctionComponent(
  3827. current,
  3828. workInProgress,
  3829. Component,
  3830. nextProps,
  3831. renderExpirationTime
  3832. ) {
  3833. var context = isContextProvider(Component)
  3834. ? previousContext
  3835. : contextStackCursor.current;
  3836. context = getMaskedContext(workInProgress, context);
  3837. prepareToReadContext(workInProgress, renderExpirationTime);
  3838. Component = renderWithHooks(
  3839. current,
  3840. workInProgress,
  3841. Component,
  3842. nextProps,
  3843. context,
  3844. renderExpirationTime
  3845. );
  3846. if (null !== current && !didReceiveUpdate)
  3847. return (
  3848. (workInProgress.updateQueue = current.updateQueue),
  3849. (workInProgress.effectTag &= -517),
  3850. current.expirationTime <= renderExpirationTime &&
  3851. (current.expirationTime = 0),
  3852. bailoutOnAlreadyFinishedWork(
  3853. current,
  3854. workInProgress,
  3855. renderExpirationTime
  3856. )
  3857. );
  3858. workInProgress.effectTag |= 1;
  3859. reconcileChildren(current, workInProgress, Component, renderExpirationTime);
  3860. return workInProgress.child;
  3861. }
  3862. function updateClassComponent(
  3863. current,
  3864. workInProgress,
  3865. Component,
  3866. nextProps,
  3867. renderExpirationTime
  3868. ) {
  3869. if (isContextProvider(Component)) {
  3870. var hasContext = !0;
  3871. pushContextProvider(workInProgress);
  3872. } else hasContext = !1;
  3873. prepareToReadContext(workInProgress, renderExpirationTime);
  3874. if (null === workInProgress.stateNode)
  3875. null !== current &&
  3876. ((current.alternate = null),
  3877. (workInProgress.alternate = null),
  3878. (workInProgress.effectTag |= 2)),
  3879. constructClassInstance(workInProgress, Component, nextProps),
  3880. mountClassInstance(
  3881. workInProgress,
  3882. Component,
  3883. nextProps,
  3884. renderExpirationTime
  3885. ),
  3886. (nextProps = !0);
  3887. else if (null === current) {
  3888. var instance = workInProgress.stateNode,
  3889. oldProps = workInProgress.memoizedProps;
  3890. instance.props = oldProps;
  3891. var oldContext = instance.context,
  3892. contextType = Component.contextType;
  3893. "object" === typeof contextType && null !== contextType
  3894. ? (contextType = readContext(contextType))
  3895. : ((contextType = isContextProvider(Component)
  3896. ? previousContext
  3897. : contextStackCursor.current),
  3898. (contextType = getMaskedContext(workInProgress, contextType)));
  3899. var getDerivedStateFromProps = Component.getDerivedStateFromProps,
  3900. hasNewLifecycles =
  3901. "function" === typeof getDerivedStateFromProps ||
  3902. "function" === typeof instance.getSnapshotBeforeUpdate;
  3903. hasNewLifecycles ||
  3904. ("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
  3905. "function" !== typeof instance.componentWillReceiveProps) ||
  3906. ((oldProps !== nextProps || oldContext !== contextType) &&
  3907. callComponentWillReceiveProps(
  3908. workInProgress,
  3909. instance,
  3910. nextProps,
  3911. contextType
  3912. ));
  3913. hasForceUpdate = !1;
  3914. var oldState = workInProgress.memoizedState;
  3915. instance.state = oldState;
  3916. processUpdateQueue(
  3917. workInProgress,
  3918. nextProps,
  3919. instance,
  3920. renderExpirationTime
  3921. );
  3922. oldContext = workInProgress.memoizedState;
  3923. oldProps !== nextProps ||
  3924. oldState !== oldContext ||
  3925. didPerformWorkStackCursor.current ||
  3926. hasForceUpdate
  3927. ? ("function" === typeof getDerivedStateFromProps &&
  3928. (applyDerivedStateFromProps(
  3929. workInProgress,
  3930. Component,
  3931. getDerivedStateFromProps,
  3932. nextProps
  3933. ),
  3934. (oldContext = workInProgress.memoizedState)),
  3935. (oldProps =
  3936. hasForceUpdate ||
  3937. checkShouldComponentUpdate(
  3938. workInProgress,
  3939. Component,
  3940. oldProps,
  3941. nextProps,
  3942. oldState,
  3943. oldContext,
  3944. contextType
  3945. ))
  3946. ? (hasNewLifecycles ||
  3947. ("function" !== typeof instance.UNSAFE_componentWillMount &&
  3948. "function" !== typeof instance.componentWillMount) ||
  3949. ("function" === typeof instance.componentWillMount &&
  3950. instance.componentWillMount(),
  3951. "function" === typeof instance.UNSAFE_componentWillMount &&
  3952. instance.UNSAFE_componentWillMount()),
  3953. "function" === typeof instance.componentDidMount &&
  3954. (workInProgress.effectTag |= 4))
  3955. : ("function" === typeof instance.componentDidMount &&
  3956. (workInProgress.effectTag |= 4),
  3957. (workInProgress.memoizedProps = nextProps),
  3958. (workInProgress.memoizedState = oldContext)),
  3959. (instance.props = nextProps),
  3960. (instance.state = oldContext),
  3961. (instance.context = contextType),
  3962. (nextProps = oldProps))
  3963. : ("function" === typeof instance.componentDidMount &&
  3964. (workInProgress.effectTag |= 4),
  3965. (nextProps = !1));
  3966. } else
  3967. (instance = workInProgress.stateNode),
  3968. cloneUpdateQueue(current, workInProgress),
  3969. (oldProps = workInProgress.memoizedProps),
  3970. (instance.props =
  3971. workInProgress.type === workInProgress.elementType
  3972. ? oldProps
  3973. : resolveDefaultProps(workInProgress.type, oldProps)),
  3974. (oldContext = instance.context),
  3975. (contextType = Component.contextType),
  3976. "object" === typeof contextType && null !== contextType
  3977. ? (contextType = readContext(contextType))
  3978. : ((contextType = isContextProvider(Component)
  3979. ? previousContext
  3980. : contextStackCursor.current),
  3981. (contextType = getMaskedContext(workInProgress, contextType))),
  3982. (getDerivedStateFromProps = Component.getDerivedStateFromProps),
  3983. (hasNewLifecycles =
  3984. "function" === typeof getDerivedStateFromProps ||
  3985. "function" === typeof instance.getSnapshotBeforeUpdate) ||
  3986. ("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
  3987. "function" !== typeof instance.componentWillReceiveProps) ||
  3988. ((oldProps !== nextProps || oldContext !== contextType) &&
  3989. callComponentWillReceiveProps(
  3990. workInProgress,
  3991. instance,
  3992. nextProps,
  3993. contextType
  3994. )),
  3995. (hasForceUpdate = !1),
  3996. (oldContext = workInProgress.memoizedState),
  3997. (instance.state = oldContext),
  3998. processUpdateQueue(
  3999. workInProgress,
  4000. nextProps,
  4001. instance,
  4002. renderExpirationTime
  4003. ),
  4004. (oldState = workInProgress.memoizedState),
  4005. oldProps !== nextProps ||
  4006. oldContext !== oldState ||
  4007. didPerformWorkStackCursor.current ||
  4008. hasForceUpdate
  4009. ? ("function" === typeof getDerivedStateFromProps &&
  4010. (applyDerivedStateFromProps(
  4011. workInProgress,
  4012. Component,
  4013. getDerivedStateFromProps,
  4014. nextProps
  4015. ),
  4016. (oldState = workInProgress.memoizedState)),
  4017. (getDerivedStateFromProps =
  4018. hasForceUpdate ||
  4019. checkShouldComponentUpdate(
  4020. workInProgress,
  4021. Component,
  4022. oldProps,
  4023. nextProps,
  4024. oldContext,
  4025. oldState,
  4026. contextType
  4027. ))
  4028. ? (hasNewLifecycles ||
  4029. ("function" !== typeof instance.UNSAFE_componentWillUpdate &&
  4030. "function" !== typeof instance.componentWillUpdate) ||
  4031. ("function" === typeof instance.componentWillUpdate &&
  4032. instance.componentWillUpdate(
  4033. nextProps,
  4034. oldState,
  4035. contextType
  4036. ),
  4037. "function" === typeof instance.UNSAFE_componentWillUpdate &&
  4038. instance.UNSAFE_componentWillUpdate(
  4039. nextProps,
  4040. oldState,
  4041. contextType
  4042. )),
  4043. "function" === typeof instance.componentDidUpdate &&
  4044. (workInProgress.effectTag |= 4),
  4045. "function" === typeof instance.getSnapshotBeforeUpdate &&
  4046. (workInProgress.effectTag |= 256))
  4047. : ("function" !== typeof instance.componentDidUpdate ||
  4048. (oldProps === current.memoizedProps &&
  4049. oldContext === current.memoizedState) ||
  4050. (workInProgress.effectTag |= 4),
  4051. "function" !== typeof instance.getSnapshotBeforeUpdate ||
  4052. (oldProps === current.memoizedProps &&
  4053. oldContext === current.memoizedState) ||
  4054. (workInProgress.effectTag |= 256),
  4055. (workInProgress.memoizedProps = nextProps),
  4056. (workInProgress.memoizedState = oldState)),
  4057. (instance.props = nextProps),
  4058. (instance.state = oldState),
  4059. (instance.context = contextType),
  4060. (nextProps = getDerivedStateFromProps))
  4061. : ("function" !== typeof instance.componentDidUpdate ||
  4062. (oldProps === current.memoizedProps &&
  4063. oldContext === current.memoizedState) ||
  4064. (workInProgress.effectTag |= 4),
  4065. "function" !== typeof instance.getSnapshotBeforeUpdate ||
  4066. (oldProps === current.memoizedProps &&
  4067. oldContext === current.memoizedState) ||
  4068. (workInProgress.effectTag |= 256),
  4069. (nextProps = !1));
  4070. return finishClassComponent(
  4071. current,
  4072. workInProgress,
  4073. Component,
  4074. nextProps,
  4075. hasContext,
  4076. renderExpirationTime
  4077. );
  4078. }
  4079. function finishClassComponent(
  4080. current,
  4081. workInProgress,
  4082. Component,
  4083. shouldUpdate,
  4084. hasContext,
  4085. renderExpirationTime
  4086. ) {
  4087. markRef(current, workInProgress);
  4088. var didCaptureError = 0 !== (workInProgress.effectTag & 64);
  4089. if (!shouldUpdate && !didCaptureError)
  4090. return (
  4091. hasContext && invalidateContextProvider(workInProgress, Component, !1),
  4092. bailoutOnAlreadyFinishedWork(
  4093. current,
  4094. workInProgress,
  4095. renderExpirationTime
  4096. )
  4097. );
  4098. shouldUpdate = workInProgress.stateNode;
  4099. ReactCurrentOwner$1.current = workInProgress;
  4100. if (
  4101. didCaptureError &&
  4102. "function" !== typeof Component.getDerivedStateFromError
  4103. ) {
  4104. var nextChildren = null;
  4105. profilerStartTime = -1;
  4106. } else nextChildren = shouldUpdate.render();
  4107. workInProgress.effectTag |= 1;
  4108. null !== current && didCaptureError
  4109. ? ((didCaptureError = nextChildren),
  4110. (workInProgress.child = reconcileChildFibers(
  4111. workInProgress,
  4112. current.child,
  4113. null,
  4114. renderExpirationTime
  4115. )),
  4116. (workInProgress.child = reconcileChildFibers(
  4117. workInProgress,
  4118. null,
  4119. didCaptureError,
  4120. renderExpirationTime
  4121. )))
  4122. : reconcileChildren(
  4123. current,
  4124. workInProgress,
  4125. nextChildren,
  4126. renderExpirationTime
  4127. );
  4128. workInProgress.memoizedState = shouldUpdate.state;
  4129. hasContext && invalidateContextProvider(workInProgress, Component, !0);
  4130. return workInProgress.child;
  4131. }
  4132. function pushHostRootContext(workInProgress) {
  4133. var root = workInProgress.stateNode;
  4134. root.pendingContext
  4135. ? pushTopLevelContextObject(
  4136. workInProgress,
  4137. root.pendingContext,
  4138. root.pendingContext !== root.context
  4139. )
  4140. : root.context &&
  4141. pushTopLevelContextObject(workInProgress, root.context, !1);
  4142. pushHostContainer(workInProgress, root.containerInfo);
  4143. }
  4144. var SUSPENDED_MARKER = { dehydrated: null, retryTime: 0 };
  4145. function updateSuspenseComponent(
  4146. current,
  4147. workInProgress,
  4148. renderExpirationTime
  4149. ) {
  4150. var mode = workInProgress.mode,
  4151. nextProps = workInProgress.pendingProps,
  4152. suspenseContext = suspenseStackCursor.current,
  4153. nextDidTimeout = !1,
  4154. JSCompiler_temp;
  4155. (JSCompiler_temp = 0 !== (workInProgress.effectTag & 64)) ||
  4156. (JSCompiler_temp =
  4157. 0 !== (suspenseContext & 2) &&
  4158. (null === current || null !== current.memoizedState));
  4159. JSCompiler_temp
  4160. ? ((nextDidTimeout = !0), (workInProgress.effectTag &= -65))
  4161. : (null !== current && null === current.memoizedState) ||
  4162. void 0 === nextProps.fallback ||
  4163. !0 === nextProps.unstable_avoidThisFallback ||
  4164. (suspenseContext |= 1);
  4165. push(suspenseStackCursor, suspenseContext & 1);
  4166. if (null === current) {
  4167. if (nextDidTimeout) {
  4168. nextDidTimeout = nextProps.fallback;
  4169. nextProps = createFiberFromFragment(null, mode, 0, null);
  4170. nextProps.return = workInProgress;
  4171. if (0 === (workInProgress.mode & 2))
  4172. for (
  4173. current =
  4174. null !== workInProgress.memoizedState
  4175. ? workInProgress.child.child
  4176. : workInProgress.child,
  4177. nextProps.child = current;
  4178. null !== current;
  4179. )
  4180. (current.return = nextProps), (current = current.sibling);
  4181. renderExpirationTime = createFiberFromFragment(
  4182. nextDidTimeout,
  4183. mode,
  4184. renderExpirationTime,
  4185. null
  4186. );
  4187. renderExpirationTime.return = workInProgress;
  4188. nextProps.sibling = renderExpirationTime;
  4189. workInProgress.memoizedState = SUSPENDED_MARKER;
  4190. workInProgress.child = nextProps;
  4191. return renderExpirationTime;
  4192. }
  4193. mode = nextProps.children;
  4194. workInProgress.memoizedState = null;
  4195. return (workInProgress.child = mountChildFibers(
  4196. workInProgress,
  4197. null,
  4198. mode,
  4199. renderExpirationTime
  4200. ));
  4201. }
  4202. if (null !== current.memoizedState) {
  4203. current = current.child;
  4204. mode = current.sibling;
  4205. if (nextDidTimeout) {
  4206. nextProps = nextProps.fallback;
  4207. renderExpirationTime = createWorkInProgress(
  4208. current,
  4209. current.pendingProps
  4210. );
  4211. renderExpirationTime.return = workInProgress;
  4212. if (
  4213. 0 === (workInProgress.mode & 2) &&
  4214. ((nextDidTimeout =
  4215. null !== workInProgress.memoizedState
  4216. ? workInProgress.child.child
  4217. : workInProgress.child),
  4218. nextDidTimeout !== current.child)
  4219. )
  4220. for (
  4221. renderExpirationTime.child = nextDidTimeout;
  4222. null !== nextDidTimeout;
  4223. )
  4224. (nextDidTimeout.return = renderExpirationTime),
  4225. (nextDidTimeout = nextDidTimeout.sibling);
  4226. if (workInProgress.mode & 8) {
  4227. nextDidTimeout = 0;
  4228. for (current = renderExpirationTime.child; null !== current; )
  4229. (nextDidTimeout += current.treeBaseDuration),
  4230. (current = current.sibling);
  4231. renderExpirationTime.treeBaseDuration = nextDidTimeout;
  4232. }
  4233. mode = createWorkInProgress(mode, nextProps);
  4234. mode.return = workInProgress;
  4235. renderExpirationTime.sibling = mode;
  4236. renderExpirationTime.childExpirationTime = 0;
  4237. workInProgress.memoizedState = SUSPENDED_MARKER;
  4238. workInProgress.child = renderExpirationTime;
  4239. return mode;
  4240. }
  4241. renderExpirationTime = reconcileChildFibers(
  4242. workInProgress,
  4243. current.child,
  4244. nextProps.children,
  4245. renderExpirationTime
  4246. );
  4247. workInProgress.memoizedState = null;
  4248. return (workInProgress.child = renderExpirationTime);
  4249. }
  4250. current = current.child;
  4251. if (nextDidTimeout) {
  4252. nextDidTimeout = nextProps.fallback;
  4253. nextProps = createFiberFromFragment(null, mode, 0, null);
  4254. nextProps.return = workInProgress;
  4255. nextProps.child = current;
  4256. null !== current && (current.return = nextProps);
  4257. if (0 === (workInProgress.mode & 2))
  4258. for (
  4259. current =
  4260. null !== workInProgress.memoizedState
  4261. ? workInProgress.child.child
  4262. : workInProgress.child,
  4263. nextProps.child = current;
  4264. null !== current;
  4265. )
  4266. (current.return = nextProps), (current = current.sibling);
  4267. if (workInProgress.mode & 8) {
  4268. current = 0;
  4269. for (suspenseContext = nextProps.child; null !== suspenseContext; )
  4270. (current += suspenseContext.treeBaseDuration),
  4271. (suspenseContext = suspenseContext.sibling);
  4272. nextProps.treeBaseDuration = current;
  4273. }
  4274. renderExpirationTime = createFiberFromFragment(
  4275. nextDidTimeout,
  4276. mode,
  4277. renderExpirationTime,
  4278. null
  4279. );
  4280. renderExpirationTime.return = workInProgress;
  4281. nextProps.sibling = renderExpirationTime;
  4282. renderExpirationTime.effectTag |= 2;
  4283. nextProps.childExpirationTime = 0;
  4284. workInProgress.memoizedState = SUSPENDED_MARKER;
  4285. workInProgress.child = nextProps;
  4286. return renderExpirationTime;
  4287. }
  4288. workInProgress.memoizedState = null;
  4289. return (workInProgress.child = reconcileChildFibers(
  4290. workInProgress,
  4291. current,
  4292. nextProps.children,
  4293. renderExpirationTime
  4294. ));
  4295. }
  4296. function scheduleWorkOnFiber(fiber, renderExpirationTime) {
  4297. fiber.expirationTime < renderExpirationTime &&
  4298. (fiber.expirationTime = renderExpirationTime);
  4299. var alternate = fiber.alternate;
  4300. null !== alternate &&
  4301. alternate.expirationTime < renderExpirationTime &&
  4302. (alternate.expirationTime = renderExpirationTime);
  4303. scheduleWorkOnParentPath(fiber.return, renderExpirationTime);
  4304. }
  4305. function initSuspenseListRenderState(
  4306. workInProgress,
  4307. isBackwards,
  4308. tail,
  4309. lastContentRow,
  4310. tailMode,
  4311. lastEffectBeforeRendering
  4312. ) {
  4313. var renderState = workInProgress.memoizedState;
  4314. null === renderState
  4315. ? (workInProgress.memoizedState = {
  4316. isBackwards: isBackwards,
  4317. rendering: null,
  4318. renderingStartTime: 0,
  4319. last: lastContentRow,
  4320. tail: tail,
  4321. tailExpiration: 0,
  4322. tailMode: tailMode,
  4323. lastEffect: lastEffectBeforeRendering
  4324. })
  4325. : ((renderState.isBackwards = isBackwards),
  4326. (renderState.rendering = null),
  4327. (renderState.renderingStartTime = 0),
  4328. (renderState.last = lastContentRow),
  4329. (renderState.tail = tail),
  4330. (renderState.tailExpiration = 0),
  4331. (renderState.tailMode = tailMode),
  4332. (renderState.lastEffect = lastEffectBeforeRendering));
  4333. }
  4334. function updateSuspenseListComponent(
  4335. current,
  4336. workInProgress,
  4337. renderExpirationTime
  4338. ) {
  4339. var nextProps = workInProgress.pendingProps,
  4340. revealOrder = nextProps.revealOrder,
  4341. tailMode = nextProps.tail;
  4342. reconcileChildren(
  4343. current,
  4344. workInProgress,
  4345. nextProps.children,
  4346. renderExpirationTime
  4347. );
  4348. nextProps = suspenseStackCursor.current;
  4349. if (0 !== (nextProps & 2))
  4350. (nextProps = (nextProps & 1) | 2), (workInProgress.effectTag |= 64);
  4351. else {
  4352. if (null !== current && 0 !== (current.effectTag & 64))
  4353. a: for (current = workInProgress.child; null !== current; ) {
  4354. if (13 === current.tag)
  4355. null !== current.memoizedState &&
  4356. scheduleWorkOnFiber(current, renderExpirationTime);
  4357. else if (19 === current.tag)
  4358. scheduleWorkOnFiber(current, renderExpirationTime);
  4359. else if (null !== current.child) {
  4360. current.child.return = current;
  4361. current = current.child;
  4362. continue;
  4363. }
  4364. if (current === workInProgress) break a;
  4365. for (; null === current.sibling; ) {
  4366. if (null === current.return || current.return === workInProgress)
  4367. break a;
  4368. current = current.return;
  4369. }
  4370. current.sibling.return = current.return;
  4371. current = current.sibling;
  4372. }
  4373. nextProps &= 1;
  4374. }
  4375. push(suspenseStackCursor, nextProps);
  4376. if (0 === (workInProgress.mode & 2)) workInProgress.memoizedState = null;
  4377. else
  4378. switch (revealOrder) {
  4379. case "forwards":
  4380. renderExpirationTime = workInProgress.child;
  4381. for (revealOrder = null; null !== renderExpirationTime; )
  4382. (current = renderExpirationTime.alternate),
  4383. null !== current &&
  4384. null === findFirstSuspended(current) &&
  4385. (revealOrder = renderExpirationTime),
  4386. (renderExpirationTime = renderExpirationTime.sibling);
  4387. renderExpirationTime = revealOrder;
  4388. null === renderExpirationTime
  4389. ? ((revealOrder = workInProgress.child),
  4390. (workInProgress.child = null))
  4391. : ((revealOrder = renderExpirationTime.sibling),
  4392. (renderExpirationTime.sibling = null));
  4393. initSuspenseListRenderState(
  4394. workInProgress,
  4395. !1,
  4396. revealOrder,
  4397. renderExpirationTime,
  4398. tailMode,
  4399. workInProgress.lastEffect
  4400. );
  4401. break;
  4402. case "backwards":
  4403. renderExpirationTime = null;
  4404. revealOrder = workInProgress.child;
  4405. for (workInProgress.child = null; null !== revealOrder; ) {
  4406. current = revealOrder.alternate;
  4407. if (null !== current && null === findFirstSuspended(current)) {
  4408. workInProgress.child = revealOrder;
  4409. break;
  4410. }
  4411. current = revealOrder.sibling;
  4412. revealOrder.sibling = renderExpirationTime;
  4413. renderExpirationTime = revealOrder;
  4414. revealOrder = current;
  4415. }
  4416. initSuspenseListRenderState(
  4417. workInProgress,
  4418. !0,
  4419. renderExpirationTime,
  4420. null,
  4421. tailMode,
  4422. workInProgress.lastEffect
  4423. );
  4424. break;
  4425. case "together":
  4426. initSuspenseListRenderState(
  4427. workInProgress,
  4428. !1,
  4429. null,
  4430. null,
  4431. void 0,
  4432. workInProgress.lastEffect
  4433. );
  4434. break;
  4435. default:
  4436. workInProgress.memoizedState = null;
  4437. }
  4438. return workInProgress.child;
  4439. }
  4440. function bailoutOnAlreadyFinishedWork(
  4441. current,
  4442. workInProgress,
  4443. renderExpirationTime
  4444. ) {
  4445. null !== current && (workInProgress.dependencies = current.dependencies);
  4446. profilerStartTime = -1;
  4447. var updateExpirationTime = workInProgress.expirationTime;
  4448. 0 !== updateExpirationTime && markUnprocessedUpdateTime(updateExpirationTime);
  4449. if (workInProgress.childExpirationTime < renderExpirationTime) return null;
  4450. if (null !== current && workInProgress.child !== current.child)
  4451. throw Error("Resuming work not yet implemented.");
  4452. if (null !== workInProgress.child) {
  4453. current = workInProgress.child;
  4454. renderExpirationTime = createWorkInProgress(current, current.pendingProps);
  4455. workInProgress.child = renderExpirationTime;
  4456. for (
  4457. renderExpirationTime.return = workInProgress;
  4458. null !== current.sibling;
  4459. )
  4460. (current = current.sibling),
  4461. (renderExpirationTime = renderExpirationTime.sibling = createWorkInProgress(
  4462. current,
  4463. current.pendingProps
  4464. )),
  4465. (renderExpirationTime.return = workInProgress);
  4466. renderExpirationTime.sibling = null;
  4467. }
  4468. return workInProgress.child;
  4469. }
  4470. var appendAllChildren,
  4471. updateHostContainer,
  4472. updateHostComponent$1,
  4473. updateHostText$1;
  4474. appendAllChildren = function(
  4475. parent,
  4476. workInProgress,
  4477. needsVisibilityToggle,
  4478. isHidden
  4479. ) {
  4480. for (var node = workInProgress.child; null !== node; ) {
  4481. if (5 === node.tag) {
  4482. var instance = node.stateNode;
  4483. needsVisibilityToggle &&
  4484. isHidden &&
  4485. (instance = cloneHiddenInstance(instance));
  4486. appendChildNode(parent.node, instance.node);
  4487. } else if (6 === node.tag) {
  4488. instance = node.stateNode;
  4489. if (needsVisibilityToggle && isHidden)
  4490. throw Error("Not yet implemented.");
  4491. appendChildNode(parent.node, instance.node);
  4492. } else if (4 !== node.tag) {
  4493. if (
  4494. 13 === node.tag &&
  4495. 0 !== (node.effectTag & 4) &&
  4496. (instance = null !== node.memoizedState)
  4497. ) {
  4498. var primaryChildParent = node.child;
  4499. if (
  4500. null !== primaryChildParent &&
  4501. (null !== primaryChildParent.child &&
  4502. ((primaryChildParent.child.return = primaryChildParent),
  4503. appendAllChildren(parent, primaryChildParent, !0, instance)),
  4504. (instance = primaryChildParent.sibling),
  4505. null !== instance)
  4506. ) {
  4507. instance.return = node;
  4508. node = instance;
  4509. continue;
  4510. }
  4511. }
  4512. if (null !== node.child) {
  4513. node.child.return = node;
  4514. node = node.child;
  4515. continue;
  4516. }
  4517. }
  4518. if (node === workInProgress) break;
  4519. for (; null === node.sibling; ) {
  4520. if (null === node.return || node.return === workInProgress) return;
  4521. node = node.return;
  4522. }
  4523. node.sibling.return = node.return;
  4524. node = node.sibling;
  4525. }
  4526. };
  4527. function appendAllChildrenToContainer(
  4528. containerChildSet,
  4529. workInProgress,
  4530. needsVisibilityToggle,
  4531. isHidden
  4532. ) {
  4533. for (var node = workInProgress.child; null !== node; ) {
  4534. if (5 === node.tag) {
  4535. var instance = node.stateNode;
  4536. needsVisibilityToggle &&
  4537. isHidden &&
  4538. (instance = cloneHiddenInstance(instance));
  4539. appendChildNodeToSet(containerChildSet, instance.node);
  4540. } else if (6 === node.tag) {
  4541. instance = node.stateNode;
  4542. if (needsVisibilityToggle && isHidden)
  4543. throw Error("Not yet implemented.");
  4544. appendChildNodeToSet(containerChildSet, instance.node);
  4545. } else if (4 !== node.tag) {
  4546. if (
  4547. 13 === node.tag &&
  4548. 0 !== (node.effectTag & 4) &&
  4549. (instance = null !== node.memoizedState)
  4550. ) {
  4551. var primaryChildParent = node.child;
  4552. if (
  4553. null !== primaryChildParent &&
  4554. (null !== primaryChildParent.child &&
  4555. ((primaryChildParent.child.return = primaryChildParent),
  4556. appendAllChildrenToContainer(
  4557. containerChildSet,
  4558. primaryChildParent,
  4559. !0,
  4560. instance
  4561. )),
  4562. (instance = primaryChildParent.sibling),
  4563. null !== instance)
  4564. ) {
  4565. instance.return = node;
  4566. node = instance;
  4567. continue;
  4568. }
  4569. }
  4570. if (null !== node.child) {
  4571. node.child.return = node;
  4572. node = node.child;
  4573. continue;
  4574. }
  4575. }
  4576. if (node === workInProgress) break;
  4577. for (; null === node.sibling; ) {
  4578. if (null === node.return || node.return === workInProgress) return;
  4579. node = node.return;
  4580. }
  4581. node.sibling.return = node.return;
  4582. node = node.sibling;
  4583. }
  4584. }
  4585. updateHostContainer = function(workInProgress) {
  4586. var portalOrRoot = workInProgress.stateNode;
  4587. if (null !== workInProgress.firstEffect) {
  4588. var container = portalOrRoot.containerInfo,
  4589. newChildSet = createChildNodeSet(container);
  4590. appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1);
  4591. portalOrRoot.pendingChildren = newChildSet;
  4592. workInProgress.effectTag |= 4;
  4593. completeRoot(container, newChildSet);
  4594. }
  4595. };
  4596. updateHostComponent$1 = function(current, workInProgress, type, newProps) {
  4597. type = current.stateNode;
  4598. var oldProps = current.memoizedProps;
  4599. if ((current = null === workInProgress.firstEffect) && oldProps === newProps)
  4600. workInProgress.stateNode = type;
  4601. else {
  4602. var recyclableInstance = workInProgress.stateNode;
  4603. requiredContext(contextStackCursor$1.current);
  4604. var updatePayload = null;
  4605. oldProps !== newProps &&
  4606. ((oldProps = diffProperties(
  4607. null,
  4608. oldProps,
  4609. newProps,
  4610. recyclableInstance.canonical.viewConfig.validAttributes
  4611. )),
  4612. (recyclableInstance.canonical.currentProps = newProps),
  4613. (updatePayload = oldProps));
  4614. current && null === updatePayload
  4615. ? (workInProgress.stateNode = type)
  4616. : ((newProps = updatePayload),
  4617. (recyclableInstance = type.node),
  4618. (type = {
  4619. node: current
  4620. ? null !== newProps
  4621. ? cloneNodeWithNewProps(recyclableInstance, newProps)
  4622. : cloneNode(recyclableInstance)
  4623. : null !== newProps
  4624. ? cloneNodeWithNewChildrenAndProps(recyclableInstance, newProps)
  4625. : cloneNodeWithNewChildren(recyclableInstance),
  4626. canonical: type.canonical
  4627. }),
  4628. (workInProgress.stateNode = type),
  4629. current
  4630. ? (workInProgress.effectTag |= 4)
  4631. : appendAllChildren(type, workInProgress, !1, !1));
  4632. }
  4633. };
  4634. updateHostText$1 = function(current, workInProgress, oldText, newText) {
  4635. oldText !== newText
  4636. ? ((current = requiredContext(rootInstanceStackCursor.current)),
  4637. (oldText = requiredContext(contextStackCursor$1.current)),
  4638. (workInProgress.stateNode = createTextInstance(
  4639. newText,
  4640. current,
  4641. oldText,
  4642. workInProgress
  4643. )),
  4644. (workInProgress.effectTag |= 4))
  4645. : (workInProgress.stateNode = current.stateNode);
  4646. };
  4647. function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
  4648. switch (renderState.tailMode) {
  4649. case "hidden":
  4650. hasRenderedATailFallback = renderState.tail;
  4651. for (var lastTailNode = null; null !== hasRenderedATailFallback; )
  4652. null !== hasRenderedATailFallback.alternate &&
  4653. (lastTailNode = hasRenderedATailFallback),
  4654. (hasRenderedATailFallback = hasRenderedATailFallback.sibling);
  4655. null === lastTailNode
  4656. ? (renderState.tail = null)
  4657. : (lastTailNode.sibling = null);
  4658. break;
  4659. case "collapsed":
  4660. lastTailNode = renderState.tail;
  4661. for (var _lastTailNode = null; null !== lastTailNode; )
  4662. null !== lastTailNode.alternate && (_lastTailNode = lastTailNode),
  4663. (lastTailNode = lastTailNode.sibling);
  4664. null === _lastTailNode
  4665. ? hasRenderedATailFallback || null === renderState.tail
  4666. ? (renderState.tail = null)
  4667. : (renderState.tail.sibling = null)
  4668. : (_lastTailNode.sibling = null);
  4669. }
  4670. }
  4671. function completeWork(current, workInProgress, renderExpirationTime) {
  4672. var newProps = workInProgress.pendingProps;
  4673. switch (workInProgress.tag) {
  4674. case 2:
  4675. case 16:
  4676. case 15:
  4677. case 0:
  4678. case 11:
  4679. case 7:
  4680. case 8:
  4681. case 12:
  4682. case 9:
  4683. case 14:
  4684. return null;
  4685. case 1:
  4686. return isContextProvider(workInProgress.type) && popContext(), null;
  4687. case 3:
  4688. return (
  4689. popHostContainer(),
  4690. pop(didPerformWorkStackCursor),
  4691. pop(contextStackCursor),
  4692. (current = workInProgress.stateNode),
  4693. current.pendingContext &&
  4694. ((current.context = current.pendingContext),
  4695. (current.pendingContext = null)),
  4696. updateHostContainer(workInProgress),
  4697. null
  4698. );
  4699. case 5:
  4700. popHostContext(workInProgress);
  4701. var rootContainerInstance = requiredContext(
  4702. rootInstanceStackCursor.current
  4703. );
  4704. renderExpirationTime = workInProgress.type;
  4705. if (null !== current && null != workInProgress.stateNode)
  4706. updateHostComponent$1(
  4707. current,
  4708. workInProgress,
  4709. renderExpirationTime,
  4710. newProps,
  4711. rootContainerInstance
  4712. ),
  4713. current.ref !== workInProgress.ref &&
  4714. (workInProgress.effectTag |= 128);
  4715. else {
  4716. if (!newProps) {
  4717. if (null === workInProgress.stateNode)
  4718. throw Error(
  4719. "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
  4720. );
  4721. return null;
  4722. }
  4723. requiredContext(contextStackCursor$1.current);
  4724. current = nextReactTag;
  4725. nextReactTag += 2;
  4726. renderExpirationTime = getViewConfigForType(renderExpirationTime);
  4727. var updatePayload = diffProperties(
  4728. null,
  4729. emptyObject,
  4730. newProps,
  4731. renderExpirationTime.validAttributes
  4732. );
  4733. rootContainerInstance = createNode(
  4734. current,
  4735. renderExpirationTime.uiViewClassName,
  4736. rootContainerInstance,
  4737. updatePayload,
  4738. workInProgress
  4739. );
  4740. current = new ReactFabricHostComponent(
  4741. current,
  4742. renderExpirationTime,
  4743. newProps,
  4744. workInProgress
  4745. );
  4746. current = { node: rootContainerInstance, canonical: current };
  4747. appendAllChildren(current, workInProgress, !1, !1);
  4748. workInProgress.stateNode = current;
  4749. null !== workInProgress.ref && (workInProgress.effectTag |= 128);
  4750. }
  4751. return null;
  4752. case 6:
  4753. if (current && null != workInProgress.stateNode)
  4754. updateHostText$1(
  4755. current,
  4756. workInProgress,
  4757. current.memoizedProps,
  4758. newProps
  4759. );
  4760. else {
  4761. if ("string" !== typeof newProps && null === workInProgress.stateNode)
  4762. throw Error(
  4763. "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
  4764. );
  4765. current = requiredContext(rootInstanceStackCursor.current);
  4766. rootContainerInstance = requiredContext(contextStackCursor$1.current);
  4767. workInProgress.stateNode = createTextInstance(
  4768. newProps,
  4769. current,
  4770. rootContainerInstance,
  4771. workInProgress
  4772. );
  4773. }
  4774. return null;
  4775. case 13:
  4776. pop(suspenseStackCursor);
  4777. newProps = workInProgress.memoizedState;
  4778. if (0 !== (workInProgress.effectTag & 64))
  4779. return (
  4780. (workInProgress.expirationTime = renderExpirationTime), workInProgress
  4781. );
  4782. newProps = null !== newProps;
  4783. rootContainerInstance = !1;
  4784. null !== current &&
  4785. ((renderExpirationTime = current.memoizedState),
  4786. (rootContainerInstance = null !== renderExpirationTime),
  4787. newProps ||
  4788. null === renderExpirationTime ||
  4789. ((renderExpirationTime = current.child.sibling),
  4790. null !== renderExpirationTime &&
  4791. ((updatePayload = workInProgress.firstEffect),
  4792. null !== updatePayload
  4793. ? ((workInProgress.firstEffect = renderExpirationTime),
  4794. (renderExpirationTime.nextEffect = updatePayload))
  4795. : ((workInProgress.firstEffect = workInProgress.lastEffect = renderExpirationTime),
  4796. (renderExpirationTime.nextEffect = null)),
  4797. (renderExpirationTime.effectTag = 8))));
  4798. if (newProps && !rootContainerInstance && 0 !== (workInProgress.mode & 2))
  4799. if (
  4800. (null === current &&
  4801. !0 !== workInProgress.memoizedProps.unstable_avoidThisFallback) ||
  4802. 0 !== (suspenseStackCursor.current & 1)
  4803. )
  4804. workInProgressRootExitStatus === RootIncomplete &&
  4805. (workInProgressRootExitStatus = RootSuspended);
  4806. else {
  4807. if (
  4808. workInProgressRootExitStatus === RootIncomplete ||
  4809. workInProgressRootExitStatus === RootSuspended
  4810. )
  4811. workInProgressRootExitStatus = RootSuspendedWithDelay;
  4812. 0 !== workInProgressRootNextUnprocessedUpdateTime &&
  4813. null !== workInProgressRoot &&
  4814. (markRootSuspendedAtTime(
  4815. workInProgressRoot,
  4816. renderExpirationTime$1
  4817. ),
  4818. markRootUpdatedAtTime(
  4819. workInProgressRoot,
  4820. workInProgressRootNextUnprocessedUpdateTime
  4821. ));
  4822. }
  4823. newProps && (workInProgress.effectTag |= 4);
  4824. return null;
  4825. case 4:
  4826. return popHostContainer(), updateHostContainer(workInProgress), null;
  4827. case 10:
  4828. return popProvider(workInProgress), null;
  4829. case 17:
  4830. return isContextProvider(workInProgress.type) && popContext(), null;
  4831. case 19:
  4832. pop(suspenseStackCursor);
  4833. newProps = workInProgress.memoizedState;
  4834. if (null === newProps) return null;
  4835. rootContainerInstance = 0 !== (workInProgress.effectTag & 64);
  4836. updatePayload = newProps.rendering;
  4837. if (null === updatePayload)
  4838. if (rootContainerInstance) cutOffTailIfNeeded(newProps, !1);
  4839. else {
  4840. if (
  4841. workInProgressRootExitStatus !== RootIncomplete ||
  4842. (null !== current && 0 !== (current.effectTag & 64))
  4843. )
  4844. for (current = workInProgress.child; null !== current; ) {
  4845. updatePayload = findFirstSuspended(current);
  4846. if (null !== updatePayload) {
  4847. workInProgress.effectTag |= 64;
  4848. cutOffTailIfNeeded(newProps, !1);
  4849. current = updatePayload.updateQueue;
  4850. null !== current &&
  4851. ((workInProgress.updateQueue = current),
  4852. (workInProgress.effectTag |= 4));
  4853. null === newProps.lastEffect &&
  4854. (workInProgress.firstEffect = null);
  4855. workInProgress.lastEffect = newProps.lastEffect;
  4856. current = renderExpirationTime;
  4857. for (newProps = workInProgress.child; null !== newProps; )
  4858. (rootContainerInstance = newProps),
  4859. (updatePayload = current),
  4860. (rootContainerInstance.effectTag &= 2),
  4861. (rootContainerInstance.nextEffect = null),
  4862. (rootContainerInstance.firstEffect = null),
  4863. (rootContainerInstance.lastEffect = null),
  4864. (renderExpirationTime = rootContainerInstance.alternate),
  4865. null === renderExpirationTime
  4866. ? ((rootContainerInstance.childExpirationTime = 0),
  4867. (rootContainerInstance.expirationTime = updatePayload),
  4868. (rootContainerInstance.child = null),
  4869. (rootContainerInstance.memoizedProps = null),
  4870. (rootContainerInstance.memoizedState = null),
  4871. (rootContainerInstance.updateQueue = null),
  4872. (rootContainerInstance.dependencies = null),
  4873. (rootContainerInstance.selfBaseDuration = 0),
  4874. (rootContainerInstance.treeBaseDuration = 0))
  4875. : ((rootContainerInstance.childExpirationTime =
  4876. renderExpirationTime.childExpirationTime),
  4877. (rootContainerInstance.expirationTime =
  4878. renderExpirationTime.expirationTime),
  4879. (rootContainerInstance.child =
  4880. renderExpirationTime.child),
  4881. (rootContainerInstance.memoizedProps =
  4882. renderExpirationTime.memoizedProps),
  4883. (rootContainerInstance.memoizedState =
  4884. renderExpirationTime.memoizedState),
  4885. (rootContainerInstance.updateQueue =
  4886. renderExpirationTime.updateQueue),
  4887. (updatePayload = renderExpirationTime.dependencies),
  4888. (rootContainerInstance.dependencies =
  4889. null === updatePayload
  4890. ? null
  4891. : {
  4892. expirationTime: updatePayload.expirationTime,
  4893. firstContext: updatePayload.firstContext,
  4894. responders: updatePayload.responders
  4895. }),
  4896. (rootContainerInstance.selfBaseDuration =
  4897. renderExpirationTime.selfBaseDuration),
  4898. (rootContainerInstance.treeBaseDuration =
  4899. renderExpirationTime.treeBaseDuration)),
  4900. (newProps = newProps.sibling);
  4901. push(
  4902. suspenseStackCursor,
  4903. (suspenseStackCursor.current & 1) | 2
  4904. );
  4905. return workInProgress.child;
  4906. }
  4907. current = current.sibling;
  4908. }
  4909. }
  4910. else {
  4911. if (!rootContainerInstance)
  4912. if (
  4913. ((current = findFirstSuspended(updatePayload)), null !== current)
  4914. ) {
  4915. if (
  4916. ((workInProgress.effectTag |= 64),
  4917. (rootContainerInstance = !0),
  4918. (current = current.updateQueue),
  4919. null !== current &&
  4920. ((workInProgress.updateQueue = current),
  4921. (workInProgress.effectTag |= 4)),
  4922. cutOffTailIfNeeded(newProps, !0),
  4923. null === newProps.tail &&
  4924. "hidden" === newProps.tailMode &&
  4925. !updatePayload.alternate)
  4926. )
  4927. return (
  4928. (workInProgress = workInProgress.lastEffect =
  4929. newProps.lastEffect),
  4930. null !== workInProgress && (workInProgress.nextEffect = null),
  4931. null
  4932. );
  4933. } else
  4934. 2 * now() - newProps.renderingStartTime > newProps.tailExpiration &&
  4935. 1 < renderExpirationTime &&
  4936. ((workInProgress.effectTag |= 64),
  4937. (rootContainerInstance = !0),
  4938. cutOffTailIfNeeded(newProps, !1),
  4939. (current = renderExpirationTime - 1),
  4940. (workInProgress.expirationTime = workInProgress.childExpirationTime = current),
  4941. null === spawnedWorkDuringRender
  4942. ? (spawnedWorkDuringRender = [current])
  4943. : spawnedWorkDuringRender.push(current));
  4944. newProps.isBackwards
  4945. ? ((updatePayload.sibling = workInProgress.child),
  4946. (workInProgress.child = updatePayload))
  4947. : ((current = newProps.last),
  4948. null !== current
  4949. ? (current.sibling = updatePayload)
  4950. : (workInProgress.child = updatePayload),
  4951. (newProps.last = updatePayload));
  4952. }
  4953. return null !== newProps.tail
  4954. ? (0 === newProps.tailExpiration &&
  4955. (newProps.tailExpiration = now() + 500),
  4956. (current = newProps.tail),
  4957. (newProps.rendering = current),
  4958. (newProps.tail = current.sibling),
  4959. (newProps.lastEffect = workInProgress.lastEffect),
  4960. (newProps.renderingStartTime = now()),
  4961. (current.sibling = null),
  4962. (workInProgress = suspenseStackCursor.current),
  4963. push(
  4964. suspenseStackCursor,
  4965. rootContainerInstance
  4966. ? (workInProgress & 1) | 2
  4967. : workInProgress & 1
  4968. ),
  4969. current)
  4970. : null;
  4971. }
  4972. throw Error(
  4973. "Unknown unit of work tag (" +
  4974. workInProgress.tag +
  4975. "). This error is likely caused by a bug in React. Please file an issue."
  4976. );
  4977. }
  4978. function unwindWork(workInProgress) {
  4979. switch (workInProgress.tag) {
  4980. case 1:
  4981. isContextProvider(workInProgress.type) && popContext();
  4982. var effectTag = workInProgress.effectTag;
  4983. return effectTag & 4096
  4984. ? ((workInProgress.effectTag = (effectTag & -4097) | 64),
  4985. workInProgress)
  4986. : null;
  4987. case 3:
  4988. popHostContainer();
  4989. pop(didPerformWorkStackCursor);
  4990. pop(contextStackCursor);
  4991. effectTag = workInProgress.effectTag;
  4992. if (0 !== (effectTag & 64))
  4993. throw Error(
  4994. "The root failed to unmount after an error. This is likely a bug in React. Please file an issue."
  4995. );
  4996. workInProgress.effectTag = (effectTag & -4097) | 64;
  4997. return workInProgress;
  4998. case 5:
  4999. return popHostContext(workInProgress), null;
  5000. case 13:
  5001. return (
  5002. pop(suspenseStackCursor),
  5003. (effectTag = workInProgress.effectTag),
  5004. effectTag & 4096
  5005. ? ((workInProgress.effectTag = (effectTag & -4097) | 64),
  5006. workInProgress)
  5007. : null
  5008. );
  5009. case 19:
  5010. return pop(suspenseStackCursor), null;
  5011. case 4:
  5012. return popHostContainer(), null;
  5013. case 10:
  5014. return popProvider(workInProgress), null;
  5015. default:
  5016. return null;
  5017. }
  5018. }
  5019. function createCapturedValue(value, source) {
  5020. return {
  5021. value: value,
  5022. source: source,
  5023. stack: getStackByFiberInDevAndProd(source)
  5024. };
  5025. }
  5026. if (
  5027. "function" !==
  5028. typeof ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog
  5029. )
  5030. throw Error(
  5031. "Expected ReactFiberErrorDialog.showErrorDialog to be a function."
  5032. );
  5033. function logCapturedError(capturedError) {
  5034. !1 !==
  5035. ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog(
  5036. capturedError
  5037. ) && console.error(capturedError.error);
  5038. }
  5039. var PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set;
  5040. function logError(boundary, errorInfo) {
  5041. var source = errorInfo.source,
  5042. stack = errorInfo.stack;
  5043. null === stack &&
  5044. null !== source &&
  5045. (stack = getStackByFiberInDevAndProd(source));
  5046. errorInfo = {
  5047. componentName: null !== source ? getComponentName(source.type) : null,
  5048. componentStack: null !== stack ? stack : "",
  5049. error: errorInfo.value,
  5050. errorBoundary: null,
  5051. errorBoundaryName: null,
  5052. errorBoundaryFound: !1,
  5053. willRetry: !1
  5054. };
  5055. null !== boundary &&
  5056. 1 === boundary.tag &&
  5057. ((errorInfo.errorBoundary = boundary.stateNode),
  5058. (errorInfo.errorBoundaryName = getComponentName(boundary.type)),
  5059. (errorInfo.errorBoundaryFound = !0),
  5060. (errorInfo.willRetry = !0));
  5061. try {
  5062. logCapturedError(errorInfo);
  5063. } catch (e) {
  5064. setTimeout(function() {
  5065. throw e;
  5066. });
  5067. }
  5068. }
  5069. function safelyCallComponentWillUnmount(current, instance) {
  5070. try {
  5071. (instance.props = current.memoizedProps),
  5072. (instance.state = current.memoizedState),
  5073. instance.componentWillUnmount();
  5074. } catch (unmountError) {
  5075. captureCommitPhaseError(current, unmountError);
  5076. }
  5077. }
  5078. function safelyDetachRef(current) {
  5079. var ref = current.ref;
  5080. if (null !== ref)
  5081. if ("function" === typeof ref)
  5082. try {
  5083. ref(null);
  5084. } catch (refError) {
  5085. captureCommitPhaseError(current, refError);
  5086. }
  5087. else ref.current = null;
  5088. }
  5089. function commitBeforeMutationLifeCycles(current, finishedWork) {
  5090. switch (finishedWork.tag) {
  5091. case 0:
  5092. case 11:
  5093. case 15:
  5094. case 22:
  5095. return;
  5096. case 1:
  5097. if (finishedWork.effectTag & 256 && null !== current) {
  5098. var prevProps = current.memoizedProps,
  5099. prevState = current.memoizedState;
  5100. current = finishedWork.stateNode;
  5101. finishedWork = current.getSnapshotBeforeUpdate(
  5102. finishedWork.elementType === finishedWork.type
  5103. ? prevProps
  5104. : resolveDefaultProps(finishedWork.type, prevProps),
  5105. prevState
  5106. );
  5107. current.__reactInternalSnapshotBeforeUpdate = finishedWork;
  5108. }
  5109. return;
  5110. case 3:
  5111. case 5:
  5112. case 6:
  5113. case 4:
  5114. case 17:
  5115. return;
  5116. }
  5117. throw Error(
  5118. "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
  5119. );
  5120. }
  5121. function commitHookEffectListUnmount(tag, finishedWork) {
  5122. finishedWork = finishedWork.updateQueue;
  5123. finishedWork = null !== finishedWork ? finishedWork.lastEffect : null;
  5124. if (null !== finishedWork) {
  5125. var effect = (finishedWork = finishedWork.next);
  5126. do {
  5127. if ((effect.tag & tag) === tag) {
  5128. var destroy = effect.destroy;
  5129. effect.destroy = void 0;
  5130. void 0 !== destroy && destroy();
  5131. }
  5132. effect = effect.next;
  5133. } while (effect !== finishedWork);
  5134. }
  5135. }
  5136. function commitHookEffectListMount(tag, finishedWork) {
  5137. finishedWork = finishedWork.updateQueue;
  5138. finishedWork = null !== finishedWork ? finishedWork.lastEffect : null;
  5139. if (null !== finishedWork) {
  5140. var effect = (finishedWork = finishedWork.next);
  5141. do {
  5142. if ((effect.tag & tag) === tag) {
  5143. var create = effect.create;
  5144. effect.destroy = create();
  5145. }
  5146. effect = effect.next;
  5147. } while (effect !== finishedWork);
  5148. }
  5149. }
  5150. function commitLifeCycles(finishedRoot, current, finishedWork) {
  5151. switch (finishedWork.tag) {
  5152. case 0:
  5153. case 11:
  5154. case 15:
  5155. case 22:
  5156. commitHookEffectListMount(3, finishedWork);
  5157. return;
  5158. case 1:
  5159. finishedRoot = finishedWork.stateNode;
  5160. if (finishedWork.effectTag & 4)
  5161. if (null === current) finishedRoot.componentDidMount();
  5162. else {
  5163. var prevProps =
  5164. finishedWork.elementType === finishedWork.type
  5165. ? current.memoizedProps
  5166. : resolveDefaultProps(finishedWork.type, current.memoizedProps);
  5167. finishedRoot.componentDidUpdate(
  5168. prevProps,
  5169. current.memoizedState,
  5170. finishedRoot.__reactInternalSnapshotBeforeUpdate
  5171. );
  5172. }
  5173. current = finishedWork.updateQueue;
  5174. null !== current &&
  5175. commitUpdateQueue(finishedWork, current, finishedRoot);
  5176. return;
  5177. case 3:
  5178. current = finishedWork.updateQueue;
  5179. if (null !== current) {
  5180. finishedRoot = null;
  5181. if (null !== finishedWork.child)
  5182. switch (finishedWork.child.tag) {
  5183. case 5:
  5184. finishedRoot = finishedWork.child.stateNode.canonical;
  5185. break;
  5186. case 1:
  5187. finishedRoot = finishedWork.child.stateNode;
  5188. }
  5189. commitUpdateQueue(finishedWork, current, finishedRoot);
  5190. }
  5191. return;
  5192. case 5:
  5193. if (null === current && finishedWork.effectTag & 4)
  5194. throw Error(
  5195. "The current renderer does not support mutation. This error is likely caused by a bug in React. Please file an issue."
  5196. );
  5197. return;
  5198. case 6:
  5199. return;
  5200. case 4:
  5201. return;
  5202. case 12:
  5203. prevProps = finishedWork.memoizedProps.onRender;
  5204. var commitTime$jscomp$0 = commitTime;
  5205. "function" === typeof prevProps &&
  5206. prevProps(
  5207. finishedWork.memoizedProps.id,
  5208. null === current ? "mount" : "update",
  5209. finishedWork.actualDuration,
  5210. finishedWork.treeBaseDuration,
  5211. finishedWork.actualStartTime,
  5212. commitTime$jscomp$0,
  5213. finishedRoot.memoizedInteractions
  5214. );
  5215. return;
  5216. case 13:
  5217. return;
  5218. case 19:
  5219. case 17:
  5220. case 20:
  5221. case 21:
  5222. return;
  5223. }
  5224. throw Error(
  5225. "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
  5226. );
  5227. }
  5228. function commitUnmount(finishedRoot, current$jscomp$0, renderPriorityLevel) {
  5229. "function" === typeof onCommitFiberUnmount &&
  5230. onCommitFiberUnmount(current$jscomp$0);
  5231. switch (current$jscomp$0.tag) {
  5232. case 0:
  5233. case 11:
  5234. case 14:
  5235. case 15:
  5236. case 22:
  5237. finishedRoot = current$jscomp$0.updateQueue;
  5238. if (
  5239. null !== finishedRoot &&
  5240. ((finishedRoot = finishedRoot.lastEffect), null !== finishedRoot)
  5241. ) {
  5242. var firstEffect = finishedRoot.next;
  5243. runWithPriority(
  5244. 97 < renderPriorityLevel ? 97 : renderPriorityLevel,
  5245. function() {
  5246. var effect = firstEffect;
  5247. do {
  5248. var _destroy = effect.destroy;
  5249. if (void 0 !== _destroy) {
  5250. var current = current$jscomp$0;
  5251. try {
  5252. _destroy();
  5253. } catch (error) {
  5254. captureCommitPhaseError(current, error);
  5255. }
  5256. }
  5257. effect = effect.next;
  5258. } while (effect !== firstEffect);
  5259. }
  5260. );
  5261. }
  5262. break;
  5263. case 1:
  5264. safelyDetachRef(current$jscomp$0);
  5265. renderPriorityLevel = current$jscomp$0.stateNode;
  5266. "function" === typeof renderPriorityLevel.componentWillUnmount &&
  5267. safelyCallComponentWillUnmount(current$jscomp$0, renderPriorityLevel);
  5268. break;
  5269. case 5:
  5270. safelyDetachRef(current$jscomp$0);
  5271. break;
  5272. case 4:
  5273. createChildNodeSet(current$jscomp$0.stateNode.containerInfo);
  5274. }
  5275. }
  5276. function detachFiber(current) {
  5277. var alternate = current.alternate;
  5278. current.return = null;
  5279. current.child = null;
  5280. current.memoizedState = null;
  5281. current.updateQueue = null;
  5282. current.dependencies = null;
  5283. current.alternate = null;
  5284. current.firstEffect = null;
  5285. current.lastEffect = null;
  5286. current.pendingProps = null;
  5287. current.memoizedProps = null;
  5288. current.stateNode = null;
  5289. null !== alternate && detachFiber(alternate);
  5290. }
  5291. function commitWork(current, finishedWork) {
  5292. switch (finishedWork.tag) {
  5293. case 0:
  5294. case 11:
  5295. case 14:
  5296. case 15:
  5297. case 22:
  5298. commitHookEffectListUnmount(3, finishedWork);
  5299. return;
  5300. case 12:
  5301. return;
  5302. case 13:
  5303. null !== finishedWork.memoizedState &&
  5304. (globalMostRecentFallbackTime = now());
  5305. attachSuspenseRetryListeners(finishedWork);
  5306. return;
  5307. case 19:
  5308. attachSuspenseRetryListeners(finishedWork);
  5309. return;
  5310. }
  5311. a: {
  5312. switch (finishedWork.tag) {
  5313. case 1:
  5314. case 5:
  5315. case 6:
  5316. case 20:
  5317. break a;
  5318. case 3:
  5319. case 4:
  5320. break a;
  5321. }
  5322. throw Error(
  5323. "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
  5324. );
  5325. }
  5326. }
  5327. function attachSuspenseRetryListeners(finishedWork) {
  5328. var thenables = finishedWork.updateQueue;
  5329. if (null !== thenables) {
  5330. finishedWork.updateQueue = null;
  5331. var retryCache = finishedWork.stateNode;
  5332. null === retryCache &&
  5333. (retryCache = finishedWork.stateNode = new PossiblyWeakSet());
  5334. thenables.forEach(function(thenable) {
  5335. var retry = resolveRetryThenable.bind(null, finishedWork, thenable);
  5336. retryCache.has(thenable) ||
  5337. (!0 !== thenable.__reactDoNotTraceInteractions &&
  5338. (retry = tracing.unstable_wrap(retry)),
  5339. retryCache.add(thenable),
  5340. thenable.then(retry, retry));
  5341. });
  5342. }
  5343. }
  5344. var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map;
  5345. function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
  5346. expirationTime = createUpdate(expirationTime, null);
  5347. expirationTime.tag = 3;
  5348. expirationTime.payload = { element: null };
  5349. var error = errorInfo.value;
  5350. expirationTime.callback = function() {
  5351. hasUncaughtError || ((hasUncaughtError = !0), (firstUncaughtError = error));
  5352. logError(fiber, errorInfo);
  5353. };
  5354. return expirationTime;
  5355. }
  5356. function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
  5357. expirationTime = createUpdate(expirationTime, null);
  5358. expirationTime.tag = 3;
  5359. var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
  5360. if ("function" === typeof getDerivedStateFromError) {
  5361. var error = errorInfo.value;
  5362. expirationTime.payload = function() {
  5363. logError(fiber, errorInfo);
  5364. return getDerivedStateFromError(error);
  5365. };
  5366. }
  5367. var inst = fiber.stateNode;
  5368. null !== inst &&
  5369. "function" === typeof inst.componentDidCatch &&
  5370. (expirationTime.callback = function() {
  5371. "function" !== typeof getDerivedStateFromError &&
  5372. (null === legacyErrorBoundariesThatAlreadyFailed
  5373. ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))
  5374. : legacyErrorBoundariesThatAlreadyFailed.add(this),
  5375. logError(fiber, errorInfo));
  5376. var stack = errorInfo.stack;
  5377. this.componentDidCatch(errorInfo.value, {
  5378. componentStack: null !== stack ? stack : ""
  5379. });
  5380. });
  5381. return expirationTime;
  5382. }
  5383. var ceil = Math.ceil,
  5384. ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
  5385. ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,
  5386. NoContext = 0,
  5387. LegacyUnbatchedContext = 8,
  5388. RenderContext = 16,
  5389. CommitContext = 32,
  5390. RootIncomplete = 0,
  5391. RootFatalErrored = 1,
  5392. RootErrored = 2,
  5393. RootSuspended = 3,
  5394. RootSuspendedWithDelay = 4,
  5395. RootCompleted = 5,
  5396. executionContext = NoContext,
  5397. workInProgressRoot = null,
  5398. workInProgress = null,
  5399. renderExpirationTime$1 = 0,
  5400. workInProgressRootExitStatus = RootIncomplete,
  5401. workInProgressRootFatalError = null,
  5402. workInProgressRootLatestProcessedExpirationTime = 1073741823,
  5403. workInProgressRootLatestSuspenseTimeout = 1073741823,
  5404. workInProgressRootCanSuspendUsingConfig = null,
  5405. workInProgressRootNextUnprocessedUpdateTime = 0,
  5406. workInProgressRootHasPendingPing = !1,
  5407. globalMostRecentFallbackTime = 0,
  5408. FALLBACK_THROTTLE_MS = 500,
  5409. nextEffect = null,
  5410. hasUncaughtError = !1,
  5411. firstUncaughtError = null,
  5412. legacyErrorBoundariesThatAlreadyFailed = null,
  5413. rootDoesHavePassiveEffects = !1,
  5414. rootWithPendingPassiveEffects = null,
  5415. pendingPassiveEffectsRenderPriority = 90,
  5416. pendingPassiveEffectsExpirationTime = 0,
  5417. rootsWithPendingDiscreteUpdates = null,
  5418. nestedUpdateCount = 0,
  5419. rootWithNestedUpdates = null,
  5420. spawnedWorkDuringRender = null,
  5421. currentEventTime = 0;
  5422. function requestCurrentTimeForUpdate() {
  5423. return (executionContext & (RenderContext | CommitContext)) !== NoContext
  5424. ? 1073741821 - ((now() / 10) | 0)
  5425. : 0 !== currentEventTime
  5426. ? currentEventTime
  5427. : (currentEventTime = 1073741821 - ((now() / 10) | 0));
  5428. }
  5429. function computeExpirationForFiber(currentTime, fiber, suspenseConfig) {
  5430. fiber = fiber.mode;
  5431. if (0 === (fiber & 2)) return 1073741823;
  5432. var priorityLevel = getCurrentPriorityLevel();
  5433. if (0 === (fiber & 4)) return 99 === priorityLevel ? 1073741823 : 1073741822;
  5434. if ((executionContext & RenderContext) !== NoContext)
  5435. return renderExpirationTime$1;
  5436. if (null !== suspenseConfig)
  5437. currentTime =
  5438. 1073741821 -
  5439. 25 *
  5440. ((((1073741821 -
  5441. currentTime +
  5442. (suspenseConfig.timeoutMs | 0 || 5e3) / 10) /
  5443. 25) |
  5444. 0) +
  5445. 1);
  5446. else
  5447. switch (priorityLevel) {
  5448. case 99:
  5449. currentTime = 1073741823;
  5450. break;
  5451. case 98:
  5452. currentTime =
  5453. 1073741821 - 10 * ((((1073741821 - currentTime + 15) / 10) | 0) + 1);
  5454. break;
  5455. case 97:
  5456. case 96:
  5457. currentTime =
  5458. 1073741821 - 25 * ((((1073741821 - currentTime + 500) / 25) | 0) + 1);
  5459. break;
  5460. case 95:
  5461. currentTime = 2;
  5462. break;
  5463. default:
  5464. throw Error("Expected a valid priority level");
  5465. }
  5466. null !== workInProgressRoot &&
  5467. currentTime === renderExpirationTime$1 &&
  5468. --currentTime;
  5469. return currentTime;
  5470. }
  5471. function scheduleWork(fiber, expirationTime) {
  5472. if (50 < nestedUpdateCount)
  5473. throw ((nestedUpdateCount = 0),
  5474. (rootWithNestedUpdates = null),
  5475. Error(
  5476. "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops."
  5477. ));
  5478. fiber = markUpdateTimeFromFiberToRoot(fiber, expirationTime);
  5479. if (null !== fiber) {
  5480. var priorityLevel = getCurrentPriorityLevel();
  5481. 1073741823 === expirationTime
  5482. ? (executionContext & LegacyUnbatchedContext) !== NoContext &&
  5483. (executionContext & (RenderContext | CommitContext)) === NoContext
  5484. ? (schedulePendingInteractions(fiber, expirationTime),
  5485. performSyncWorkOnRoot(fiber))
  5486. : (ensureRootIsScheduled(fiber),
  5487. schedulePendingInteractions(fiber, expirationTime),
  5488. executionContext === NoContext && flushSyncCallbackQueue())
  5489. : (ensureRootIsScheduled(fiber),
  5490. schedulePendingInteractions(fiber, expirationTime));
  5491. (executionContext & 4) === NoContext ||
  5492. (98 !== priorityLevel && 99 !== priorityLevel) ||
  5493. (null === rootsWithPendingDiscreteUpdates
  5494. ? (rootsWithPendingDiscreteUpdates = new Map([[fiber, expirationTime]]))
  5495. : ((priorityLevel = rootsWithPendingDiscreteUpdates.get(fiber)),
  5496. (void 0 === priorityLevel || priorityLevel > expirationTime) &&
  5497. rootsWithPendingDiscreteUpdates.set(fiber, expirationTime)));
  5498. }
  5499. }
  5500. function markUpdateTimeFromFiberToRoot(fiber, expirationTime) {
  5501. fiber.expirationTime < expirationTime &&
  5502. (fiber.expirationTime = expirationTime);
  5503. var alternate = fiber.alternate;
  5504. null !== alternate &&
  5505. alternate.expirationTime < expirationTime &&
  5506. (alternate.expirationTime = expirationTime);
  5507. var node = fiber.return,
  5508. root = null;
  5509. if (null === node && 3 === fiber.tag) root = fiber.stateNode;
  5510. else
  5511. for (; null !== node; ) {
  5512. alternate = node.alternate;
  5513. node.childExpirationTime < expirationTime &&
  5514. (node.childExpirationTime = expirationTime);
  5515. null !== alternate &&
  5516. alternate.childExpirationTime < expirationTime &&
  5517. (alternate.childExpirationTime = expirationTime);
  5518. if (null === node.return && 3 === node.tag) {
  5519. root = node.stateNode;
  5520. break;
  5521. }
  5522. node = node.return;
  5523. }
  5524. null !== root &&
  5525. (workInProgressRoot === root &&
  5526. (markUnprocessedUpdateTime(expirationTime),
  5527. workInProgressRootExitStatus === RootSuspendedWithDelay &&
  5528. markRootSuspendedAtTime(root, renderExpirationTime$1)),
  5529. markRootUpdatedAtTime(root, expirationTime));
  5530. return root;
  5531. }
  5532. function getNextRootExpirationTimeToWorkOn(root) {
  5533. var lastExpiredTime = root.lastExpiredTime;
  5534. if (0 !== lastExpiredTime) return lastExpiredTime;
  5535. lastExpiredTime = root.firstPendingTime;
  5536. if (!isRootSuspendedAtTime(root, lastExpiredTime)) return lastExpiredTime;
  5537. var lastPingedTime = root.lastPingedTime;
  5538. root = root.nextKnownPendingLevel;
  5539. root = lastPingedTime > root ? lastPingedTime : root;
  5540. return 2 >= root && lastExpiredTime !== root ? 0 : root;
  5541. }
  5542. function ensureRootIsScheduled(root) {
  5543. if (0 !== root.lastExpiredTime)
  5544. (root.callbackExpirationTime = 1073741823),
  5545. (root.callbackPriority = 99),
  5546. (root.callbackNode = scheduleSyncCallback(
  5547. performSyncWorkOnRoot.bind(null, root)
  5548. ));
  5549. else {
  5550. var expirationTime = getNextRootExpirationTimeToWorkOn(root),
  5551. existingCallbackNode = root.callbackNode;
  5552. if (0 === expirationTime)
  5553. null !== existingCallbackNode &&
  5554. ((root.callbackNode = null),
  5555. (root.callbackExpirationTime = 0),
  5556. (root.callbackPriority = 90));
  5557. else {
  5558. var currentTime = requestCurrentTimeForUpdate();
  5559. currentTime = inferPriorityFromExpirationTime(
  5560. currentTime,
  5561. expirationTime
  5562. );
  5563. if (null !== existingCallbackNode) {
  5564. var existingCallbackPriority = root.callbackPriority;
  5565. if (
  5566. root.callbackExpirationTime === expirationTime &&
  5567. existingCallbackPriority >= currentTime
  5568. )
  5569. return;
  5570. existingCallbackNode !== fakeCallbackNode &&
  5571. Scheduler_cancelCallback(existingCallbackNode);
  5572. }
  5573. root.callbackExpirationTime = expirationTime;
  5574. root.callbackPriority = currentTime;
  5575. expirationTime =
  5576. 1073741823 === expirationTime
  5577. ? scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root))
  5578. : scheduleCallback(
  5579. currentTime,
  5580. performConcurrentWorkOnRoot.bind(null, root),
  5581. { timeout: 10 * (1073741821 - expirationTime) - now() }
  5582. );
  5583. root.callbackNode = expirationTime;
  5584. }
  5585. }
  5586. }
  5587. function performConcurrentWorkOnRoot(root, didTimeout) {
  5588. currentEventTime = 0;
  5589. if (didTimeout) {
  5590. didTimeout = requestCurrentTimeForUpdate();
  5591. var lastExpiredTime = root.lastExpiredTime;
  5592. if (0 === lastExpiredTime || lastExpiredTime > didTimeout)
  5593. root.lastExpiredTime = didTimeout;
  5594. ensureRootIsScheduled(root);
  5595. return null;
  5596. }
  5597. lastExpiredTime = getNextRootExpirationTimeToWorkOn(root);
  5598. if (0 === lastExpiredTime) return null;
  5599. didTimeout = root.callbackNode;
  5600. if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
  5601. throw Error("Should not already be working.");
  5602. flushPassiveEffects();
  5603. var expirationTime = lastExpiredTime,
  5604. prevExecutionContext = executionContext;
  5605. executionContext |= RenderContext;
  5606. var exitStatus = pushDispatcher();
  5607. if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1)
  5608. prepareFreshStack(root, expirationTime),
  5609. startWorkOnPendingInteractions(root, expirationTime);
  5610. expirationTime = pushInteractions(root);
  5611. do
  5612. try {
  5613. workLoopConcurrent();
  5614. break;
  5615. } catch (thrownValue) {
  5616. handleError(root, thrownValue);
  5617. }
  5618. while (1);
  5619. resetContextDependencies();
  5620. tracing.__interactionsRef.current = expirationTime;
  5621. ReactCurrentDispatcher$1.current = exitStatus;
  5622. executionContext = prevExecutionContext;
  5623. null !== workInProgress
  5624. ? (exitStatus = RootIncomplete)
  5625. : ((workInProgressRoot = null),
  5626. (exitStatus = workInProgressRootExitStatus));
  5627. if (exitStatus !== RootIncomplete) {
  5628. exitStatus === RootErrored &&
  5629. ((lastExpiredTime = 2 < lastExpiredTime ? 2 : lastExpiredTime),
  5630. (exitStatus = renderRootSync(root, lastExpiredTime)));
  5631. if (exitStatus === RootFatalErrored)
  5632. throw ((didTimeout = workInProgressRootFatalError),
  5633. prepareFreshStack(root, lastExpiredTime),
  5634. markRootSuspendedAtTime(root, lastExpiredTime),
  5635. ensureRootIsScheduled(root),
  5636. didTimeout);
  5637. prevExecutionContext = root.finishedWork = root.current.alternate;
  5638. root.finishedExpirationTime = lastExpiredTime;
  5639. switch (exitStatus) {
  5640. case RootIncomplete:
  5641. case RootFatalErrored:
  5642. throw Error("Root did not complete. This is a bug in React.");
  5643. case RootErrored:
  5644. commitRoot(root);
  5645. break;
  5646. case RootSuspended:
  5647. markRootSuspendedAtTime(root, lastExpiredTime);
  5648. exitStatus = root.lastSuspendedTime;
  5649. lastExpiredTime === exitStatus &&
  5650. (root.nextKnownPendingLevel = getRemainingExpirationTime(
  5651. prevExecutionContext
  5652. ));
  5653. if (
  5654. 1073741823 === workInProgressRootLatestProcessedExpirationTime &&
  5655. ((prevExecutionContext =
  5656. globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now()),
  5657. 10 < prevExecutionContext)
  5658. ) {
  5659. if (
  5660. workInProgressRootHasPendingPing &&
  5661. ((expirationTime = root.lastPingedTime),
  5662. 0 === expirationTime || expirationTime >= lastExpiredTime)
  5663. ) {
  5664. root.lastPingedTime = lastExpiredTime;
  5665. prepareFreshStack(root, lastExpiredTime);
  5666. break;
  5667. }
  5668. expirationTime = getNextRootExpirationTimeToWorkOn(root);
  5669. if (0 !== expirationTime && expirationTime !== lastExpiredTime) break;
  5670. if (0 !== exitStatus && exitStatus !== lastExpiredTime) {
  5671. root.lastPingedTime = exitStatus;
  5672. break;
  5673. }
  5674. root.timeoutHandle = scheduleTimeout(
  5675. commitRoot.bind(null, root),
  5676. prevExecutionContext
  5677. );
  5678. break;
  5679. }
  5680. commitRoot(root);
  5681. break;
  5682. case RootSuspendedWithDelay:
  5683. markRootSuspendedAtTime(root, lastExpiredTime);
  5684. exitStatus = root.lastSuspendedTime;
  5685. lastExpiredTime === exitStatus &&
  5686. (root.nextKnownPendingLevel = getRemainingExpirationTime(
  5687. prevExecutionContext
  5688. ));
  5689. if (
  5690. workInProgressRootHasPendingPing &&
  5691. ((prevExecutionContext = root.lastPingedTime),
  5692. 0 === prevExecutionContext || prevExecutionContext >= lastExpiredTime)
  5693. ) {
  5694. root.lastPingedTime = lastExpiredTime;
  5695. prepareFreshStack(root, lastExpiredTime);
  5696. break;
  5697. }
  5698. prevExecutionContext = getNextRootExpirationTimeToWorkOn(root);
  5699. if (
  5700. 0 !== prevExecutionContext &&
  5701. prevExecutionContext !== lastExpiredTime
  5702. )
  5703. break;
  5704. if (0 !== exitStatus && exitStatus !== lastExpiredTime) {
  5705. root.lastPingedTime = exitStatus;
  5706. break;
  5707. }
  5708. 1073741823 !== workInProgressRootLatestSuspenseTimeout
  5709. ? (prevExecutionContext =
  5710. 10 * (1073741821 - workInProgressRootLatestSuspenseTimeout) -
  5711. now())
  5712. : 1073741823 === workInProgressRootLatestProcessedExpirationTime
  5713. ? (prevExecutionContext = 0)
  5714. : ((prevExecutionContext =
  5715. 10 *
  5716. (1073741821 - workInProgressRootLatestProcessedExpirationTime) -
  5717. 5e3),
  5718. (exitStatus = now()),
  5719. (lastExpiredTime =
  5720. 10 * (1073741821 - lastExpiredTime) - exitStatus),
  5721. (prevExecutionContext = exitStatus - prevExecutionContext),
  5722. 0 > prevExecutionContext && (prevExecutionContext = 0),
  5723. (prevExecutionContext =
  5724. (120 > prevExecutionContext
  5725. ? 120
  5726. : 480 > prevExecutionContext
  5727. ? 480
  5728. : 1080 > prevExecutionContext
  5729. ? 1080
  5730. : 1920 > prevExecutionContext
  5731. ? 1920
  5732. : 3e3 > prevExecutionContext
  5733. ? 3e3
  5734. : 4320 > prevExecutionContext
  5735. ? 4320
  5736. : 1960 * ceil(prevExecutionContext / 1960)) -
  5737. prevExecutionContext),
  5738. lastExpiredTime < prevExecutionContext &&
  5739. (prevExecutionContext = lastExpiredTime));
  5740. if (10 < prevExecutionContext) {
  5741. root.timeoutHandle = scheduleTimeout(
  5742. commitRoot.bind(null, root),
  5743. prevExecutionContext
  5744. );
  5745. break;
  5746. }
  5747. commitRoot(root);
  5748. break;
  5749. case RootCompleted:
  5750. if (
  5751. 1073741823 !== workInProgressRootLatestProcessedExpirationTime &&
  5752. null !== workInProgressRootCanSuspendUsingConfig
  5753. ) {
  5754. expirationTime = workInProgressRootLatestProcessedExpirationTime;
  5755. var suspenseConfig = workInProgressRootCanSuspendUsingConfig;
  5756. prevExecutionContext = suspenseConfig.busyMinDurationMs | 0;
  5757. 0 >= prevExecutionContext
  5758. ? (prevExecutionContext = 0)
  5759. : ((exitStatus = suspenseConfig.busyDelayMs | 0),
  5760. (expirationTime =
  5761. now() -
  5762. (10 * (1073741821 - expirationTime) -
  5763. (suspenseConfig.timeoutMs | 0 || 5e3))),
  5764. (prevExecutionContext =
  5765. expirationTime <= exitStatus
  5766. ? 0
  5767. : exitStatus + prevExecutionContext - expirationTime));
  5768. if (10 < prevExecutionContext) {
  5769. markRootSuspendedAtTime(root, lastExpiredTime);
  5770. root.timeoutHandle = scheduleTimeout(
  5771. commitRoot.bind(null, root),
  5772. prevExecutionContext
  5773. );
  5774. break;
  5775. }
  5776. }
  5777. commitRoot(root);
  5778. break;
  5779. default:
  5780. throw Error("Unknown root exit status.");
  5781. }
  5782. }
  5783. ensureRootIsScheduled(root);
  5784. return root.callbackNode === didTimeout
  5785. ? performConcurrentWorkOnRoot.bind(null, root)
  5786. : null;
  5787. }
  5788. function performSyncWorkOnRoot(root) {
  5789. if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
  5790. throw Error("Should not already be working.");
  5791. flushPassiveEffects();
  5792. var lastExpiredTime = root.lastExpiredTime;
  5793. lastExpiredTime =
  5794. 0 !== lastExpiredTime
  5795. ? root === workInProgressRoot && renderExpirationTime$1 >= lastExpiredTime
  5796. ? renderExpirationTime$1
  5797. : lastExpiredTime
  5798. : 1073741823;
  5799. var exitStatus = renderRootSync(root, lastExpiredTime);
  5800. 0 !== root.tag &&
  5801. exitStatus === RootErrored &&
  5802. ((lastExpiredTime = 2 < lastExpiredTime ? 2 : lastExpiredTime),
  5803. (exitStatus = renderRootSync(root, lastExpiredTime)));
  5804. if (exitStatus === RootFatalErrored)
  5805. throw ((exitStatus = workInProgressRootFatalError),
  5806. prepareFreshStack(root, lastExpiredTime),
  5807. markRootSuspendedAtTime(root, lastExpiredTime),
  5808. ensureRootIsScheduled(root),
  5809. exitStatus);
  5810. root.finishedWork = root.current.alternate;
  5811. root.finishedExpirationTime = lastExpiredTime;
  5812. commitRoot(root);
  5813. ensureRootIsScheduled(root);
  5814. return null;
  5815. }
  5816. function prepareFreshStack(root, expirationTime) {
  5817. root.finishedWork = null;
  5818. root.finishedExpirationTime = 0;
  5819. var timeoutHandle = root.timeoutHandle;
  5820. -1 !== timeoutHandle &&
  5821. ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle));
  5822. if (null !== workInProgress)
  5823. for (timeoutHandle = workInProgress.return; null !== timeoutHandle; ) {
  5824. var interruptedWork = timeoutHandle;
  5825. switch (interruptedWork.tag) {
  5826. case 1:
  5827. interruptedWork = interruptedWork.type.childContextTypes;
  5828. null !== interruptedWork &&
  5829. void 0 !== interruptedWork &&
  5830. popContext();
  5831. break;
  5832. case 3:
  5833. popHostContainer();
  5834. pop(didPerformWorkStackCursor);
  5835. pop(contextStackCursor);
  5836. break;
  5837. case 5:
  5838. popHostContext(interruptedWork);
  5839. break;
  5840. case 4:
  5841. popHostContainer();
  5842. break;
  5843. case 13:
  5844. pop(suspenseStackCursor);
  5845. break;
  5846. case 19:
  5847. pop(suspenseStackCursor);
  5848. break;
  5849. case 10:
  5850. popProvider(interruptedWork);
  5851. }
  5852. timeoutHandle = timeoutHandle.return;
  5853. }
  5854. workInProgressRoot = root;
  5855. workInProgress = createWorkInProgress(root.current, null);
  5856. renderExpirationTime$1 = expirationTime;
  5857. workInProgressRootExitStatus = RootIncomplete;
  5858. workInProgressRootFatalError = null;
  5859. workInProgressRootLatestSuspenseTimeout = workInProgressRootLatestProcessedExpirationTime = 1073741823;
  5860. workInProgressRootCanSuspendUsingConfig = null;
  5861. workInProgressRootNextUnprocessedUpdateTime = 0;
  5862. workInProgressRootHasPendingPing = !1;
  5863. spawnedWorkDuringRender = null;
  5864. }
  5865. function handleError(root$jscomp$0, thrownValue) {
  5866. do {
  5867. try {
  5868. resetContextDependencies();
  5869. ReactCurrentDispatcher.current = ContextOnlyDispatcher;
  5870. if (didScheduleRenderPhaseUpdate)
  5871. for (
  5872. var hook = currentlyRenderingFiber$1.memoizedState;
  5873. null !== hook;
  5874. ) {
  5875. var queue = hook.queue;
  5876. null !== queue && (queue.pending = null);
  5877. hook = hook.next;
  5878. }
  5879. renderExpirationTime = 0;
  5880. workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
  5881. didScheduleRenderPhaseUpdate = !1;
  5882. if (null === workInProgress || null === workInProgress.return)
  5883. return (
  5884. (workInProgressRootExitStatus = RootFatalErrored),
  5885. (workInProgressRootFatalError = thrownValue),
  5886. (workInProgress = null)
  5887. );
  5888. workInProgress.mode & 8 &&
  5889. stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !0);
  5890. a: {
  5891. var root = root$jscomp$0,
  5892. returnFiber = workInProgress.return,
  5893. sourceFiber = workInProgress,
  5894. value = thrownValue;
  5895. thrownValue = renderExpirationTime$1;
  5896. sourceFiber.effectTag |= 2048;
  5897. sourceFiber.firstEffect = sourceFiber.lastEffect = null;
  5898. if (
  5899. null !== value &&
  5900. "object" === typeof value &&
  5901. "function" === typeof value.then
  5902. ) {
  5903. var thenable = value;
  5904. if (0 === (sourceFiber.mode & 2)) {
  5905. var currentSource = sourceFiber.alternate;
  5906. currentSource
  5907. ? ((sourceFiber.updateQueue = currentSource.updateQueue),
  5908. (sourceFiber.memoizedState = currentSource.memoizedState),
  5909. (sourceFiber.expirationTime = currentSource.expirationTime))
  5910. : ((sourceFiber.updateQueue = null),
  5911. (sourceFiber.memoizedState = null));
  5912. }
  5913. var hasInvisibleParentBoundary =
  5914. 0 !== (suspenseStackCursor.current & 1),
  5915. _workInProgress = returnFiber;
  5916. do {
  5917. var JSCompiler_temp;
  5918. if ((JSCompiler_temp = 13 === _workInProgress.tag)) {
  5919. var nextState = _workInProgress.memoizedState;
  5920. if (null !== nextState)
  5921. JSCompiler_temp = null !== nextState.dehydrated ? !0 : !1;
  5922. else {
  5923. var props = _workInProgress.memoizedProps;
  5924. JSCompiler_temp =
  5925. void 0 === props.fallback
  5926. ? !1
  5927. : !0 !== props.unstable_avoidThisFallback
  5928. ? !0
  5929. : hasInvisibleParentBoundary
  5930. ? !1
  5931. : !0;
  5932. }
  5933. }
  5934. if (JSCompiler_temp) {
  5935. var thenables = _workInProgress.updateQueue;
  5936. if (null === thenables) {
  5937. var updateQueue = new Set();
  5938. updateQueue.add(thenable);
  5939. _workInProgress.updateQueue = updateQueue;
  5940. } else thenables.add(thenable);
  5941. if (0 === (_workInProgress.mode & 2)) {
  5942. _workInProgress.effectTag |= 64;
  5943. sourceFiber.effectTag &= -2981;
  5944. if (1 === sourceFiber.tag)
  5945. if (null === sourceFiber.alternate) sourceFiber.tag = 17;
  5946. else {
  5947. var update = createUpdate(1073741823, null);
  5948. update.tag = 2;
  5949. enqueueUpdate(sourceFiber, update);
  5950. }
  5951. sourceFiber.expirationTime = 1073741823;
  5952. break a;
  5953. }
  5954. value = void 0;
  5955. sourceFiber = thrownValue;
  5956. var pingCache = root.pingCache;
  5957. null === pingCache
  5958. ? ((pingCache = root.pingCache = new PossiblyWeakMap()),
  5959. (value = new Set()),
  5960. pingCache.set(thenable, value))
  5961. : ((value = pingCache.get(thenable)),
  5962. void 0 === value &&
  5963. ((value = new Set()), pingCache.set(thenable, value)));
  5964. if (!value.has(sourceFiber)) {
  5965. value.add(sourceFiber);
  5966. var ping = pingSuspendedRoot.bind(
  5967. null,
  5968. root,
  5969. thenable,
  5970. sourceFiber
  5971. );
  5972. thenable.then(ping, ping);
  5973. }
  5974. _workInProgress.effectTag |= 4096;
  5975. _workInProgress.expirationTime = thrownValue;
  5976. break a;
  5977. }
  5978. _workInProgress = _workInProgress.return;
  5979. } while (null !== _workInProgress);
  5980. value = Error(
  5981. (getComponentName(sourceFiber.type) || "A React component") +
  5982. " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display." +
  5983. getStackByFiberInDevAndProd(sourceFiber)
  5984. );
  5985. }
  5986. workInProgressRootExitStatus !== RootCompleted &&
  5987. (workInProgressRootExitStatus = RootErrored);
  5988. value = createCapturedValue(value, sourceFiber);
  5989. _workInProgress = returnFiber;
  5990. do {
  5991. switch (_workInProgress.tag) {
  5992. case 3:
  5993. thenable = value;
  5994. _workInProgress.effectTag |= 4096;
  5995. _workInProgress.expirationTime = thrownValue;
  5996. var _update = createRootErrorUpdate(
  5997. _workInProgress,
  5998. thenable,
  5999. thrownValue
  6000. );
  6001. enqueueCapturedUpdate(_workInProgress, _update);
  6002. break a;
  6003. case 1:
  6004. thenable = value;
  6005. var ctor = _workInProgress.type,
  6006. instance = _workInProgress.stateNode;
  6007. if (
  6008. 0 === (_workInProgress.effectTag & 64) &&
  6009. ("function" === typeof ctor.getDerivedStateFromError ||
  6010. (null !== instance &&
  6011. "function" === typeof instance.componentDidCatch &&
  6012. (null === legacyErrorBoundariesThatAlreadyFailed ||
  6013. !legacyErrorBoundariesThatAlreadyFailed.has(instance))))
  6014. ) {
  6015. _workInProgress.effectTag |= 4096;
  6016. _workInProgress.expirationTime = thrownValue;
  6017. var _update2 = createClassErrorUpdate(
  6018. _workInProgress,
  6019. thenable,
  6020. thrownValue
  6021. );
  6022. enqueueCapturedUpdate(_workInProgress, _update2);
  6023. break a;
  6024. }
  6025. }
  6026. _workInProgress = _workInProgress.return;
  6027. } while (null !== _workInProgress);
  6028. }
  6029. workInProgress = completeUnitOfWork(workInProgress);
  6030. } catch (yetAnotherThrownValue) {
  6031. thrownValue = yetAnotherThrownValue;
  6032. continue;
  6033. }
  6034. break;
  6035. } while (1);
  6036. }
  6037. function pushDispatcher() {
  6038. var prevDispatcher = ReactCurrentDispatcher$1.current;
  6039. ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
  6040. return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher;
  6041. }
  6042. function pushInteractions(root) {
  6043. var prevInteractions = tracing.__interactionsRef.current;
  6044. tracing.__interactionsRef.current = root.memoizedInteractions;
  6045. return prevInteractions;
  6046. }
  6047. function markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {
  6048. expirationTime < workInProgressRootLatestProcessedExpirationTime &&
  6049. 2 < expirationTime &&
  6050. (workInProgressRootLatestProcessedExpirationTime = expirationTime);
  6051. null !== suspenseConfig &&
  6052. expirationTime < workInProgressRootLatestSuspenseTimeout &&
  6053. 2 < expirationTime &&
  6054. ((workInProgressRootLatestSuspenseTimeout = expirationTime),
  6055. (workInProgressRootCanSuspendUsingConfig = suspenseConfig));
  6056. }
  6057. function markUnprocessedUpdateTime(expirationTime) {
  6058. expirationTime > workInProgressRootNextUnprocessedUpdateTime &&
  6059. (workInProgressRootNextUnprocessedUpdateTime = expirationTime);
  6060. }
  6061. function renderRootSync(root, expirationTime) {
  6062. var prevExecutionContext = executionContext;
  6063. executionContext |= RenderContext;
  6064. var prevDispatcher = pushDispatcher();
  6065. if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1)
  6066. prepareFreshStack(root, expirationTime),
  6067. startWorkOnPendingInteractions(root, expirationTime);
  6068. expirationTime = pushInteractions(root);
  6069. do
  6070. try {
  6071. workLoopSync();
  6072. break;
  6073. } catch (thrownValue) {
  6074. handleError(root, thrownValue);
  6075. }
  6076. while (1);
  6077. resetContextDependencies();
  6078. tracing.__interactionsRef.current = expirationTime;
  6079. executionContext = prevExecutionContext;
  6080. ReactCurrentDispatcher$1.current = prevDispatcher;
  6081. if (null !== workInProgress)
  6082. throw Error(
  6083. "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue."
  6084. );
  6085. workInProgressRoot = null;
  6086. return workInProgressRootExitStatus;
  6087. }
  6088. function workLoopSync() {
  6089. for (; null !== workInProgress; )
  6090. workInProgress = performUnitOfWork(workInProgress);
  6091. }
  6092. function workLoopConcurrent() {
  6093. for (; null !== workInProgress && !Scheduler_shouldYield(); )
  6094. workInProgress = performUnitOfWork(workInProgress);
  6095. }
  6096. function performUnitOfWork(unitOfWork) {
  6097. var current = unitOfWork.alternate;
  6098. 0 !== (unitOfWork.mode & 8)
  6099. ? ((profilerStartTime = now$1()),
  6100. 0 > unitOfWork.actualStartTime && (unitOfWork.actualStartTime = now$1()),
  6101. (current = beginWork$1(current, unitOfWork, renderExpirationTime$1)),
  6102. stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0))
  6103. : (current = beginWork$1(current, unitOfWork, renderExpirationTime$1));
  6104. unitOfWork.memoizedProps = unitOfWork.pendingProps;
  6105. null === current && (current = completeUnitOfWork(unitOfWork));
  6106. ReactCurrentOwner$2.current = null;
  6107. return current;
  6108. }
  6109. function completeUnitOfWork(unitOfWork) {
  6110. workInProgress = unitOfWork;
  6111. do {
  6112. var current = workInProgress.alternate;
  6113. unitOfWork = workInProgress.return;
  6114. if (0 === (workInProgress.effectTag & 2048)) {
  6115. if (0 === (workInProgress.mode & 8))
  6116. current = completeWork(current, workInProgress, renderExpirationTime$1);
  6117. else {
  6118. var fiber = workInProgress;
  6119. profilerStartTime = now$1();
  6120. 0 > fiber.actualStartTime && (fiber.actualStartTime = now$1());
  6121. current = completeWork(current, workInProgress, renderExpirationTime$1);
  6122. stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !1);
  6123. }
  6124. fiber = workInProgress;
  6125. if (1 === renderExpirationTime$1 || 1 !== fiber.childExpirationTime) {
  6126. var newChildExpirationTime = 0;
  6127. if (0 !== (fiber.mode & 8)) {
  6128. for (
  6129. var actualDuration = fiber.actualDuration,
  6130. treeBaseDuration = fiber.selfBaseDuration,
  6131. shouldBubbleActualDurations =
  6132. null === fiber.alternate ||
  6133. fiber.child !== fiber.alternate.child,
  6134. child = fiber.child;
  6135. null !== child;
  6136. ) {
  6137. var childUpdateExpirationTime = child.expirationTime,
  6138. childChildExpirationTime = child.childExpirationTime;
  6139. childUpdateExpirationTime > newChildExpirationTime &&
  6140. (newChildExpirationTime = childUpdateExpirationTime);
  6141. childChildExpirationTime > newChildExpirationTime &&
  6142. (newChildExpirationTime = childChildExpirationTime);
  6143. shouldBubbleActualDurations &&
  6144. (actualDuration += child.actualDuration);
  6145. treeBaseDuration += child.treeBaseDuration;
  6146. child = child.sibling;
  6147. }
  6148. fiber.actualDuration = actualDuration;
  6149. fiber.treeBaseDuration = treeBaseDuration;
  6150. } else
  6151. for (actualDuration = fiber.child; null !== actualDuration; )
  6152. (treeBaseDuration = actualDuration.expirationTime),
  6153. (shouldBubbleActualDurations =
  6154. actualDuration.childExpirationTime),
  6155. treeBaseDuration > newChildExpirationTime &&
  6156. (newChildExpirationTime = treeBaseDuration),
  6157. shouldBubbleActualDurations > newChildExpirationTime &&
  6158. (newChildExpirationTime = shouldBubbleActualDurations),
  6159. (actualDuration = actualDuration.sibling);
  6160. fiber.childExpirationTime = newChildExpirationTime;
  6161. }
  6162. if (null !== current) return current;
  6163. null !== unitOfWork &&
  6164. 0 === (unitOfWork.effectTag & 2048) &&
  6165. (null === unitOfWork.firstEffect &&
  6166. (unitOfWork.firstEffect = workInProgress.firstEffect),
  6167. null !== workInProgress.lastEffect &&
  6168. (null !== unitOfWork.lastEffect &&
  6169. (unitOfWork.lastEffect.nextEffect = workInProgress.firstEffect),
  6170. (unitOfWork.lastEffect = workInProgress.lastEffect)),
  6171. 1 < workInProgress.effectTag &&
  6172. (null !== unitOfWork.lastEffect
  6173. ? (unitOfWork.lastEffect.nextEffect = workInProgress)
  6174. : (unitOfWork.firstEffect = workInProgress),
  6175. (unitOfWork.lastEffect = workInProgress)));
  6176. } else {
  6177. current = unwindWork(workInProgress);
  6178. if (0 !== (workInProgress.mode & 8)) {
  6179. stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !1);
  6180. fiber = workInProgress.actualDuration;
  6181. for (
  6182. newChildExpirationTime = workInProgress.child;
  6183. null !== newChildExpirationTime;
  6184. )
  6185. (fiber += newChildExpirationTime.actualDuration),
  6186. (newChildExpirationTime = newChildExpirationTime.sibling);
  6187. workInProgress.actualDuration = fiber;
  6188. }
  6189. if (null !== current) return (current.effectTag &= 2047), current;
  6190. null !== unitOfWork &&
  6191. ((unitOfWork.firstEffect = unitOfWork.lastEffect = null),
  6192. (unitOfWork.effectTag |= 2048));
  6193. }
  6194. current = workInProgress.sibling;
  6195. if (null !== current) return current;
  6196. workInProgress = unitOfWork;
  6197. } while (null !== workInProgress);
  6198. workInProgressRootExitStatus === RootIncomplete &&
  6199. (workInProgressRootExitStatus = RootCompleted);
  6200. return null;
  6201. }
  6202. function getRemainingExpirationTime(fiber) {
  6203. var updateExpirationTime = fiber.expirationTime;
  6204. fiber = fiber.childExpirationTime;
  6205. return updateExpirationTime > fiber ? updateExpirationTime : fiber;
  6206. }
  6207. function commitRoot(root) {
  6208. var renderPriorityLevel = getCurrentPriorityLevel();
  6209. runWithPriority(99, commitRootImpl.bind(null, root, renderPriorityLevel));
  6210. return null;
  6211. }
  6212. function commitRootImpl(root$jscomp$1, renderPriorityLevel$jscomp$1) {
  6213. do flushPassiveEffects();
  6214. while (null !== rootWithPendingPassiveEffects);
  6215. if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
  6216. throw Error("Should not already be working.");
  6217. var finishedWork = root$jscomp$1.finishedWork,
  6218. expirationTime = root$jscomp$1.finishedExpirationTime;
  6219. if (null === finishedWork) return null;
  6220. root$jscomp$1.finishedWork = null;
  6221. root$jscomp$1.finishedExpirationTime = 0;
  6222. if (finishedWork === root$jscomp$1.current)
  6223. throw Error(
  6224. "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."
  6225. );
  6226. root$jscomp$1.callbackNode = null;
  6227. root$jscomp$1.callbackExpirationTime = 0;
  6228. root$jscomp$1.callbackPriority = 90;
  6229. root$jscomp$1.nextKnownPendingLevel = 0;
  6230. var remainingExpirationTimeBeforeCommit = getRemainingExpirationTime(
  6231. finishedWork
  6232. );
  6233. root$jscomp$1.firstPendingTime = remainingExpirationTimeBeforeCommit;
  6234. expirationTime <= root$jscomp$1.lastSuspendedTime
  6235. ? (root$jscomp$1.firstSuspendedTime = root$jscomp$1.lastSuspendedTime = root$jscomp$1.nextKnownPendingLevel = 0)
  6236. : expirationTime <= root$jscomp$1.firstSuspendedTime &&
  6237. (root$jscomp$1.firstSuspendedTime = expirationTime - 1);
  6238. expirationTime <= root$jscomp$1.lastPingedTime &&
  6239. (root$jscomp$1.lastPingedTime = 0);
  6240. expirationTime <= root$jscomp$1.lastExpiredTime &&
  6241. (root$jscomp$1.lastExpiredTime = 0);
  6242. root$jscomp$1 === workInProgressRoot &&
  6243. ((workInProgress = workInProgressRoot = null),
  6244. (renderExpirationTime$1 = 0));
  6245. 1 < finishedWork.effectTag
  6246. ? null !== finishedWork.lastEffect
  6247. ? ((finishedWork.lastEffect.nextEffect = finishedWork),
  6248. (remainingExpirationTimeBeforeCommit = finishedWork.firstEffect))
  6249. : (remainingExpirationTimeBeforeCommit = finishedWork)
  6250. : (remainingExpirationTimeBeforeCommit = finishedWork.firstEffect);
  6251. if (null !== remainingExpirationTimeBeforeCommit) {
  6252. var prevExecutionContext = executionContext;
  6253. executionContext |= CommitContext;
  6254. var prevInteractions = pushInteractions(root$jscomp$1);
  6255. ReactCurrentOwner$2.current = null;
  6256. nextEffect = remainingExpirationTimeBeforeCommit;
  6257. do
  6258. try {
  6259. commitBeforeMutationEffects();
  6260. } catch (error) {
  6261. if (null === nextEffect) throw Error("Should be working on an effect.");
  6262. captureCommitPhaseError(nextEffect, error);
  6263. nextEffect = nextEffect.nextEffect;
  6264. }
  6265. while (null !== nextEffect);
  6266. commitTime = now$1();
  6267. nextEffect = remainingExpirationTimeBeforeCommit;
  6268. do
  6269. try {
  6270. for (
  6271. var root = root$jscomp$1,
  6272. renderPriorityLevel = renderPriorityLevel$jscomp$1;
  6273. null !== nextEffect;
  6274. ) {
  6275. var effectTag = nextEffect.effectTag;
  6276. if (effectTag & 128) {
  6277. var current = nextEffect.alternate;
  6278. if (null !== current) {
  6279. var currentRef = current.ref;
  6280. null !== currentRef &&
  6281. ("function" === typeof currentRef
  6282. ? currentRef(null)
  6283. : (currentRef.current = null));
  6284. }
  6285. }
  6286. switch (effectTag & 1038) {
  6287. case 2:
  6288. nextEffect.effectTag &= -3;
  6289. break;
  6290. case 6:
  6291. nextEffect.effectTag &= -3;
  6292. commitWork(nextEffect.alternate, nextEffect);
  6293. break;
  6294. case 1024:
  6295. nextEffect.effectTag &= -1025;
  6296. break;
  6297. case 1028:
  6298. nextEffect.effectTag &= -1025;
  6299. commitWork(nextEffect.alternate, nextEffect);
  6300. break;
  6301. case 4:
  6302. commitWork(nextEffect.alternate, nextEffect);
  6303. break;
  6304. case 8:
  6305. var current$jscomp$0 = nextEffect;
  6306. a: for (
  6307. var finishedRoot = root,
  6308. root$jscomp$0 = current$jscomp$0,
  6309. renderPriorityLevel$jscomp$0 = renderPriorityLevel,
  6310. node = root$jscomp$0;
  6311. ;
  6312. )
  6313. if (
  6314. (commitUnmount(
  6315. finishedRoot,
  6316. node,
  6317. renderPriorityLevel$jscomp$0
  6318. ),
  6319. null !== node.child)
  6320. )
  6321. (node.child.return = node), (node = node.child);
  6322. else {
  6323. if (node === root$jscomp$0) break;
  6324. for (; null === node.sibling; ) {
  6325. if (null === node.return || node.return === root$jscomp$0)
  6326. break a;
  6327. node = node.return;
  6328. }
  6329. node.sibling.return = node.return;
  6330. node = node.sibling;
  6331. }
  6332. detachFiber(current$jscomp$0);
  6333. }
  6334. nextEffect = nextEffect.nextEffect;
  6335. }
  6336. } catch (error) {
  6337. if (null === nextEffect) throw Error("Should be working on an effect.");
  6338. captureCommitPhaseError(nextEffect, error);
  6339. nextEffect = nextEffect.nextEffect;
  6340. }
  6341. while (null !== nextEffect);
  6342. root$jscomp$1.current = finishedWork;
  6343. nextEffect = remainingExpirationTimeBeforeCommit;
  6344. do
  6345. try {
  6346. for (effectTag = root$jscomp$1; null !== nextEffect; ) {
  6347. var effectTag$jscomp$0 = nextEffect.effectTag;
  6348. effectTag$jscomp$0 & 36 &&
  6349. commitLifeCycles(effectTag, nextEffect.alternate, nextEffect);
  6350. if (effectTag$jscomp$0 & 128) {
  6351. current = void 0;
  6352. var ref = nextEffect.ref;
  6353. if (null !== ref) {
  6354. var instance = nextEffect.stateNode;
  6355. switch (nextEffect.tag) {
  6356. case 5:
  6357. current = instance.canonical;
  6358. break;
  6359. default:
  6360. current = instance;
  6361. }
  6362. "function" === typeof ref
  6363. ? ref(current)
  6364. : (ref.current = current);
  6365. }
  6366. }
  6367. nextEffect = nextEffect.nextEffect;
  6368. }
  6369. } catch (error) {
  6370. if (null === nextEffect) throw Error("Should be working on an effect.");
  6371. captureCommitPhaseError(nextEffect, error);
  6372. nextEffect = nextEffect.nextEffect;
  6373. }
  6374. while (null !== nextEffect);
  6375. nextEffect = null;
  6376. requestPaint();
  6377. tracing.__interactionsRef.current = prevInteractions;
  6378. executionContext = prevExecutionContext;
  6379. } else (root$jscomp$1.current = finishedWork), (commitTime = now$1());
  6380. if ((effectTag$jscomp$0 = rootDoesHavePassiveEffects))
  6381. (rootDoesHavePassiveEffects = !1),
  6382. (rootWithPendingPassiveEffects = root$jscomp$1),
  6383. (pendingPassiveEffectsExpirationTime = expirationTime),
  6384. (pendingPassiveEffectsRenderPriority = renderPriorityLevel$jscomp$1);
  6385. else
  6386. for (
  6387. nextEffect = remainingExpirationTimeBeforeCommit;
  6388. null !== nextEffect;
  6389. )
  6390. (renderPriorityLevel$jscomp$1 = nextEffect.nextEffect),
  6391. (nextEffect.nextEffect = null),
  6392. (nextEffect = renderPriorityLevel$jscomp$1);
  6393. renderPriorityLevel$jscomp$1 = root$jscomp$1.firstPendingTime;
  6394. if (0 !== renderPriorityLevel$jscomp$1) {
  6395. if (null !== spawnedWorkDuringRender)
  6396. for (
  6397. remainingExpirationTimeBeforeCommit = spawnedWorkDuringRender,
  6398. spawnedWorkDuringRender = null,
  6399. ref = 0;
  6400. ref < remainingExpirationTimeBeforeCommit.length;
  6401. ref++
  6402. )
  6403. scheduleInteractions(
  6404. root$jscomp$1,
  6405. remainingExpirationTimeBeforeCommit[ref],
  6406. root$jscomp$1.memoizedInteractions
  6407. );
  6408. schedulePendingInteractions(root$jscomp$1, renderPriorityLevel$jscomp$1);
  6409. } else legacyErrorBoundariesThatAlreadyFailed = null;
  6410. effectTag$jscomp$0 ||
  6411. finishPendingInteractions(root$jscomp$1, expirationTime);
  6412. 1073741823 === renderPriorityLevel$jscomp$1
  6413. ? root$jscomp$1 === rootWithNestedUpdates
  6414. ? nestedUpdateCount++
  6415. : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root$jscomp$1))
  6416. : (nestedUpdateCount = 0);
  6417. "function" === typeof onCommitFiberRoot &&
  6418. onCommitFiberRoot(finishedWork.stateNode, expirationTime);
  6419. ensureRootIsScheduled(root$jscomp$1);
  6420. if (hasUncaughtError)
  6421. throw ((hasUncaughtError = !1),
  6422. (root$jscomp$1 = firstUncaughtError),
  6423. (firstUncaughtError = null),
  6424. root$jscomp$1);
  6425. if ((executionContext & LegacyUnbatchedContext) !== NoContext) return null;
  6426. flushSyncCallbackQueue();
  6427. return null;
  6428. }
  6429. function commitBeforeMutationEffects() {
  6430. for (; null !== nextEffect; ) {
  6431. var effectTag = nextEffect.effectTag;
  6432. 0 !== (effectTag & 256) &&
  6433. commitBeforeMutationLifeCycles(nextEffect.alternate, nextEffect);
  6434. 0 === (effectTag & 512) ||
  6435. rootDoesHavePassiveEffects ||
  6436. ((rootDoesHavePassiveEffects = !0),
  6437. scheduleCallback(97, function() {
  6438. flushPassiveEffects();
  6439. return null;
  6440. }));
  6441. nextEffect = nextEffect.nextEffect;
  6442. }
  6443. }
  6444. function flushPassiveEffects() {
  6445. if (90 !== pendingPassiveEffectsRenderPriority) {
  6446. var priorityLevel =
  6447. 97 < pendingPassiveEffectsRenderPriority
  6448. ? 97
  6449. : pendingPassiveEffectsRenderPriority;
  6450. pendingPassiveEffectsRenderPriority = 90;
  6451. return runWithPriority(priorityLevel, flushPassiveEffectsImpl);
  6452. }
  6453. }
  6454. function flushPassiveEffectsImpl() {
  6455. if (null === rootWithPendingPassiveEffects) return !1;
  6456. var root = rootWithPendingPassiveEffects,
  6457. expirationTime = pendingPassiveEffectsExpirationTime;
  6458. rootWithPendingPassiveEffects = null;
  6459. pendingPassiveEffectsExpirationTime = 0;
  6460. if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
  6461. throw Error("Cannot flush passive effects while already rendering.");
  6462. var prevExecutionContext = executionContext;
  6463. executionContext |= CommitContext;
  6464. for (
  6465. var prevInteractions = pushInteractions(root),
  6466. _effect2 = root.current.firstEffect;
  6467. null !== _effect2;
  6468. ) {
  6469. try {
  6470. var finishedWork = _effect2;
  6471. if (0 !== (finishedWork.effectTag & 512))
  6472. switch (finishedWork.tag) {
  6473. case 0:
  6474. case 11:
  6475. case 15:
  6476. case 22:
  6477. commitHookEffectListUnmount(5, finishedWork),
  6478. commitHookEffectListMount(5, finishedWork);
  6479. }
  6480. } catch (error) {
  6481. if (null === _effect2) throw Error("Should be working on an effect.");
  6482. captureCommitPhaseError(_effect2, error);
  6483. }
  6484. finishedWork = _effect2.nextEffect;
  6485. _effect2.nextEffect = null;
  6486. _effect2 = finishedWork;
  6487. }
  6488. tracing.__interactionsRef.current = prevInteractions;
  6489. finishPendingInteractions(root, expirationTime);
  6490. executionContext = prevExecutionContext;
  6491. flushSyncCallbackQueue();
  6492. return !0;
  6493. }
  6494. function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
  6495. sourceFiber = createCapturedValue(error, sourceFiber);
  6496. sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 1073741823);
  6497. enqueueUpdate(rootFiber, sourceFiber);
  6498. rootFiber = markUpdateTimeFromFiberToRoot(rootFiber, 1073741823);
  6499. null !== rootFiber &&
  6500. (ensureRootIsScheduled(rootFiber),
  6501. schedulePendingInteractions(rootFiber, 1073741823));
  6502. }
  6503. function captureCommitPhaseError(sourceFiber, error) {
  6504. if (3 === sourceFiber.tag)
  6505. captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
  6506. else
  6507. for (var fiber = sourceFiber.return; null !== fiber; ) {
  6508. if (3 === fiber.tag) {
  6509. captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
  6510. break;
  6511. } else if (1 === fiber.tag) {
  6512. var instance = fiber.stateNode;
  6513. if (
  6514. "function" === typeof fiber.type.getDerivedStateFromError ||
  6515. ("function" === typeof instance.componentDidCatch &&
  6516. (null === legacyErrorBoundariesThatAlreadyFailed ||
  6517. !legacyErrorBoundariesThatAlreadyFailed.has(instance)))
  6518. ) {
  6519. sourceFiber = createCapturedValue(error, sourceFiber);
  6520. sourceFiber = createClassErrorUpdate(fiber, sourceFiber, 1073741823);
  6521. enqueueUpdate(fiber, sourceFiber);
  6522. fiber = markUpdateTimeFromFiberToRoot(fiber, 1073741823);
  6523. null !== fiber &&
  6524. (ensureRootIsScheduled(fiber),
  6525. schedulePendingInteractions(fiber, 1073741823));
  6526. break;
  6527. }
  6528. }
  6529. fiber = fiber.return;
  6530. }
  6531. }
  6532. function pingSuspendedRoot(root, thenable, suspendedTime) {
  6533. var pingCache = root.pingCache;
  6534. null !== pingCache && pingCache.delete(thenable);
  6535. workInProgressRoot === root && renderExpirationTime$1 === suspendedTime
  6536. ? workInProgressRootExitStatus === RootSuspendedWithDelay ||
  6537. (workInProgressRootExitStatus === RootSuspended &&
  6538. 1073741823 === workInProgressRootLatestProcessedExpirationTime &&
  6539. now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS)
  6540. ? prepareFreshStack(root, renderExpirationTime$1)
  6541. : (workInProgressRootHasPendingPing = !0)
  6542. : isRootSuspendedAtTime(root, suspendedTime) &&
  6543. ((thenable = root.lastPingedTime),
  6544. (0 !== thenable && thenable < suspendedTime) ||
  6545. ((root.lastPingedTime = suspendedTime),
  6546. ensureRootIsScheduled(root),
  6547. schedulePendingInteractions(root, suspendedTime)));
  6548. }
  6549. function resolveRetryThenable(boundaryFiber, thenable) {
  6550. var retryCache = boundaryFiber.stateNode;
  6551. null !== retryCache && retryCache.delete(thenable);
  6552. thenable = 0;
  6553. 0 === thenable &&
  6554. ((thenable = requestCurrentTimeForUpdate()),
  6555. (thenable = computeExpirationForFiber(thenable, boundaryFiber, null)));
  6556. boundaryFiber = markUpdateTimeFromFiberToRoot(boundaryFiber, thenable);
  6557. null !== boundaryFiber &&
  6558. (ensureRootIsScheduled(boundaryFiber),
  6559. schedulePendingInteractions(boundaryFiber, thenable));
  6560. }
  6561. var beginWork$1;
  6562. beginWork$1 = function(current, workInProgress, renderExpirationTime) {
  6563. var updateExpirationTime = workInProgress.expirationTime;
  6564. if (null !== current)
  6565. if (
  6566. current.memoizedProps !== workInProgress.pendingProps ||
  6567. didPerformWorkStackCursor.current
  6568. )
  6569. didReceiveUpdate = !0;
  6570. else {
  6571. if (updateExpirationTime < renderExpirationTime) {
  6572. didReceiveUpdate = !1;
  6573. switch (workInProgress.tag) {
  6574. case 3:
  6575. pushHostRootContext(workInProgress);
  6576. break;
  6577. case 5:
  6578. pushHostContext(workInProgress);
  6579. break;
  6580. case 1:
  6581. isContextProvider(workInProgress.type) &&
  6582. pushContextProvider(workInProgress);
  6583. break;
  6584. case 4:
  6585. pushHostContainer(
  6586. workInProgress,
  6587. workInProgress.stateNode.containerInfo
  6588. );
  6589. break;
  6590. case 10:
  6591. updateExpirationTime = workInProgress.memoizedProps.value;
  6592. var context = workInProgress.type._context;
  6593. push(valueCursor, context._currentValue2);
  6594. context._currentValue2 = updateExpirationTime;
  6595. break;
  6596. case 12:
  6597. workInProgress.childExpirationTime >= renderExpirationTime &&
  6598. (workInProgress.effectTag |= 4);
  6599. updateExpirationTime = workInProgress.stateNode;
  6600. updateExpirationTime.effectDuration = 0;
  6601. updateExpirationTime.passiveEffectDuration = 0;
  6602. break;
  6603. case 13:
  6604. if (null !== workInProgress.memoizedState) {
  6605. updateExpirationTime = workInProgress.child.childExpirationTime;
  6606. if (
  6607. 0 !== updateExpirationTime &&
  6608. updateExpirationTime >= renderExpirationTime
  6609. )
  6610. return updateSuspenseComponent(
  6611. current,
  6612. workInProgress,
  6613. renderExpirationTime
  6614. );
  6615. push(suspenseStackCursor, suspenseStackCursor.current & 1);
  6616. workInProgress = bailoutOnAlreadyFinishedWork(
  6617. current,
  6618. workInProgress,
  6619. renderExpirationTime
  6620. );
  6621. return null !== workInProgress ? workInProgress.sibling : null;
  6622. }
  6623. push(suspenseStackCursor, suspenseStackCursor.current & 1);
  6624. break;
  6625. case 19:
  6626. updateExpirationTime =
  6627. workInProgress.childExpirationTime >= renderExpirationTime;
  6628. if (0 !== (current.effectTag & 64)) {
  6629. if (updateExpirationTime)
  6630. return updateSuspenseListComponent(
  6631. current,
  6632. workInProgress,
  6633. renderExpirationTime
  6634. );
  6635. workInProgress.effectTag |= 64;
  6636. }
  6637. context = workInProgress.memoizedState;
  6638. null !== context &&
  6639. ((context.rendering = null), (context.tail = null));
  6640. push(suspenseStackCursor, suspenseStackCursor.current);
  6641. if (!updateExpirationTime) return null;
  6642. }
  6643. return bailoutOnAlreadyFinishedWork(
  6644. current,
  6645. workInProgress,
  6646. renderExpirationTime
  6647. );
  6648. }
  6649. didReceiveUpdate = !1;
  6650. }
  6651. else didReceiveUpdate = !1;
  6652. workInProgress.expirationTime = 0;
  6653. switch (workInProgress.tag) {
  6654. case 2:
  6655. updateExpirationTime = workInProgress.type;
  6656. null !== current &&
  6657. ((current.alternate = null),
  6658. (workInProgress.alternate = null),
  6659. (workInProgress.effectTag |= 2));
  6660. current = workInProgress.pendingProps;
  6661. context = getMaskedContext(workInProgress, contextStackCursor.current);
  6662. prepareToReadContext(workInProgress, renderExpirationTime);
  6663. context = renderWithHooks(
  6664. null,
  6665. workInProgress,
  6666. updateExpirationTime,
  6667. current,
  6668. context,
  6669. renderExpirationTime
  6670. );
  6671. workInProgress.effectTag |= 1;
  6672. if (
  6673. "object" === typeof context &&
  6674. null !== context &&
  6675. "function" === typeof context.render &&
  6676. void 0 === context.$$typeof
  6677. ) {
  6678. workInProgress.tag = 1;
  6679. workInProgress.memoizedState = null;
  6680. workInProgress.updateQueue = null;
  6681. if (isContextProvider(updateExpirationTime)) {
  6682. var hasContext = !0;
  6683. pushContextProvider(workInProgress);
  6684. } else hasContext = !1;
  6685. workInProgress.memoizedState =
  6686. null !== context.state && void 0 !== context.state
  6687. ? context.state
  6688. : null;
  6689. initializeUpdateQueue(workInProgress);
  6690. var getDerivedStateFromProps =
  6691. updateExpirationTime.getDerivedStateFromProps;
  6692. "function" === typeof getDerivedStateFromProps &&
  6693. applyDerivedStateFromProps(
  6694. workInProgress,
  6695. updateExpirationTime,
  6696. getDerivedStateFromProps,
  6697. current
  6698. );
  6699. context.updater = classComponentUpdater;
  6700. workInProgress.stateNode = context;
  6701. context._reactInternalFiber = workInProgress;
  6702. mountClassInstance(
  6703. workInProgress,
  6704. updateExpirationTime,
  6705. current,
  6706. renderExpirationTime
  6707. );
  6708. workInProgress = finishClassComponent(
  6709. null,
  6710. workInProgress,
  6711. updateExpirationTime,
  6712. !0,
  6713. hasContext,
  6714. renderExpirationTime
  6715. );
  6716. } else
  6717. (workInProgress.tag = 0),
  6718. reconcileChildren(
  6719. null,
  6720. workInProgress,
  6721. context,
  6722. renderExpirationTime
  6723. ),
  6724. (workInProgress = workInProgress.child);
  6725. return workInProgress;
  6726. case 16:
  6727. a: {
  6728. context = workInProgress.elementType;
  6729. null !== current &&
  6730. ((current.alternate = null),
  6731. (workInProgress.alternate = null),
  6732. (workInProgress.effectTag |= 2));
  6733. current = workInProgress.pendingProps;
  6734. initializeLazyComponentType(context);
  6735. if (1 !== context._status) throw context._result;
  6736. context = context._result;
  6737. workInProgress.type = context;
  6738. hasContext = workInProgress.tag = resolveLazyComponentTag(context);
  6739. current = resolveDefaultProps(context, current);
  6740. switch (hasContext) {
  6741. case 0:
  6742. workInProgress = updateFunctionComponent(
  6743. null,
  6744. workInProgress,
  6745. context,
  6746. current,
  6747. renderExpirationTime
  6748. );
  6749. break a;
  6750. case 1:
  6751. workInProgress = updateClassComponent(
  6752. null,
  6753. workInProgress,
  6754. context,
  6755. current,
  6756. renderExpirationTime
  6757. );
  6758. break a;
  6759. case 11:
  6760. workInProgress = updateForwardRef(
  6761. null,
  6762. workInProgress,
  6763. context,
  6764. current,
  6765. renderExpirationTime
  6766. );
  6767. break a;
  6768. case 14:
  6769. workInProgress = updateMemoComponent(
  6770. null,
  6771. workInProgress,
  6772. context,
  6773. resolveDefaultProps(context.type, current),
  6774. updateExpirationTime,
  6775. renderExpirationTime
  6776. );
  6777. break a;
  6778. }
  6779. throw Error(
  6780. "Element type is invalid. Received a promise that resolves to: " +
  6781. context +
  6782. ". Lazy element type must resolve to a class or function."
  6783. );
  6784. }
  6785. return workInProgress;
  6786. case 0:
  6787. return (
  6788. (updateExpirationTime = workInProgress.type),
  6789. (context = workInProgress.pendingProps),
  6790. (context =
  6791. workInProgress.elementType === updateExpirationTime
  6792. ? context
  6793. : resolveDefaultProps(updateExpirationTime, context)),
  6794. updateFunctionComponent(
  6795. current,
  6796. workInProgress,
  6797. updateExpirationTime,
  6798. context,
  6799. renderExpirationTime
  6800. )
  6801. );
  6802. case 1:
  6803. return (
  6804. (updateExpirationTime = workInProgress.type),
  6805. (context = workInProgress.pendingProps),
  6806. (context =
  6807. workInProgress.elementType === updateExpirationTime
  6808. ? context
  6809. : resolveDefaultProps(updateExpirationTime, context)),
  6810. updateClassComponent(
  6811. current,
  6812. workInProgress,
  6813. updateExpirationTime,
  6814. context,
  6815. renderExpirationTime
  6816. )
  6817. );
  6818. case 3:
  6819. pushHostRootContext(workInProgress);
  6820. updateExpirationTime = workInProgress.updateQueue;
  6821. if (null === current || null === updateExpirationTime)
  6822. throw Error(
  6823. "If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue."
  6824. );
  6825. updateExpirationTime = workInProgress.pendingProps;
  6826. context = workInProgress.memoizedState;
  6827. context = null !== context ? context.element : null;
  6828. cloneUpdateQueue(current, workInProgress);
  6829. processUpdateQueue(
  6830. workInProgress,
  6831. updateExpirationTime,
  6832. null,
  6833. renderExpirationTime
  6834. );
  6835. updateExpirationTime = workInProgress.memoizedState.element;
  6836. updateExpirationTime === context
  6837. ? (workInProgress = bailoutOnAlreadyFinishedWork(
  6838. current,
  6839. workInProgress,
  6840. renderExpirationTime
  6841. ))
  6842. : (reconcileChildren(
  6843. current,
  6844. workInProgress,
  6845. updateExpirationTime,
  6846. renderExpirationTime
  6847. ),
  6848. (workInProgress = workInProgress.child));
  6849. return workInProgress;
  6850. case 5:
  6851. return (
  6852. pushHostContext(workInProgress),
  6853. (updateExpirationTime = workInProgress.pendingProps.children),
  6854. markRef(current, workInProgress),
  6855. reconcileChildren(
  6856. current,
  6857. workInProgress,
  6858. updateExpirationTime,
  6859. renderExpirationTime
  6860. ),
  6861. (workInProgress = workInProgress.child),
  6862. workInProgress
  6863. );
  6864. case 6:
  6865. return null;
  6866. case 13:
  6867. return updateSuspenseComponent(
  6868. current,
  6869. workInProgress,
  6870. renderExpirationTime
  6871. );
  6872. case 4:
  6873. return (
  6874. pushHostContainer(
  6875. workInProgress,
  6876. workInProgress.stateNode.containerInfo
  6877. ),
  6878. (updateExpirationTime = workInProgress.pendingProps),
  6879. null === current
  6880. ? (workInProgress.child = reconcileChildFibers(
  6881. workInProgress,
  6882. null,
  6883. updateExpirationTime,
  6884. renderExpirationTime
  6885. ))
  6886. : reconcileChildren(
  6887. current,
  6888. workInProgress,
  6889. updateExpirationTime,
  6890. renderExpirationTime
  6891. ),
  6892. workInProgress.child
  6893. );
  6894. case 11:
  6895. return (
  6896. (updateExpirationTime = workInProgress.type),
  6897. (context = workInProgress.pendingProps),
  6898. (context =
  6899. workInProgress.elementType === updateExpirationTime
  6900. ? context
  6901. : resolveDefaultProps(updateExpirationTime, context)),
  6902. updateForwardRef(
  6903. current,
  6904. workInProgress,
  6905. updateExpirationTime,
  6906. context,
  6907. renderExpirationTime
  6908. )
  6909. );
  6910. case 7:
  6911. return (
  6912. reconcileChildren(
  6913. current,
  6914. workInProgress,
  6915. workInProgress.pendingProps,
  6916. renderExpirationTime
  6917. ),
  6918. workInProgress.child
  6919. );
  6920. case 8:
  6921. return (
  6922. reconcileChildren(
  6923. current,
  6924. workInProgress,
  6925. workInProgress.pendingProps.children,
  6926. renderExpirationTime
  6927. ),
  6928. workInProgress.child
  6929. );
  6930. case 12:
  6931. return (
  6932. (workInProgress.effectTag |= 4),
  6933. (updateExpirationTime = workInProgress.stateNode),
  6934. (updateExpirationTime.effectDuration = 0),
  6935. (updateExpirationTime.passiveEffectDuration = 0),
  6936. reconcileChildren(
  6937. current,
  6938. workInProgress,
  6939. workInProgress.pendingProps.children,
  6940. renderExpirationTime
  6941. ),
  6942. workInProgress.child
  6943. );
  6944. case 10:
  6945. a: {
  6946. updateExpirationTime = workInProgress.type._context;
  6947. context = workInProgress.pendingProps;
  6948. getDerivedStateFromProps = workInProgress.memoizedProps;
  6949. hasContext = context.value;
  6950. var context$jscomp$0 = workInProgress.type._context;
  6951. push(valueCursor, context$jscomp$0._currentValue2);
  6952. context$jscomp$0._currentValue2 = hasContext;
  6953. if (null !== getDerivedStateFromProps)
  6954. if (
  6955. ((context$jscomp$0 = getDerivedStateFromProps.value),
  6956. (hasContext = objectIs(context$jscomp$0, hasContext)
  6957. ? 0
  6958. : ("function" ===
  6959. typeof updateExpirationTime._calculateChangedBits
  6960. ? updateExpirationTime._calculateChangedBits(
  6961. context$jscomp$0,
  6962. hasContext
  6963. )
  6964. : 1073741823) | 0),
  6965. 0 === hasContext)
  6966. ) {
  6967. if (
  6968. getDerivedStateFromProps.children === context.children &&
  6969. !didPerformWorkStackCursor.current
  6970. ) {
  6971. workInProgress = bailoutOnAlreadyFinishedWork(
  6972. current,
  6973. workInProgress,
  6974. renderExpirationTime
  6975. );
  6976. break a;
  6977. }
  6978. } else
  6979. for (
  6980. context$jscomp$0 = workInProgress.child,
  6981. null !== context$jscomp$0 &&
  6982. (context$jscomp$0.return = workInProgress);
  6983. null !== context$jscomp$0;
  6984. ) {
  6985. var list = context$jscomp$0.dependencies;
  6986. if (null !== list) {
  6987. getDerivedStateFromProps = context$jscomp$0.child;
  6988. for (
  6989. var dependency = list.firstContext;
  6990. null !== dependency;
  6991. ) {
  6992. if (
  6993. dependency.context === updateExpirationTime &&
  6994. 0 !== (dependency.observedBits & hasContext)
  6995. ) {
  6996. 1 === context$jscomp$0.tag &&
  6997. ((dependency = createUpdate(renderExpirationTime, null)),
  6998. (dependency.tag = 2),
  6999. enqueueUpdate(context$jscomp$0, dependency));
  7000. context$jscomp$0.expirationTime < renderExpirationTime &&
  7001. (context$jscomp$0.expirationTime = renderExpirationTime);
  7002. dependency = context$jscomp$0.alternate;
  7003. null !== dependency &&
  7004. dependency.expirationTime < renderExpirationTime &&
  7005. (dependency.expirationTime = renderExpirationTime);
  7006. scheduleWorkOnParentPath(
  7007. context$jscomp$0.return,
  7008. renderExpirationTime
  7009. );
  7010. list.expirationTime < renderExpirationTime &&
  7011. (list.expirationTime = renderExpirationTime);
  7012. break;
  7013. }
  7014. dependency = dependency.next;
  7015. }
  7016. } else
  7017. getDerivedStateFromProps =
  7018. 10 === context$jscomp$0.tag
  7019. ? context$jscomp$0.type === workInProgress.type
  7020. ? null
  7021. : context$jscomp$0.child
  7022. : context$jscomp$0.child;
  7023. if (null !== getDerivedStateFromProps)
  7024. getDerivedStateFromProps.return = context$jscomp$0;
  7025. else
  7026. for (
  7027. getDerivedStateFromProps = context$jscomp$0;
  7028. null !== getDerivedStateFromProps;
  7029. ) {
  7030. if (getDerivedStateFromProps === workInProgress) {
  7031. getDerivedStateFromProps = null;
  7032. break;
  7033. }
  7034. context$jscomp$0 = getDerivedStateFromProps.sibling;
  7035. if (null !== context$jscomp$0) {
  7036. context$jscomp$0.return = getDerivedStateFromProps.return;
  7037. getDerivedStateFromProps = context$jscomp$0;
  7038. break;
  7039. }
  7040. getDerivedStateFromProps = getDerivedStateFromProps.return;
  7041. }
  7042. context$jscomp$0 = getDerivedStateFromProps;
  7043. }
  7044. reconcileChildren(
  7045. current,
  7046. workInProgress,
  7047. context.children,
  7048. renderExpirationTime
  7049. );
  7050. workInProgress = workInProgress.child;
  7051. }
  7052. return workInProgress;
  7053. case 9:
  7054. return (
  7055. (context = workInProgress.type),
  7056. (hasContext = workInProgress.pendingProps),
  7057. (updateExpirationTime = hasContext.children),
  7058. prepareToReadContext(workInProgress, renderExpirationTime),
  7059. (context = readContext(context, hasContext.unstable_observedBits)),
  7060. (updateExpirationTime = updateExpirationTime(context)),
  7061. (workInProgress.effectTag |= 1),
  7062. reconcileChildren(
  7063. current,
  7064. workInProgress,
  7065. updateExpirationTime,
  7066. renderExpirationTime
  7067. ),
  7068. workInProgress.child
  7069. );
  7070. case 14:
  7071. return (
  7072. (context = workInProgress.type),
  7073. (hasContext = resolveDefaultProps(
  7074. context,
  7075. workInProgress.pendingProps
  7076. )),
  7077. (hasContext = resolveDefaultProps(context.type, hasContext)),
  7078. updateMemoComponent(
  7079. current,
  7080. workInProgress,
  7081. context,
  7082. hasContext,
  7083. updateExpirationTime,
  7084. renderExpirationTime
  7085. )
  7086. );
  7087. case 15:
  7088. return updateSimpleMemoComponent(
  7089. current,
  7090. workInProgress,
  7091. workInProgress.type,
  7092. workInProgress.pendingProps,
  7093. updateExpirationTime,
  7094. renderExpirationTime
  7095. );
  7096. case 17:
  7097. return (
  7098. (updateExpirationTime = workInProgress.type),
  7099. (context = workInProgress.pendingProps),
  7100. (context =
  7101. workInProgress.elementType === updateExpirationTime
  7102. ? context
  7103. : resolveDefaultProps(updateExpirationTime, context)),
  7104. null !== current &&
  7105. ((current.alternate = null),
  7106. (workInProgress.alternate = null),
  7107. (workInProgress.effectTag |= 2)),
  7108. (workInProgress.tag = 1),
  7109. isContextProvider(updateExpirationTime)
  7110. ? ((current = !0), pushContextProvider(workInProgress))
  7111. : (current = !1),
  7112. prepareToReadContext(workInProgress, renderExpirationTime),
  7113. constructClassInstance(workInProgress, updateExpirationTime, context),
  7114. mountClassInstance(
  7115. workInProgress,
  7116. updateExpirationTime,
  7117. context,
  7118. renderExpirationTime
  7119. ),
  7120. finishClassComponent(
  7121. null,
  7122. workInProgress,
  7123. updateExpirationTime,
  7124. !0,
  7125. current,
  7126. renderExpirationTime
  7127. )
  7128. );
  7129. case 19:
  7130. return updateSuspenseListComponent(
  7131. current,
  7132. workInProgress,
  7133. renderExpirationTime
  7134. );
  7135. }
  7136. throw Error(
  7137. "Unknown unit of work tag (" +
  7138. workInProgress.tag +
  7139. "). This error is likely caused by a bug in React. Please file an issue."
  7140. );
  7141. };
  7142. function scheduleInteractions(root, expirationTime, interactions) {
  7143. if (0 < interactions.size) {
  7144. var pendingInteractionMap = root.pendingInteractionMap,
  7145. pendingInteractions = pendingInteractionMap.get(expirationTime);
  7146. null != pendingInteractions
  7147. ? interactions.forEach(function(interaction) {
  7148. pendingInteractions.has(interaction) || interaction.__count++;
  7149. pendingInteractions.add(interaction);
  7150. })
  7151. : (pendingInteractionMap.set(expirationTime, new Set(interactions)),
  7152. interactions.forEach(function(interaction) {
  7153. interaction.__count++;
  7154. }));
  7155. pendingInteractionMap = tracing.__subscriberRef.current;
  7156. if (null !== pendingInteractionMap)
  7157. pendingInteractionMap.onWorkScheduled(
  7158. interactions,
  7159. 1e3 * expirationTime + root.interactionThreadID
  7160. );
  7161. }
  7162. }
  7163. function schedulePendingInteractions(root, expirationTime) {
  7164. scheduleInteractions(root, expirationTime, tracing.__interactionsRef.current);
  7165. }
  7166. function startWorkOnPendingInteractions(root, expirationTime) {
  7167. var interactions = new Set();
  7168. root.pendingInteractionMap.forEach(function(
  7169. scheduledInteractions,
  7170. scheduledExpirationTime
  7171. ) {
  7172. scheduledExpirationTime >= expirationTime &&
  7173. scheduledInteractions.forEach(function(interaction) {
  7174. return interactions.add(interaction);
  7175. });
  7176. });
  7177. root.memoizedInteractions = interactions;
  7178. if (0 < interactions.size) {
  7179. var subscriber = tracing.__subscriberRef.current;
  7180. if (null !== subscriber) {
  7181. root = 1e3 * expirationTime + root.interactionThreadID;
  7182. try {
  7183. subscriber.onWorkStarted(interactions, root);
  7184. } catch (error) {
  7185. scheduleCallback(99, function() {
  7186. throw error;
  7187. });
  7188. }
  7189. }
  7190. }
  7191. }
  7192. function finishPendingInteractions(root, committedExpirationTime) {
  7193. var earliestRemainingTimeAfterCommit = root.firstPendingTime;
  7194. try {
  7195. var subscriber = tracing.__subscriberRef.current;
  7196. if (null !== subscriber && 0 < root.memoizedInteractions.size)
  7197. subscriber.onWorkStopped(
  7198. root.memoizedInteractions,
  7199. 1e3 * committedExpirationTime + root.interactionThreadID
  7200. );
  7201. } catch (error) {
  7202. scheduleCallback(99, function() {
  7203. throw error;
  7204. });
  7205. } finally {
  7206. var pendingInteractionMap = root.pendingInteractionMap;
  7207. pendingInteractionMap.forEach(function(
  7208. scheduledInteractions,
  7209. scheduledExpirationTime
  7210. ) {
  7211. scheduledExpirationTime > earliestRemainingTimeAfterCommit &&
  7212. (pendingInteractionMap.delete(scheduledExpirationTime),
  7213. scheduledInteractions.forEach(function(interaction) {
  7214. interaction.__count--;
  7215. if (null !== subscriber && 0 === interaction.__count)
  7216. try {
  7217. subscriber.onInteractionScheduledWorkCompleted(interaction);
  7218. } catch (error) {
  7219. scheduleCallback(99, function() {
  7220. throw error;
  7221. });
  7222. }
  7223. }));
  7224. });
  7225. }
  7226. }
  7227. var onCommitFiberRoot = null,
  7228. onCommitFiberUnmount = null,
  7229. isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__;
  7230. function injectInternals(internals) {
  7231. if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1;
  7232. var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  7233. if (hook.isDisabled || !hook.supportsFiber) return !0;
  7234. try {
  7235. var rendererID = hook.inject(internals);
  7236. onCommitFiberRoot = function(root, expirationTime) {
  7237. try {
  7238. var didError = 64 === (root.current.effectTag & 64),
  7239. currentTime = 1073741821 - ((now() / 10) | 0),
  7240. priorityLevel = inferPriorityFromExpirationTime(
  7241. currentTime,
  7242. expirationTime
  7243. );
  7244. hook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);
  7245. } catch (err) {}
  7246. };
  7247. onCommitFiberUnmount = function(fiber) {
  7248. try {
  7249. hook.onCommitFiberUnmount(rendererID, fiber);
  7250. } catch (err) {}
  7251. };
  7252. } catch (err) {}
  7253. return !0;
  7254. }
  7255. function FiberNode(tag, pendingProps, key, mode) {
  7256. this.tag = tag;
  7257. this.key = key;
  7258. this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
  7259. this.index = 0;
  7260. this.ref = null;
  7261. this.pendingProps = pendingProps;
  7262. this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
  7263. this.mode = mode;
  7264. this.effectTag = 0;
  7265. this.lastEffect = this.firstEffect = this.nextEffect = null;
  7266. this.childExpirationTime = this.expirationTime = 0;
  7267. this.alternate = null;
  7268. this.actualDuration = 0;
  7269. this.actualStartTime = -1;
  7270. this.treeBaseDuration = this.selfBaseDuration = 0;
  7271. }
  7272. function shouldConstruct(Component) {
  7273. Component = Component.prototype;
  7274. return !(!Component || !Component.isReactComponent);
  7275. }
  7276. function resolveLazyComponentTag(Component) {
  7277. if ("function" === typeof Component)
  7278. return shouldConstruct(Component) ? 1 : 0;
  7279. if (void 0 !== Component && null !== Component) {
  7280. Component = Component.$$typeof;
  7281. if (Component === REACT_FORWARD_REF_TYPE) return 11;
  7282. if (Component === REACT_MEMO_TYPE) return 14;
  7283. }
  7284. return 2;
  7285. }
  7286. function createWorkInProgress(current, pendingProps) {
  7287. var workInProgress = current.alternate;
  7288. null === workInProgress
  7289. ? ((workInProgress = new FiberNode(
  7290. current.tag,
  7291. pendingProps,
  7292. current.key,
  7293. current.mode
  7294. )),
  7295. (workInProgress.elementType = current.elementType),
  7296. (workInProgress.type = current.type),
  7297. (workInProgress.stateNode = current.stateNode),
  7298. (workInProgress.alternate = current),
  7299. (current.alternate = workInProgress))
  7300. : ((workInProgress.pendingProps = pendingProps),
  7301. (workInProgress.effectTag = 0),
  7302. (workInProgress.nextEffect = null),
  7303. (workInProgress.firstEffect = null),
  7304. (workInProgress.lastEffect = null),
  7305. (workInProgress.actualDuration = 0),
  7306. (workInProgress.actualStartTime = -1));
  7307. workInProgress.childExpirationTime = current.childExpirationTime;
  7308. workInProgress.expirationTime = current.expirationTime;
  7309. workInProgress.child = current.child;
  7310. workInProgress.memoizedProps = current.memoizedProps;
  7311. workInProgress.memoizedState = current.memoizedState;
  7312. workInProgress.updateQueue = current.updateQueue;
  7313. pendingProps = current.dependencies;
  7314. workInProgress.dependencies =
  7315. null === pendingProps
  7316. ? null
  7317. : {
  7318. expirationTime: pendingProps.expirationTime,
  7319. firstContext: pendingProps.firstContext,
  7320. responders: pendingProps.responders
  7321. };
  7322. workInProgress.sibling = current.sibling;
  7323. workInProgress.index = current.index;
  7324. workInProgress.ref = current.ref;
  7325. workInProgress.selfBaseDuration = current.selfBaseDuration;
  7326. workInProgress.treeBaseDuration = current.treeBaseDuration;
  7327. return workInProgress;
  7328. }
  7329. function createFiberFromTypeAndProps(
  7330. type,
  7331. key,
  7332. pendingProps,
  7333. owner,
  7334. mode,
  7335. expirationTime
  7336. ) {
  7337. var fiberTag = 2;
  7338. owner = type;
  7339. if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1);
  7340. else if ("string" === typeof type) fiberTag = 5;
  7341. else
  7342. a: switch (type) {
  7343. case REACT_FRAGMENT_TYPE:
  7344. return createFiberFromFragment(
  7345. pendingProps.children,
  7346. mode,
  7347. expirationTime,
  7348. key
  7349. );
  7350. case REACT_CONCURRENT_MODE_TYPE:
  7351. fiberTag = 8;
  7352. mode |= 7;
  7353. break;
  7354. case REACT_STRICT_MODE_TYPE:
  7355. fiberTag = 8;
  7356. mode |= 1;
  7357. break;
  7358. case REACT_PROFILER_TYPE:
  7359. return (
  7360. (type = new FiberNode(12, pendingProps, key, mode | 8)),
  7361. (type.elementType = REACT_PROFILER_TYPE),
  7362. (type.type = REACT_PROFILER_TYPE),
  7363. (type.expirationTime = expirationTime),
  7364. (type.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }),
  7365. type
  7366. );
  7367. case REACT_SUSPENSE_TYPE:
  7368. return (
  7369. (type = new FiberNode(13, pendingProps, key, mode)),
  7370. (type.type = REACT_SUSPENSE_TYPE),
  7371. (type.elementType = REACT_SUSPENSE_TYPE),
  7372. (type.expirationTime = expirationTime),
  7373. type
  7374. );
  7375. case REACT_SUSPENSE_LIST_TYPE:
  7376. return (
  7377. (type = new FiberNode(19, pendingProps, key, mode)),
  7378. (type.elementType = REACT_SUSPENSE_LIST_TYPE),
  7379. (type.expirationTime = expirationTime),
  7380. type
  7381. );
  7382. default:
  7383. if ("object" === typeof type && null !== type)
  7384. switch (type.$$typeof) {
  7385. case REACT_PROVIDER_TYPE:
  7386. fiberTag = 10;
  7387. break a;
  7388. case REACT_CONTEXT_TYPE:
  7389. fiberTag = 9;
  7390. break a;
  7391. case REACT_FORWARD_REF_TYPE:
  7392. fiberTag = 11;
  7393. break a;
  7394. case REACT_MEMO_TYPE:
  7395. fiberTag = 14;
  7396. break a;
  7397. case REACT_LAZY_TYPE:
  7398. fiberTag = 16;
  7399. owner = null;
  7400. break a;
  7401. case REACT_BLOCK_TYPE:
  7402. fiberTag = 22;
  7403. break a;
  7404. }
  7405. throw Error(
  7406. "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " +
  7407. (null == type ? type : typeof type) +
  7408. "."
  7409. );
  7410. }
  7411. key = new FiberNode(fiberTag, pendingProps, key, mode);
  7412. key.elementType = type;
  7413. key.type = owner;
  7414. key.expirationTime = expirationTime;
  7415. return key;
  7416. }
  7417. function createFiberFromFragment(elements, mode, expirationTime, key) {
  7418. elements = new FiberNode(7, elements, key, mode);
  7419. elements.expirationTime = expirationTime;
  7420. return elements;
  7421. }
  7422. function createFiberFromText(content, mode, expirationTime) {
  7423. content = new FiberNode(6, content, null, mode);
  7424. content.expirationTime = expirationTime;
  7425. return content;
  7426. }
  7427. function createFiberFromPortal(portal, mode, expirationTime) {
  7428. mode = new FiberNode(
  7429. 4,
  7430. null !== portal.children ? portal.children : [],
  7431. portal.key,
  7432. mode
  7433. );
  7434. mode.expirationTime = expirationTime;
  7435. mode.stateNode = {
  7436. containerInfo: portal.containerInfo,
  7437. pendingChildren: null,
  7438. implementation: portal.implementation
  7439. };
  7440. return mode;
  7441. }
  7442. function FiberRootNode(containerInfo, tag, hydrate) {
  7443. this.tag = tag;
  7444. this.current = null;
  7445. this.containerInfo = containerInfo;
  7446. this.pingCache = this.pendingChildren = null;
  7447. this.finishedExpirationTime = 0;
  7448. this.finishedWork = null;
  7449. this.timeoutHandle = -1;
  7450. this.pendingContext = this.context = null;
  7451. this.hydrate = hydrate;
  7452. this.callbackNode = null;
  7453. this.callbackPriority = 90;
  7454. this.lastExpiredTime = this.lastPingedTime = this.nextKnownPendingLevel = this.lastSuspendedTime = this.firstSuspendedTime = this.firstPendingTime = 0;
  7455. this.interactionThreadID = tracing.unstable_getThreadID();
  7456. this.memoizedInteractions = new Set();
  7457. this.pendingInteractionMap = new Map();
  7458. }
  7459. function isRootSuspendedAtTime(root, expirationTime) {
  7460. var firstSuspendedTime = root.firstSuspendedTime;
  7461. root = root.lastSuspendedTime;
  7462. return (
  7463. 0 !== firstSuspendedTime &&
  7464. firstSuspendedTime >= expirationTime &&
  7465. root <= expirationTime
  7466. );
  7467. }
  7468. function markRootSuspendedAtTime(root, expirationTime) {
  7469. var firstSuspendedTime = root.firstSuspendedTime,
  7470. lastSuspendedTime = root.lastSuspendedTime;
  7471. firstSuspendedTime < expirationTime &&
  7472. (root.firstSuspendedTime = expirationTime);
  7473. if (lastSuspendedTime > expirationTime || 0 === firstSuspendedTime)
  7474. root.lastSuspendedTime = expirationTime;
  7475. expirationTime <= root.lastPingedTime && (root.lastPingedTime = 0);
  7476. expirationTime <= root.lastExpiredTime && (root.lastExpiredTime = 0);
  7477. }
  7478. function markRootUpdatedAtTime(root, expirationTime) {
  7479. expirationTime > root.firstPendingTime &&
  7480. (root.firstPendingTime = expirationTime);
  7481. var firstSuspendedTime = root.firstSuspendedTime;
  7482. 0 !== firstSuspendedTime &&
  7483. (expirationTime >= firstSuspendedTime
  7484. ? (root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = 0)
  7485. : expirationTime >= root.lastSuspendedTime &&
  7486. (root.lastSuspendedTime = expirationTime + 1),
  7487. expirationTime > root.nextKnownPendingLevel &&
  7488. (root.nextKnownPendingLevel = expirationTime));
  7489. }
  7490. function findHostInstance(component) {
  7491. var fiber = component._reactInternalFiber;
  7492. if (void 0 === fiber) {
  7493. if ("function" === typeof component.render)
  7494. throw Error("Unable to find node on an unmounted component.");
  7495. throw Error(
  7496. "Argument appears to not be a ReactComponent. Keys: " +
  7497. Object.keys(component)
  7498. );
  7499. }
  7500. component = findCurrentHostFiber(fiber);
  7501. return null === component ? null : component.stateNode;
  7502. }
  7503. function updateContainer(element, container, parentComponent, callback) {
  7504. var current = container.current,
  7505. currentTime = requestCurrentTimeForUpdate(),
  7506. suspenseConfig = ReactCurrentBatchConfig.suspense;
  7507. currentTime = computeExpirationForFiber(currentTime, current, suspenseConfig);
  7508. a: if (parentComponent) {
  7509. parentComponent = parentComponent._reactInternalFiber;
  7510. b: {
  7511. if (
  7512. getNearestMountedFiber(parentComponent) !== parentComponent ||
  7513. 1 !== parentComponent.tag
  7514. )
  7515. throw Error(
  7516. "Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue."
  7517. );
  7518. var parentContext = parentComponent;
  7519. do {
  7520. switch (parentContext.tag) {
  7521. case 3:
  7522. parentContext = parentContext.stateNode.context;
  7523. break b;
  7524. case 1:
  7525. if (isContextProvider(parentContext.type)) {
  7526. parentContext =
  7527. parentContext.stateNode
  7528. .__reactInternalMemoizedMergedChildContext;
  7529. break b;
  7530. }
  7531. }
  7532. parentContext = parentContext.return;
  7533. } while (null !== parentContext);
  7534. throw Error(
  7535. "Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue."
  7536. );
  7537. }
  7538. if (1 === parentComponent.tag) {
  7539. var Component = parentComponent.type;
  7540. if (isContextProvider(Component)) {
  7541. parentComponent = processChildContext(
  7542. parentComponent,
  7543. Component,
  7544. parentContext
  7545. );
  7546. break a;
  7547. }
  7548. }
  7549. parentComponent = parentContext;
  7550. } else parentComponent = emptyContextObject;
  7551. null === container.context
  7552. ? (container.context = parentComponent)
  7553. : (container.pendingContext = parentComponent);
  7554. container = createUpdate(currentTime, suspenseConfig);
  7555. container.payload = { element: element };
  7556. callback = void 0 === callback ? null : callback;
  7557. null !== callback && (container.callback = callback);
  7558. enqueueUpdate(current, container);
  7559. scheduleWork(current, currentTime);
  7560. return currentTime;
  7561. }
  7562. function createPortal(children, containerInfo, implementation) {
  7563. var key =
  7564. 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
  7565. return {
  7566. $$typeof: REACT_PORTAL_TYPE,
  7567. key: null == key ? null : "" + key,
  7568. children: children,
  7569. containerInfo: containerInfo,
  7570. implementation: implementation
  7571. };
  7572. }
  7573. function findNodeHandle(componentOrHandle) {
  7574. if (null == componentOrHandle) return null;
  7575. if ("number" === typeof componentOrHandle) return componentOrHandle;
  7576. if (componentOrHandle._nativeTag) return componentOrHandle._nativeTag;
  7577. if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag)
  7578. return componentOrHandle.canonical._nativeTag;
  7579. componentOrHandle = findHostInstance(componentOrHandle);
  7580. return null == componentOrHandle
  7581. ? componentOrHandle
  7582. : componentOrHandle.canonical
  7583. ? componentOrHandle.canonical._nativeTag
  7584. : componentOrHandle._nativeTag;
  7585. }
  7586. batchedUpdatesImpl = function(fn, a) {
  7587. var prevExecutionContext = executionContext;
  7588. executionContext |= 1;
  7589. try {
  7590. return fn(a);
  7591. } finally {
  7592. (executionContext = prevExecutionContext),
  7593. executionContext === NoContext && flushSyncCallbackQueue();
  7594. }
  7595. };
  7596. var roots = new Map();
  7597. (function(devToolsConfig) {
  7598. var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
  7599. return injectInternals({
  7600. bundleType: devToolsConfig.bundleType,
  7601. version: devToolsConfig.version,
  7602. rendererPackageName: devToolsConfig.rendererPackageName,
  7603. rendererConfig: devToolsConfig.rendererConfig,
  7604. overrideHookState: null,
  7605. overrideProps: null,
  7606. setSuspenseHandler: null,
  7607. scheduleUpdate: null,
  7608. currentDispatcherRef: ReactSharedInternals.ReactCurrentDispatcher,
  7609. findHostInstanceByFiber: function(fiber) {
  7610. fiber = findCurrentHostFiber(fiber);
  7611. return null === fiber ? null : fiber.stateNode;
  7612. },
  7613. findFiberByHostInstance: function(instance) {
  7614. return findFiberByHostInstance ? findFiberByHostInstance(instance) : null;
  7615. },
  7616. findHostInstancesForRefresh: null,
  7617. scheduleRefresh: null,
  7618. scheduleRoot: null,
  7619. setRefreshHandler: null,
  7620. getCurrentFiber: null
  7621. });
  7622. })({
  7623. findFiberByHostInstance: getInstanceFromInstance,
  7624. bundleType: 0,
  7625. version: "16.13.0",
  7626. rendererPackageName: "react-native-renderer",
  7627. rendererConfig: {
  7628. getInspectorDataForViewTag: function() {
  7629. throw Error(
  7630. "getInspectorDataForViewTag() is not available in production"
  7631. );
  7632. },
  7633. getInspectorDataForViewAtPoint: function() {
  7634. throw Error(
  7635. "getInspectorDataForViewAtPoint() is not available in production."
  7636. );
  7637. }.bind(null, findNodeHandle)
  7638. }
  7639. });
  7640. exports.createPortal = function(children, containerTag) {
  7641. return createPortal(
  7642. children,
  7643. containerTag,
  7644. null,
  7645. 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null
  7646. );
  7647. };
  7648. exports.dispatchCommand = function(handle, command, args) {
  7649. null != handle._nativeTag &&
  7650. (handle._internalInstanceHandle
  7651. ? nativeFabricUIManager.dispatchCommand(
  7652. handle._internalInstanceHandle.stateNode.node,
  7653. command,
  7654. args
  7655. )
  7656. : ReactNativePrivateInterface.UIManager.dispatchViewManagerCommand(
  7657. handle._nativeTag,
  7658. command,
  7659. args
  7660. ));
  7661. };
  7662. exports.findHostInstance_DEPRECATED = function(componentOrHandle) {
  7663. if (null == componentOrHandle) return null;
  7664. if (componentOrHandle._nativeTag) return componentOrHandle;
  7665. if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag)
  7666. return componentOrHandle.canonical;
  7667. componentOrHandle = findHostInstance(componentOrHandle);
  7668. return null == componentOrHandle
  7669. ? componentOrHandle
  7670. : componentOrHandle.canonical
  7671. ? componentOrHandle.canonical
  7672. : componentOrHandle;
  7673. };
  7674. exports.findNodeHandle = findNodeHandle;
  7675. exports.render = function(element, containerTag, callback) {
  7676. var root = roots.get(containerTag);
  7677. if (!root) {
  7678. root = new FiberRootNode(containerTag, 0, !1);
  7679. var uninitializedFiber = 0;
  7680. isDevToolsPresent && (uninitializedFiber |= 8);
  7681. uninitializedFiber = new FiberNode(3, null, null, uninitializedFiber);
  7682. root.current = uninitializedFiber;
  7683. uninitializedFiber.stateNode = root;
  7684. initializeUpdateQueue(uninitializedFiber);
  7685. roots.set(containerTag, root);
  7686. }
  7687. updateContainer(element, root, null, callback);
  7688. a: if (((element = root.current), element.child))
  7689. switch (element.child.tag) {
  7690. case 5:
  7691. element = element.child.stateNode.canonical;
  7692. break a;
  7693. default:
  7694. element = element.child.stateNode;
  7695. }
  7696. else element = null;
  7697. return element;
  7698. };
  7699. exports.stopSurface = function(containerTag) {
  7700. var root = roots.get(containerTag);
  7701. root &&
  7702. updateContainer(null, root, null, function() {
  7703. roots.delete(containerTag);
  7704. });
  7705. };
  7706. exports.unmountComponentAtNode = function(containerTag) {
  7707. this.stopSurface(containerTag);
  7708. };