ReactFabric-profiling.fb.js 264 KB

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