ReactNativeRenderer-prod.fb.js 261 KB

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