ReactFabric-prod.fb.js 253 KB

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