babylon.guiEditor.max.js 1.6 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("babylonjs-gui"), require("babylonjs"));
  4. else if(typeof define === 'function' && define.amd)
  5. define("babylonjs-gui-editor", ["babylonjs-gui", "babylonjs"], factory);
  6. else if(typeof exports === 'object')
  7. exports["babylonjs-gui-editor"] = factory(require("babylonjs-gui"), require("babylonjs"));
  8. else
  9. root["GUIEDITOR"] = factory(root["BABYLON"]["GUI"], root["BABYLON"]);
  10. })((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_gui_2D_controls_button__, __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_observable__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = "./legacy/legacy.ts");
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./components/guiList/guiList.scss":
  99. /*!**********************************************************************************************************************************************************!*\
  100. !*** C:/Repos/Babylon.js/node_modules/css-loader/dist/cjs.js!C:/Repos/Babylon.js/node_modules/sass-loader/dist/cjs.js!./components/guiList/guiList.scss ***!
  101. \**********************************************************************************************************************************************************/
  102. /*! no static exports found */
  103. /***/ (function(module, exports, __webpack_require__) {
  104. // Imports
  105. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  106. exports = ___CSS_LOADER_API_IMPORT___(false);
  107. // Module
  108. exports.push([module.i, "#guiList {\n background: #333333;\n height: 100%;\n margin: 0;\n padding: 0;\n display: grid;\n width: 100%;\n overflow: hidden; }\n #guiList .panes {\n overflow: hidden; }\n #guiList .panes .pane {\n color: white;\n overflow: hidden;\n height: 100%;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n #guiList .panes .pane .filter {\n display: flex;\n align-items: stretch; }\n #guiList .panes .pane .filter input {\n width: 100%;\n margin: 10px 10px 5px 10px;\n display: block;\n border: none;\n padding: 0;\n border-bottom: solid 1px #337ab7;\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, #337ab7 4%);\n background-position: -1000px 0;\n background-size: 1000px 100%;\n background-repeat: no-repeat;\n color: white; }\n #guiList .panes .pane .filter input:focus {\n box-shadow: none;\n outline: none;\n background-position: 0 0; }\n #guiList .panes .pane .filter input::placeholder {\n color: gray; }\n #guiList .panes .pane .list-container {\n overflow-x: hidden;\n overflow-y: auto;\n height: calc(100% - 32px); }\n #guiList .panes .pane .list-container .underline {\n border-bottom: 0.5px solid rgba(255, 255, 255, 0.5); }\n #guiList .panes .pane .list-container .draggableLine {\n height: 30px;\n display: grid;\n align-items: center;\n justify-items: stretch;\n background: #222222;\n cursor: grab;\n text-align: center;\n margin: 0;\n box-sizing: border-box; }\n #guiList .panes .pane .list-container .draggableLine:hover {\n background: #337ab7;\n color: white; }\n #guiList .panes .pane .list-container .nonDraggableLine {\n height: 30px;\n display: grid;\n align-items: center;\n justify-items: stretch;\n background: #222222;\n text-align: center;\n margin: 0;\n box-sizing: border-box; }\n #guiList .panes .pane .list-container .withButton {\n height: 30px;\n position: relative; }\n #guiList .panes .pane .list-container .withButton .icon {\n position: absolute;\n right: 4px;\n top: 5px; }\n #guiList .panes .pane .list-container .withButton .icon:hover {\n cursor: pointer; }\n #guiList .panes .pane .list-container .withButton .icon .img {\n height: 17px;\n width: 17px; }\n #guiList .panes .pane .list-container .withButton .buttonLine {\n height: 30px;\n display: grid;\n align-items: center;\n justify-items: stretch;\n padding-bottom: 5px;\n position: absolute;\n right: 0px;\n top: 2px; }\n #guiList .panes .pane .list-container .withButton .buttonLine input[type=\"file\"] {\n display: none; }\n #guiList .panes .pane .list-container .withButton .buttonLine .file-upload {\n background: transparent;\n border: transparent;\n padding: 15px 200px;\n opacity: 0.9;\n cursor: pointer;\n text-align: center; }\n #guiList .panes .pane .list-container .withButton .buttonLine .file-upload:hover {\n opacity: 1.0; }\n #guiList .panes .pane .list-container .withButton .buttonLine .file-upload:active {\n transform: scale(0.98);\n transform-origin: 0.5 0.5; }\n #guiList .panes .pane .list-container .withButton .buttonLine button {\n background: transparent;\n border: transparent;\n margin: 5px 10px 5px 10px;\n color: white;\n padding: 4px 5px;\n opacity: 0.9; }\n #guiList .panes .pane .list-container .withButton .buttonLine button:hover {\n opacity: 0.0; }\n #guiList .panes .pane .list-container .withButton .buttonLine button:active {\n background: transparent; }\n #guiList .panes .pane .list-container .withButton .buttonLine button:focus {\n border: transparent;\n outline: 0px; }\n #guiList .panes .pane .list-container .paneContainer {\n margin-top: 3px;\n display: grid;\n grid-template-rows: 100%;\n grid-template-columns: 100%; }\n #guiList .panes .pane .list-container .paneContainer .paneContainer-content {\n grid-row: 1;\n grid-column: 1; }\n #guiList .panes .pane .list-container .paneContainer .paneContainer-content .header {\n display: grid;\n grid-template-columns: 1fr auto;\n background: #555555;\n height: 30px;\n padding-right: 5px;\n cursor: pointer; }\n #guiList .panes .pane .list-container .paneContainer .paneContainer-content .header .title {\n border-left: 3px solid transparent;\n padding-left: 5px;\n grid-column: 1;\n display: flex;\n align-items: center; }\n #guiList .panes .pane .list-container .paneContainer .paneContainer-content .header .collapse {\n grid-column: 2;\n display: flex;\n align-items: center;\n justify-items: center;\n transform-origin: center; }\n #guiList .panes .pane .list-container .paneContainer .paneContainer-content .header .collapse.closed {\n transform: rotate(180deg); }\n #guiList .panes .pane .list-container .paneContainer .paneContainer-content .paneList > div:not(:last-child) {\n border-bottom: 1px solid rgba(255, 255, 255, 0.3); }\n", ""]);
  109. // Exports
  110. module.exports = exports;
  111. /***/ }),
  112. /***/ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./components/log/log.scss":
  113. /*!**************************************************************************************************************************************************!*\
  114. !*** C:/Repos/Babylon.js/node_modules/css-loader/dist/cjs.js!C:/Repos/Babylon.js/node_modules/sass-loader/dist/cjs.js!./components/log/log.scss ***!
  115. \**************************************************************************************************************************************************/
  116. /*! no static exports found */
  117. /***/ (function(module, exports, __webpack_require__) {
  118. // Imports
  119. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  120. exports = ___CSS_LOADER_API_IMPORT___(false);
  121. // Module
  122. exports.push([module.i, "#log-console {\n background: #333333;\n height: 120px;\n box-sizing: border-box;\n margin: 0;\n padding: 10px;\n width: 100%;\n overflow: hidden;\n overflow-y: auto; }\n #log-console .log {\n color: white;\n font-size: 14px;\n font-family: 'Courier New', Courier, monospace; }\n #log-console .log.error {\n color: red; }\n", ""]);
  123. // Exports
  124. module.exports = exports;
  125. /***/ }),
  126. /***/ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./components/propertyTab/propertyTab.scss":
  127. /*!******************************************************************************************************************************************************************!*\
  128. !*** C:/Repos/Babylon.js/node_modules/css-loader/dist/cjs.js!C:/Repos/Babylon.js/node_modules/sass-loader/dist/cjs.js!./components/propertyTab/propertyTab.scss ***!
  129. \******************************************************************************************************************************************************************/
  130. /*! no static exports found */
  131. /***/ (function(module, exports, __webpack_require__) {
  132. // Imports
  133. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  134. exports = ___CSS_LOADER_API_IMPORT___(false);
  135. // Module
  136. exports.push([module.i, "#propertyTab {\n color: white;\n background: #333333; }\n #propertyTab #header {\n height: 30px;\n font-size: 16px;\n color: white;\n background: #222222;\n grid-row: 1;\n text-align: center;\n display: grid;\n grid-template-columns: 30px 1fr;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n #propertyTab #header #logo {\n position: relative;\n grid-column: 1;\n width: 24px;\n height: 24px;\n left: 0;\n display: flex;\n align-self: center;\n justify-self: center; }\n #propertyTab #header #title {\n grid-column: 2;\n display: grid;\n align-items: center;\n text-align: center; }\n #propertyTab .range {\n -webkit-appearance: none;\n width: 120px;\n height: 6px;\n background: #d3d3d3;\n border-radius: 5px;\n outline: none;\n opacity: 0.7;\n -webkit-transition: .2s;\n transition: opacity .2s; }\n #propertyTab .range:hover {\n opacity: 1; }\n #propertyTab .range::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background: #337ab7;\n cursor: pointer; }\n #propertyTab .range::-moz-range-thumb {\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background: #337ab7;\n cursor: pointer; }\n #propertyTab input[type=\"color\"] {\n -webkit-appearance: none;\n border: 1px solid rgba(255, 255, 255, 0.5);\n padding: 0;\n width: 30px;\n height: 20px; }\n #propertyTab input[type=\"color\"]::-webkit-color-swatch-wrapper {\n padding: 0; }\n #propertyTab input[type=\"color\"]::-webkit-color-swatch {\n border: none; }\n #propertyTab .sliderLine {\n padding-left: 5px;\n height: 30px;\n display: grid;\n grid-template-rows: 100%;\n grid-template-columns: 1fr 40px; }\n #propertyTab .sliderLine .label {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .sliderLine .slider {\n grid-column: 3;\n grid-row: 1;\n margin-right: 5px;\n width: 90%;\n display: flex;\n align-items: center; }\n #propertyTab .sliderLine .floatLine {\n padding-left: 5px; }\n #propertyTab .sliderLine .floatLine .label {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .sliderLine .floatLine .short {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .sliderLine .floatLine .short input {\n width: 27px; }\n #propertyTab .sliderLine .floatLine .short input::-webkit-outer-spin-button,\n #propertyTab .sliderLine .floatLine .short input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0; }\n #propertyTab .sliderLine .floatLine .short input[type=number] {\n -moz-appearance: textfield; }\n #propertyTab .textInputLine {\n padding-left: 5px;\n height: 30px;\n display: grid;\n grid-template-columns: 1fr 120px auto; }\n #propertyTab .textInputLine .label {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .textInputLine .value {\n display: flex;\n align-items: center;\n grid-column: 2; }\n #propertyTab .textInputLine .value input {\n width: calc(100% - 5px); }\n #propertyTab .textInputArea {\n padding-left: 5px;\n height: 100%;\n display: grid;\n grid-template-columns: 1fr 120px; }\n #propertyTab .textInputArea .label {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .textInputArea .value {\n display: flex;\n align-items: center;\n grid-column: 2; }\n #propertyTab .textInputArea .value textarea {\n width: calc(150% - 5px);\n margin-left: -50%;\n height: 40px; }\n #propertyTab .paneContainer {\n margin-top: 3px;\n display: grid;\n grid-template-rows: 100%;\n grid-template-columns: 100%; }\n #propertyTab .paneContainer .paneList {\n border-left: 3px solid transparent; }\n #propertyTab .paneContainer:hover .paneList {\n border-left: 3px solid rgba(51, 122, 183, 0.8); }\n #propertyTab .paneContainer:hover .paneContainer-content .header .title {\n border-left: 3px solid #337ab7; }\n #propertyTab .paneContainer .paneContainer-highlight-border {\n grid-row: 1;\n grid-column: 1;\n opacity: 1;\n border: 3px solid red;\n transition: opacity 250ms;\n pointer-events: none; }\n #propertyTab .paneContainer .paneContainer-highlight-border.transparent {\n opacity: 0; }\n #propertyTab .paneContainer .paneContainer-content {\n grid-row: 1;\n grid-column: 1; }\n #propertyTab .paneContainer .paneContainer-content .header {\n display: grid;\n grid-template-columns: 1fr auto;\n background: #555555;\n height: 30px;\n padding-right: 5px;\n cursor: pointer; }\n #propertyTab .paneContainer .paneContainer-content .header .title {\n border-left: 3px solid transparent;\n padding-left: 5px;\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .paneContainer .paneContainer-content .header .collapse {\n grid-column: 2;\n display: flex;\n align-items: center;\n justify-items: center;\n transform-origin: center; }\n #propertyTab .paneContainer .paneContainer-content .header .collapse.closed {\n transform: rotate(180deg); }\n #propertyTab .paneContainer .paneContainer-content .paneList > div:not(:last-child) {\n border-bottom: 0.5px solid rgba(255, 255, 255, 0.1); }\n #propertyTab .paneContainer .paneContainer-content .fragment > div:not(:last-child) {\n border-bottom: 0.5px solid rgba(255, 255, 255, 0.1); }\n #propertyTab .color-picker {\n height: calc(100% - 8px);\n margin: 4px;\n width: calc(100% - 8px); }\n #propertyTab .color-picker .color-rect {\n height: calc(100% - 4px);\n border: 2px white solid;\n cursor: pointer;\n min-height: 18px; }\n #propertyTab .color-picker .color-picker-cover {\n position: fixed;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px; }\n #propertyTab .color-picker .color-picker-float {\n z-index: 2;\n position: absolute; }\n #propertyTab .gradient-step {\n display: grid;\n grid-template-rows: 100%;\n grid-template-columns: 20px 30px 40px auto 20px 30px;\n padding-top: 5px;\n padding-left: 5px;\n padding-bottom: 5px; }\n #propertyTab .gradient-step .step {\n grid-row: 1;\n grid-column: 1; }\n #propertyTab .gradient-step .color {\n grid-row: 1;\n grid-column: 2;\n cursor: pointer; }\n #propertyTab .gradient-step .step-value {\n margin-left: 5px;\n grid-row: 1;\n grid-column: 3;\n text-align: right;\n margin-right: 5px; }\n #propertyTab .gradient-step .step-slider {\n grid-row: 1;\n grid-column: 4;\n display: grid;\n justify-content: stretch;\n align-content: center;\n margin-right: -5px;\n padding-left: 12px; }\n #propertyTab .gradient-step .step-slider input {\n width: 90%; }\n #propertyTab .gradient-step .gradient-copy {\n grid-row: 1;\n grid-column: 5;\n display: grid;\n align-content: center;\n justify-content: center; }\n #propertyTab .gradient-step .gradient-copy .img {\n height: 20px;\n width: 20px; }\n #propertyTab .gradient-step .gradient-copy .img:hover {\n cursor: pointer; }\n #propertyTab .gradient-step .gradient-delete {\n grid-row: 1;\n grid-column: 6;\n display: grid;\n align-content: center;\n justify-content: center; }\n #propertyTab .gradient-step .gradient-delete .img {\n height: 20px;\n width: 20px; }\n #propertyTab .gradient-step .gradient-delete .img:hover {\n cursor: pointer; }\n #propertyTab .floatLine {\n padding-left: 5px;\n height: 30px;\n display: grid;\n grid-template-columns: 1fr 120px; }\n #propertyTab .floatLine .label {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .floatLine .value {\n grid-column: 2;\n display: flex;\n align-items: center; }\n #propertyTab .floatLine .value input {\n width: 110px; }\n #propertyTab .floatLine .short {\n grid-column: 2;\n display: flex;\n align-items: center; }\n #propertyTab .floatLine .short input {\n width: 27px; }\n #propertyTab .floatLine .short input::-webkit-outer-spin-button,\n #propertyTab .floatLine .short input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0; }\n #propertyTab .floatLine .short input[type=number] {\n -moz-appearance: textfield; }\n #propertyTab .vector3Line {\n padding-left: 5px;\n display: grid; }\n #propertyTab .vector3Line .firstLine {\n display: grid;\n grid-template-columns: 1fr auto 20px;\n height: 30px; }\n #propertyTab .vector3Line .firstLine .label {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .vector3Line .firstLine .vector {\n grid-column: 2;\n display: flex;\n align-items: center;\n text-align: right;\n opacity: 0.8; }\n #propertyTab .vector3Line .firstLine .expand {\n grid-column: 3;\n display: grid;\n align-items: center;\n justify-items: center;\n cursor: pointer; }\n #propertyTab .vector3Line .secondLine {\n display: grid;\n padding-right: 5px;\n border-left: 1px solid #337ab7; }\n #propertyTab .vector3Line .secondLine .no-right-margin {\n margin-right: 0; }\n #propertyTab .vector3Line .secondLine .numeric {\n display: grid;\n grid-template-columns: 1fr auto; }\n #propertyTab .vector3Line .secondLine .numeric-label {\n text-align: right;\n grid-column: 1;\n display: flex;\n align-items: center;\n justify-self: right;\n margin-right: 10px; }\n #propertyTab .vector3Line .secondLine .numeric-value {\n width: 120px;\n grid-column: 2;\n display: flex;\n align-items: center;\n border: 1px solid #337ab7; }\n #propertyTab .buttonLine {\n height: 30px;\n display: grid;\n align-items: center;\n justify-items: stretch;\n padding-bottom: 5px; }\n #propertyTab .buttonLine input[type=\"file\"] {\n display: none; }\n #propertyTab .buttonLine .file-upload {\n background: #222222;\n border: 1px solid #337ab7;\n margin: 5px 10px;\n color: white;\n padding: 4px 5px;\n padding-top: 0px;\n opacity: 0.9;\n cursor: pointer;\n text-align: center; }\n #propertyTab .buttonLine .file-upload:hover {\n opacity: 1.0; }\n #propertyTab .buttonLine .file-upload:active {\n transform: scale(0.98);\n transform-origin: 0.5 0.5; }\n #propertyTab .buttonLine button {\n background: #222222;\n border: 1px solid #337ab7;\n margin: 5px 10px 5px 10px;\n color: white;\n padding: 4px 5px;\n opacity: 0.9; }\n #propertyTab .buttonLine button:hover {\n opacity: 1.0; }\n #propertyTab .buttonLine button:active {\n background: #282828; }\n #propertyTab .buttonLine button:focus {\n border: 1px solid #337ab7;\n outline: 0px; }\n #propertyTab .numeric {\n padding-left: 5px;\n height: 30px;\n display: grid;\n grid-template-columns: 1fr 120px auto; }\n #propertyTab .numeric .numeric-label {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .numeric .number {\n display: flex;\n align-items: center;\n grid-column: 2;\n height: 10px; }\n #propertyTab .numeric .number .input {\n width: calc(100% - 5px);\n height: 10px; }\n #propertyTab .checkBoxLine {\n padding-left: 5px;\n height: 30px;\n display: grid;\n grid-template-columns: 1fr auto; }\n #propertyTab .checkBoxLine .label {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .checkBoxLine .checkBox {\n grid-column: 2;\n display: flex;\n align-items: center; }\n #propertyTab .checkBoxLine .checkBox .lbl {\n position: relative;\n display: block;\n height: 14px;\n width: 34px;\n margin-right: 5px;\n background: #898989;\n border-radius: 100px;\n cursor: pointer;\n transition: all 0.3s ease; }\n #propertyTab .checkBoxLine .checkBox .lbl:after {\n position: absolute;\n left: 3px;\n top: 2px;\n display: block;\n width: 10px;\n height: 10px;\n border-radius: 100px;\n background: #fff;\n box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.05);\n content: '';\n transition: all 0.15s ease; }\n #propertyTab .checkBoxLine .checkBox .lbl:active:after {\n transform: scale(1.15, 0.85); }\n #propertyTab .checkBoxLine .checkBox .cbx:checked ~ label {\n background: #337ab7; }\n #propertyTab .checkBoxLine .checkBox .cbx:checked ~ label:after {\n left: 20px;\n background: #164975; }\n #propertyTab .checkBoxLine .checkBox .cbx:checked ~ label.disabled {\n background: #164975;\n cursor: pointer; }\n #propertyTab .checkBoxLine .checkBox .cbx:checked ~ label.disabled:after {\n left: 20px;\n background: #555555;\n cursor: pointer; }\n #propertyTab .checkBoxLine .checkBox .cbx ~ label.disabled {\n background: #555555;\n cursor: pointer; }\n #propertyTab .checkBoxLine .checkBox .hidden {\n display: none; }\n #propertyTab .listLine {\n padding-left: 5px;\n height: 30px;\n display: grid;\n grid-template-columns: 1fr auto; }\n #propertyTab .listLine .label {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .listLine .options {\n grid-column: 2;\n display: flex;\n align-items: center;\n margin-right: 5px; }\n #propertyTab .listLine .options select {\n width: 115px; }\n #propertyTab .color3Line {\n padding-left: 5px;\n display: grid; }\n #propertyTab .color3Line .firstLine {\n height: 30px;\n display: grid;\n grid-template-columns: 1fr auto 20px 20px; }\n #propertyTab .color3Line .firstLine .label {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .color3Line .firstLine .color3 {\n grid-column: 2;\n width: 50px;\n display: flex;\n align-items: center; }\n #propertyTab .color3Line .firstLine .color3 input {\n margin-right: 5px; }\n #propertyTab .color3Line .firstLine .copy {\n grid-column: 3;\n display: grid;\n align-items: center;\n justify-items: center;\n cursor: pointer; }\n #propertyTab .color3Line .firstLine .copy img {\n height: 100%;\n width: 20px; }\n #propertyTab .color3Line .firstLine .expand {\n grid-column: 4;\n display: grid;\n align-items: center;\n justify-items: center;\n cursor: pointer; }\n #propertyTab .color3Line .firstLine .expand img {\n height: 100%;\n width: 20px; }\n #propertyTab .color3Line .secondLine {\n display: grid;\n padding-right: 5px;\n border-left: 1px solid #337ab7; }\n #propertyTab .color3Line .secondLine .numeric {\n display: grid;\n grid-template-columns: 1fr auto; }\n #propertyTab .color3Line .secondLine .numeric-label {\n text-align: right;\n grid-column: 1;\n display: flex;\n align-items: center;\n justify-self: right;\n margin-right: 10px; }\n #propertyTab .color3Line .secondLine .numeric-value {\n width: 120px;\n grid-column: 2;\n display: flex;\n align-items: center;\n border: 1px solid #337ab7; }\n #propertyTab .textLine {\n padding-left: 5px;\n height: 30px;\n display: grid;\n grid-template-columns: 1fr auto; }\n #propertyTab .textLine .label {\n grid-column: 1;\n display: flex;\n align-items: center; }\n #propertyTab .textLine .link-value {\n grid-column: 2;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n text-align: end;\n opacity: 0.8;\n margin: 5px;\n margin-top: 6px;\n max-width: 140px;\n text-decoration: underline;\n cursor: pointer; }\n #propertyTab .textLine .value {\n grid-column: 2;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n text-align: end;\n opacity: 0.8;\n margin: 5px;\n margin-top: 6px;\n max-width: 200px;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text; }\n #propertyTab .textLine .value.check {\n color: green; }\n #propertyTab .textLine .value.uncheck {\n color: red; }\n", ""]);
  137. // Exports
  138. module.exports = exports;
  139. /***/ }),
  140. /***/ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./diagram/workbenchCanvas.scss":
  141. /*!*******************************************************************************************************************************************************!*\
  142. !*** C:/Repos/Babylon.js/node_modules/css-loader/dist/cjs.js!C:/Repos/Babylon.js/node_modules/sass-loader/dist/cjs.js!./diagram/workbenchCanvas.scss ***!
  143. \*******************************************************************************************************************************************************/
  144. /*! no static exports found */
  145. /***/ (function(module, exports, __webpack_require__) {
  146. // Imports
  147. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  148. exports = ___CSS_LOADER_API_IMPORT___(false);
  149. // Module
  150. exports.push([module.i, "#workbench-canvas {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n font: 14px \"acumin-pro\";\n user-select: none;\n overflow: hidden;\n cursor: move;\n background-image: linear-gradient(to right, #4F4E4F 1px, transparent 1px), linear-gradient(to bottom, #4F4E4F 1px, transparent 1px); }\n #workbench-canvas #selection-container {\n pointer-events: none; }\n #workbench-canvas #selection-container .selection-box {\n z-index: 10;\n position: absolute;\n background: rgba(72, 72, 196, 0.5);\n border: blue solid 2px; }\n #workbench-canvas #workbench-container {\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n transform-origin: left top;\n display: grid;\n grid-template-rows: 100%;\n grid-template-columns: 100%; }\n #workbench-canvas #workbench-container #frame-container {\n overflow: visible;\n grid-row: 1;\n grid-column: 1;\n position: relative;\n width: 100%;\n height: 100%; }\n #workbench-canvas #workbench-container .frame-box {\n position: absolute;\n background: rgba(72, 72, 72, 0.7);\n display: grid;\n grid-template-rows: 40px calc(100% - 40px);\n grid-template-columns: 100%;\n box-sizing: border-box; }\n #workbench-canvas #workbench-container .frame-box.collapsed {\n height: auto !important;\n width: 200px !important;\n z-index: 3; }\n #workbench-canvas #workbench-container .frame-box.collapsed .frame-box-header {\n font-size: 16px;\n grid-template-columns: calc(100% - 37px) 30px 7px; }\n #workbench-canvas #workbench-container .frame-box.collapsed .frame-box-header .frame-box-header-collapse {\n margin-top: -2px; }\n #workbench-canvas #workbench-container .frame-box.collapsed .frame-box-header .frame-box-header-close {\n display: none; }\n #workbench-canvas #workbench-container .frame-box.collapsed .frame-comments.has-comments .frame-comment-span {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden; }\n #workbench-canvas #workbench-container .frame-box .frame-box-border {\n grid-row: 1 / span 2;\n grid-column: 1;\n width: 100%;\n height: 100%;\n border: transparent solid 4px;\n pointer-events: none;\n box-sizing: border-box; }\n #workbench-canvas #workbench-container .frame-box .frame-box-header {\n grid-row: 1;\n grid-column: 1;\n background: #484848;\n color: white;\n font-size: 24px;\n text-align: center;\n display: grid;\n grid-template-rows: 100%;\n grid-template-columns: calc(100% - 74px) 30px 7px 30px 7px;\n align-content: center;\n overflow: hidden; }\n #workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-button {\n cursor: pointer;\n align-self: center;\n transform-origin: 50% 50%;\n transform: scale(1);\n stroke: transparent;\n fill: white;\n display: grid; }\n #workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-button.down {\n transform: scale(0.9); }\n #workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-collapse {\n grid-column: 2;\n grid-row: 1; }\n #workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-close {\n grid-column: 4;\n grid-row: 1; }\n #workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-title {\n grid-column: 1;\n grid-row: 1;\n display: grid;\n height: 100%;\n width: 100%;\n align-self: stretch;\n align-items: center;\n margin-top: -2px; }\n #workbench-canvas #workbench-container .frame-box .frame-comments.has-comments {\n display: grid;\n grid-row: 2;\n grid-column: 1;\n padding: 0 10px;\n font-style: italic;\n word-wrap: break-word; }\n #workbench-canvas #workbench-container .frame-box.selected .frame-box-border {\n border-color: white; }\n #workbench-canvas #workbench-container .frame-box .right-handle {\n grid-area: 1 / 2 / 3 / 2;\n width: 4px;\n background-color: transparent;\n cursor: ew-resize; }\n #workbench-canvas #workbench-container .frame-box .right-handle::after {\n content: \"\";\n width: 8px;\n position: absolute;\n top: 0;\n bottom: 0;\n margin-left: -4px;\n cursor: ew-resize; }\n #workbench-canvas #workbench-container .frame-box .right-handle.collapsed {\n cursor: pointer; }\n #workbench-canvas #workbench-container .frame-box .top-right-corner-handle {\n background-color: transparent;\n height: 4px;\n z-index: 21;\n cursor: ne-resize;\n width: 4px;\n margin-left: -6px; }\n #workbench-canvas #workbench-container .frame-box .top-right-corner-handle::after {\n background-color: transparent;\n cursor: ne-resize;\n margin-left: unset;\n top: -4px;\n height: 10px;\n width: 10px; }\n #workbench-canvas #workbench-container .frame-box .bottom-right-corner-handle {\n background-color: transparent;\n height: 0px;\n z-index: 21;\n cursor: nw-resize;\n grid-area: 4 / 2 / 4 / 2;\n margin-left: -2px; }\n #workbench-canvas #workbench-container .frame-box .bottom-right-corner-handle::after {\n background-color: transparent;\n height: 10px;\n cursor: nw-resize;\n top: unset;\n bottom: -4px;\n width: 10px; }\n #workbench-canvas #workbench-container .frame-box .left-handle {\n grid-area: 1 / 1 / 3 / 1;\n width: 4px;\n background-color: transparent;\n cursor: ew-resize; }\n #workbench-canvas #workbench-container .frame-box .left-handle::before {\n content: \"\";\n width: 8px;\n position: absolute;\n top: 0;\n bottom: 0;\n margin-left: -4px; }\n #workbench-canvas #workbench-container .frame-box .top-left-corner-handle {\n background-color: transparent;\n height: 4px;\n z-index: 21;\n cursor: nw-resize;\n width: 4px;\n margin-left: -4px; }\n #workbench-canvas #workbench-container .frame-box .top-left-corner-handle::before {\n background-color: transparent;\n cursor: nw-resize;\n margin-left: unset;\n top: -4px;\n height: 10px;\n width: 10px; }\n #workbench-canvas #workbench-container .frame-box .bottom-left-corner-handle {\n background-color: transparent;\n height: 0px;\n z-index: 21;\n cursor: sw-resize;\n grid-area: 4 / 1 / 4 / 1; }\n #workbench-canvas #workbench-container .frame-box .bottom-left-corner-handle::before {\n background-color: transparent;\n height: 10px;\n cursor: sw-resize;\n top: unset;\n bottom: -4px;\n width: 10px; }\n #workbench-canvas #workbench-container .frame-box .top-handle {\n grid-area: 1 / 1 / 1 / 1;\n background-color: transparent;\n height: 4px;\n cursor: ns-resize; }\n #workbench-canvas #workbench-container .frame-box .top-handle::before {\n content: \"\";\n width: 100%;\n position: absolute;\n top: -4px;\n bottom: 100%;\n right: 0;\n left: 0;\n margin-bottom: -8px;\n cursor: ns-resize;\n height: 8px; }\n #workbench-canvas #workbench-container .frame-box .bottom-handle {\n grid-area: 3 / 1 / 3 / 1;\n background-color: transparent;\n height: 4px;\n cursor: ns-resize; }\n #workbench-canvas #workbench-container .frame-box .bottom-handle::after {\n content: \"\";\n width: 100%;\n position: absolute;\n top: 100%;\n bottom: 0;\n right: 0;\n left: 0;\n margin-top: -8px;\n cursor: ns-resize;\n height: 12px; }\n #workbench-canvas #workbench-container .frame-box.collapsed .top-handle, #workbench-canvas #workbench-container .frame-box.collapsed .top-right-corner-handle, #workbench-canvas #workbench-container .frame-box.collapsed .right-handle, #workbench-canvas #workbench-container .frame-box.collapsed .bottom-right-corner-handle, #workbench-canvas #workbench-container .frame-box.collapsed .bottom-handle, #workbench-canvas #workbench-container .frame-box.collapsed .bottom-left-corner-handle, #workbench-canvas #workbench-container .frame-box.collapsed .left-handle, #workbench-canvas #workbench-container .frame-box.collapsed .top-left-corner-handle {\n cursor: default; }\n #workbench-canvas #workbench-container .frame-box.collapsed .right-handle::after, #workbench-canvas #workbench-container .frame-box.collapsed .bottom-handle::after, #workbench-canvas #workbench-container .frame-box.collapsed .top-right-corner-handle::after, #workbench-canvas #workbench-container .frame-box.collapsed .bottom-right-corner-handle::after {\n cursor: default; }\n #workbench-canvas #workbench-container .frame-box.collapsed .left-handle::before, #workbench-canvas #workbench-container .frame-box.collapsed .top-handle::before, #workbench-canvas #workbench-container .frame-box.collapsed .top-left-corner-handle::before, #workbench-canvas #workbench-container .frame-box.collapsed .bottom-left-corner-handle::before {\n cursor: default; }\n #workbench-canvas #workbench-container #workbench-svg-container {\n grid-row: 1;\n grid-column: 1;\n position: relative;\n width: 100%;\n height: 100%;\n overflow: visible;\n pointer-events: none;\n z-index: 2; }\n #workbench-canvas #workbench-container #workbench-svg-container .link {\n stroke-width: 4px; }\n #workbench-canvas #workbench-container #workbench-svg-container .link.selected {\n stroke: white !important;\n stroke-dasharray: 10, 2; }\n #workbench-canvas #workbench-container #workbench-svg-container .link.hidden {\n display: none; }\n #workbench-canvas #workbench-container #workbench-svg-container .selection-link {\n pointer-events: all;\n stroke-width: 16px;\n opacity: 0;\n transition: opacity 75ms;\n stroke: transparent;\n cursor: pointer; }\n #workbench-canvas #workbench-container #workbench-svg-container .selection-link.hidden {\n display: none; }\n #workbench-canvas #workbench-container #workbench-svg-container .selection-link:hover, #workbench-canvas #workbench-container #workbench-svg-container .selection-link.selected {\n stroke: white !important;\n opacity: 0.4; }\n #workbench-canvas #workbench-container #workbench-canvas-container {\n grid-row: 1;\n grid-column: 1;\n position: relative;\n width: 100%;\n height: 100%; }\n #workbench-canvas #workbench-container #workbench-canvas-container .visual {\n z-index: 4;\n width: 200px;\n position: absolute;\n left: 0;\n top: 0;\n background: gray;\n border: 4px solid black;\n border-radius: 12px;\n display: grid;\n grid-template-rows: 30px auto;\n grid-template-columns: 100%;\n color: white; }\n #workbench-canvas #workbench-container #workbench-canvas-container .visual.hidden {\n display: none; }\n #workbench-canvas #workbench-container #workbench-canvas-container .visual .comments {\n position: absolute;\n top: -50px;\n width: 200px;\n height: 45px;\n overflow: hidden;\n font-style: italic;\n opacity: 0.8;\n display: grid;\n align-items: flex-end;\n pointer-events: none; }\n #workbench-canvas #workbench-container #workbench-canvas-container .visual .selection-border {\n grid-row: 1 / span 3;\n grid-column: 1;\n margin: -4px;\n transition: border-color 100ms;\n border: 4px solid black;\n border-radius: 12px; }\n #workbench-canvas #workbench-container #workbench-canvas-container .visual.selected .selection-border {\n border-color: white; }\n #workbench-canvas #workbench-container #workbench-canvas-container .visual .header {\n grid-row: 1;\n grid-column: 1;\n border: 4px solid black;\n border-top-right-radius: 7px;\n border-top-left-radius: 7px;\n font-size: 16px;\n text-align: center;\n margin-top: -1px;\n margin-left: -1px;\n margin-right: -1px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n background: black;\n color: white; }\n #workbench-canvas #workbench-container #workbench-canvas-container .visual .header.constant {\n border-color: #464348;\n background: #464348; }\n #workbench-canvas #workbench-container #workbench-canvas-container .visual .header.inspector {\n border-color: #66491b;\n background: #66491b; }\n", ""]);
  151. // Exports
  152. module.exports = exports;
  153. /***/ }),
  154. /***/ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./main.scss":
  155. /*!************************************************************************************************************************************!*\
  156. !*** C:/Repos/Babylon.js/node_modules/css-loader/dist/cjs.js!C:/Repos/Babylon.js/node_modules/sass-loader/dist/cjs.js!./main.scss ***!
  157. \************************************************************************************************************************************/
  158. /*! no static exports found */
  159. /***/ (function(module, exports, __webpack_require__) {
  160. // Imports
  161. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  162. exports = ___CSS_LOADER_API_IMPORT___(false);
  163. // Module
  164. exports.push([module.i, "#gui-editor-workbench-root {\n display: grid;\n grid-template-rows: calc(100% - 120px) 120px;\n height: 100%;\n width: 100%;\n background: #464646;\n font: 14px \"acumin-pro\"; }\n\n.wait-screen {\n display: grid;\n justify-content: center;\n align-content: center;\n height: 100%;\n width: 100%;\n background: #464646;\n opacity: 0.95;\n color: white;\n font: 24px \"acumin-pro\";\n position: absolute;\n top: 0;\n left: 0; }\n .wait-screen.hidden {\n visibility: hidden; }\n\n#leftGrab {\n grid-row: 1 / span 2;\n grid-column: 2;\n cursor: ew-resize; }\n\n#rightGrab {\n grid-row: 1 / span 2;\n grid-column: 4;\n cursor: ew-resize; }\n\n.diagram-container {\n grid-row: 1;\n grid-column: 3;\n background: #5f5b60;\n width: 100%;\n height: 100%; }\n .diagram-container .diagram {\n display: none;\n width: 100%;\n height: 100%; }\n\n.right-panel {\n grid-row: 1 / span 2;\n grid-column: 5;\n display: grid;\n grid-template-rows: 1fr 40px auto 40px;\n grid-template-columns: 100%;\n height: 100%;\n overflow-y: auto; }\n .right-panel #propertyTab {\n grid-row: 1;\n grid-column: 1; }\n .right-panel .button {\n display: grid;\n justify-content: center;\n align-content: center;\n height: auto;\n width: calc(100% / 7);\n cursor: pointer; }\n .right-panel .button:hover {\n background: #337ab7;\n color: white;\n opacity: 0.8; }\n .right-panel .button.selected {\n background: #337ab7;\n color: white; }\n .right-panel .button.align {\n justify-content: stretch;\n text-align: center; }\n .right-panel #preview-mesh-bar {\n grid-row: 2;\n grid-column: 1;\n display: grid;\n grid-template-columns: auto 1fr 40px 40px 40px;\n align-items: center;\n font-size: 18px;\n background-color: #555555; }\n .right-panel #preview-mesh-bar #file-picker {\n display: none; }\n .right-panel #preview-mesh-bar .listLine {\n grid-column: 1;\n height: 40px;\n display: grid;\n grid-template-columns: 0px 1fr; }\n .right-panel #preview-mesh-bar .listLine .label {\n grid-column: 1;\n display: flex;\n align-items: center;\n font-size: 14px; }\n .right-panel #preview-mesh-bar .listLine .options {\n grid-column: 2;\n display: flex;\n align-items: center;\n margin-left: 5px; }\n .right-panel #preview-mesh-bar .listLine .options select {\n width: 115px; }\n .right-panel #preview-mesh-bar .button {\n color: #ffffff;\n width: 40px;\n height: 40px;\n transform-origin: 50% 50%; }\n .right-panel #preview-mesh-bar .button:active {\n transform: scale(0.9); }\n .right-panel #preview-mesh-bar .button:hover {\n background: #3f3461; }\n .right-panel #preview-mesh-bar .button.selected {\n background: #9379e6; }\n .right-panel #preview-mesh-bar .button img {\n height: 40px;\n width: 100%; }\n .right-panel #preview-mesh-bar #play-button {\n grid-column: 3; }\n .right-panel #preview-mesh-bar #color-picker-button {\n grid-column: 4;\n display: grid;\n grid-template-columns: 100%;\n grid-template-rows: 100%; }\n .right-panel #preview-mesh-bar #color-picker-button img {\n height: 40px;\n width: 30px; }\n .right-panel #preview-mesh-bar #color-picker-button #color-picker-image {\n padding-left: 5px;\n padding-bottom: 38px; }\n .right-panel #preview-mesh-bar #color-picker-button #color-picker {\n transform: scale(0);\n grid-column: 1;\n grid-row: 1; }\n .right-panel #preview-mesh-bar #color-picker-button #color-picker-label {\n width: 100%;\n background: transparent;\n cursor: pointer; }\n .right-panel #preview-mesh-bar #preview-new-window {\n grid-column: 5; }\n .right-panel #preview-mesh-bar select {\n background-color: #a3a3a3;\n color: #333333; }\n .right-panel #preview-config-bar {\n grid-row: 4;\n grid-column: 1;\n display: grid;\n grid-template-columns: 40px 40px 40px 1fr 40px 40px;\n color: white;\n align-items: center;\n font-size: 18px; }\n .right-panel #preview-config-bar .button {\n width: 40px;\n grid-row: 1;\n height: 40px;\n transform-origin: 50% 50%; }\n .right-panel #preview-config-bar .button:hover {\n background: #3f3461; }\n .right-panel #preview-config-bar .button.selected {\n background: #9379e6; }\n .right-panel #preview-config-bar .button:active {\n transform: scale(0.9); }\n .right-panel #preview-config-bar .button img {\n height: auto;\n width: 100%; }\n .right-panel #preview-config-bar .button.back-face {\n grid-column: 6; }\n .right-panel #preview-config-bar .button.depth-pass {\n grid-column: 5 / 6; }\n .right-panel #preview-config-bar .button.hemispheric-light {\n grid-column: 3 / 4; }\n .right-panel #preview-config-bar .button.direction-light-1 {\n grid-column: 2 / 3; }\n .right-panel #preview-config-bar .button.direction-light-0 {\n grid-column: 1 / 2; }\n\n.blocker {\n visibility: hidden;\n position: absolute;\n width: calc(100% - 40px);\n height: 100%;\n top: 0;\n left: 0;\n background: rgba(20, 20, 20, 0.95);\n font-family: \"acumin-pro\";\n color: white;\n font-size: 24px;\n display: grid;\n align-content: center;\n justify-content: center;\n user-select: none;\n padding: 20px;\n text-align: center; }\n\n#log-console {\n grid-row: 2;\n grid-column: 3; }\n\n.dialog-container {\n position: absolute;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.6);\n display: grid;\n font-family: \"acumin-pro\";\n top: 0; }\n .dialog-container .dialog {\n align-self: center;\n justify-self: center;\n min-height: 140px;\n max-width: 400px;\n border-radius: 10px;\n background: white;\n display: grid;\n grid-template-columns: 100%;\n grid-template-rows: calc(100% - 50px) 50px; }\n .dialog-container .dialog .dialog-message {\n grid-row: 1;\n grid-column: 1;\n margin-top: 20px;\n padding: 10px;\n font-size: 18px;\n color: black; }\n .dialog-container .dialog .dialog-buttons {\n grid-row: 2;\n grid-column: 1;\n display: grid;\n grid-template-rows: 100%;\n grid-template-columns: 100%;\n color: white; }\n .dialog-container .dialog .dialog-buttons .dialog-button-ok {\n cursor: pointer;\n justify-self: center;\n background: green;\n min-width: 80px;\n justify-content: center;\n display: grid;\n align-content: center;\n align-self: center;\n height: 35px;\n border-radius: 10px; }\n .dialog-container .dialog .dialog-buttons .dialog-button-ok:hover {\n opacity: 0.8; }\n .dialog-container .dialog .dialog-buttons .dialog-button-ok.error {\n background: red; }\n", ""]);
  165. // Exports
  166. module.exports = exports;
  167. /***/ }),
  168. /***/ "../../node_modules/css-loader/dist/runtime/api.js":
  169. /*!***********************************************************************!*\
  170. !*** C:/Repos/Babylon.js/node_modules/css-loader/dist/runtime/api.js ***!
  171. \***********************************************************************/
  172. /*! no static exports found */
  173. /***/ (function(module, exports, __webpack_require__) {
  174. "use strict";
  175. /*
  176. MIT License http://www.opensource.org/licenses/mit-license.php
  177. Author Tobias Koppers @sokra
  178. */
  179. // css base code, injected by the css-loader
  180. // eslint-disable-next-line func-names
  181. module.exports = function (useSourceMap) {
  182. var list = []; // return the list of modules as css string
  183. list.toString = function toString() {
  184. return this.map(function (item) {
  185. var content = cssWithMappingToString(item, useSourceMap);
  186. if (item[2]) {
  187. return "@media ".concat(item[2], " {").concat(content, "}");
  188. }
  189. return content;
  190. }).join('');
  191. }; // import a list of modules into the list
  192. // eslint-disable-next-line func-names
  193. list.i = function (modules, mediaQuery, dedupe) {
  194. if (typeof modules === 'string') {
  195. // eslint-disable-next-line no-param-reassign
  196. modules = [[null, modules, '']];
  197. }
  198. var alreadyImportedModules = {};
  199. if (dedupe) {
  200. for (var i = 0; i < this.length; i++) {
  201. // eslint-disable-next-line prefer-destructuring
  202. var id = this[i][0];
  203. if (id != null) {
  204. alreadyImportedModules[id] = true;
  205. }
  206. }
  207. }
  208. for (var _i = 0; _i < modules.length; _i++) {
  209. var item = [].concat(modules[_i]);
  210. if (dedupe && alreadyImportedModules[item[0]]) {
  211. // eslint-disable-next-line no-continue
  212. continue;
  213. }
  214. if (mediaQuery) {
  215. if (!item[2]) {
  216. item[2] = mediaQuery;
  217. } else {
  218. item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
  219. }
  220. }
  221. list.push(item);
  222. }
  223. };
  224. return list;
  225. };
  226. function cssWithMappingToString(item, useSourceMap) {
  227. var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
  228. var cssMapping = item[3];
  229. if (!cssMapping) {
  230. return content;
  231. }
  232. if (useSourceMap && typeof btoa === 'function') {
  233. var sourceMapping = toComment(cssMapping);
  234. var sourceURLs = cssMapping.sources.map(function (source) {
  235. return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */");
  236. });
  237. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  238. }
  239. return [content].join('\n');
  240. } // Adapted from convert-source-map (MIT)
  241. function toComment(sourceMap) {
  242. // eslint-disable-next-line no-undef
  243. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  244. var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
  245. return "/*# ".concat(data, " */");
  246. }
  247. /***/ }),
  248. /***/ "../../node_modules/dagre/index.js":
  249. /*!*******************************************************!*\
  250. !*** C:/Repos/Babylon.js/node_modules/dagre/index.js ***!
  251. \*******************************************************/
  252. /*! no static exports found */
  253. /***/ (function(module, exports, __webpack_require__) {
  254. /*
  255. Copyright (c) 2012-2014 Chris Pettitt
  256. Permission is hereby granted, free of charge, to any person obtaining a copy
  257. of this software and associated documentation files (the "Software"), to deal
  258. in the Software without restriction, including without limitation the rights
  259. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  260. copies of the Software, and to permit persons to whom the Software is
  261. furnished to do so, subject to the following conditions:
  262. The above copyright notice and this permission notice shall be included in
  263. all copies or substantial portions of the Software.
  264. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  265. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  266. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  267. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  268. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  269. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  270. THE SOFTWARE.
  271. */
  272. module.exports = {
  273. graphlib: __webpack_require__(/*! ./lib/graphlib */ "../../node_modules/dagre/lib/graphlib.js"),
  274. layout: __webpack_require__(/*! ./lib/layout */ "../../node_modules/dagre/lib/layout.js"),
  275. debug: __webpack_require__(/*! ./lib/debug */ "../../node_modules/dagre/lib/debug.js"),
  276. util: {
  277. time: __webpack_require__(/*! ./lib/util */ "../../node_modules/dagre/lib/util.js").time,
  278. notime: __webpack_require__(/*! ./lib/util */ "../../node_modules/dagre/lib/util.js").notime
  279. },
  280. version: __webpack_require__(/*! ./lib/version */ "../../node_modules/dagre/lib/version.js")
  281. };
  282. /***/ }),
  283. /***/ "../../node_modules/dagre/lib/acyclic.js":
  284. /*!*************************************************************!*\
  285. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/acyclic.js ***!
  286. \*************************************************************/
  287. /*! no static exports found */
  288. /***/ (function(module, exports, __webpack_require__) {
  289. "use strict";
  290. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/dagre/lib/lodash.js");
  291. var greedyFAS = __webpack_require__(/*! ./greedy-fas */ "../../node_modules/dagre/lib/greedy-fas.js");
  292. module.exports = {
  293. run: run,
  294. undo: undo
  295. };
  296. function run(g) {
  297. var fas = (g.graph().acyclicer === "greedy"
  298. ? greedyFAS(g, weightFn(g))
  299. : dfsFAS(g));
  300. _.forEach(fas, function(e) {
  301. var label = g.edge(e);
  302. g.removeEdge(e);
  303. label.forwardName = e.name;
  304. label.reversed = true;
  305. g.setEdge(e.w, e.v, label, _.uniqueId("rev"));
  306. });
  307. function weightFn(g) {
  308. return function(e) {
  309. return g.edge(e).weight;
  310. };
  311. }
  312. }
  313. function dfsFAS(g) {
  314. var fas = [];
  315. var stack = {};
  316. var visited = {};
  317. function dfs(v) {
  318. if (_.has(visited, v)) {
  319. return;
  320. }
  321. visited[v] = true;
  322. stack[v] = true;
  323. _.forEach(g.outEdges(v), function(e) {
  324. if (_.has(stack, e.w)) {
  325. fas.push(e);
  326. } else {
  327. dfs(e.w);
  328. }
  329. });
  330. delete stack[v];
  331. }
  332. _.forEach(g.nodes(), dfs);
  333. return fas;
  334. }
  335. function undo(g) {
  336. _.forEach(g.edges(), function(e) {
  337. var label = g.edge(e);
  338. if (label.reversed) {
  339. g.removeEdge(e);
  340. var forwardName = label.forwardName;
  341. delete label.reversed;
  342. delete label.forwardName;
  343. g.setEdge(e.w, e.v, label, forwardName);
  344. }
  345. });
  346. }
  347. /***/ }),
  348. /***/ "../../node_modules/dagre/lib/add-border-segments.js":
  349. /*!*************************************************************************!*\
  350. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/add-border-segments.js ***!
  351. \*************************************************************************/
  352. /*! no static exports found */
  353. /***/ (function(module, exports, __webpack_require__) {
  354. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/dagre/lib/lodash.js");
  355. var util = __webpack_require__(/*! ./util */ "../../node_modules/dagre/lib/util.js");
  356. module.exports = addBorderSegments;
  357. function addBorderSegments(g) {
  358. function dfs(v) {
  359. var children = g.children(v);
  360. var node = g.node(v);
  361. if (children.length) {
  362. _.forEach(children, dfs);
  363. }
  364. if (_.has(node, "minRank")) {
  365. node.borderLeft = [];
  366. node.borderRight = [];
  367. for (var rank = node.minRank, maxRank = node.maxRank + 1;
  368. rank < maxRank;
  369. ++rank) {
  370. addBorderNode(g, "borderLeft", "_bl", v, node, rank);
  371. addBorderNode(g, "borderRight", "_br", v, node, rank);
  372. }
  373. }
  374. }
  375. _.forEach(g.children(), dfs);
  376. }
  377. function addBorderNode(g, prop, prefix, sg, sgNode, rank) {
  378. var label = { width: 0, height: 0, rank: rank, borderType: prop };
  379. var prev = sgNode[prop][rank - 1];
  380. var curr = util.addDummyNode(g, "border", label, prefix);
  381. sgNode[prop][rank] = curr;
  382. g.setParent(curr, sg);
  383. if (prev) {
  384. g.setEdge(prev, curr, { weight: 1 });
  385. }
  386. }
  387. /***/ }),
  388. /***/ "../../node_modules/dagre/lib/coordinate-system.js":
  389. /*!***********************************************************************!*\
  390. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/coordinate-system.js ***!
  391. \***********************************************************************/
  392. /*! no static exports found */
  393. /***/ (function(module, exports, __webpack_require__) {
  394. "use strict";
  395. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/dagre/lib/lodash.js");
  396. module.exports = {
  397. adjust: adjust,
  398. undo: undo
  399. };
  400. function adjust(g) {
  401. var rankDir = g.graph().rankdir.toLowerCase();
  402. if (rankDir === "lr" || rankDir === "rl") {
  403. swapWidthHeight(g);
  404. }
  405. }
  406. function undo(g) {
  407. var rankDir = g.graph().rankdir.toLowerCase();
  408. if (rankDir === "bt" || rankDir === "rl") {
  409. reverseY(g);
  410. }
  411. if (rankDir === "lr" || rankDir === "rl") {
  412. swapXY(g);
  413. swapWidthHeight(g);
  414. }
  415. }
  416. function swapWidthHeight(g) {
  417. _.forEach(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); });
  418. _.forEach(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); });
  419. }
  420. function swapWidthHeightOne(attrs) {
  421. var w = attrs.width;
  422. attrs.width = attrs.height;
  423. attrs.height = w;
  424. }
  425. function reverseY(g) {
  426. _.forEach(g.nodes(), function(v) { reverseYOne(g.node(v)); });
  427. _.forEach(g.edges(), function(e) {
  428. var edge = g.edge(e);
  429. _.forEach(edge.points, reverseYOne);
  430. if (_.has(edge, "y")) {
  431. reverseYOne(edge);
  432. }
  433. });
  434. }
  435. function reverseYOne(attrs) {
  436. attrs.y = -attrs.y;
  437. }
  438. function swapXY(g) {
  439. _.forEach(g.nodes(), function(v) { swapXYOne(g.node(v)); });
  440. _.forEach(g.edges(), function(e) {
  441. var edge = g.edge(e);
  442. _.forEach(edge.points, swapXYOne);
  443. if (_.has(edge, "x")) {
  444. swapXYOne(edge);
  445. }
  446. });
  447. }
  448. function swapXYOne(attrs) {
  449. var x = attrs.x;
  450. attrs.x = attrs.y;
  451. attrs.y = x;
  452. }
  453. /***/ }),
  454. /***/ "../../node_modules/dagre/lib/data/list.js":
  455. /*!***************************************************************!*\
  456. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/data/list.js ***!
  457. \***************************************************************/
  458. /*! no static exports found */
  459. /***/ (function(module, exports) {
  460. /*
  461. * Simple doubly linked list implementation derived from Cormen, et al.,
  462. * "Introduction to Algorithms".
  463. */
  464. module.exports = List;
  465. function List() {
  466. var sentinel = {};
  467. sentinel._next = sentinel._prev = sentinel;
  468. this._sentinel = sentinel;
  469. }
  470. List.prototype.dequeue = function() {
  471. var sentinel = this._sentinel;
  472. var entry = sentinel._prev;
  473. if (entry !== sentinel) {
  474. unlink(entry);
  475. return entry;
  476. }
  477. };
  478. List.prototype.enqueue = function(entry) {
  479. var sentinel = this._sentinel;
  480. if (entry._prev && entry._next) {
  481. unlink(entry);
  482. }
  483. entry._next = sentinel._next;
  484. sentinel._next._prev = entry;
  485. sentinel._next = entry;
  486. entry._prev = sentinel;
  487. };
  488. List.prototype.toString = function() {
  489. var strs = [];
  490. var sentinel = this._sentinel;
  491. var curr = sentinel._prev;
  492. while (curr !== sentinel) {
  493. strs.push(JSON.stringify(curr, filterOutLinks));
  494. curr = curr._prev;
  495. }
  496. return "[" + strs.join(", ") + "]";
  497. };
  498. function unlink(entry) {
  499. entry._prev._next = entry._next;
  500. entry._next._prev = entry._prev;
  501. delete entry._next;
  502. delete entry._prev;
  503. }
  504. function filterOutLinks(k, v) {
  505. if (k !== "_next" && k !== "_prev") {
  506. return v;
  507. }
  508. }
  509. /***/ }),
  510. /***/ "../../node_modules/dagre/lib/debug.js":
  511. /*!***********************************************************!*\
  512. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/debug.js ***!
  513. \***********************************************************/
  514. /*! no static exports found */
  515. /***/ (function(module, exports, __webpack_require__) {
  516. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/dagre/lib/lodash.js");
  517. var util = __webpack_require__(/*! ./util */ "../../node_modules/dagre/lib/util.js");
  518. var Graph = __webpack_require__(/*! ./graphlib */ "../../node_modules/dagre/lib/graphlib.js").Graph;
  519. module.exports = {
  520. debugOrdering: debugOrdering
  521. };
  522. /* istanbul ignore next */
  523. function debugOrdering(g) {
  524. var layerMatrix = util.buildLayerMatrix(g);
  525. var h = new Graph({ compound: true, multigraph: true }).setGraph({});
  526. _.forEach(g.nodes(), function(v) {
  527. h.setNode(v, { label: v });
  528. h.setParent(v, "layer" + g.node(v).rank);
  529. });
  530. _.forEach(g.edges(), function(e) {
  531. h.setEdge(e.v, e.w, {}, e.name);
  532. });
  533. _.forEach(layerMatrix, function(layer, i) {
  534. var layerV = "layer" + i;
  535. h.setNode(layerV, { rank: "same" });
  536. _.reduce(layer, function(u, v) {
  537. h.setEdge(u, v, { style: "invis" });
  538. return v;
  539. });
  540. });
  541. return h;
  542. }
  543. /***/ }),
  544. /***/ "../../node_modules/dagre/lib/graphlib.js":
  545. /*!**************************************************************!*\
  546. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/graphlib.js ***!
  547. \**************************************************************/
  548. /*! no static exports found */
  549. /***/ (function(module, exports, __webpack_require__) {
  550. /* global window */
  551. var graphlib;
  552. if (true) {
  553. try {
  554. graphlib = __webpack_require__(/*! graphlib */ "../../node_modules/graphlib/index.js");
  555. } catch (e) {
  556. // continue regardless of error
  557. }
  558. }
  559. if (!graphlib) {
  560. graphlib = window.graphlib;
  561. }
  562. module.exports = graphlib;
  563. /***/ }),
  564. /***/ "../../node_modules/dagre/lib/greedy-fas.js":
  565. /*!****************************************************************!*\
  566. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/greedy-fas.js ***!
  567. \****************************************************************/
  568. /*! no static exports found */
  569. /***/ (function(module, exports, __webpack_require__) {
  570. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/dagre/lib/lodash.js");
  571. var Graph = __webpack_require__(/*! ./graphlib */ "../../node_modules/dagre/lib/graphlib.js").Graph;
  572. var List = __webpack_require__(/*! ./data/list */ "../../node_modules/dagre/lib/data/list.js");
  573. /*
  574. * A greedy heuristic for finding a feedback arc set for a graph. A feedback
  575. * arc set is a set of edges that can be removed to make a graph acyclic.
  576. * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and
  577. * effective heuristic for the feedback arc set problem." This implementation
  578. * adjusts that from the paper to allow for weighted edges.
  579. */
  580. module.exports = greedyFAS;
  581. var DEFAULT_WEIGHT_FN = _.constant(1);
  582. function greedyFAS(g, weightFn) {
  583. if (g.nodeCount() <= 1) {
  584. return [];
  585. }
  586. var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN);
  587. var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx);
  588. // Expand multi-edges
  589. return _.flatten(_.map(results, function(e) {
  590. return g.outEdges(e.v, e.w);
  591. }), true);
  592. }
  593. function doGreedyFAS(g, buckets, zeroIdx) {
  594. var results = [];
  595. var sources = buckets[buckets.length - 1];
  596. var sinks = buckets[0];
  597. var entry;
  598. while (g.nodeCount()) {
  599. while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); }
  600. while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); }
  601. if (g.nodeCount()) {
  602. for (var i = buckets.length - 2; i > 0; --i) {
  603. entry = buckets[i].dequeue();
  604. if (entry) {
  605. results = results.concat(removeNode(g, buckets, zeroIdx, entry, true));
  606. break;
  607. }
  608. }
  609. }
  610. }
  611. return results;
  612. }
  613. function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) {
  614. var results = collectPredecessors ? [] : undefined;
  615. _.forEach(g.inEdges(entry.v), function(edge) {
  616. var weight = g.edge(edge);
  617. var uEntry = g.node(edge.v);
  618. if (collectPredecessors) {
  619. results.push({ v: edge.v, w: edge.w });
  620. }
  621. uEntry.out -= weight;
  622. assignBucket(buckets, zeroIdx, uEntry);
  623. });
  624. _.forEach(g.outEdges(entry.v), function(edge) {
  625. var weight = g.edge(edge);
  626. var w = edge.w;
  627. var wEntry = g.node(w);
  628. wEntry["in"] -= weight;
  629. assignBucket(buckets, zeroIdx, wEntry);
  630. });
  631. g.removeNode(entry.v);
  632. return results;
  633. }
  634. function buildState(g, weightFn) {
  635. var fasGraph = new Graph();
  636. var maxIn = 0;
  637. var maxOut = 0;
  638. _.forEach(g.nodes(), function(v) {
  639. fasGraph.setNode(v, { v: v, "in": 0, out: 0 });
  640. });
  641. // Aggregate weights on nodes, but also sum the weights across multi-edges
  642. // into a single edge for the fasGraph.
  643. _.forEach(g.edges(), function(e) {
  644. var prevWeight = fasGraph.edge(e.v, e.w) || 0;
  645. var weight = weightFn(e);
  646. var edgeWeight = prevWeight + weight;
  647. fasGraph.setEdge(e.v, e.w, edgeWeight);
  648. maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight);
  649. maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight);
  650. });
  651. var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); });
  652. var zeroIdx = maxIn + 1;
  653. _.forEach(fasGraph.nodes(), function(v) {
  654. assignBucket(buckets, zeroIdx, fasGraph.node(v));
  655. });
  656. return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx };
  657. }
  658. function assignBucket(buckets, zeroIdx, entry) {
  659. if (!entry.out) {
  660. buckets[0].enqueue(entry);
  661. } else if (!entry["in"]) {
  662. buckets[buckets.length - 1].enqueue(entry);
  663. } else {
  664. buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry);
  665. }
  666. }
  667. /***/ }),
  668. /***/ "../../node_modules/dagre/lib/layout.js":
  669. /*!************************************************************!*\
  670. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/layout.js ***!
  671. \************************************************************/
  672. /*! no static exports found */
  673. /***/ (function(module, exports, __webpack_require__) {
  674. "use strict";
  675. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/dagre/lib/lodash.js");
  676. var acyclic = __webpack_require__(/*! ./acyclic */ "../../node_modules/dagre/lib/acyclic.js");
  677. var normalize = __webpack_require__(/*! ./normalize */ "../../node_modules/dagre/lib/normalize.js");
  678. var rank = __webpack_require__(/*! ./rank */ "../../node_modules/dagre/lib/rank/index.js");
  679. var normalizeRanks = __webpack_require__(/*! ./util */ "../../node_modules/dagre/lib/util.js").normalizeRanks;
  680. var parentDummyChains = __webpack_require__(/*! ./parent-dummy-chains */ "../../node_modules/dagre/lib/parent-dummy-chains.js");
  681. var removeEmptyRanks = __webpack_require__(/*! ./util */ "../../node_modules/dagre/lib/util.js").removeEmptyRanks;
  682. var nestingGraph = __webpack_require__(/*! ./nesting-graph */ "../../node_modules/dagre/lib/nesting-graph.js");
  683. var addBorderSegments = __webpack_require__(/*! ./add-border-segments */ "../../node_modules/dagre/lib/add-border-segments.js");
  684. var coordinateSystem = __webpack_require__(/*! ./coordinate-system */ "../../node_modules/dagre/lib/coordinate-system.js");
  685. var order = __webpack_require__(/*! ./order */ "../../node_modules/dagre/lib/order/index.js");
  686. var position = __webpack_require__(/*! ./position */ "../../node_modules/dagre/lib/position/index.js");
  687. var util = __webpack_require__(/*! ./util */ "../../node_modules/dagre/lib/util.js");
  688. var Graph = __webpack_require__(/*! ./graphlib */ "../../node_modules/dagre/lib/graphlib.js").Graph;
  689. module.exports = layout;
  690. function layout(g, opts) {
  691. var time = opts && opts.debugTiming ? util.time : util.notime;
  692. time("layout", function() {
  693. var layoutGraph =
  694. time(" buildLayoutGraph", function() { return buildLayoutGraph(g); });
  695. time(" runLayout", function() { runLayout(layoutGraph, time); });
  696. time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); });
  697. });
  698. }
  699. function runLayout(g, time) {
  700. time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); });
  701. time(" removeSelfEdges", function() { removeSelfEdges(g); });
  702. time(" acyclic", function() { acyclic.run(g); });
  703. time(" nestingGraph.run", function() { nestingGraph.run(g); });
  704. time(" rank", function() { rank(util.asNonCompoundGraph(g)); });
  705. time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); });
  706. time(" removeEmptyRanks", function() { removeEmptyRanks(g); });
  707. time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); });
  708. time(" normalizeRanks", function() { normalizeRanks(g); });
  709. time(" assignRankMinMax", function() { assignRankMinMax(g); });
  710. time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); });
  711. time(" normalize.run", function() { normalize.run(g); });
  712. time(" parentDummyChains", function() { parentDummyChains(g); });
  713. time(" addBorderSegments", function() { addBorderSegments(g); });
  714. time(" order", function() { order(g); });
  715. time(" insertSelfEdges", function() { insertSelfEdges(g); });
  716. time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); });
  717. time(" position", function() { position(g); });
  718. time(" positionSelfEdges", function() { positionSelfEdges(g); });
  719. time(" removeBorderNodes", function() { removeBorderNodes(g); });
  720. time(" normalize.undo", function() { normalize.undo(g); });
  721. time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); });
  722. time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); });
  723. time(" translateGraph", function() { translateGraph(g); });
  724. time(" assignNodeIntersects", function() { assignNodeIntersects(g); });
  725. time(" reversePoints", function() { reversePointsForReversedEdges(g); });
  726. time(" acyclic.undo", function() { acyclic.undo(g); });
  727. }
  728. /*
  729. * Copies final layout information from the layout graph back to the input
  730. * graph. This process only copies whitelisted attributes from the layout graph
  731. * to the input graph, so it serves as a good place to determine what
  732. * attributes can influence layout.
  733. */
  734. function updateInputGraph(inputGraph, layoutGraph) {
  735. _.forEach(inputGraph.nodes(), function(v) {
  736. var inputLabel = inputGraph.node(v);
  737. var layoutLabel = layoutGraph.node(v);
  738. if (inputLabel) {
  739. inputLabel.x = layoutLabel.x;
  740. inputLabel.y = layoutLabel.y;
  741. if (layoutGraph.children(v).length) {
  742. inputLabel.width = layoutLabel.width;
  743. inputLabel.height = layoutLabel.height;
  744. }
  745. }
  746. });
  747. _.forEach(inputGraph.edges(), function(e) {
  748. var inputLabel = inputGraph.edge(e);
  749. var layoutLabel = layoutGraph.edge(e);
  750. inputLabel.points = layoutLabel.points;
  751. if (_.has(layoutLabel, "x")) {
  752. inputLabel.x = layoutLabel.x;
  753. inputLabel.y = layoutLabel.y;
  754. }
  755. });
  756. inputGraph.graph().width = layoutGraph.graph().width;
  757. inputGraph.graph().height = layoutGraph.graph().height;
  758. }
  759. var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"];
  760. var graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" };
  761. var graphAttrs = ["acyclicer", "ranker", "rankdir", "align"];
  762. var nodeNumAttrs = ["width", "height"];
  763. var nodeDefaults = { width: 0, height: 0 };
  764. var edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"];
  765. var edgeDefaults = {
  766. minlen: 1, weight: 1, width: 0, height: 0,
  767. labeloffset: 10, labelpos: "r"
  768. };
  769. var edgeAttrs = ["labelpos"];
  770. /*
  771. * Constructs a new graph from the input graph, which can be used for layout.
  772. * This process copies only whitelisted attributes from the input graph to the
  773. * layout graph. Thus this function serves as a good place to determine what
  774. * attributes can influence layout.
  775. */
  776. function buildLayoutGraph(inputGraph) {
  777. var g = new Graph({ multigraph: true, compound: true });
  778. var graph = canonicalize(inputGraph.graph());
  779. g.setGraph(_.merge({},
  780. graphDefaults,
  781. selectNumberAttrs(graph, graphNumAttrs),
  782. _.pick(graph, graphAttrs)));
  783. _.forEach(inputGraph.nodes(), function(v) {
  784. var node = canonicalize(inputGraph.node(v));
  785. g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults));
  786. g.setParent(v, inputGraph.parent(v));
  787. });
  788. _.forEach(inputGraph.edges(), function(e) {
  789. var edge = canonicalize(inputGraph.edge(e));
  790. g.setEdge(e, _.merge({},
  791. edgeDefaults,
  792. selectNumberAttrs(edge, edgeNumAttrs),
  793. _.pick(edge, edgeAttrs)));
  794. });
  795. return g;
  796. }
  797. /*
  798. * This idea comes from the Gansner paper: to account for edge labels in our
  799. * layout we split each rank in half by doubling minlen and halving ranksep.
  800. * Then we can place labels at these mid-points between nodes.
  801. *
  802. * We also add some minimal padding to the width to push the label for the edge
  803. * away from the edge itself a bit.
  804. */
  805. function makeSpaceForEdgeLabels(g) {
  806. var graph = g.graph();
  807. graph.ranksep /= 2;
  808. _.forEach(g.edges(), function(e) {
  809. var edge = g.edge(e);
  810. edge.minlen *= 2;
  811. if (edge.labelpos.toLowerCase() !== "c") {
  812. if (graph.rankdir === "TB" || graph.rankdir === "BT") {
  813. edge.width += edge.labeloffset;
  814. } else {
  815. edge.height += edge.labeloffset;
  816. }
  817. }
  818. });
  819. }
  820. /*
  821. * Creates temporary dummy nodes that capture the rank in which each edge's
  822. * label is going to, if it has one of non-zero width and height. We do this
  823. * so that we can safely remove empty ranks while preserving balance for the
  824. * label's position.
  825. */
  826. function injectEdgeLabelProxies(g) {
  827. _.forEach(g.edges(), function(e) {
  828. var edge = g.edge(e);
  829. if (edge.width && edge.height) {
  830. var v = g.node(e.v);
  831. var w = g.node(e.w);
  832. var label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e };
  833. util.addDummyNode(g, "edge-proxy", label, "_ep");
  834. }
  835. });
  836. }
  837. function assignRankMinMax(g) {
  838. var maxRank = 0;
  839. _.forEach(g.nodes(), function(v) {
  840. var node = g.node(v);
  841. if (node.borderTop) {
  842. node.minRank = g.node(node.borderTop).rank;
  843. node.maxRank = g.node(node.borderBottom).rank;
  844. maxRank = _.max(maxRank, node.maxRank);
  845. }
  846. });
  847. g.graph().maxRank = maxRank;
  848. }
  849. function removeEdgeLabelProxies(g) {
  850. _.forEach(g.nodes(), function(v) {
  851. var node = g.node(v);
  852. if (node.dummy === "edge-proxy") {
  853. g.edge(node.e).labelRank = node.rank;
  854. g.removeNode(v);
  855. }
  856. });
  857. }
  858. function translateGraph(g) {
  859. var minX = Number.POSITIVE_INFINITY;
  860. var maxX = 0;
  861. var minY = Number.POSITIVE_INFINITY;
  862. var maxY = 0;
  863. var graphLabel = g.graph();
  864. var marginX = graphLabel.marginx || 0;
  865. var marginY = graphLabel.marginy || 0;
  866. function getExtremes(attrs) {
  867. var x = attrs.x;
  868. var y = attrs.y;
  869. var w = attrs.width;
  870. var h = attrs.height;
  871. minX = Math.min(minX, x - w / 2);
  872. maxX = Math.max(maxX, x + w / 2);
  873. minY = Math.min(minY, y - h / 2);
  874. maxY = Math.max(maxY, y + h / 2);
  875. }
  876. _.forEach(g.nodes(), function(v) { getExtremes(g.node(v)); });
  877. _.forEach(g.edges(), function(e) {
  878. var edge = g.edge(e);
  879. if (_.has(edge, "x")) {
  880. getExtremes(edge);
  881. }
  882. });
  883. minX -= marginX;
  884. minY -= marginY;
  885. _.forEach(g.nodes(), function(v) {
  886. var node = g.node(v);
  887. node.x -= minX;
  888. node.y -= minY;
  889. });
  890. _.forEach(g.edges(), function(e) {
  891. var edge = g.edge(e);
  892. _.forEach(edge.points, function(p) {
  893. p.x -= minX;
  894. p.y -= minY;
  895. });
  896. if (_.has(edge, "x")) { edge.x -= minX; }
  897. if (_.has(edge, "y")) { edge.y -= minY; }
  898. });
  899. graphLabel.width = maxX - minX + marginX;
  900. graphLabel.height = maxY - minY + marginY;
  901. }
  902. function assignNodeIntersects(g) {
  903. _.forEach(g.edges(), function(e) {
  904. var edge = g.edge(e);
  905. var nodeV = g.node(e.v);
  906. var nodeW = g.node(e.w);
  907. var p1, p2;
  908. if (!edge.points) {
  909. edge.points = [];
  910. p1 = nodeW;
  911. p2 = nodeV;
  912. } else {
  913. p1 = edge.points[0];
  914. p2 = edge.points[edge.points.length - 1];
  915. }
  916. edge.points.unshift(util.intersectRect(nodeV, p1));
  917. edge.points.push(util.intersectRect(nodeW, p2));
  918. });
  919. }
  920. function fixupEdgeLabelCoords(g) {
  921. _.forEach(g.edges(), function(e) {
  922. var edge = g.edge(e);
  923. if (_.has(edge, "x")) {
  924. if (edge.labelpos === "l" || edge.labelpos === "r") {
  925. edge.width -= edge.labeloffset;
  926. }
  927. switch (edge.labelpos) {
  928. case "l": edge.x -= edge.width / 2 + edge.labeloffset; break;
  929. case "r": edge.x += edge.width / 2 + edge.labeloffset; break;
  930. }
  931. }
  932. });
  933. }
  934. function reversePointsForReversedEdges(g) {
  935. _.forEach(g.edges(), function(e) {
  936. var edge = g.edge(e);
  937. if (edge.reversed) {
  938. edge.points.reverse();
  939. }
  940. });
  941. }
  942. function removeBorderNodes(g) {
  943. _.forEach(g.nodes(), function(v) {
  944. if (g.children(v).length) {
  945. var node = g.node(v);
  946. var t = g.node(node.borderTop);
  947. var b = g.node(node.borderBottom);
  948. var l = g.node(_.last(node.borderLeft));
  949. var r = g.node(_.last(node.borderRight));
  950. node.width = Math.abs(r.x - l.x);
  951. node.height = Math.abs(b.y - t.y);
  952. node.x = l.x + node.width / 2;
  953. node.y = t.y + node.height / 2;
  954. }
  955. });
  956. _.forEach(g.nodes(), function(v) {
  957. if (g.node(v).dummy === "border") {
  958. g.removeNode(v);
  959. }
  960. });
  961. }
  962. function removeSelfEdges(g) {
  963. _.forEach(g.edges(), function(e) {
  964. if (e.v === e.w) {
  965. var node = g.node(e.v);
  966. if (!node.selfEdges) {
  967. node.selfEdges = [];
  968. }
  969. node.selfEdges.push({ e: e, label: g.edge(e) });
  970. g.removeEdge(e);
  971. }
  972. });
  973. }
  974. function insertSelfEdges(g) {
  975. var layers = util.buildLayerMatrix(g);
  976. _.forEach(layers, function(layer) {
  977. var orderShift = 0;
  978. _.forEach(layer, function(v, i) {
  979. var node = g.node(v);
  980. node.order = i + orderShift;
  981. _.forEach(node.selfEdges, function(selfEdge) {
  982. util.addDummyNode(g, "selfedge", {
  983. width: selfEdge.label.width,
  984. height: selfEdge.label.height,
  985. rank: node.rank,
  986. order: i + (++orderShift),
  987. e: selfEdge.e,
  988. label: selfEdge.label
  989. }, "_se");
  990. });
  991. delete node.selfEdges;
  992. });
  993. });
  994. }
  995. function positionSelfEdges(g) {
  996. _.forEach(g.nodes(), function(v) {
  997. var node = g.node(v);
  998. if (node.dummy === "selfedge") {
  999. var selfNode = g.node(node.e.v);
  1000. var x = selfNode.x + selfNode.width / 2;
  1001. var y = selfNode.y;
  1002. var dx = node.x - x;
  1003. var dy = selfNode.height / 2;
  1004. g.setEdge(node.e, node.label);
  1005. g.removeNode(v);
  1006. node.label.points = [
  1007. { x: x + 2 * dx / 3, y: y - dy },
  1008. { x: x + 5 * dx / 6, y: y - dy },
  1009. { x: x + dx , y: y },
  1010. { x: x + 5 * dx / 6, y: y + dy },
  1011. { x: x + 2 * dx / 3, y: y + dy }
  1012. ];
  1013. node.label.x = node.x;
  1014. node.label.y = node.y;
  1015. }
  1016. });
  1017. }
  1018. function selectNumberAttrs(obj, attrs) {
  1019. return _.mapValues(_.pick(obj, attrs), Number);
  1020. }
  1021. function canonicalize(attrs) {
  1022. var newAttrs = {};
  1023. _.forEach(attrs, function(v, k) {
  1024. newAttrs[k.toLowerCase()] = v;
  1025. });
  1026. return newAttrs;
  1027. }
  1028. /***/ }),
  1029. /***/ "../../node_modules/dagre/lib/lodash.js":
  1030. /*!************************************************************!*\
  1031. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/lodash.js ***!
  1032. \************************************************************/
  1033. /*! no static exports found */
  1034. /***/ (function(module, exports, __webpack_require__) {
  1035. /* global window */
  1036. var lodash;
  1037. if (true) {
  1038. try {
  1039. lodash = {
  1040. cloneDeep: __webpack_require__(/*! lodash/cloneDeep */ "../../node_modules/lodash/cloneDeep.js"),
  1041. constant: __webpack_require__(/*! lodash/constant */ "../../node_modules/lodash/constant.js"),
  1042. defaults: __webpack_require__(/*! lodash/defaults */ "../../node_modules/lodash/defaults.js"),
  1043. each: __webpack_require__(/*! lodash/each */ "../../node_modules/lodash/each.js"),
  1044. filter: __webpack_require__(/*! lodash/filter */ "../../node_modules/lodash/filter.js"),
  1045. find: __webpack_require__(/*! lodash/find */ "../../node_modules/lodash/find.js"),
  1046. flatten: __webpack_require__(/*! lodash/flatten */ "../../node_modules/lodash/flatten.js"),
  1047. forEach: __webpack_require__(/*! lodash/forEach */ "../../node_modules/lodash/forEach.js"),
  1048. forIn: __webpack_require__(/*! lodash/forIn */ "../../node_modules/lodash/forIn.js"),
  1049. has: __webpack_require__(/*! lodash/has */ "../../node_modules/lodash/has.js"),
  1050. isUndefined: __webpack_require__(/*! lodash/isUndefined */ "../../node_modules/lodash/isUndefined.js"),
  1051. last: __webpack_require__(/*! lodash/last */ "../../node_modules/lodash/last.js"),
  1052. map: __webpack_require__(/*! lodash/map */ "../../node_modules/lodash/map.js"),
  1053. mapValues: __webpack_require__(/*! lodash/mapValues */ "../../node_modules/lodash/mapValues.js"),
  1054. max: __webpack_require__(/*! lodash/max */ "../../node_modules/lodash/max.js"),
  1055. merge: __webpack_require__(/*! lodash/merge */ "../../node_modules/lodash/merge.js"),
  1056. min: __webpack_require__(/*! lodash/min */ "../../node_modules/lodash/min.js"),
  1057. minBy: __webpack_require__(/*! lodash/minBy */ "../../node_modules/lodash/minBy.js"),
  1058. now: __webpack_require__(/*! lodash/now */ "../../node_modules/lodash/now.js"),
  1059. pick: __webpack_require__(/*! lodash/pick */ "../../node_modules/lodash/pick.js"),
  1060. range: __webpack_require__(/*! lodash/range */ "../../node_modules/lodash/range.js"),
  1061. reduce: __webpack_require__(/*! lodash/reduce */ "../../node_modules/lodash/reduce.js"),
  1062. sortBy: __webpack_require__(/*! lodash/sortBy */ "../../node_modules/lodash/sortBy.js"),
  1063. uniqueId: __webpack_require__(/*! lodash/uniqueId */ "../../node_modules/lodash/uniqueId.js"),
  1064. values: __webpack_require__(/*! lodash/values */ "../../node_modules/lodash/values.js"),
  1065. zipObject: __webpack_require__(/*! lodash/zipObject */ "../../node_modules/lodash/zipObject.js"),
  1066. };
  1067. } catch (e) {
  1068. // continue regardless of error
  1069. }
  1070. }
  1071. if (!lodash) {
  1072. lodash = window._;
  1073. }
  1074. module.exports = lodash;
  1075. /***/ }),
  1076. /***/ "../../node_modules/dagre/lib/nesting-graph.js":
  1077. /*!*******************************************************************!*\
  1078. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/nesting-graph.js ***!
  1079. \*******************************************************************/
  1080. /*! no static exports found */
  1081. /***/ (function(module, exports, __webpack_require__) {
  1082. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/dagre/lib/lodash.js");
  1083. var util = __webpack_require__(/*! ./util */ "../../node_modules/dagre/lib/util.js");
  1084. module.exports = {
  1085. run: run,
  1086. cleanup: cleanup
  1087. };
  1088. /*
  1089. * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs,
  1090. * adds appropriate edges to ensure that all cluster nodes are placed between
  1091. * these boundries, and ensures that the graph is connected.
  1092. *
  1093. * In addition we ensure, through the use of the minlen property, that nodes
  1094. * and subgraph border nodes to not end up on the same rank.
  1095. *
  1096. * Preconditions:
  1097. *
  1098. * 1. Input graph is a DAG
  1099. * 2. Nodes in the input graph has a minlen attribute
  1100. *
  1101. * Postconditions:
  1102. *
  1103. * 1. Input graph is connected.
  1104. * 2. Dummy nodes are added for the tops and bottoms of subgraphs.
  1105. * 3. The minlen attribute for nodes is adjusted to ensure nodes do not
  1106. * get placed on the same rank as subgraph border nodes.
  1107. *
  1108. * The nesting graph idea comes from Sander, "Layout of Compound Directed
  1109. * Graphs."
  1110. */
  1111. function run(g) {
  1112. var root = util.addDummyNode(g, "root", {}, "_root");
  1113. var depths = treeDepths(g);
  1114. var height = _.max(_.values(depths)) - 1; // Note: depths is an Object not an array
  1115. var nodeSep = 2 * height + 1;
  1116. g.graph().nestingRoot = root;
  1117. // Multiply minlen by nodeSep to align nodes on non-border ranks.
  1118. _.forEach(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });
  1119. // Calculate a weight that is sufficient to keep subgraphs vertically compact
  1120. var weight = sumWeights(g) + 1;
  1121. // Create border nodes and link them up
  1122. _.forEach(g.children(), function(child) {
  1123. dfs(g, root, nodeSep, weight, height, depths, child);
  1124. });
  1125. // Save the multiplier for node layers for later removal of empty border
  1126. // layers.
  1127. g.graph().nodeRankFactor = nodeSep;
  1128. }
  1129. function dfs(g, root, nodeSep, weight, height, depths, v) {
  1130. var children = g.children(v);
  1131. if (!children.length) {
  1132. if (v !== root) {
  1133. g.setEdge(root, v, { weight: 0, minlen: nodeSep });
  1134. }
  1135. return;
  1136. }
  1137. var top = util.addBorderNode(g, "_bt");
  1138. var bottom = util.addBorderNode(g, "_bb");
  1139. var label = g.node(v);
  1140. g.setParent(top, v);
  1141. label.borderTop = top;
  1142. g.setParent(bottom, v);
  1143. label.borderBottom = bottom;
  1144. _.forEach(children, function(child) {
  1145. dfs(g, root, nodeSep, weight, height, depths, child);
  1146. var childNode = g.node(child);
  1147. var childTop = childNode.borderTop ? childNode.borderTop : child;
  1148. var childBottom = childNode.borderBottom ? childNode.borderBottom : child;
  1149. var thisWeight = childNode.borderTop ? weight : 2 * weight;
  1150. var minlen = childTop !== childBottom ? 1 : height - depths[v] + 1;
  1151. g.setEdge(top, childTop, {
  1152. weight: thisWeight,
  1153. minlen: minlen,
  1154. nestingEdge: true
  1155. });
  1156. g.setEdge(childBottom, bottom, {
  1157. weight: thisWeight,
  1158. minlen: minlen,
  1159. nestingEdge: true
  1160. });
  1161. });
  1162. if (!g.parent(v)) {
  1163. g.setEdge(root, top, { weight: 0, minlen: height + depths[v] });
  1164. }
  1165. }
  1166. function treeDepths(g) {
  1167. var depths = {};
  1168. function dfs(v, depth) {
  1169. var children = g.children(v);
  1170. if (children && children.length) {
  1171. _.forEach(children, function(child) {
  1172. dfs(child, depth + 1);
  1173. });
  1174. }
  1175. depths[v] = depth;
  1176. }
  1177. _.forEach(g.children(), function(v) { dfs(v, 1); });
  1178. return depths;
  1179. }
  1180. function sumWeights(g) {
  1181. return _.reduce(g.edges(), function(acc, e) {
  1182. return acc + g.edge(e).weight;
  1183. }, 0);
  1184. }
  1185. function cleanup(g) {
  1186. var graphLabel = g.graph();
  1187. g.removeNode(graphLabel.nestingRoot);
  1188. delete graphLabel.nestingRoot;
  1189. _.forEach(g.edges(), function(e) {
  1190. var edge = g.edge(e);
  1191. if (edge.nestingEdge) {
  1192. g.removeEdge(e);
  1193. }
  1194. });
  1195. }
  1196. /***/ }),
  1197. /***/ "../../node_modules/dagre/lib/normalize.js":
  1198. /*!***************************************************************!*\
  1199. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/normalize.js ***!
  1200. \***************************************************************/
  1201. /*! no static exports found */
  1202. /***/ (function(module, exports, __webpack_require__) {
  1203. "use strict";
  1204. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/dagre/lib/lodash.js");
  1205. var util = __webpack_require__(/*! ./util */ "../../node_modules/dagre/lib/util.js");
  1206. module.exports = {
  1207. run: run,
  1208. undo: undo
  1209. };
  1210. /*
  1211. * Breaks any long edges in the graph into short segments that span 1 layer
  1212. * each. This operation is undoable with the denormalize function.
  1213. *
  1214. * Pre-conditions:
  1215. *
  1216. * 1. The input graph is a DAG.
  1217. * 2. Each node in the graph has a "rank" property.
  1218. *
  1219. * Post-condition:
  1220. *
  1221. * 1. All edges in the graph have a length of 1.
  1222. * 2. Dummy nodes are added where edges have been split into segments.
  1223. * 3. The graph is augmented with a "dummyChains" attribute which contains
  1224. * the first dummy in each chain of dummy nodes produced.
  1225. */
  1226. function run(g) {
  1227. g.graph().dummyChains = [];
  1228. _.forEach(g.edges(), function(edge) { normalizeEdge(g, edge); });
  1229. }
  1230. function normalizeEdge(g, e) {
  1231. var v = e.v;
  1232. var vRank = g.node(v).rank;
  1233. var w = e.w;
  1234. var wRank = g.node(w).rank;
  1235. var name = e.name;
  1236. var edgeLabel = g.edge(e);
  1237. var labelRank = edgeLabel.labelRank;
  1238. if (wRank === vRank + 1) return;
  1239. g.removeEdge(e);
  1240. var dummy, attrs, i;
  1241. for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) {
  1242. edgeLabel.points = [];
  1243. attrs = {
  1244. width: 0, height: 0,
  1245. edgeLabel: edgeLabel, edgeObj: e,
  1246. rank: vRank
  1247. };
  1248. dummy = util.addDummyNode(g, "edge", attrs, "_d");
  1249. if (vRank === labelRank) {
  1250. attrs.width = edgeLabel.width;
  1251. attrs.height = edgeLabel.height;
  1252. attrs.dummy = "edge-label";
  1253. attrs.labelpos = edgeLabel.labelpos;
  1254. }
  1255. g.setEdge(v, dummy, { weight: edgeLabel.weight }, name);
  1256. if (i === 0) {
  1257. g.graph().dummyChains.push(dummy);
  1258. }
  1259. v = dummy;
  1260. }
  1261. g.setEdge(v, w, { weight: edgeLabel.weight }, name);
  1262. }
  1263. function undo(g) {
  1264. _.forEach(g.graph().dummyChains, function(v) {
  1265. var node = g.node(v);
  1266. var origLabel = node.edgeLabel;
  1267. var w;
  1268. g.setEdge(node.edgeObj, origLabel);
  1269. while (node.dummy) {
  1270. w = g.successors(v)[0];
  1271. g.removeNode(v);
  1272. origLabel.points.push({ x: node.x, y: node.y });
  1273. if (node.dummy === "edge-label") {
  1274. origLabel.x = node.x;
  1275. origLabel.y = node.y;
  1276. origLabel.width = node.width;
  1277. origLabel.height = node.height;
  1278. }
  1279. v = w;
  1280. node = g.node(v);
  1281. }
  1282. });
  1283. }
  1284. /***/ }),
  1285. /***/ "../../node_modules/dagre/lib/order/add-subgraph-constraints.js":
  1286. /*!************************************************************************************!*\
  1287. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/order/add-subgraph-constraints.js ***!
  1288. \************************************************************************************/
  1289. /*! no static exports found */
  1290. /***/ (function(module, exports, __webpack_require__) {
  1291. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  1292. module.exports = addSubgraphConstraints;
  1293. function addSubgraphConstraints(g, cg, vs) {
  1294. var prev = {},
  1295. rootPrev;
  1296. _.forEach(vs, function(v) {
  1297. var child = g.parent(v),
  1298. parent,
  1299. prevChild;
  1300. while (child) {
  1301. parent = g.parent(child);
  1302. if (parent) {
  1303. prevChild = prev[parent];
  1304. prev[parent] = child;
  1305. } else {
  1306. prevChild = rootPrev;
  1307. rootPrev = child;
  1308. }
  1309. if (prevChild && prevChild !== child) {
  1310. cg.setEdge(prevChild, child);
  1311. return;
  1312. }
  1313. child = parent;
  1314. }
  1315. });
  1316. /*
  1317. function dfs(v) {
  1318. var children = v ? g.children(v) : g.children();
  1319. if (children.length) {
  1320. var min = Number.POSITIVE_INFINITY,
  1321. subgraphs = [];
  1322. _.each(children, function(child) {
  1323. var childMin = dfs(child);
  1324. if (g.children(child).length) {
  1325. subgraphs.push({ v: child, order: childMin });
  1326. }
  1327. min = Math.min(min, childMin);
  1328. });
  1329. _.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) {
  1330. cg.setEdge(prev.v, curr.v);
  1331. return curr;
  1332. });
  1333. return min;
  1334. }
  1335. return g.node(v).order;
  1336. }
  1337. dfs(undefined);
  1338. */
  1339. }
  1340. /***/ }),
  1341. /***/ "../../node_modules/dagre/lib/order/barycenter.js":
  1342. /*!**********************************************************************!*\
  1343. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/order/barycenter.js ***!
  1344. \**********************************************************************/
  1345. /*! no static exports found */
  1346. /***/ (function(module, exports, __webpack_require__) {
  1347. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  1348. module.exports = barycenter;
  1349. function barycenter(g, movable) {
  1350. return _.map(movable, function(v) {
  1351. var inV = g.inEdges(v);
  1352. if (!inV.length) {
  1353. return { v: v };
  1354. } else {
  1355. var result = _.reduce(inV, function(acc, e) {
  1356. var edge = g.edge(e),
  1357. nodeU = g.node(e.v);
  1358. return {
  1359. sum: acc.sum + (edge.weight * nodeU.order),
  1360. weight: acc.weight + edge.weight
  1361. };
  1362. }, { sum: 0, weight: 0 });
  1363. return {
  1364. v: v,
  1365. barycenter: result.sum / result.weight,
  1366. weight: result.weight
  1367. };
  1368. }
  1369. });
  1370. }
  1371. /***/ }),
  1372. /***/ "../../node_modules/dagre/lib/order/build-layer-graph.js":
  1373. /*!*****************************************************************************!*\
  1374. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/order/build-layer-graph.js ***!
  1375. \*****************************************************************************/
  1376. /*! no static exports found */
  1377. /***/ (function(module, exports, __webpack_require__) {
  1378. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  1379. var Graph = __webpack_require__(/*! ../graphlib */ "../../node_modules/dagre/lib/graphlib.js").Graph;
  1380. module.exports = buildLayerGraph;
  1381. /*
  1382. * Constructs a graph that can be used to sort a layer of nodes. The graph will
  1383. * contain all base and subgraph nodes from the request layer in their original
  1384. * hierarchy and any edges that are incident on these nodes and are of the type
  1385. * requested by the "relationship" parameter.
  1386. *
  1387. * Nodes from the requested rank that do not have parents are assigned a root
  1388. * node in the output graph, which is set in the root graph attribute. This
  1389. * makes it easy to walk the hierarchy of movable nodes during ordering.
  1390. *
  1391. * Pre-conditions:
  1392. *
  1393. * 1. Input graph is a DAG
  1394. * 2. Base nodes in the input graph have a rank attribute
  1395. * 3. Subgraph nodes in the input graph has minRank and maxRank attributes
  1396. * 4. Edges have an assigned weight
  1397. *
  1398. * Post-conditions:
  1399. *
  1400. * 1. Output graph has all nodes in the movable rank with preserved
  1401. * hierarchy.
  1402. * 2. Root nodes in the movable layer are made children of the node
  1403. * indicated by the root attribute of the graph.
  1404. * 3. Non-movable nodes incident on movable nodes, selected by the
  1405. * relationship parameter, are included in the graph (without hierarchy).
  1406. * 4. Edges incident on movable nodes, selected by the relationship
  1407. * parameter, are added to the output graph.
  1408. * 5. The weights for copied edges are aggregated as need, since the output
  1409. * graph is not a multi-graph.
  1410. */
  1411. function buildLayerGraph(g, rank, relationship) {
  1412. var root = createRootNode(g),
  1413. result = new Graph({ compound: true }).setGraph({ root: root })
  1414. .setDefaultNodeLabel(function(v) { return g.node(v); });
  1415. _.forEach(g.nodes(), function(v) {
  1416. var node = g.node(v),
  1417. parent = g.parent(v);
  1418. if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) {
  1419. result.setNode(v);
  1420. result.setParent(v, parent || root);
  1421. // This assumes we have only short edges!
  1422. _.forEach(g[relationship](v), function(e) {
  1423. var u = e.v === v ? e.w : e.v,
  1424. edge = result.edge(u, v),
  1425. weight = !_.isUndefined(edge) ? edge.weight : 0;
  1426. result.setEdge(u, v, { weight: g.edge(e).weight + weight });
  1427. });
  1428. if (_.has(node, "minRank")) {
  1429. result.setNode(v, {
  1430. borderLeft: node.borderLeft[rank],
  1431. borderRight: node.borderRight[rank]
  1432. });
  1433. }
  1434. }
  1435. });
  1436. return result;
  1437. }
  1438. function createRootNode(g) {
  1439. var v;
  1440. while (g.hasNode((v = _.uniqueId("_root"))));
  1441. return v;
  1442. }
  1443. /***/ }),
  1444. /***/ "../../node_modules/dagre/lib/order/cross-count.js":
  1445. /*!***********************************************************************!*\
  1446. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/order/cross-count.js ***!
  1447. \***********************************************************************/
  1448. /*! no static exports found */
  1449. /***/ (function(module, exports, __webpack_require__) {
  1450. "use strict";
  1451. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  1452. module.exports = crossCount;
  1453. /*
  1454. * A function that takes a layering (an array of layers, each with an array of
  1455. * ordererd nodes) and a graph and returns a weighted crossing count.
  1456. *
  1457. * Pre-conditions:
  1458. *
  1459. * 1. Input graph must be simple (not a multigraph), directed, and include
  1460. * only simple edges.
  1461. * 2. Edges in the input graph must have assigned weights.
  1462. *
  1463. * Post-conditions:
  1464. *
  1465. * 1. The graph and layering matrix are left unchanged.
  1466. *
  1467. * This algorithm is derived from Barth, et al., "Bilayer Cross Counting."
  1468. */
  1469. function crossCount(g, layering) {
  1470. var cc = 0;
  1471. for (var i = 1; i < layering.length; ++i) {
  1472. cc += twoLayerCrossCount(g, layering[i-1], layering[i]);
  1473. }
  1474. return cc;
  1475. }
  1476. function twoLayerCrossCount(g, northLayer, southLayer) {
  1477. // Sort all of the edges between the north and south layers by their position
  1478. // in the north layer and then the south. Map these edges to the position of
  1479. // their head in the south layer.
  1480. var southPos = _.zipObject(southLayer,
  1481. _.map(southLayer, function (v, i) { return i; }));
  1482. var southEntries = _.flatten(_.map(northLayer, function(v) {
  1483. return _.sortBy(_.map(g.outEdges(v), function(e) {
  1484. return { pos: southPos[e.w], weight: g.edge(e).weight };
  1485. }), "pos");
  1486. }), true);
  1487. // Build the accumulator tree
  1488. var firstIndex = 1;
  1489. while (firstIndex < southLayer.length) firstIndex <<= 1;
  1490. var treeSize = 2 * firstIndex - 1;
  1491. firstIndex -= 1;
  1492. var tree = _.map(new Array(treeSize), function() { return 0; });
  1493. // Calculate the weighted crossings
  1494. var cc = 0;
  1495. _.forEach(southEntries.forEach(function(entry) {
  1496. var index = entry.pos + firstIndex;
  1497. tree[index] += entry.weight;
  1498. var weightSum = 0;
  1499. while (index > 0) {
  1500. if (index % 2) {
  1501. weightSum += tree[index + 1];
  1502. }
  1503. index = (index - 1) >> 1;
  1504. tree[index] += entry.weight;
  1505. }
  1506. cc += entry.weight * weightSum;
  1507. }));
  1508. return cc;
  1509. }
  1510. /***/ }),
  1511. /***/ "../../node_modules/dagre/lib/order/index.js":
  1512. /*!*****************************************************************!*\
  1513. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/order/index.js ***!
  1514. \*****************************************************************/
  1515. /*! no static exports found */
  1516. /***/ (function(module, exports, __webpack_require__) {
  1517. "use strict";
  1518. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  1519. var initOrder = __webpack_require__(/*! ./init-order */ "../../node_modules/dagre/lib/order/init-order.js");
  1520. var crossCount = __webpack_require__(/*! ./cross-count */ "../../node_modules/dagre/lib/order/cross-count.js");
  1521. var sortSubgraph = __webpack_require__(/*! ./sort-subgraph */ "../../node_modules/dagre/lib/order/sort-subgraph.js");
  1522. var buildLayerGraph = __webpack_require__(/*! ./build-layer-graph */ "../../node_modules/dagre/lib/order/build-layer-graph.js");
  1523. var addSubgraphConstraints = __webpack_require__(/*! ./add-subgraph-constraints */ "../../node_modules/dagre/lib/order/add-subgraph-constraints.js");
  1524. var Graph = __webpack_require__(/*! ../graphlib */ "../../node_modules/dagre/lib/graphlib.js").Graph;
  1525. var util = __webpack_require__(/*! ../util */ "../../node_modules/dagre/lib/util.js");
  1526. module.exports = order;
  1527. /*
  1528. * Applies heuristics to minimize edge crossings in the graph and sets the best
  1529. * order solution as an order attribute on each node.
  1530. *
  1531. * Pre-conditions:
  1532. *
  1533. * 1. Graph must be DAG
  1534. * 2. Graph nodes must be objects with a "rank" attribute
  1535. * 3. Graph edges must have the "weight" attribute
  1536. *
  1537. * Post-conditions:
  1538. *
  1539. * 1. Graph nodes will have an "order" attribute based on the results of the
  1540. * algorithm.
  1541. */
  1542. function order(g) {
  1543. var maxRank = util.maxRank(g),
  1544. downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"),
  1545. upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges");
  1546. var layering = initOrder(g);
  1547. assignOrder(g, layering);
  1548. var bestCC = Number.POSITIVE_INFINITY,
  1549. best;
  1550. for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) {
  1551. sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2);
  1552. layering = util.buildLayerMatrix(g);
  1553. var cc = crossCount(g, layering);
  1554. if (cc < bestCC) {
  1555. lastBest = 0;
  1556. best = _.cloneDeep(layering);
  1557. bestCC = cc;
  1558. }
  1559. }
  1560. assignOrder(g, best);
  1561. }
  1562. function buildLayerGraphs(g, ranks, relationship) {
  1563. return _.map(ranks, function(rank) {
  1564. return buildLayerGraph(g, rank, relationship);
  1565. });
  1566. }
  1567. function sweepLayerGraphs(layerGraphs, biasRight) {
  1568. var cg = new Graph();
  1569. _.forEach(layerGraphs, function(lg) {
  1570. var root = lg.graph().root;
  1571. var sorted = sortSubgraph(lg, root, cg, biasRight);
  1572. _.forEach(sorted.vs, function(v, i) {
  1573. lg.node(v).order = i;
  1574. });
  1575. addSubgraphConstraints(lg, cg, sorted.vs);
  1576. });
  1577. }
  1578. function assignOrder(g, layering) {
  1579. _.forEach(layering, function(layer) {
  1580. _.forEach(layer, function(v, i) {
  1581. g.node(v).order = i;
  1582. });
  1583. });
  1584. }
  1585. /***/ }),
  1586. /***/ "../../node_modules/dagre/lib/order/init-order.js":
  1587. /*!**********************************************************************!*\
  1588. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/order/init-order.js ***!
  1589. \**********************************************************************/
  1590. /*! no static exports found */
  1591. /***/ (function(module, exports, __webpack_require__) {
  1592. "use strict";
  1593. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  1594. module.exports = initOrder;
  1595. /*
  1596. * Assigns an initial order value for each node by performing a DFS search
  1597. * starting from nodes in the first rank. Nodes are assigned an order in their
  1598. * rank as they are first visited.
  1599. *
  1600. * This approach comes from Gansner, et al., "A Technique for Drawing Directed
  1601. * Graphs."
  1602. *
  1603. * Returns a layering matrix with an array per layer and each layer sorted by
  1604. * the order of its nodes.
  1605. */
  1606. function initOrder(g) {
  1607. var visited = {};
  1608. var simpleNodes = _.filter(g.nodes(), function(v) {
  1609. return !g.children(v).length;
  1610. });
  1611. var maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; }));
  1612. var layers = _.map(_.range(maxRank + 1), function() { return []; });
  1613. function dfs(v) {
  1614. if (_.has(visited, v)) return;
  1615. visited[v] = true;
  1616. var node = g.node(v);
  1617. layers[node.rank].push(v);
  1618. _.forEach(g.successors(v), dfs);
  1619. }
  1620. var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; });
  1621. _.forEach(orderedVs, dfs);
  1622. return layers;
  1623. }
  1624. /***/ }),
  1625. /***/ "../../node_modules/dagre/lib/order/resolve-conflicts.js":
  1626. /*!*****************************************************************************!*\
  1627. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/order/resolve-conflicts.js ***!
  1628. \*****************************************************************************/
  1629. /*! no static exports found */
  1630. /***/ (function(module, exports, __webpack_require__) {
  1631. "use strict";
  1632. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  1633. module.exports = resolveConflicts;
  1634. /*
  1635. * Given a list of entries of the form {v, barycenter, weight} and a
  1636. * constraint graph this function will resolve any conflicts between the
  1637. * constraint graph and the barycenters for the entries. If the barycenters for
  1638. * an entry would violate a constraint in the constraint graph then we coalesce
  1639. * the nodes in the conflict into a new node that respects the contraint and
  1640. * aggregates barycenter and weight information.
  1641. *
  1642. * This implementation is based on the description in Forster, "A Fast and
  1643. * Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it
  1644. * differs in some specific details.
  1645. *
  1646. * Pre-conditions:
  1647. *
  1648. * 1. Each entry has the form {v, barycenter, weight}, or if the node has
  1649. * no barycenter, then {v}.
  1650. *
  1651. * Returns:
  1652. *
  1653. * A new list of entries of the form {vs, i, barycenter, weight}. The list
  1654. * `vs` may either be a singleton or it may be an aggregation of nodes
  1655. * ordered such that they do not violate constraints from the constraint
  1656. * graph. The property `i` is the lowest original index of any of the
  1657. * elements in `vs`.
  1658. */
  1659. function resolveConflicts(entries, cg) {
  1660. var mappedEntries = {};
  1661. _.forEach(entries, function(entry, i) {
  1662. var tmp = mappedEntries[entry.v] = {
  1663. indegree: 0,
  1664. "in": [],
  1665. out: [],
  1666. vs: [entry.v],
  1667. i: i
  1668. };
  1669. if (!_.isUndefined(entry.barycenter)) {
  1670. tmp.barycenter = entry.barycenter;
  1671. tmp.weight = entry.weight;
  1672. }
  1673. });
  1674. _.forEach(cg.edges(), function(e) {
  1675. var entryV = mappedEntries[e.v];
  1676. var entryW = mappedEntries[e.w];
  1677. if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) {
  1678. entryW.indegree++;
  1679. entryV.out.push(mappedEntries[e.w]);
  1680. }
  1681. });
  1682. var sourceSet = _.filter(mappedEntries, function(entry) {
  1683. return !entry.indegree;
  1684. });
  1685. return doResolveConflicts(sourceSet);
  1686. }
  1687. function doResolveConflicts(sourceSet) {
  1688. var entries = [];
  1689. function handleIn(vEntry) {
  1690. return function(uEntry) {
  1691. if (uEntry.merged) {
  1692. return;
  1693. }
  1694. if (_.isUndefined(uEntry.barycenter) ||
  1695. _.isUndefined(vEntry.barycenter) ||
  1696. uEntry.barycenter >= vEntry.barycenter) {
  1697. mergeEntries(vEntry, uEntry);
  1698. }
  1699. };
  1700. }
  1701. function handleOut(vEntry) {
  1702. return function(wEntry) {
  1703. wEntry["in"].push(vEntry);
  1704. if (--wEntry.indegree === 0) {
  1705. sourceSet.push(wEntry);
  1706. }
  1707. };
  1708. }
  1709. while (sourceSet.length) {
  1710. var entry = sourceSet.pop();
  1711. entries.push(entry);
  1712. _.forEach(entry["in"].reverse(), handleIn(entry));
  1713. _.forEach(entry.out, handleOut(entry));
  1714. }
  1715. return _.map(_.filter(entries, function(entry) { return !entry.merged; }),
  1716. function(entry) {
  1717. return _.pick(entry, ["vs", "i", "barycenter", "weight"]);
  1718. });
  1719. }
  1720. function mergeEntries(target, source) {
  1721. var sum = 0;
  1722. var weight = 0;
  1723. if (target.weight) {
  1724. sum += target.barycenter * target.weight;
  1725. weight += target.weight;
  1726. }
  1727. if (source.weight) {
  1728. sum += source.barycenter * source.weight;
  1729. weight += source.weight;
  1730. }
  1731. target.vs = source.vs.concat(target.vs);
  1732. target.barycenter = sum / weight;
  1733. target.weight = weight;
  1734. target.i = Math.min(source.i, target.i);
  1735. source.merged = true;
  1736. }
  1737. /***/ }),
  1738. /***/ "../../node_modules/dagre/lib/order/sort-subgraph.js":
  1739. /*!*************************************************************************!*\
  1740. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/order/sort-subgraph.js ***!
  1741. \*************************************************************************/
  1742. /*! no static exports found */
  1743. /***/ (function(module, exports, __webpack_require__) {
  1744. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  1745. var barycenter = __webpack_require__(/*! ./barycenter */ "../../node_modules/dagre/lib/order/barycenter.js");
  1746. var resolveConflicts = __webpack_require__(/*! ./resolve-conflicts */ "../../node_modules/dagre/lib/order/resolve-conflicts.js");
  1747. var sort = __webpack_require__(/*! ./sort */ "../../node_modules/dagre/lib/order/sort.js");
  1748. module.exports = sortSubgraph;
  1749. function sortSubgraph(g, v, cg, biasRight) {
  1750. var movable = g.children(v);
  1751. var node = g.node(v);
  1752. var bl = node ? node.borderLeft : undefined;
  1753. var br = node ? node.borderRight: undefined;
  1754. var subgraphs = {};
  1755. if (bl) {
  1756. movable = _.filter(movable, function(w) {
  1757. return w !== bl && w !== br;
  1758. });
  1759. }
  1760. var barycenters = barycenter(g, movable);
  1761. _.forEach(barycenters, function(entry) {
  1762. if (g.children(entry.v).length) {
  1763. var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight);
  1764. subgraphs[entry.v] = subgraphResult;
  1765. if (_.has(subgraphResult, "barycenter")) {
  1766. mergeBarycenters(entry, subgraphResult);
  1767. }
  1768. }
  1769. });
  1770. var entries = resolveConflicts(barycenters, cg);
  1771. expandSubgraphs(entries, subgraphs);
  1772. var result = sort(entries, biasRight);
  1773. if (bl) {
  1774. result.vs = _.flatten([bl, result.vs, br], true);
  1775. if (g.predecessors(bl).length) {
  1776. var blPred = g.node(g.predecessors(bl)[0]),
  1777. brPred = g.node(g.predecessors(br)[0]);
  1778. if (!_.has(result, "barycenter")) {
  1779. result.barycenter = 0;
  1780. result.weight = 0;
  1781. }
  1782. result.barycenter = (result.barycenter * result.weight +
  1783. blPred.order + brPred.order) / (result.weight + 2);
  1784. result.weight += 2;
  1785. }
  1786. }
  1787. return result;
  1788. }
  1789. function expandSubgraphs(entries, subgraphs) {
  1790. _.forEach(entries, function(entry) {
  1791. entry.vs = _.flatten(entry.vs.map(function(v) {
  1792. if (subgraphs[v]) {
  1793. return subgraphs[v].vs;
  1794. }
  1795. return v;
  1796. }), true);
  1797. });
  1798. }
  1799. function mergeBarycenters(target, other) {
  1800. if (!_.isUndefined(target.barycenter)) {
  1801. target.barycenter = (target.barycenter * target.weight +
  1802. other.barycenter * other.weight) /
  1803. (target.weight + other.weight);
  1804. target.weight += other.weight;
  1805. } else {
  1806. target.barycenter = other.barycenter;
  1807. target.weight = other.weight;
  1808. }
  1809. }
  1810. /***/ }),
  1811. /***/ "../../node_modules/dagre/lib/order/sort.js":
  1812. /*!****************************************************************!*\
  1813. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/order/sort.js ***!
  1814. \****************************************************************/
  1815. /*! no static exports found */
  1816. /***/ (function(module, exports, __webpack_require__) {
  1817. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  1818. var util = __webpack_require__(/*! ../util */ "../../node_modules/dagre/lib/util.js");
  1819. module.exports = sort;
  1820. function sort(entries, biasRight) {
  1821. var parts = util.partition(entries, function(entry) {
  1822. return _.has(entry, "barycenter");
  1823. });
  1824. var sortable = parts.lhs,
  1825. unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }),
  1826. vs = [],
  1827. sum = 0,
  1828. weight = 0,
  1829. vsIndex = 0;
  1830. sortable.sort(compareWithBias(!!biasRight));
  1831. vsIndex = consumeUnsortable(vs, unsortable, vsIndex);
  1832. _.forEach(sortable, function (entry) {
  1833. vsIndex += entry.vs.length;
  1834. vs.push(entry.vs);
  1835. sum += entry.barycenter * entry.weight;
  1836. weight += entry.weight;
  1837. vsIndex = consumeUnsortable(vs, unsortable, vsIndex);
  1838. });
  1839. var result = { vs: _.flatten(vs, true) };
  1840. if (weight) {
  1841. result.barycenter = sum / weight;
  1842. result.weight = weight;
  1843. }
  1844. return result;
  1845. }
  1846. function consumeUnsortable(vs, unsortable, index) {
  1847. var last;
  1848. while (unsortable.length && (last = _.last(unsortable)).i <= index) {
  1849. unsortable.pop();
  1850. vs.push(last.vs);
  1851. index++;
  1852. }
  1853. return index;
  1854. }
  1855. function compareWithBias(bias) {
  1856. return function(entryV, entryW) {
  1857. if (entryV.barycenter < entryW.barycenter) {
  1858. return -1;
  1859. } else if (entryV.barycenter > entryW.barycenter) {
  1860. return 1;
  1861. }
  1862. return !bias ? entryV.i - entryW.i : entryW.i - entryV.i;
  1863. };
  1864. }
  1865. /***/ }),
  1866. /***/ "../../node_modules/dagre/lib/parent-dummy-chains.js":
  1867. /*!*************************************************************************!*\
  1868. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/parent-dummy-chains.js ***!
  1869. \*************************************************************************/
  1870. /*! no static exports found */
  1871. /***/ (function(module, exports, __webpack_require__) {
  1872. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/dagre/lib/lodash.js");
  1873. module.exports = parentDummyChains;
  1874. function parentDummyChains(g) {
  1875. var postorderNums = postorder(g);
  1876. _.forEach(g.graph().dummyChains, function(v) {
  1877. var node = g.node(v);
  1878. var edgeObj = node.edgeObj;
  1879. var pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w);
  1880. var path = pathData.path;
  1881. var lca = pathData.lca;
  1882. var pathIdx = 0;
  1883. var pathV = path[pathIdx];
  1884. var ascending = true;
  1885. while (v !== edgeObj.w) {
  1886. node = g.node(v);
  1887. if (ascending) {
  1888. while ((pathV = path[pathIdx]) !== lca &&
  1889. g.node(pathV).maxRank < node.rank) {
  1890. pathIdx++;
  1891. }
  1892. if (pathV === lca) {
  1893. ascending = false;
  1894. }
  1895. }
  1896. if (!ascending) {
  1897. while (pathIdx < path.length - 1 &&
  1898. g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) {
  1899. pathIdx++;
  1900. }
  1901. pathV = path[pathIdx];
  1902. }
  1903. g.setParent(v, pathV);
  1904. v = g.successors(v)[0];
  1905. }
  1906. });
  1907. }
  1908. // Find a path from v to w through the lowest common ancestor (LCA). Return the
  1909. // full path and the LCA.
  1910. function findPath(g, postorderNums, v, w) {
  1911. var vPath = [];
  1912. var wPath = [];
  1913. var low = Math.min(postorderNums[v].low, postorderNums[w].low);
  1914. var lim = Math.max(postorderNums[v].lim, postorderNums[w].lim);
  1915. var parent;
  1916. var lca;
  1917. // Traverse up from v to find the LCA
  1918. parent = v;
  1919. do {
  1920. parent = g.parent(parent);
  1921. vPath.push(parent);
  1922. } while (parent &&
  1923. (postorderNums[parent].low > low || lim > postorderNums[parent].lim));
  1924. lca = parent;
  1925. // Traverse from w to LCA
  1926. parent = w;
  1927. while ((parent = g.parent(parent)) !== lca) {
  1928. wPath.push(parent);
  1929. }
  1930. return { path: vPath.concat(wPath.reverse()), lca: lca };
  1931. }
  1932. function postorder(g) {
  1933. var result = {};
  1934. var lim = 0;
  1935. function dfs(v) {
  1936. var low = lim;
  1937. _.forEach(g.children(v), dfs);
  1938. result[v] = { low: low, lim: lim++ };
  1939. }
  1940. _.forEach(g.children(), dfs);
  1941. return result;
  1942. }
  1943. /***/ }),
  1944. /***/ "../../node_modules/dagre/lib/position/bk.js":
  1945. /*!*****************************************************************!*\
  1946. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/position/bk.js ***!
  1947. \*****************************************************************/
  1948. /*! no static exports found */
  1949. /***/ (function(module, exports, __webpack_require__) {
  1950. "use strict";
  1951. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  1952. var Graph = __webpack_require__(/*! ../graphlib */ "../../node_modules/dagre/lib/graphlib.js").Graph;
  1953. var util = __webpack_require__(/*! ../util */ "../../node_modules/dagre/lib/util.js");
  1954. /*
  1955. * This module provides coordinate assignment based on Brandes and Köpf, "Fast
  1956. * and Simple Horizontal Coordinate Assignment."
  1957. */
  1958. module.exports = {
  1959. positionX: positionX,
  1960. findType1Conflicts: findType1Conflicts,
  1961. findType2Conflicts: findType2Conflicts,
  1962. addConflict: addConflict,
  1963. hasConflict: hasConflict,
  1964. verticalAlignment: verticalAlignment,
  1965. horizontalCompaction: horizontalCompaction,
  1966. alignCoordinates: alignCoordinates,
  1967. findSmallestWidthAlignment: findSmallestWidthAlignment,
  1968. balance: balance
  1969. };
  1970. /*
  1971. * Marks all edges in the graph with a type-1 conflict with the "type1Conflict"
  1972. * property. A type-1 conflict is one where a non-inner segment crosses an
  1973. * inner segment. An inner segment is an edge with both incident nodes marked
  1974. * with the "dummy" property.
  1975. *
  1976. * This algorithm scans layer by layer, starting with the second, for type-1
  1977. * conflicts between the current layer and the previous layer. For each layer
  1978. * it scans the nodes from left to right until it reaches one that is incident
  1979. * on an inner segment. It then scans predecessors to determine if they have
  1980. * edges that cross that inner segment. At the end a final scan is done for all
  1981. * nodes on the current rank to see if they cross the last visited inner
  1982. * segment.
  1983. *
  1984. * This algorithm (safely) assumes that a dummy node will only be incident on a
  1985. * single node in the layers being scanned.
  1986. */
  1987. function findType1Conflicts(g, layering) {
  1988. var conflicts = {};
  1989. function visitLayer(prevLayer, layer) {
  1990. var
  1991. // last visited node in the previous layer that is incident on an inner
  1992. // segment.
  1993. k0 = 0,
  1994. // Tracks the last node in this layer scanned for crossings with a type-1
  1995. // segment.
  1996. scanPos = 0,
  1997. prevLayerLength = prevLayer.length,
  1998. lastNode = _.last(layer);
  1999. _.forEach(layer, function(v, i) {
  2000. var w = findOtherInnerSegmentNode(g, v),
  2001. k1 = w ? g.node(w).order : prevLayerLength;
  2002. if (w || v === lastNode) {
  2003. _.forEach(layer.slice(scanPos, i +1), function(scanNode) {
  2004. _.forEach(g.predecessors(scanNode), function(u) {
  2005. var uLabel = g.node(u),
  2006. uPos = uLabel.order;
  2007. if ((uPos < k0 || k1 < uPos) &&
  2008. !(uLabel.dummy && g.node(scanNode).dummy)) {
  2009. addConflict(conflicts, u, scanNode);
  2010. }
  2011. });
  2012. });
  2013. scanPos = i + 1;
  2014. k0 = k1;
  2015. }
  2016. });
  2017. return layer;
  2018. }
  2019. _.reduce(layering, visitLayer);
  2020. return conflicts;
  2021. }
  2022. function findType2Conflicts(g, layering) {
  2023. var conflicts = {};
  2024. function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {
  2025. var v;
  2026. _.forEach(_.range(southPos, southEnd), function(i) {
  2027. v = south[i];
  2028. if (g.node(v).dummy) {
  2029. _.forEach(g.predecessors(v), function(u) {
  2030. var uNode = g.node(u);
  2031. if (uNode.dummy &&
  2032. (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) {
  2033. addConflict(conflicts, u, v);
  2034. }
  2035. });
  2036. }
  2037. });
  2038. }
  2039. function visitLayer(north, south) {
  2040. var prevNorthPos = -1,
  2041. nextNorthPos,
  2042. southPos = 0;
  2043. _.forEach(south, function(v, southLookahead) {
  2044. if (g.node(v).dummy === "border") {
  2045. var predecessors = g.predecessors(v);
  2046. if (predecessors.length) {
  2047. nextNorthPos = g.node(predecessors[0]).order;
  2048. scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos);
  2049. southPos = southLookahead;
  2050. prevNorthPos = nextNorthPos;
  2051. }
  2052. }
  2053. scan(south, southPos, south.length, nextNorthPos, north.length);
  2054. });
  2055. return south;
  2056. }
  2057. _.reduce(layering, visitLayer);
  2058. return conflicts;
  2059. }
  2060. function findOtherInnerSegmentNode(g, v) {
  2061. if (g.node(v).dummy) {
  2062. return _.find(g.predecessors(v), function(u) {
  2063. return g.node(u).dummy;
  2064. });
  2065. }
  2066. }
  2067. function addConflict(conflicts, v, w) {
  2068. if (v > w) {
  2069. var tmp = v;
  2070. v = w;
  2071. w = tmp;
  2072. }
  2073. var conflictsV = conflicts[v];
  2074. if (!conflictsV) {
  2075. conflicts[v] = conflictsV = {};
  2076. }
  2077. conflictsV[w] = true;
  2078. }
  2079. function hasConflict(conflicts, v, w) {
  2080. if (v > w) {
  2081. var tmp = v;
  2082. v = w;
  2083. w = tmp;
  2084. }
  2085. return _.has(conflicts[v], w);
  2086. }
  2087. /*
  2088. * Try to align nodes into vertical "blocks" where possible. This algorithm
  2089. * attempts to align a node with one of its median neighbors. If the edge
  2090. * connecting a neighbor is a type-1 conflict then we ignore that possibility.
  2091. * If a previous node has already formed a block with a node after the node
  2092. * we're trying to form a block with, we also ignore that possibility - our
  2093. * blocks would be split in that scenario.
  2094. */
  2095. function verticalAlignment(g, layering, conflicts, neighborFn) {
  2096. var root = {},
  2097. align = {},
  2098. pos = {};
  2099. // We cache the position here based on the layering because the graph and
  2100. // layering may be out of sync. The layering matrix is manipulated to
  2101. // generate different extreme alignments.
  2102. _.forEach(layering, function(layer) {
  2103. _.forEach(layer, function(v, order) {
  2104. root[v] = v;
  2105. align[v] = v;
  2106. pos[v] = order;
  2107. });
  2108. });
  2109. _.forEach(layering, function(layer) {
  2110. var prevIdx = -1;
  2111. _.forEach(layer, function(v) {
  2112. var ws = neighborFn(v);
  2113. if (ws.length) {
  2114. ws = _.sortBy(ws, function(w) { return pos[w]; });
  2115. var mp = (ws.length - 1) / 2;
  2116. for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) {
  2117. var w = ws[i];
  2118. if (align[v] === v &&
  2119. prevIdx < pos[w] &&
  2120. !hasConflict(conflicts, v, w)) {
  2121. align[w] = v;
  2122. align[v] = root[v] = root[w];
  2123. prevIdx = pos[w];
  2124. }
  2125. }
  2126. }
  2127. });
  2128. });
  2129. return { root: root, align: align };
  2130. }
  2131. function horizontalCompaction(g, layering, root, align, reverseSep) {
  2132. // This portion of the algorithm differs from BK due to a number of problems.
  2133. // Instead of their algorithm we construct a new block graph and do two
  2134. // sweeps. The first sweep places blocks with the smallest possible
  2135. // coordinates. The second sweep removes unused space by moving blocks to the
  2136. // greatest coordinates without violating separation.
  2137. var xs = {},
  2138. blockG = buildBlockGraph(g, layering, root, reverseSep),
  2139. borderType = reverseSep ? "borderLeft" : "borderRight";
  2140. function iterate(setXsFunc, nextNodesFunc) {
  2141. var stack = blockG.nodes();
  2142. var elem = stack.pop();
  2143. var visited = {};
  2144. while (elem) {
  2145. if (visited[elem]) {
  2146. setXsFunc(elem);
  2147. } else {
  2148. visited[elem] = true;
  2149. stack.push(elem);
  2150. stack = stack.concat(nextNodesFunc(elem));
  2151. }
  2152. elem = stack.pop();
  2153. }
  2154. }
  2155. // First pass, assign smallest coordinates
  2156. function pass1(elem) {
  2157. xs[elem] = blockG.inEdges(elem).reduce(function(acc, e) {
  2158. return Math.max(acc, xs[e.v] + blockG.edge(e));
  2159. }, 0);
  2160. }
  2161. // Second pass, assign greatest coordinates
  2162. function pass2(elem) {
  2163. var min = blockG.outEdges(elem).reduce(function(acc, e) {
  2164. return Math.min(acc, xs[e.w] - blockG.edge(e));
  2165. }, Number.POSITIVE_INFINITY);
  2166. var node = g.node(elem);
  2167. if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) {
  2168. xs[elem] = Math.max(xs[elem], min);
  2169. }
  2170. }
  2171. iterate(pass1, blockG.predecessors.bind(blockG));
  2172. iterate(pass2, blockG.successors.bind(blockG));
  2173. // Assign x coordinates to all nodes
  2174. _.forEach(align, function(v) {
  2175. xs[v] = xs[root[v]];
  2176. });
  2177. return xs;
  2178. }
  2179. function buildBlockGraph(g, layering, root, reverseSep) {
  2180. var blockGraph = new Graph(),
  2181. graphLabel = g.graph(),
  2182. sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep);
  2183. _.forEach(layering, function(layer) {
  2184. var u;
  2185. _.forEach(layer, function(v) {
  2186. var vRoot = root[v];
  2187. blockGraph.setNode(vRoot);
  2188. if (u) {
  2189. var uRoot = root[u],
  2190. prevMax = blockGraph.edge(uRoot, vRoot);
  2191. blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0));
  2192. }
  2193. u = v;
  2194. });
  2195. });
  2196. return blockGraph;
  2197. }
  2198. /*
  2199. * Returns the alignment that has the smallest width of the given alignments.
  2200. */
  2201. function findSmallestWidthAlignment(g, xss) {
  2202. return _.minBy(_.values(xss), function (xs) {
  2203. var max = Number.NEGATIVE_INFINITY;
  2204. var min = Number.POSITIVE_INFINITY;
  2205. _.forIn(xs, function (x, v) {
  2206. var halfWidth = width(g, v) / 2;
  2207. max = Math.max(x + halfWidth, max);
  2208. min = Math.min(x - halfWidth, min);
  2209. });
  2210. return max - min;
  2211. });
  2212. }
  2213. /*
  2214. * Align the coordinates of each of the layout alignments such that
  2215. * left-biased alignments have their minimum coordinate at the same point as
  2216. * the minimum coordinate of the smallest width alignment and right-biased
  2217. * alignments have their maximum coordinate at the same point as the maximum
  2218. * coordinate of the smallest width alignment.
  2219. */
  2220. function alignCoordinates(xss, alignTo) {
  2221. var alignToVals = _.values(alignTo),
  2222. alignToMin = _.min(alignToVals),
  2223. alignToMax = _.max(alignToVals);
  2224. _.forEach(["u", "d"], function(vert) {
  2225. _.forEach(["l", "r"], function(horiz) {
  2226. var alignment = vert + horiz,
  2227. xs = xss[alignment],
  2228. delta;
  2229. if (xs === alignTo) return;
  2230. var xsVals = _.values(xs);
  2231. delta = horiz === "l" ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals);
  2232. if (delta) {
  2233. xss[alignment] = _.mapValues(xs, function(x) { return x + delta; });
  2234. }
  2235. });
  2236. });
  2237. }
  2238. function balance(xss, align) {
  2239. return _.mapValues(xss.ul, function(ignore, v) {
  2240. if (align) {
  2241. return xss[align.toLowerCase()][v];
  2242. } else {
  2243. var xs = _.sortBy(_.map(xss, v));
  2244. return (xs[1] + xs[2]) / 2;
  2245. }
  2246. });
  2247. }
  2248. function positionX(g) {
  2249. var layering = util.buildLayerMatrix(g);
  2250. var conflicts = _.merge(
  2251. findType1Conflicts(g, layering),
  2252. findType2Conflicts(g, layering));
  2253. var xss = {};
  2254. var adjustedLayering;
  2255. _.forEach(["u", "d"], function(vert) {
  2256. adjustedLayering = vert === "u" ? layering : _.values(layering).reverse();
  2257. _.forEach(["l", "r"], function(horiz) {
  2258. if (horiz === "r") {
  2259. adjustedLayering = _.map(adjustedLayering, function(inner) {
  2260. return _.values(inner).reverse();
  2261. });
  2262. }
  2263. var neighborFn = (vert === "u" ? g.predecessors : g.successors).bind(g);
  2264. var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn);
  2265. var xs = horizontalCompaction(g, adjustedLayering,
  2266. align.root, align.align, horiz === "r");
  2267. if (horiz === "r") {
  2268. xs = _.mapValues(xs, function(x) { return -x; });
  2269. }
  2270. xss[vert + horiz] = xs;
  2271. });
  2272. });
  2273. var smallestWidth = findSmallestWidthAlignment(g, xss);
  2274. alignCoordinates(xss, smallestWidth);
  2275. return balance(xss, g.graph().align);
  2276. }
  2277. function sep(nodeSep, edgeSep, reverseSep) {
  2278. return function(g, v, w) {
  2279. var vLabel = g.node(v);
  2280. var wLabel = g.node(w);
  2281. var sum = 0;
  2282. var delta;
  2283. sum += vLabel.width / 2;
  2284. if (_.has(vLabel, "labelpos")) {
  2285. switch (vLabel.labelpos.toLowerCase()) {
  2286. case "l": delta = -vLabel.width / 2; break;
  2287. case "r": delta = vLabel.width / 2; break;
  2288. }
  2289. }
  2290. if (delta) {
  2291. sum += reverseSep ? delta : -delta;
  2292. }
  2293. delta = 0;
  2294. sum += (vLabel.dummy ? edgeSep : nodeSep) / 2;
  2295. sum += (wLabel.dummy ? edgeSep : nodeSep) / 2;
  2296. sum += wLabel.width / 2;
  2297. if (_.has(wLabel, "labelpos")) {
  2298. switch (wLabel.labelpos.toLowerCase()) {
  2299. case "l": delta = wLabel.width / 2; break;
  2300. case "r": delta = -wLabel.width / 2; break;
  2301. }
  2302. }
  2303. if (delta) {
  2304. sum += reverseSep ? delta : -delta;
  2305. }
  2306. delta = 0;
  2307. return sum;
  2308. };
  2309. }
  2310. function width(g, v) {
  2311. return g.node(v).width;
  2312. }
  2313. /***/ }),
  2314. /***/ "../../node_modules/dagre/lib/position/index.js":
  2315. /*!********************************************************************!*\
  2316. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/position/index.js ***!
  2317. \********************************************************************/
  2318. /*! no static exports found */
  2319. /***/ (function(module, exports, __webpack_require__) {
  2320. "use strict";
  2321. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  2322. var util = __webpack_require__(/*! ../util */ "../../node_modules/dagre/lib/util.js");
  2323. var positionX = __webpack_require__(/*! ./bk */ "../../node_modules/dagre/lib/position/bk.js").positionX;
  2324. module.exports = position;
  2325. function position(g) {
  2326. g = util.asNonCompoundGraph(g);
  2327. positionY(g);
  2328. _.forEach(positionX(g), function(x, v) {
  2329. g.node(v).x = x;
  2330. });
  2331. }
  2332. function positionY(g) {
  2333. var layering = util.buildLayerMatrix(g);
  2334. var rankSep = g.graph().ranksep;
  2335. var prevY = 0;
  2336. _.forEach(layering, function(layer) {
  2337. var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; }));
  2338. _.forEach(layer, function(v) {
  2339. g.node(v).y = prevY + maxHeight / 2;
  2340. });
  2341. prevY += maxHeight + rankSep;
  2342. });
  2343. }
  2344. /***/ }),
  2345. /***/ "../../node_modules/dagre/lib/rank/feasible-tree.js":
  2346. /*!************************************************************************!*\
  2347. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/rank/feasible-tree.js ***!
  2348. \************************************************************************/
  2349. /*! no static exports found */
  2350. /***/ (function(module, exports, __webpack_require__) {
  2351. "use strict";
  2352. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  2353. var Graph = __webpack_require__(/*! ../graphlib */ "../../node_modules/dagre/lib/graphlib.js").Graph;
  2354. var slack = __webpack_require__(/*! ./util */ "../../node_modules/dagre/lib/rank/util.js").slack;
  2355. module.exports = feasibleTree;
  2356. /*
  2357. * Constructs a spanning tree with tight edges and adjusted the input node's
  2358. * ranks to achieve this. A tight edge is one that is has a length that matches
  2359. * its "minlen" attribute.
  2360. *
  2361. * The basic structure for this function is derived from Gansner, et al., "A
  2362. * Technique for Drawing Directed Graphs."
  2363. *
  2364. * Pre-conditions:
  2365. *
  2366. * 1. Graph must be a DAG.
  2367. * 2. Graph must be connected.
  2368. * 3. Graph must have at least one node.
  2369. * 5. Graph nodes must have been previously assigned a "rank" property that
  2370. * respects the "minlen" property of incident edges.
  2371. * 6. Graph edges must have a "minlen" property.
  2372. *
  2373. * Post-conditions:
  2374. *
  2375. * - Graph nodes will have their rank adjusted to ensure that all edges are
  2376. * tight.
  2377. *
  2378. * Returns a tree (undirected graph) that is constructed using only "tight"
  2379. * edges.
  2380. */
  2381. function feasibleTree(g) {
  2382. var t = new Graph({ directed: false });
  2383. // Choose arbitrary node from which to start our tree
  2384. var start = g.nodes()[0];
  2385. var size = g.nodeCount();
  2386. t.setNode(start, {});
  2387. var edge, delta;
  2388. while (tightTree(t, g) < size) {
  2389. edge = findMinSlackEdge(t, g);
  2390. delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge);
  2391. shiftRanks(t, g, delta);
  2392. }
  2393. return t;
  2394. }
  2395. /*
  2396. * Finds a maximal tree of tight edges and returns the number of nodes in the
  2397. * tree.
  2398. */
  2399. function tightTree(t, g) {
  2400. function dfs(v) {
  2401. _.forEach(g.nodeEdges(v), function(e) {
  2402. var edgeV = e.v,
  2403. w = (v === edgeV) ? e.w : edgeV;
  2404. if (!t.hasNode(w) && !slack(g, e)) {
  2405. t.setNode(w, {});
  2406. t.setEdge(v, w, {});
  2407. dfs(w);
  2408. }
  2409. });
  2410. }
  2411. _.forEach(t.nodes(), dfs);
  2412. return t.nodeCount();
  2413. }
  2414. /*
  2415. * Finds the edge with the smallest slack that is incident on tree and returns
  2416. * it.
  2417. */
  2418. function findMinSlackEdge(t, g) {
  2419. return _.minBy(g.edges(), function(e) {
  2420. if (t.hasNode(e.v) !== t.hasNode(e.w)) {
  2421. return slack(g, e);
  2422. }
  2423. });
  2424. }
  2425. function shiftRanks(t, g, delta) {
  2426. _.forEach(t.nodes(), function(v) {
  2427. g.node(v).rank += delta;
  2428. });
  2429. }
  2430. /***/ }),
  2431. /***/ "../../node_modules/dagre/lib/rank/index.js":
  2432. /*!****************************************************************!*\
  2433. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/rank/index.js ***!
  2434. \****************************************************************/
  2435. /*! no static exports found */
  2436. /***/ (function(module, exports, __webpack_require__) {
  2437. "use strict";
  2438. var rankUtil = __webpack_require__(/*! ./util */ "../../node_modules/dagre/lib/rank/util.js");
  2439. var longestPath = rankUtil.longestPath;
  2440. var feasibleTree = __webpack_require__(/*! ./feasible-tree */ "../../node_modules/dagre/lib/rank/feasible-tree.js");
  2441. var networkSimplex = __webpack_require__(/*! ./network-simplex */ "../../node_modules/dagre/lib/rank/network-simplex.js");
  2442. module.exports = rank;
  2443. /*
  2444. * Assigns a rank to each node in the input graph that respects the "minlen"
  2445. * constraint specified on edges between nodes.
  2446. *
  2447. * This basic structure is derived from Gansner, et al., "A Technique for
  2448. * Drawing Directed Graphs."
  2449. *
  2450. * Pre-conditions:
  2451. *
  2452. * 1. Graph must be a connected DAG
  2453. * 2. Graph nodes must be objects
  2454. * 3. Graph edges must have "weight" and "minlen" attributes
  2455. *
  2456. * Post-conditions:
  2457. *
  2458. * 1. Graph nodes will have a "rank" attribute based on the results of the
  2459. * algorithm. Ranks can start at any index (including negative), we'll
  2460. * fix them up later.
  2461. */
  2462. function rank(g) {
  2463. switch(g.graph().ranker) {
  2464. case "network-simplex": networkSimplexRanker(g); break;
  2465. case "tight-tree": tightTreeRanker(g); break;
  2466. case "longest-path": longestPathRanker(g); break;
  2467. default: networkSimplexRanker(g);
  2468. }
  2469. }
  2470. // A fast and simple ranker, but results are far from optimal.
  2471. var longestPathRanker = longestPath;
  2472. function tightTreeRanker(g) {
  2473. longestPath(g);
  2474. feasibleTree(g);
  2475. }
  2476. function networkSimplexRanker(g) {
  2477. networkSimplex(g);
  2478. }
  2479. /***/ }),
  2480. /***/ "../../node_modules/dagre/lib/rank/network-simplex.js":
  2481. /*!**************************************************************************!*\
  2482. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/rank/network-simplex.js ***!
  2483. \**************************************************************************/
  2484. /*! no static exports found */
  2485. /***/ (function(module, exports, __webpack_require__) {
  2486. "use strict";
  2487. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  2488. var feasibleTree = __webpack_require__(/*! ./feasible-tree */ "../../node_modules/dagre/lib/rank/feasible-tree.js");
  2489. var slack = __webpack_require__(/*! ./util */ "../../node_modules/dagre/lib/rank/util.js").slack;
  2490. var initRank = __webpack_require__(/*! ./util */ "../../node_modules/dagre/lib/rank/util.js").longestPath;
  2491. var preorder = __webpack_require__(/*! ../graphlib */ "../../node_modules/dagre/lib/graphlib.js").alg.preorder;
  2492. var postorder = __webpack_require__(/*! ../graphlib */ "../../node_modules/dagre/lib/graphlib.js").alg.postorder;
  2493. var simplify = __webpack_require__(/*! ../util */ "../../node_modules/dagre/lib/util.js").simplify;
  2494. module.exports = networkSimplex;
  2495. // Expose some internals for testing purposes
  2496. networkSimplex.initLowLimValues = initLowLimValues;
  2497. networkSimplex.initCutValues = initCutValues;
  2498. networkSimplex.calcCutValue = calcCutValue;
  2499. networkSimplex.leaveEdge = leaveEdge;
  2500. networkSimplex.enterEdge = enterEdge;
  2501. networkSimplex.exchangeEdges = exchangeEdges;
  2502. /*
  2503. * The network simplex algorithm assigns ranks to each node in the input graph
  2504. * and iteratively improves the ranking to reduce the length of edges.
  2505. *
  2506. * Preconditions:
  2507. *
  2508. * 1. The input graph must be a DAG.
  2509. * 2. All nodes in the graph must have an object value.
  2510. * 3. All edges in the graph must have "minlen" and "weight" attributes.
  2511. *
  2512. * Postconditions:
  2513. *
  2514. * 1. All nodes in the graph will have an assigned "rank" attribute that has
  2515. * been optimized by the network simplex algorithm. Ranks start at 0.
  2516. *
  2517. *
  2518. * A rough sketch of the algorithm is as follows:
  2519. *
  2520. * 1. Assign initial ranks to each node. We use the longest path algorithm,
  2521. * which assigns ranks to the lowest position possible. In general this
  2522. * leads to very wide bottom ranks and unnecessarily long edges.
  2523. * 2. Construct a feasible tight tree. A tight tree is one such that all
  2524. * edges in the tree have no slack (difference between length of edge
  2525. * and minlen for the edge). This by itself greatly improves the assigned
  2526. * rankings by shorting edges.
  2527. * 3. Iteratively find edges that have negative cut values. Generally a
  2528. * negative cut value indicates that the edge could be removed and a new
  2529. * tree edge could be added to produce a more compact graph.
  2530. *
  2531. * Much of the algorithms here are derived from Gansner, et al., "A Technique
  2532. * for Drawing Directed Graphs." The structure of the file roughly follows the
  2533. * structure of the overall algorithm.
  2534. */
  2535. function networkSimplex(g) {
  2536. g = simplify(g);
  2537. initRank(g);
  2538. var t = feasibleTree(g);
  2539. initLowLimValues(t);
  2540. initCutValues(t, g);
  2541. var e, f;
  2542. while ((e = leaveEdge(t))) {
  2543. f = enterEdge(t, g, e);
  2544. exchangeEdges(t, g, e, f);
  2545. }
  2546. }
  2547. /*
  2548. * Initializes cut values for all edges in the tree.
  2549. */
  2550. function initCutValues(t, g) {
  2551. var vs = postorder(t, t.nodes());
  2552. vs = vs.slice(0, vs.length - 1);
  2553. _.forEach(vs, function(v) {
  2554. assignCutValue(t, g, v);
  2555. });
  2556. }
  2557. function assignCutValue(t, g, child) {
  2558. var childLab = t.node(child);
  2559. var parent = childLab.parent;
  2560. t.edge(child, parent).cutvalue = calcCutValue(t, g, child);
  2561. }
  2562. /*
  2563. * Given the tight tree, its graph, and a child in the graph calculate and
  2564. * return the cut value for the edge between the child and its parent.
  2565. */
  2566. function calcCutValue(t, g, child) {
  2567. var childLab = t.node(child);
  2568. var parent = childLab.parent;
  2569. // True if the child is on the tail end of the edge in the directed graph
  2570. var childIsTail = true;
  2571. // The graph's view of the tree edge we're inspecting
  2572. var graphEdge = g.edge(child, parent);
  2573. // The accumulated cut value for the edge between this node and its parent
  2574. var cutValue = 0;
  2575. if (!graphEdge) {
  2576. childIsTail = false;
  2577. graphEdge = g.edge(parent, child);
  2578. }
  2579. cutValue = graphEdge.weight;
  2580. _.forEach(g.nodeEdges(child), function(e) {
  2581. var isOutEdge = e.v === child,
  2582. other = isOutEdge ? e.w : e.v;
  2583. if (other !== parent) {
  2584. var pointsToHead = isOutEdge === childIsTail,
  2585. otherWeight = g.edge(e).weight;
  2586. cutValue += pointsToHead ? otherWeight : -otherWeight;
  2587. if (isTreeEdge(t, child, other)) {
  2588. var otherCutValue = t.edge(child, other).cutvalue;
  2589. cutValue += pointsToHead ? -otherCutValue : otherCutValue;
  2590. }
  2591. }
  2592. });
  2593. return cutValue;
  2594. }
  2595. function initLowLimValues(tree, root) {
  2596. if (arguments.length < 2) {
  2597. root = tree.nodes()[0];
  2598. }
  2599. dfsAssignLowLim(tree, {}, 1, root);
  2600. }
  2601. function dfsAssignLowLim(tree, visited, nextLim, v, parent) {
  2602. var low = nextLim;
  2603. var label = tree.node(v);
  2604. visited[v] = true;
  2605. _.forEach(tree.neighbors(v), function(w) {
  2606. if (!_.has(visited, w)) {
  2607. nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v);
  2608. }
  2609. });
  2610. label.low = low;
  2611. label.lim = nextLim++;
  2612. if (parent) {
  2613. label.parent = parent;
  2614. } else {
  2615. // TODO should be able to remove this when we incrementally update low lim
  2616. delete label.parent;
  2617. }
  2618. return nextLim;
  2619. }
  2620. function leaveEdge(tree) {
  2621. return _.find(tree.edges(), function(e) {
  2622. return tree.edge(e).cutvalue < 0;
  2623. });
  2624. }
  2625. function enterEdge(t, g, edge) {
  2626. var v = edge.v;
  2627. var w = edge.w;
  2628. // For the rest of this function we assume that v is the tail and w is the
  2629. // head, so if we don't have this edge in the graph we should flip it to
  2630. // match the correct orientation.
  2631. if (!g.hasEdge(v, w)) {
  2632. v = edge.w;
  2633. w = edge.v;
  2634. }
  2635. var vLabel = t.node(v);
  2636. var wLabel = t.node(w);
  2637. var tailLabel = vLabel;
  2638. var flip = false;
  2639. // If the root is in the tail of the edge then we need to flip the logic that
  2640. // checks for the head and tail nodes in the candidates function below.
  2641. if (vLabel.lim > wLabel.lim) {
  2642. tailLabel = wLabel;
  2643. flip = true;
  2644. }
  2645. var candidates = _.filter(g.edges(), function(edge) {
  2646. return flip === isDescendant(t, t.node(edge.v), tailLabel) &&
  2647. flip !== isDescendant(t, t.node(edge.w), tailLabel);
  2648. });
  2649. return _.minBy(candidates, function(edge) { return slack(g, edge); });
  2650. }
  2651. function exchangeEdges(t, g, e, f) {
  2652. var v = e.v;
  2653. var w = e.w;
  2654. t.removeEdge(v, w);
  2655. t.setEdge(f.v, f.w, {});
  2656. initLowLimValues(t);
  2657. initCutValues(t, g);
  2658. updateRanks(t, g);
  2659. }
  2660. function updateRanks(t, g) {
  2661. var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; });
  2662. var vs = preorder(t, root);
  2663. vs = vs.slice(1);
  2664. _.forEach(vs, function(v) {
  2665. var parent = t.node(v).parent,
  2666. edge = g.edge(v, parent),
  2667. flipped = false;
  2668. if (!edge) {
  2669. edge = g.edge(parent, v);
  2670. flipped = true;
  2671. }
  2672. g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen);
  2673. });
  2674. }
  2675. /*
  2676. * Returns true if the edge is in the tree.
  2677. */
  2678. function isTreeEdge(tree, u, v) {
  2679. return tree.hasEdge(u, v);
  2680. }
  2681. /*
  2682. * Returns true if the specified node is descendant of the root node per the
  2683. * assigned low and lim attributes in the tree.
  2684. */
  2685. function isDescendant(tree, vLabel, rootLabel) {
  2686. return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim;
  2687. }
  2688. /***/ }),
  2689. /***/ "../../node_modules/dagre/lib/rank/util.js":
  2690. /*!***************************************************************!*\
  2691. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/rank/util.js ***!
  2692. \***************************************************************/
  2693. /*! no static exports found */
  2694. /***/ (function(module, exports, __webpack_require__) {
  2695. "use strict";
  2696. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/dagre/lib/lodash.js");
  2697. module.exports = {
  2698. longestPath: longestPath,
  2699. slack: slack
  2700. };
  2701. /*
  2702. * Initializes ranks for the input graph using the longest path algorithm. This
  2703. * algorithm scales well and is fast in practice, it yields rather poor
  2704. * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom
  2705. * ranks wide and leaving edges longer than necessary. However, due to its
  2706. * speed, this algorithm is good for getting an initial ranking that can be fed
  2707. * into other algorithms.
  2708. *
  2709. * This algorithm does not normalize layers because it will be used by other
  2710. * algorithms in most cases. If using this algorithm directly, be sure to
  2711. * run normalize at the end.
  2712. *
  2713. * Pre-conditions:
  2714. *
  2715. * 1. Input graph is a DAG.
  2716. * 2. Input graph node labels can be assigned properties.
  2717. *
  2718. * Post-conditions:
  2719. *
  2720. * 1. Each node will be assign an (unnormalized) "rank" property.
  2721. */
  2722. function longestPath(g) {
  2723. var visited = {};
  2724. function dfs(v) {
  2725. var label = g.node(v);
  2726. if (_.has(visited, v)) {
  2727. return label.rank;
  2728. }
  2729. visited[v] = true;
  2730. var rank = _.min(_.map(g.outEdges(v), function(e) {
  2731. return dfs(e.w) - g.edge(e).minlen;
  2732. }));
  2733. if (rank === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3
  2734. rank === undefined || // return value of _.map([]) for Lodash 4
  2735. rank === null) { // return value of _.map([null])
  2736. rank = 0;
  2737. }
  2738. return (label.rank = rank);
  2739. }
  2740. _.forEach(g.sources(), dfs);
  2741. }
  2742. /*
  2743. * Returns the amount of slack for the given edge. The slack is defined as the
  2744. * difference between the length of the edge and its minimum length.
  2745. */
  2746. function slack(g, e) {
  2747. return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen;
  2748. }
  2749. /***/ }),
  2750. /***/ "../../node_modules/dagre/lib/util.js":
  2751. /*!**********************************************************!*\
  2752. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/util.js ***!
  2753. \**********************************************************/
  2754. /*! no static exports found */
  2755. /***/ (function(module, exports, __webpack_require__) {
  2756. "use strict";
  2757. /* eslint "no-console": off */
  2758. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/dagre/lib/lodash.js");
  2759. var Graph = __webpack_require__(/*! ./graphlib */ "../../node_modules/dagre/lib/graphlib.js").Graph;
  2760. module.exports = {
  2761. addDummyNode: addDummyNode,
  2762. simplify: simplify,
  2763. asNonCompoundGraph: asNonCompoundGraph,
  2764. successorWeights: successorWeights,
  2765. predecessorWeights: predecessorWeights,
  2766. intersectRect: intersectRect,
  2767. buildLayerMatrix: buildLayerMatrix,
  2768. normalizeRanks: normalizeRanks,
  2769. removeEmptyRanks: removeEmptyRanks,
  2770. addBorderNode: addBorderNode,
  2771. maxRank: maxRank,
  2772. partition: partition,
  2773. time: time,
  2774. notime: notime
  2775. };
  2776. /*
  2777. * Adds a dummy node to the graph and return v.
  2778. */
  2779. function addDummyNode(g, type, attrs, name) {
  2780. var v;
  2781. do {
  2782. v = _.uniqueId(name);
  2783. } while (g.hasNode(v));
  2784. attrs.dummy = type;
  2785. g.setNode(v, attrs);
  2786. return v;
  2787. }
  2788. /*
  2789. * Returns a new graph with only simple edges. Handles aggregation of data
  2790. * associated with multi-edges.
  2791. */
  2792. function simplify(g) {
  2793. var simplified = new Graph().setGraph(g.graph());
  2794. _.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });
  2795. _.forEach(g.edges(), function(e) {
  2796. var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 };
  2797. var label = g.edge(e);
  2798. simplified.setEdge(e.v, e.w, {
  2799. weight: simpleLabel.weight + label.weight,
  2800. minlen: Math.max(simpleLabel.minlen, label.minlen)
  2801. });
  2802. });
  2803. return simplified;
  2804. }
  2805. function asNonCompoundGraph(g) {
  2806. var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph());
  2807. _.forEach(g.nodes(), function(v) {
  2808. if (!g.children(v).length) {
  2809. simplified.setNode(v, g.node(v));
  2810. }
  2811. });
  2812. _.forEach(g.edges(), function(e) {
  2813. simplified.setEdge(e, g.edge(e));
  2814. });
  2815. return simplified;
  2816. }
  2817. function successorWeights(g) {
  2818. var weightMap = _.map(g.nodes(), function(v) {
  2819. var sucs = {};
  2820. _.forEach(g.outEdges(v), function(e) {
  2821. sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight;
  2822. });
  2823. return sucs;
  2824. });
  2825. return _.zipObject(g.nodes(), weightMap);
  2826. }
  2827. function predecessorWeights(g) {
  2828. var weightMap = _.map(g.nodes(), function(v) {
  2829. var preds = {};
  2830. _.forEach(g.inEdges(v), function(e) {
  2831. preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight;
  2832. });
  2833. return preds;
  2834. });
  2835. return _.zipObject(g.nodes(), weightMap);
  2836. }
  2837. /*
  2838. * Finds where a line starting at point ({x, y}) would intersect a rectangle
  2839. * ({x, y, width, height}) if it were pointing at the rectangle's center.
  2840. */
  2841. function intersectRect(rect, point) {
  2842. var x = rect.x;
  2843. var y = rect.y;
  2844. // Rectangle intersection algorithm from:
  2845. // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes
  2846. var dx = point.x - x;
  2847. var dy = point.y - y;
  2848. var w = rect.width / 2;
  2849. var h = rect.height / 2;
  2850. if (!dx && !dy) {
  2851. throw new Error("Not possible to find intersection inside of the rectangle");
  2852. }
  2853. var sx, sy;
  2854. if (Math.abs(dy) * w > Math.abs(dx) * h) {
  2855. // Intersection is top or bottom of rect.
  2856. if (dy < 0) {
  2857. h = -h;
  2858. }
  2859. sx = h * dx / dy;
  2860. sy = h;
  2861. } else {
  2862. // Intersection is left or right of rect.
  2863. if (dx < 0) {
  2864. w = -w;
  2865. }
  2866. sx = w;
  2867. sy = w * dy / dx;
  2868. }
  2869. return { x: x + sx, y: y + sy };
  2870. }
  2871. /*
  2872. * Given a DAG with each node assigned "rank" and "order" properties, this
  2873. * function will produce a matrix with the ids of each node.
  2874. */
  2875. function buildLayerMatrix(g) {
  2876. var layering = _.map(_.range(maxRank(g) + 1), function() { return []; });
  2877. _.forEach(g.nodes(), function(v) {
  2878. var node = g.node(v);
  2879. var rank = node.rank;
  2880. if (!_.isUndefined(rank)) {
  2881. layering[rank][node.order] = v;
  2882. }
  2883. });
  2884. return layering;
  2885. }
  2886. /*
  2887. * Adjusts the ranks for all nodes in the graph such that all nodes v have
  2888. * rank(v) >= 0 and at least one node w has rank(w) = 0.
  2889. */
  2890. function normalizeRanks(g) {
  2891. var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
  2892. _.forEach(g.nodes(), function(v) {
  2893. var node = g.node(v);
  2894. if (_.has(node, "rank")) {
  2895. node.rank -= min;
  2896. }
  2897. });
  2898. }
  2899. function removeEmptyRanks(g) {
  2900. // Ranks may not start at 0, so we need to offset them
  2901. var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
  2902. var layers = [];
  2903. _.forEach(g.nodes(), function(v) {
  2904. var rank = g.node(v).rank - offset;
  2905. if (!layers[rank]) {
  2906. layers[rank] = [];
  2907. }
  2908. layers[rank].push(v);
  2909. });
  2910. var delta = 0;
  2911. var nodeRankFactor = g.graph().nodeRankFactor;
  2912. _.forEach(layers, function(vs, i) {
  2913. if (_.isUndefined(vs) && i % nodeRankFactor !== 0) {
  2914. --delta;
  2915. } else if (delta) {
  2916. _.forEach(vs, function(v) { g.node(v).rank += delta; });
  2917. }
  2918. });
  2919. }
  2920. function addBorderNode(g, prefix, rank, order) {
  2921. var node = {
  2922. width: 0,
  2923. height: 0
  2924. };
  2925. if (arguments.length >= 4) {
  2926. node.rank = rank;
  2927. node.order = order;
  2928. }
  2929. return addDummyNode(g, "border", node, prefix);
  2930. }
  2931. function maxRank(g) {
  2932. return _.max(_.map(g.nodes(), function(v) {
  2933. var rank = g.node(v).rank;
  2934. if (!_.isUndefined(rank)) {
  2935. return rank;
  2936. }
  2937. }));
  2938. }
  2939. /*
  2940. * Partition a collection into two groups: `lhs` and `rhs`. If the supplied
  2941. * function returns true for an entry it goes into `lhs`. Otherwise it goes
  2942. * into `rhs.
  2943. */
  2944. function partition(collection, fn) {
  2945. var result = { lhs: [], rhs: [] };
  2946. _.forEach(collection, function(value) {
  2947. if (fn(value)) {
  2948. result.lhs.push(value);
  2949. } else {
  2950. result.rhs.push(value);
  2951. }
  2952. });
  2953. return result;
  2954. }
  2955. /*
  2956. * Returns a new function that wraps `fn` with a timer. The wrapper logs the
  2957. * time it takes to execute the function.
  2958. */
  2959. function time(name, fn) {
  2960. var start = _.now();
  2961. try {
  2962. return fn();
  2963. } finally {
  2964. console.log(name + " time: " + (_.now() - start) + "ms");
  2965. }
  2966. }
  2967. function notime(name, fn) {
  2968. return fn();
  2969. }
  2970. /***/ }),
  2971. /***/ "../../node_modules/dagre/lib/version.js":
  2972. /*!*************************************************************!*\
  2973. !*** C:/Repos/Babylon.js/node_modules/dagre/lib/version.js ***!
  2974. \*************************************************************/
  2975. /*! no static exports found */
  2976. /***/ (function(module, exports) {
  2977. module.exports = "0.8.5";
  2978. /***/ }),
  2979. /***/ "../../node_modules/graphlib/index.js":
  2980. /*!**********************************************************!*\
  2981. !*** C:/Repos/Babylon.js/node_modules/graphlib/index.js ***!
  2982. \**********************************************************/
  2983. /*! no static exports found */
  2984. /***/ (function(module, exports, __webpack_require__) {
  2985. /**
  2986. * Copyright (c) 2014, Chris Pettitt
  2987. * All rights reserved.
  2988. *
  2989. * Redistribution and use in source and binary forms, with or without
  2990. * modification, are permitted provided that the following conditions are met:
  2991. *
  2992. * 1. Redistributions of source code must retain the above copyright notice, this
  2993. * list of conditions and the following disclaimer.
  2994. *
  2995. * 2. Redistributions in binary form must reproduce the above copyright notice,
  2996. * this list of conditions and the following disclaimer in the documentation
  2997. * and/or other materials provided with the distribution.
  2998. *
  2999. * 3. Neither the name of the copyright holder nor the names of its contributors
  3000. * may be used to endorse or promote products derived from this software without
  3001. * specific prior written permission.
  3002. *
  3003. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  3004. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  3005. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  3006. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  3007. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  3008. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  3009. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  3010. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  3011. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  3012. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3013. */
  3014. var lib = __webpack_require__(/*! ./lib */ "../../node_modules/graphlib/lib/index.js");
  3015. module.exports = {
  3016. Graph: lib.Graph,
  3017. json: __webpack_require__(/*! ./lib/json */ "../../node_modules/graphlib/lib/json.js"),
  3018. alg: __webpack_require__(/*! ./lib/alg */ "../../node_modules/graphlib/lib/alg/index.js"),
  3019. version: lib.version
  3020. };
  3021. /***/ }),
  3022. /***/ "../../node_modules/graphlib/lib/alg/components.js":
  3023. /*!***********************************************************************!*\
  3024. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/components.js ***!
  3025. \***********************************************************************/
  3026. /*! no static exports found */
  3027. /***/ (function(module, exports, __webpack_require__) {
  3028. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/graphlib/lib/lodash.js");
  3029. module.exports = components;
  3030. function components(g) {
  3031. var visited = {};
  3032. var cmpts = [];
  3033. var cmpt;
  3034. function dfs(v) {
  3035. if (_.has(visited, v)) return;
  3036. visited[v] = true;
  3037. cmpt.push(v);
  3038. _.each(g.successors(v), dfs);
  3039. _.each(g.predecessors(v), dfs);
  3040. }
  3041. _.each(g.nodes(), function(v) {
  3042. cmpt = [];
  3043. dfs(v);
  3044. if (cmpt.length) {
  3045. cmpts.push(cmpt);
  3046. }
  3047. });
  3048. return cmpts;
  3049. }
  3050. /***/ }),
  3051. /***/ "../../node_modules/graphlib/lib/alg/dfs.js":
  3052. /*!****************************************************************!*\
  3053. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/dfs.js ***!
  3054. \****************************************************************/
  3055. /*! no static exports found */
  3056. /***/ (function(module, exports, __webpack_require__) {
  3057. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/graphlib/lib/lodash.js");
  3058. module.exports = dfs;
  3059. /*
  3060. * A helper that preforms a pre- or post-order traversal on the input graph
  3061. * and returns the nodes in the order they were visited. If the graph is
  3062. * undirected then this algorithm will navigate using neighbors. If the graph
  3063. * is directed then this algorithm will navigate using successors.
  3064. *
  3065. * Order must be one of "pre" or "post".
  3066. */
  3067. function dfs(g, vs, order) {
  3068. if (!_.isArray(vs)) {
  3069. vs = [vs];
  3070. }
  3071. var navigation = (g.isDirected() ? g.successors : g.neighbors).bind(g);
  3072. var acc = [];
  3073. var visited = {};
  3074. _.each(vs, function(v) {
  3075. if (!g.hasNode(v)) {
  3076. throw new Error("Graph does not have node: " + v);
  3077. }
  3078. doDfs(g, v, order === "post", visited, navigation, acc);
  3079. });
  3080. return acc;
  3081. }
  3082. function doDfs(g, v, postorder, visited, navigation, acc) {
  3083. if (!_.has(visited, v)) {
  3084. visited[v] = true;
  3085. if (!postorder) { acc.push(v); }
  3086. _.each(navigation(v), function(w) {
  3087. doDfs(g, w, postorder, visited, navigation, acc);
  3088. });
  3089. if (postorder) { acc.push(v); }
  3090. }
  3091. }
  3092. /***/ }),
  3093. /***/ "../../node_modules/graphlib/lib/alg/dijkstra-all.js":
  3094. /*!*************************************************************************!*\
  3095. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/dijkstra-all.js ***!
  3096. \*************************************************************************/
  3097. /*! no static exports found */
  3098. /***/ (function(module, exports, __webpack_require__) {
  3099. var dijkstra = __webpack_require__(/*! ./dijkstra */ "../../node_modules/graphlib/lib/alg/dijkstra.js");
  3100. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/graphlib/lib/lodash.js");
  3101. module.exports = dijkstraAll;
  3102. function dijkstraAll(g, weightFunc, edgeFunc) {
  3103. return _.transform(g.nodes(), function(acc, v) {
  3104. acc[v] = dijkstra(g, v, weightFunc, edgeFunc);
  3105. }, {});
  3106. }
  3107. /***/ }),
  3108. /***/ "../../node_modules/graphlib/lib/alg/dijkstra.js":
  3109. /*!*********************************************************************!*\
  3110. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/dijkstra.js ***!
  3111. \*********************************************************************/
  3112. /*! no static exports found */
  3113. /***/ (function(module, exports, __webpack_require__) {
  3114. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/graphlib/lib/lodash.js");
  3115. var PriorityQueue = __webpack_require__(/*! ../data/priority-queue */ "../../node_modules/graphlib/lib/data/priority-queue.js");
  3116. module.exports = dijkstra;
  3117. var DEFAULT_WEIGHT_FUNC = _.constant(1);
  3118. function dijkstra(g, source, weightFn, edgeFn) {
  3119. return runDijkstra(g, String(source),
  3120. weightFn || DEFAULT_WEIGHT_FUNC,
  3121. edgeFn || function(v) { return g.outEdges(v); });
  3122. }
  3123. function runDijkstra(g, source, weightFn, edgeFn) {
  3124. var results = {};
  3125. var pq = new PriorityQueue();
  3126. var v, vEntry;
  3127. var updateNeighbors = function(edge) {
  3128. var w = edge.v !== v ? edge.v : edge.w;
  3129. var wEntry = results[w];
  3130. var weight = weightFn(edge);
  3131. var distance = vEntry.distance + weight;
  3132. if (weight < 0) {
  3133. throw new Error("dijkstra does not allow negative edge weights. " +
  3134. "Bad edge: " + edge + " Weight: " + weight);
  3135. }
  3136. if (distance < wEntry.distance) {
  3137. wEntry.distance = distance;
  3138. wEntry.predecessor = v;
  3139. pq.decrease(w, distance);
  3140. }
  3141. };
  3142. g.nodes().forEach(function(v) {
  3143. var distance = v === source ? 0 : Number.POSITIVE_INFINITY;
  3144. results[v] = { distance: distance };
  3145. pq.add(v, distance);
  3146. });
  3147. while (pq.size() > 0) {
  3148. v = pq.removeMin();
  3149. vEntry = results[v];
  3150. if (vEntry.distance === Number.POSITIVE_INFINITY) {
  3151. break;
  3152. }
  3153. edgeFn(v).forEach(updateNeighbors);
  3154. }
  3155. return results;
  3156. }
  3157. /***/ }),
  3158. /***/ "../../node_modules/graphlib/lib/alg/find-cycles.js":
  3159. /*!************************************************************************!*\
  3160. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/find-cycles.js ***!
  3161. \************************************************************************/
  3162. /*! no static exports found */
  3163. /***/ (function(module, exports, __webpack_require__) {
  3164. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/graphlib/lib/lodash.js");
  3165. var tarjan = __webpack_require__(/*! ./tarjan */ "../../node_modules/graphlib/lib/alg/tarjan.js");
  3166. module.exports = findCycles;
  3167. function findCycles(g) {
  3168. return _.filter(tarjan(g), function(cmpt) {
  3169. return cmpt.length > 1 || (cmpt.length === 1 && g.hasEdge(cmpt[0], cmpt[0]));
  3170. });
  3171. }
  3172. /***/ }),
  3173. /***/ "../../node_modules/graphlib/lib/alg/floyd-warshall.js":
  3174. /*!***************************************************************************!*\
  3175. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/floyd-warshall.js ***!
  3176. \***************************************************************************/
  3177. /*! no static exports found */
  3178. /***/ (function(module, exports, __webpack_require__) {
  3179. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/graphlib/lib/lodash.js");
  3180. module.exports = floydWarshall;
  3181. var DEFAULT_WEIGHT_FUNC = _.constant(1);
  3182. function floydWarshall(g, weightFn, edgeFn) {
  3183. return runFloydWarshall(g,
  3184. weightFn || DEFAULT_WEIGHT_FUNC,
  3185. edgeFn || function(v) { return g.outEdges(v); });
  3186. }
  3187. function runFloydWarshall(g, weightFn, edgeFn) {
  3188. var results = {};
  3189. var nodes = g.nodes();
  3190. nodes.forEach(function(v) {
  3191. results[v] = {};
  3192. results[v][v] = { distance: 0 };
  3193. nodes.forEach(function(w) {
  3194. if (v !== w) {
  3195. results[v][w] = { distance: Number.POSITIVE_INFINITY };
  3196. }
  3197. });
  3198. edgeFn(v).forEach(function(edge) {
  3199. var w = edge.v === v ? edge.w : edge.v;
  3200. var d = weightFn(edge);
  3201. results[v][w] = { distance: d, predecessor: v };
  3202. });
  3203. });
  3204. nodes.forEach(function(k) {
  3205. var rowK = results[k];
  3206. nodes.forEach(function(i) {
  3207. var rowI = results[i];
  3208. nodes.forEach(function(j) {
  3209. var ik = rowI[k];
  3210. var kj = rowK[j];
  3211. var ij = rowI[j];
  3212. var altDistance = ik.distance + kj.distance;
  3213. if (altDistance < ij.distance) {
  3214. ij.distance = altDistance;
  3215. ij.predecessor = kj.predecessor;
  3216. }
  3217. });
  3218. });
  3219. });
  3220. return results;
  3221. }
  3222. /***/ }),
  3223. /***/ "../../node_modules/graphlib/lib/alg/index.js":
  3224. /*!******************************************************************!*\
  3225. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/index.js ***!
  3226. \******************************************************************/
  3227. /*! no static exports found */
  3228. /***/ (function(module, exports, __webpack_require__) {
  3229. module.exports = {
  3230. components: __webpack_require__(/*! ./components */ "../../node_modules/graphlib/lib/alg/components.js"),
  3231. dijkstra: __webpack_require__(/*! ./dijkstra */ "../../node_modules/graphlib/lib/alg/dijkstra.js"),
  3232. dijkstraAll: __webpack_require__(/*! ./dijkstra-all */ "../../node_modules/graphlib/lib/alg/dijkstra-all.js"),
  3233. findCycles: __webpack_require__(/*! ./find-cycles */ "../../node_modules/graphlib/lib/alg/find-cycles.js"),
  3234. floydWarshall: __webpack_require__(/*! ./floyd-warshall */ "../../node_modules/graphlib/lib/alg/floyd-warshall.js"),
  3235. isAcyclic: __webpack_require__(/*! ./is-acyclic */ "../../node_modules/graphlib/lib/alg/is-acyclic.js"),
  3236. postorder: __webpack_require__(/*! ./postorder */ "../../node_modules/graphlib/lib/alg/postorder.js"),
  3237. preorder: __webpack_require__(/*! ./preorder */ "../../node_modules/graphlib/lib/alg/preorder.js"),
  3238. prim: __webpack_require__(/*! ./prim */ "../../node_modules/graphlib/lib/alg/prim.js"),
  3239. tarjan: __webpack_require__(/*! ./tarjan */ "../../node_modules/graphlib/lib/alg/tarjan.js"),
  3240. topsort: __webpack_require__(/*! ./topsort */ "../../node_modules/graphlib/lib/alg/topsort.js")
  3241. };
  3242. /***/ }),
  3243. /***/ "../../node_modules/graphlib/lib/alg/is-acyclic.js":
  3244. /*!***********************************************************************!*\
  3245. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/is-acyclic.js ***!
  3246. \***********************************************************************/
  3247. /*! no static exports found */
  3248. /***/ (function(module, exports, __webpack_require__) {
  3249. var topsort = __webpack_require__(/*! ./topsort */ "../../node_modules/graphlib/lib/alg/topsort.js");
  3250. module.exports = isAcyclic;
  3251. function isAcyclic(g) {
  3252. try {
  3253. topsort(g);
  3254. } catch (e) {
  3255. if (e instanceof topsort.CycleException) {
  3256. return false;
  3257. }
  3258. throw e;
  3259. }
  3260. return true;
  3261. }
  3262. /***/ }),
  3263. /***/ "../../node_modules/graphlib/lib/alg/postorder.js":
  3264. /*!**********************************************************************!*\
  3265. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/postorder.js ***!
  3266. \**********************************************************************/
  3267. /*! no static exports found */
  3268. /***/ (function(module, exports, __webpack_require__) {
  3269. var dfs = __webpack_require__(/*! ./dfs */ "../../node_modules/graphlib/lib/alg/dfs.js");
  3270. module.exports = postorder;
  3271. function postorder(g, vs) {
  3272. return dfs(g, vs, "post");
  3273. }
  3274. /***/ }),
  3275. /***/ "../../node_modules/graphlib/lib/alg/preorder.js":
  3276. /*!*********************************************************************!*\
  3277. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/preorder.js ***!
  3278. \*********************************************************************/
  3279. /*! no static exports found */
  3280. /***/ (function(module, exports, __webpack_require__) {
  3281. var dfs = __webpack_require__(/*! ./dfs */ "../../node_modules/graphlib/lib/alg/dfs.js");
  3282. module.exports = preorder;
  3283. function preorder(g, vs) {
  3284. return dfs(g, vs, "pre");
  3285. }
  3286. /***/ }),
  3287. /***/ "../../node_modules/graphlib/lib/alg/prim.js":
  3288. /*!*****************************************************************!*\
  3289. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/prim.js ***!
  3290. \*****************************************************************/
  3291. /*! no static exports found */
  3292. /***/ (function(module, exports, __webpack_require__) {
  3293. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/graphlib/lib/lodash.js");
  3294. var Graph = __webpack_require__(/*! ../graph */ "../../node_modules/graphlib/lib/graph.js");
  3295. var PriorityQueue = __webpack_require__(/*! ../data/priority-queue */ "../../node_modules/graphlib/lib/data/priority-queue.js");
  3296. module.exports = prim;
  3297. function prim(g, weightFunc) {
  3298. var result = new Graph();
  3299. var parents = {};
  3300. var pq = new PriorityQueue();
  3301. var v;
  3302. function updateNeighbors(edge) {
  3303. var w = edge.v === v ? edge.w : edge.v;
  3304. var pri = pq.priority(w);
  3305. if (pri !== undefined) {
  3306. var edgeWeight = weightFunc(edge);
  3307. if (edgeWeight < pri) {
  3308. parents[w] = v;
  3309. pq.decrease(w, edgeWeight);
  3310. }
  3311. }
  3312. }
  3313. if (g.nodeCount() === 0) {
  3314. return result;
  3315. }
  3316. _.each(g.nodes(), function(v) {
  3317. pq.add(v, Number.POSITIVE_INFINITY);
  3318. result.setNode(v);
  3319. });
  3320. // Start from an arbitrary node
  3321. pq.decrease(g.nodes()[0], 0);
  3322. var init = false;
  3323. while (pq.size() > 0) {
  3324. v = pq.removeMin();
  3325. if (_.has(parents, v)) {
  3326. result.setEdge(v, parents[v]);
  3327. } else if (init) {
  3328. throw new Error("Input graph is not connected: " + g);
  3329. } else {
  3330. init = true;
  3331. }
  3332. g.nodeEdges(v).forEach(updateNeighbors);
  3333. }
  3334. return result;
  3335. }
  3336. /***/ }),
  3337. /***/ "../../node_modules/graphlib/lib/alg/tarjan.js":
  3338. /*!*******************************************************************!*\
  3339. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/tarjan.js ***!
  3340. \*******************************************************************/
  3341. /*! no static exports found */
  3342. /***/ (function(module, exports, __webpack_require__) {
  3343. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/graphlib/lib/lodash.js");
  3344. module.exports = tarjan;
  3345. function tarjan(g) {
  3346. var index = 0;
  3347. var stack = [];
  3348. var visited = {}; // node id -> { onStack, lowlink, index }
  3349. var results = [];
  3350. function dfs(v) {
  3351. var entry = visited[v] = {
  3352. onStack: true,
  3353. lowlink: index,
  3354. index: index++
  3355. };
  3356. stack.push(v);
  3357. g.successors(v).forEach(function(w) {
  3358. if (!_.has(visited, w)) {
  3359. dfs(w);
  3360. entry.lowlink = Math.min(entry.lowlink, visited[w].lowlink);
  3361. } else if (visited[w].onStack) {
  3362. entry.lowlink = Math.min(entry.lowlink, visited[w].index);
  3363. }
  3364. });
  3365. if (entry.lowlink === entry.index) {
  3366. var cmpt = [];
  3367. var w;
  3368. do {
  3369. w = stack.pop();
  3370. visited[w].onStack = false;
  3371. cmpt.push(w);
  3372. } while (v !== w);
  3373. results.push(cmpt);
  3374. }
  3375. }
  3376. g.nodes().forEach(function(v) {
  3377. if (!_.has(visited, v)) {
  3378. dfs(v);
  3379. }
  3380. });
  3381. return results;
  3382. }
  3383. /***/ }),
  3384. /***/ "../../node_modules/graphlib/lib/alg/topsort.js":
  3385. /*!********************************************************************!*\
  3386. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/alg/topsort.js ***!
  3387. \********************************************************************/
  3388. /*! no static exports found */
  3389. /***/ (function(module, exports, __webpack_require__) {
  3390. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/graphlib/lib/lodash.js");
  3391. module.exports = topsort;
  3392. topsort.CycleException = CycleException;
  3393. function topsort(g) {
  3394. var visited = {};
  3395. var stack = {};
  3396. var results = [];
  3397. function visit(node) {
  3398. if (_.has(stack, node)) {
  3399. throw new CycleException();
  3400. }
  3401. if (!_.has(visited, node)) {
  3402. stack[node] = true;
  3403. visited[node] = true;
  3404. _.each(g.predecessors(node), visit);
  3405. delete stack[node];
  3406. results.push(node);
  3407. }
  3408. }
  3409. _.each(g.sinks(), visit);
  3410. if (_.size(visited) !== g.nodeCount()) {
  3411. throw new CycleException();
  3412. }
  3413. return results;
  3414. }
  3415. function CycleException() {}
  3416. CycleException.prototype = new Error(); // must be an instance of Error to pass testing
  3417. /***/ }),
  3418. /***/ "../../node_modules/graphlib/lib/data/priority-queue.js":
  3419. /*!****************************************************************************!*\
  3420. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/data/priority-queue.js ***!
  3421. \****************************************************************************/
  3422. /*! no static exports found */
  3423. /***/ (function(module, exports, __webpack_require__) {
  3424. var _ = __webpack_require__(/*! ../lodash */ "../../node_modules/graphlib/lib/lodash.js");
  3425. module.exports = PriorityQueue;
  3426. /**
  3427. * A min-priority queue data structure. This algorithm is derived from Cormen,
  3428. * et al., "Introduction to Algorithms". The basic idea of a min-priority
  3429. * queue is that you can efficiently (in O(1) time) get the smallest key in
  3430. * the queue. Adding and removing elements takes O(log n) time. A key can
  3431. * have its priority decreased in O(log n) time.
  3432. */
  3433. function PriorityQueue() {
  3434. this._arr = [];
  3435. this._keyIndices = {};
  3436. }
  3437. /**
  3438. * Returns the number of elements in the queue. Takes `O(1)` time.
  3439. */
  3440. PriorityQueue.prototype.size = function() {
  3441. return this._arr.length;
  3442. };
  3443. /**
  3444. * Returns the keys that are in the queue. Takes `O(n)` time.
  3445. */
  3446. PriorityQueue.prototype.keys = function() {
  3447. return this._arr.map(function(x) { return x.key; });
  3448. };
  3449. /**
  3450. * Returns `true` if **key** is in the queue and `false` if not.
  3451. */
  3452. PriorityQueue.prototype.has = function(key) {
  3453. return _.has(this._keyIndices, key);
  3454. };
  3455. /**
  3456. * Returns the priority for **key**. If **key** is not present in the queue
  3457. * then this function returns `undefined`. Takes `O(1)` time.
  3458. *
  3459. * @param {Object} key
  3460. */
  3461. PriorityQueue.prototype.priority = function(key) {
  3462. var index = this._keyIndices[key];
  3463. if (index !== undefined) {
  3464. return this._arr[index].priority;
  3465. }
  3466. };
  3467. /**
  3468. * Returns the key for the minimum element in this queue. If the queue is
  3469. * empty this function throws an Error. Takes `O(1)` time.
  3470. */
  3471. PriorityQueue.prototype.min = function() {
  3472. if (this.size() === 0) {
  3473. throw new Error("Queue underflow");
  3474. }
  3475. return this._arr[0].key;
  3476. };
  3477. /**
  3478. * Inserts a new key into the priority queue. If the key already exists in
  3479. * the queue this function returns `false`; otherwise it will return `true`.
  3480. * Takes `O(n)` time.
  3481. *
  3482. * @param {Object} key the key to add
  3483. * @param {Number} priority the initial priority for the key
  3484. */
  3485. PriorityQueue.prototype.add = function(key, priority) {
  3486. var keyIndices = this._keyIndices;
  3487. key = String(key);
  3488. if (!_.has(keyIndices, key)) {
  3489. var arr = this._arr;
  3490. var index = arr.length;
  3491. keyIndices[key] = index;
  3492. arr.push({key: key, priority: priority});
  3493. this._decrease(index);
  3494. return true;
  3495. }
  3496. return false;
  3497. };
  3498. /**
  3499. * Removes and returns the smallest key in the queue. Takes `O(log n)` time.
  3500. */
  3501. PriorityQueue.prototype.removeMin = function() {
  3502. this._swap(0, this._arr.length - 1);
  3503. var min = this._arr.pop();
  3504. delete this._keyIndices[min.key];
  3505. this._heapify(0);
  3506. return min.key;
  3507. };
  3508. /**
  3509. * Decreases the priority for **key** to **priority**. If the new priority is
  3510. * greater than the previous priority, this function will throw an Error.
  3511. *
  3512. * @param {Object} key the key for which to raise priority
  3513. * @param {Number} priority the new priority for the key
  3514. */
  3515. PriorityQueue.prototype.decrease = function(key, priority) {
  3516. var index = this._keyIndices[key];
  3517. if (priority > this._arr[index].priority) {
  3518. throw new Error("New priority is greater than current priority. " +
  3519. "Key: " + key + " Old: " + this._arr[index].priority + " New: " + priority);
  3520. }
  3521. this._arr[index].priority = priority;
  3522. this._decrease(index);
  3523. };
  3524. PriorityQueue.prototype._heapify = function(i) {
  3525. var arr = this._arr;
  3526. var l = 2 * i;
  3527. var r = l + 1;
  3528. var largest = i;
  3529. if (l < arr.length) {
  3530. largest = arr[l].priority < arr[largest].priority ? l : largest;
  3531. if (r < arr.length) {
  3532. largest = arr[r].priority < arr[largest].priority ? r : largest;
  3533. }
  3534. if (largest !== i) {
  3535. this._swap(i, largest);
  3536. this._heapify(largest);
  3537. }
  3538. }
  3539. };
  3540. PriorityQueue.prototype._decrease = function(index) {
  3541. var arr = this._arr;
  3542. var priority = arr[index].priority;
  3543. var parent;
  3544. while (index !== 0) {
  3545. parent = index >> 1;
  3546. if (arr[parent].priority < priority) {
  3547. break;
  3548. }
  3549. this._swap(index, parent);
  3550. index = parent;
  3551. }
  3552. };
  3553. PriorityQueue.prototype._swap = function(i, j) {
  3554. var arr = this._arr;
  3555. var keyIndices = this._keyIndices;
  3556. var origArrI = arr[i];
  3557. var origArrJ = arr[j];
  3558. arr[i] = origArrJ;
  3559. arr[j] = origArrI;
  3560. keyIndices[origArrJ.key] = i;
  3561. keyIndices[origArrI.key] = j;
  3562. };
  3563. /***/ }),
  3564. /***/ "../../node_modules/graphlib/lib/graph.js":
  3565. /*!**************************************************************!*\
  3566. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/graph.js ***!
  3567. \**************************************************************/
  3568. /*! no static exports found */
  3569. /***/ (function(module, exports, __webpack_require__) {
  3570. "use strict";
  3571. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/graphlib/lib/lodash.js");
  3572. module.exports = Graph;
  3573. var DEFAULT_EDGE_NAME = "\x00";
  3574. var GRAPH_NODE = "\x00";
  3575. var EDGE_KEY_DELIM = "\x01";
  3576. // Implementation notes:
  3577. //
  3578. // * Node id query functions should return string ids for the nodes
  3579. // * Edge id query functions should return an "edgeObj", edge object, that is
  3580. // composed of enough information to uniquely identify an edge: {v, w, name}.
  3581. // * Internally we use an "edgeId", a stringified form of the edgeObj, to
  3582. // reference edges. This is because we need a performant way to look these
  3583. // edges up and, object properties, which have string keys, are the closest
  3584. // we're going to get to a performant hashtable in JavaScript.
  3585. function Graph(opts) {
  3586. this._isDirected = _.has(opts, "directed") ? opts.directed : true;
  3587. this._isMultigraph = _.has(opts, "multigraph") ? opts.multigraph : false;
  3588. this._isCompound = _.has(opts, "compound") ? opts.compound : false;
  3589. // Label for the graph itself
  3590. this._label = undefined;
  3591. // Defaults to be set when creating a new node
  3592. this._defaultNodeLabelFn = _.constant(undefined);
  3593. // Defaults to be set when creating a new edge
  3594. this._defaultEdgeLabelFn = _.constant(undefined);
  3595. // v -> label
  3596. this._nodes = {};
  3597. if (this._isCompound) {
  3598. // v -> parent
  3599. this._parent = {};
  3600. // v -> children
  3601. this._children = {};
  3602. this._children[GRAPH_NODE] = {};
  3603. }
  3604. // v -> edgeObj
  3605. this._in = {};
  3606. // u -> v -> Number
  3607. this._preds = {};
  3608. // v -> edgeObj
  3609. this._out = {};
  3610. // v -> w -> Number
  3611. this._sucs = {};
  3612. // e -> edgeObj
  3613. this._edgeObjs = {};
  3614. // e -> label
  3615. this._edgeLabels = {};
  3616. }
  3617. /* Number of nodes in the graph. Should only be changed by the implementation. */
  3618. Graph.prototype._nodeCount = 0;
  3619. /* Number of edges in the graph. Should only be changed by the implementation. */
  3620. Graph.prototype._edgeCount = 0;
  3621. /* === Graph functions ========= */
  3622. Graph.prototype.isDirected = function() {
  3623. return this._isDirected;
  3624. };
  3625. Graph.prototype.isMultigraph = function() {
  3626. return this._isMultigraph;
  3627. };
  3628. Graph.prototype.isCompound = function() {
  3629. return this._isCompound;
  3630. };
  3631. Graph.prototype.setGraph = function(label) {
  3632. this._label = label;
  3633. return this;
  3634. };
  3635. Graph.prototype.graph = function() {
  3636. return this._label;
  3637. };
  3638. /* === Node functions ========== */
  3639. Graph.prototype.setDefaultNodeLabel = function(newDefault) {
  3640. if (!_.isFunction(newDefault)) {
  3641. newDefault = _.constant(newDefault);
  3642. }
  3643. this._defaultNodeLabelFn = newDefault;
  3644. return this;
  3645. };
  3646. Graph.prototype.nodeCount = function() {
  3647. return this._nodeCount;
  3648. };
  3649. Graph.prototype.nodes = function() {
  3650. return _.keys(this._nodes);
  3651. };
  3652. Graph.prototype.sources = function() {
  3653. var self = this;
  3654. return _.filter(this.nodes(), function(v) {
  3655. return _.isEmpty(self._in[v]);
  3656. });
  3657. };
  3658. Graph.prototype.sinks = function() {
  3659. var self = this;
  3660. return _.filter(this.nodes(), function(v) {
  3661. return _.isEmpty(self._out[v]);
  3662. });
  3663. };
  3664. Graph.prototype.setNodes = function(vs, value) {
  3665. var args = arguments;
  3666. var self = this;
  3667. _.each(vs, function(v) {
  3668. if (args.length > 1) {
  3669. self.setNode(v, value);
  3670. } else {
  3671. self.setNode(v);
  3672. }
  3673. });
  3674. return this;
  3675. };
  3676. Graph.prototype.setNode = function(v, value) {
  3677. if (_.has(this._nodes, v)) {
  3678. if (arguments.length > 1) {
  3679. this._nodes[v] = value;
  3680. }
  3681. return this;
  3682. }
  3683. this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v);
  3684. if (this._isCompound) {
  3685. this._parent[v] = GRAPH_NODE;
  3686. this._children[v] = {};
  3687. this._children[GRAPH_NODE][v] = true;
  3688. }
  3689. this._in[v] = {};
  3690. this._preds[v] = {};
  3691. this._out[v] = {};
  3692. this._sucs[v] = {};
  3693. ++this._nodeCount;
  3694. return this;
  3695. };
  3696. Graph.prototype.node = function(v) {
  3697. return this._nodes[v];
  3698. };
  3699. Graph.prototype.hasNode = function(v) {
  3700. return _.has(this._nodes, v);
  3701. };
  3702. Graph.prototype.removeNode = function(v) {
  3703. var self = this;
  3704. if (_.has(this._nodes, v)) {
  3705. var removeEdge = function(e) { self.removeEdge(self._edgeObjs[e]); };
  3706. delete this._nodes[v];
  3707. if (this._isCompound) {
  3708. this._removeFromParentsChildList(v);
  3709. delete this._parent[v];
  3710. _.each(this.children(v), function(child) {
  3711. self.setParent(child);
  3712. });
  3713. delete this._children[v];
  3714. }
  3715. _.each(_.keys(this._in[v]), removeEdge);
  3716. delete this._in[v];
  3717. delete this._preds[v];
  3718. _.each(_.keys(this._out[v]), removeEdge);
  3719. delete this._out[v];
  3720. delete this._sucs[v];
  3721. --this._nodeCount;
  3722. }
  3723. return this;
  3724. };
  3725. Graph.prototype.setParent = function(v, parent) {
  3726. if (!this._isCompound) {
  3727. throw new Error("Cannot set parent in a non-compound graph");
  3728. }
  3729. if (_.isUndefined(parent)) {
  3730. parent = GRAPH_NODE;
  3731. } else {
  3732. // Coerce parent to string
  3733. parent += "";
  3734. for (var ancestor = parent;
  3735. !_.isUndefined(ancestor);
  3736. ancestor = this.parent(ancestor)) {
  3737. if (ancestor === v) {
  3738. throw new Error("Setting " + parent+ " as parent of " + v +
  3739. " would create a cycle");
  3740. }
  3741. }
  3742. this.setNode(parent);
  3743. }
  3744. this.setNode(v);
  3745. this._removeFromParentsChildList(v);
  3746. this._parent[v] = parent;
  3747. this._children[parent][v] = true;
  3748. return this;
  3749. };
  3750. Graph.prototype._removeFromParentsChildList = function(v) {
  3751. delete this._children[this._parent[v]][v];
  3752. };
  3753. Graph.prototype.parent = function(v) {
  3754. if (this._isCompound) {
  3755. var parent = this._parent[v];
  3756. if (parent !== GRAPH_NODE) {
  3757. return parent;
  3758. }
  3759. }
  3760. };
  3761. Graph.prototype.children = function(v) {
  3762. if (_.isUndefined(v)) {
  3763. v = GRAPH_NODE;
  3764. }
  3765. if (this._isCompound) {
  3766. var children = this._children[v];
  3767. if (children) {
  3768. return _.keys(children);
  3769. }
  3770. } else if (v === GRAPH_NODE) {
  3771. return this.nodes();
  3772. } else if (this.hasNode(v)) {
  3773. return [];
  3774. }
  3775. };
  3776. Graph.prototype.predecessors = function(v) {
  3777. var predsV = this._preds[v];
  3778. if (predsV) {
  3779. return _.keys(predsV);
  3780. }
  3781. };
  3782. Graph.prototype.successors = function(v) {
  3783. var sucsV = this._sucs[v];
  3784. if (sucsV) {
  3785. return _.keys(sucsV);
  3786. }
  3787. };
  3788. Graph.prototype.neighbors = function(v) {
  3789. var preds = this.predecessors(v);
  3790. if (preds) {
  3791. return _.union(preds, this.successors(v));
  3792. }
  3793. };
  3794. Graph.prototype.isLeaf = function (v) {
  3795. var neighbors;
  3796. if (this.isDirected()) {
  3797. neighbors = this.successors(v);
  3798. } else {
  3799. neighbors = this.neighbors(v);
  3800. }
  3801. return neighbors.length === 0;
  3802. };
  3803. Graph.prototype.filterNodes = function(filter) {
  3804. var copy = new this.constructor({
  3805. directed: this._isDirected,
  3806. multigraph: this._isMultigraph,
  3807. compound: this._isCompound
  3808. });
  3809. copy.setGraph(this.graph());
  3810. var self = this;
  3811. _.each(this._nodes, function(value, v) {
  3812. if (filter(v)) {
  3813. copy.setNode(v, value);
  3814. }
  3815. });
  3816. _.each(this._edgeObjs, function(e) {
  3817. if (copy.hasNode(e.v) && copy.hasNode(e.w)) {
  3818. copy.setEdge(e, self.edge(e));
  3819. }
  3820. });
  3821. var parents = {};
  3822. function findParent(v) {
  3823. var parent = self.parent(v);
  3824. if (parent === undefined || copy.hasNode(parent)) {
  3825. parents[v] = parent;
  3826. return parent;
  3827. } else if (parent in parents) {
  3828. return parents[parent];
  3829. } else {
  3830. return findParent(parent);
  3831. }
  3832. }
  3833. if (this._isCompound) {
  3834. _.each(copy.nodes(), function(v) {
  3835. copy.setParent(v, findParent(v));
  3836. });
  3837. }
  3838. return copy;
  3839. };
  3840. /* === Edge functions ========== */
  3841. Graph.prototype.setDefaultEdgeLabel = function(newDefault) {
  3842. if (!_.isFunction(newDefault)) {
  3843. newDefault = _.constant(newDefault);
  3844. }
  3845. this._defaultEdgeLabelFn = newDefault;
  3846. return this;
  3847. };
  3848. Graph.prototype.edgeCount = function() {
  3849. return this._edgeCount;
  3850. };
  3851. Graph.prototype.edges = function() {
  3852. return _.values(this._edgeObjs);
  3853. };
  3854. Graph.prototype.setPath = function(vs, value) {
  3855. var self = this;
  3856. var args = arguments;
  3857. _.reduce(vs, function(v, w) {
  3858. if (args.length > 1) {
  3859. self.setEdge(v, w, value);
  3860. } else {
  3861. self.setEdge(v, w);
  3862. }
  3863. return w;
  3864. });
  3865. return this;
  3866. };
  3867. /*
  3868. * setEdge(v, w, [value, [name]])
  3869. * setEdge({ v, w, [name] }, [value])
  3870. */
  3871. Graph.prototype.setEdge = function() {
  3872. var v, w, name, value;
  3873. var valueSpecified = false;
  3874. var arg0 = arguments[0];
  3875. if (typeof arg0 === "object" && arg0 !== null && "v" in arg0) {
  3876. v = arg0.v;
  3877. w = arg0.w;
  3878. name = arg0.name;
  3879. if (arguments.length === 2) {
  3880. value = arguments[1];
  3881. valueSpecified = true;
  3882. }
  3883. } else {
  3884. v = arg0;
  3885. w = arguments[1];
  3886. name = arguments[3];
  3887. if (arguments.length > 2) {
  3888. value = arguments[2];
  3889. valueSpecified = true;
  3890. }
  3891. }
  3892. v = "" + v;
  3893. w = "" + w;
  3894. if (!_.isUndefined(name)) {
  3895. name = "" + name;
  3896. }
  3897. var e = edgeArgsToId(this._isDirected, v, w, name);
  3898. if (_.has(this._edgeLabels, e)) {
  3899. if (valueSpecified) {
  3900. this._edgeLabels[e] = value;
  3901. }
  3902. return this;
  3903. }
  3904. if (!_.isUndefined(name) && !this._isMultigraph) {
  3905. throw new Error("Cannot set a named edge when isMultigraph = false");
  3906. }
  3907. // It didn't exist, so we need to create it.
  3908. // First ensure the nodes exist.
  3909. this.setNode(v);
  3910. this.setNode(w);
  3911. this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);
  3912. var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);
  3913. // Ensure we add undirected edges in a consistent way.
  3914. v = edgeObj.v;
  3915. w = edgeObj.w;
  3916. Object.freeze(edgeObj);
  3917. this._edgeObjs[e] = edgeObj;
  3918. incrementOrInitEntry(this._preds[w], v);
  3919. incrementOrInitEntry(this._sucs[v], w);
  3920. this._in[w][e] = edgeObj;
  3921. this._out[v][e] = edgeObj;
  3922. this._edgeCount++;
  3923. return this;
  3924. };
  3925. Graph.prototype.edge = function(v, w, name) {
  3926. var e = (arguments.length === 1
  3927. ? edgeObjToId(this._isDirected, arguments[0])
  3928. : edgeArgsToId(this._isDirected, v, w, name));
  3929. return this._edgeLabels[e];
  3930. };
  3931. Graph.prototype.hasEdge = function(v, w, name) {
  3932. var e = (arguments.length === 1
  3933. ? edgeObjToId(this._isDirected, arguments[0])
  3934. : edgeArgsToId(this._isDirected, v, w, name));
  3935. return _.has(this._edgeLabels, e);
  3936. };
  3937. Graph.prototype.removeEdge = function(v, w, name) {
  3938. var e = (arguments.length === 1
  3939. ? edgeObjToId(this._isDirected, arguments[0])
  3940. : edgeArgsToId(this._isDirected, v, w, name));
  3941. var edge = this._edgeObjs[e];
  3942. if (edge) {
  3943. v = edge.v;
  3944. w = edge.w;
  3945. delete this._edgeLabels[e];
  3946. delete this._edgeObjs[e];
  3947. decrementOrRemoveEntry(this._preds[w], v);
  3948. decrementOrRemoveEntry(this._sucs[v], w);
  3949. delete this._in[w][e];
  3950. delete this._out[v][e];
  3951. this._edgeCount--;
  3952. }
  3953. return this;
  3954. };
  3955. Graph.prototype.inEdges = function(v, u) {
  3956. var inV = this._in[v];
  3957. if (inV) {
  3958. var edges = _.values(inV);
  3959. if (!u) {
  3960. return edges;
  3961. }
  3962. return _.filter(edges, function(edge) { return edge.v === u; });
  3963. }
  3964. };
  3965. Graph.prototype.outEdges = function(v, w) {
  3966. var outV = this._out[v];
  3967. if (outV) {
  3968. var edges = _.values(outV);
  3969. if (!w) {
  3970. return edges;
  3971. }
  3972. return _.filter(edges, function(edge) { return edge.w === w; });
  3973. }
  3974. };
  3975. Graph.prototype.nodeEdges = function(v, w) {
  3976. var inEdges = this.inEdges(v, w);
  3977. if (inEdges) {
  3978. return inEdges.concat(this.outEdges(v, w));
  3979. }
  3980. };
  3981. function incrementOrInitEntry(map, k) {
  3982. if (map[k]) {
  3983. map[k]++;
  3984. } else {
  3985. map[k] = 1;
  3986. }
  3987. }
  3988. function decrementOrRemoveEntry(map, k) {
  3989. if (!--map[k]) { delete map[k]; }
  3990. }
  3991. function edgeArgsToId(isDirected, v_, w_, name) {
  3992. var v = "" + v_;
  3993. var w = "" + w_;
  3994. if (!isDirected && v > w) {
  3995. var tmp = v;
  3996. v = w;
  3997. w = tmp;
  3998. }
  3999. return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM +
  4000. (_.isUndefined(name) ? DEFAULT_EDGE_NAME : name);
  4001. }
  4002. function edgeArgsToObj(isDirected, v_, w_, name) {
  4003. var v = "" + v_;
  4004. var w = "" + w_;
  4005. if (!isDirected && v > w) {
  4006. var tmp = v;
  4007. v = w;
  4008. w = tmp;
  4009. }
  4010. var edgeObj = { v: v, w: w };
  4011. if (name) {
  4012. edgeObj.name = name;
  4013. }
  4014. return edgeObj;
  4015. }
  4016. function edgeObjToId(isDirected, edgeObj) {
  4017. return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);
  4018. }
  4019. /***/ }),
  4020. /***/ "../../node_modules/graphlib/lib/index.js":
  4021. /*!**************************************************************!*\
  4022. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/index.js ***!
  4023. \**************************************************************/
  4024. /*! no static exports found */
  4025. /***/ (function(module, exports, __webpack_require__) {
  4026. // Includes only the "core" of graphlib
  4027. module.exports = {
  4028. Graph: __webpack_require__(/*! ./graph */ "../../node_modules/graphlib/lib/graph.js"),
  4029. version: __webpack_require__(/*! ./version */ "../../node_modules/graphlib/lib/version.js")
  4030. };
  4031. /***/ }),
  4032. /***/ "../../node_modules/graphlib/lib/json.js":
  4033. /*!*************************************************************!*\
  4034. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/json.js ***!
  4035. \*************************************************************/
  4036. /*! no static exports found */
  4037. /***/ (function(module, exports, __webpack_require__) {
  4038. var _ = __webpack_require__(/*! ./lodash */ "../../node_modules/graphlib/lib/lodash.js");
  4039. var Graph = __webpack_require__(/*! ./graph */ "../../node_modules/graphlib/lib/graph.js");
  4040. module.exports = {
  4041. write: write,
  4042. read: read
  4043. };
  4044. function write(g) {
  4045. var json = {
  4046. options: {
  4047. directed: g.isDirected(),
  4048. multigraph: g.isMultigraph(),
  4049. compound: g.isCompound()
  4050. },
  4051. nodes: writeNodes(g),
  4052. edges: writeEdges(g)
  4053. };
  4054. if (!_.isUndefined(g.graph())) {
  4055. json.value = _.clone(g.graph());
  4056. }
  4057. return json;
  4058. }
  4059. function writeNodes(g) {
  4060. return _.map(g.nodes(), function(v) {
  4061. var nodeValue = g.node(v);
  4062. var parent = g.parent(v);
  4063. var node = { v: v };
  4064. if (!_.isUndefined(nodeValue)) {
  4065. node.value = nodeValue;
  4066. }
  4067. if (!_.isUndefined(parent)) {
  4068. node.parent = parent;
  4069. }
  4070. return node;
  4071. });
  4072. }
  4073. function writeEdges(g) {
  4074. return _.map(g.edges(), function(e) {
  4075. var edgeValue = g.edge(e);
  4076. var edge = { v: e.v, w: e.w };
  4077. if (!_.isUndefined(e.name)) {
  4078. edge.name = e.name;
  4079. }
  4080. if (!_.isUndefined(edgeValue)) {
  4081. edge.value = edgeValue;
  4082. }
  4083. return edge;
  4084. });
  4085. }
  4086. function read(json) {
  4087. var g = new Graph(json.options).setGraph(json.value);
  4088. _.each(json.nodes, function(entry) {
  4089. g.setNode(entry.v, entry.value);
  4090. if (entry.parent) {
  4091. g.setParent(entry.v, entry.parent);
  4092. }
  4093. });
  4094. _.each(json.edges, function(entry) {
  4095. g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);
  4096. });
  4097. return g;
  4098. }
  4099. /***/ }),
  4100. /***/ "../../node_modules/graphlib/lib/lodash.js":
  4101. /*!***************************************************************!*\
  4102. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/lodash.js ***!
  4103. \***************************************************************/
  4104. /*! no static exports found */
  4105. /***/ (function(module, exports, __webpack_require__) {
  4106. /* global window */
  4107. var lodash;
  4108. if (true) {
  4109. try {
  4110. lodash = {
  4111. clone: __webpack_require__(/*! lodash/clone */ "../../node_modules/lodash/clone.js"),
  4112. constant: __webpack_require__(/*! lodash/constant */ "../../node_modules/lodash/constant.js"),
  4113. each: __webpack_require__(/*! lodash/each */ "../../node_modules/lodash/each.js"),
  4114. filter: __webpack_require__(/*! lodash/filter */ "../../node_modules/lodash/filter.js"),
  4115. has: __webpack_require__(/*! lodash/has */ "../../node_modules/lodash/has.js"),
  4116. isArray: __webpack_require__(/*! lodash/isArray */ "../../node_modules/lodash/isArray.js"),
  4117. isEmpty: __webpack_require__(/*! lodash/isEmpty */ "../../node_modules/lodash/isEmpty.js"),
  4118. isFunction: __webpack_require__(/*! lodash/isFunction */ "../../node_modules/lodash/isFunction.js"),
  4119. isUndefined: __webpack_require__(/*! lodash/isUndefined */ "../../node_modules/lodash/isUndefined.js"),
  4120. keys: __webpack_require__(/*! lodash/keys */ "../../node_modules/lodash/keys.js"),
  4121. map: __webpack_require__(/*! lodash/map */ "../../node_modules/lodash/map.js"),
  4122. reduce: __webpack_require__(/*! lodash/reduce */ "../../node_modules/lodash/reduce.js"),
  4123. size: __webpack_require__(/*! lodash/size */ "../../node_modules/lodash/size.js"),
  4124. transform: __webpack_require__(/*! lodash/transform */ "../../node_modules/lodash/transform.js"),
  4125. union: __webpack_require__(/*! lodash/union */ "../../node_modules/lodash/union.js"),
  4126. values: __webpack_require__(/*! lodash/values */ "../../node_modules/lodash/values.js")
  4127. };
  4128. } catch (e) {
  4129. // continue regardless of error
  4130. }
  4131. }
  4132. if (!lodash) {
  4133. lodash = window._;
  4134. }
  4135. module.exports = lodash;
  4136. /***/ }),
  4137. /***/ "../../node_modules/graphlib/lib/version.js":
  4138. /*!****************************************************************!*\
  4139. !*** C:/Repos/Babylon.js/node_modules/graphlib/lib/version.js ***!
  4140. \****************************************************************/
  4141. /*! no static exports found */
  4142. /***/ (function(module, exports) {
  4143. module.exports = '2.1.8';
  4144. /***/ }),
  4145. /***/ "../../node_modules/lodash/_DataView.js":
  4146. /*!************************************************************!*\
  4147. !*** C:/Repos/Babylon.js/node_modules/lodash/_DataView.js ***!
  4148. \************************************************************/
  4149. /*! no static exports found */
  4150. /***/ (function(module, exports, __webpack_require__) {
  4151. var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"),
  4152. root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js");
  4153. /* Built-in method references that are verified to be native. */
  4154. var DataView = getNative(root, 'DataView');
  4155. module.exports = DataView;
  4156. /***/ }),
  4157. /***/ "../../node_modules/lodash/_Hash.js":
  4158. /*!********************************************************!*\
  4159. !*** C:/Repos/Babylon.js/node_modules/lodash/_Hash.js ***!
  4160. \********************************************************/
  4161. /*! no static exports found */
  4162. /***/ (function(module, exports, __webpack_require__) {
  4163. var hashClear = __webpack_require__(/*! ./_hashClear */ "../../node_modules/lodash/_hashClear.js"),
  4164. hashDelete = __webpack_require__(/*! ./_hashDelete */ "../../node_modules/lodash/_hashDelete.js"),
  4165. hashGet = __webpack_require__(/*! ./_hashGet */ "../../node_modules/lodash/_hashGet.js"),
  4166. hashHas = __webpack_require__(/*! ./_hashHas */ "../../node_modules/lodash/_hashHas.js"),
  4167. hashSet = __webpack_require__(/*! ./_hashSet */ "../../node_modules/lodash/_hashSet.js");
  4168. /**
  4169. * Creates a hash object.
  4170. *
  4171. * @private
  4172. * @constructor
  4173. * @param {Array} [entries] The key-value pairs to cache.
  4174. */
  4175. function Hash(entries) {
  4176. var index = -1,
  4177. length = entries == null ? 0 : entries.length;
  4178. this.clear();
  4179. while (++index < length) {
  4180. var entry = entries[index];
  4181. this.set(entry[0], entry[1]);
  4182. }
  4183. }
  4184. // Add methods to `Hash`.
  4185. Hash.prototype.clear = hashClear;
  4186. Hash.prototype['delete'] = hashDelete;
  4187. Hash.prototype.get = hashGet;
  4188. Hash.prototype.has = hashHas;
  4189. Hash.prototype.set = hashSet;
  4190. module.exports = Hash;
  4191. /***/ }),
  4192. /***/ "../../node_modules/lodash/_ListCache.js":
  4193. /*!*************************************************************!*\
  4194. !*** C:/Repos/Babylon.js/node_modules/lodash/_ListCache.js ***!
  4195. \*************************************************************/
  4196. /*! no static exports found */
  4197. /***/ (function(module, exports, __webpack_require__) {
  4198. var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../../node_modules/lodash/_listCacheClear.js"),
  4199. listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../../node_modules/lodash/_listCacheDelete.js"),
  4200. listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../../node_modules/lodash/_listCacheGet.js"),
  4201. listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../../node_modules/lodash/_listCacheHas.js"),
  4202. listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../../node_modules/lodash/_listCacheSet.js");
  4203. /**
  4204. * Creates an list cache object.
  4205. *
  4206. * @private
  4207. * @constructor
  4208. * @param {Array} [entries] The key-value pairs to cache.
  4209. */
  4210. function ListCache(entries) {
  4211. var index = -1,
  4212. length = entries == null ? 0 : entries.length;
  4213. this.clear();
  4214. while (++index < length) {
  4215. var entry = entries[index];
  4216. this.set(entry[0], entry[1]);
  4217. }
  4218. }
  4219. // Add methods to `ListCache`.
  4220. ListCache.prototype.clear = listCacheClear;
  4221. ListCache.prototype['delete'] = listCacheDelete;
  4222. ListCache.prototype.get = listCacheGet;
  4223. ListCache.prototype.has = listCacheHas;
  4224. ListCache.prototype.set = listCacheSet;
  4225. module.exports = ListCache;
  4226. /***/ }),
  4227. /***/ "../../node_modules/lodash/_Map.js":
  4228. /*!*******************************************************!*\
  4229. !*** C:/Repos/Babylon.js/node_modules/lodash/_Map.js ***!
  4230. \*******************************************************/
  4231. /*! no static exports found */
  4232. /***/ (function(module, exports, __webpack_require__) {
  4233. var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"),
  4234. root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js");
  4235. /* Built-in method references that are verified to be native. */
  4236. var Map = getNative(root, 'Map');
  4237. module.exports = Map;
  4238. /***/ }),
  4239. /***/ "../../node_modules/lodash/_MapCache.js":
  4240. /*!************************************************************!*\
  4241. !*** C:/Repos/Babylon.js/node_modules/lodash/_MapCache.js ***!
  4242. \************************************************************/
  4243. /*! no static exports found */
  4244. /***/ (function(module, exports, __webpack_require__) {
  4245. var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ "../../node_modules/lodash/_mapCacheClear.js"),
  4246. mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ "../../node_modules/lodash/_mapCacheDelete.js"),
  4247. mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ "../../node_modules/lodash/_mapCacheGet.js"),
  4248. mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ "../../node_modules/lodash/_mapCacheHas.js"),
  4249. mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ "../../node_modules/lodash/_mapCacheSet.js");
  4250. /**
  4251. * Creates a map cache object to store key-value pairs.
  4252. *
  4253. * @private
  4254. * @constructor
  4255. * @param {Array} [entries] The key-value pairs to cache.
  4256. */
  4257. function MapCache(entries) {
  4258. var index = -1,
  4259. length = entries == null ? 0 : entries.length;
  4260. this.clear();
  4261. while (++index < length) {
  4262. var entry = entries[index];
  4263. this.set(entry[0], entry[1]);
  4264. }
  4265. }
  4266. // Add methods to `MapCache`.
  4267. MapCache.prototype.clear = mapCacheClear;
  4268. MapCache.prototype['delete'] = mapCacheDelete;
  4269. MapCache.prototype.get = mapCacheGet;
  4270. MapCache.prototype.has = mapCacheHas;
  4271. MapCache.prototype.set = mapCacheSet;
  4272. module.exports = MapCache;
  4273. /***/ }),
  4274. /***/ "../../node_modules/lodash/_Promise.js":
  4275. /*!***********************************************************!*\
  4276. !*** C:/Repos/Babylon.js/node_modules/lodash/_Promise.js ***!
  4277. \***********************************************************/
  4278. /*! no static exports found */
  4279. /***/ (function(module, exports, __webpack_require__) {
  4280. var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"),
  4281. root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js");
  4282. /* Built-in method references that are verified to be native. */
  4283. var Promise = getNative(root, 'Promise');
  4284. module.exports = Promise;
  4285. /***/ }),
  4286. /***/ "../../node_modules/lodash/_Set.js":
  4287. /*!*******************************************************!*\
  4288. !*** C:/Repos/Babylon.js/node_modules/lodash/_Set.js ***!
  4289. \*******************************************************/
  4290. /*! no static exports found */
  4291. /***/ (function(module, exports, __webpack_require__) {
  4292. var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"),
  4293. root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js");
  4294. /* Built-in method references that are verified to be native. */
  4295. var Set = getNative(root, 'Set');
  4296. module.exports = Set;
  4297. /***/ }),
  4298. /***/ "../../node_modules/lodash/_SetCache.js":
  4299. /*!************************************************************!*\
  4300. !*** C:/Repos/Babylon.js/node_modules/lodash/_SetCache.js ***!
  4301. \************************************************************/
  4302. /*! no static exports found */
  4303. /***/ (function(module, exports, __webpack_require__) {
  4304. var MapCache = __webpack_require__(/*! ./_MapCache */ "../../node_modules/lodash/_MapCache.js"),
  4305. setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ "../../node_modules/lodash/_setCacheAdd.js"),
  4306. setCacheHas = __webpack_require__(/*! ./_setCacheHas */ "../../node_modules/lodash/_setCacheHas.js");
  4307. /**
  4308. *
  4309. * Creates an array cache object to store unique values.
  4310. *
  4311. * @private
  4312. * @constructor
  4313. * @param {Array} [values] The values to cache.
  4314. */
  4315. function SetCache(values) {
  4316. var index = -1,
  4317. length = values == null ? 0 : values.length;
  4318. this.__data__ = new MapCache;
  4319. while (++index < length) {
  4320. this.add(values[index]);
  4321. }
  4322. }
  4323. // Add methods to `SetCache`.
  4324. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  4325. SetCache.prototype.has = setCacheHas;
  4326. module.exports = SetCache;
  4327. /***/ }),
  4328. /***/ "../../node_modules/lodash/_Stack.js":
  4329. /*!*********************************************************!*\
  4330. !*** C:/Repos/Babylon.js/node_modules/lodash/_Stack.js ***!
  4331. \*********************************************************/
  4332. /*! no static exports found */
  4333. /***/ (function(module, exports, __webpack_require__) {
  4334. var ListCache = __webpack_require__(/*! ./_ListCache */ "../../node_modules/lodash/_ListCache.js"),
  4335. stackClear = __webpack_require__(/*! ./_stackClear */ "../../node_modules/lodash/_stackClear.js"),
  4336. stackDelete = __webpack_require__(/*! ./_stackDelete */ "../../node_modules/lodash/_stackDelete.js"),
  4337. stackGet = __webpack_require__(/*! ./_stackGet */ "../../node_modules/lodash/_stackGet.js"),
  4338. stackHas = __webpack_require__(/*! ./_stackHas */ "../../node_modules/lodash/_stackHas.js"),
  4339. stackSet = __webpack_require__(/*! ./_stackSet */ "../../node_modules/lodash/_stackSet.js");
  4340. /**
  4341. * Creates a stack cache object to store key-value pairs.
  4342. *
  4343. * @private
  4344. * @constructor
  4345. * @param {Array} [entries] The key-value pairs to cache.
  4346. */
  4347. function Stack(entries) {
  4348. var data = this.__data__ = new ListCache(entries);
  4349. this.size = data.size;
  4350. }
  4351. // Add methods to `Stack`.
  4352. Stack.prototype.clear = stackClear;
  4353. Stack.prototype['delete'] = stackDelete;
  4354. Stack.prototype.get = stackGet;
  4355. Stack.prototype.has = stackHas;
  4356. Stack.prototype.set = stackSet;
  4357. module.exports = Stack;
  4358. /***/ }),
  4359. /***/ "../../node_modules/lodash/_Symbol.js":
  4360. /*!**********************************************************!*\
  4361. !*** C:/Repos/Babylon.js/node_modules/lodash/_Symbol.js ***!
  4362. \**********************************************************/
  4363. /*! no static exports found */
  4364. /***/ (function(module, exports, __webpack_require__) {
  4365. var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js");
  4366. /** Built-in value references. */
  4367. var Symbol = root.Symbol;
  4368. module.exports = Symbol;
  4369. /***/ }),
  4370. /***/ "../../node_modules/lodash/_Uint8Array.js":
  4371. /*!**************************************************************!*\
  4372. !*** C:/Repos/Babylon.js/node_modules/lodash/_Uint8Array.js ***!
  4373. \**************************************************************/
  4374. /*! no static exports found */
  4375. /***/ (function(module, exports, __webpack_require__) {
  4376. var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js");
  4377. /** Built-in value references. */
  4378. var Uint8Array = root.Uint8Array;
  4379. module.exports = Uint8Array;
  4380. /***/ }),
  4381. /***/ "../../node_modules/lodash/_WeakMap.js":
  4382. /*!***********************************************************!*\
  4383. !*** C:/Repos/Babylon.js/node_modules/lodash/_WeakMap.js ***!
  4384. \***********************************************************/
  4385. /*! no static exports found */
  4386. /***/ (function(module, exports, __webpack_require__) {
  4387. var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"),
  4388. root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js");
  4389. /* Built-in method references that are verified to be native. */
  4390. var WeakMap = getNative(root, 'WeakMap');
  4391. module.exports = WeakMap;
  4392. /***/ }),
  4393. /***/ "../../node_modules/lodash/_apply.js":
  4394. /*!*********************************************************!*\
  4395. !*** C:/Repos/Babylon.js/node_modules/lodash/_apply.js ***!
  4396. \*********************************************************/
  4397. /*! no static exports found */
  4398. /***/ (function(module, exports) {
  4399. /**
  4400. * A faster alternative to `Function#apply`, this function invokes `func`
  4401. * with the `this` binding of `thisArg` and the arguments of `args`.
  4402. *
  4403. * @private
  4404. * @param {Function} func The function to invoke.
  4405. * @param {*} thisArg The `this` binding of `func`.
  4406. * @param {Array} args The arguments to invoke `func` with.
  4407. * @returns {*} Returns the result of `func`.
  4408. */
  4409. function apply(func, thisArg, args) {
  4410. switch (args.length) {
  4411. case 0: return func.call(thisArg);
  4412. case 1: return func.call(thisArg, args[0]);
  4413. case 2: return func.call(thisArg, args[0], args[1]);
  4414. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  4415. }
  4416. return func.apply(thisArg, args);
  4417. }
  4418. module.exports = apply;
  4419. /***/ }),
  4420. /***/ "../../node_modules/lodash/_arrayEach.js":
  4421. /*!*************************************************************!*\
  4422. !*** C:/Repos/Babylon.js/node_modules/lodash/_arrayEach.js ***!
  4423. \*************************************************************/
  4424. /*! no static exports found */
  4425. /***/ (function(module, exports) {
  4426. /**
  4427. * A specialized version of `_.forEach` for arrays without support for
  4428. * iteratee shorthands.
  4429. *
  4430. * @private
  4431. * @param {Array} [array] The array to iterate over.
  4432. * @param {Function} iteratee The function invoked per iteration.
  4433. * @returns {Array} Returns `array`.
  4434. */
  4435. function arrayEach(array, iteratee) {
  4436. var index = -1,
  4437. length = array == null ? 0 : array.length;
  4438. while (++index < length) {
  4439. if (iteratee(array[index], index, array) === false) {
  4440. break;
  4441. }
  4442. }
  4443. return array;
  4444. }
  4445. module.exports = arrayEach;
  4446. /***/ }),
  4447. /***/ "../../node_modules/lodash/_arrayFilter.js":
  4448. /*!***************************************************************!*\
  4449. !*** C:/Repos/Babylon.js/node_modules/lodash/_arrayFilter.js ***!
  4450. \***************************************************************/
  4451. /*! no static exports found */
  4452. /***/ (function(module, exports) {
  4453. /**
  4454. * A specialized version of `_.filter` for arrays without support for
  4455. * iteratee shorthands.
  4456. *
  4457. * @private
  4458. * @param {Array} [array] The array to iterate over.
  4459. * @param {Function} predicate The function invoked per iteration.
  4460. * @returns {Array} Returns the new filtered array.
  4461. */
  4462. function arrayFilter(array, predicate) {
  4463. var index = -1,
  4464. length = array == null ? 0 : array.length,
  4465. resIndex = 0,
  4466. result = [];
  4467. while (++index < length) {
  4468. var value = array[index];
  4469. if (predicate(value, index, array)) {
  4470. result[resIndex++] = value;
  4471. }
  4472. }
  4473. return result;
  4474. }
  4475. module.exports = arrayFilter;
  4476. /***/ }),
  4477. /***/ "../../node_modules/lodash/_arrayIncludes.js":
  4478. /*!*****************************************************************!*\
  4479. !*** C:/Repos/Babylon.js/node_modules/lodash/_arrayIncludes.js ***!
  4480. \*****************************************************************/
  4481. /*! no static exports found */
  4482. /***/ (function(module, exports, __webpack_require__) {
  4483. var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ "../../node_modules/lodash/_baseIndexOf.js");
  4484. /**
  4485. * A specialized version of `_.includes` for arrays without support for
  4486. * specifying an index to search from.
  4487. *
  4488. * @private
  4489. * @param {Array} [array] The array to inspect.
  4490. * @param {*} target The value to search for.
  4491. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  4492. */
  4493. function arrayIncludes(array, value) {
  4494. var length = array == null ? 0 : array.length;
  4495. return !!length && baseIndexOf(array, value, 0) > -1;
  4496. }
  4497. module.exports = arrayIncludes;
  4498. /***/ }),
  4499. /***/ "../../node_modules/lodash/_arrayIncludesWith.js":
  4500. /*!*********************************************************************!*\
  4501. !*** C:/Repos/Babylon.js/node_modules/lodash/_arrayIncludesWith.js ***!
  4502. \*********************************************************************/
  4503. /*! no static exports found */
  4504. /***/ (function(module, exports) {
  4505. /**
  4506. * This function is like `arrayIncludes` except that it accepts a comparator.
  4507. *
  4508. * @private
  4509. * @param {Array} [array] The array to inspect.
  4510. * @param {*} target The value to search for.
  4511. * @param {Function} comparator The comparator invoked per element.
  4512. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  4513. */
  4514. function arrayIncludesWith(array, value, comparator) {
  4515. var index = -1,
  4516. length = array == null ? 0 : array.length;
  4517. while (++index < length) {
  4518. if (comparator(value, array[index])) {
  4519. return true;
  4520. }
  4521. }
  4522. return false;
  4523. }
  4524. module.exports = arrayIncludesWith;
  4525. /***/ }),
  4526. /***/ "../../node_modules/lodash/_arrayLikeKeys.js":
  4527. /*!*****************************************************************!*\
  4528. !*** C:/Repos/Babylon.js/node_modules/lodash/_arrayLikeKeys.js ***!
  4529. \*****************************************************************/
  4530. /*! no static exports found */
  4531. /***/ (function(module, exports, __webpack_require__) {
  4532. var baseTimes = __webpack_require__(/*! ./_baseTimes */ "../../node_modules/lodash/_baseTimes.js"),
  4533. isArguments = __webpack_require__(/*! ./isArguments */ "../../node_modules/lodash/isArguments.js"),
  4534. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  4535. isBuffer = __webpack_require__(/*! ./isBuffer */ "../../node_modules/lodash/isBuffer.js"),
  4536. isIndex = __webpack_require__(/*! ./_isIndex */ "../../node_modules/lodash/_isIndex.js"),
  4537. isTypedArray = __webpack_require__(/*! ./isTypedArray */ "../../node_modules/lodash/isTypedArray.js");
  4538. /** Used for built-in method references. */
  4539. var objectProto = Object.prototype;
  4540. /** Used to check objects for own properties. */
  4541. var hasOwnProperty = objectProto.hasOwnProperty;
  4542. /**
  4543. * Creates an array of the enumerable property names of the array-like `value`.
  4544. *
  4545. * @private
  4546. * @param {*} value The value to query.
  4547. * @param {boolean} inherited Specify returning inherited property names.
  4548. * @returns {Array} Returns the array of property names.
  4549. */
  4550. function arrayLikeKeys(value, inherited) {
  4551. var isArr = isArray(value),
  4552. isArg = !isArr && isArguments(value),
  4553. isBuff = !isArr && !isArg && isBuffer(value),
  4554. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  4555. skipIndexes = isArr || isArg || isBuff || isType,
  4556. result = skipIndexes ? baseTimes(value.length, String) : [],
  4557. length = result.length;
  4558. for (var key in value) {
  4559. if ((inherited || hasOwnProperty.call(value, key)) &&
  4560. !(skipIndexes && (
  4561. // Safari 9 has enumerable `arguments.length` in strict mode.
  4562. key == 'length' ||
  4563. // Node.js 0.10 has enumerable non-index properties on buffers.
  4564. (isBuff && (key == 'offset' || key == 'parent')) ||
  4565. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  4566. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  4567. // Skip index properties.
  4568. isIndex(key, length)
  4569. ))) {
  4570. result.push(key);
  4571. }
  4572. }
  4573. return result;
  4574. }
  4575. module.exports = arrayLikeKeys;
  4576. /***/ }),
  4577. /***/ "../../node_modules/lodash/_arrayMap.js":
  4578. /*!************************************************************!*\
  4579. !*** C:/Repos/Babylon.js/node_modules/lodash/_arrayMap.js ***!
  4580. \************************************************************/
  4581. /*! no static exports found */
  4582. /***/ (function(module, exports) {
  4583. /**
  4584. * A specialized version of `_.map` for arrays without support for iteratee
  4585. * shorthands.
  4586. *
  4587. * @private
  4588. * @param {Array} [array] The array to iterate over.
  4589. * @param {Function} iteratee The function invoked per iteration.
  4590. * @returns {Array} Returns the new mapped array.
  4591. */
  4592. function arrayMap(array, iteratee) {
  4593. var index = -1,
  4594. length = array == null ? 0 : array.length,
  4595. result = Array(length);
  4596. while (++index < length) {
  4597. result[index] = iteratee(array[index], index, array);
  4598. }
  4599. return result;
  4600. }
  4601. module.exports = arrayMap;
  4602. /***/ }),
  4603. /***/ "../../node_modules/lodash/_arrayPush.js":
  4604. /*!*************************************************************!*\
  4605. !*** C:/Repos/Babylon.js/node_modules/lodash/_arrayPush.js ***!
  4606. \*************************************************************/
  4607. /*! no static exports found */
  4608. /***/ (function(module, exports) {
  4609. /**
  4610. * Appends the elements of `values` to `array`.
  4611. *
  4612. * @private
  4613. * @param {Array} array The array to modify.
  4614. * @param {Array} values The values to append.
  4615. * @returns {Array} Returns `array`.
  4616. */
  4617. function arrayPush(array, values) {
  4618. var index = -1,
  4619. length = values.length,
  4620. offset = array.length;
  4621. while (++index < length) {
  4622. array[offset + index] = values[index];
  4623. }
  4624. return array;
  4625. }
  4626. module.exports = arrayPush;
  4627. /***/ }),
  4628. /***/ "../../node_modules/lodash/_arrayReduce.js":
  4629. /*!***************************************************************!*\
  4630. !*** C:/Repos/Babylon.js/node_modules/lodash/_arrayReduce.js ***!
  4631. \***************************************************************/
  4632. /*! no static exports found */
  4633. /***/ (function(module, exports) {
  4634. /**
  4635. * A specialized version of `_.reduce` for arrays without support for
  4636. * iteratee shorthands.
  4637. *
  4638. * @private
  4639. * @param {Array} [array] The array to iterate over.
  4640. * @param {Function} iteratee The function invoked per iteration.
  4641. * @param {*} [accumulator] The initial value.
  4642. * @param {boolean} [initAccum] Specify using the first element of `array` as
  4643. * the initial value.
  4644. * @returns {*} Returns the accumulated value.
  4645. */
  4646. function arrayReduce(array, iteratee, accumulator, initAccum) {
  4647. var index = -1,
  4648. length = array == null ? 0 : array.length;
  4649. if (initAccum && length) {
  4650. accumulator = array[++index];
  4651. }
  4652. while (++index < length) {
  4653. accumulator = iteratee(accumulator, array[index], index, array);
  4654. }
  4655. return accumulator;
  4656. }
  4657. module.exports = arrayReduce;
  4658. /***/ }),
  4659. /***/ "../../node_modules/lodash/_arraySome.js":
  4660. /*!*************************************************************!*\
  4661. !*** C:/Repos/Babylon.js/node_modules/lodash/_arraySome.js ***!
  4662. \*************************************************************/
  4663. /*! no static exports found */
  4664. /***/ (function(module, exports) {
  4665. /**
  4666. * A specialized version of `_.some` for arrays without support for iteratee
  4667. * shorthands.
  4668. *
  4669. * @private
  4670. * @param {Array} [array] The array to iterate over.
  4671. * @param {Function} predicate The function invoked per iteration.
  4672. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4673. * else `false`.
  4674. */
  4675. function arraySome(array, predicate) {
  4676. var index = -1,
  4677. length = array == null ? 0 : array.length;
  4678. while (++index < length) {
  4679. if (predicate(array[index], index, array)) {
  4680. return true;
  4681. }
  4682. }
  4683. return false;
  4684. }
  4685. module.exports = arraySome;
  4686. /***/ }),
  4687. /***/ "../../node_modules/lodash/_asciiSize.js":
  4688. /*!*************************************************************!*\
  4689. !*** C:/Repos/Babylon.js/node_modules/lodash/_asciiSize.js ***!
  4690. \*************************************************************/
  4691. /*! no static exports found */
  4692. /***/ (function(module, exports, __webpack_require__) {
  4693. var baseProperty = __webpack_require__(/*! ./_baseProperty */ "../../node_modules/lodash/_baseProperty.js");
  4694. /**
  4695. * Gets the size of an ASCII `string`.
  4696. *
  4697. * @private
  4698. * @param {string} string The string inspect.
  4699. * @returns {number} Returns the string size.
  4700. */
  4701. var asciiSize = baseProperty('length');
  4702. module.exports = asciiSize;
  4703. /***/ }),
  4704. /***/ "../../node_modules/lodash/_assignMergeValue.js":
  4705. /*!********************************************************************!*\
  4706. !*** C:/Repos/Babylon.js/node_modules/lodash/_assignMergeValue.js ***!
  4707. \********************************************************************/
  4708. /*! no static exports found */
  4709. /***/ (function(module, exports, __webpack_require__) {
  4710. var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../../node_modules/lodash/_baseAssignValue.js"),
  4711. eq = __webpack_require__(/*! ./eq */ "../../node_modules/lodash/eq.js");
  4712. /**
  4713. * This function is like `assignValue` except that it doesn't assign
  4714. * `undefined` values.
  4715. *
  4716. * @private
  4717. * @param {Object} object The object to modify.
  4718. * @param {string} key The key of the property to assign.
  4719. * @param {*} value The value to assign.
  4720. */
  4721. function assignMergeValue(object, key, value) {
  4722. if ((value !== undefined && !eq(object[key], value)) ||
  4723. (value === undefined && !(key in object))) {
  4724. baseAssignValue(object, key, value);
  4725. }
  4726. }
  4727. module.exports = assignMergeValue;
  4728. /***/ }),
  4729. /***/ "../../node_modules/lodash/_assignValue.js":
  4730. /*!***************************************************************!*\
  4731. !*** C:/Repos/Babylon.js/node_modules/lodash/_assignValue.js ***!
  4732. \***************************************************************/
  4733. /*! no static exports found */
  4734. /***/ (function(module, exports, __webpack_require__) {
  4735. var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../../node_modules/lodash/_baseAssignValue.js"),
  4736. eq = __webpack_require__(/*! ./eq */ "../../node_modules/lodash/eq.js");
  4737. /** Used for built-in method references. */
  4738. var objectProto = Object.prototype;
  4739. /** Used to check objects for own properties. */
  4740. var hasOwnProperty = objectProto.hasOwnProperty;
  4741. /**
  4742. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  4743. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  4744. * for equality comparisons.
  4745. *
  4746. * @private
  4747. * @param {Object} object The object to modify.
  4748. * @param {string} key The key of the property to assign.
  4749. * @param {*} value The value to assign.
  4750. */
  4751. function assignValue(object, key, value) {
  4752. var objValue = object[key];
  4753. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  4754. (value === undefined && !(key in object))) {
  4755. baseAssignValue(object, key, value);
  4756. }
  4757. }
  4758. module.exports = assignValue;
  4759. /***/ }),
  4760. /***/ "../../node_modules/lodash/_assocIndexOf.js":
  4761. /*!****************************************************************!*\
  4762. !*** C:/Repos/Babylon.js/node_modules/lodash/_assocIndexOf.js ***!
  4763. \****************************************************************/
  4764. /*! no static exports found */
  4765. /***/ (function(module, exports, __webpack_require__) {
  4766. var eq = __webpack_require__(/*! ./eq */ "../../node_modules/lodash/eq.js");
  4767. /**
  4768. * Gets the index at which the `key` is found in `array` of key-value pairs.
  4769. *
  4770. * @private
  4771. * @param {Array} array The array to inspect.
  4772. * @param {*} key The key to search for.
  4773. * @returns {number} Returns the index of the matched value, else `-1`.
  4774. */
  4775. function assocIndexOf(array, key) {
  4776. var length = array.length;
  4777. while (length--) {
  4778. if (eq(array[length][0], key)) {
  4779. return length;
  4780. }
  4781. }
  4782. return -1;
  4783. }
  4784. module.exports = assocIndexOf;
  4785. /***/ }),
  4786. /***/ "../../node_modules/lodash/_baseAssign.js":
  4787. /*!**************************************************************!*\
  4788. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseAssign.js ***!
  4789. \**************************************************************/
  4790. /*! no static exports found */
  4791. /***/ (function(module, exports, __webpack_require__) {
  4792. var copyObject = __webpack_require__(/*! ./_copyObject */ "../../node_modules/lodash/_copyObject.js"),
  4793. keys = __webpack_require__(/*! ./keys */ "../../node_modules/lodash/keys.js");
  4794. /**
  4795. * The base implementation of `_.assign` without support for multiple sources
  4796. * or `customizer` functions.
  4797. *
  4798. * @private
  4799. * @param {Object} object The destination object.
  4800. * @param {Object} source The source object.
  4801. * @returns {Object} Returns `object`.
  4802. */
  4803. function baseAssign(object, source) {
  4804. return object && copyObject(source, keys(source), object);
  4805. }
  4806. module.exports = baseAssign;
  4807. /***/ }),
  4808. /***/ "../../node_modules/lodash/_baseAssignIn.js":
  4809. /*!****************************************************************!*\
  4810. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseAssignIn.js ***!
  4811. \****************************************************************/
  4812. /*! no static exports found */
  4813. /***/ (function(module, exports, __webpack_require__) {
  4814. var copyObject = __webpack_require__(/*! ./_copyObject */ "../../node_modules/lodash/_copyObject.js"),
  4815. keysIn = __webpack_require__(/*! ./keysIn */ "../../node_modules/lodash/keysIn.js");
  4816. /**
  4817. * The base implementation of `_.assignIn` without support for multiple sources
  4818. * or `customizer` functions.
  4819. *
  4820. * @private
  4821. * @param {Object} object The destination object.
  4822. * @param {Object} source The source object.
  4823. * @returns {Object} Returns `object`.
  4824. */
  4825. function baseAssignIn(object, source) {
  4826. return object && copyObject(source, keysIn(source), object);
  4827. }
  4828. module.exports = baseAssignIn;
  4829. /***/ }),
  4830. /***/ "../../node_modules/lodash/_baseAssignValue.js":
  4831. /*!*******************************************************************!*\
  4832. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseAssignValue.js ***!
  4833. \*******************************************************************/
  4834. /*! no static exports found */
  4835. /***/ (function(module, exports, __webpack_require__) {
  4836. var defineProperty = __webpack_require__(/*! ./_defineProperty */ "../../node_modules/lodash/_defineProperty.js");
  4837. /**
  4838. * The base implementation of `assignValue` and `assignMergeValue` without
  4839. * value checks.
  4840. *
  4841. * @private
  4842. * @param {Object} object The object to modify.
  4843. * @param {string} key The key of the property to assign.
  4844. * @param {*} value The value to assign.
  4845. */
  4846. function baseAssignValue(object, key, value) {
  4847. if (key == '__proto__' && defineProperty) {
  4848. defineProperty(object, key, {
  4849. 'configurable': true,
  4850. 'enumerable': true,
  4851. 'value': value,
  4852. 'writable': true
  4853. });
  4854. } else {
  4855. object[key] = value;
  4856. }
  4857. }
  4858. module.exports = baseAssignValue;
  4859. /***/ }),
  4860. /***/ "../../node_modules/lodash/_baseClone.js":
  4861. /*!*************************************************************!*\
  4862. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseClone.js ***!
  4863. \*************************************************************/
  4864. /*! no static exports found */
  4865. /***/ (function(module, exports, __webpack_require__) {
  4866. var Stack = __webpack_require__(/*! ./_Stack */ "../../node_modules/lodash/_Stack.js"),
  4867. arrayEach = __webpack_require__(/*! ./_arrayEach */ "../../node_modules/lodash/_arrayEach.js"),
  4868. assignValue = __webpack_require__(/*! ./_assignValue */ "../../node_modules/lodash/_assignValue.js"),
  4869. baseAssign = __webpack_require__(/*! ./_baseAssign */ "../../node_modules/lodash/_baseAssign.js"),
  4870. baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ "../../node_modules/lodash/_baseAssignIn.js"),
  4871. cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "../../node_modules/lodash/_cloneBuffer.js"),
  4872. copyArray = __webpack_require__(/*! ./_copyArray */ "../../node_modules/lodash/_copyArray.js"),
  4873. copySymbols = __webpack_require__(/*! ./_copySymbols */ "../../node_modules/lodash/_copySymbols.js"),
  4874. copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ "../../node_modules/lodash/_copySymbolsIn.js"),
  4875. getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "../../node_modules/lodash/_getAllKeys.js"),
  4876. getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "../../node_modules/lodash/_getAllKeysIn.js"),
  4877. getTag = __webpack_require__(/*! ./_getTag */ "../../node_modules/lodash/_getTag.js"),
  4878. initCloneArray = __webpack_require__(/*! ./_initCloneArray */ "../../node_modules/lodash/_initCloneArray.js"),
  4879. initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ "../../node_modules/lodash/_initCloneByTag.js"),
  4880. initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "../../node_modules/lodash/_initCloneObject.js"),
  4881. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  4882. isBuffer = __webpack_require__(/*! ./isBuffer */ "../../node_modules/lodash/isBuffer.js"),
  4883. isMap = __webpack_require__(/*! ./isMap */ "../../node_modules/lodash/isMap.js"),
  4884. isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"),
  4885. isSet = __webpack_require__(/*! ./isSet */ "../../node_modules/lodash/isSet.js"),
  4886. keys = __webpack_require__(/*! ./keys */ "../../node_modules/lodash/keys.js"),
  4887. keysIn = __webpack_require__(/*! ./keysIn */ "../../node_modules/lodash/keysIn.js");
  4888. /** Used to compose bitmasks for cloning. */
  4889. var CLONE_DEEP_FLAG = 1,
  4890. CLONE_FLAT_FLAG = 2,
  4891. CLONE_SYMBOLS_FLAG = 4;
  4892. /** `Object#toString` result references. */
  4893. var argsTag = '[object Arguments]',
  4894. arrayTag = '[object Array]',
  4895. boolTag = '[object Boolean]',
  4896. dateTag = '[object Date]',
  4897. errorTag = '[object Error]',
  4898. funcTag = '[object Function]',
  4899. genTag = '[object GeneratorFunction]',
  4900. mapTag = '[object Map]',
  4901. numberTag = '[object Number]',
  4902. objectTag = '[object Object]',
  4903. regexpTag = '[object RegExp]',
  4904. setTag = '[object Set]',
  4905. stringTag = '[object String]',
  4906. symbolTag = '[object Symbol]',
  4907. weakMapTag = '[object WeakMap]';
  4908. var arrayBufferTag = '[object ArrayBuffer]',
  4909. dataViewTag = '[object DataView]',
  4910. float32Tag = '[object Float32Array]',
  4911. float64Tag = '[object Float64Array]',
  4912. int8Tag = '[object Int8Array]',
  4913. int16Tag = '[object Int16Array]',
  4914. int32Tag = '[object Int32Array]',
  4915. uint8Tag = '[object Uint8Array]',
  4916. uint8ClampedTag = '[object Uint8ClampedArray]',
  4917. uint16Tag = '[object Uint16Array]',
  4918. uint32Tag = '[object Uint32Array]';
  4919. /** Used to identify `toStringTag` values supported by `_.clone`. */
  4920. var cloneableTags = {};
  4921. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  4922. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  4923. cloneableTags[boolTag] = cloneableTags[dateTag] =
  4924. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  4925. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  4926. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  4927. cloneableTags[numberTag] = cloneableTags[objectTag] =
  4928. cloneableTags[regexpTag] = cloneableTags[setTag] =
  4929. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  4930. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  4931. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  4932. cloneableTags[errorTag] = cloneableTags[funcTag] =
  4933. cloneableTags[weakMapTag] = false;
  4934. /**
  4935. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  4936. * traversed objects.
  4937. *
  4938. * @private
  4939. * @param {*} value The value to clone.
  4940. * @param {boolean} bitmask The bitmask flags.
  4941. * 1 - Deep clone
  4942. * 2 - Flatten inherited properties
  4943. * 4 - Clone symbols
  4944. * @param {Function} [customizer] The function to customize cloning.
  4945. * @param {string} [key] The key of `value`.
  4946. * @param {Object} [object] The parent object of `value`.
  4947. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  4948. * @returns {*} Returns the cloned value.
  4949. */
  4950. function baseClone(value, bitmask, customizer, key, object, stack) {
  4951. var result,
  4952. isDeep = bitmask & CLONE_DEEP_FLAG,
  4953. isFlat = bitmask & CLONE_FLAT_FLAG,
  4954. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  4955. if (customizer) {
  4956. result = object ? customizer(value, key, object, stack) : customizer(value);
  4957. }
  4958. if (result !== undefined) {
  4959. return result;
  4960. }
  4961. if (!isObject(value)) {
  4962. return value;
  4963. }
  4964. var isArr = isArray(value);
  4965. if (isArr) {
  4966. result = initCloneArray(value);
  4967. if (!isDeep) {
  4968. return copyArray(value, result);
  4969. }
  4970. } else {
  4971. var tag = getTag(value),
  4972. isFunc = tag == funcTag || tag == genTag;
  4973. if (isBuffer(value)) {
  4974. return cloneBuffer(value, isDeep);
  4975. }
  4976. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  4977. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  4978. if (!isDeep) {
  4979. return isFlat
  4980. ? copySymbolsIn(value, baseAssignIn(result, value))
  4981. : copySymbols(value, baseAssign(result, value));
  4982. }
  4983. } else {
  4984. if (!cloneableTags[tag]) {
  4985. return object ? value : {};
  4986. }
  4987. result = initCloneByTag(value, tag, isDeep);
  4988. }
  4989. }
  4990. // Check for circular references and return its corresponding clone.
  4991. stack || (stack = new Stack);
  4992. var stacked = stack.get(value);
  4993. if (stacked) {
  4994. return stacked;
  4995. }
  4996. stack.set(value, result);
  4997. if (isSet(value)) {
  4998. value.forEach(function(subValue) {
  4999. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  5000. });
  5001. } else if (isMap(value)) {
  5002. value.forEach(function(subValue, key) {
  5003. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  5004. });
  5005. }
  5006. var keysFunc = isFull
  5007. ? (isFlat ? getAllKeysIn : getAllKeys)
  5008. : (isFlat ? keysIn : keys);
  5009. var props = isArr ? undefined : keysFunc(value);
  5010. arrayEach(props || value, function(subValue, key) {
  5011. if (props) {
  5012. key = subValue;
  5013. subValue = value[key];
  5014. }
  5015. // Recursively populate clone (susceptible to call stack limits).
  5016. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  5017. });
  5018. return result;
  5019. }
  5020. module.exports = baseClone;
  5021. /***/ }),
  5022. /***/ "../../node_modules/lodash/_baseCreate.js":
  5023. /*!**************************************************************!*\
  5024. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseCreate.js ***!
  5025. \**************************************************************/
  5026. /*! no static exports found */
  5027. /***/ (function(module, exports, __webpack_require__) {
  5028. var isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js");
  5029. /** Built-in value references. */
  5030. var objectCreate = Object.create;
  5031. /**
  5032. * The base implementation of `_.create` without support for assigning
  5033. * properties to the created object.
  5034. *
  5035. * @private
  5036. * @param {Object} proto The object to inherit from.
  5037. * @returns {Object} Returns the new object.
  5038. */
  5039. var baseCreate = (function() {
  5040. function object() {}
  5041. return function(proto) {
  5042. if (!isObject(proto)) {
  5043. return {};
  5044. }
  5045. if (objectCreate) {
  5046. return objectCreate(proto);
  5047. }
  5048. object.prototype = proto;
  5049. var result = new object;
  5050. object.prototype = undefined;
  5051. return result;
  5052. };
  5053. }());
  5054. module.exports = baseCreate;
  5055. /***/ }),
  5056. /***/ "../../node_modules/lodash/_baseEach.js":
  5057. /*!************************************************************!*\
  5058. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseEach.js ***!
  5059. \************************************************************/
  5060. /*! no static exports found */
  5061. /***/ (function(module, exports, __webpack_require__) {
  5062. var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "../../node_modules/lodash/_baseForOwn.js"),
  5063. createBaseEach = __webpack_require__(/*! ./_createBaseEach */ "../../node_modules/lodash/_createBaseEach.js");
  5064. /**
  5065. * The base implementation of `_.forEach` without support for iteratee shorthands.
  5066. *
  5067. * @private
  5068. * @param {Array|Object} collection The collection to iterate over.
  5069. * @param {Function} iteratee The function invoked per iteration.
  5070. * @returns {Array|Object} Returns `collection`.
  5071. */
  5072. var baseEach = createBaseEach(baseForOwn);
  5073. module.exports = baseEach;
  5074. /***/ }),
  5075. /***/ "../../node_modules/lodash/_baseExtremum.js":
  5076. /*!****************************************************************!*\
  5077. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseExtremum.js ***!
  5078. \****************************************************************/
  5079. /*! no static exports found */
  5080. /***/ (function(module, exports, __webpack_require__) {
  5081. var isSymbol = __webpack_require__(/*! ./isSymbol */ "../../node_modules/lodash/isSymbol.js");
  5082. /**
  5083. * The base implementation of methods like `_.max` and `_.min` which accepts a
  5084. * `comparator` to determine the extremum value.
  5085. *
  5086. * @private
  5087. * @param {Array} array The array to iterate over.
  5088. * @param {Function} iteratee The iteratee invoked per iteration.
  5089. * @param {Function} comparator The comparator used to compare values.
  5090. * @returns {*} Returns the extremum value.
  5091. */
  5092. function baseExtremum(array, iteratee, comparator) {
  5093. var index = -1,
  5094. length = array.length;
  5095. while (++index < length) {
  5096. var value = array[index],
  5097. current = iteratee(value);
  5098. if (current != null && (computed === undefined
  5099. ? (current === current && !isSymbol(current))
  5100. : comparator(current, computed)
  5101. )) {
  5102. var computed = current,
  5103. result = value;
  5104. }
  5105. }
  5106. return result;
  5107. }
  5108. module.exports = baseExtremum;
  5109. /***/ }),
  5110. /***/ "../../node_modules/lodash/_baseFilter.js":
  5111. /*!**************************************************************!*\
  5112. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseFilter.js ***!
  5113. \**************************************************************/
  5114. /*! no static exports found */
  5115. /***/ (function(module, exports, __webpack_require__) {
  5116. var baseEach = __webpack_require__(/*! ./_baseEach */ "../../node_modules/lodash/_baseEach.js");
  5117. /**
  5118. * The base implementation of `_.filter` without support for iteratee shorthands.
  5119. *
  5120. * @private
  5121. * @param {Array|Object} collection The collection to iterate over.
  5122. * @param {Function} predicate The function invoked per iteration.
  5123. * @returns {Array} Returns the new filtered array.
  5124. */
  5125. function baseFilter(collection, predicate) {
  5126. var result = [];
  5127. baseEach(collection, function(value, index, collection) {
  5128. if (predicate(value, index, collection)) {
  5129. result.push(value);
  5130. }
  5131. });
  5132. return result;
  5133. }
  5134. module.exports = baseFilter;
  5135. /***/ }),
  5136. /***/ "../../node_modules/lodash/_baseFindIndex.js":
  5137. /*!*****************************************************************!*\
  5138. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseFindIndex.js ***!
  5139. \*****************************************************************/
  5140. /*! no static exports found */
  5141. /***/ (function(module, exports) {
  5142. /**
  5143. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  5144. * support for iteratee shorthands.
  5145. *
  5146. * @private
  5147. * @param {Array} array The array to inspect.
  5148. * @param {Function} predicate The function invoked per iteration.
  5149. * @param {number} fromIndex The index to search from.
  5150. * @param {boolean} [fromRight] Specify iterating from right to left.
  5151. * @returns {number} Returns the index of the matched value, else `-1`.
  5152. */
  5153. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  5154. var length = array.length,
  5155. index = fromIndex + (fromRight ? 1 : -1);
  5156. while ((fromRight ? index-- : ++index < length)) {
  5157. if (predicate(array[index], index, array)) {
  5158. return index;
  5159. }
  5160. }
  5161. return -1;
  5162. }
  5163. module.exports = baseFindIndex;
  5164. /***/ }),
  5165. /***/ "../../node_modules/lodash/_baseFlatten.js":
  5166. /*!***************************************************************!*\
  5167. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseFlatten.js ***!
  5168. \***************************************************************/
  5169. /*! no static exports found */
  5170. /***/ (function(module, exports, __webpack_require__) {
  5171. var arrayPush = __webpack_require__(/*! ./_arrayPush */ "../../node_modules/lodash/_arrayPush.js"),
  5172. isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "../../node_modules/lodash/_isFlattenable.js");
  5173. /**
  5174. * The base implementation of `_.flatten` with support for restricting flattening.
  5175. *
  5176. * @private
  5177. * @param {Array} array The array to flatten.
  5178. * @param {number} depth The maximum recursion depth.
  5179. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  5180. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  5181. * @param {Array} [result=[]] The initial result value.
  5182. * @returns {Array} Returns the new flattened array.
  5183. */
  5184. function baseFlatten(array, depth, predicate, isStrict, result) {
  5185. var index = -1,
  5186. length = array.length;
  5187. predicate || (predicate = isFlattenable);
  5188. result || (result = []);
  5189. while (++index < length) {
  5190. var value = array[index];
  5191. if (depth > 0 && predicate(value)) {
  5192. if (depth > 1) {
  5193. // Recursively flatten arrays (susceptible to call stack limits).
  5194. baseFlatten(value, depth - 1, predicate, isStrict, result);
  5195. } else {
  5196. arrayPush(result, value);
  5197. }
  5198. } else if (!isStrict) {
  5199. result[result.length] = value;
  5200. }
  5201. }
  5202. return result;
  5203. }
  5204. module.exports = baseFlatten;
  5205. /***/ }),
  5206. /***/ "../../node_modules/lodash/_baseFor.js":
  5207. /*!***********************************************************!*\
  5208. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseFor.js ***!
  5209. \***********************************************************/
  5210. /*! no static exports found */
  5211. /***/ (function(module, exports, __webpack_require__) {
  5212. var createBaseFor = __webpack_require__(/*! ./_createBaseFor */ "../../node_modules/lodash/_createBaseFor.js");
  5213. /**
  5214. * The base implementation of `baseForOwn` which iterates over `object`
  5215. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  5216. * Iteratee functions may exit iteration early by explicitly returning `false`.
  5217. *
  5218. * @private
  5219. * @param {Object} object The object to iterate over.
  5220. * @param {Function} iteratee The function invoked per iteration.
  5221. * @param {Function} keysFunc The function to get the keys of `object`.
  5222. * @returns {Object} Returns `object`.
  5223. */
  5224. var baseFor = createBaseFor();
  5225. module.exports = baseFor;
  5226. /***/ }),
  5227. /***/ "../../node_modules/lodash/_baseForOwn.js":
  5228. /*!**************************************************************!*\
  5229. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseForOwn.js ***!
  5230. \**************************************************************/
  5231. /*! no static exports found */
  5232. /***/ (function(module, exports, __webpack_require__) {
  5233. var baseFor = __webpack_require__(/*! ./_baseFor */ "../../node_modules/lodash/_baseFor.js"),
  5234. keys = __webpack_require__(/*! ./keys */ "../../node_modules/lodash/keys.js");
  5235. /**
  5236. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  5237. *
  5238. * @private
  5239. * @param {Object} object The object to iterate over.
  5240. * @param {Function} iteratee The function invoked per iteration.
  5241. * @returns {Object} Returns `object`.
  5242. */
  5243. function baseForOwn(object, iteratee) {
  5244. return object && baseFor(object, iteratee, keys);
  5245. }
  5246. module.exports = baseForOwn;
  5247. /***/ }),
  5248. /***/ "../../node_modules/lodash/_baseGet.js":
  5249. /*!***********************************************************!*\
  5250. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseGet.js ***!
  5251. \***********************************************************/
  5252. /*! no static exports found */
  5253. /***/ (function(module, exports, __webpack_require__) {
  5254. var castPath = __webpack_require__(/*! ./_castPath */ "../../node_modules/lodash/_castPath.js"),
  5255. toKey = __webpack_require__(/*! ./_toKey */ "../../node_modules/lodash/_toKey.js");
  5256. /**
  5257. * The base implementation of `_.get` without support for default values.
  5258. *
  5259. * @private
  5260. * @param {Object} object The object to query.
  5261. * @param {Array|string} path The path of the property to get.
  5262. * @returns {*} Returns the resolved value.
  5263. */
  5264. function baseGet(object, path) {
  5265. path = castPath(path, object);
  5266. var index = 0,
  5267. length = path.length;
  5268. while (object != null && index < length) {
  5269. object = object[toKey(path[index++])];
  5270. }
  5271. return (index && index == length) ? object : undefined;
  5272. }
  5273. module.exports = baseGet;
  5274. /***/ }),
  5275. /***/ "../../node_modules/lodash/_baseGetAllKeys.js":
  5276. /*!******************************************************************!*\
  5277. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseGetAllKeys.js ***!
  5278. \******************************************************************/
  5279. /*! no static exports found */
  5280. /***/ (function(module, exports, __webpack_require__) {
  5281. var arrayPush = __webpack_require__(/*! ./_arrayPush */ "../../node_modules/lodash/_arrayPush.js"),
  5282. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js");
  5283. /**
  5284. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  5285. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  5286. * symbols of `object`.
  5287. *
  5288. * @private
  5289. * @param {Object} object The object to query.
  5290. * @param {Function} keysFunc The function to get the keys of `object`.
  5291. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  5292. * @returns {Array} Returns the array of property names and symbols.
  5293. */
  5294. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  5295. var result = keysFunc(object);
  5296. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  5297. }
  5298. module.exports = baseGetAllKeys;
  5299. /***/ }),
  5300. /***/ "../../node_modules/lodash/_baseGetTag.js":
  5301. /*!**************************************************************!*\
  5302. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseGetTag.js ***!
  5303. \**************************************************************/
  5304. /*! no static exports found */
  5305. /***/ (function(module, exports, __webpack_require__) {
  5306. var Symbol = __webpack_require__(/*! ./_Symbol */ "../../node_modules/lodash/_Symbol.js"),
  5307. getRawTag = __webpack_require__(/*! ./_getRawTag */ "../../node_modules/lodash/_getRawTag.js"),
  5308. objectToString = __webpack_require__(/*! ./_objectToString */ "../../node_modules/lodash/_objectToString.js");
  5309. /** `Object#toString` result references. */
  5310. var nullTag = '[object Null]',
  5311. undefinedTag = '[object Undefined]';
  5312. /** Built-in value references. */
  5313. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  5314. /**
  5315. * The base implementation of `getTag` without fallbacks for buggy environments.
  5316. *
  5317. * @private
  5318. * @param {*} value The value to query.
  5319. * @returns {string} Returns the `toStringTag`.
  5320. */
  5321. function baseGetTag(value) {
  5322. if (value == null) {
  5323. return value === undefined ? undefinedTag : nullTag;
  5324. }
  5325. return (symToStringTag && symToStringTag in Object(value))
  5326. ? getRawTag(value)
  5327. : objectToString(value);
  5328. }
  5329. module.exports = baseGetTag;
  5330. /***/ }),
  5331. /***/ "../../node_modules/lodash/_baseGt.js":
  5332. /*!**********************************************************!*\
  5333. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseGt.js ***!
  5334. \**********************************************************/
  5335. /*! no static exports found */
  5336. /***/ (function(module, exports) {
  5337. /**
  5338. * The base implementation of `_.gt` which doesn't coerce arguments.
  5339. *
  5340. * @private
  5341. * @param {*} value The value to compare.
  5342. * @param {*} other The other value to compare.
  5343. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  5344. * else `false`.
  5345. */
  5346. function baseGt(value, other) {
  5347. return value > other;
  5348. }
  5349. module.exports = baseGt;
  5350. /***/ }),
  5351. /***/ "../../node_modules/lodash/_baseHas.js":
  5352. /*!***********************************************************!*\
  5353. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseHas.js ***!
  5354. \***********************************************************/
  5355. /*! no static exports found */
  5356. /***/ (function(module, exports) {
  5357. /** Used for built-in method references. */
  5358. var objectProto = Object.prototype;
  5359. /** Used to check objects for own properties. */
  5360. var hasOwnProperty = objectProto.hasOwnProperty;
  5361. /**
  5362. * The base implementation of `_.has` without support for deep paths.
  5363. *
  5364. * @private
  5365. * @param {Object} [object] The object to query.
  5366. * @param {Array|string} key The key to check.
  5367. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  5368. */
  5369. function baseHas(object, key) {
  5370. return object != null && hasOwnProperty.call(object, key);
  5371. }
  5372. module.exports = baseHas;
  5373. /***/ }),
  5374. /***/ "../../node_modules/lodash/_baseHasIn.js":
  5375. /*!*************************************************************!*\
  5376. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseHasIn.js ***!
  5377. \*************************************************************/
  5378. /*! no static exports found */
  5379. /***/ (function(module, exports) {
  5380. /**
  5381. * The base implementation of `_.hasIn` without support for deep paths.
  5382. *
  5383. * @private
  5384. * @param {Object} [object] The object to query.
  5385. * @param {Array|string} key The key to check.
  5386. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  5387. */
  5388. function baseHasIn(object, key) {
  5389. return object != null && key in Object(object);
  5390. }
  5391. module.exports = baseHasIn;
  5392. /***/ }),
  5393. /***/ "../../node_modules/lodash/_baseIndexOf.js":
  5394. /*!***************************************************************!*\
  5395. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseIndexOf.js ***!
  5396. \***************************************************************/
  5397. /*! no static exports found */
  5398. /***/ (function(module, exports, __webpack_require__) {
  5399. var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "../../node_modules/lodash/_baseFindIndex.js"),
  5400. baseIsNaN = __webpack_require__(/*! ./_baseIsNaN */ "../../node_modules/lodash/_baseIsNaN.js"),
  5401. strictIndexOf = __webpack_require__(/*! ./_strictIndexOf */ "../../node_modules/lodash/_strictIndexOf.js");
  5402. /**
  5403. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  5404. *
  5405. * @private
  5406. * @param {Array} array The array to inspect.
  5407. * @param {*} value The value to search for.
  5408. * @param {number} fromIndex The index to search from.
  5409. * @returns {number} Returns the index of the matched value, else `-1`.
  5410. */
  5411. function baseIndexOf(array, value, fromIndex) {
  5412. return value === value
  5413. ? strictIndexOf(array, value, fromIndex)
  5414. : baseFindIndex(array, baseIsNaN, fromIndex);
  5415. }
  5416. module.exports = baseIndexOf;
  5417. /***/ }),
  5418. /***/ "../../node_modules/lodash/_baseIsArguments.js":
  5419. /*!*******************************************************************!*\
  5420. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseIsArguments.js ***!
  5421. \*******************************************************************/
  5422. /*! no static exports found */
  5423. /***/ (function(module, exports, __webpack_require__) {
  5424. var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"),
  5425. isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js");
  5426. /** `Object#toString` result references. */
  5427. var argsTag = '[object Arguments]';
  5428. /**
  5429. * The base implementation of `_.isArguments`.
  5430. *
  5431. * @private
  5432. * @param {*} value The value to check.
  5433. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  5434. */
  5435. function baseIsArguments(value) {
  5436. return isObjectLike(value) && baseGetTag(value) == argsTag;
  5437. }
  5438. module.exports = baseIsArguments;
  5439. /***/ }),
  5440. /***/ "../../node_modules/lodash/_baseIsEqual.js":
  5441. /*!***************************************************************!*\
  5442. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseIsEqual.js ***!
  5443. \***************************************************************/
  5444. /*! no static exports found */
  5445. /***/ (function(module, exports, __webpack_require__) {
  5446. var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ "../../node_modules/lodash/_baseIsEqualDeep.js"),
  5447. isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js");
  5448. /**
  5449. * The base implementation of `_.isEqual` which supports partial comparisons
  5450. * and tracks traversed objects.
  5451. *
  5452. * @private
  5453. * @param {*} value The value to compare.
  5454. * @param {*} other The other value to compare.
  5455. * @param {boolean} bitmask The bitmask flags.
  5456. * 1 - Unordered comparison
  5457. * 2 - Partial comparison
  5458. * @param {Function} [customizer] The function to customize comparisons.
  5459. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  5460. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  5461. */
  5462. function baseIsEqual(value, other, bitmask, customizer, stack) {
  5463. if (value === other) {
  5464. return true;
  5465. }
  5466. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  5467. return value !== value && other !== other;
  5468. }
  5469. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  5470. }
  5471. module.exports = baseIsEqual;
  5472. /***/ }),
  5473. /***/ "../../node_modules/lodash/_baseIsEqualDeep.js":
  5474. /*!*******************************************************************!*\
  5475. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseIsEqualDeep.js ***!
  5476. \*******************************************************************/
  5477. /*! no static exports found */
  5478. /***/ (function(module, exports, __webpack_require__) {
  5479. var Stack = __webpack_require__(/*! ./_Stack */ "../../node_modules/lodash/_Stack.js"),
  5480. equalArrays = __webpack_require__(/*! ./_equalArrays */ "../../node_modules/lodash/_equalArrays.js"),
  5481. equalByTag = __webpack_require__(/*! ./_equalByTag */ "../../node_modules/lodash/_equalByTag.js"),
  5482. equalObjects = __webpack_require__(/*! ./_equalObjects */ "../../node_modules/lodash/_equalObjects.js"),
  5483. getTag = __webpack_require__(/*! ./_getTag */ "../../node_modules/lodash/_getTag.js"),
  5484. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  5485. isBuffer = __webpack_require__(/*! ./isBuffer */ "../../node_modules/lodash/isBuffer.js"),
  5486. isTypedArray = __webpack_require__(/*! ./isTypedArray */ "../../node_modules/lodash/isTypedArray.js");
  5487. /** Used to compose bitmasks for value comparisons. */
  5488. var COMPARE_PARTIAL_FLAG = 1;
  5489. /** `Object#toString` result references. */
  5490. var argsTag = '[object Arguments]',
  5491. arrayTag = '[object Array]',
  5492. objectTag = '[object Object]';
  5493. /** Used for built-in method references. */
  5494. var objectProto = Object.prototype;
  5495. /** Used to check objects for own properties. */
  5496. var hasOwnProperty = objectProto.hasOwnProperty;
  5497. /**
  5498. * A specialized version of `baseIsEqual` for arrays and objects which performs
  5499. * deep comparisons and tracks traversed objects enabling objects with circular
  5500. * references to be compared.
  5501. *
  5502. * @private
  5503. * @param {Object} object The object to compare.
  5504. * @param {Object} other The other object to compare.
  5505. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  5506. * @param {Function} customizer The function to customize comparisons.
  5507. * @param {Function} equalFunc The function to determine equivalents of values.
  5508. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  5509. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  5510. */
  5511. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  5512. var objIsArr = isArray(object),
  5513. othIsArr = isArray(other),
  5514. objTag = objIsArr ? arrayTag : getTag(object),
  5515. othTag = othIsArr ? arrayTag : getTag(other);
  5516. objTag = objTag == argsTag ? objectTag : objTag;
  5517. othTag = othTag == argsTag ? objectTag : othTag;
  5518. var objIsObj = objTag == objectTag,
  5519. othIsObj = othTag == objectTag,
  5520. isSameTag = objTag == othTag;
  5521. if (isSameTag && isBuffer(object)) {
  5522. if (!isBuffer(other)) {
  5523. return false;
  5524. }
  5525. objIsArr = true;
  5526. objIsObj = false;
  5527. }
  5528. if (isSameTag && !objIsObj) {
  5529. stack || (stack = new Stack);
  5530. return (objIsArr || isTypedArray(object))
  5531. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  5532. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  5533. }
  5534. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  5535. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  5536. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  5537. if (objIsWrapped || othIsWrapped) {
  5538. var objUnwrapped = objIsWrapped ? object.value() : object,
  5539. othUnwrapped = othIsWrapped ? other.value() : other;
  5540. stack || (stack = new Stack);
  5541. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  5542. }
  5543. }
  5544. if (!isSameTag) {
  5545. return false;
  5546. }
  5547. stack || (stack = new Stack);
  5548. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  5549. }
  5550. module.exports = baseIsEqualDeep;
  5551. /***/ }),
  5552. /***/ "../../node_modules/lodash/_baseIsMap.js":
  5553. /*!*************************************************************!*\
  5554. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseIsMap.js ***!
  5555. \*************************************************************/
  5556. /*! no static exports found */
  5557. /***/ (function(module, exports, __webpack_require__) {
  5558. var getTag = __webpack_require__(/*! ./_getTag */ "../../node_modules/lodash/_getTag.js"),
  5559. isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js");
  5560. /** `Object#toString` result references. */
  5561. var mapTag = '[object Map]';
  5562. /**
  5563. * The base implementation of `_.isMap` without Node.js optimizations.
  5564. *
  5565. * @private
  5566. * @param {*} value The value to check.
  5567. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  5568. */
  5569. function baseIsMap(value) {
  5570. return isObjectLike(value) && getTag(value) == mapTag;
  5571. }
  5572. module.exports = baseIsMap;
  5573. /***/ }),
  5574. /***/ "../../node_modules/lodash/_baseIsMatch.js":
  5575. /*!***************************************************************!*\
  5576. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseIsMatch.js ***!
  5577. \***************************************************************/
  5578. /*! no static exports found */
  5579. /***/ (function(module, exports, __webpack_require__) {
  5580. var Stack = __webpack_require__(/*! ./_Stack */ "../../node_modules/lodash/_Stack.js"),
  5581. baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "../../node_modules/lodash/_baseIsEqual.js");
  5582. /** Used to compose bitmasks for value comparisons. */
  5583. var COMPARE_PARTIAL_FLAG = 1,
  5584. COMPARE_UNORDERED_FLAG = 2;
  5585. /**
  5586. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  5587. *
  5588. * @private
  5589. * @param {Object} object The object to inspect.
  5590. * @param {Object} source The object of property values to match.
  5591. * @param {Array} matchData The property names, values, and compare flags to match.
  5592. * @param {Function} [customizer] The function to customize comparisons.
  5593. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  5594. */
  5595. function baseIsMatch(object, source, matchData, customizer) {
  5596. var index = matchData.length,
  5597. length = index,
  5598. noCustomizer = !customizer;
  5599. if (object == null) {
  5600. return !length;
  5601. }
  5602. object = Object(object);
  5603. while (index--) {
  5604. var data = matchData[index];
  5605. if ((noCustomizer && data[2])
  5606. ? data[1] !== object[data[0]]
  5607. : !(data[0] in object)
  5608. ) {
  5609. return false;
  5610. }
  5611. }
  5612. while (++index < length) {
  5613. data = matchData[index];
  5614. var key = data[0],
  5615. objValue = object[key],
  5616. srcValue = data[1];
  5617. if (noCustomizer && data[2]) {
  5618. if (objValue === undefined && !(key in object)) {
  5619. return false;
  5620. }
  5621. } else {
  5622. var stack = new Stack;
  5623. if (customizer) {
  5624. var result = customizer(objValue, srcValue, key, object, source, stack);
  5625. }
  5626. if (!(result === undefined
  5627. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  5628. : result
  5629. )) {
  5630. return false;
  5631. }
  5632. }
  5633. }
  5634. return true;
  5635. }
  5636. module.exports = baseIsMatch;
  5637. /***/ }),
  5638. /***/ "../../node_modules/lodash/_baseIsNaN.js":
  5639. /*!*************************************************************!*\
  5640. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseIsNaN.js ***!
  5641. \*************************************************************/
  5642. /*! no static exports found */
  5643. /***/ (function(module, exports) {
  5644. /**
  5645. * The base implementation of `_.isNaN` without support for number objects.
  5646. *
  5647. * @private
  5648. * @param {*} value The value to check.
  5649. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  5650. */
  5651. function baseIsNaN(value) {
  5652. return value !== value;
  5653. }
  5654. module.exports = baseIsNaN;
  5655. /***/ }),
  5656. /***/ "../../node_modules/lodash/_baseIsNative.js":
  5657. /*!****************************************************************!*\
  5658. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseIsNative.js ***!
  5659. \****************************************************************/
  5660. /*! no static exports found */
  5661. /***/ (function(module, exports, __webpack_require__) {
  5662. var isFunction = __webpack_require__(/*! ./isFunction */ "../../node_modules/lodash/isFunction.js"),
  5663. isMasked = __webpack_require__(/*! ./_isMasked */ "../../node_modules/lodash/_isMasked.js"),
  5664. isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"),
  5665. toSource = __webpack_require__(/*! ./_toSource */ "../../node_modules/lodash/_toSource.js");
  5666. /**
  5667. * Used to match `RegExp`
  5668. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  5669. */
  5670. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  5671. /** Used to detect host constructors (Safari). */
  5672. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  5673. /** Used for built-in method references. */
  5674. var funcProto = Function.prototype,
  5675. objectProto = Object.prototype;
  5676. /** Used to resolve the decompiled source of functions. */
  5677. var funcToString = funcProto.toString;
  5678. /** Used to check objects for own properties. */
  5679. var hasOwnProperty = objectProto.hasOwnProperty;
  5680. /** Used to detect if a method is native. */
  5681. var reIsNative = RegExp('^' +
  5682. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  5683. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  5684. );
  5685. /**
  5686. * The base implementation of `_.isNative` without bad shim checks.
  5687. *
  5688. * @private
  5689. * @param {*} value The value to check.
  5690. * @returns {boolean} Returns `true` if `value` is a native function,
  5691. * else `false`.
  5692. */
  5693. function baseIsNative(value) {
  5694. if (!isObject(value) || isMasked(value)) {
  5695. return false;
  5696. }
  5697. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  5698. return pattern.test(toSource(value));
  5699. }
  5700. module.exports = baseIsNative;
  5701. /***/ }),
  5702. /***/ "../../node_modules/lodash/_baseIsSet.js":
  5703. /*!*************************************************************!*\
  5704. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseIsSet.js ***!
  5705. \*************************************************************/
  5706. /*! no static exports found */
  5707. /***/ (function(module, exports, __webpack_require__) {
  5708. var getTag = __webpack_require__(/*! ./_getTag */ "../../node_modules/lodash/_getTag.js"),
  5709. isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js");
  5710. /** `Object#toString` result references. */
  5711. var setTag = '[object Set]';
  5712. /**
  5713. * The base implementation of `_.isSet` without Node.js optimizations.
  5714. *
  5715. * @private
  5716. * @param {*} value The value to check.
  5717. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  5718. */
  5719. function baseIsSet(value) {
  5720. return isObjectLike(value) && getTag(value) == setTag;
  5721. }
  5722. module.exports = baseIsSet;
  5723. /***/ }),
  5724. /***/ "../../node_modules/lodash/_baseIsTypedArray.js":
  5725. /*!********************************************************************!*\
  5726. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseIsTypedArray.js ***!
  5727. \********************************************************************/
  5728. /*! no static exports found */
  5729. /***/ (function(module, exports, __webpack_require__) {
  5730. var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"),
  5731. isLength = __webpack_require__(/*! ./isLength */ "../../node_modules/lodash/isLength.js"),
  5732. isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js");
  5733. /** `Object#toString` result references. */
  5734. var argsTag = '[object Arguments]',
  5735. arrayTag = '[object Array]',
  5736. boolTag = '[object Boolean]',
  5737. dateTag = '[object Date]',
  5738. errorTag = '[object Error]',
  5739. funcTag = '[object Function]',
  5740. mapTag = '[object Map]',
  5741. numberTag = '[object Number]',
  5742. objectTag = '[object Object]',
  5743. regexpTag = '[object RegExp]',
  5744. setTag = '[object Set]',
  5745. stringTag = '[object String]',
  5746. weakMapTag = '[object WeakMap]';
  5747. var arrayBufferTag = '[object ArrayBuffer]',
  5748. dataViewTag = '[object DataView]',
  5749. float32Tag = '[object Float32Array]',
  5750. float64Tag = '[object Float64Array]',
  5751. int8Tag = '[object Int8Array]',
  5752. int16Tag = '[object Int16Array]',
  5753. int32Tag = '[object Int32Array]',
  5754. uint8Tag = '[object Uint8Array]',
  5755. uint8ClampedTag = '[object Uint8ClampedArray]',
  5756. uint16Tag = '[object Uint16Array]',
  5757. uint32Tag = '[object Uint32Array]';
  5758. /** Used to identify `toStringTag` values of typed arrays. */
  5759. var typedArrayTags = {};
  5760. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  5761. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  5762. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  5763. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  5764. typedArrayTags[uint32Tag] = true;
  5765. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  5766. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  5767. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  5768. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  5769. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  5770. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  5771. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  5772. typedArrayTags[weakMapTag] = false;
  5773. /**
  5774. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  5775. *
  5776. * @private
  5777. * @param {*} value The value to check.
  5778. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  5779. */
  5780. function baseIsTypedArray(value) {
  5781. return isObjectLike(value) &&
  5782. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  5783. }
  5784. module.exports = baseIsTypedArray;
  5785. /***/ }),
  5786. /***/ "../../node_modules/lodash/_baseIteratee.js":
  5787. /*!****************************************************************!*\
  5788. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseIteratee.js ***!
  5789. \****************************************************************/
  5790. /*! no static exports found */
  5791. /***/ (function(module, exports, __webpack_require__) {
  5792. var baseMatches = __webpack_require__(/*! ./_baseMatches */ "../../node_modules/lodash/_baseMatches.js"),
  5793. baseMatchesProperty = __webpack_require__(/*! ./_baseMatchesProperty */ "../../node_modules/lodash/_baseMatchesProperty.js"),
  5794. identity = __webpack_require__(/*! ./identity */ "../../node_modules/lodash/identity.js"),
  5795. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  5796. property = __webpack_require__(/*! ./property */ "../../node_modules/lodash/property.js");
  5797. /**
  5798. * The base implementation of `_.iteratee`.
  5799. *
  5800. * @private
  5801. * @param {*} [value=_.identity] The value to convert to an iteratee.
  5802. * @returns {Function} Returns the iteratee.
  5803. */
  5804. function baseIteratee(value) {
  5805. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  5806. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  5807. if (typeof value == 'function') {
  5808. return value;
  5809. }
  5810. if (value == null) {
  5811. return identity;
  5812. }
  5813. if (typeof value == 'object') {
  5814. return isArray(value)
  5815. ? baseMatchesProperty(value[0], value[1])
  5816. : baseMatches(value);
  5817. }
  5818. return property(value);
  5819. }
  5820. module.exports = baseIteratee;
  5821. /***/ }),
  5822. /***/ "../../node_modules/lodash/_baseKeys.js":
  5823. /*!************************************************************!*\
  5824. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseKeys.js ***!
  5825. \************************************************************/
  5826. /*! no static exports found */
  5827. /***/ (function(module, exports, __webpack_require__) {
  5828. var isPrototype = __webpack_require__(/*! ./_isPrototype */ "../../node_modules/lodash/_isPrototype.js"),
  5829. nativeKeys = __webpack_require__(/*! ./_nativeKeys */ "../../node_modules/lodash/_nativeKeys.js");
  5830. /** Used for built-in method references. */
  5831. var objectProto = Object.prototype;
  5832. /** Used to check objects for own properties. */
  5833. var hasOwnProperty = objectProto.hasOwnProperty;
  5834. /**
  5835. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  5836. *
  5837. * @private
  5838. * @param {Object} object The object to query.
  5839. * @returns {Array} Returns the array of property names.
  5840. */
  5841. function baseKeys(object) {
  5842. if (!isPrototype(object)) {
  5843. return nativeKeys(object);
  5844. }
  5845. var result = [];
  5846. for (var key in Object(object)) {
  5847. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  5848. result.push(key);
  5849. }
  5850. }
  5851. return result;
  5852. }
  5853. module.exports = baseKeys;
  5854. /***/ }),
  5855. /***/ "../../node_modules/lodash/_baseKeysIn.js":
  5856. /*!**************************************************************!*\
  5857. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseKeysIn.js ***!
  5858. \**************************************************************/
  5859. /*! no static exports found */
  5860. /***/ (function(module, exports, __webpack_require__) {
  5861. var isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"),
  5862. isPrototype = __webpack_require__(/*! ./_isPrototype */ "../../node_modules/lodash/_isPrototype.js"),
  5863. nativeKeysIn = __webpack_require__(/*! ./_nativeKeysIn */ "../../node_modules/lodash/_nativeKeysIn.js");
  5864. /** Used for built-in method references. */
  5865. var objectProto = Object.prototype;
  5866. /** Used to check objects for own properties. */
  5867. var hasOwnProperty = objectProto.hasOwnProperty;
  5868. /**
  5869. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  5870. *
  5871. * @private
  5872. * @param {Object} object The object to query.
  5873. * @returns {Array} Returns the array of property names.
  5874. */
  5875. function baseKeysIn(object) {
  5876. if (!isObject(object)) {
  5877. return nativeKeysIn(object);
  5878. }
  5879. var isProto = isPrototype(object),
  5880. result = [];
  5881. for (var key in object) {
  5882. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  5883. result.push(key);
  5884. }
  5885. }
  5886. return result;
  5887. }
  5888. module.exports = baseKeysIn;
  5889. /***/ }),
  5890. /***/ "../../node_modules/lodash/_baseLt.js":
  5891. /*!**********************************************************!*\
  5892. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseLt.js ***!
  5893. \**********************************************************/
  5894. /*! no static exports found */
  5895. /***/ (function(module, exports) {
  5896. /**
  5897. * The base implementation of `_.lt` which doesn't coerce arguments.
  5898. *
  5899. * @private
  5900. * @param {*} value The value to compare.
  5901. * @param {*} other The other value to compare.
  5902. * @returns {boolean} Returns `true` if `value` is less than `other`,
  5903. * else `false`.
  5904. */
  5905. function baseLt(value, other) {
  5906. return value < other;
  5907. }
  5908. module.exports = baseLt;
  5909. /***/ }),
  5910. /***/ "../../node_modules/lodash/_baseMap.js":
  5911. /*!***********************************************************!*\
  5912. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseMap.js ***!
  5913. \***********************************************************/
  5914. /*! no static exports found */
  5915. /***/ (function(module, exports, __webpack_require__) {
  5916. var baseEach = __webpack_require__(/*! ./_baseEach */ "../../node_modules/lodash/_baseEach.js"),
  5917. isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js");
  5918. /**
  5919. * The base implementation of `_.map` without support for iteratee shorthands.
  5920. *
  5921. * @private
  5922. * @param {Array|Object} collection The collection to iterate over.
  5923. * @param {Function} iteratee The function invoked per iteration.
  5924. * @returns {Array} Returns the new mapped array.
  5925. */
  5926. function baseMap(collection, iteratee) {
  5927. var index = -1,
  5928. result = isArrayLike(collection) ? Array(collection.length) : [];
  5929. baseEach(collection, function(value, key, collection) {
  5930. result[++index] = iteratee(value, key, collection);
  5931. });
  5932. return result;
  5933. }
  5934. module.exports = baseMap;
  5935. /***/ }),
  5936. /***/ "../../node_modules/lodash/_baseMatches.js":
  5937. /*!***************************************************************!*\
  5938. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseMatches.js ***!
  5939. \***************************************************************/
  5940. /*! no static exports found */
  5941. /***/ (function(module, exports, __webpack_require__) {
  5942. var baseIsMatch = __webpack_require__(/*! ./_baseIsMatch */ "../../node_modules/lodash/_baseIsMatch.js"),
  5943. getMatchData = __webpack_require__(/*! ./_getMatchData */ "../../node_modules/lodash/_getMatchData.js"),
  5944. matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "../../node_modules/lodash/_matchesStrictComparable.js");
  5945. /**
  5946. * The base implementation of `_.matches` which doesn't clone `source`.
  5947. *
  5948. * @private
  5949. * @param {Object} source The object of property values to match.
  5950. * @returns {Function} Returns the new spec function.
  5951. */
  5952. function baseMatches(source) {
  5953. var matchData = getMatchData(source);
  5954. if (matchData.length == 1 && matchData[0][2]) {
  5955. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  5956. }
  5957. return function(object) {
  5958. return object === source || baseIsMatch(object, source, matchData);
  5959. };
  5960. }
  5961. module.exports = baseMatches;
  5962. /***/ }),
  5963. /***/ "../../node_modules/lodash/_baseMatchesProperty.js":
  5964. /*!***********************************************************************!*\
  5965. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseMatchesProperty.js ***!
  5966. \***********************************************************************/
  5967. /*! no static exports found */
  5968. /***/ (function(module, exports, __webpack_require__) {
  5969. var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "../../node_modules/lodash/_baseIsEqual.js"),
  5970. get = __webpack_require__(/*! ./get */ "../../node_modules/lodash/get.js"),
  5971. hasIn = __webpack_require__(/*! ./hasIn */ "../../node_modules/lodash/hasIn.js"),
  5972. isKey = __webpack_require__(/*! ./_isKey */ "../../node_modules/lodash/_isKey.js"),
  5973. isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "../../node_modules/lodash/_isStrictComparable.js"),
  5974. matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "../../node_modules/lodash/_matchesStrictComparable.js"),
  5975. toKey = __webpack_require__(/*! ./_toKey */ "../../node_modules/lodash/_toKey.js");
  5976. /** Used to compose bitmasks for value comparisons. */
  5977. var COMPARE_PARTIAL_FLAG = 1,
  5978. COMPARE_UNORDERED_FLAG = 2;
  5979. /**
  5980. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  5981. *
  5982. * @private
  5983. * @param {string} path The path of the property to get.
  5984. * @param {*} srcValue The value to match.
  5985. * @returns {Function} Returns the new spec function.
  5986. */
  5987. function baseMatchesProperty(path, srcValue) {
  5988. if (isKey(path) && isStrictComparable(srcValue)) {
  5989. return matchesStrictComparable(toKey(path), srcValue);
  5990. }
  5991. return function(object) {
  5992. var objValue = get(object, path);
  5993. return (objValue === undefined && objValue === srcValue)
  5994. ? hasIn(object, path)
  5995. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  5996. };
  5997. }
  5998. module.exports = baseMatchesProperty;
  5999. /***/ }),
  6000. /***/ "../../node_modules/lodash/_baseMerge.js":
  6001. /*!*************************************************************!*\
  6002. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseMerge.js ***!
  6003. \*************************************************************/
  6004. /*! no static exports found */
  6005. /***/ (function(module, exports, __webpack_require__) {
  6006. var Stack = __webpack_require__(/*! ./_Stack */ "../../node_modules/lodash/_Stack.js"),
  6007. assignMergeValue = __webpack_require__(/*! ./_assignMergeValue */ "../../node_modules/lodash/_assignMergeValue.js"),
  6008. baseFor = __webpack_require__(/*! ./_baseFor */ "../../node_modules/lodash/_baseFor.js"),
  6009. baseMergeDeep = __webpack_require__(/*! ./_baseMergeDeep */ "../../node_modules/lodash/_baseMergeDeep.js"),
  6010. isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"),
  6011. keysIn = __webpack_require__(/*! ./keysIn */ "../../node_modules/lodash/keysIn.js"),
  6012. safeGet = __webpack_require__(/*! ./_safeGet */ "../../node_modules/lodash/_safeGet.js");
  6013. /**
  6014. * The base implementation of `_.merge` without support for multiple sources.
  6015. *
  6016. * @private
  6017. * @param {Object} object The destination object.
  6018. * @param {Object} source The source object.
  6019. * @param {number} srcIndex The index of `source`.
  6020. * @param {Function} [customizer] The function to customize merged values.
  6021. * @param {Object} [stack] Tracks traversed source values and their merged
  6022. * counterparts.
  6023. */
  6024. function baseMerge(object, source, srcIndex, customizer, stack) {
  6025. if (object === source) {
  6026. return;
  6027. }
  6028. baseFor(source, function(srcValue, key) {
  6029. stack || (stack = new Stack);
  6030. if (isObject(srcValue)) {
  6031. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  6032. }
  6033. else {
  6034. var newValue = customizer
  6035. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  6036. : undefined;
  6037. if (newValue === undefined) {
  6038. newValue = srcValue;
  6039. }
  6040. assignMergeValue(object, key, newValue);
  6041. }
  6042. }, keysIn);
  6043. }
  6044. module.exports = baseMerge;
  6045. /***/ }),
  6046. /***/ "../../node_modules/lodash/_baseMergeDeep.js":
  6047. /*!*****************************************************************!*\
  6048. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseMergeDeep.js ***!
  6049. \*****************************************************************/
  6050. /*! no static exports found */
  6051. /***/ (function(module, exports, __webpack_require__) {
  6052. var assignMergeValue = __webpack_require__(/*! ./_assignMergeValue */ "../../node_modules/lodash/_assignMergeValue.js"),
  6053. cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "../../node_modules/lodash/_cloneBuffer.js"),
  6054. cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ "../../node_modules/lodash/_cloneTypedArray.js"),
  6055. copyArray = __webpack_require__(/*! ./_copyArray */ "../../node_modules/lodash/_copyArray.js"),
  6056. initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "../../node_modules/lodash/_initCloneObject.js"),
  6057. isArguments = __webpack_require__(/*! ./isArguments */ "../../node_modules/lodash/isArguments.js"),
  6058. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  6059. isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "../../node_modules/lodash/isArrayLikeObject.js"),
  6060. isBuffer = __webpack_require__(/*! ./isBuffer */ "../../node_modules/lodash/isBuffer.js"),
  6061. isFunction = __webpack_require__(/*! ./isFunction */ "../../node_modules/lodash/isFunction.js"),
  6062. isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"),
  6063. isPlainObject = __webpack_require__(/*! ./isPlainObject */ "../../node_modules/lodash/isPlainObject.js"),
  6064. isTypedArray = __webpack_require__(/*! ./isTypedArray */ "../../node_modules/lodash/isTypedArray.js"),
  6065. safeGet = __webpack_require__(/*! ./_safeGet */ "../../node_modules/lodash/_safeGet.js"),
  6066. toPlainObject = __webpack_require__(/*! ./toPlainObject */ "../../node_modules/lodash/toPlainObject.js");
  6067. /**
  6068. * A specialized version of `baseMerge` for arrays and objects which performs
  6069. * deep merges and tracks traversed objects enabling objects with circular
  6070. * references to be merged.
  6071. *
  6072. * @private
  6073. * @param {Object} object The destination object.
  6074. * @param {Object} source The source object.
  6075. * @param {string} key The key of the value to merge.
  6076. * @param {number} srcIndex The index of `source`.
  6077. * @param {Function} mergeFunc The function to merge values.
  6078. * @param {Function} [customizer] The function to customize assigned values.
  6079. * @param {Object} [stack] Tracks traversed source values and their merged
  6080. * counterparts.
  6081. */
  6082. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  6083. var objValue = safeGet(object, key),
  6084. srcValue = safeGet(source, key),
  6085. stacked = stack.get(srcValue);
  6086. if (stacked) {
  6087. assignMergeValue(object, key, stacked);
  6088. return;
  6089. }
  6090. var newValue = customizer
  6091. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  6092. : undefined;
  6093. var isCommon = newValue === undefined;
  6094. if (isCommon) {
  6095. var isArr = isArray(srcValue),
  6096. isBuff = !isArr && isBuffer(srcValue),
  6097. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  6098. newValue = srcValue;
  6099. if (isArr || isBuff || isTyped) {
  6100. if (isArray(objValue)) {
  6101. newValue = objValue;
  6102. }
  6103. else if (isArrayLikeObject(objValue)) {
  6104. newValue = copyArray(objValue);
  6105. }
  6106. else if (isBuff) {
  6107. isCommon = false;
  6108. newValue = cloneBuffer(srcValue, true);
  6109. }
  6110. else if (isTyped) {
  6111. isCommon = false;
  6112. newValue = cloneTypedArray(srcValue, true);
  6113. }
  6114. else {
  6115. newValue = [];
  6116. }
  6117. }
  6118. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  6119. newValue = objValue;
  6120. if (isArguments(objValue)) {
  6121. newValue = toPlainObject(objValue);
  6122. }
  6123. else if (!isObject(objValue) || isFunction(objValue)) {
  6124. newValue = initCloneObject(srcValue);
  6125. }
  6126. }
  6127. else {
  6128. isCommon = false;
  6129. }
  6130. }
  6131. if (isCommon) {
  6132. // Recursively merge objects and arrays (susceptible to call stack limits).
  6133. stack.set(srcValue, newValue);
  6134. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  6135. stack['delete'](srcValue);
  6136. }
  6137. assignMergeValue(object, key, newValue);
  6138. }
  6139. module.exports = baseMergeDeep;
  6140. /***/ }),
  6141. /***/ "../../node_modules/lodash/_baseOrderBy.js":
  6142. /*!***************************************************************!*\
  6143. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseOrderBy.js ***!
  6144. \***************************************************************/
  6145. /*! no static exports found */
  6146. /***/ (function(module, exports, __webpack_require__) {
  6147. var arrayMap = __webpack_require__(/*! ./_arrayMap */ "../../node_modules/lodash/_arrayMap.js"),
  6148. baseGet = __webpack_require__(/*! ./_baseGet */ "../../node_modules/lodash/_baseGet.js"),
  6149. baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "../../node_modules/lodash/_baseIteratee.js"),
  6150. baseMap = __webpack_require__(/*! ./_baseMap */ "../../node_modules/lodash/_baseMap.js"),
  6151. baseSortBy = __webpack_require__(/*! ./_baseSortBy */ "../../node_modules/lodash/_baseSortBy.js"),
  6152. baseUnary = __webpack_require__(/*! ./_baseUnary */ "../../node_modules/lodash/_baseUnary.js"),
  6153. compareMultiple = __webpack_require__(/*! ./_compareMultiple */ "../../node_modules/lodash/_compareMultiple.js"),
  6154. identity = __webpack_require__(/*! ./identity */ "../../node_modules/lodash/identity.js"),
  6155. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js");
  6156. /**
  6157. * The base implementation of `_.orderBy` without param guards.
  6158. *
  6159. * @private
  6160. * @param {Array|Object} collection The collection to iterate over.
  6161. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  6162. * @param {string[]} orders The sort orders of `iteratees`.
  6163. * @returns {Array} Returns the new sorted array.
  6164. */
  6165. function baseOrderBy(collection, iteratees, orders) {
  6166. if (iteratees.length) {
  6167. iteratees = arrayMap(iteratees, function(iteratee) {
  6168. if (isArray(iteratee)) {
  6169. return function(value) {
  6170. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  6171. }
  6172. }
  6173. return iteratee;
  6174. });
  6175. } else {
  6176. iteratees = [identity];
  6177. }
  6178. var index = -1;
  6179. iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
  6180. var result = baseMap(collection, function(value, key, collection) {
  6181. var criteria = arrayMap(iteratees, function(iteratee) {
  6182. return iteratee(value);
  6183. });
  6184. return { 'criteria': criteria, 'index': ++index, 'value': value };
  6185. });
  6186. return baseSortBy(result, function(object, other) {
  6187. return compareMultiple(object, other, orders);
  6188. });
  6189. }
  6190. module.exports = baseOrderBy;
  6191. /***/ }),
  6192. /***/ "../../node_modules/lodash/_basePick.js":
  6193. /*!************************************************************!*\
  6194. !*** C:/Repos/Babylon.js/node_modules/lodash/_basePick.js ***!
  6195. \************************************************************/
  6196. /*! no static exports found */
  6197. /***/ (function(module, exports, __webpack_require__) {
  6198. var basePickBy = __webpack_require__(/*! ./_basePickBy */ "../../node_modules/lodash/_basePickBy.js"),
  6199. hasIn = __webpack_require__(/*! ./hasIn */ "../../node_modules/lodash/hasIn.js");
  6200. /**
  6201. * The base implementation of `_.pick` without support for individual
  6202. * property identifiers.
  6203. *
  6204. * @private
  6205. * @param {Object} object The source object.
  6206. * @param {string[]} paths The property paths to pick.
  6207. * @returns {Object} Returns the new object.
  6208. */
  6209. function basePick(object, paths) {
  6210. return basePickBy(object, paths, function(value, path) {
  6211. return hasIn(object, path);
  6212. });
  6213. }
  6214. module.exports = basePick;
  6215. /***/ }),
  6216. /***/ "../../node_modules/lodash/_basePickBy.js":
  6217. /*!**************************************************************!*\
  6218. !*** C:/Repos/Babylon.js/node_modules/lodash/_basePickBy.js ***!
  6219. \**************************************************************/
  6220. /*! no static exports found */
  6221. /***/ (function(module, exports, __webpack_require__) {
  6222. var baseGet = __webpack_require__(/*! ./_baseGet */ "../../node_modules/lodash/_baseGet.js"),
  6223. baseSet = __webpack_require__(/*! ./_baseSet */ "../../node_modules/lodash/_baseSet.js"),
  6224. castPath = __webpack_require__(/*! ./_castPath */ "../../node_modules/lodash/_castPath.js");
  6225. /**
  6226. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  6227. *
  6228. * @private
  6229. * @param {Object} object The source object.
  6230. * @param {string[]} paths The property paths to pick.
  6231. * @param {Function} predicate The function invoked per property.
  6232. * @returns {Object} Returns the new object.
  6233. */
  6234. function basePickBy(object, paths, predicate) {
  6235. var index = -1,
  6236. length = paths.length,
  6237. result = {};
  6238. while (++index < length) {
  6239. var path = paths[index],
  6240. value = baseGet(object, path);
  6241. if (predicate(value, path)) {
  6242. baseSet(result, castPath(path, object), value);
  6243. }
  6244. }
  6245. return result;
  6246. }
  6247. module.exports = basePickBy;
  6248. /***/ }),
  6249. /***/ "../../node_modules/lodash/_baseProperty.js":
  6250. /*!****************************************************************!*\
  6251. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseProperty.js ***!
  6252. \****************************************************************/
  6253. /*! no static exports found */
  6254. /***/ (function(module, exports) {
  6255. /**
  6256. * The base implementation of `_.property` without support for deep paths.
  6257. *
  6258. * @private
  6259. * @param {string} key The key of the property to get.
  6260. * @returns {Function} Returns the new accessor function.
  6261. */
  6262. function baseProperty(key) {
  6263. return function(object) {
  6264. return object == null ? undefined : object[key];
  6265. };
  6266. }
  6267. module.exports = baseProperty;
  6268. /***/ }),
  6269. /***/ "../../node_modules/lodash/_basePropertyDeep.js":
  6270. /*!********************************************************************!*\
  6271. !*** C:/Repos/Babylon.js/node_modules/lodash/_basePropertyDeep.js ***!
  6272. \********************************************************************/
  6273. /*! no static exports found */
  6274. /***/ (function(module, exports, __webpack_require__) {
  6275. var baseGet = __webpack_require__(/*! ./_baseGet */ "../../node_modules/lodash/_baseGet.js");
  6276. /**
  6277. * A specialized version of `baseProperty` which supports deep paths.
  6278. *
  6279. * @private
  6280. * @param {Array|string} path The path of the property to get.
  6281. * @returns {Function} Returns the new accessor function.
  6282. */
  6283. function basePropertyDeep(path) {
  6284. return function(object) {
  6285. return baseGet(object, path);
  6286. };
  6287. }
  6288. module.exports = basePropertyDeep;
  6289. /***/ }),
  6290. /***/ "../../node_modules/lodash/_baseRange.js":
  6291. /*!*************************************************************!*\
  6292. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseRange.js ***!
  6293. \*************************************************************/
  6294. /*! no static exports found */
  6295. /***/ (function(module, exports) {
  6296. /* Built-in method references for those with the same name as other `lodash` methods. */
  6297. var nativeCeil = Math.ceil,
  6298. nativeMax = Math.max;
  6299. /**
  6300. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  6301. * coerce arguments.
  6302. *
  6303. * @private
  6304. * @param {number} start The start of the range.
  6305. * @param {number} end The end of the range.
  6306. * @param {number} step The value to increment or decrement by.
  6307. * @param {boolean} [fromRight] Specify iterating from right to left.
  6308. * @returns {Array} Returns the range of numbers.
  6309. */
  6310. function baseRange(start, end, step, fromRight) {
  6311. var index = -1,
  6312. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  6313. result = Array(length);
  6314. while (length--) {
  6315. result[fromRight ? length : ++index] = start;
  6316. start += step;
  6317. }
  6318. return result;
  6319. }
  6320. module.exports = baseRange;
  6321. /***/ }),
  6322. /***/ "../../node_modules/lodash/_baseReduce.js":
  6323. /*!**************************************************************!*\
  6324. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseReduce.js ***!
  6325. \**************************************************************/
  6326. /*! no static exports found */
  6327. /***/ (function(module, exports) {
  6328. /**
  6329. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  6330. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  6331. *
  6332. * @private
  6333. * @param {Array|Object} collection The collection to iterate over.
  6334. * @param {Function} iteratee The function invoked per iteration.
  6335. * @param {*} accumulator The initial value.
  6336. * @param {boolean} initAccum Specify using the first or last element of
  6337. * `collection` as the initial value.
  6338. * @param {Function} eachFunc The function to iterate over `collection`.
  6339. * @returns {*} Returns the accumulated value.
  6340. */
  6341. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  6342. eachFunc(collection, function(value, index, collection) {
  6343. accumulator = initAccum
  6344. ? (initAccum = false, value)
  6345. : iteratee(accumulator, value, index, collection);
  6346. });
  6347. return accumulator;
  6348. }
  6349. module.exports = baseReduce;
  6350. /***/ }),
  6351. /***/ "../../node_modules/lodash/_baseRest.js":
  6352. /*!************************************************************!*\
  6353. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseRest.js ***!
  6354. \************************************************************/
  6355. /*! no static exports found */
  6356. /***/ (function(module, exports, __webpack_require__) {
  6357. var identity = __webpack_require__(/*! ./identity */ "../../node_modules/lodash/identity.js"),
  6358. overRest = __webpack_require__(/*! ./_overRest */ "../../node_modules/lodash/_overRest.js"),
  6359. setToString = __webpack_require__(/*! ./_setToString */ "../../node_modules/lodash/_setToString.js");
  6360. /**
  6361. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  6362. *
  6363. * @private
  6364. * @param {Function} func The function to apply a rest parameter to.
  6365. * @param {number} [start=func.length-1] The start position of the rest parameter.
  6366. * @returns {Function} Returns the new function.
  6367. */
  6368. function baseRest(func, start) {
  6369. return setToString(overRest(func, start, identity), func + '');
  6370. }
  6371. module.exports = baseRest;
  6372. /***/ }),
  6373. /***/ "../../node_modules/lodash/_baseSet.js":
  6374. /*!***********************************************************!*\
  6375. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseSet.js ***!
  6376. \***********************************************************/
  6377. /*! no static exports found */
  6378. /***/ (function(module, exports, __webpack_require__) {
  6379. var assignValue = __webpack_require__(/*! ./_assignValue */ "../../node_modules/lodash/_assignValue.js"),
  6380. castPath = __webpack_require__(/*! ./_castPath */ "../../node_modules/lodash/_castPath.js"),
  6381. isIndex = __webpack_require__(/*! ./_isIndex */ "../../node_modules/lodash/_isIndex.js"),
  6382. isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"),
  6383. toKey = __webpack_require__(/*! ./_toKey */ "../../node_modules/lodash/_toKey.js");
  6384. /**
  6385. * The base implementation of `_.set`.
  6386. *
  6387. * @private
  6388. * @param {Object} object The object to modify.
  6389. * @param {Array|string} path The path of the property to set.
  6390. * @param {*} value The value to set.
  6391. * @param {Function} [customizer] The function to customize path creation.
  6392. * @returns {Object} Returns `object`.
  6393. */
  6394. function baseSet(object, path, value, customizer) {
  6395. if (!isObject(object)) {
  6396. return object;
  6397. }
  6398. path = castPath(path, object);
  6399. var index = -1,
  6400. length = path.length,
  6401. lastIndex = length - 1,
  6402. nested = object;
  6403. while (nested != null && ++index < length) {
  6404. var key = toKey(path[index]),
  6405. newValue = value;
  6406. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  6407. return object;
  6408. }
  6409. if (index != lastIndex) {
  6410. var objValue = nested[key];
  6411. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  6412. if (newValue === undefined) {
  6413. newValue = isObject(objValue)
  6414. ? objValue
  6415. : (isIndex(path[index + 1]) ? [] : {});
  6416. }
  6417. }
  6418. assignValue(nested, key, newValue);
  6419. nested = nested[key];
  6420. }
  6421. return object;
  6422. }
  6423. module.exports = baseSet;
  6424. /***/ }),
  6425. /***/ "../../node_modules/lodash/_baseSetToString.js":
  6426. /*!*******************************************************************!*\
  6427. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseSetToString.js ***!
  6428. \*******************************************************************/
  6429. /*! no static exports found */
  6430. /***/ (function(module, exports, __webpack_require__) {
  6431. var constant = __webpack_require__(/*! ./constant */ "../../node_modules/lodash/constant.js"),
  6432. defineProperty = __webpack_require__(/*! ./_defineProperty */ "../../node_modules/lodash/_defineProperty.js"),
  6433. identity = __webpack_require__(/*! ./identity */ "../../node_modules/lodash/identity.js");
  6434. /**
  6435. * The base implementation of `setToString` without support for hot loop shorting.
  6436. *
  6437. * @private
  6438. * @param {Function} func The function to modify.
  6439. * @param {Function} string The `toString` result.
  6440. * @returns {Function} Returns `func`.
  6441. */
  6442. var baseSetToString = !defineProperty ? identity : function(func, string) {
  6443. return defineProperty(func, 'toString', {
  6444. 'configurable': true,
  6445. 'enumerable': false,
  6446. 'value': constant(string),
  6447. 'writable': true
  6448. });
  6449. };
  6450. module.exports = baseSetToString;
  6451. /***/ }),
  6452. /***/ "../../node_modules/lodash/_baseSortBy.js":
  6453. /*!**************************************************************!*\
  6454. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseSortBy.js ***!
  6455. \**************************************************************/
  6456. /*! no static exports found */
  6457. /***/ (function(module, exports) {
  6458. /**
  6459. * The base implementation of `_.sortBy` which uses `comparer` to define the
  6460. * sort order of `array` and replaces criteria objects with their corresponding
  6461. * values.
  6462. *
  6463. * @private
  6464. * @param {Array} array The array to sort.
  6465. * @param {Function} comparer The function to define sort order.
  6466. * @returns {Array} Returns `array`.
  6467. */
  6468. function baseSortBy(array, comparer) {
  6469. var length = array.length;
  6470. array.sort(comparer);
  6471. while (length--) {
  6472. array[length] = array[length].value;
  6473. }
  6474. return array;
  6475. }
  6476. module.exports = baseSortBy;
  6477. /***/ }),
  6478. /***/ "../../node_modules/lodash/_baseTimes.js":
  6479. /*!*************************************************************!*\
  6480. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseTimes.js ***!
  6481. \*************************************************************/
  6482. /*! no static exports found */
  6483. /***/ (function(module, exports) {
  6484. /**
  6485. * The base implementation of `_.times` without support for iteratee shorthands
  6486. * or max array length checks.
  6487. *
  6488. * @private
  6489. * @param {number} n The number of times to invoke `iteratee`.
  6490. * @param {Function} iteratee The function invoked per iteration.
  6491. * @returns {Array} Returns the array of results.
  6492. */
  6493. function baseTimes(n, iteratee) {
  6494. var index = -1,
  6495. result = Array(n);
  6496. while (++index < n) {
  6497. result[index] = iteratee(index);
  6498. }
  6499. return result;
  6500. }
  6501. module.exports = baseTimes;
  6502. /***/ }),
  6503. /***/ "../../node_modules/lodash/_baseToString.js":
  6504. /*!****************************************************************!*\
  6505. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseToString.js ***!
  6506. \****************************************************************/
  6507. /*! no static exports found */
  6508. /***/ (function(module, exports, __webpack_require__) {
  6509. var Symbol = __webpack_require__(/*! ./_Symbol */ "../../node_modules/lodash/_Symbol.js"),
  6510. arrayMap = __webpack_require__(/*! ./_arrayMap */ "../../node_modules/lodash/_arrayMap.js"),
  6511. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  6512. isSymbol = __webpack_require__(/*! ./isSymbol */ "../../node_modules/lodash/isSymbol.js");
  6513. /** Used as references for various `Number` constants. */
  6514. var INFINITY = 1 / 0;
  6515. /** Used to convert symbols to primitives and strings. */
  6516. var symbolProto = Symbol ? Symbol.prototype : undefined,
  6517. symbolToString = symbolProto ? symbolProto.toString : undefined;
  6518. /**
  6519. * The base implementation of `_.toString` which doesn't convert nullish
  6520. * values to empty strings.
  6521. *
  6522. * @private
  6523. * @param {*} value The value to process.
  6524. * @returns {string} Returns the string.
  6525. */
  6526. function baseToString(value) {
  6527. // Exit early for strings to avoid a performance hit in some environments.
  6528. if (typeof value == 'string') {
  6529. return value;
  6530. }
  6531. if (isArray(value)) {
  6532. // Recursively convert values (susceptible to call stack limits).
  6533. return arrayMap(value, baseToString) + '';
  6534. }
  6535. if (isSymbol(value)) {
  6536. return symbolToString ? symbolToString.call(value) : '';
  6537. }
  6538. var result = (value + '');
  6539. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  6540. }
  6541. module.exports = baseToString;
  6542. /***/ }),
  6543. /***/ "../../node_modules/lodash/_baseUnary.js":
  6544. /*!*************************************************************!*\
  6545. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseUnary.js ***!
  6546. \*************************************************************/
  6547. /*! no static exports found */
  6548. /***/ (function(module, exports) {
  6549. /**
  6550. * The base implementation of `_.unary` without support for storing metadata.
  6551. *
  6552. * @private
  6553. * @param {Function} func The function to cap arguments for.
  6554. * @returns {Function} Returns the new capped function.
  6555. */
  6556. function baseUnary(func) {
  6557. return function(value) {
  6558. return func(value);
  6559. };
  6560. }
  6561. module.exports = baseUnary;
  6562. /***/ }),
  6563. /***/ "../../node_modules/lodash/_baseUniq.js":
  6564. /*!************************************************************!*\
  6565. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseUniq.js ***!
  6566. \************************************************************/
  6567. /*! no static exports found */
  6568. /***/ (function(module, exports, __webpack_require__) {
  6569. var SetCache = __webpack_require__(/*! ./_SetCache */ "../../node_modules/lodash/_SetCache.js"),
  6570. arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ "../../node_modules/lodash/_arrayIncludes.js"),
  6571. arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ "../../node_modules/lodash/_arrayIncludesWith.js"),
  6572. cacheHas = __webpack_require__(/*! ./_cacheHas */ "../../node_modules/lodash/_cacheHas.js"),
  6573. createSet = __webpack_require__(/*! ./_createSet */ "../../node_modules/lodash/_createSet.js"),
  6574. setToArray = __webpack_require__(/*! ./_setToArray */ "../../node_modules/lodash/_setToArray.js");
  6575. /** Used as the size to enable large array optimizations. */
  6576. var LARGE_ARRAY_SIZE = 200;
  6577. /**
  6578. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  6579. *
  6580. * @private
  6581. * @param {Array} array The array to inspect.
  6582. * @param {Function} [iteratee] The iteratee invoked per element.
  6583. * @param {Function} [comparator] The comparator invoked per element.
  6584. * @returns {Array} Returns the new duplicate free array.
  6585. */
  6586. function baseUniq(array, iteratee, comparator) {
  6587. var index = -1,
  6588. includes = arrayIncludes,
  6589. length = array.length,
  6590. isCommon = true,
  6591. result = [],
  6592. seen = result;
  6593. if (comparator) {
  6594. isCommon = false;
  6595. includes = arrayIncludesWith;
  6596. }
  6597. else if (length >= LARGE_ARRAY_SIZE) {
  6598. var set = iteratee ? null : createSet(array);
  6599. if (set) {
  6600. return setToArray(set);
  6601. }
  6602. isCommon = false;
  6603. includes = cacheHas;
  6604. seen = new SetCache;
  6605. }
  6606. else {
  6607. seen = iteratee ? [] : result;
  6608. }
  6609. outer:
  6610. while (++index < length) {
  6611. var value = array[index],
  6612. computed = iteratee ? iteratee(value) : value;
  6613. value = (comparator || value !== 0) ? value : 0;
  6614. if (isCommon && computed === computed) {
  6615. var seenIndex = seen.length;
  6616. while (seenIndex--) {
  6617. if (seen[seenIndex] === computed) {
  6618. continue outer;
  6619. }
  6620. }
  6621. if (iteratee) {
  6622. seen.push(computed);
  6623. }
  6624. result.push(value);
  6625. }
  6626. else if (!includes(seen, computed, comparator)) {
  6627. if (seen !== result) {
  6628. seen.push(computed);
  6629. }
  6630. result.push(value);
  6631. }
  6632. }
  6633. return result;
  6634. }
  6635. module.exports = baseUniq;
  6636. /***/ }),
  6637. /***/ "../../node_modules/lodash/_baseValues.js":
  6638. /*!**************************************************************!*\
  6639. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseValues.js ***!
  6640. \**************************************************************/
  6641. /*! no static exports found */
  6642. /***/ (function(module, exports, __webpack_require__) {
  6643. var arrayMap = __webpack_require__(/*! ./_arrayMap */ "../../node_modules/lodash/_arrayMap.js");
  6644. /**
  6645. * The base implementation of `_.values` and `_.valuesIn` which creates an
  6646. * array of `object` property values corresponding to the property names
  6647. * of `props`.
  6648. *
  6649. * @private
  6650. * @param {Object} object The object to query.
  6651. * @param {Array} props The property names to get values for.
  6652. * @returns {Object} Returns the array of property values.
  6653. */
  6654. function baseValues(object, props) {
  6655. return arrayMap(props, function(key) {
  6656. return object[key];
  6657. });
  6658. }
  6659. module.exports = baseValues;
  6660. /***/ }),
  6661. /***/ "../../node_modules/lodash/_baseZipObject.js":
  6662. /*!*****************************************************************!*\
  6663. !*** C:/Repos/Babylon.js/node_modules/lodash/_baseZipObject.js ***!
  6664. \*****************************************************************/
  6665. /*! no static exports found */
  6666. /***/ (function(module, exports) {
  6667. /**
  6668. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  6669. *
  6670. * @private
  6671. * @param {Array} props The property identifiers.
  6672. * @param {Array} values The property values.
  6673. * @param {Function} assignFunc The function to assign values.
  6674. * @returns {Object} Returns the new object.
  6675. */
  6676. function baseZipObject(props, values, assignFunc) {
  6677. var index = -1,
  6678. length = props.length,
  6679. valsLength = values.length,
  6680. result = {};
  6681. while (++index < length) {
  6682. var value = index < valsLength ? values[index] : undefined;
  6683. assignFunc(result, props[index], value);
  6684. }
  6685. return result;
  6686. }
  6687. module.exports = baseZipObject;
  6688. /***/ }),
  6689. /***/ "../../node_modules/lodash/_cacheHas.js":
  6690. /*!************************************************************!*\
  6691. !*** C:/Repos/Babylon.js/node_modules/lodash/_cacheHas.js ***!
  6692. \************************************************************/
  6693. /*! no static exports found */
  6694. /***/ (function(module, exports) {
  6695. /**
  6696. * Checks if a `cache` value for `key` exists.
  6697. *
  6698. * @private
  6699. * @param {Object} cache The cache to query.
  6700. * @param {string} key The key of the entry to check.
  6701. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  6702. */
  6703. function cacheHas(cache, key) {
  6704. return cache.has(key);
  6705. }
  6706. module.exports = cacheHas;
  6707. /***/ }),
  6708. /***/ "../../node_modules/lodash/_castFunction.js":
  6709. /*!****************************************************************!*\
  6710. !*** C:/Repos/Babylon.js/node_modules/lodash/_castFunction.js ***!
  6711. \****************************************************************/
  6712. /*! no static exports found */
  6713. /***/ (function(module, exports, __webpack_require__) {
  6714. var identity = __webpack_require__(/*! ./identity */ "../../node_modules/lodash/identity.js");
  6715. /**
  6716. * Casts `value` to `identity` if it's not a function.
  6717. *
  6718. * @private
  6719. * @param {*} value The value to inspect.
  6720. * @returns {Function} Returns cast function.
  6721. */
  6722. function castFunction(value) {
  6723. return typeof value == 'function' ? value : identity;
  6724. }
  6725. module.exports = castFunction;
  6726. /***/ }),
  6727. /***/ "../../node_modules/lodash/_castPath.js":
  6728. /*!************************************************************!*\
  6729. !*** C:/Repos/Babylon.js/node_modules/lodash/_castPath.js ***!
  6730. \************************************************************/
  6731. /*! no static exports found */
  6732. /***/ (function(module, exports, __webpack_require__) {
  6733. var isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  6734. isKey = __webpack_require__(/*! ./_isKey */ "../../node_modules/lodash/_isKey.js"),
  6735. stringToPath = __webpack_require__(/*! ./_stringToPath */ "../../node_modules/lodash/_stringToPath.js"),
  6736. toString = __webpack_require__(/*! ./toString */ "../../node_modules/lodash/toString.js");
  6737. /**
  6738. * Casts `value` to a path array if it's not one.
  6739. *
  6740. * @private
  6741. * @param {*} value The value to inspect.
  6742. * @param {Object} [object] The object to query keys on.
  6743. * @returns {Array} Returns the cast property path array.
  6744. */
  6745. function castPath(value, object) {
  6746. if (isArray(value)) {
  6747. return value;
  6748. }
  6749. return isKey(value, object) ? [value] : stringToPath(toString(value));
  6750. }
  6751. module.exports = castPath;
  6752. /***/ }),
  6753. /***/ "../../node_modules/lodash/_cloneArrayBuffer.js":
  6754. /*!********************************************************************!*\
  6755. !*** C:/Repos/Babylon.js/node_modules/lodash/_cloneArrayBuffer.js ***!
  6756. \********************************************************************/
  6757. /*! no static exports found */
  6758. /***/ (function(module, exports, __webpack_require__) {
  6759. var Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "../../node_modules/lodash/_Uint8Array.js");
  6760. /**
  6761. * Creates a clone of `arrayBuffer`.
  6762. *
  6763. * @private
  6764. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  6765. * @returns {ArrayBuffer} Returns the cloned array buffer.
  6766. */
  6767. function cloneArrayBuffer(arrayBuffer) {
  6768. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  6769. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  6770. return result;
  6771. }
  6772. module.exports = cloneArrayBuffer;
  6773. /***/ }),
  6774. /***/ "../../node_modules/lodash/_cloneBuffer.js":
  6775. /*!***************************************************************!*\
  6776. !*** C:/Repos/Babylon.js/node_modules/lodash/_cloneBuffer.js ***!
  6777. \***************************************************************/
  6778. /*! no static exports found */
  6779. /***/ (function(module, exports, __webpack_require__) {
  6780. /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js");
  6781. /** Detect free variable `exports`. */
  6782. var freeExports = true && exports && !exports.nodeType && exports;
  6783. /** Detect free variable `module`. */
  6784. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  6785. /** Detect the popular CommonJS extension `module.exports`. */
  6786. var moduleExports = freeModule && freeModule.exports === freeExports;
  6787. /** Built-in value references. */
  6788. var Buffer = moduleExports ? root.Buffer : undefined,
  6789. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
  6790. /**
  6791. * Creates a clone of `buffer`.
  6792. *
  6793. * @private
  6794. * @param {Buffer} buffer The buffer to clone.
  6795. * @param {boolean} [isDeep] Specify a deep clone.
  6796. * @returns {Buffer} Returns the cloned buffer.
  6797. */
  6798. function cloneBuffer(buffer, isDeep) {
  6799. if (isDeep) {
  6800. return buffer.slice();
  6801. }
  6802. var length = buffer.length,
  6803. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  6804. buffer.copy(result);
  6805. return result;
  6806. }
  6807. module.exports = cloneBuffer;
  6808. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "../../node_modules/webpack/buildin/module.js")(module)))
  6809. /***/ }),
  6810. /***/ "../../node_modules/lodash/_cloneDataView.js":
  6811. /*!*****************************************************************!*\
  6812. !*** C:/Repos/Babylon.js/node_modules/lodash/_cloneDataView.js ***!
  6813. \*****************************************************************/
  6814. /*! no static exports found */
  6815. /***/ (function(module, exports, __webpack_require__) {
  6816. var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "../../node_modules/lodash/_cloneArrayBuffer.js");
  6817. /**
  6818. * Creates a clone of `dataView`.
  6819. *
  6820. * @private
  6821. * @param {Object} dataView The data view to clone.
  6822. * @param {boolean} [isDeep] Specify a deep clone.
  6823. * @returns {Object} Returns the cloned data view.
  6824. */
  6825. function cloneDataView(dataView, isDeep) {
  6826. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  6827. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  6828. }
  6829. module.exports = cloneDataView;
  6830. /***/ }),
  6831. /***/ "../../node_modules/lodash/_cloneRegExp.js":
  6832. /*!***************************************************************!*\
  6833. !*** C:/Repos/Babylon.js/node_modules/lodash/_cloneRegExp.js ***!
  6834. \***************************************************************/
  6835. /*! no static exports found */
  6836. /***/ (function(module, exports) {
  6837. /** Used to match `RegExp` flags from their coerced string values. */
  6838. var reFlags = /\w*$/;
  6839. /**
  6840. * Creates a clone of `regexp`.
  6841. *
  6842. * @private
  6843. * @param {Object} regexp The regexp to clone.
  6844. * @returns {Object} Returns the cloned regexp.
  6845. */
  6846. function cloneRegExp(regexp) {
  6847. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  6848. result.lastIndex = regexp.lastIndex;
  6849. return result;
  6850. }
  6851. module.exports = cloneRegExp;
  6852. /***/ }),
  6853. /***/ "../../node_modules/lodash/_cloneSymbol.js":
  6854. /*!***************************************************************!*\
  6855. !*** C:/Repos/Babylon.js/node_modules/lodash/_cloneSymbol.js ***!
  6856. \***************************************************************/
  6857. /*! no static exports found */
  6858. /***/ (function(module, exports, __webpack_require__) {
  6859. var Symbol = __webpack_require__(/*! ./_Symbol */ "../../node_modules/lodash/_Symbol.js");
  6860. /** Used to convert symbols to primitives and strings. */
  6861. var symbolProto = Symbol ? Symbol.prototype : undefined,
  6862. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  6863. /**
  6864. * Creates a clone of the `symbol` object.
  6865. *
  6866. * @private
  6867. * @param {Object} symbol The symbol object to clone.
  6868. * @returns {Object} Returns the cloned symbol object.
  6869. */
  6870. function cloneSymbol(symbol) {
  6871. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  6872. }
  6873. module.exports = cloneSymbol;
  6874. /***/ }),
  6875. /***/ "../../node_modules/lodash/_cloneTypedArray.js":
  6876. /*!*******************************************************************!*\
  6877. !*** C:/Repos/Babylon.js/node_modules/lodash/_cloneTypedArray.js ***!
  6878. \*******************************************************************/
  6879. /*! no static exports found */
  6880. /***/ (function(module, exports, __webpack_require__) {
  6881. var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "../../node_modules/lodash/_cloneArrayBuffer.js");
  6882. /**
  6883. * Creates a clone of `typedArray`.
  6884. *
  6885. * @private
  6886. * @param {Object} typedArray The typed array to clone.
  6887. * @param {boolean} [isDeep] Specify a deep clone.
  6888. * @returns {Object} Returns the cloned typed array.
  6889. */
  6890. function cloneTypedArray(typedArray, isDeep) {
  6891. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  6892. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  6893. }
  6894. module.exports = cloneTypedArray;
  6895. /***/ }),
  6896. /***/ "../../node_modules/lodash/_compareAscending.js":
  6897. /*!********************************************************************!*\
  6898. !*** C:/Repos/Babylon.js/node_modules/lodash/_compareAscending.js ***!
  6899. \********************************************************************/
  6900. /*! no static exports found */
  6901. /***/ (function(module, exports, __webpack_require__) {
  6902. var isSymbol = __webpack_require__(/*! ./isSymbol */ "../../node_modules/lodash/isSymbol.js");
  6903. /**
  6904. * Compares values to sort them in ascending order.
  6905. *
  6906. * @private
  6907. * @param {*} value The value to compare.
  6908. * @param {*} other The other value to compare.
  6909. * @returns {number} Returns the sort order indicator for `value`.
  6910. */
  6911. function compareAscending(value, other) {
  6912. if (value !== other) {
  6913. var valIsDefined = value !== undefined,
  6914. valIsNull = value === null,
  6915. valIsReflexive = value === value,
  6916. valIsSymbol = isSymbol(value);
  6917. var othIsDefined = other !== undefined,
  6918. othIsNull = other === null,
  6919. othIsReflexive = other === other,
  6920. othIsSymbol = isSymbol(other);
  6921. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  6922. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  6923. (valIsNull && othIsDefined && othIsReflexive) ||
  6924. (!valIsDefined && othIsReflexive) ||
  6925. !valIsReflexive) {
  6926. return 1;
  6927. }
  6928. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  6929. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  6930. (othIsNull && valIsDefined && valIsReflexive) ||
  6931. (!othIsDefined && valIsReflexive) ||
  6932. !othIsReflexive) {
  6933. return -1;
  6934. }
  6935. }
  6936. return 0;
  6937. }
  6938. module.exports = compareAscending;
  6939. /***/ }),
  6940. /***/ "../../node_modules/lodash/_compareMultiple.js":
  6941. /*!*******************************************************************!*\
  6942. !*** C:/Repos/Babylon.js/node_modules/lodash/_compareMultiple.js ***!
  6943. \*******************************************************************/
  6944. /*! no static exports found */
  6945. /***/ (function(module, exports, __webpack_require__) {
  6946. var compareAscending = __webpack_require__(/*! ./_compareAscending */ "../../node_modules/lodash/_compareAscending.js");
  6947. /**
  6948. * Used by `_.orderBy` to compare multiple properties of a value to another
  6949. * and stable sort them.
  6950. *
  6951. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  6952. * specify an order of "desc" for descending or "asc" for ascending sort order
  6953. * of corresponding values.
  6954. *
  6955. * @private
  6956. * @param {Object} object The object to compare.
  6957. * @param {Object} other The other object to compare.
  6958. * @param {boolean[]|string[]} orders The order to sort by for each property.
  6959. * @returns {number} Returns the sort order indicator for `object`.
  6960. */
  6961. function compareMultiple(object, other, orders) {
  6962. var index = -1,
  6963. objCriteria = object.criteria,
  6964. othCriteria = other.criteria,
  6965. length = objCriteria.length,
  6966. ordersLength = orders.length;
  6967. while (++index < length) {
  6968. var result = compareAscending(objCriteria[index], othCriteria[index]);
  6969. if (result) {
  6970. if (index >= ordersLength) {
  6971. return result;
  6972. }
  6973. var order = orders[index];
  6974. return result * (order == 'desc' ? -1 : 1);
  6975. }
  6976. }
  6977. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  6978. // that causes it, under certain circumstances, to provide the same value for
  6979. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  6980. // for more details.
  6981. //
  6982. // This also ensures a stable sort in V8 and other engines.
  6983. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  6984. return object.index - other.index;
  6985. }
  6986. module.exports = compareMultiple;
  6987. /***/ }),
  6988. /***/ "../../node_modules/lodash/_copyArray.js":
  6989. /*!*************************************************************!*\
  6990. !*** C:/Repos/Babylon.js/node_modules/lodash/_copyArray.js ***!
  6991. \*************************************************************/
  6992. /*! no static exports found */
  6993. /***/ (function(module, exports) {
  6994. /**
  6995. * Copies the values of `source` to `array`.
  6996. *
  6997. * @private
  6998. * @param {Array} source The array to copy values from.
  6999. * @param {Array} [array=[]] The array to copy values to.
  7000. * @returns {Array} Returns `array`.
  7001. */
  7002. function copyArray(source, array) {
  7003. var index = -1,
  7004. length = source.length;
  7005. array || (array = Array(length));
  7006. while (++index < length) {
  7007. array[index] = source[index];
  7008. }
  7009. return array;
  7010. }
  7011. module.exports = copyArray;
  7012. /***/ }),
  7013. /***/ "../../node_modules/lodash/_copyObject.js":
  7014. /*!**************************************************************!*\
  7015. !*** C:/Repos/Babylon.js/node_modules/lodash/_copyObject.js ***!
  7016. \**************************************************************/
  7017. /*! no static exports found */
  7018. /***/ (function(module, exports, __webpack_require__) {
  7019. var assignValue = __webpack_require__(/*! ./_assignValue */ "../../node_modules/lodash/_assignValue.js"),
  7020. baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../../node_modules/lodash/_baseAssignValue.js");
  7021. /**
  7022. * Copies properties of `source` to `object`.
  7023. *
  7024. * @private
  7025. * @param {Object} source The object to copy properties from.
  7026. * @param {Array} props The property identifiers to copy.
  7027. * @param {Object} [object={}] The object to copy properties to.
  7028. * @param {Function} [customizer] The function to customize copied values.
  7029. * @returns {Object} Returns `object`.
  7030. */
  7031. function copyObject(source, props, object, customizer) {
  7032. var isNew = !object;
  7033. object || (object = {});
  7034. var index = -1,
  7035. length = props.length;
  7036. while (++index < length) {
  7037. var key = props[index];
  7038. var newValue = customizer
  7039. ? customizer(object[key], source[key], key, object, source)
  7040. : undefined;
  7041. if (newValue === undefined) {
  7042. newValue = source[key];
  7043. }
  7044. if (isNew) {
  7045. baseAssignValue(object, key, newValue);
  7046. } else {
  7047. assignValue(object, key, newValue);
  7048. }
  7049. }
  7050. return object;
  7051. }
  7052. module.exports = copyObject;
  7053. /***/ }),
  7054. /***/ "../../node_modules/lodash/_copySymbols.js":
  7055. /*!***************************************************************!*\
  7056. !*** C:/Repos/Babylon.js/node_modules/lodash/_copySymbols.js ***!
  7057. \***************************************************************/
  7058. /*! no static exports found */
  7059. /***/ (function(module, exports, __webpack_require__) {
  7060. var copyObject = __webpack_require__(/*! ./_copyObject */ "../../node_modules/lodash/_copyObject.js"),
  7061. getSymbols = __webpack_require__(/*! ./_getSymbols */ "../../node_modules/lodash/_getSymbols.js");
  7062. /**
  7063. * Copies own symbols of `source` to `object`.
  7064. *
  7065. * @private
  7066. * @param {Object} source The object to copy symbols from.
  7067. * @param {Object} [object={}] The object to copy symbols to.
  7068. * @returns {Object} Returns `object`.
  7069. */
  7070. function copySymbols(source, object) {
  7071. return copyObject(source, getSymbols(source), object);
  7072. }
  7073. module.exports = copySymbols;
  7074. /***/ }),
  7075. /***/ "../../node_modules/lodash/_copySymbolsIn.js":
  7076. /*!*****************************************************************!*\
  7077. !*** C:/Repos/Babylon.js/node_modules/lodash/_copySymbolsIn.js ***!
  7078. \*****************************************************************/
  7079. /*! no static exports found */
  7080. /***/ (function(module, exports, __webpack_require__) {
  7081. var copyObject = __webpack_require__(/*! ./_copyObject */ "../../node_modules/lodash/_copyObject.js"),
  7082. getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "../../node_modules/lodash/_getSymbolsIn.js");
  7083. /**
  7084. * Copies own and inherited symbols of `source` to `object`.
  7085. *
  7086. * @private
  7087. * @param {Object} source The object to copy symbols from.
  7088. * @param {Object} [object={}] The object to copy symbols to.
  7089. * @returns {Object} Returns `object`.
  7090. */
  7091. function copySymbolsIn(source, object) {
  7092. return copyObject(source, getSymbolsIn(source), object);
  7093. }
  7094. module.exports = copySymbolsIn;
  7095. /***/ }),
  7096. /***/ "../../node_modules/lodash/_coreJsData.js":
  7097. /*!**************************************************************!*\
  7098. !*** C:/Repos/Babylon.js/node_modules/lodash/_coreJsData.js ***!
  7099. \**************************************************************/
  7100. /*! no static exports found */
  7101. /***/ (function(module, exports, __webpack_require__) {
  7102. var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js");
  7103. /** Used to detect overreaching core-js shims. */
  7104. var coreJsData = root['__core-js_shared__'];
  7105. module.exports = coreJsData;
  7106. /***/ }),
  7107. /***/ "../../node_modules/lodash/_createAssigner.js":
  7108. /*!******************************************************************!*\
  7109. !*** C:/Repos/Babylon.js/node_modules/lodash/_createAssigner.js ***!
  7110. \******************************************************************/
  7111. /*! no static exports found */
  7112. /***/ (function(module, exports, __webpack_require__) {
  7113. var baseRest = __webpack_require__(/*! ./_baseRest */ "../../node_modules/lodash/_baseRest.js"),
  7114. isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "../../node_modules/lodash/_isIterateeCall.js");
  7115. /**
  7116. * Creates a function like `_.assign`.
  7117. *
  7118. * @private
  7119. * @param {Function} assigner The function to assign values.
  7120. * @returns {Function} Returns the new assigner function.
  7121. */
  7122. function createAssigner(assigner) {
  7123. return baseRest(function(object, sources) {
  7124. var index = -1,
  7125. length = sources.length,
  7126. customizer = length > 1 ? sources[length - 1] : undefined,
  7127. guard = length > 2 ? sources[2] : undefined;
  7128. customizer = (assigner.length > 3 && typeof customizer == 'function')
  7129. ? (length--, customizer)
  7130. : undefined;
  7131. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  7132. customizer = length < 3 ? undefined : customizer;
  7133. length = 1;
  7134. }
  7135. object = Object(object);
  7136. while (++index < length) {
  7137. var source = sources[index];
  7138. if (source) {
  7139. assigner(object, source, index, customizer);
  7140. }
  7141. }
  7142. return object;
  7143. });
  7144. }
  7145. module.exports = createAssigner;
  7146. /***/ }),
  7147. /***/ "../../node_modules/lodash/_createBaseEach.js":
  7148. /*!******************************************************************!*\
  7149. !*** C:/Repos/Babylon.js/node_modules/lodash/_createBaseEach.js ***!
  7150. \******************************************************************/
  7151. /*! no static exports found */
  7152. /***/ (function(module, exports, __webpack_require__) {
  7153. var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js");
  7154. /**
  7155. * Creates a `baseEach` or `baseEachRight` function.
  7156. *
  7157. * @private
  7158. * @param {Function} eachFunc The function to iterate over a collection.
  7159. * @param {boolean} [fromRight] Specify iterating from right to left.
  7160. * @returns {Function} Returns the new base function.
  7161. */
  7162. function createBaseEach(eachFunc, fromRight) {
  7163. return function(collection, iteratee) {
  7164. if (collection == null) {
  7165. return collection;
  7166. }
  7167. if (!isArrayLike(collection)) {
  7168. return eachFunc(collection, iteratee);
  7169. }
  7170. var length = collection.length,
  7171. index = fromRight ? length : -1,
  7172. iterable = Object(collection);
  7173. while ((fromRight ? index-- : ++index < length)) {
  7174. if (iteratee(iterable[index], index, iterable) === false) {
  7175. break;
  7176. }
  7177. }
  7178. return collection;
  7179. };
  7180. }
  7181. module.exports = createBaseEach;
  7182. /***/ }),
  7183. /***/ "../../node_modules/lodash/_createBaseFor.js":
  7184. /*!*****************************************************************!*\
  7185. !*** C:/Repos/Babylon.js/node_modules/lodash/_createBaseFor.js ***!
  7186. \*****************************************************************/
  7187. /*! no static exports found */
  7188. /***/ (function(module, exports) {
  7189. /**
  7190. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  7191. *
  7192. * @private
  7193. * @param {boolean} [fromRight] Specify iterating from right to left.
  7194. * @returns {Function} Returns the new base function.
  7195. */
  7196. function createBaseFor(fromRight) {
  7197. return function(object, iteratee, keysFunc) {
  7198. var index = -1,
  7199. iterable = Object(object),
  7200. props = keysFunc(object),
  7201. length = props.length;
  7202. while (length--) {
  7203. var key = props[fromRight ? length : ++index];
  7204. if (iteratee(iterable[key], key, iterable) === false) {
  7205. break;
  7206. }
  7207. }
  7208. return object;
  7209. };
  7210. }
  7211. module.exports = createBaseFor;
  7212. /***/ }),
  7213. /***/ "../../node_modules/lodash/_createFind.js":
  7214. /*!**************************************************************!*\
  7215. !*** C:/Repos/Babylon.js/node_modules/lodash/_createFind.js ***!
  7216. \**************************************************************/
  7217. /*! no static exports found */
  7218. /***/ (function(module, exports, __webpack_require__) {
  7219. var baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "../../node_modules/lodash/_baseIteratee.js"),
  7220. isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js"),
  7221. keys = __webpack_require__(/*! ./keys */ "../../node_modules/lodash/keys.js");
  7222. /**
  7223. * Creates a `_.find` or `_.findLast` function.
  7224. *
  7225. * @private
  7226. * @param {Function} findIndexFunc The function to find the collection index.
  7227. * @returns {Function} Returns the new find function.
  7228. */
  7229. function createFind(findIndexFunc) {
  7230. return function(collection, predicate, fromIndex) {
  7231. var iterable = Object(collection);
  7232. if (!isArrayLike(collection)) {
  7233. var iteratee = baseIteratee(predicate, 3);
  7234. collection = keys(collection);
  7235. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  7236. }
  7237. var index = findIndexFunc(collection, predicate, fromIndex);
  7238. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  7239. };
  7240. }
  7241. module.exports = createFind;
  7242. /***/ }),
  7243. /***/ "../../node_modules/lodash/_createRange.js":
  7244. /*!***************************************************************!*\
  7245. !*** C:/Repos/Babylon.js/node_modules/lodash/_createRange.js ***!
  7246. \***************************************************************/
  7247. /*! no static exports found */
  7248. /***/ (function(module, exports, __webpack_require__) {
  7249. var baseRange = __webpack_require__(/*! ./_baseRange */ "../../node_modules/lodash/_baseRange.js"),
  7250. isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "../../node_modules/lodash/_isIterateeCall.js"),
  7251. toFinite = __webpack_require__(/*! ./toFinite */ "../../node_modules/lodash/toFinite.js");
  7252. /**
  7253. * Creates a `_.range` or `_.rangeRight` function.
  7254. *
  7255. * @private
  7256. * @param {boolean} [fromRight] Specify iterating from right to left.
  7257. * @returns {Function} Returns the new range function.
  7258. */
  7259. function createRange(fromRight) {
  7260. return function(start, end, step) {
  7261. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  7262. end = step = undefined;
  7263. }
  7264. // Ensure the sign of `-0` is preserved.
  7265. start = toFinite(start);
  7266. if (end === undefined) {
  7267. end = start;
  7268. start = 0;
  7269. } else {
  7270. end = toFinite(end);
  7271. }
  7272. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  7273. return baseRange(start, end, step, fromRight);
  7274. };
  7275. }
  7276. module.exports = createRange;
  7277. /***/ }),
  7278. /***/ "../../node_modules/lodash/_createSet.js":
  7279. /*!*************************************************************!*\
  7280. !*** C:/Repos/Babylon.js/node_modules/lodash/_createSet.js ***!
  7281. \*************************************************************/
  7282. /*! no static exports found */
  7283. /***/ (function(module, exports, __webpack_require__) {
  7284. var Set = __webpack_require__(/*! ./_Set */ "../../node_modules/lodash/_Set.js"),
  7285. noop = __webpack_require__(/*! ./noop */ "../../node_modules/lodash/noop.js"),
  7286. setToArray = __webpack_require__(/*! ./_setToArray */ "../../node_modules/lodash/_setToArray.js");
  7287. /** Used as references for various `Number` constants. */
  7288. var INFINITY = 1 / 0;
  7289. /**
  7290. * Creates a set object of `values`.
  7291. *
  7292. * @private
  7293. * @param {Array} values The values to add to the set.
  7294. * @returns {Object} Returns the new set.
  7295. */
  7296. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  7297. return new Set(values);
  7298. };
  7299. module.exports = createSet;
  7300. /***/ }),
  7301. /***/ "../../node_modules/lodash/_defineProperty.js":
  7302. /*!******************************************************************!*\
  7303. !*** C:/Repos/Babylon.js/node_modules/lodash/_defineProperty.js ***!
  7304. \******************************************************************/
  7305. /*! no static exports found */
  7306. /***/ (function(module, exports, __webpack_require__) {
  7307. var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js");
  7308. var defineProperty = (function() {
  7309. try {
  7310. var func = getNative(Object, 'defineProperty');
  7311. func({}, '', {});
  7312. return func;
  7313. } catch (e) {}
  7314. }());
  7315. module.exports = defineProperty;
  7316. /***/ }),
  7317. /***/ "../../node_modules/lodash/_equalArrays.js":
  7318. /*!***************************************************************!*\
  7319. !*** C:/Repos/Babylon.js/node_modules/lodash/_equalArrays.js ***!
  7320. \***************************************************************/
  7321. /*! no static exports found */
  7322. /***/ (function(module, exports, __webpack_require__) {
  7323. var SetCache = __webpack_require__(/*! ./_SetCache */ "../../node_modules/lodash/_SetCache.js"),
  7324. arraySome = __webpack_require__(/*! ./_arraySome */ "../../node_modules/lodash/_arraySome.js"),
  7325. cacheHas = __webpack_require__(/*! ./_cacheHas */ "../../node_modules/lodash/_cacheHas.js");
  7326. /** Used to compose bitmasks for value comparisons. */
  7327. var COMPARE_PARTIAL_FLAG = 1,
  7328. COMPARE_UNORDERED_FLAG = 2;
  7329. /**
  7330. * A specialized version of `baseIsEqualDeep` for arrays with support for
  7331. * partial deep comparisons.
  7332. *
  7333. * @private
  7334. * @param {Array} array The array to compare.
  7335. * @param {Array} other The other array to compare.
  7336. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  7337. * @param {Function} customizer The function to customize comparisons.
  7338. * @param {Function} equalFunc The function to determine equivalents of values.
  7339. * @param {Object} stack Tracks traversed `array` and `other` objects.
  7340. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  7341. */
  7342. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  7343. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  7344. arrLength = array.length,
  7345. othLength = other.length;
  7346. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  7347. return false;
  7348. }
  7349. // Check that cyclic values are equal.
  7350. var arrStacked = stack.get(array);
  7351. var othStacked = stack.get(other);
  7352. if (arrStacked && othStacked) {
  7353. return arrStacked == other && othStacked == array;
  7354. }
  7355. var index = -1,
  7356. result = true,
  7357. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  7358. stack.set(array, other);
  7359. stack.set(other, array);
  7360. // Ignore non-index properties.
  7361. while (++index < arrLength) {
  7362. var arrValue = array[index],
  7363. othValue = other[index];
  7364. if (customizer) {
  7365. var compared = isPartial
  7366. ? customizer(othValue, arrValue, index, other, array, stack)
  7367. : customizer(arrValue, othValue, index, array, other, stack);
  7368. }
  7369. if (compared !== undefined) {
  7370. if (compared) {
  7371. continue;
  7372. }
  7373. result = false;
  7374. break;
  7375. }
  7376. // Recursively compare arrays (susceptible to call stack limits).
  7377. if (seen) {
  7378. if (!arraySome(other, function(othValue, othIndex) {
  7379. if (!cacheHas(seen, othIndex) &&
  7380. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  7381. return seen.push(othIndex);
  7382. }
  7383. })) {
  7384. result = false;
  7385. break;
  7386. }
  7387. } else if (!(
  7388. arrValue === othValue ||
  7389. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  7390. )) {
  7391. result = false;
  7392. break;
  7393. }
  7394. }
  7395. stack['delete'](array);
  7396. stack['delete'](other);
  7397. return result;
  7398. }
  7399. module.exports = equalArrays;
  7400. /***/ }),
  7401. /***/ "../../node_modules/lodash/_equalByTag.js":
  7402. /*!**************************************************************!*\
  7403. !*** C:/Repos/Babylon.js/node_modules/lodash/_equalByTag.js ***!
  7404. \**************************************************************/
  7405. /*! no static exports found */
  7406. /***/ (function(module, exports, __webpack_require__) {
  7407. var Symbol = __webpack_require__(/*! ./_Symbol */ "../../node_modules/lodash/_Symbol.js"),
  7408. Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "../../node_modules/lodash/_Uint8Array.js"),
  7409. eq = __webpack_require__(/*! ./eq */ "../../node_modules/lodash/eq.js"),
  7410. equalArrays = __webpack_require__(/*! ./_equalArrays */ "../../node_modules/lodash/_equalArrays.js"),
  7411. mapToArray = __webpack_require__(/*! ./_mapToArray */ "../../node_modules/lodash/_mapToArray.js"),
  7412. setToArray = __webpack_require__(/*! ./_setToArray */ "../../node_modules/lodash/_setToArray.js");
  7413. /** Used to compose bitmasks for value comparisons. */
  7414. var COMPARE_PARTIAL_FLAG = 1,
  7415. COMPARE_UNORDERED_FLAG = 2;
  7416. /** `Object#toString` result references. */
  7417. var boolTag = '[object Boolean]',
  7418. dateTag = '[object Date]',
  7419. errorTag = '[object Error]',
  7420. mapTag = '[object Map]',
  7421. numberTag = '[object Number]',
  7422. regexpTag = '[object RegExp]',
  7423. setTag = '[object Set]',
  7424. stringTag = '[object String]',
  7425. symbolTag = '[object Symbol]';
  7426. var arrayBufferTag = '[object ArrayBuffer]',
  7427. dataViewTag = '[object DataView]';
  7428. /** Used to convert symbols to primitives and strings. */
  7429. var symbolProto = Symbol ? Symbol.prototype : undefined,
  7430. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  7431. /**
  7432. * A specialized version of `baseIsEqualDeep` for comparing objects of
  7433. * the same `toStringTag`.
  7434. *
  7435. * **Note:** This function only supports comparing values with tags of
  7436. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  7437. *
  7438. * @private
  7439. * @param {Object} object The object to compare.
  7440. * @param {Object} other The other object to compare.
  7441. * @param {string} tag The `toStringTag` of the objects to compare.
  7442. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  7443. * @param {Function} customizer The function to customize comparisons.
  7444. * @param {Function} equalFunc The function to determine equivalents of values.
  7445. * @param {Object} stack Tracks traversed `object` and `other` objects.
  7446. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  7447. */
  7448. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  7449. switch (tag) {
  7450. case dataViewTag:
  7451. if ((object.byteLength != other.byteLength) ||
  7452. (object.byteOffset != other.byteOffset)) {
  7453. return false;
  7454. }
  7455. object = object.buffer;
  7456. other = other.buffer;
  7457. case arrayBufferTag:
  7458. if ((object.byteLength != other.byteLength) ||
  7459. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  7460. return false;
  7461. }
  7462. return true;
  7463. case boolTag:
  7464. case dateTag:
  7465. case numberTag:
  7466. // Coerce booleans to `1` or `0` and dates to milliseconds.
  7467. // Invalid dates are coerced to `NaN`.
  7468. return eq(+object, +other);
  7469. case errorTag:
  7470. return object.name == other.name && object.message == other.message;
  7471. case regexpTag:
  7472. case stringTag:
  7473. // Coerce regexes to strings and treat strings, primitives and objects,
  7474. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  7475. // for more details.
  7476. return object == (other + '');
  7477. case mapTag:
  7478. var convert = mapToArray;
  7479. case setTag:
  7480. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  7481. convert || (convert = setToArray);
  7482. if (object.size != other.size && !isPartial) {
  7483. return false;
  7484. }
  7485. // Assume cyclic values are equal.
  7486. var stacked = stack.get(object);
  7487. if (stacked) {
  7488. return stacked == other;
  7489. }
  7490. bitmask |= COMPARE_UNORDERED_FLAG;
  7491. // Recursively compare objects (susceptible to call stack limits).
  7492. stack.set(object, other);
  7493. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  7494. stack['delete'](object);
  7495. return result;
  7496. case symbolTag:
  7497. if (symbolValueOf) {
  7498. return symbolValueOf.call(object) == symbolValueOf.call(other);
  7499. }
  7500. }
  7501. return false;
  7502. }
  7503. module.exports = equalByTag;
  7504. /***/ }),
  7505. /***/ "../../node_modules/lodash/_equalObjects.js":
  7506. /*!****************************************************************!*\
  7507. !*** C:/Repos/Babylon.js/node_modules/lodash/_equalObjects.js ***!
  7508. \****************************************************************/
  7509. /*! no static exports found */
  7510. /***/ (function(module, exports, __webpack_require__) {
  7511. var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "../../node_modules/lodash/_getAllKeys.js");
  7512. /** Used to compose bitmasks for value comparisons. */
  7513. var COMPARE_PARTIAL_FLAG = 1;
  7514. /** Used for built-in method references. */
  7515. var objectProto = Object.prototype;
  7516. /** Used to check objects for own properties. */
  7517. var hasOwnProperty = objectProto.hasOwnProperty;
  7518. /**
  7519. * A specialized version of `baseIsEqualDeep` for objects with support for
  7520. * partial deep comparisons.
  7521. *
  7522. * @private
  7523. * @param {Object} object The object to compare.
  7524. * @param {Object} other The other object to compare.
  7525. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  7526. * @param {Function} customizer The function to customize comparisons.
  7527. * @param {Function} equalFunc The function to determine equivalents of values.
  7528. * @param {Object} stack Tracks traversed `object` and `other` objects.
  7529. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  7530. */
  7531. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  7532. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  7533. objProps = getAllKeys(object),
  7534. objLength = objProps.length,
  7535. othProps = getAllKeys(other),
  7536. othLength = othProps.length;
  7537. if (objLength != othLength && !isPartial) {
  7538. return false;
  7539. }
  7540. var index = objLength;
  7541. while (index--) {
  7542. var key = objProps[index];
  7543. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  7544. return false;
  7545. }
  7546. }
  7547. // Check that cyclic values are equal.
  7548. var objStacked = stack.get(object);
  7549. var othStacked = stack.get(other);
  7550. if (objStacked && othStacked) {
  7551. return objStacked == other && othStacked == object;
  7552. }
  7553. var result = true;
  7554. stack.set(object, other);
  7555. stack.set(other, object);
  7556. var skipCtor = isPartial;
  7557. while (++index < objLength) {
  7558. key = objProps[index];
  7559. var objValue = object[key],
  7560. othValue = other[key];
  7561. if (customizer) {
  7562. var compared = isPartial
  7563. ? customizer(othValue, objValue, key, other, object, stack)
  7564. : customizer(objValue, othValue, key, object, other, stack);
  7565. }
  7566. // Recursively compare objects (susceptible to call stack limits).
  7567. if (!(compared === undefined
  7568. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  7569. : compared
  7570. )) {
  7571. result = false;
  7572. break;
  7573. }
  7574. skipCtor || (skipCtor = key == 'constructor');
  7575. }
  7576. if (result && !skipCtor) {
  7577. var objCtor = object.constructor,
  7578. othCtor = other.constructor;
  7579. // Non `Object` object instances with different constructors are not equal.
  7580. if (objCtor != othCtor &&
  7581. ('constructor' in object && 'constructor' in other) &&
  7582. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  7583. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  7584. result = false;
  7585. }
  7586. }
  7587. stack['delete'](object);
  7588. stack['delete'](other);
  7589. return result;
  7590. }
  7591. module.exports = equalObjects;
  7592. /***/ }),
  7593. /***/ "../../node_modules/lodash/_flatRest.js":
  7594. /*!************************************************************!*\
  7595. !*** C:/Repos/Babylon.js/node_modules/lodash/_flatRest.js ***!
  7596. \************************************************************/
  7597. /*! no static exports found */
  7598. /***/ (function(module, exports, __webpack_require__) {
  7599. var flatten = __webpack_require__(/*! ./flatten */ "../../node_modules/lodash/flatten.js"),
  7600. overRest = __webpack_require__(/*! ./_overRest */ "../../node_modules/lodash/_overRest.js"),
  7601. setToString = __webpack_require__(/*! ./_setToString */ "../../node_modules/lodash/_setToString.js");
  7602. /**
  7603. * A specialized version of `baseRest` which flattens the rest array.
  7604. *
  7605. * @private
  7606. * @param {Function} func The function to apply a rest parameter to.
  7607. * @returns {Function} Returns the new function.
  7608. */
  7609. function flatRest(func) {
  7610. return setToString(overRest(func, undefined, flatten), func + '');
  7611. }
  7612. module.exports = flatRest;
  7613. /***/ }),
  7614. /***/ "../../node_modules/lodash/_freeGlobal.js":
  7615. /*!**************************************************************!*\
  7616. !*** C:/Repos/Babylon.js/node_modules/lodash/_freeGlobal.js ***!
  7617. \**************************************************************/
  7618. /*! no static exports found */
  7619. /***/ (function(module, exports, __webpack_require__) {
  7620. /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
  7621. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  7622. module.exports = freeGlobal;
  7623. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
  7624. /***/ }),
  7625. /***/ "../../node_modules/lodash/_getAllKeys.js":
  7626. /*!**************************************************************!*\
  7627. !*** C:/Repos/Babylon.js/node_modules/lodash/_getAllKeys.js ***!
  7628. \**************************************************************/
  7629. /*! no static exports found */
  7630. /***/ (function(module, exports, __webpack_require__) {
  7631. var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "../../node_modules/lodash/_baseGetAllKeys.js"),
  7632. getSymbols = __webpack_require__(/*! ./_getSymbols */ "../../node_modules/lodash/_getSymbols.js"),
  7633. keys = __webpack_require__(/*! ./keys */ "../../node_modules/lodash/keys.js");
  7634. /**
  7635. * Creates an array of own enumerable property names and symbols of `object`.
  7636. *
  7637. * @private
  7638. * @param {Object} object The object to query.
  7639. * @returns {Array} Returns the array of property names and symbols.
  7640. */
  7641. function getAllKeys(object) {
  7642. return baseGetAllKeys(object, keys, getSymbols);
  7643. }
  7644. module.exports = getAllKeys;
  7645. /***/ }),
  7646. /***/ "../../node_modules/lodash/_getAllKeysIn.js":
  7647. /*!****************************************************************!*\
  7648. !*** C:/Repos/Babylon.js/node_modules/lodash/_getAllKeysIn.js ***!
  7649. \****************************************************************/
  7650. /*! no static exports found */
  7651. /***/ (function(module, exports, __webpack_require__) {
  7652. var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "../../node_modules/lodash/_baseGetAllKeys.js"),
  7653. getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "../../node_modules/lodash/_getSymbolsIn.js"),
  7654. keysIn = __webpack_require__(/*! ./keysIn */ "../../node_modules/lodash/keysIn.js");
  7655. /**
  7656. * Creates an array of own and inherited enumerable property names and
  7657. * symbols of `object`.
  7658. *
  7659. * @private
  7660. * @param {Object} object The object to query.
  7661. * @returns {Array} Returns the array of property names and symbols.
  7662. */
  7663. function getAllKeysIn(object) {
  7664. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  7665. }
  7666. module.exports = getAllKeysIn;
  7667. /***/ }),
  7668. /***/ "../../node_modules/lodash/_getMapData.js":
  7669. /*!**************************************************************!*\
  7670. !*** C:/Repos/Babylon.js/node_modules/lodash/_getMapData.js ***!
  7671. \**************************************************************/
  7672. /*! no static exports found */
  7673. /***/ (function(module, exports, __webpack_require__) {
  7674. var isKeyable = __webpack_require__(/*! ./_isKeyable */ "../../node_modules/lodash/_isKeyable.js");
  7675. /**
  7676. * Gets the data for `map`.
  7677. *
  7678. * @private
  7679. * @param {Object} map The map to query.
  7680. * @param {string} key The reference key.
  7681. * @returns {*} Returns the map data.
  7682. */
  7683. function getMapData(map, key) {
  7684. var data = map.__data__;
  7685. return isKeyable(key)
  7686. ? data[typeof key == 'string' ? 'string' : 'hash']
  7687. : data.map;
  7688. }
  7689. module.exports = getMapData;
  7690. /***/ }),
  7691. /***/ "../../node_modules/lodash/_getMatchData.js":
  7692. /*!****************************************************************!*\
  7693. !*** C:/Repos/Babylon.js/node_modules/lodash/_getMatchData.js ***!
  7694. \****************************************************************/
  7695. /*! no static exports found */
  7696. /***/ (function(module, exports, __webpack_require__) {
  7697. var isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "../../node_modules/lodash/_isStrictComparable.js"),
  7698. keys = __webpack_require__(/*! ./keys */ "../../node_modules/lodash/keys.js");
  7699. /**
  7700. * Gets the property names, values, and compare flags of `object`.
  7701. *
  7702. * @private
  7703. * @param {Object} object The object to query.
  7704. * @returns {Array} Returns the match data of `object`.
  7705. */
  7706. function getMatchData(object) {
  7707. var result = keys(object),
  7708. length = result.length;
  7709. while (length--) {
  7710. var key = result[length],
  7711. value = object[key];
  7712. result[length] = [key, value, isStrictComparable(value)];
  7713. }
  7714. return result;
  7715. }
  7716. module.exports = getMatchData;
  7717. /***/ }),
  7718. /***/ "../../node_modules/lodash/_getNative.js":
  7719. /*!*************************************************************!*\
  7720. !*** C:/Repos/Babylon.js/node_modules/lodash/_getNative.js ***!
  7721. \*************************************************************/
  7722. /*! no static exports found */
  7723. /***/ (function(module, exports, __webpack_require__) {
  7724. var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ "../../node_modules/lodash/_baseIsNative.js"),
  7725. getValue = __webpack_require__(/*! ./_getValue */ "../../node_modules/lodash/_getValue.js");
  7726. /**
  7727. * Gets the native function at `key` of `object`.
  7728. *
  7729. * @private
  7730. * @param {Object} object The object to query.
  7731. * @param {string} key The key of the method to get.
  7732. * @returns {*} Returns the function if it's native, else `undefined`.
  7733. */
  7734. function getNative(object, key) {
  7735. var value = getValue(object, key);
  7736. return baseIsNative(value) ? value : undefined;
  7737. }
  7738. module.exports = getNative;
  7739. /***/ }),
  7740. /***/ "../../node_modules/lodash/_getPrototype.js":
  7741. /*!****************************************************************!*\
  7742. !*** C:/Repos/Babylon.js/node_modules/lodash/_getPrototype.js ***!
  7743. \****************************************************************/
  7744. /*! no static exports found */
  7745. /***/ (function(module, exports, __webpack_require__) {
  7746. var overArg = __webpack_require__(/*! ./_overArg */ "../../node_modules/lodash/_overArg.js");
  7747. /** Built-in value references. */
  7748. var getPrototype = overArg(Object.getPrototypeOf, Object);
  7749. module.exports = getPrototype;
  7750. /***/ }),
  7751. /***/ "../../node_modules/lodash/_getRawTag.js":
  7752. /*!*************************************************************!*\
  7753. !*** C:/Repos/Babylon.js/node_modules/lodash/_getRawTag.js ***!
  7754. \*************************************************************/
  7755. /*! no static exports found */
  7756. /***/ (function(module, exports, __webpack_require__) {
  7757. var Symbol = __webpack_require__(/*! ./_Symbol */ "../../node_modules/lodash/_Symbol.js");
  7758. /** Used for built-in method references. */
  7759. var objectProto = Object.prototype;
  7760. /** Used to check objects for own properties. */
  7761. var hasOwnProperty = objectProto.hasOwnProperty;
  7762. /**
  7763. * Used to resolve the
  7764. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  7765. * of values.
  7766. */
  7767. var nativeObjectToString = objectProto.toString;
  7768. /** Built-in value references. */
  7769. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  7770. /**
  7771. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  7772. *
  7773. * @private
  7774. * @param {*} value The value to query.
  7775. * @returns {string} Returns the raw `toStringTag`.
  7776. */
  7777. function getRawTag(value) {
  7778. var isOwn = hasOwnProperty.call(value, symToStringTag),
  7779. tag = value[symToStringTag];
  7780. try {
  7781. value[symToStringTag] = undefined;
  7782. var unmasked = true;
  7783. } catch (e) {}
  7784. var result = nativeObjectToString.call(value);
  7785. if (unmasked) {
  7786. if (isOwn) {
  7787. value[symToStringTag] = tag;
  7788. } else {
  7789. delete value[symToStringTag];
  7790. }
  7791. }
  7792. return result;
  7793. }
  7794. module.exports = getRawTag;
  7795. /***/ }),
  7796. /***/ "../../node_modules/lodash/_getSymbols.js":
  7797. /*!**************************************************************!*\
  7798. !*** C:/Repos/Babylon.js/node_modules/lodash/_getSymbols.js ***!
  7799. \**************************************************************/
  7800. /*! no static exports found */
  7801. /***/ (function(module, exports, __webpack_require__) {
  7802. var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "../../node_modules/lodash/_arrayFilter.js"),
  7803. stubArray = __webpack_require__(/*! ./stubArray */ "../../node_modules/lodash/stubArray.js");
  7804. /** Used for built-in method references. */
  7805. var objectProto = Object.prototype;
  7806. /** Built-in value references. */
  7807. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  7808. /* Built-in method references for those with the same name as other `lodash` methods. */
  7809. var nativeGetSymbols = Object.getOwnPropertySymbols;
  7810. /**
  7811. * Creates an array of the own enumerable symbols of `object`.
  7812. *
  7813. * @private
  7814. * @param {Object} object The object to query.
  7815. * @returns {Array} Returns the array of symbols.
  7816. */
  7817. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  7818. if (object == null) {
  7819. return [];
  7820. }
  7821. object = Object(object);
  7822. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  7823. return propertyIsEnumerable.call(object, symbol);
  7824. });
  7825. };
  7826. module.exports = getSymbols;
  7827. /***/ }),
  7828. /***/ "../../node_modules/lodash/_getSymbolsIn.js":
  7829. /*!****************************************************************!*\
  7830. !*** C:/Repos/Babylon.js/node_modules/lodash/_getSymbolsIn.js ***!
  7831. \****************************************************************/
  7832. /*! no static exports found */
  7833. /***/ (function(module, exports, __webpack_require__) {
  7834. var arrayPush = __webpack_require__(/*! ./_arrayPush */ "../../node_modules/lodash/_arrayPush.js"),
  7835. getPrototype = __webpack_require__(/*! ./_getPrototype */ "../../node_modules/lodash/_getPrototype.js"),
  7836. getSymbols = __webpack_require__(/*! ./_getSymbols */ "../../node_modules/lodash/_getSymbols.js"),
  7837. stubArray = __webpack_require__(/*! ./stubArray */ "../../node_modules/lodash/stubArray.js");
  7838. /* Built-in method references for those with the same name as other `lodash` methods. */
  7839. var nativeGetSymbols = Object.getOwnPropertySymbols;
  7840. /**
  7841. * Creates an array of the own and inherited enumerable symbols of `object`.
  7842. *
  7843. * @private
  7844. * @param {Object} object The object to query.
  7845. * @returns {Array} Returns the array of symbols.
  7846. */
  7847. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  7848. var result = [];
  7849. while (object) {
  7850. arrayPush(result, getSymbols(object));
  7851. object = getPrototype(object);
  7852. }
  7853. return result;
  7854. };
  7855. module.exports = getSymbolsIn;
  7856. /***/ }),
  7857. /***/ "../../node_modules/lodash/_getTag.js":
  7858. /*!**********************************************************!*\
  7859. !*** C:/Repos/Babylon.js/node_modules/lodash/_getTag.js ***!
  7860. \**********************************************************/
  7861. /*! no static exports found */
  7862. /***/ (function(module, exports, __webpack_require__) {
  7863. var DataView = __webpack_require__(/*! ./_DataView */ "../../node_modules/lodash/_DataView.js"),
  7864. Map = __webpack_require__(/*! ./_Map */ "../../node_modules/lodash/_Map.js"),
  7865. Promise = __webpack_require__(/*! ./_Promise */ "../../node_modules/lodash/_Promise.js"),
  7866. Set = __webpack_require__(/*! ./_Set */ "../../node_modules/lodash/_Set.js"),
  7867. WeakMap = __webpack_require__(/*! ./_WeakMap */ "../../node_modules/lodash/_WeakMap.js"),
  7868. baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"),
  7869. toSource = __webpack_require__(/*! ./_toSource */ "../../node_modules/lodash/_toSource.js");
  7870. /** `Object#toString` result references. */
  7871. var mapTag = '[object Map]',
  7872. objectTag = '[object Object]',
  7873. promiseTag = '[object Promise]',
  7874. setTag = '[object Set]',
  7875. weakMapTag = '[object WeakMap]';
  7876. var dataViewTag = '[object DataView]';
  7877. /** Used to detect maps, sets, and weakmaps. */
  7878. var dataViewCtorString = toSource(DataView),
  7879. mapCtorString = toSource(Map),
  7880. promiseCtorString = toSource(Promise),
  7881. setCtorString = toSource(Set),
  7882. weakMapCtorString = toSource(WeakMap);
  7883. /**
  7884. * Gets the `toStringTag` of `value`.
  7885. *
  7886. * @private
  7887. * @param {*} value The value to query.
  7888. * @returns {string} Returns the `toStringTag`.
  7889. */
  7890. var getTag = baseGetTag;
  7891. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  7892. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  7893. (Map && getTag(new Map) != mapTag) ||
  7894. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  7895. (Set && getTag(new Set) != setTag) ||
  7896. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  7897. getTag = function(value) {
  7898. var result = baseGetTag(value),
  7899. Ctor = result == objectTag ? value.constructor : undefined,
  7900. ctorString = Ctor ? toSource(Ctor) : '';
  7901. if (ctorString) {
  7902. switch (ctorString) {
  7903. case dataViewCtorString: return dataViewTag;
  7904. case mapCtorString: return mapTag;
  7905. case promiseCtorString: return promiseTag;
  7906. case setCtorString: return setTag;
  7907. case weakMapCtorString: return weakMapTag;
  7908. }
  7909. }
  7910. return result;
  7911. };
  7912. }
  7913. module.exports = getTag;
  7914. /***/ }),
  7915. /***/ "../../node_modules/lodash/_getValue.js":
  7916. /*!************************************************************!*\
  7917. !*** C:/Repos/Babylon.js/node_modules/lodash/_getValue.js ***!
  7918. \************************************************************/
  7919. /*! no static exports found */
  7920. /***/ (function(module, exports) {
  7921. /**
  7922. * Gets the value at `key` of `object`.
  7923. *
  7924. * @private
  7925. * @param {Object} [object] The object to query.
  7926. * @param {string} key The key of the property to get.
  7927. * @returns {*} Returns the property value.
  7928. */
  7929. function getValue(object, key) {
  7930. return object == null ? undefined : object[key];
  7931. }
  7932. module.exports = getValue;
  7933. /***/ }),
  7934. /***/ "../../node_modules/lodash/_hasPath.js":
  7935. /*!***********************************************************!*\
  7936. !*** C:/Repos/Babylon.js/node_modules/lodash/_hasPath.js ***!
  7937. \***********************************************************/
  7938. /*! no static exports found */
  7939. /***/ (function(module, exports, __webpack_require__) {
  7940. var castPath = __webpack_require__(/*! ./_castPath */ "../../node_modules/lodash/_castPath.js"),
  7941. isArguments = __webpack_require__(/*! ./isArguments */ "../../node_modules/lodash/isArguments.js"),
  7942. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  7943. isIndex = __webpack_require__(/*! ./_isIndex */ "../../node_modules/lodash/_isIndex.js"),
  7944. isLength = __webpack_require__(/*! ./isLength */ "../../node_modules/lodash/isLength.js"),
  7945. toKey = __webpack_require__(/*! ./_toKey */ "../../node_modules/lodash/_toKey.js");
  7946. /**
  7947. * Checks if `path` exists on `object`.
  7948. *
  7949. * @private
  7950. * @param {Object} object The object to query.
  7951. * @param {Array|string} path The path to check.
  7952. * @param {Function} hasFunc The function to check properties.
  7953. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7954. */
  7955. function hasPath(object, path, hasFunc) {
  7956. path = castPath(path, object);
  7957. var index = -1,
  7958. length = path.length,
  7959. result = false;
  7960. while (++index < length) {
  7961. var key = toKey(path[index]);
  7962. if (!(result = object != null && hasFunc(object, key))) {
  7963. break;
  7964. }
  7965. object = object[key];
  7966. }
  7967. if (result || ++index != length) {
  7968. return result;
  7969. }
  7970. length = object == null ? 0 : object.length;
  7971. return !!length && isLength(length) && isIndex(key, length) &&
  7972. (isArray(object) || isArguments(object));
  7973. }
  7974. module.exports = hasPath;
  7975. /***/ }),
  7976. /***/ "../../node_modules/lodash/_hasUnicode.js":
  7977. /*!**************************************************************!*\
  7978. !*** C:/Repos/Babylon.js/node_modules/lodash/_hasUnicode.js ***!
  7979. \**************************************************************/
  7980. /*! no static exports found */
  7981. /***/ (function(module, exports) {
  7982. /** Used to compose unicode character classes. */
  7983. var rsAstralRange = '\\ud800-\\udfff',
  7984. rsComboMarksRange = '\\u0300-\\u036f',
  7985. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  7986. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  7987. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  7988. rsVarRange = '\\ufe0e\\ufe0f';
  7989. /** Used to compose unicode capture groups. */
  7990. var rsZWJ = '\\u200d';
  7991. /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  7992. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  7993. /**
  7994. * Checks if `string` contains Unicode symbols.
  7995. *
  7996. * @private
  7997. * @param {string} string The string to inspect.
  7998. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  7999. */
  8000. function hasUnicode(string) {
  8001. return reHasUnicode.test(string);
  8002. }
  8003. module.exports = hasUnicode;
  8004. /***/ }),
  8005. /***/ "../../node_modules/lodash/_hashClear.js":
  8006. /*!*************************************************************!*\
  8007. !*** C:/Repos/Babylon.js/node_modules/lodash/_hashClear.js ***!
  8008. \*************************************************************/
  8009. /*! no static exports found */
  8010. /***/ (function(module, exports, __webpack_require__) {
  8011. var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../../node_modules/lodash/_nativeCreate.js");
  8012. /**
  8013. * Removes all key-value entries from the hash.
  8014. *
  8015. * @private
  8016. * @name clear
  8017. * @memberOf Hash
  8018. */
  8019. function hashClear() {
  8020. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  8021. this.size = 0;
  8022. }
  8023. module.exports = hashClear;
  8024. /***/ }),
  8025. /***/ "../../node_modules/lodash/_hashDelete.js":
  8026. /*!**************************************************************!*\
  8027. !*** C:/Repos/Babylon.js/node_modules/lodash/_hashDelete.js ***!
  8028. \**************************************************************/
  8029. /*! no static exports found */
  8030. /***/ (function(module, exports) {
  8031. /**
  8032. * Removes `key` and its value from the hash.
  8033. *
  8034. * @private
  8035. * @name delete
  8036. * @memberOf Hash
  8037. * @param {Object} hash The hash to modify.
  8038. * @param {string} key The key of the value to remove.
  8039. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8040. */
  8041. function hashDelete(key) {
  8042. var result = this.has(key) && delete this.__data__[key];
  8043. this.size -= result ? 1 : 0;
  8044. return result;
  8045. }
  8046. module.exports = hashDelete;
  8047. /***/ }),
  8048. /***/ "../../node_modules/lodash/_hashGet.js":
  8049. /*!***********************************************************!*\
  8050. !*** C:/Repos/Babylon.js/node_modules/lodash/_hashGet.js ***!
  8051. \***********************************************************/
  8052. /*! no static exports found */
  8053. /***/ (function(module, exports, __webpack_require__) {
  8054. var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../../node_modules/lodash/_nativeCreate.js");
  8055. /** Used to stand-in for `undefined` hash values. */
  8056. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  8057. /** Used for built-in method references. */
  8058. var objectProto = Object.prototype;
  8059. /** Used to check objects for own properties. */
  8060. var hasOwnProperty = objectProto.hasOwnProperty;
  8061. /**
  8062. * Gets the hash value for `key`.
  8063. *
  8064. * @private
  8065. * @name get
  8066. * @memberOf Hash
  8067. * @param {string} key The key of the value to get.
  8068. * @returns {*} Returns the entry value.
  8069. */
  8070. function hashGet(key) {
  8071. var data = this.__data__;
  8072. if (nativeCreate) {
  8073. var result = data[key];
  8074. return result === HASH_UNDEFINED ? undefined : result;
  8075. }
  8076. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  8077. }
  8078. module.exports = hashGet;
  8079. /***/ }),
  8080. /***/ "../../node_modules/lodash/_hashHas.js":
  8081. /*!***********************************************************!*\
  8082. !*** C:/Repos/Babylon.js/node_modules/lodash/_hashHas.js ***!
  8083. \***********************************************************/
  8084. /*! no static exports found */
  8085. /***/ (function(module, exports, __webpack_require__) {
  8086. var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../../node_modules/lodash/_nativeCreate.js");
  8087. /** Used for built-in method references. */
  8088. var objectProto = Object.prototype;
  8089. /** Used to check objects for own properties. */
  8090. var hasOwnProperty = objectProto.hasOwnProperty;
  8091. /**
  8092. * Checks if a hash value for `key` exists.
  8093. *
  8094. * @private
  8095. * @name has
  8096. * @memberOf Hash
  8097. * @param {string} key The key of the entry to check.
  8098. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8099. */
  8100. function hashHas(key) {
  8101. var data = this.__data__;
  8102. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  8103. }
  8104. module.exports = hashHas;
  8105. /***/ }),
  8106. /***/ "../../node_modules/lodash/_hashSet.js":
  8107. /*!***********************************************************!*\
  8108. !*** C:/Repos/Babylon.js/node_modules/lodash/_hashSet.js ***!
  8109. \***********************************************************/
  8110. /*! no static exports found */
  8111. /***/ (function(module, exports, __webpack_require__) {
  8112. var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../../node_modules/lodash/_nativeCreate.js");
  8113. /** Used to stand-in for `undefined` hash values. */
  8114. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  8115. /**
  8116. * Sets the hash `key` to `value`.
  8117. *
  8118. * @private
  8119. * @name set
  8120. * @memberOf Hash
  8121. * @param {string} key The key of the value to set.
  8122. * @param {*} value The value to set.
  8123. * @returns {Object} Returns the hash instance.
  8124. */
  8125. function hashSet(key, value) {
  8126. var data = this.__data__;
  8127. this.size += this.has(key) ? 0 : 1;
  8128. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  8129. return this;
  8130. }
  8131. module.exports = hashSet;
  8132. /***/ }),
  8133. /***/ "../../node_modules/lodash/_initCloneArray.js":
  8134. /*!******************************************************************!*\
  8135. !*** C:/Repos/Babylon.js/node_modules/lodash/_initCloneArray.js ***!
  8136. \******************************************************************/
  8137. /*! no static exports found */
  8138. /***/ (function(module, exports) {
  8139. /** Used for built-in method references. */
  8140. var objectProto = Object.prototype;
  8141. /** Used to check objects for own properties. */
  8142. var hasOwnProperty = objectProto.hasOwnProperty;
  8143. /**
  8144. * Initializes an array clone.
  8145. *
  8146. * @private
  8147. * @param {Array} array The array to clone.
  8148. * @returns {Array} Returns the initialized clone.
  8149. */
  8150. function initCloneArray(array) {
  8151. var length = array.length,
  8152. result = new array.constructor(length);
  8153. // Add properties assigned by `RegExp#exec`.
  8154. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  8155. result.index = array.index;
  8156. result.input = array.input;
  8157. }
  8158. return result;
  8159. }
  8160. module.exports = initCloneArray;
  8161. /***/ }),
  8162. /***/ "../../node_modules/lodash/_initCloneByTag.js":
  8163. /*!******************************************************************!*\
  8164. !*** C:/Repos/Babylon.js/node_modules/lodash/_initCloneByTag.js ***!
  8165. \******************************************************************/
  8166. /*! no static exports found */
  8167. /***/ (function(module, exports, __webpack_require__) {
  8168. var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "../../node_modules/lodash/_cloneArrayBuffer.js"),
  8169. cloneDataView = __webpack_require__(/*! ./_cloneDataView */ "../../node_modules/lodash/_cloneDataView.js"),
  8170. cloneRegExp = __webpack_require__(/*! ./_cloneRegExp */ "../../node_modules/lodash/_cloneRegExp.js"),
  8171. cloneSymbol = __webpack_require__(/*! ./_cloneSymbol */ "../../node_modules/lodash/_cloneSymbol.js"),
  8172. cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ "../../node_modules/lodash/_cloneTypedArray.js");
  8173. /** `Object#toString` result references. */
  8174. var boolTag = '[object Boolean]',
  8175. dateTag = '[object Date]',
  8176. mapTag = '[object Map]',
  8177. numberTag = '[object Number]',
  8178. regexpTag = '[object RegExp]',
  8179. setTag = '[object Set]',
  8180. stringTag = '[object String]',
  8181. symbolTag = '[object Symbol]';
  8182. var arrayBufferTag = '[object ArrayBuffer]',
  8183. dataViewTag = '[object DataView]',
  8184. float32Tag = '[object Float32Array]',
  8185. float64Tag = '[object Float64Array]',
  8186. int8Tag = '[object Int8Array]',
  8187. int16Tag = '[object Int16Array]',
  8188. int32Tag = '[object Int32Array]',
  8189. uint8Tag = '[object Uint8Array]',
  8190. uint8ClampedTag = '[object Uint8ClampedArray]',
  8191. uint16Tag = '[object Uint16Array]',
  8192. uint32Tag = '[object Uint32Array]';
  8193. /**
  8194. * Initializes an object clone based on its `toStringTag`.
  8195. *
  8196. * **Note:** This function only supports cloning values with tags of
  8197. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  8198. *
  8199. * @private
  8200. * @param {Object} object The object to clone.
  8201. * @param {string} tag The `toStringTag` of the object to clone.
  8202. * @param {boolean} [isDeep] Specify a deep clone.
  8203. * @returns {Object} Returns the initialized clone.
  8204. */
  8205. function initCloneByTag(object, tag, isDeep) {
  8206. var Ctor = object.constructor;
  8207. switch (tag) {
  8208. case arrayBufferTag:
  8209. return cloneArrayBuffer(object);
  8210. case boolTag:
  8211. case dateTag:
  8212. return new Ctor(+object);
  8213. case dataViewTag:
  8214. return cloneDataView(object, isDeep);
  8215. case float32Tag: case float64Tag:
  8216. case int8Tag: case int16Tag: case int32Tag:
  8217. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  8218. return cloneTypedArray(object, isDeep);
  8219. case mapTag:
  8220. return new Ctor;
  8221. case numberTag:
  8222. case stringTag:
  8223. return new Ctor(object);
  8224. case regexpTag:
  8225. return cloneRegExp(object);
  8226. case setTag:
  8227. return new Ctor;
  8228. case symbolTag:
  8229. return cloneSymbol(object);
  8230. }
  8231. }
  8232. module.exports = initCloneByTag;
  8233. /***/ }),
  8234. /***/ "../../node_modules/lodash/_initCloneObject.js":
  8235. /*!*******************************************************************!*\
  8236. !*** C:/Repos/Babylon.js/node_modules/lodash/_initCloneObject.js ***!
  8237. \*******************************************************************/
  8238. /*! no static exports found */
  8239. /***/ (function(module, exports, __webpack_require__) {
  8240. var baseCreate = __webpack_require__(/*! ./_baseCreate */ "../../node_modules/lodash/_baseCreate.js"),
  8241. getPrototype = __webpack_require__(/*! ./_getPrototype */ "../../node_modules/lodash/_getPrototype.js"),
  8242. isPrototype = __webpack_require__(/*! ./_isPrototype */ "../../node_modules/lodash/_isPrototype.js");
  8243. /**
  8244. * Initializes an object clone.
  8245. *
  8246. * @private
  8247. * @param {Object} object The object to clone.
  8248. * @returns {Object} Returns the initialized clone.
  8249. */
  8250. function initCloneObject(object) {
  8251. return (typeof object.constructor == 'function' && !isPrototype(object))
  8252. ? baseCreate(getPrototype(object))
  8253. : {};
  8254. }
  8255. module.exports = initCloneObject;
  8256. /***/ }),
  8257. /***/ "../../node_modules/lodash/_isFlattenable.js":
  8258. /*!*****************************************************************!*\
  8259. !*** C:/Repos/Babylon.js/node_modules/lodash/_isFlattenable.js ***!
  8260. \*****************************************************************/
  8261. /*! no static exports found */
  8262. /***/ (function(module, exports, __webpack_require__) {
  8263. var Symbol = __webpack_require__(/*! ./_Symbol */ "../../node_modules/lodash/_Symbol.js"),
  8264. isArguments = __webpack_require__(/*! ./isArguments */ "../../node_modules/lodash/isArguments.js"),
  8265. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js");
  8266. /** Built-in value references. */
  8267. var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
  8268. /**
  8269. * Checks if `value` is a flattenable `arguments` object or array.
  8270. *
  8271. * @private
  8272. * @param {*} value The value to check.
  8273. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  8274. */
  8275. function isFlattenable(value) {
  8276. return isArray(value) || isArguments(value) ||
  8277. !!(spreadableSymbol && value && value[spreadableSymbol]);
  8278. }
  8279. module.exports = isFlattenable;
  8280. /***/ }),
  8281. /***/ "../../node_modules/lodash/_isIndex.js":
  8282. /*!***********************************************************!*\
  8283. !*** C:/Repos/Babylon.js/node_modules/lodash/_isIndex.js ***!
  8284. \***********************************************************/
  8285. /*! no static exports found */
  8286. /***/ (function(module, exports) {
  8287. /** Used as references for various `Number` constants. */
  8288. var MAX_SAFE_INTEGER = 9007199254740991;
  8289. /** Used to detect unsigned integer values. */
  8290. var reIsUint = /^(?:0|[1-9]\d*)$/;
  8291. /**
  8292. * Checks if `value` is a valid array-like index.
  8293. *
  8294. * @private
  8295. * @param {*} value The value to check.
  8296. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  8297. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  8298. */
  8299. function isIndex(value, length) {
  8300. var type = typeof value;
  8301. length = length == null ? MAX_SAFE_INTEGER : length;
  8302. return !!length &&
  8303. (type == 'number' ||
  8304. (type != 'symbol' && reIsUint.test(value))) &&
  8305. (value > -1 && value % 1 == 0 && value < length);
  8306. }
  8307. module.exports = isIndex;
  8308. /***/ }),
  8309. /***/ "../../node_modules/lodash/_isIterateeCall.js":
  8310. /*!******************************************************************!*\
  8311. !*** C:/Repos/Babylon.js/node_modules/lodash/_isIterateeCall.js ***!
  8312. \******************************************************************/
  8313. /*! no static exports found */
  8314. /***/ (function(module, exports, __webpack_require__) {
  8315. var eq = __webpack_require__(/*! ./eq */ "../../node_modules/lodash/eq.js"),
  8316. isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js"),
  8317. isIndex = __webpack_require__(/*! ./_isIndex */ "../../node_modules/lodash/_isIndex.js"),
  8318. isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js");
  8319. /**
  8320. * Checks if the given arguments are from an iteratee call.
  8321. *
  8322. * @private
  8323. * @param {*} value The potential iteratee value argument.
  8324. * @param {*} index The potential iteratee index or key argument.
  8325. * @param {*} object The potential iteratee object argument.
  8326. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  8327. * else `false`.
  8328. */
  8329. function isIterateeCall(value, index, object) {
  8330. if (!isObject(object)) {
  8331. return false;
  8332. }
  8333. var type = typeof index;
  8334. if (type == 'number'
  8335. ? (isArrayLike(object) && isIndex(index, object.length))
  8336. : (type == 'string' && index in object)
  8337. ) {
  8338. return eq(object[index], value);
  8339. }
  8340. return false;
  8341. }
  8342. module.exports = isIterateeCall;
  8343. /***/ }),
  8344. /***/ "../../node_modules/lodash/_isKey.js":
  8345. /*!*********************************************************!*\
  8346. !*** C:/Repos/Babylon.js/node_modules/lodash/_isKey.js ***!
  8347. \*********************************************************/
  8348. /*! no static exports found */
  8349. /***/ (function(module, exports, __webpack_require__) {
  8350. var isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  8351. isSymbol = __webpack_require__(/*! ./isSymbol */ "../../node_modules/lodash/isSymbol.js");
  8352. /** Used to match property names within property paths. */
  8353. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  8354. reIsPlainProp = /^\w*$/;
  8355. /**
  8356. * Checks if `value` is a property name and not a property path.
  8357. *
  8358. * @private
  8359. * @param {*} value The value to check.
  8360. * @param {Object} [object] The object to query keys on.
  8361. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  8362. */
  8363. function isKey(value, object) {
  8364. if (isArray(value)) {
  8365. return false;
  8366. }
  8367. var type = typeof value;
  8368. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  8369. value == null || isSymbol(value)) {
  8370. return true;
  8371. }
  8372. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  8373. (object != null && value in Object(object));
  8374. }
  8375. module.exports = isKey;
  8376. /***/ }),
  8377. /***/ "../../node_modules/lodash/_isKeyable.js":
  8378. /*!*************************************************************!*\
  8379. !*** C:/Repos/Babylon.js/node_modules/lodash/_isKeyable.js ***!
  8380. \*************************************************************/
  8381. /*! no static exports found */
  8382. /***/ (function(module, exports) {
  8383. /**
  8384. * Checks if `value` is suitable for use as unique object key.
  8385. *
  8386. * @private
  8387. * @param {*} value The value to check.
  8388. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  8389. */
  8390. function isKeyable(value) {
  8391. var type = typeof value;
  8392. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  8393. ? (value !== '__proto__')
  8394. : (value === null);
  8395. }
  8396. module.exports = isKeyable;
  8397. /***/ }),
  8398. /***/ "../../node_modules/lodash/_isMasked.js":
  8399. /*!************************************************************!*\
  8400. !*** C:/Repos/Babylon.js/node_modules/lodash/_isMasked.js ***!
  8401. \************************************************************/
  8402. /*! no static exports found */
  8403. /***/ (function(module, exports, __webpack_require__) {
  8404. var coreJsData = __webpack_require__(/*! ./_coreJsData */ "../../node_modules/lodash/_coreJsData.js");
  8405. /** Used to detect methods masquerading as native. */
  8406. var maskSrcKey = (function() {
  8407. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  8408. return uid ? ('Symbol(src)_1.' + uid) : '';
  8409. }());
  8410. /**
  8411. * Checks if `func` has its source masked.
  8412. *
  8413. * @private
  8414. * @param {Function} func The function to check.
  8415. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  8416. */
  8417. function isMasked(func) {
  8418. return !!maskSrcKey && (maskSrcKey in func);
  8419. }
  8420. module.exports = isMasked;
  8421. /***/ }),
  8422. /***/ "../../node_modules/lodash/_isPrototype.js":
  8423. /*!***************************************************************!*\
  8424. !*** C:/Repos/Babylon.js/node_modules/lodash/_isPrototype.js ***!
  8425. \***************************************************************/
  8426. /*! no static exports found */
  8427. /***/ (function(module, exports) {
  8428. /** Used for built-in method references. */
  8429. var objectProto = Object.prototype;
  8430. /**
  8431. * Checks if `value` is likely a prototype object.
  8432. *
  8433. * @private
  8434. * @param {*} value The value to check.
  8435. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  8436. */
  8437. function isPrototype(value) {
  8438. var Ctor = value && value.constructor,
  8439. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  8440. return value === proto;
  8441. }
  8442. module.exports = isPrototype;
  8443. /***/ }),
  8444. /***/ "../../node_modules/lodash/_isStrictComparable.js":
  8445. /*!**********************************************************************!*\
  8446. !*** C:/Repos/Babylon.js/node_modules/lodash/_isStrictComparable.js ***!
  8447. \**********************************************************************/
  8448. /*! no static exports found */
  8449. /***/ (function(module, exports, __webpack_require__) {
  8450. var isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js");
  8451. /**
  8452. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  8453. *
  8454. * @private
  8455. * @param {*} value The value to check.
  8456. * @returns {boolean} Returns `true` if `value` if suitable for strict
  8457. * equality comparisons, else `false`.
  8458. */
  8459. function isStrictComparable(value) {
  8460. return value === value && !isObject(value);
  8461. }
  8462. module.exports = isStrictComparable;
  8463. /***/ }),
  8464. /***/ "../../node_modules/lodash/_listCacheClear.js":
  8465. /*!******************************************************************!*\
  8466. !*** C:/Repos/Babylon.js/node_modules/lodash/_listCacheClear.js ***!
  8467. \******************************************************************/
  8468. /*! no static exports found */
  8469. /***/ (function(module, exports) {
  8470. /**
  8471. * Removes all key-value entries from the list cache.
  8472. *
  8473. * @private
  8474. * @name clear
  8475. * @memberOf ListCache
  8476. */
  8477. function listCacheClear() {
  8478. this.__data__ = [];
  8479. this.size = 0;
  8480. }
  8481. module.exports = listCacheClear;
  8482. /***/ }),
  8483. /***/ "../../node_modules/lodash/_listCacheDelete.js":
  8484. /*!*******************************************************************!*\
  8485. !*** C:/Repos/Babylon.js/node_modules/lodash/_listCacheDelete.js ***!
  8486. \*******************************************************************/
  8487. /*! no static exports found */
  8488. /***/ (function(module, exports, __webpack_require__) {
  8489. var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../../node_modules/lodash/_assocIndexOf.js");
  8490. /** Used for built-in method references. */
  8491. var arrayProto = Array.prototype;
  8492. /** Built-in value references. */
  8493. var splice = arrayProto.splice;
  8494. /**
  8495. * Removes `key` and its value from the list cache.
  8496. *
  8497. * @private
  8498. * @name delete
  8499. * @memberOf ListCache
  8500. * @param {string} key The key of the value to remove.
  8501. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8502. */
  8503. function listCacheDelete(key) {
  8504. var data = this.__data__,
  8505. index = assocIndexOf(data, key);
  8506. if (index < 0) {
  8507. return false;
  8508. }
  8509. var lastIndex = data.length - 1;
  8510. if (index == lastIndex) {
  8511. data.pop();
  8512. } else {
  8513. splice.call(data, index, 1);
  8514. }
  8515. --this.size;
  8516. return true;
  8517. }
  8518. module.exports = listCacheDelete;
  8519. /***/ }),
  8520. /***/ "../../node_modules/lodash/_listCacheGet.js":
  8521. /*!****************************************************************!*\
  8522. !*** C:/Repos/Babylon.js/node_modules/lodash/_listCacheGet.js ***!
  8523. \****************************************************************/
  8524. /*! no static exports found */
  8525. /***/ (function(module, exports, __webpack_require__) {
  8526. var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../../node_modules/lodash/_assocIndexOf.js");
  8527. /**
  8528. * Gets the list cache value for `key`.
  8529. *
  8530. * @private
  8531. * @name get
  8532. * @memberOf ListCache
  8533. * @param {string} key The key of the value to get.
  8534. * @returns {*} Returns the entry value.
  8535. */
  8536. function listCacheGet(key) {
  8537. var data = this.__data__,
  8538. index = assocIndexOf(data, key);
  8539. return index < 0 ? undefined : data[index][1];
  8540. }
  8541. module.exports = listCacheGet;
  8542. /***/ }),
  8543. /***/ "../../node_modules/lodash/_listCacheHas.js":
  8544. /*!****************************************************************!*\
  8545. !*** C:/Repos/Babylon.js/node_modules/lodash/_listCacheHas.js ***!
  8546. \****************************************************************/
  8547. /*! no static exports found */
  8548. /***/ (function(module, exports, __webpack_require__) {
  8549. var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../../node_modules/lodash/_assocIndexOf.js");
  8550. /**
  8551. * Checks if a list cache value for `key` exists.
  8552. *
  8553. * @private
  8554. * @name has
  8555. * @memberOf ListCache
  8556. * @param {string} key The key of the entry to check.
  8557. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8558. */
  8559. function listCacheHas(key) {
  8560. return assocIndexOf(this.__data__, key) > -1;
  8561. }
  8562. module.exports = listCacheHas;
  8563. /***/ }),
  8564. /***/ "../../node_modules/lodash/_listCacheSet.js":
  8565. /*!****************************************************************!*\
  8566. !*** C:/Repos/Babylon.js/node_modules/lodash/_listCacheSet.js ***!
  8567. \****************************************************************/
  8568. /*! no static exports found */
  8569. /***/ (function(module, exports, __webpack_require__) {
  8570. var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../../node_modules/lodash/_assocIndexOf.js");
  8571. /**
  8572. * Sets the list cache `key` to `value`.
  8573. *
  8574. * @private
  8575. * @name set
  8576. * @memberOf ListCache
  8577. * @param {string} key The key of the value to set.
  8578. * @param {*} value The value to set.
  8579. * @returns {Object} Returns the list cache instance.
  8580. */
  8581. function listCacheSet(key, value) {
  8582. var data = this.__data__,
  8583. index = assocIndexOf(data, key);
  8584. if (index < 0) {
  8585. ++this.size;
  8586. data.push([key, value]);
  8587. } else {
  8588. data[index][1] = value;
  8589. }
  8590. return this;
  8591. }
  8592. module.exports = listCacheSet;
  8593. /***/ }),
  8594. /***/ "../../node_modules/lodash/_mapCacheClear.js":
  8595. /*!*****************************************************************!*\
  8596. !*** C:/Repos/Babylon.js/node_modules/lodash/_mapCacheClear.js ***!
  8597. \*****************************************************************/
  8598. /*! no static exports found */
  8599. /***/ (function(module, exports, __webpack_require__) {
  8600. var Hash = __webpack_require__(/*! ./_Hash */ "../../node_modules/lodash/_Hash.js"),
  8601. ListCache = __webpack_require__(/*! ./_ListCache */ "../../node_modules/lodash/_ListCache.js"),
  8602. Map = __webpack_require__(/*! ./_Map */ "../../node_modules/lodash/_Map.js");
  8603. /**
  8604. * Removes all key-value entries from the map.
  8605. *
  8606. * @private
  8607. * @name clear
  8608. * @memberOf MapCache
  8609. */
  8610. function mapCacheClear() {
  8611. this.size = 0;
  8612. this.__data__ = {
  8613. 'hash': new Hash,
  8614. 'map': new (Map || ListCache),
  8615. 'string': new Hash
  8616. };
  8617. }
  8618. module.exports = mapCacheClear;
  8619. /***/ }),
  8620. /***/ "../../node_modules/lodash/_mapCacheDelete.js":
  8621. /*!******************************************************************!*\
  8622. !*** C:/Repos/Babylon.js/node_modules/lodash/_mapCacheDelete.js ***!
  8623. \******************************************************************/
  8624. /*! no static exports found */
  8625. /***/ (function(module, exports, __webpack_require__) {
  8626. var getMapData = __webpack_require__(/*! ./_getMapData */ "../../node_modules/lodash/_getMapData.js");
  8627. /**
  8628. * Removes `key` and its value from the map.
  8629. *
  8630. * @private
  8631. * @name delete
  8632. * @memberOf MapCache
  8633. * @param {string} key The key of the value to remove.
  8634. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8635. */
  8636. function mapCacheDelete(key) {
  8637. var result = getMapData(this, key)['delete'](key);
  8638. this.size -= result ? 1 : 0;
  8639. return result;
  8640. }
  8641. module.exports = mapCacheDelete;
  8642. /***/ }),
  8643. /***/ "../../node_modules/lodash/_mapCacheGet.js":
  8644. /*!***************************************************************!*\
  8645. !*** C:/Repos/Babylon.js/node_modules/lodash/_mapCacheGet.js ***!
  8646. \***************************************************************/
  8647. /*! no static exports found */
  8648. /***/ (function(module, exports, __webpack_require__) {
  8649. var getMapData = __webpack_require__(/*! ./_getMapData */ "../../node_modules/lodash/_getMapData.js");
  8650. /**
  8651. * Gets the map value for `key`.
  8652. *
  8653. * @private
  8654. * @name get
  8655. * @memberOf MapCache
  8656. * @param {string} key The key of the value to get.
  8657. * @returns {*} Returns the entry value.
  8658. */
  8659. function mapCacheGet(key) {
  8660. return getMapData(this, key).get(key);
  8661. }
  8662. module.exports = mapCacheGet;
  8663. /***/ }),
  8664. /***/ "../../node_modules/lodash/_mapCacheHas.js":
  8665. /*!***************************************************************!*\
  8666. !*** C:/Repos/Babylon.js/node_modules/lodash/_mapCacheHas.js ***!
  8667. \***************************************************************/
  8668. /*! no static exports found */
  8669. /***/ (function(module, exports, __webpack_require__) {
  8670. var getMapData = __webpack_require__(/*! ./_getMapData */ "../../node_modules/lodash/_getMapData.js");
  8671. /**
  8672. * Checks if a map value for `key` exists.
  8673. *
  8674. * @private
  8675. * @name has
  8676. * @memberOf MapCache
  8677. * @param {string} key The key of the entry to check.
  8678. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8679. */
  8680. function mapCacheHas(key) {
  8681. return getMapData(this, key).has(key);
  8682. }
  8683. module.exports = mapCacheHas;
  8684. /***/ }),
  8685. /***/ "../../node_modules/lodash/_mapCacheSet.js":
  8686. /*!***************************************************************!*\
  8687. !*** C:/Repos/Babylon.js/node_modules/lodash/_mapCacheSet.js ***!
  8688. \***************************************************************/
  8689. /*! no static exports found */
  8690. /***/ (function(module, exports, __webpack_require__) {
  8691. var getMapData = __webpack_require__(/*! ./_getMapData */ "../../node_modules/lodash/_getMapData.js");
  8692. /**
  8693. * Sets the map `key` to `value`.
  8694. *
  8695. * @private
  8696. * @name set
  8697. * @memberOf MapCache
  8698. * @param {string} key The key of the value to set.
  8699. * @param {*} value The value to set.
  8700. * @returns {Object} Returns the map cache instance.
  8701. */
  8702. function mapCacheSet(key, value) {
  8703. var data = getMapData(this, key),
  8704. size = data.size;
  8705. data.set(key, value);
  8706. this.size += data.size == size ? 0 : 1;
  8707. return this;
  8708. }
  8709. module.exports = mapCacheSet;
  8710. /***/ }),
  8711. /***/ "../../node_modules/lodash/_mapToArray.js":
  8712. /*!**************************************************************!*\
  8713. !*** C:/Repos/Babylon.js/node_modules/lodash/_mapToArray.js ***!
  8714. \**************************************************************/
  8715. /*! no static exports found */
  8716. /***/ (function(module, exports) {
  8717. /**
  8718. * Converts `map` to its key-value pairs.
  8719. *
  8720. * @private
  8721. * @param {Object} map The map to convert.
  8722. * @returns {Array} Returns the key-value pairs.
  8723. */
  8724. function mapToArray(map) {
  8725. var index = -1,
  8726. result = Array(map.size);
  8727. map.forEach(function(value, key) {
  8728. result[++index] = [key, value];
  8729. });
  8730. return result;
  8731. }
  8732. module.exports = mapToArray;
  8733. /***/ }),
  8734. /***/ "../../node_modules/lodash/_matchesStrictComparable.js":
  8735. /*!***************************************************************************!*\
  8736. !*** C:/Repos/Babylon.js/node_modules/lodash/_matchesStrictComparable.js ***!
  8737. \***************************************************************************/
  8738. /*! no static exports found */
  8739. /***/ (function(module, exports) {
  8740. /**
  8741. * A specialized version of `matchesProperty` for source values suitable
  8742. * for strict equality comparisons, i.e. `===`.
  8743. *
  8744. * @private
  8745. * @param {string} key The key of the property to get.
  8746. * @param {*} srcValue The value to match.
  8747. * @returns {Function} Returns the new spec function.
  8748. */
  8749. function matchesStrictComparable(key, srcValue) {
  8750. return function(object) {
  8751. if (object == null) {
  8752. return false;
  8753. }
  8754. return object[key] === srcValue &&
  8755. (srcValue !== undefined || (key in Object(object)));
  8756. };
  8757. }
  8758. module.exports = matchesStrictComparable;
  8759. /***/ }),
  8760. /***/ "../../node_modules/lodash/_memoizeCapped.js":
  8761. /*!*****************************************************************!*\
  8762. !*** C:/Repos/Babylon.js/node_modules/lodash/_memoizeCapped.js ***!
  8763. \*****************************************************************/
  8764. /*! no static exports found */
  8765. /***/ (function(module, exports, __webpack_require__) {
  8766. var memoize = __webpack_require__(/*! ./memoize */ "../../node_modules/lodash/memoize.js");
  8767. /** Used as the maximum memoize cache size. */
  8768. var MAX_MEMOIZE_SIZE = 500;
  8769. /**
  8770. * A specialized version of `_.memoize` which clears the memoized function's
  8771. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  8772. *
  8773. * @private
  8774. * @param {Function} func The function to have its output memoized.
  8775. * @returns {Function} Returns the new memoized function.
  8776. */
  8777. function memoizeCapped(func) {
  8778. var result = memoize(func, function(key) {
  8779. if (cache.size === MAX_MEMOIZE_SIZE) {
  8780. cache.clear();
  8781. }
  8782. return key;
  8783. });
  8784. var cache = result.cache;
  8785. return result;
  8786. }
  8787. module.exports = memoizeCapped;
  8788. /***/ }),
  8789. /***/ "../../node_modules/lodash/_nativeCreate.js":
  8790. /*!****************************************************************!*\
  8791. !*** C:/Repos/Babylon.js/node_modules/lodash/_nativeCreate.js ***!
  8792. \****************************************************************/
  8793. /*! no static exports found */
  8794. /***/ (function(module, exports, __webpack_require__) {
  8795. var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js");
  8796. /* Built-in method references that are verified to be native. */
  8797. var nativeCreate = getNative(Object, 'create');
  8798. module.exports = nativeCreate;
  8799. /***/ }),
  8800. /***/ "../../node_modules/lodash/_nativeKeys.js":
  8801. /*!**************************************************************!*\
  8802. !*** C:/Repos/Babylon.js/node_modules/lodash/_nativeKeys.js ***!
  8803. \**************************************************************/
  8804. /*! no static exports found */
  8805. /***/ (function(module, exports, __webpack_require__) {
  8806. var overArg = __webpack_require__(/*! ./_overArg */ "../../node_modules/lodash/_overArg.js");
  8807. /* Built-in method references for those with the same name as other `lodash` methods. */
  8808. var nativeKeys = overArg(Object.keys, Object);
  8809. module.exports = nativeKeys;
  8810. /***/ }),
  8811. /***/ "../../node_modules/lodash/_nativeKeysIn.js":
  8812. /*!****************************************************************!*\
  8813. !*** C:/Repos/Babylon.js/node_modules/lodash/_nativeKeysIn.js ***!
  8814. \****************************************************************/
  8815. /*! no static exports found */
  8816. /***/ (function(module, exports) {
  8817. /**
  8818. * This function is like
  8819. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  8820. * except that it includes inherited enumerable properties.
  8821. *
  8822. * @private
  8823. * @param {Object} object The object to query.
  8824. * @returns {Array} Returns the array of property names.
  8825. */
  8826. function nativeKeysIn(object) {
  8827. var result = [];
  8828. if (object != null) {
  8829. for (var key in Object(object)) {
  8830. result.push(key);
  8831. }
  8832. }
  8833. return result;
  8834. }
  8835. module.exports = nativeKeysIn;
  8836. /***/ }),
  8837. /***/ "../../node_modules/lodash/_nodeUtil.js":
  8838. /*!************************************************************!*\
  8839. !*** C:/Repos/Babylon.js/node_modules/lodash/_nodeUtil.js ***!
  8840. \************************************************************/
  8841. /*! no static exports found */
  8842. /***/ (function(module, exports, __webpack_require__) {
  8843. /* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "../../node_modules/lodash/_freeGlobal.js");
  8844. /** Detect free variable `exports`. */
  8845. var freeExports = true && exports && !exports.nodeType && exports;
  8846. /** Detect free variable `module`. */
  8847. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  8848. /** Detect the popular CommonJS extension `module.exports`. */
  8849. var moduleExports = freeModule && freeModule.exports === freeExports;
  8850. /** Detect free variable `process` from Node.js. */
  8851. var freeProcess = moduleExports && freeGlobal.process;
  8852. /** Used to access faster Node.js helpers. */
  8853. var nodeUtil = (function() {
  8854. try {
  8855. // Use `util.types` for Node.js 10+.
  8856. var types = freeModule && freeModule.require && freeModule.require('util').types;
  8857. if (types) {
  8858. return types;
  8859. }
  8860. // Legacy `process.binding('util')` for Node.js < 10.
  8861. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  8862. } catch (e) {}
  8863. }());
  8864. module.exports = nodeUtil;
  8865. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "../../node_modules/webpack/buildin/module.js")(module)))
  8866. /***/ }),
  8867. /***/ "../../node_modules/lodash/_objectToString.js":
  8868. /*!******************************************************************!*\
  8869. !*** C:/Repos/Babylon.js/node_modules/lodash/_objectToString.js ***!
  8870. \******************************************************************/
  8871. /*! no static exports found */
  8872. /***/ (function(module, exports) {
  8873. /** Used for built-in method references. */
  8874. var objectProto = Object.prototype;
  8875. /**
  8876. * Used to resolve the
  8877. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  8878. * of values.
  8879. */
  8880. var nativeObjectToString = objectProto.toString;
  8881. /**
  8882. * Converts `value` to a string using `Object.prototype.toString`.
  8883. *
  8884. * @private
  8885. * @param {*} value The value to convert.
  8886. * @returns {string} Returns the converted string.
  8887. */
  8888. function objectToString(value) {
  8889. return nativeObjectToString.call(value);
  8890. }
  8891. module.exports = objectToString;
  8892. /***/ }),
  8893. /***/ "../../node_modules/lodash/_overArg.js":
  8894. /*!***********************************************************!*\
  8895. !*** C:/Repos/Babylon.js/node_modules/lodash/_overArg.js ***!
  8896. \***********************************************************/
  8897. /*! no static exports found */
  8898. /***/ (function(module, exports) {
  8899. /**
  8900. * Creates a unary function that invokes `func` with its argument transformed.
  8901. *
  8902. * @private
  8903. * @param {Function} func The function to wrap.
  8904. * @param {Function} transform The argument transform.
  8905. * @returns {Function} Returns the new function.
  8906. */
  8907. function overArg(func, transform) {
  8908. return function(arg) {
  8909. return func(transform(arg));
  8910. };
  8911. }
  8912. module.exports = overArg;
  8913. /***/ }),
  8914. /***/ "../../node_modules/lodash/_overRest.js":
  8915. /*!************************************************************!*\
  8916. !*** C:/Repos/Babylon.js/node_modules/lodash/_overRest.js ***!
  8917. \************************************************************/
  8918. /*! no static exports found */
  8919. /***/ (function(module, exports, __webpack_require__) {
  8920. var apply = __webpack_require__(/*! ./_apply */ "../../node_modules/lodash/_apply.js");
  8921. /* Built-in method references for those with the same name as other `lodash` methods. */
  8922. var nativeMax = Math.max;
  8923. /**
  8924. * A specialized version of `baseRest` which transforms the rest array.
  8925. *
  8926. * @private
  8927. * @param {Function} func The function to apply a rest parameter to.
  8928. * @param {number} [start=func.length-1] The start position of the rest parameter.
  8929. * @param {Function} transform The rest array transform.
  8930. * @returns {Function} Returns the new function.
  8931. */
  8932. function overRest(func, start, transform) {
  8933. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  8934. return function() {
  8935. var args = arguments,
  8936. index = -1,
  8937. length = nativeMax(args.length - start, 0),
  8938. array = Array(length);
  8939. while (++index < length) {
  8940. array[index] = args[start + index];
  8941. }
  8942. index = -1;
  8943. var otherArgs = Array(start + 1);
  8944. while (++index < start) {
  8945. otherArgs[index] = args[index];
  8946. }
  8947. otherArgs[start] = transform(array);
  8948. return apply(func, this, otherArgs);
  8949. };
  8950. }
  8951. module.exports = overRest;
  8952. /***/ }),
  8953. /***/ "../../node_modules/lodash/_root.js":
  8954. /*!********************************************************!*\
  8955. !*** C:/Repos/Babylon.js/node_modules/lodash/_root.js ***!
  8956. \********************************************************/
  8957. /*! no static exports found */
  8958. /***/ (function(module, exports, __webpack_require__) {
  8959. var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "../../node_modules/lodash/_freeGlobal.js");
  8960. /** Detect free variable `self`. */
  8961. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  8962. /** Used as a reference to the global object. */
  8963. var root = freeGlobal || freeSelf || Function('return this')();
  8964. module.exports = root;
  8965. /***/ }),
  8966. /***/ "../../node_modules/lodash/_safeGet.js":
  8967. /*!***********************************************************!*\
  8968. !*** C:/Repos/Babylon.js/node_modules/lodash/_safeGet.js ***!
  8969. \***********************************************************/
  8970. /*! no static exports found */
  8971. /***/ (function(module, exports) {
  8972. /**
  8973. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  8974. *
  8975. * @private
  8976. * @param {Object} object The object to query.
  8977. * @param {string} key The key of the property to get.
  8978. * @returns {*} Returns the property value.
  8979. */
  8980. function safeGet(object, key) {
  8981. if (key === 'constructor' && typeof object[key] === 'function') {
  8982. return;
  8983. }
  8984. if (key == '__proto__') {
  8985. return;
  8986. }
  8987. return object[key];
  8988. }
  8989. module.exports = safeGet;
  8990. /***/ }),
  8991. /***/ "../../node_modules/lodash/_setCacheAdd.js":
  8992. /*!***************************************************************!*\
  8993. !*** C:/Repos/Babylon.js/node_modules/lodash/_setCacheAdd.js ***!
  8994. \***************************************************************/
  8995. /*! no static exports found */
  8996. /***/ (function(module, exports) {
  8997. /** Used to stand-in for `undefined` hash values. */
  8998. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  8999. /**
  9000. * Adds `value` to the array cache.
  9001. *
  9002. * @private
  9003. * @name add
  9004. * @memberOf SetCache
  9005. * @alias push
  9006. * @param {*} value The value to cache.
  9007. * @returns {Object} Returns the cache instance.
  9008. */
  9009. function setCacheAdd(value) {
  9010. this.__data__.set(value, HASH_UNDEFINED);
  9011. return this;
  9012. }
  9013. module.exports = setCacheAdd;
  9014. /***/ }),
  9015. /***/ "../../node_modules/lodash/_setCacheHas.js":
  9016. /*!***************************************************************!*\
  9017. !*** C:/Repos/Babylon.js/node_modules/lodash/_setCacheHas.js ***!
  9018. \***************************************************************/
  9019. /*! no static exports found */
  9020. /***/ (function(module, exports) {
  9021. /**
  9022. * Checks if `value` is in the array cache.
  9023. *
  9024. * @private
  9025. * @name has
  9026. * @memberOf SetCache
  9027. * @param {*} value The value to search for.
  9028. * @returns {number} Returns `true` if `value` is found, else `false`.
  9029. */
  9030. function setCacheHas(value) {
  9031. return this.__data__.has(value);
  9032. }
  9033. module.exports = setCacheHas;
  9034. /***/ }),
  9035. /***/ "../../node_modules/lodash/_setToArray.js":
  9036. /*!**************************************************************!*\
  9037. !*** C:/Repos/Babylon.js/node_modules/lodash/_setToArray.js ***!
  9038. \**************************************************************/
  9039. /*! no static exports found */
  9040. /***/ (function(module, exports) {
  9041. /**
  9042. * Converts `set` to an array of its values.
  9043. *
  9044. * @private
  9045. * @param {Object} set The set to convert.
  9046. * @returns {Array} Returns the values.
  9047. */
  9048. function setToArray(set) {
  9049. var index = -1,
  9050. result = Array(set.size);
  9051. set.forEach(function(value) {
  9052. result[++index] = value;
  9053. });
  9054. return result;
  9055. }
  9056. module.exports = setToArray;
  9057. /***/ }),
  9058. /***/ "../../node_modules/lodash/_setToString.js":
  9059. /*!***************************************************************!*\
  9060. !*** C:/Repos/Babylon.js/node_modules/lodash/_setToString.js ***!
  9061. \***************************************************************/
  9062. /*! no static exports found */
  9063. /***/ (function(module, exports, __webpack_require__) {
  9064. var baseSetToString = __webpack_require__(/*! ./_baseSetToString */ "../../node_modules/lodash/_baseSetToString.js"),
  9065. shortOut = __webpack_require__(/*! ./_shortOut */ "../../node_modules/lodash/_shortOut.js");
  9066. /**
  9067. * Sets the `toString` method of `func` to return `string`.
  9068. *
  9069. * @private
  9070. * @param {Function} func The function to modify.
  9071. * @param {Function} string The `toString` result.
  9072. * @returns {Function} Returns `func`.
  9073. */
  9074. var setToString = shortOut(baseSetToString);
  9075. module.exports = setToString;
  9076. /***/ }),
  9077. /***/ "../../node_modules/lodash/_shortOut.js":
  9078. /*!************************************************************!*\
  9079. !*** C:/Repos/Babylon.js/node_modules/lodash/_shortOut.js ***!
  9080. \************************************************************/
  9081. /*! no static exports found */
  9082. /***/ (function(module, exports) {
  9083. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  9084. var HOT_COUNT = 800,
  9085. HOT_SPAN = 16;
  9086. /* Built-in method references for those with the same name as other `lodash` methods. */
  9087. var nativeNow = Date.now;
  9088. /**
  9089. * Creates a function that'll short out and invoke `identity` instead
  9090. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  9091. * milliseconds.
  9092. *
  9093. * @private
  9094. * @param {Function} func The function to restrict.
  9095. * @returns {Function} Returns the new shortable function.
  9096. */
  9097. function shortOut(func) {
  9098. var count = 0,
  9099. lastCalled = 0;
  9100. return function() {
  9101. var stamp = nativeNow(),
  9102. remaining = HOT_SPAN - (stamp - lastCalled);
  9103. lastCalled = stamp;
  9104. if (remaining > 0) {
  9105. if (++count >= HOT_COUNT) {
  9106. return arguments[0];
  9107. }
  9108. } else {
  9109. count = 0;
  9110. }
  9111. return func.apply(undefined, arguments);
  9112. };
  9113. }
  9114. module.exports = shortOut;
  9115. /***/ }),
  9116. /***/ "../../node_modules/lodash/_stackClear.js":
  9117. /*!**************************************************************!*\
  9118. !*** C:/Repos/Babylon.js/node_modules/lodash/_stackClear.js ***!
  9119. \**************************************************************/
  9120. /*! no static exports found */
  9121. /***/ (function(module, exports, __webpack_require__) {
  9122. var ListCache = __webpack_require__(/*! ./_ListCache */ "../../node_modules/lodash/_ListCache.js");
  9123. /**
  9124. * Removes all key-value entries from the stack.
  9125. *
  9126. * @private
  9127. * @name clear
  9128. * @memberOf Stack
  9129. */
  9130. function stackClear() {
  9131. this.__data__ = new ListCache;
  9132. this.size = 0;
  9133. }
  9134. module.exports = stackClear;
  9135. /***/ }),
  9136. /***/ "../../node_modules/lodash/_stackDelete.js":
  9137. /*!***************************************************************!*\
  9138. !*** C:/Repos/Babylon.js/node_modules/lodash/_stackDelete.js ***!
  9139. \***************************************************************/
  9140. /*! no static exports found */
  9141. /***/ (function(module, exports) {
  9142. /**
  9143. * Removes `key` and its value from the stack.
  9144. *
  9145. * @private
  9146. * @name delete
  9147. * @memberOf Stack
  9148. * @param {string} key The key of the value to remove.
  9149. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9150. */
  9151. function stackDelete(key) {
  9152. var data = this.__data__,
  9153. result = data['delete'](key);
  9154. this.size = data.size;
  9155. return result;
  9156. }
  9157. module.exports = stackDelete;
  9158. /***/ }),
  9159. /***/ "../../node_modules/lodash/_stackGet.js":
  9160. /*!************************************************************!*\
  9161. !*** C:/Repos/Babylon.js/node_modules/lodash/_stackGet.js ***!
  9162. \************************************************************/
  9163. /*! no static exports found */
  9164. /***/ (function(module, exports) {
  9165. /**
  9166. * Gets the stack value for `key`.
  9167. *
  9168. * @private
  9169. * @name get
  9170. * @memberOf Stack
  9171. * @param {string} key The key of the value to get.
  9172. * @returns {*} Returns the entry value.
  9173. */
  9174. function stackGet(key) {
  9175. return this.__data__.get(key);
  9176. }
  9177. module.exports = stackGet;
  9178. /***/ }),
  9179. /***/ "../../node_modules/lodash/_stackHas.js":
  9180. /*!************************************************************!*\
  9181. !*** C:/Repos/Babylon.js/node_modules/lodash/_stackHas.js ***!
  9182. \************************************************************/
  9183. /*! no static exports found */
  9184. /***/ (function(module, exports) {
  9185. /**
  9186. * Checks if a stack value for `key` exists.
  9187. *
  9188. * @private
  9189. * @name has
  9190. * @memberOf Stack
  9191. * @param {string} key The key of the entry to check.
  9192. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9193. */
  9194. function stackHas(key) {
  9195. return this.__data__.has(key);
  9196. }
  9197. module.exports = stackHas;
  9198. /***/ }),
  9199. /***/ "../../node_modules/lodash/_stackSet.js":
  9200. /*!************************************************************!*\
  9201. !*** C:/Repos/Babylon.js/node_modules/lodash/_stackSet.js ***!
  9202. \************************************************************/
  9203. /*! no static exports found */
  9204. /***/ (function(module, exports, __webpack_require__) {
  9205. var ListCache = __webpack_require__(/*! ./_ListCache */ "../../node_modules/lodash/_ListCache.js"),
  9206. Map = __webpack_require__(/*! ./_Map */ "../../node_modules/lodash/_Map.js"),
  9207. MapCache = __webpack_require__(/*! ./_MapCache */ "../../node_modules/lodash/_MapCache.js");
  9208. /** Used as the size to enable large array optimizations. */
  9209. var LARGE_ARRAY_SIZE = 200;
  9210. /**
  9211. * Sets the stack `key` to `value`.
  9212. *
  9213. * @private
  9214. * @name set
  9215. * @memberOf Stack
  9216. * @param {string} key The key of the value to set.
  9217. * @param {*} value The value to set.
  9218. * @returns {Object} Returns the stack cache instance.
  9219. */
  9220. function stackSet(key, value) {
  9221. var data = this.__data__;
  9222. if (data instanceof ListCache) {
  9223. var pairs = data.__data__;
  9224. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  9225. pairs.push([key, value]);
  9226. this.size = ++data.size;
  9227. return this;
  9228. }
  9229. data = this.__data__ = new MapCache(pairs);
  9230. }
  9231. data.set(key, value);
  9232. this.size = data.size;
  9233. return this;
  9234. }
  9235. module.exports = stackSet;
  9236. /***/ }),
  9237. /***/ "../../node_modules/lodash/_strictIndexOf.js":
  9238. /*!*****************************************************************!*\
  9239. !*** C:/Repos/Babylon.js/node_modules/lodash/_strictIndexOf.js ***!
  9240. \*****************************************************************/
  9241. /*! no static exports found */
  9242. /***/ (function(module, exports) {
  9243. /**
  9244. * A specialized version of `_.indexOf` which performs strict equality
  9245. * comparisons of values, i.e. `===`.
  9246. *
  9247. * @private
  9248. * @param {Array} array The array to inspect.
  9249. * @param {*} value The value to search for.
  9250. * @param {number} fromIndex The index to search from.
  9251. * @returns {number} Returns the index of the matched value, else `-1`.
  9252. */
  9253. function strictIndexOf(array, value, fromIndex) {
  9254. var index = fromIndex - 1,
  9255. length = array.length;
  9256. while (++index < length) {
  9257. if (array[index] === value) {
  9258. return index;
  9259. }
  9260. }
  9261. return -1;
  9262. }
  9263. module.exports = strictIndexOf;
  9264. /***/ }),
  9265. /***/ "../../node_modules/lodash/_stringSize.js":
  9266. /*!**************************************************************!*\
  9267. !*** C:/Repos/Babylon.js/node_modules/lodash/_stringSize.js ***!
  9268. \**************************************************************/
  9269. /*! no static exports found */
  9270. /***/ (function(module, exports, __webpack_require__) {
  9271. var asciiSize = __webpack_require__(/*! ./_asciiSize */ "../../node_modules/lodash/_asciiSize.js"),
  9272. hasUnicode = __webpack_require__(/*! ./_hasUnicode */ "../../node_modules/lodash/_hasUnicode.js"),
  9273. unicodeSize = __webpack_require__(/*! ./_unicodeSize */ "../../node_modules/lodash/_unicodeSize.js");
  9274. /**
  9275. * Gets the number of symbols in `string`.
  9276. *
  9277. * @private
  9278. * @param {string} string The string to inspect.
  9279. * @returns {number} Returns the string size.
  9280. */
  9281. function stringSize(string) {
  9282. return hasUnicode(string)
  9283. ? unicodeSize(string)
  9284. : asciiSize(string);
  9285. }
  9286. module.exports = stringSize;
  9287. /***/ }),
  9288. /***/ "../../node_modules/lodash/_stringToPath.js":
  9289. /*!****************************************************************!*\
  9290. !*** C:/Repos/Babylon.js/node_modules/lodash/_stringToPath.js ***!
  9291. \****************************************************************/
  9292. /*! no static exports found */
  9293. /***/ (function(module, exports, __webpack_require__) {
  9294. var memoizeCapped = __webpack_require__(/*! ./_memoizeCapped */ "../../node_modules/lodash/_memoizeCapped.js");
  9295. /** Used to match property names within property paths. */
  9296. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  9297. /** Used to match backslashes in property paths. */
  9298. var reEscapeChar = /\\(\\)?/g;
  9299. /**
  9300. * Converts `string` to a property path array.
  9301. *
  9302. * @private
  9303. * @param {string} string The string to convert.
  9304. * @returns {Array} Returns the property path array.
  9305. */
  9306. var stringToPath = memoizeCapped(function(string) {
  9307. var result = [];
  9308. if (string.charCodeAt(0) === 46 /* . */) {
  9309. result.push('');
  9310. }
  9311. string.replace(rePropName, function(match, number, quote, subString) {
  9312. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  9313. });
  9314. return result;
  9315. });
  9316. module.exports = stringToPath;
  9317. /***/ }),
  9318. /***/ "../../node_modules/lodash/_toKey.js":
  9319. /*!*********************************************************!*\
  9320. !*** C:/Repos/Babylon.js/node_modules/lodash/_toKey.js ***!
  9321. \*********************************************************/
  9322. /*! no static exports found */
  9323. /***/ (function(module, exports, __webpack_require__) {
  9324. var isSymbol = __webpack_require__(/*! ./isSymbol */ "../../node_modules/lodash/isSymbol.js");
  9325. /** Used as references for various `Number` constants. */
  9326. var INFINITY = 1 / 0;
  9327. /**
  9328. * Converts `value` to a string key if it's not a string or symbol.
  9329. *
  9330. * @private
  9331. * @param {*} value The value to inspect.
  9332. * @returns {string|symbol} Returns the key.
  9333. */
  9334. function toKey(value) {
  9335. if (typeof value == 'string' || isSymbol(value)) {
  9336. return value;
  9337. }
  9338. var result = (value + '');
  9339. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  9340. }
  9341. module.exports = toKey;
  9342. /***/ }),
  9343. /***/ "../../node_modules/lodash/_toSource.js":
  9344. /*!************************************************************!*\
  9345. !*** C:/Repos/Babylon.js/node_modules/lodash/_toSource.js ***!
  9346. \************************************************************/
  9347. /*! no static exports found */
  9348. /***/ (function(module, exports) {
  9349. /** Used for built-in method references. */
  9350. var funcProto = Function.prototype;
  9351. /** Used to resolve the decompiled source of functions. */
  9352. var funcToString = funcProto.toString;
  9353. /**
  9354. * Converts `func` to its source code.
  9355. *
  9356. * @private
  9357. * @param {Function} func The function to convert.
  9358. * @returns {string} Returns the source code.
  9359. */
  9360. function toSource(func) {
  9361. if (func != null) {
  9362. try {
  9363. return funcToString.call(func);
  9364. } catch (e) {}
  9365. try {
  9366. return (func + '');
  9367. } catch (e) {}
  9368. }
  9369. return '';
  9370. }
  9371. module.exports = toSource;
  9372. /***/ }),
  9373. /***/ "../../node_modules/lodash/_unicodeSize.js":
  9374. /*!***************************************************************!*\
  9375. !*** C:/Repos/Babylon.js/node_modules/lodash/_unicodeSize.js ***!
  9376. \***************************************************************/
  9377. /*! no static exports found */
  9378. /***/ (function(module, exports) {
  9379. /** Used to compose unicode character classes. */
  9380. var rsAstralRange = '\\ud800-\\udfff',
  9381. rsComboMarksRange = '\\u0300-\\u036f',
  9382. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  9383. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  9384. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  9385. rsVarRange = '\\ufe0e\\ufe0f';
  9386. /** Used to compose unicode capture groups. */
  9387. var rsAstral = '[' + rsAstralRange + ']',
  9388. rsCombo = '[' + rsComboRange + ']',
  9389. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  9390. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  9391. rsNonAstral = '[^' + rsAstralRange + ']',
  9392. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  9393. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  9394. rsZWJ = '\\u200d';
  9395. /** Used to compose unicode regexes. */
  9396. var reOptMod = rsModifier + '?',
  9397. rsOptVar = '[' + rsVarRange + ']?',
  9398. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  9399. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  9400. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  9401. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  9402. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  9403. /**
  9404. * Gets the size of a Unicode `string`.
  9405. *
  9406. * @private
  9407. * @param {string} string The string inspect.
  9408. * @returns {number} Returns the string size.
  9409. */
  9410. function unicodeSize(string) {
  9411. var result = reUnicode.lastIndex = 0;
  9412. while (reUnicode.test(string)) {
  9413. ++result;
  9414. }
  9415. return result;
  9416. }
  9417. module.exports = unicodeSize;
  9418. /***/ }),
  9419. /***/ "../../node_modules/lodash/clone.js":
  9420. /*!********************************************************!*\
  9421. !*** C:/Repos/Babylon.js/node_modules/lodash/clone.js ***!
  9422. \********************************************************/
  9423. /*! no static exports found */
  9424. /***/ (function(module, exports, __webpack_require__) {
  9425. var baseClone = __webpack_require__(/*! ./_baseClone */ "../../node_modules/lodash/_baseClone.js");
  9426. /** Used to compose bitmasks for cloning. */
  9427. var CLONE_SYMBOLS_FLAG = 4;
  9428. /**
  9429. * Creates a shallow clone of `value`.
  9430. *
  9431. * **Note:** This method is loosely based on the
  9432. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  9433. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  9434. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  9435. * arrays. The own enumerable properties of `arguments` objects are cloned
  9436. * as plain objects. An empty object is returned for uncloneable values such
  9437. * as error objects, functions, DOM nodes, and WeakMaps.
  9438. *
  9439. * @static
  9440. * @memberOf _
  9441. * @since 0.1.0
  9442. * @category Lang
  9443. * @param {*} value The value to clone.
  9444. * @returns {*} Returns the cloned value.
  9445. * @see _.cloneDeep
  9446. * @example
  9447. *
  9448. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  9449. *
  9450. * var shallow = _.clone(objects);
  9451. * console.log(shallow[0] === objects[0]);
  9452. * // => true
  9453. */
  9454. function clone(value) {
  9455. return baseClone(value, CLONE_SYMBOLS_FLAG);
  9456. }
  9457. module.exports = clone;
  9458. /***/ }),
  9459. /***/ "../../node_modules/lodash/cloneDeep.js":
  9460. /*!************************************************************!*\
  9461. !*** C:/Repos/Babylon.js/node_modules/lodash/cloneDeep.js ***!
  9462. \************************************************************/
  9463. /*! no static exports found */
  9464. /***/ (function(module, exports, __webpack_require__) {
  9465. var baseClone = __webpack_require__(/*! ./_baseClone */ "../../node_modules/lodash/_baseClone.js");
  9466. /** Used to compose bitmasks for cloning. */
  9467. var CLONE_DEEP_FLAG = 1,
  9468. CLONE_SYMBOLS_FLAG = 4;
  9469. /**
  9470. * This method is like `_.clone` except that it recursively clones `value`.
  9471. *
  9472. * @static
  9473. * @memberOf _
  9474. * @since 1.0.0
  9475. * @category Lang
  9476. * @param {*} value The value to recursively clone.
  9477. * @returns {*} Returns the deep cloned value.
  9478. * @see _.clone
  9479. * @example
  9480. *
  9481. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  9482. *
  9483. * var deep = _.cloneDeep(objects);
  9484. * console.log(deep[0] === objects[0]);
  9485. * // => false
  9486. */
  9487. function cloneDeep(value) {
  9488. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  9489. }
  9490. module.exports = cloneDeep;
  9491. /***/ }),
  9492. /***/ "../../node_modules/lodash/constant.js":
  9493. /*!***********************************************************!*\
  9494. !*** C:/Repos/Babylon.js/node_modules/lodash/constant.js ***!
  9495. \***********************************************************/
  9496. /*! no static exports found */
  9497. /***/ (function(module, exports) {
  9498. /**
  9499. * Creates a function that returns `value`.
  9500. *
  9501. * @static
  9502. * @memberOf _
  9503. * @since 2.4.0
  9504. * @category Util
  9505. * @param {*} value The value to return from the new function.
  9506. * @returns {Function} Returns the new constant function.
  9507. * @example
  9508. *
  9509. * var objects = _.times(2, _.constant({ 'a': 1 }));
  9510. *
  9511. * console.log(objects);
  9512. * // => [{ 'a': 1 }, { 'a': 1 }]
  9513. *
  9514. * console.log(objects[0] === objects[1]);
  9515. * // => true
  9516. */
  9517. function constant(value) {
  9518. return function() {
  9519. return value;
  9520. };
  9521. }
  9522. module.exports = constant;
  9523. /***/ }),
  9524. /***/ "../../node_modules/lodash/defaults.js":
  9525. /*!***********************************************************!*\
  9526. !*** C:/Repos/Babylon.js/node_modules/lodash/defaults.js ***!
  9527. \***********************************************************/
  9528. /*! no static exports found */
  9529. /***/ (function(module, exports, __webpack_require__) {
  9530. var baseRest = __webpack_require__(/*! ./_baseRest */ "../../node_modules/lodash/_baseRest.js"),
  9531. eq = __webpack_require__(/*! ./eq */ "../../node_modules/lodash/eq.js"),
  9532. isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "../../node_modules/lodash/_isIterateeCall.js"),
  9533. keysIn = __webpack_require__(/*! ./keysIn */ "../../node_modules/lodash/keysIn.js");
  9534. /** Used for built-in method references. */
  9535. var objectProto = Object.prototype;
  9536. /** Used to check objects for own properties. */
  9537. var hasOwnProperty = objectProto.hasOwnProperty;
  9538. /**
  9539. * Assigns own and inherited enumerable string keyed properties of source
  9540. * objects to the destination object for all destination properties that
  9541. * resolve to `undefined`. Source objects are applied from left to right.
  9542. * Once a property is set, additional values of the same property are ignored.
  9543. *
  9544. * **Note:** This method mutates `object`.
  9545. *
  9546. * @static
  9547. * @since 0.1.0
  9548. * @memberOf _
  9549. * @category Object
  9550. * @param {Object} object The destination object.
  9551. * @param {...Object} [sources] The source objects.
  9552. * @returns {Object} Returns `object`.
  9553. * @see _.defaultsDeep
  9554. * @example
  9555. *
  9556. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  9557. * // => { 'a': 1, 'b': 2 }
  9558. */
  9559. var defaults = baseRest(function(object, sources) {
  9560. object = Object(object);
  9561. var index = -1;
  9562. var length = sources.length;
  9563. var guard = length > 2 ? sources[2] : undefined;
  9564. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  9565. length = 1;
  9566. }
  9567. while (++index < length) {
  9568. var source = sources[index];
  9569. var props = keysIn(source);
  9570. var propsIndex = -1;
  9571. var propsLength = props.length;
  9572. while (++propsIndex < propsLength) {
  9573. var key = props[propsIndex];
  9574. var value = object[key];
  9575. if (value === undefined ||
  9576. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  9577. object[key] = source[key];
  9578. }
  9579. }
  9580. }
  9581. return object;
  9582. });
  9583. module.exports = defaults;
  9584. /***/ }),
  9585. /***/ "../../node_modules/lodash/each.js":
  9586. /*!*******************************************************!*\
  9587. !*** C:/Repos/Babylon.js/node_modules/lodash/each.js ***!
  9588. \*******************************************************/
  9589. /*! no static exports found */
  9590. /***/ (function(module, exports, __webpack_require__) {
  9591. module.exports = __webpack_require__(/*! ./forEach */ "../../node_modules/lodash/forEach.js");
  9592. /***/ }),
  9593. /***/ "../../node_modules/lodash/eq.js":
  9594. /*!*****************************************************!*\
  9595. !*** C:/Repos/Babylon.js/node_modules/lodash/eq.js ***!
  9596. \*****************************************************/
  9597. /*! no static exports found */
  9598. /***/ (function(module, exports) {
  9599. /**
  9600. * Performs a
  9601. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9602. * comparison between two values to determine if they are equivalent.
  9603. *
  9604. * @static
  9605. * @memberOf _
  9606. * @since 4.0.0
  9607. * @category Lang
  9608. * @param {*} value The value to compare.
  9609. * @param {*} other The other value to compare.
  9610. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  9611. * @example
  9612. *
  9613. * var object = { 'a': 1 };
  9614. * var other = { 'a': 1 };
  9615. *
  9616. * _.eq(object, object);
  9617. * // => true
  9618. *
  9619. * _.eq(object, other);
  9620. * // => false
  9621. *
  9622. * _.eq('a', 'a');
  9623. * // => true
  9624. *
  9625. * _.eq('a', Object('a'));
  9626. * // => false
  9627. *
  9628. * _.eq(NaN, NaN);
  9629. * // => true
  9630. */
  9631. function eq(value, other) {
  9632. return value === other || (value !== value && other !== other);
  9633. }
  9634. module.exports = eq;
  9635. /***/ }),
  9636. /***/ "../../node_modules/lodash/filter.js":
  9637. /*!*********************************************************!*\
  9638. !*** C:/Repos/Babylon.js/node_modules/lodash/filter.js ***!
  9639. \*********************************************************/
  9640. /*! no static exports found */
  9641. /***/ (function(module, exports, __webpack_require__) {
  9642. var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "../../node_modules/lodash/_arrayFilter.js"),
  9643. baseFilter = __webpack_require__(/*! ./_baseFilter */ "../../node_modules/lodash/_baseFilter.js"),
  9644. baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "../../node_modules/lodash/_baseIteratee.js"),
  9645. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js");
  9646. /**
  9647. * Iterates over elements of `collection`, returning an array of all elements
  9648. * `predicate` returns truthy for. The predicate is invoked with three
  9649. * arguments: (value, index|key, collection).
  9650. *
  9651. * **Note:** Unlike `_.remove`, this method returns a new array.
  9652. *
  9653. * @static
  9654. * @memberOf _
  9655. * @since 0.1.0
  9656. * @category Collection
  9657. * @param {Array|Object} collection The collection to iterate over.
  9658. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9659. * @returns {Array} Returns the new filtered array.
  9660. * @see _.reject
  9661. * @example
  9662. *
  9663. * var users = [
  9664. * { 'user': 'barney', 'age': 36, 'active': true },
  9665. * { 'user': 'fred', 'age': 40, 'active': false }
  9666. * ];
  9667. *
  9668. * _.filter(users, function(o) { return !o.active; });
  9669. * // => objects for ['fred']
  9670. *
  9671. * // The `_.matches` iteratee shorthand.
  9672. * _.filter(users, { 'age': 36, 'active': true });
  9673. * // => objects for ['barney']
  9674. *
  9675. * // The `_.matchesProperty` iteratee shorthand.
  9676. * _.filter(users, ['active', false]);
  9677. * // => objects for ['fred']
  9678. *
  9679. * // The `_.property` iteratee shorthand.
  9680. * _.filter(users, 'active');
  9681. * // => objects for ['barney']
  9682. *
  9683. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9684. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9685. * // => objects for ['fred', 'barney']
  9686. */
  9687. function filter(collection, predicate) {
  9688. var func = isArray(collection) ? arrayFilter : baseFilter;
  9689. return func(collection, baseIteratee(predicate, 3));
  9690. }
  9691. module.exports = filter;
  9692. /***/ }),
  9693. /***/ "../../node_modules/lodash/find.js":
  9694. /*!*******************************************************!*\
  9695. !*** C:/Repos/Babylon.js/node_modules/lodash/find.js ***!
  9696. \*******************************************************/
  9697. /*! no static exports found */
  9698. /***/ (function(module, exports, __webpack_require__) {
  9699. var createFind = __webpack_require__(/*! ./_createFind */ "../../node_modules/lodash/_createFind.js"),
  9700. findIndex = __webpack_require__(/*! ./findIndex */ "../../node_modules/lodash/findIndex.js");
  9701. /**
  9702. * Iterates over elements of `collection`, returning the first element
  9703. * `predicate` returns truthy for. The predicate is invoked with three
  9704. * arguments: (value, index|key, collection).
  9705. *
  9706. * @static
  9707. * @memberOf _
  9708. * @since 0.1.0
  9709. * @category Collection
  9710. * @param {Array|Object} collection The collection to inspect.
  9711. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9712. * @param {number} [fromIndex=0] The index to search from.
  9713. * @returns {*} Returns the matched element, else `undefined`.
  9714. * @example
  9715. *
  9716. * var users = [
  9717. * { 'user': 'barney', 'age': 36, 'active': true },
  9718. * { 'user': 'fred', 'age': 40, 'active': false },
  9719. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9720. * ];
  9721. *
  9722. * _.find(users, function(o) { return o.age < 40; });
  9723. * // => object for 'barney'
  9724. *
  9725. * // The `_.matches` iteratee shorthand.
  9726. * _.find(users, { 'age': 1, 'active': true });
  9727. * // => object for 'pebbles'
  9728. *
  9729. * // The `_.matchesProperty` iteratee shorthand.
  9730. * _.find(users, ['active', false]);
  9731. * // => object for 'fred'
  9732. *
  9733. * // The `_.property` iteratee shorthand.
  9734. * _.find(users, 'active');
  9735. * // => object for 'barney'
  9736. */
  9737. var find = createFind(findIndex);
  9738. module.exports = find;
  9739. /***/ }),
  9740. /***/ "../../node_modules/lodash/findIndex.js":
  9741. /*!************************************************************!*\
  9742. !*** C:/Repos/Babylon.js/node_modules/lodash/findIndex.js ***!
  9743. \************************************************************/
  9744. /*! no static exports found */
  9745. /***/ (function(module, exports, __webpack_require__) {
  9746. var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "../../node_modules/lodash/_baseFindIndex.js"),
  9747. baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "../../node_modules/lodash/_baseIteratee.js"),
  9748. toInteger = __webpack_require__(/*! ./toInteger */ "../../node_modules/lodash/toInteger.js");
  9749. /* Built-in method references for those with the same name as other `lodash` methods. */
  9750. var nativeMax = Math.max;
  9751. /**
  9752. * This method is like `_.find` except that it returns the index of the first
  9753. * element `predicate` returns truthy for instead of the element itself.
  9754. *
  9755. * @static
  9756. * @memberOf _
  9757. * @since 1.1.0
  9758. * @category Array
  9759. * @param {Array} array The array to inspect.
  9760. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9761. * @param {number} [fromIndex=0] The index to search from.
  9762. * @returns {number} Returns the index of the found element, else `-1`.
  9763. * @example
  9764. *
  9765. * var users = [
  9766. * { 'user': 'barney', 'active': false },
  9767. * { 'user': 'fred', 'active': false },
  9768. * { 'user': 'pebbles', 'active': true }
  9769. * ];
  9770. *
  9771. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  9772. * // => 0
  9773. *
  9774. * // The `_.matches` iteratee shorthand.
  9775. * _.findIndex(users, { 'user': 'fred', 'active': false });
  9776. * // => 1
  9777. *
  9778. * // The `_.matchesProperty` iteratee shorthand.
  9779. * _.findIndex(users, ['active', false]);
  9780. * // => 0
  9781. *
  9782. * // The `_.property` iteratee shorthand.
  9783. * _.findIndex(users, 'active');
  9784. * // => 2
  9785. */
  9786. function findIndex(array, predicate, fromIndex) {
  9787. var length = array == null ? 0 : array.length;
  9788. if (!length) {
  9789. return -1;
  9790. }
  9791. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  9792. if (index < 0) {
  9793. index = nativeMax(length + index, 0);
  9794. }
  9795. return baseFindIndex(array, baseIteratee(predicate, 3), index);
  9796. }
  9797. module.exports = findIndex;
  9798. /***/ }),
  9799. /***/ "../../node_modules/lodash/flatten.js":
  9800. /*!**********************************************************!*\
  9801. !*** C:/Repos/Babylon.js/node_modules/lodash/flatten.js ***!
  9802. \**********************************************************/
  9803. /*! no static exports found */
  9804. /***/ (function(module, exports, __webpack_require__) {
  9805. var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "../../node_modules/lodash/_baseFlatten.js");
  9806. /**
  9807. * Flattens `array` a single level deep.
  9808. *
  9809. * @static
  9810. * @memberOf _
  9811. * @since 0.1.0
  9812. * @category Array
  9813. * @param {Array} array The array to flatten.
  9814. * @returns {Array} Returns the new flattened array.
  9815. * @example
  9816. *
  9817. * _.flatten([1, [2, [3, [4]], 5]]);
  9818. * // => [1, 2, [3, [4]], 5]
  9819. */
  9820. function flatten(array) {
  9821. var length = array == null ? 0 : array.length;
  9822. return length ? baseFlatten(array, 1) : [];
  9823. }
  9824. module.exports = flatten;
  9825. /***/ }),
  9826. /***/ "../../node_modules/lodash/forEach.js":
  9827. /*!**********************************************************!*\
  9828. !*** C:/Repos/Babylon.js/node_modules/lodash/forEach.js ***!
  9829. \**********************************************************/
  9830. /*! no static exports found */
  9831. /***/ (function(module, exports, __webpack_require__) {
  9832. var arrayEach = __webpack_require__(/*! ./_arrayEach */ "../../node_modules/lodash/_arrayEach.js"),
  9833. baseEach = __webpack_require__(/*! ./_baseEach */ "../../node_modules/lodash/_baseEach.js"),
  9834. castFunction = __webpack_require__(/*! ./_castFunction */ "../../node_modules/lodash/_castFunction.js"),
  9835. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js");
  9836. /**
  9837. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9838. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9839. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9840. *
  9841. * **Note:** As with other "Collections" methods, objects with a "length"
  9842. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9843. * or `_.forOwn` for object iteration.
  9844. *
  9845. * @static
  9846. * @memberOf _
  9847. * @since 0.1.0
  9848. * @alias each
  9849. * @category Collection
  9850. * @param {Array|Object} collection The collection to iterate over.
  9851. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9852. * @returns {Array|Object} Returns `collection`.
  9853. * @see _.forEachRight
  9854. * @example
  9855. *
  9856. * _.forEach([1, 2], function(value) {
  9857. * console.log(value);
  9858. * });
  9859. * // => Logs `1` then `2`.
  9860. *
  9861. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9862. * console.log(key);
  9863. * });
  9864. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9865. */
  9866. function forEach(collection, iteratee) {
  9867. var func = isArray(collection) ? arrayEach : baseEach;
  9868. return func(collection, castFunction(iteratee));
  9869. }
  9870. module.exports = forEach;
  9871. /***/ }),
  9872. /***/ "../../node_modules/lodash/forIn.js":
  9873. /*!********************************************************!*\
  9874. !*** C:/Repos/Babylon.js/node_modules/lodash/forIn.js ***!
  9875. \********************************************************/
  9876. /*! no static exports found */
  9877. /***/ (function(module, exports, __webpack_require__) {
  9878. var baseFor = __webpack_require__(/*! ./_baseFor */ "../../node_modules/lodash/_baseFor.js"),
  9879. castFunction = __webpack_require__(/*! ./_castFunction */ "../../node_modules/lodash/_castFunction.js"),
  9880. keysIn = __webpack_require__(/*! ./keysIn */ "../../node_modules/lodash/keysIn.js");
  9881. /**
  9882. * Iterates over own and inherited enumerable string keyed properties of an
  9883. * object and invokes `iteratee` for each property. The iteratee is invoked
  9884. * with three arguments: (value, key, object). Iteratee functions may exit
  9885. * iteration early by explicitly returning `false`.
  9886. *
  9887. * @static
  9888. * @memberOf _
  9889. * @since 0.3.0
  9890. * @category Object
  9891. * @param {Object} object The object to iterate over.
  9892. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9893. * @returns {Object} Returns `object`.
  9894. * @see _.forInRight
  9895. * @example
  9896. *
  9897. * function Foo() {
  9898. * this.a = 1;
  9899. * this.b = 2;
  9900. * }
  9901. *
  9902. * Foo.prototype.c = 3;
  9903. *
  9904. * _.forIn(new Foo, function(value, key) {
  9905. * console.log(key);
  9906. * });
  9907. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  9908. */
  9909. function forIn(object, iteratee) {
  9910. return object == null
  9911. ? object
  9912. : baseFor(object, castFunction(iteratee), keysIn);
  9913. }
  9914. module.exports = forIn;
  9915. /***/ }),
  9916. /***/ "../../node_modules/lodash/get.js":
  9917. /*!******************************************************!*\
  9918. !*** C:/Repos/Babylon.js/node_modules/lodash/get.js ***!
  9919. \******************************************************/
  9920. /*! no static exports found */
  9921. /***/ (function(module, exports, __webpack_require__) {
  9922. var baseGet = __webpack_require__(/*! ./_baseGet */ "../../node_modules/lodash/_baseGet.js");
  9923. /**
  9924. * Gets the value at `path` of `object`. If the resolved value is
  9925. * `undefined`, the `defaultValue` is returned in its place.
  9926. *
  9927. * @static
  9928. * @memberOf _
  9929. * @since 3.7.0
  9930. * @category Object
  9931. * @param {Object} object The object to query.
  9932. * @param {Array|string} path The path of the property to get.
  9933. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  9934. * @returns {*} Returns the resolved value.
  9935. * @example
  9936. *
  9937. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  9938. *
  9939. * _.get(object, 'a[0].b.c');
  9940. * // => 3
  9941. *
  9942. * _.get(object, ['a', '0', 'b', 'c']);
  9943. * // => 3
  9944. *
  9945. * _.get(object, 'a.b.c', 'default');
  9946. * // => 'default'
  9947. */
  9948. function get(object, path, defaultValue) {
  9949. var result = object == null ? undefined : baseGet(object, path);
  9950. return result === undefined ? defaultValue : result;
  9951. }
  9952. module.exports = get;
  9953. /***/ }),
  9954. /***/ "../../node_modules/lodash/has.js":
  9955. /*!******************************************************!*\
  9956. !*** C:/Repos/Babylon.js/node_modules/lodash/has.js ***!
  9957. \******************************************************/
  9958. /*! no static exports found */
  9959. /***/ (function(module, exports, __webpack_require__) {
  9960. var baseHas = __webpack_require__(/*! ./_baseHas */ "../../node_modules/lodash/_baseHas.js"),
  9961. hasPath = __webpack_require__(/*! ./_hasPath */ "../../node_modules/lodash/_hasPath.js");
  9962. /**
  9963. * Checks if `path` is a direct property of `object`.
  9964. *
  9965. * @static
  9966. * @since 0.1.0
  9967. * @memberOf _
  9968. * @category Object
  9969. * @param {Object} object The object to query.
  9970. * @param {Array|string} path The path to check.
  9971. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  9972. * @example
  9973. *
  9974. * var object = { 'a': { 'b': 2 } };
  9975. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  9976. *
  9977. * _.has(object, 'a');
  9978. * // => true
  9979. *
  9980. * _.has(object, 'a.b');
  9981. * // => true
  9982. *
  9983. * _.has(object, ['a', 'b']);
  9984. * // => true
  9985. *
  9986. * _.has(other, 'a');
  9987. * // => false
  9988. */
  9989. function has(object, path) {
  9990. return object != null && hasPath(object, path, baseHas);
  9991. }
  9992. module.exports = has;
  9993. /***/ }),
  9994. /***/ "../../node_modules/lodash/hasIn.js":
  9995. /*!********************************************************!*\
  9996. !*** C:/Repos/Babylon.js/node_modules/lodash/hasIn.js ***!
  9997. \********************************************************/
  9998. /*! no static exports found */
  9999. /***/ (function(module, exports, __webpack_require__) {
  10000. var baseHasIn = __webpack_require__(/*! ./_baseHasIn */ "../../node_modules/lodash/_baseHasIn.js"),
  10001. hasPath = __webpack_require__(/*! ./_hasPath */ "../../node_modules/lodash/_hasPath.js");
  10002. /**
  10003. * Checks if `path` is a direct or inherited property of `object`.
  10004. *
  10005. * @static
  10006. * @memberOf _
  10007. * @since 4.0.0
  10008. * @category Object
  10009. * @param {Object} object The object to query.
  10010. * @param {Array|string} path The path to check.
  10011. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  10012. * @example
  10013. *
  10014. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  10015. *
  10016. * _.hasIn(object, 'a');
  10017. * // => true
  10018. *
  10019. * _.hasIn(object, 'a.b');
  10020. * // => true
  10021. *
  10022. * _.hasIn(object, ['a', 'b']);
  10023. * // => true
  10024. *
  10025. * _.hasIn(object, 'b');
  10026. * // => false
  10027. */
  10028. function hasIn(object, path) {
  10029. return object != null && hasPath(object, path, baseHasIn);
  10030. }
  10031. module.exports = hasIn;
  10032. /***/ }),
  10033. /***/ "../../node_modules/lodash/identity.js":
  10034. /*!***********************************************************!*\
  10035. !*** C:/Repos/Babylon.js/node_modules/lodash/identity.js ***!
  10036. \***********************************************************/
  10037. /*! no static exports found */
  10038. /***/ (function(module, exports) {
  10039. /**
  10040. * This method returns the first argument it receives.
  10041. *
  10042. * @static
  10043. * @since 0.1.0
  10044. * @memberOf _
  10045. * @category Util
  10046. * @param {*} value Any value.
  10047. * @returns {*} Returns `value`.
  10048. * @example
  10049. *
  10050. * var object = { 'a': 1 };
  10051. *
  10052. * console.log(_.identity(object) === object);
  10053. * // => true
  10054. */
  10055. function identity(value) {
  10056. return value;
  10057. }
  10058. module.exports = identity;
  10059. /***/ }),
  10060. /***/ "../../node_modules/lodash/isArguments.js":
  10061. /*!**************************************************************!*\
  10062. !*** C:/Repos/Babylon.js/node_modules/lodash/isArguments.js ***!
  10063. \**************************************************************/
  10064. /*! no static exports found */
  10065. /***/ (function(module, exports, __webpack_require__) {
  10066. var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ "../../node_modules/lodash/_baseIsArguments.js"),
  10067. isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js");
  10068. /** Used for built-in method references. */
  10069. var objectProto = Object.prototype;
  10070. /** Used to check objects for own properties. */
  10071. var hasOwnProperty = objectProto.hasOwnProperty;
  10072. /** Built-in value references. */
  10073. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  10074. /**
  10075. * Checks if `value` is likely an `arguments` object.
  10076. *
  10077. * @static
  10078. * @memberOf _
  10079. * @since 0.1.0
  10080. * @category Lang
  10081. * @param {*} value The value to check.
  10082. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  10083. * else `false`.
  10084. * @example
  10085. *
  10086. * _.isArguments(function() { return arguments; }());
  10087. * // => true
  10088. *
  10089. * _.isArguments([1, 2, 3]);
  10090. * // => false
  10091. */
  10092. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  10093. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  10094. !propertyIsEnumerable.call(value, 'callee');
  10095. };
  10096. module.exports = isArguments;
  10097. /***/ }),
  10098. /***/ "../../node_modules/lodash/isArray.js":
  10099. /*!**********************************************************!*\
  10100. !*** C:/Repos/Babylon.js/node_modules/lodash/isArray.js ***!
  10101. \**********************************************************/
  10102. /*! no static exports found */
  10103. /***/ (function(module, exports) {
  10104. /**
  10105. * Checks if `value` is classified as an `Array` object.
  10106. *
  10107. * @static
  10108. * @memberOf _
  10109. * @since 0.1.0
  10110. * @category Lang
  10111. * @param {*} value The value to check.
  10112. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  10113. * @example
  10114. *
  10115. * _.isArray([1, 2, 3]);
  10116. * // => true
  10117. *
  10118. * _.isArray(document.body.children);
  10119. * // => false
  10120. *
  10121. * _.isArray('abc');
  10122. * // => false
  10123. *
  10124. * _.isArray(_.noop);
  10125. * // => false
  10126. */
  10127. var isArray = Array.isArray;
  10128. module.exports = isArray;
  10129. /***/ }),
  10130. /***/ "../../node_modules/lodash/isArrayLike.js":
  10131. /*!**************************************************************!*\
  10132. !*** C:/Repos/Babylon.js/node_modules/lodash/isArrayLike.js ***!
  10133. \**************************************************************/
  10134. /*! no static exports found */
  10135. /***/ (function(module, exports, __webpack_require__) {
  10136. var isFunction = __webpack_require__(/*! ./isFunction */ "../../node_modules/lodash/isFunction.js"),
  10137. isLength = __webpack_require__(/*! ./isLength */ "../../node_modules/lodash/isLength.js");
  10138. /**
  10139. * Checks if `value` is array-like. A value is considered array-like if it's
  10140. * not a function and has a `value.length` that's an integer greater than or
  10141. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  10142. *
  10143. * @static
  10144. * @memberOf _
  10145. * @since 4.0.0
  10146. * @category Lang
  10147. * @param {*} value The value to check.
  10148. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  10149. * @example
  10150. *
  10151. * _.isArrayLike([1, 2, 3]);
  10152. * // => true
  10153. *
  10154. * _.isArrayLike(document.body.children);
  10155. * // => true
  10156. *
  10157. * _.isArrayLike('abc');
  10158. * // => true
  10159. *
  10160. * _.isArrayLike(_.noop);
  10161. * // => false
  10162. */
  10163. function isArrayLike(value) {
  10164. return value != null && isLength(value.length) && !isFunction(value);
  10165. }
  10166. module.exports = isArrayLike;
  10167. /***/ }),
  10168. /***/ "../../node_modules/lodash/isArrayLikeObject.js":
  10169. /*!********************************************************************!*\
  10170. !*** C:/Repos/Babylon.js/node_modules/lodash/isArrayLikeObject.js ***!
  10171. \********************************************************************/
  10172. /*! no static exports found */
  10173. /***/ (function(module, exports, __webpack_require__) {
  10174. var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js"),
  10175. isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js");
  10176. /**
  10177. * This method is like `_.isArrayLike` except that it also checks if `value`
  10178. * is an object.
  10179. *
  10180. * @static
  10181. * @memberOf _
  10182. * @since 4.0.0
  10183. * @category Lang
  10184. * @param {*} value The value to check.
  10185. * @returns {boolean} Returns `true` if `value` is an array-like object,
  10186. * else `false`.
  10187. * @example
  10188. *
  10189. * _.isArrayLikeObject([1, 2, 3]);
  10190. * // => true
  10191. *
  10192. * _.isArrayLikeObject(document.body.children);
  10193. * // => true
  10194. *
  10195. * _.isArrayLikeObject('abc');
  10196. * // => false
  10197. *
  10198. * _.isArrayLikeObject(_.noop);
  10199. * // => false
  10200. */
  10201. function isArrayLikeObject(value) {
  10202. return isObjectLike(value) && isArrayLike(value);
  10203. }
  10204. module.exports = isArrayLikeObject;
  10205. /***/ }),
  10206. /***/ "../../node_modules/lodash/isBuffer.js":
  10207. /*!***********************************************************!*\
  10208. !*** C:/Repos/Babylon.js/node_modules/lodash/isBuffer.js ***!
  10209. \***********************************************************/
  10210. /*! no static exports found */
  10211. /***/ (function(module, exports, __webpack_require__) {
  10212. /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"),
  10213. stubFalse = __webpack_require__(/*! ./stubFalse */ "../../node_modules/lodash/stubFalse.js");
  10214. /** Detect free variable `exports`. */
  10215. var freeExports = true && exports && !exports.nodeType && exports;
  10216. /** Detect free variable `module`. */
  10217. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  10218. /** Detect the popular CommonJS extension `module.exports`. */
  10219. var moduleExports = freeModule && freeModule.exports === freeExports;
  10220. /** Built-in value references. */
  10221. var Buffer = moduleExports ? root.Buffer : undefined;
  10222. /* Built-in method references for those with the same name as other `lodash` methods. */
  10223. var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
  10224. /**
  10225. * Checks if `value` is a buffer.
  10226. *
  10227. * @static
  10228. * @memberOf _
  10229. * @since 4.3.0
  10230. * @category Lang
  10231. * @param {*} value The value to check.
  10232. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  10233. * @example
  10234. *
  10235. * _.isBuffer(new Buffer(2));
  10236. * // => true
  10237. *
  10238. * _.isBuffer(new Uint8Array(2));
  10239. * // => false
  10240. */
  10241. var isBuffer = nativeIsBuffer || stubFalse;
  10242. module.exports = isBuffer;
  10243. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "../../node_modules/webpack/buildin/module.js")(module)))
  10244. /***/ }),
  10245. /***/ "../../node_modules/lodash/isEmpty.js":
  10246. /*!**********************************************************!*\
  10247. !*** C:/Repos/Babylon.js/node_modules/lodash/isEmpty.js ***!
  10248. \**********************************************************/
  10249. /*! no static exports found */
  10250. /***/ (function(module, exports, __webpack_require__) {
  10251. var baseKeys = __webpack_require__(/*! ./_baseKeys */ "../../node_modules/lodash/_baseKeys.js"),
  10252. getTag = __webpack_require__(/*! ./_getTag */ "../../node_modules/lodash/_getTag.js"),
  10253. isArguments = __webpack_require__(/*! ./isArguments */ "../../node_modules/lodash/isArguments.js"),
  10254. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  10255. isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js"),
  10256. isBuffer = __webpack_require__(/*! ./isBuffer */ "../../node_modules/lodash/isBuffer.js"),
  10257. isPrototype = __webpack_require__(/*! ./_isPrototype */ "../../node_modules/lodash/_isPrototype.js"),
  10258. isTypedArray = __webpack_require__(/*! ./isTypedArray */ "../../node_modules/lodash/isTypedArray.js");
  10259. /** `Object#toString` result references. */
  10260. var mapTag = '[object Map]',
  10261. setTag = '[object Set]';
  10262. /** Used for built-in method references. */
  10263. var objectProto = Object.prototype;
  10264. /** Used to check objects for own properties. */
  10265. var hasOwnProperty = objectProto.hasOwnProperty;
  10266. /**
  10267. * Checks if `value` is an empty object, collection, map, or set.
  10268. *
  10269. * Objects are considered empty if they have no own enumerable string keyed
  10270. * properties.
  10271. *
  10272. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  10273. * jQuery-like collections are considered empty if they have a `length` of `0`.
  10274. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  10275. *
  10276. * @static
  10277. * @memberOf _
  10278. * @since 0.1.0
  10279. * @category Lang
  10280. * @param {*} value The value to check.
  10281. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  10282. * @example
  10283. *
  10284. * _.isEmpty(null);
  10285. * // => true
  10286. *
  10287. * _.isEmpty(true);
  10288. * // => true
  10289. *
  10290. * _.isEmpty(1);
  10291. * // => true
  10292. *
  10293. * _.isEmpty([1, 2, 3]);
  10294. * // => false
  10295. *
  10296. * _.isEmpty({ 'a': 1 });
  10297. * // => false
  10298. */
  10299. function isEmpty(value) {
  10300. if (value == null) {
  10301. return true;
  10302. }
  10303. if (isArrayLike(value) &&
  10304. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  10305. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  10306. return !value.length;
  10307. }
  10308. var tag = getTag(value);
  10309. if (tag == mapTag || tag == setTag) {
  10310. return !value.size;
  10311. }
  10312. if (isPrototype(value)) {
  10313. return !baseKeys(value).length;
  10314. }
  10315. for (var key in value) {
  10316. if (hasOwnProperty.call(value, key)) {
  10317. return false;
  10318. }
  10319. }
  10320. return true;
  10321. }
  10322. module.exports = isEmpty;
  10323. /***/ }),
  10324. /***/ "../../node_modules/lodash/isFunction.js":
  10325. /*!*************************************************************!*\
  10326. !*** C:/Repos/Babylon.js/node_modules/lodash/isFunction.js ***!
  10327. \*************************************************************/
  10328. /*! no static exports found */
  10329. /***/ (function(module, exports, __webpack_require__) {
  10330. var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"),
  10331. isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js");
  10332. /** `Object#toString` result references. */
  10333. var asyncTag = '[object AsyncFunction]',
  10334. funcTag = '[object Function]',
  10335. genTag = '[object GeneratorFunction]',
  10336. proxyTag = '[object Proxy]';
  10337. /**
  10338. * Checks if `value` is classified as a `Function` object.
  10339. *
  10340. * @static
  10341. * @memberOf _
  10342. * @since 0.1.0
  10343. * @category Lang
  10344. * @param {*} value The value to check.
  10345. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  10346. * @example
  10347. *
  10348. * _.isFunction(_);
  10349. * // => true
  10350. *
  10351. * _.isFunction(/abc/);
  10352. * // => false
  10353. */
  10354. function isFunction(value) {
  10355. if (!isObject(value)) {
  10356. return false;
  10357. }
  10358. // The use of `Object#toString` avoids issues with the `typeof` operator
  10359. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  10360. var tag = baseGetTag(value);
  10361. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  10362. }
  10363. module.exports = isFunction;
  10364. /***/ }),
  10365. /***/ "../../node_modules/lodash/isLength.js":
  10366. /*!***********************************************************!*\
  10367. !*** C:/Repos/Babylon.js/node_modules/lodash/isLength.js ***!
  10368. \***********************************************************/
  10369. /*! no static exports found */
  10370. /***/ (function(module, exports) {
  10371. /** Used as references for various `Number` constants. */
  10372. var MAX_SAFE_INTEGER = 9007199254740991;
  10373. /**
  10374. * Checks if `value` is a valid array-like length.
  10375. *
  10376. * **Note:** This method is loosely based on
  10377. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  10378. *
  10379. * @static
  10380. * @memberOf _
  10381. * @since 4.0.0
  10382. * @category Lang
  10383. * @param {*} value The value to check.
  10384. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  10385. * @example
  10386. *
  10387. * _.isLength(3);
  10388. * // => true
  10389. *
  10390. * _.isLength(Number.MIN_VALUE);
  10391. * // => false
  10392. *
  10393. * _.isLength(Infinity);
  10394. * // => false
  10395. *
  10396. * _.isLength('3');
  10397. * // => false
  10398. */
  10399. function isLength(value) {
  10400. return typeof value == 'number' &&
  10401. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  10402. }
  10403. module.exports = isLength;
  10404. /***/ }),
  10405. /***/ "../../node_modules/lodash/isMap.js":
  10406. /*!********************************************************!*\
  10407. !*** C:/Repos/Babylon.js/node_modules/lodash/isMap.js ***!
  10408. \********************************************************/
  10409. /*! no static exports found */
  10410. /***/ (function(module, exports, __webpack_require__) {
  10411. var baseIsMap = __webpack_require__(/*! ./_baseIsMap */ "../../node_modules/lodash/_baseIsMap.js"),
  10412. baseUnary = __webpack_require__(/*! ./_baseUnary */ "../../node_modules/lodash/_baseUnary.js"),
  10413. nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "../../node_modules/lodash/_nodeUtil.js");
  10414. /* Node.js helper references. */
  10415. var nodeIsMap = nodeUtil && nodeUtil.isMap;
  10416. /**
  10417. * Checks if `value` is classified as a `Map` object.
  10418. *
  10419. * @static
  10420. * @memberOf _
  10421. * @since 4.3.0
  10422. * @category Lang
  10423. * @param {*} value The value to check.
  10424. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  10425. * @example
  10426. *
  10427. * _.isMap(new Map);
  10428. * // => true
  10429. *
  10430. * _.isMap(new WeakMap);
  10431. * // => false
  10432. */
  10433. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  10434. module.exports = isMap;
  10435. /***/ }),
  10436. /***/ "../../node_modules/lodash/isObject.js":
  10437. /*!***********************************************************!*\
  10438. !*** C:/Repos/Babylon.js/node_modules/lodash/isObject.js ***!
  10439. \***********************************************************/
  10440. /*! no static exports found */
  10441. /***/ (function(module, exports) {
  10442. /**
  10443. * Checks if `value` is the
  10444. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  10445. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  10446. *
  10447. * @static
  10448. * @memberOf _
  10449. * @since 0.1.0
  10450. * @category Lang
  10451. * @param {*} value The value to check.
  10452. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  10453. * @example
  10454. *
  10455. * _.isObject({});
  10456. * // => true
  10457. *
  10458. * _.isObject([1, 2, 3]);
  10459. * // => true
  10460. *
  10461. * _.isObject(_.noop);
  10462. * // => true
  10463. *
  10464. * _.isObject(null);
  10465. * // => false
  10466. */
  10467. function isObject(value) {
  10468. var type = typeof value;
  10469. return value != null && (type == 'object' || type == 'function');
  10470. }
  10471. module.exports = isObject;
  10472. /***/ }),
  10473. /***/ "../../node_modules/lodash/isObjectLike.js":
  10474. /*!***************************************************************!*\
  10475. !*** C:/Repos/Babylon.js/node_modules/lodash/isObjectLike.js ***!
  10476. \***************************************************************/
  10477. /*! no static exports found */
  10478. /***/ (function(module, exports) {
  10479. /**
  10480. * Checks if `value` is object-like. A value is object-like if it's not `null`
  10481. * and has a `typeof` result of "object".
  10482. *
  10483. * @static
  10484. * @memberOf _
  10485. * @since 4.0.0
  10486. * @category Lang
  10487. * @param {*} value The value to check.
  10488. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  10489. * @example
  10490. *
  10491. * _.isObjectLike({});
  10492. * // => true
  10493. *
  10494. * _.isObjectLike([1, 2, 3]);
  10495. * // => true
  10496. *
  10497. * _.isObjectLike(_.noop);
  10498. * // => false
  10499. *
  10500. * _.isObjectLike(null);
  10501. * // => false
  10502. */
  10503. function isObjectLike(value) {
  10504. return value != null && typeof value == 'object';
  10505. }
  10506. module.exports = isObjectLike;
  10507. /***/ }),
  10508. /***/ "../../node_modules/lodash/isPlainObject.js":
  10509. /*!****************************************************************!*\
  10510. !*** C:/Repos/Babylon.js/node_modules/lodash/isPlainObject.js ***!
  10511. \****************************************************************/
  10512. /*! no static exports found */
  10513. /***/ (function(module, exports, __webpack_require__) {
  10514. var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"),
  10515. getPrototype = __webpack_require__(/*! ./_getPrototype */ "../../node_modules/lodash/_getPrototype.js"),
  10516. isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js");
  10517. /** `Object#toString` result references. */
  10518. var objectTag = '[object Object]';
  10519. /** Used for built-in method references. */
  10520. var funcProto = Function.prototype,
  10521. objectProto = Object.prototype;
  10522. /** Used to resolve the decompiled source of functions. */
  10523. var funcToString = funcProto.toString;
  10524. /** Used to check objects for own properties. */
  10525. var hasOwnProperty = objectProto.hasOwnProperty;
  10526. /** Used to infer the `Object` constructor. */
  10527. var objectCtorString = funcToString.call(Object);
  10528. /**
  10529. * Checks if `value` is a plain object, that is, an object created by the
  10530. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  10531. *
  10532. * @static
  10533. * @memberOf _
  10534. * @since 0.8.0
  10535. * @category Lang
  10536. * @param {*} value The value to check.
  10537. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  10538. * @example
  10539. *
  10540. * function Foo() {
  10541. * this.a = 1;
  10542. * }
  10543. *
  10544. * _.isPlainObject(new Foo);
  10545. * // => false
  10546. *
  10547. * _.isPlainObject([1, 2, 3]);
  10548. * // => false
  10549. *
  10550. * _.isPlainObject({ 'x': 0, 'y': 0 });
  10551. * // => true
  10552. *
  10553. * _.isPlainObject(Object.create(null));
  10554. * // => true
  10555. */
  10556. function isPlainObject(value) {
  10557. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  10558. return false;
  10559. }
  10560. var proto = getPrototype(value);
  10561. if (proto === null) {
  10562. return true;
  10563. }
  10564. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  10565. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  10566. funcToString.call(Ctor) == objectCtorString;
  10567. }
  10568. module.exports = isPlainObject;
  10569. /***/ }),
  10570. /***/ "../../node_modules/lodash/isSet.js":
  10571. /*!********************************************************!*\
  10572. !*** C:/Repos/Babylon.js/node_modules/lodash/isSet.js ***!
  10573. \********************************************************/
  10574. /*! no static exports found */
  10575. /***/ (function(module, exports, __webpack_require__) {
  10576. var baseIsSet = __webpack_require__(/*! ./_baseIsSet */ "../../node_modules/lodash/_baseIsSet.js"),
  10577. baseUnary = __webpack_require__(/*! ./_baseUnary */ "../../node_modules/lodash/_baseUnary.js"),
  10578. nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "../../node_modules/lodash/_nodeUtil.js");
  10579. /* Node.js helper references. */
  10580. var nodeIsSet = nodeUtil && nodeUtil.isSet;
  10581. /**
  10582. * Checks if `value` is classified as a `Set` object.
  10583. *
  10584. * @static
  10585. * @memberOf _
  10586. * @since 4.3.0
  10587. * @category Lang
  10588. * @param {*} value The value to check.
  10589. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  10590. * @example
  10591. *
  10592. * _.isSet(new Set);
  10593. * // => true
  10594. *
  10595. * _.isSet(new WeakSet);
  10596. * // => false
  10597. */
  10598. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  10599. module.exports = isSet;
  10600. /***/ }),
  10601. /***/ "../../node_modules/lodash/isString.js":
  10602. /*!***********************************************************!*\
  10603. !*** C:/Repos/Babylon.js/node_modules/lodash/isString.js ***!
  10604. \***********************************************************/
  10605. /*! no static exports found */
  10606. /***/ (function(module, exports, __webpack_require__) {
  10607. var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"),
  10608. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  10609. isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js");
  10610. /** `Object#toString` result references. */
  10611. var stringTag = '[object String]';
  10612. /**
  10613. * Checks if `value` is classified as a `String` primitive or object.
  10614. *
  10615. * @static
  10616. * @since 0.1.0
  10617. * @memberOf _
  10618. * @category Lang
  10619. * @param {*} value The value to check.
  10620. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  10621. * @example
  10622. *
  10623. * _.isString('abc');
  10624. * // => true
  10625. *
  10626. * _.isString(1);
  10627. * // => false
  10628. */
  10629. function isString(value) {
  10630. return typeof value == 'string' ||
  10631. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  10632. }
  10633. module.exports = isString;
  10634. /***/ }),
  10635. /***/ "../../node_modules/lodash/isSymbol.js":
  10636. /*!***********************************************************!*\
  10637. !*** C:/Repos/Babylon.js/node_modules/lodash/isSymbol.js ***!
  10638. \***********************************************************/
  10639. /*! no static exports found */
  10640. /***/ (function(module, exports, __webpack_require__) {
  10641. var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"),
  10642. isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js");
  10643. /** `Object#toString` result references. */
  10644. var symbolTag = '[object Symbol]';
  10645. /**
  10646. * Checks if `value` is classified as a `Symbol` primitive or object.
  10647. *
  10648. * @static
  10649. * @memberOf _
  10650. * @since 4.0.0
  10651. * @category Lang
  10652. * @param {*} value The value to check.
  10653. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  10654. * @example
  10655. *
  10656. * _.isSymbol(Symbol.iterator);
  10657. * // => true
  10658. *
  10659. * _.isSymbol('abc');
  10660. * // => false
  10661. */
  10662. function isSymbol(value) {
  10663. return typeof value == 'symbol' ||
  10664. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  10665. }
  10666. module.exports = isSymbol;
  10667. /***/ }),
  10668. /***/ "../../node_modules/lodash/isTypedArray.js":
  10669. /*!***************************************************************!*\
  10670. !*** C:/Repos/Babylon.js/node_modules/lodash/isTypedArray.js ***!
  10671. \***************************************************************/
  10672. /*! no static exports found */
  10673. /***/ (function(module, exports, __webpack_require__) {
  10674. var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ "../../node_modules/lodash/_baseIsTypedArray.js"),
  10675. baseUnary = __webpack_require__(/*! ./_baseUnary */ "../../node_modules/lodash/_baseUnary.js"),
  10676. nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "../../node_modules/lodash/_nodeUtil.js");
  10677. /* Node.js helper references. */
  10678. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  10679. /**
  10680. * Checks if `value` is classified as a typed array.
  10681. *
  10682. * @static
  10683. * @memberOf _
  10684. * @since 3.0.0
  10685. * @category Lang
  10686. * @param {*} value The value to check.
  10687. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  10688. * @example
  10689. *
  10690. * _.isTypedArray(new Uint8Array);
  10691. * // => true
  10692. *
  10693. * _.isTypedArray([]);
  10694. * // => false
  10695. */
  10696. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  10697. module.exports = isTypedArray;
  10698. /***/ }),
  10699. /***/ "../../node_modules/lodash/isUndefined.js":
  10700. /*!**************************************************************!*\
  10701. !*** C:/Repos/Babylon.js/node_modules/lodash/isUndefined.js ***!
  10702. \**************************************************************/
  10703. /*! no static exports found */
  10704. /***/ (function(module, exports) {
  10705. /**
  10706. * Checks if `value` is `undefined`.
  10707. *
  10708. * @static
  10709. * @since 0.1.0
  10710. * @memberOf _
  10711. * @category Lang
  10712. * @param {*} value The value to check.
  10713. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  10714. * @example
  10715. *
  10716. * _.isUndefined(void 0);
  10717. * // => true
  10718. *
  10719. * _.isUndefined(null);
  10720. * // => false
  10721. */
  10722. function isUndefined(value) {
  10723. return value === undefined;
  10724. }
  10725. module.exports = isUndefined;
  10726. /***/ }),
  10727. /***/ "../../node_modules/lodash/keys.js":
  10728. /*!*******************************************************!*\
  10729. !*** C:/Repos/Babylon.js/node_modules/lodash/keys.js ***!
  10730. \*******************************************************/
  10731. /*! no static exports found */
  10732. /***/ (function(module, exports, __webpack_require__) {
  10733. var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "../../node_modules/lodash/_arrayLikeKeys.js"),
  10734. baseKeys = __webpack_require__(/*! ./_baseKeys */ "../../node_modules/lodash/_baseKeys.js"),
  10735. isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js");
  10736. /**
  10737. * Creates an array of the own enumerable property names of `object`.
  10738. *
  10739. * **Note:** Non-object values are coerced to objects. See the
  10740. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  10741. * for more details.
  10742. *
  10743. * @static
  10744. * @since 0.1.0
  10745. * @memberOf _
  10746. * @category Object
  10747. * @param {Object} object The object to query.
  10748. * @returns {Array} Returns the array of property names.
  10749. * @example
  10750. *
  10751. * function Foo() {
  10752. * this.a = 1;
  10753. * this.b = 2;
  10754. * }
  10755. *
  10756. * Foo.prototype.c = 3;
  10757. *
  10758. * _.keys(new Foo);
  10759. * // => ['a', 'b'] (iteration order is not guaranteed)
  10760. *
  10761. * _.keys('hi');
  10762. * // => ['0', '1']
  10763. */
  10764. function keys(object) {
  10765. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  10766. }
  10767. module.exports = keys;
  10768. /***/ }),
  10769. /***/ "../../node_modules/lodash/keysIn.js":
  10770. /*!*********************************************************!*\
  10771. !*** C:/Repos/Babylon.js/node_modules/lodash/keysIn.js ***!
  10772. \*********************************************************/
  10773. /*! no static exports found */
  10774. /***/ (function(module, exports, __webpack_require__) {
  10775. var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "../../node_modules/lodash/_arrayLikeKeys.js"),
  10776. baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ "../../node_modules/lodash/_baseKeysIn.js"),
  10777. isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js");
  10778. /**
  10779. * Creates an array of the own and inherited enumerable property names of `object`.
  10780. *
  10781. * **Note:** Non-object values are coerced to objects.
  10782. *
  10783. * @static
  10784. * @memberOf _
  10785. * @since 3.0.0
  10786. * @category Object
  10787. * @param {Object} object The object to query.
  10788. * @returns {Array} Returns the array of property names.
  10789. * @example
  10790. *
  10791. * function Foo() {
  10792. * this.a = 1;
  10793. * this.b = 2;
  10794. * }
  10795. *
  10796. * Foo.prototype.c = 3;
  10797. *
  10798. * _.keysIn(new Foo);
  10799. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  10800. */
  10801. function keysIn(object) {
  10802. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  10803. }
  10804. module.exports = keysIn;
  10805. /***/ }),
  10806. /***/ "../../node_modules/lodash/last.js":
  10807. /*!*******************************************************!*\
  10808. !*** C:/Repos/Babylon.js/node_modules/lodash/last.js ***!
  10809. \*******************************************************/
  10810. /*! no static exports found */
  10811. /***/ (function(module, exports) {
  10812. /**
  10813. * Gets the last element of `array`.
  10814. *
  10815. * @static
  10816. * @memberOf _
  10817. * @since 0.1.0
  10818. * @category Array
  10819. * @param {Array} array The array to query.
  10820. * @returns {*} Returns the last element of `array`.
  10821. * @example
  10822. *
  10823. * _.last([1, 2, 3]);
  10824. * // => 3
  10825. */
  10826. function last(array) {
  10827. var length = array == null ? 0 : array.length;
  10828. return length ? array[length - 1] : undefined;
  10829. }
  10830. module.exports = last;
  10831. /***/ }),
  10832. /***/ "../../node_modules/lodash/map.js":
  10833. /*!******************************************************!*\
  10834. !*** C:/Repos/Babylon.js/node_modules/lodash/map.js ***!
  10835. \******************************************************/
  10836. /*! no static exports found */
  10837. /***/ (function(module, exports, __webpack_require__) {
  10838. var arrayMap = __webpack_require__(/*! ./_arrayMap */ "../../node_modules/lodash/_arrayMap.js"),
  10839. baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "../../node_modules/lodash/_baseIteratee.js"),
  10840. baseMap = __webpack_require__(/*! ./_baseMap */ "../../node_modules/lodash/_baseMap.js"),
  10841. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js");
  10842. /**
  10843. * Creates an array of values by running each element in `collection` thru
  10844. * `iteratee`. The iteratee is invoked with three arguments:
  10845. * (value, index|key, collection).
  10846. *
  10847. * Many lodash methods are guarded to work as iteratees for methods like
  10848. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10849. *
  10850. * The guarded methods are:
  10851. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10852. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10853. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10854. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10855. *
  10856. * @static
  10857. * @memberOf _
  10858. * @since 0.1.0
  10859. * @category Collection
  10860. * @param {Array|Object} collection The collection to iterate over.
  10861. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10862. * @returns {Array} Returns the new mapped array.
  10863. * @example
  10864. *
  10865. * function square(n) {
  10866. * return n * n;
  10867. * }
  10868. *
  10869. * _.map([4, 8], square);
  10870. * // => [16, 64]
  10871. *
  10872. * _.map({ 'a': 4, 'b': 8 }, square);
  10873. * // => [16, 64] (iteration order is not guaranteed)
  10874. *
  10875. * var users = [
  10876. * { 'user': 'barney' },
  10877. * { 'user': 'fred' }
  10878. * ];
  10879. *
  10880. * // The `_.property` iteratee shorthand.
  10881. * _.map(users, 'user');
  10882. * // => ['barney', 'fred']
  10883. */
  10884. function map(collection, iteratee) {
  10885. var func = isArray(collection) ? arrayMap : baseMap;
  10886. return func(collection, baseIteratee(iteratee, 3));
  10887. }
  10888. module.exports = map;
  10889. /***/ }),
  10890. /***/ "../../node_modules/lodash/mapValues.js":
  10891. /*!************************************************************!*\
  10892. !*** C:/Repos/Babylon.js/node_modules/lodash/mapValues.js ***!
  10893. \************************************************************/
  10894. /*! no static exports found */
  10895. /***/ (function(module, exports, __webpack_require__) {
  10896. var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../../node_modules/lodash/_baseAssignValue.js"),
  10897. baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "../../node_modules/lodash/_baseForOwn.js"),
  10898. baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "../../node_modules/lodash/_baseIteratee.js");
  10899. /**
  10900. * Creates an object with the same keys as `object` and values generated
  10901. * by running each own enumerable string keyed property of `object` thru
  10902. * `iteratee`. The iteratee is invoked with three arguments:
  10903. * (value, key, object).
  10904. *
  10905. * @static
  10906. * @memberOf _
  10907. * @since 2.4.0
  10908. * @category Object
  10909. * @param {Object} object The object to iterate over.
  10910. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10911. * @returns {Object} Returns the new mapped object.
  10912. * @see _.mapKeys
  10913. * @example
  10914. *
  10915. * var users = {
  10916. * 'fred': { 'user': 'fred', 'age': 40 },
  10917. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  10918. * };
  10919. *
  10920. * _.mapValues(users, function(o) { return o.age; });
  10921. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  10922. *
  10923. * // The `_.property` iteratee shorthand.
  10924. * _.mapValues(users, 'age');
  10925. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  10926. */
  10927. function mapValues(object, iteratee) {
  10928. var result = {};
  10929. iteratee = baseIteratee(iteratee, 3);
  10930. baseForOwn(object, function(value, key, object) {
  10931. baseAssignValue(result, key, iteratee(value, key, object));
  10932. });
  10933. return result;
  10934. }
  10935. module.exports = mapValues;
  10936. /***/ }),
  10937. /***/ "../../node_modules/lodash/max.js":
  10938. /*!******************************************************!*\
  10939. !*** C:/Repos/Babylon.js/node_modules/lodash/max.js ***!
  10940. \******************************************************/
  10941. /*! no static exports found */
  10942. /***/ (function(module, exports, __webpack_require__) {
  10943. var baseExtremum = __webpack_require__(/*! ./_baseExtremum */ "../../node_modules/lodash/_baseExtremum.js"),
  10944. baseGt = __webpack_require__(/*! ./_baseGt */ "../../node_modules/lodash/_baseGt.js"),
  10945. identity = __webpack_require__(/*! ./identity */ "../../node_modules/lodash/identity.js");
  10946. /**
  10947. * Computes the maximum value of `array`. If `array` is empty or falsey,
  10948. * `undefined` is returned.
  10949. *
  10950. * @static
  10951. * @since 0.1.0
  10952. * @memberOf _
  10953. * @category Math
  10954. * @param {Array} array The array to iterate over.
  10955. * @returns {*} Returns the maximum value.
  10956. * @example
  10957. *
  10958. * _.max([4, 2, 8, 6]);
  10959. * // => 8
  10960. *
  10961. * _.max([]);
  10962. * // => undefined
  10963. */
  10964. function max(array) {
  10965. return (array && array.length)
  10966. ? baseExtremum(array, identity, baseGt)
  10967. : undefined;
  10968. }
  10969. module.exports = max;
  10970. /***/ }),
  10971. /***/ "../../node_modules/lodash/memoize.js":
  10972. /*!**********************************************************!*\
  10973. !*** C:/Repos/Babylon.js/node_modules/lodash/memoize.js ***!
  10974. \**********************************************************/
  10975. /*! no static exports found */
  10976. /***/ (function(module, exports, __webpack_require__) {
  10977. var MapCache = __webpack_require__(/*! ./_MapCache */ "../../node_modules/lodash/_MapCache.js");
  10978. /** Error message constants. */
  10979. var FUNC_ERROR_TEXT = 'Expected a function';
  10980. /**
  10981. * Creates a function that memoizes the result of `func`. If `resolver` is
  10982. * provided, it determines the cache key for storing the result based on the
  10983. * arguments provided to the memoized function. By default, the first argument
  10984. * provided to the memoized function is used as the map cache key. The `func`
  10985. * is invoked with the `this` binding of the memoized function.
  10986. *
  10987. * **Note:** The cache is exposed as the `cache` property on the memoized
  10988. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10989. * constructor with one whose instances implement the
  10990. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10991. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10992. *
  10993. * @static
  10994. * @memberOf _
  10995. * @since 0.1.0
  10996. * @category Function
  10997. * @param {Function} func The function to have its output memoized.
  10998. * @param {Function} [resolver] The function to resolve the cache key.
  10999. * @returns {Function} Returns the new memoized function.
  11000. * @example
  11001. *
  11002. * var object = { 'a': 1, 'b': 2 };
  11003. * var other = { 'c': 3, 'd': 4 };
  11004. *
  11005. * var values = _.memoize(_.values);
  11006. * values(object);
  11007. * // => [1, 2]
  11008. *
  11009. * values(other);
  11010. * // => [3, 4]
  11011. *
  11012. * object.a = 2;
  11013. * values(object);
  11014. * // => [1, 2]
  11015. *
  11016. * // Modify the result cache.
  11017. * values.cache.set(object, ['a', 'b']);
  11018. * values(object);
  11019. * // => ['a', 'b']
  11020. *
  11021. * // Replace `_.memoize.Cache`.
  11022. * _.memoize.Cache = WeakMap;
  11023. */
  11024. function memoize(func, resolver) {
  11025. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11026. throw new TypeError(FUNC_ERROR_TEXT);
  11027. }
  11028. var memoized = function() {
  11029. var args = arguments,
  11030. key = resolver ? resolver.apply(this, args) : args[0],
  11031. cache = memoized.cache;
  11032. if (cache.has(key)) {
  11033. return cache.get(key);
  11034. }
  11035. var result = func.apply(this, args);
  11036. memoized.cache = cache.set(key, result) || cache;
  11037. return result;
  11038. };
  11039. memoized.cache = new (memoize.Cache || MapCache);
  11040. return memoized;
  11041. }
  11042. // Expose `MapCache`.
  11043. memoize.Cache = MapCache;
  11044. module.exports = memoize;
  11045. /***/ }),
  11046. /***/ "../../node_modules/lodash/merge.js":
  11047. /*!********************************************************!*\
  11048. !*** C:/Repos/Babylon.js/node_modules/lodash/merge.js ***!
  11049. \********************************************************/
  11050. /*! no static exports found */
  11051. /***/ (function(module, exports, __webpack_require__) {
  11052. var baseMerge = __webpack_require__(/*! ./_baseMerge */ "../../node_modules/lodash/_baseMerge.js"),
  11053. createAssigner = __webpack_require__(/*! ./_createAssigner */ "../../node_modules/lodash/_createAssigner.js");
  11054. /**
  11055. * This method is like `_.assign` except that it recursively merges own and
  11056. * inherited enumerable string keyed properties of source objects into the
  11057. * destination object. Source properties that resolve to `undefined` are
  11058. * skipped if a destination value exists. Array and plain object properties
  11059. * are merged recursively. Other objects and value types are overridden by
  11060. * assignment. Source objects are applied from left to right. Subsequent
  11061. * sources overwrite property assignments of previous sources.
  11062. *
  11063. * **Note:** This method mutates `object`.
  11064. *
  11065. * @static
  11066. * @memberOf _
  11067. * @since 0.5.0
  11068. * @category Object
  11069. * @param {Object} object The destination object.
  11070. * @param {...Object} [sources] The source objects.
  11071. * @returns {Object} Returns `object`.
  11072. * @example
  11073. *
  11074. * var object = {
  11075. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  11076. * };
  11077. *
  11078. * var other = {
  11079. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  11080. * };
  11081. *
  11082. * _.merge(object, other);
  11083. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  11084. */
  11085. var merge = createAssigner(function(object, source, srcIndex) {
  11086. baseMerge(object, source, srcIndex);
  11087. });
  11088. module.exports = merge;
  11089. /***/ }),
  11090. /***/ "../../node_modules/lodash/min.js":
  11091. /*!******************************************************!*\
  11092. !*** C:/Repos/Babylon.js/node_modules/lodash/min.js ***!
  11093. \******************************************************/
  11094. /*! no static exports found */
  11095. /***/ (function(module, exports, __webpack_require__) {
  11096. var baseExtremum = __webpack_require__(/*! ./_baseExtremum */ "../../node_modules/lodash/_baseExtremum.js"),
  11097. baseLt = __webpack_require__(/*! ./_baseLt */ "../../node_modules/lodash/_baseLt.js"),
  11098. identity = __webpack_require__(/*! ./identity */ "../../node_modules/lodash/identity.js");
  11099. /**
  11100. * Computes the minimum value of `array`. If `array` is empty or falsey,
  11101. * `undefined` is returned.
  11102. *
  11103. * @static
  11104. * @since 0.1.0
  11105. * @memberOf _
  11106. * @category Math
  11107. * @param {Array} array The array to iterate over.
  11108. * @returns {*} Returns the minimum value.
  11109. * @example
  11110. *
  11111. * _.min([4, 2, 8, 6]);
  11112. * // => 2
  11113. *
  11114. * _.min([]);
  11115. * // => undefined
  11116. */
  11117. function min(array) {
  11118. return (array && array.length)
  11119. ? baseExtremum(array, identity, baseLt)
  11120. : undefined;
  11121. }
  11122. module.exports = min;
  11123. /***/ }),
  11124. /***/ "../../node_modules/lodash/minBy.js":
  11125. /*!********************************************************!*\
  11126. !*** C:/Repos/Babylon.js/node_modules/lodash/minBy.js ***!
  11127. \********************************************************/
  11128. /*! no static exports found */
  11129. /***/ (function(module, exports, __webpack_require__) {
  11130. var baseExtremum = __webpack_require__(/*! ./_baseExtremum */ "../../node_modules/lodash/_baseExtremum.js"),
  11131. baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "../../node_modules/lodash/_baseIteratee.js"),
  11132. baseLt = __webpack_require__(/*! ./_baseLt */ "../../node_modules/lodash/_baseLt.js");
  11133. /**
  11134. * This method is like `_.min` except that it accepts `iteratee` which is
  11135. * invoked for each element in `array` to generate the criterion by which
  11136. * the value is ranked. The iteratee is invoked with one argument: (value).
  11137. *
  11138. * @static
  11139. * @memberOf _
  11140. * @since 4.0.0
  11141. * @category Math
  11142. * @param {Array} array The array to iterate over.
  11143. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  11144. * @returns {*} Returns the minimum value.
  11145. * @example
  11146. *
  11147. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  11148. *
  11149. * _.minBy(objects, function(o) { return o.n; });
  11150. * // => { 'n': 1 }
  11151. *
  11152. * // The `_.property` iteratee shorthand.
  11153. * _.minBy(objects, 'n');
  11154. * // => { 'n': 1 }
  11155. */
  11156. function minBy(array, iteratee) {
  11157. return (array && array.length)
  11158. ? baseExtremum(array, baseIteratee(iteratee, 2), baseLt)
  11159. : undefined;
  11160. }
  11161. module.exports = minBy;
  11162. /***/ }),
  11163. /***/ "../../node_modules/lodash/noop.js":
  11164. /*!*******************************************************!*\
  11165. !*** C:/Repos/Babylon.js/node_modules/lodash/noop.js ***!
  11166. \*******************************************************/
  11167. /*! no static exports found */
  11168. /***/ (function(module, exports) {
  11169. /**
  11170. * This method returns `undefined`.
  11171. *
  11172. * @static
  11173. * @memberOf _
  11174. * @since 2.3.0
  11175. * @category Util
  11176. * @example
  11177. *
  11178. * _.times(2, _.noop);
  11179. * // => [undefined, undefined]
  11180. */
  11181. function noop() {
  11182. // No operation performed.
  11183. }
  11184. module.exports = noop;
  11185. /***/ }),
  11186. /***/ "../../node_modules/lodash/now.js":
  11187. /*!******************************************************!*\
  11188. !*** C:/Repos/Babylon.js/node_modules/lodash/now.js ***!
  11189. \******************************************************/
  11190. /*! no static exports found */
  11191. /***/ (function(module, exports, __webpack_require__) {
  11192. var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js");
  11193. /**
  11194. * Gets the timestamp of the number of milliseconds that have elapsed since
  11195. * the Unix epoch (1 January 1970 00:00:00 UTC).
  11196. *
  11197. * @static
  11198. * @memberOf _
  11199. * @since 2.4.0
  11200. * @category Date
  11201. * @returns {number} Returns the timestamp.
  11202. * @example
  11203. *
  11204. * _.defer(function(stamp) {
  11205. * console.log(_.now() - stamp);
  11206. * }, _.now());
  11207. * // => Logs the number of milliseconds it took for the deferred invocation.
  11208. */
  11209. var now = function() {
  11210. return root.Date.now();
  11211. };
  11212. module.exports = now;
  11213. /***/ }),
  11214. /***/ "../../node_modules/lodash/pick.js":
  11215. /*!*******************************************************!*\
  11216. !*** C:/Repos/Babylon.js/node_modules/lodash/pick.js ***!
  11217. \*******************************************************/
  11218. /*! no static exports found */
  11219. /***/ (function(module, exports, __webpack_require__) {
  11220. var basePick = __webpack_require__(/*! ./_basePick */ "../../node_modules/lodash/_basePick.js"),
  11221. flatRest = __webpack_require__(/*! ./_flatRest */ "../../node_modules/lodash/_flatRest.js");
  11222. /**
  11223. * Creates an object composed of the picked `object` properties.
  11224. *
  11225. * @static
  11226. * @since 0.1.0
  11227. * @memberOf _
  11228. * @category Object
  11229. * @param {Object} object The source object.
  11230. * @param {...(string|string[])} [paths] The property paths to pick.
  11231. * @returns {Object} Returns the new object.
  11232. * @example
  11233. *
  11234. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  11235. *
  11236. * _.pick(object, ['a', 'c']);
  11237. * // => { 'a': 1, 'c': 3 }
  11238. */
  11239. var pick = flatRest(function(object, paths) {
  11240. return object == null ? {} : basePick(object, paths);
  11241. });
  11242. module.exports = pick;
  11243. /***/ }),
  11244. /***/ "../../node_modules/lodash/property.js":
  11245. /*!***********************************************************!*\
  11246. !*** C:/Repos/Babylon.js/node_modules/lodash/property.js ***!
  11247. \***********************************************************/
  11248. /*! no static exports found */
  11249. /***/ (function(module, exports, __webpack_require__) {
  11250. var baseProperty = __webpack_require__(/*! ./_baseProperty */ "../../node_modules/lodash/_baseProperty.js"),
  11251. basePropertyDeep = __webpack_require__(/*! ./_basePropertyDeep */ "../../node_modules/lodash/_basePropertyDeep.js"),
  11252. isKey = __webpack_require__(/*! ./_isKey */ "../../node_modules/lodash/_isKey.js"),
  11253. toKey = __webpack_require__(/*! ./_toKey */ "../../node_modules/lodash/_toKey.js");
  11254. /**
  11255. * Creates a function that returns the value at `path` of a given object.
  11256. *
  11257. * @static
  11258. * @memberOf _
  11259. * @since 2.4.0
  11260. * @category Util
  11261. * @param {Array|string} path The path of the property to get.
  11262. * @returns {Function} Returns the new accessor function.
  11263. * @example
  11264. *
  11265. * var objects = [
  11266. * { 'a': { 'b': 2 } },
  11267. * { 'a': { 'b': 1 } }
  11268. * ];
  11269. *
  11270. * _.map(objects, _.property('a.b'));
  11271. * // => [2, 1]
  11272. *
  11273. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  11274. * // => [1, 2]
  11275. */
  11276. function property(path) {
  11277. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  11278. }
  11279. module.exports = property;
  11280. /***/ }),
  11281. /***/ "../../node_modules/lodash/range.js":
  11282. /*!********************************************************!*\
  11283. !*** C:/Repos/Babylon.js/node_modules/lodash/range.js ***!
  11284. \********************************************************/
  11285. /*! no static exports found */
  11286. /***/ (function(module, exports, __webpack_require__) {
  11287. var createRange = __webpack_require__(/*! ./_createRange */ "../../node_modules/lodash/_createRange.js");
  11288. /**
  11289. * Creates an array of numbers (positive and/or negative) progressing from
  11290. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  11291. * `start` is specified without an `end` or `step`. If `end` is not specified,
  11292. * it's set to `start` with `start` then set to `0`.
  11293. *
  11294. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  11295. * floating-point values which can produce unexpected results.
  11296. *
  11297. * @static
  11298. * @since 0.1.0
  11299. * @memberOf _
  11300. * @category Util
  11301. * @param {number} [start=0] The start of the range.
  11302. * @param {number} end The end of the range.
  11303. * @param {number} [step=1] The value to increment or decrement by.
  11304. * @returns {Array} Returns the range of numbers.
  11305. * @see _.inRange, _.rangeRight
  11306. * @example
  11307. *
  11308. * _.range(4);
  11309. * // => [0, 1, 2, 3]
  11310. *
  11311. * _.range(-4);
  11312. * // => [0, -1, -2, -3]
  11313. *
  11314. * _.range(1, 5);
  11315. * // => [1, 2, 3, 4]
  11316. *
  11317. * _.range(0, 20, 5);
  11318. * // => [0, 5, 10, 15]
  11319. *
  11320. * _.range(0, -4, -1);
  11321. * // => [0, -1, -2, -3]
  11322. *
  11323. * _.range(1, 4, 0);
  11324. * // => [1, 1, 1]
  11325. *
  11326. * _.range(0);
  11327. * // => []
  11328. */
  11329. var range = createRange();
  11330. module.exports = range;
  11331. /***/ }),
  11332. /***/ "../../node_modules/lodash/reduce.js":
  11333. /*!*********************************************************!*\
  11334. !*** C:/Repos/Babylon.js/node_modules/lodash/reduce.js ***!
  11335. \*********************************************************/
  11336. /*! no static exports found */
  11337. /***/ (function(module, exports, __webpack_require__) {
  11338. var arrayReduce = __webpack_require__(/*! ./_arrayReduce */ "../../node_modules/lodash/_arrayReduce.js"),
  11339. baseEach = __webpack_require__(/*! ./_baseEach */ "../../node_modules/lodash/_baseEach.js"),
  11340. baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "../../node_modules/lodash/_baseIteratee.js"),
  11341. baseReduce = __webpack_require__(/*! ./_baseReduce */ "../../node_modules/lodash/_baseReduce.js"),
  11342. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js");
  11343. /**
  11344. * Reduces `collection` to a value which is the accumulated result of running
  11345. * each element in `collection` thru `iteratee`, where each successive
  11346. * invocation is supplied the return value of the previous. If `accumulator`
  11347. * is not given, the first element of `collection` is used as the initial
  11348. * value. The iteratee is invoked with four arguments:
  11349. * (accumulator, value, index|key, collection).
  11350. *
  11351. * Many lodash methods are guarded to work as iteratees for methods like
  11352. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  11353. *
  11354. * The guarded methods are:
  11355. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  11356. * and `sortBy`
  11357. *
  11358. * @static
  11359. * @memberOf _
  11360. * @since 0.1.0
  11361. * @category Collection
  11362. * @param {Array|Object} collection The collection to iterate over.
  11363. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  11364. * @param {*} [accumulator] The initial value.
  11365. * @returns {*} Returns the accumulated value.
  11366. * @see _.reduceRight
  11367. * @example
  11368. *
  11369. * _.reduce([1, 2], function(sum, n) {
  11370. * return sum + n;
  11371. * }, 0);
  11372. * // => 3
  11373. *
  11374. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  11375. * (result[value] || (result[value] = [])).push(key);
  11376. * return result;
  11377. * }, {});
  11378. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  11379. */
  11380. function reduce(collection, iteratee, accumulator) {
  11381. var func = isArray(collection) ? arrayReduce : baseReduce,
  11382. initAccum = arguments.length < 3;
  11383. return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  11384. }
  11385. module.exports = reduce;
  11386. /***/ }),
  11387. /***/ "../../node_modules/lodash/size.js":
  11388. /*!*******************************************************!*\
  11389. !*** C:/Repos/Babylon.js/node_modules/lodash/size.js ***!
  11390. \*******************************************************/
  11391. /*! no static exports found */
  11392. /***/ (function(module, exports, __webpack_require__) {
  11393. var baseKeys = __webpack_require__(/*! ./_baseKeys */ "../../node_modules/lodash/_baseKeys.js"),
  11394. getTag = __webpack_require__(/*! ./_getTag */ "../../node_modules/lodash/_getTag.js"),
  11395. isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js"),
  11396. isString = __webpack_require__(/*! ./isString */ "../../node_modules/lodash/isString.js"),
  11397. stringSize = __webpack_require__(/*! ./_stringSize */ "../../node_modules/lodash/_stringSize.js");
  11398. /** `Object#toString` result references. */
  11399. var mapTag = '[object Map]',
  11400. setTag = '[object Set]';
  11401. /**
  11402. * Gets the size of `collection` by returning its length for array-like
  11403. * values or the number of own enumerable string keyed properties for objects.
  11404. *
  11405. * @static
  11406. * @memberOf _
  11407. * @since 0.1.0
  11408. * @category Collection
  11409. * @param {Array|Object|string} collection The collection to inspect.
  11410. * @returns {number} Returns the collection size.
  11411. * @example
  11412. *
  11413. * _.size([1, 2, 3]);
  11414. * // => 3
  11415. *
  11416. * _.size({ 'a': 1, 'b': 2 });
  11417. * // => 2
  11418. *
  11419. * _.size('pebbles');
  11420. * // => 7
  11421. */
  11422. function size(collection) {
  11423. if (collection == null) {
  11424. return 0;
  11425. }
  11426. if (isArrayLike(collection)) {
  11427. return isString(collection) ? stringSize(collection) : collection.length;
  11428. }
  11429. var tag = getTag(collection);
  11430. if (tag == mapTag || tag == setTag) {
  11431. return collection.size;
  11432. }
  11433. return baseKeys(collection).length;
  11434. }
  11435. module.exports = size;
  11436. /***/ }),
  11437. /***/ "../../node_modules/lodash/sortBy.js":
  11438. /*!*********************************************************!*\
  11439. !*** C:/Repos/Babylon.js/node_modules/lodash/sortBy.js ***!
  11440. \*********************************************************/
  11441. /*! no static exports found */
  11442. /***/ (function(module, exports, __webpack_require__) {
  11443. var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "../../node_modules/lodash/_baseFlatten.js"),
  11444. baseOrderBy = __webpack_require__(/*! ./_baseOrderBy */ "../../node_modules/lodash/_baseOrderBy.js"),
  11445. baseRest = __webpack_require__(/*! ./_baseRest */ "../../node_modules/lodash/_baseRest.js"),
  11446. isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "../../node_modules/lodash/_isIterateeCall.js");
  11447. /**
  11448. * Creates an array of elements, sorted in ascending order by the results of
  11449. * running each element in a collection thru each iteratee. This method
  11450. * performs a stable sort, that is, it preserves the original sort order of
  11451. * equal elements. The iteratees are invoked with one argument: (value).
  11452. *
  11453. * @static
  11454. * @memberOf _
  11455. * @since 0.1.0
  11456. * @category Collection
  11457. * @param {Array|Object} collection The collection to iterate over.
  11458. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  11459. * The iteratees to sort by.
  11460. * @returns {Array} Returns the new sorted array.
  11461. * @example
  11462. *
  11463. * var users = [
  11464. * { 'user': 'fred', 'age': 48 },
  11465. * { 'user': 'barney', 'age': 36 },
  11466. * { 'user': 'fred', 'age': 30 },
  11467. * { 'user': 'barney', 'age': 34 }
  11468. * ];
  11469. *
  11470. * _.sortBy(users, [function(o) { return o.user; }]);
  11471. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  11472. *
  11473. * _.sortBy(users, ['user', 'age']);
  11474. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  11475. */
  11476. var sortBy = baseRest(function(collection, iteratees) {
  11477. if (collection == null) {
  11478. return [];
  11479. }
  11480. var length = iteratees.length;
  11481. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  11482. iteratees = [];
  11483. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  11484. iteratees = [iteratees[0]];
  11485. }
  11486. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  11487. });
  11488. module.exports = sortBy;
  11489. /***/ }),
  11490. /***/ "../../node_modules/lodash/stubArray.js":
  11491. /*!************************************************************!*\
  11492. !*** C:/Repos/Babylon.js/node_modules/lodash/stubArray.js ***!
  11493. \************************************************************/
  11494. /*! no static exports found */
  11495. /***/ (function(module, exports) {
  11496. /**
  11497. * This method returns a new empty array.
  11498. *
  11499. * @static
  11500. * @memberOf _
  11501. * @since 4.13.0
  11502. * @category Util
  11503. * @returns {Array} Returns the new empty array.
  11504. * @example
  11505. *
  11506. * var arrays = _.times(2, _.stubArray);
  11507. *
  11508. * console.log(arrays);
  11509. * // => [[], []]
  11510. *
  11511. * console.log(arrays[0] === arrays[1]);
  11512. * // => false
  11513. */
  11514. function stubArray() {
  11515. return [];
  11516. }
  11517. module.exports = stubArray;
  11518. /***/ }),
  11519. /***/ "../../node_modules/lodash/stubFalse.js":
  11520. /*!************************************************************!*\
  11521. !*** C:/Repos/Babylon.js/node_modules/lodash/stubFalse.js ***!
  11522. \************************************************************/
  11523. /*! no static exports found */
  11524. /***/ (function(module, exports) {
  11525. /**
  11526. * This method returns `false`.
  11527. *
  11528. * @static
  11529. * @memberOf _
  11530. * @since 4.13.0
  11531. * @category Util
  11532. * @returns {boolean} Returns `false`.
  11533. * @example
  11534. *
  11535. * _.times(2, _.stubFalse);
  11536. * // => [false, false]
  11537. */
  11538. function stubFalse() {
  11539. return false;
  11540. }
  11541. module.exports = stubFalse;
  11542. /***/ }),
  11543. /***/ "../../node_modules/lodash/toFinite.js":
  11544. /*!***********************************************************!*\
  11545. !*** C:/Repos/Babylon.js/node_modules/lodash/toFinite.js ***!
  11546. \***********************************************************/
  11547. /*! no static exports found */
  11548. /***/ (function(module, exports, __webpack_require__) {
  11549. var toNumber = __webpack_require__(/*! ./toNumber */ "../../node_modules/lodash/toNumber.js");
  11550. /** Used as references for various `Number` constants. */
  11551. var INFINITY = 1 / 0,
  11552. MAX_INTEGER = 1.7976931348623157e+308;
  11553. /**
  11554. * Converts `value` to a finite number.
  11555. *
  11556. * @static
  11557. * @memberOf _
  11558. * @since 4.12.0
  11559. * @category Lang
  11560. * @param {*} value The value to convert.
  11561. * @returns {number} Returns the converted number.
  11562. * @example
  11563. *
  11564. * _.toFinite(3.2);
  11565. * // => 3.2
  11566. *
  11567. * _.toFinite(Number.MIN_VALUE);
  11568. * // => 5e-324
  11569. *
  11570. * _.toFinite(Infinity);
  11571. * // => 1.7976931348623157e+308
  11572. *
  11573. * _.toFinite('3.2');
  11574. * // => 3.2
  11575. */
  11576. function toFinite(value) {
  11577. if (!value) {
  11578. return value === 0 ? value : 0;
  11579. }
  11580. value = toNumber(value);
  11581. if (value === INFINITY || value === -INFINITY) {
  11582. var sign = (value < 0 ? -1 : 1);
  11583. return sign * MAX_INTEGER;
  11584. }
  11585. return value === value ? value : 0;
  11586. }
  11587. module.exports = toFinite;
  11588. /***/ }),
  11589. /***/ "../../node_modules/lodash/toInteger.js":
  11590. /*!************************************************************!*\
  11591. !*** C:/Repos/Babylon.js/node_modules/lodash/toInteger.js ***!
  11592. \************************************************************/
  11593. /*! no static exports found */
  11594. /***/ (function(module, exports, __webpack_require__) {
  11595. var toFinite = __webpack_require__(/*! ./toFinite */ "../../node_modules/lodash/toFinite.js");
  11596. /**
  11597. * Converts `value` to an integer.
  11598. *
  11599. * **Note:** This method is loosely based on
  11600. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  11601. *
  11602. * @static
  11603. * @memberOf _
  11604. * @since 4.0.0
  11605. * @category Lang
  11606. * @param {*} value The value to convert.
  11607. * @returns {number} Returns the converted integer.
  11608. * @example
  11609. *
  11610. * _.toInteger(3.2);
  11611. * // => 3
  11612. *
  11613. * _.toInteger(Number.MIN_VALUE);
  11614. * // => 0
  11615. *
  11616. * _.toInteger(Infinity);
  11617. * // => 1.7976931348623157e+308
  11618. *
  11619. * _.toInteger('3.2');
  11620. * // => 3
  11621. */
  11622. function toInteger(value) {
  11623. var result = toFinite(value),
  11624. remainder = result % 1;
  11625. return result === result ? (remainder ? result - remainder : result) : 0;
  11626. }
  11627. module.exports = toInteger;
  11628. /***/ }),
  11629. /***/ "../../node_modules/lodash/toNumber.js":
  11630. /*!***********************************************************!*\
  11631. !*** C:/Repos/Babylon.js/node_modules/lodash/toNumber.js ***!
  11632. \***********************************************************/
  11633. /*! no static exports found */
  11634. /***/ (function(module, exports, __webpack_require__) {
  11635. var isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"),
  11636. isSymbol = __webpack_require__(/*! ./isSymbol */ "../../node_modules/lodash/isSymbol.js");
  11637. /** Used as references for various `Number` constants. */
  11638. var NAN = 0 / 0;
  11639. /** Used to match leading and trailing whitespace. */
  11640. var reTrim = /^\s+|\s+$/g;
  11641. /** Used to detect bad signed hexadecimal string values. */
  11642. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  11643. /** Used to detect binary string values. */
  11644. var reIsBinary = /^0b[01]+$/i;
  11645. /** Used to detect octal string values. */
  11646. var reIsOctal = /^0o[0-7]+$/i;
  11647. /** Built-in method references without a dependency on `root`. */
  11648. var freeParseInt = parseInt;
  11649. /**
  11650. * Converts `value` to a number.
  11651. *
  11652. * @static
  11653. * @memberOf _
  11654. * @since 4.0.0
  11655. * @category Lang
  11656. * @param {*} value The value to process.
  11657. * @returns {number} Returns the number.
  11658. * @example
  11659. *
  11660. * _.toNumber(3.2);
  11661. * // => 3.2
  11662. *
  11663. * _.toNumber(Number.MIN_VALUE);
  11664. * // => 5e-324
  11665. *
  11666. * _.toNumber(Infinity);
  11667. * // => Infinity
  11668. *
  11669. * _.toNumber('3.2');
  11670. * // => 3.2
  11671. */
  11672. function toNumber(value) {
  11673. if (typeof value == 'number') {
  11674. return value;
  11675. }
  11676. if (isSymbol(value)) {
  11677. return NAN;
  11678. }
  11679. if (isObject(value)) {
  11680. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  11681. value = isObject(other) ? (other + '') : other;
  11682. }
  11683. if (typeof value != 'string') {
  11684. return value === 0 ? value : +value;
  11685. }
  11686. value = value.replace(reTrim, '');
  11687. var isBinary = reIsBinary.test(value);
  11688. return (isBinary || reIsOctal.test(value))
  11689. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  11690. : (reIsBadHex.test(value) ? NAN : +value);
  11691. }
  11692. module.exports = toNumber;
  11693. /***/ }),
  11694. /***/ "../../node_modules/lodash/toPlainObject.js":
  11695. /*!****************************************************************!*\
  11696. !*** C:/Repos/Babylon.js/node_modules/lodash/toPlainObject.js ***!
  11697. \****************************************************************/
  11698. /*! no static exports found */
  11699. /***/ (function(module, exports, __webpack_require__) {
  11700. var copyObject = __webpack_require__(/*! ./_copyObject */ "../../node_modules/lodash/_copyObject.js"),
  11701. keysIn = __webpack_require__(/*! ./keysIn */ "../../node_modules/lodash/keysIn.js");
  11702. /**
  11703. * Converts `value` to a plain object flattening inherited enumerable string
  11704. * keyed properties of `value` to own properties of the plain object.
  11705. *
  11706. * @static
  11707. * @memberOf _
  11708. * @since 3.0.0
  11709. * @category Lang
  11710. * @param {*} value The value to convert.
  11711. * @returns {Object} Returns the converted plain object.
  11712. * @example
  11713. *
  11714. * function Foo() {
  11715. * this.b = 2;
  11716. * }
  11717. *
  11718. * Foo.prototype.c = 3;
  11719. *
  11720. * _.assign({ 'a': 1 }, new Foo);
  11721. * // => { 'a': 1, 'b': 2 }
  11722. *
  11723. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  11724. * // => { 'a': 1, 'b': 2, 'c': 3 }
  11725. */
  11726. function toPlainObject(value) {
  11727. return copyObject(value, keysIn(value));
  11728. }
  11729. module.exports = toPlainObject;
  11730. /***/ }),
  11731. /***/ "../../node_modules/lodash/toString.js":
  11732. /*!***********************************************************!*\
  11733. !*** C:/Repos/Babylon.js/node_modules/lodash/toString.js ***!
  11734. \***********************************************************/
  11735. /*! no static exports found */
  11736. /***/ (function(module, exports, __webpack_require__) {
  11737. var baseToString = __webpack_require__(/*! ./_baseToString */ "../../node_modules/lodash/_baseToString.js");
  11738. /**
  11739. * Converts `value` to a string. An empty string is returned for `null`
  11740. * and `undefined` values. The sign of `-0` is preserved.
  11741. *
  11742. * @static
  11743. * @memberOf _
  11744. * @since 4.0.0
  11745. * @category Lang
  11746. * @param {*} value The value to convert.
  11747. * @returns {string} Returns the converted string.
  11748. * @example
  11749. *
  11750. * _.toString(null);
  11751. * // => ''
  11752. *
  11753. * _.toString(-0);
  11754. * // => '-0'
  11755. *
  11756. * _.toString([1, 2, 3]);
  11757. * // => '1,2,3'
  11758. */
  11759. function toString(value) {
  11760. return value == null ? '' : baseToString(value);
  11761. }
  11762. module.exports = toString;
  11763. /***/ }),
  11764. /***/ "../../node_modules/lodash/transform.js":
  11765. /*!************************************************************!*\
  11766. !*** C:/Repos/Babylon.js/node_modules/lodash/transform.js ***!
  11767. \************************************************************/
  11768. /*! no static exports found */
  11769. /***/ (function(module, exports, __webpack_require__) {
  11770. var arrayEach = __webpack_require__(/*! ./_arrayEach */ "../../node_modules/lodash/_arrayEach.js"),
  11771. baseCreate = __webpack_require__(/*! ./_baseCreate */ "../../node_modules/lodash/_baseCreate.js"),
  11772. baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "../../node_modules/lodash/_baseForOwn.js"),
  11773. baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "../../node_modules/lodash/_baseIteratee.js"),
  11774. getPrototype = __webpack_require__(/*! ./_getPrototype */ "../../node_modules/lodash/_getPrototype.js"),
  11775. isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"),
  11776. isBuffer = __webpack_require__(/*! ./isBuffer */ "../../node_modules/lodash/isBuffer.js"),
  11777. isFunction = __webpack_require__(/*! ./isFunction */ "../../node_modules/lodash/isFunction.js"),
  11778. isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"),
  11779. isTypedArray = __webpack_require__(/*! ./isTypedArray */ "../../node_modules/lodash/isTypedArray.js");
  11780. /**
  11781. * An alternative to `_.reduce`; this method transforms `object` to a new
  11782. * `accumulator` object which is the result of running each of its own
  11783. * enumerable string keyed properties thru `iteratee`, with each invocation
  11784. * potentially mutating the `accumulator` object. If `accumulator` is not
  11785. * provided, a new object with the same `[[Prototype]]` will be used. The
  11786. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  11787. * Iteratee functions may exit iteration early by explicitly returning `false`.
  11788. *
  11789. * @static
  11790. * @memberOf _
  11791. * @since 1.3.0
  11792. * @category Object
  11793. * @param {Object} object The object to iterate over.
  11794. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  11795. * @param {*} [accumulator] The custom accumulator value.
  11796. * @returns {*} Returns the accumulated value.
  11797. * @example
  11798. *
  11799. * _.transform([2, 3, 4], function(result, n) {
  11800. * result.push(n *= n);
  11801. * return n % 2 == 0;
  11802. * }, []);
  11803. * // => [4, 9]
  11804. *
  11805. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  11806. * (result[value] || (result[value] = [])).push(key);
  11807. * }, {});
  11808. * // => { '1': ['a', 'c'], '2': ['b'] }
  11809. */
  11810. function transform(object, iteratee, accumulator) {
  11811. var isArr = isArray(object),
  11812. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  11813. iteratee = baseIteratee(iteratee, 4);
  11814. if (accumulator == null) {
  11815. var Ctor = object && object.constructor;
  11816. if (isArrLike) {
  11817. accumulator = isArr ? new Ctor : [];
  11818. }
  11819. else if (isObject(object)) {
  11820. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  11821. }
  11822. else {
  11823. accumulator = {};
  11824. }
  11825. }
  11826. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  11827. return iteratee(accumulator, value, index, object);
  11828. });
  11829. return accumulator;
  11830. }
  11831. module.exports = transform;
  11832. /***/ }),
  11833. /***/ "../../node_modules/lodash/union.js":
  11834. /*!********************************************************!*\
  11835. !*** C:/Repos/Babylon.js/node_modules/lodash/union.js ***!
  11836. \********************************************************/
  11837. /*! no static exports found */
  11838. /***/ (function(module, exports, __webpack_require__) {
  11839. var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "../../node_modules/lodash/_baseFlatten.js"),
  11840. baseRest = __webpack_require__(/*! ./_baseRest */ "../../node_modules/lodash/_baseRest.js"),
  11841. baseUniq = __webpack_require__(/*! ./_baseUniq */ "../../node_modules/lodash/_baseUniq.js"),
  11842. isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "../../node_modules/lodash/isArrayLikeObject.js");
  11843. /**
  11844. * Creates an array of unique values, in order, from all given arrays using
  11845. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11846. * for equality comparisons.
  11847. *
  11848. * @static
  11849. * @memberOf _
  11850. * @since 0.1.0
  11851. * @category Array
  11852. * @param {...Array} [arrays] The arrays to inspect.
  11853. * @returns {Array} Returns the new array of combined values.
  11854. * @example
  11855. *
  11856. * _.union([2], [1, 2]);
  11857. * // => [2, 1]
  11858. */
  11859. var union = baseRest(function(arrays) {
  11860. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  11861. });
  11862. module.exports = union;
  11863. /***/ }),
  11864. /***/ "../../node_modules/lodash/uniqueId.js":
  11865. /*!***********************************************************!*\
  11866. !*** C:/Repos/Babylon.js/node_modules/lodash/uniqueId.js ***!
  11867. \***********************************************************/
  11868. /*! no static exports found */
  11869. /***/ (function(module, exports, __webpack_require__) {
  11870. var toString = __webpack_require__(/*! ./toString */ "../../node_modules/lodash/toString.js");
  11871. /** Used to generate unique IDs. */
  11872. var idCounter = 0;
  11873. /**
  11874. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  11875. *
  11876. * @static
  11877. * @since 0.1.0
  11878. * @memberOf _
  11879. * @category Util
  11880. * @param {string} [prefix=''] The value to prefix the ID with.
  11881. * @returns {string} Returns the unique ID.
  11882. * @example
  11883. *
  11884. * _.uniqueId('contact_');
  11885. * // => 'contact_104'
  11886. *
  11887. * _.uniqueId();
  11888. * // => '105'
  11889. */
  11890. function uniqueId(prefix) {
  11891. var id = ++idCounter;
  11892. return toString(prefix) + id;
  11893. }
  11894. module.exports = uniqueId;
  11895. /***/ }),
  11896. /***/ "../../node_modules/lodash/values.js":
  11897. /*!*********************************************************!*\
  11898. !*** C:/Repos/Babylon.js/node_modules/lodash/values.js ***!
  11899. \*********************************************************/
  11900. /*! no static exports found */
  11901. /***/ (function(module, exports, __webpack_require__) {
  11902. var baseValues = __webpack_require__(/*! ./_baseValues */ "../../node_modules/lodash/_baseValues.js"),
  11903. keys = __webpack_require__(/*! ./keys */ "../../node_modules/lodash/keys.js");
  11904. /**
  11905. * Creates an array of the own enumerable string keyed property values of `object`.
  11906. *
  11907. * **Note:** Non-object values are coerced to objects.
  11908. *
  11909. * @static
  11910. * @since 0.1.0
  11911. * @memberOf _
  11912. * @category Object
  11913. * @param {Object} object The object to query.
  11914. * @returns {Array} Returns the array of property values.
  11915. * @example
  11916. *
  11917. * function Foo() {
  11918. * this.a = 1;
  11919. * this.b = 2;
  11920. * }
  11921. *
  11922. * Foo.prototype.c = 3;
  11923. *
  11924. * _.values(new Foo);
  11925. * // => [1, 2] (iteration order is not guaranteed)
  11926. *
  11927. * _.values('hi');
  11928. * // => ['h', 'i']
  11929. */
  11930. function values(object) {
  11931. return object == null ? [] : baseValues(object, keys(object));
  11932. }
  11933. module.exports = values;
  11934. /***/ }),
  11935. /***/ "../../node_modules/lodash/zipObject.js":
  11936. /*!************************************************************!*\
  11937. !*** C:/Repos/Babylon.js/node_modules/lodash/zipObject.js ***!
  11938. \************************************************************/
  11939. /*! no static exports found */
  11940. /***/ (function(module, exports, __webpack_require__) {
  11941. var assignValue = __webpack_require__(/*! ./_assignValue */ "../../node_modules/lodash/_assignValue.js"),
  11942. baseZipObject = __webpack_require__(/*! ./_baseZipObject */ "../../node_modules/lodash/_baseZipObject.js");
  11943. /**
  11944. * This method is like `_.fromPairs` except that it accepts two arrays,
  11945. * one of property identifiers and one of corresponding values.
  11946. *
  11947. * @static
  11948. * @memberOf _
  11949. * @since 0.4.0
  11950. * @category Array
  11951. * @param {Array} [props=[]] The property identifiers.
  11952. * @param {Array} [values=[]] The property values.
  11953. * @returns {Object} Returns the new object.
  11954. * @example
  11955. *
  11956. * _.zipObject(['a', 'b'], [1, 2]);
  11957. * // => { 'a': 1, 'b': 2 }
  11958. */
  11959. function zipObject(props, values) {
  11960. return baseZipObject(props || [], values || [], assignValue);
  11961. }
  11962. module.exports = zipObject;
  11963. /***/ }),
  11964. /***/ "../../node_modules/object-assign/index.js":
  11965. /*!***************************************************************!*\
  11966. !*** C:/Repos/Babylon.js/node_modules/object-assign/index.js ***!
  11967. \***************************************************************/
  11968. /*! no static exports found */
  11969. /***/ (function(module, exports, __webpack_require__) {
  11970. "use strict";
  11971. /*
  11972. object-assign
  11973. (c) Sindre Sorhus
  11974. @license MIT
  11975. */
  11976. /* eslint-disable no-unused-vars */
  11977. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  11978. var hasOwnProperty = Object.prototype.hasOwnProperty;
  11979. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  11980. function toObject(val) {
  11981. if (val === null || val === undefined) {
  11982. throw new TypeError('Object.assign cannot be called with null or undefined');
  11983. }
  11984. return Object(val);
  11985. }
  11986. function shouldUseNative() {
  11987. try {
  11988. if (!Object.assign) {
  11989. return false;
  11990. }
  11991. // Detect buggy property enumeration order in older V8 versions.
  11992. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  11993. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  11994. test1[5] = 'de';
  11995. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  11996. return false;
  11997. }
  11998. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  11999. var test2 = {};
  12000. for (var i = 0; i < 10; i++) {
  12001. test2['_' + String.fromCharCode(i)] = i;
  12002. }
  12003. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  12004. return test2[n];
  12005. });
  12006. if (order2.join('') !== '0123456789') {
  12007. return false;
  12008. }
  12009. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  12010. var test3 = {};
  12011. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  12012. test3[letter] = letter;
  12013. });
  12014. if (Object.keys(Object.assign({}, test3)).join('') !==
  12015. 'abcdefghijklmnopqrst') {
  12016. return false;
  12017. }
  12018. return true;
  12019. } catch (err) {
  12020. // We don't expect any of the above to throw, but better to be safe.
  12021. return false;
  12022. }
  12023. }
  12024. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  12025. var from;
  12026. var to = toObject(target);
  12027. var symbols;
  12028. for (var s = 1; s < arguments.length; s++) {
  12029. from = Object(arguments[s]);
  12030. for (var key in from) {
  12031. if (hasOwnProperty.call(from, key)) {
  12032. to[key] = from[key];
  12033. }
  12034. }
  12035. if (getOwnPropertySymbols) {
  12036. symbols = getOwnPropertySymbols(from);
  12037. for (var i = 0; i < symbols.length; i++) {
  12038. if (propIsEnumerable.call(from, symbols[i])) {
  12039. to[symbols[i]] = from[symbols[i]];
  12040. }
  12041. }
  12042. }
  12043. }
  12044. return to;
  12045. };
  12046. /***/ }),
  12047. /***/ "../../node_modules/prop-types/checkPropTypes.js":
  12048. /*!*********************************************************************!*\
  12049. !*** C:/Repos/Babylon.js/node_modules/prop-types/checkPropTypes.js ***!
  12050. \*********************************************************************/
  12051. /*! no static exports found */
  12052. /***/ (function(module, exports, __webpack_require__) {
  12053. "use strict";
  12054. /**
  12055. * Copyright (c) 2013-present, Facebook, Inc.
  12056. *
  12057. * This source code is licensed under the MIT license found in the
  12058. * LICENSE file in the root directory of this source tree.
  12059. */
  12060. var printWarning = function() {};
  12061. if (true) {
  12062. var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../../node_modules/prop-types/lib/ReactPropTypesSecret.js");
  12063. var loggedTypeFailures = {};
  12064. var has = Function.call.bind(Object.prototype.hasOwnProperty);
  12065. printWarning = function(text) {
  12066. var message = 'Warning: ' + text;
  12067. if (typeof console !== 'undefined') {
  12068. console.error(message);
  12069. }
  12070. try {
  12071. // --- Welcome to debugging React ---
  12072. // This error was thrown as a convenience so that you can use this stack
  12073. // to find the callsite that caused this warning to fire.
  12074. throw new Error(message);
  12075. } catch (x) {}
  12076. };
  12077. }
  12078. /**
  12079. * Assert that the values match with the type specs.
  12080. * Error messages are memorized and will only be shown once.
  12081. *
  12082. * @param {object} typeSpecs Map of name to a ReactPropType
  12083. * @param {object} values Runtime values that need to be type-checked
  12084. * @param {string} location e.g. "prop", "context", "child context"
  12085. * @param {string} componentName Name of the component for error messages.
  12086. * @param {?Function} getStack Returns the component stack.
  12087. * @private
  12088. */
  12089. function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
  12090. if (true) {
  12091. for (var typeSpecName in typeSpecs) {
  12092. if (has(typeSpecs, typeSpecName)) {
  12093. var error;
  12094. // Prop type validation may throw. In case they do, we don't want to
  12095. // fail the render phase where it didn't fail before. So we log it.
  12096. // After these have been cleaned up, we'll let them throw.
  12097. try {
  12098. // This is intentionally an invariant that gets caught. It's the same
  12099. // behavior as without this statement except with a better message.
  12100. if (typeof typeSpecs[typeSpecName] !== 'function') {
  12101. var err = Error(
  12102. (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
  12103. 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
  12104. );
  12105. err.name = 'Invariant Violation';
  12106. throw err;
  12107. }
  12108. error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
  12109. } catch (ex) {
  12110. error = ex;
  12111. }
  12112. if (error && !(error instanceof Error)) {
  12113. printWarning(
  12114. (componentName || 'React class') + ': type specification of ' +
  12115. location + ' `' + typeSpecName + '` is invalid; the type checker ' +
  12116. 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
  12117. 'You may have forgotten to pass an argument to the type checker ' +
  12118. 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
  12119. 'shape all require an argument).'
  12120. );
  12121. }
  12122. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  12123. // Only monitor this failure once because there tends to be a lot of the
  12124. // same error.
  12125. loggedTypeFailures[error.message] = true;
  12126. var stack = getStack ? getStack() : '';
  12127. printWarning(
  12128. 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
  12129. );
  12130. }
  12131. }
  12132. }
  12133. }
  12134. }
  12135. /**
  12136. * Resets warning cache when testing.
  12137. *
  12138. * @private
  12139. */
  12140. checkPropTypes.resetWarningCache = function() {
  12141. if (true) {
  12142. loggedTypeFailures = {};
  12143. }
  12144. }
  12145. module.exports = checkPropTypes;
  12146. /***/ }),
  12147. /***/ "../../node_modules/prop-types/lib/ReactPropTypesSecret.js":
  12148. /*!*******************************************************************************!*\
  12149. !*** C:/Repos/Babylon.js/node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
  12150. \*******************************************************************************/
  12151. /*! no static exports found */
  12152. /***/ (function(module, exports, __webpack_require__) {
  12153. "use strict";
  12154. /**
  12155. * Copyright (c) 2013-present, Facebook, Inc.
  12156. *
  12157. * This source code is licensed under the MIT license found in the
  12158. * LICENSE file in the root directory of this source tree.
  12159. */
  12160. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  12161. module.exports = ReactPropTypesSecret;
  12162. /***/ }),
  12163. /***/ "../../node_modules/react-dom/cjs/react-dom.development.js":
  12164. /*!*******************************************************************************!*\
  12165. !*** C:/Repos/Babylon.js/node_modules/react-dom/cjs/react-dom.development.js ***!
  12166. \*******************************************************************************/
  12167. /*! no static exports found */
  12168. /***/ (function(module, exports, __webpack_require__) {
  12169. "use strict";
  12170. /** @license React v16.13.1
  12171. * react-dom.development.js
  12172. *
  12173. * Copyright (c) Facebook, Inc. and its affiliates.
  12174. *
  12175. * This source code is licensed under the MIT license found in the
  12176. * LICENSE file in the root directory of this source tree.
  12177. */
  12178. if (true) {
  12179. (function() {
  12180. 'use strict';
  12181. var React = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  12182. var _assign = __webpack_require__(/*! object-assign */ "../../node_modules/object-assign/index.js");
  12183. var Scheduler = __webpack_require__(/*! scheduler */ "../../node_modules/scheduler/index.js");
  12184. var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "../../node_modules/prop-types/checkPropTypes.js");
  12185. var tracing = __webpack_require__(/*! scheduler/tracing */ "../../node_modules/scheduler/tracing.js");
  12186. var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.
  12187. // Current owner and dispatcher used to share the same ref,
  12188. // but PR #14548 split them out to better support the react-debug-tools package.
  12189. if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
  12190. ReactSharedInternals.ReactCurrentDispatcher = {
  12191. current: null
  12192. };
  12193. }
  12194. if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
  12195. ReactSharedInternals.ReactCurrentBatchConfig = {
  12196. suspense: null
  12197. };
  12198. }
  12199. // by calls to these methods by a Babel plugin.
  12200. //
  12201. // In PROD (or in packages without access to React internals),
  12202. // they are left as they are instead.
  12203. function warn(format) {
  12204. {
  12205. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  12206. args[_key - 1] = arguments[_key];
  12207. }
  12208. printWarning('warn', format, args);
  12209. }
  12210. }
  12211. function error(format) {
  12212. {
  12213. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  12214. args[_key2 - 1] = arguments[_key2];
  12215. }
  12216. printWarning('error', format, args);
  12217. }
  12218. }
  12219. function printWarning(level, format, args) {
  12220. // When changing this logic, you might want to also
  12221. // update consoleWithStackDev.www.js as well.
  12222. {
  12223. var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0;
  12224. if (!hasExistingStack) {
  12225. var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
  12226. var stack = ReactDebugCurrentFrame.getStackAddendum();
  12227. if (stack !== '') {
  12228. format += '%s';
  12229. args = args.concat([stack]);
  12230. }
  12231. }
  12232. var argsWithFormat = args.map(function (item) {
  12233. return '' + item;
  12234. }); // Careful: RN currently depends on this prefix
  12235. argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
  12236. // breaks IE9: https://github.com/facebook/react/issues/13610
  12237. // eslint-disable-next-line react-internal/no-production-logging
  12238. Function.prototype.apply.call(console[level], console, argsWithFormat);
  12239. try {
  12240. // --- Welcome to debugging React ---
  12241. // This error was thrown as a convenience so that you can use this stack
  12242. // to find the callsite that caused this warning to fire.
  12243. var argIndex = 0;
  12244. var message = 'Warning: ' + format.replace(/%s/g, function () {
  12245. return args[argIndex++];
  12246. });
  12247. throw new Error(message);
  12248. } catch (x) {}
  12249. }
  12250. }
  12251. if (!React) {
  12252. {
  12253. throw Error( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." );
  12254. }
  12255. }
  12256. var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {
  12257. var funcArgs = Array.prototype.slice.call(arguments, 3);
  12258. try {
  12259. func.apply(context, funcArgs);
  12260. } catch (error) {
  12261. this.onError(error);
  12262. }
  12263. };
  12264. {
  12265. // In DEV mode, we swap out invokeGuardedCallback for a special version
  12266. // that plays more nicely with the browser's DevTools. The idea is to preserve
  12267. // "Pause on exceptions" behavior. Because React wraps all user-provided
  12268. // functions in invokeGuardedCallback, and the production version of
  12269. // invokeGuardedCallback uses a try-catch, all user exceptions are treated
  12270. // like caught exceptions, and the DevTools won't pause unless the developer
  12271. // takes the extra step of enabling pause on caught exceptions. This is
  12272. // unintuitive, though, because even though React has caught the error, from
  12273. // the developer's perspective, the error is uncaught.
  12274. //
  12275. // To preserve the expected "Pause on exceptions" behavior, we don't use a
  12276. // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
  12277. // DOM node, and call the user-provided callback from inside an event handler
  12278. // for that fake event. If the callback throws, the error is "captured" using
  12279. // a global event handler. But because the error happens in a different
  12280. // event loop context, it does not interrupt the normal program flow.
  12281. // Effectively, this gives us try-catch behavior without actually using
  12282. // try-catch. Neat!
  12283. // Check that the browser supports the APIs we need to implement our special
  12284. // DEV version of invokeGuardedCallback
  12285. if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
  12286. var fakeNode = document.createElement('react');
  12287. var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
  12288. // If document doesn't exist we know for sure we will crash in this method
  12289. // when we call document.createEvent(). However this can cause confusing
  12290. // errors: https://github.com/facebookincubator/create-react-app/issues/3482
  12291. // So we preemptively throw with a better message instead.
  12292. if (!(typeof document !== 'undefined')) {
  12293. {
  12294. throw Error( "The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous." );
  12295. }
  12296. }
  12297. var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We
  12298. // set this to true at the beginning, then set it to false right after
  12299. // calling the function. If the function errors, `didError` will never be
  12300. // set to false. This strategy works even if the browser is flaky and
  12301. // fails to call our global error handler, because it doesn't rely on
  12302. // the error event at all.
  12303. var didError = true; // Keeps track of the value of window.event so that we can reset it
  12304. // during the callback to let user code access window.event in the
  12305. // browsers that support it.
  12306. var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event
  12307. // dispatching: https://github.com/facebook/react/issues/13688
  12308. var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously
  12309. // dispatch our fake event using `dispatchEvent`. Inside the handler, we
  12310. // call the user-provided callback.
  12311. var funcArgs = Array.prototype.slice.call(arguments, 3);
  12312. function callCallback() {
  12313. // We immediately remove the callback from event listeners so that
  12314. // nested `invokeGuardedCallback` calls do not clash. Otherwise, a
  12315. // nested call would trigger the fake event handlers of any call higher
  12316. // in the stack.
  12317. fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the
  12318. // window.event assignment in both IE <= 10 as they throw an error
  12319. // "Member not found" in strict mode, and in Firefox which does not
  12320. // support window.event.
  12321. if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
  12322. window.event = windowEvent;
  12323. }
  12324. func.apply(context, funcArgs);
  12325. didError = false;
  12326. } // Create a global error event handler. We use this to capture the value
  12327. // that was thrown. It's possible that this error handler will fire more
  12328. // than once; for example, if non-React code also calls `dispatchEvent`
  12329. // and a handler for that event throws. We should be resilient to most of
  12330. // those cases. Even if our error event handler fires more than once, the
  12331. // last error event is always used. If the callback actually does error,
  12332. // we know that the last error event is the correct one, because it's not
  12333. // possible for anything else to have happened in between our callback
  12334. // erroring and the code that follows the `dispatchEvent` call below. If
  12335. // the callback doesn't error, but the error event was fired, we know to
  12336. // ignore it because `didError` will be false, as described above.
  12337. var error; // Use this to track whether the error event is ever called.
  12338. var didSetError = false;
  12339. var isCrossOriginError = false;
  12340. function handleWindowError(event) {
  12341. error = event.error;
  12342. didSetError = true;
  12343. if (error === null && event.colno === 0 && event.lineno === 0) {
  12344. isCrossOriginError = true;
  12345. }
  12346. if (event.defaultPrevented) {
  12347. // Some other error handler has prevented default.
  12348. // Browsers silence the error report if this happens.
  12349. // We'll remember this to later decide whether to log it or not.
  12350. if (error != null && typeof error === 'object') {
  12351. try {
  12352. error._suppressLogging = true;
  12353. } catch (inner) {// Ignore.
  12354. }
  12355. }
  12356. }
  12357. } // Create a fake event type.
  12358. var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers
  12359. window.addEventListener('error', handleWindowError);
  12360. fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function
  12361. // errors, it will trigger our global error handler.
  12362. evt.initEvent(evtType, false, false);
  12363. fakeNode.dispatchEvent(evt);
  12364. if (windowEventDescriptor) {
  12365. Object.defineProperty(window, 'event', windowEventDescriptor);
  12366. }
  12367. if (didError) {
  12368. if (!didSetError) {
  12369. // The callback errored, but the error event never fired.
  12370. error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
  12371. } else if (isCrossOriginError) {
  12372. error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
  12373. }
  12374. this.onError(error);
  12375. } // Remove our event listeners
  12376. window.removeEventListener('error', handleWindowError);
  12377. };
  12378. invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
  12379. }
  12380. }
  12381. var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
  12382. var hasError = false;
  12383. var caughtError = null; // Used by event system to capture/rethrow the first error.
  12384. var hasRethrowError = false;
  12385. var rethrowError = null;
  12386. var reporter = {
  12387. onError: function (error) {
  12388. hasError = true;
  12389. caughtError = error;
  12390. }
  12391. };
  12392. /**
  12393. * Call a function while guarding against errors that happens within it.
  12394. * Returns an error if it throws, otherwise null.
  12395. *
  12396. * In production, this is implemented using a try-catch. The reason we don't
  12397. * use a try-catch directly is so that we can swap out a different
  12398. * implementation in DEV mode.
  12399. *
  12400. * @param {String} name of the guard to use for logging or debugging
  12401. * @param {Function} func The function to invoke
  12402. * @param {*} context The context to use when calling the function
  12403. * @param {...*} args Arguments for function
  12404. */
  12405. function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
  12406. hasError = false;
  12407. caughtError = null;
  12408. invokeGuardedCallbackImpl$1.apply(reporter, arguments);
  12409. }
  12410. /**
  12411. * Same as invokeGuardedCallback, but instead of returning an error, it stores
  12412. * it in a global so it can be rethrown by `rethrowCaughtError` later.
  12413. * TODO: See if caughtError and rethrowError can be unified.
  12414. *
  12415. * @param {String} name of the guard to use for logging or debugging
  12416. * @param {Function} func The function to invoke
  12417. * @param {*} context The context to use when calling the function
  12418. * @param {...*} args Arguments for function
  12419. */
  12420. function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
  12421. invokeGuardedCallback.apply(this, arguments);
  12422. if (hasError) {
  12423. var error = clearCaughtError();
  12424. if (!hasRethrowError) {
  12425. hasRethrowError = true;
  12426. rethrowError = error;
  12427. }
  12428. }
  12429. }
  12430. /**
  12431. * During execution of guarded functions we will capture the first error which
  12432. * we will rethrow to be handled by the top level error handler.
  12433. */
  12434. function rethrowCaughtError() {
  12435. if (hasRethrowError) {
  12436. var error = rethrowError;
  12437. hasRethrowError = false;
  12438. rethrowError = null;
  12439. throw error;
  12440. }
  12441. }
  12442. function hasCaughtError() {
  12443. return hasError;
  12444. }
  12445. function clearCaughtError() {
  12446. if (hasError) {
  12447. var error = caughtError;
  12448. hasError = false;
  12449. caughtError = null;
  12450. return error;
  12451. } else {
  12452. {
  12453. {
  12454. throw Error( "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." );
  12455. }
  12456. }
  12457. }
  12458. }
  12459. var getFiberCurrentPropsFromNode = null;
  12460. var getInstanceFromNode = null;
  12461. var getNodeFromInstance = null;
  12462. function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
  12463. getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
  12464. getInstanceFromNode = getInstanceFromNodeImpl;
  12465. getNodeFromInstance = getNodeFromInstanceImpl;
  12466. {
  12467. if (!getNodeFromInstance || !getInstanceFromNode) {
  12468. error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.');
  12469. }
  12470. }
  12471. }
  12472. var validateEventDispatches;
  12473. {
  12474. validateEventDispatches = function (event) {
  12475. var dispatchListeners = event._dispatchListeners;
  12476. var dispatchInstances = event._dispatchInstances;
  12477. var listenersIsArr = Array.isArray(dispatchListeners);
  12478. var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
  12479. var instancesIsArr = Array.isArray(dispatchInstances);
  12480. var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
  12481. if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) {
  12482. error('EventPluginUtils: Invalid `event`.');
  12483. }
  12484. };
  12485. }
  12486. /**
  12487. * Dispatch the event to the listener.
  12488. * @param {SyntheticEvent} event SyntheticEvent to handle
  12489. * @param {function} listener Application-level callback
  12490. * @param {*} inst Internal component instance
  12491. */
  12492. function executeDispatch(event, listener, inst) {
  12493. var type = event.type || 'unknown-event';
  12494. event.currentTarget = getNodeFromInstance(inst);
  12495. invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
  12496. event.currentTarget = null;
  12497. }
  12498. /**
  12499. * Standard/simple iteration through an event's collected dispatches.
  12500. */
  12501. function executeDispatchesInOrder(event) {
  12502. var dispatchListeners = event._dispatchListeners;
  12503. var dispatchInstances = event._dispatchInstances;
  12504. {
  12505. validateEventDispatches(event);
  12506. }
  12507. if (Array.isArray(dispatchListeners)) {
  12508. for (var i = 0; i < dispatchListeners.length; i++) {
  12509. if (event.isPropagationStopped()) {
  12510. break;
  12511. } // Listeners and Instances are two parallel arrays that are always in sync.
  12512. executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);
  12513. }
  12514. } else if (dispatchListeners) {
  12515. executeDispatch(event, dispatchListeners, dispatchInstances);
  12516. }
  12517. event._dispatchListeners = null;
  12518. event._dispatchInstances = null;
  12519. }
  12520. var FunctionComponent = 0;
  12521. var ClassComponent = 1;
  12522. var IndeterminateComponent = 2; // Before we know whether it is function or class
  12523. var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
  12524. var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
  12525. var HostComponent = 5;
  12526. var HostText = 6;
  12527. var Fragment = 7;
  12528. var Mode = 8;
  12529. var ContextConsumer = 9;
  12530. var ContextProvider = 10;
  12531. var ForwardRef = 11;
  12532. var Profiler = 12;
  12533. var SuspenseComponent = 13;
  12534. var MemoComponent = 14;
  12535. var SimpleMemoComponent = 15;
  12536. var LazyComponent = 16;
  12537. var IncompleteClassComponent = 17;
  12538. var DehydratedFragment = 18;
  12539. var SuspenseListComponent = 19;
  12540. var FundamentalComponent = 20;
  12541. var ScopeComponent = 21;
  12542. var Block = 22;
  12543. /**
  12544. * Injectable ordering of event plugins.
  12545. */
  12546. var eventPluginOrder = null;
  12547. /**
  12548. * Injectable mapping from names to event plugin modules.
  12549. */
  12550. var namesToPlugins = {};
  12551. /**
  12552. * Recomputes the plugin list using the injected plugins and plugin ordering.
  12553. *
  12554. * @private
  12555. */
  12556. function recomputePluginOrdering() {
  12557. if (!eventPluginOrder) {
  12558. // Wait until an `eventPluginOrder` is injected.
  12559. return;
  12560. }
  12561. for (var pluginName in namesToPlugins) {
  12562. var pluginModule = namesToPlugins[pluginName];
  12563. var pluginIndex = eventPluginOrder.indexOf(pluginName);
  12564. if (!(pluginIndex > -1)) {
  12565. {
  12566. throw Error( "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`." );
  12567. }
  12568. }
  12569. if (plugins[pluginIndex]) {
  12570. continue;
  12571. }
  12572. if (!pluginModule.extractEvents) {
  12573. {
  12574. throw Error( "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not." );
  12575. }
  12576. }
  12577. plugins[pluginIndex] = pluginModule;
  12578. var publishedEvents = pluginModule.eventTypes;
  12579. for (var eventName in publishedEvents) {
  12580. if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {
  12581. {
  12582. throw Error( "EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`." );
  12583. }
  12584. }
  12585. }
  12586. }
  12587. }
  12588. /**
  12589. * Publishes an event so that it can be dispatched by the supplied plugin.
  12590. *
  12591. * @param {object} dispatchConfig Dispatch configuration for the event.
  12592. * @param {object} PluginModule Plugin publishing the event.
  12593. * @return {boolean} True if the event was successfully published.
  12594. * @private
  12595. */
  12596. function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
  12597. if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {
  12598. {
  12599. throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + eventName + "`." );
  12600. }
  12601. }
  12602. eventNameDispatchConfigs[eventName] = dispatchConfig;
  12603. var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
  12604. if (phasedRegistrationNames) {
  12605. for (var phaseName in phasedRegistrationNames) {
  12606. if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
  12607. var phasedRegistrationName = phasedRegistrationNames[phaseName];
  12608. publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
  12609. }
  12610. }
  12611. return true;
  12612. } else if (dispatchConfig.registrationName) {
  12613. publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
  12614. return true;
  12615. }
  12616. return false;
  12617. }
  12618. /**
  12619. * Publishes a registration name that is used to identify dispatched events.
  12620. *
  12621. * @param {string} registrationName Registration name to add.
  12622. * @param {object} PluginModule Plugin publishing the event.
  12623. * @private
  12624. */
  12625. function publishRegistrationName(registrationName, pluginModule, eventName) {
  12626. if (!!registrationNameModules[registrationName]) {
  12627. {
  12628. throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + registrationName + "`." );
  12629. }
  12630. }
  12631. registrationNameModules[registrationName] = pluginModule;
  12632. registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
  12633. {
  12634. var lowerCasedName = registrationName.toLowerCase();
  12635. possibleRegistrationNames[lowerCasedName] = registrationName;
  12636. if (registrationName === 'onDoubleClick') {
  12637. possibleRegistrationNames.ondblclick = registrationName;
  12638. }
  12639. }
  12640. }
  12641. /**
  12642. * Registers plugins so that they can extract and dispatch events.
  12643. */
  12644. /**
  12645. * Ordered list of injected plugins.
  12646. */
  12647. var plugins = [];
  12648. /**
  12649. * Mapping from event name to dispatch config
  12650. */
  12651. var eventNameDispatchConfigs = {};
  12652. /**
  12653. * Mapping from registration name to plugin module
  12654. */
  12655. var registrationNameModules = {};
  12656. /**
  12657. * Mapping from registration name to event name
  12658. */
  12659. var registrationNameDependencies = {};
  12660. /**
  12661. * Mapping from lowercase registration names to the properly cased version,
  12662. * used to warn in the case of missing event handlers. Available
  12663. * only in true.
  12664. * @type {Object}
  12665. */
  12666. var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true
  12667. /**
  12668. * Injects an ordering of plugins (by plugin name). This allows the ordering
  12669. * to be decoupled from injection of the actual plugins so that ordering is
  12670. * always deterministic regardless of packaging, on-the-fly injection, etc.
  12671. *
  12672. * @param {array} InjectedEventPluginOrder
  12673. * @internal
  12674. */
  12675. function injectEventPluginOrder(injectedEventPluginOrder) {
  12676. if (!!eventPluginOrder) {
  12677. {
  12678. throw Error( "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React." );
  12679. }
  12680. } // Clone the ordering so it cannot be dynamically mutated.
  12681. eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
  12682. recomputePluginOrdering();
  12683. }
  12684. /**
  12685. * Injects plugins to be used by plugin event system. The plugin names must be
  12686. * in the ordering injected by `injectEventPluginOrder`.
  12687. *
  12688. * Plugins can be injected as part of page initialization or on-the-fly.
  12689. *
  12690. * @param {object} injectedNamesToPlugins Map from names to plugin modules.
  12691. * @internal
  12692. */
  12693. function injectEventPluginsByName(injectedNamesToPlugins) {
  12694. var isOrderingDirty = false;
  12695. for (var pluginName in injectedNamesToPlugins) {
  12696. if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
  12697. continue;
  12698. }
  12699. var pluginModule = injectedNamesToPlugins[pluginName];
  12700. if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
  12701. if (!!namesToPlugins[pluginName]) {
  12702. {
  12703. throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`." );
  12704. }
  12705. }
  12706. namesToPlugins[pluginName] = pluginModule;
  12707. isOrderingDirty = true;
  12708. }
  12709. }
  12710. if (isOrderingDirty) {
  12711. recomputePluginOrdering();
  12712. }
  12713. }
  12714. var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
  12715. var PLUGIN_EVENT_SYSTEM = 1;
  12716. var IS_REPLAYED = 1 << 5;
  12717. var IS_FIRST_ANCESTOR = 1 << 6;
  12718. var restoreImpl = null;
  12719. var restoreTarget = null;
  12720. var restoreQueue = null;
  12721. function restoreStateOfTarget(target) {
  12722. // We perform this translation at the end of the event loop so that we
  12723. // always receive the correct fiber here
  12724. var internalInstance = getInstanceFromNode(target);
  12725. if (!internalInstance) {
  12726. // Unmounted
  12727. return;
  12728. }
  12729. if (!(typeof restoreImpl === 'function')) {
  12730. {
  12731. throw Error( "setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue." );
  12732. }
  12733. }
  12734. var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted.
  12735. if (stateNode) {
  12736. var _props = getFiberCurrentPropsFromNode(stateNode);
  12737. restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
  12738. }
  12739. }
  12740. function setRestoreImplementation(impl) {
  12741. restoreImpl = impl;
  12742. }
  12743. function enqueueStateRestore(target) {
  12744. if (restoreTarget) {
  12745. if (restoreQueue) {
  12746. restoreQueue.push(target);
  12747. } else {
  12748. restoreQueue = [target];
  12749. }
  12750. } else {
  12751. restoreTarget = target;
  12752. }
  12753. }
  12754. function needsStateRestore() {
  12755. return restoreTarget !== null || restoreQueue !== null;
  12756. }
  12757. function restoreStateIfNeeded() {
  12758. if (!restoreTarget) {
  12759. return;
  12760. }
  12761. var target = restoreTarget;
  12762. var queuedTargets = restoreQueue;
  12763. restoreTarget = null;
  12764. restoreQueue = null;
  12765. restoreStateOfTarget(target);
  12766. if (queuedTargets) {
  12767. for (var i = 0; i < queuedTargets.length; i++) {
  12768. restoreStateOfTarget(queuedTargets[i]);
  12769. }
  12770. }
  12771. }
  12772. var enableProfilerTimer = true; // Trace which interactions trigger each commit.
  12773. var enableDeprecatedFlareAPI = false; // Experimental Host Component support.
  12774. var enableFundamentalAPI = false; // Experimental Scope support.
  12775. var warnAboutStringRefs = false;
  12776. // the renderer. Such as when we're dispatching events or if third party
  12777. // libraries need to call batchedUpdates. Eventually, this API will go away when
  12778. // everything is batched by default. We'll then have a similar API to opt-out of
  12779. // scheduled work and instead do synchronous work.
  12780. // Defaults
  12781. var batchedUpdatesImpl = function (fn, bookkeeping) {
  12782. return fn(bookkeeping);
  12783. };
  12784. var discreteUpdatesImpl = function (fn, a, b, c, d) {
  12785. return fn(a, b, c, d);
  12786. };
  12787. var flushDiscreteUpdatesImpl = function () {};
  12788. var batchedEventUpdatesImpl = batchedUpdatesImpl;
  12789. var isInsideEventHandler = false;
  12790. var isBatchingEventUpdates = false;
  12791. function finishEventHandler() {
  12792. // Here we wait until all updates have propagated, which is important
  12793. // when using controlled components within layers:
  12794. // https://github.com/facebook/react/issues/1698
  12795. // Then we restore state of any controlled component.
  12796. var controlledComponentsHavePendingUpdates = needsStateRestore();
  12797. if (controlledComponentsHavePendingUpdates) {
  12798. // If a controlled event was fired, we may need to restore the state of
  12799. // the DOM node back to the controlled value. This is necessary when React
  12800. // bails out of the update without touching the DOM.
  12801. flushDiscreteUpdatesImpl();
  12802. restoreStateIfNeeded();
  12803. }
  12804. }
  12805. function batchedUpdates(fn, bookkeeping) {
  12806. if (isInsideEventHandler) {
  12807. // If we are currently inside another batch, we need to wait until it
  12808. // fully completes before restoring state.
  12809. return fn(bookkeeping);
  12810. }
  12811. isInsideEventHandler = true;
  12812. try {
  12813. return batchedUpdatesImpl(fn, bookkeeping);
  12814. } finally {
  12815. isInsideEventHandler = false;
  12816. finishEventHandler();
  12817. }
  12818. }
  12819. function batchedEventUpdates(fn, a, b) {
  12820. if (isBatchingEventUpdates) {
  12821. // If we are currently inside another batch, we need to wait until it
  12822. // fully completes before restoring state.
  12823. return fn(a, b);
  12824. }
  12825. isBatchingEventUpdates = true;
  12826. try {
  12827. return batchedEventUpdatesImpl(fn, a, b);
  12828. } finally {
  12829. isBatchingEventUpdates = false;
  12830. finishEventHandler();
  12831. }
  12832. } // This is for the React Flare event system
  12833. function discreteUpdates(fn, a, b, c, d) {
  12834. var prevIsInsideEventHandler = isInsideEventHandler;
  12835. isInsideEventHandler = true;
  12836. try {
  12837. return discreteUpdatesImpl(fn, a, b, c, d);
  12838. } finally {
  12839. isInsideEventHandler = prevIsInsideEventHandler;
  12840. if (!isInsideEventHandler) {
  12841. finishEventHandler();
  12842. }
  12843. }
  12844. }
  12845. function flushDiscreteUpdatesIfNeeded(timeStamp) {
  12846. // event.timeStamp isn't overly reliable due to inconsistencies in
  12847. // how different browsers have historically provided the time stamp.
  12848. // Some browsers provide high-resolution time stamps for all events,
  12849. // some provide low-resolution time stamps for all events. FF < 52
  12850. // even mixes both time stamps together. Some browsers even report
  12851. // negative time stamps or time stamps that are 0 (iOS9) in some cases.
  12852. // Given we are only comparing two time stamps with equality (!==),
  12853. // we are safe from the resolution differences. If the time stamp is 0
  12854. // we bail-out of preventing the flush, which can affect semantics,
  12855. // such as if an earlier flush removes or adds event listeners that
  12856. // are fired in the subsequent flush. However, this is the same
  12857. // behaviour as we had before this change, so the risks are low.
  12858. if (!isInsideEventHandler && (!enableDeprecatedFlareAPI )) {
  12859. flushDiscreteUpdatesImpl();
  12860. }
  12861. }
  12862. function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
  12863. batchedUpdatesImpl = _batchedUpdatesImpl;
  12864. discreteUpdatesImpl = _discreteUpdatesImpl;
  12865. flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
  12866. batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
  12867. }
  12868. var DiscreteEvent = 0;
  12869. var UserBlockingEvent = 1;
  12870. var ContinuousEvent = 2;
  12871. // A reserved attribute.
  12872. // It is handled by React separately and shouldn't be written to the DOM.
  12873. var RESERVED = 0; // A simple string attribute.
  12874. // Attributes that aren't in the whitelist are presumed to have this type.
  12875. var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
  12876. // "enumerated" attributes with "true" and "false" as possible values.
  12877. // When true, it should be set to a "true" string.
  12878. // When false, it should be set to a "false" string.
  12879. var BOOLEANISH_STRING = 2; // A real boolean attribute.
  12880. // When true, it should be present (set either to an empty string or its name).
  12881. // When false, it should be omitted.
  12882. var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
  12883. // When true, it should be present (set either to an empty string or its name).
  12884. // When false, it should be omitted.
  12885. // For any other value, should be present with that value.
  12886. var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
  12887. // When falsy, it should be removed.
  12888. var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
  12889. // When falsy, it should be removed.
  12890. var POSITIVE_NUMERIC = 6;
  12891. /* eslint-disable max-len */
  12892. var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
  12893. /* eslint-enable max-len */
  12894. var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
  12895. var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
  12896. var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
  12897. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12898. var illegalAttributeNameCache = {};
  12899. var validatedAttributeNameCache = {};
  12900. function isAttributeNameSafe(attributeName) {
  12901. if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
  12902. return true;
  12903. }
  12904. if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
  12905. return false;
  12906. }
  12907. if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
  12908. validatedAttributeNameCache[attributeName] = true;
  12909. return true;
  12910. }
  12911. illegalAttributeNameCache[attributeName] = true;
  12912. {
  12913. error('Invalid attribute name: `%s`', attributeName);
  12914. }
  12915. return false;
  12916. }
  12917. function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
  12918. if (propertyInfo !== null) {
  12919. return propertyInfo.type === RESERVED;
  12920. }
  12921. if (isCustomComponentTag) {
  12922. return false;
  12923. }
  12924. if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
  12925. return true;
  12926. }
  12927. return false;
  12928. }
  12929. function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
  12930. if (propertyInfo !== null && propertyInfo.type === RESERVED) {
  12931. return false;
  12932. }
  12933. switch (typeof value) {
  12934. case 'function': // $FlowIssue symbol is perfectly valid here
  12935. case 'symbol':
  12936. // eslint-disable-line
  12937. return true;
  12938. case 'boolean':
  12939. {
  12940. if (isCustomComponentTag) {
  12941. return false;
  12942. }
  12943. if (propertyInfo !== null) {
  12944. return !propertyInfo.acceptsBooleans;
  12945. } else {
  12946. var prefix = name.toLowerCase().slice(0, 5);
  12947. return prefix !== 'data-' && prefix !== 'aria-';
  12948. }
  12949. }
  12950. default:
  12951. return false;
  12952. }
  12953. }
  12954. function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
  12955. if (value === null || typeof value === 'undefined') {
  12956. return true;
  12957. }
  12958. if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
  12959. return true;
  12960. }
  12961. if (isCustomComponentTag) {
  12962. return false;
  12963. }
  12964. if (propertyInfo !== null) {
  12965. switch (propertyInfo.type) {
  12966. case BOOLEAN:
  12967. return !value;
  12968. case OVERLOADED_BOOLEAN:
  12969. return value === false;
  12970. case NUMERIC:
  12971. return isNaN(value);
  12972. case POSITIVE_NUMERIC:
  12973. return isNaN(value) || value < 1;
  12974. }
  12975. }
  12976. return false;
  12977. }
  12978. function getPropertyInfo(name) {
  12979. return properties.hasOwnProperty(name) ? properties[name] : null;
  12980. }
  12981. function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {
  12982. this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
  12983. this.attributeName = attributeName;
  12984. this.attributeNamespace = attributeNamespace;
  12985. this.mustUseProperty = mustUseProperty;
  12986. this.propertyName = name;
  12987. this.type = type;
  12988. this.sanitizeURL = sanitizeURL;
  12989. } // When adding attributes to this list, be sure to also add them to
  12990. // the `possibleStandardNames` module to ensure casing and incorrect
  12991. // name warnings.
  12992. var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
  12993. var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
  12994. // elements (not just inputs). Now that ReactDOMInput assigns to the
  12995. // defaultValue property -- do we need this?
  12996. 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
  12997. reservedProps.forEach(function (name) {
  12998. properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
  12999. name, // attributeName
  13000. null, // attributeNamespace
  13001. false);
  13002. }); // A few React string attributes have a different name.
  13003. // This is a mapping from React prop names to the attribute names.
  13004. [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
  13005. var name = _ref[0],
  13006. attributeName = _ref[1];
  13007. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  13008. attributeName, // attributeName
  13009. null, // attributeNamespace
  13010. false);
  13011. }); // These are "enumerated" HTML attributes that accept "true" and "false".
  13012. // In React, we let users pass `true` and `false` even though technically
  13013. // these aren't boolean attributes (they are coerced to strings).
  13014. ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
  13015. properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  13016. name.toLowerCase(), // attributeName
  13017. null, // attributeNamespace
  13018. false);
  13019. }); // These are "enumerated" SVG attributes that accept "true" and "false".
  13020. // In React, we let users pass `true` and `false` even though technically
  13021. // these aren't boolean attributes (they are coerced to strings).
  13022. // Since these are SVG attributes, their attribute names are case-sensitive.
  13023. ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
  13024. properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  13025. name, // attributeName
  13026. null, // attributeNamespace
  13027. false);
  13028. }); // These are HTML boolean attributes.
  13029. ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
  13030. // on the client side because the browsers are inconsistent. Instead we call focus().
  13031. 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
  13032. 'itemScope'].forEach(function (name) {
  13033. properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
  13034. name.toLowerCase(), // attributeName
  13035. null, // attributeNamespace
  13036. false);
  13037. }); // These are the few React props that we set as DOM properties
  13038. // rather than attributes. These are all booleans.
  13039. ['checked', // Note: `option.selected` is not updated if `select.multiple` is
  13040. // disabled with `removeAttribute`. We have special logic for handling this.
  13041. 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,
  13042. // you'll need to set attributeName to name.toLowerCase()
  13043. // instead in the assignment below.
  13044. ].forEach(function (name) {
  13045. properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
  13046. name, // attributeName
  13047. null, // attributeNamespace
  13048. false);
  13049. }); // These are HTML attributes that are "overloaded booleans": they behave like
  13050. // booleans, but can also accept a string value.
  13051. ['capture', 'download' // NOTE: if you add a camelCased prop to this list,
  13052. // you'll need to set attributeName to name.toLowerCase()
  13053. // instead in the assignment below.
  13054. ].forEach(function (name) {
  13055. properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
  13056. name, // attributeName
  13057. null, // attributeNamespace
  13058. false);
  13059. }); // These are HTML attributes that must be positive numbers.
  13060. ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,
  13061. // you'll need to set attributeName to name.toLowerCase()
  13062. // instead in the assignment below.
  13063. ].forEach(function (name) {
  13064. properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
  13065. name, // attributeName
  13066. null, // attributeNamespace
  13067. false);
  13068. }); // These are HTML attributes that must be numbers.
  13069. ['rowSpan', 'start'].forEach(function (name) {
  13070. properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
  13071. name.toLowerCase(), // attributeName
  13072. null, // attributeNamespace
  13073. false);
  13074. });
  13075. var CAMELIZE = /[\-\:]([a-z])/g;
  13076. var capitalize = function (token) {
  13077. return token[1].toUpperCase();
  13078. }; // This is a list of all SVG attributes that need special casing, namespacing,
  13079. // or boolean value assignment. Regular attributes that just accept strings
  13080. // and have the same names are omitted, just like in the HTML whitelist.
  13081. // Some of these attributes can be hard to find. This list was created by
  13082. // scraping the MDN documentation.
  13083. ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,
  13084. // you'll need to set attributeName to name.toLowerCase()
  13085. // instead in the assignment below.
  13086. ].forEach(function (attributeName) {
  13087. var name = attributeName.replace(CAMELIZE, capitalize);
  13088. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  13089. attributeName, null, // attributeNamespace
  13090. false);
  13091. }); // String SVG attributes with the xlink namespace.
  13092. ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,
  13093. // you'll need to set attributeName to name.toLowerCase()
  13094. // instead in the assignment below.
  13095. ].forEach(function (attributeName) {
  13096. var name = attributeName.replace(CAMELIZE, capitalize);
  13097. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  13098. attributeName, 'http://www.w3.org/1999/xlink', false);
  13099. }); // String SVG attributes with the xml namespace.
  13100. ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,
  13101. // you'll need to set attributeName to name.toLowerCase()
  13102. // instead in the assignment below.
  13103. ].forEach(function (attributeName) {
  13104. var name = attributeName.replace(CAMELIZE, capitalize);
  13105. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  13106. attributeName, 'http://www.w3.org/XML/1998/namespace', false);
  13107. }); // These attribute exists both in HTML and SVG.
  13108. // The attribute name is case-sensitive in SVG so we can't just use
  13109. // the React name like we do for attributes that exist only in HTML.
  13110. ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
  13111. properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  13112. attributeName.toLowerCase(), // attributeName
  13113. null, // attributeNamespace
  13114. false);
  13115. }); // These attributes accept URLs. These must not allow javascript: URLS.
  13116. // These will also need to accept Trusted Types object in the future.
  13117. var xlinkHref = 'xlinkHref';
  13118. properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
  13119. 'xlink:href', 'http://www.w3.org/1999/xlink', true);
  13120. ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
  13121. properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  13122. attributeName.toLowerCase(), // attributeName
  13123. null, // attributeNamespace
  13124. true);
  13125. });
  13126. var ReactDebugCurrentFrame = null;
  13127. {
  13128. ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
  13129. } // A javascript: URL can contain leading C0 control or \u0020 SPACE,
  13130. // and any newline or tab are filtered out as if they're not part of the URL.
  13131. // https://url.spec.whatwg.org/#url-parsing
  13132. // Tab or newline are defined as \r\n\t:
  13133. // https://infra.spec.whatwg.org/#ascii-tab-or-newline
  13134. // A C0 control is a code point in the range \u0000 NULL to \u001F
  13135. // INFORMATION SEPARATOR ONE, inclusive:
  13136. // https://infra.spec.whatwg.org/#c0-control-or-space
  13137. /* eslint-disable max-len */
  13138. var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
  13139. var didWarn = false;
  13140. function sanitizeURL(url) {
  13141. {
  13142. if (!didWarn && isJavaScriptProtocol.test(url)) {
  13143. didWarn = true;
  13144. error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
  13145. }
  13146. }
  13147. }
  13148. /**
  13149. * Get the value for a property on a node. Only used in DEV for SSR validation.
  13150. * The "expected" argument is used as a hint of what the expected value is.
  13151. * Some properties have multiple equivalent values.
  13152. */
  13153. function getValueForProperty(node, name, expected, propertyInfo) {
  13154. {
  13155. if (propertyInfo.mustUseProperty) {
  13156. var propertyName = propertyInfo.propertyName;
  13157. return node[propertyName];
  13158. } else {
  13159. if ( propertyInfo.sanitizeURL) {
  13160. // If we haven't fully disabled javascript: URLs, and if
  13161. // the hydration is successful of a javascript: URL, we
  13162. // still want to warn on the client.
  13163. sanitizeURL('' + expected);
  13164. }
  13165. var attributeName = propertyInfo.attributeName;
  13166. var stringValue = null;
  13167. if (propertyInfo.type === OVERLOADED_BOOLEAN) {
  13168. if (node.hasAttribute(attributeName)) {
  13169. var value = node.getAttribute(attributeName);
  13170. if (value === '') {
  13171. return true;
  13172. }
  13173. if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
  13174. return value;
  13175. }
  13176. if (value === '' + expected) {
  13177. return expected;
  13178. }
  13179. return value;
  13180. }
  13181. } else if (node.hasAttribute(attributeName)) {
  13182. if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
  13183. // We had an attribute but shouldn't have had one, so read it
  13184. // for the error message.
  13185. return node.getAttribute(attributeName);
  13186. }
  13187. if (propertyInfo.type === BOOLEAN) {
  13188. // If this was a boolean, it doesn't matter what the value is
  13189. // the fact that we have it is the same as the expected.
  13190. return expected;
  13191. } // Even if this property uses a namespace we use getAttribute
  13192. // because we assume its namespaced name is the same as our config.
  13193. // To use getAttributeNS we need the local name which we don't have
  13194. // in our config atm.
  13195. stringValue = node.getAttribute(attributeName);
  13196. }
  13197. if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
  13198. return stringValue === null ? expected : stringValue;
  13199. } else if (stringValue === '' + expected) {
  13200. return expected;
  13201. } else {
  13202. return stringValue;
  13203. }
  13204. }
  13205. }
  13206. }
  13207. /**
  13208. * Get the value for a attribute on a node. Only used in DEV for SSR validation.
  13209. * The third argument is used as a hint of what the expected value is. Some
  13210. * attributes have multiple equivalent values.
  13211. */
  13212. function getValueForAttribute(node, name, expected) {
  13213. {
  13214. if (!isAttributeNameSafe(name)) {
  13215. return;
  13216. }
  13217. if (!node.hasAttribute(name)) {
  13218. return expected === undefined ? undefined : null;
  13219. }
  13220. var value = node.getAttribute(name);
  13221. if (value === '' + expected) {
  13222. return expected;
  13223. }
  13224. return value;
  13225. }
  13226. }
  13227. /**
  13228. * Sets the value for a property on a node.
  13229. *
  13230. * @param {DOMElement} node
  13231. * @param {string} name
  13232. * @param {*} value
  13233. */
  13234. function setValueForProperty(node, name, value, isCustomComponentTag) {
  13235. var propertyInfo = getPropertyInfo(name);
  13236. if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
  13237. return;
  13238. }
  13239. if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
  13240. value = null;
  13241. } // If the prop isn't in the special list, treat it as a simple attribute.
  13242. if (isCustomComponentTag || propertyInfo === null) {
  13243. if (isAttributeNameSafe(name)) {
  13244. var _attributeName = name;
  13245. if (value === null) {
  13246. node.removeAttribute(_attributeName);
  13247. } else {
  13248. node.setAttribute(_attributeName, '' + value);
  13249. }
  13250. }
  13251. return;
  13252. }
  13253. var mustUseProperty = propertyInfo.mustUseProperty;
  13254. if (mustUseProperty) {
  13255. var propertyName = propertyInfo.propertyName;
  13256. if (value === null) {
  13257. var type = propertyInfo.type;
  13258. node[propertyName] = type === BOOLEAN ? false : '';
  13259. } else {
  13260. // Contrary to `setAttribute`, object properties are properly
  13261. // `toString`ed by IE8/9.
  13262. node[propertyName] = value;
  13263. }
  13264. return;
  13265. } // The rest are treated as attributes with special cases.
  13266. var attributeName = propertyInfo.attributeName,
  13267. attributeNamespace = propertyInfo.attributeNamespace;
  13268. if (value === null) {
  13269. node.removeAttribute(attributeName);
  13270. } else {
  13271. var _type = propertyInfo.type;
  13272. var attributeValue;
  13273. if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
  13274. // If attribute type is boolean, we know for sure it won't be an execution sink
  13275. // and we won't require Trusted Type here.
  13276. attributeValue = '';
  13277. } else {
  13278. // `setAttribute` with objects becomes only `[object]` in IE8/9,
  13279. // ('' + value) makes it output the correct toString()-value.
  13280. {
  13281. attributeValue = '' + value;
  13282. }
  13283. if (propertyInfo.sanitizeURL) {
  13284. sanitizeURL(attributeValue.toString());
  13285. }
  13286. }
  13287. if (attributeNamespace) {
  13288. node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
  13289. } else {
  13290. node.setAttribute(attributeName, attributeValue);
  13291. }
  13292. }
  13293. }
  13294. var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
  13295. function describeComponentFrame (name, source, ownerName) {
  13296. var sourceInfo = '';
  13297. if (source) {
  13298. var path = source.fileName;
  13299. var fileName = path.replace(BEFORE_SLASH_RE, '');
  13300. {
  13301. // In DEV, include code for a common special case:
  13302. // prefer "folder/index.js" instead of just "index.js".
  13303. if (/^index\./.test(fileName)) {
  13304. var match = path.match(BEFORE_SLASH_RE);
  13305. if (match) {
  13306. var pathBeforeSlash = match[1];
  13307. if (pathBeforeSlash) {
  13308. var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
  13309. fileName = folderName + '/' + fileName;
  13310. }
  13311. }
  13312. }
  13313. }
  13314. sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
  13315. } else if (ownerName) {
  13316. sourceInfo = ' (created by ' + ownerName + ')';
  13317. }
  13318. return '\n in ' + (name || 'Unknown') + sourceInfo;
  13319. }
  13320. // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  13321. // nor polyfill, then a plain number is used for performance.
  13322. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  13323. var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
  13324. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  13325. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  13326. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  13327. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  13328. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  13329. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
  13330. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  13331. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  13332. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  13333. var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
  13334. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  13335. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  13336. var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
  13337. var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  13338. var FAUX_ITERATOR_SYMBOL = '@@iterator';
  13339. function getIteratorFn(maybeIterable) {
  13340. if (maybeIterable === null || typeof maybeIterable !== 'object') {
  13341. return null;
  13342. }
  13343. var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
  13344. if (typeof maybeIterator === 'function') {
  13345. return maybeIterator;
  13346. }
  13347. return null;
  13348. }
  13349. var Uninitialized = -1;
  13350. var Pending = 0;
  13351. var Resolved = 1;
  13352. var Rejected = 2;
  13353. function refineResolvedLazyComponent(lazyComponent) {
  13354. return lazyComponent._status === Resolved ? lazyComponent._result : null;
  13355. }
  13356. function initializeLazyComponentType(lazyComponent) {
  13357. if (lazyComponent._status === Uninitialized) {
  13358. lazyComponent._status = Pending;
  13359. var ctor = lazyComponent._ctor;
  13360. var thenable = ctor();
  13361. lazyComponent._result = thenable;
  13362. thenable.then(function (moduleObject) {
  13363. if (lazyComponent._status === Pending) {
  13364. var defaultExport = moduleObject.default;
  13365. {
  13366. if (defaultExport === undefined) {
  13367. error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
  13368. }
  13369. }
  13370. lazyComponent._status = Resolved;
  13371. lazyComponent._result = defaultExport;
  13372. }
  13373. }, function (error) {
  13374. if (lazyComponent._status === Pending) {
  13375. lazyComponent._status = Rejected;
  13376. lazyComponent._result = error;
  13377. }
  13378. });
  13379. }
  13380. }
  13381. function getWrappedName(outerType, innerType, wrapperName) {
  13382. var functionName = innerType.displayName || innerType.name || '';
  13383. return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
  13384. }
  13385. function getComponentName(type) {
  13386. if (type == null) {
  13387. // Host root, text node or just invalid type.
  13388. return null;
  13389. }
  13390. {
  13391. if (typeof type.tag === 'number') {
  13392. error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
  13393. }
  13394. }
  13395. if (typeof type === 'function') {
  13396. return type.displayName || type.name || null;
  13397. }
  13398. if (typeof type === 'string') {
  13399. return type;
  13400. }
  13401. switch (type) {
  13402. case REACT_FRAGMENT_TYPE:
  13403. return 'Fragment';
  13404. case REACT_PORTAL_TYPE:
  13405. return 'Portal';
  13406. case REACT_PROFILER_TYPE:
  13407. return "Profiler";
  13408. case REACT_STRICT_MODE_TYPE:
  13409. return 'StrictMode';
  13410. case REACT_SUSPENSE_TYPE:
  13411. return 'Suspense';
  13412. case REACT_SUSPENSE_LIST_TYPE:
  13413. return 'SuspenseList';
  13414. }
  13415. if (typeof type === 'object') {
  13416. switch (type.$$typeof) {
  13417. case REACT_CONTEXT_TYPE:
  13418. return 'Context.Consumer';
  13419. case REACT_PROVIDER_TYPE:
  13420. return 'Context.Provider';
  13421. case REACT_FORWARD_REF_TYPE:
  13422. return getWrappedName(type, type.render, 'ForwardRef');
  13423. case REACT_MEMO_TYPE:
  13424. return getComponentName(type.type);
  13425. case REACT_BLOCK_TYPE:
  13426. return getComponentName(type.render);
  13427. case REACT_LAZY_TYPE:
  13428. {
  13429. var thenable = type;
  13430. var resolvedThenable = refineResolvedLazyComponent(thenable);
  13431. if (resolvedThenable) {
  13432. return getComponentName(resolvedThenable);
  13433. }
  13434. break;
  13435. }
  13436. }
  13437. }
  13438. return null;
  13439. }
  13440. var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
  13441. function describeFiber(fiber) {
  13442. switch (fiber.tag) {
  13443. case HostRoot:
  13444. case HostPortal:
  13445. case HostText:
  13446. case Fragment:
  13447. case ContextProvider:
  13448. case ContextConsumer:
  13449. return '';
  13450. default:
  13451. var owner = fiber._debugOwner;
  13452. var source = fiber._debugSource;
  13453. var name = getComponentName(fiber.type);
  13454. var ownerName = null;
  13455. if (owner) {
  13456. ownerName = getComponentName(owner.type);
  13457. }
  13458. return describeComponentFrame(name, source, ownerName);
  13459. }
  13460. }
  13461. function getStackByFiberInDevAndProd(workInProgress) {
  13462. var info = '';
  13463. var node = workInProgress;
  13464. do {
  13465. info += describeFiber(node);
  13466. node = node.return;
  13467. } while (node);
  13468. return info;
  13469. }
  13470. var current = null;
  13471. var isRendering = false;
  13472. function getCurrentFiberOwnerNameInDevOrNull() {
  13473. {
  13474. if (current === null) {
  13475. return null;
  13476. }
  13477. var owner = current._debugOwner;
  13478. if (owner !== null && typeof owner !== 'undefined') {
  13479. return getComponentName(owner.type);
  13480. }
  13481. }
  13482. return null;
  13483. }
  13484. function getCurrentFiberStackInDev() {
  13485. {
  13486. if (current === null) {
  13487. return '';
  13488. } // Safe because if current fiber exists, we are reconciling,
  13489. // and it is guaranteed to be the work-in-progress version.
  13490. return getStackByFiberInDevAndProd(current);
  13491. }
  13492. }
  13493. function resetCurrentFiber() {
  13494. {
  13495. ReactDebugCurrentFrame$1.getCurrentStack = null;
  13496. current = null;
  13497. isRendering = false;
  13498. }
  13499. }
  13500. function setCurrentFiber(fiber) {
  13501. {
  13502. ReactDebugCurrentFrame$1.getCurrentStack = getCurrentFiberStackInDev;
  13503. current = fiber;
  13504. isRendering = false;
  13505. }
  13506. }
  13507. function setIsRendering(rendering) {
  13508. {
  13509. isRendering = rendering;
  13510. }
  13511. }
  13512. // Flow does not allow string concatenation of most non-string types. To work
  13513. // around this limitation, we use an opaque type that can only be obtained by
  13514. // passing the value through getToStringValue first.
  13515. function toString(value) {
  13516. return '' + value;
  13517. }
  13518. function getToStringValue(value) {
  13519. switch (typeof value) {
  13520. case 'boolean':
  13521. case 'number':
  13522. case 'object':
  13523. case 'string':
  13524. case 'undefined':
  13525. return value;
  13526. default:
  13527. // function, symbol are assigned as empty strings
  13528. return '';
  13529. }
  13530. }
  13531. var ReactDebugCurrentFrame$2 = null;
  13532. var ReactControlledValuePropTypes = {
  13533. checkPropTypes: null
  13534. };
  13535. {
  13536. ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
  13537. var hasReadOnlyValue = {
  13538. button: true,
  13539. checkbox: true,
  13540. image: true,
  13541. hidden: true,
  13542. radio: true,
  13543. reset: true,
  13544. submit: true
  13545. };
  13546. var propTypes = {
  13547. value: function (props, propName, componentName) {
  13548. if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {
  13549. return null;
  13550. }
  13551. return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
  13552. },
  13553. checked: function (props, propName, componentName) {
  13554. if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {
  13555. return null;
  13556. }
  13557. return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
  13558. }
  13559. };
  13560. /**
  13561. * Provide a linked `value` attribute for controlled forms. You should not use
  13562. * this outside of the ReactDOM controlled form components.
  13563. */
  13564. ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
  13565. checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
  13566. };
  13567. }
  13568. function isCheckable(elem) {
  13569. var type = elem.type;
  13570. var nodeName = elem.nodeName;
  13571. return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
  13572. }
  13573. function getTracker(node) {
  13574. return node._valueTracker;
  13575. }
  13576. function detachTracker(node) {
  13577. node._valueTracker = null;
  13578. }
  13579. function getValueFromNode(node) {
  13580. var value = '';
  13581. if (!node) {
  13582. return value;
  13583. }
  13584. if (isCheckable(node)) {
  13585. value = node.checked ? 'true' : 'false';
  13586. } else {
  13587. value = node.value;
  13588. }
  13589. return value;
  13590. }
  13591. function trackValueOnNode(node) {
  13592. var valueField = isCheckable(node) ? 'checked' : 'value';
  13593. var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
  13594. var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail
  13595. // and don't track value will cause over reporting of changes,
  13596. // but it's better then a hard failure
  13597. // (needed for certain tests that spyOn input values and Safari)
  13598. if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
  13599. return;
  13600. }
  13601. var get = descriptor.get,
  13602. set = descriptor.set;
  13603. Object.defineProperty(node, valueField, {
  13604. configurable: true,
  13605. get: function () {
  13606. return get.call(this);
  13607. },
  13608. set: function (value) {
  13609. currentValue = '' + value;
  13610. set.call(this, value);
  13611. }
  13612. }); // We could've passed this the first time
  13613. // but it triggers a bug in IE11 and Edge 14/15.
  13614. // Calling defineProperty() again should be equivalent.
  13615. // https://github.com/facebook/react/issues/11768
  13616. Object.defineProperty(node, valueField, {
  13617. enumerable: descriptor.enumerable
  13618. });
  13619. var tracker = {
  13620. getValue: function () {
  13621. return currentValue;
  13622. },
  13623. setValue: function (value) {
  13624. currentValue = '' + value;
  13625. },
  13626. stopTracking: function () {
  13627. detachTracker(node);
  13628. delete node[valueField];
  13629. }
  13630. };
  13631. return tracker;
  13632. }
  13633. function track(node) {
  13634. if (getTracker(node)) {
  13635. return;
  13636. } // TODO: Once it's just Fiber we can move this to node._wrapperState
  13637. node._valueTracker = trackValueOnNode(node);
  13638. }
  13639. function updateValueIfChanged(node) {
  13640. if (!node) {
  13641. return false;
  13642. }
  13643. var tracker = getTracker(node); // if there is no tracker at this point it's unlikely
  13644. // that trying again will succeed
  13645. if (!tracker) {
  13646. return true;
  13647. }
  13648. var lastValue = tracker.getValue();
  13649. var nextValue = getValueFromNode(node);
  13650. if (nextValue !== lastValue) {
  13651. tracker.setValue(nextValue);
  13652. return true;
  13653. }
  13654. return false;
  13655. }
  13656. var didWarnValueDefaultValue = false;
  13657. var didWarnCheckedDefaultChecked = false;
  13658. var didWarnControlledToUncontrolled = false;
  13659. var didWarnUncontrolledToControlled = false;
  13660. function isControlled(props) {
  13661. var usesChecked = props.type === 'checkbox' || props.type === 'radio';
  13662. return usesChecked ? props.checked != null : props.value != null;
  13663. }
  13664. /**
  13665. * Implements an <input> host component that allows setting these optional
  13666. * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
  13667. *
  13668. * If `checked` or `value` are not supplied (or null/undefined), user actions
  13669. * that affect the checked state or value will trigger updates to the element.
  13670. *
  13671. * If they are supplied (and not null/undefined), the rendered element will not
  13672. * trigger updates to the element. Instead, the props must change in order for
  13673. * the rendered element to be updated.
  13674. *
  13675. * The rendered element will be initialized as unchecked (or `defaultChecked`)
  13676. * with an empty value (or `defaultValue`).
  13677. *
  13678. * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
  13679. */
  13680. function getHostProps(element, props) {
  13681. var node = element;
  13682. var checked = props.checked;
  13683. var hostProps = _assign({}, props, {
  13684. defaultChecked: undefined,
  13685. defaultValue: undefined,
  13686. value: undefined,
  13687. checked: checked != null ? checked : node._wrapperState.initialChecked
  13688. });
  13689. return hostProps;
  13690. }
  13691. function initWrapperState(element, props) {
  13692. {
  13693. ReactControlledValuePropTypes.checkPropTypes('input', props);
  13694. if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
  13695. error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
  13696. didWarnCheckedDefaultChecked = true;
  13697. }
  13698. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
  13699. error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
  13700. didWarnValueDefaultValue = true;
  13701. }
  13702. }
  13703. var node = element;
  13704. var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
  13705. node._wrapperState = {
  13706. initialChecked: props.checked != null ? props.checked : props.defaultChecked,
  13707. initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
  13708. controlled: isControlled(props)
  13709. };
  13710. }
  13711. function updateChecked(element, props) {
  13712. var node = element;
  13713. var checked = props.checked;
  13714. if (checked != null) {
  13715. setValueForProperty(node, 'checked', checked, false);
  13716. }
  13717. }
  13718. function updateWrapper(element, props) {
  13719. var node = element;
  13720. {
  13721. var controlled = isControlled(props);
  13722. if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
  13723. error('A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
  13724. didWarnUncontrolledToControlled = true;
  13725. }
  13726. if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
  13727. error('A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
  13728. didWarnControlledToUncontrolled = true;
  13729. }
  13730. }
  13731. updateChecked(element, props);
  13732. var value = getToStringValue(props.value);
  13733. var type = props.type;
  13734. if (value != null) {
  13735. if (type === 'number') {
  13736. if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.
  13737. // eslint-disable-next-line
  13738. node.value != value) {
  13739. node.value = toString(value);
  13740. }
  13741. } else if (node.value !== toString(value)) {
  13742. node.value = toString(value);
  13743. }
  13744. } else if (type === 'submit' || type === 'reset') {
  13745. // Submit/reset inputs need the attribute removed completely to avoid
  13746. // blank-text buttons.
  13747. node.removeAttribute('value');
  13748. return;
  13749. }
  13750. {
  13751. // When syncing the value attribute, the value comes from a cascade of
  13752. // properties:
  13753. // 1. The value React property
  13754. // 2. The defaultValue React property
  13755. // 3. Otherwise there should be no change
  13756. if (props.hasOwnProperty('value')) {
  13757. setDefaultValue(node, props.type, value);
  13758. } else if (props.hasOwnProperty('defaultValue')) {
  13759. setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
  13760. }
  13761. }
  13762. {
  13763. // When syncing the checked attribute, it only changes when it needs
  13764. // to be removed, such as transitioning from a checkbox into a text input
  13765. if (props.checked == null && props.defaultChecked != null) {
  13766. node.defaultChecked = !!props.defaultChecked;
  13767. }
  13768. }
  13769. }
  13770. function postMountWrapper(element, props, isHydrating) {
  13771. var node = element; // Do not assign value if it is already set. This prevents user text input
  13772. // from being lost during SSR hydration.
  13773. if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
  13774. var type = props.type;
  13775. var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the
  13776. // default value provided by the browser. See: #12872
  13777. if (isButton && (props.value === undefined || props.value === null)) {
  13778. return;
  13779. }
  13780. var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input
  13781. // from being lost during SSR hydration.
  13782. if (!isHydrating) {
  13783. {
  13784. // When syncing the value attribute, the value property should use
  13785. // the wrapperState._initialValue property. This uses:
  13786. //
  13787. // 1. The value React property when present
  13788. // 2. The defaultValue React property when present
  13789. // 3. An empty string
  13790. if (initialValue !== node.value) {
  13791. node.value = initialValue;
  13792. }
  13793. }
  13794. }
  13795. {
  13796. // Otherwise, the value attribute is synchronized to the property,
  13797. // so we assign defaultValue to the same thing as the value property
  13798. // assignment step above.
  13799. node.defaultValue = initialValue;
  13800. }
  13801. } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
  13802. // this is needed to work around a chrome bug where setting defaultChecked
  13803. // will sometimes influence the value of checked (even after detachment).
  13804. // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
  13805. // We need to temporarily unset name to avoid disrupting radio button groups.
  13806. var name = node.name;
  13807. if (name !== '') {
  13808. node.name = '';
  13809. }
  13810. {
  13811. // When syncing the checked attribute, both the checked property and
  13812. // attribute are assigned at the same time using defaultChecked. This uses:
  13813. //
  13814. // 1. The checked React property when present
  13815. // 2. The defaultChecked React property when present
  13816. // 3. Otherwise, false
  13817. node.defaultChecked = !node.defaultChecked;
  13818. node.defaultChecked = !!node._wrapperState.initialChecked;
  13819. }
  13820. if (name !== '') {
  13821. node.name = name;
  13822. }
  13823. }
  13824. function restoreControlledState(element, props) {
  13825. var node = element;
  13826. updateWrapper(node, props);
  13827. updateNamedCousins(node, props);
  13828. }
  13829. function updateNamedCousins(rootNode, props) {
  13830. var name = props.name;
  13831. if (props.type === 'radio' && name != null) {
  13832. var queryRoot = rootNode;
  13833. while (queryRoot.parentNode) {
  13834. queryRoot = queryRoot.parentNode;
  13835. } // If `rootNode.form` was non-null, then we could try `form.elements`,
  13836. // but that sometimes behaves strangely in IE8. We could also try using
  13837. // `form.getElementsByName`, but that will only return direct children
  13838. // and won't include inputs that use the HTML5 `form=` attribute. Since
  13839. // the input might not even be in a form. It might not even be in the
  13840. // document. Let's just use the local `querySelectorAll` to ensure we don't
  13841. // miss anything.
  13842. var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
  13843. for (var i = 0; i < group.length; i++) {
  13844. var otherNode = group[i];
  13845. if (otherNode === rootNode || otherNode.form !== rootNode.form) {
  13846. continue;
  13847. } // This will throw if radio buttons rendered by different copies of React
  13848. // and the same name are rendered into the same form (same as #1939).
  13849. // That's probably okay; we don't support it just as we don't support
  13850. // mixing React radio buttons with non-React ones.
  13851. var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
  13852. if (!otherProps) {
  13853. {
  13854. throw Error( "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." );
  13855. }
  13856. } // We need update the tracked value on the named cousin since the value
  13857. // was changed but the input saw no event or value set
  13858. updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that
  13859. // was previously checked to update will cause it to be come re-checked
  13860. // as appropriate.
  13861. updateWrapper(otherNode, otherProps);
  13862. }
  13863. }
  13864. } // In Chrome, assigning defaultValue to certain input types triggers input validation.
  13865. // For number inputs, the display value loses trailing decimal points. For email inputs,
  13866. // Chrome raises "The specified value <x> is not a valid email address".
  13867. //
  13868. // Here we check to see if the defaultValue has actually changed, avoiding these problems
  13869. // when the user is inputting text
  13870. //
  13871. // https://github.com/facebook/react/issues/7253
  13872. function setDefaultValue(node, type, value) {
  13873. if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
  13874. type !== 'number' || node.ownerDocument.activeElement !== node) {
  13875. if (value == null) {
  13876. node.defaultValue = toString(node._wrapperState.initialValue);
  13877. } else if (node.defaultValue !== toString(value)) {
  13878. node.defaultValue = toString(value);
  13879. }
  13880. }
  13881. }
  13882. var didWarnSelectedSetOnOption = false;
  13883. var didWarnInvalidChild = false;
  13884. function flattenChildren(children) {
  13885. var content = ''; // Flatten children. We'll warn if they are invalid
  13886. // during validateProps() which runs for hydration too.
  13887. // Note that this would throw on non-element objects.
  13888. // Elements are stringified (which is normally irrelevant
  13889. // but matters for <fbt>).
  13890. React.Children.forEach(children, function (child) {
  13891. if (child == null) {
  13892. return;
  13893. }
  13894. content += child; // Note: we don't warn about invalid children here.
  13895. // Instead, this is done separately below so that
  13896. // it happens during the hydration codepath too.
  13897. });
  13898. return content;
  13899. }
  13900. /**
  13901. * Implements an <option> host component that warns when `selected` is set.
  13902. */
  13903. function validateProps(element, props) {
  13904. {
  13905. // This mirrors the codepath above, but runs for hydration too.
  13906. // Warn about invalid children here so that client and hydration are consistent.
  13907. // TODO: this seems like it could cause a DEV-only throw for hydration
  13908. // if children contains a non-element object. We should try to avoid that.
  13909. if (typeof props.children === 'object' && props.children !== null) {
  13910. React.Children.forEach(props.children, function (child) {
  13911. if (child == null) {
  13912. return;
  13913. }
  13914. if (typeof child === 'string' || typeof child === 'number') {
  13915. return;
  13916. }
  13917. if (typeof child.type !== 'string') {
  13918. return;
  13919. }
  13920. if (!didWarnInvalidChild) {
  13921. didWarnInvalidChild = true;
  13922. error('Only strings and numbers are supported as <option> children.');
  13923. }
  13924. });
  13925. } // TODO: Remove support for `selected` in <option>.
  13926. if (props.selected != null && !didWarnSelectedSetOnOption) {
  13927. error('Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');
  13928. didWarnSelectedSetOnOption = true;
  13929. }
  13930. }
  13931. }
  13932. function postMountWrapper$1(element, props) {
  13933. // value="" should make a value attribute (#6219)
  13934. if (props.value != null) {
  13935. element.setAttribute('value', toString(getToStringValue(props.value)));
  13936. }
  13937. }
  13938. function getHostProps$1(element, props) {
  13939. var hostProps = _assign({
  13940. children: undefined
  13941. }, props);
  13942. var content = flattenChildren(props.children);
  13943. if (content) {
  13944. hostProps.children = content;
  13945. }
  13946. return hostProps;
  13947. }
  13948. var didWarnValueDefaultValue$1;
  13949. {
  13950. didWarnValueDefaultValue$1 = false;
  13951. }
  13952. function getDeclarationErrorAddendum() {
  13953. var ownerName = getCurrentFiberOwnerNameInDevOrNull();
  13954. if (ownerName) {
  13955. return '\n\nCheck the render method of `' + ownerName + '`.';
  13956. }
  13957. return '';
  13958. }
  13959. var valuePropNames = ['value', 'defaultValue'];
  13960. /**
  13961. * Validation function for `value` and `defaultValue`.
  13962. */
  13963. function checkSelectPropTypes(props) {
  13964. {
  13965. ReactControlledValuePropTypes.checkPropTypes('select', props);
  13966. for (var i = 0; i < valuePropNames.length; i++) {
  13967. var propName = valuePropNames[i];
  13968. if (props[propName] == null) {
  13969. continue;
  13970. }
  13971. var isArray = Array.isArray(props[propName]);
  13972. if (props.multiple && !isArray) {
  13973. error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
  13974. } else if (!props.multiple && isArray) {
  13975. error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
  13976. }
  13977. }
  13978. }
  13979. }
  13980. function updateOptions(node, multiple, propValue, setDefaultSelected) {
  13981. var options = node.options;
  13982. if (multiple) {
  13983. var selectedValues = propValue;
  13984. var selectedValue = {};
  13985. for (var i = 0; i < selectedValues.length; i++) {
  13986. // Prefix to avoid chaos with special keys.
  13987. selectedValue['$' + selectedValues[i]] = true;
  13988. }
  13989. for (var _i = 0; _i < options.length; _i++) {
  13990. var selected = selectedValue.hasOwnProperty('$' + options[_i].value);
  13991. if (options[_i].selected !== selected) {
  13992. options[_i].selected = selected;
  13993. }
  13994. if (selected && setDefaultSelected) {
  13995. options[_i].defaultSelected = true;
  13996. }
  13997. }
  13998. } else {
  13999. // Do not set `select.value` as exact behavior isn't consistent across all
  14000. // browsers for all cases.
  14001. var _selectedValue = toString(getToStringValue(propValue));
  14002. var defaultSelected = null;
  14003. for (var _i2 = 0; _i2 < options.length; _i2++) {
  14004. if (options[_i2].value === _selectedValue) {
  14005. options[_i2].selected = true;
  14006. if (setDefaultSelected) {
  14007. options[_i2].defaultSelected = true;
  14008. }
  14009. return;
  14010. }
  14011. if (defaultSelected === null && !options[_i2].disabled) {
  14012. defaultSelected = options[_i2];
  14013. }
  14014. }
  14015. if (defaultSelected !== null) {
  14016. defaultSelected.selected = true;
  14017. }
  14018. }
  14019. }
  14020. /**
  14021. * Implements a <select> host component that allows optionally setting the
  14022. * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
  14023. * stringable. If `multiple` is true, the prop must be an array of stringables.
  14024. *
  14025. * If `value` is not supplied (or null/undefined), user actions that change the
  14026. * selected option will trigger updates to the rendered options.
  14027. *
  14028. * If it is supplied (and not null/undefined), the rendered options will not
  14029. * update in response to user actions. Instead, the `value` prop must change in
  14030. * order for the rendered options to update.
  14031. *
  14032. * If `defaultValue` is provided, any options with the supplied values will be
  14033. * selected.
  14034. */
  14035. function getHostProps$2(element, props) {
  14036. return _assign({}, props, {
  14037. value: undefined
  14038. });
  14039. }
  14040. function initWrapperState$1(element, props) {
  14041. var node = element;
  14042. {
  14043. checkSelectPropTypes(props);
  14044. }
  14045. node._wrapperState = {
  14046. wasMultiple: !!props.multiple
  14047. };
  14048. {
  14049. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
  14050. error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
  14051. didWarnValueDefaultValue$1 = true;
  14052. }
  14053. }
  14054. }
  14055. function postMountWrapper$2(element, props) {
  14056. var node = element;
  14057. node.multiple = !!props.multiple;
  14058. var value = props.value;
  14059. if (value != null) {
  14060. updateOptions(node, !!props.multiple, value, false);
  14061. } else if (props.defaultValue != null) {
  14062. updateOptions(node, !!props.multiple, props.defaultValue, true);
  14063. }
  14064. }
  14065. function postUpdateWrapper(element, props) {
  14066. var node = element;
  14067. var wasMultiple = node._wrapperState.wasMultiple;
  14068. node._wrapperState.wasMultiple = !!props.multiple;
  14069. var value = props.value;
  14070. if (value != null) {
  14071. updateOptions(node, !!props.multiple, value, false);
  14072. } else if (wasMultiple !== !!props.multiple) {
  14073. // For simplicity, reapply `defaultValue` if `multiple` is toggled.
  14074. if (props.defaultValue != null) {
  14075. updateOptions(node, !!props.multiple, props.defaultValue, true);
  14076. } else {
  14077. // Revert the select back to its default unselected state.
  14078. updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
  14079. }
  14080. }
  14081. }
  14082. function restoreControlledState$1(element, props) {
  14083. var node = element;
  14084. var value = props.value;
  14085. if (value != null) {
  14086. updateOptions(node, !!props.multiple, value, false);
  14087. }
  14088. }
  14089. var didWarnValDefaultVal = false;
  14090. /**
  14091. * Implements a <textarea> host component that allows setting `value`, and
  14092. * `defaultValue`. This differs from the traditional DOM API because value is
  14093. * usually set as PCDATA children.
  14094. *
  14095. * If `value` is not supplied (or null/undefined), user actions that affect the
  14096. * value will trigger updates to the element.
  14097. *
  14098. * If `value` is supplied (and not null/undefined), the rendered element will
  14099. * not trigger updates to the element. Instead, the `value` prop must change in
  14100. * order for the rendered element to be updated.
  14101. *
  14102. * The rendered element will be initialized with an empty value, the prop
  14103. * `defaultValue` if specified, or the children content (deprecated).
  14104. */
  14105. function getHostProps$3(element, props) {
  14106. var node = element;
  14107. if (!(props.dangerouslySetInnerHTML == null)) {
  14108. {
  14109. throw Error( "`dangerouslySetInnerHTML` does not make sense on <textarea>." );
  14110. }
  14111. } // Always set children to the same thing. In IE9, the selection range will
  14112. // get reset if `textContent` is mutated. We could add a check in setTextContent
  14113. // to only set the value if/when the value differs from the node value (which would
  14114. // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this
  14115. // solution. The value can be a boolean or object so that's why it's forced
  14116. // to be a string.
  14117. var hostProps = _assign({}, props, {
  14118. value: undefined,
  14119. defaultValue: undefined,
  14120. children: toString(node._wrapperState.initialValue)
  14121. });
  14122. return hostProps;
  14123. }
  14124. function initWrapperState$2(element, props) {
  14125. var node = element;
  14126. {
  14127. ReactControlledValuePropTypes.checkPropTypes('textarea', props);
  14128. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
  14129. error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
  14130. didWarnValDefaultVal = true;
  14131. }
  14132. }
  14133. var initialValue = props.value; // Only bother fetching default value if we're going to use it
  14134. if (initialValue == null) {
  14135. var children = props.children,
  14136. defaultValue = props.defaultValue;
  14137. if (children != null) {
  14138. {
  14139. error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
  14140. }
  14141. {
  14142. if (!(defaultValue == null)) {
  14143. {
  14144. throw Error( "If you supply `defaultValue` on a <textarea>, do not pass children." );
  14145. }
  14146. }
  14147. if (Array.isArray(children)) {
  14148. if (!(children.length <= 1)) {
  14149. {
  14150. throw Error( "<textarea> can only have at most one child." );
  14151. }
  14152. }
  14153. children = children[0];
  14154. }
  14155. defaultValue = children;
  14156. }
  14157. }
  14158. if (defaultValue == null) {
  14159. defaultValue = '';
  14160. }
  14161. initialValue = defaultValue;
  14162. }
  14163. node._wrapperState = {
  14164. initialValue: getToStringValue(initialValue)
  14165. };
  14166. }
  14167. function updateWrapper$1(element, props) {
  14168. var node = element;
  14169. var value = getToStringValue(props.value);
  14170. var defaultValue = getToStringValue(props.defaultValue);
  14171. if (value != null) {
  14172. // Cast `value` to a string to ensure the value is set correctly. While
  14173. // browsers typically do this as necessary, jsdom doesn't.
  14174. var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed
  14175. if (newValue !== node.value) {
  14176. node.value = newValue;
  14177. }
  14178. if (props.defaultValue == null && node.defaultValue !== newValue) {
  14179. node.defaultValue = newValue;
  14180. }
  14181. }
  14182. if (defaultValue != null) {
  14183. node.defaultValue = toString(defaultValue);
  14184. }
  14185. }
  14186. function postMountWrapper$3(element, props) {
  14187. var node = element; // This is in postMount because we need access to the DOM node, which is not
  14188. // available until after the component has mounted.
  14189. var textContent = node.textContent; // Only set node.value if textContent is equal to the expected
  14190. // initial value. In IE10/IE11 there is a bug where the placeholder attribute
  14191. // will populate textContent as well.
  14192. // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
  14193. if (textContent === node._wrapperState.initialValue) {
  14194. if (textContent !== '' && textContent !== null) {
  14195. node.value = textContent;
  14196. }
  14197. }
  14198. }
  14199. function restoreControlledState$2(element, props) {
  14200. // DOM component is still mounted; update
  14201. updateWrapper$1(element, props);
  14202. }
  14203. var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
  14204. var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
  14205. var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
  14206. var Namespaces = {
  14207. html: HTML_NAMESPACE,
  14208. mathml: MATH_NAMESPACE,
  14209. svg: SVG_NAMESPACE
  14210. }; // Assumes there is no parent namespace.
  14211. function getIntrinsicNamespace(type) {
  14212. switch (type) {
  14213. case 'svg':
  14214. return SVG_NAMESPACE;
  14215. case 'math':
  14216. return MATH_NAMESPACE;
  14217. default:
  14218. return HTML_NAMESPACE;
  14219. }
  14220. }
  14221. function getChildNamespace(parentNamespace, type) {
  14222. if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
  14223. // No (or default) parent namespace: potential entry point.
  14224. return getIntrinsicNamespace(type);
  14225. }
  14226. if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
  14227. // We're leaving SVG.
  14228. return HTML_NAMESPACE;
  14229. } // By default, pass namespace below.
  14230. return parentNamespace;
  14231. }
  14232. /* globals MSApp */
  14233. /**
  14234. * Create a function which has 'unsafe' privileges (required by windows8 apps)
  14235. */
  14236. var createMicrosoftUnsafeLocalFunction = function (func) {
  14237. if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
  14238. return function (arg0, arg1, arg2, arg3) {
  14239. MSApp.execUnsafeLocalFunction(function () {
  14240. return func(arg0, arg1, arg2, arg3);
  14241. });
  14242. };
  14243. } else {
  14244. return func;
  14245. }
  14246. };
  14247. var reusableSVGContainer;
  14248. /**
  14249. * Set the innerHTML property of a node
  14250. *
  14251. * @param {DOMElement} node
  14252. * @param {string} html
  14253. * @internal
  14254. */
  14255. var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
  14256. if (node.namespaceURI === Namespaces.svg) {
  14257. if (!('innerHTML' in node)) {
  14258. // IE does not have innerHTML for SVG nodes, so instead we inject the
  14259. // new markup in a temp node and then move the child nodes across into
  14260. // the target node
  14261. reusableSVGContainer = reusableSVGContainer || document.createElement('div');
  14262. reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';
  14263. var svgNode = reusableSVGContainer.firstChild;
  14264. while (node.firstChild) {
  14265. node.removeChild(node.firstChild);
  14266. }
  14267. while (svgNode.firstChild) {
  14268. node.appendChild(svgNode.firstChild);
  14269. }
  14270. return;
  14271. }
  14272. }
  14273. node.innerHTML = html;
  14274. });
  14275. /**
  14276. * HTML nodeType values that represent the type of the node
  14277. */
  14278. var ELEMENT_NODE = 1;
  14279. var TEXT_NODE = 3;
  14280. var COMMENT_NODE = 8;
  14281. var DOCUMENT_NODE = 9;
  14282. var DOCUMENT_FRAGMENT_NODE = 11;
  14283. /**
  14284. * Set the textContent property of a node. For text updates, it's faster
  14285. * to set the `nodeValue` of the Text node directly instead of using
  14286. * `.textContent` which will remove the existing node and create a new one.
  14287. *
  14288. * @param {DOMElement} node
  14289. * @param {string} text
  14290. * @internal
  14291. */
  14292. var setTextContent = function (node, text) {
  14293. if (text) {
  14294. var firstChild = node.firstChild;
  14295. if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
  14296. firstChild.nodeValue = text;
  14297. return;
  14298. }
  14299. }
  14300. node.textContent = text;
  14301. };
  14302. // Do not use the below two methods directly!
  14303. // Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
  14304. // (It is the only module that is allowed to access these methods.)
  14305. function unsafeCastStringToDOMTopLevelType(topLevelType) {
  14306. return topLevelType;
  14307. }
  14308. function unsafeCastDOMTopLevelTypeToString(topLevelType) {
  14309. return topLevelType;
  14310. }
  14311. /**
  14312. * Generate a mapping of standard vendor prefixes using the defined style property and event name.
  14313. *
  14314. * @param {string} styleProp
  14315. * @param {string} eventName
  14316. * @returns {object}
  14317. */
  14318. function makePrefixMap(styleProp, eventName) {
  14319. var prefixes = {};
  14320. prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
  14321. prefixes['Webkit' + styleProp] = 'webkit' + eventName;
  14322. prefixes['Moz' + styleProp] = 'moz' + eventName;
  14323. return prefixes;
  14324. }
  14325. /**
  14326. * A list of event names to a configurable list of vendor prefixes.
  14327. */
  14328. var vendorPrefixes = {
  14329. animationend: makePrefixMap('Animation', 'AnimationEnd'),
  14330. animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
  14331. animationstart: makePrefixMap('Animation', 'AnimationStart'),
  14332. transitionend: makePrefixMap('Transition', 'TransitionEnd')
  14333. };
  14334. /**
  14335. * Event names that have already been detected and prefixed (if applicable).
  14336. */
  14337. var prefixedEventNames = {};
  14338. /**
  14339. * Element to check for prefixes on.
  14340. */
  14341. var style = {};
  14342. /**
  14343. * Bootstrap if a DOM exists.
  14344. */
  14345. if (canUseDOM) {
  14346. style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,
  14347. // the un-prefixed "animation" and "transition" properties are defined on the
  14348. // style object but the events that fire will still be prefixed, so we need
  14349. // to check if the un-prefixed events are usable, and if not remove them from the map.
  14350. if (!('AnimationEvent' in window)) {
  14351. delete vendorPrefixes.animationend.animation;
  14352. delete vendorPrefixes.animationiteration.animation;
  14353. delete vendorPrefixes.animationstart.animation;
  14354. } // Same as above
  14355. if (!('TransitionEvent' in window)) {
  14356. delete vendorPrefixes.transitionend.transition;
  14357. }
  14358. }
  14359. /**
  14360. * Attempts to determine the correct vendor prefixed event name.
  14361. *
  14362. * @param {string} eventName
  14363. * @returns {string}
  14364. */
  14365. function getVendorPrefixedEventName(eventName) {
  14366. if (prefixedEventNames[eventName]) {
  14367. return prefixedEventNames[eventName];
  14368. } else if (!vendorPrefixes[eventName]) {
  14369. return eventName;
  14370. }
  14371. var prefixMap = vendorPrefixes[eventName];
  14372. for (var styleProp in prefixMap) {
  14373. if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
  14374. return prefixedEventNames[eventName] = prefixMap[styleProp];
  14375. }
  14376. }
  14377. return eventName;
  14378. }
  14379. /**
  14380. * To identify top level events in ReactDOM, we use constants defined by this
  14381. * module. This is the only module that uses the unsafe* methods to express
  14382. * that the constants actually correspond to the browser event names. This lets
  14383. * us save some bundle size by avoiding a top level type -> event name map.
  14384. * The rest of ReactDOM code should import top level types from this file.
  14385. */
  14386. var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
  14387. var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
  14388. var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
  14389. var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
  14390. var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
  14391. var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
  14392. var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
  14393. var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
  14394. var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
  14395. var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
  14396. var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
  14397. var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
  14398. var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
  14399. var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
  14400. var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
  14401. var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
  14402. var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
  14403. var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
  14404. var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');
  14405. var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
  14406. var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
  14407. var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
  14408. var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
  14409. var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
  14410. var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
  14411. var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
  14412. var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
  14413. var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
  14414. var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
  14415. var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
  14416. var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
  14417. var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
  14418. var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
  14419. var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');
  14420. var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
  14421. var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');
  14422. var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
  14423. var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
  14424. var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
  14425. var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
  14426. var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
  14427. var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
  14428. var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
  14429. var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');
  14430. var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
  14431. var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
  14432. var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
  14433. var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
  14434. var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
  14435. var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
  14436. var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
  14437. var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
  14438. var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
  14439. var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');
  14440. var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');
  14441. var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');
  14442. var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');
  14443. var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');
  14444. var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');
  14445. var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
  14446. var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
  14447. var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');
  14448. var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
  14449. var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
  14450. var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
  14451. var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
  14452. var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
  14453. var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');
  14454. var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
  14455. var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
  14456. var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
  14457. var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
  14458. var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
  14459. var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
  14460. var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
  14461. var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
  14462. var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
  14463. var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
  14464. var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
  14465. var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements.
  14466. // Note that events in this list will *not* be listened to at the top level
  14467. // unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
  14468. var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];
  14469. function getRawEventName(topLevelType) {
  14470. return unsafeCastDOMTopLevelTypeToString(topLevelType);
  14471. }
  14472. var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // prettier-ignore
  14473. var elementListenerMap = new PossiblyWeakMap();
  14474. function getListenerMapForElement(element) {
  14475. var listenerMap = elementListenerMap.get(element);
  14476. if (listenerMap === undefined) {
  14477. listenerMap = new Map();
  14478. elementListenerMap.set(element, listenerMap);
  14479. }
  14480. return listenerMap;
  14481. }
  14482. /**
  14483. * `ReactInstanceMap` maintains a mapping from a public facing stateful
  14484. * instance (key) and the internal representation (value). This allows public
  14485. * methods to accept the user facing instance as an argument and map them back
  14486. * to internal methods.
  14487. *
  14488. * Note that this module is currently shared and assumed to be stateless.
  14489. * If this becomes an actual Map, that will break.
  14490. */
  14491. function get(key) {
  14492. return key._reactInternalFiber;
  14493. }
  14494. function has(key) {
  14495. return key._reactInternalFiber !== undefined;
  14496. }
  14497. function set(key, value) {
  14498. key._reactInternalFiber = value;
  14499. }
  14500. // Don't change these two values. They're used by React Dev Tools.
  14501. var NoEffect =
  14502. /* */
  14503. 0;
  14504. var PerformedWork =
  14505. /* */
  14506. 1; // You can change the rest (and add more).
  14507. var Placement =
  14508. /* */
  14509. 2;
  14510. var Update =
  14511. /* */
  14512. 4;
  14513. var PlacementAndUpdate =
  14514. /* */
  14515. 6;
  14516. var Deletion =
  14517. /* */
  14518. 8;
  14519. var ContentReset =
  14520. /* */
  14521. 16;
  14522. var Callback =
  14523. /* */
  14524. 32;
  14525. var DidCapture =
  14526. /* */
  14527. 64;
  14528. var Ref =
  14529. /* */
  14530. 128;
  14531. var Snapshot =
  14532. /* */
  14533. 256;
  14534. var Passive =
  14535. /* */
  14536. 512;
  14537. var Hydrating =
  14538. /* */
  14539. 1024;
  14540. var HydratingAndUpdate =
  14541. /* */
  14542. 1028; // Passive & Update & Callback & Ref & Snapshot
  14543. var LifecycleEffectMask =
  14544. /* */
  14545. 932; // Union of all host effects
  14546. var HostEffectMask =
  14547. /* */
  14548. 2047;
  14549. var Incomplete =
  14550. /* */
  14551. 2048;
  14552. var ShouldCapture =
  14553. /* */
  14554. 4096;
  14555. var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
  14556. function getNearestMountedFiber(fiber) {
  14557. var node = fiber;
  14558. var nearestMounted = fiber;
  14559. if (!fiber.alternate) {
  14560. // If there is no alternate, this might be a new tree that isn't inserted
  14561. // yet. If it is, then it will have a pending insertion effect on it.
  14562. var nextNode = node;
  14563. do {
  14564. node = nextNode;
  14565. if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) {
  14566. // This is an insertion or in-progress hydration. The nearest possible
  14567. // mounted fiber is the parent but we need to continue to figure out
  14568. // if that one is still mounted.
  14569. nearestMounted = node.return;
  14570. }
  14571. nextNode = node.return;
  14572. } while (nextNode);
  14573. } else {
  14574. while (node.return) {
  14575. node = node.return;
  14576. }
  14577. }
  14578. if (node.tag === HostRoot) {
  14579. // TODO: Check if this was a nested HostRoot when used with
  14580. // renderContainerIntoSubtree.
  14581. return nearestMounted;
  14582. } // If we didn't hit the root, that means that we're in an disconnected tree
  14583. // that has been unmounted.
  14584. return null;
  14585. }
  14586. function getSuspenseInstanceFromFiber(fiber) {
  14587. if (fiber.tag === SuspenseComponent) {
  14588. var suspenseState = fiber.memoizedState;
  14589. if (suspenseState === null) {
  14590. var current = fiber.alternate;
  14591. if (current !== null) {
  14592. suspenseState = current.memoizedState;
  14593. }
  14594. }
  14595. if (suspenseState !== null) {
  14596. return suspenseState.dehydrated;
  14597. }
  14598. }
  14599. return null;
  14600. }
  14601. function getContainerFromFiber(fiber) {
  14602. return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
  14603. }
  14604. function isFiberMounted(fiber) {
  14605. return getNearestMountedFiber(fiber) === fiber;
  14606. }
  14607. function isMounted(component) {
  14608. {
  14609. var owner = ReactCurrentOwner.current;
  14610. if (owner !== null && owner.tag === ClassComponent) {
  14611. var ownerFiber = owner;
  14612. var instance = ownerFiber.stateNode;
  14613. if (!instance._warnedAboutRefsInRender) {
  14614. error('%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component');
  14615. }
  14616. instance._warnedAboutRefsInRender = true;
  14617. }
  14618. }
  14619. var fiber = get(component);
  14620. if (!fiber) {
  14621. return false;
  14622. }
  14623. return getNearestMountedFiber(fiber) === fiber;
  14624. }
  14625. function assertIsMounted(fiber) {
  14626. if (!(getNearestMountedFiber(fiber) === fiber)) {
  14627. {
  14628. throw Error( "Unable to find node on an unmounted component." );
  14629. }
  14630. }
  14631. }
  14632. function findCurrentFiberUsingSlowPath(fiber) {
  14633. var alternate = fiber.alternate;
  14634. if (!alternate) {
  14635. // If there is no alternate, then we only need to check if it is mounted.
  14636. var nearestMounted = getNearestMountedFiber(fiber);
  14637. if (!(nearestMounted !== null)) {
  14638. {
  14639. throw Error( "Unable to find node on an unmounted component." );
  14640. }
  14641. }
  14642. if (nearestMounted !== fiber) {
  14643. return null;
  14644. }
  14645. return fiber;
  14646. } // If we have two possible branches, we'll walk backwards up to the root
  14647. // to see what path the root points to. On the way we may hit one of the
  14648. // special cases and we'll deal with them.
  14649. var a = fiber;
  14650. var b = alternate;
  14651. while (true) {
  14652. var parentA = a.return;
  14653. if (parentA === null) {
  14654. // We're at the root.
  14655. break;
  14656. }
  14657. var parentB = parentA.alternate;
  14658. if (parentB === null) {
  14659. // There is no alternate. This is an unusual case. Currently, it only
  14660. // happens when a Suspense component is hidden. An extra fragment fiber
  14661. // is inserted in between the Suspense fiber and its children. Skip
  14662. // over this extra fragment fiber and proceed to the next parent.
  14663. var nextParent = parentA.return;
  14664. if (nextParent !== null) {
  14665. a = b = nextParent;
  14666. continue;
  14667. } // If there's no parent, we're at the root.
  14668. break;
  14669. } // If both copies of the parent fiber point to the same child, we can
  14670. // assume that the child is current. This happens when we bailout on low
  14671. // priority: the bailed out fiber's child reuses the current child.
  14672. if (parentA.child === parentB.child) {
  14673. var child = parentA.child;
  14674. while (child) {
  14675. if (child === a) {
  14676. // We've determined that A is the current branch.
  14677. assertIsMounted(parentA);
  14678. return fiber;
  14679. }
  14680. if (child === b) {
  14681. // We've determined that B is the current branch.
  14682. assertIsMounted(parentA);
  14683. return alternate;
  14684. }
  14685. child = child.sibling;
  14686. } // We should never have an alternate for any mounting node. So the only
  14687. // way this could possibly happen is if this was unmounted, if at all.
  14688. {
  14689. {
  14690. throw Error( "Unable to find node on an unmounted component." );
  14691. }
  14692. }
  14693. }
  14694. if (a.return !== b.return) {
  14695. // The return pointer of A and the return pointer of B point to different
  14696. // fibers. We assume that return pointers never criss-cross, so A must
  14697. // belong to the child set of A.return, and B must belong to the child
  14698. // set of B.return.
  14699. a = parentA;
  14700. b = parentB;
  14701. } else {
  14702. // The return pointers point to the same fiber. We'll have to use the
  14703. // default, slow path: scan the child sets of each parent alternate to see
  14704. // which child belongs to which set.
  14705. //
  14706. // Search parent A's child set
  14707. var didFindChild = false;
  14708. var _child = parentA.child;
  14709. while (_child) {
  14710. if (_child === a) {
  14711. didFindChild = true;
  14712. a = parentA;
  14713. b = parentB;
  14714. break;
  14715. }
  14716. if (_child === b) {
  14717. didFindChild = true;
  14718. b = parentA;
  14719. a = parentB;
  14720. break;
  14721. }
  14722. _child = _child.sibling;
  14723. }
  14724. if (!didFindChild) {
  14725. // Search parent B's child set
  14726. _child = parentB.child;
  14727. while (_child) {
  14728. if (_child === a) {
  14729. didFindChild = true;
  14730. a = parentB;
  14731. b = parentA;
  14732. break;
  14733. }
  14734. if (_child === b) {
  14735. didFindChild = true;
  14736. b = parentB;
  14737. a = parentA;
  14738. break;
  14739. }
  14740. _child = _child.sibling;
  14741. }
  14742. if (!didFindChild) {
  14743. {
  14744. throw Error( "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." );
  14745. }
  14746. }
  14747. }
  14748. }
  14749. if (!(a.alternate === b)) {
  14750. {
  14751. throw Error( "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." );
  14752. }
  14753. }
  14754. } // If the root is not a host container, we're in a disconnected tree. I.e.
  14755. // unmounted.
  14756. if (!(a.tag === HostRoot)) {
  14757. {
  14758. throw Error( "Unable to find node on an unmounted component." );
  14759. }
  14760. }
  14761. if (a.stateNode.current === a) {
  14762. // We've determined that A is the current branch.
  14763. return fiber;
  14764. } // Otherwise B has to be current branch.
  14765. return alternate;
  14766. }
  14767. function findCurrentHostFiber(parent) {
  14768. var currentParent = findCurrentFiberUsingSlowPath(parent);
  14769. if (!currentParent) {
  14770. return null;
  14771. } // Next we'll drill down this component to find the first HostComponent/Text.
  14772. var node = currentParent;
  14773. while (true) {
  14774. if (node.tag === HostComponent || node.tag === HostText) {
  14775. return node;
  14776. } else if (node.child) {
  14777. node.child.return = node;
  14778. node = node.child;
  14779. continue;
  14780. }
  14781. if (node === currentParent) {
  14782. return null;
  14783. }
  14784. while (!node.sibling) {
  14785. if (!node.return || node.return === currentParent) {
  14786. return null;
  14787. }
  14788. node = node.return;
  14789. }
  14790. node.sibling.return = node.return;
  14791. node = node.sibling;
  14792. } // Flow needs the return null here, but ESLint complains about it.
  14793. // eslint-disable-next-line no-unreachable
  14794. return null;
  14795. }
  14796. function findCurrentHostFiberWithNoPortals(parent) {
  14797. var currentParent = findCurrentFiberUsingSlowPath(parent);
  14798. if (!currentParent) {
  14799. return null;
  14800. } // Next we'll drill down this component to find the first HostComponent/Text.
  14801. var node = currentParent;
  14802. while (true) {
  14803. if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI ) {
  14804. return node;
  14805. } else if (node.child && node.tag !== HostPortal) {
  14806. node.child.return = node;
  14807. node = node.child;
  14808. continue;
  14809. }
  14810. if (node === currentParent) {
  14811. return null;
  14812. }
  14813. while (!node.sibling) {
  14814. if (!node.return || node.return === currentParent) {
  14815. return null;
  14816. }
  14817. node = node.return;
  14818. }
  14819. node.sibling.return = node.return;
  14820. node = node.sibling;
  14821. } // Flow needs the return null here, but ESLint complains about it.
  14822. // eslint-disable-next-line no-unreachable
  14823. return null;
  14824. }
  14825. /**
  14826. * Accumulates items that must not be null or undefined into the first one. This
  14827. * is used to conserve memory by avoiding array allocations, and thus sacrifices
  14828. * API cleanness. Since `current` can be null before being passed in and not
  14829. * null after this function, make sure to assign it back to `current`:
  14830. *
  14831. * `a = accumulateInto(a, b);`
  14832. *
  14833. * This API should be sparingly used. Try `accumulate` for something cleaner.
  14834. *
  14835. * @return {*|array<*>} An accumulation of items.
  14836. */
  14837. function accumulateInto(current, next) {
  14838. if (!(next != null)) {
  14839. {
  14840. throw Error( "accumulateInto(...): Accumulated items must not be null or undefined." );
  14841. }
  14842. }
  14843. if (current == null) {
  14844. return next;
  14845. } // Both are not empty. Warning: Never call x.concat(y) when you are not
  14846. // certain that x is an Array (x could be a string with concat method).
  14847. if (Array.isArray(current)) {
  14848. if (Array.isArray(next)) {
  14849. current.push.apply(current, next);
  14850. return current;
  14851. }
  14852. current.push(next);
  14853. return current;
  14854. }
  14855. if (Array.isArray(next)) {
  14856. // A bit too dangerous to mutate `next`.
  14857. return [current].concat(next);
  14858. }
  14859. return [current, next];
  14860. }
  14861. /**
  14862. * @param {array} arr an "accumulation" of items which is either an Array or
  14863. * a single item. Useful when paired with the `accumulate` module. This is a
  14864. * simple utility that allows us to reason about a collection of items, but
  14865. * handling the case when there is exactly one item (and we do not need to
  14866. * allocate an array).
  14867. * @param {function} cb Callback invoked with each element or a collection.
  14868. * @param {?} [scope] Scope used as `this` in a callback.
  14869. */
  14870. function forEachAccumulated(arr, cb, scope) {
  14871. if (Array.isArray(arr)) {
  14872. arr.forEach(cb, scope);
  14873. } else if (arr) {
  14874. cb.call(scope, arr);
  14875. }
  14876. }
  14877. /**
  14878. * Internal queue of events that have accumulated their dispatches and are
  14879. * waiting to have their dispatches executed.
  14880. */
  14881. var eventQueue = null;
  14882. /**
  14883. * Dispatches an event and releases it back into the pool, unless persistent.
  14884. *
  14885. * @param {?object} event Synthetic event to be dispatched.
  14886. * @private
  14887. */
  14888. var executeDispatchesAndRelease = function (event) {
  14889. if (event) {
  14890. executeDispatchesInOrder(event);
  14891. if (!event.isPersistent()) {
  14892. event.constructor.release(event);
  14893. }
  14894. }
  14895. };
  14896. var executeDispatchesAndReleaseTopLevel = function (e) {
  14897. return executeDispatchesAndRelease(e);
  14898. };
  14899. function runEventsInBatch(events) {
  14900. if (events !== null) {
  14901. eventQueue = accumulateInto(eventQueue, events);
  14902. } // Set `eventQueue` to null before processing it so that we can tell if more
  14903. // events get enqueued while processing.
  14904. var processingEventQueue = eventQueue;
  14905. eventQueue = null;
  14906. if (!processingEventQueue) {
  14907. return;
  14908. }
  14909. forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
  14910. if (!!eventQueue) {
  14911. {
  14912. throw Error( "processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented." );
  14913. }
  14914. } // This would be a good time to rethrow if any of the event handlers threw.
  14915. rethrowCaughtError();
  14916. }
  14917. /**
  14918. * Gets the target node from a native browser event by accounting for
  14919. * inconsistencies in browser DOM APIs.
  14920. *
  14921. * @param {object} nativeEvent Native browser event.
  14922. * @return {DOMEventTarget} Target node.
  14923. */
  14924. function getEventTarget(nativeEvent) {
  14925. // Fallback to nativeEvent.srcElement for IE9
  14926. // https://github.com/facebook/react/issues/12506
  14927. var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963
  14928. if (target.correspondingUseElement) {
  14929. target = target.correspondingUseElement;
  14930. } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
  14931. // @see http://www.quirksmode.org/js/events_properties.html
  14932. return target.nodeType === TEXT_NODE ? target.parentNode : target;
  14933. }
  14934. /**
  14935. * Checks if an event is supported in the current execution environment.
  14936. *
  14937. * NOTE: This will not work correctly for non-generic events such as `change`,
  14938. * `reset`, `load`, `error`, and `select`.
  14939. *
  14940. * Borrows from Modernizr.
  14941. *
  14942. * @param {string} eventNameSuffix Event name, e.g. "click".
  14943. * @return {boolean} True if the event is supported.
  14944. * @internal
  14945. * @license Modernizr 3.0.0pre (Custom Build) | MIT
  14946. */
  14947. function isEventSupported(eventNameSuffix) {
  14948. if (!canUseDOM) {
  14949. return false;
  14950. }
  14951. var eventName = 'on' + eventNameSuffix;
  14952. var isSupported = eventName in document;
  14953. if (!isSupported) {
  14954. var element = document.createElement('div');
  14955. element.setAttribute(eventName, 'return;');
  14956. isSupported = typeof element[eventName] === 'function';
  14957. }
  14958. return isSupported;
  14959. }
  14960. /**
  14961. * Summary of `DOMEventPluginSystem` event handling:
  14962. *
  14963. * - Top-level delegation is used to trap most native browser events. This
  14964. * may only occur in the main thread and is the responsibility of
  14965. * ReactDOMEventListener, which is injected and can therefore support
  14966. * pluggable event sources. This is the only work that occurs in the main
  14967. * thread.
  14968. *
  14969. * - We normalize and de-duplicate events to account for browser quirks. This
  14970. * may be done in the worker thread.
  14971. *
  14972. * - Forward these native events (with the associated top-level type used to
  14973. * trap it) to `EventPluginRegistry`, which in turn will ask plugins if they want
  14974. * to extract any synthetic events.
  14975. *
  14976. * - The `EventPluginRegistry` will then process each event by annotating them with
  14977. * "dispatches", a sequence of listeners and IDs that care about that event.
  14978. *
  14979. * - The `EventPluginRegistry` then dispatches the events.
  14980. *
  14981. * Overview of React and the event system:
  14982. *
  14983. * +------------+ .
  14984. * | DOM | .
  14985. * +------------+ .
  14986. * | .
  14987. * v .
  14988. * +------------+ .
  14989. * | ReactEvent | .
  14990. * | Listener | .
  14991. * +------------+ . +-----------+
  14992. * | . +--------+|SimpleEvent|
  14993. * | . | |Plugin |
  14994. * +-----|------+ . v +-----------+
  14995. * | | | . +--------------+ +------------+
  14996. * | +-----------.--->|PluginRegistry| | Event |
  14997. * | | . | | +-----------+ | Propagators|
  14998. * | ReactEvent | . | | |TapEvent | |------------|
  14999. * | Emitter | . | |<---+|Plugin | |other plugin|
  15000. * | | . | | +-----------+ | utilities |
  15001. * | +-----------.--->| | +------------+
  15002. * | | | . +--------------+
  15003. * +-----|------+ . ^ +-----------+
  15004. * | . | |Enter/Leave|
  15005. * + . +-------+|Plugin |
  15006. * +-------------+ . +-----------+
  15007. * | application | .
  15008. * |-------------| .
  15009. * | | .
  15010. * | | .
  15011. * +-------------+ .
  15012. * .
  15013. * React Core . General Purpose Event Plugin System
  15014. */
  15015. var CALLBACK_BOOKKEEPING_POOL_SIZE = 10;
  15016. var callbackBookkeepingPool = [];
  15017. function releaseTopLevelCallbackBookKeeping(instance) {
  15018. instance.topLevelType = null;
  15019. instance.nativeEvent = null;
  15020. instance.targetInst = null;
  15021. instance.ancestors.length = 0;
  15022. if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {
  15023. callbackBookkeepingPool.push(instance);
  15024. }
  15025. } // Used to store ancestor hierarchy in top level callback
  15026. function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags) {
  15027. if (callbackBookkeepingPool.length) {
  15028. var instance = callbackBookkeepingPool.pop();
  15029. instance.topLevelType = topLevelType;
  15030. instance.eventSystemFlags = eventSystemFlags;
  15031. instance.nativeEvent = nativeEvent;
  15032. instance.targetInst = targetInst;
  15033. return instance;
  15034. }
  15035. return {
  15036. topLevelType: topLevelType,
  15037. eventSystemFlags: eventSystemFlags,
  15038. nativeEvent: nativeEvent,
  15039. targetInst: targetInst,
  15040. ancestors: []
  15041. };
  15042. }
  15043. /**
  15044. * Find the deepest React component completely containing the root of the
  15045. * passed-in instance (for use when entire React trees are nested within each
  15046. * other). If React trees are not nested, returns null.
  15047. */
  15048. function findRootContainerNode(inst) {
  15049. if (inst.tag === HostRoot) {
  15050. return inst.stateNode.containerInfo;
  15051. } // TODO: It may be a good idea to cache this to prevent unnecessary DOM
  15052. // traversal, but caching is difficult to do correctly without using a
  15053. // mutation observer to listen for all DOM changes.
  15054. while (inst.return) {
  15055. inst = inst.return;
  15056. }
  15057. if (inst.tag !== HostRoot) {
  15058. // This can happen if we're in a detached tree.
  15059. return null;
  15060. }
  15061. return inst.stateNode.containerInfo;
  15062. }
  15063. /**
  15064. * Allows registered plugins an opportunity to extract events from top-level
  15065. * native browser events.
  15066. *
  15067. * @return {*} An accumulation of synthetic events.
  15068. * @internal
  15069. */
  15070. function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  15071. var events = null;
  15072. for (var i = 0; i < plugins.length; i++) {
  15073. // Not every plugin in the ordering may be loaded at runtime.
  15074. var possiblePlugin = plugins[i];
  15075. if (possiblePlugin) {
  15076. var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
  15077. if (extractedEvents) {
  15078. events = accumulateInto(events, extractedEvents);
  15079. }
  15080. }
  15081. }
  15082. return events;
  15083. }
  15084. function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  15085. var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
  15086. runEventsInBatch(events);
  15087. }
  15088. function handleTopLevel(bookKeeping) {
  15089. var targetInst = bookKeeping.targetInst; // Loop through the hierarchy, in case there's any nested components.
  15090. // It's important that we build the array of ancestors before calling any
  15091. // event handlers, because event handlers can modify the DOM, leading to
  15092. // inconsistencies with ReactMount's node cache. See #1105.
  15093. var ancestor = targetInst;
  15094. do {
  15095. if (!ancestor) {
  15096. var ancestors = bookKeeping.ancestors;
  15097. ancestors.push(ancestor);
  15098. break;
  15099. }
  15100. var root = findRootContainerNode(ancestor);
  15101. if (!root) {
  15102. break;
  15103. }
  15104. var tag = ancestor.tag;
  15105. if (tag === HostComponent || tag === HostText) {
  15106. bookKeeping.ancestors.push(ancestor);
  15107. }
  15108. ancestor = getClosestInstanceFromNode(root);
  15109. } while (ancestor);
  15110. for (var i = 0; i < bookKeeping.ancestors.length; i++) {
  15111. targetInst = bookKeeping.ancestors[i];
  15112. var eventTarget = getEventTarget(bookKeeping.nativeEvent);
  15113. var topLevelType = bookKeeping.topLevelType;
  15114. var nativeEvent = bookKeeping.nativeEvent;
  15115. var eventSystemFlags = bookKeeping.eventSystemFlags; // If this is the first ancestor, we mark it on the system flags
  15116. if (i === 0) {
  15117. eventSystemFlags |= IS_FIRST_ANCESTOR;
  15118. }
  15119. runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, eventTarget, eventSystemFlags);
  15120. }
  15121. }
  15122. function dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) {
  15123. var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags);
  15124. try {
  15125. // Event queue being processed in the same cycle allows
  15126. // `preventDefault`.
  15127. batchedEventUpdates(handleTopLevel, bookKeeping);
  15128. } finally {
  15129. releaseTopLevelCallbackBookKeeping(bookKeeping);
  15130. }
  15131. }
  15132. /**
  15133. * We listen for bubbled touch events on the document object.
  15134. *
  15135. * Firefox v8.01 (and possibly others) exhibited strange behavior when
  15136. * mounting `onmousemove` events at some node that was not the document
  15137. * element. The symptoms were that if your mouse is not moving over something
  15138. * contained within that mount point (for example on the background) the
  15139. * top-level listeners for `onmousemove` won't be called. However, if you
  15140. * register the `mousemove` on the document object, then it will of course
  15141. * catch all `mousemove`s. This along with iOS quirks, justifies restricting
  15142. * top-level listeners to the document object only, at least for these
  15143. * movement types of events and possibly all events.
  15144. *
  15145. * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  15146. *
  15147. * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
  15148. * they bubble to document.
  15149. *
  15150. * @param {string} registrationName Name of listener (e.g. `onClick`).
  15151. * @param {object} mountAt Container where to mount the listener
  15152. */
  15153. function legacyListenToEvent(registrationName, mountAt) {
  15154. var listenerMap = getListenerMapForElement(mountAt);
  15155. var dependencies = registrationNameDependencies[registrationName];
  15156. for (var i = 0; i < dependencies.length; i++) {
  15157. var dependency = dependencies[i];
  15158. legacyListenToTopLevelEvent(dependency, mountAt, listenerMap);
  15159. }
  15160. }
  15161. function legacyListenToTopLevelEvent(topLevelType, mountAt, listenerMap) {
  15162. if (!listenerMap.has(topLevelType)) {
  15163. switch (topLevelType) {
  15164. case TOP_SCROLL:
  15165. trapCapturedEvent(TOP_SCROLL, mountAt);
  15166. break;
  15167. case TOP_FOCUS:
  15168. case TOP_BLUR:
  15169. trapCapturedEvent(TOP_FOCUS, mountAt);
  15170. trapCapturedEvent(TOP_BLUR, mountAt); // We set the flag for a single dependency later in this function,
  15171. // but this ensures we mark both as attached rather than just one.
  15172. listenerMap.set(TOP_BLUR, null);
  15173. listenerMap.set(TOP_FOCUS, null);
  15174. break;
  15175. case TOP_CANCEL:
  15176. case TOP_CLOSE:
  15177. if (isEventSupported(getRawEventName(topLevelType))) {
  15178. trapCapturedEvent(topLevelType, mountAt);
  15179. }
  15180. break;
  15181. case TOP_INVALID:
  15182. case TOP_SUBMIT:
  15183. case TOP_RESET:
  15184. // We listen to them on the target DOM elements.
  15185. // Some of them bubble so we don't want them to fire twice.
  15186. break;
  15187. default:
  15188. // By default, listen on the top level to all non-media events.
  15189. // Media events don't bubble so adding the listener wouldn't do anything.
  15190. var isMediaEvent = mediaEventTypes.indexOf(topLevelType) !== -1;
  15191. if (!isMediaEvent) {
  15192. trapBubbledEvent(topLevelType, mountAt);
  15193. }
  15194. break;
  15195. }
  15196. listenerMap.set(topLevelType, null);
  15197. }
  15198. }
  15199. function isListeningToAllDependencies(registrationName, mountAt) {
  15200. var listenerMap = getListenerMapForElement(mountAt);
  15201. var dependencies = registrationNameDependencies[registrationName];
  15202. for (var i = 0; i < dependencies.length; i++) {
  15203. var dependency = dependencies[i];
  15204. if (!listenerMap.has(dependency)) {
  15205. return false;
  15206. }
  15207. }
  15208. return true;
  15209. }
  15210. var attemptUserBlockingHydration;
  15211. function setAttemptUserBlockingHydration(fn) {
  15212. attemptUserBlockingHydration = fn;
  15213. }
  15214. var attemptContinuousHydration;
  15215. function setAttemptContinuousHydration(fn) {
  15216. attemptContinuousHydration = fn;
  15217. }
  15218. var attemptHydrationAtCurrentPriority;
  15219. function setAttemptHydrationAtCurrentPriority(fn) {
  15220. attemptHydrationAtCurrentPriority = fn;
  15221. } // TODO: Upgrade this definition once we're on a newer version of Flow that
  15222. var hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.
  15223. var queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.
  15224. // if the last target was dehydrated.
  15225. var queuedFocus = null;
  15226. var queuedDrag = null;
  15227. var queuedMouse = null; // For pointer events there can be one latest event per pointerId.
  15228. var queuedPointers = new Map();
  15229. var queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.
  15230. var queuedExplicitHydrationTargets = [];
  15231. function hasQueuedDiscreteEvents() {
  15232. return queuedDiscreteEvents.length > 0;
  15233. }
  15234. var discreteReplayableEvents = [TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_TOUCH_START, TOP_AUX_CLICK, TOP_DOUBLE_CLICK, TOP_POINTER_CANCEL, TOP_POINTER_DOWN, TOP_POINTER_UP, TOP_DRAG_END, TOP_DRAG_START, TOP_DROP, TOP_COMPOSITION_END, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_INPUT, TOP_TEXT_INPUT, TOP_CLOSE, TOP_CANCEL, TOP_COPY, TOP_CUT, TOP_PASTE, TOP_CLICK, TOP_CHANGE, TOP_CONTEXT_MENU, TOP_RESET, TOP_SUBMIT];
  15235. var continuousReplayableEvents = [TOP_FOCUS, TOP_BLUR, TOP_DRAG_ENTER, TOP_DRAG_LEAVE, TOP_MOUSE_OVER, TOP_MOUSE_OUT, TOP_POINTER_OVER, TOP_POINTER_OUT, TOP_GOT_POINTER_CAPTURE, TOP_LOST_POINTER_CAPTURE];
  15236. function isReplayableDiscreteEvent(eventType) {
  15237. return discreteReplayableEvents.indexOf(eventType) > -1;
  15238. }
  15239. function trapReplayableEventForDocument(topLevelType, document, listenerMap) {
  15240. legacyListenToTopLevelEvent(topLevelType, document, listenerMap);
  15241. }
  15242. function eagerlyTrapReplayableEvents(container, document) {
  15243. var listenerMapForDoc = getListenerMapForElement(document); // Discrete
  15244. discreteReplayableEvents.forEach(function (topLevelType) {
  15245. trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc);
  15246. }); // Continuous
  15247. continuousReplayableEvents.forEach(function (topLevelType) {
  15248. trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc);
  15249. });
  15250. }
  15251. function createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
  15252. return {
  15253. blockedOn: blockedOn,
  15254. topLevelType: topLevelType,
  15255. eventSystemFlags: eventSystemFlags | IS_REPLAYED,
  15256. nativeEvent: nativeEvent,
  15257. container: container
  15258. };
  15259. }
  15260. function queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
  15261. var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);
  15262. queuedDiscreteEvents.push(queuedEvent);
  15263. } // Resets the replaying for this type of continuous event to no event.
  15264. function clearIfContinuousEvent(topLevelType, nativeEvent) {
  15265. switch (topLevelType) {
  15266. case TOP_FOCUS:
  15267. case TOP_BLUR:
  15268. queuedFocus = null;
  15269. break;
  15270. case TOP_DRAG_ENTER:
  15271. case TOP_DRAG_LEAVE:
  15272. queuedDrag = null;
  15273. break;
  15274. case TOP_MOUSE_OVER:
  15275. case TOP_MOUSE_OUT:
  15276. queuedMouse = null;
  15277. break;
  15278. case TOP_POINTER_OVER:
  15279. case TOP_POINTER_OUT:
  15280. {
  15281. var pointerId = nativeEvent.pointerId;
  15282. queuedPointers.delete(pointerId);
  15283. break;
  15284. }
  15285. case TOP_GOT_POINTER_CAPTURE:
  15286. case TOP_LOST_POINTER_CAPTURE:
  15287. {
  15288. var _pointerId = nativeEvent.pointerId;
  15289. queuedPointerCaptures.delete(_pointerId);
  15290. break;
  15291. }
  15292. }
  15293. }
  15294. function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
  15295. if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
  15296. var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);
  15297. if (blockedOn !== null) {
  15298. var _fiber2 = getInstanceFromNode$1(blockedOn);
  15299. if (_fiber2 !== null) {
  15300. // Attempt to increase the priority of this target.
  15301. attemptContinuousHydration(_fiber2);
  15302. }
  15303. }
  15304. return queuedEvent;
  15305. } // If we have already queued this exact event, then it's because
  15306. // the different event systems have different DOM event listeners.
  15307. // We can accumulate the flags and store a single event to be
  15308. // replayed.
  15309. existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
  15310. return existingQueuedEvent;
  15311. }
  15312. function queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
  15313. // These set relatedTarget to null because the replayed event will be treated as if we
  15314. // moved from outside the window (no target) onto the target once it hydrates.
  15315. // Instead of mutating we could clone the event.
  15316. switch (topLevelType) {
  15317. case TOP_FOCUS:
  15318. {
  15319. var focusEvent = nativeEvent;
  15320. queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, container, focusEvent);
  15321. return true;
  15322. }
  15323. case TOP_DRAG_ENTER:
  15324. {
  15325. var dragEvent = nativeEvent;
  15326. queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, container, dragEvent);
  15327. return true;
  15328. }
  15329. case TOP_MOUSE_OVER:
  15330. {
  15331. var mouseEvent = nativeEvent;
  15332. queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, container, mouseEvent);
  15333. return true;
  15334. }
  15335. case TOP_POINTER_OVER:
  15336. {
  15337. var pointerEvent = nativeEvent;
  15338. var pointerId = pointerEvent.pointerId;
  15339. queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, container, pointerEvent));
  15340. return true;
  15341. }
  15342. case TOP_GOT_POINTER_CAPTURE:
  15343. {
  15344. var _pointerEvent = nativeEvent;
  15345. var _pointerId2 = _pointerEvent.pointerId;
  15346. queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, container, _pointerEvent));
  15347. return true;
  15348. }
  15349. }
  15350. return false;
  15351. } // Check if this target is unblocked. Returns true if it's unblocked.
  15352. function attemptExplicitHydrationTarget(queuedTarget) {
  15353. // TODO: This function shares a lot of logic with attemptToDispatchEvent.
  15354. // Try to unify them. It's a bit tricky since it would require two return
  15355. // values.
  15356. var targetInst = getClosestInstanceFromNode(queuedTarget.target);
  15357. if (targetInst !== null) {
  15358. var nearestMounted = getNearestMountedFiber(targetInst);
  15359. if (nearestMounted !== null) {
  15360. var tag = nearestMounted.tag;
  15361. if (tag === SuspenseComponent) {
  15362. var instance = getSuspenseInstanceFromFiber(nearestMounted);
  15363. if (instance !== null) {
  15364. // We're blocked on hydrating this boundary.
  15365. // Increase its priority.
  15366. queuedTarget.blockedOn = instance;
  15367. Scheduler.unstable_runWithPriority(queuedTarget.priority, function () {
  15368. attemptHydrationAtCurrentPriority(nearestMounted);
  15369. });
  15370. return;
  15371. }
  15372. } else if (tag === HostRoot) {
  15373. var root = nearestMounted.stateNode;
  15374. if (root.hydrate) {
  15375. queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of
  15376. // a root other than sync.
  15377. return;
  15378. }
  15379. }
  15380. }
  15381. }
  15382. queuedTarget.blockedOn = null;
  15383. }
  15384. function attemptReplayContinuousQueuedEvent(queuedEvent) {
  15385. if (queuedEvent.blockedOn !== null) {
  15386. return false;
  15387. }
  15388. var nextBlockedOn = attemptToDispatchEvent(queuedEvent.topLevelType, queuedEvent.eventSystemFlags, queuedEvent.container, queuedEvent.nativeEvent);
  15389. if (nextBlockedOn !== null) {
  15390. // We're still blocked. Try again later.
  15391. var _fiber3 = getInstanceFromNode$1(nextBlockedOn);
  15392. if (_fiber3 !== null) {
  15393. attemptContinuousHydration(_fiber3);
  15394. }
  15395. queuedEvent.blockedOn = nextBlockedOn;
  15396. return false;
  15397. }
  15398. return true;
  15399. }
  15400. function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
  15401. if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
  15402. map.delete(key);
  15403. }
  15404. }
  15405. function replayUnblockedEvents() {
  15406. hasScheduledReplayAttempt = false; // First replay discrete events.
  15407. while (queuedDiscreteEvents.length > 0) {
  15408. var nextDiscreteEvent = queuedDiscreteEvents[0];
  15409. if (nextDiscreteEvent.blockedOn !== null) {
  15410. // We're still blocked.
  15411. // Increase the priority of this boundary to unblock
  15412. // the next discrete event.
  15413. var _fiber4 = getInstanceFromNode$1(nextDiscreteEvent.blockedOn);
  15414. if (_fiber4 !== null) {
  15415. attemptUserBlockingHydration(_fiber4);
  15416. }
  15417. break;
  15418. }
  15419. var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.topLevelType, nextDiscreteEvent.eventSystemFlags, nextDiscreteEvent.container, nextDiscreteEvent.nativeEvent);
  15420. if (nextBlockedOn !== null) {
  15421. // We're still blocked. Try again later.
  15422. nextDiscreteEvent.blockedOn = nextBlockedOn;
  15423. } else {
  15424. // We've successfully replayed the first event. Let's try the next one.
  15425. queuedDiscreteEvents.shift();
  15426. }
  15427. } // Next replay any continuous events.
  15428. if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
  15429. queuedFocus = null;
  15430. }
  15431. if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
  15432. queuedDrag = null;
  15433. }
  15434. if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
  15435. queuedMouse = null;
  15436. }
  15437. queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
  15438. queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
  15439. }
  15440. function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
  15441. if (queuedEvent.blockedOn === unblocked) {
  15442. queuedEvent.blockedOn = null;
  15443. if (!hasScheduledReplayAttempt) {
  15444. hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are
  15445. // now unblocked. This first might not actually be unblocked yet.
  15446. // We could check it early to avoid scheduling an unnecessary callback.
  15447. Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
  15448. }
  15449. }
  15450. }
  15451. function retryIfBlockedOn(unblocked) {
  15452. // Mark anything that was blocked on this as no longer blocked
  15453. // and eligible for a replay.
  15454. if (queuedDiscreteEvents.length > 0) {
  15455. scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's
  15456. // worth it because we expect very few discrete events to queue up and once
  15457. // we are actually fully unblocked it will be fast to replay them.
  15458. for (var i = 1; i < queuedDiscreteEvents.length; i++) {
  15459. var queuedEvent = queuedDiscreteEvents[i];
  15460. if (queuedEvent.blockedOn === unblocked) {
  15461. queuedEvent.blockedOn = null;
  15462. }
  15463. }
  15464. }
  15465. if (queuedFocus !== null) {
  15466. scheduleCallbackIfUnblocked(queuedFocus, unblocked);
  15467. }
  15468. if (queuedDrag !== null) {
  15469. scheduleCallbackIfUnblocked(queuedDrag, unblocked);
  15470. }
  15471. if (queuedMouse !== null) {
  15472. scheduleCallbackIfUnblocked(queuedMouse, unblocked);
  15473. }
  15474. var unblock = function (queuedEvent) {
  15475. return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
  15476. };
  15477. queuedPointers.forEach(unblock);
  15478. queuedPointerCaptures.forEach(unblock);
  15479. for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
  15480. var queuedTarget = queuedExplicitHydrationTargets[_i];
  15481. if (queuedTarget.blockedOn === unblocked) {
  15482. queuedTarget.blockedOn = null;
  15483. }
  15484. }
  15485. while (queuedExplicitHydrationTargets.length > 0) {
  15486. var nextExplicitTarget = queuedExplicitHydrationTargets[0];
  15487. if (nextExplicitTarget.blockedOn !== null) {
  15488. // We're still blocked.
  15489. break;
  15490. } else {
  15491. attemptExplicitHydrationTarget(nextExplicitTarget);
  15492. if (nextExplicitTarget.blockedOn === null) {
  15493. // We're unblocked.
  15494. queuedExplicitHydrationTargets.shift();
  15495. }
  15496. }
  15497. }
  15498. }
  15499. function addEventBubbleListener(element, eventType, listener) {
  15500. element.addEventListener(eventType, listener, false);
  15501. }
  15502. function addEventCaptureListener(element, eventType, listener) {
  15503. element.addEventListener(eventType, listener, true);
  15504. }
  15505. // do it in two places, which duplicates logic
  15506. // and increases the bundle size, we do it all
  15507. // here once. If we remove or refactor the
  15508. // SimpleEventPlugin, we should also remove or
  15509. // update the below line.
  15510. var simpleEventPluginEventTypes = {};
  15511. var topLevelEventsToDispatchConfig = new Map();
  15512. var eventPriorities = new Map(); // We store most of the events in this module in pairs of two strings so we can re-use
  15513. // the code required to apply the same logic for event prioritization and that of the
  15514. // SimpleEventPlugin. This complicates things slightly, but the aim is to reduce code
  15515. // duplication (for which there would be quite a bit). For the events that are not needed
  15516. // for the SimpleEventPlugin (otherDiscreteEvents) we process them separately as an
  15517. // array of top level events.
  15518. // Lastly, we ignore prettier so we can keep the formatting sane.
  15519. // prettier-ignore
  15520. var discreteEventPairsForSimpleEventPlugin = [TOP_BLUR, 'blur', TOP_CANCEL, 'cancel', TOP_CLICK, 'click', TOP_CLOSE, 'close', TOP_CONTEXT_MENU, 'contextMenu', TOP_COPY, 'copy', TOP_CUT, 'cut', TOP_AUX_CLICK, 'auxClick', TOP_DOUBLE_CLICK, 'doubleClick', TOP_DRAG_END, 'dragEnd', TOP_DRAG_START, 'dragStart', TOP_DROP, 'drop', TOP_FOCUS, 'focus', TOP_INPUT, 'input', TOP_INVALID, 'invalid', TOP_KEY_DOWN, 'keyDown', TOP_KEY_PRESS, 'keyPress', TOP_KEY_UP, 'keyUp', TOP_MOUSE_DOWN, 'mouseDown', TOP_MOUSE_UP, 'mouseUp', TOP_PASTE, 'paste', TOP_PAUSE, 'pause', TOP_PLAY, 'play', TOP_POINTER_CANCEL, 'pointerCancel', TOP_POINTER_DOWN, 'pointerDown', TOP_POINTER_UP, 'pointerUp', TOP_RATE_CHANGE, 'rateChange', TOP_RESET, 'reset', TOP_SEEKED, 'seeked', TOP_SUBMIT, 'submit', TOP_TOUCH_CANCEL, 'touchCancel', TOP_TOUCH_END, 'touchEnd', TOP_TOUCH_START, 'touchStart', TOP_VOLUME_CHANGE, 'volumeChange'];
  15521. var otherDiscreteEvents = [TOP_CHANGE, TOP_SELECTION_CHANGE, TOP_TEXT_INPUT, TOP_COMPOSITION_START, TOP_COMPOSITION_END, TOP_COMPOSITION_UPDATE]; // prettier-ignore
  15522. var userBlockingPairsForSimpleEventPlugin = [TOP_DRAG, 'drag', TOP_DRAG_ENTER, 'dragEnter', TOP_DRAG_EXIT, 'dragExit', TOP_DRAG_LEAVE, 'dragLeave', TOP_DRAG_OVER, 'dragOver', TOP_MOUSE_MOVE, 'mouseMove', TOP_MOUSE_OUT, 'mouseOut', TOP_MOUSE_OVER, 'mouseOver', TOP_POINTER_MOVE, 'pointerMove', TOP_POINTER_OUT, 'pointerOut', TOP_POINTER_OVER, 'pointerOver', TOP_SCROLL, 'scroll', TOP_TOGGLE, 'toggle', TOP_TOUCH_MOVE, 'touchMove', TOP_WHEEL, 'wheel']; // prettier-ignore
  15523. var continuousPairsForSimpleEventPlugin = [TOP_ABORT, 'abort', TOP_ANIMATION_END, 'animationEnd', TOP_ANIMATION_ITERATION, 'animationIteration', TOP_ANIMATION_START, 'animationStart', TOP_CAN_PLAY, 'canPlay', TOP_CAN_PLAY_THROUGH, 'canPlayThrough', TOP_DURATION_CHANGE, 'durationChange', TOP_EMPTIED, 'emptied', TOP_ENCRYPTED, 'encrypted', TOP_ENDED, 'ended', TOP_ERROR, 'error', TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture', TOP_LOAD, 'load', TOP_LOADED_DATA, 'loadedData', TOP_LOADED_METADATA, 'loadedMetadata', TOP_LOAD_START, 'loadStart', TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture', TOP_PLAYING, 'playing', TOP_PROGRESS, 'progress', TOP_SEEKING, 'seeking', TOP_STALLED, 'stalled', TOP_SUSPEND, 'suspend', TOP_TIME_UPDATE, 'timeUpdate', TOP_TRANSITION_END, 'transitionEnd', TOP_WAITING, 'waiting'];
  15524. /**
  15525. * Turns
  15526. * ['abort', ...]
  15527. * into
  15528. * eventTypes = {
  15529. * 'abort': {
  15530. * phasedRegistrationNames: {
  15531. * bubbled: 'onAbort',
  15532. * captured: 'onAbortCapture',
  15533. * },
  15534. * dependencies: [TOP_ABORT],
  15535. * },
  15536. * ...
  15537. * };
  15538. * topLevelEventsToDispatchConfig = new Map([
  15539. * [TOP_ABORT, { sameConfig }],
  15540. * ]);
  15541. */
  15542. function processSimpleEventPluginPairsByPriority(eventTypes, priority) {
  15543. // As the event types are in pairs of two, we need to iterate
  15544. // through in twos. The events are in pairs of two to save code
  15545. // and improve init perf of processing this array, as it will
  15546. // result in far fewer object allocations and property accesses
  15547. // if we only use three arrays to process all the categories of
  15548. // instead of tuples.
  15549. for (var i = 0; i < eventTypes.length; i += 2) {
  15550. var topEvent = eventTypes[i];
  15551. var event = eventTypes[i + 1];
  15552. var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
  15553. var onEvent = 'on' + capitalizedEvent;
  15554. var config = {
  15555. phasedRegistrationNames: {
  15556. bubbled: onEvent,
  15557. captured: onEvent + 'Capture'
  15558. },
  15559. dependencies: [topEvent],
  15560. eventPriority: priority
  15561. };
  15562. eventPriorities.set(topEvent, priority);
  15563. topLevelEventsToDispatchConfig.set(topEvent, config);
  15564. simpleEventPluginEventTypes[event] = config;
  15565. }
  15566. }
  15567. function processTopEventPairsByPriority(eventTypes, priority) {
  15568. for (var i = 0; i < eventTypes.length; i++) {
  15569. eventPriorities.set(eventTypes[i], priority);
  15570. }
  15571. } // SimpleEventPlugin
  15572. processSimpleEventPluginPairsByPriority(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);
  15573. processSimpleEventPluginPairsByPriority(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);
  15574. processSimpleEventPluginPairsByPriority(continuousPairsForSimpleEventPlugin, ContinuousEvent); // Not used by SimpleEventPlugin
  15575. processTopEventPairsByPriority(otherDiscreteEvents, DiscreteEvent);
  15576. function getEventPriorityForPluginSystem(topLevelType) {
  15577. var priority = eventPriorities.get(topLevelType); // Default to a ContinuousEvent. Note: we might
  15578. // want to warn if we can't detect the priority
  15579. // for the event.
  15580. return priority === undefined ? ContinuousEvent : priority;
  15581. }
  15582. // Intentionally not named imports because Rollup would use dynamic dispatch for
  15583. var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,
  15584. runWithPriority = Scheduler.unstable_runWithPriority; // TODO: can we stop exporting these?
  15585. var _enabled = true;
  15586. function setEnabled(enabled) {
  15587. _enabled = !!enabled;
  15588. }
  15589. function isEnabled() {
  15590. return _enabled;
  15591. }
  15592. function trapBubbledEvent(topLevelType, element) {
  15593. trapEventForPluginEventSystem(element, topLevelType, false);
  15594. }
  15595. function trapCapturedEvent(topLevelType, element) {
  15596. trapEventForPluginEventSystem(element, topLevelType, true);
  15597. }
  15598. function trapEventForPluginEventSystem(container, topLevelType, capture) {
  15599. var listener;
  15600. switch (getEventPriorityForPluginSystem(topLevelType)) {
  15601. case DiscreteEvent:
  15602. listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);
  15603. break;
  15604. case UserBlockingEvent:
  15605. listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);
  15606. break;
  15607. case ContinuousEvent:
  15608. default:
  15609. listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);
  15610. break;
  15611. }
  15612. var rawEventName = getRawEventName(topLevelType);
  15613. if (capture) {
  15614. addEventCaptureListener(container, rawEventName, listener);
  15615. } else {
  15616. addEventBubbleListener(container, rawEventName, listener);
  15617. }
  15618. }
  15619. function dispatchDiscreteEvent(topLevelType, eventSystemFlags, container, nativeEvent) {
  15620. flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
  15621. discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, container, nativeEvent);
  15622. }
  15623. function dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, container, nativeEvent) {
  15624. runWithPriority(UserBlockingPriority, dispatchEvent.bind(null, topLevelType, eventSystemFlags, container, nativeEvent));
  15625. }
  15626. function dispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {
  15627. if (!_enabled) {
  15628. return;
  15629. }
  15630. if (hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(topLevelType)) {
  15631. // If we already have a queue of discrete events, and this is another discrete
  15632. // event, then we can't dispatch it regardless of its target, since they
  15633. // need to dispatch in order.
  15634. queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know.
  15635. topLevelType, eventSystemFlags, container, nativeEvent);
  15636. return;
  15637. }
  15638. var blockedOn = attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent);
  15639. if (blockedOn === null) {
  15640. // We successfully dispatched this event.
  15641. clearIfContinuousEvent(topLevelType, nativeEvent);
  15642. return;
  15643. }
  15644. if (isReplayableDiscreteEvent(topLevelType)) {
  15645. // This this to be replayed later once the target is available.
  15646. queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);
  15647. return;
  15648. }
  15649. if (queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent)) {
  15650. return;
  15651. } // We need to clear only if we didn't queue because
  15652. // queueing is accummulative.
  15653. clearIfContinuousEvent(topLevelType, nativeEvent); // This is not replayable so we'll invoke it but without a target,
  15654. // in case the event system needs to trace it.
  15655. {
  15656. dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);
  15657. }
  15658. } // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.
  15659. function attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {
  15660. // TODO: Warn if _enabled is false.
  15661. var nativeEventTarget = getEventTarget(nativeEvent);
  15662. var targetInst = getClosestInstanceFromNode(nativeEventTarget);
  15663. if (targetInst !== null) {
  15664. var nearestMounted = getNearestMountedFiber(targetInst);
  15665. if (nearestMounted === null) {
  15666. // This tree has been unmounted already. Dispatch without a target.
  15667. targetInst = null;
  15668. } else {
  15669. var tag = nearestMounted.tag;
  15670. if (tag === SuspenseComponent) {
  15671. var instance = getSuspenseInstanceFromFiber(nearestMounted);
  15672. if (instance !== null) {
  15673. // Queue the event to be replayed later. Abort dispatching since we
  15674. // don't want this event dispatched twice through the event system.
  15675. // TODO: If this is the first discrete event in the queue. Schedule an increased
  15676. // priority for this boundary.
  15677. return instance;
  15678. } // This shouldn't happen, something went wrong but to avoid blocking
  15679. // the whole system, dispatch the event without a target.
  15680. // TODO: Warn.
  15681. targetInst = null;
  15682. } else if (tag === HostRoot) {
  15683. var root = nearestMounted.stateNode;
  15684. if (root.hydrate) {
  15685. // If this happens during a replay something went wrong and it might block
  15686. // the whole system.
  15687. return getContainerFromFiber(nearestMounted);
  15688. }
  15689. targetInst = null;
  15690. } else if (nearestMounted !== targetInst) {
  15691. // If we get an event (ex: img onload) before committing that
  15692. // component's mount, ignore it for now (that is, treat it as if it was an
  15693. // event on a non-React tree). We might also consider queueing events and
  15694. // dispatching them after the mount.
  15695. targetInst = null;
  15696. }
  15697. }
  15698. }
  15699. {
  15700. dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);
  15701. } // We're not blocked on anything.
  15702. return null;
  15703. }
  15704. // List derived from Gecko source code:
  15705. // https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js
  15706. var shorthandToLonghand = {
  15707. animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
  15708. background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],
  15709. backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],
  15710. border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  15711. borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],
  15712. borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],
  15713. borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
  15714. borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
  15715. borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
  15716. borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],
  15717. borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],
  15718. borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
  15719. borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],
  15720. borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],
  15721. borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],
  15722. borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  15723. borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],
  15724. columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
  15725. columns: ['columnCount', 'columnWidth'],
  15726. flex: ['flexBasis', 'flexGrow', 'flexShrink'],
  15727. flexFlow: ['flexDirection', 'flexWrap'],
  15728. font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],
  15729. fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],
  15730. gap: ['columnGap', 'rowGap'],
  15731. grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  15732. gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],
  15733. gridColumn: ['gridColumnEnd', 'gridColumnStart'],
  15734. gridColumnGap: ['columnGap'],
  15735. gridGap: ['columnGap', 'rowGap'],
  15736. gridRow: ['gridRowEnd', 'gridRowStart'],
  15737. gridRowGap: ['rowGap'],
  15738. gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  15739. listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
  15740. margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
  15741. marker: ['markerEnd', 'markerMid', 'markerStart'],
  15742. mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],
  15743. maskPosition: ['maskPositionX', 'maskPositionY'],
  15744. outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
  15745. overflow: ['overflowX', 'overflowY'],
  15746. padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
  15747. placeContent: ['alignContent', 'justifyContent'],
  15748. placeItems: ['alignItems', 'justifyItems'],
  15749. placeSelf: ['alignSelf', 'justifySelf'],
  15750. textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],
  15751. textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
  15752. transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
  15753. wordWrap: ['overflowWrap']
  15754. };
  15755. /**
  15756. * CSS properties which accept numbers but are not in units of "px".
  15757. */
  15758. var isUnitlessNumber = {
  15759. animationIterationCount: true,
  15760. borderImageOutset: true,
  15761. borderImageSlice: true,
  15762. borderImageWidth: true,
  15763. boxFlex: true,
  15764. boxFlexGroup: true,
  15765. boxOrdinalGroup: true,
  15766. columnCount: true,
  15767. columns: true,
  15768. flex: true,
  15769. flexGrow: true,
  15770. flexPositive: true,
  15771. flexShrink: true,
  15772. flexNegative: true,
  15773. flexOrder: true,
  15774. gridArea: true,
  15775. gridRow: true,
  15776. gridRowEnd: true,
  15777. gridRowSpan: true,
  15778. gridRowStart: true,
  15779. gridColumn: true,
  15780. gridColumnEnd: true,
  15781. gridColumnSpan: true,
  15782. gridColumnStart: true,
  15783. fontWeight: true,
  15784. lineClamp: true,
  15785. lineHeight: true,
  15786. opacity: true,
  15787. order: true,
  15788. orphans: true,
  15789. tabSize: true,
  15790. widows: true,
  15791. zIndex: true,
  15792. zoom: true,
  15793. // SVG-related properties
  15794. fillOpacity: true,
  15795. floodOpacity: true,
  15796. stopOpacity: true,
  15797. strokeDasharray: true,
  15798. strokeDashoffset: true,
  15799. strokeMiterlimit: true,
  15800. strokeOpacity: true,
  15801. strokeWidth: true
  15802. };
  15803. /**
  15804. * @param {string} prefix vendor-specific prefix, eg: Webkit
  15805. * @param {string} key style name, eg: transitionDuration
  15806. * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
  15807. * WebkitTransitionDuration
  15808. */
  15809. function prefixKey(prefix, key) {
  15810. return prefix + key.charAt(0).toUpperCase() + key.substring(1);
  15811. }
  15812. /**
  15813. * Support style names that may come passed in prefixed by adding permutations
  15814. * of vendor prefixes.
  15815. */
  15816. var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
  15817. // infinite loop, because it iterates over the newly added props too.
  15818. Object.keys(isUnitlessNumber).forEach(function (prop) {
  15819. prefixes.forEach(function (prefix) {
  15820. isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
  15821. });
  15822. });
  15823. /**
  15824. * Convert a value into the proper css writable value. The style name `name`
  15825. * should be logical (no hyphens), as specified
  15826. * in `CSSProperty.isUnitlessNumber`.
  15827. *
  15828. * @param {string} name CSS property name such as `topMargin`.
  15829. * @param {*} value CSS property value such as `10px`.
  15830. * @return {string} Normalized style value with dimensions applied.
  15831. */
  15832. function dangerousStyleValue(name, value, isCustomProperty) {
  15833. // Note that we've removed escapeTextForBrowser() calls here since the
  15834. // whole string will be escaped when the attribute is injected into
  15835. // the markup. If you provide unsafe user data here they can inject
  15836. // arbitrary CSS which may be problematic (I couldn't repro this):
  15837. // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
  15838. // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
  15839. // This is not an XSS hole but instead a potential CSS injection issue
  15840. // which has lead to a greater discussion about how we're going to
  15841. // trust URLs moving forward. See #2115901
  15842. var isEmpty = value == null || typeof value === 'boolean' || value === '';
  15843. if (isEmpty) {
  15844. return '';
  15845. }
  15846. if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
  15847. return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
  15848. }
  15849. return ('' + value).trim();
  15850. }
  15851. var uppercasePattern = /([A-Z])/g;
  15852. var msPattern = /^ms-/;
  15853. /**
  15854. * Hyphenates a camelcased CSS property name, for example:
  15855. *
  15856. * > hyphenateStyleName('backgroundColor')
  15857. * < "background-color"
  15858. * > hyphenateStyleName('MozTransition')
  15859. * < "-moz-transition"
  15860. * > hyphenateStyleName('msTransition')
  15861. * < "-ms-transition"
  15862. *
  15863. * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
  15864. * is converted to `-ms-`.
  15865. */
  15866. function hyphenateStyleName(name) {
  15867. return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
  15868. }
  15869. var warnValidStyle = function () {};
  15870. {
  15871. // 'msTransform' is correct, but the other prefixes should be capitalized
  15872. var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
  15873. var msPattern$1 = /^-ms-/;
  15874. var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon
  15875. var badStyleValueWithSemicolonPattern = /;\s*$/;
  15876. var warnedStyleNames = {};
  15877. var warnedStyleValues = {};
  15878. var warnedForNaNValue = false;
  15879. var warnedForInfinityValue = false;
  15880. var camelize = function (string) {
  15881. return string.replace(hyphenPattern, function (_, character) {
  15882. return character.toUpperCase();
  15883. });
  15884. };
  15885. var warnHyphenatedStyleName = function (name) {
  15886. if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
  15887. return;
  15888. }
  15889. warnedStyleNames[name] = true;
  15890. error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests
  15891. // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
  15892. // is converted to lowercase `ms`.
  15893. camelize(name.replace(msPattern$1, 'ms-')));
  15894. };
  15895. var warnBadVendoredStyleName = function (name) {
  15896. if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
  15897. return;
  15898. }
  15899. warnedStyleNames[name] = true;
  15900. error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
  15901. };
  15902. var warnStyleValueWithSemicolon = function (name, value) {
  15903. if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
  15904. return;
  15905. }
  15906. warnedStyleValues[value] = true;
  15907. error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
  15908. };
  15909. var warnStyleValueIsNaN = function (name, value) {
  15910. if (warnedForNaNValue) {
  15911. return;
  15912. }
  15913. warnedForNaNValue = true;
  15914. error('`NaN` is an invalid value for the `%s` css style property.', name);
  15915. };
  15916. var warnStyleValueIsInfinity = function (name, value) {
  15917. if (warnedForInfinityValue) {
  15918. return;
  15919. }
  15920. warnedForInfinityValue = true;
  15921. error('`Infinity` is an invalid value for the `%s` css style property.', name);
  15922. };
  15923. warnValidStyle = function (name, value) {
  15924. if (name.indexOf('-') > -1) {
  15925. warnHyphenatedStyleName(name);
  15926. } else if (badVendoredStyleNamePattern.test(name)) {
  15927. warnBadVendoredStyleName(name);
  15928. } else if (badStyleValueWithSemicolonPattern.test(value)) {
  15929. warnStyleValueWithSemicolon(name, value);
  15930. }
  15931. if (typeof value === 'number') {
  15932. if (isNaN(value)) {
  15933. warnStyleValueIsNaN(name, value);
  15934. } else if (!isFinite(value)) {
  15935. warnStyleValueIsInfinity(name, value);
  15936. }
  15937. }
  15938. };
  15939. }
  15940. var warnValidStyle$1 = warnValidStyle;
  15941. /**
  15942. * Operations for dealing with CSS properties.
  15943. */
  15944. /**
  15945. * This creates a string that is expected to be equivalent to the style
  15946. * attribute generated by server-side rendering. It by-passes warnings and
  15947. * security checks so it's not safe to use this value for anything other than
  15948. * comparison. It is only used in DEV for SSR validation.
  15949. */
  15950. function createDangerousStringForStyles(styles) {
  15951. {
  15952. var serialized = '';
  15953. var delimiter = '';
  15954. for (var styleName in styles) {
  15955. if (!styles.hasOwnProperty(styleName)) {
  15956. continue;
  15957. }
  15958. var styleValue = styles[styleName];
  15959. if (styleValue != null) {
  15960. var isCustomProperty = styleName.indexOf('--') === 0;
  15961. serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';
  15962. serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
  15963. delimiter = ';';
  15964. }
  15965. }
  15966. return serialized || null;
  15967. }
  15968. }
  15969. /**
  15970. * Sets the value for multiple styles on a node. If a value is specified as
  15971. * '' (empty string), the corresponding style property will be unset.
  15972. *
  15973. * @param {DOMElement} node
  15974. * @param {object} styles
  15975. */
  15976. function setValueForStyles(node, styles) {
  15977. var style = node.style;
  15978. for (var styleName in styles) {
  15979. if (!styles.hasOwnProperty(styleName)) {
  15980. continue;
  15981. }
  15982. var isCustomProperty = styleName.indexOf('--') === 0;
  15983. {
  15984. if (!isCustomProperty) {
  15985. warnValidStyle$1(styleName, styles[styleName]);
  15986. }
  15987. }
  15988. var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
  15989. if (styleName === 'float') {
  15990. styleName = 'cssFloat';
  15991. }
  15992. if (isCustomProperty) {
  15993. style.setProperty(styleName, styleValue);
  15994. } else {
  15995. style[styleName] = styleValue;
  15996. }
  15997. }
  15998. }
  15999. function isValueEmpty(value) {
  16000. return value == null || typeof value === 'boolean' || value === '';
  16001. }
  16002. /**
  16003. * Given {color: 'red', overflow: 'hidden'} returns {
  16004. * color: 'color',
  16005. * overflowX: 'overflow',
  16006. * overflowY: 'overflow',
  16007. * }. This can be read as "the overflowY property was set by the overflow
  16008. * shorthand". That is, the values are the property that each was derived from.
  16009. */
  16010. function expandShorthandMap(styles) {
  16011. var expanded = {};
  16012. for (var key in styles) {
  16013. var longhands = shorthandToLonghand[key] || [key];
  16014. for (var i = 0; i < longhands.length; i++) {
  16015. expanded[longhands[i]] = key;
  16016. }
  16017. }
  16018. return expanded;
  16019. }
  16020. /**
  16021. * When mixing shorthand and longhand property names, we warn during updates if
  16022. * we expect an incorrect result to occur. In particular, we warn for:
  16023. *
  16024. * Updating a shorthand property (longhand gets overwritten):
  16025. * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}
  16026. * becomes .style.font = 'baz'
  16027. * Removing a shorthand property (longhand gets lost too):
  16028. * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}
  16029. * becomes .style.font = ''
  16030. * Removing a longhand property (should revert to shorthand; doesn't):
  16031. * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}
  16032. * becomes .style.fontVariant = ''
  16033. */
  16034. function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
  16035. {
  16036. if (!nextStyles) {
  16037. return;
  16038. }
  16039. var expandedUpdates = expandShorthandMap(styleUpdates);
  16040. var expandedStyles = expandShorthandMap(nextStyles);
  16041. var warnedAbout = {};
  16042. for (var key in expandedUpdates) {
  16043. var originalKey = expandedUpdates[key];
  16044. var correctOriginalKey = expandedStyles[key];
  16045. if (correctOriginalKey && originalKey !== correctOriginalKey) {
  16046. var warningKey = originalKey + ',' + correctOriginalKey;
  16047. if (warnedAbout[warningKey]) {
  16048. continue;
  16049. }
  16050. warnedAbout[warningKey] = true;
  16051. error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);
  16052. }
  16053. }
  16054. }
  16055. }
  16056. // For HTML, certain tags should omit their close tag. We keep a whitelist for
  16057. // those special-case tags.
  16058. var omittedCloseTags = {
  16059. area: true,
  16060. base: true,
  16061. br: true,
  16062. col: true,
  16063. embed: true,
  16064. hr: true,
  16065. img: true,
  16066. input: true,
  16067. keygen: true,
  16068. link: true,
  16069. meta: true,
  16070. param: true,
  16071. source: true,
  16072. track: true,
  16073. wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.
  16074. };
  16075. // `omittedCloseTags` except that `menuitem` should still have its closing tag.
  16076. var voidElementTags = _assign({
  16077. menuitem: true
  16078. }, omittedCloseTags);
  16079. var HTML = '__html';
  16080. var ReactDebugCurrentFrame$3 = null;
  16081. {
  16082. ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
  16083. }
  16084. function assertValidProps(tag, props) {
  16085. if (!props) {
  16086. return;
  16087. } // Note the use of `==` which checks for null or undefined.
  16088. if (voidElementTags[tag]) {
  16089. if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
  16090. {
  16091. throw Error( tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );
  16092. }
  16093. }
  16094. }
  16095. if (props.dangerouslySetInnerHTML != null) {
  16096. if (!(props.children == null)) {
  16097. {
  16098. throw Error( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." );
  16099. }
  16100. }
  16101. if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {
  16102. {
  16103. throw Error( "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information." );
  16104. }
  16105. }
  16106. }
  16107. {
  16108. if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
  16109. error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');
  16110. }
  16111. }
  16112. if (!(props.style == null || typeof props.style === 'object')) {
  16113. {
  16114. throw Error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );
  16115. }
  16116. }
  16117. }
  16118. function isCustomComponent(tagName, props) {
  16119. if (tagName.indexOf('-') === -1) {
  16120. return typeof props.is === 'string';
  16121. }
  16122. switch (tagName) {
  16123. // These are reserved SVG and MathML elements.
  16124. // We don't mind this whitelist too much because we expect it to never grow.
  16125. // The alternative is to track the namespace in a few places which is convoluted.
  16126. // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
  16127. case 'annotation-xml':
  16128. case 'color-profile':
  16129. case 'font-face':
  16130. case 'font-face-src':
  16131. case 'font-face-uri':
  16132. case 'font-face-format':
  16133. case 'font-face-name':
  16134. case 'missing-glyph':
  16135. return false;
  16136. default:
  16137. return true;
  16138. }
  16139. }
  16140. // When adding attributes to the HTML or SVG whitelist, be sure to
  16141. // also add them to this module to ensure casing and incorrect name
  16142. // warnings.
  16143. var possibleStandardNames = {
  16144. // HTML
  16145. accept: 'accept',
  16146. acceptcharset: 'acceptCharset',
  16147. 'accept-charset': 'acceptCharset',
  16148. accesskey: 'accessKey',
  16149. action: 'action',
  16150. allowfullscreen: 'allowFullScreen',
  16151. alt: 'alt',
  16152. as: 'as',
  16153. async: 'async',
  16154. autocapitalize: 'autoCapitalize',
  16155. autocomplete: 'autoComplete',
  16156. autocorrect: 'autoCorrect',
  16157. autofocus: 'autoFocus',
  16158. autoplay: 'autoPlay',
  16159. autosave: 'autoSave',
  16160. capture: 'capture',
  16161. cellpadding: 'cellPadding',
  16162. cellspacing: 'cellSpacing',
  16163. challenge: 'challenge',
  16164. charset: 'charSet',
  16165. checked: 'checked',
  16166. children: 'children',
  16167. cite: 'cite',
  16168. class: 'className',
  16169. classid: 'classID',
  16170. classname: 'className',
  16171. cols: 'cols',
  16172. colspan: 'colSpan',
  16173. content: 'content',
  16174. contenteditable: 'contentEditable',
  16175. contextmenu: 'contextMenu',
  16176. controls: 'controls',
  16177. controlslist: 'controlsList',
  16178. coords: 'coords',
  16179. crossorigin: 'crossOrigin',
  16180. dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
  16181. data: 'data',
  16182. datetime: 'dateTime',
  16183. default: 'default',
  16184. defaultchecked: 'defaultChecked',
  16185. defaultvalue: 'defaultValue',
  16186. defer: 'defer',
  16187. dir: 'dir',
  16188. disabled: 'disabled',
  16189. disablepictureinpicture: 'disablePictureInPicture',
  16190. download: 'download',
  16191. draggable: 'draggable',
  16192. enctype: 'encType',
  16193. for: 'htmlFor',
  16194. form: 'form',
  16195. formmethod: 'formMethod',
  16196. formaction: 'formAction',
  16197. formenctype: 'formEncType',
  16198. formnovalidate: 'formNoValidate',
  16199. formtarget: 'formTarget',
  16200. frameborder: 'frameBorder',
  16201. headers: 'headers',
  16202. height: 'height',
  16203. hidden: 'hidden',
  16204. high: 'high',
  16205. href: 'href',
  16206. hreflang: 'hrefLang',
  16207. htmlfor: 'htmlFor',
  16208. httpequiv: 'httpEquiv',
  16209. 'http-equiv': 'httpEquiv',
  16210. icon: 'icon',
  16211. id: 'id',
  16212. innerhtml: 'innerHTML',
  16213. inputmode: 'inputMode',
  16214. integrity: 'integrity',
  16215. is: 'is',
  16216. itemid: 'itemID',
  16217. itemprop: 'itemProp',
  16218. itemref: 'itemRef',
  16219. itemscope: 'itemScope',
  16220. itemtype: 'itemType',
  16221. keyparams: 'keyParams',
  16222. keytype: 'keyType',
  16223. kind: 'kind',
  16224. label: 'label',
  16225. lang: 'lang',
  16226. list: 'list',
  16227. loop: 'loop',
  16228. low: 'low',
  16229. manifest: 'manifest',
  16230. marginwidth: 'marginWidth',
  16231. marginheight: 'marginHeight',
  16232. max: 'max',
  16233. maxlength: 'maxLength',
  16234. media: 'media',
  16235. mediagroup: 'mediaGroup',
  16236. method: 'method',
  16237. min: 'min',
  16238. minlength: 'minLength',
  16239. multiple: 'multiple',
  16240. muted: 'muted',
  16241. name: 'name',
  16242. nomodule: 'noModule',
  16243. nonce: 'nonce',
  16244. novalidate: 'noValidate',
  16245. open: 'open',
  16246. optimum: 'optimum',
  16247. pattern: 'pattern',
  16248. placeholder: 'placeholder',
  16249. playsinline: 'playsInline',
  16250. poster: 'poster',
  16251. preload: 'preload',
  16252. profile: 'profile',
  16253. radiogroup: 'radioGroup',
  16254. readonly: 'readOnly',
  16255. referrerpolicy: 'referrerPolicy',
  16256. rel: 'rel',
  16257. required: 'required',
  16258. reversed: 'reversed',
  16259. role: 'role',
  16260. rows: 'rows',
  16261. rowspan: 'rowSpan',
  16262. sandbox: 'sandbox',
  16263. scope: 'scope',
  16264. scoped: 'scoped',
  16265. scrolling: 'scrolling',
  16266. seamless: 'seamless',
  16267. selected: 'selected',
  16268. shape: 'shape',
  16269. size: 'size',
  16270. sizes: 'sizes',
  16271. span: 'span',
  16272. spellcheck: 'spellCheck',
  16273. src: 'src',
  16274. srcdoc: 'srcDoc',
  16275. srclang: 'srcLang',
  16276. srcset: 'srcSet',
  16277. start: 'start',
  16278. step: 'step',
  16279. style: 'style',
  16280. summary: 'summary',
  16281. tabindex: 'tabIndex',
  16282. target: 'target',
  16283. title: 'title',
  16284. type: 'type',
  16285. usemap: 'useMap',
  16286. value: 'value',
  16287. width: 'width',
  16288. wmode: 'wmode',
  16289. wrap: 'wrap',
  16290. // SVG
  16291. about: 'about',
  16292. accentheight: 'accentHeight',
  16293. 'accent-height': 'accentHeight',
  16294. accumulate: 'accumulate',
  16295. additive: 'additive',
  16296. alignmentbaseline: 'alignmentBaseline',
  16297. 'alignment-baseline': 'alignmentBaseline',
  16298. allowreorder: 'allowReorder',
  16299. alphabetic: 'alphabetic',
  16300. amplitude: 'amplitude',
  16301. arabicform: 'arabicForm',
  16302. 'arabic-form': 'arabicForm',
  16303. ascent: 'ascent',
  16304. attributename: 'attributeName',
  16305. attributetype: 'attributeType',
  16306. autoreverse: 'autoReverse',
  16307. azimuth: 'azimuth',
  16308. basefrequency: 'baseFrequency',
  16309. baselineshift: 'baselineShift',
  16310. 'baseline-shift': 'baselineShift',
  16311. baseprofile: 'baseProfile',
  16312. bbox: 'bbox',
  16313. begin: 'begin',
  16314. bias: 'bias',
  16315. by: 'by',
  16316. calcmode: 'calcMode',
  16317. capheight: 'capHeight',
  16318. 'cap-height': 'capHeight',
  16319. clip: 'clip',
  16320. clippath: 'clipPath',
  16321. 'clip-path': 'clipPath',
  16322. clippathunits: 'clipPathUnits',
  16323. cliprule: 'clipRule',
  16324. 'clip-rule': 'clipRule',
  16325. color: 'color',
  16326. colorinterpolation: 'colorInterpolation',
  16327. 'color-interpolation': 'colorInterpolation',
  16328. colorinterpolationfilters: 'colorInterpolationFilters',
  16329. 'color-interpolation-filters': 'colorInterpolationFilters',
  16330. colorprofile: 'colorProfile',
  16331. 'color-profile': 'colorProfile',
  16332. colorrendering: 'colorRendering',
  16333. 'color-rendering': 'colorRendering',
  16334. contentscripttype: 'contentScriptType',
  16335. contentstyletype: 'contentStyleType',
  16336. cursor: 'cursor',
  16337. cx: 'cx',
  16338. cy: 'cy',
  16339. d: 'd',
  16340. datatype: 'datatype',
  16341. decelerate: 'decelerate',
  16342. descent: 'descent',
  16343. diffuseconstant: 'diffuseConstant',
  16344. direction: 'direction',
  16345. display: 'display',
  16346. divisor: 'divisor',
  16347. dominantbaseline: 'dominantBaseline',
  16348. 'dominant-baseline': 'dominantBaseline',
  16349. dur: 'dur',
  16350. dx: 'dx',
  16351. dy: 'dy',
  16352. edgemode: 'edgeMode',
  16353. elevation: 'elevation',
  16354. enablebackground: 'enableBackground',
  16355. 'enable-background': 'enableBackground',
  16356. end: 'end',
  16357. exponent: 'exponent',
  16358. externalresourcesrequired: 'externalResourcesRequired',
  16359. fill: 'fill',
  16360. fillopacity: 'fillOpacity',
  16361. 'fill-opacity': 'fillOpacity',
  16362. fillrule: 'fillRule',
  16363. 'fill-rule': 'fillRule',
  16364. filter: 'filter',
  16365. filterres: 'filterRes',
  16366. filterunits: 'filterUnits',
  16367. floodopacity: 'floodOpacity',
  16368. 'flood-opacity': 'floodOpacity',
  16369. floodcolor: 'floodColor',
  16370. 'flood-color': 'floodColor',
  16371. focusable: 'focusable',
  16372. fontfamily: 'fontFamily',
  16373. 'font-family': 'fontFamily',
  16374. fontsize: 'fontSize',
  16375. 'font-size': 'fontSize',
  16376. fontsizeadjust: 'fontSizeAdjust',
  16377. 'font-size-adjust': 'fontSizeAdjust',
  16378. fontstretch: 'fontStretch',
  16379. 'font-stretch': 'fontStretch',
  16380. fontstyle: 'fontStyle',
  16381. 'font-style': 'fontStyle',
  16382. fontvariant: 'fontVariant',
  16383. 'font-variant': 'fontVariant',
  16384. fontweight: 'fontWeight',
  16385. 'font-weight': 'fontWeight',
  16386. format: 'format',
  16387. from: 'from',
  16388. fx: 'fx',
  16389. fy: 'fy',
  16390. g1: 'g1',
  16391. g2: 'g2',
  16392. glyphname: 'glyphName',
  16393. 'glyph-name': 'glyphName',
  16394. glyphorientationhorizontal: 'glyphOrientationHorizontal',
  16395. 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
  16396. glyphorientationvertical: 'glyphOrientationVertical',
  16397. 'glyph-orientation-vertical': 'glyphOrientationVertical',
  16398. glyphref: 'glyphRef',
  16399. gradienttransform: 'gradientTransform',
  16400. gradientunits: 'gradientUnits',
  16401. hanging: 'hanging',
  16402. horizadvx: 'horizAdvX',
  16403. 'horiz-adv-x': 'horizAdvX',
  16404. horizoriginx: 'horizOriginX',
  16405. 'horiz-origin-x': 'horizOriginX',
  16406. ideographic: 'ideographic',
  16407. imagerendering: 'imageRendering',
  16408. 'image-rendering': 'imageRendering',
  16409. in2: 'in2',
  16410. in: 'in',
  16411. inlist: 'inlist',
  16412. intercept: 'intercept',
  16413. k1: 'k1',
  16414. k2: 'k2',
  16415. k3: 'k3',
  16416. k4: 'k4',
  16417. k: 'k',
  16418. kernelmatrix: 'kernelMatrix',
  16419. kernelunitlength: 'kernelUnitLength',
  16420. kerning: 'kerning',
  16421. keypoints: 'keyPoints',
  16422. keysplines: 'keySplines',
  16423. keytimes: 'keyTimes',
  16424. lengthadjust: 'lengthAdjust',
  16425. letterspacing: 'letterSpacing',
  16426. 'letter-spacing': 'letterSpacing',
  16427. lightingcolor: 'lightingColor',
  16428. 'lighting-color': 'lightingColor',
  16429. limitingconeangle: 'limitingConeAngle',
  16430. local: 'local',
  16431. markerend: 'markerEnd',
  16432. 'marker-end': 'markerEnd',
  16433. markerheight: 'markerHeight',
  16434. markermid: 'markerMid',
  16435. 'marker-mid': 'markerMid',
  16436. markerstart: 'markerStart',
  16437. 'marker-start': 'markerStart',
  16438. markerunits: 'markerUnits',
  16439. markerwidth: 'markerWidth',
  16440. mask: 'mask',
  16441. maskcontentunits: 'maskContentUnits',
  16442. maskunits: 'maskUnits',
  16443. mathematical: 'mathematical',
  16444. mode: 'mode',
  16445. numoctaves: 'numOctaves',
  16446. offset: 'offset',
  16447. opacity: 'opacity',
  16448. operator: 'operator',
  16449. order: 'order',
  16450. orient: 'orient',
  16451. orientation: 'orientation',
  16452. origin: 'origin',
  16453. overflow: 'overflow',
  16454. overlineposition: 'overlinePosition',
  16455. 'overline-position': 'overlinePosition',
  16456. overlinethickness: 'overlineThickness',
  16457. 'overline-thickness': 'overlineThickness',
  16458. paintorder: 'paintOrder',
  16459. 'paint-order': 'paintOrder',
  16460. panose1: 'panose1',
  16461. 'panose-1': 'panose1',
  16462. pathlength: 'pathLength',
  16463. patterncontentunits: 'patternContentUnits',
  16464. patterntransform: 'patternTransform',
  16465. patternunits: 'patternUnits',
  16466. pointerevents: 'pointerEvents',
  16467. 'pointer-events': 'pointerEvents',
  16468. points: 'points',
  16469. pointsatx: 'pointsAtX',
  16470. pointsaty: 'pointsAtY',
  16471. pointsatz: 'pointsAtZ',
  16472. prefix: 'prefix',
  16473. preservealpha: 'preserveAlpha',
  16474. preserveaspectratio: 'preserveAspectRatio',
  16475. primitiveunits: 'primitiveUnits',
  16476. property: 'property',
  16477. r: 'r',
  16478. radius: 'radius',
  16479. refx: 'refX',
  16480. refy: 'refY',
  16481. renderingintent: 'renderingIntent',
  16482. 'rendering-intent': 'renderingIntent',
  16483. repeatcount: 'repeatCount',
  16484. repeatdur: 'repeatDur',
  16485. requiredextensions: 'requiredExtensions',
  16486. requiredfeatures: 'requiredFeatures',
  16487. resource: 'resource',
  16488. restart: 'restart',
  16489. result: 'result',
  16490. results: 'results',
  16491. rotate: 'rotate',
  16492. rx: 'rx',
  16493. ry: 'ry',
  16494. scale: 'scale',
  16495. security: 'security',
  16496. seed: 'seed',
  16497. shaperendering: 'shapeRendering',
  16498. 'shape-rendering': 'shapeRendering',
  16499. slope: 'slope',
  16500. spacing: 'spacing',
  16501. specularconstant: 'specularConstant',
  16502. specularexponent: 'specularExponent',
  16503. speed: 'speed',
  16504. spreadmethod: 'spreadMethod',
  16505. startoffset: 'startOffset',
  16506. stddeviation: 'stdDeviation',
  16507. stemh: 'stemh',
  16508. stemv: 'stemv',
  16509. stitchtiles: 'stitchTiles',
  16510. stopcolor: 'stopColor',
  16511. 'stop-color': 'stopColor',
  16512. stopopacity: 'stopOpacity',
  16513. 'stop-opacity': 'stopOpacity',
  16514. strikethroughposition: 'strikethroughPosition',
  16515. 'strikethrough-position': 'strikethroughPosition',
  16516. strikethroughthickness: 'strikethroughThickness',
  16517. 'strikethrough-thickness': 'strikethroughThickness',
  16518. string: 'string',
  16519. stroke: 'stroke',
  16520. strokedasharray: 'strokeDasharray',
  16521. 'stroke-dasharray': 'strokeDasharray',
  16522. strokedashoffset: 'strokeDashoffset',
  16523. 'stroke-dashoffset': 'strokeDashoffset',
  16524. strokelinecap: 'strokeLinecap',
  16525. 'stroke-linecap': 'strokeLinecap',
  16526. strokelinejoin: 'strokeLinejoin',
  16527. 'stroke-linejoin': 'strokeLinejoin',
  16528. strokemiterlimit: 'strokeMiterlimit',
  16529. 'stroke-miterlimit': 'strokeMiterlimit',
  16530. strokewidth: 'strokeWidth',
  16531. 'stroke-width': 'strokeWidth',
  16532. strokeopacity: 'strokeOpacity',
  16533. 'stroke-opacity': 'strokeOpacity',
  16534. suppresscontenteditablewarning: 'suppressContentEditableWarning',
  16535. suppresshydrationwarning: 'suppressHydrationWarning',
  16536. surfacescale: 'surfaceScale',
  16537. systemlanguage: 'systemLanguage',
  16538. tablevalues: 'tableValues',
  16539. targetx: 'targetX',
  16540. targety: 'targetY',
  16541. textanchor: 'textAnchor',
  16542. 'text-anchor': 'textAnchor',
  16543. textdecoration: 'textDecoration',
  16544. 'text-decoration': 'textDecoration',
  16545. textlength: 'textLength',
  16546. textrendering: 'textRendering',
  16547. 'text-rendering': 'textRendering',
  16548. to: 'to',
  16549. transform: 'transform',
  16550. typeof: 'typeof',
  16551. u1: 'u1',
  16552. u2: 'u2',
  16553. underlineposition: 'underlinePosition',
  16554. 'underline-position': 'underlinePosition',
  16555. underlinethickness: 'underlineThickness',
  16556. 'underline-thickness': 'underlineThickness',
  16557. unicode: 'unicode',
  16558. unicodebidi: 'unicodeBidi',
  16559. 'unicode-bidi': 'unicodeBidi',
  16560. unicoderange: 'unicodeRange',
  16561. 'unicode-range': 'unicodeRange',
  16562. unitsperem: 'unitsPerEm',
  16563. 'units-per-em': 'unitsPerEm',
  16564. unselectable: 'unselectable',
  16565. valphabetic: 'vAlphabetic',
  16566. 'v-alphabetic': 'vAlphabetic',
  16567. values: 'values',
  16568. vectoreffect: 'vectorEffect',
  16569. 'vector-effect': 'vectorEffect',
  16570. version: 'version',
  16571. vertadvy: 'vertAdvY',
  16572. 'vert-adv-y': 'vertAdvY',
  16573. vertoriginx: 'vertOriginX',
  16574. 'vert-origin-x': 'vertOriginX',
  16575. vertoriginy: 'vertOriginY',
  16576. 'vert-origin-y': 'vertOriginY',
  16577. vhanging: 'vHanging',
  16578. 'v-hanging': 'vHanging',
  16579. videographic: 'vIdeographic',
  16580. 'v-ideographic': 'vIdeographic',
  16581. viewbox: 'viewBox',
  16582. viewtarget: 'viewTarget',
  16583. visibility: 'visibility',
  16584. vmathematical: 'vMathematical',
  16585. 'v-mathematical': 'vMathematical',
  16586. vocab: 'vocab',
  16587. widths: 'widths',
  16588. wordspacing: 'wordSpacing',
  16589. 'word-spacing': 'wordSpacing',
  16590. writingmode: 'writingMode',
  16591. 'writing-mode': 'writingMode',
  16592. x1: 'x1',
  16593. x2: 'x2',
  16594. x: 'x',
  16595. xchannelselector: 'xChannelSelector',
  16596. xheight: 'xHeight',
  16597. 'x-height': 'xHeight',
  16598. xlinkactuate: 'xlinkActuate',
  16599. 'xlink:actuate': 'xlinkActuate',
  16600. xlinkarcrole: 'xlinkArcrole',
  16601. 'xlink:arcrole': 'xlinkArcrole',
  16602. xlinkhref: 'xlinkHref',
  16603. 'xlink:href': 'xlinkHref',
  16604. xlinkrole: 'xlinkRole',
  16605. 'xlink:role': 'xlinkRole',
  16606. xlinkshow: 'xlinkShow',
  16607. 'xlink:show': 'xlinkShow',
  16608. xlinktitle: 'xlinkTitle',
  16609. 'xlink:title': 'xlinkTitle',
  16610. xlinktype: 'xlinkType',
  16611. 'xlink:type': 'xlinkType',
  16612. xmlbase: 'xmlBase',
  16613. 'xml:base': 'xmlBase',
  16614. xmllang: 'xmlLang',
  16615. 'xml:lang': 'xmlLang',
  16616. xmlns: 'xmlns',
  16617. 'xml:space': 'xmlSpace',
  16618. xmlnsxlink: 'xmlnsXlink',
  16619. 'xmlns:xlink': 'xmlnsXlink',
  16620. xmlspace: 'xmlSpace',
  16621. y1: 'y1',
  16622. y2: 'y2',
  16623. y: 'y',
  16624. ychannelselector: 'yChannelSelector',
  16625. z: 'z',
  16626. zoomandpan: 'zoomAndPan'
  16627. };
  16628. var ariaProperties = {
  16629. 'aria-current': 0,
  16630. // state
  16631. 'aria-details': 0,
  16632. 'aria-disabled': 0,
  16633. // state
  16634. 'aria-hidden': 0,
  16635. // state
  16636. 'aria-invalid': 0,
  16637. // state
  16638. 'aria-keyshortcuts': 0,
  16639. 'aria-label': 0,
  16640. 'aria-roledescription': 0,
  16641. // Widget Attributes
  16642. 'aria-autocomplete': 0,
  16643. 'aria-checked': 0,
  16644. 'aria-expanded': 0,
  16645. 'aria-haspopup': 0,
  16646. 'aria-level': 0,
  16647. 'aria-modal': 0,
  16648. 'aria-multiline': 0,
  16649. 'aria-multiselectable': 0,
  16650. 'aria-orientation': 0,
  16651. 'aria-placeholder': 0,
  16652. 'aria-pressed': 0,
  16653. 'aria-readonly': 0,
  16654. 'aria-required': 0,
  16655. 'aria-selected': 0,
  16656. 'aria-sort': 0,
  16657. 'aria-valuemax': 0,
  16658. 'aria-valuemin': 0,
  16659. 'aria-valuenow': 0,
  16660. 'aria-valuetext': 0,
  16661. // Live Region Attributes
  16662. 'aria-atomic': 0,
  16663. 'aria-busy': 0,
  16664. 'aria-live': 0,
  16665. 'aria-relevant': 0,
  16666. // Drag-and-Drop Attributes
  16667. 'aria-dropeffect': 0,
  16668. 'aria-grabbed': 0,
  16669. // Relationship Attributes
  16670. 'aria-activedescendant': 0,
  16671. 'aria-colcount': 0,
  16672. 'aria-colindex': 0,
  16673. 'aria-colspan': 0,
  16674. 'aria-controls': 0,
  16675. 'aria-describedby': 0,
  16676. 'aria-errormessage': 0,
  16677. 'aria-flowto': 0,
  16678. 'aria-labelledby': 0,
  16679. 'aria-owns': 0,
  16680. 'aria-posinset': 0,
  16681. 'aria-rowcount': 0,
  16682. 'aria-rowindex': 0,
  16683. 'aria-rowspan': 0,
  16684. 'aria-setsize': 0
  16685. };
  16686. var warnedProperties = {};
  16687. var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
  16688. var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
  16689. var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  16690. function validateProperty(tagName, name) {
  16691. {
  16692. if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
  16693. return true;
  16694. }
  16695. if (rARIACamel.test(name)) {
  16696. var ariaName = 'aria-' + name.slice(4).toLowerCase();
  16697. var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM
  16698. // DOM properties, then it is an invalid aria-* attribute.
  16699. if (correctName == null) {
  16700. error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
  16701. warnedProperties[name] = true;
  16702. return true;
  16703. } // aria-* attributes should be lowercase; suggest the lowercase version.
  16704. if (name !== correctName) {
  16705. error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
  16706. warnedProperties[name] = true;
  16707. return true;
  16708. }
  16709. }
  16710. if (rARIA.test(name)) {
  16711. var lowerCasedName = name.toLowerCase();
  16712. var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM
  16713. // DOM properties, then it is an invalid aria-* attribute.
  16714. if (standardName == null) {
  16715. warnedProperties[name] = true;
  16716. return false;
  16717. } // aria-* attributes should be lowercase; suggest the lowercase version.
  16718. if (name !== standardName) {
  16719. error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
  16720. warnedProperties[name] = true;
  16721. return true;
  16722. }
  16723. }
  16724. }
  16725. return true;
  16726. }
  16727. function warnInvalidARIAProps(type, props) {
  16728. {
  16729. var invalidProps = [];
  16730. for (var key in props) {
  16731. var isValid = validateProperty(type, key);
  16732. if (!isValid) {
  16733. invalidProps.push(key);
  16734. }
  16735. }
  16736. var unknownPropString = invalidProps.map(function (prop) {
  16737. return '`' + prop + '`';
  16738. }).join(', ');
  16739. if (invalidProps.length === 1) {
  16740. error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  16741. } else if (invalidProps.length > 1) {
  16742. error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  16743. }
  16744. }
  16745. }
  16746. function validateProperties(type, props) {
  16747. if (isCustomComponent(type, props)) {
  16748. return;
  16749. }
  16750. warnInvalidARIAProps(type, props);
  16751. }
  16752. var didWarnValueNull = false;
  16753. function validateProperties$1(type, props) {
  16754. {
  16755. if (type !== 'input' && type !== 'textarea' && type !== 'select') {
  16756. return;
  16757. }
  16758. if (props != null && props.value === null && !didWarnValueNull) {
  16759. didWarnValueNull = true;
  16760. if (type === 'select' && props.multiple) {
  16761. error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
  16762. } else {
  16763. error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
  16764. }
  16765. }
  16766. }
  16767. }
  16768. var validateProperty$1 = function () {};
  16769. {
  16770. var warnedProperties$1 = {};
  16771. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  16772. var EVENT_NAME_REGEX = /^on./;
  16773. var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
  16774. var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
  16775. var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
  16776. validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
  16777. if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
  16778. return true;
  16779. }
  16780. var lowerCasedName = name.toLowerCase();
  16781. if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
  16782. error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
  16783. warnedProperties$1[name] = true;
  16784. return true;
  16785. } // We can't rely on the event system being injected on the server.
  16786. if (canUseEventSystem) {
  16787. if (registrationNameModules.hasOwnProperty(name)) {
  16788. return true;
  16789. }
  16790. var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
  16791. if (registrationName != null) {
  16792. error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
  16793. warnedProperties$1[name] = true;
  16794. return true;
  16795. }
  16796. if (EVENT_NAME_REGEX.test(name)) {
  16797. error('Unknown event handler property `%s`. It will be ignored.', name);
  16798. warnedProperties$1[name] = true;
  16799. return true;
  16800. }
  16801. } else if (EVENT_NAME_REGEX.test(name)) {
  16802. // If no event plugins have been injected, we are in a server environment.
  16803. // So we can't tell if the event name is correct for sure, but we can filter
  16804. // out known bad ones like `onclick`. We can't suggest a specific replacement though.
  16805. if (INVALID_EVENT_NAME_REGEX.test(name)) {
  16806. error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
  16807. }
  16808. warnedProperties$1[name] = true;
  16809. return true;
  16810. } // Let the ARIA attribute hook validate ARIA attributes
  16811. if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
  16812. return true;
  16813. }
  16814. if (lowerCasedName === 'innerhtml') {
  16815. error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
  16816. warnedProperties$1[name] = true;
  16817. return true;
  16818. }
  16819. if (lowerCasedName === 'aria') {
  16820. error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
  16821. warnedProperties$1[name] = true;
  16822. return true;
  16823. }
  16824. if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
  16825. error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
  16826. warnedProperties$1[name] = true;
  16827. return true;
  16828. }
  16829. if (typeof value === 'number' && isNaN(value)) {
  16830. error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
  16831. warnedProperties$1[name] = true;
  16832. return true;
  16833. }
  16834. var propertyInfo = getPropertyInfo(name);
  16835. var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.
  16836. if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
  16837. var standardName = possibleStandardNames[lowerCasedName];
  16838. if (standardName !== name) {
  16839. error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
  16840. warnedProperties$1[name] = true;
  16841. return true;
  16842. }
  16843. } else if (!isReserved && name !== lowerCasedName) {
  16844. // Unknown attributes should have lowercase casing since that's how they
  16845. // will be cased anyway with server rendering.
  16846. error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
  16847. warnedProperties$1[name] = true;
  16848. return true;
  16849. }
  16850. if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
  16851. if (value) {
  16852. error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
  16853. } else {
  16854. error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
  16855. }
  16856. warnedProperties$1[name] = true;
  16857. return true;
  16858. } // Now that we've validated casing, do not validate
  16859. // data types for reserved props
  16860. if (isReserved) {
  16861. return true;
  16862. } // Warn when a known attribute is a bad type
  16863. if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
  16864. warnedProperties$1[name] = true;
  16865. return false;
  16866. } // Warn when passing the strings 'false' or 'true' into a boolean prop
  16867. if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
  16868. error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
  16869. warnedProperties$1[name] = true;
  16870. return true;
  16871. }
  16872. return true;
  16873. };
  16874. }
  16875. var warnUnknownProperties = function (type, props, canUseEventSystem) {
  16876. {
  16877. var unknownProps = [];
  16878. for (var key in props) {
  16879. var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
  16880. if (!isValid) {
  16881. unknownProps.push(key);
  16882. }
  16883. }
  16884. var unknownPropString = unknownProps.map(function (prop) {
  16885. return '`' + prop + '`';
  16886. }).join(', ');
  16887. if (unknownProps.length === 1) {
  16888. error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  16889. } else if (unknownProps.length > 1) {
  16890. error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  16891. }
  16892. }
  16893. };
  16894. function validateProperties$2(type, props, canUseEventSystem) {
  16895. if (isCustomComponent(type, props)) {
  16896. return;
  16897. }
  16898. warnUnknownProperties(type, props, canUseEventSystem);
  16899. }
  16900. var didWarnInvalidHydration = false;
  16901. var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
  16902. var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
  16903. var SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
  16904. var AUTOFOCUS = 'autoFocus';
  16905. var CHILDREN = 'children';
  16906. var STYLE = 'style';
  16907. var HTML$1 = '__html';
  16908. var HTML_NAMESPACE$1 = Namespaces.html;
  16909. var warnedUnknownTags;
  16910. var suppressHydrationWarning;
  16911. var validatePropertiesInDevelopment;
  16912. var warnForTextDifference;
  16913. var warnForPropDifference;
  16914. var warnForExtraAttributes;
  16915. var warnForInvalidEventListener;
  16916. var canDiffStyleForHydrationWarning;
  16917. var normalizeMarkupForTextOrAttribute;
  16918. var normalizeHTML;
  16919. {
  16920. warnedUnknownTags = {
  16921. // Chrome is the only major browser not shipping <time>. But as of July
  16922. // 2017 it intends to ship it due to widespread usage. We intentionally
  16923. // *don't* warn for <time> even if it's unrecognized by Chrome because
  16924. // it soon will be, and many apps have been using it anyway.
  16925. time: true,
  16926. // There are working polyfills for <dialog>. Let people use it.
  16927. dialog: true,
  16928. // Electron ships a custom <webview> tag to display external web content in
  16929. // an isolated frame and process.
  16930. // This tag is not present in non Electron environments such as JSDom which
  16931. // is often used for testing purposes.
  16932. // @see https://electronjs.org/docs/api/webview-tag
  16933. webview: true
  16934. };
  16935. validatePropertiesInDevelopment = function (type, props) {
  16936. validateProperties(type, props);
  16937. validateProperties$1(type, props);
  16938. validateProperties$2(type, props,
  16939. /* canUseEventSystem */
  16940. true);
  16941. }; // IE 11 parses & normalizes the style attribute as opposed to other
  16942. // browsers. It adds spaces and sorts the properties in some
  16943. // non-alphabetical order. Handling that would require sorting CSS
  16944. // properties in the client & server versions or applying
  16945. // `expectedStyle` to a temporary DOM node to read its `style` attribute
  16946. // normalized. Since it only affects IE, we're skipping style warnings
  16947. // in that browser completely in favor of doing all that work.
  16948. // See https://github.com/facebook/react/issues/11807
  16949. canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF.
  16950. // It also can turn \u0000 into \uFFFD inside attributes.
  16951. // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream
  16952. // If we have a mismatch, it might be caused by that.
  16953. // We will still patch up in this case but not fire the warning.
  16954. var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
  16955. var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
  16956. normalizeMarkupForTextOrAttribute = function (markup) {
  16957. var markupString = typeof markup === 'string' ? markup : '' + markup;
  16958. return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');
  16959. };
  16960. warnForTextDifference = function (serverText, clientText) {
  16961. if (didWarnInvalidHydration) {
  16962. return;
  16963. }
  16964. var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
  16965. var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
  16966. if (normalizedServerText === normalizedClientText) {
  16967. return;
  16968. }
  16969. didWarnInvalidHydration = true;
  16970. error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
  16971. };
  16972. warnForPropDifference = function (propName, serverValue, clientValue) {
  16973. if (didWarnInvalidHydration) {
  16974. return;
  16975. }
  16976. var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
  16977. var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
  16978. if (normalizedServerValue === normalizedClientValue) {
  16979. return;
  16980. }
  16981. didWarnInvalidHydration = true;
  16982. error('Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
  16983. };
  16984. warnForExtraAttributes = function (attributeNames) {
  16985. if (didWarnInvalidHydration) {
  16986. return;
  16987. }
  16988. didWarnInvalidHydration = true;
  16989. var names = [];
  16990. attributeNames.forEach(function (name) {
  16991. names.push(name);
  16992. });
  16993. error('Extra attributes from the server: %s', names);
  16994. };
  16995. warnForInvalidEventListener = function (registrationName, listener) {
  16996. if (listener === false) {
  16997. error('Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);
  16998. } else {
  16999. error('Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);
  17000. }
  17001. }; // Parse the HTML and read it back to normalize the HTML string so that it
  17002. // can be used for comparison.
  17003. normalizeHTML = function (parent, html) {
  17004. // We could have created a separate document here to avoid
  17005. // re-initializing custom elements if they exist. But this breaks
  17006. // how <noscript> is being handled. So we use the same document.
  17007. // See the discussion in https://github.com/facebook/react/pull/11157.
  17008. var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
  17009. testElement.innerHTML = html;
  17010. return testElement.innerHTML;
  17011. };
  17012. }
  17013. function ensureListeningTo(rootContainerElement, registrationName) {
  17014. var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;
  17015. var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;
  17016. legacyListenToEvent(registrationName, doc);
  17017. }
  17018. function getOwnerDocumentFromRootContainer(rootContainerElement) {
  17019. return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
  17020. }
  17021. function noop() {}
  17022. function trapClickOnNonInteractiveElement(node) {
  17023. // Mobile Safari does not fire properly bubble click events on
  17024. // non-interactive elements, which means delegated click listeners do not
  17025. // fire. The workaround for this bug involves attaching an empty click
  17026. // listener on the target node.
  17027. // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  17028. // Just set it using the onclick property so that we don't have to manage any
  17029. // bookkeeping for it. Not sure if we need to clear it when the listener is
  17030. // removed.
  17031. // TODO: Only do this for the relevant Safaris maybe?
  17032. node.onclick = noop;
  17033. }
  17034. function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
  17035. for (var propKey in nextProps) {
  17036. if (!nextProps.hasOwnProperty(propKey)) {
  17037. continue;
  17038. }
  17039. var nextProp = nextProps[propKey];
  17040. if (propKey === STYLE) {
  17041. {
  17042. if (nextProp) {
  17043. // Freeze the next style object so that we can assume it won't be
  17044. // mutated. We have already warned for this in the past.
  17045. Object.freeze(nextProp);
  17046. }
  17047. } // Relies on `updateStylesByID` not mutating `styleUpdates`.
  17048. setValueForStyles(domElement, nextProp);
  17049. } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
  17050. var nextHtml = nextProp ? nextProp[HTML$1] : undefined;
  17051. if (nextHtml != null) {
  17052. setInnerHTML(domElement, nextHtml);
  17053. }
  17054. } else if (propKey === CHILDREN) {
  17055. if (typeof nextProp === 'string') {
  17056. // Avoid setting initial textContent when the text is empty. In IE11 setting
  17057. // textContent on a <textarea> will cause the placeholder to not
  17058. // show within the <textarea> until it has been focused and blurred again.
  17059. // https://github.com/facebook/react/issues/6731#issuecomment-254874553
  17060. var canSetTextContent = tag !== 'textarea' || nextProp !== '';
  17061. if (canSetTextContent) {
  17062. setTextContent(domElement, nextProp);
  17063. }
  17064. } else if (typeof nextProp === 'number') {
  17065. setTextContent(domElement, '' + nextProp);
  17066. }
  17067. } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) {
  17068. if (nextProp != null) {
  17069. if ( typeof nextProp !== 'function') {
  17070. warnForInvalidEventListener(propKey, nextProp);
  17071. }
  17072. ensureListeningTo(rootContainerElement, propKey);
  17073. }
  17074. } else if (nextProp != null) {
  17075. setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
  17076. }
  17077. }
  17078. }
  17079. function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
  17080. // TODO: Handle wasCustomComponentTag
  17081. for (var i = 0; i < updatePayload.length; i += 2) {
  17082. var propKey = updatePayload[i];
  17083. var propValue = updatePayload[i + 1];
  17084. if (propKey === STYLE) {
  17085. setValueForStyles(domElement, propValue);
  17086. } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
  17087. setInnerHTML(domElement, propValue);
  17088. } else if (propKey === CHILDREN) {
  17089. setTextContent(domElement, propValue);
  17090. } else {
  17091. setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
  17092. }
  17093. }
  17094. }
  17095. function createElement(type, props, rootContainerElement, parentNamespace) {
  17096. var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML
  17097. // tags get no namespace.
  17098. var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
  17099. var domElement;
  17100. var namespaceURI = parentNamespace;
  17101. if (namespaceURI === HTML_NAMESPACE$1) {
  17102. namespaceURI = getIntrinsicNamespace(type);
  17103. }
  17104. if (namespaceURI === HTML_NAMESPACE$1) {
  17105. {
  17106. isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to
  17107. // allow <SVG> or <mATH>.
  17108. if (!isCustomComponentTag && type !== type.toLowerCase()) {
  17109. error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type);
  17110. }
  17111. }
  17112. if (type === 'script') {
  17113. // Create the script via .innerHTML so its "parser-inserted" flag is
  17114. // set to true and it does not execute
  17115. var div = ownerDocument.createElement('div');
  17116. div.innerHTML = '<script><' + '/script>'; // eslint-disable-line
  17117. // This is guaranteed to yield a script element.
  17118. var firstChild = div.firstChild;
  17119. domElement = div.removeChild(firstChild);
  17120. } else if (typeof props.is === 'string') {
  17121. // $FlowIssue `createElement` should be updated for Web Components
  17122. domElement = ownerDocument.createElement(type, {
  17123. is: props.is
  17124. });
  17125. } else {
  17126. // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
  17127. // See discussion in https://github.com/facebook/react/pull/6896
  17128. // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
  17129. domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`
  17130. // attributes on `select`s needs to be added before `option`s are inserted.
  17131. // This prevents:
  17132. // - a bug where the `select` does not scroll to the correct option because singular
  17133. // `select` elements automatically pick the first item #13222
  17134. // - a bug where the `select` set the first item as selected despite the `size` attribute #14239
  17135. // See https://github.com/facebook/react/issues/13222
  17136. // and https://github.com/facebook/react/issues/14239
  17137. if (type === 'select') {
  17138. var node = domElement;
  17139. if (props.multiple) {
  17140. node.multiple = true;
  17141. } else if (props.size) {
  17142. // Setting a size greater than 1 causes a select to behave like `multiple=true`, where
  17143. // it is possible that no option is selected.
  17144. //
  17145. // This is only necessary when a select in "single selection mode".
  17146. node.size = props.size;
  17147. }
  17148. }
  17149. }
  17150. } else {
  17151. domElement = ownerDocument.createElementNS(namespaceURI, type);
  17152. }
  17153. {
  17154. if (namespaceURI === HTML_NAMESPACE$1) {
  17155. if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
  17156. warnedUnknownTags[type] = true;
  17157. error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);
  17158. }
  17159. }
  17160. }
  17161. return domElement;
  17162. }
  17163. function createTextNode(text, rootContainerElement) {
  17164. return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
  17165. }
  17166. function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
  17167. var isCustomComponentTag = isCustomComponent(tag, rawProps);
  17168. {
  17169. validatePropertiesInDevelopment(tag, rawProps);
  17170. } // TODO: Make sure that we check isMounted before firing any of these events.
  17171. var props;
  17172. switch (tag) {
  17173. case 'iframe':
  17174. case 'object':
  17175. case 'embed':
  17176. trapBubbledEvent(TOP_LOAD, domElement);
  17177. props = rawProps;
  17178. break;
  17179. case 'video':
  17180. case 'audio':
  17181. // Create listener for each media event
  17182. for (var i = 0; i < mediaEventTypes.length; i++) {
  17183. trapBubbledEvent(mediaEventTypes[i], domElement);
  17184. }
  17185. props = rawProps;
  17186. break;
  17187. case 'source':
  17188. trapBubbledEvent(TOP_ERROR, domElement);
  17189. props = rawProps;
  17190. break;
  17191. case 'img':
  17192. case 'image':
  17193. case 'link':
  17194. trapBubbledEvent(TOP_ERROR, domElement);
  17195. trapBubbledEvent(TOP_LOAD, domElement);
  17196. props = rawProps;
  17197. break;
  17198. case 'form':
  17199. trapBubbledEvent(TOP_RESET, domElement);
  17200. trapBubbledEvent(TOP_SUBMIT, domElement);
  17201. props = rawProps;
  17202. break;
  17203. case 'details':
  17204. trapBubbledEvent(TOP_TOGGLE, domElement);
  17205. props = rawProps;
  17206. break;
  17207. case 'input':
  17208. initWrapperState(domElement, rawProps);
  17209. props = getHostProps(domElement, rawProps);
  17210. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  17211. // to onChange. Even if there is no listener.
  17212. ensureListeningTo(rootContainerElement, 'onChange');
  17213. break;
  17214. case 'option':
  17215. validateProps(domElement, rawProps);
  17216. props = getHostProps$1(domElement, rawProps);
  17217. break;
  17218. case 'select':
  17219. initWrapperState$1(domElement, rawProps);
  17220. props = getHostProps$2(domElement, rawProps);
  17221. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  17222. // to onChange. Even if there is no listener.
  17223. ensureListeningTo(rootContainerElement, 'onChange');
  17224. break;
  17225. case 'textarea':
  17226. initWrapperState$2(domElement, rawProps);
  17227. props = getHostProps$3(domElement, rawProps);
  17228. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  17229. // to onChange. Even if there is no listener.
  17230. ensureListeningTo(rootContainerElement, 'onChange');
  17231. break;
  17232. default:
  17233. props = rawProps;
  17234. }
  17235. assertValidProps(tag, props);
  17236. setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
  17237. switch (tag) {
  17238. case 'input':
  17239. // TODO: Make sure we check if this is still unmounted or do any clean
  17240. // up necessary since we never stop tracking anymore.
  17241. track(domElement);
  17242. postMountWrapper(domElement, rawProps, false);
  17243. break;
  17244. case 'textarea':
  17245. // TODO: Make sure we check if this is still unmounted or do any clean
  17246. // up necessary since we never stop tracking anymore.
  17247. track(domElement);
  17248. postMountWrapper$3(domElement);
  17249. break;
  17250. case 'option':
  17251. postMountWrapper$1(domElement, rawProps);
  17252. break;
  17253. case 'select':
  17254. postMountWrapper$2(domElement, rawProps);
  17255. break;
  17256. default:
  17257. if (typeof props.onClick === 'function') {
  17258. // TODO: This cast may not be sound for SVG, MathML or custom elements.
  17259. trapClickOnNonInteractiveElement(domElement);
  17260. }
  17261. break;
  17262. }
  17263. } // Calculate the diff between the two objects.
  17264. function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
  17265. {
  17266. validatePropertiesInDevelopment(tag, nextRawProps);
  17267. }
  17268. var updatePayload = null;
  17269. var lastProps;
  17270. var nextProps;
  17271. switch (tag) {
  17272. case 'input':
  17273. lastProps = getHostProps(domElement, lastRawProps);
  17274. nextProps = getHostProps(domElement, nextRawProps);
  17275. updatePayload = [];
  17276. break;
  17277. case 'option':
  17278. lastProps = getHostProps$1(domElement, lastRawProps);
  17279. nextProps = getHostProps$1(domElement, nextRawProps);
  17280. updatePayload = [];
  17281. break;
  17282. case 'select':
  17283. lastProps = getHostProps$2(domElement, lastRawProps);
  17284. nextProps = getHostProps$2(domElement, nextRawProps);
  17285. updatePayload = [];
  17286. break;
  17287. case 'textarea':
  17288. lastProps = getHostProps$3(domElement, lastRawProps);
  17289. nextProps = getHostProps$3(domElement, nextRawProps);
  17290. updatePayload = [];
  17291. break;
  17292. default:
  17293. lastProps = lastRawProps;
  17294. nextProps = nextRawProps;
  17295. if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
  17296. // TODO: This cast may not be sound for SVG, MathML or custom elements.
  17297. trapClickOnNonInteractiveElement(domElement);
  17298. }
  17299. break;
  17300. }
  17301. assertValidProps(tag, nextProps);
  17302. var propKey;
  17303. var styleName;
  17304. var styleUpdates = null;
  17305. for (propKey in lastProps) {
  17306. if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
  17307. continue;
  17308. }
  17309. if (propKey === STYLE) {
  17310. var lastStyle = lastProps[propKey];
  17311. for (styleName in lastStyle) {
  17312. if (lastStyle.hasOwnProperty(styleName)) {
  17313. if (!styleUpdates) {
  17314. styleUpdates = {};
  17315. }
  17316. styleUpdates[styleName] = '';
  17317. }
  17318. }
  17319. } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) {
  17320. // This is a special case. If any listener updates we need to ensure
  17321. // that the "current" fiber pointer gets updated so we need a commit
  17322. // to update this element.
  17323. if (!updatePayload) {
  17324. updatePayload = [];
  17325. }
  17326. } else {
  17327. // For all other deleted properties we add it to the queue. We use
  17328. // the whitelist in the commit phase instead.
  17329. (updatePayload = updatePayload || []).push(propKey, null);
  17330. }
  17331. }
  17332. for (propKey in nextProps) {
  17333. var nextProp = nextProps[propKey];
  17334. var lastProp = lastProps != null ? lastProps[propKey] : undefined;
  17335. if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
  17336. continue;
  17337. }
  17338. if (propKey === STYLE) {
  17339. {
  17340. if (nextProp) {
  17341. // Freeze the next style object so that we can assume it won't be
  17342. // mutated. We have already warned for this in the past.
  17343. Object.freeze(nextProp);
  17344. }
  17345. }
  17346. if (lastProp) {
  17347. // Unset styles on `lastProp` but not on `nextProp`.
  17348. for (styleName in lastProp) {
  17349. if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
  17350. if (!styleUpdates) {
  17351. styleUpdates = {};
  17352. }
  17353. styleUpdates[styleName] = '';
  17354. }
  17355. } // Update styles that changed since `lastProp`.
  17356. for (styleName in nextProp) {
  17357. if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
  17358. if (!styleUpdates) {
  17359. styleUpdates = {};
  17360. }
  17361. styleUpdates[styleName] = nextProp[styleName];
  17362. }
  17363. }
  17364. } else {
  17365. // Relies on `updateStylesByID` not mutating `styleUpdates`.
  17366. if (!styleUpdates) {
  17367. if (!updatePayload) {
  17368. updatePayload = [];
  17369. }
  17370. updatePayload.push(propKey, styleUpdates);
  17371. }
  17372. styleUpdates = nextProp;
  17373. }
  17374. } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
  17375. var nextHtml = nextProp ? nextProp[HTML$1] : undefined;
  17376. var lastHtml = lastProp ? lastProp[HTML$1] : undefined;
  17377. if (nextHtml != null) {
  17378. if (lastHtml !== nextHtml) {
  17379. (updatePayload = updatePayload || []).push(propKey, nextHtml);
  17380. }
  17381. }
  17382. } else if (propKey === CHILDREN) {
  17383. if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {
  17384. (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
  17385. }
  17386. } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameModules.hasOwnProperty(propKey)) {
  17387. if (nextProp != null) {
  17388. // We eagerly listen to this even though we haven't committed yet.
  17389. if ( typeof nextProp !== 'function') {
  17390. warnForInvalidEventListener(propKey, nextProp);
  17391. }
  17392. ensureListeningTo(rootContainerElement, propKey);
  17393. }
  17394. if (!updatePayload && lastProp !== nextProp) {
  17395. // This is a special case. If any listener updates we need to ensure
  17396. // that the "current" props pointer gets updated so we need a commit
  17397. // to update this element.
  17398. updatePayload = [];
  17399. }
  17400. } else {
  17401. // For any other property we always add it to the queue and then we
  17402. // filter it out using the whitelist during the commit.
  17403. (updatePayload = updatePayload || []).push(propKey, nextProp);
  17404. }
  17405. }
  17406. if (styleUpdates) {
  17407. {
  17408. validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
  17409. }
  17410. (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
  17411. }
  17412. return updatePayload;
  17413. } // Apply the diff.
  17414. function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
  17415. // Update checked *before* name.
  17416. // In the middle of an update, it is possible to have multiple checked.
  17417. // When a checked radio tries to change name, browser makes another radio's checked false.
  17418. if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
  17419. updateChecked(domElement, nextRawProps);
  17420. }
  17421. var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
  17422. var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff.
  17423. updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props
  17424. // changed.
  17425. switch (tag) {
  17426. case 'input':
  17427. // Update the wrapper around inputs *after* updating props. This has to
  17428. // happen after `updateDOMProperties`. Otherwise HTML5 input validations
  17429. // raise warnings and prevent the new value from being assigned.
  17430. updateWrapper(domElement, nextRawProps);
  17431. break;
  17432. case 'textarea':
  17433. updateWrapper$1(domElement, nextRawProps);
  17434. break;
  17435. case 'select':
  17436. // <select> value update needs to occur after <option> children
  17437. // reconciliation
  17438. postUpdateWrapper(domElement, nextRawProps);
  17439. break;
  17440. }
  17441. }
  17442. function getPossibleStandardName(propName) {
  17443. {
  17444. var lowerCasedName = propName.toLowerCase();
  17445. if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
  17446. return null;
  17447. }
  17448. return possibleStandardNames[lowerCasedName] || null;
  17449. }
  17450. }
  17451. function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
  17452. var isCustomComponentTag;
  17453. var extraAttributeNames;
  17454. {
  17455. suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;
  17456. isCustomComponentTag = isCustomComponent(tag, rawProps);
  17457. validatePropertiesInDevelopment(tag, rawProps);
  17458. } // TODO: Make sure that we check isMounted before firing any of these events.
  17459. switch (tag) {
  17460. case 'iframe':
  17461. case 'object':
  17462. case 'embed':
  17463. trapBubbledEvent(TOP_LOAD, domElement);
  17464. break;
  17465. case 'video':
  17466. case 'audio':
  17467. // Create listener for each media event
  17468. for (var i = 0; i < mediaEventTypes.length; i++) {
  17469. trapBubbledEvent(mediaEventTypes[i], domElement);
  17470. }
  17471. break;
  17472. case 'source':
  17473. trapBubbledEvent(TOP_ERROR, domElement);
  17474. break;
  17475. case 'img':
  17476. case 'image':
  17477. case 'link':
  17478. trapBubbledEvent(TOP_ERROR, domElement);
  17479. trapBubbledEvent(TOP_LOAD, domElement);
  17480. break;
  17481. case 'form':
  17482. trapBubbledEvent(TOP_RESET, domElement);
  17483. trapBubbledEvent(TOP_SUBMIT, domElement);
  17484. break;
  17485. case 'details':
  17486. trapBubbledEvent(TOP_TOGGLE, domElement);
  17487. break;
  17488. case 'input':
  17489. initWrapperState(domElement, rawProps);
  17490. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  17491. // to onChange. Even if there is no listener.
  17492. ensureListeningTo(rootContainerElement, 'onChange');
  17493. break;
  17494. case 'option':
  17495. validateProps(domElement, rawProps);
  17496. break;
  17497. case 'select':
  17498. initWrapperState$1(domElement, rawProps);
  17499. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  17500. // to onChange. Even if there is no listener.
  17501. ensureListeningTo(rootContainerElement, 'onChange');
  17502. break;
  17503. case 'textarea':
  17504. initWrapperState$2(domElement, rawProps);
  17505. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  17506. // to onChange. Even if there is no listener.
  17507. ensureListeningTo(rootContainerElement, 'onChange');
  17508. break;
  17509. }
  17510. assertValidProps(tag, rawProps);
  17511. {
  17512. extraAttributeNames = new Set();
  17513. var attributes = domElement.attributes;
  17514. for (var _i = 0; _i < attributes.length; _i++) {
  17515. var name = attributes[_i].name.toLowerCase();
  17516. switch (name) {
  17517. // Built-in SSR attribute is whitelisted
  17518. case 'data-reactroot':
  17519. break;
  17520. // Controlled attributes are not validated
  17521. // TODO: Only ignore them on controlled tags.
  17522. case 'value':
  17523. break;
  17524. case 'checked':
  17525. break;
  17526. case 'selected':
  17527. break;
  17528. default:
  17529. // Intentionally use the original name.
  17530. // See discussion in https://github.com/facebook/react/pull/10676.
  17531. extraAttributeNames.add(attributes[_i].name);
  17532. }
  17533. }
  17534. }
  17535. var updatePayload = null;
  17536. for (var propKey in rawProps) {
  17537. if (!rawProps.hasOwnProperty(propKey)) {
  17538. continue;
  17539. }
  17540. var nextProp = rawProps[propKey];
  17541. if (propKey === CHILDREN) {
  17542. // For text content children we compare against textContent. This
  17543. // might match additional HTML that is hidden when we read it using
  17544. // textContent. E.g. "foo" will match "f<span>oo</span>" but that still
  17545. // satisfies our requirement. Our requirement is not to produce perfect
  17546. // HTML and attributes. Ideally we should preserve structure but it's
  17547. // ok not to if the visible content is still enough to indicate what
  17548. // even listeners these nodes might be wired up to.
  17549. // TODO: Warn if there is more than a single textNode as a child.
  17550. // TODO: Should we use domElement.firstChild.nodeValue to compare?
  17551. if (typeof nextProp === 'string') {
  17552. if (domElement.textContent !== nextProp) {
  17553. if ( !suppressHydrationWarning) {
  17554. warnForTextDifference(domElement.textContent, nextProp);
  17555. }
  17556. updatePayload = [CHILDREN, nextProp];
  17557. }
  17558. } else if (typeof nextProp === 'number') {
  17559. if (domElement.textContent !== '' + nextProp) {
  17560. if ( !suppressHydrationWarning) {
  17561. warnForTextDifference(domElement.textContent, nextProp);
  17562. }
  17563. updatePayload = [CHILDREN, '' + nextProp];
  17564. }
  17565. }
  17566. } else if (registrationNameModules.hasOwnProperty(propKey)) {
  17567. if (nextProp != null) {
  17568. if ( typeof nextProp !== 'function') {
  17569. warnForInvalidEventListener(propKey, nextProp);
  17570. }
  17571. ensureListeningTo(rootContainerElement, propKey);
  17572. }
  17573. } else if ( // Convince Flow we've calculated it (it's DEV-only in this method.)
  17574. typeof isCustomComponentTag === 'boolean') {
  17575. // Validate that the properties correspond to their expected values.
  17576. var serverValue = void 0;
  17577. var propertyInfo = getPropertyInfo(propKey);
  17578. if (suppressHydrationWarning) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated
  17579. // TODO: Only ignore them on controlled tags.
  17580. propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
  17581. var serverHTML = domElement.innerHTML;
  17582. var nextHtml = nextProp ? nextProp[HTML$1] : undefined;
  17583. var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : '');
  17584. if (expectedHTML !== serverHTML) {
  17585. warnForPropDifference(propKey, serverHTML, expectedHTML);
  17586. }
  17587. } else if (propKey === STYLE) {
  17588. // $FlowFixMe - Should be inferred as not undefined.
  17589. extraAttributeNames.delete(propKey);
  17590. if (canDiffStyleForHydrationWarning) {
  17591. var expectedStyle = createDangerousStringForStyles(nextProp);
  17592. serverValue = domElement.getAttribute('style');
  17593. if (expectedStyle !== serverValue) {
  17594. warnForPropDifference(propKey, serverValue, expectedStyle);
  17595. }
  17596. }
  17597. } else if (isCustomComponentTag) {
  17598. // $FlowFixMe - Should be inferred as not undefined.
  17599. extraAttributeNames.delete(propKey.toLowerCase());
  17600. serverValue = getValueForAttribute(domElement, propKey, nextProp);
  17601. if (nextProp !== serverValue) {
  17602. warnForPropDifference(propKey, serverValue, nextProp);
  17603. }
  17604. } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
  17605. var isMismatchDueToBadCasing = false;
  17606. if (propertyInfo !== null) {
  17607. // $FlowFixMe - Should be inferred as not undefined.
  17608. extraAttributeNames.delete(propertyInfo.attributeName);
  17609. serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
  17610. } else {
  17611. var ownNamespace = parentNamespace;
  17612. if (ownNamespace === HTML_NAMESPACE$1) {
  17613. ownNamespace = getIntrinsicNamespace(tag);
  17614. }
  17615. if (ownNamespace === HTML_NAMESPACE$1) {
  17616. // $FlowFixMe - Should be inferred as not undefined.
  17617. extraAttributeNames.delete(propKey.toLowerCase());
  17618. } else {
  17619. var standardName = getPossibleStandardName(propKey);
  17620. if (standardName !== null && standardName !== propKey) {
  17621. // If an SVG prop is supplied with bad casing, it will
  17622. // be successfully parsed from HTML, but will produce a mismatch
  17623. // (and would be incorrectly rendered on the client).
  17624. // However, we already warn about bad casing elsewhere.
  17625. // So we'll skip the misleading extra mismatch warning in this case.
  17626. isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined.
  17627. extraAttributeNames.delete(standardName);
  17628. } // $FlowFixMe - Should be inferred as not undefined.
  17629. extraAttributeNames.delete(propKey);
  17630. }
  17631. serverValue = getValueForAttribute(domElement, propKey, nextProp);
  17632. }
  17633. if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
  17634. warnForPropDifference(propKey, serverValue, nextProp);
  17635. }
  17636. }
  17637. }
  17638. }
  17639. {
  17640. // $FlowFixMe - Should be inferred as not undefined.
  17641. if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
  17642. // $FlowFixMe - Should be inferred as not undefined.
  17643. warnForExtraAttributes(extraAttributeNames);
  17644. }
  17645. }
  17646. switch (tag) {
  17647. case 'input':
  17648. // TODO: Make sure we check if this is still unmounted or do any clean
  17649. // up necessary since we never stop tracking anymore.
  17650. track(domElement);
  17651. postMountWrapper(domElement, rawProps, true);
  17652. break;
  17653. case 'textarea':
  17654. // TODO: Make sure we check if this is still unmounted or do any clean
  17655. // up necessary since we never stop tracking anymore.
  17656. track(domElement);
  17657. postMountWrapper$3(domElement);
  17658. break;
  17659. case 'select':
  17660. case 'option':
  17661. // For input and textarea we current always set the value property at
  17662. // post mount to force it to diverge from attributes. However, for
  17663. // option and select we don't quite do the same thing and select
  17664. // is not resilient to the DOM state changing so we don't do that here.
  17665. // TODO: Consider not doing this for input and textarea.
  17666. break;
  17667. default:
  17668. if (typeof rawProps.onClick === 'function') {
  17669. // TODO: This cast may not be sound for SVG, MathML or custom elements.
  17670. trapClickOnNonInteractiveElement(domElement);
  17671. }
  17672. break;
  17673. }
  17674. return updatePayload;
  17675. }
  17676. function diffHydratedText(textNode, text) {
  17677. var isDifferent = textNode.nodeValue !== text;
  17678. return isDifferent;
  17679. }
  17680. function warnForUnmatchedText(textNode, text) {
  17681. {
  17682. warnForTextDifference(textNode.nodeValue, text);
  17683. }
  17684. }
  17685. function warnForDeletedHydratableElement(parentNode, child) {
  17686. {
  17687. if (didWarnInvalidHydration) {
  17688. return;
  17689. }
  17690. didWarnInvalidHydration = true;
  17691. error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
  17692. }
  17693. }
  17694. function warnForDeletedHydratableText(parentNode, child) {
  17695. {
  17696. if (didWarnInvalidHydration) {
  17697. return;
  17698. }
  17699. didWarnInvalidHydration = true;
  17700. error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
  17701. }
  17702. }
  17703. function warnForInsertedHydratedElement(parentNode, tag, props) {
  17704. {
  17705. if (didWarnInvalidHydration) {
  17706. return;
  17707. }
  17708. didWarnInvalidHydration = true;
  17709. error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());
  17710. }
  17711. }
  17712. function warnForInsertedHydratedText(parentNode, text) {
  17713. {
  17714. if (text === '') {
  17715. // We expect to insert empty text nodes since they're not represented in
  17716. // the HTML.
  17717. // TODO: Remove this special case if we can just avoid inserting empty
  17718. // text nodes.
  17719. return;
  17720. }
  17721. if (didWarnInvalidHydration) {
  17722. return;
  17723. }
  17724. didWarnInvalidHydration = true;
  17725. error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
  17726. }
  17727. }
  17728. function restoreControlledState$3(domElement, tag, props) {
  17729. switch (tag) {
  17730. case 'input':
  17731. restoreControlledState(domElement, props);
  17732. return;
  17733. case 'textarea':
  17734. restoreControlledState$2(domElement, props);
  17735. return;
  17736. case 'select':
  17737. restoreControlledState$1(domElement, props);
  17738. return;
  17739. }
  17740. }
  17741. function getActiveElement(doc) {
  17742. doc = doc || (typeof document !== 'undefined' ? document : undefined);
  17743. if (typeof doc === 'undefined') {
  17744. return null;
  17745. }
  17746. try {
  17747. return doc.activeElement || doc.body;
  17748. } catch (e) {
  17749. return doc.body;
  17750. }
  17751. }
  17752. /**
  17753. * Given any node return the first leaf node without children.
  17754. *
  17755. * @param {DOMElement|DOMTextNode} node
  17756. * @return {DOMElement|DOMTextNode}
  17757. */
  17758. function getLeafNode(node) {
  17759. while (node && node.firstChild) {
  17760. node = node.firstChild;
  17761. }
  17762. return node;
  17763. }
  17764. /**
  17765. * Get the next sibling within a container. This will walk up the
  17766. * DOM if a node's siblings have been exhausted.
  17767. *
  17768. * @param {DOMElement|DOMTextNode} node
  17769. * @return {?DOMElement|DOMTextNode}
  17770. */
  17771. function getSiblingNode(node) {
  17772. while (node) {
  17773. if (node.nextSibling) {
  17774. return node.nextSibling;
  17775. }
  17776. node = node.parentNode;
  17777. }
  17778. }
  17779. /**
  17780. * Get object describing the nodes which contain characters at offset.
  17781. *
  17782. * @param {DOMElement|DOMTextNode} root
  17783. * @param {number} offset
  17784. * @return {?object}
  17785. */
  17786. function getNodeForCharacterOffset(root, offset) {
  17787. var node = getLeafNode(root);
  17788. var nodeStart = 0;
  17789. var nodeEnd = 0;
  17790. while (node) {
  17791. if (node.nodeType === TEXT_NODE) {
  17792. nodeEnd = nodeStart + node.textContent.length;
  17793. if (nodeStart <= offset && nodeEnd >= offset) {
  17794. return {
  17795. node: node,
  17796. offset: offset - nodeStart
  17797. };
  17798. }
  17799. nodeStart = nodeEnd;
  17800. }
  17801. node = getLeafNode(getSiblingNode(node));
  17802. }
  17803. }
  17804. /**
  17805. * @param {DOMElement} outerNode
  17806. * @return {?object}
  17807. */
  17808. function getOffsets(outerNode) {
  17809. var ownerDocument = outerNode.ownerDocument;
  17810. var win = ownerDocument && ownerDocument.defaultView || window;
  17811. var selection = win.getSelection && win.getSelection();
  17812. if (!selection || selection.rangeCount === 0) {
  17813. return null;
  17814. }
  17815. var anchorNode = selection.anchorNode,
  17816. anchorOffset = selection.anchorOffset,
  17817. focusNode = selection.focusNode,
  17818. focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the
  17819. // up/down buttons on an <input type="number">. Anonymous divs do not seem to
  17820. // expose properties, triggering a "Permission denied error" if any of its
  17821. // properties are accessed. The only seemingly possible way to avoid erroring
  17822. // is to access a property that typically works for non-anonymous divs and
  17823. // catch any error that may otherwise arise. See
  17824. // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
  17825. try {
  17826. /* eslint-disable no-unused-expressions */
  17827. anchorNode.nodeType;
  17828. focusNode.nodeType;
  17829. /* eslint-enable no-unused-expressions */
  17830. } catch (e) {
  17831. return null;
  17832. }
  17833. return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
  17834. }
  17835. /**
  17836. * Returns {start, end} where `start` is the character/codepoint index of
  17837. * (anchorNode, anchorOffset) within the textContent of `outerNode`, and
  17838. * `end` is the index of (focusNode, focusOffset).
  17839. *
  17840. * Returns null if you pass in garbage input but we should probably just crash.
  17841. *
  17842. * Exported only for testing.
  17843. */
  17844. function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
  17845. var length = 0;
  17846. var start = -1;
  17847. var end = -1;
  17848. var indexWithinAnchor = 0;
  17849. var indexWithinFocus = 0;
  17850. var node = outerNode;
  17851. var parentNode = null;
  17852. outer: while (true) {
  17853. var next = null;
  17854. while (true) {
  17855. if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
  17856. start = length + anchorOffset;
  17857. }
  17858. if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
  17859. end = length + focusOffset;
  17860. }
  17861. if (node.nodeType === TEXT_NODE) {
  17862. length += node.nodeValue.length;
  17863. }
  17864. if ((next = node.firstChild) === null) {
  17865. break;
  17866. } // Moving from `node` to its first child `next`.
  17867. parentNode = node;
  17868. node = next;
  17869. }
  17870. while (true) {
  17871. if (node === outerNode) {
  17872. // If `outerNode` has children, this is always the second time visiting
  17873. // it. If it has no children, this is still the first loop, and the only
  17874. // valid selection is anchorNode and focusNode both equal to this node
  17875. // and both offsets 0, in which case we will have handled above.
  17876. break outer;
  17877. }
  17878. if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
  17879. start = length;
  17880. }
  17881. if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
  17882. end = length;
  17883. }
  17884. if ((next = node.nextSibling) !== null) {
  17885. break;
  17886. }
  17887. node = parentNode;
  17888. parentNode = node.parentNode;
  17889. } // Moving from `node` to its next sibling `next`.
  17890. node = next;
  17891. }
  17892. if (start === -1 || end === -1) {
  17893. // This should never happen. (Would happen if the anchor/focus nodes aren't
  17894. // actually inside the passed-in node.)
  17895. return null;
  17896. }
  17897. return {
  17898. start: start,
  17899. end: end
  17900. };
  17901. }
  17902. /**
  17903. * In modern non-IE browsers, we can support both forward and backward
  17904. * selections.
  17905. *
  17906. * Note: IE10+ supports the Selection object, but it does not support
  17907. * the `extend` method, which means that even in modern IE, it's not possible
  17908. * to programmatically create a backward selection. Thus, for all IE
  17909. * versions, we use the old IE API to create our selections.
  17910. *
  17911. * @param {DOMElement|DOMTextNode} node
  17912. * @param {object} offsets
  17913. */
  17914. function setOffsets(node, offsets) {
  17915. var doc = node.ownerDocument || document;
  17916. var win = doc && doc.defaultView || window; // Edge fails with "Object expected" in some scenarios.
  17917. // (For instance: TinyMCE editor used in a list component that supports pasting to add more,
  17918. // fails when pasting 100+ items)
  17919. if (!win.getSelection) {
  17920. return;
  17921. }
  17922. var selection = win.getSelection();
  17923. var length = node.textContent.length;
  17924. var start = Math.min(offsets.start, length);
  17925. var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method.
  17926. // Flip backward selections, so we can set with a single range.
  17927. if (!selection.extend && start > end) {
  17928. var temp = end;
  17929. end = start;
  17930. start = temp;
  17931. }
  17932. var startMarker = getNodeForCharacterOffset(node, start);
  17933. var endMarker = getNodeForCharacterOffset(node, end);
  17934. if (startMarker && endMarker) {
  17935. if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
  17936. return;
  17937. }
  17938. var range = doc.createRange();
  17939. range.setStart(startMarker.node, startMarker.offset);
  17940. selection.removeAllRanges();
  17941. if (start > end) {
  17942. selection.addRange(range);
  17943. selection.extend(endMarker.node, endMarker.offset);
  17944. } else {
  17945. range.setEnd(endMarker.node, endMarker.offset);
  17946. selection.addRange(range);
  17947. }
  17948. }
  17949. }
  17950. function isTextNode(node) {
  17951. return node && node.nodeType === TEXT_NODE;
  17952. }
  17953. function containsNode(outerNode, innerNode) {
  17954. if (!outerNode || !innerNode) {
  17955. return false;
  17956. } else if (outerNode === innerNode) {
  17957. return true;
  17958. } else if (isTextNode(outerNode)) {
  17959. return false;
  17960. } else if (isTextNode(innerNode)) {
  17961. return containsNode(outerNode, innerNode.parentNode);
  17962. } else if ('contains' in outerNode) {
  17963. return outerNode.contains(innerNode);
  17964. } else if (outerNode.compareDocumentPosition) {
  17965. return !!(outerNode.compareDocumentPosition(innerNode) & 16);
  17966. } else {
  17967. return false;
  17968. }
  17969. }
  17970. function isInDocument(node) {
  17971. return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
  17972. }
  17973. function isSameOriginFrame(iframe) {
  17974. try {
  17975. // Accessing the contentDocument of a HTMLIframeElement can cause the browser
  17976. // to throw, e.g. if it has a cross-origin src attribute.
  17977. // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
  17978. // iframe.contentDocument.defaultView;
  17979. // A safety way is to access one of the cross origin properties: Window or Location
  17980. // Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
  17981. // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl
  17982. return typeof iframe.contentWindow.location.href === 'string';
  17983. } catch (err) {
  17984. return false;
  17985. }
  17986. }
  17987. function getActiveElementDeep() {
  17988. var win = window;
  17989. var element = getActiveElement();
  17990. while (element instanceof win.HTMLIFrameElement) {
  17991. if (isSameOriginFrame(element)) {
  17992. win = element.contentWindow;
  17993. } else {
  17994. return element;
  17995. }
  17996. element = getActiveElement(win.document);
  17997. }
  17998. return element;
  17999. }
  18000. /**
  18001. * @ReactInputSelection: React input selection module. Based on Selection.js,
  18002. * but modified to be suitable for react and has a couple of bug fixes (doesn't
  18003. * assume buttons have range selections allowed).
  18004. * Input selection module for React.
  18005. */
  18006. /**
  18007. * @hasSelectionCapabilities: we get the element types that support selection
  18008. * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
  18009. * and `selectionEnd` rows.
  18010. */
  18011. function hasSelectionCapabilities(elem) {
  18012. var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  18013. return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');
  18014. }
  18015. function getSelectionInformation() {
  18016. var focusedElem = getActiveElementDeep();
  18017. return {
  18018. // Used by Flare
  18019. activeElementDetached: null,
  18020. focusedElem: focusedElem,
  18021. selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
  18022. };
  18023. }
  18024. /**
  18025. * @restoreSelection: If any selection information was potentially lost,
  18026. * restore it. This is useful when performing operations that could remove dom
  18027. * nodes and place them back in, resulting in focus being lost.
  18028. */
  18029. function restoreSelection(priorSelectionInformation) {
  18030. var curFocusedElem = getActiveElementDeep();
  18031. var priorFocusedElem = priorSelectionInformation.focusedElem;
  18032. var priorSelectionRange = priorSelectionInformation.selectionRange;
  18033. if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
  18034. if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
  18035. setSelection(priorFocusedElem, priorSelectionRange);
  18036. } // Focusing a node can change the scroll position, which is undesirable
  18037. var ancestors = [];
  18038. var ancestor = priorFocusedElem;
  18039. while (ancestor = ancestor.parentNode) {
  18040. if (ancestor.nodeType === ELEMENT_NODE) {
  18041. ancestors.push({
  18042. element: ancestor,
  18043. left: ancestor.scrollLeft,
  18044. top: ancestor.scrollTop
  18045. });
  18046. }
  18047. }
  18048. if (typeof priorFocusedElem.focus === 'function') {
  18049. priorFocusedElem.focus();
  18050. }
  18051. for (var i = 0; i < ancestors.length; i++) {
  18052. var info = ancestors[i];
  18053. info.element.scrollLeft = info.left;
  18054. info.element.scrollTop = info.top;
  18055. }
  18056. }
  18057. }
  18058. /**
  18059. * @getSelection: Gets the selection bounds of a focused textarea, input or
  18060. * contentEditable node.
  18061. * -@input: Look up selection bounds of this input
  18062. * -@return {start: selectionStart, end: selectionEnd}
  18063. */
  18064. function getSelection(input) {
  18065. var selection;
  18066. if ('selectionStart' in input) {
  18067. // Modern browser with input or textarea.
  18068. selection = {
  18069. start: input.selectionStart,
  18070. end: input.selectionEnd
  18071. };
  18072. } else {
  18073. // Content editable or old IE textarea.
  18074. selection = getOffsets(input);
  18075. }
  18076. return selection || {
  18077. start: 0,
  18078. end: 0
  18079. };
  18080. }
  18081. /**
  18082. * @setSelection: Sets the selection bounds of a textarea or input and focuses
  18083. * the input.
  18084. * -@input Set selection bounds of this input or textarea
  18085. * -@offsets Object of same form that is returned from get*
  18086. */
  18087. function setSelection(input, offsets) {
  18088. var start = offsets.start,
  18089. end = offsets.end;
  18090. if (end === undefined) {
  18091. end = start;
  18092. }
  18093. if ('selectionStart' in input) {
  18094. input.selectionStart = start;
  18095. input.selectionEnd = Math.min(end, input.value.length);
  18096. } else {
  18097. setOffsets(input, offsets);
  18098. }
  18099. }
  18100. var validateDOMNesting = function () {};
  18101. var updatedAncestorInfo = function () {};
  18102. {
  18103. // This validation code was written based on the HTML5 parsing spec:
  18104. // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  18105. //
  18106. // Note: this does not catch all invalid nesting, nor does it try to (as it's
  18107. // not clear what practical benefit doing so provides); instead, we warn only
  18108. // for cases where the parser will give a parse tree differing from what React
  18109. // intended. For example, <b><div></div></b> is invalid but we don't warn
  18110. // because it still parses correctly; we do warn for other cases like nested
  18111. // <p> tags where the beginning of the second element implicitly closes the
  18112. // first, causing a confusing mess.
  18113. // https://html.spec.whatwg.org/multipage/syntax.html#special
  18114. var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  18115. var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
  18116. // TODO: Distinguish by namespace here -- for <title>, including it here
  18117. // errs on the side of fewer warnings
  18118. 'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
  18119. var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
  18120. var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
  18121. var emptyAncestorInfo = {
  18122. current: null,
  18123. formTag: null,
  18124. aTagInScope: null,
  18125. buttonTagInScope: null,
  18126. nobrTagInScope: null,
  18127. pTagInButtonScope: null,
  18128. listItemTagAutoclosing: null,
  18129. dlItemTagAutoclosing: null
  18130. };
  18131. updatedAncestorInfo = function (oldInfo, tag) {
  18132. var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
  18133. var info = {
  18134. tag: tag
  18135. };
  18136. if (inScopeTags.indexOf(tag) !== -1) {
  18137. ancestorInfo.aTagInScope = null;
  18138. ancestorInfo.buttonTagInScope = null;
  18139. ancestorInfo.nobrTagInScope = null;
  18140. }
  18141. if (buttonScopeTags.indexOf(tag) !== -1) {
  18142. ancestorInfo.pTagInButtonScope = null;
  18143. } // See rules for 'li', 'dd', 'dt' start tags in
  18144. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
  18145. if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
  18146. ancestorInfo.listItemTagAutoclosing = null;
  18147. ancestorInfo.dlItemTagAutoclosing = null;
  18148. }
  18149. ancestorInfo.current = info;
  18150. if (tag === 'form') {
  18151. ancestorInfo.formTag = info;
  18152. }
  18153. if (tag === 'a') {
  18154. ancestorInfo.aTagInScope = info;
  18155. }
  18156. if (tag === 'button') {
  18157. ancestorInfo.buttonTagInScope = info;
  18158. }
  18159. if (tag === 'nobr') {
  18160. ancestorInfo.nobrTagInScope = info;
  18161. }
  18162. if (tag === 'p') {
  18163. ancestorInfo.pTagInButtonScope = info;
  18164. }
  18165. if (tag === 'li') {
  18166. ancestorInfo.listItemTagAutoclosing = info;
  18167. }
  18168. if (tag === 'dd' || tag === 'dt') {
  18169. ancestorInfo.dlItemTagAutoclosing = info;
  18170. }
  18171. return ancestorInfo;
  18172. };
  18173. /**
  18174. * Returns whether
  18175. */
  18176. var isTagValidWithParent = function (tag, parentTag) {
  18177. // First, let's check if we're in an unusual parsing mode...
  18178. switch (parentTag) {
  18179. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
  18180. case 'select':
  18181. return tag === 'option' || tag === 'optgroup' || tag === '#text';
  18182. case 'optgroup':
  18183. return tag === 'option' || tag === '#text';
  18184. // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
  18185. // but
  18186. case 'option':
  18187. return tag === '#text';
  18188. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
  18189. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
  18190. // No special behavior since these rules fall back to "in body" mode for
  18191. // all except special table nodes which cause bad parsing behavior anyway.
  18192. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
  18193. case 'tr':
  18194. return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
  18195. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
  18196. case 'tbody':
  18197. case 'thead':
  18198. case 'tfoot':
  18199. return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
  18200. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
  18201. case 'colgroup':
  18202. return tag === 'col' || tag === 'template';
  18203. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
  18204. case 'table':
  18205. return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
  18206. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
  18207. case 'head':
  18208. return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
  18209. // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
  18210. case 'html':
  18211. return tag === 'head' || tag === 'body' || tag === 'frameset';
  18212. case 'frameset':
  18213. return tag === 'frame';
  18214. case '#document':
  18215. return tag === 'html';
  18216. } // Probably in the "in body" parsing mode, so we outlaw only tag combos
  18217. // where the parsing rules cause implicit opens or closes to be added.
  18218. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
  18219. switch (tag) {
  18220. case 'h1':
  18221. case 'h2':
  18222. case 'h3':
  18223. case 'h4':
  18224. case 'h5':
  18225. case 'h6':
  18226. return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
  18227. case 'rp':
  18228. case 'rt':
  18229. return impliedEndTags.indexOf(parentTag) === -1;
  18230. case 'body':
  18231. case 'caption':
  18232. case 'col':
  18233. case 'colgroup':
  18234. case 'frameset':
  18235. case 'frame':
  18236. case 'head':
  18237. case 'html':
  18238. case 'tbody':
  18239. case 'td':
  18240. case 'tfoot':
  18241. case 'th':
  18242. case 'thead':
  18243. case 'tr':
  18244. // These tags are only valid with a few parents that have special child
  18245. // parsing rules -- if we're down here, then none of those matched and
  18246. // so we allow it only if we don't know what the parent is, as all other
  18247. // cases are invalid.
  18248. return parentTag == null;
  18249. }
  18250. return true;
  18251. };
  18252. /**
  18253. * Returns whether
  18254. */
  18255. var findInvalidAncestorForTag = function (tag, ancestorInfo) {
  18256. switch (tag) {
  18257. case 'address':
  18258. case 'article':
  18259. case 'aside':
  18260. case 'blockquote':
  18261. case 'center':
  18262. case 'details':
  18263. case 'dialog':
  18264. case 'dir':
  18265. case 'div':
  18266. case 'dl':
  18267. case 'fieldset':
  18268. case 'figcaption':
  18269. case 'figure':
  18270. case 'footer':
  18271. case 'header':
  18272. case 'hgroup':
  18273. case 'main':
  18274. case 'menu':
  18275. case 'nav':
  18276. case 'ol':
  18277. case 'p':
  18278. case 'section':
  18279. case 'summary':
  18280. case 'ul':
  18281. case 'pre':
  18282. case 'listing':
  18283. case 'table':
  18284. case 'hr':
  18285. case 'xmp':
  18286. case 'h1':
  18287. case 'h2':
  18288. case 'h3':
  18289. case 'h4':
  18290. case 'h5':
  18291. case 'h6':
  18292. return ancestorInfo.pTagInButtonScope;
  18293. case 'form':
  18294. return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
  18295. case 'li':
  18296. return ancestorInfo.listItemTagAutoclosing;
  18297. case 'dd':
  18298. case 'dt':
  18299. return ancestorInfo.dlItemTagAutoclosing;
  18300. case 'button':
  18301. return ancestorInfo.buttonTagInScope;
  18302. case 'a':
  18303. // Spec says something about storing a list of markers, but it sounds
  18304. // equivalent to this check.
  18305. return ancestorInfo.aTagInScope;
  18306. case 'nobr':
  18307. return ancestorInfo.nobrTagInScope;
  18308. }
  18309. return null;
  18310. };
  18311. var didWarn$1 = {};
  18312. validateDOMNesting = function (childTag, childText, ancestorInfo) {
  18313. ancestorInfo = ancestorInfo || emptyAncestorInfo;
  18314. var parentInfo = ancestorInfo.current;
  18315. var parentTag = parentInfo && parentInfo.tag;
  18316. if (childText != null) {
  18317. if (childTag != null) {
  18318. error('validateDOMNesting: when childText is passed, childTag should be null');
  18319. }
  18320. childTag = '#text';
  18321. }
  18322. var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
  18323. var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
  18324. var invalidParentOrAncestor = invalidParent || invalidAncestor;
  18325. if (!invalidParentOrAncestor) {
  18326. return;
  18327. }
  18328. var ancestorTag = invalidParentOrAncestor.tag;
  18329. var addendum = getCurrentFiberStackInDev();
  18330. var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;
  18331. if (didWarn$1[warnKey]) {
  18332. return;
  18333. }
  18334. didWarn$1[warnKey] = true;
  18335. var tagDisplayName = childTag;
  18336. var whitespaceInfo = '';
  18337. if (childTag === '#text') {
  18338. if (/\S/.test(childText)) {
  18339. tagDisplayName = 'Text nodes';
  18340. } else {
  18341. tagDisplayName = 'Whitespace text nodes';
  18342. whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
  18343. }
  18344. } else {
  18345. tagDisplayName = '<' + childTag + '>';
  18346. }
  18347. if (invalidParent) {
  18348. var info = '';
  18349. if (ancestorTag === 'table' && childTag === 'tr') {
  18350. info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';
  18351. }
  18352. error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info);
  18353. } else {
  18354. error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag);
  18355. }
  18356. };
  18357. }
  18358. var SUPPRESS_HYDRATION_WARNING$1;
  18359. {
  18360. SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';
  18361. }
  18362. var SUSPENSE_START_DATA = '$';
  18363. var SUSPENSE_END_DATA = '/$';
  18364. var SUSPENSE_PENDING_START_DATA = '$?';
  18365. var SUSPENSE_FALLBACK_START_DATA = '$!';
  18366. var STYLE$1 = 'style';
  18367. var eventsEnabled = null;
  18368. var selectionInformation = null;
  18369. function shouldAutoFocusHostComponent(type, props) {
  18370. switch (type) {
  18371. case 'button':
  18372. case 'input':
  18373. case 'select':
  18374. case 'textarea':
  18375. return !!props.autoFocus;
  18376. }
  18377. return false;
  18378. }
  18379. function getRootHostContext(rootContainerInstance) {
  18380. var type;
  18381. var namespace;
  18382. var nodeType = rootContainerInstance.nodeType;
  18383. switch (nodeType) {
  18384. case DOCUMENT_NODE:
  18385. case DOCUMENT_FRAGMENT_NODE:
  18386. {
  18387. type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
  18388. var root = rootContainerInstance.documentElement;
  18389. namespace = root ? root.namespaceURI : getChildNamespace(null, '');
  18390. break;
  18391. }
  18392. default:
  18393. {
  18394. var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
  18395. var ownNamespace = container.namespaceURI || null;
  18396. type = container.tagName;
  18397. namespace = getChildNamespace(ownNamespace, type);
  18398. break;
  18399. }
  18400. }
  18401. {
  18402. var validatedTag = type.toLowerCase();
  18403. var ancestorInfo = updatedAncestorInfo(null, validatedTag);
  18404. return {
  18405. namespace: namespace,
  18406. ancestorInfo: ancestorInfo
  18407. };
  18408. }
  18409. }
  18410. function getChildHostContext(parentHostContext, type, rootContainerInstance) {
  18411. {
  18412. var parentHostContextDev = parentHostContext;
  18413. var namespace = getChildNamespace(parentHostContextDev.namespace, type);
  18414. var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
  18415. return {
  18416. namespace: namespace,
  18417. ancestorInfo: ancestorInfo
  18418. };
  18419. }
  18420. }
  18421. function getPublicInstance(instance) {
  18422. return instance;
  18423. }
  18424. function prepareForCommit(containerInfo) {
  18425. eventsEnabled = isEnabled();
  18426. selectionInformation = getSelectionInformation();
  18427. setEnabled(false);
  18428. }
  18429. function resetAfterCommit(containerInfo) {
  18430. restoreSelection(selectionInformation);
  18431. setEnabled(eventsEnabled);
  18432. eventsEnabled = null;
  18433. selectionInformation = null;
  18434. }
  18435. function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  18436. var parentNamespace;
  18437. {
  18438. // TODO: take namespace into account when validating.
  18439. var hostContextDev = hostContext;
  18440. validateDOMNesting(type, null, hostContextDev.ancestorInfo);
  18441. if (typeof props.children === 'string' || typeof props.children === 'number') {
  18442. var string = '' + props.children;
  18443. var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
  18444. validateDOMNesting(null, string, ownAncestorInfo);
  18445. }
  18446. parentNamespace = hostContextDev.namespace;
  18447. }
  18448. var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
  18449. precacheFiberNode(internalInstanceHandle, domElement);
  18450. updateFiberProps(domElement, props);
  18451. return domElement;
  18452. }
  18453. function appendInitialChild(parentInstance, child) {
  18454. parentInstance.appendChild(child);
  18455. }
  18456. function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
  18457. setInitialProperties(domElement, type, props, rootContainerInstance);
  18458. return shouldAutoFocusHostComponent(type, props);
  18459. }
  18460. function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
  18461. {
  18462. var hostContextDev = hostContext;
  18463. if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
  18464. var string = '' + newProps.children;
  18465. var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
  18466. validateDOMNesting(null, string, ownAncestorInfo);
  18467. }
  18468. }
  18469. return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
  18470. }
  18471. function shouldSetTextContent(type, props) {
  18472. return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
  18473. }
  18474. function shouldDeprioritizeSubtree(type, props) {
  18475. return !!props.hidden;
  18476. }
  18477. function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
  18478. {
  18479. var hostContextDev = hostContext;
  18480. validateDOMNesting(null, text, hostContextDev.ancestorInfo);
  18481. }
  18482. var textNode = createTextNode(text, rootContainerInstance);
  18483. precacheFiberNode(internalInstanceHandle, textNode);
  18484. return textNode;
  18485. }
  18486. // if a component just imports ReactDOM (e.g. for findDOMNode).
  18487. // Some environments might not have setTimeout or clearTimeout.
  18488. var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
  18489. var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
  18490. var noTimeout = -1; // -------------------
  18491. function commitMount(domElement, type, newProps, internalInstanceHandle) {
  18492. // Despite the naming that might imply otherwise, this method only
  18493. // fires if there is an `Update` effect scheduled during mounting.
  18494. // This happens if `finalizeInitialChildren` returns `true` (which it
  18495. // does to implement the `autoFocus` attribute on the client). But
  18496. // there are also other cases when this might happen (such as patching
  18497. // up text content during hydration mismatch). So we'll check this again.
  18498. if (shouldAutoFocusHostComponent(type, newProps)) {
  18499. domElement.focus();
  18500. }
  18501. }
  18502. function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
  18503. // Update the props handle so that we know which props are the ones with
  18504. // with current event handlers.
  18505. updateFiberProps(domElement, newProps); // Apply the diff to the DOM node.
  18506. updateProperties(domElement, updatePayload, type, oldProps, newProps);
  18507. }
  18508. function resetTextContent(domElement) {
  18509. setTextContent(domElement, '');
  18510. }
  18511. function commitTextUpdate(textInstance, oldText, newText) {
  18512. textInstance.nodeValue = newText;
  18513. }
  18514. function appendChild(parentInstance, child) {
  18515. parentInstance.appendChild(child);
  18516. }
  18517. function appendChildToContainer(container, child) {
  18518. var parentNode;
  18519. if (container.nodeType === COMMENT_NODE) {
  18520. parentNode = container.parentNode;
  18521. parentNode.insertBefore(child, container);
  18522. } else {
  18523. parentNode = container;
  18524. parentNode.appendChild(child);
  18525. } // This container might be used for a portal.
  18526. // If something inside a portal is clicked, that click should bubble
  18527. // through the React tree. However, on Mobile Safari the click would
  18528. // never bubble through the *DOM* tree unless an ancestor with onclick
  18529. // event exists. So we wouldn't see it and dispatch it.
  18530. // This is why we ensure that non React root containers have inline onclick
  18531. // defined.
  18532. // https://github.com/facebook/react/issues/11918
  18533. var reactRootContainer = container._reactRootContainer;
  18534. if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {
  18535. // TODO: This cast may not be sound for SVG, MathML or custom elements.
  18536. trapClickOnNonInteractiveElement(parentNode);
  18537. }
  18538. }
  18539. function insertBefore(parentInstance, child, beforeChild) {
  18540. parentInstance.insertBefore(child, beforeChild);
  18541. }
  18542. function insertInContainerBefore(container, child, beforeChild) {
  18543. if (container.nodeType === COMMENT_NODE) {
  18544. container.parentNode.insertBefore(child, beforeChild);
  18545. } else {
  18546. container.insertBefore(child, beforeChild);
  18547. }
  18548. }
  18549. function removeChild(parentInstance, child) {
  18550. parentInstance.removeChild(child);
  18551. }
  18552. function removeChildFromContainer(container, child) {
  18553. if (container.nodeType === COMMENT_NODE) {
  18554. container.parentNode.removeChild(child);
  18555. } else {
  18556. container.removeChild(child);
  18557. }
  18558. }
  18559. function hideInstance(instance) {
  18560. // pass host context to this method?
  18561. instance = instance;
  18562. var style = instance.style;
  18563. if (typeof style.setProperty === 'function') {
  18564. style.setProperty('display', 'none', 'important');
  18565. } else {
  18566. style.display = 'none';
  18567. }
  18568. }
  18569. function hideTextInstance(textInstance) {
  18570. textInstance.nodeValue = '';
  18571. }
  18572. function unhideInstance(instance, props) {
  18573. instance = instance;
  18574. var styleProp = props[STYLE$1];
  18575. var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;
  18576. instance.style.display = dangerousStyleValue('display', display);
  18577. }
  18578. function unhideTextInstance(textInstance, text) {
  18579. textInstance.nodeValue = text;
  18580. } // -------------------
  18581. function canHydrateInstance(instance, type, props) {
  18582. if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
  18583. return null;
  18584. } // This has now been refined to an element node.
  18585. return instance;
  18586. }
  18587. function canHydrateTextInstance(instance, text) {
  18588. if (text === '' || instance.nodeType !== TEXT_NODE) {
  18589. // Empty strings are not parsed by HTML so there won't be a correct match here.
  18590. return null;
  18591. } // This has now been refined to a text node.
  18592. return instance;
  18593. }
  18594. function isSuspenseInstancePending(instance) {
  18595. return instance.data === SUSPENSE_PENDING_START_DATA;
  18596. }
  18597. function isSuspenseInstanceFallback(instance) {
  18598. return instance.data === SUSPENSE_FALLBACK_START_DATA;
  18599. }
  18600. function getNextHydratable(node) {
  18601. // Skip non-hydratable nodes.
  18602. for (; node != null; node = node.nextSibling) {
  18603. var nodeType = node.nodeType;
  18604. if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
  18605. break;
  18606. }
  18607. }
  18608. return node;
  18609. }
  18610. function getNextHydratableSibling(instance) {
  18611. return getNextHydratable(instance.nextSibling);
  18612. }
  18613. function getFirstHydratableChild(parentInstance) {
  18614. return getNextHydratable(parentInstance.firstChild);
  18615. }
  18616. function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  18617. precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events
  18618. // get attached.
  18619. updateFiberProps(instance, props);
  18620. var parentNamespace;
  18621. {
  18622. var hostContextDev = hostContext;
  18623. parentNamespace = hostContextDev.namespace;
  18624. }
  18625. return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);
  18626. }
  18627. function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
  18628. precacheFiberNode(internalInstanceHandle, textInstance);
  18629. return diffHydratedText(textInstance, text);
  18630. }
  18631. function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
  18632. var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary.
  18633. // There might be nested nodes so we need to keep track of how
  18634. // deep we are and only break out when we're back on top.
  18635. var depth = 0;
  18636. while (node) {
  18637. if (node.nodeType === COMMENT_NODE) {
  18638. var data = node.data;
  18639. if (data === SUSPENSE_END_DATA) {
  18640. if (depth === 0) {
  18641. return getNextHydratableSibling(node);
  18642. } else {
  18643. depth--;
  18644. }
  18645. } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
  18646. depth++;
  18647. }
  18648. }
  18649. node = node.nextSibling;
  18650. } // TODO: Warn, we didn't find the end comment boundary.
  18651. return null;
  18652. } // Returns the SuspenseInstance if this node is a direct child of a
  18653. // SuspenseInstance. I.e. if its previous sibling is a Comment with
  18654. // SUSPENSE_x_START_DATA. Otherwise, null.
  18655. function getParentSuspenseInstance(targetInstance) {
  18656. var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary.
  18657. // There might be nested nodes so we need to keep track of how
  18658. // deep we are and only break out when we're back on top.
  18659. var depth = 0;
  18660. while (node) {
  18661. if (node.nodeType === COMMENT_NODE) {
  18662. var data = node.data;
  18663. if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
  18664. if (depth === 0) {
  18665. return node;
  18666. } else {
  18667. depth--;
  18668. }
  18669. } else if (data === SUSPENSE_END_DATA) {
  18670. depth++;
  18671. }
  18672. }
  18673. node = node.previousSibling;
  18674. }
  18675. return null;
  18676. }
  18677. function commitHydratedContainer(container) {
  18678. // Retry if any event replaying was blocked on this.
  18679. retryIfBlockedOn(container);
  18680. }
  18681. function commitHydratedSuspenseInstance(suspenseInstance) {
  18682. // Retry if any event replaying was blocked on this.
  18683. retryIfBlockedOn(suspenseInstance);
  18684. }
  18685. function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
  18686. {
  18687. warnForUnmatchedText(textInstance, text);
  18688. }
  18689. }
  18690. function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
  18691. if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
  18692. warnForUnmatchedText(textInstance, text);
  18693. }
  18694. }
  18695. function didNotHydrateContainerInstance(parentContainer, instance) {
  18696. {
  18697. if (instance.nodeType === ELEMENT_NODE) {
  18698. warnForDeletedHydratableElement(parentContainer, instance);
  18699. } else if (instance.nodeType === COMMENT_NODE) ; else {
  18700. warnForDeletedHydratableText(parentContainer, instance);
  18701. }
  18702. }
  18703. }
  18704. function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
  18705. if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
  18706. if (instance.nodeType === ELEMENT_NODE) {
  18707. warnForDeletedHydratableElement(parentInstance, instance);
  18708. } else if (instance.nodeType === COMMENT_NODE) ; else {
  18709. warnForDeletedHydratableText(parentInstance, instance);
  18710. }
  18711. }
  18712. }
  18713. function didNotFindHydratableContainerInstance(parentContainer, type, props) {
  18714. {
  18715. warnForInsertedHydratedElement(parentContainer, type);
  18716. }
  18717. }
  18718. function didNotFindHydratableContainerTextInstance(parentContainer, text) {
  18719. {
  18720. warnForInsertedHydratedText(parentContainer, text);
  18721. }
  18722. }
  18723. function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
  18724. if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
  18725. warnForInsertedHydratedElement(parentInstance, type);
  18726. }
  18727. }
  18728. function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
  18729. if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
  18730. warnForInsertedHydratedText(parentInstance, text);
  18731. }
  18732. }
  18733. function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
  18734. if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) ;
  18735. }
  18736. var randomKey = Math.random().toString(36).slice(2);
  18737. var internalInstanceKey = '__reactInternalInstance$' + randomKey;
  18738. var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
  18739. var internalContainerInstanceKey = '__reactContainere$' + randomKey;
  18740. function precacheFiberNode(hostInst, node) {
  18741. node[internalInstanceKey] = hostInst;
  18742. }
  18743. function markContainerAsRoot(hostRoot, node) {
  18744. node[internalContainerInstanceKey] = hostRoot;
  18745. }
  18746. function unmarkContainerAsRoot(node) {
  18747. node[internalContainerInstanceKey] = null;
  18748. }
  18749. function isContainerMarkedAsRoot(node) {
  18750. return !!node[internalContainerInstanceKey];
  18751. } // Given a DOM node, return the closest HostComponent or HostText fiber ancestor.
  18752. // If the target node is part of a hydrated or not yet rendered subtree, then
  18753. // this may also return a SuspenseComponent or HostRoot to indicate that.
  18754. // Conceptually the HostRoot fiber is a child of the Container node. So if you
  18755. // pass the Container node as the targetNode, you will not actually get the
  18756. // HostRoot back. To get to the HostRoot, you need to pass a child of it.
  18757. // The same thing applies to Suspense boundaries.
  18758. function getClosestInstanceFromNode(targetNode) {
  18759. var targetInst = targetNode[internalInstanceKey];
  18760. if (targetInst) {
  18761. // Don't return HostRoot or SuspenseComponent here.
  18762. return targetInst;
  18763. } // If the direct event target isn't a React owned DOM node, we need to look
  18764. // to see if one of its parents is a React owned DOM node.
  18765. var parentNode = targetNode.parentNode;
  18766. while (parentNode) {
  18767. // We'll check if this is a container root that could include
  18768. // React nodes in the future. We need to check this first because
  18769. // if we're a child of a dehydrated container, we need to first
  18770. // find that inner container before moving on to finding the parent
  18771. // instance. Note that we don't check this field on the targetNode
  18772. // itself because the fibers are conceptually between the container
  18773. // node and the first child. It isn't surrounding the container node.
  18774. // If it's not a container, we check if it's an instance.
  18775. targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
  18776. if (targetInst) {
  18777. // Since this wasn't the direct target of the event, we might have
  18778. // stepped past dehydrated DOM nodes to get here. However they could
  18779. // also have been non-React nodes. We need to answer which one.
  18780. // If we the instance doesn't have any children, then there can't be
  18781. // a nested suspense boundary within it. So we can use this as a fast
  18782. // bailout. Most of the time, when people add non-React children to
  18783. // the tree, it is using a ref to a child-less DOM node.
  18784. // Normally we'd only need to check one of the fibers because if it
  18785. // has ever gone from having children to deleting them or vice versa
  18786. // it would have deleted the dehydrated boundary nested inside already.
  18787. // However, since the HostRoot starts out with an alternate it might
  18788. // have one on the alternate so we need to check in case this was a
  18789. // root.
  18790. var alternate = targetInst.alternate;
  18791. if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
  18792. // Next we need to figure out if the node that skipped past is
  18793. // nested within a dehydrated boundary and if so, which one.
  18794. var suspenseInstance = getParentSuspenseInstance(targetNode);
  18795. while (suspenseInstance !== null) {
  18796. // We found a suspense instance. That means that we haven't
  18797. // hydrated it yet. Even though we leave the comments in the
  18798. // DOM after hydrating, and there are boundaries in the DOM
  18799. // that could already be hydrated, we wouldn't have found them
  18800. // through this pass since if the target is hydrated it would
  18801. // have had an internalInstanceKey on it.
  18802. // Let's get the fiber associated with the SuspenseComponent
  18803. // as the deepest instance.
  18804. var targetSuspenseInst = suspenseInstance[internalInstanceKey];
  18805. if (targetSuspenseInst) {
  18806. return targetSuspenseInst;
  18807. } // If we don't find a Fiber on the comment, it might be because
  18808. // we haven't gotten to hydrate it yet. There might still be a
  18809. // parent boundary that hasn't above this one so we need to find
  18810. // the outer most that is known.
  18811. suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent
  18812. // host component also hasn't hydrated yet. We can return it
  18813. // below since it will bail out on the isMounted check later.
  18814. }
  18815. }
  18816. return targetInst;
  18817. }
  18818. targetNode = parentNode;
  18819. parentNode = targetNode.parentNode;
  18820. }
  18821. return null;
  18822. }
  18823. /**
  18824. * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
  18825. * instance, or null if the node was not rendered by this React.
  18826. */
  18827. function getInstanceFromNode$1(node) {
  18828. var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
  18829. if (inst) {
  18830. if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
  18831. return inst;
  18832. } else {
  18833. return null;
  18834. }
  18835. }
  18836. return null;
  18837. }
  18838. /**
  18839. * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
  18840. * DOM node.
  18841. */
  18842. function getNodeFromInstance$1(inst) {
  18843. if (inst.tag === HostComponent || inst.tag === HostText) {
  18844. // In Fiber this, is just the state node right now. We assume it will be
  18845. // a host component or host text.
  18846. return inst.stateNode;
  18847. } // Without this first invariant, passing a non-DOM-component triggers the next
  18848. // invariant for a missing parent, which is super confusing.
  18849. {
  18850. {
  18851. throw Error( "getNodeFromInstance: Invalid argument." );
  18852. }
  18853. }
  18854. }
  18855. function getFiberCurrentPropsFromNode$1(node) {
  18856. return node[internalEventHandlersKey] || null;
  18857. }
  18858. function updateFiberProps(node, props) {
  18859. node[internalEventHandlersKey] = props;
  18860. }
  18861. function getParent(inst) {
  18862. do {
  18863. inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.
  18864. // That is depending on if we want nested subtrees (layers) to bubble
  18865. // events to their parent. We could also go through parentNode on the
  18866. // host node but that wouldn't work for React Native and doesn't let us
  18867. // do the portal feature.
  18868. } while (inst && inst.tag !== HostComponent);
  18869. if (inst) {
  18870. return inst;
  18871. }
  18872. return null;
  18873. }
  18874. /**
  18875. * Return the lowest common ancestor of A and B, or null if they are in
  18876. * different trees.
  18877. */
  18878. function getLowestCommonAncestor(instA, instB) {
  18879. var depthA = 0;
  18880. for (var tempA = instA; tempA; tempA = getParent(tempA)) {
  18881. depthA++;
  18882. }
  18883. var depthB = 0;
  18884. for (var tempB = instB; tempB; tempB = getParent(tempB)) {
  18885. depthB++;
  18886. } // If A is deeper, crawl up.
  18887. while (depthA - depthB > 0) {
  18888. instA = getParent(instA);
  18889. depthA--;
  18890. } // If B is deeper, crawl up.
  18891. while (depthB - depthA > 0) {
  18892. instB = getParent(instB);
  18893. depthB--;
  18894. } // Walk in lockstep until we find a match.
  18895. var depth = depthA;
  18896. while (depth--) {
  18897. if (instA === instB || instA === instB.alternate) {
  18898. return instA;
  18899. }
  18900. instA = getParent(instA);
  18901. instB = getParent(instB);
  18902. }
  18903. return null;
  18904. }
  18905. /**
  18906. * Simulates the traversal of a two-phase, capture/bubble event dispatch.
  18907. */
  18908. function traverseTwoPhase(inst, fn, arg) {
  18909. var path = [];
  18910. while (inst) {
  18911. path.push(inst);
  18912. inst = getParent(inst);
  18913. }
  18914. var i;
  18915. for (i = path.length; i-- > 0;) {
  18916. fn(path[i], 'captured', arg);
  18917. }
  18918. for (i = 0; i < path.length; i++) {
  18919. fn(path[i], 'bubbled', arg);
  18920. }
  18921. }
  18922. /**
  18923. * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
  18924. * should would receive a `mouseEnter` or `mouseLeave` event.
  18925. *
  18926. * Does not invoke the callback on the nearest common ancestor because nothing
  18927. * "entered" or "left" that element.
  18928. */
  18929. function traverseEnterLeave(from, to, fn, argFrom, argTo) {
  18930. var common = from && to ? getLowestCommonAncestor(from, to) : null;
  18931. var pathFrom = [];
  18932. while (true) {
  18933. if (!from) {
  18934. break;
  18935. }
  18936. if (from === common) {
  18937. break;
  18938. }
  18939. var alternate = from.alternate;
  18940. if (alternate !== null && alternate === common) {
  18941. break;
  18942. }
  18943. pathFrom.push(from);
  18944. from = getParent(from);
  18945. }
  18946. var pathTo = [];
  18947. while (true) {
  18948. if (!to) {
  18949. break;
  18950. }
  18951. if (to === common) {
  18952. break;
  18953. }
  18954. var _alternate = to.alternate;
  18955. if (_alternate !== null && _alternate === common) {
  18956. break;
  18957. }
  18958. pathTo.push(to);
  18959. to = getParent(to);
  18960. }
  18961. for (var i = 0; i < pathFrom.length; i++) {
  18962. fn(pathFrom[i], 'bubbled', argFrom);
  18963. }
  18964. for (var _i = pathTo.length; _i-- > 0;) {
  18965. fn(pathTo[_i], 'captured', argTo);
  18966. }
  18967. }
  18968. function isInteractive(tag) {
  18969. return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
  18970. }
  18971. function shouldPreventMouseEvent(name, type, props) {
  18972. switch (name) {
  18973. case 'onClick':
  18974. case 'onClickCapture':
  18975. case 'onDoubleClick':
  18976. case 'onDoubleClickCapture':
  18977. case 'onMouseDown':
  18978. case 'onMouseDownCapture':
  18979. case 'onMouseMove':
  18980. case 'onMouseMoveCapture':
  18981. case 'onMouseUp':
  18982. case 'onMouseUpCapture':
  18983. case 'onMouseEnter':
  18984. return !!(props.disabled && isInteractive(type));
  18985. default:
  18986. return false;
  18987. }
  18988. }
  18989. /**
  18990. * @param {object} inst The instance, which is the source of events.
  18991. * @param {string} registrationName Name of listener (e.g. `onClick`).
  18992. * @return {?function} The stored callback.
  18993. */
  18994. function getListener(inst, registrationName) {
  18995. var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
  18996. // live here; needs to be moved to a better place soon
  18997. var stateNode = inst.stateNode;
  18998. if (!stateNode) {
  18999. // Work in progress (ex: onload events in incremental mode).
  19000. return null;
  19001. }
  19002. var props = getFiberCurrentPropsFromNode(stateNode);
  19003. if (!props) {
  19004. // Work in progress.
  19005. return null;
  19006. }
  19007. listener = props[registrationName];
  19008. if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
  19009. return null;
  19010. }
  19011. if (!(!listener || typeof listener === 'function')) {
  19012. {
  19013. throw Error( "Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type." );
  19014. }
  19015. }
  19016. return listener;
  19017. }
  19018. /**
  19019. * Some event types have a notion of different registration names for different
  19020. * "phases" of propagation. This finds listeners by a given phase.
  19021. */
  19022. function listenerAtPhase(inst, event, propagationPhase) {
  19023. var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
  19024. return getListener(inst, registrationName);
  19025. }
  19026. /**
  19027. * A small set of propagation patterns, each of which will accept a small amount
  19028. * of information, and generate a set of "dispatch ready event objects" - which
  19029. * are sets of events that have already been annotated with a set of dispatched
  19030. * listener functions/ids. The API is designed this way to discourage these
  19031. * propagation strategies from actually executing the dispatches, since we
  19032. * always want to collect the entire set of dispatches before executing even a
  19033. * single one.
  19034. */
  19035. /**
  19036. * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
  19037. * here, allows us to not have to bind or create functions for each event.
  19038. * Mutating the event's members allows us to not have to create a wrapping
  19039. * "dispatch" object that pairs the event with the listener.
  19040. */
  19041. function accumulateDirectionalDispatches(inst, phase, event) {
  19042. {
  19043. if (!inst) {
  19044. error('Dispatching inst must not be null');
  19045. }
  19046. }
  19047. var listener = listenerAtPhase(inst, event, phase);
  19048. if (listener) {
  19049. event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
  19050. event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  19051. }
  19052. }
  19053. /**
  19054. * Collect dispatches (must be entirely collected before dispatching - see unit
  19055. * tests). Lazily allocate the array to conserve memory. We must loop through
  19056. * each event and perform the traversal for each one. We cannot perform a
  19057. * single traversal for the entire collection of events because each event may
  19058. * have a different target.
  19059. */
  19060. function accumulateTwoPhaseDispatchesSingle(event) {
  19061. if (event && event.dispatchConfig.phasedRegistrationNames) {
  19062. traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
  19063. }
  19064. }
  19065. /**
  19066. * Accumulates without regard to direction, does not look for phased
  19067. * registration names. Same as `accumulateDirectDispatchesSingle` but without
  19068. * requiring that the `dispatchMarker` be the same as the dispatched ID.
  19069. */
  19070. function accumulateDispatches(inst, ignoredDirection, event) {
  19071. if (inst && event && event.dispatchConfig.registrationName) {
  19072. var registrationName = event.dispatchConfig.registrationName;
  19073. var listener = getListener(inst, registrationName);
  19074. if (listener) {
  19075. event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
  19076. event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  19077. }
  19078. }
  19079. }
  19080. /**
  19081. * Accumulates dispatches on an `SyntheticEvent`, but only for the
  19082. * `dispatchMarker`.
  19083. * @param {SyntheticEvent} event
  19084. */
  19085. function accumulateDirectDispatchesSingle(event) {
  19086. if (event && event.dispatchConfig.registrationName) {
  19087. accumulateDispatches(event._targetInst, null, event);
  19088. }
  19089. }
  19090. function accumulateTwoPhaseDispatches(events) {
  19091. forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
  19092. }
  19093. function accumulateEnterLeaveDispatches(leave, enter, from, to) {
  19094. traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
  19095. }
  19096. function accumulateDirectDispatches(events) {
  19097. forEachAccumulated(events, accumulateDirectDispatchesSingle);
  19098. }
  19099. /**
  19100. * These variables store information about text content of a target node,
  19101. * allowing comparison of content before and after a given event.
  19102. *
  19103. * Identify the node where selection currently begins, then observe
  19104. * both its text content and its current position in the DOM. Since the
  19105. * browser may natively replace the target node during composition, we can
  19106. * use its position to find its replacement.
  19107. *
  19108. *
  19109. */
  19110. var root = null;
  19111. var startText = null;
  19112. var fallbackText = null;
  19113. function initialize(nativeEventTarget) {
  19114. root = nativeEventTarget;
  19115. startText = getText();
  19116. return true;
  19117. }
  19118. function reset() {
  19119. root = null;
  19120. startText = null;
  19121. fallbackText = null;
  19122. }
  19123. function getData() {
  19124. if (fallbackText) {
  19125. return fallbackText;
  19126. }
  19127. var start;
  19128. var startValue = startText;
  19129. var startLength = startValue.length;
  19130. var end;
  19131. var endValue = getText();
  19132. var endLength = endValue.length;
  19133. for (start = 0; start < startLength; start++) {
  19134. if (startValue[start] !== endValue[start]) {
  19135. break;
  19136. }
  19137. }
  19138. var minEnd = startLength - start;
  19139. for (end = 1; end <= minEnd; end++) {
  19140. if (startValue[startLength - end] !== endValue[endLength - end]) {
  19141. break;
  19142. }
  19143. }
  19144. var sliceTail = end > 1 ? 1 - end : undefined;
  19145. fallbackText = endValue.slice(start, sliceTail);
  19146. return fallbackText;
  19147. }
  19148. function getText() {
  19149. if ('value' in root) {
  19150. return root.value;
  19151. }
  19152. return root.textContent;
  19153. }
  19154. var EVENT_POOL_SIZE = 10;
  19155. /**
  19156. * @interface Event
  19157. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  19158. */
  19159. var EventInterface = {
  19160. type: null,
  19161. target: null,
  19162. // currentTarget is set when dispatching; no use in copying it here
  19163. currentTarget: function () {
  19164. return null;
  19165. },
  19166. eventPhase: null,
  19167. bubbles: null,
  19168. cancelable: null,
  19169. timeStamp: function (event) {
  19170. return event.timeStamp || Date.now();
  19171. },
  19172. defaultPrevented: null,
  19173. isTrusted: null
  19174. };
  19175. function functionThatReturnsTrue() {
  19176. return true;
  19177. }
  19178. function functionThatReturnsFalse() {
  19179. return false;
  19180. }
  19181. /**
  19182. * Synthetic events are dispatched by event plugins, typically in response to a
  19183. * top-level event delegation handler.
  19184. *
  19185. * These systems should generally use pooling to reduce the frequency of garbage
  19186. * collection. The system should check `isPersistent` to determine whether the
  19187. * event should be released into the pool after being dispatched. Users that
  19188. * need a persisted event should invoke `persist`.
  19189. *
  19190. * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
  19191. * normalizing browser quirks. Subclasses do not necessarily have to implement a
  19192. * DOM interface; custom application-specific events can also subclass this.
  19193. *
  19194. * @param {object} dispatchConfig Configuration used to dispatch this event.
  19195. * @param {*} targetInst Marker identifying the event target.
  19196. * @param {object} nativeEvent Native browser event.
  19197. * @param {DOMEventTarget} nativeEventTarget Target node.
  19198. */
  19199. function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
  19200. {
  19201. // these have a getter/setter for warnings
  19202. delete this.nativeEvent;
  19203. delete this.preventDefault;
  19204. delete this.stopPropagation;
  19205. delete this.isDefaultPrevented;
  19206. delete this.isPropagationStopped;
  19207. }
  19208. this.dispatchConfig = dispatchConfig;
  19209. this._targetInst = targetInst;
  19210. this.nativeEvent = nativeEvent;
  19211. var Interface = this.constructor.Interface;
  19212. for (var propName in Interface) {
  19213. if (!Interface.hasOwnProperty(propName)) {
  19214. continue;
  19215. }
  19216. {
  19217. delete this[propName]; // this has a getter/setter for warnings
  19218. }
  19219. var normalize = Interface[propName];
  19220. if (normalize) {
  19221. this[propName] = normalize(nativeEvent);
  19222. } else {
  19223. if (propName === 'target') {
  19224. this.target = nativeEventTarget;
  19225. } else {
  19226. this[propName] = nativeEvent[propName];
  19227. }
  19228. }
  19229. }
  19230. var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
  19231. if (defaultPrevented) {
  19232. this.isDefaultPrevented = functionThatReturnsTrue;
  19233. } else {
  19234. this.isDefaultPrevented = functionThatReturnsFalse;
  19235. }
  19236. this.isPropagationStopped = functionThatReturnsFalse;
  19237. return this;
  19238. }
  19239. _assign(SyntheticEvent.prototype, {
  19240. preventDefault: function () {
  19241. this.defaultPrevented = true;
  19242. var event = this.nativeEvent;
  19243. if (!event) {
  19244. return;
  19245. }
  19246. if (event.preventDefault) {
  19247. event.preventDefault();
  19248. } else if (typeof event.returnValue !== 'unknown') {
  19249. event.returnValue = false;
  19250. }
  19251. this.isDefaultPrevented = functionThatReturnsTrue;
  19252. },
  19253. stopPropagation: function () {
  19254. var event = this.nativeEvent;
  19255. if (!event) {
  19256. return;
  19257. }
  19258. if (event.stopPropagation) {
  19259. event.stopPropagation();
  19260. } else if (typeof event.cancelBubble !== 'unknown') {
  19261. // The ChangeEventPlugin registers a "propertychange" event for
  19262. // IE. This event does not support bubbling or cancelling, and
  19263. // any references to cancelBubble throw "Member not found". A
  19264. // typeof check of "unknown" circumvents this issue (and is also
  19265. // IE specific).
  19266. event.cancelBubble = true;
  19267. }
  19268. this.isPropagationStopped = functionThatReturnsTrue;
  19269. },
  19270. /**
  19271. * We release all dispatched `SyntheticEvent`s after each event loop, adding
  19272. * them back into the pool. This allows a way to hold onto a reference that
  19273. * won't be added back into the pool.
  19274. */
  19275. persist: function () {
  19276. this.isPersistent = functionThatReturnsTrue;
  19277. },
  19278. /**
  19279. * Checks if this event should be released back into the pool.
  19280. *
  19281. * @return {boolean} True if this should not be released, false otherwise.
  19282. */
  19283. isPersistent: functionThatReturnsFalse,
  19284. /**
  19285. * `PooledClass` looks for `destructor` on each instance it releases.
  19286. */
  19287. destructor: function () {
  19288. var Interface = this.constructor.Interface;
  19289. for (var propName in Interface) {
  19290. {
  19291. Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
  19292. }
  19293. }
  19294. this.dispatchConfig = null;
  19295. this._targetInst = null;
  19296. this.nativeEvent = null;
  19297. this.isDefaultPrevented = functionThatReturnsFalse;
  19298. this.isPropagationStopped = functionThatReturnsFalse;
  19299. this._dispatchListeners = null;
  19300. this._dispatchInstances = null;
  19301. {
  19302. Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
  19303. Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
  19304. Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
  19305. Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
  19306. Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
  19307. }
  19308. }
  19309. });
  19310. SyntheticEvent.Interface = EventInterface;
  19311. /**
  19312. * Helper to reduce boilerplate when creating subclasses.
  19313. */
  19314. SyntheticEvent.extend = function (Interface) {
  19315. var Super = this;
  19316. var E = function () {};
  19317. E.prototype = Super.prototype;
  19318. var prototype = new E();
  19319. function Class() {
  19320. return Super.apply(this, arguments);
  19321. }
  19322. _assign(prototype, Class.prototype);
  19323. Class.prototype = prototype;
  19324. Class.prototype.constructor = Class;
  19325. Class.Interface = _assign({}, Super.Interface, Interface);
  19326. Class.extend = Super.extend;
  19327. addEventPoolingTo(Class);
  19328. return Class;
  19329. };
  19330. addEventPoolingTo(SyntheticEvent);
  19331. /**
  19332. * Helper to nullify syntheticEvent instance properties when destructing
  19333. *
  19334. * @param {String} propName
  19335. * @param {?object} getVal
  19336. * @return {object} defineProperty object
  19337. */
  19338. function getPooledWarningPropertyDefinition(propName, getVal) {
  19339. var isFunction = typeof getVal === 'function';
  19340. return {
  19341. configurable: true,
  19342. set: set,
  19343. get: get
  19344. };
  19345. function set(val) {
  19346. var action = isFunction ? 'setting the method' : 'setting the property';
  19347. warn(action, 'This is effectively a no-op');
  19348. return val;
  19349. }
  19350. function get() {
  19351. var action = isFunction ? 'accessing the method' : 'accessing the property';
  19352. var result = isFunction ? 'This is a no-op function' : 'This is set to null';
  19353. warn(action, result);
  19354. return getVal;
  19355. }
  19356. function warn(action, result) {
  19357. {
  19358. error("This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result);
  19359. }
  19360. }
  19361. }
  19362. function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
  19363. var EventConstructor = this;
  19364. if (EventConstructor.eventPool.length) {
  19365. var instance = EventConstructor.eventPool.pop();
  19366. EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
  19367. return instance;
  19368. }
  19369. return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
  19370. }
  19371. function releasePooledEvent(event) {
  19372. var EventConstructor = this;
  19373. if (!(event instanceof EventConstructor)) {
  19374. {
  19375. throw Error( "Trying to release an event instance into a pool of a different type." );
  19376. }
  19377. }
  19378. event.destructor();
  19379. if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
  19380. EventConstructor.eventPool.push(event);
  19381. }
  19382. }
  19383. function addEventPoolingTo(EventConstructor) {
  19384. EventConstructor.eventPool = [];
  19385. EventConstructor.getPooled = getPooledEvent;
  19386. EventConstructor.release = releasePooledEvent;
  19387. }
  19388. /**
  19389. * @interface Event
  19390. * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
  19391. */
  19392. var SyntheticCompositionEvent = SyntheticEvent.extend({
  19393. data: null
  19394. });
  19395. /**
  19396. * @interface Event
  19397. * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
  19398. * /#events-inputevents
  19399. */
  19400. var SyntheticInputEvent = SyntheticEvent.extend({
  19401. data: null
  19402. });
  19403. var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
  19404. var START_KEYCODE = 229;
  19405. var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;
  19406. var documentMode = null;
  19407. if (canUseDOM && 'documentMode' in document) {
  19408. documentMode = document.documentMode;
  19409. } // Webkit offers a very useful `textInput` event that can be used to
  19410. // directly represent `beforeInput`. The IE `textinput` event is not as
  19411. // useful, so we don't use it.
  19412. var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied
  19413. // by the native compositionend event may be incorrect. Japanese ideographic
  19414. // spaces, for instance (\u3000) are not recorded correctly.
  19415. var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
  19416. var SPACEBAR_CODE = 32;
  19417. var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); // Events and their corresponding property names.
  19418. var eventTypes = {
  19419. beforeInput: {
  19420. phasedRegistrationNames: {
  19421. bubbled: 'onBeforeInput',
  19422. captured: 'onBeforeInputCapture'
  19423. },
  19424. dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]
  19425. },
  19426. compositionEnd: {
  19427. phasedRegistrationNames: {
  19428. bubbled: 'onCompositionEnd',
  19429. captured: 'onCompositionEndCapture'
  19430. },
  19431. dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  19432. },
  19433. compositionStart: {
  19434. phasedRegistrationNames: {
  19435. bubbled: 'onCompositionStart',
  19436. captured: 'onCompositionStartCapture'
  19437. },
  19438. dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  19439. },
  19440. compositionUpdate: {
  19441. phasedRegistrationNames: {
  19442. bubbled: 'onCompositionUpdate',
  19443. captured: 'onCompositionUpdateCapture'
  19444. },
  19445. dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  19446. }
  19447. }; // Track whether we've ever handled a keypress on the space key.
  19448. var hasSpaceKeypress = false;
  19449. /**
  19450. * Return whether a native keypress event is assumed to be a command.
  19451. * This is required because Firefox fires `keypress` events for key commands
  19452. * (cut, copy, select-all, etc.) even though no character is inserted.
  19453. */
  19454. function isKeypressCommand(nativeEvent) {
  19455. return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
  19456. !(nativeEvent.ctrlKey && nativeEvent.altKey);
  19457. }
  19458. /**
  19459. * Translate native top level events into event types.
  19460. *
  19461. * @param {string} topLevelType
  19462. * @return {object}
  19463. */
  19464. function getCompositionEventType(topLevelType) {
  19465. switch (topLevelType) {
  19466. case TOP_COMPOSITION_START:
  19467. return eventTypes.compositionStart;
  19468. case TOP_COMPOSITION_END:
  19469. return eventTypes.compositionEnd;
  19470. case TOP_COMPOSITION_UPDATE:
  19471. return eventTypes.compositionUpdate;
  19472. }
  19473. }
  19474. /**
  19475. * Does our fallback best-guess model think this event signifies that
  19476. * composition has begun?
  19477. *
  19478. * @param {string} topLevelType
  19479. * @param {object} nativeEvent
  19480. * @return {boolean}
  19481. */
  19482. function isFallbackCompositionStart(topLevelType, nativeEvent) {
  19483. return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;
  19484. }
  19485. /**
  19486. * Does our fallback mode think that this event is the end of composition?
  19487. *
  19488. * @param {string} topLevelType
  19489. * @param {object} nativeEvent
  19490. * @return {boolean}
  19491. */
  19492. function isFallbackCompositionEnd(topLevelType, nativeEvent) {
  19493. switch (topLevelType) {
  19494. case TOP_KEY_UP:
  19495. // Command keys insert or clear IME input.
  19496. return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
  19497. case TOP_KEY_DOWN:
  19498. // Expect IME keyCode on each keydown. If we get any other
  19499. // code we must have exited earlier.
  19500. return nativeEvent.keyCode !== START_KEYCODE;
  19501. case TOP_KEY_PRESS:
  19502. case TOP_MOUSE_DOWN:
  19503. case TOP_BLUR:
  19504. // Events are not possible without cancelling IME.
  19505. return true;
  19506. default:
  19507. return false;
  19508. }
  19509. }
  19510. /**
  19511. * Google Input Tools provides composition data via a CustomEvent,
  19512. * with the `data` property populated in the `detail` object. If this
  19513. * is available on the event object, use it. If not, this is a plain
  19514. * composition event and we have nothing special to extract.
  19515. *
  19516. * @param {object} nativeEvent
  19517. * @return {?string}
  19518. */
  19519. function getDataFromCustomEvent(nativeEvent) {
  19520. var detail = nativeEvent.detail;
  19521. if (typeof detail === 'object' && 'data' in detail) {
  19522. return detail.data;
  19523. }
  19524. return null;
  19525. }
  19526. /**
  19527. * Check if a composition event was triggered by Korean IME.
  19528. * Our fallback mode does not work well with IE's Korean IME,
  19529. * so just use native composition events when Korean IME is used.
  19530. * Although CompositionEvent.locale property is deprecated,
  19531. * it is available in IE, where our fallback mode is enabled.
  19532. *
  19533. * @param {object} nativeEvent
  19534. * @return {boolean}
  19535. */
  19536. function isUsingKoreanIME(nativeEvent) {
  19537. return nativeEvent.locale === 'ko';
  19538. } // Track the current IME composition status, if any.
  19539. var isComposing = false;
  19540. /**
  19541. * @return {?object} A SyntheticCompositionEvent.
  19542. */
  19543. function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  19544. var eventType;
  19545. var fallbackData;
  19546. if (canUseCompositionEvent) {
  19547. eventType = getCompositionEventType(topLevelType);
  19548. } else if (!isComposing) {
  19549. if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
  19550. eventType = eventTypes.compositionStart;
  19551. }
  19552. } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
  19553. eventType = eventTypes.compositionEnd;
  19554. }
  19555. if (!eventType) {
  19556. return null;
  19557. }
  19558. if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
  19559. // The current composition is stored statically and must not be
  19560. // overwritten while composition continues.
  19561. if (!isComposing && eventType === eventTypes.compositionStart) {
  19562. isComposing = initialize(nativeEventTarget);
  19563. } else if (eventType === eventTypes.compositionEnd) {
  19564. if (isComposing) {
  19565. fallbackData = getData();
  19566. }
  19567. }
  19568. }
  19569. var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
  19570. if (fallbackData) {
  19571. // Inject data generated from fallback path into the synthetic event.
  19572. // This matches the property of native CompositionEventInterface.
  19573. event.data = fallbackData;
  19574. } else {
  19575. var customData = getDataFromCustomEvent(nativeEvent);
  19576. if (customData !== null) {
  19577. event.data = customData;
  19578. }
  19579. }
  19580. accumulateTwoPhaseDispatches(event);
  19581. return event;
  19582. }
  19583. /**
  19584. * @param {TopLevelType} topLevelType Number from `TopLevelType`.
  19585. * @param {object} nativeEvent Native browser event.
  19586. * @return {?string} The string corresponding to this `beforeInput` event.
  19587. */
  19588. function getNativeBeforeInputChars(topLevelType, nativeEvent) {
  19589. switch (topLevelType) {
  19590. case TOP_COMPOSITION_END:
  19591. return getDataFromCustomEvent(nativeEvent);
  19592. case TOP_KEY_PRESS:
  19593. /**
  19594. * If native `textInput` events are available, our goal is to make
  19595. * use of them. However, there is a special case: the spacebar key.
  19596. * In Webkit, preventing default on a spacebar `textInput` event
  19597. * cancels character insertion, but it *also* causes the browser
  19598. * to fall back to its default spacebar behavior of scrolling the
  19599. * page.
  19600. *
  19601. * Tracking at:
  19602. * https://code.google.com/p/chromium/issues/detail?id=355103
  19603. *
  19604. * To avoid this issue, use the keypress event as if no `textInput`
  19605. * event is available.
  19606. */
  19607. var which = nativeEvent.which;
  19608. if (which !== SPACEBAR_CODE) {
  19609. return null;
  19610. }
  19611. hasSpaceKeypress = true;
  19612. return SPACEBAR_CHAR;
  19613. case TOP_TEXT_INPUT:
  19614. // Record the characters to be added to the DOM.
  19615. var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled
  19616. // it at the keypress level and bail immediately. Android Chrome
  19617. // doesn't give us keycodes, so we need to ignore it.
  19618. if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
  19619. return null;
  19620. }
  19621. return chars;
  19622. default:
  19623. // For other native event types, do nothing.
  19624. return null;
  19625. }
  19626. }
  19627. /**
  19628. * For browsers that do not provide the `textInput` event, extract the
  19629. * appropriate string to use for SyntheticInputEvent.
  19630. *
  19631. * @param {number} topLevelType Number from `TopLevelEventTypes`.
  19632. * @param {object} nativeEvent Native browser event.
  19633. * @return {?string} The fallback string for this `beforeInput` event.
  19634. */
  19635. function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
  19636. // If we are currently composing (IME) and using a fallback to do so,
  19637. // try to extract the composed characters from the fallback object.
  19638. // If composition event is available, we extract a string only at
  19639. // compositionevent, otherwise extract it at fallback events.
  19640. if (isComposing) {
  19641. if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
  19642. var chars = getData();
  19643. reset();
  19644. isComposing = false;
  19645. return chars;
  19646. }
  19647. return null;
  19648. }
  19649. switch (topLevelType) {
  19650. case TOP_PASTE:
  19651. // If a paste event occurs after a keypress, throw out the input
  19652. // chars. Paste events should not lead to BeforeInput events.
  19653. return null;
  19654. case TOP_KEY_PRESS:
  19655. /**
  19656. * As of v27, Firefox may fire keypress events even when no character
  19657. * will be inserted. A few possibilities:
  19658. *
  19659. * - `which` is `0`. Arrow keys, Esc key, etc.
  19660. *
  19661. * - `which` is the pressed key code, but no char is available.
  19662. * Ex: 'AltGr + d` in Polish. There is no modified character for
  19663. * this key combination and no character is inserted into the
  19664. * document, but FF fires the keypress for char code `100` anyway.
  19665. * No `input` event will occur.
  19666. *
  19667. * - `which` is the pressed key code, but a command combination is
  19668. * being used. Ex: `Cmd+C`. No character is inserted, and no
  19669. * `input` event will occur.
  19670. */
  19671. if (!isKeypressCommand(nativeEvent)) {
  19672. // IE fires the `keypress` event when a user types an emoji via
  19673. // Touch keyboard of Windows. In such a case, the `char` property
  19674. // holds an emoji character like `\uD83D\uDE0A`. Because its length
  19675. // is 2, the property `which` does not represent an emoji correctly.
  19676. // In such a case, we directly return the `char` property instead of
  19677. // using `which`.
  19678. if (nativeEvent.char && nativeEvent.char.length > 1) {
  19679. return nativeEvent.char;
  19680. } else if (nativeEvent.which) {
  19681. return String.fromCharCode(nativeEvent.which);
  19682. }
  19683. }
  19684. return null;
  19685. case TOP_COMPOSITION_END:
  19686. return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
  19687. default:
  19688. return null;
  19689. }
  19690. }
  19691. /**
  19692. * Extract a SyntheticInputEvent for `beforeInput`, based on either native
  19693. * `textInput` or fallback behavior.
  19694. *
  19695. * @return {?object} A SyntheticInputEvent.
  19696. */
  19697. function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  19698. var chars;
  19699. if (canUseTextInputEvent) {
  19700. chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
  19701. } else {
  19702. chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
  19703. } // If no characters are being inserted, no BeforeInput event should
  19704. // be fired.
  19705. if (!chars) {
  19706. return null;
  19707. }
  19708. var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
  19709. event.data = chars;
  19710. accumulateTwoPhaseDispatches(event);
  19711. return event;
  19712. }
  19713. /**
  19714. * Create an `onBeforeInput` event to match
  19715. * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
  19716. *
  19717. * This event plugin is based on the native `textInput` event
  19718. * available in Chrome, Safari, Opera, and IE. This event fires after
  19719. * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
  19720. *
  19721. * `beforeInput` is spec'd but not implemented in any browsers, and
  19722. * the `input` event does not provide any useful information about what has
  19723. * actually been added, contrary to the spec. Thus, `textInput` is the best
  19724. * available event to identify the characters that have actually been inserted
  19725. * into the target node.
  19726. *
  19727. * This plugin is also responsible for emitting `composition` events, thus
  19728. * allowing us to share composition fallback code for both `beforeInput` and
  19729. * `composition` event types.
  19730. */
  19731. var BeforeInputEventPlugin = {
  19732. eventTypes: eventTypes,
  19733. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  19734. var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  19735. var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  19736. if (composition === null) {
  19737. return beforeInput;
  19738. }
  19739. if (beforeInput === null) {
  19740. return composition;
  19741. }
  19742. return [composition, beforeInput];
  19743. }
  19744. };
  19745. /**
  19746. * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
  19747. */
  19748. var supportedInputTypes = {
  19749. color: true,
  19750. date: true,
  19751. datetime: true,
  19752. 'datetime-local': true,
  19753. email: true,
  19754. month: true,
  19755. number: true,
  19756. password: true,
  19757. range: true,
  19758. search: true,
  19759. tel: true,
  19760. text: true,
  19761. time: true,
  19762. url: true,
  19763. week: true
  19764. };
  19765. function isTextInputElement(elem) {
  19766. var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  19767. if (nodeName === 'input') {
  19768. return !!supportedInputTypes[elem.type];
  19769. }
  19770. if (nodeName === 'textarea') {
  19771. return true;
  19772. }
  19773. return false;
  19774. }
  19775. var eventTypes$1 = {
  19776. change: {
  19777. phasedRegistrationNames: {
  19778. bubbled: 'onChange',
  19779. captured: 'onChangeCapture'
  19780. },
  19781. dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]
  19782. }
  19783. };
  19784. function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
  19785. var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target);
  19786. event.type = 'change'; // Flag this event loop as needing state restore.
  19787. enqueueStateRestore(target);
  19788. accumulateTwoPhaseDispatches(event);
  19789. return event;
  19790. }
  19791. /**
  19792. * For IE shims
  19793. */
  19794. var activeElement = null;
  19795. var activeElementInst = null;
  19796. /**
  19797. * SECTION: handle `change` event
  19798. */
  19799. function shouldUseChangeEvent(elem) {
  19800. var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
  19801. return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
  19802. }
  19803. function manualDispatchChangeEvent(nativeEvent) {
  19804. var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the
  19805. // other events and have it go through ReactBrowserEventEmitter. Since it
  19806. // doesn't, we manually listen for the events and so we have to enqueue and
  19807. // process the abstract event manually.
  19808. //
  19809. // Batching is necessary here in order to ensure that all event handlers run
  19810. // before the next rerender (including event handlers attached to ancestor
  19811. // elements instead of directly on the input). Without this, controlled
  19812. // components don't work properly in conjunction with event bubbling because
  19813. // the component is rerendered and the value reverted before all the event
  19814. // handlers can run. See https://github.com/facebook/react/issues/708.
  19815. batchedUpdates(runEventInBatch, event);
  19816. }
  19817. function runEventInBatch(event) {
  19818. runEventsInBatch(event);
  19819. }
  19820. function getInstIfValueChanged(targetInst) {
  19821. var targetNode = getNodeFromInstance$1(targetInst);
  19822. if (updateValueIfChanged(targetNode)) {
  19823. return targetInst;
  19824. }
  19825. }
  19826. function getTargetInstForChangeEvent(topLevelType, targetInst) {
  19827. if (topLevelType === TOP_CHANGE) {
  19828. return targetInst;
  19829. }
  19830. }
  19831. /**
  19832. * SECTION: handle `input` event
  19833. */
  19834. var isInputEventSupported = false;
  19835. if (canUseDOM) {
  19836. // IE9 claims to support the input event but fails to trigger it when
  19837. // deleting text, so we ignore its input events.
  19838. isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
  19839. }
  19840. /**
  19841. * (For IE <=9) Starts tracking propertychange events on the passed-in element
  19842. * and override the value property so that we can distinguish user events from
  19843. * value changes in JS.
  19844. */
  19845. function startWatchingForValueChange(target, targetInst) {
  19846. activeElement = target;
  19847. activeElementInst = targetInst;
  19848. activeElement.attachEvent('onpropertychange', handlePropertyChange);
  19849. }
  19850. /**
  19851. * (For IE <=9) Removes the event listeners from the currently-tracked element,
  19852. * if any exists.
  19853. */
  19854. function stopWatchingForValueChange() {
  19855. if (!activeElement) {
  19856. return;
  19857. }
  19858. activeElement.detachEvent('onpropertychange', handlePropertyChange);
  19859. activeElement = null;
  19860. activeElementInst = null;
  19861. }
  19862. /**
  19863. * (For IE <=9) Handles a propertychange event, sending a `change` event if
  19864. * the value of the active element has changed.
  19865. */
  19866. function handlePropertyChange(nativeEvent) {
  19867. if (nativeEvent.propertyName !== 'value') {
  19868. return;
  19869. }
  19870. if (getInstIfValueChanged(activeElementInst)) {
  19871. manualDispatchChangeEvent(nativeEvent);
  19872. }
  19873. }
  19874. function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
  19875. if (topLevelType === TOP_FOCUS) {
  19876. // In IE9, propertychange fires for most input events but is buggy and
  19877. // doesn't fire when text is deleted, but conveniently, selectionchange
  19878. // appears to fire in all of the remaining cases so we catch those and
  19879. // forward the event if the value has changed
  19880. // In either case, we don't want to call the event handler if the value
  19881. // is changed from JS so we redefine a setter for `.value` that updates
  19882. // our activeElementValue variable, allowing us to ignore those changes
  19883. //
  19884. // stopWatching() should be a noop here but we call it just in case we
  19885. // missed a blur event somehow.
  19886. stopWatchingForValueChange();
  19887. startWatchingForValueChange(target, targetInst);
  19888. } else if (topLevelType === TOP_BLUR) {
  19889. stopWatchingForValueChange();
  19890. }
  19891. } // For IE8 and IE9.
  19892. function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
  19893. if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {
  19894. // On the selectionchange event, the target is just document which isn't
  19895. // helpful for us so just check activeElement instead.
  19896. //
  19897. // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
  19898. // propertychange on the first input event after setting `value` from a
  19899. // script and fires only keydown, keypress, keyup. Catching keyup usually
  19900. // gets it and catching keydown lets us fire an event for the first
  19901. // keystroke if user does a key repeat (it'll be a little delayed: right
  19902. // before the second keystroke). Other input methods (e.g., paste) seem to
  19903. // fire selectionchange normally.
  19904. return getInstIfValueChanged(activeElementInst);
  19905. }
  19906. }
  19907. /**
  19908. * SECTION: handle `click` event
  19909. */
  19910. function shouldUseClickEvent(elem) {
  19911. // Use the `click` event to detect changes to checkbox and radio inputs.
  19912. // This approach works across all browsers, whereas `change` does not fire
  19913. // until `blur` in IE8.
  19914. var nodeName = elem.nodeName;
  19915. return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
  19916. }
  19917. function getTargetInstForClickEvent(topLevelType, targetInst) {
  19918. if (topLevelType === TOP_CLICK) {
  19919. return getInstIfValueChanged(targetInst);
  19920. }
  19921. }
  19922. function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
  19923. if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
  19924. return getInstIfValueChanged(targetInst);
  19925. }
  19926. }
  19927. function handleControlledInputBlur(node) {
  19928. var state = node._wrapperState;
  19929. if (!state || !state.controlled || node.type !== 'number') {
  19930. return;
  19931. }
  19932. {
  19933. // If controlled, assign the value attribute to the current value on blur
  19934. setDefaultValue(node, 'number', node.value);
  19935. }
  19936. }
  19937. /**
  19938. * This plugin creates an `onChange` event that normalizes change events
  19939. * across form elements. This event fires at a time when it's possible to
  19940. * change the element's value without seeing a flicker.
  19941. *
  19942. * Supported elements are:
  19943. * - input (see `isTextInputElement`)
  19944. * - textarea
  19945. * - select
  19946. */
  19947. var ChangeEventPlugin = {
  19948. eventTypes: eventTypes$1,
  19949. _isInputEventSupported: isInputEventSupported,
  19950. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  19951. var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
  19952. var getTargetInstFunc, handleEventFunc;
  19953. if (shouldUseChangeEvent(targetNode)) {
  19954. getTargetInstFunc = getTargetInstForChangeEvent;
  19955. } else if (isTextInputElement(targetNode)) {
  19956. if (isInputEventSupported) {
  19957. getTargetInstFunc = getTargetInstForInputOrChangeEvent;
  19958. } else {
  19959. getTargetInstFunc = getTargetInstForInputEventPolyfill;
  19960. handleEventFunc = handleEventsForInputEventPolyfill;
  19961. }
  19962. } else if (shouldUseClickEvent(targetNode)) {
  19963. getTargetInstFunc = getTargetInstForClickEvent;
  19964. }
  19965. if (getTargetInstFunc) {
  19966. var inst = getTargetInstFunc(topLevelType, targetInst);
  19967. if (inst) {
  19968. var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
  19969. return event;
  19970. }
  19971. }
  19972. if (handleEventFunc) {
  19973. handleEventFunc(topLevelType, targetNode, targetInst);
  19974. } // When blurring, set the value attribute for number inputs
  19975. if (topLevelType === TOP_BLUR) {
  19976. handleControlledInputBlur(targetNode);
  19977. }
  19978. }
  19979. };
  19980. var SyntheticUIEvent = SyntheticEvent.extend({
  19981. view: null,
  19982. detail: null
  19983. });
  19984. /**
  19985. * Translation from modifier key to the associated property in the event.
  19986. * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
  19987. */
  19988. var modifierKeyToProp = {
  19989. Alt: 'altKey',
  19990. Control: 'ctrlKey',
  19991. Meta: 'metaKey',
  19992. Shift: 'shiftKey'
  19993. }; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support
  19994. // getModifierState. If getModifierState is not supported, we map it to a set of
  19995. // modifier keys exposed by the event. In this case, Lock-keys are not supported.
  19996. function modifierStateGetter(keyArg) {
  19997. var syntheticEvent = this;
  19998. var nativeEvent = syntheticEvent.nativeEvent;
  19999. if (nativeEvent.getModifierState) {
  20000. return nativeEvent.getModifierState(keyArg);
  20001. }
  20002. var keyProp = modifierKeyToProp[keyArg];
  20003. return keyProp ? !!nativeEvent[keyProp] : false;
  20004. }
  20005. function getEventModifierState(nativeEvent) {
  20006. return modifierStateGetter;
  20007. }
  20008. var previousScreenX = 0;
  20009. var previousScreenY = 0; // Use flags to signal movementX/Y has already been set
  20010. var isMovementXSet = false;
  20011. var isMovementYSet = false;
  20012. /**
  20013. * @interface MouseEvent
  20014. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  20015. */
  20016. var SyntheticMouseEvent = SyntheticUIEvent.extend({
  20017. screenX: null,
  20018. screenY: null,
  20019. clientX: null,
  20020. clientY: null,
  20021. pageX: null,
  20022. pageY: null,
  20023. ctrlKey: null,
  20024. shiftKey: null,
  20025. altKey: null,
  20026. metaKey: null,
  20027. getModifierState: getEventModifierState,
  20028. button: null,
  20029. buttons: null,
  20030. relatedTarget: function (event) {
  20031. return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
  20032. },
  20033. movementX: function (event) {
  20034. if ('movementX' in event) {
  20035. return event.movementX;
  20036. }
  20037. var screenX = previousScreenX;
  20038. previousScreenX = event.screenX;
  20039. if (!isMovementXSet) {
  20040. isMovementXSet = true;
  20041. return 0;
  20042. }
  20043. return event.type === 'mousemove' ? event.screenX - screenX : 0;
  20044. },
  20045. movementY: function (event) {
  20046. if ('movementY' in event) {
  20047. return event.movementY;
  20048. }
  20049. var screenY = previousScreenY;
  20050. previousScreenY = event.screenY;
  20051. if (!isMovementYSet) {
  20052. isMovementYSet = true;
  20053. return 0;
  20054. }
  20055. return event.type === 'mousemove' ? event.screenY - screenY : 0;
  20056. }
  20057. });
  20058. /**
  20059. * @interface PointerEvent
  20060. * @see http://www.w3.org/TR/pointerevents/
  20061. */
  20062. var SyntheticPointerEvent = SyntheticMouseEvent.extend({
  20063. pointerId: null,
  20064. width: null,
  20065. height: null,
  20066. pressure: null,
  20067. tangentialPressure: null,
  20068. tiltX: null,
  20069. tiltY: null,
  20070. twist: null,
  20071. pointerType: null,
  20072. isPrimary: null
  20073. });
  20074. var eventTypes$2 = {
  20075. mouseEnter: {
  20076. registrationName: 'onMouseEnter',
  20077. dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
  20078. },
  20079. mouseLeave: {
  20080. registrationName: 'onMouseLeave',
  20081. dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
  20082. },
  20083. pointerEnter: {
  20084. registrationName: 'onPointerEnter',
  20085. dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
  20086. },
  20087. pointerLeave: {
  20088. registrationName: 'onPointerLeave',
  20089. dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
  20090. }
  20091. };
  20092. var EnterLeaveEventPlugin = {
  20093. eventTypes: eventTypes$2,
  20094. /**
  20095. * For almost every interaction we care about, there will be both a top-level
  20096. * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
  20097. * we do not extract duplicate events. However, moving the mouse into the
  20098. * browser from outside will not fire a `mouseout` event. In this case, we use
  20099. * the `mouseover` top-level event.
  20100. */
  20101. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  20102. var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;
  20103. var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;
  20104. if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0 && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
  20105. // If this is an over event with a target, then we've already dispatched
  20106. // the event in the out event of the other target. If this is replayed,
  20107. // then it's because we couldn't dispatch against this target previously
  20108. // so we have to do it now instead.
  20109. return null;
  20110. }
  20111. if (!isOutEvent && !isOverEvent) {
  20112. // Must not be a mouse or pointer in or out - ignoring.
  20113. return null;
  20114. }
  20115. var win;
  20116. if (nativeEventTarget.window === nativeEventTarget) {
  20117. // `nativeEventTarget` is probably a window object.
  20118. win = nativeEventTarget;
  20119. } else {
  20120. // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
  20121. var doc = nativeEventTarget.ownerDocument;
  20122. if (doc) {
  20123. win = doc.defaultView || doc.parentWindow;
  20124. } else {
  20125. win = window;
  20126. }
  20127. }
  20128. var from;
  20129. var to;
  20130. if (isOutEvent) {
  20131. from = targetInst;
  20132. var related = nativeEvent.relatedTarget || nativeEvent.toElement;
  20133. to = related ? getClosestInstanceFromNode(related) : null;
  20134. if (to !== null) {
  20135. var nearestMounted = getNearestMountedFiber(to);
  20136. if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
  20137. to = null;
  20138. }
  20139. }
  20140. } else {
  20141. // Moving to a node from outside the window.
  20142. from = null;
  20143. to = targetInst;
  20144. }
  20145. if (from === to) {
  20146. // Nothing pertains to our managed components.
  20147. return null;
  20148. }
  20149. var eventInterface, leaveEventType, enterEventType, eventTypePrefix;
  20150. if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {
  20151. eventInterface = SyntheticMouseEvent;
  20152. leaveEventType = eventTypes$2.mouseLeave;
  20153. enterEventType = eventTypes$2.mouseEnter;
  20154. eventTypePrefix = 'mouse';
  20155. } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {
  20156. eventInterface = SyntheticPointerEvent;
  20157. leaveEventType = eventTypes$2.pointerLeave;
  20158. enterEventType = eventTypes$2.pointerEnter;
  20159. eventTypePrefix = 'pointer';
  20160. }
  20161. var fromNode = from == null ? win : getNodeFromInstance$1(from);
  20162. var toNode = to == null ? win : getNodeFromInstance$1(to);
  20163. var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);
  20164. leave.type = eventTypePrefix + 'leave';
  20165. leave.target = fromNode;
  20166. leave.relatedTarget = toNode;
  20167. var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);
  20168. enter.type = eventTypePrefix + 'enter';
  20169. enter.target = toNode;
  20170. enter.relatedTarget = fromNode;
  20171. accumulateEnterLeaveDispatches(leave, enter, from, to); // If we are not processing the first ancestor, then we
  20172. // should not process the same nativeEvent again, as we
  20173. // will have already processed it in the first ancestor.
  20174. if ((eventSystemFlags & IS_FIRST_ANCESTOR) === 0) {
  20175. return [leave];
  20176. }
  20177. return [leave, enter];
  20178. }
  20179. };
  20180. /**
  20181. * inlined Object.is polyfill to avoid requiring consumers ship their own
  20182. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  20183. */
  20184. function is(x, y) {
  20185. return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
  20186. ;
  20187. }
  20188. var objectIs = typeof Object.is === 'function' ? Object.is : is;
  20189. var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
  20190. /**
  20191. * Performs equality by iterating through keys on an object and returning false
  20192. * when any key has values which are not strictly equal between the arguments.
  20193. * Returns true when the values of all keys are strictly equal.
  20194. */
  20195. function shallowEqual(objA, objB) {
  20196. if (objectIs(objA, objB)) {
  20197. return true;
  20198. }
  20199. if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
  20200. return false;
  20201. }
  20202. var keysA = Object.keys(objA);
  20203. var keysB = Object.keys(objB);
  20204. if (keysA.length !== keysB.length) {
  20205. return false;
  20206. } // Test for A's keys different from B.
  20207. for (var i = 0; i < keysA.length; i++) {
  20208. if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {
  20209. return false;
  20210. }
  20211. }
  20212. return true;
  20213. }
  20214. var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;
  20215. var eventTypes$3 = {
  20216. select: {
  20217. phasedRegistrationNames: {
  20218. bubbled: 'onSelect',
  20219. captured: 'onSelectCapture'
  20220. },
  20221. dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]
  20222. }
  20223. };
  20224. var activeElement$1 = null;
  20225. var activeElementInst$1 = null;
  20226. var lastSelection = null;
  20227. var mouseDown = false;
  20228. /**
  20229. * Get an object which is a unique representation of the current selection.
  20230. *
  20231. * The return value will not be consistent across nodes or browsers, but
  20232. * two identical selections on the same node will return identical objects.
  20233. *
  20234. * @param {DOMElement} node
  20235. * @return {object}
  20236. */
  20237. function getSelection$1(node) {
  20238. if ('selectionStart' in node && hasSelectionCapabilities(node)) {
  20239. return {
  20240. start: node.selectionStart,
  20241. end: node.selectionEnd
  20242. };
  20243. } else {
  20244. var win = node.ownerDocument && node.ownerDocument.defaultView || window;
  20245. var selection = win.getSelection();
  20246. return {
  20247. anchorNode: selection.anchorNode,
  20248. anchorOffset: selection.anchorOffset,
  20249. focusNode: selection.focusNode,
  20250. focusOffset: selection.focusOffset
  20251. };
  20252. }
  20253. }
  20254. /**
  20255. * Get document associated with the event target.
  20256. *
  20257. * @param {object} nativeEventTarget
  20258. * @return {Document}
  20259. */
  20260. function getEventTargetDocument(eventTarget) {
  20261. return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
  20262. }
  20263. /**
  20264. * Poll selection to see whether it's changed.
  20265. *
  20266. * @param {object} nativeEvent
  20267. * @param {object} nativeEventTarget
  20268. * @return {?SyntheticEvent}
  20269. */
  20270. function constructSelectEvent(nativeEvent, nativeEventTarget) {
  20271. // Ensure we have the right element, and that the user is not dragging a
  20272. // selection (this matches native `select` event behavior). In HTML5, select
  20273. // fires only on input and textarea thus if there's no focused element we
  20274. // won't dispatch.
  20275. var doc = getEventTargetDocument(nativeEventTarget);
  20276. if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
  20277. return null;
  20278. } // Only fire when selection has actually changed.
  20279. var currentSelection = getSelection$1(activeElement$1);
  20280. if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
  20281. lastSelection = currentSelection;
  20282. var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);
  20283. syntheticEvent.type = 'select';
  20284. syntheticEvent.target = activeElement$1;
  20285. accumulateTwoPhaseDispatches(syntheticEvent);
  20286. return syntheticEvent;
  20287. }
  20288. return null;
  20289. }
  20290. /**
  20291. * This plugin creates an `onSelect` event that normalizes select events
  20292. * across form elements.
  20293. *
  20294. * Supported elements are:
  20295. * - input (see `isTextInputElement`)
  20296. * - textarea
  20297. * - contentEditable
  20298. *
  20299. * This differs from native browser implementations in the following ways:
  20300. * - Fires on contentEditable fields as well as inputs.
  20301. * - Fires for collapsed selection.
  20302. * - Fires after user input.
  20303. */
  20304. var SelectEventPlugin = {
  20305. eventTypes: eventTypes$3,
  20306. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, container) {
  20307. var containerOrDoc = container || getEventTargetDocument(nativeEventTarget); // Track whether all listeners exists for this plugin. If none exist, we do
  20308. // not extract events. See #3639.
  20309. if (!containerOrDoc || !isListeningToAllDependencies('onSelect', containerOrDoc)) {
  20310. return null;
  20311. }
  20312. var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
  20313. switch (topLevelType) {
  20314. // Track the input node that has focus.
  20315. case TOP_FOCUS:
  20316. if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
  20317. activeElement$1 = targetNode;
  20318. activeElementInst$1 = targetInst;
  20319. lastSelection = null;
  20320. }
  20321. break;
  20322. case TOP_BLUR:
  20323. activeElement$1 = null;
  20324. activeElementInst$1 = null;
  20325. lastSelection = null;
  20326. break;
  20327. // Don't fire the event while the user is dragging. This matches the
  20328. // semantics of the native select event.
  20329. case TOP_MOUSE_DOWN:
  20330. mouseDown = true;
  20331. break;
  20332. case TOP_CONTEXT_MENU:
  20333. case TOP_MOUSE_UP:
  20334. case TOP_DRAG_END:
  20335. mouseDown = false;
  20336. return constructSelectEvent(nativeEvent, nativeEventTarget);
  20337. // Chrome and IE fire non-standard event when selection is changed (and
  20338. // sometimes when it hasn't). IE's event fires out of order with respect
  20339. // to key and input events on deletion, so we discard it.
  20340. //
  20341. // Firefox doesn't support selectionchange, so check selection status
  20342. // after each key entry. The selection changes after keydown and before
  20343. // keyup, but we check on keydown as well in the case of holding down a
  20344. // key, when multiple keydown events are fired but only one keyup is.
  20345. // This is also our approach for IE handling, for the reason above.
  20346. case TOP_SELECTION_CHANGE:
  20347. if (skipSelectionChangeEvent) {
  20348. break;
  20349. }
  20350. // falls through
  20351. case TOP_KEY_DOWN:
  20352. case TOP_KEY_UP:
  20353. return constructSelectEvent(nativeEvent, nativeEventTarget);
  20354. }
  20355. return null;
  20356. }
  20357. };
  20358. /**
  20359. * @interface Event
  20360. * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
  20361. * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
  20362. */
  20363. var SyntheticAnimationEvent = SyntheticEvent.extend({
  20364. animationName: null,
  20365. elapsedTime: null,
  20366. pseudoElement: null
  20367. });
  20368. /**
  20369. * @interface Event
  20370. * @see http://www.w3.org/TR/clipboard-apis/
  20371. */
  20372. var SyntheticClipboardEvent = SyntheticEvent.extend({
  20373. clipboardData: function (event) {
  20374. return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
  20375. }
  20376. });
  20377. /**
  20378. * @interface FocusEvent
  20379. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  20380. */
  20381. var SyntheticFocusEvent = SyntheticUIEvent.extend({
  20382. relatedTarget: null
  20383. });
  20384. /**
  20385. * `charCode` represents the actual "character code" and is safe to use with
  20386. * `String.fromCharCode`. As such, only keys that correspond to printable
  20387. * characters produce a valid `charCode`, the only exception to this is Enter.
  20388. * The Tab-key is considered non-printable and does not have a `charCode`,
  20389. * presumably because it does not produce a tab-character in browsers.
  20390. *
  20391. * @param {object} nativeEvent Native browser event.
  20392. * @return {number} Normalized `charCode` property.
  20393. */
  20394. function getEventCharCode(nativeEvent) {
  20395. var charCode;
  20396. var keyCode = nativeEvent.keyCode;
  20397. if ('charCode' in nativeEvent) {
  20398. charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`.
  20399. if (charCode === 0 && keyCode === 13) {
  20400. charCode = 13;
  20401. }
  20402. } else {
  20403. // IE8 does not implement `charCode`, but `keyCode` has the correct value.
  20404. charCode = keyCode;
  20405. } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)
  20406. // report Enter as charCode 10 when ctrl is pressed.
  20407. if (charCode === 10) {
  20408. charCode = 13;
  20409. } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
  20410. // Must not discard the (non-)printable Enter-key.
  20411. if (charCode >= 32 || charCode === 13) {
  20412. return charCode;
  20413. }
  20414. return 0;
  20415. }
  20416. /**
  20417. * Normalization of deprecated HTML5 `key` values
  20418. * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
  20419. */
  20420. var normalizeKey = {
  20421. Esc: 'Escape',
  20422. Spacebar: ' ',
  20423. Left: 'ArrowLeft',
  20424. Up: 'ArrowUp',
  20425. Right: 'ArrowRight',
  20426. Down: 'ArrowDown',
  20427. Del: 'Delete',
  20428. Win: 'OS',
  20429. Menu: 'ContextMenu',
  20430. Apps: 'ContextMenu',
  20431. Scroll: 'ScrollLock',
  20432. MozPrintableKey: 'Unidentified'
  20433. };
  20434. /**
  20435. * Translation from legacy `keyCode` to HTML5 `key`
  20436. * Only special keys supported, all others depend on keyboard layout or browser
  20437. * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
  20438. */
  20439. var translateToKey = {
  20440. '8': 'Backspace',
  20441. '9': 'Tab',
  20442. '12': 'Clear',
  20443. '13': 'Enter',
  20444. '16': 'Shift',
  20445. '17': 'Control',
  20446. '18': 'Alt',
  20447. '19': 'Pause',
  20448. '20': 'CapsLock',
  20449. '27': 'Escape',
  20450. '32': ' ',
  20451. '33': 'PageUp',
  20452. '34': 'PageDown',
  20453. '35': 'End',
  20454. '36': 'Home',
  20455. '37': 'ArrowLeft',
  20456. '38': 'ArrowUp',
  20457. '39': 'ArrowRight',
  20458. '40': 'ArrowDown',
  20459. '45': 'Insert',
  20460. '46': 'Delete',
  20461. '112': 'F1',
  20462. '113': 'F2',
  20463. '114': 'F3',
  20464. '115': 'F4',
  20465. '116': 'F5',
  20466. '117': 'F6',
  20467. '118': 'F7',
  20468. '119': 'F8',
  20469. '120': 'F9',
  20470. '121': 'F10',
  20471. '122': 'F11',
  20472. '123': 'F12',
  20473. '144': 'NumLock',
  20474. '145': 'ScrollLock',
  20475. '224': 'Meta'
  20476. };
  20477. /**
  20478. * @param {object} nativeEvent Native browser event.
  20479. * @return {string} Normalized `key` property.
  20480. */
  20481. function getEventKey(nativeEvent) {
  20482. if (nativeEvent.key) {
  20483. // Normalize inconsistent values reported by browsers due to
  20484. // implementations of a working draft specification.
  20485. // FireFox implements `key` but returns `MozPrintableKey` for all
  20486. // printable characters (normalized to `Unidentified`), ignore it.
  20487. var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
  20488. if (key !== 'Unidentified') {
  20489. return key;
  20490. }
  20491. } // Browser does not implement `key`, polyfill as much of it as we can.
  20492. if (nativeEvent.type === 'keypress') {
  20493. var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can
  20494. // thus be captured by `keypress`, no other non-printable key should.
  20495. return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
  20496. }
  20497. if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
  20498. // While user keyboard layout determines the actual meaning of each
  20499. // `keyCode` value, almost all function keys have a universal value.
  20500. return translateToKey[nativeEvent.keyCode] || 'Unidentified';
  20501. }
  20502. return '';
  20503. }
  20504. /**
  20505. * @interface KeyboardEvent
  20506. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  20507. */
  20508. var SyntheticKeyboardEvent = SyntheticUIEvent.extend({
  20509. key: getEventKey,
  20510. location: null,
  20511. ctrlKey: null,
  20512. shiftKey: null,
  20513. altKey: null,
  20514. metaKey: null,
  20515. repeat: null,
  20516. locale: null,
  20517. getModifierState: getEventModifierState,
  20518. // Legacy Interface
  20519. charCode: function (event) {
  20520. // `charCode` is the result of a KeyPress event and represents the value of
  20521. // the actual printable character.
  20522. // KeyPress is deprecated, but its replacement is not yet final and not
  20523. // implemented in any major browser. Only KeyPress has charCode.
  20524. if (event.type === 'keypress') {
  20525. return getEventCharCode(event);
  20526. }
  20527. return 0;
  20528. },
  20529. keyCode: function (event) {
  20530. // `keyCode` is the result of a KeyDown/Up event and represents the value of
  20531. // physical keyboard key.
  20532. // The actual meaning of the value depends on the users' keyboard layout
  20533. // which cannot be detected. Assuming that it is a US keyboard layout
  20534. // provides a surprisingly accurate mapping for US and European users.
  20535. // Due to this, it is left to the user to implement at this time.
  20536. if (event.type === 'keydown' || event.type === 'keyup') {
  20537. return event.keyCode;
  20538. }
  20539. return 0;
  20540. },
  20541. which: function (event) {
  20542. // `which` is an alias for either `keyCode` or `charCode` depending on the
  20543. // type of the event.
  20544. if (event.type === 'keypress') {
  20545. return getEventCharCode(event);
  20546. }
  20547. if (event.type === 'keydown' || event.type === 'keyup') {
  20548. return event.keyCode;
  20549. }
  20550. return 0;
  20551. }
  20552. });
  20553. /**
  20554. * @interface DragEvent
  20555. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  20556. */
  20557. var SyntheticDragEvent = SyntheticMouseEvent.extend({
  20558. dataTransfer: null
  20559. });
  20560. /**
  20561. * @interface TouchEvent
  20562. * @see http://www.w3.org/TR/touch-events/
  20563. */
  20564. var SyntheticTouchEvent = SyntheticUIEvent.extend({
  20565. touches: null,
  20566. targetTouches: null,
  20567. changedTouches: null,
  20568. altKey: null,
  20569. metaKey: null,
  20570. ctrlKey: null,
  20571. shiftKey: null,
  20572. getModifierState: getEventModifierState
  20573. });
  20574. /**
  20575. * @interface Event
  20576. * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
  20577. * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
  20578. */
  20579. var SyntheticTransitionEvent = SyntheticEvent.extend({
  20580. propertyName: null,
  20581. elapsedTime: null,
  20582. pseudoElement: null
  20583. });
  20584. /**
  20585. * @interface WheelEvent
  20586. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  20587. */
  20588. var SyntheticWheelEvent = SyntheticMouseEvent.extend({
  20589. deltaX: function (event) {
  20590. return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
  20591. 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
  20592. },
  20593. deltaY: function (event) {
  20594. return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
  20595. 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
  20596. 'wheelDelta' in event ? -event.wheelDelta : 0;
  20597. },
  20598. deltaZ: null,
  20599. // Browsers without "deltaMode" is reporting in raw wheel delta where one
  20600. // notch on the scroll is always +/- 120, roughly equivalent to pixels.
  20601. // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
  20602. // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
  20603. deltaMode: null
  20604. });
  20605. var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];
  20606. var SimpleEventPlugin = {
  20607. // simpleEventPluginEventTypes gets populated from
  20608. // the DOMEventProperties module.
  20609. eventTypes: simpleEventPluginEventTypes,
  20610. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  20611. var dispatchConfig = topLevelEventsToDispatchConfig.get(topLevelType);
  20612. if (!dispatchConfig) {
  20613. return null;
  20614. }
  20615. var EventConstructor;
  20616. switch (topLevelType) {
  20617. case TOP_KEY_PRESS:
  20618. // Firefox creates a keypress event for function keys too. This removes
  20619. // the unwanted keypress events. Enter is however both printable and
  20620. // non-printable. One would expect Tab to be as well (but it isn't).
  20621. if (getEventCharCode(nativeEvent) === 0) {
  20622. return null;
  20623. }
  20624. /* falls through */
  20625. case TOP_KEY_DOWN:
  20626. case TOP_KEY_UP:
  20627. EventConstructor = SyntheticKeyboardEvent;
  20628. break;
  20629. case TOP_BLUR:
  20630. case TOP_FOCUS:
  20631. EventConstructor = SyntheticFocusEvent;
  20632. break;
  20633. case TOP_CLICK:
  20634. // Firefox creates a click event on right mouse clicks. This removes the
  20635. // unwanted click events.
  20636. if (nativeEvent.button === 2) {
  20637. return null;
  20638. }
  20639. /* falls through */
  20640. case TOP_AUX_CLICK:
  20641. case TOP_DOUBLE_CLICK:
  20642. case TOP_MOUSE_DOWN:
  20643. case TOP_MOUSE_MOVE:
  20644. case TOP_MOUSE_UP: // TODO: Disabled elements should not respond to mouse events
  20645. /* falls through */
  20646. case TOP_MOUSE_OUT:
  20647. case TOP_MOUSE_OVER:
  20648. case TOP_CONTEXT_MENU:
  20649. EventConstructor = SyntheticMouseEvent;
  20650. break;
  20651. case TOP_DRAG:
  20652. case TOP_DRAG_END:
  20653. case TOP_DRAG_ENTER:
  20654. case TOP_DRAG_EXIT:
  20655. case TOP_DRAG_LEAVE:
  20656. case TOP_DRAG_OVER:
  20657. case TOP_DRAG_START:
  20658. case TOP_DROP:
  20659. EventConstructor = SyntheticDragEvent;
  20660. break;
  20661. case TOP_TOUCH_CANCEL:
  20662. case TOP_TOUCH_END:
  20663. case TOP_TOUCH_MOVE:
  20664. case TOP_TOUCH_START:
  20665. EventConstructor = SyntheticTouchEvent;
  20666. break;
  20667. case TOP_ANIMATION_END:
  20668. case TOP_ANIMATION_ITERATION:
  20669. case TOP_ANIMATION_START:
  20670. EventConstructor = SyntheticAnimationEvent;
  20671. break;
  20672. case TOP_TRANSITION_END:
  20673. EventConstructor = SyntheticTransitionEvent;
  20674. break;
  20675. case TOP_SCROLL:
  20676. EventConstructor = SyntheticUIEvent;
  20677. break;
  20678. case TOP_WHEEL:
  20679. EventConstructor = SyntheticWheelEvent;
  20680. break;
  20681. case TOP_COPY:
  20682. case TOP_CUT:
  20683. case TOP_PASTE:
  20684. EventConstructor = SyntheticClipboardEvent;
  20685. break;
  20686. case TOP_GOT_POINTER_CAPTURE:
  20687. case TOP_LOST_POINTER_CAPTURE:
  20688. case TOP_POINTER_CANCEL:
  20689. case TOP_POINTER_DOWN:
  20690. case TOP_POINTER_MOVE:
  20691. case TOP_POINTER_OUT:
  20692. case TOP_POINTER_OVER:
  20693. case TOP_POINTER_UP:
  20694. EventConstructor = SyntheticPointerEvent;
  20695. break;
  20696. default:
  20697. {
  20698. if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
  20699. error('SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);
  20700. }
  20701. } // HTML Events
  20702. // @see http://www.w3.org/TR/html5/index.html#events-0
  20703. EventConstructor = SyntheticEvent;
  20704. break;
  20705. }
  20706. var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
  20707. accumulateTwoPhaseDispatches(event);
  20708. return event;
  20709. }
  20710. };
  20711. /**
  20712. * Specifies a deterministic ordering of `EventPlugin`s. A convenient way to
  20713. * reason about plugins, without having to package every one of them. This
  20714. * is better than having plugins be ordered in the same order that they
  20715. * are injected because that ordering would be influenced by the packaging order.
  20716. * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
  20717. * preventing default on events is convenient in `SimpleEventPlugin` handlers.
  20718. */
  20719. var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
  20720. /**
  20721. * Inject modules for resolving DOM hierarchy and plugin ordering.
  20722. */
  20723. injectEventPluginOrder(DOMEventPluginOrder);
  20724. setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);
  20725. /**
  20726. * Some important event plugins included by default (without having to require
  20727. * them).
  20728. */
  20729. injectEventPluginsByName({
  20730. SimpleEventPlugin: SimpleEventPlugin,
  20731. EnterLeaveEventPlugin: EnterLeaveEventPlugin,
  20732. ChangeEventPlugin: ChangeEventPlugin,
  20733. SelectEventPlugin: SelectEventPlugin,
  20734. BeforeInputEventPlugin: BeforeInputEventPlugin
  20735. });
  20736. // Prefix measurements so that it's possible to filter them.
  20737. // Longer prefixes are hard to read in DevTools.
  20738. var reactEmoji = "\u269B";
  20739. var warningEmoji = "\u26D4";
  20740. var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; // Keep track of current fiber so that we know the path to unwind on pause.
  20741. // TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?
  20742. var currentFiber = null; // If we're in the middle of user code, which fiber and method is it?
  20743. // Reusing `currentFiber` would be confusing for this because user code fiber
  20744. // can change during commit phase too, but we don't need to unwind it (since
  20745. // lifecycles in the commit phase don't resemble a tree).
  20746. var currentPhase = null;
  20747. var currentPhaseFiber = null; // Did lifecycle hook schedule an update? This is often a performance problem,
  20748. // so we will keep track of it, and include it in the report.
  20749. // Track commits caused by cascading updates.
  20750. var isCommitting = false;
  20751. var hasScheduledUpdateInCurrentCommit = false;
  20752. var hasScheduledUpdateInCurrentPhase = false;
  20753. var commitCountInCurrentWorkLoop = 0;
  20754. var effectCountInCurrentCommit = 0;
  20755. // to avoid stretch the commit phase with measurement overhead.
  20756. var labelsInCurrentCommit = new Set();
  20757. var formatMarkName = function (markName) {
  20758. return reactEmoji + " " + markName;
  20759. };
  20760. var formatLabel = function (label, warning) {
  20761. var prefix = warning ? warningEmoji + " " : reactEmoji + " ";
  20762. var suffix = warning ? " Warning: " + warning : '';
  20763. return "" + prefix + label + suffix;
  20764. };
  20765. var beginMark = function (markName) {
  20766. performance.mark(formatMarkName(markName));
  20767. };
  20768. var clearMark = function (markName) {
  20769. performance.clearMarks(formatMarkName(markName));
  20770. };
  20771. var endMark = function (label, markName, warning) {
  20772. var formattedMarkName = formatMarkName(markName);
  20773. var formattedLabel = formatLabel(label, warning);
  20774. try {
  20775. performance.measure(formattedLabel, formattedMarkName);
  20776. } catch (err) {} // If previous mark was missing for some reason, this will throw.
  20777. // This could only happen if React crashed in an unexpected place earlier.
  20778. // Don't pile on with more errors.
  20779. // Clear marks immediately to avoid growing buffer.
  20780. performance.clearMarks(formattedMarkName);
  20781. performance.clearMeasures(formattedLabel);
  20782. };
  20783. var getFiberMarkName = function (label, debugID) {
  20784. return label + " (#" + debugID + ")";
  20785. };
  20786. var getFiberLabel = function (componentName, isMounted, phase) {
  20787. if (phase === null) {
  20788. // These are composite component total time measurements.
  20789. return componentName + " [" + (isMounted ? 'update' : 'mount') + "]";
  20790. } else {
  20791. // Composite component methods.
  20792. return componentName + "." + phase;
  20793. }
  20794. };
  20795. var beginFiberMark = function (fiber, phase) {
  20796. var componentName = getComponentName(fiber.type) || 'Unknown';
  20797. var debugID = fiber._debugID;
  20798. var isMounted = fiber.alternate !== null;
  20799. var label = getFiberLabel(componentName, isMounted, phase);
  20800. if (isCommitting && labelsInCurrentCommit.has(label)) {
  20801. // During the commit phase, we don't show duplicate labels because
  20802. // there is a fixed overhead for every measurement, and we don't
  20803. // want to stretch the commit phase beyond necessary.
  20804. return false;
  20805. }
  20806. labelsInCurrentCommit.add(label);
  20807. var markName = getFiberMarkName(label, debugID);
  20808. beginMark(markName);
  20809. return true;
  20810. };
  20811. var clearFiberMark = function (fiber, phase) {
  20812. var componentName = getComponentName(fiber.type) || 'Unknown';
  20813. var debugID = fiber._debugID;
  20814. var isMounted = fiber.alternate !== null;
  20815. var label = getFiberLabel(componentName, isMounted, phase);
  20816. var markName = getFiberMarkName(label, debugID);
  20817. clearMark(markName);
  20818. };
  20819. var endFiberMark = function (fiber, phase, warning) {
  20820. var componentName = getComponentName(fiber.type) || 'Unknown';
  20821. var debugID = fiber._debugID;
  20822. var isMounted = fiber.alternate !== null;
  20823. var label = getFiberLabel(componentName, isMounted, phase);
  20824. var markName = getFiberMarkName(label, debugID);
  20825. endMark(label, markName, warning);
  20826. };
  20827. var shouldIgnoreFiber = function (fiber) {
  20828. // Host components should be skipped in the timeline.
  20829. // We could check typeof fiber.type, but does this work with RN?
  20830. switch (fiber.tag) {
  20831. case HostRoot:
  20832. case HostComponent:
  20833. case HostText:
  20834. case HostPortal:
  20835. case Fragment:
  20836. case ContextProvider:
  20837. case ContextConsumer:
  20838. case Mode:
  20839. return true;
  20840. default:
  20841. return false;
  20842. }
  20843. };
  20844. var clearPendingPhaseMeasurement = function () {
  20845. if (currentPhase !== null && currentPhaseFiber !== null) {
  20846. clearFiberMark(currentPhaseFiber, currentPhase);
  20847. }
  20848. currentPhaseFiber = null;
  20849. currentPhase = null;
  20850. hasScheduledUpdateInCurrentPhase = false;
  20851. };
  20852. var pauseTimers = function () {
  20853. // Stops all currently active measurements so that they can be resumed
  20854. // if we continue in a later deferred loop from the same unit of work.
  20855. var fiber = currentFiber;
  20856. while (fiber) {
  20857. if (fiber._debugIsCurrentlyTiming) {
  20858. endFiberMark(fiber, null, null);
  20859. }
  20860. fiber = fiber.return;
  20861. }
  20862. };
  20863. var resumeTimersRecursively = function (fiber) {
  20864. if (fiber.return !== null) {
  20865. resumeTimersRecursively(fiber.return);
  20866. }
  20867. if (fiber._debugIsCurrentlyTiming) {
  20868. beginFiberMark(fiber, null);
  20869. }
  20870. };
  20871. var resumeTimers = function () {
  20872. // Resumes all measurements that were active during the last deferred loop.
  20873. if (currentFiber !== null) {
  20874. resumeTimersRecursively(currentFiber);
  20875. }
  20876. };
  20877. function recordEffect() {
  20878. {
  20879. effectCountInCurrentCommit++;
  20880. }
  20881. }
  20882. function recordScheduleUpdate() {
  20883. {
  20884. if (isCommitting) {
  20885. hasScheduledUpdateInCurrentCommit = true;
  20886. }
  20887. if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {
  20888. hasScheduledUpdateInCurrentPhase = true;
  20889. }
  20890. }
  20891. }
  20892. function startWorkTimer(fiber) {
  20893. {
  20894. if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
  20895. return;
  20896. } // If we pause, this is the fiber to unwind from.
  20897. currentFiber = fiber;
  20898. if (!beginFiberMark(fiber, null)) {
  20899. return;
  20900. }
  20901. fiber._debugIsCurrentlyTiming = true;
  20902. }
  20903. }
  20904. function cancelWorkTimer(fiber) {
  20905. {
  20906. if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
  20907. return;
  20908. } // Remember we shouldn't complete measurement for this fiber.
  20909. // Otherwise flamechart will be deep even for small updates.
  20910. fiber._debugIsCurrentlyTiming = false;
  20911. clearFiberMark(fiber, null);
  20912. }
  20913. }
  20914. function stopWorkTimer(fiber) {
  20915. {
  20916. if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
  20917. return;
  20918. } // If we pause, its parent is the fiber to unwind from.
  20919. currentFiber = fiber.return;
  20920. if (!fiber._debugIsCurrentlyTiming) {
  20921. return;
  20922. }
  20923. fiber._debugIsCurrentlyTiming = false;
  20924. endFiberMark(fiber, null, null);
  20925. }
  20926. }
  20927. function stopFailedWorkTimer(fiber) {
  20928. {
  20929. if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
  20930. return;
  20931. } // If we pause, its parent is the fiber to unwind from.
  20932. currentFiber = fiber.return;
  20933. if (!fiber._debugIsCurrentlyTiming) {
  20934. return;
  20935. }
  20936. fiber._debugIsCurrentlyTiming = false;
  20937. var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary';
  20938. endFiberMark(fiber, null, warning);
  20939. }
  20940. }
  20941. function startPhaseTimer(fiber, phase) {
  20942. {
  20943. if (!supportsUserTiming) {
  20944. return;
  20945. }
  20946. clearPendingPhaseMeasurement();
  20947. if (!beginFiberMark(fiber, phase)) {
  20948. return;
  20949. }
  20950. currentPhaseFiber = fiber;
  20951. currentPhase = phase;
  20952. }
  20953. }
  20954. function stopPhaseTimer() {
  20955. {
  20956. if (!supportsUserTiming) {
  20957. return;
  20958. }
  20959. if (currentPhase !== null && currentPhaseFiber !== null) {
  20960. var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;
  20961. endFiberMark(currentPhaseFiber, currentPhase, warning);
  20962. }
  20963. currentPhase = null;
  20964. currentPhaseFiber = null;
  20965. }
  20966. }
  20967. function startWorkLoopTimer(nextUnitOfWork) {
  20968. {
  20969. currentFiber = nextUnitOfWork;
  20970. if (!supportsUserTiming) {
  20971. return;
  20972. }
  20973. commitCountInCurrentWorkLoop = 0; // This is top level call.
  20974. // Any other measurements are performed within.
  20975. beginMark('(React Tree Reconciliation)'); // Resume any measurements that were in progress during the last loop.
  20976. resumeTimers();
  20977. }
  20978. }
  20979. function stopWorkLoopTimer(interruptedBy, didCompleteRoot) {
  20980. {
  20981. if (!supportsUserTiming) {
  20982. return;
  20983. }
  20984. var warning = null;
  20985. if (interruptedBy !== null) {
  20986. if (interruptedBy.tag === HostRoot) {
  20987. warning = 'A top-level update interrupted the previous render';
  20988. } else {
  20989. var componentName = getComponentName(interruptedBy.type) || 'Unknown';
  20990. warning = "An update to " + componentName + " interrupted the previous render";
  20991. }
  20992. } else if (commitCountInCurrentWorkLoop > 1) {
  20993. warning = 'There were cascading updates';
  20994. }
  20995. commitCountInCurrentWorkLoop = 0;
  20996. var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)'; // Pause any measurements until the next loop.
  20997. pauseTimers();
  20998. endMark(label, '(React Tree Reconciliation)', warning);
  20999. }
  21000. }
  21001. function startCommitTimer() {
  21002. {
  21003. if (!supportsUserTiming) {
  21004. return;
  21005. }
  21006. isCommitting = true;
  21007. hasScheduledUpdateInCurrentCommit = false;
  21008. labelsInCurrentCommit.clear();
  21009. beginMark('(Committing Changes)');
  21010. }
  21011. }
  21012. function stopCommitTimer() {
  21013. {
  21014. if (!supportsUserTiming) {
  21015. return;
  21016. }
  21017. var warning = null;
  21018. if (hasScheduledUpdateInCurrentCommit) {
  21019. warning = 'Lifecycle hook scheduled a cascading update';
  21020. } else if (commitCountInCurrentWorkLoop > 0) {
  21021. warning = 'Caused by a cascading update in earlier commit';
  21022. }
  21023. hasScheduledUpdateInCurrentCommit = false;
  21024. commitCountInCurrentWorkLoop++;
  21025. isCommitting = false;
  21026. labelsInCurrentCommit.clear();
  21027. endMark('(Committing Changes)', '(Committing Changes)', warning);
  21028. }
  21029. }
  21030. function startCommitSnapshotEffectsTimer() {
  21031. {
  21032. if (!supportsUserTiming) {
  21033. return;
  21034. }
  21035. effectCountInCurrentCommit = 0;
  21036. beginMark('(Committing Snapshot Effects)');
  21037. }
  21038. }
  21039. function stopCommitSnapshotEffectsTimer() {
  21040. {
  21041. if (!supportsUserTiming) {
  21042. return;
  21043. }
  21044. var count = effectCountInCurrentCommit;
  21045. effectCountInCurrentCommit = 0;
  21046. endMark("(Committing Snapshot Effects: " + count + " Total)", '(Committing Snapshot Effects)', null);
  21047. }
  21048. }
  21049. function startCommitHostEffectsTimer() {
  21050. {
  21051. if (!supportsUserTiming) {
  21052. return;
  21053. }
  21054. effectCountInCurrentCommit = 0;
  21055. beginMark('(Committing Host Effects)');
  21056. }
  21057. }
  21058. function stopCommitHostEffectsTimer() {
  21059. {
  21060. if (!supportsUserTiming) {
  21061. return;
  21062. }
  21063. var count = effectCountInCurrentCommit;
  21064. effectCountInCurrentCommit = 0;
  21065. endMark("(Committing Host Effects: " + count + " Total)", '(Committing Host Effects)', null);
  21066. }
  21067. }
  21068. function startCommitLifeCyclesTimer() {
  21069. {
  21070. if (!supportsUserTiming) {
  21071. return;
  21072. }
  21073. effectCountInCurrentCommit = 0;
  21074. beginMark('(Calling Lifecycle Methods)');
  21075. }
  21076. }
  21077. function stopCommitLifeCyclesTimer() {
  21078. {
  21079. if (!supportsUserTiming) {
  21080. return;
  21081. }
  21082. var count = effectCountInCurrentCommit;
  21083. effectCountInCurrentCommit = 0;
  21084. endMark("(Calling Lifecycle Methods: " + count + " Total)", '(Calling Lifecycle Methods)', null);
  21085. }
  21086. }
  21087. var valueStack = [];
  21088. var fiberStack;
  21089. {
  21090. fiberStack = [];
  21091. }
  21092. var index = -1;
  21093. function createCursor(defaultValue) {
  21094. return {
  21095. current: defaultValue
  21096. };
  21097. }
  21098. function pop(cursor, fiber) {
  21099. if (index < 0) {
  21100. {
  21101. error('Unexpected pop.');
  21102. }
  21103. return;
  21104. }
  21105. {
  21106. if (fiber !== fiberStack[index]) {
  21107. error('Unexpected Fiber popped.');
  21108. }
  21109. }
  21110. cursor.current = valueStack[index];
  21111. valueStack[index] = null;
  21112. {
  21113. fiberStack[index] = null;
  21114. }
  21115. index--;
  21116. }
  21117. function push(cursor, value, fiber) {
  21118. index++;
  21119. valueStack[index] = cursor.current;
  21120. {
  21121. fiberStack[index] = fiber;
  21122. }
  21123. cursor.current = value;
  21124. }
  21125. var warnedAboutMissingGetChildContext;
  21126. {
  21127. warnedAboutMissingGetChildContext = {};
  21128. }
  21129. var emptyContextObject = {};
  21130. {
  21131. Object.freeze(emptyContextObject);
  21132. } // A cursor to the current merged context object on the stack.
  21133. var contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed.
  21134. var didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack.
  21135. // We use this to get access to the parent context after we have already
  21136. // pushed the next context provider, and now need to merge their contexts.
  21137. var previousContext = emptyContextObject;
  21138. function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {
  21139. {
  21140. if (didPushOwnContextIfProvider && isContextProvider(Component)) {
  21141. // If the fiber is a context provider itself, when we read its context
  21142. // we may have already pushed its own child context on the stack. A context
  21143. // provider should not "see" its own child context. Therefore we read the
  21144. // previous (parent) context instead for a context provider.
  21145. return previousContext;
  21146. }
  21147. return contextStackCursor.current;
  21148. }
  21149. }
  21150. function cacheContext(workInProgress, unmaskedContext, maskedContext) {
  21151. {
  21152. var instance = workInProgress.stateNode;
  21153. instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
  21154. instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
  21155. }
  21156. }
  21157. function getMaskedContext(workInProgress, unmaskedContext) {
  21158. {
  21159. var type = workInProgress.type;
  21160. var contextTypes = type.contextTypes;
  21161. if (!contextTypes) {
  21162. return emptyContextObject;
  21163. } // Avoid recreating masked context unless unmasked context has changed.
  21164. // Failing to do this will result in unnecessary calls to componentWillReceiveProps.
  21165. // This may trigger infinite loops if componentWillReceiveProps calls setState.
  21166. var instance = workInProgress.stateNode;
  21167. if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
  21168. return instance.__reactInternalMemoizedMaskedChildContext;
  21169. }
  21170. var context = {};
  21171. for (var key in contextTypes) {
  21172. context[key] = unmaskedContext[key];
  21173. }
  21174. {
  21175. var name = getComponentName(type) || 'Unknown';
  21176. checkPropTypes(contextTypes, context, 'context', name, getCurrentFiberStackInDev);
  21177. } // Cache unmasked context so we can avoid recreating masked context unless necessary.
  21178. // Context is created before the class component is instantiated so check for instance.
  21179. if (instance) {
  21180. cacheContext(workInProgress, unmaskedContext, context);
  21181. }
  21182. return context;
  21183. }
  21184. }
  21185. function hasContextChanged() {
  21186. {
  21187. return didPerformWorkStackCursor.current;
  21188. }
  21189. }
  21190. function isContextProvider(type) {
  21191. {
  21192. var childContextTypes = type.childContextTypes;
  21193. return childContextTypes !== null && childContextTypes !== undefined;
  21194. }
  21195. }
  21196. function popContext(fiber) {
  21197. {
  21198. pop(didPerformWorkStackCursor, fiber);
  21199. pop(contextStackCursor, fiber);
  21200. }
  21201. }
  21202. function popTopLevelContextObject(fiber) {
  21203. {
  21204. pop(didPerformWorkStackCursor, fiber);
  21205. pop(contextStackCursor, fiber);
  21206. }
  21207. }
  21208. function pushTopLevelContextObject(fiber, context, didChange) {
  21209. {
  21210. if (!(contextStackCursor.current === emptyContextObject)) {
  21211. {
  21212. throw Error( "Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue." );
  21213. }
  21214. }
  21215. push(contextStackCursor, context, fiber);
  21216. push(didPerformWorkStackCursor, didChange, fiber);
  21217. }
  21218. }
  21219. function processChildContext(fiber, type, parentContext) {
  21220. {
  21221. var instance = fiber.stateNode;
  21222. var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future.
  21223. // It has only been added in Fiber to match the (unintentional) behavior in Stack.
  21224. if (typeof instance.getChildContext !== 'function') {
  21225. {
  21226. var componentName = getComponentName(type) || 'Unknown';
  21227. if (!warnedAboutMissingGetChildContext[componentName]) {
  21228. warnedAboutMissingGetChildContext[componentName] = true;
  21229. error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);
  21230. }
  21231. }
  21232. return parentContext;
  21233. }
  21234. var childContext;
  21235. startPhaseTimer(fiber, 'getChildContext');
  21236. childContext = instance.getChildContext();
  21237. stopPhaseTimer();
  21238. for (var contextKey in childContext) {
  21239. if (!(contextKey in childContextTypes)) {
  21240. {
  21241. throw Error( (getComponentName(type) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes." );
  21242. }
  21243. }
  21244. }
  21245. {
  21246. var name = getComponentName(type) || 'Unknown';
  21247. checkPropTypes(childContextTypes, childContext, 'child context', name, // In practice, there is one case in which we won't get a stack. It's when
  21248. // somebody calls unstable_renderSubtreeIntoContainer() and we process
  21249. // context from the parent component instance. The stack will be missing
  21250. // because it's outside of the reconciliation, and so the pointer has not
  21251. // been set. This is rare and doesn't matter. We'll also remove that API.
  21252. getCurrentFiberStackInDev);
  21253. }
  21254. return _assign({}, parentContext, {}, childContext);
  21255. }
  21256. }
  21257. function pushContextProvider(workInProgress) {
  21258. {
  21259. var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity.
  21260. // If the instance does not exist yet, we will push null at first,
  21261. // and replace it on the stack later when invalidating the context.
  21262. var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later.
  21263. // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
  21264. previousContext = contextStackCursor.current;
  21265. push(contextStackCursor, memoizedMergedChildContext, workInProgress);
  21266. push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
  21267. return true;
  21268. }
  21269. }
  21270. function invalidateContextProvider(workInProgress, type, didChange) {
  21271. {
  21272. var instance = workInProgress.stateNode;
  21273. if (!instance) {
  21274. {
  21275. throw Error( "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue." );
  21276. }
  21277. }
  21278. if (didChange) {
  21279. // Merge parent and own context.
  21280. // Skip this if we're not updating due to sCU.
  21281. // This avoids unnecessarily recomputing memoized values.
  21282. var mergedContext = processChildContext(workInProgress, type, previousContext);
  21283. instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.
  21284. // It is important to unwind the context in the reverse order.
  21285. pop(didPerformWorkStackCursor, workInProgress);
  21286. pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.
  21287. push(contextStackCursor, mergedContext, workInProgress);
  21288. push(didPerformWorkStackCursor, didChange, workInProgress);
  21289. } else {
  21290. pop(didPerformWorkStackCursor, workInProgress);
  21291. push(didPerformWorkStackCursor, didChange, workInProgress);
  21292. }
  21293. }
  21294. }
  21295. function findCurrentUnmaskedContext(fiber) {
  21296. {
  21297. // Currently this is only used with renderSubtreeIntoContainer; not sure if it
  21298. // makes sense elsewhere
  21299. if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {
  21300. {
  21301. throw Error( "Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue." );
  21302. }
  21303. }
  21304. var node = fiber;
  21305. do {
  21306. switch (node.tag) {
  21307. case HostRoot:
  21308. return node.stateNode.context;
  21309. case ClassComponent:
  21310. {
  21311. var Component = node.type;
  21312. if (isContextProvider(Component)) {
  21313. return node.stateNode.__reactInternalMemoizedMergedChildContext;
  21314. }
  21315. break;
  21316. }
  21317. }
  21318. node = node.return;
  21319. } while (node !== null);
  21320. {
  21321. {
  21322. throw Error( "Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue." );
  21323. }
  21324. }
  21325. }
  21326. }
  21327. var LegacyRoot = 0;
  21328. var BlockingRoot = 1;
  21329. var ConcurrentRoot = 2;
  21330. var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,
  21331. Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,
  21332. Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,
  21333. Scheduler_shouldYield = Scheduler.unstable_shouldYield,
  21334. Scheduler_requestPaint = Scheduler.unstable_requestPaint,
  21335. Scheduler_now = Scheduler.unstable_now,
  21336. Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel,
  21337. Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,
  21338. Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,
  21339. Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,
  21340. Scheduler_LowPriority = Scheduler.unstable_LowPriority,
  21341. Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;
  21342. {
  21343. // Provide explicit error message when production+profiling bundle of e.g.
  21344. // react-dom is used with production (non-profiling) bundle of
  21345. // scheduler/tracing
  21346. if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
  21347. {
  21348. throw Error( "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling" );
  21349. }
  21350. }
  21351. }
  21352. var fakeCallbackNode = {}; // Except for NoPriority, these correspond to Scheduler priorities. We use
  21353. // ascending numbers so we can compare them like numbers. They start at 90 to
  21354. // avoid clashing with Scheduler's priorities.
  21355. var ImmediatePriority = 99;
  21356. var UserBlockingPriority$1 = 98;
  21357. var NormalPriority = 97;
  21358. var LowPriority = 96;
  21359. var IdlePriority = 95; // NoPriority is the absence of priority. Also React-only.
  21360. var NoPriority = 90;
  21361. var shouldYield = Scheduler_shouldYield;
  21362. var requestPaint = // Fall back gracefully if we're running an older version of Scheduler.
  21363. Scheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};
  21364. var syncQueue = null;
  21365. var immediateQueueCallbackNode = null;
  21366. var isFlushingSyncQueue = false;
  21367. var initialTimeMs = Scheduler_now(); // If the initial timestamp is reasonably small, use Scheduler's `now` directly.
  21368. // This will be the case for modern browsers that support `performance.now`. In
  21369. // older browsers, Scheduler falls back to `Date.now`, which returns a Unix
  21370. // timestamp. In that case, subtract the module initialization time to simulate
  21371. // the behavior of performance.now and keep our times small enough to fit
  21372. // within 32 bits.
  21373. // TODO: Consider lifting this into Scheduler.
  21374. var now = initialTimeMs < 10000 ? Scheduler_now : function () {
  21375. return Scheduler_now() - initialTimeMs;
  21376. };
  21377. function getCurrentPriorityLevel() {
  21378. switch (Scheduler_getCurrentPriorityLevel()) {
  21379. case Scheduler_ImmediatePriority:
  21380. return ImmediatePriority;
  21381. case Scheduler_UserBlockingPriority:
  21382. return UserBlockingPriority$1;
  21383. case Scheduler_NormalPriority:
  21384. return NormalPriority;
  21385. case Scheduler_LowPriority:
  21386. return LowPriority;
  21387. case Scheduler_IdlePriority:
  21388. return IdlePriority;
  21389. default:
  21390. {
  21391. {
  21392. throw Error( "Unknown priority level." );
  21393. }
  21394. }
  21395. }
  21396. }
  21397. function reactPriorityToSchedulerPriority(reactPriorityLevel) {
  21398. switch (reactPriorityLevel) {
  21399. case ImmediatePriority:
  21400. return Scheduler_ImmediatePriority;
  21401. case UserBlockingPriority$1:
  21402. return Scheduler_UserBlockingPriority;
  21403. case NormalPriority:
  21404. return Scheduler_NormalPriority;
  21405. case LowPriority:
  21406. return Scheduler_LowPriority;
  21407. case IdlePriority:
  21408. return Scheduler_IdlePriority;
  21409. default:
  21410. {
  21411. {
  21412. throw Error( "Unknown priority level." );
  21413. }
  21414. }
  21415. }
  21416. }
  21417. function runWithPriority$1(reactPriorityLevel, fn) {
  21418. var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  21419. return Scheduler_runWithPriority(priorityLevel, fn);
  21420. }
  21421. function scheduleCallback(reactPriorityLevel, callback, options) {
  21422. var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  21423. return Scheduler_scheduleCallback(priorityLevel, callback, options);
  21424. }
  21425. function scheduleSyncCallback(callback) {
  21426. // Push this callback into an internal queue. We'll flush these either in
  21427. // the next tick, or earlier if something calls `flushSyncCallbackQueue`.
  21428. if (syncQueue === null) {
  21429. syncQueue = [callback]; // Flush the queue in the next tick, at the earliest.
  21430. immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
  21431. } else {
  21432. // Push onto existing queue. Don't need to schedule a callback because
  21433. // we already scheduled one when we created the queue.
  21434. syncQueue.push(callback);
  21435. }
  21436. return fakeCallbackNode;
  21437. }
  21438. function cancelCallback(callbackNode) {
  21439. if (callbackNode !== fakeCallbackNode) {
  21440. Scheduler_cancelCallback(callbackNode);
  21441. }
  21442. }
  21443. function flushSyncCallbackQueue() {
  21444. if (immediateQueueCallbackNode !== null) {
  21445. var node = immediateQueueCallbackNode;
  21446. immediateQueueCallbackNode = null;
  21447. Scheduler_cancelCallback(node);
  21448. }
  21449. flushSyncCallbackQueueImpl();
  21450. }
  21451. function flushSyncCallbackQueueImpl() {
  21452. if (!isFlushingSyncQueue && syncQueue !== null) {
  21453. // Prevent re-entrancy.
  21454. isFlushingSyncQueue = true;
  21455. var i = 0;
  21456. try {
  21457. var _isSync = true;
  21458. var queue = syncQueue;
  21459. runWithPriority$1(ImmediatePriority, function () {
  21460. for (; i < queue.length; i++) {
  21461. var callback = queue[i];
  21462. do {
  21463. callback = callback(_isSync);
  21464. } while (callback !== null);
  21465. }
  21466. });
  21467. syncQueue = null;
  21468. } catch (error) {
  21469. // If something throws, leave the remaining callbacks on the queue.
  21470. if (syncQueue !== null) {
  21471. syncQueue = syncQueue.slice(i + 1);
  21472. } // Resume flushing in the next tick
  21473. Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
  21474. throw error;
  21475. } finally {
  21476. isFlushingSyncQueue = false;
  21477. }
  21478. }
  21479. }
  21480. var NoMode = 0;
  21481. var StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root
  21482. // tag instead
  21483. var BlockingMode = 2;
  21484. var ConcurrentMode = 4;
  21485. var ProfileMode = 8;
  21486. // Max 31 bit integer. The max integer size in V8 for 32-bit systems.
  21487. // Math.pow(2, 30) - 1
  21488. // 0b111111111111111111111111111111
  21489. var MAX_SIGNED_31_BIT_INT = 1073741823;
  21490. var NoWork = 0; // TODO: Think of a better name for Never. The key difference with Idle is that
  21491. // Never work can be committed in an inconsistent state without tearing the UI.
  21492. // The main example is offscreen content, like a hidden subtree. So one possible
  21493. // name is Offscreen. However, it also includes dehydrated Suspense boundaries,
  21494. // which are inconsistent in the sense that they haven't finished yet, but
  21495. // aren't visibly inconsistent because the server rendered HTML matches what the
  21496. // hydrated tree would look like.
  21497. var Never = 1; // Idle is slightly higher priority than Never. It must completely finish in
  21498. // order to be consistent.
  21499. var Idle = 2; // Continuous Hydration is slightly higher than Idle and is used to increase
  21500. // priority of hover targets.
  21501. var ContinuousHydration = 3;
  21502. var Sync = MAX_SIGNED_31_BIT_INT;
  21503. var Batched = Sync - 1;
  21504. var UNIT_SIZE = 10;
  21505. var MAGIC_NUMBER_OFFSET = Batched - 1; // 1 unit of expiration time represents 10ms.
  21506. function msToExpirationTime(ms) {
  21507. // Always subtract from the offset so that we don't clash with the magic number for NoWork.
  21508. return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);
  21509. }
  21510. function expirationTimeToMs(expirationTime) {
  21511. return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;
  21512. }
  21513. function ceiling(num, precision) {
  21514. return ((num / precision | 0) + 1) * precision;
  21515. }
  21516. function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {
  21517. return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);
  21518. } // TODO: This corresponds to Scheduler's NormalPriority, not LowPriority. Update
  21519. // the names to reflect.
  21520. var LOW_PRIORITY_EXPIRATION = 5000;
  21521. var LOW_PRIORITY_BATCH_SIZE = 250;
  21522. function computeAsyncExpiration(currentTime) {
  21523. return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);
  21524. }
  21525. function computeSuspenseExpiration(currentTime, timeoutMs) {
  21526. // TODO: Should we warn if timeoutMs is lower than the normal pri expiration time?
  21527. return computeExpirationBucket(currentTime, timeoutMs, LOW_PRIORITY_BATCH_SIZE);
  21528. } // We intentionally set a higher expiration time for interactive updates in
  21529. // dev than in production.
  21530. //
  21531. // If the main thread is being blocked so long that you hit the expiration,
  21532. // it's a problem that could be solved with better scheduling.
  21533. //
  21534. // People will be more likely to notice this and fix it with the long
  21535. // expiration time in development.
  21536. //
  21537. // In production we opt for better UX at the risk of masking scheduling
  21538. // problems, by expiring fast.
  21539. var HIGH_PRIORITY_EXPIRATION = 500 ;
  21540. var HIGH_PRIORITY_BATCH_SIZE = 100;
  21541. function computeInteractiveExpiration(currentTime) {
  21542. return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);
  21543. }
  21544. function inferPriorityFromExpirationTime(currentTime, expirationTime) {
  21545. if (expirationTime === Sync) {
  21546. return ImmediatePriority;
  21547. }
  21548. if (expirationTime === Never || expirationTime === Idle) {
  21549. return IdlePriority;
  21550. }
  21551. var msUntil = expirationTimeToMs(expirationTime) - expirationTimeToMs(currentTime);
  21552. if (msUntil <= 0) {
  21553. return ImmediatePriority;
  21554. }
  21555. if (msUntil <= HIGH_PRIORITY_EXPIRATION + HIGH_PRIORITY_BATCH_SIZE) {
  21556. return UserBlockingPriority$1;
  21557. }
  21558. if (msUntil <= LOW_PRIORITY_EXPIRATION + LOW_PRIORITY_BATCH_SIZE) {
  21559. return NormalPriority;
  21560. } // TODO: Handle LowPriority
  21561. // Assume anything lower has idle priority
  21562. return IdlePriority;
  21563. }
  21564. var ReactStrictModeWarnings = {
  21565. recordUnsafeLifecycleWarnings: function (fiber, instance) {},
  21566. flushPendingUnsafeLifecycleWarnings: function () {},
  21567. recordLegacyContextWarning: function (fiber, instance) {},
  21568. flushLegacyContextWarning: function () {},
  21569. discardPendingWarnings: function () {}
  21570. };
  21571. {
  21572. var findStrictRoot = function (fiber) {
  21573. var maybeStrictRoot = null;
  21574. var node = fiber;
  21575. while (node !== null) {
  21576. if (node.mode & StrictMode) {
  21577. maybeStrictRoot = node;
  21578. }
  21579. node = node.return;
  21580. }
  21581. return maybeStrictRoot;
  21582. };
  21583. var setToSortedString = function (set) {
  21584. var array = [];
  21585. set.forEach(function (value) {
  21586. array.push(value);
  21587. });
  21588. return array.sort().join(', ');
  21589. };
  21590. var pendingComponentWillMountWarnings = [];
  21591. var pendingUNSAFE_ComponentWillMountWarnings = [];
  21592. var pendingComponentWillReceivePropsWarnings = [];
  21593. var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
  21594. var pendingComponentWillUpdateWarnings = [];
  21595. var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about.
  21596. var didWarnAboutUnsafeLifecycles = new Set();
  21597. ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {
  21598. // Dedup strategy: Warn once per component.
  21599. if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
  21600. return;
  21601. }
  21602. if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components.
  21603. instance.componentWillMount.__suppressDeprecationWarning !== true) {
  21604. pendingComponentWillMountWarnings.push(fiber);
  21605. }
  21606. if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {
  21607. pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
  21608. }
  21609. if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
  21610. pendingComponentWillReceivePropsWarnings.push(fiber);
  21611. }
  21612. if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
  21613. pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
  21614. }
  21615. if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
  21616. pendingComponentWillUpdateWarnings.push(fiber);
  21617. }
  21618. if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {
  21619. pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
  21620. }
  21621. };
  21622. ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {
  21623. // We do an initial pass to gather component names
  21624. var componentWillMountUniqueNames = new Set();
  21625. if (pendingComponentWillMountWarnings.length > 0) {
  21626. pendingComponentWillMountWarnings.forEach(function (fiber) {
  21627. componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
  21628. didWarnAboutUnsafeLifecycles.add(fiber.type);
  21629. });
  21630. pendingComponentWillMountWarnings = [];
  21631. }
  21632. var UNSAFE_componentWillMountUniqueNames = new Set();
  21633. if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
  21634. pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {
  21635. UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
  21636. didWarnAboutUnsafeLifecycles.add(fiber.type);
  21637. });
  21638. pendingUNSAFE_ComponentWillMountWarnings = [];
  21639. }
  21640. var componentWillReceivePropsUniqueNames = new Set();
  21641. if (pendingComponentWillReceivePropsWarnings.length > 0) {
  21642. pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {
  21643. componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
  21644. didWarnAboutUnsafeLifecycles.add(fiber.type);
  21645. });
  21646. pendingComponentWillReceivePropsWarnings = [];
  21647. }
  21648. var UNSAFE_componentWillReceivePropsUniqueNames = new Set();
  21649. if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
  21650. pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {
  21651. UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
  21652. didWarnAboutUnsafeLifecycles.add(fiber.type);
  21653. });
  21654. pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
  21655. }
  21656. var componentWillUpdateUniqueNames = new Set();
  21657. if (pendingComponentWillUpdateWarnings.length > 0) {
  21658. pendingComponentWillUpdateWarnings.forEach(function (fiber) {
  21659. componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
  21660. didWarnAboutUnsafeLifecycles.add(fiber.type);
  21661. });
  21662. pendingComponentWillUpdateWarnings = [];
  21663. }
  21664. var UNSAFE_componentWillUpdateUniqueNames = new Set();
  21665. if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
  21666. pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {
  21667. UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
  21668. didWarnAboutUnsafeLifecycles.add(fiber.type);
  21669. });
  21670. pendingUNSAFE_ComponentWillUpdateWarnings = [];
  21671. } // Finally, we flush all the warnings
  21672. // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'
  21673. if (UNSAFE_componentWillMountUniqueNames.size > 0) {
  21674. var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
  21675. error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '\nPlease update the following components: %s', sortedNames);
  21676. }
  21677. if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
  21678. var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
  21679. error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, " + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '\nPlease update the following components: %s', _sortedNames);
  21680. }
  21681. if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
  21682. var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
  21683. error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '\nPlease update the following components: %s', _sortedNames2);
  21684. }
  21685. if (componentWillMountUniqueNames.size > 0) {
  21686. var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
  21687. warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames3);
  21688. }
  21689. if (componentWillReceivePropsUniqueNames.size > 0) {
  21690. var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
  21691. warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, refactor your " + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames4);
  21692. }
  21693. if (componentWillUpdateUniqueNames.size > 0) {
  21694. var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
  21695. warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames5);
  21696. }
  21697. };
  21698. var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about.
  21699. var didWarnAboutLegacyContext = new Set();
  21700. ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {
  21701. var strictRoot = findStrictRoot(fiber);
  21702. if (strictRoot === null) {
  21703. error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');
  21704. return;
  21705. } // Dedup strategy: Warn once per component.
  21706. if (didWarnAboutLegacyContext.has(fiber.type)) {
  21707. return;
  21708. }
  21709. var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
  21710. if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {
  21711. if (warningsForRoot === undefined) {
  21712. warningsForRoot = [];
  21713. pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
  21714. }
  21715. warningsForRoot.push(fiber);
  21716. }
  21717. };
  21718. ReactStrictModeWarnings.flushLegacyContextWarning = function () {
  21719. pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {
  21720. if (fiberArray.length === 0) {
  21721. return;
  21722. }
  21723. var firstFiber = fiberArray[0];
  21724. var uniqueNames = new Set();
  21725. fiberArray.forEach(function (fiber) {
  21726. uniqueNames.add(getComponentName(fiber.type) || 'Component');
  21727. didWarnAboutLegacyContext.add(fiber.type);
  21728. });
  21729. var sortedNames = setToSortedString(uniqueNames);
  21730. var firstComponentStack = getStackByFiberInDevAndProd(firstFiber);
  21731. error('Legacy context API has been detected within a strict-mode tree.' + '\n\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here: https://fb.me/react-legacy-context' + '%s', sortedNames, firstComponentStack);
  21732. });
  21733. };
  21734. ReactStrictModeWarnings.discardPendingWarnings = function () {
  21735. pendingComponentWillMountWarnings = [];
  21736. pendingUNSAFE_ComponentWillMountWarnings = [];
  21737. pendingComponentWillReceivePropsWarnings = [];
  21738. pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
  21739. pendingComponentWillUpdateWarnings = [];
  21740. pendingUNSAFE_ComponentWillUpdateWarnings = [];
  21741. pendingLegacyContextWarning = new Map();
  21742. };
  21743. }
  21744. var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.
  21745. var failedBoundaries = null;
  21746. var setRefreshHandler = function (handler) {
  21747. {
  21748. resolveFamily = handler;
  21749. }
  21750. };
  21751. function resolveFunctionForHotReloading(type) {
  21752. {
  21753. if (resolveFamily === null) {
  21754. // Hot reloading is disabled.
  21755. return type;
  21756. }
  21757. var family = resolveFamily(type);
  21758. if (family === undefined) {
  21759. return type;
  21760. } // Use the latest known implementation.
  21761. return family.current;
  21762. }
  21763. }
  21764. function resolveClassForHotReloading(type) {
  21765. // No implementation differences.
  21766. return resolveFunctionForHotReloading(type);
  21767. }
  21768. function resolveForwardRefForHotReloading(type) {
  21769. {
  21770. if (resolveFamily === null) {
  21771. // Hot reloading is disabled.
  21772. return type;
  21773. }
  21774. var family = resolveFamily(type);
  21775. if (family === undefined) {
  21776. // Check if we're dealing with a real forwardRef. Don't want to crash early.
  21777. if (type !== null && type !== undefined && typeof type.render === 'function') {
  21778. // ForwardRef is special because its resolved .type is an object,
  21779. // but it's possible that we only have its inner render function in the map.
  21780. // If that inner render function is different, we'll build a new forwardRef type.
  21781. var currentRender = resolveFunctionForHotReloading(type.render);
  21782. if (type.render !== currentRender) {
  21783. var syntheticType = {
  21784. $$typeof: REACT_FORWARD_REF_TYPE,
  21785. render: currentRender
  21786. };
  21787. if (type.displayName !== undefined) {
  21788. syntheticType.displayName = type.displayName;
  21789. }
  21790. return syntheticType;
  21791. }
  21792. }
  21793. return type;
  21794. } // Use the latest known implementation.
  21795. return family.current;
  21796. }
  21797. }
  21798. function isCompatibleFamilyForHotReloading(fiber, element) {
  21799. {
  21800. if (resolveFamily === null) {
  21801. // Hot reloading is disabled.
  21802. return false;
  21803. }
  21804. var prevType = fiber.elementType;
  21805. var nextType = element.type; // If we got here, we know types aren't === equal.
  21806. var needsCompareFamilies = false;
  21807. var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;
  21808. switch (fiber.tag) {
  21809. case ClassComponent:
  21810. {
  21811. if (typeof nextType === 'function') {
  21812. needsCompareFamilies = true;
  21813. }
  21814. break;
  21815. }
  21816. case FunctionComponent:
  21817. {
  21818. if (typeof nextType === 'function') {
  21819. needsCompareFamilies = true;
  21820. } else if ($$typeofNextType === REACT_LAZY_TYPE) {
  21821. // We don't know the inner type yet.
  21822. // We're going to assume that the lazy inner type is stable,
  21823. // and so it is sufficient to avoid reconciling it away.
  21824. // We're not going to unwrap or actually use the new lazy type.
  21825. needsCompareFamilies = true;
  21826. }
  21827. break;
  21828. }
  21829. case ForwardRef:
  21830. {
  21831. if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
  21832. needsCompareFamilies = true;
  21833. } else if ($$typeofNextType === REACT_LAZY_TYPE) {
  21834. needsCompareFamilies = true;
  21835. }
  21836. break;
  21837. }
  21838. case MemoComponent:
  21839. case SimpleMemoComponent:
  21840. {
  21841. if ($$typeofNextType === REACT_MEMO_TYPE) {
  21842. // TODO: if it was but can no longer be simple,
  21843. // we shouldn't set this.
  21844. needsCompareFamilies = true;
  21845. } else if ($$typeofNextType === REACT_LAZY_TYPE) {
  21846. needsCompareFamilies = true;
  21847. }
  21848. break;
  21849. }
  21850. default:
  21851. return false;
  21852. } // Check if both types have a family and it's the same one.
  21853. if (needsCompareFamilies) {
  21854. // Note: memo() and forwardRef() we'll compare outer rather than inner type.
  21855. // This means both of them need to be registered to preserve state.
  21856. // If we unwrapped and compared the inner types for wrappers instead,
  21857. // then we would risk falsely saying two separate memo(Foo)
  21858. // calls are equivalent because they wrap the same Foo function.
  21859. var prevFamily = resolveFamily(prevType);
  21860. if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {
  21861. return true;
  21862. }
  21863. }
  21864. return false;
  21865. }
  21866. }
  21867. function markFailedErrorBoundaryForHotReloading(fiber) {
  21868. {
  21869. if (resolveFamily === null) {
  21870. // Hot reloading is disabled.
  21871. return;
  21872. }
  21873. if (typeof WeakSet !== 'function') {
  21874. return;
  21875. }
  21876. if (failedBoundaries === null) {
  21877. failedBoundaries = new WeakSet();
  21878. }
  21879. failedBoundaries.add(fiber);
  21880. }
  21881. }
  21882. var scheduleRefresh = function (root, update) {
  21883. {
  21884. if (resolveFamily === null) {
  21885. // Hot reloading is disabled.
  21886. return;
  21887. }
  21888. var staleFamilies = update.staleFamilies,
  21889. updatedFamilies = update.updatedFamilies;
  21890. flushPassiveEffects();
  21891. flushSync(function () {
  21892. scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);
  21893. });
  21894. }
  21895. };
  21896. var scheduleRoot = function (root, element) {
  21897. {
  21898. if (root.context !== emptyContextObject) {
  21899. // Super edge case: root has a legacy _renderSubtree context
  21900. // but we don't know the parentComponent so we can't pass it.
  21901. // Just ignore. We'll delete this with _renderSubtree code path later.
  21902. return;
  21903. }
  21904. flushPassiveEffects();
  21905. syncUpdates(function () {
  21906. updateContainer(element, root, null, null);
  21907. });
  21908. }
  21909. };
  21910. function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
  21911. {
  21912. var alternate = fiber.alternate,
  21913. child = fiber.child,
  21914. sibling = fiber.sibling,
  21915. tag = fiber.tag,
  21916. type = fiber.type;
  21917. var candidateType = null;
  21918. switch (tag) {
  21919. case FunctionComponent:
  21920. case SimpleMemoComponent:
  21921. case ClassComponent:
  21922. candidateType = type;
  21923. break;
  21924. case ForwardRef:
  21925. candidateType = type.render;
  21926. break;
  21927. }
  21928. if (resolveFamily === null) {
  21929. throw new Error('Expected resolveFamily to be set during hot reload.');
  21930. }
  21931. var needsRender = false;
  21932. var needsRemount = false;
  21933. if (candidateType !== null) {
  21934. var family = resolveFamily(candidateType);
  21935. if (family !== undefined) {
  21936. if (staleFamilies.has(family)) {
  21937. needsRemount = true;
  21938. } else if (updatedFamilies.has(family)) {
  21939. if (tag === ClassComponent) {
  21940. needsRemount = true;
  21941. } else {
  21942. needsRender = true;
  21943. }
  21944. }
  21945. }
  21946. }
  21947. if (failedBoundaries !== null) {
  21948. if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
  21949. needsRemount = true;
  21950. }
  21951. }
  21952. if (needsRemount) {
  21953. fiber._debugNeedsRemount = true;
  21954. }
  21955. if (needsRemount || needsRender) {
  21956. scheduleWork(fiber, Sync);
  21957. }
  21958. if (child !== null && !needsRemount) {
  21959. scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
  21960. }
  21961. if (sibling !== null) {
  21962. scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
  21963. }
  21964. }
  21965. }
  21966. var findHostInstancesForRefresh = function (root, families) {
  21967. {
  21968. var hostInstances = new Set();
  21969. var types = new Set(families.map(function (family) {
  21970. return family.current;
  21971. }));
  21972. findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);
  21973. return hostInstances;
  21974. }
  21975. };
  21976. function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
  21977. {
  21978. var child = fiber.child,
  21979. sibling = fiber.sibling,
  21980. tag = fiber.tag,
  21981. type = fiber.type;
  21982. var candidateType = null;
  21983. switch (tag) {
  21984. case FunctionComponent:
  21985. case SimpleMemoComponent:
  21986. case ClassComponent:
  21987. candidateType = type;
  21988. break;
  21989. case ForwardRef:
  21990. candidateType = type.render;
  21991. break;
  21992. }
  21993. var didMatch = false;
  21994. if (candidateType !== null) {
  21995. if (types.has(candidateType)) {
  21996. didMatch = true;
  21997. }
  21998. }
  21999. if (didMatch) {
  22000. // We have a match. This only drills down to the closest host components.
  22001. // There's no need to search deeper because for the purpose of giving
  22002. // visual feedback, "flashing" outermost parent rectangles is sufficient.
  22003. findHostInstancesForFiberShallowly(fiber, hostInstances);
  22004. } else {
  22005. // If there's no match, maybe there will be one further down in the child tree.
  22006. if (child !== null) {
  22007. findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
  22008. }
  22009. }
  22010. if (sibling !== null) {
  22011. findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
  22012. }
  22013. }
  22014. }
  22015. function findHostInstancesForFiberShallowly(fiber, hostInstances) {
  22016. {
  22017. var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
  22018. if (foundHostInstances) {
  22019. return;
  22020. } // If we didn't find any host children, fallback to closest host parent.
  22021. var node = fiber;
  22022. while (true) {
  22023. switch (node.tag) {
  22024. case HostComponent:
  22025. hostInstances.add(node.stateNode);
  22026. return;
  22027. case HostPortal:
  22028. hostInstances.add(node.stateNode.containerInfo);
  22029. return;
  22030. case HostRoot:
  22031. hostInstances.add(node.stateNode.containerInfo);
  22032. return;
  22033. }
  22034. if (node.return === null) {
  22035. throw new Error('Expected to reach root first.');
  22036. }
  22037. node = node.return;
  22038. }
  22039. }
  22040. }
  22041. function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
  22042. {
  22043. var node = fiber;
  22044. var foundHostInstances = false;
  22045. while (true) {
  22046. if (node.tag === HostComponent) {
  22047. // We got a match.
  22048. foundHostInstances = true;
  22049. hostInstances.add(node.stateNode); // There may still be more, so keep searching.
  22050. } else if (node.child !== null) {
  22051. node.child.return = node;
  22052. node = node.child;
  22053. continue;
  22054. }
  22055. if (node === fiber) {
  22056. return foundHostInstances;
  22057. }
  22058. while (node.sibling === null) {
  22059. if (node.return === null || node.return === fiber) {
  22060. return foundHostInstances;
  22061. }
  22062. node = node.return;
  22063. }
  22064. node.sibling.return = node.return;
  22065. node = node.sibling;
  22066. }
  22067. }
  22068. return false;
  22069. }
  22070. function resolveDefaultProps(Component, baseProps) {
  22071. if (Component && Component.defaultProps) {
  22072. // Resolve default props. Taken from ReactElement
  22073. var props = _assign({}, baseProps);
  22074. var defaultProps = Component.defaultProps;
  22075. for (var propName in defaultProps) {
  22076. if (props[propName] === undefined) {
  22077. props[propName] = defaultProps[propName];
  22078. }
  22079. }
  22080. return props;
  22081. }
  22082. return baseProps;
  22083. }
  22084. function readLazyComponentType(lazyComponent) {
  22085. initializeLazyComponentType(lazyComponent);
  22086. if (lazyComponent._status !== Resolved) {
  22087. throw lazyComponent._result;
  22088. }
  22089. return lazyComponent._result;
  22090. }
  22091. var valueCursor = createCursor(null);
  22092. var rendererSigil;
  22093. {
  22094. // Use this to detect multiple renderers using the same context
  22095. rendererSigil = {};
  22096. }
  22097. var currentlyRenderingFiber = null;
  22098. var lastContextDependency = null;
  22099. var lastContextWithAllBitsObserved = null;
  22100. var isDisallowedContextReadInDEV = false;
  22101. function resetContextDependencies() {
  22102. // This is called right before React yields execution, to ensure `readContext`
  22103. // cannot be called outside the render phase.
  22104. currentlyRenderingFiber = null;
  22105. lastContextDependency = null;
  22106. lastContextWithAllBitsObserved = null;
  22107. {
  22108. isDisallowedContextReadInDEV = false;
  22109. }
  22110. }
  22111. function enterDisallowedContextReadInDEV() {
  22112. {
  22113. isDisallowedContextReadInDEV = true;
  22114. }
  22115. }
  22116. function exitDisallowedContextReadInDEV() {
  22117. {
  22118. isDisallowedContextReadInDEV = false;
  22119. }
  22120. }
  22121. function pushProvider(providerFiber, nextValue) {
  22122. var context = providerFiber.type._context;
  22123. {
  22124. push(valueCursor, context._currentValue, providerFiber);
  22125. context._currentValue = nextValue;
  22126. {
  22127. if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
  22128. error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');
  22129. }
  22130. context._currentRenderer = rendererSigil;
  22131. }
  22132. }
  22133. }
  22134. function popProvider(providerFiber) {
  22135. var currentValue = valueCursor.current;
  22136. pop(valueCursor, providerFiber);
  22137. var context = providerFiber.type._context;
  22138. {
  22139. context._currentValue = currentValue;
  22140. }
  22141. }
  22142. function calculateChangedBits(context, newValue, oldValue) {
  22143. if (objectIs(oldValue, newValue)) {
  22144. // No change
  22145. return 0;
  22146. } else {
  22147. var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
  22148. {
  22149. if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {
  22150. error('calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);
  22151. }
  22152. }
  22153. return changedBits | 0;
  22154. }
  22155. }
  22156. function scheduleWorkOnParentPath(parent, renderExpirationTime) {
  22157. // Update the child expiration time of all the ancestors, including
  22158. // the alternates.
  22159. var node = parent;
  22160. while (node !== null) {
  22161. var alternate = node.alternate;
  22162. if (node.childExpirationTime < renderExpirationTime) {
  22163. node.childExpirationTime = renderExpirationTime;
  22164. if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
  22165. alternate.childExpirationTime = renderExpirationTime;
  22166. }
  22167. } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
  22168. alternate.childExpirationTime = renderExpirationTime;
  22169. } else {
  22170. // Neither alternate was updated, which means the rest of the
  22171. // ancestor path already has sufficient priority.
  22172. break;
  22173. }
  22174. node = node.return;
  22175. }
  22176. }
  22177. function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {
  22178. var fiber = workInProgress.child;
  22179. if (fiber !== null) {
  22180. // Set the return pointer of the child to the work-in-progress fiber.
  22181. fiber.return = workInProgress;
  22182. }
  22183. while (fiber !== null) {
  22184. var nextFiber = void 0; // Visit this fiber.
  22185. var list = fiber.dependencies;
  22186. if (list !== null) {
  22187. nextFiber = fiber.child;
  22188. var dependency = list.firstContext;
  22189. while (dependency !== null) {
  22190. // Check if the context matches.
  22191. if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
  22192. // Match! Schedule an update on this fiber.
  22193. if (fiber.tag === ClassComponent) {
  22194. // Schedule a force update on the work-in-progress.
  22195. var update = createUpdate(renderExpirationTime, null);
  22196. update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the
  22197. // update to the current fiber, too, which means it will persist even if
  22198. // this render is thrown away. Since it's a race condition, not sure it's
  22199. // worth fixing.
  22200. enqueueUpdate(fiber, update);
  22201. }
  22202. if (fiber.expirationTime < renderExpirationTime) {
  22203. fiber.expirationTime = renderExpirationTime;
  22204. }
  22205. var alternate = fiber.alternate;
  22206. if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
  22207. alternate.expirationTime = renderExpirationTime;
  22208. }
  22209. scheduleWorkOnParentPath(fiber.return, renderExpirationTime); // Mark the expiration time on the list, too.
  22210. if (list.expirationTime < renderExpirationTime) {
  22211. list.expirationTime = renderExpirationTime;
  22212. } // Since we already found a match, we can stop traversing the
  22213. // dependency list.
  22214. break;
  22215. }
  22216. dependency = dependency.next;
  22217. }
  22218. } else if (fiber.tag === ContextProvider) {
  22219. // Don't scan deeper if this is a matching provider
  22220. nextFiber = fiber.type === workInProgress.type ? null : fiber.child;
  22221. } else {
  22222. // Traverse down.
  22223. nextFiber = fiber.child;
  22224. }
  22225. if (nextFiber !== null) {
  22226. // Set the return pointer of the child to the work-in-progress fiber.
  22227. nextFiber.return = fiber;
  22228. } else {
  22229. // No child. Traverse to next sibling.
  22230. nextFiber = fiber;
  22231. while (nextFiber !== null) {
  22232. if (nextFiber === workInProgress) {
  22233. // We're back to the root of this subtree. Exit.
  22234. nextFiber = null;
  22235. break;
  22236. }
  22237. var sibling = nextFiber.sibling;
  22238. if (sibling !== null) {
  22239. // Set the return pointer of the sibling to the work-in-progress fiber.
  22240. sibling.return = nextFiber.return;
  22241. nextFiber = sibling;
  22242. break;
  22243. } // No more siblings. Traverse up.
  22244. nextFiber = nextFiber.return;
  22245. }
  22246. }
  22247. fiber = nextFiber;
  22248. }
  22249. }
  22250. function prepareToReadContext(workInProgress, renderExpirationTime) {
  22251. currentlyRenderingFiber = workInProgress;
  22252. lastContextDependency = null;
  22253. lastContextWithAllBitsObserved = null;
  22254. var dependencies = workInProgress.dependencies;
  22255. if (dependencies !== null) {
  22256. var firstContext = dependencies.firstContext;
  22257. if (firstContext !== null) {
  22258. if (dependencies.expirationTime >= renderExpirationTime) {
  22259. // Context list has a pending update. Mark that this fiber performed work.
  22260. markWorkInProgressReceivedUpdate();
  22261. } // Reset the work-in-progress list
  22262. dependencies.firstContext = null;
  22263. }
  22264. }
  22265. }
  22266. function readContext(context, observedBits) {
  22267. {
  22268. // This warning would fire if you read context inside a Hook like useMemo.
  22269. // Unlike the class check below, it's not enforced in production for perf.
  22270. if (isDisallowedContextReadInDEV) {
  22271. error('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().');
  22272. }
  22273. }
  22274. if (lastContextWithAllBitsObserved === context) ; else if (observedBits === false || observedBits === 0) ; else {
  22275. var resolvedObservedBits; // Avoid deopting on observable arguments or heterogeneous types.
  22276. if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {
  22277. // Observe all updates.
  22278. lastContextWithAllBitsObserved = context;
  22279. resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
  22280. } else {
  22281. resolvedObservedBits = observedBits;
  22282. }
  22283. var contextItem = {
  22284. context: context,
  22285. observedBits: resolvedObservedBits,
  22286. next: null
  22287. };
  22288. if (lastContextDependency === null) {
  22289. if (!(currentlyRenderingFiber !== null)) {
  22290. {
  22291. throw Error( "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()." );
  22292. }
  22293. } // This is the first dependency for this component. Create a new list.
  22294. lastContextDependency = contextItem;
  22295. currentlyRenderingFiber.dependencies = {
  22296. expirationTime: NoWork,
  22297. firstContext: contextItem,
  22298. responders: null
  22299. };
  22300. } else {
  22301. // Append a new context item.
  22302. lastContextDependency = lastContextDependency.next = contextItem;
  22303. }
  22304. }
  22305. return context._currentValue ;
  22306. }
  22307. var UpdateState = 0;
  22308. var ReplaceState = 1;
  22309. var ForceUpdate = 2;
  22310. var CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`.
  22311. // It should only be read right after calling `processUpdateQueue`, via
  22312. // `checkHasForceUpdateAfterProcessing`.
  22313. var hasForceUpdate = false;
  22314. var didWarnUpdateInsideUpdate;
  22315. var currentlyProcessingQueue;
  22316. {
  22317. didWarnUpdateInsideUpdate = false;
  22318. currentlyProcessingQueue = null;
  22319. }
  22320. function initializeUpdateQueue(fiber) {
  22321. var queue = {
  22322. baseState: fiber.memoizedState,
  22323. baseQueue: null,
  22324. shared: {
  22325. pending: null
  22326. },
  22327. effects: null
  22328. };
  22329. fiber.updateQueue = queue;
  22330. }
  22331. function cloneUpdateQueue(current, workInProgress) {
  22332. // Clone the update queue from current. Unless it's already a clone.
  22333. var queue = workInProgress.updateQueue;
  22334. var currentQueue = current.updateQueue;
  22335. if (queue === currentQueue) {
  22336. var clone = {
  22337. baseState: currentQueue.baseState,
  22338. baseQueue: currentQueue.baseQueue,
  22339. shared: currentQueue.shared,
  22340. effects: currentQueue.effects
  22341. };
  22342. workInProgress.updateQueue = clone;
  22343. }
  22344. }
  22345. function createUpdate(expirationTime, suspenseConfig) {
  22346. var update = {
  22347. expirationTime: expirationTime,
  22348. suspenseConfig: suspenseConfig,
  22349. tag: UpdateState,
  22350. payload: null,
  22351. callback: null,
  22352. next: null
  22353. };
  22354. update.next = update;
  22355. {
  22356. update.priority = getCurrentPriorityLevel();
  22357. }
  22358. return update;
  22359. }
  22360. function enqueueUpdate(fiber, update) {
  22361. var updateQueue = fiber.updateQueue;
  22362. if (updateQueue === null) {
  22363. // Only occurs if the fiber has been unmounted.
  22364. return;
  22365. }
  22366. var sharedQueue = updateQueue.shared;
  22367. var pending = sharedQueue.pending;
  22368. if (pending === null) {
  22369. // This is the first update. Create a circular list.
  22370. update.next = update;
  22371. } else {
  22372. update.next = pending.next;
  22373. pending.next = update;
  22374. }
  22375. sharedQueue.pending = update;
  22376. {
  22377. if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
  22378. error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');
  22379. didWarnUpdateInsideUpdate = true;
  22380. }
  22381. }
  22382. }
  22383. function enqueueCapturedUpdate(workInProgress, update) {
  22384. var current = workInProgress.alternate;
  22385. if (current !== null) {
  22386. // Ensure the work-in-progress queue is a clone
  22387. cloneUpdateQueue(current, workInProgress);
  22388. } // Captured updates go only on the work-in-progress queue.
  22389. var queue = workInProgress.updateQueue; // Append the update to the end of the list.
  22390. var last = queue.baseQueue;
  22391. if (last === null) {
  22392. queue.baseQueue = update.next = update;
  22393. update.next = update;
  22394. } else {
  22395. update.next = last.next;
  22396. last.next = update;
  22397. }
  22398. }
  22399. function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
  22400. switch (update.tag) {
  22401. case ReplaceState:
  22402. {
  22403. var payload = update.payload;
  22404. if (typeof payload === 'function') {
  22405. // Updater function
  22406. {
  22407. enterDisallowedContextReadInDEV();
  22408. if ( workInProgress.mode & StrictMode) {
  22409. payload.call(instance, prevState, nextProps);
  22410. }
  22411. }
  22412. var nextState = payload.call(instance, prevState, nextProps);
  22413. {
  22414. exitDisallowedContextReadInDEV();
  22415. }
  22416. return nextState;
  22417. } // State object
  22418. return payload;
  22419. }
  22420. case CaptureUpdate:
  22421. {
  22422. workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture;
  22423. }
  22424. // Intentional fallthrough
  22425. case UpdateState:
  22426. {
  22427. var _payload = update.payload;
  22428. var partialState;
  22429. if (typeof _payload === 'function') {
  22430. // Updater function
  22431. {
  22432. enterDisallowedContextReadInDEV();
  22433. if ( workInProgress.mode & StrictMode) {
  22434. _payload.call(instance, prevState, nextProps);
  22435. }
  22436. }
  22437. partialState = _payload.call(instance, prevState, nextProps);
  22438. {
  22439. exitDisallowedContextReadInDEV();
  22440. }
  22441. } else {
  22442. // Partial state object
  22443. partialState = _payload;
  22444. }
  22445. if (partialState === null || partialState === undefined) {
  22446. // Null and undefined are treated as no-ops.
  22447. return prevState;
  22448. } // Merge the partial state and the previous state.
  22449. return _assign({}, prevState, partialState);
  22450. }
  22451. case ForceUpdate:
  22452. {
  22453. hasForceUpdate = true;
  22454. return prevState;
  22455. }
  22456. }
  22457. return prevState;
  22458. }
  22459. function processUpdateQueue(workInProgress, props, instance, renderExpirationTime) {
  22460. // This is always non-null on a ClassComponent or HostRoot
  22461. var queue = workInProgress.updateQueue;
  22462. hasForceUpdate = false;
  22463. {
  22464. currentlyProcessingQueue = queue.shared;
  22465. } // The last rebase update that is NOT part of the base state.
  22466. var baseQueue = queue.baseQueue; // The last pending update that hasn't been processed yet.
  22467. var pendingQueue = queue.shared.pending;
  22468. if (pendingQueue !== null) {
  22469. // We have new updates that haven't been processed yet.
  22470. // We'll add them to the base queue.
  22471. if (baseQueue !== null) {
  22472. // Merge the pending queue and the base queue.
  22473. var baseFirst = baseQueue.next;
  22474. var pendingFirst = pendingQueue.next;
  22475. baseQueue.next = pendingFirst;
  22476. pendingQueue.next = baseFirst;
  22477. }
  22478. baseQueue = pendingQueue;
  22479. queue.shared.pending = null; // TODO: Pass `current` as argument
  22480. var current = workInProgress.alternate;
  22481. if (current !== null) {
  22482. var currentQueue = current.updateQueue;
  22483. if (currentQueue !== null) {
  22484. currentQueue.baseQueue = pendingQueue;
  22485. }
  22486. }
  22487. } // These values may change as we process the queue.
  22488. if (baseQueue !== null) {
  22489. var first = baseQueue.next; // Iterate through the list of updates to compute the result.
  22490. var newState = queue.baseState;
  22491. var newExpirationTime = NoWork;
  22492. var newBaseState = null;
  22493. var newBaseQueueFirst = null;
  22494. var newBaseQueueLast = null;
  22495. if (first !== null) {
  22496. var update = first;
  22497. do {
  22498. var updateExpirationTime = update.expirationTime;
  22499. if (updateExpirationTime < renderExpirationTime) {
  22500. // Priority is insufficient. Skip this update. If this is the first
  22501. // skipped update, the previous update/state is the new base
  22502. // update/state.
  22503. var clone = {
  22504. expirationTime: update.expirationTime,
  22505. suspenseConfig: update.suspenseConfig,
  22506. tag: update.tag,
  22507. payload: update.payload,
  22508. callback: update.callback,
  22509. next: null
  22510. };
  22511. if (newBaseQueueLast === null) {
  22512. newBaseQueueFirst = newBaseQueueLast = clone;
  22513. newBaseState = newState;
  22514. } else {
  22515. newBaseQueueLast = newBaseQueueLast.next = clone;
  22516. } // Update the remaining priority in the queue.
  22517. if (updateExpirationTime > newExpirationTime) {
  22518. newExpirationTime = updateExpirationTime;
  22519. }
  22520. } else {
  22521. // This update does have sufficient priority.
  22522. if (newBaseQueueLast !== null) {
  22523. var _clone = {
  22524. expirationTime: Sync,
  22525. // This update is going to be committed so we never want uncommit it.
  22526. suspenseConfig: update.suspenseConfig,
  22527. tag: update.tag,
  22528. payload: update.payload,
  22529. callback: update.callback,
  22530. next: null
  22531. };
  22532. newBaseQueueLast = newBaseQueueLast.next = _clone;
  22533. } // Mark the event time of this update as relevant to this render pass.
  22534. // TODO: This should ideally use the true event time of this update rather than
  22535. // its priority which is a derived and not reverseable value.
  22536. // TODO: We should skip this update if it was already committed but currently
  22537. // we have no way of detecting the difference between a committed and suspended
  22538. // update here.
  22539. markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process this update.
  22540. newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance);
  22541. var callback = update.callback;
  22542. if (callback !== null) {
  22543. workInProgress.effectTag |= Callback;
  22544. var effects = queue.effects;
  22545. if (effects === null) {
  22546. queue.effects = [update];
  22547. } else {
  22548. effects.push(update);
  22549. }
  22550. }
  22551. }
  22552. update = update.next;
  22553. if (update === null || update === first) {
  22554. pendingQueue = queue.shared.pending;
  22555. if (pendingQueue === null) {
  22556. break;
  22557. } else {
  22558. // An update was scheduled from inside a reducer. Add the new
  22559. // pending updates to the end of the list and keep processing.
  22560. update = baseQueue.next = pendingQueue.next;
  22561. pendingQueue.next = first;
  22562. queue.baseQueue = baseQueue = pendingQueue;
  22563. queue.shared.pending = null;
  22564. }
  22565. }
  22566. } while (true);
  22567. }
  22568. if (newBaseQueueLast === null) {
  22569. newBaseState = newState;
  22570. } else {
  22571. newBaseQueueLast.next = newBaseQueueFirst;
  22572. }
  22573. queue.baseState = newBaseState;
  22574. queue.baseQueue = newBaseQueueLast; // Set the remaining expiration time to be whatever is remaining in the queue.
  22575. // This should be fine because the only two other things that contribute to
  22576. // expiration time are props and context. We're already in the middle of the
  22577. // begin phase by the time we start processing the queue, so we've already
  22578. // dealt with the props. Context in components that specify
  22579. // shouldComponentUpdate is tricky; but we'll have to account for
  22580. // that regardless.
  22581. markUnprocessedUpdateTime(newExpirationTime);
  22582. workInProgress.expirationTime = newExpirationTime;
  22583. workInProgress.memoizedState = newState;
  22584. }
  22585. {
  22586. currentlyProcessingQueue = null;
  22587. }
  22588. }
  22589. function callCallback(callback, context) {
  22590. if (!(typeof callback === 'function')) {
  22591. {
  22592. throw Error( "Invalid argument passed as callback. Expected a function. Instead received: " + callback );
  22593. }
  22594. }
  22595. callback.call(context);
  22596. }
  22597. function resetHasForceUpdateBeforeProcessing() {
  22598. hasForceUpdate = false;
  22599. }
  22600. function checkHasForceUpdateAfterProcessing() {
  22601. return hasForceUpdate;
  22602. }
  22603. function commitUpdateQueue(finishedWork, finishedQueue, instance) {
  22604. // Commit the effects
  22605. var effects = finishedQueue.effects;
  22606. finishedQueue.effects = null;
  22607. if (effects !== null) {
  22608. for (var i = 0; i < effects.length; i++) {
  22609. var effect = effects[i];
  22610. var callback = effect.callback;
  22611. if (callback !== null) {
  22612. effect.callback = null;
  22613. callCallback(callback, instance);
  22614. }
  22615. }
  22616. }
  22617. }
  22618. var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
  22619. function requestCurrentSuspenseConfig() {
  22620. return ReactCurrentBatchConfig.suspense;
  22621. }
  22622. var fakeInternalInstance = {};
  22623. var isArray = Array.isArray; // React.Component uses a shared frozen object by default.
  22624. // We'll use it to determine whether we need to initialize legacy refs.
  22625. var emptyRefsObject = new React.Component().refs;
  22626. var didWarnAboutStateAssignmentForComponent;
  22627. var didWarnAboutUninitializedState;
  22628. var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
  22629. var didWarnAboutLegacyLifecyclesAndDerivedState;
  22630. var didWarnAboutUndefinedDerivedState;
  22631. var warnOnUndefinedDerivedState;
  22632. var warnOnInvalidCallback;
  22633. var didWarnAboutDirectlyAssigningPropsToState;
  22634. var didWarnAboutContextTypeAndContextTypes;
  22635. var didWarnAboutInvalidateContextType;
  22636. {
  22637. didWarnAboutStateAssignmentForComponent = new Set();
  22638. didWarnAboutUninitializedState = new Set();
  22639. didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
  22640. didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
  22641. didWarnAboutDirectlyAssigningPropsToState = new Set();
  22642. didWarnAboutUndefinedDerivedState = new Set();
  22643. didWarnAboutContextTypeAndContextTypes = new Set();
  22644. didWarnAboutInvalidateContextType = new Set();
  22645. var didWarnOnInvalidCallback = new Set();
  22646. warnOnInvalidCallback = function (callback, callerName) {
  22647. if (callback === null || typeof callback === 'function') {
  22648. return;
  22649. }
  22650. var key = callerName + "_" + callback;
  22651. if (!didWarnOnInvalidCallback.has(key)) {
  22652. didWarnOnInvalidCallback.add(key);
  22653. error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
  22654. }
  22655. };
  22656. warnOnUndefinedDerivedState = function (type, partialState) {
  22657. if (partialState === undefined) {
  22658. var componentName = getComponentName(type) || 'Component';
  22659. if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
  22660. didWarnAboutUndefinedDerivedState.add(componentName);
  22661. error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);
  22662. }
  22663. }
  22664. }; // This is so gross but it's at least non-critical and can be removed if
  22665. // it causes problems. This is meant to give a nicer error message for
  22666. // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,
  22667. // ...)) which otherwise throws a "_processChildContext is not a function"
  22668. // exception.
  22669. Object.defineProperty(fakeInternalInstance, '_processChildContext', {
  22670. enumerable: false,
  22671. value: function () {
  22672. {
  22673. {
  22674. throw Error( "_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal)." );
  22675. }
  22676. }
  22677. }
  22678. });
  22679. Object.freeze(fakeInternalInstance);
  22680. }
  22681. function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {
  22682. var prevState = workInProgress.memoizedState;
  22683. {
  22684. if ( workInProgress.mode & StrictMode) {
  22685. // Invoke the function an extra time to help detect side-effects.
  22686. getDerivedStateFromProps(nextProps, prevState);
  22687. }
  22688. }
  22689. var partialState = getDerivedStateFromProps(nextProps, prevState);
  22690. {
  22691. warnOnUndefinedDerivedState(ctor, partialState);
  22692. } // Merge the partial state and the previous state.
  22693. var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);
  22694. workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the
  22695. // base state.
  22696. if (workInProgress.expirationTime === NoWork) {
  22697. // Queue is always non-null for classes
  22698. var updateQueue = workInProgress.updateQueue;
  22699. updateQueue.baseState = memoizedState;
  22700. }
  22701. }
  22702. var classComponentUpdater = {
  22703. isMounted: isMounted,
  22704. enqueueSetState: function (inst, payload, callback) {
  22705. var fiber = get(inst);
  22706. var currentTime = requestCurrentTimeForUpdate();
  22707. var suspenseConfig = requestCurrentSuspenseConfig();
  22708. var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
  22709. var update = createUpdate(expirationTime, suspenseConfig);
  22710. update.payload = payload;
  22711. if (callback !== undefined && callback !== null) {
  22712. {
  22713. warnOnInvalidCallback(callback, 'setState');
  22714. }
  22715. update.callback = callback;
  22716. }
  22717. enqueueUpdate(fiber, update);
  22718. scheduleWork(fiber, expirationTime);
  22719. },
  22720. enqueueReplaceState: function (inst, payload, callback) {
  22721. var fiber = get(inst);
  22722. var currentTime = requestCurrentTimeForUpdate();
  22723. var suspenseConfig = requestCurrentSuspenseConfig();
  22724. var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
  22725. var update = createUpdate(expirationTime, suspenseConfig);
  22726. update.tag = ReplaceState;
  22727. update.payload = payload;
  22728. if (callback !== undefined && callback !== null) {
  22729. {
  22730. warnOnInvalidCallback(callback, 'replaceState');
  22731. }
  22732. update.callback = callback;
  22733. }
  22734. enqueueUpdate(fiber, update);
  22735. scheduleWork(fiber, expirationTime);
  22736. },
  22737. enqueueForceUpdate: function (inst, callback) {
  22738. var fiber = get(inst);
  22739. var currentTime = requestCurrentTimeForUpdate();
  22740. var suspenseConfig = requestCurrentSuspenseConfig();
  22741. var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
  22742. var update = createUpdate(expirationTime, suspenseConfig);
  22743. update.tag = ForceUpdate;
  22744. if (callback !== undefined && callback !== null) {
  22745. {
  22746. warnOnInvalidCallback(callback, 'forceUpdate');
  22747. }
  22748. update.callback = callback;
  22749. }
  22750. enqueueUpdate(fiber, update);
  22751. scheduleWork(fiber, expirationTime);
  22752. }
  22753. };
  22754. function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {
  22755. var instance = workInProgress.stateNode;
  22756. if (typeof instance.shouldComponentUpdate === 'function') {
  22757. {
  22758. if ( workInProgress.mode & StrictMode) {
  22759. // Invoke the function an extra time to help detect side-effects.
  22760. instance.shouldComponentUpdate(newProps, newState, nextContext);
  22761. }
  22762. }
  22763. startPhaseTimer(workInProgress, 'shouldComponentUpdate');
  22764. var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
  22765. stopPhaseTimer();
  22766. {
  22767. if (shouldUpdate === undefined) {
  22768. error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component');
  22769. }
  22770. }
  22771. return shouldUpdate;
  22772. }
  22773. if (ctor.prototype && ctor.prototype.isPureReactComponent) {
  22774. return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
  22775. }
  22776. return true;
  22777. }
  22778. function checkClassInstance(workInProgress, ctor, newProps) {
  22779. var instance = workInProgress.stateNode;
  22780. {
  22781. var name = getComponentName(ctor) || 'Component';
  22782. var renderPresent = instance.render;
  22783. if (!renderPresent) {
  22784. if (ctor.prototype && typeof ctor.prototype.render === 'function') {
  22785. error('%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);
  22786. } else {
  22787. error('%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);
  22788. }
  22789. }
  22790. if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
  22791. error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name);
  22792. }
  22793. if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
  22794. error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name);
  22795. }
  22796. if (instance.propTypes) {
  22797. error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);
  22798. }
  22799. if (instance.contextType) {
  22800. error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name);
  22801. }
  22802. {
  22803. if (instance.contextTypes) {
  22804. error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);
  22805. }
  22806. if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
  22807. didWarnAboutContextTypeAndContextTypes.add(ctor);
  22808. error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);
  22809. }
  22810. }
  22811. if (typeof instance.componentShouldUpdate === 'function') {
  22812. error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name);
  22813. }
  22814. if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
  22815. error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');
  22816. }
  22817. if (typeof instance.componentDidUnmount === 'function') {
  22818. error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);
  22819. }
  22820. if (typeof instance.componentDidReceiveProps === 'function') {
  22821. error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);
  22822. }
  22823. if (typeof instance.componentWillRecieveProps === 'function') {
  22824. error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);
  22825. }
  22826. if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') {
  22827. error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name);
  22828. }
  22829. var hasMutatedProps = instance.props !== newProps;
  22830. if (instance.props !== undefined && hasMutatedProps) {
  22831. error('%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name);
  22832. }
  22833. if (instance.defaultProps) {
  22834. error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name);
  22835. }
  22836. if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
  22837. didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
  22838. error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));
  22839. }
  22840. if (typeof instance.getDerivedStateFromProps === 'function') {
  22841. error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);
  22842. }
  22843. if (typeof instance.getDerivedStateFromError === 'function') {
  22844. error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);
  22845. }
  22846. if (typeof ctor.getSnapshotBeforeUpdate === 'function') {
  22847. error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name);
  22848. }
  22849. var _state = instance.state;
  22850. if (_state && (typeof _state !== 'object' || isArray(_state))) {
  22851. error('%s.state: must be set to an object or null', name);
  22852. }
  22853. if (typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object') {
  22854. error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name);
  22855. }
  22856. }
  22857. }
  22858. function adoptClassInstance(workInProgress, instance) {
  22859. instance.updater = classComponentUpdater;
  22860. workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates
  22861. set(instance, workInProgress);
  22862. {
  22863. instance._reactInternalInstance = fakeInternalInstance;
  22864. }
  22865. }
  22866. function constructClassInstance(workInProgress, ctor, props) {
  22867. var isLegacyContextConsumer = false;
  22868. var unmaskedContext = emptyContextObject;
  22869. var context = emptyContextObject;
  22870. var contextType = ctor.contextType;
  22871. {
  22872. if ('contextType' in ctor) {
  22873. var isValid = // Allow null for conditional declaration
  22874. contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>
  22875. if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
  22876. didWarnAboutInvalidateContextType.add(ctor);
  22877. var addendum = '';
  22878. if (contextType === undefined) {
  22879. addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
  22880. } else if (typeof contextType !== 'object') {
  22881. addendum = ' However, it is set to a ' + typeof contextType + '.';
  22882. } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
  22883. addendum = ' Did you accidentally pass the Context.Provider instead?';
  22884. } else if (contextType._context !== undefined) {
  22885. // <Context.Consumer>
  22886. addendum = ' Did you accidentally pass the Context.Consumer instead?';
  22887. } else {
  22888. addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
  22889. }
  22890. error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);
  22891. }
  22892. }
  22893. }
  22894. if (typeof contextType === 'object' && contextType !== null) {
  22895. context = readContext(contextType);
  22896. } else {
  22897. unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
  22898. var contextTypes = ctor.contextTypes;
  22899. isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;
  22900. context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;
  22901. } // Instantiate twice to help detect side-effects.
  22902. {
  22903. if ( workInProgress.mode & StrictMode) {
  22904. new ctor(props, context); // eslint-disable-line no-new
  22905. }
  22906. }
  22907. var instance = new ctor(props, context);
  22908. var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;
  22909. adoptClassInstance(workInProgress, instance);
  22910. {
  22911. if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {
  22912. var componentName = getComponentName(ctor) || 'Component';
  22913. if (!didWarnAboutUninitializedState.has(componentName)) {
  22914. didWarnAboutUninitializedState.add(componentName);
  22915. error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);
  22916. }
  22917. } // If new component APIs are defined, "unsafe" lifecycles won't be called.
  22918. // Warn about these lifecycles if they are present.
  22919. // Don't warn about react-lifecycles-compat polyfilled methods though.
  22920. if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {
  22921. var foundWillMountName = null;
  22922. var foundWillReceivePropsName = null;
  22923. var foundWillUpdateName = null;
  22924. if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
  22925. foundWillMountName = 'componentWillMount';
  22926. } else if (typeof instance.UNSAFE_componentWillMount === 'function') {
  22927. foundWillMountName = 'UNSAFE_componentWillMount';
  22928. }
  22929. if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
  22930. foundWillReceivePropsName = 'componentWillReceiveProps';
  22931. } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
  22932. foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
  22933. }
  22934. if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
  22935. foundWillUpdateName = 'componentWillUpdate';
  22936. } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
  22937. foundWillUpdateName = 'UNSAFE_componentWillUpdate';
  22938. }
  22939. if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
  22940. var _componentName = getComponentName(ctor) || 'Component';
  22941. var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
  22942. if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
  22943. didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
  22944. error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : '', foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : '', foundWillUpdateName !== null ? "\n " + foundWillUpdateName : '');
  22945. }
  22946. }
  22947. }
  22948. } // Cache unmasked context so we can avoid recreating masked context unless necessary.
  22949. // ReactFiberContext usually updates this cache but can't for newly-created instances.
  22950. if (isLegacyContextConsumer) {
  22951. cacheContext(workInProgress, unmaskedContext, context);
  22952. }
  22953. return instance;
  22954. }
  22955. function callComponentWillMount(workInProgress, instance) {
  22956. startPhaseTimer(workInProgress, 'componentWillMount');
  22957. var oldState = instance.state;
  22958. if (typeof instance.componentWillMount === 'function') {
  22959. instance.componentWillMount();
  22960. }
  22961. if (typeof instance.UNSAFE_componentWillMount === 'function') {
  22962. instance.UNSAFE_componentWillMount();
  22963. }
  22964. stopPhaseTimer();
  22965. if (oldState !== instance.state) {
  22966. {
  22967. error('%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
  22968. }
  22969. classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  22970. }
  22971. }
  22972. function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
  22973. var oldState = instance.state;
  22974. startPhaseTimer(workInProgress, 'componentWillReceiveProps');
  22975. if (typeof instance.componentWillReceiveProps === 'function') {
  22976. instance.componentWillReceiveProps(newProps, nextContext);
  22977. }
  22978. if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
  22979. instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
  22980. }
  22981. stopPhaseTimer();
  22982. if (instance.state !== oldState) {
  22983. {
  22984. var componentName = getComponentName(workInProgress.type) || 'Component';
  22985. if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
  22986. didWarnAboutStateAssignmentForComponent.add(componentName);
  22987. error('%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
  22988. }
  22989. }
  22990. classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  22991. }
  22992. } // Invokes the mount life-cycles on a previously never rendered instance.
  22993. function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
  22994. {
  22995. checkClassInstance(workInProgress, ctor, newProps);
  22996. }
  22997. var instance = workInProgress.stateNode;
  22998. instance.props = newProps;
  22999. instance.state = workInProgress.memoizedState;
  23000. instance.refs = emptyRefsObject;
  23001. initializeUpdateQueue(workInProgress);
  23002. var contextType = ctor.contextType;
  23003. if (typeof contextType === 'object' && contextType !== null) {
  23004. instance.context = readContext(contextType);
  23005. } else {
  23006. var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
  23007. instance.context = getMaskedContext(workInProgress, unmaskedContext);
  23008. }
  23009. {
  23010. if (instance.state === newProps) {
  23011. var componentName = getComponentName(ctor) || 'Component';
  23012. if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
  23013. didWarnAboutDirectlyAssigningPropsToState.add(componentName);
  23014. error('%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName);
  23015. }
  23016. }
  23017. if (workInProgress.mode & StrictMode) {
  23018. ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);
  23019. }
  23020. {
  23021. ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
  23022. }
  23023. }
  23024. processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);
  23025. instance.state = workInProgress.memoizedState;
  23026. var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  23027. if (typeof getDerivedStateFromProps === 'function') {
  23028. applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
  23029. instance.state = workInProgress.memoizedState;
  23030. } // In order to support react-lifecycles-compat polyfilled components,
  23031. // Unsafe lifecycles should not be invoked for components using the new APIs.
  23032. if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
  23033. callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's
  23034. // process them now.
  23035. processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);
  23036. instance.state = workInProgress.memoizedState;
  23037. }
  23038. if (typeof instance.componentDidMount === 'function') {
  23039. workInProgress.effectTag |= Update;
  23040. }
  23041. }
  23042. function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
  23043. var instance = workInProgress.stateNode;
  23044. var oldProps = workInProgress.memoizedProps;
  23045. instance.props = oldProps;
  23046. var oldContext = instance.context;
  23047. var contextType = ctor.contextType;
  23048. var nextContext = emptyContextObject;
  23049. if (typeof contextType === 'object' && contextType !== null) {
  23050. nextContext = readContext(contextType);
  23051. } else {
  23052. var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
  23053. nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);
  23054. }
  23055. var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  23056. var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
  23057. // ever the previously attempted to render - not the "current". However,
  23058. // during componentDidUpdate we pass the "current" props.
  23059. // In order to support react-lifecycles-compat polyfilled components,
  23060. // Unsafe lifecycles should not be invoked for components using the new APIs.
  23061. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
  23062. if (oldProps !== newProps || oldContext !== nextContext) {
  23063. callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
  23064. }
  23065. }
  23066. resetHasForceUpdateBeforeProcessing();
  23067. var oldState = workInProgress.memoizedState;
  23068. var newState = instance.state = oldState;
  23069. processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);
  23070. newState = workInProgress.memoizedState;
  23071. if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
  23072. // If an update was already in progress, we should schedule an Update
  23073. // effect even though we're bailing out, so that cWU/cDU are called.
  23074. if (typeof instance.componentDidMount === 'function') {
  23075. workInProgress.effectTag |= Update;
  23076. }
  23077. return false;
  23078. }
  23079. if (typeof getDerivedStateFromProps === 'function') {
  23080. applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
  23081. newState = workInProgress.memoizedState;
  23082. }
  23083. var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
  23084. if (shouldUpdate) {
  23085. // In order to support react-lifecycles-compat polyfilled components,
  23086. // Unsafe lifecycles should not be invoked for components using the new APIs.
  23087. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
  23088. startPhaseTimer(workInProgress, 'componentWillMount');
  23089. if (typeof instance.componentWillMount === 'function') {
  23090. instance.componentWillMount();
  23091. }
  23092. if (typeof instance.UNSAFE_componentWillMount === 'function') {
  23093. instance.UNSAFE_componentWillMount();
  23094. }
  23095. stopPhaseTimer();
  23096. }
  23097. if (typeof instance.componentDidMount === 'function') {
  23098. workInProgress.effectTag |= Update;
  23099. }
  23100. } else {
  23101. // If an update was already in progress, we should schedule an Update
  23102. // effect even though we're bailing out, so that cWU/cDU are called.
  23103. if (typeof instance.componentDidMount === 'function') {
  23104. workInProgress.effectTag |= Update;
  23105. } // If shouldComponentUpdate returned false, we should still update the
  23106. // memoized state to indicate that this work can be reused.
  23107. workInProgress.memoizedProps = newProps;
  23108. workInProgress.memoizedState = newState;
  23109. } // Update the existing instance's state, props, and context pointers even
  23110. // if shouldComponentUpdate returns false.
  23111. instance.props = newProps;
  23112. instance.state = newState;
  23113. instance.context = nextContext;
  23114. return shouldUpdate;
  23115. } // Invokes the update life-cycles and returns false if it shouldn't rerender.
  23116. function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {
  23117. var instance = workInProgress.stateNode;
  23118. cloneUpdateQueue(current, workInProgress);
  23119. var oldProps = workInProgress.memoizedProps;
  23120. instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);
  23121. var oldContext = instance.context;
  23122. var contextType = ctor.contextType;
  23123. var nextContext = emptyContextObject;
  23124. if (typeof contextType === 'object' && contextType !== null) {
  23125. nextContext = readContext(contextType);
  23126. } else {
  23127. var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
  23128. nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
  23129. }
  23130. var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  23131. var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
  23132. // ever the previously attempted to render - not the "current". However,
  23133. // during componentDidUpdate we pass the "current" props.
  23134. // In order to support react-lifecycles-compat polyfilled components,
  23135. // Unsafe lifecycles should not be invoked for components using the new APIs.
  23136. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
  23137. if (oldProps !== newProps || oldContext !== nextContext) {
  23138. callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
  23139. }
  23140. }
  23141. resetHasForceUpdateBeforeProcessing();
  23142. var oldState = workInProgress.memoizedState;
  23143. var newState = instance.state = oldState;
  23144. processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);
  23145. newState = workInProgress.memoizedState;
  23146. if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
  23147. // If an update was already in progress, we should schedule an Update
  23148. // effect even though we're bailing out, so that cWU/cDU are called.
  23149. if (typeof instance.componentDidUpdate === 'function') {
  23150. if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
  23151. workInProgress.effectTag |= Update;
  23152. }
  23153. }
  23154. if (typeof instance.getSnapshotBeforeUpdate === 'function') {
  23155. if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
  23156. workInProgress.effectTag |= Snapshot;
  23157. }
  23158. }
  23159. return false;
  23160. }
  23161. if (typeof getDerivedStateFromProps === 'function') {
  23162. applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
  23163. newState = workInProgress.memoizedState;
  23164. }
  23165. var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
  23166. if (shouldUpdate) {
  23167. // In order to support react-lifecycles-compat polyfilled components,
  23168. // Unsafe lifecycles should not be invoked for components using the new APIs.
  23169. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {
  23170. startPhaseTimer(workInProgress, 'componentWillUpdate');
  23171. if (typeof instance.componentWillUpdate === 'function') {
  23172. instance.componentWillUpdate(newProps, newState, nextContext);
  23173. }
  23174. if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
  23175. instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
  23176. }
  23177. stopPhaseTimer();
  23178. }
  23179. if (typeof instance.componentDidUpdate === 'function') {
  23180. workInProgress.effectTag |= Update;
  23181. }
  23182. if (typeof instance.getSnapshotBeforeUpdate === 'function') {
  23183. workInProgress.effectTag |= Snapshot;
  23184. }
  23185. } else {
  23186. // If an update was already in progress, we should schedule an Update
  23187. // effect even though we're bailing out, so that cWU/cDU are called.
  23188. if (typeof instance.componentDidUpdate === 'function') {
  23189. if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
  23190. workInProgress.effectTag |= Update;
  23191. }
  23192. }
  23193. if (typeof instance.getSnapshotBeforeUpdate === 'function') {
  23194. if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
  23195. workInProgress.effectTag |= Snapshot;
  23196. }
  23197. } // If shouldComponentUpdate returned false, we should still update the
  23198. // memoized props/state to indicate that this work can be reused.
  23199. workInProgress.memoizedProps = newProps;
  23200. workInProgress.memoizedState = newState;
  23201. } // Update the existing instance's state, props, and context pointers even
  23202. // if shouldComponentUpdate returns false.
  23203. instance.props = newProps;
  23204. instance.state = newState;
  23205. instance.context = nextContext;
  23206. return shouldUpdate;
  23207. }
  23208. var didWarnAboutMaps;
  23209. var didWarnAboutGenerators;
  23210. var didWarnAboutStringRefs;
  23211. var ownerHasKeyUseWarning;
  23212. var ownerHasFunctionTypeWarning;
  23213. var warnForMissingKey = function (child) {};
  23214. {
  23215. didWarnAboutMaps = false;
  23216. didWarnAboutGenerators = false;
  23217. didWarnAboutStringRefs = {};
  23218. /**
  23219. * Warn if there's no key explicitly set on dynamic arrays of children or
  23220. * object keys are not valid. This allows us to keep track of children between
  23221. * updates.
  23222. */
  23223. ownerHasKeyUseWarning = {};
  23224. ownerHasFunctionTypeWarning = {};
  23225. warnForMissingKey = function (child) {
  23226. if (child === null || typeof child !== 'object') {
  23227. return;
  23228. }
  23229. if (!child._store || child._store.validated || child.key != null) {
  23230. return;
  23231. }
  23232. if (!(typeof child._store === 'object')) {
  23233. {
  23234. throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." );
  23235. }
  23236. }
  23237. child._store.validated = true;
  23238. var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev();
  23239. if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
  23240. return;
  23241. }
  23242. ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
  23243. error('Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.');
  23244. };
  23245. }
  23246. var isArray$1 = Array.isArray;
  23247. function coerceRef(returnFiber, current, element) {
  23248. var mixedRef = element.ref;
  23249. if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {
  23250. {
  23251. // TODO: Clean this up once we turn on the string ref warning for
  23252. // everyone, because the strict mode case will no longer be relevant
  23253. if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
  23254. // because these cannot be automatically converted to an arrow function
  23255. // using a codemod. Therefore, we don't have to warn about string refs again.
  23256. !(element._owner && element._self && element._owner.stateNode !== element._self)) {
  23257. var componentName = getComponentName(returnFiber.type) || 'Component';
  23258. if (!didWarnAboutStringRefs[componentName]) {
  23259. {
  23260. error('A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', mixedRef, getStackByFiberInDevAndProd(returnFiber));
  23261. }
  23262. didWarnAboutStringRefs[componentName] = true;
  23263. }
  23264. }
  23265. }
  23266. if (element._owner) {
  23267. var owner = element._owner;
  23268. var inst;
  23269. if (owner) {
  23270. var ownerFiber = owner;
  23271. if (!(ownerFiber.tag === ClassComponent)) {
  23272. {
  23273. throw Error( "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" );
  23274. }
  23275. }
  23276. inst = ownerFiber.stateNode;
  23277. }
  23278. if (!inst) {
  23279. {
  23280. throw Error( "Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue." );
  23281. }
  23282. }
  23283. var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref
  23284. if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) {
  23285. return current.ref;
  23286. }
  23287. var ref = function (value) {
  23288. var refs = inst.refs;
  23289. if (refs === emptyRefsObject) {
  23290. // This is a lazy pooled frozen object, so we need to initialize.
  23291. refs = inst.refs = {};
  23292. }
  23293. if (value === null) {
  23294. delete refs[stringRef];
  23295. } else {
  23296. refs[stringRef] = value;
  23297. }
  23298. };
  23299. ref._stringRef = stringRef;
  23300. return ref;
  23301. } else {
  23302. if (!(typeof mixedRef === 'string')) {
  23303. {
  23304. throw Error( "Expected ref to be a function, a string, an object returned by React.createRef(), or null." );
  23305. }
  23306. }
  23307. if (!element._owner) {
  23308. {
  23309. throw Error( "Element ref was specified as a string (" + mixedRef + ") 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." );
  23310. }
  23311. }
  23312. }
  23313. }
  23314. return mixedRef;
  23315. }
  23316. function throwOnInvalidObjectType(returnFiber, newChild) {
  23317. if (returnFiber.type !== 'textarea') {
  23318. var addendum = '';
  23319. {
  23320. addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev();
  23321. }
  23322. {
  23323. {
  23324. throw Error( "Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + ")." + addendum );
  23325. }
  23326. }
  23327. }
  23328. }
  23329. function warnOnFunctionType() {
  23330. {
  23331. var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();
  23332. if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {
  23333. return;
  23334. }
  23335. ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;
  23336. error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');
  23337. }
  23338. } // This wrapper function exists because I expect to clone the code in each path
  23339. // to be able to optimize each path individually by branching early. This needs
  23340. // a compiler or we can do it manually. Helpers that don't need this branching
  23341. // live outside of this function.
  23342. function ChildReconciler(shouldTrackSideEffects) {
  23343. function deleteChild(returnFiber, childToDelete) {
  23344. if (!shouldTrackSideEffects) {
  23345. // Noop.
  23346. return;
  23347. } // Deletions are added in reversed order so we add it to the front.
  23348. // At this point, the return fiber's effect list is empty except for
  23349. // deletions, so we can just append the deletion to the list. The remaining
  23350. // effects aren't added until the complete phase. Once we implement
  23351. // resuming, this may not be true.
  23352. var last = returnFiber.lastEffect;
  23353. if (last !== null) {
  23354. last.nextEffect = childToDelete;
  23355. returnFiber.lastEffect = childToDelete;
  23356. } else {
  23357. returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
  23358. }
  23359. childToDelete.nextEffect = null;
  23360. childToDelete.effectTag = Deletion;
  23361. }
  23362. function deleteRemainingChildren(returnFiber, currentFirstChild) {
  23363. if (!shouldTrackSideEffects) {
  23364. // Noop.
  23365. return null;
  23366. } // TODO: For the shouldClone case, this could be micro-optimized a bit by
  23367. // assuming that after the first child we've already added everything.
  23368. var childToDelete = currentFirstChild;
  23369. while (childToDelete !== null) {
  23370. deleteChild(returnFiber, childToDelete);
  23371. childToDelete = childToDelete.sibling;
  23372. }
  23373. return null;
  23374. }
  23375. function mapRemainingChildren(returnFiber, currentFirstChild) {
  23376. // Add the remaining children to a temporary map so that we can find them by
  23377. // keys quickly. Implicit (null) keys get added to this set with their index
  23378. // instead.
  23379. var existingChildren = new Map();
  23380. var existingChild = currentFirstChild;
  23381. while (existingChild !== null) {
  23382. if (existingChild.key !== null) {
  23383. existingChildren.set(existingChild.key, existingChild);
  23384. } else {
  23385. existingChildren.set(existingChild.index, existingChild);
  23386. }
  23387. existingChild = existingChild.sibling;
  23388. }
  23389. return existingChildren;
  23390. }
  23391. function useFiber(fiber, pendingProps) {
  23392. // We currently set sibling to null and index to 0 here because it is easy
  23393. // to forget to do before returning it. E.g. for the single child case.
  23394. var clone = createWorkInProgress(fiber, pendingProps);
  23395. clone.index = 0;
  23396. clone.sibling = null;
  23397. return clone;
  23398. }
  23399. function placeChild(newFiber, lastPlacedIndex, newIndex) {
  23400. newFiber.index = newIndex;
  23401. if (!shouldTrackSideEffects) {
  23402. // Noop.
  23403. return lastPlacedIndex;
  23404. }
  23405. var current = newFiber.alternate;
  23406. if (current !== null) {
  23407. var oldIndex = current.index;
  23408. if (oldIndex < lastPlacedIndex) {
  23409. // This is a move.
  23410. newFiber.effectTag = Placement;
  23411. return lastPlacedIndex;
  23412. } else {
  23413. // This item can stay in place.
  23414. return oldIndex;
  23415. }
  23416. } else {
  23417. // This is an insertion.
  23418. newFiber.effectTag = Placement;
  23419. return lastPlacedIndex;
  23420. }
  23421. }
  23422. function placeSingleChild(newFiber) {
  23423. // This is simpler for the single child case. We only need to do a
  23424. // placement for inserting new children.
  23425. if (shouldTrackSideEffects && newFiber.alternate === null) {
  23426. newFiber.effectTag = Placement;
  23427. }
  23428. return newFiber;
  23429. }
  23430. function updateTextNode(returnFiber, current, textContent, expirationTime) {
  23431. if (current === null || current.tag !== HostText) {
  23432. // Insert
  23433. var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
  23434. created.return = returnFiber;
  23435. return created;
  23436. } else {
  23437. // Update
  23438. var existing = useFiber(current, textContent);
  23439. existing.return = returnFiber;
  23440. return existing;
  23441. }
  23442. }
  23443. function updateElement(returnFiber, current, element, expirationTime) {
  23444. if (current !== null) {
  23445. if (current.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
  23446. isCompatibleFamilyForHotReloading(current, element) )) {
  23447. // Move based on index
  23448. var existing = useFiber(current, element.props);
  23449. existing.ref = coerceRef(returnFiber, current, element);
  23450. existing.return = returnFiber;
  23451. {
  23452. existing._debugSource = element._source;
  23453. existing._debugOwner = element._owner;
  23454. }
  23455. return existing;
  23456. }
  23457. } // Insert
  23458. var created = createFiberFromElement(element, returnFiber.mode, expirationTime);
  23459. created.ref = coerceRef(returnFiber, current, element);
  23460. created.return = returnFiber;
  23461. return created;
  23462. }
  23463. function updatePortal(returnFiber, current, portal, expirationTime) {
  23464. if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {
  23465. // Insert
  23466. var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
  23467. created.return = returnFiber;
  23468. return created;
  23469. } else {
  23470. // Update
  23471. var existing = useFiber(current, portal.children || []);
  23472. existing.return = returnFiber;
  23473. return existing;
  23474. }
  23475. }
  23476. function updateFragment(returnFiber, current, fragment, expirationTime, key) {
  23477. if (current === null || current.tag !== Fragment) {
  23478. // Insert
  23479. var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);
  23480. created.return = returnFiber;
  23481. return created;
  23482. } else {
  23483. // Update
  23484. var existing = useFiber(current, fragment);
  23485. existing.return = returnFiber;
  23486. return existing;
  23487. }
  23488. }
  23489. function createChild(returnFiber, newChild, expirationTime) {
  23490. if (typeof newChild === 'string' || typeof newChild === 'number') {
  23491. // Text nodes don't have keys. If the previous node is implicitly keyed
  23492. // we can continue to replace it without aborting even if it is not a text
  23493. // node.
  23494. var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);
  23495. created.return = returnFiber;
  23496. return created;
  23497. }
  23498. if (typeof newChild === 'object' && newChild !== null) {
  23499. switch (newChild.$$typeof) {
  23500. case REACT_ELEMENT_TYPE:
  23501. {
  23502. var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);
  23503. _created.ref = coerceRef(returnFiber, null, newChild);
  23504. _created.return = returnFiber;
  23505. return _created;
  23506. }
  23507. case REACT_PORTAL_TYPE:
  23508. {
  23509. var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);
  23510. _created2.return = returnFiber;
  23511. return _created2;
  23512. }
  23513. }
  23514. if (isArray$1(newChild) || getIteratorFn(newChild)) {
  23515. var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);
  23516. _created3.return = returnFiber;
  23517. return _created3;
  23518. }
  23519. throwOnInvalidObjectType(returnFiber, newChild);
  23520. }
  23521. {
  23522. if (typeof newChild === 'function') {
  23523. warnOnFunctionType();
  23524. }
  23525. }
  23526. return null;
  23527. }
  23528. function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
  23529. // Update the fiber if the keys match, otherwise return null.
  23530. var key = oldFiber !== null ? oldFiber.key : null;
  23531. if (typeof newChild === 'string' || typeof newChild === 'number') {
  23532. // Text nodes don't have keys. If the previous node is implicitly keyed
  23533. // we can continue to replace it without aborting even if it is not a text
  23534. // node.
  23535. if (key !== null) {
  23536. return null;
  23537. }
  23538. return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);
  23539. }
  23540. if (typeof newChild === 'object' && newChild !== null) {
  23541. switch (newChild.$$typeof) {
  23542. case REACT_ELEMENT_TYPE:
  23543. {
  23544. if (newChild.key === key) {
  23545. if (newChild.type === REACT_FRAGMENT_TYPE) {
  23546. return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);
  23547. }
  23548. return updateElement(returnFiber, oldFiber, newChild, expirationTime);
  23549. } else {
  23550. return null;
  23551. }
  23552. }
  23553. case REACT_PORTAL_TYPE:
  23554. {
  23555. if (newChild.key === key) {
  23556. return updatePortal(returnFiber, oldFiber, newChild, expirationTime);
  23557. } else {
  23558. return null;
  23559. }
  23560. }
  23561. }
  23562. if (isArray$1(newChild) || getIteratorFn(newChild)) {
  23563. if (key !== null) {
  23564. return null;
  23565. }
  23566. return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);
  23567. }
  23568. throwOnInvalidObjectType(returnFiber, newChild);
  23569. }
  23570. {
  23571. if (typeof newChild === 'function') {
  23572. warnOnFunctionType();
  23573. }
  23574. }
  23575. return null;
  23576. }
  23577. function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {
  23578. if (typeof newChild === 'string' || typeof newChild === 'number') {
  23579. // Text nodes don't have keys, so we neither have to check the old nor
  23580. // new node for the key. If both are text nodes, they match.
  23581. var matchedFiber = existingChildren.get(newIdx) || null;
  23582. return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);
  23583. }
  23584. if (typeof newChild === 'object' && newChild !== null) {
  23585. switch (newChild.$$typeof) {
  23586. case REACT_ELEMENT_TYPE:
  23587. {
  23588. var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
  23589. if (newChild.type === REACT_FRAGMENT_TYPE) {
  23590. return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);
  23591. }
  23592. return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);
  23593. }
  23594. case REACT_PORTAL_TYPE:
  23595. {
  23596. var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
  23597. return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);
  23598. }
  23599. }
  23600. if (isArray$1(newChild) || getIteratorFn(newChild)) {
  23601. var _matchedFiber3 = existingChildren.get(newIdx) || null;
  23602. return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);
  23603. }
  23604. throwOnInvalidObjectType(returnFiber, newChild);
  23605. }
  23606. {
  23607. if (typeof newChild === 'function') {
  23608. warnOnFunctionType();
  23609. }
  23610. }
  23611. return null;
  23612. }
  23613. /**
  23614. * Warns if there is a duplicate or missing key
  23615. */
  23616. function warnOnInvalidKey(child, knownKeys) {
  23617. {
  23618. if (typeof child !== 'object' || child === null) {
  23619. return knownKeys;
  23620. }
  23621. switch (child.$$typeof) {
  23622. case REACT_ELEMENT_TYPE:
  23623. case REACT_PORTAL_TYPE:
  23624. warnForMissingKey(child);
  23625. var key = child.key;
  23626. if (typeof key !== 'string') {
  23627. break;
  23628. }
  23629. if (knownKeys === null) {
  23630. knownKeys = new Set();
  23631. knownKeys.add(key);
  23632. break;
  23633. }
  23634. if (!knownKeys.has(key)) {
  23635. knownKeys.add(key);
  23636. break;
  23637. }
  23638. error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);
  23639. break;
  23640. }
  23641. }
  23642. return knownKeys;
  23643. }
  23644. function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {
  23645. // This algorithm can't optimize by searching from both ends since we
  23646. // don't have backpointers on fibers. I'm trying to see how far we can get
  23647. // with that model. If it ends up not being worth the tradeoffs, we can
  23648. // add it later.
  23649. // Even with a two ended optimization, we'd want to optimize for the case
  23650. // where there are few changes and brute force the comparison instead of
  23651. // going for the Map. It'd like to explore hitting that path first in
  23652. // forward-only mode and only go for the Map once we notice that we need
  23653. // lots of look ahead. This doesn't handle reversal as well as two ended
  23654. // search but that's unusual. Besides, for the two ended optimization to
  23655. // work on Iterables, we'd need to copy the whole set.
  23656. // In this first iteration, we'll just live with hitting the bad case
  23657. // (adding everything to a Map) in for every insert/move.
  23658. // If you change this code, also update reconcileChildrenIterator() which
  23659. // uses the same algorithm.
  23660. {
  23661. // First, validate keys.
  23662. var knownKeys = null;
  23663. for (var i = 0; i < newChildren.length; i++) {
  23664. var child = newChildren[i];
  23665. knownKeys = warnOnInvalidKey(child, knownKeys);
  23666. }
  23667. }
  23668. var resultingFirstChild = null;
  23669. var previousNewFiber = null;
  23670. var oldFiber = currentFirstChild;
  23671. var lastPlacedIndex = 0;
  23672. var newIdx = 0;
  23673. var nextOldFiber = null;
  23674. for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
  23675. if (oldFiber.index > newIdx) {
  23676. nextOldFiber = oldFiber;
  23677. oldFiber = null;
  23678. } else {
  23679. nextOldFiber = oldFiber.sibling;
  23680. }
  23681. var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);
  23682. if (newFiber === null) {
  23683. // TODO: This breaks on empty slots like null children. That's
  23684. // unfortunate because it triggers the slow path all the time. We need
  23685. // a better way to communicate whether this was a miss or null,
  23686. // boolean, undefined, etc.
  23687. if (oldFiber === null) {
  23688. oldFiber = nextOldFiber;
  23689. }
  23690. break;
  23691. }
  23692. if (shouldTrackSideEffects) {
  23693. if (oldFiber && newFiber.alternate === null) {
  23694. // We matched the slot, but we didn't reuse the existing fiber, so we
  23695. // need to delete the existing child.
  23696. deleteChild(returnFiber, oldFiber);
  23697. }
  23698. }
  23699. lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
  23700. if (previousNewFiber === null) {
  23701. // TODO: Move out of the loop. This only happens for the first run.
  23702. resultingFirstChild = newFiber;
  23703. } else {
  23704. // TODO: Defer siblings if we're not at the right index for this slot.
  23705. // I.e. if we had null values before, then we want to defer this
  23706. // for each null value. However, we also don't want to call updateSlot
  23707. // with the previous one.
  23708. previousNewFiber.sibling = newFiber;
  23709. }
  23710. previousNewFiber = newFiber;
  23711. oldFiber = nextOldFiber;
  23712. }
  23713. if (newIdx === newChildren.length) {
  23714. // We've reached the end of the new children. We can delete the rest.
  23715. deleteRemainingChildren(returnFiber, oldFiber);
  23716. return resultingFirstChild;
  23717. }
  23718. if (oldFiber === null) {
  23719. // If we don't have any more existing children we can choose a fast path
  23720. // since the rest will all be insertions.
  23721. for (; newIdx < newChildren.length; newIdx++) {
  23722. var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);
  23723. if (_newFiber === null) {
  23724. continue;
  23725. }
  23726. lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
  23727. if (previousNewFiber === null) {
  23728. // TODO: Move out of the loop. This only happens for the first run.
  23729. resultingFirstChild = _newFiber;
  23730. } else {
  23731. previousNewFiber.sibling = _newFiber;
  23732. }
  23733. previousNewFiber = _newFiber;
  23734. }
  23735. return resultingFirstChild;
  23736. } // Add all children to a key map for quick lookups.
  23737. var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.
  23738. for (; newIdx < newChildren.length; newIdx++) {
  23739. var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);
  23740. if (_newFiber2 !== null) {
  23741. if (shouldTrackSideEffects) {
  23742. if (_newFiber2.alternate !== null) {
  23743. // The new fiber is a work in progress, but if there exists a
  23744. // current, that means that we reused the fiber. We need to delete
  23745. // it from the child list so that we don't add it to the deletion
  23746. // list.
  23747. existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
  23748. }
  23749. }
  23750. lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
  23751. if (previousNewFiber === null) {
  23752. resultingFirstChild = _newFiber2;
  23753. } else {
  23754. previousNewFiber.sibling = _newFiber2;
  23755. }
  23756. previousNewFiber = _newFiber2;
  23757. }
  23758. }
  23759. if (shouldTrackSideEffects) {
  23760. // Any existing children that weren't consumed above were deleted. We need
  23761. // to add them to the deletion list.
  23762. existingChildren.forEach(function (child) {
  23763. return deleteChild(returnFiber, child);
  23764. });
  23765. }
  23766. return resultingFirstChild;
  23767. }
  23768. function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {
  23769. // This is the same implementation as reconcileChildrenArray(),
  23770. // but using the iterator instead.
  23771. var iteratorFn = getIteratorFn(newChildrenIterable);
  23772. if (!(typeof iteratorFn === 'function')) {
  23773. {
  23774. throw Error( "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." );
  23775. }
  23776. }
  23777. {
  23778. // We don't support rendering Generators because it's a mutation.
  23779. // See https://github.com/facebook/react/issues/12995
  23780. if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag
  23781. newChildrenIterable[Symbol.toStringTag] === 'Generator') {
  23782. if (!didWarnAboutGenerators) {
  23783. error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.');
  23784. }
  23785. didWarnAboutGenerators = true;
  23786. } // Warn about using Maps as children
  23787. if (newChildrenIterable.entries === iteratorFn) {
  23788. if (!didWarnAboutMaps) {
  23789. error('Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.');
  23790. }
  23791. didWarnAboutMaps = true;
  23792. } // First, validate keys.
  23793. // We'll get a different iterator later for the main pass.
  23794. var _newChildren = iteratorFn.call(newChildrenIterable);
  23795. if (_newChildren) {
  23796. var knownKeys = null;
  23797. var _step = _newChildren.next();
  23798. for (; !_step.done; _step = _newChildren.next()) {
  23799. var child = _step.value;
  23800. knownKeys = warnOnInvalidKey(child, knownKeys);
  23801. }
  23802. }
  23803. }
  23804. var newChildren = iteratorFn.call(newChildrenIterable);
  23805. if (!(newChildren != null)) {
  23806. {
  23807. throw Error( "An iterable object provided no iterator." );
  23808. }
  23809. }
  23810. var resultingFirstChild = null;
  23811. var previousNewFiber = null;
  23812. var oldFiber = currentFirstChild;
  23813. var lastPlacedIndex = 0;
  23814. var newIdx = 0;
  23815. var nextOldFiber = null;
  23816. var step = newChildren.next();
  23817. for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
  23818. if (oldFiber.index > newIdx) {
  23819. nextOldFiber = oldFiber;
  23820. oldFiber = null;
  23821. } else {
  23822. nextOldFiber = oldFiber.sibling;
  23823. }
  23824. var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);
  23825. if (newFiber === null) {
  23826. // TODO: This breaks on empty slots like null children. That's
  23827. // unfortunate because it triggers the slow path all the time. We need
  23828. // a better way to communicate whether this was a miss or null,
  23829. // boolean, undefined, etc.
  23830. if (oldFiber === null) {
  23831. oldFiber = nextOldFiber;
  23832. }
  23833. break;
  23834. }
  23835. if (shouldTrackSideEffects) {
  23836. if (oldFiber && newFiber.alternate === null) {
  23837. // We matched the slot, but we didn't reuse the existing fiber, so we
  23838. // need to delete the existing child.
  23839. deleteChild(returnFiber, oldFiber);
  23840. }
  23841. }
  23842. lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
  23843. if (previousNewFiber === null) {
  23844. // TODO: Move out of the loop. This only happens for the first run.
  23845. resultingFirstChild = newFiber;
  23846. } else {
  23847. // TODO: Defer siblings if we're not at the right index for this slot.
  23848. // I.e. if we had null values before, then we want to defer this
  23849. // for each null value. However, we also don't want to call updateSlot
  23850. // with the previous one.
  23851. previousNewFiber.sibling = newFiber;
  23852. }
  23853. previousNewFiber = newFiber;
  23854. oldFiber = nextOldFiber;
  23855. }
  23856. if (step.done) {
  23857. // We've reached the end of the new children. We can delete the rest.
  23858. deleteRemainingChildren(returnFiber, oldFiber);
  23859. return resultingFirstChild;
  23860. }
  23861. if (oldFiber === null) {
  23862. // If we don't have any more existing children we can choose a fast path
  23863. // since the rest will all be insertions.
  23864. for (; !step.done; newIdx++, step = newChildren.next()) {
  23865. var _newFiber3 = createChild(returnFiber, step.value, expirationTime);
  23866. if (_newFiber3 === null) {
  23867. continue;
  23868. }
  23869. lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
  23870. if (previousNewFiber === null) {
  23871. // TODO: Move out of the loop. This only happens for the first run.
  23872. resultingFirstChild = _newFiber3;
  23873. } else {
  23874. previousNewFiber.sibling = _newFiber3;
  23875. }
  23876. previousNewFiber = _newFiber3;
  23877. }
  23878. return resultingFirstChild;
  23879. } // Add all children to a key map for quick lookups.
  23880. var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.
  23881. for (; !step.done; newIdx++, step = newChildren.next()) {
  23882. var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);
  23883. if (_newFiber4 !== null) {
  23884. if (shouldTrackSideEffects) {
  23885. if (_newFiber4.alternate !== null) {
  23886. // The new fiber is a work in progress, but if there exists a
  23887. // current, that means that we reused the fiber. We need to delete
  23888. // it from the child list so that we don't add it to the deletion
  23889. // list.
  23890. existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
  23891. }
  23892. }
  23893. lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
  23894. if (previousNewFiber === null) {
  23895. resultingFirstChild = _newFiber4;
  23896. } else {
  23897. previousNewFiber.sibling = _newFiber4;
  23898. }
  23899. previousNewFiber = _newFiber4;
  23900. }
  23901. }
  23902. if (shouldTrackSideEffects) {
  23903. // Any existing children that weren't consumed above were deleted. We need
  23904. // to add them to the deletion list.
  23905. existingChildren.forEach(function (child) {
  23906. return deleteChild(returnFiber, child);
  23907. });
  23908. }
  23909. return resultingFirstChild;
  23910. }
  23911. function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
  23912. // There's no need to check for keys on text nodes since we don't have a
  23913. // way to define them.
  23914. if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
  23915. // We already have an existing node so let's just update it and delete
  23916. // the rest.
  23917. deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
  23918. var existing = useFiber(currentFirstChild, textContent);
  23919. existing.return = returnFiber;
  23920. return existing;
  23921. } // The existing first child is not a text node so we need to create one
  23922. // and delete the existing ones.
  23923. deleteRemainingChildren(returnFiber, currentFirstChild);
  23924. var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
  23925. created.return = returnFiber;
  23926. return created;
  23927. }
  23928. function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
  23929. var key = element.key;
  23930. var child = currentFirstChild;
  23931. while (child !== null) {
  23932. // TODO: If key === null and child.key === null, then this only applies to
  23933. // the first item in the list.
  23934. if (child.key === key) {
  23935. switch (child.tag) {
  23936. case Fragment:
  23937. {
  23938. if (element.type === REACT_FRAGMENT_TYPE) {
  23939. deleteRemainingChildren(returnFiber, child.sibling);
  23940. var existing = useFiber(child, element.props.children);
  23941. existing.return = returnFiber;
  23942. {
  23943. existing._debugSource = element._source;
  23944. existing._debugOwner = element._owner;
  23945. }
  23946. return existing;
  23947. }
  23948. break;
  23949. }
  23950. case Block:
  23951. // We intentionally fallthrough here if enableBlocksAPI is not on.
  23952. // eslint-disable-next-lined no-fallthrough
  23953. default:
  23954. {
  23955. if (child.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
  23956. isCompatibleFamilyForHotReloading(child, element) )) {
  23957. deleteRemainingChildren(returnFiber, child.sibling);
  23958. var _existing3 = useFiber(child, element.props);
  23959. _existing3.ref = coerceRef(returnFiber, child, element);
  23960. _existing3.return = returnFiber;
  23961. {
  23962. _existing3._debugSource = element._source;
  23963. _existing3._debugOwner = element._owner;
  23964. }
  23965. return _existing3;
  23966. }
  23967. break;
  23968. }
  23969. } // Didn't match.
  23970. deleteRemainingChildren(returnFiber, child);
  23971. break;
  23972. } else {
  23973. deleteChild(returnFiber, child);
  23974. }
  23975. child = child.sibling;
  23976. }
  23977. if (element.type === REACT_FRAGMENT_TYPE) {
  23978. var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);
  23979. created.return = returnFiber;
  23980. return created;
  23981. } else {
  23982. var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
  23983. _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
  23984. _created4.return = returnFiber;
  23985. return _created4;
  23986. }
  23987. }
  23988. function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
  23989. var key = portal.key;
  23990. var child = currentFirstChild;
  23991. while (child !== null) {
  23992. // TODO: If key === null and child.key === null, then this only applies to
  23993. // the first item in the list.
  23994. if (child.key === key) {
  23995. if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
  23996. deleteRemainingChildren(returnFiber, child.sibling);
  23997. var existing = useFiber(child, portal.children || []);
  23998. existing.return = returnFiber;
  23999. return existing;
  24000. } else {
  24001. deleteRemainingChildren(returnFiber, child);
  24002. break;
  24003. }
  24004. } else {
  24005. deleteChild(returnFiber, child);
  24006. }
  24007. child = child.sibling;
  24008. }
  24009. var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
  24010. created.return = returnFiber;
  24011. return created;
  24012. } // This API will tag the children with the side-effect of the reconciliation
  24013. // itself. They will be added to the side-effect list as we pass through the
  24014. // children and the parent.
  24015. function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {
  24016. // This function is not recursive.
  24017. // If the top level item is an array, we treat it as a set of children,
  24018. // not as a fragment. Nested arrays on the other hand will be treated as
  24019. // fragment nodes. Recursion happens at the normal flow.
  24020. // Handle top level unkeyed fragments as if they were arrays.
  24021. // This leads to an ambiguity between <>{[...]}</> and <>...</>.
  24022. // We treat the ambiguous cases above the same.
  24023. var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
  24024. if (isUnkeyedTopLevelFragment) {
  24025. newChild = newChild.props.children;
  24026. } // Handle object types
  24027. var isObject = typeof newChild === 'object' && newChild !== null;
  24028. if (isObject) {
  24029. switch (newChild.$$typeof) {
  24030. case REACT_ELEMENT_TYPE:
  24031. return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));
  24032. case REACT_PORTAL_TYPE:
  24033. return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));
  24034. }
  24035. }
  24036. if (typeof newChild === 'string' || typeof newChild === 'number') {
  24037. return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));
  24038. }
  24039. if (isArray$1(newChild)) {
  24040. return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);
  24041. }
  24042. if (getIteratorFn(newChild)) {
  24043. return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);
  24044. }
  24045. if (isObject) {
  24046. throwOnInvalidObjectType(returnFiber, newChild);
  24047. }
  24048. {
  24049. if (typeof newChild === 'function') {
  24050. warnOnFunctionType();
  24051. }
  24052. }
  24053. if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {
  24054. // If the new child is undefined, and the return fiber is a composite
  24055. // component, throw an error. If Fiber return types are disabled,
  24056. // we already threw above.
  24057. switch (returnFiber.tag) {
  24058. case ClassComponent:
  24059. {
  24060. {
  24061. var instance = returnFiber.stateNode;
  24062. if (instance.render._isMockFunction) {
  24063. // We allow auto-mocks to proceed as if they're returning null.
  24064. break;
  24065. }
  24066. }
  24067. }
  24068. // Intentionally fall through to the next case, which handles both
  24069. // functions and classes
  24070. // eslint-disable-next-lined no-fallthrough
  24071. case FunctionComponent:
  24072. {
  24073. var Component = returnFiber.type;
  24074. {
  24075. {
  24076. throw Error( (Component.displayName || Component.name || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null." );
  24077. }
  24078. }
  24079. }
  24080. }
  24081. } // Remaining cases are all treated as empty.
  24082. return deleteRemainingChildren(returnFiber, currentFirstChild);
  24083. }
  24084. return reconcileChildFibers;
  24085. }
  24086. var reconcileChildFibers = ChildReconciler(true);
  24087. var mountChildFibers = ChildReconciler(false);
  24088. function cloneChildFibers(current, workInProgress) {
  24089. if (!(current === null || workInProgress.child === current.child)) {
  24090. {
  24091. throw Error( "Resuming work not yet implemented." );
  24092. }
  24093. }
  24094. if (workInProgress.child === null) {
  24095. return;
  24096. }
  24097. var currentChild = workInProgress.child;
  24098. var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
  24099. workInProgress.child = newChild;
  24100. newChild.return = workInProgress;
  24101. while (currentChild.sibling !== null) {
  24102. currentChild = currentChild.sibling;
  24103. newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
  24104. newChild.return = workInProgress;
  24105. }
  24106. newChild.sibling = null;
  24107. } // Reset a workInProgress child set to prepare it for a second pass.
  24108. function resetChildFibers(workInProgress, renderExpirationTime) {
  24109. var child = workInProgress.child;
  24110. while (child !== null) {
  24111. resetWorkInProgress(child, renderExpirationTime);
  24112. child = child.sibling;
  24113. }
  24114. }
  24115. var NO_CONTEXT = {};
  24116. var contextStackCursor$1 = createCursor(NO_CONTEXT);
  24117. var contextFiberStackCursor = createCursor(NO_CONTEXT);
  24118. var rootInstanceStackCursor = createCursor(NO_CONTEXT);
  24119. function requiredContext(c) {
  24120. if (!(c !== NO_CONTEXT)) {
  24121. {
  24122. throw Error( "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." );
  24123. }
  24124. }
  24125. return c;
  24126. }
  24127. function getRootHostContainer() {
  24128. var rootInstance = requiredContext(rootInstanceStackCursor.current);
  24129. return rootInstance;
  24130. }
  24131. function pushHostContainer(fiber, nextRootInstance) {
  24132. // Push current root instance onto the stack;
  24133. // This allows us to reset root when portals are popped.
  24134. push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.
  24135. // This enables us to pop only Fibers that provide unique contexts.
  24136. push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.
  24137. // However, we can't just call getRootHostContext() and push it because
  24138. // we'd have a different number of entries on the stack depending on
  24139. // whether getRootHostContext() throws somewhere in renderer code or not.
  24140. // So we push an empty value first. This lets us safely unwind on errors.
  24141. push(contextStackCursor$1, NO_CONTEXT, fiber);
  24142. var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.
  24143. pop(contextStackCursor$1, fiber);
  24144. push(contextStackCursor$1, nextRootContext, fiber);
  24145. }
  24146. function popHostContainer(fiber) {
  24147. pop(contextStackCursor$1, fiber);
  24148. pop(contextFiberStackCursor, fiber);
  24149. pop(rootInstanceStackCursor, fiber);
  24150. }
  24151. function getHostContext() {
  24152. var context = requiredContext(contextStackCursor$1.current);
  24153. return context;
  24154. }
  24155. function pushHostContext(fiber) {
  24156. var rootInstance = requiredContext(rootInstanceStackCursor.current);
  24157. var context = requiredContext(contextStackCursor$1.current);
  24158. var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.
  24159. if (context === nextContext) {
  24160. return;
  24161. } // Track the context and the Fiber that provided it.
  24162. // This enables us to pop only Fibers that provide unique contexts.
  24163. push(contextFiberStackCursor, fiber, fiber);
  24164. push(contextStackCursor$1, nextContext, fiber);
  24165. }
  24166. function popHostContext(fiber) {
  24167. // Do not pop unless this Fiber provided the current context.
  24168. // pushHostContext() only pushes Fibers that provide unique contexts.
  24169. if (contextFiberStackCursor.current !== fiber) {
  24170. return;
  24171. }
  24172. pop(contextStackCursor$1, fiber);
  24173. pop(contextFiberStackCursor, fiber);
  24174. }
  24175. var DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is
  24176. // inherited deeply down the subtree. The upper bits only affect
  24177. // this immediate suspense boundary and gets reset each new
  24178. // boundary or suspense list.
  24179. var SubtreeSuspenseContextMask = 1; // Subtree Flags:
  24180. // InvisibleParentSuspenseContext indicates that one of our parent Suspense
  24181. // boundaries is not currently showing visible main content.
  24182. // Either because it is already showing a fallback or is not mounted at all.
  24183. // We can use this to determine if it is desirable to trigger a fallback at
  24184. // the parent. If not, then we might need to trigger undesirable boundaries
  24185. // and/or suspend the commit to avoid hiding the parent content.
  24186. var InvisibleParentSuspenseContext = 1; // Shallow Flags:
  24187. // ForceSuspenseFallback can be used by SuspenseList to force newly added
  24188. // items into their fallback state during one of the render passes.
  24189. var ForceSuspenseFallback = 2;
  24190. var suspenseStackCursor = createCursor(DefaultSuspenseContext);
  24191. function hasSuspenseContext(parentContext, flag) {
  24192. return (parentContext & flag) !== 0;
  24193. }
  24194. function setDefaultShallowSuspenseContext(parentContext) {
  24195. return parentContext & SubtreeSuspenseContextMask;
  24196. }
  24197. function setShallowSuspenseContext(parentContext, shallowContext) {
  24198. return parentContext & SubtreeSuspenseContextMask | shallowContext;
  24199. }
  24200. function addSubtreeSuspenseContext(parentContext, subtreeContext) {
  24201. return parentContext | subtreeContext;
  24202. }
  24203. function pushSuspenseContext(fiber, newContext) {
  24204. push(suspenseStackCursor, newContext, fiber);
  24205. }
  24206. function popSuspenseContext(fiber) {
  24207. pop(suspenseStackCursor, fiber);
  24208. }
  24209. function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
  24210. // If it was the primary children that just suspended, capture and render the
  24211. // fallback. Otherwise, don't capture and bubble to the next boundary.
  24212. var nextState = workInProgress.memoizedState;
  24213. if (nextState !== null) {
  24214. if (nextState.dehydrated !== null) {
  24215. // A dehydrated boundary always captures.
  24216. return true;
  24217. }
  24218. return false;
  24219. }
  24220. var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop.
  24221. if (props.fallback === undefined) {
  24222. return false;
  24223. } // Regular boundaries always capture.
  24224. if (props.unstable_avoidThisFallback !== true) {
  24225. return true;
  24226. } // If it's a boundary we should avoid, then we prefer to bubble up to the
  24227. // parent boundary if it is currently invisible.
  24228. if (hasInvisibleParent) {
  24229. return false;
  24230. } // If the parent is not able to handle it, we must handle it.
  24231. return true;
  24232. }
  24233. function findFirstSuspended(row) {
  24234. var node = row;
  24235. while (node !== null) {
  24236. if (node.tag === SuspenseComponent) {
  24237. var state = node.memoizedState;
  24238. if (state !== null) {
  24239. var dehydrated = state.dehydrated;
  24240. if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
  24241. return node;
  24242. }
  24243. }
  24244. } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
  24245. // keep track of whether it suspended or not.
  24246. node.memoizedProps.revealOrder !== undefined) {
  24247. var didSuspend = (node.effectTag & DidCapture) !== NoEffect;
  24248. if (didSuspend) {
  24249. return node;
  24250. }
  24251. } else if (node.child !== null) {
  24252. node.child.return = node;
  24253. node = node.child;
  24254. continue;
  24255. }
  24256. if (node === row) {
  24257. return null;
  24258. }
  24259. while (node.sibling === null) {
  24260. if (node.return === null || node.return === row) {
  24261. return null;
  24262. }
  24263. node = node.return;
  24264. }
  24265. node.sibling.return = node.return;
  24266. node = node.sibling;
  24267. }
  24268. return null;
  24269. }
  24270. function createDeprecatedResponderListener(responder, props) {
  24271. var eventResponderListener = {
  24272. responder: responder,
  24273. props: props
  24274. };
  24275. {
  24276. Object.freeze(eventResponderListener);
  24277. }
  24278. return eventResponderListener;
  24279. }
  24280. var HasEffect =
  24281. /* */
  24282. 1; // Represents the phase in which the effect (not the clean-up) fires.
  24283. var Layout =
  24284. /* */
  24285. 2;
  24286. var Passive$1 =
  24287. /* */
  24288. 4;
  24289. var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
  24290. ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
  24291. var didWarnAboutMismatchedHooksForComponent;
  24292. {
  24293. didWarnAboutMismatchedHooksForComponent = new Set();
  24294. }
  24295. // These are set right before calling the component.
  24296. var renderExpirationTime = NoWork; // The work-in-progress fiber. I've named it differently to distinguish it from
  24297. // the work-in-progress hook.
  24298. var currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The
  24299. // current hook list is the list that belongs to the current fiber. The
  24300. // work-in-progress hook list is a new list that will be added to the
  24301. // work-in-progress fiber.
  24302. var currentHook = null;
  24303. var workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This
  24304. // does not get reset if we do another render pass; only when we're completely
  24305. // finished evaluating this component. This is an optimization so we know
  24306. // whether we need to clear render phase updates after a throw.
  24307. var didScheduleRenderPhaseUpdate = false;
  24308. var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook
  24309. var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.
  24310. // The list stores the order of hooks used during the initial render (mount).
  24311. // Subsequent renders (updates) reference this list.
  24312. var hookTypesDev = null;
  24313. var hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore
  24314. // the dependencies for Hooks that need them (e.g. useEffect or useMemo).
  24315. // When true, such Hooks will always be "remounted". Only used during hot reload.
  24316. var ignorePreviousDependencies = false;
  24317. function mountHookTypesDev() {
  24318. {
  24319. var hookName = currentHookNameInDev;
  24320. if (hookTypesDev === null) {
  24321. hookTypesDev = [hookName];
  24322. } else {
  24323. hookTypesDev.push(hookName);
  24324. }
  24325. }
  24326. }
  24327. function updateHookTypesDev() {
  24328. {
  24329. var hookName = currentHookNameInDev;
  24330. if (hookTypesDev !== null) {
  24331. hookTypesUpdateIndexDev++;
  24332. if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
  24333. warnOnHookMismatchInDev(hookName);
  24334. }
  24335. }
  24336. }
  24337. }
  24338. function checkDepsAreArrayDev(deps) {
  24339. {
  24340. if (deps !== undefined && deps !== null && !Array.isArray(deps)) {
  24341. // Verify deps, but only on mount to avoid extra checks.
  24342. // It's unlikely their type would change as usually you define them inline.
  24343. error('%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);
  24344. }
  24345. }
  24346. }
  24347. function warnOnHookMismatchInDev(currentHookName) {
  24348. {
  24349. var componentName = getComponentName(currentlyRenderingFiber$1.type);
  24350. if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
  24351. didWarnAboutMismatchedHooksForComponent.add(componentName);
  24352. if (hookTypesDev !== null) {
  24353. var table = '';
  24354. var secondColumnStart = 30;
  24355. for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
  24356. var oldHookName = hookTypesDev[i];
  24357. var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
  24358. var row = i + 1 + ". " + oldHookName; // Extra space so second column lines up
  24359. // lol @ IE not supporting String#repeat
  24360. while (row.length < secondColumnStart) {
  24361. row += ' ';
  24362. }
  24363. row += newHookName + '\n';
  24364. table += row;
  24365. }
  24366. error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\n\n' + ' Previous render Next render\n' + ' ------------------------------------------------------\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table);
  24367. }
  24368. }
  24369. }
  24370. }
  24371. function throwInvalidHookError() {
  24372. {
  24373. {
  24374. throw Error( "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." );
  24375. }
  24376. }
  24377. }
  24378. function areHookInputsEqual(nextDeps, prevDeps) {
  24379. {
  24380. if (ignorePreviousDependencies) {
  24381. // Only true when this component is being hot reloaded.
  24382. return false;
  24383. }
  24384. }
  24385. if (prevDeps === null) {
  24386. {
  24387. error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
  24388. }
  24389. return false;
  24390. }
  24391. {
  24392. // Don't bother comparing lengths in prod because these arrays should be
  24393. // passed inline.
  24394. if (nextDeps.length !== prevDeps.length) {
  24395. error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + prevDeps.join(', ') + "]", "[" + nextDeps.join(', ') + "]");
  24396. }
  24397. }
  24398. for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
  24399. if (objectIs(nextDeps[i], prevDeps[i])) {
  24400. continue;
  24401. }
  24402. return false;
  24403. }
  24404. return true;
  24405. }
  24406. function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderExpirationTime) {
  24407. renderExpirationTime = nextRenderExpirationTime;
  24408. currentlyRenderingFiber$1 = workInProgress;
  24409. {
  24410. hookTypesDev = current !== null ? current._debugHookTypes : null;
  24411. hookTypesUpdateIndexDev = -1; // Used for hot reloading:
  24412. ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;
  24413. }
  24414. workInProgress.memoizedState = null;
  24415. workInProgress.updateQueue = null;
  24416. workInProgress.expirationTime = NoWork; // The following should have already been reset
  24417. // currentHook = null;
  24418. // workInProgressHook = null;
  24419. // didScheduleRenderPhaseUpdate = false;
  24420. // TODO Warn if no hooks are used at all during mount, then some are used during update.
  24421. // Currently we will identify the update render as a mount because memoizedState === null.
  24422. // This is tricky because it's valid for certain types of components (e.g. React.lazy)
  24423. // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used.
  24424. // Non-stateful hooks (e.g. context) don't get added to memoizedState,
  24425. // so memoizedState would be null during updates and mounts.
  24426. {
  24427. if (current !== null && current.memoizedState !== null) {
  24428. ReactCurrentDispatcher.current = HooksDispatcherOnUpdateInDEV;
  24429. } else if (hookTypesDev !== null) {
  24430. // This dispatcher handles an edge case where a component is updating,
  24431. // but no stateful hooks have been used.
  24432. // We want to match the production code behavior (which will use HooksDispatcherOnMount),
  24433. // but with the extra DEV validation to ensure hooks ordering hasn't changed.
  24434. // This dispatcher does that.
  24435. ReactCurrentDispatcher.current = HooksDispatcherOnMountWithHookTypesInDEV;
  24436. } else {
  24437. ReactCurrentDispatcher.current = HooksDispatcherOnMountInDEV;
  24438. }
  24439. }
  24440. var children = Component(props, secondArg); // Check if there was a render phase update
  24441. if (workInProgress.expirationTime === renderExpirationTime) {
  24442. // Keep rendering in a loop for as long as render phase updates continue to
  24443. // be scheduled. Use a counter to prevent infinite loops.
  24444. var numberOfReRenders = 0;
  24445. do {
  24446. workInProgress.expirationTime = NoWork;
  24447. if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
  24448. {
  24449. throw Error( "Too many re-renders. React limits the number of renders to prevent an infinite loop." );
  24450. }
  24451. }
  24452. numberOfReRenders += 1;
  24453. {
  24454. // Even when hot reloading, allow dependencies to stabilize
  24455. // after first render to prevent infinite render phase updates.
  24456. ignorePreviousDependencies = false;
  24457. } // Start over from the beginning of the list
  24458. currentHook = null;
  24459. workInProgressHook = null;
  24460. workInProgress.updateQueue = null;
  24461. {
  24462. // Also validate hook order for cascading updates.
  24463. hookTypesUpdateIndexDev = -1;
  24464. }
  24465. ReactCurrentDispatcher.current = HooksDispatcherOnRerenderInDEV ;
  24466. children = Component(props, secondArg);
  24467. } while (workInProgress.expirationTime === renderExpirationTime);
  24468. } // We can assume the previous dispatcher is always this one, since we set it
  24469. // at the beginning of the render phase and there's no re-entrancy.
  24470. ReactCurrentDispatcher.current = ContextOnlyDispatcher;
  24471. {
  24472. workInProgress._debugHookTypes = hookTypesDev;
  24473. } // This check uses currentHook so that it works the same in DEV and prod bundles.
  24474. // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
  24475. var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
  24476. renderExpirationTime = NoWork;
  24477. currentlyRenderingFiber$1 = null;
  24478. currentHook = null;
  24479. workInProgressHook = null;
  24480. {
  24481. currentHookNameInDev = null;
  24482. hookTypesDev = null;
  24483. hookTypesUpdateIndexDev = -1;
  24484. }
  24485. didScheduleRenderPhaseUpdate = false;
  24486. if (!!didRenderTooFewHooks) {
  24487. {
  24488. throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." );
  24489. }
  24490. }
  24491. return children;
  24492. }
  24493. function bailoutHooks(current, workInProgress, expirationTime) {
  24494. workInProgress.updateQueue = current.updateQueue;
  24495. workInProgress.effectTag &= ~(Passive | Update);
  24496. if (current.expirationTime <= expirationTime) {
  24497. current.expirationTime = NoWork;
  24498. }
  24499. }
  24500. function resetHooksAfterThrow() {
  24501. // We can assume the previous dispatcher is always this one, since we set it
  24502. // at the beginning of the render phase and there's no re-entrancy.
  24503. ReactCurrentDispatcher.current = ContextOnlyDispatcher;
  24504. if (didScheduleRenderPhaseUpdate) {
  24505. // There were render phase updates. These are only valid for this render
  24506. // phase, which we are now aborting. Remove the updates from the queues so
  24507. // they do not persist to the next render. Do not remove updates from hooks
  24508. // that weren't processed.
  24509. //
  24510. // Only reset the updates from the queue if it has a clone. If it does
  24511. // not have a clone, that means it wasn't processed, and the updates were
  24512. // scheduled before we entered the render phase.
  24513. var hook = currentlyRenderingFiber$1.memoizedState;
  24514. while (hook !== null) {
  24515. var queue = hook.queue;
  24516. if (queue !== null) {
  24517. queue.pending = null;
  24518. }
  24519. hook = hook.next;
  24520. }
  24521. }
  24522. renderExpirationTime = NoWork;
  24523. currentlyRenderingFiber$1 = null;
  24524. currentHook = null;
  24525. workInProgressHook = null;
  24526. {
  24527. hookTypesDev = null;
  24528. hookTypesUpdateIndexDev = -1;
  24529. currentHookNameInDev = null;
  24530. }
  24531. didScheduleRenderPhaseUpdate = false;
  24532. }
  24533. function mountWorkInProgressHook() {
  24534. var hook = {
  24535. memoizedState: null,
  24536. baseState: null,
  24537. baseQueue: null,
  24538. queue: null,
  24539. next: null
  24540. };
  24541. if (workInProgressHook === null) {
  24542. // This is the first hook in the list
  24543. currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
  24544. } else {
  24545. // Append to the end of the list
  24546. workInProgressHook = workInProgressHook.next = hook;
  24547. }
  24548. return workInProgressHook;
  24549. }
  24550. function updateWorkInProgressHook() {
  24551. // This function is used both for updates and for re-renders triggered by a
  24552. // render phase update. It assumes there is either a current hook we can
  24553. // clone, or a work-in-progress hook from a previous render pass that we can
  24554. // use as a base. When we reach the end of the base list, we must switch to
  24555. // the dispatcher used for mounts.
  24556. var nextCurrentHook;
  24557. if (currentHook === null) {
  24558. var current = currentlyRenderingFiber$1.alternate;
  24559. if (current !== null) {
  24560. nextCurrentHook = current.memoizedState;
  24561. } else {
  24562. nextCurrentHook = null;
  24563. }
  24564. } else {
  24565. nextCurrentHook = currentHook.next;
  24566. }
  24567. var nextWorkInProgressHook;
  24568. if (workInProgressHook === null) {
  24569. nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
  24570. } else {
  24571. nextWorkInProgressHook = workInProgressHook.next;
  24572. }
  24573. if (nextWorkInProgressHook !== null) {
  24574. // There's already a work-in-progress. Reuse it.
  24575. workInProgressHook = nextWorkInProgressHook;
  24576. nextWorkInProgressHook = workInProgressHook.next;
  24577. currentHook = nextCurrentHook;
  24578. } else {
  24579. // Clone from the current hook.
  24580. if (!(nextCurrentHook !== null)) {
  24581. {
  24582. throw Error( "Rendered more hooks than during the previous render." );
  24583. }
  24584. }
  24585. currentHook = nextCurrentHook;
  24586. var newHook = {
  24587. memoizedState: currentHook.memoizedState,
  24588. baseState: currentHook.baseState,
  24589. baseQueue: currentHook.baseQueue,
  24590. queue: currentHook.queue,
  24591. next: null
  24592. };
  24593. if (workInProgressHook === null) {
  24594. // This is the first hook in the list.
  24595. currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
  24596. } else {
  24597. // Append to the end of the list.
  24598. workInProgressHook = workInProgressHook.next = newHook;
  24599. }
  24600. }
  24601. return workInProgressHook;
  24602. }
  24603. function createFunctionComponentUpdateQueue() {
  24604. return {
  24605. lastEffect: null
  24606. };
  24607. }
  24608. function basicStateReducer(state, action) {
  24609. // $FlowFixMe: Flow doesn't like mixed types
  24610. return typeof action === 'function' ? action(state) : action;
  24611. }
  24612. function mountReducer(reducer, initialArg, init) {
  24613. var hook = mountWorkInProgressHook();
  24614. var initialState;
  24615. if (init !== undefined) {
  24616. initialState = init(initialArg);
  24617. } else {
  24618. initialState = initialArg;
  24619. }
  24620. hook.memoizedState = hook.baseState = initialState;
  24621. var queue = hook.queue = {
  24622. pending: null,
  24623. dispatch: null,
  24624. lastRenderedReducer: reducer,
  24625. lastRenderedState: initialState
  24626. };
  24627. var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
  24628. return [hook.memoizedState, dispatch];
  24629. }
  24630. function updateReducer(reducer, initialArg, init) {
  24631. var hook = updateWorkInProgressHook();
  24632. var queue = hook.queue;
  24633. if (!(queue !== null)) {
  24634. {
  24635. throw Error( "Should have a queue. This is likely a bug in React. Please file an issue." );
  24636. }
  24637. }
  24638. queue.lastRenderedReducer = reducer;
  24639. var current = currentHook; // The last rebase update that is NOT part of the base state.
  24640. var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet.
  24641. var pendingQueue = queue.pending;
  24642. if (pendingQueue !== null) {
  24643. // We have new updates that haven't been processed yet.
  24644. // We'll add them to the base queue.
  24645. if (baseQueue !== null) {
  24646. // Merge the pending queue and the base queue.
  24647. var baseFirst = baseQueue.next;
  24648. var pendingFirst = pendingQueue.next;
  24649. baseQueue.next = pendingFirst;
  24650. pendingQueue.next = baseFirst;
  24651. }
  24652. current.baseQueue = baseQueue = pendingQueue;
  24653. queue.pending = null;
  24654. }
  24655. if (baseQueue !== null) {
  24656. // We have a queue to process.
  24657. var first = baseQueue.next;
  24658. var newState = current.baseState;
  24659. var newBaseState = null;
  24660. var newBaseQueueFirst = null;
  24661. var newBaseQueueLast = null;
  24662. var update = first;
  24663. do {
  24664. var updateExpirationTime = update.expirationTime;
  24665. if (updateExpirationTime < renderExpirationTime) {
  24666. // Priority is insufficient. Skip this update. If this is the first
  24667. // skipped update, the previous update/state is the new base
  24668. // update/state.
  24669. var clone = {
  24670. expirationTime: update.expirationTime,
  24671. suspenseConfig: update.suspenseConfig,
  24672. action: update.action,
  24673. eagerReducer: update.eagerReducer,
  24674. eagerState: update.eagerState,
  24675. next: null
  24676. };
  24677. if (newBaseQueueLast === null) {
  24678. newBaseQueueFirst = newBaseQueueLast = clone;
  24679. newBaseState = newState;
  24680. } else {
  24681. newBaseQueueLast = newBaseQueueLast.next = clone;
  24682. } // Update the remaining priority in the queue.
  24683. if (updateExpirationTime > currentlyRenderingFiber$1.expirationTime) {
  24684. currentlyRenderingFiber$1.expirationTime = updateExpirationTime;
  24685. markUnprocessedUpdateTime(updateExpirationTime);
  24686. }
  24687. } else {
  24688. // This update does have sufficient priority.
  24689. if (newBaseQueueLast !== null) {
  24690. var _clone = {
  24691. expirationTime: Sync,
  24692. // This update is going to be committed so we never want uncommit it.
  24693. suspenseConfig: update.suspenseConfig,
  24694. action: update.action,
  24695. eagerReducer: update.eagerReducer,
  24696. eagerState: update.eagerState,
  24697. next: null
  24698. };
  24699. newBaseQueueLast = newBaseQueueLast.next = _clone;
  24700. } // Mark the event time of this update as relevant to this render pass.
  24701. // TODO: This should ideally use the true event time of this update rather than
  24702. // its priority which is a derived and not reverseable value.
  24703. // TODO: We should skip this update if it was already committed but currently
  24704. // we have no way of detecting the difference between a committed and suspended
  24705. // update here.
  24706. markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process this update.
  24707. if (update.eagerReducer === reducer) {
  24708. // If this update was processed eagerly, and its reducer matches the
  24709. // current reducer, we can use the eagerly computed state.
  24710. newState = update.eagerState;
  24711. } else {
  24712. var action = update.action;
  24713. newState = reducer(newState, action);
  24714. }
  24715. }
  24716. update = update.next;
  24717. } while (update !== null && update !== first);
  24718. if (newBaseQueueLast === null) {
  24719. newBaseState = newState;
  24720. } else {
  24721. newBaseQueueLast.next = newBaseQueueFirst;
  24722. } // Mark that the fiber performed work, but only if the new state is
  24723. // different from the current state.
  24724. if (!objectIs(newState, hook.memoizedState)) {
  24725. markWorkInProgressReceivedUpdate();
  24726. }
  24727. hook.memoizedState = newState;
  24728. hook.baseState = newBaseState;
  24729. hook.baseQueue = newBaseQueueLast;
  24730. queue.lastRenderedState = newState;
  24731. }
  24732. var dispatch = queue.dispatch;
  24733. return [hook.memoizedState, dispatch];
  24734. }
  24735. function rerenderReducer(reducer, initialArg, init) {
  24736. var hook = updateWorkInProgressHook();
  24737. var queue = hook.queue;
  24738. if (!(queue !== null)) {
  24739. {
  24740. throw Error( "Should have a queue. This is likely a bug in React. Please file an issue." );
  24741. }
  24742. }
  24743. queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous
  24744. // work-in-progress hook.
  24745. var dispatch = queue.dispatch;
  24746. var lastRenderPhaseUpdate = queue.pending;
  24747. var newState = hook.memoizedState;
  24748. if (lastRenderPhaseUpdate !== null) {
  24749. // The queue doesn't persist past this render pass.
  24750. queue.pending = null;
  24751. var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
  24752. var update = firstRenderPhaseUpdate;
  24753. do {
  24754. // Process this render phase update. We don't have to check the
  24755. // priority because it will always be the same as the current
  24756. // render's.
  24757. var action = update.action;
  24758. newState = reducer(newState, action);
  24759. update = update.next;
  24760. } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is
  24761. // different from the current state.
  24762. if (!objectIs(newState, hook.memoizedState)) {
  24763. markWorkInProgressReceivedUpdate();
  24764. }
  24765. hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to
  24766. // the base state unless the queue is empty.
  24767. // TODO: Not sure if this is the desired semantics, but it's what we
  24768. // do for gDSFP. I can't remember why.
  24769. if (hook.baseQueue === null) {
  24770. hook.baseState = newState;
  24771. }
  24772. queue.lastRenderedState = newState;
  24773. }
  24774. return [newState, dispatch];
  24775. }
  24776. function mountState(initialState) {
  24777. var hook = mountWorkInProgressHook();
  24778. if (typeof initialState === 'function') {
  24779. // $FlowFixMe: Flow doesn't like mixed types
  24780. initialState = initialState();
  24781. }
  24782. hook.memoizedState = hook.baseState = initialState;
  24783. var queue = hook.queue = {
  24784. pending: null,
  24785. dispatch: null,
  24786. lastRenderedReducer: basicStateReducer,
  24787. lastRenderedState: initialState
  24788. };
  24789. var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
  24790. return [hook.memoizedState, dispatch];
  24791. }
  24792. function updateState(initialState) {
  24793. return updateReducer(basicStateReducer);
  24794. }
  24795. function rerenderState(initialState) {
  24796. return rerenderReducer(basicStateReducer);
  24797. }
  24798. function pushEffect(tag, create, destroy, deps) {
  24799. var effect = {
  24800. tag: tag,
  24801. create: create,
  24802. destroy: destroy,
  24803. deps: deps,
  24804. // Circular
  24805. next: null
  24806. };
  24807. var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
  24808. if (componentUpdateQueue === null) {
  24809. componentUpdateQueue = createFunctionComponentUpdateQueue();
  24810. currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
  24811. componentUpdateQueue.lastEffect = effect.next = effect;
  24812. } else {
  24813. var lastEffect = componentUpdateQueue.lastEffect;
  24814. if (lastEffect === null) {
  24815. componentUpdateQueue.lastEffect = effect.next = effect;
  24816. } else {
  24817. var firstEffect = lastEffect.next;
  24818. lastEffect.next = effect;
  24819. effect.next = firstEffect;
  24820. componentUpdateQueue.lastEffect = effect;
  24821. }
  24822. }
  24823. return effect;
  24824. }
  24825. function mountRef(initialValue) {
  24826. var hook = mountWorkInProgressHook();
  24827. var ref = {
  24828. current: initialValue
  24829. };
  24830. {
  24831. Object.seal(ref);
  24832. }
  24833. hook.memoizedState = ref;
  24834. return ref;
  24835. }
  24836. function updateRef(initialValue) {
  24837. var hook = updateWorkInProgressHook();
  24838. return hook.memoizedState;
  24839. }
  24840. function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  24841. var hook = mountWorkInProgressHook();
  24842. var nextDeps = deps === undefined ? null : deps;
  24843. currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
  24844. hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, undefined, nextDeps);
  24845. }
  24846. function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  24847. var hook = updateWorkInProgressHook();
  24848. var nextDeps = deps === undefined ? null : deps;
  24849. var destroy = undefined;
  24850. if (currentHook !== null) {
  24851. var prevEffect = currentHook.memoizedState;
  24852. destroy = prevEffect.destroy;
  24853. if (nextDeps !== null) {
  24854. var prevDeps = prevEffect.deps;
  24855. if (areHookInputsEqual(nextDeps, prevDeps)) {
  24856. pushEffect(hookEffectTag, create, destroy, nextDeps);
  24857. return;
  24858. }
  24859. }
  24860. }
  24861. currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
  24862. hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, destroy, nextDeps);
  24863. }
  24864. function mountEffect(create, deps) {
  24865. {
  24866. // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
  24867. if ('undefined' !== typeof jest) {
  24868. warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
  24869. }
  24870. }
  24871. return mountEffectImpl(Update | Passive, Passive$1, create, deps);
  24872. }
  24873. function updateEffect(create, deps) {
  24874. {
  24875. // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
  24876. if ('undefined' !== typeof jest) {
  24877. warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
  24878. }
  24879. }
  24880. return updateEffectImpl(Update | Passive, Passive$1, create, deps);
  24881. }
  24882. function mountLayoutEffect(create, deps) {
  24883. return mountEffectImpl(Update, Layout, create, deps);
  24884. }
  24885. function updateLayoutEffect(create, deps) {
  24886. return updateEffectImpl(Update, Layout, create, deps);
  24887. }
  24888. function imperativeHandleEffect(create, ref) {
  24889. if (typeof ref === 'function') {
  24890. var refCallback = ref;
  24891. var _inst = create();
  24892. refCallback(_inst);
  24893. return function () {
  24894. refCallback(null);
  24895. };
  24896. } else if (ref !== null && ref !== undefined) {
  24897. var refObject = ref;
  24898. {
  24899. if (!refObject.hasOwnProperty('current')) {
  24900. error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}');
  24901. }
  24902. }
  24903. var _inst2 = create();
  24904. refObject.current = _inst2;
  24905. return function () {
  24906. refObject.current = null;
  24907. };
  24908. }
  24909. }
  24910. function mountImperativeHandle(ref, create, deps) {
  24911. {
  24912. if (typeof create !== 'function') {
  24913. error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');
  24914. }
  24915. } // TODO: If deps are provided, should we skip comparing the ref itself?
  24916. var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
  24917. return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
  24918. }
  24919. function updateImperativeHandle(ref, create, deps) {
  24920. {
  24921. if (typeof create !== 'function') {
  24922. error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');
  24923. }
  24924. } // TODO: If deps are provided, should we skip comparing the ref itself?
  24925. var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
  24926. return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
  24927. }
  24928. function mountDebugValue(value, formatterFn) {// This hook is normally a no-op.
  24929. // The react-debug-hooks package injects its own implementation
  24930. // so that e.g. DevTools can display custom hook values.
  24931. }
  24932. var updateDebugValue = mountDebugValue;
  24933. function mountCallback(callback, deps) {
  24934. var hook = mountWorkInProgressHook();
  24935. var nextDeps = deps === undefined ? null : deps;
  24936. hook.memoizedState = [callback, nextDeps];
  24937. return callback;
  24938. }
  24939. function updateCallback(callback, deps) {
  24940. var hook = updateWorkInProgressHook();
  24941. var nextDeps = deps === undefined ? null : deps;
  24942. var prevState = hook.memoizedState;
  24943. if (prevState !== null) {
  24944. if (nextDeps !== null) {
  24945. var prevDeps = prevState[1];
  24946. if (areHookInputsEqual(nextDeps, prevDeps)) {
  24947. return prevState[0];
  24948. }
  24949. }
  24950. }
  24951. hook.memoizedState = [callback, nextDeps];
  24952. return callback;
  24953. }
  24954. function mountMemo(nextCreate, deps) {
  24955. var hook = mountWorkInProgressHook();
  24956. var nextDeps = deps === undefined ? null : deps;
  24957. var nextValue = nextCreate();
  24958. hook.memoizedState = [nextValue, nextDeps];
  24959. return nextValue;
  24960. }
  24961. function updateMemo(nextCreate, deps) {
  24962. var hook = updateWorkInProgressHook();
  24963. var nextDeps = deps === undefined ? null : deps;
  24964. var prevState = hook.memoizedState;
  24965. if (prevState !== null) {
  24966. // Assume these are defined. If they're not, areHookInputsEqual will warn.
  24967. if (nextDeps !== null) {
  24968. var prevDeps = prevState[1];
  24969. if (areHookInputsEqual(nextDeps, prevDeps)) {
  24970. return prevState[0];
  24971. }
  24972. }
  24973. }
  24974. var nextValue = nextCreate();
  24975. hook.memoizedState = [nextValue, nextDeps];
  24976. return nextValue;
  24977. }
  24978. function mountDeferredValue(value, config) {
  24979. var _mountState = mountState(value),
  24980. prevValue = _mountState[0],
  24981. setValue = _mountState[1];
  24982. mountEffect(function () {
  24983. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  24984. ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
  24985. try {
  24986. setValue(value);
  24987. } finally {
  24988. ReactCurrentBatchConfig$1.suspense = previousConfig;
  24989. }
  24990. }, [value, config]);
  24991. return prevValue;
  24992. }
  24993. function updateDeferredValue(value, config) {
  24994. var _updateState = updateState(),
  24995. prevValue = _updateState[0],
  24996. setValue = _updateState[1];
  24997. updateEffect(function () {
  24998. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  24999. ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
  25000. try {
  25001. setValue(value);
  25002. } finally {
  25003. ReactCurrentBatchConfig$1.suspense = previousConfig;
  25004. }
  25005. }, [value, config]);
  25006. return prevValue;
  25007. }
  25008. function rerenderDeferredValue(value, config) {
  25009. var _rerenderState = rerenderState(),
  25010. prevValue = _rerenderState[0],
  25011. setValue = _rerenderState[1];
  25012. updateEffect(function () {
  25013. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  25014. ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
  25015. try {
  25016. setValue(value);
  25017. } finally {
  25018. ReactCurrentBatchConfig$1.suspense = previousConfig;
  25019. }
  25020. }, [value, config]);
  25021. return prevValue;
  25022. }
  25023. function startTransition(setPending, config, callback) {
  25024. var priorityLevel = getCurrentPriorityLevel();
  25025. runWithPriority$1(priorityLevel < UserBlockingPriority$1 ? UserBlockingPriority$1 : priorityLevel, function () {
  25026. setPending(true);
  25027. });
  25028. runWithPriority$1(priorityLevel > NormalPriority ? NormalPriority : priorityLevel, function () {
  25029. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  25030. ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
  25031. try {
  25032. setPending(false);
  25033. callback();
  25034. } finally {
  25035. ReactCurrentBatchConfig$1.suspense = previousConfig;
  25036. }
  25037. });
  25038. }
  25039. function mountTransition(config) {
  25040. var _mountState2 = mountState(false),
  25041. isPending = _mountState2[0],
  25042. setPending = _mountState2[1];
  25043. var start = mountCallback(startTransition.bind(null, setPending, config), [setPending, config]);
  25044. return [start, isPending];
  25045. }
  25046. function updateTransition(config) {
  25047. var _updateState2 = updateState(),
  25048. isPending = _updateState2[0],
  25049. setPending = _updateState2[1];
  25050. var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]);
  25051. return [start, isPending];
  25052. }
  25053. function rerenderTransition(config) {
  25054. var _rerenderState2 = rerenderState(),
  25055. isPending = _rerenderState2[0],
  25056. setPending = _rerenderState2[1];
  25057. var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]);
  25058. return [start, isPending];
  25059. }
  25060. function dispatchAction(fiber, queue, action) {
  25061. {
  25062. if (typeof arguments[3] === 'function') {
  25063. error("State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().');
  25064. }
  25065. }
  25066. var currentTime = requestCurrentTimeForUpdate();
  25067. var suspenseConfig = requestCurrentSuspenseConfig();
  25068. var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
  25069. var update = {
  25070. expirationTime: expirationTime,
  25071. suspenseConfig: suspenseConfig,
  25072. action: action,
  25073. eagerReducer: null,
  25074. eagerState: null,
  25075. next: null
  25076. };
  25077. {
  25078. update.priority = getCurrentPriorityLevel();
  25079. } // Append the update to the end of the list.
  25080. var pending = queue.pending;
  25081. if (pending === null) {
  25082. // This is the first update. Create a circular list.
  25083. update.next = update;
  25084. } else {
  25085. update.next = pending.next;
  25086. pending.next = update;
  25087. }
  25088. queue.pending = update;
  25089. var alternate = fiber.alternate;
  25090. if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
  25091. // This is a render phase update. Stash it in a lazily-created map of
  25092. // queue -> linked list of updates. After this render pass, we'll restart
  25093. // and apply the stashed updates on top of the work-in-progress hook.
  25094. didScheduleRenderPhaseUpdate = true;
  25095. update.expirationTime = renderExpirationTime;
  25096. currentlyRenderingFiber$1.expirationTime = renderExpirationTime;
  25097. } else {
  25098. if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) {
  25099. // The queue is currently empty, which means we can eagerly compute the
  25100. // next state before entering the render phase. If the new state is the
  25101. // same as the current state, we may be able to bail out entirely.
  25102. var lastRenderedReducer = queue.lastRenderedReducer;
  25103. if (lastRenderedReducer !== null) {
  25104. var prevDispatcher;
  25105. {
  25106. prevDispatcher = ReactCurrentDispatcher.current;
  25107. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  25108. }
  25109. try {
  25110. var currentState = queue.lastRenderedState;
  25111. var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute
  25112. // it, on the update object. If the reducer hasn't changed by the
  25113. // time we enter the render phase, then the eager state can be used
  25114. // without calling the reducer again.
  25115. update.eagerReducer = lastRenderedReducer;
  25116. update.eagerState = eagerState;
  25117. if (objectIs(eagerState, currentState)) {
  25118. // Fast path. We can bail out without scheduling React to re-render.
  25119. // It's still possible that we'll need to rebase this update later,
  25120. // if the component re-renders for a different reason and by that
  25121. // time the reducer has changed.
  25122. return;
  25123. }
  25124. } catch (error) {// Suppress the error. It will throw again in the render phase.
  25125. } finally {
  25126. {
  25127. ReactCurrentDispatcher.current = prevDispatcher;
  25128. }
  25129. }
  25130. }
  25131. }
  25132. {
  25133. // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
  25134. if ('undefined' !== typeof jest) {
  25135. warnIfNotScopedWithMatchingAct(fiber);
  25136. warnIfNotCurrentlyActingUpdatesInDev(fiber);
  25137. }
  25138. }
  25139. scheduleWork(fiber, expirationTime);
  25140. }
  25141. }
  25142. var ContextOnlyDispatcher = {
  25143. readContext: readContext,
  25144. useCallback: throwInvalidHookError,
  25145. useContext: throwInvalidHookError,
  25146. useEffect: throwInvalidHookError,
  25147. useImperativeHandle: throwInvalidHookError,
  25148. useLayoutEffect: throwInvalidHookError,
  25149. useMemo: throwInvalidHookError,
  25150. useReducer: throwInvalidHookError,
  25151. useRef: throwInvalidHookError,
  25152. useState: throwInvalidHookError,
  25153. useDebugValue: throwInvalidHookError,
  25154. useResponder: throwInvalidHookError,
  25155. useDeferredValue: throwInvalidHookError,
  25156. useTransition: throwInvalidHookError
  25157. };
  25158. var HooksDispatcherOnMountInDEV = null;
  25159. var HooksDispatcherOnMountWithHookTypesInDEV = null;
  25160. var HooksDispatcherOnUpdateInDEV = null;
  25161. var HooksDispatcherOnRerenderInDEV = null;
  25162. var InvalidNestedHooksDispatcherOnMountInDEV = null;
  25163. var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
  25164. var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
  25165. {
  25166. var warnInvalidContextAccess = function () {
  25167. error('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().');
  25168. };
  25169. var warnInvalidHookAccess = function () {
  25170. error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks');
  25171. };
  25172. HooksDispatcherOnMountInDEV = {
  25173. readContext: function (context, observedBits) {
  25174. return readContext(context, observedBits);
  25175. },
  25176. useCallback: function (callback, deps) {
  25177. currentHookNameInDev = 'useCallback';
  25178. mountHookTypesDev();
  25179. checkDepsAreArrayDev(deps);
  25180. return mountCallback(callback, deps);
  25181. },
  25182. useContext: function (context, observedBits) {
  25183. currentHookNameInDev = 'useContext';
  25184. mountHookTypesDev();
  25185. return readContext(context, observedBits);
  25186. },
  25187. useEffect: function (create, deps) {
  25188. currentHookNameInDev = 'useEffect';
  25189. mountHookTypesDev();
  25190. checkDepsAreArrayDev(deps);
  25191. return mountEffect(create, deps);
  25192. },
  25193. useImperativeHandle: function (ref, create, deps) {
  25194. currentHookNameInDev = 'useImperativeHandle';
  25195. mountHookTypesDev();
  25196. checkDepsAreArrayDev(deps);
  25197. return mountImperativeHandle(ref, create, deps);
  25198. },
  25199. useLayoutEffect: function (create, deps) {
  25200. currentHookNameInDev = 'useLayoutEffect';
  25201. mountHookTypesDev();
  25202. checkDepsAreArrayDev(deps);
  25203. return mountLayoutEffect(create, deps);
  25204. },
  25205. useMemo: function (create, deps) {
  25206. currentHookNameInDev = 'useMemo';
  25207. mountHookTypesDev();
  25208. checkDepsAreArrayDev(deps);
  25209. var prevDispatcher = ReactCurrentDispatcher.current;
  25210. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
  25211. try {
  25212. return mountMemo(create, deps);
  25213. } finally {
  25214. ReactCurrentDispatcher.current = prevDispatcher;
  25215. }
  25216. },
  25217. useReducer: function (reducer, initialArg, init) {
  25218. currentHookNameInDev = 'useReducer';
  25219. mountHookTypesDev();
  25220. var prevDispatcher = ReactCurrentDispatcher.current;
  25221. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
  25222. try {
  25223. return mountReducer(reducer, initialArg, init);
  25224. } finally {
  25225. ReactCurrentDispatcher.current = prevDispatcher;
  25226. }
  25227. },
  25228. useRef: function (initialValue) {
  25229. currentHookNameInDev = 'useRef';
  25230. mountHookTypesDev();
  25231. return mountRef(initialValue);
  25232. },
  25233. useState: function (initialState) {
  25234. currentHookNameInDev = 'useState';
  25235. mountHookTypesDev();
  25236. var prevDispatcher = ReactCurrentDispatcher.current;
  25237. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
  25238. try {
  25239. return mountState(initialState);
  25240. } finally {
  25241. ReactCurrentDispatcher.current = prevDispatcher;
  25242. }
  25243. },
  25244. useDebugValue: function (value, formatterFn) {
  25245. currentHookNameInDev = 'useDebugValue';
  25246. mountHookTypesDev();
  25247. return mountDebugValue();
  25248. },
  25249. useResponder: function (responder, props) {
  25250. currentHookNameInDev = 'useResponder';
  25251. mountHookTypesDev();
  25252. return createDeprecatedResponderListener(responder, props);
  25253. },
  25254. useDeferredValue: function (value, config) {
  25255. currentHookNameInDev = 'useDeferredValue';
  25256. mountHookTypesDev();
  25257. return mountDeferredValue(value, config);
  25258. },
  25259. useTransition: function (config) {
  25260. currentHookNameInDev = 'useTransition';
  25261. mountHookTypesDev();
  25262. return mountTransition(config);
  25263. }
  25264. };
  25265. HooksDispatcherOnMountWithHookTypesInDEV = {
  25266. readContext: function (context, observedBits) {
  25267. return readContext(context, observedBits);
  25268. },
  25269. useCallback: function (callback, deps) {
  25270. currentHookNameInDev = 'useCallback';
  25271. updateHookTypesDev();
  25272. return mountCallback(callback, deps);
  25273. },
  25274. useContext: function (context, observedBits) {
  25275. currentHookNameInDev = 'useContext';
  25276. updateHookTypesDev();
  25277. return readContext(context, observedBits);
  25278. },
  25279. useEffect: function (create, deps) {
  25280. currentHookNameInDev = 'useEffect';
  25281. updateHookTypesDev();
  25282. return mountEffect(create, deps);
  25283. },
  25284. useImperativeHandle: function (ref, create, deps) {
  25285. currentHookNameInDev = 'useImperativeHandle';
  25286. updateHookTypesDev();
  25287. return mountImperativeHandle(ref, create, deps);
  25288. },
  25289. useLayoutEffect: function (create, deps) {
  25290. currentHookNameInDev = 'useLayoutEffect';
  25291. updateHookTypesDev();
  25292. return mountLayoutEffect(create, deps);
  25293. },
  25294. useMemo: function (create, deps) {
  25295. currentHookNameInDev = 'useMemo';
  25296. updateHookTypesDev();
  25297. var prevDispatcher = ReactCurrentDispatcher.current;
  25298. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
  25299. try {
  25300. return mountMemo(create, deps);
  25301. } finally {
  25302. ReactCurrentDispatcher.current = prevDispatcher;
  25303. }
  25304. },
  25305. useReducer: function (reducer, initialArg, init) {
  25306. currentHookNameInDev = 'useReducer';
  25307. updateHookTypesDev();
  25308. var prevDispatcher = ReactCurrentDispatcher.current;
  25309. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
  25310. try {
  25311. return mountReducer(reducer, initialArg, init);
  25312. } finally {
  25313. ReactCurrentDispatcher.current = prevDispatcher;
  25314. }
  25315. },
  25316. useRef: function (initialValue) {
  25317. currentHookNameInDev = 'useRef';
  25318. updateHookTypesDev();
  25319. return mountRef(initialValue);
  25320. },
  25321. useState: function (initialState) {
  25322. currentHookNameInDev = 'useState';
  25323. updateHookTypesDev();
  25324. var prevDispatcher = ReactCurrentDispatcher.current;
  25325. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
  25326. try {
  25327. return mountState(initialState);
  25328. } finally {
  25329. ReactCurrentDispatcher.current = prevDispatcher;
  25330. }
  25331. },
  25332. useDebugValue: function (value, formatterFn) {
  25333. currentHookNameInDev = 'useDebugValue';
  25334. updateHookTypesDev();
  25335. return mountDebugValue();
  25336. },
  25337. useResponder: function (responder, props) {
  25338. currentHookNameInDev = 'useResponder';
  25339. updateHookTypesDev();
  25340. return createDeprecatedResponderListener(responder, props);
  25341. },
  25342. useDeferredValue: function (value, config) {
  25343. currentHookNameInDev = 'useDeferredValue';
  25344. updateHookTypesDev();
  25345. return mountDeferredValue(value, config);
  25346. },
  25347. useTransition: function (config) {
  25348. currentHookNameInDev = 'useTransition';
  25349. updateHookTypesDev();
  25350. return mountTransition(config);
  25351. }
  25352. };
  25353. HooksDispatcherOnUpdateInDEV = {
  25354. readContext: function (context, observedBits) {
  25355. return readContext(context, observedBits);
  25356. },
  25357. useCallback: function (callback, deps) {
  25358. currentHookNameInDev = 'useCallback';
  25359. updateHookTypesDev();
  25360. return updateCallback(callback, deps);
  25361. },
  25362. useContext: function (context, observedBits) {
  25363. currentHookNameInDev = 'useContext';
  25364. updateHookTypesDev();
  25365. return readContext(context, observedBits);
  25366. },
  25367. useEffect: function (create, deps) {
  25368. currentHookNameInDev = 'useEffect';
  25369. updateHookTypesDev();
  25370. return updateEffect(create, deps);
  25371. },
  25372. useImperativeHandle: function (ref, create, deps) {
  25373. currentHookNameInDev = 'useImperativeHandle';
  25374. updateHookTypesDev();
  25375. return updateImperativeHandle(ref, create, deps);
  25376. },
  25377. useLayoutEffect: function (create, deps) {
  25378. currentHookNameInDev = 'useLayoutEffect';
  25379. updateHookTypesDev();
  25380. return updateLayoutEffect(create, deps);
  25381. },
  25382. useMemo: function (create, deps) {
  25383. currentHookNameInDev = 'useMemo';
  25384. updateHookTypesDev();
  25385. var prevDispatcher = ReactCurrentDispatcher.current;
  25386. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  25387. try {
  25388. return updateMemo(create, deps);
  25389. } finally {
  25390. ReactCurrentDispatcher.current = prevDispatcher;
  25391. }
  25392. },
  25393. useReducer: function (reducer, initialArg, init) {
  25394. currentHookNameInDev = 'useReducer';
  25395. updateHookTypesDev();
  25396. var prevDispatcher = ReactCurrentDispatcher.current;
  25397. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  25398. try {
  25399. return updateReducer(reducer, initialArg, init);
  25400. } finally {
  25401. ReactCurrentDispatcher.current = prevDispatcher;
  25402. }
  25403. },
  25404. useRef: function (initialValue) {
  25405. currentHookNameInDev = 'useRef';
  25406. updateHookTypesDev();
  25407. return updateRef();
  25408. },
  25409. useState: function (initialState) {
  25410. currentHookNameInDev = 'useState';
  25411. updateHookTypesDev();
  25412. var prevDispatcher = ReactCurrentDispatcher.current;
  25413. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  25414. try {
  25415. return updateState(initialState);
  25416. } finally {
  25417. ReactCurrentDispatcher.current = prevDispatcher;
  25418. }
  25419. },
  25420. useDebugValue: function (value, formatterFn) {
  25421. currentHookNameInDev = 'useDebugValue';
  25422. updateHookTypesDev();
  25423. return updateDebugValue();
  25424. },
  25425. useResponder: function (responder, props) {
  25426. currentHookNameInDev = 'useResponder';
  25427. updateHookTypesDev();
  25428. return createDeprecatedResponderListener(responder, props);
  25429. },
  25430. useDeferredValue: function (value, config) {
  25431. currentHookNameInDev = 'useDeferredValue';
  25432. updateHookTypesDev();
  25433. return updateDeferredValue(value, config);
  25434. },
  25435. useTransition: function (config) {
  25436. currentHookNameInDev = 'useTransition';
  25437. updateHookTypesDev();
  25438. return updateTransition(config);
  25439. }
  25440. };
  25441. HooksDispatcherOnRerenderInDEV = {
  25442. readContext: function (context, observedBits) {
  25443. return readContext(context, observedBits);
  25444. },
  25445. useCallback: function (callback, deps) {
  25446. currentHookNameInDev = 'useCallback';
  25447. updateHookTypesDev();
  25448. return updateCallback(callback, deps);
  25449. },
  25450. useContext: function (context, observedBits) {
  25451. currentHookNameInDev = 'useContext';
  25452. updateHookTypesDev();
  25453. return readContext(context, observedBits);
  25454. },
  25455. useEffect: function (create, deps) {
  25456. currentHookNameInDev = 'useEffect';
  25457. updateHookTypesDev();
  25458. return updateEffect(create, deps);
  25459. },
  25460. useImperativeHandle: function (ref, create, deps) {
  25461. currentHookNameInDev = 'useImperativeHandle';
  25462. updateHookTypesDev();
  25463. return updateImperativeHandle(ref, create, deps);
  25464. },
  25465. useLayoutEffect: function (create, deps) {
  25466. currentHookNameInDev = 'useLayoutEffect';
  25467. updateHookTypesDev();
  25468. return updateLayoutEffect(create, deps);
  25469. },
  25470. useMemo: function (create, deps) {
  25471. currentHookNameInDev = 'useMemo';
  25472. updateHookTypesDev();
  25473. var prevDispatcher = ReactCurrentDispatcher.current;
  25474. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
  25475. try {
  25476. return updateMemo(create, deps);
  25477. } finally {
  25478. ReactCurrentDispatcher.current = prevDispatcher;
  25479. }
  25480. },
  25481. useReducer: function (reducer, initialArg, init) {
  25482. currentHookNameInDev = 'useReducer';
  25483. updateHookTypesDev();
  25484. var prevDispatcher = ReactCurrentDispatcher.current;
  25485. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
  25486. try {
  25487. return rerenderReducer(reducer, initialArg, init);
  25488. } finally {
  25489. ReactCurrentDispatcher.current = prevDispatcher;
  25490. }
  25491. },
  25492. useRef: function (initialValue) {
  25493. currentHookNameInDev = 'useRef';
  25494. updateHookTypesDev();
  25495. return updateRef();
  25496. },
  25497. useState: function (initialState) {
  25498. currentHookNameInDev = 'useState';
  25499. updateHookTypesDev();
  25500. var prevDispatcher = ReactCurrentDispatcher.current;
  25501. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
  25502. try {
  25503. return rerenderState(initialState);
  25504. } finally {
  25505. ReactCurrentDispatcher.current = prevDispatcher;
  25506. }
  25507. },
  25508. useDebugValue: function (value, formatterFn) {
  25509. currentHookNameInDev = 'useDebugValue';
  25510. updateHookTypesDev();
  25511. return updateDebugValue();
  25512. },
  25513. useResponder: function (responder, props) {
  25514. currentHookNameInDev = 'useResponder';
  25515. updateHookTypesDev();
  25516. return createDeprecatedResponderListener(responder, props);
  25517. },
  25518. useDeferredValue: function (value, config) {
  25519. currentHookNameInDev = 'useDeferredValue';
  25520. updateHookTypesDev();
  25521. return rerenderDeferredValue(value, config);
  25522. },
  25523. useTransition: function (config) {
  25524. currentHookNameInDev = 'useTransition';
  25525. updateHookTypesDev();
  25526. return rerenderTransition(config);
  25527. }
  25528. };
  25529. InvalidNestedHooksDispatcherOnMountInDEV = {
  25530. readContext: function (context, observedBits) {
  25531. warnInvalidContextAccess();
  25532. return readContext(context, observedBits);
  25533. },
  25534. useCallback: function (callback, deps) {
  25535. currentHookNameInDev = 'useCallback';
  25536. warnInvalidHookAccess();
  25537. mountHookTypesDev();
  25538. return mountCallback(callback, deps);
  25539. },
  25540. useContext: function (context, observedBits) {
  25541. currentHookNameInDev = 'useContext';
  25542. warnInvalidHookAccess();
  25543. mountHookTypesDev();
  25544. return readContext(context, observedBits);
  25545. },
  25546. useEffect: function (create, deps) {
  25547. currentHookNameInDev = 'useEffect';
  25548. warnInvalidHookAccess();
  25549. mountHookTypesDev();
  25550. return mountEffect(create, deps);
  25551. },
  25552. useImperativeHandle: function (ref, create, deps) {
  25553. currentHookNameInDev = 'useImperativeHandle';
  25554. warnInvalidHookAccess();
  25555. mountHookTypesDev();
  25556. return mountImperativeHandle(ref, create, deps);
  25557. },
  25558. useLayoutEffect: function (create, deps) {
  25559. currentHookNameInDev = 'useLayoutEffect';
  25560. warnInvalidHookAccess();
  25561. mountHookTypesDev();
  25562. return mountLayoutEffect(create, deps);
  25563. },
  25564. useMemo: function (create, deps) {
  25565. currentHookNameInDev = 'useMemo';
  25566. warnInvalidHookAccess();
  25567. mountHookTypesDev();
  25568. var prevDispatcher = ReactCurrentDispatcher.current;
  25569. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
  25570. try {
  25571. return mountMemo(create, deps);
  25572. } finally {
  25573. ReactCurrentDispatcher.current = prevDispatcher;
  25574. }
  25575. },
  25576. useReducer: function (reducer, initialArg, init) {
  25577. currentHookNameInDev = 'useReducer';
  25578. warnInvalidHookAccess();
  25579. mountHookTypesDev();
  25580. var prevDispatcher = ReactCurrentDispatcher.current;
  25581. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
  25582. try {
  25583. return mountReducer(reducer, initialArg, init);
  25584. } finally {
  25585. ReactCurrentDispatcher.current = prevDispatcher;
  25586. }
  25587. },
  25588. useRef: function (initialValue) {
  25589. currentHookNameInDev = 'useRef';
  25590. warnInvalidHookAccess();
  25591. mountHookTypesDev();
  25592. return mountRef(initialValue);
  25593. },
  25594. useState: function (initialState) {
  25595. currentHookNameInDev = 'useState';
  25596. warnInvalidHookAccess();
  25597. mountHookTypesDev();
  25598. var prevDispatcher = ReactCurrentDispatcher.current;
  25599. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
  25600. try {
  25601. return mountState(initialState);
  25602. } finally {
  25603. ReactCurrentDispatcher.current = prevDispatcher;
  25604. }
  25605. },
  25606. useDebugValue: function (value, formatterFn) {
  25607. currentHookNameInDev = 'useDebugValue';
  25608. warnInvalidHookAccess();
  25609. mountHookTypesDev();
  25610. return mountDebugValue();
  25611. },
  25612. useResponder: function (responder, props) {
  25613. currentHookNameInDev = 'useResponder';
  25614. warnInvalidHookAccess();
  25615. mountHookTypesDev();
  25616. return createDeprecatedResponderListener(responder, props);
  25617. },
  25618. useDeferredValue: function (value, config) {
  25619. currentHookNameInDev = 'useDeferredValue';
  25620. warnInvalidHookAccess();
  25621. mountHookTypesDev();
  25622. return mountDeferredValue(value, config);
  25623. },
  25624. useTransition: function (config) {
  25625. currentHookNameInDev = 'useTransition';
  25626. warnInvalidHookAccess();
  25627. mountHookTypesDev();
  25628. return mountTransition(config);
  25629. }
  25630. };
  25631. InvalidNestedHooksDispatcherOnUpdateInDEV = {
  25632. readContext: function (context, observedBits) {
  25633. warnInvalidContextAccess();
  25634. return readContext(context, observedBits);
  25635. },
  25636. useCallback: function (callback, deps) {
  25637. currentHookNameInDev = 'useCallback';
  25638. warnInvalidHookAccess();
  25639. updateHookTypesDev();
  25640. return updateCallback(callback, deps);
  25641. },
  25642. useContext: function (context, observedBits) {
  25643. currentHookNameInDev = 'useContext';
  25644. warnInvalidHookAccess();
  25645. updateHookTypesDev();
  25646. return readContext(context, observedBits);
  25647. },
  25648. useEffect: function (create, deps) {
  25649. currentHookNameInDev = 'useEffect';
  25650. warnInvalidHookAccess();
  25651. updateHookTypesDev();
  25652. return updateEffect(create, deps);
  25653. },
  25654. useImperativeHandle: function (ref, create, deps) {
  25655. currentHookNameInDev = 'useImperativeHandle';
  25656. warnInvalidHookAccess();
  25657. updateHookTypesDev();
  25658. return updateImperativeHandle(ref, create, deps);
  25659. },
  25660. useLayoutEffect: function (create, deps) {
  25661. currentHookNameInDev = 'useLayoutEffect';
  25662. warnInvalidHookAccess();
  25663. updateHookTypesDev();
  25664. return updateLayoutEffect(create, deps);
  25665. },
  25666. useMemo: function (create, deps) {
  25667. currentHookNameInDev = 'useMemo';
  25668. warnInvalidHookAccess();
  25669. updateHookTypesDev();
  25670. var prevDispatcher = ReactCurrentDispatcher.current;
  25671. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  25672. try {
  25673. return updateMemo(create, deps);
  25674. } finally {
  25675. ReactCurrentDispatcher.current = prevDispatcher;
  25676. }
  25677. },
  25678. useReducer: function (reducer, initialArg, init) {
  25679. currentHookNameInDev = 'useReducer';
  25680. warnInvalidHookAccess();
  25681. updateHookTypesDev();
  25682. var prevDispatcher = ReactCurrentDispatcher.current;
  25683. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  25684. try {
  25685. return updateReducer(reducer, initialArg, init);
  25686. } finally {
  25687. ReactCurrentDispatcher.current = prevDispatcher;
  25688. }
  25689. },
  25690. useRef: function (initialValue) {
  25691. currentHookNameInDev = 'useRef';
  25692. warnInvalidHookAccess();
  25693. updateHookTypesDev();
  25694. return updateRef();
  25695. },
  25696. useState: function (initialState) {
  25697. currentHookNameInDev = 'useState';
  25698. warnInvalidHookAccess();
  25699. updateHookTypesDev();
  25700. var prevDispatcher = ReactCurrentDispatcher.current;
  25701. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  25702. try {
  25703. return updateState(initialState);
  25704. } finally {
  25705. ReactCurrentDispatcher.current = prevDispatcher;
  25706. }
  25707. },
  25708. useDebugValue: function (value, formatterFn) {
  25709. currentHookNameInDev = 'useDebugValue';
  25710. warnInvalidHookAccess();
  25711. updateHookTypesDev();
  25712. return updateDebugValue();
  25713. },
  25714. useResponder: function (responder, props) {
  25715. currentHookNameInDev = 'useResponder';
  25716. warnInvalidHookAccess();
  25717. updateHookTypesDev();
  25718. return createDeprecatedResponderListener(responder, props);
  25719. },
  25720. useDeferredValue: function (value, config) {
  25721. currentHookNameInDev = 'useDeferredValue';
  25722. warnInvalidHookAccess();
  25723. updateHookTypesDev();
  25724. return updateDeferredValue(value, config);
  25725. },
  25726. useTransition: function (config) {
  25727. currentHookNameInDev = 'useTransition';
  25728. warnInvalidHookAccess();
  25729. updateHookTypesDev();
  25730. return updateTransition(config);
  25731. }
  25732. };
  25733. InvalidNestedHooksDispatcherOnRerenderInDEV = {
  25734. readContext: function (context, observedBits) {
  25735. warnInvalidContextAccess();
  25736. return readContext(context, observedBits);
  25737. },
  25738. useCallback: function (callback, deps) {
  25739. currentHookNameInDev = 'useCallback';
  25740. warnInvalidHookAccess();
  25741. updateHookTypesDev();
  25742. return updateCallback(callback, deps);
  25743. },
  25744. useContext: function (context, observedBits) {
  25745. currentHookNameInDev = 'useContext';
  25746. warnInvalidHookAccess();
  25747. updateHookTypesDev();
  25748. return readContext(context, observedBits);
  25749. },
  25750. useEffect: function (create, deps) {
  25751. currentHookNameInDev = 'useEffect';
  25752. warnInvalidHookAccess();
  25753. updateHookTypesDev();
  25754. return updateEffect(create, deps);
  25755. },
  25756. useImperativeHandle: function (ref, create, deps) {
  25757. currentHookNameInDev = 'useImperativeHandle';
  25758. warnInvalidHookAccess();
  25759. updateHookTypesDev();
  25760. return updateImperativeHandle(ref, create, deps);
  25761. },
  25762. useLayoutEffect: function (create, deps) {
  25763. currentHookNameInDev = 'useLayoutEffect';
  25764. warnInvalidHookAccess();
  25765. updateHookTypesDev();
  25766. return updateLayoutEffect(create, deps);
  25767. },
  25768. useMemo: function (create, deps) {
  25769. currentHookNameInDev = 'useMemo';
  25770. warnInvalidHookAccess();
  25771. updateHookTypesDev();
  25772. var prevDispatcher = ReactCurrentDispatcher.current;
  25773. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  25774. try {
  25775. return updateMemo(create, deps);
  25776. } finally {
  25777. ReactCurrentDispatcher.current = prevDispatcher;
  25778. }
  25779. },
  25780. useReducer: function (reducer, initialArg, init) {
  25781. currentHookNameInDev = 'useReducer';
  25782. warnInvalidHookAccess();
  25783. updateHookTypesDev();
  25784. var prevDispatcher = ReactCurrentDispatcher.current;
  25785. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  25786. try {
  25787. return rerenderReducer(reducer, initialArg, init);
  25788. } finally {
  25789. ReactCurrentDispatcher.current = prevDispatcher;
  25790. }
  25791. },
  25792. useRef: function (initialValue) {
  25793. currentHookNameInDev = 'useRef';
  25794. warnInvalidHookAccess();
  25795. updateHookTypesDev();
  25796. return updateRef();
  25797. },
  25798. useState: function (initialState) {
  25799. currentHookNameInDev = 'useState';
  25800. warnInvalidHookAccess();
  25801. updateHookTypesDev();
  25802. var prevDispatcher = ReactCurrentDispatcher.current;
  25803. ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  25804. try {
  25805. return rerenderState(initialState);
  25806. } finally {
  25807. ReactCurrentDispatcher.current = prevDispatcher;
  25808. }
  25809. },
  25810. useDebugValue: function (value, formatterFn) {
  25811. currentHookNameInDev = 'useDebugValue';
  25812. warnInvalidHookAccess();
  25813. updateHookTypesDev();
  25814. return updateDebugValue();
  25815. },
  25816. useResponder: function (responder, props) {
  25817. currentHookNameInDev = 'useResponder';
  25818. warnInvalidHookAccess();
  25819. updateHookTypesDev();
  25820. return createDeprecatedResponderListener(responder, props);
  25821. },
  25822. useDeferredValue: function (value, config) {
  25823. currentHookNameInDev = 'useDeferredValue';
  25824. warnInvalidHookAccess();
  25825. updateHookTypesDev();
  25826. return rerenderDeferredValue(value, config);
  25827. },
  25828. useTransition: function (config) {
  25829. currentHookNameInDev = 'useTransition';
  25830. warnInvalidHookAccess();
  25831. updateHookTypesDev();
  25832. return rerenderTransition(config);
  25833. }
  25834. };
  25835. }
  25836. var now$1 = Scheduler.unstable_now;
  25837. var commitTime = 0;
  25838. var profilerStartTime = -1;
  25839. function getCommitTime() {
  25840. return commitTime;
  25841. }
  25842. function recordCommitTime() {
  25843. commitTime = now$1();
  25844. }
  25845. function startProfilerTimer(fiber) {
  25846. profilerStartTime = now$1();
  25847. if (fiber.actualStartTime < 0) {
  25848. fiber.actualStartTime = now$1();
  25849. }
  25850. }
  25851. function stopProfilerTimerIfRunning(fiber) {
  25852. profilerStartTime = -1;
  25853. }
  25854. function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
  25855. if (profilerStartTime >= 0) {
  25856. var elapsedTime = now$1() - profilerStartTime;
  25857. fiber.actualDuration += elapsedTime;
  25858. if (overrideBaseTime) {
  25859. fiber.selfBaseDuration = elapsedTime;
  25860. }
  25861. profilerStartTime = -1;
  25862. }
  25863. }
  25864. // This may have been an insertion or a hydration.
  25865. var hydrationParentFiber = null;
  25866. var nextHydratableInstance = null;
  25867. var isHydrating = false;
  25868. function enterHydrationState(fiber) {
  25869. var parentInstance = fiber.stateNode.containerInfo;
  25870. nextHydratableInstance = getFirstHydratableChild(parentInstance);
  25871. hydrationParentFiber = fiber;
  25872. isHydrating = true;
  25873. return true;
  25874. }
  25875. function deleteHydratableInstance(returnFiber, instance) {
  25876. {
  25877. switch (returnFiber.tag) {
  25878. case HostRoot:
  25879. didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
  25880. break;
  25881. case HostComponent:
  25882. didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
  25883. break;
  25884. }
  25885. }
  25886. var childToDelete = createFiberFromHostInstanceForDeletion();
  25887. childToDelete.stateNode = instance;
  25888. childToDelete.return = returnFiber;
  25889. childToDelete.effectTag = Deletion; // This might seem like it belongs on progressedFirstDeletion. However,
  25890. // these children are not part of the reconciliation list of children.
  25891. // Even if we abort and rereconcile the children, that will try to hydrate
  25892. // again and the nodes are still in the host tree so these will be
  25893. // recreated.
  25894. if (returnFiber.lastEffect !== null) {
  25895. returnFiber.lastEffect.nextEffect = childToDelete;
  25896. returnFiber.lastEffect = childToDelete;
  25897. } else {
  25898. returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
  25899. }
  25900. }
  25901. function insertNonHydratedInstance(returnFiber, fiber) {
  25902. fiber.effectTag = fiber.effectTag & ~Hydrating | Placement;
  25903. {
  25904. switch (returnFiber.tag) {
  25905. case HostRoot:
  25906. {
  25907. var parentContainer = returnFiber.stateNode.containerInfo;
  25908. switch (fiber.tag) {
  25909. case HostComponent:
  25910. var type = fiber.type;
  25911. var props = fiber.pendingProps;
  25912. didNotFindHydratableContainerInstance(parentContainer, type);
  25913. break;
  25914. case HostText:
  25915. var text = fiber.pendingProps;
  25916. didNotFindHydratableContainerTextInstance(parentContainer, text);
  25917. break;
  25918. }
  25919. break;
  25920. }
  25921. case HostComponent:
  25922. {
  25923. var parentType = returnFiber.type;
  25924. var parentProps = returnFiber.memoizedProps;
  25925. var parentInstance = returnFiber.stateNode;
  25926. switch (fiber.tag) {
  25927. case HostComponent:
  25928. var _type = fiber.type;
  25929. var _props = fiber.pendingProps;
  25930. didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);
  25931. break;
  25932. case HostText:
  25933. var _text = fiber.pendingProps;
  25934. didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
  25935. break;
  25936. case SuspenseComponent:
  25937. didNotFindHydratableSuspenseInstance(parentType, parentProps);
  25938. break;
  25939. }
  25940. break;
  25941. }
  25942. default:
  25943. return;
  25944. }
  25945. }
  25946. }
  25947. function tryHydrate(fiber, nextInstance) {
  25948. switch (fiber.tag) {
  25949. case HostComponent:
  25950. {
  25951. var type = fiber.type;
  25952. var props = fiber.pendingProps;
  25953. var instance = canHydrateInstance(nextInstance, type);
  25954. if (instance !== null) {
  25955. fiber.stateNode = instance;
  25956. return true;
  25957. }
  25958. return false;
  25959. }
  25960. case HostText:
  25961. {
  25962. var text = fiber.pendingProps;
  25963. var textInstance = canHydrateTextInstance(nextInstance, text);
  25964. if (textInstance !== null) {
  25965. fiber.stateNode = textInstance;
  25966. return true;
  25967. }
  25968. return false;
  25969. }
  25970. case SuspenseComponent:
  25971. {
  25972. return false;
  25973. }
  25974. default:
  25975. return false;
  25976. }
  25977. }
  25978. function tryToClaimNextHydratableInstance(fiber) {
  25979. if (!isHydrating) {
  25980. return;
  25981. }
  25982. var nextInstance = nextHydratableInstance;
  25983. if (!nextInstance) {
  25984. // Nothing to hydrate. Make it an insertion.
  25985. insertNonHydratedInstance(hydrationParentFiber, fiber);
  25986. isHydrating = false;
  25987. hydrationParentFiber = fiber;
  25988. return;
  25989. }
  25990. var firstAttemptedInstance = nextInstance;
  25991. if (!tryHydrate(fiber, nextInstance)) {
  25992. // If we can't hydrate this instance let's try the next one.
  25993. // We use this as a heuristic. It's based on intuition and not data so it
  25994. // might be flawed or unnecessary.
  25995. nextInstance = getNextHydratableSibling(firstAttemptedInstance);
  25996. if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
  25997. // Nothing to hydrate. Make it an insertion.
  25998. insertNonHydratedInstance(hydrationParentFiber, fiber);
  25999. isHydrating = false;
  26000. hydrationParentFiber = fiber;
  26001. return;
  26002. } // We matched the next one, we'll now assume that the first one was
  26003. // superfluous and we'll delete it. Since we can't eagerly delete it
  26004. // we'll have to schedule a deletion. To do that, this node needs a dummy
  26005. // fiber associated with it.
  26006. deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
  26007. }
  26008. hydrationParentFiber = fiber;
  26009. nextHydratableInstance = getFirstHydratableChild(nextInstance);
  26010. }
  26011. function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
  26012. var instance = fiber.stateNode;
  26013. var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); // TODO: Type this specific to this type of component.
  26014. fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
  26015. // is a new ref we mark this as an update.
  26016. if (updatePayload !== null) {
  26017. return true;
  26018. }
  26019. return false;
  26020. }
  26021. function prepareToHydrateHostTextInstance(fiber) {
  26022. var textInstance = fiber.stateNode;
  26023. var textContent = fiber.memoizedProps;
  26024. var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
  26025. {
  26026. if (shouldUpdate) {
  26027. // We assume that prepareToHydrateHostTextInstance is called in a context where the
  26028. // hydration parent is the parent host component of this host text.
  26029. var returnFiber = hydrationParentFiber;
  26030. if (returnFiber !== null) {
  26031. switch (returnFiber.tag) {
  26032. case HostRoot:
  26033. {
  26034. var parentContainer = returnFiber.stateNode.containerInfo;
  26035. didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
  26036. break;
  26037. }
  26038. case HostComponent:
  26039. {
  26040. var parentType = returnFiber.type;
  26041. var parentProps = returnFiber.memoizedProps;
  26042. var parentInstance = returnFiber.stateNode;
  26043. didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
  26044. break;
  26045. }
  26046. }
  26047. }
  26048. }
  26049. }
  26050. return shouldUpdate;
  26051. }
  26052. function skipPastDehydratedSuspenseInstance(fiber) {
  26053. var suspenseState = fiber.memoizedState;
  26054. var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
  26055. if (!suspenseInstance) {
  26056. {
  26057. throw Error( "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." );
  26058. }
  26059. }
  26060. return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
  26061. }
  26062. function popToNextHostParent(fiber) {
  26063. var parent = fiber.return;
  26064. while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
  26065. parent = parent.return;
  26066. }
  26067. hydrationParentFiber = parent;
  26068. }
  26069. function popHydrationState(fiber) {
  26070. if (fiber !== hydrationParentFiber) {
  26071. // We're deeper than the current hydration context, inside an inserted
  26072. // tree.
  26073. return false;
  26074. }
  26075. if (!isHydrating) {
  26076. // If we're not currently hydrating but we're in a hydration context, then
  26077. // we were an insertion and now need to pop up reenter hydration of our
  26078. // siblings.
  26079. popToNextHostParent(fiber);
  26080. isHydrating = true;
  26081. return false;
  26082. }
  26083. var type = fiber.type; // If we have any remaining hydratable nodes, we need to delete them now.
  26084. // We only do this deeper than head and body since they tend to have random
  26085. // other nodes in them. We also ignore components with pure text content in
  26086. // side of them.
  26087. // TODO: Better heuristic.
  26088. if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {
  26089. var nextInstance = nextHydratableInstance;
  26090. while (nextInstance) {
  26091. deleteHydratableInstance(fiber, nextInstance);
  26092. nextInstance = getNextHydratableSibling(nextInstance);
  26093. }
  26094. }
  26095. popToNextHostParent(fiber);
  26096. if (fiber.tag === SuspenseComponent) {
  26097. nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
  26098. } else {
  26099. nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
  26100. }
  26101. return true;
  26102. }
  26103. function resetHydrationState() {
  26104. hydrationParentFiber = null;
  26105. nextHydratableInstance = null;
  26106. isHydrating = false;
  26107. }
  26108. var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
  26109. var didReceiveUpdate = false;
  26110. var didWarnAboutBadClass;
  26111. var didWarnAboutModulePatternComponent;
  26112. var didWarnAboutContextTypeOnFunctionComponent;
  26113. var didWarnAboutGetDerivedStateOnFunctionComponent;
  26114. var didWarnAboutFunctionRefs;
  26115. var didWarnAboutReassigningProps;
  26116. var didWarnAboutRevealOrder;
  26117. var didWarnAboutTailOptions;
  26118. {
  26119. didWarnAboutBadClass = {};
  26120. didWarnAboutModulePatternComponent = {};
  26121. didWarnAboutContextTypeOnFunctionComponent = {};
  26122. didWarnAboutGetDerivedStateOnFunctionComponent = {};
  26123. didWarnAboutFunctionRefs = {};
  26124. didWarnAboutReassigningProps = false;
  26125. didWarnAboutRevealOrder = {};
  26126. didWarnAboutTailOptions = {};
  26127. }
  26128. function reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime) {
  26129. if (current === null) {
  26130. // If this is a fresh new component that hasn't been rendered yet, we
  26131. // won't update its child set by applying minimal side-effects. Instead,
  26132. // we will add them all to the child before it gets rendered. That means
  26133. // we can optimize this reconciliation pass by not tracking side-effects.
  26134. workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  26135. } else {
  26136. // If the current child is the same as the work in progress, it means that
  26137. // we haven't yet started any work on these children. Therefore, we use
  26138. // the clone algorithm to create a copy of all the current children.
  26139. // If we had any progressed work already, that is invalid at this point so
  26140. // let's throw it out.
  26141. workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime);
  26142. }
  26143. }
  26144. function forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime) {
  26145. // This function is fork of reconcileChildren. It's used in cases where we
  26146. // want to reconcile without matching against the existing set. This has the
  26147. // effect of all current children being unmounted; even if the type and key
  26148. // are the same, the old child is unmounted and a new child is created.
  26149. //
  26150. // To do this, we're going to go through the reconcile algorithm twice. In
  26151. // the first pass, we schedule a deletion for all the current children by
  26152. // passing null.
  26153. workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderExpirationTime); // In the second pass, we mount the new children. The trick here is that we
  26154. // pass null in place of where we usually pass the current child set. This has
  26155. // the effect of remounting all children regardless of whether their
  26156. // identities match.
  26157. workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  26158. }
  26159. function updateForwardRef(current, workInProgress, Component, nextProps, renderExpirationTime) {
  26160. // TODO: current can be non-null here even if the component
  26161. // hasn't yet mounted. This happens after the first render suspends.
  26162. // We'll need to figure out if this is fine or can cause issues.
  26163. {
  26164. if (workInProgress.type !== workInProgress.elementType) {
  26165. // Lazy component props can't be validated in createElement
  26166. // because they're only guaranteed to be resolved here.
  26167. var innerPropTypes = Component.propTypes;
  26168. if (innerPropTypes) {
  26169. checkPropTypes(innerPropTypes, nextProps, // Resolved props
  26170. 'prop', getComponentName(Component), getCurrentFiberStackInDev);
  26171. }
  26172. }
  26173. }
  26174. var render = Component.render;
  26175. var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent
  26176. var nextChildren;
  26177. prepareToReadContext(workInProgress, renderExpirationTime);
  26178. {
  26179. ReactCurrentOwner$1.current = workInProgress;
  26180. setIsRendering(true);
  26181. nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);
  26182. if ( workInProgress.mode & StrictMode) {
  26183. // Only double-render components with Hooks
  26184. if (workInProgress.memoizedState !== null) {
  26185. nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);
  26186. }
  26187. }
  26188. setIsRendering(false);
  26189. }
  26190. if (current !== null && !didReceiveUpdate) {
  26191. bailoutHooks(current, workInProgress, renderExpirationTime);
  26192. return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
  26193. } // React DevTools reads this flag.
  26194. workInProgress.effectTag |= PerformedWork;
  26195. reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
  26196. return workInProgress.child;
  26197. }
  26198. function updateMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
  26199. if (current === null) {
  26200. var type = Component.type;
  26201. if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
  26202. Component.defaultProps === undefined) {
  26203. var resolvedType = type;
  26204. {
  26205. resolvedType = resolveFunctionForHotReloading(type);
  26206. } // If this is a plain function component without default props,
  26207. // and with only the default shallow comparison, we upgrade it
  26208. // to a SimpleMemoComponent to allow fast path updates.
  26209. workInProgress.tag = SimpleMemoComponent;
  26210. workInProgress.type = resolvedType;
  26211. {
  26212. validateFunctionComponentInDev(workInProgress, type);
  26213. }
  26214. return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, updateExpirationTime, renderExpirationTime);
  26215. }
  26216. {
  26217. var innerPropTypes = type.propTypes;
  26218. if (innerPropTypes) {
  26219. // Inner memo component props aren't currently validated in createElement.
  26220. // We could move it there, but we'd still need this for lazy code path.
  26221. checkPropTypes(innerPropTypes, nextProps, // Resolved props
  26222. 'prop', getComponentName(type), getCurrentFiberStackInDev);
  26223. }
  26224. }
  26225. var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);
  26226. child.ref = workInProgress.ref;
  26227. child.return = workInProgress;
  26228. workInProgress.child = child;
  26229. return child;
  26230. }
  26231. {
  26232. var _type = Component.type;
  26233. var _innerPropTypes = _type.propTypes;
  26234. if (_innerPropTypes) {
  26235. // Inner memo component props aren't currently validated in createElement.
  26236. // We could move it there, but we'd still need this for lazy code path.
  26237. checkPropTypes(_innerPropTypes, nextProps, // Resolved props
  26238. 'prop', getComponentName(_type), getCurrentFiberStackInDev);
  26239. }
  26240. }
  26241. var currentChild = current.child; // This is always exactly one child
  26242. if (updateExpirationTime < renderExpirationTime) {
  26243. // This will be the props with resolved defaultProps,
  26244. // unlike current.memoizedProps which will be the unresolved ones.
  26245. var prevProps = currentChild.memoizedProps; // Default to shallow comparison
  26246. var compare = Component.compare;
  26247. compare = compare !== null ? compare : shallowEqual;
  26248. if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) {
  26249. return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
  26250. }
  26251. } // React DevTools reads this flag.
  26252. workInProgress.effectTag |= PerformedWork;
  26253. var newChild = createWorkInProgress(currentChild, nextProps);
  26254. newChild.ref = workInProgress.ref;
  26255. newChild.return = workInProgress;
  26256. workInProgress.child = newChild;
  26257. return newChild;
  26258. }
  26259. function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
  26260. // TODO: current can be non-null here even if the component
  26261. // hasn't yet mounted. This happens when the inner render suspends.
  26262. // We'll need to figure out if this is fine or can cause issues.
  26263. {
  26264. if (workInProgress.type !== workInProgress.elementType) {
  26265. // Lazy component props can't be validated in createElement
  26266. // because they're only guaranteed to be resolved here.
  26267. var outerMemoType = workInProgress.elementType;
  26268. if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
  26269. // We warn when you define propTypes on lazy()
  26270. // so let's just skip over it to find memo() outer wrapper.
  26271. // Inner props for memo are validated later.
  26272. outerMemoType = refineResolvedLazyComponent(outerMemoType);
  26273. }
  26274. var outerPropTypes = outerMemoType && outerMemoType.propTypes;
  26275. if (outerPropTypes) {
  26276. checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)
  26277. 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);
  26278. } // Inner propTypes will be validated in the function component path.
  26279. }
  26280. }
  26281. if (current !== null) {
  26282. var prevProps = current.memoizedProps;
  26283. if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload.
  26284. workInProgress.type === current.type )) {
  26285. didReceiveUpdate = false;
  26286. if (updateExpirationTime < renderExpirationTime) {
  26287. // The pending update priority was cleared at the beginning of
  26288. // beginWork. We're about to bail out, but there might be additional
  26289. // updates at a lower priority. Usually, the priority level of the
  26290. // remaining updates is accumlated during the evaluation of the
  26291. // component (i.e. when processing the update queue). But since since
  26292. // we're bailing out early *without* evaluating the component, we need
  26293. // to account for it here, too. Reset to the value of the current fiber.
  26294. // NOTE: This only applies to SimpleMemoComponent, not MemoComponent,
  26295. // because a MemoComponent fiber does not have hooks or an update queue;
  26296. // rather, it wraps around an inner component, which may or may not
  26297. // contains hooks.
  26298. // TODO: Move the reset at in beginWork out of the common path so that
  26299. // this is no longer necessary.
  26300. workInProgress.expirationTime = current.expirationTime;
  26301. return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
  26302. }
  26303. }
  26304. }
  26305. return updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime);
  26306. }
  26307. function updateFragment(current, workInProgress, renderExpirationTime) {
  26308. var nextChildren = workInProgress.pendingProps;
  26309. reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
  26310. return workInProgress.child;
  26311. }
  26312. function updateMode(current, workInProgress, renderExpirationTime) {
  26313. var nextChildren = workInProgress.pendingProps.children;
  26314. reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
  26315. return workInProgress.child;
  26316. }
  26317. function updateProfiler(current, workInProgress, renderExpirationTime) {
  26318. {
  26319. workInProgress.effectTag |= Update;
  26320. }
  26321. var nextProps = workInProgress.pendingProps;
  26322. var nextChildren = nextProps.children;
  26323. reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
  26324. return workInProgress.child;
  26325. }
  26326. function markRef(current, workInProgress) {
  26327. var ref = workInProgress.ref;
  26328. if (current === null && ref !== null || current !== null && current.ref !== ref) {
  26329. // Schedule a Ref effect
  26330. workInProgress.effectTag |= Ref;
  26331. }
  26332. }
  26333. function updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {
  26334. {
  26335. if (workInProgress.type !== workInProgress.elementType) {
  26336. // Lazy component props can't be validated in createElement
  26337. // because they're only guaranteed to be resolved here.
  26338. var innerPropTypes = Component.propTypes;
  26339. if (innerPropTypes) {
  26340. checkPropTypes(innerPropTypes, nextProps, // Resolved props
  26341. 'prop', getComponentName(Component), getCurrentFiberStackInDev);
  26342. }
  26343. }
  26344. }
  26345. var context;
  26346. {
  26347. var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
  26348. context = getMaskedContext(workInProgress, unmaskedContext);
  26349. }
  26350. var nextChildren;
  26351. prepareToReadContext(workInProgress, renderExpirationTime);
  26352. {
  26353. ReactCurrentOwner$1.current = workInProgress;
  26354. setIsRendering(true);
  26355. nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);
  26356. if ( workInProgress.mode & StrictMode) {
  26357. // Only double-render components with Hooks
  26358. if (workInProgress.memoizedState !== null) {
  26359. nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);
  26360. }
  26361. }
  26362. setIsRendering(false);
  26363. }
  26364. if (current !== null && !didReceiveUpdate) {
  26365. bailoutHooks(current, workInProgress, renderExpirationTime);
  26366. return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
  26367. } // React DevTools reads this flag.
  26368. workInProgress.effectTag |= PerformedWork;
  26369. reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
  26370. return workInProgress.child;
  26371. }
  26372. function updateClassComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {
  26373. {
  26374. if (workInProgress.type !== workInProgress.elementType) {
  26375. // Lazy component props can't be validated in createElement
  26376. // because they're only guaranteed to be resolved here.
  26377. var innerPropTypes = Component.propTypes;
  26378. if (innerPropTypes) {
  26379. checkPropTypes(innerPropTypes, nextProps, // Resolved props
  26380. 'prop', getComponentName(Component), getCurrentFiberStackInDev);
  26381. }
  26382. }
  26383. } // Push context providers early to prevent context stack mismatches.
  26384. // During mounting we don't know the child context yet as the instance doesn't exist.
  26385. // We will invalidate the child context in finishClassComponent() right after rendering.
  26386. var hasContext;
  26387. if (isContextProvider(Component)) {
  26388. hasContext = true;
  26389. pushContextProvider(workInProgress);
  26390. } else {
  26391. hasContext = false;
  26392. }
  26393. prepareToReadContext(workInProgress, renderExpirationTime);
  26394. var instance = workInProgress.stateNode;
  26395. var shouldUpdate;
  26396. if (instance === null) {
  26397. if (current !== null) {
  26398. // A class component without an instance only mounts if it suspended
  26399. // inside a non-concurrent tree, in an inconsistent state. We want to
  26400. // treat it like a new mount, even though an empty version of it already
  26401. // committed. Disconnect the alternate pointers.
  26402. current.alternate = null;
  26403. workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
  26404. workInProgress.effectTag |= Placement;
  26405. } // In the initial pass we might need to construct the instance.
  26406. constructClassInstance(workInProgress, Component, nextProps);
  26407. mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  26408. shouldUpdate = true;
  26409. } else if (current === null) {
  26410. // In a resume, we'll already have an instance we can reuse.
  26411. shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  26412. } else {
  26413. shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderExpirationTime);
  26414. }
  26415. var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);
  26416. {
  26417. var inst = workInProgress.stateNode;
  26418. if (inst.props !== nextProps) {
  26419. if (!didWarnAboutReassigningProps) {
  26420. error('It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component');
  26421. }
  26422. didWarnAboutReassigningProps = true;
  26423. }
  26424. }
  26425. return nextUnitOfWork;
  26426. }
  26427. function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {
  26428. // Refs should update even if shouldComponentUpdate returns false
  26429. markRef(current, workInProgress);
  26430. var didCaptureError = (workInProgress.effectTag & DidCapture) !== NoEffect;
  26431. if (!shouldUpdate && !didCaptureError) {
  26432. // Context providers should defer to sCU for rendering
  26433. if (hasContext) {
  26434. invalidateContextProvider(workInProgress, Component, false);
  26435. }
  26436. return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
  26437. }
  26438. var instance = workInProgress.stateNode; // Rerender
  26439. ReactCurrentOwner$1.current = workInProgress;
  26440. var nextChildren;
  26441. if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {
  26442. // If we captured an error, but getDerivedStateFromError is not defined,
  26443. // unmount all the children. componentDidCatch will schedule an update to
  26444. // re-render a fallback. This is temporary until we migrate everyone to
  26445. // the new API.
  26446. // TODO: Warn in a future release.
  26447. nextChildren = null;
  26448. {
  26449. stopProfilerTimerIfRunning();
  26450. }
  26451. } else {
  26452. {
  26453. setIsRendering(true);
  26454. nextChildren = instance.render();
  26455. if ( workInProgress.mode & StrictMode) {
  26456. instance.render();
  26457. }
  26458. setIsRendering(false);
  26459. }
  26460. } // React DevTools reads this flag.
  26461. workInProgress.effectTag |= PerformedWork;
  26462. if (current !== null && didCaptureError) {
  26463. // If we're recovering from an error, reconcile without reusing any of
  26464. // the existing children. Conceptually, the normal children and the children
  26465. // that are shown on error are two different sets, so we shouldn't reuse
  26466. // normal children even if their identities match.
  26467. forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime);
  26468. } else {
  26469. reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
  26470. } // Memoize state using the values we just used to render.
  26471. // TODO: Restructure so we never read values from the instance.
  26472. workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it.
  26473. if (hasContext) {
  26474. invalidateContextProvider(workInProgress, Component, true);
  26475. }
  26476. return workInProgress.child;
  26477. }
  26478. function pushHostRootContext(workInProgress) {
  26479. var root = workInProgress.stateNode;
  26480. if (root.pendingContext) {
  26481. pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);
  26482. } else if (root.context) {
  26483. // Should always be set
  26484. pushTopLevelContextObject(workInProgress, root.context, false);
  26485. }
  26486. pushHostContainer(workInProgress, root.containerInfo);
  26487. }
  26488. function updateHostRoot(current, workInProgress, renderExpirationTime) {
  26489. pushHostRootContext(workInProgress);
  26490. var updateQueue = workInProgress.updateQueue;
  26491. if (!(current !== null && updateQueue !== null)) {
  26492. {
  26493. throw Error( "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." );
  26494. }
  26495. }
  26496. var nextProps = workInProgress.pendingProps;
  26497. var prevState = workInProgress.memoizedState;
  26498. var prevChildren = prevState !== null ? prevState.element : null;
  26499. cloneUpdateQueue(current, workInProgress);
  26500. processUpdateQueue(workInProgress, nextProps, null, renderExpirationTime);
  26501. var nextState = workInProgress.memoizedState; // Caution: React DevTools currently depends on this property
  26502. // being called "element".
  26503. var nextChildren = nextState.element;
  26504. if (nextChildren === prevChildren) {
  26505. // If the state is the same as before, that's a bailout because we had
  26506. // no work that expires at this time.
  26507. resetHydrationState();
  26508. return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
  26509. }
  26510. var root = workInProgress.stateNode;
  26511. if (root.hydrate && enterHydrationState(workInProgress)) {
  26512. // If we don't have any current children this might be the first pass.
  26513. // We always try to hydrate. If this isn't a hydration pass there won't
  26514. // be any children to hydrate which is effectively the same thing as
  26515. // not hydrating.
  26516. var child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  26517. workInProgress.child = child;
  26518. var node = child;
  26519. while (node) {
  26520. // Mark each child as hydrating. This is a fast path to know whether this
  26521. // tree is part of a hydrating tree. This is used to determine if a child
  26522. // node has fully mounted yet, and for scheduling event replaying.
  26523. // Conceptually this is similar to Placement in that a new subtree is
  26524. // inserted into the React tree here. It just happens to not need DOM
  26525. // mutations because it already exists.
  26526. node.effectTag = node.effectTag & ~Placement | Hydrating;
  26527. node = node.sibling;
  26528. }
  26529. } else {
  26530. // Otherwise reset hydration state in case we aborted and resumed another
  26531. // root.
  26532. reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
  26533. resetHydrationState();
  26534. }
  26535. return workInProgress.child;
  26536. }
  26537. function updateHostComponent(current, workInProgress, renderExpirationTime) {
  26538. pushHostContext(workInProgress);
  26539. if (current === null) {
  26540. tryToClaimNextHydratableInstance(workInProgress);
  26541. }
  26542. var type = workInProgress.type;
  26543. var nextProps = workInProgress.pendingProps;
  26544. var prevProps = current !== null ? current.memoizedProps : null;
  26545. var nextChildren = nextProps.children;
  26546. var isDirectTextChild = shouldSetTextContent(type, nextProps);
  26547. if (isDirectTextChild) {
  26548. // We special case a direct text child of a host node. This is a common
  26549. // case. We won't handle it as a reified child. We will instead handle
  26550. // this in the host environment that also has access to this prop. That
  26551. // avoids allocating another HostText fiber and traversing it.
  26552. nextChildren = null;
  26553. } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
  26554. // If we're switching from a direct text child to a normal child, or to
  26555. // empty, we need to schedule the text content to be reset.
  26556. workInProgress.effectTag |= ContentReset;
  26557. }
  26558. markRef(current, workInProgress); // Check the host config to see if the children are offscreen/hidden.
  26559. if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(type, nextProps)) {
  26560. {
  26561. markSpawnedWork(Never);
  26562. } // Schedule this fiber to re-render at offscreen priority. Then bailout.
  26563. workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
  26564. return null;
  26565. }
  26566. reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
  26567. return workInProgress.child;
  26568. }
  26569. function updateHostText(current, workInProgress) {
  26570. if (current === null) {
  26571. tryToClaimNextHydratableInstance(workInProgress);
  26572. } // Nothing to do here. This is terminal. We'll do the completion step
  26573. // immediately after.
  26574. return null;
  26575. }
  26576. function mountLazyComponent(_current, workInProgress, elementType, updateExpirationTime, renderExpirationTime) {
  26577. if (_current !== null) {
  26578. // A lazy component only mounts if it suspended inside a non-
  26579. // concurrent tree, in an inconsistent state. We want to treat it like
  26580. // a new mount, even though an empty version of it already committed.
  26581. // Disconnect the alternate pointers.
  26582. _current.alternate = null;
  26583. workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
  26584. workInProgress.effectTag |= Placement;
  26585. }
  26586. var props = workInProgress.pendingProps; // We can't start a User Timing measurement with correct label yet.
  26587. // Cancel and resume right after we know the tag.
  26588. cancelWorkTimer(workInProgress);
  26589. var Component = readLazyComponentType(elementType); // Store the unwrapped component in the type.
  26590. workInProgress.type = Component;
  26591. var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);
  26592. startWorkTimer(workInProgress);
  26593. var resolvedProps = resolveDefaultProps(Component, props);
  26594. var child;
  26595. switch (resolvedTag) {
  26596. case FunctionComponent:
  26597. {
  26598. {
  26599. validateFunctionComponentInDev(workInProgress, Component);
  26600. workInProgress.type = Component = resolveFunctionForHotReloading(Component);
  26601. }
  26602. child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
  26603. return child;
  26604. }
  26605. case ClassComponent:
  26606. {
  26607. {
  26608. workInProgress.type = Component = resolveClassForHotReloading(Component);
  26609. }
  26610. child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
  26611. return child;
  26612. }
  26613. case ForwardRef:
  26614. {
  26615. {
  26616. workInProgress.type = Component = resolveForwardRefForHotReloading(Component);
  26617. }
  26618. child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderExpirationTime);
  26619. return child;
  26620. }
  26621. case MemoComponent:
  26622. {
  26623. {
  26624. if (workInProgress.type !== workInProgress.elementType) {
  26625. var outerPropTypes = Component.propTypes;
  26626. if (outerPropTypes) {
  26627. checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only
  26628. 'prop', getComponentName(Component), getCurrentFiberStackInDev);
  26629. }
  26630. }
  26631. }
  26632. child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
  26633. updateExpirationTime, renderExpirationTime);
  26634. return child;
  26635. }
  26636. }
  26637. var hint = '';
  26638. {
  26639. if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {
  26640. hint = ' Did you wrap a component in React.lazy() more than once?';
  26641. }
  26642. } // This message intentionally doesn't mention ForwardRef or MemoComponent
  26643. // because the fact that it's a separate type of work is an
  26644. // implementation detail.
  26645. {
  26646. {
  26647. throw Error( "Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function." + hint );
  26648. }
  26649. }
  26650. }
  26651. function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderExpirationTime) {
  26652. if (_current !== null) {
  26653. // An incomplete component only mounts if it suspended inside a non-
  26654. // concurrent tree, in an inconsistent state. We want to treat it like
  26655. // a new mount, even though an empty version of it already committed.
  26656. // Disconnect the alternate pointers.
  26657. _current.alternate = null;
  26658. workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
  26659. workInProgress.effectTag |= Placement;
  26660. } // Promote the fiber to a class and try rendering again.
  26661. workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent`
  26662. // Push context providers early to prevent context stack mismatches.
  26663. // During mounting we don't know the child context yet as the instance doesn't exist.
  26664. // We will invalidate the child context in finishClassComponent() right after rendering.
  26665. var hasContext;
  26666. if (isContextProvider(Component)) {
  26667. hasContext = true;
  26668. pushContextProvider(workInProgress);
  26669. } else {
  26670. hasContext = false;
  26671. }
  26672. prepareToReadContext(workInProgress, renderExpirationTime);
  26673. constructClassInstance(workInProgress, Component, nextProps);
  26674. mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  26675. return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
  26676. }
  26677. function mountIndeterminateComponent(_current, workInProgress, Component, renderExpirationTime) {
  26678. if (_current !== null) {
  26679. // An indeterminate component only mounts if it suspended inside a non-
  26680. // concurrent tree, in an inconsistent state. We want to treat it like
  26681. // a new mount, even though an empty version of it already committed.
  26682. // Disconnect the alternate pointers.
  26683. _current.alternate = null;
  26684. workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
  26685. workInProgress.effectTag |= Placement;
  26686. }
  26687. var props = workInProgress.pendingProps;
  26688. var context;
  26689. {
  26690. var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);
  26691. context = getMaskedContext(workInProgress, unmaskedContext);
  26692. }
  26693. prepareToReadContext(workInProgress, renderExpirationTime);
  26694. var value;
  26695. {
  26696. if (Component.prototype && typeof Component.prototype.render === 'function') {
  26697. var componentName = getComponentName(Component) || 'Unknown';
  26698. if (!didWarnAboutBadClass[componentName]) {
  26699. error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);
  26700. didWarnAboutBadClass[componentName] = true;
  26701. }
  26702. }
  26703. if (workInProgress.mode & StrictMode) {
  26704. ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
  26705. }
  26706. setIsRendering(true);
  26707. ReactCurrentOwner$1.current = workInProgress;
  26708. value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
  26709. setIsRendering(false);
  26710. } // React DevTools reads this flag.
  26711. workInProgress.effectTag |= PerformedWork;
  26712. if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
  26713. {
  26714. var _componentName = getComponentName(Component) || 'Unknown';
  26715. if (!didWarnAboutModulePatternComponent[_componentName]) {
  26716. error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);
  26717. didWarnAboutModulePatternComponent[_componentName] = true;
  26718. }
  26719. } // Proceed under the assumption that this is a class instance
  26720. workInProgress.tag = ClassComponent; // Throw out any hooks that were used.
  26721. workInProgress.memoizedState = null;
  26722. workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches.
  26723. // During mounting we don't know the child context yet as the instance doesn't exist.
  26724. // We will invalidate the child context in finishClassComponent() right after rendering.
  26725. var hasContext = false;
  26726. if (isContextProvider(Component)) {
  26727. hasContext = true;
  26728. pushContextProvider(workInProgress);
  26729. } else {
  26730. hasContext = false;
  26731. }
  26732. workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;
  26733. initializeUpdateQueue(workInProgress);
  26734. var getDerivedStateFromProps = Component.getDerivedStateFromProps;
  26735. if (typeof getDerivedStateFromProps === 'function') {
  26736. applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);
  26737. }
  26738. adoptClassInstance(workInProgress, value);
  26739. mountClassInstance(workInProgress, Component, props, renderExpirationTime);
  26740. return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
  26741. } else {
  26742. // Proceed under the assumption that this is a function component
  26743. workInProgress.tag = FunctionComponent;
  26744. {
  26745. if ( workInProgress.mode & StrictMode) {
  26746. // Only double-render components with Hooks
  26747. if (workInProgress.memoizedState !== null) {
  26748. value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
  26749. }
  26750. }
  26751. }
  26752. reconcileChildren(null, workInProgress, value, renderExpirationTime);
  26753. {
  26754. validateFunctionComponentInDev(workInProgress, Component);
  26755. }
  26756. return workInProgress.child;
  26757. }
  26758. }
  26759. function validateFunctionComponentInDev(workInProgress, Component) {
  26760. {
  26761. if (Component) {
  26762. if (Component.childContextTypes) {
  26763. error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component');
  26764. }
  26765. }
  26766. if (workInProgress.ref !== null) {
  26767. var info = '';
  26768. var ownerName = getCurrentFiberOwnerNameInDevOrNull();
  26769. if (ownerName) {
  26770. info += '\n\nCheck the render method of `' + ownerName + '`.';
  26771. }
  26772. var warningKey = ownerName || workInProgress._debugID || '';
  26773. var debugSource = workInProgress._debugSource;
  26774. if (debugSource) {
  26775. warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
  26776. }
  26777. if (!didWarnAboutFunctionRefs[warningKey]) {
  26778. didWarnAboutFunctionRefs[warningKey] = true;
  26779. error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);
  26780. }
  26781. }
  26782. if (typeof Component.getDerivedStateFromProps === 'function') {
  26783. var _componentName2 = getComponentName(Component) || 'Unknown';
  26784. if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2]) {
  26785. error('%s: Function components do not support getDerivedStateFromProps.', _componentName2);
  26786. didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true;
  26787. }
  26788. }
  26789. if (typeof Component.contextType === 'object' && Component.contextType !== null) {
  26790. var _componentName3 = getComponentName(Component) || 'Unknown';
  26791. if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) {
  26792. error('%s: Function components do not support contextType.', _componentName3);
  26793. didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true;
  26794. }
  26795. }
  26796. }
  26797. }
  26798. var SUSPENDED_MARKER = {
  26799. dehydrated: null,
  26800. retryTime: NoWork
  26801. };
  26802. function shouldRemainOnFallback(suspenseContext, current, workInProgress) {
  26803. // If the context is telling us that we should show a fallback, and we're not
  26804. // already showing content, then we should show the fallback instead.
  26805. return hasSuspenseContext(suspenseContext, ForceSuspenseFallback) && (current === null || current.memoizedState !== null);
  26806. }
  26807. function updateSuspenseComponent(current, workInProgress, renderExpirationTime) {
  26808. var mode = workInProgress.mode;
  26809. var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend.
  26810. {
  26811. if (shouldSuspend(workInProgress)) {
  26812. workInProgress.effectTag |= DidCapture;
  26813. }
  26814. }
  26815. var suspenseContext = suspenseStackCursor.current;
  26816. var nextDidTimeout = false;
  26817. var didSuspend = (workInProgress.effectTag & DidCapture) !== NoEffect;
  26818. if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) {
  26819. // Something in this boundary's subtree already suspended. Switch to
  26820. // rendering the fallback children.
  26821. nextDidTimeout = true;
  26822. workInProgress.effectTag &= ~DidCapture;
  26823. } else {
  26824. // Attempting the main content
  26825. if (current === null || current.memoizedState !== null) {
  26826. // This is a new mount or this boundary is already showing a fallback state.
  26827. // Mark this subtree context as having at least one invisible parent that could
  26828. // handle the fallback state.
  26829. // Boundaries without fallbacks or should be avoided are not considered since
  26830. // they cannot handle preferred fallback states.
  26831. if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {
  26832. suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
  26833. }
  26834. }
  26835. }
  26836. suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
  26837. pushSuspenseContext(workInProgress, suspenseContext); // This next part is a bit confusing. If the children timeout, we switch to
  26838. // showing the fallback children in place of the "primary" children.
  26839. // However, we don't want to delete the primary children because then their
  26840. // state will be lost (both the React state and the host state, e.g.
  26841. // uncontrolled form inputs). Instead we keep them mounted and hide them.
  26842. // Both the fallback children AND the primary children are rendered at the
  26843. // same time. Once the primary children are un-suspended, we can delete
  26844. // the fallback children — don't need to preserve their state.
  26845. //
  26846. // The two sets of children are siblings in the host environment, but
  26847. // semantically, for purposes of reconciliation, they are two separate sets.
  26848. // So we store them using two fragment fibers.
  26849. //
  26850. // However, we want to avoid allocating extra fibers for every placeholder.
  26851. // They're only necessary when the children time out, because that's the
  26852. // only time when both sets are mounted.
  26853. //
  26854. // So, the extra fragment fibers are only used if the children time out.
  26855. // Otherwise, we render the primary children directly. This requires some
  26856. // custom reconciliation logic to preserve the state of the primary
  26857. // children. It's essentially a very basic form of re-parenting.
  26858. if (current === null) {
  26859. // If we're currently hydrating, try to hydrate this boundary.
  26860. // But only if this has a fallback.
  26861. if (nextProps.fallback !== undefined) {
  26862. tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component.
  26863. } // This is the initial mount. This branch is pretty simple because there's
  26864. // no previous state that needs to be preserved.
  26865. if (nextDidTimeout) {
  26866. // Mount separate fragments for primary and fallback children.
  26867. var nextFallbackChildren = nextProps.fallback;
  26868. var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);
  26869. primaryChildFragment.return = workInProgress;
  26870. if ((workInProgress.mode & BlockingMode) === NoMode) {
  26871. // Outside of blocking mode, we commit the effects from the
  26872. // partially completed, timed-out tree, too.
  26873. var progressedState = workInProgress.memoizedState;
  26874. var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child;
  26875. primaryChildFragment.child = progressedPrimaryChild;
  26876. var progressedChild = progressedPrimaryChild;
  26877. while (progressedChild !== null) {
  26878. progressedChild.return = primaryChildFragment;
  26879. progressedChild = progressedChild.sibling;
  26880. }
  26881. }
  26882. var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime, null);
  26883. fallbackChildFragment.return = workInProgress;
  26884. primaryChildFragment.sibling = fallbackChildFragment; // Skip the primary children, and continue working on the
  26885. // fallback children.
  26886. workInProgress.memoizedState = SUSPENDED_MARKER;
  26887. workInProgress.child = primaryChildFragment;
  26888. return fallbackChildFragment;
  26889. } else {
  26890. // Mount the primary children without an intermediate fragment fiber.
  26891. var nextPrimaryChildren = nextProps.children;
  26892. workInProgress.memoizedState = null;
  26893. return workInProgress.child = mountChildFibers(workInProgress, null, nextPrimaryChildren, renderExpirationTime);
  26894. }
  26895. } else {
  26896. // This is an update. This branch is more complicated because we need to
  26897. // ensure the state of the primary children is preserved.
  26898. var prevState = current.memoizedState;
  26899. if (prevState !== null) {
  26900. // wrapped in a fragment fiber.
  26901. var currentPrimaryChildFragment = current.child;
  26902. var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
  26903. if (nextDidTimeout) {
  26904. // Still timed out. Reuse the current primary children by cloning
  26905. // its fragment. We're going to skip over these entirely.
  26906. var _nextFallbackChildren2 = nextProps.fallback;
  26907. var _primaryChildFragment2 = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps);
  26908. _primaryChildFragment2.return = workInProgress;
  26909. if ((workInProgress.mode & BlockingMode) === NoMode) {
  26910. // Outside of blocking mode, we commit the effects from the
  26911. // partially completed, timed-out tree, too.
  26912. var _progressedState = workInProgress.memoizedState;
  26913. var _progressedPrimaryChild = _progressedState !== null ? workInProgress.child.child : workInProgress.child;
  26914. if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) {
  26915. _primaryChildFragment2.child = _progressedPrimaryChild;
  26916. var _progressedChild2 = _progressedPrimaryChild;
  26917. while (_progressedChild2 !== null) {
  26918. _progressedChild2.return = _primaryChildFragment2;
  26919. _progressedChild2 = _progressedChild2.sibling;
  26920. }
  26921. }
  26922. } // Because primaryChildFragment is a new fiber that we're inserting as the
  26923. // parent of a new tree, we need to set its treeBaseDuration.
  26924. if ( workInProgress.mode & ProfileMode) {
  26925. // treeBaseDuration is the sum of all the child tree base durations.
  26926. var _treeBaseDuration = 0;
  26927. var _hiddenChild = _primaryChildFragment2.child;
  26928. while (_hiddenChild !== null) {
  26929. _treeBaseDuration += _hiddenChild.treeBaseDuration;
  26930. _hiddenChild = _hiddenChild.sibling;
  26931. }
  26932. _primaryChildFragment2.treeBaseDuration = _treeBaseDuration;
  26933. } // Clone the fallback child fragment, too. These we'll continue
  26934. // working on.
  26935. var _fallbackChildFragment2 = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren2);
  26936. _fallbackChildFragment2.return = workInProgress;
  26937. _primaryChildFragment2.sibling = _fallbackChildFragment2;
  26938. _primaryChildFragment2.childExpirationTime = NoWork; // Skip the primary children, and continue working on the
  26939. // fallback children.
  26940. workInProgress.memoizedState = SUSPENDED_MARKER;
  26941. workInProgress.child = _primaryChildFragment2;
  26942. return _fallbackChildFragment2;
  26943. } else {
  26944. // No longer suspended. Switch back to showing the primary children,
  26945. // and remove the intermediate fragment fiber.
  26946. var _nextPrimaryChildren = nextProps.children;
  26947. var currentPrimaryChild = currentPrimaryChildFragment.child;
  26948. var primaryChild = reconcileChildFibers(workInProgress, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime); // If this render doesn't suspend, we need to delete the fallback
  26949. // children. Wait until the complete phase, after we've confirmed the
  26950. // fallback is no longer needed.
  26951. // TODO: Would it be better to store the fallback fragment on
  26952. // the stateNode?
  26953. // Continue rendering the children, like we normally do.
  26954. workInProgress.memoizedState = null;
  26955. return workInProgress.child = primaryChild;
  26956. }
  26957. } else {
  26958. // The current tree has not already timed out. That means the primary
  26959. // children are not wrapped in a fragment fiber.
  26960. var _currentPrimaryChild = current.child;
  26961. if (nextDidTimeout) {
  26962. // Timed out. Wrap the children in a fragment fiber to keep them
  26963. // separate from the fallback children.
  26964. var _nextFallbackChildren3 = nextProps.fallback;
  26965. var _primaryChildFragment3 = createFiberFromFragment( // It shouldn't matter what the pending props are because we aren't
  26966. // going to render this fragment.
  26967. null, mode, NoWork, null);
  26968. _primaryChildFragment3.return = workInProgress;
  26969. _primaryChildFragment3.child = _currentPrimaryChild;
  26970. if (_currentPrimaryChild !== null) {
  26971. _currentPrimaryChild.return = _primaryChildFragment3;
  26972. } // Even though we're creating a new fiber, there are no new children,
  26973. // because we're reusing an already mounted tree. So we don't need to
  26974. // schedule a placement.
  26975. // primaryChildFragment.effectTag |= Placement;
  26976. if ((workInProgress.mode & BlockingMode) === NoMode) {
  26977. // Outside of blocking mode, we commit the effects from the
  26978. // partially completed, timed-out tree, too.
  26979. var _progressedState2 = workInProgress.memoizedState;
  26980. var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child;
  26981. _primaryChildFragment3.child = _progressedPrimaryChild2;
  26982. var _progressedChild3 = _progressedPrimaryChild2;
  26983. while (_progressedChild3 !== null) {
  26984. _progressedChild3.return = _primaryChildFragment3;
  26985. _progressedChild3 = _progressedChild3.sibling;
  26986. }
  26987. } // Because primaryChildFragment is a new fiber that we're inserting as the
  26988. // parent of a new tree, we need to set its treeBaseDuration.
  26989. if ( workInProgress.mode & ProfileMode) {
  26990. // treeBaseDuration is the sum of all the child tree base durations.
  26991. var _treeBaseDuration2 = 0;
  26992. var _hiddenChild2 = _primaryChildFragment3.child;
  26993. while (_hiddenChild2 !== null) {
  26994. _treeBaseDuration2 += _hiddenChild2.treeBaseDuration;
  26995. _hiddenChild2 = _hiddenChild2.sibling;
  26996. }
  26997. _primaryChildFragment3.treeBaseDuration = _treeBaseDuration2;
  26998. } // Create a fragment from the fallback children, too.
  26999. var _fallbackChildFragment3 = createFiberFromFragment(_nextFallbackChildren3, mode, renderExpirationTime, null);
  27000. _fallbackChildFragment3.return = workInProgress;
  27001. _primaryChildFragment3.sibling = _fallbackChildFragment3;
  27002. _fallbackChildFragment3.effectTag |= Placement;
  27003. _primaryChildFragment3.childExpirationTime = NoWork; // Skip the primary children, and continue working on the
  27004. // fallback children.
  27005. workInProgress.memoizedState = SUSPENDED_MARKER;
  27006. workInProgress.child = _primaryChildFragment3;
  27007. return _fallbackChildFragment3;
  27008. } else {
  27009. // Still haven't timed out. Continue rendering the children, like we
  27010. // normally do.
  27011. workInProgress.memoizedState = null;
  27012. var _nextPrimaryChildren2 = nextProps.children;
  27013. return workInProgress.child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);
  27014. }
  27015. }
  27016. }
  27017. }
  27018. function scheduleWorkOnFiber(fiber, renderExpirationTime) {
  27019. if (fiber.expirationTime < renderExpirationTime) {
  27020. fiber.expirationTime = renderExpirationTime;
  27021. }
  27022. var alternate = fiber.alternate;
  27023. if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
  27024. alternate.expirationTime = renderExpirationTime;
  27025. }
  27026. scheduleWorkOnParentPath(fiber.return, renderExpirationTime);
  27027. }
  27028. function propagateSuspenseContextChange(workInProgress, firstChild, renderExpirationTime) {
  27029. // Mark any Suspense boundaries with fallbacks as having work to do.
  27030. // If they were previously forced into fallbacks, they may now be able
  27031. // to unblock.
  27032. var node = firstChild;
  27033. while (node !== null) {
  27034. if (node.tag === SuspenseComponent) {
  27035. var state = node.memoizedState;
  27036. if (state !== null) {
  27037. scheduleWorkOnFiber(node, renderExpirationTime);
  27038. }
  27039. } else if (node.tag === SuspenseListComponent) {
  27040. // If the tail is hidden there might not be an Suspense boundaries
  27041. // to schedule work on. In this case we have to schedule it on the
  27042. // list itself.
  27043. // We don't have to traverse to the children of the list since
  27044. // the list will propagate the change when it rerenders.
  27045. scheduleWorkOnFiber(node, renderExpirationTime);
  27046. } else if (node.child !== null) {
  27047. node.child.return = node;
  27048. node = node.child;
  27049. continue;
  27050. }
  27051. if (node === workInProgress) {
  27052. return;
  27053. }
  27054. while (node.sibling === null) {
  27055. if (node.return === null || node.return === workInProgress) {
  27056. return;
  27057. }
  27058. node = node.return;
  27059. }
  27060. node.sibling.return = node.return;
  27061. node = node.sibling;
  27062. }
  27063. }
  27064. function findLastContentRow(firstChild) {
  27065. // This is going to find the last row among these children that is already
  27066. // showing content on the screen, as opposed to being in fallback state or
  27067. // new. If a row has multiple Suspense boundaries, any of them being in the
  27068. // fallback state, counts as the whole row being in a fallback state.
  27069. // Note that the "rows" will be workInProgress, but any nested children
  27070. // will still be current since we haven't rendered them yet. The mounted
  27071. // order may not be the same as the new order. We use the new order.
  27072. var row = firstChild;
  27073. var lastContentRow = null;
  27074. while (row !== null) {
  27075. var currentRow = row.alternate; // New rows can't be content rows.
  27076. if (currentRow !== null && findFirstSuspended(currentRow) === null) {
  27077. lastContentRow = row;
  27078. }
  27079. row = row.sibling;
  27080. }
  27081. return lastContentRow;
  27082. }
  27083. function validateRevealOrder(revealOrder) {
  27084. {
  27085. if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {
  27086. didWarnAboutRevealOrder[revealOrder] = true;
  27087. if (typeof revealOrder === 'string') {
  27088. switch (revealOrder.toLowerCase()) {
  27089. case 'together':
  27090. case 'forwards':
  27091. case 'backwards':
  27092. {
  27093. error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
  27094. break;
  27095. }
  27096. case 'forward':
  27097. case 'backward':
  27098. {
  27099. error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
  27100. break;
  27101. }
  27102. default:
  27103. error('"%s" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
  27104. break;
  27105. }
  27106. } else {
  27107. error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
  27108. }
  27109. }
  27110. }
  27111. }
  27112. function validateTailOptions(tailMode, revealOrder) {
  27113. {
  27114. if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {
  27115. if (tailMode !== 'collapsed' && tailMode !== 'hidden') {
  27116. didWarnAboutTailOptions[tailMode] = true;
  27117. error('"%s" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean "collapsed" or "hidden"?', tailMode);
  27118. } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {
  27119. didWarnAboutTailOptions[tailMode] = true;
  27120. error('<SuspenseList tail="%s" /> is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode);
  27121. }
  27122. }
  27123. }
  27124. }
  27125. function validateSuspenseListNestedChild(childSlot, index) {
  27126. {
  27127. var isArray = Array.isArray(childSlot);
  27128. var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';
  27129. if (isArray || isIterable) {
  27130. var type = isArray ? 'array' : 'iterable';
  27131. error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);
  27132. return false;
  27133. }
  27134. }
  27135. return true;
  27136. }
  27137. function validateSuspenseListChildren(children, revealOrder) {
  27138. {
  27139. if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {
  27140. if (Array.isArray(children)) {
  27141. for (var i = 0; i < children.length; i++) {
  27142. if (!validateSuspenseListNestedChild(children[i], i)) {
  27143. return;
  27144. }
  27145. }
  27146. } else {
  27147. var iteratorFn = getIteratorFn(children);
  27148. if (typeof iteratorFn === 'function') {
  27149. var childrenIterator = iteratorFn.call(children);
  27150. if (childrenIterator) {
  27151. var step = childrenIterator.next();
  27152. var _i = 0;
  27153. for (; !step.done; step = childrenIterator.next()) {
  27154. if (!validateSuspenseListNestedChild(step.value, _i)) {
  27155. return;
  27156. }
  27157. _i++;
  27158. }
  27159. }
  27160. } else {
  27161. error('A single row was passed to a <SuspenseList revealOrder="%s" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);
  27162. }
  27163. }
  27164. }
  27165. }
  27166. }
  27167. function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {
  27168. var renderState = workInProgress.memoizedState;
  27169. if (renderState === null) {
  27170. workInProgress.memoizedState = {
  27171. isBackwards: isBackwards,
  27172. rendering: null,
  27173. renderingStartTime: 0,
  27174. last: lastContentRow,
  27175. tail: tail,
  27176. tailExpiration: 0,
  27177. tailMode: tailMode,
  27178. lastEffect: lastEffectBeforeRendering
  27179. };
  27180. } else {
  27181. // We can reuse the existing object from previous renders.
  27182. renderState.isBackwards = isBackwards;
  27183. renderState.rendering = null;
  27184. renderState.renderingStartTime = 0;
  27185. renderState.last = lastContentRow;
  27186. renderState.tail = tail;
  27187. renderState.tailExpiration = 0;
  27188. renderState.tailMode = tailMode;
  27189. renderState.lastEffect = lastEffectBeforeRendering;
  27190. }
  27191. } // This can end up rendering this component multiple passes.
  27192. // The first pass splits the children fibers into two sets. A head and tail.
  27193. // We first render the head. If anything is in fallback state, we do another
  27194. // pass through beginWork to rerender all children (including the tail) with
  27195. // the force suspend context. If the first render didn't have anything in
  27196. // in fallback state. Then we render each row in the tail one-by-one.
  27197. // That happens in the completeWork phase without going back to beginWork.
  27198. function updateSuspenseListComponent(current, workInProgress, renderExpirationTime) {
  27199. var nextProps = workInProgress.pendingProps;
  27200. var revealOrder = nextProps.revealOrder;
  27201. var tailMode = nextProps.tail;
  27202. var newChildren = nextProps.children;
  27203. validateRevealOrder(revealOrder);
  27204. validateTailOptions(tailMode, revealOrder);
  27205. validateSuspenseListChildren(newChildren, revealOrder);
  27206. reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);
  27207. var suspenseContext = suspenseStackCursor.current;
  27208. var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
  27209. if (shouldForceFallback) {
  27210. suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
  27211. workInProgress.effectTag |= DidCapture;
  27212. } else {
  27213. var didSuspendBefore = current !== null && (current.effectTag & DidCapture) !== NoEffect;
  27214. if (didSuspendBefore) {
  27215. // If we previously forced a fallback, we need to schedule work
  27216. // on any nested boundaries to let them know to try to render
  27217. // again. This is the same as context updating.
  27218. propagateSuspenseContextChange(workInProgress, workInProgress.child, renderExpirationTime);
  27219. }
  27220. suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
  27221. }
  27222. pushSuspenseContext(workInProgress, suspenseContext);
  27223. if ((workInProgress.mode & BlockingMode) === NoMode) {
  27224. // Outside of blocking mode, SuspenseList doesn't work so we just
  27225. // use make it a noop by treating it as the default revealOrder.
  27226. workInProgress.memoizedState = null;
  27227. } else {
  27228. switch (revealOrder) {
  27229. case 'forwards':
  27230. {
  27231. var lastContentRow = findLastContentRow(workInProgress.child);
  27232. var tail;
  27233. if (lastContentRow === null) {
  27234. // The whole list is part of the tail.
  27235. // TODO: We could fast path by just rendering the tail now.
  27236. tail = workInProgress.child;
  27237. workInProgress.child = null;
  27238. } else {
  27239. // Disconnect the tail rows after the content row.
  27240. // We're going to render them separately later.
  27241. tail = lastContentRow.sibling;
  27242. lastContentRow.sibling = null;
  27243. }
  27244. initSuspenseListRenderState(workInProgress, false, // isBackwards
  27245. tail, lastContentRow, tailMode, workInProgress.lastEffect);
  27246. break;
  27247. }
  27248. case 'backwards':
  27249. {
  27250. // We're going to find the first row that has existing content.
  27251. // At the same time we're going to reverse the list of everything
  27252. // we pass in the meantime. That's going to be our tail in reverse
  27253. // order.
  27254. var _tail = null;
  27255. var row = workInProgress.child;
  27256. workInProgress.child = null;
  27257. while (row !== null) {
  27258. var currentRow = row.alternate; // New rows can't be content rows.
  27259. if (currentRow !== null && findFirstSuspended(currentRow) === null) {
  27260. // This is the beginning of the main content.
  27261. workInProgress.child = row;
  27262. break;
  27263. }
  27264. var nextRow = row.sibling;
  27265. row.sibling = _tail;
  27266. _tail = row;
  27267. row = nextRow;
  27268. } // TODO: If workInProgress.child is null, we can continue on the tail immediately.
  27269. initSuspenseListRenderState(workInProgress, true, // isBackwards
  27270. _tail, null, // last
  27271. tailMode, workInProgress.lastEffect);
  27272. break;
  27273. }
  27274. case 'together':
  27275. {
  27276. initSuspenseListRenderState(workInProgress, false, // isBackwards
  27277. null, // tail
  27278. null, // last
  27279. undefined, workInProgress.lastEffect);
  27280. break;
  27281. }
  27282. default:
  27283. {
  27284. // The default reveal order is the same as not having
  27285. // a boundary.
  27286. workInProgress.memoizedState = null;
  27287. }
  27288. }
  27289. }
  27290. return workInProgress.child;
  27291. }
  27292. function updatePortalComponent(current, workInProgress, renderExpirationTime) {
  27293. pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
  27294. var nextChildren = workInProgress.pendingProps;
  27295. if (current === null) {
  27296. // Portals are special because we don't append the children during mount
  27297. // but at commit. Therefore we need to track insertions which the normal
  27298. // flow doesn't do during mount. This doesn't happen at the root because
  27299. // the root always starts with a "current" with a null child.
  27300. // TODO: Consider unifying this with how the root works.
  27301. workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  27302. } else {
  27303. reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
  27304. }
  27305. return workInProgress.child;
  27306. }
  27307. function updateContextProvider(current, workInProgress, renderExpirationTime) {
  27308. var providerType = workInProgress.type;
  27309. var context = providerType._context;
  27310. var newProps = workInProgress.pendingProps;
  27311. var oldProps = workInProgress.memoizedProps;
  27312. var newValue = newProps.value;
  27313. {
  27314. var providerPropTypes = workInProgress.type.propTypes;
  27315. if (providerPropTypes) {
  27316. checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev);
  27317. }
  27318. }
  27319. pushProvider(workInProgress, newValue);
  27320. if (oldProps !== null) {
  27321. var oldValue = oldProps.value;
  27322. var changedBits = calculateChangedBits(context, newValue, oldValue);
  27323. if (changedBits === 0) {
  27324. // No change. Bailout early if children are the same.
  27325. if (oldProps.children === newProps.children && !hasContextChanged()) {
  27326. return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
  27327. }
  27328. } else {
  27329. // The context value changed. Search for matching consumers and schedule
  27330. // them to update.
  27331. propagateContextChange(workInProgress, context, changedBits, renderExpirationTime);
  27332. }
  27333. }
  27334. var newChildren = newProps.children;
  27335. reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);
  27336. return workInProgress.child;
  27337. }
  27338. var hasWarnedAboutUsingContextAsConsumer = false;
  27339. function updateContextConsumer(current, workInProgress, renderExpirationTime) {
  27340. var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In
  27341. // DEV mode, we create a separate object for Context.Consumer that acts
  27342. // like a proxy to Context. This proxy object adds unnecessary code in PROD
  27343. // so we use the old behaviour (Context.Consumer references Context) to
  27344. // reduce size and overhead. The separate object references context via
  27345. // a property called "_context", which also gives us the ability to check
  27346. // in DEV mode if this property exists or not and warn if it does not.
  27347. {
  27348. if (context._context === undefined) {
  27349. // This may be because it's a Context (rather than a Consumer).
  27350. // Or it may be because it's older React where they're the same thing.
  27351. // We only want to warn if we're sure it's a new React.
  27352. if (context !== context.Consumer) {
  27353. if (!hasWarnedAboutUsingContextAsConsumer) {
  27354. hasWarnedAboutUsingContextAsConsumer = true;
  27355. error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
  27356. }
  27357. }
  27358. } else {
  27359. context = context._context;
  27360. }
  27361. }
  27362. var newProps = workInProgress.pendingProps;
  27363. var render = newProps.children;
  27364. {
  27365. if (typeof render !== 'function') {
  27366. error('A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.');
  27367. }
  27368. }
  27369. prepareToReadContext(workInProgress, renderExpirationTime);
  27370. var newValue = readContext(context, newProps.unstable_observedBits);
  27371. var newChildren;
  27372. {
  27373. ReactCurrentOwner$1.current = workInProgress;
  27374. setIsRendering(true);
  27375. newChildren = render(newValue);
  27376. setIsRendering(false);
  27377. } // React DevTools reads this flag.
  27378. workInProgress.effectTag |= PerformedWork;
  27379. reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);
  27380. return workInProgress.child;
  27381. }
  27382. function markWorkInProgressReceivedUpdate() {
  27383. didReceiveUpdate = true;
  27384. }
  27385. function bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime) {
  27386. cancelWorkTimer(workInProgress);
  27387. if (current !== null) {
  27388. // Reuse previous dependencies
  27389. workInProgress.dependencies = current.dependencies;
  27390. }
  27391. {
  27392. // Don't update "base" render times for bailouts.
  27393. stopProfilerTimerIfRunning();
  27394. }
  27395. var updateExpirationTime = workInProgress.expirationTime;
  27396. if (updateExpirationTime !== NoWork) {
  27397. markUnprocessedUpdateTime(updateExpirationTime);
  27398. } // Check if the children have any pending work.
  27399. var childExpirationTime = workInProgress.childExpirationTime;
  27400. if (childExpirationTime < renderExpirationTime) {
  27401. // The children don't have any work either. We can skip them.
  27402. // TODO: Once we add back resuming, we should check if the children are
  27403. // a work-in-progress set. If so, we need to transfer their effects.
  27404. return null;
  27405. } else {
  27406. // This fiber doesn't have work, but its subtree does. Clone the child
  27407. // fibers and continue.
  27408. cloneChildFibers(current, workInProgress);
  27409. return workInProgress.child;
  27410. }
  27411. }
  27412. function remountFiber(current, oldWorkInProgress, newWorkInProgress) {
  27413. {
  27414. var returnFiber = oldWorkInProgress.return;
  27415. if (returnFiber === null) {
  27416. throw new Error('Cannot swap the root fiber.');
  27417. } // Disconnect from the old current.
  27418. // It will get deleted.
  27419. current.alternate = null;
  27420. oldWorkInProgress.alternate = null; // Connect to the new tree.
  27421. newWorkInProgress.index = oldWorkInProgress.index;
  27422. newWorkInProgress.sibling = oldWorkInProgress.sibling;
  27423. newWorkInProgress.return = oldWorkInProgress.return;
  27424. newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it.
  27425. if (oldWorkInProgress === returnFiber.child) {
  27426. returnFiber.child = newWorkInProgress;
  27427. } else {
  27428. var prevSibling = returnFiber.child;
  27429. if (prevSibling === null) {
  27430. throw new Error('Expected parent to have a child.');
  27431. }
  27432. while (prevSibling.sibling !== oldWorkInProgress) {
  27433. prevSibling = prevSibling.sibling;
  27434. if (prevSibling === null) {
  27435. throw new Error('Expected to find the previous sibling.');
  27436. }
  27437. }
  27438. prevSibling.sibling = newWorkInProgress;
  27439. } // Delete the old fiber and place the new one.
  27440. // Since the old fiber is disconnected, we have to schedule it manually.
  27441. var last = returnFiber.lastEffect;
  27442. if (last !== null) {
  27443. last.nextEffect = current;
  27444. returnFiber.lastEffect = current;
  27445. } else {
  27446. returnFiber.firstEffect = returnFiber.lastEffect = current;
  27447. }
  27448. current.nextEffect = null;
  27449. current.effectTag = Deletion;
  27450. newWorkInProgress.effectTag |= Placement; // Restart work from the new fiber.
  27451. return newWorkInProgress;
  27452. }
  27453. }
  27454. function beginWork(current, workInProgress, renderExpirationTime) {
  27455. var updateExpirationTime = workInProgress.expirationTime;
  27456. {
  27457. if (workInProgress._debugNeedsRemount && current !== null) {
  27458. // This will restart the begin phase with a new fiber.
  27459. return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.expirationTime));
  27460. }
  27461. }
  27462. if (current !== null) {
  27463. var oldProps = current.memoizedProps;
  27464. var newProps = workInProgress.pendingProps;
  27465. if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload:
  27466. workInProgress.type !== current.type )) {
  27467. // If props or context changed, mark the fiber as having performed work.
  27468. // This may be unset if the props are determined to be equal later (memo).
  27469. didReceiveUpdate = true;
  27470. } else if (updateExpirationTime < renderExpirationTime) {
  27471. didReceiveUpdate = false; // This fiber does not have any pending work. Bailout without entering
  27472. // the begin phase. There's still some bookkeeping we that needs to be done
  27473. // in this optimized path, mostly pushing stuff onto the stack.
  27474. switch (workInProgress.tag) {
  27475. case HostRoot:
  27476. pushHostRootContext(workInProgress);
  27477. resetHydrationState();
  27478. break;
  27479. case HostComponent:
  27480. pushHostContext(workInProgress);
  27481. if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(workInProgress.type, newProps)) {
  27482. {
  27483. markSpawnedWork(Never);
  27484. } // Schedule this fiber to re-render at offscreen priority. Then bailout.
  27485. workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
  27486. return null;
  27487. }
  27488. break;
  27489. case ClassComponent:
  27490. {
  27491. var Component = workInProgress.type;
  27492. if (isContextProvider(Component)) {
  27493. pushContextProvider(workInProgress);
  27494. }
  27495. break;
  27496. }
  27497. case HostPortal:
  27498. pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
  27499. break;
  27500. case ContextProvider:
  27501. {
  27502. var newValue = workInProgress.memoizedProps.value;
  27503. pushProvider(workInProgress, newValue);
  27504. break;
  27505. }
  27506. case Profiler:
  27507. {
  27508. // Profiler should only call onRender when one of its descendants actually rendered.
  27509. var hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;
  27510. if (hasChildWork) {
  27511. workInProgress.effectTag |= Update;
  27512. }
  27513. }
  27514. break;
  27515. case SuspenseComponent:
  27516. {
  27517. var state = workInProgress.memoizedState;
  27518. if (state !== null) {
  27519. // whether to retry the primary children, or to skip over it and
  27520. // go straight to the fallback. Check the priority of the primary
  27521. // child fragment.
  27522. var primaryChildFragment = workInProgress.child;
  27523. var primaryChildExpirationTime = primaryChildFragment.childExpirationTime;
  27524. if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) {
  27525. // The primary children have pending work. Use the normal path
  27526. // to attempt to render the primary children again.
  27527. return updateSuspenseComponent(current, workInProgress, renderExpirationTime);
  27528. } else {
  27529. pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient
  27530. // priority. Bailout.
  27531. var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
  27532. if (child !== null) {
  27533. // The fallback children have pending work. Skip over the
  27534. // primary children and work on the fallback.
  27535. return child.sibling;
  27536. } else {
  27537. return null;
  27538. }
  27539. }
  27540. } else {
  27541. pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
  27542. }
  27543. break;
  27544. }
  27545. case SuspenseListComponent:
  27546. {
  27547. var didSuspendBefore = (current.effectTag & DidCapture) !== NoEffect;
  27548. var _hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;
  27549. if (didSuspendBefore) {
  27550. if (_hasChildWork) {
  27551. // If something was in fallback state last time, and we have all the
  27552. // same children then we're still in progressive loading state.
  27553. // Something might get unblocked by state updates or retries in the
  27554. // tree which will affect the tail. So we need to use the normal
  27555. // path to compute the correct tail.
  27556. return updateSuspenseListComponent(current, workInProgress, renderExpirationTime);
  27557. } // If none of the children had any work, that means that none of
  27558. // them got retried so they'll still be blocked in the same way
  27559. // as before. We can fast bail out.
  27560. workInProgress.effectTag |= DidCapture;
  27561. } // If nothing suspended before and we're rendering the same children,
  27562. // then the tail doesn't matter. Anything new that suspends will work
  27563. // in the "together" mode, so we can continue from the state we had.
  27564. var renderState = workInProgress.memoizedState;
  27565. if (renderState !== null) {
  27566. // Reset to the "together" mode in case we've started a different
  27567. // update in the past but didn't complete it.
  27568. renderState.rendering = null;
  27569. renderState.tail = null;
  27570. }
  27571. pushSuspenseContext(workInProgress, suspenseStackCursor.current);
  27572. if (_hasChildWork) {
  27573. break;
  27574. } else {
  27575. // If none of the children had any work, that means that none of
  27576. // them got retried so they'll still be blocked in the same way
  27577. // as before. We can fast bail out.
  27578. return null;
  27579. }
  27580. }
  27581. }
  27582. return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
  27583. } else {
  27584. // An update was scheduled on this fiber, but there are no new props
  27585. // nor legacy context. Set this to false. If an update queue or context
  27586. // consumer produces a changed value, it will set this to true. Otherwise,
  27587. // the component will assume the children have not changed and bail out.
  27588. didReceiveUpdate = false;
  27589. }
  27590. } else {
  27591. didReceiveUpdate = false;
  27592. } // Before entering the begin phase, clear pending update priority.
  27593. // TODO: This assumes that we're about to evaluate the component and process
  27594. // the update queue. However, there's an exception: SimpleMemoComponent
  27595. // sometimes bails out later in the begin phase. This indicates that we should
  27596. // move this assignment out of the common path and into each branch.
  27597. workInProgress.expirationTime = NoWork;
  27598. switch (workInProgress.tag) {
  27599. case IndeterminateComponent:
  27600. {
  27601. return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderExpirationTime);
  27602. }
  27603. case LazyComponent:
  27604. {
  27605. var elementType = workInProgress.elementType;
  27606. return mountLazyComponent(current, workInProgress, elementType, updateExpirationTime, renderExpirationTime);
  27607. }
  27608. case FunctionComponent:
  27609. {
  27610. var _Component = workInProgress.type;
  27611. var unresolvedProps = workInProgress.pendingProps;
  27612. var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
  27613. return updateFunctionComponent(current, workInProgress, _Component, resolvedProps, renderExpirationTime);
  27614. }
  27615. case ClassComponent:
  27616. {
  27617. var _Component2 = workInProgress.type;
  27618. var _unresolvedProps = workInProgress.pendingProps;
  27619. var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);
  27620. return updateClassComponent(current, workInProgress, _Component2, _resolvedProps, renderExpirationTime);
  27621. }
  27622. case HostRoot:
  27623. return updateHostRoot(current, workInProgress, renderExpirationTime);
  27624. case HostComponent:
  27625. return updateHostComponent(current, workInProgress, renderExpirationTime);
  27626. case HostText:
  27627. return updateHostText(current, workInProgress);
  27628. case SuspenseComponent:
  27629. return updateSuspenseComponent(current, workInProgress, renderExpirationTime);
  27630. case HostPortal:
  27631. return updatePortalComponent(current, workInProgress, renderExpirationTime);
  27632. case ForwardRef:
  27633. {
  27634. var type = workInProgress.type;
  27635. var _unresolvedProps2 = workInProgress.pendingProps;
  27636. var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
  27637. return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderExpirationTime);
  27638. }
  27639. case Fragment:
  27640. return updateFragment(current, workInProgress, renderExpirationTime);
  27641. case Mode:
  27642. return updateMode(current, workInProgress, renderExpirationTime);
  27643. case Profiler:
  27644. return updateProfiler(current, workInProgress, renderExpirationTime);
  27645. case ContextProvider:
  27646. return updateContextProvider(current, workInProgress, renderExpirationTime);
  27647. case ContextConsumer:
  27648. return updateContextConsumer(current, workInProgress, renderExpirationTime);
  27649. case MemoComponent:
  27650. {
  27651. var _type2 = workInProgress.type;
  27652. var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.
  27653. var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
  27654. {
  27655. if (workInProgress.type !== workInProgress.elementType) {
  27656. var outerPropTypes = _type2.propTypes;
  27657. if (outerPropTypes) {
  27658. checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only
  27659. 'prop', getComponentName(_type2), getCurrentFiberStackInDev);
  27660. }
  27661. }
  27662. }
  27663. _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
  27664. return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);
  27665. }
  27666. case SimpleMemoComponent:
  27667. {
  27668. return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime);
  27669. }
  27670. case IncompleteClassComponent:
  27671. {
  27672. var _Component3 = workInProgress.type;
  27673. var _unresolvedProps4 = workInProgress.pendingProps;
  27674. var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);
  27675. return mountIncompleteClassComponent(current, workInProgress, _Component3, _resolvedProps4, renderExpirationTime);
  27676. }
  27677. case SuspenseListComponent:
  27678. {
  27679. return updateSuspenseListComponent(current, workInProgress, renderExpirationTime);
  27680. }
  27681. }
  27682. {
  27683. {
  27684. throw Error( "Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue." );
  27685. }
  27686. }
  27687. }
  27688. function markUpdate(workInProgress) {
  27689. // Tag the fiber with an update effect. This turns a Placement into
  27690. // a PlacementAndUpdate.
  27691. workInProgress.effectTag |= Update;
  27692. }
  27693. function markRef$1(workInProgress) {
  27694. workInProgress.effectTag |= Ref;
  27695. }
  27696. var appendAllChildren;
  27697. var updateHostContainer;
  27698. var updateHostComponent$1;
  27699. var updateHostText$1;
  27700. {
  27701. // Mutation mode
  27702. appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
  27703. // We only have the top Fiber that was created but we need recurse down its
  27704. // children to find all the terminal nodes.
  27705. var node = workInProgress.child;
  27706. while (node !== null) {
  27707. if (node.tag === HostComponent || node.tag === HostText) {
  27708. appendInitialChild(parent, node.stateNode);
  27709. } else if (node.tag === HostPortal) ; else if (node.child !== null) {
  27710. node.child.return = node;
  27711. node = node.child;
  27712. continue;
  27713. }
  27714. if (node === workInProgress) {
  27715. return;
  27716. }
  27717. while (node.sibling === null) {
  27718. if (node.return === null || node.return === workInProgress) {
  27719. return;
  27720. }
  27721. node = node.return;
  27722. }
  27723. node.sibling.return = node.return;
  27724. node = node.sibling;
  27725. }
  27726. };
  27727. updateHostContainer = function (workInProgress) {// Noop
  27728. };
  27729. updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
  27730. // If we have an alternate, that means this is an update and we need to
  27731. // schedule a side-effect to do the updates.
  27732. var oldProps = current.memoizedProps;
  27733. if (oldProps === newProps) {
  27734. // In mutation mode, this is sufficient for a bailout because
  27735. // we won't touch this node even if children changed.
  27736. return;
  27737. } // If we get updated because one of our children updated, we don't
  27738. // have newProps so we'll have to reuse them.
  27739. // TODO: Split the update API as separate for the props vs. children.
  27740. // Even better would be if children weren't special cased at all tho.
  27741. var instance = workInProgress.stateNode;
  27742. var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host
  27743. // component is hitting the resume path. Figure out why. Possibly
  27744. // related to `hidden`.
  27745. var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component.
  27746. workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
  27747. // is a new ref we mark this as an update. All the work is done in commitWork.
  27748. if (updatePayload) {
  27749. markUpdate(workInProgress);
  27750. }
  27751. };
  27752. updateHostText$1 = function (current, workInProgress, oldText, newText) {
  27753. // If the text differs, mark it as an update. All the work in done in commitWork.
  27754. if (oldText !== newText) {
  27755. markUpdate(workInProgress);
  27756. }
  27757. };
  27758. }
  27759. function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
  27760. switch (renderState.tailMode) {
  27761. case 'hidden':
  27762. {
  27763. // Any insertions at the end of the tail list after this point
  27764. // should be invisible. If there are already mounted boundaries
  27765. // anything before them are not considered for collapsing.
  27766. // Therefore we need to go through the whole tail to find if
  27767. // there are any.
  27768. var tailNode = renderState.tail;
  27769. var lastTailNode = null;
  27770. while (tailNode !== null) {
  27771. if (tailNode.alternate !== null) {
  27772. lastTailNode = tailNode;
  27773. }
  27774. tailNode = tailNode.sibling;
  27775. } // Next we're simply going to delete all insertions after the
  27776. // last rendered item.
  27777. if (lastTailNode === null) {
  27778. // All remaining items in the tail are insertions.
  27779. renderState.tail = null;
  27780. } else {
  27781. // Detach the insertion after the last node that was already
  27782. // inserted.
  27783. lastTailNode.sibling = null;
  27784. }
  27785. break;
  27786. }
  27787. case 'collapsed':
  27788. {
  27789. // Any insertions at the end of the tail list after this point
  27790. // should be invisible. If there are already mounted boundaries
  27791. // anything before them are not considered for collapsing.
  27792. // Therefore we need to go through the whole tail to find if
  27793. // there are any.
  27794. var _tailNode = renderState.tail;
  27795. var _lastTailNode = null;
  27796. while (_tailNode !== null) {
  27797. if (_tailNode.alternate !== null) {
  27798. _lastTailNode = _tailNode;
  27799. }
  27800. _tailNode = _tailNode.sibling;
  27801. } // Next we're simply going to delete all insertions after the
  27802. // last rendered item.
  27803. if (_lastTailNode === null) {
  27804. // All remaining items in the tail are insertions.
  27805. if (!hasRenderedATailFallback && renderState.tail !== null) {
  27806. // We suspended during the head. We want to show at least one
  27807. // row at the tail. So we'll keep on and cut off the rest.
  27808. renderState.tail.sibling = null;
  27809. } else {
  27810. renderState.tail = null;
  27811. }
  27812. } else {
  27813. // Detach the insertion after the last node that was already
  27814. // inserted.
  27815. _lastTailNode.sibling = null;
  27816. }
  27817. break;
  27818. }
  27819. }
  27820. }
  27821. function completeWork(current, workInProgress, renderExpirationTime) {
  27822. var newProps = workInProgress.pendingProps;
  27823. switch (workInProgress.tag) {
  27824. case IndeterminateComponent:
  27825. case LazyComponent:
  27826. case SimpleMemoComponent:
  27827. case FunctionComponent:
  27828. case ForwardRef:
  27829. case Fragment:
  27830. case Mode:
  27831. case Profiler:
  27832. case ContextConsumer:
  27833. case MemoComponent:
  27834. return null;
  27835. case ClassComponent:
  27836. {
  27837. var Component = workInProgress.type;
  27838. if (isContextProvider(Component)) {
  27839. popContext(workInProgress);
  27840. }
  27841. return null;
  27842. }
  27843. case HostRoot:
  27844. {
  27845. popHostContainer(workInProgress);
  27846. popTopLevelContextObject(workInProgress);
  27847. var fiberRoot = workInProgress.stateNode;
  27848. if (fiberRoot.pendingContext) {
  27849. fiberRoot.context = fiberRoot.pendingContext;
  27850. fiberRoot.pendingContext = null;
  27851. }
  27852. if (current === null || current.child === null) {
  27853. // If we hydrated, pop so that we can delete any remaining children
  27854. // that weren't hydrated.
  27855. var wasHydrated = popHydrationState(workInProgress);
  27856. if (wasHydrated) {
  27857. // If we hydrated, then we'll need to schedule an update for
  27858. // the commit side-effects on the root.
  27859. markUpdate(workInProgress);
  27860. }
  27861. }
  27862. updateHostContainer(workInProgress);
  27863. return null;
  27864. }
  27865. case HostComponent:
  27866. {
  27867. popHostContext(workInProgress);
  27868. var rootContainerInstance = getRootHostContainer();
  27869. var type = workInProgress.type;
  27870. if (current !== null && workInProgress.stateNode != null) {
  27871. updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);
  27872. if (current.ref !== workInProgress.ref) {
  27873. markRef$1(workInProgress);
  27874. }
  27875. } else {
  27876. if (!newProps) {
  27877. if (!(workInProgress.stateNode !== null)) {
  27878. {
  27879. throw Error( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." );
  27880. }
  27881. } // This can happen when we abort work.
  27882. return null;
  27883. }
  27884. var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
  27885. // "stack" as the parent. Then append children as we go in beginWork
  27886. // or completeWork depending on whether we want to add them top->down or
  27887. // bottom->up. Top->down is faster in IE11.
  27888. var _wasHydrated = popHydrationState(workInProgress);
  27889. if (_wasHydrated) {
  27890. // TODO: Move this and createInstance step into the beginPhase
  27891. // to consolidate.
  27892. if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {
  27893. // If changes to the hydrated node need to be applied at the
  27894. // commit-phase we mark this as such.
  27895. markUpdate(workInProgress);
  27896. }
  27897. } else {
  27898. var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);
  27899. appendAllChildren(instance, workInProgress, false, false); // This needs to be set before we mount Flare event listeners
  27900. workInProgress.stateNode = instance;
  27901. // (eg DOM renderer supports auto-focus for certain elements).
  27902. // Make sure such renderers get scheduled for later work.
  27903. if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
  27904. markUpdate(workInProgress);
  27905. }
  27906. }
  27907. if (workInProgress.ref !== null) {
  27908. // If there is a ref on a host node we need to schedule a callback
  27909. markRef$1(workInProgress);
  27910. }
  27911. }
  27912. return null;
  27913. }
  27914. case HostText:
  27915. {
  27916. var newText = newProps;
  27917. if (current && workInProgress.stateNode != null) {
  27918. var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need
  27919. // to schedule a side-effect to do the updates.
  27920. updateHostText$1(current, workInProgress, oldText, newText);
  27921. } else {
  27922. if (typeof newText !== 'string') {
  27923. if (!(workInProgress.stateNode !== null)) {
  27924. {
  27925. throw Error( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." );
  27926. }
  27927. } // This can happen when we abort work.
  27928. }
  27929. var _rootContainerInstance = getRootHostContainer();
  27930. var _currentHostContext = getHostContext();
  27931. var _wasHydrated2 = popHydrationState(workInProgress);
  27932. if (_wasHydrated2) {
  27933. if (prepareToHydrateHostTextInstance(workInProgress)) {
  27934. markUpdate(workInProgress);
  27935. }
  27936. } else {
  27937. workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);
  27938. }
  27939. }
  27940. return null;
  27941. }
  27942. case SuspenseComponent:
  27943. {
  27944. popSuspenseContext(workInProgress);
  27945. var nextState = workInProgress.memoizedState;
  27946. if ((workInProgress.effectTag & DidCapture) !== NoEffect) {
  27947. // Something suspended. Re-render with the fallback children.
  27948. workInProgress.expirationTime = renderExpirationTime; // Do not reset the effect list.
  27949. return workInProgress;
  27950. }
  27951. var nextDidTimeout = nextState !== null;
  27952. var prevDidTimeout = false;
  27953. if (current === null) {
  27954. if (workInProgress.memoizedProps.fallback !== undefined) {
  27955. popHydrationState(workInProgress);
  27956. }
  27957. } else {
  27958. var prevState = current.memoizedState;
  27959. prevDidTimeout = prevState !== null;
  27960. if (!nextDidTimeout && prevState !== null) {
  27961. // We just switched from the fallback to the normal children.
  27962. // Delete the fallback.
  27963. // TODO: Would it be better to store the fallback fragment on
  27964. // the stateNode during the begin phase?
  27965. var currentFallbackChild = current.child.sibling;
  27966. if (currentFallbackChild !== null) {
  27967. // Deletions go at the beginning of the return fiber's effect list
  27968. var first = workInProgress.firstEffect;
  27969. if (first !== null) {
  27970. workInProgress.firstEffect = currentFallbackChild;
  27971. currentFallbackChild.nextEffect = first;
  27972. } else {
  27973. workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChild;
  27974. currentFallbackChild.nextEffect = null;
  27975. }
  27976. currentFallbackChild.effectTag = Deletion;
  27977. }
  27978. }
  27979. }
  27980. if (nextDidTimeout && !prevDidTimeout) {
  27981. // If this subtreee is running in blocking mode we can suspend,
  27982. // otherwise we won't suspend.
  27983. // TODO: This will still suspend a synchronous tree if anything
  27984. // in the concurrent tree already suspended during this render.
  27985. // This is a known bug.
  27986. if ((workInProgress.mode & BlockingMode) !== NoMode) {
  27987. // TODO: Move this back to throwException because this is too late
  27988. // if this is a large tree which is common for initial loads. We
  27989. // don't know if we should restart a render or not until we get
  27990. // this marker, and this is too late.
  27991. // If this render already had a ping or lower pri updates,
  27992. // and this is the first time we know we're going to suspend we
  27993. // should be able to immediately restart from within throwException.
  27994. var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;
  27995. if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
  27996. // If this was in an invisible tree or a new render, then showing
  27997. // this boundary is ok.
  27998. renderDidSuspend();
  27999. } else {
  28000. // Otherwise, we're going to have to hide content so we should
  28001. // suspend for longer if possible.
  28002. renderDidSuspendDelayIfPossible();
  28003. }
  28004. }
  28005. }
  28006. {
  28007. // TODO: Only schedule updates if these values are non equal, i.e. it changed.
  28008. if (nextDidTimeout || prevDidTimeout) {
  28009. // If this boundary just timed out, schedule an effect to attach a
  28010. // retry listener to the promise. This flag is also used to hide the
  28011. // primary children. In mutation mode, we also need the flag to
  28012. // *unhide* children that were previously hidden, so check if this
  28013. // is currently timed out, too.
  28014. workInProgress.effectTag |= Update;
  28015. }
  28016. }
  28017. return null;
  28018. }
  28019. case HostPortal:
  28020. popHostContainer(workInProgress);
  28021. updateHostContainer(workInProgress);
  28022. return null;
  28023. case ContextProvider:
  28024. // Pop provider fiber
  28025. popProvider(workInProgress);
  28026. return null;
  28027. case IncompleteClassComponent:
  28028. {
  28029. // Same as class component case. I put it down here so that the tags are
  28030. // sequential to ensure this switch is compiled to a jump table.
  28031. var _Component = workInProgress.type;
  28032. if (isContextProvider(_Component)) {
  28033. popContext(workInProgress);
  28034. }
  28035. return null;
  28036. }
  28037. case SuspenseListComponent:
  28038. {
  28039. popSuspenseContext(workInProgress);
  28040. var renderState = workInProgress.memoizedState;
  28041. if (renderState === null) {
  28042. // We're running in the default, "independent" mode.
  28043. // We don't do anything in this mode.
  28044. return null;
  28045. }
  28046. var didSuspendAlready = (workInProgress.effectTag & DidCapture) !== NoEffect;
  28047. var renderedTail = renderState.rendering;
  28048. if (renderedTail === null) {
  28049. // We just rendered the head.
  28050. if (!didSuspendAlready) {
  28051. // This is the first pass. We need to figure out if anything is still
  28052. // suspended in the rendered set.
  28053. // If new content unsuspended, but there's still some content that
  28054. // didn't. Then we need to do a second pass that forces everything
  28055. // to keep showing their fallbacks.
  28056. // We might be suspended if something in this render pass suspended, or
  28057. // something in the previous committed pass suspended. Otherwise,
  28058. // there's no chance so we can skip the expensive call to
  28059. // findFirstSuspended.
  28060. var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.effectTag & DidCapture) === NoEffect);
  28061. if (!cannotBeSuspended) {
  28062. var row = workInProgress.child;
  28063. while (row !== null) {
  28064. var suspended = findFirstSuspended(row);
  28065. if (suspended !== null) {
  28066. didSuspendAlready = true;
  28067. workInProgress.effectTag |= DidCapture;
  28068. cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as
  28069. // part of the second pass. In that case nothing will subscribe to
  28070. // its thennables. Instead, we'll transfer its thennables to the
  28071. // SuspenseList so that it can retry if they resolve.
  28072. // There might be multiple of these in the list but since we're
  28073. // going to wait for all of them anyway, it doesn't really matter
  28074. // which ones gets to ping. In theory we could get clever and keep
  28075. // track of how many dependencies remain but it gets tricky because
  28076. // in the meantime, we can add/remove/change items and dependencies.
  28077. // We might bail out of the loop before finding any but that
  28078. // doesn't matter since that means that the other boundaries that
  28079. // we did find already has their listeners attached.
  28080. var newThennables = suspended.updateQueue;
  28081. if (newThennables !== null) {
  28082. workInProgress.updateQueue = newThennables;
  28083. workInProgress.effectTag |= Update;
  28084. } // Rerender the whole list, but this time, we'll force fallbacks
  28085. // to stay in place.
  28086. // Reset the effect list before doing the second pass since that's now invalid.
  28087. if (renderState.lastEffect === null) {
  28088. workInProgress.firstEffect = null;
  28089. }
  28090. workInProgress.lastEffect = renderState.lastEffect; // Reset the child fibers to their original state.
  28091. resetChildFibers(workInProgress, renderExpirationTime); // Set up the Suspense Context to force suspense and immediately
  28092. // rerender the children.
  28093. pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
  28094. return workInProgress.child;
  28095. }
  28096. row = row.sibling;
  28097. }
  28098. }
  28099. } else {
  28100. cutOffTailIfNeeded(renderState, false);
  28101. } // Next we're going to render the tail.
  28102. } else {
  28103. // Append the rendered row to the child list.
  28104. if (!didSuspendAlready) {
  28105. var _suspended = findFirstSuspended(renderedTail);
  28106. if (_suspended !== null) {
  28107. workInProgress.effectTag |= DidCapture;
  28108. didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't
  28109. // get lost if this row ends up dropped during a second pass.
  28110. var _newThennables = _suspended.updateQueue;
  28111. if (_newThennables !== null) {
  28112. workInProgress.updateQueue = _newThennables;
  28113. workInProgress.effectTag |= Update;
  28114. }
  28115. cutOffTailIfNeeded(renderState, true); // This might have been modified.
  28116. if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate) {
  28117. // We need to delete the row we just rendered.
  28118. // Reset the effect list to what it was before we rendered this
  28119. // child. The nested children have already appended themselves.
  28120. var lastEffect = workInProgress.lastEffect = renderState.lastEffect; // Remove any effects that were appended after this point.
  28121. if (lastEffect !== null) {
  28122. lastEffect.nextEffect = null;
  28123. } // We're done.
  28124. return null;
  28125. }
  28126. } else if ( // The time it took to render last row is greater than time until
  28127. // the expiration.
  28128. now() * 2 - renderState.renderingStartTime > renderState.tailExpiration && renderExpirationTime > Never) {
  28129. // We have now passed our CPU deadline and we'll just give up further
  28130. // attempts to render the main content and only render fallbacks.
  28131. // The assumption is that this is usually faster.
  28132. workInProgress.effectTag |= DidCapture;
  28133. didSuspendAlready = true;
  28134. cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this
  28135. // to get it started back up to attempt the next item. If we can show
  28136. // them, then they really have the same priority as this render.
  28137. // So we'll pick it back up the very next render pass once we've had
  28138. // an opportunity to yield for paint.
  28139. var nextPriority = renderExpirationTime - 1;
  28140. workInProgress.expirationTime = workInProgress.childExpirationTime = nextPriority;
  28141. {
  28142. markSpawnedWork(nextPriority);
  28143. }
  28144. }
  28145. }
  28146. if (renderState.isBackwards) {
  28147. // The effect list of the backwards tail will have been added
  28148. // to the end. This breaks the guarantee that life-cycles fire in
  28149. // sibling order but that isn't a strong guarantee promised by React.
  28150. // Especially since these might also just pop in during future commits.
  28151. // Append to the beginning of the list.
  28152. renderedTail.sibling = workInProgress.child;
  28153. workInProgress.child = renderedTail;
  28154. } else {
  28155. var previousSibling = renderState.last;
  28156. if (previousSibling !== null) {
  28157. previousSibling.sibling = renderedTail;
  28158. } else {
  28159. workInProgress.child = renderedTail;
  28160. }
  28161. renderState.last = renderedTail;
  28162. }
  28163. }
  28164. if (renderState.tail !== null) {
  28165. // We still have tail rows to render.
  28166. if (renderState.tailExpiration === 0) {
  28167. // Heuristic for how long we're willing to spend rendering rows
  28168. // until we just give up and show what we have so far.
  28169. var TAIL_EXPIRATION_TIMEOUT_MS = 500;
  28170. renderState.tailExpiration = now() + TAIL_EXPIRATION_TIMEOUT_MS; // TODO: This is meant to mimic the train model or JND but this
  28171. // is a per component value. It should really be since the start
  28172. // of the total render or last commit. Consider using something like
  28173. // globalMostRecentFallbackTime. That doesn't account for being
  28174. // suspended for part of the time or when it's a new render.
  28175. // It should probably use a global start time value instead.
  28176. } // Pop a row.
  28177. var next = renderState.tail;
  28178. renderState.rendering = next;
  28179. renderState.tail = next.sibling;
  28180. renderState.lastEffect = workInProgress.lastEffect;
  28181. renderState.renderingStartTime = now();
  28182. next.sibling = null; // Restore the context.
  28183. // TODO: We can probably just avoid popping it instead and only
  28184. // setting it the first time we go from not suspended to suspended.
  28185. var suspenseContext = suspenseStackCursor.current;
  28186. if (didSuspendAlready) {
  28187. suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
  28188. } else {
  28189. suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
  28190. }
  28191. pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row.
  28192. return next;
  28193. }
  28194. return null;
  28195. }
  28196. }
  28197. {
  28198. {
  28199. throw Error( "Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue." );
  28200. }
  28201. }
  28202. }
  28203. function unwindWork(workInProgress, renderExpirationTime) {
  28204. switch (workInProgress.tag) {
  28205. case ClassComponent:
  28206. {
  28207. var Component = workInProgress.type;
  28208. if (isContextProvider(Component)) {
  28209. popContext(workInProgress);
  28210. }
  28211. var effectTag = workInProgress.effectTag;
  28212. if (effectTag & ShouldCapture) {
  28213. workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;
  28214. return workInProgress;
  28215. }
  28216. return null;
  28217. }
  28218. case HostRoot:
  28219. {
  28220. popHostContainer(workInProgress);
  28221. popTopLevelContextObject(workInProgress);
  28222. var _effectTag = workInProgress.effectTag;
  28223. if (!((_effectTag & DidCapture) === NoEffect)) {
  28224. {
  28225. throw Error( "The root failed to unmount after an error. This is likely a bug in React. Please file an issue." );
  28226. }
  28227. }
  28228. workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;
  28229. return workInProgress;
  28230. }
  28231. case HostComponent:
  28232. {
  28233. // TODO: popHydrationState
  28234. popHostContext(workInProgress);
  28235. return null;
  28236. }
  28237. case SuspenseComponent:
  28238. {
  28239. popSuspenseContext(workInProgress);
  28240. var _effectTag2 = workInProgress.effectTag;
  28241. if (_effectTag2 & ShouldCapture) {
  28242. workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.
  28243. return workInProgress;
  28244. }
  28245. return null;
  28246. }
  28247. case SuspenseListComponent:
  28248. {
  28249. popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been
  28250. // caught by a nested boundary. If not, it should bubble through.
  28251. return null;
  28252. }
  28253. case HostPortal:
  28254. popHostContainer(workInProgress);
  28255. return null;
  28256. case ContextProvider:
  28257. popProvider(workInProgress);
  28258. return null;
  28259. default:
  28260. return null;
  28261. }
  28262. }
  28263. function unwindInterruptedWork(interruptedWork) {
  28264. switch (interruptedWork.tag) {
  28265. case ClassComponent:
  28266. {
  28267. var childContextTypes = interruptedWork.type.childContextTypes;
  28268. if (childContextTypes !== null && childContextTypes !== undefined) {
  28269. popContext(interruptedWork);
  28270. }
  28271. break;
  28272. }
  28273. case HostRoot:
  28274. {
  28275. popHostContainer(interruptedWork);
  28276. popTopLevelContextObject(interruptedWork);
  28277. break;
  28278. }
  28279. case HostComponent:
  28280. {
  28281. popHostContext(interruptedWork);
  28282. break;
  28283. }
  28284. case HostPortal:
  28285. popHostContainer(interruptedWork);
  28286. break;
  28287. case SuspenseComponent:
  28288. popSuspenseContext(interruptedWork);
  28289. break;
  28290. case SuspenseListComponent:
  28291. popSuspenseContext(interruptedWork);
  28292. break;
  28293. case ContextProvider:
  28294. popProvider(interruptedWork);
  28295. break;
  28296. }
  28297. }
  28298. function createCapturedValue(value, source) {
  28299. // If the value is an error, call this function immediately after it is thrown
  28300. // so the stack is accurate.
  28301. return {
  28302. value: value,
  28303. source: source,
  28304. stack: getStackByFiberInDevAndProd(source)
  28305. };
  28306. }
  28307. function logCapturedError(capturedError) {
  28308. var error = capturedError.error;
  28309. {
  28310. var componentName = capturedError.componentName,
  28311. componentStack = capturedError.componentStack,
  28312. errorBoundaryName = capturedError.errorBoundaryName,
  28313. errorBoundaryFound = capturedError.errorBoundaryFound,
  28314. willRetry = capturedError.willRetry; // Browsers support silencing uncaught errors by calling
  28315. // `preventDefault()` in window `error` handler.
  28316. // We record this information as an expando on the error.
  28317. if (error != null && error._suppressLogging) {
  28318. if (errorBoundaryFound && willRetry) {
  28319. // The error is recoverable and was silenced.
  28320. // Ignore it and don't print the stack addendum.
  28321. // This is handy for testing error boundaries without noise.
  28322. return;
  28323. } // The error is fatal. Since the silencing might have
  28324. // been accidental, we'll surface it anyway.
  28325. // However, the browser would have silenced the original error
  28326. // so we'll print it first, and then print the stack addendum.
  28327. console['error'](error); // Don't transform to our wrapper
  28328. // For a more detailed description of this block, see:
  28329. // https://github.com/facebook/react/pull/13384
  28330. }
  28331. var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : 'The above error occurred in one of your React components:';
  28332. var errorBoundaryMessage; // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.
  28333. if (errorBoundaryFound && errorBoundaryName) {
  28334. if (willRetry) {
  28335. errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
  28336. } else {
  28337. errorBoundaryMessage = "This error was initially handled by the error boundary " + errorBoundaryName + ".\n" + "Recreating the tree from scratch failed so React will unmount the tree.";
  28338. }
  28339. } else {
  28340. errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';
  28341. }
  28342. var combinedMessage = "" + componentNameMessage + componentStack + "\n\n" + ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack.
  28343. // We don't include the original error message and JS stack because the browser
  28344. // has already printed it. Even if the application swallows the error, it is still
  28345. // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.
  28346. console['error'](combinedMessage); // Don't transform to our wrapper
  28347. }
  28348. }
  28349. var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
  28350. {
  28351. didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
  28352. }
  28353. var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;
  28354. function logError(boundary, errorInfo) {
  28355. var source = errorInfo.source;
  28356. var stack = errorInfo.stack;
  28357. if (stack === null && source !== null) {
  28358. stack = getStackByFiberInDevAndProd(source);
  28359. }
  28360. var capturedError = {
  28361. componentName: source !== null ? getComponentName(source.type) : null,
  28362. componentStack: stack !== null ? stack : '',
  28363. error: errorInfo.value,
  28364. errorBoundary: null,
  28365. errorBoundaryName: null,
  28366. errorBoundaryFound: false,
  28367. willRetry: false
  28368. };
  28369. if (boundary !== null && boundary.tag === ClassComponent) {
  28370. capturedError.errorBoundary = boundary.stateNode;
  28371. capturedError.errorBoundaryName = getComponentName(boundary.type);
  28372. capturedError.errorBoundaryFound = true;
  28373. capturedError.willRetry = true;
  28374. }
  28375. try {
  28376. logCapturedError(capturedError);
  28377. } catch (e) {
  28378. // This method must not throw, or React internal state will get messed up.
  28379. // If console.error is overridden, or logCapturedError() shows a dialog that throws,
  28380. // we want to report this error outside of the normal stack as a last resort.
  28381. // https://github.com/facebook/react/issues/13188
  28382. setTimeout(function () {
  28383. throw e;
  28384. });
  28385. }
  28386. }
  28387. var callComponentWillUnmountWithTimer = function (current, instance) {
  28388. startPhaseTimer(current, 'componentWillUnmount');
  28389. instance.props = current.memoizedProps;
  28390. instance.state = current.memoizedState;
  28391. instance.componentWillUnmount();
  28392. stopPhaseTimer();
  28393. }; // Capture errors so they don't interrupt unmounting.
  28394. function safelyCallComponentWillUnmount(current, instance) {
  28395. {
  28396. invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current, instance);
  28397. if (hasCaughtError()) {
  28398. var unmountError = clearCaughtError();
  28399. captureCommitPhaseError(current, unmountError);
  28400. }
  28401. }
  28402. }
  28403. function safelyDetachRef(current) {
  28404. var ref = current.ref;
  28405. if (ref !== null) {
  28406. if (typeof ref === 'function') {
  28407. {
  28408. invokeGuardedCallback(null, ref, null, null);
  28409. if (hasCaughtError()) {
  28410. var refError = clearCaughtError();
  28411. captureCommitPhaseError(current, refError);
  28412. }
  28413. }
  28414. } else {
  28415. ref.current = null;
  28416. }
  28417. }
  28418. }
  28419. function safelyCallDestroy(current, destroy) {
  28420. {
  28421. invokeGuardedCallback(null, destroy, null);
  28422. if (hasCaughtError()) {
  28423. var error = clearCaughtError();
  28424. captureCommitPhaseError(current, error);
  28425. }
  28426. }
  28427. }
  28428. function commitBeforeMutationLifeCycles(current, finishedWork) {
  28429. switch (finishedWork.tag) {
  28430. case FunctionComponent:
  28431. case ForwardRef:
  28432. case SimpleMemoComponent:
  28433. case Block:
  28434. {
  28435. return;
  28436. }
  28437. case ClassComponent:
  28438. {
  28439. if (finishedWork.effectTag & Snapshot) {
  28440. if (current !== null) {
  28441. var prevProps = current.memoizedProps;
  28442. var prevState = current.memoizedState;
  28443. startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate');
  28444. var instance = finishedWork.stateNode; // We could update instance props and state here,
  28445. // but instead we rely on them being set during last render.
  28446. // TODO: revisit this when we implement resuming.
  28447. {
  28448. if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
  28449. if (instance.props !== finishedWork.memoizedProps) {
  28450. error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
  28451. }
  28452. if (instance.state !== finishedWork.memoizedState) {
  28453. error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
  28454. }
  28455. }
  28456. }
  28457. var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
  28458. {
  28459. var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
  28460. if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {
  28461. didWarnSet.add(finishedWork.type);
  28462. error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));
  28463. }
  28464. }
  28465. instance.__reactInternalSnapshotBeforeUpdate = snapshot;
  28466. stopPhaseTimer();
  28467. }
  28468. }
  28469. return;
  28470. }
  28471. case HostRoot:
  28472. case HostComponent:
  28473. case HostText:
  28474. case HostPortal:
  28475. case IncompleteClassComponent:
  28476. // Nothing to do for these component types
  28477. return;
  28478. }
  28479. {
  28480. {
  28481. throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
  28482. }
  28483. }
  28484. }
  28485. function commitHookEffectListUnmount(tag, finishedWork) {
  28486. var updateQueue = finishedWork.updateQueue;
  28487. var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
  28488. if (lastEffect !== null) {
  28489. var firstEffect = lastEffect.next;
  28490. var effect = firstEffect;
  28491. do {
  28492. if ((effect.tag & tag) === tag) {
  28493. // Unmount
  28494. var destroy = effect.destroy;
  28495. effect.destroy = undefined;
  28496. if (destroy !== undefined) {
  28497. destroy();
  28498. }
  28499. }
  28500. effect = effect.next;
  28501. } while (effect !== firstEffect);
  28502. }
  28503. }
  28504. function commitHookEffectListMount(tag, finishedWork) {
  28505. var updateQueue = finishedWork.updateQueue;
  28506. var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
  28507. if (lastEffect !== null) {
  28508. var firstEffect = lastEffect.next;
  28509. var effect = firstEffect;
  28510. do {
  28511. if ((effect.tag & tag) === tag) {
  28512. // Mount
  28513. var create = effect.create;
  28514. effect.destroy = create();
  28515. {
  28516. var destroy = effect.destroy;
  28517. if (destroy !== undefined && typeof destroy !== 'function') {
  28518. var addendum = void 0;
  28519. if (destroy === null) {
  28520. addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';
  28521. } else if (typeof destroy.then === 'function') {
  28522. addendum = '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + 'useEffect(() => {\n' + ' async function fetchData() {\n' + ' // You can await here\n' + ' const response = await MyAPI.getData(someId);\n' + ' // ...\n' + ' }\n' + ' fetchData();\n' + "}, [someId]); // Or [] if effect doesn't need props or state\n\n" + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching';
  28523. } else {
  28524. addendum = ' You returned: ' + destroy;
  28525. }
  28526. error('An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork));
  28527. }
  28528. }
  28529. }
  28530. effect = effect.next;
  28531. } while (effect !== firstEffect);
  28532. }
  28533. }
  28534. function commitPassiveHookEffects(finishedWork) {
  28535. if ((finishedWork.effectTag & Passive) !== NoEffect) {
  28536. switch (finishedWork.tag) {
  28537. case FunctionComponent:
  28538. case ForwardRef:
  28539. case SimpleMemoComponent:
  28540. case Block:
  28541. {
  28542. // TODO (#17945) We should call all passive destroy functions (for all fibers)
  28543. // before calling any create functions. The current approach only serializes
  28544. // these for a single fiber.
  28545. commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork);
  28546. commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
  28547. break;
  28548. }
  28549. }
  28550. }
  28551. }
  28552. function commitLifeCycles(finishedRoot, current, finishedWork, committedExpirationTime) {
  28553. switch (finishedWork.tag) {
  28554. case FunctionComponent:
  28555. case ForwardRef:
  28556. case SimpleMemoComponent:
  28557. case Block:
  28558. {
  28559. // At this point layout effects have already been destroyed (during mutation phase).
  28560. // This is done to prevent sibling component effects from interfering with each other,
  28561. // e.g. a destroy function in one component should never override a ref set
  28562. // by a create function in another component during the same commit.
  28563. commitHookEffectListMount(Layout | HasEffect, finishedWork);
  28564. return;
  28565. }
  28566. case ClassComponent:
  28567. {
  28568. var instance = finishedWork.stateNode;
  28569. if (finishedWork.effectTag & Update) {
  28570. if (current === null) {
  28571. startPhaseTimer(finishedWork, 'componentDidMount'); // We could update instance props and state here,
  28572. // but instead we rely on them being set during last render.
  28573. // TODO: revisit this when we implement resuming.
  28574. {
  28575. if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
  28576. if (instance.props !== finishedWork.memoizedProps) {
  28577. error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
  28578. }
  28579. if (instance.state !== finishedWork.memoizedState) {
  28580. error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
  28581. }
  28582. }
  28583. }
  28584. instance.componentDidMount();
  28585. stopPhaseTimer();
  28586. } else {
  28587. var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps);
  28588. var prevState = current.memoizedState;
  28589. startPhaseTimer(finishedWork, 'componentDidUpdate'); // We could update instance props and state here,
  28590. // but instead we rely on them being set during last render.
  28591. // TODO: revisit this when we implement resuming.
  28592. {
  28593. if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
  28594. if (instance.props !== finishedWork.memoizedProps) {
  28595. error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
  28596. }
  28597. if (instance.state !== finishedWork.memoizedState) {
  28598. error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
  28599. }
  28600. }
  28601. }
  28602. instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
  28603. stopPhaseTimer();
  28604. }
  28605. }
  28606. var updateQueue = finishedWork.updateQueue;
  28607. if (updateQueue !== null) {
  28608. {
  28609. if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
  28610. if (instance.props !== finishedWork.memoizedProps) {
  28611. error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
  28612. }
  28613. if (instance.state !== finishedWork.memoizedState) {
  28614. error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
  28615. }
  28616. }
  28617. } // We could update instance props and state here,
  28618. // but instead we rely on them being set during last render.
  28619. // TODO: revisit this when we implement resuming.
  28620. commitUpdateQueue(finishedWork, updateQueue, instance);
  28621. }
  28622. return;
  28623. }
  28624. case HostRoot:
  28625. {
  28626. var _updateQueue = finishedWork.updateQueue;
  28627. if (_updateQueue !== null) {
  28628. var _instance = null;
  28629. if (finishedWork.child !== null) {
  28630. switch (finishedWork.child.tag) {
  28631. case HostComponent:
  28632. _instance = getPublicInstance(finishedWork.child.stateNode);
  28633. break;
  28634. case ClassComponent:
  28635. _instance = finishedWork.child.stateNode;
  28636. break;
  28637. }
  28638. }
  28639. commitUpdateQueue(finishedWork, _updateQueue, _instance);
  28640. }
  28641. return;
  28642. }
  28643. case HostComponent:
  28644. {
  28645. var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted
  28646. // (eg DOM renderer may schedule auto-focus for inputs and form controls).
  28647. // These effects should only be committed when components are first mounted,
  28648. // aka when there is no current/alternate.
  28649. if (current === null && finishedWork.effectTag & Update) {
  28650. var type = finishedWork.type;
  28651. var props = finishedWork.memoizedProps;
  28652. commitMount(_instance2, type, props);
  28653. }
  28654. return;
  28655. }
  28656. case HostText:
  28657. {
  28658. // We have no life-cycles associated with text.
  28659. return;
  28660. }
  28661. case HostPortal:
  28662. {
  28663. // We have no life-cycles associated with portals.
  28664. return;
  28665. }
  28666. case Profiler:
  28667. {
  28668. {
  28669. var onRender = finishedWork.memoizedProps.onRender;
  28670. if (typeof onRender === 'function') {
  28671. {
  28672. onRender(finishedWork.memoizedProps.id, current === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);
  28673. }
  28674. }
  28675. }
  28676. return;
  28677. }
  28678. case SuspenseComponent:
  28679. {
  28680. commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
  28681. return;
  28682. }
  28683. case SuspenseListComponent:
  28684. case IncompleteClassComponent:
  28685. case FundamentalComponent:
  28686. case ScopeComponent:
  28687. return;
  28688. }
  28689. {
  28690. {
  28691. throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
  28692. }
  28693. }
  28694. }
  28695. function hideOrUnhideAllChildren(finishedWork, isHidden) {
  28696. {
  28697. // We only have the top Fiber that was inserted but we need to recurse down its
  28698. // children to find all the terminal nodes.
  28699. var node = finishedWork;
  28700. while (true) {
  28701. if (node.tag === HostComponent) {
  28702. var instance = node.stateNode;
  28703. if (isHidden) {
  28704. hideInstance(instance);
  28705. } else {
  28706. unhideInstance(node.stateNode, node.memoizedProps);
  28707. }
  28708. } else if (node.tag === HostText) {
  28709. var _instance3 = node.stateNode;
  28710. if (isHidden) {
  28711. hideTextInstance(_instance3);
  28712. } else {
  28713. unhideTextInstance(_instance3, node.memoizedProps);
  28714. }
  28715. } else if (node.tag === SuspenseComponent && node.memoizedState !== null && node.memoizedState.dehydrated === null) {
  28716. // Found a nested Suspense component that timed out. Skip over the
  28717. // primary child fragment, which should remain hidden.
  28718. var fallbackChildFragment = node.child.sibling;
  28719. fallbackChildFragment.return = node;
  28720. node = fallbackChildFragment;
  28721. continue;
  28722. } else if (node.child !== null) {
  28723. node.child.return = node;
  28724. node = node.child;
  28725. continue;
  28726. }
  28727. if (node === finishedWork) {
  28728. return;
  28729. }
  28730. while (node.sibling === null) {
  28731. if (node.return === null || node.return === finishedWork) {
  28732. return;
  28733. }
  28734. node = node.return;
  28735. }
  28736. node.sibling.return = node.return;
  28737. node = node.sibling;
  28738. }
  28739. }
  28740. }
  28741. function commitAttachRef(finishedWork) {
  28742. var ref = finishedWork.ref;
  28743. if (ref !== null) {
  28744. var instance = finishedWork.stateNode;
  28745. var instanceToUse;
  28746. switch (finishedWork.tag) {
  28747. case HostComponent:
  28748. instanceToUse = getPublicInstance(instance);
  28749. break;
  28750. default:
  28751. instanceToUse = instance;
  28752. } // Moved outside to ensure DCE works with this flag
  28753. if (typeof ref === 'function') {
  28754. ref(instanceToUse);
  28755. } else {
  28756. {
  28757. if (!ref.hasOwnProperty('current')) {
  28758. error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork));
  28759. }
  28760. }
  28761. ref.current = instanceToUse;
  28762. }
  28763. }
  28764. }
  28765. function commitDetachRef(current) {
  28766. var currentRef = current.ref;
  28767. if (currentRef !== null) {
  28768. if (typeof currentRef === 'function') {
  28769. currentRef(null);
  28770. } else {
  28771. currentRef.current = null;
  28772. }
  28773. }
  28774. } // User-originating errors (lifecycles and refs) should not interrupt
  28775. // deletion, so don't let them throw. Host-originating errors should
  28776. // interrupt deletion, so it's okay
  28777. function commitUnmount(finishedRoot, current, renderPriorityLevel) {
  28778. onCommitUnmount(current);
  28779. switch (current.tag) {
  28780. case FunctionComponent:
  28781. case ForwardRef:
  28782. case MemoComponent:
  28783. case SimpleMemoComponent:
  28784. case Block:
  28785. {
  28786. var updateQueue = current.updateQueue;
  28787. if (updateQueue !== null) {
  28788. var lastEffect = updateQueue.lastEffect;
  28789. if (lastEffect !== null) {
  28790. var firstEffect = lastEffect.next;
  28791. {
  28792. // When the owner fiber is deleted, the destroy function of a passive
  28793. // effect hook is called during the synchronous commit phase. This is
  28794. // a concession to implementation complexity. Calling it in the
  28795. // passive effect phase (like they usually are, when dependencies
  28796. // change during an update) would require either traversing the
  28797. // children of the deleted fiber again, or including unmount effects
  28798. // as part of the fiber effect list.
  28799. //
  28800. // Because this is during the sync commit phase, we need to change
  28801. // the priority.
  28802. //
  28803. // TODO: Reconsider this implementation trade off.
  28804. var priorityLevel = renderPriorityLevel > NormalPriority ? NormalPriority : renderPriorityLevel;
  28805. runWithPriority$1(priorityLevel, function () {
  28806. var effect = firstEffect;
  28807. do {
  28808. var _destroy = effect.destroy;
  28809. if (_destroy !== undefined) {
  28810. safelyCallDestroy(current, _destroy);
  28811. }
  28812. effect = effect.next;
  28813. } while (effect !== firstEffect);
  28814. });
  28815. }
  28816. }
  28817. }
  28818. return;
  28819. }
  28820. case ClassComponent:
  28821. {
  28822. safelyDetachRef(current);
  28823. var instance = current.stateNode;
  28824. if (typeof instance.componentWillUnmount === 'function') {
  28825. safelyCallComponentWillUnmount(current, instance);
  28826. }
  28827. return;
  28828. }
  28829. case HostComponent:
  28830. {
  28831. safelyDetachRef(current);
  28832. return;
  28833. }
  28834. case HostPortal:
  28835. {
  28836. // TODO: this is recursive.
  28837. // We are also not using this parent because
  28838. // the portal will get pushed immediately.
  28839. {
  28840. unmountHostComponents(finishedRoot, current, renderPriorityLevel);
  28841. }
  28842. return;
  28843. }
  28844. case FundamentalComponent:
  28845. {
  28846. return;
  28847. }
  28848. case DehydratedFragment:
  28849. {
  28850. return;
  28851. }
  28852. case ScopeComponent:
  28853. {
  28854. return;
  28855. }
  28856. }
  28857. }
  28858. function commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {
  28859. // While we're inside a removed host node we don't want to call
  28860. // removeChild on the inner nodes because they're removed by the top
  28861. // call anyway. We also want to call componentWillUnmount on all
  28862. // composites before this host node is removed from the tree. Therefore
  28863. // we do an inner loop while we're still inside the host node.
  28864. var node = root;
  28865. while (true) {
  28866. commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because they may contain more composite or host nodes.
  28867. // Skip portals because commitUnmount() currently visits them recursively.
  28868. if (node.child !== null && ( // If we use mutation we drill down into portals using commitUnmount above.
  28869. // If we don't use mutation we drill down into portals here instead.
  28870. node.tag !== HostPortal)) {
  28871. node.child.return = node;
  28872. node = node.child;
  28873. continue;
  28874. }
  28875. if (node === root) {
  28876. return;
  28877. }
  28878. while (node.sibling === null) {
  28879. if (node.return === null || node.return === root) {
  28880. return;
  28881. }
  28882. node = node.return;
  28883. }
  28884. node.sibling.return = node.return;
  28885. node = node.sibling;
  28886. }
  28887. }
  28888. function detachFiber(current) {
  28889. var alternate = current.alternate; // Cut off the return pointers to disconnect it from the tree. Ideally, we
  28890. // should clear the child pointer of the parent alternate to let this
  28891. // get GC:ed but we don't know which for sure which parent is the current
  28892. // one so we'll settle for GC:ing the subtree of this child. This child
  28893. // itself will be GC:ed when the parent updates the next time.
  28894. current.return = null;
  28895. current.child = null;
  28896. current.memoizedState = null;
  28897. current.updateQueue = null;
  28898. current.dependencies = null;
  28899. current.alternate = null;
  28900. current.firstEffect = null;
  28901. current.lastEffect = null;
  28902. current.pendingProps = null;
  28903. current.memoizedProps = null;
  28904. current.stateNode = null;
  28905. if (alternate !== null) {
  28906. detachFiber(alternate);
  28907. }
  28908. }
  28909. function getHostParentFiber(fiber) {
  28910. var parent = fiber.return;
  28911. while (parent !== null) {
  28912. if (isHostParent(parent)) {
  28913. return parent;
  28914. }
  28915. parent = parent.return;
  28916. }
  28917. {
  28918. {
  28919. throw Error( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." );
  28920. }
  28921. }
  28922. }
  28923. function isHostParent(fiber) {
  28924. return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
  28925. }
  28926. function getHostSibling(fiber) {
  28927. // We're going to search forward into the tree until we find a sibling host
  28928. // node. Unfortunately, if multiple insertions are done in a row we have to
  28929. // search past them. This leads to exponential search for the next sibling.
  28930. // TODO: Find a more efficient way to do this.
  28931. var node = fiber;
  28932. siblings: while (true) {
  28933. // If we didn't find anything, let's try the next sibling.
  28934. while (node.sibling === null) {
  28935. if (node.return === null || isHostParent(node.return)) {
  28936. // If we pop out of the root or hit the parent the fiber we are the
  28937. // last sibling.
  28938. return null;
  28939. }
  28940. node = node.return;
  28941. }
  28942. node.sibling.return = node.return;
  28943. node = node.sibling;
  28944. while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
  28945. // If it is not host node and, we might have a host node inside it.
  28946. // Try to search down until we find one.
  28947. if (node.effectTag & Placement) {
  28948. // If we don't have a child, try the siblings instead.
  28949. continue siblings;
  28950. } // If we don't have a child, try the siblings instead.
  28951. // We also skip portals because they are not part of this host tree.
  28952. if (node.child === null || node.tag === HostPortal) {
  28953. continue siblings;
  28954. } else {
  28955. node.child.return = node;
  28956. node = node.child;
  28957. }
  28958. } // Check if this host node is stable or about to be placed.
  28959. if (!(node.effectTag & Placement)) {
  28960. // Found it!
  28961. return node.stateNode;
  28962. }
  28963. }
  28964. }
  28965. function commitPlacement(finishedWork) {
  28966. var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together.
  28967. var parent;
  28968. var isContainer;
  28969. var parentStateNode = parentFiber.stateNode;
  28970. switch (parentFiber.tag) {
  28971. case HostComponent:
  28972. parent = parentStateNode;
  28973. isContainer = false;
  28974. break;
  28975. case HostRoot:
  28976. parent = parentStateNode.containerInfo;
  28977. isContainer = true;
  28978. break;
  28979. case HostPortal:
  28980. parent = parentStateNode.containerInfo;
  28981. isContainer = true;
  28982. break;
  28983. case FundamentalComponent:
  28984. // eslint-disable-next-line-no-fallthrough
  28985. default:
  28986. {
  28987. {
  28988. throw Error( "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." );
  28989. }
  28990. }
  28991. }
  28992. if (parentFiber.effectTag & ContentReset) {
  28993. // Reset the text content of the parent before doing any insertions
  28994. resetTextContent(parent); // Clear ContentReset from the effect tag
  28995. parentFiber.effectTag &= ~ContentReset;
  28996. }
  28997. var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its
  28998. // children to find all the terminal nodes.
  28999. if (isContainer) {
  29000. insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);
  29001. } else {
  29002. insertOrAppendPlacementNode(finishedWork, before, parent);
  29003. }
  29004. }
  29005. function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
  29006. var tag = node.tag;
  29007. var isHost = tag === HostComponent || tag === HostText;
  29008. if (isHost || enableFundamentalAPI ) {
  29009. var stateNode = isHost ? node.stateNode : node.stateNode.instance;
  29010. if (before) {
  29011. insertInContainerBefore(parent, stateNode, before);
  29012. } else {
  29013. appendChildToContainer(parent, stateNode);
  29014. }
  29015. } else if (tag === HostPortal) ; else {
  29016. var child = node.child;
  29017. if (child !== null) {
  29018. insertOrAppendPlacementNodeIntoContainer(child, before, parent);
  29019. var sibling = child.sibling;
  29020. while (sibling !== null) {
  29021. insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
  29022. sibling = sibling.sibling;
  29023. }
  29024. }
  29025. }
  29026. }
  29027. function insertOrAppendPlacementNode(node, before, parent) {
  29028. var tag = node.tag;
  29029. var isHost = tag === HostComponent || tag === HostText;
  29030. if (isHost || enableFundamentalAPI ) {
  29031. var stateNode = isHost ? node.stateNode : node.stateNode.instance;
  29032. if (before) {
  29033. insertBefore(parent, stateNode, before);
  29034. } else {
  29035. appendChild(parent, stateNode);
  29036. }
  29037. } else if (tag === HostPortal) ; else {
  29038. var child = node.child;
  29039. if (child !== null) {
  29040. insertOrAppendPlacementNode(child, before, parent);
  29041. var sibling = child.sibling;
  29042. while (sibling !== null) {
  29043. insertOrAppendPlacementNode(sibling, before, parent);
  29044. sibling = sibling.sibling;
  29045. }
  29046. }
  29047. }
  29048. }
  29049. function unmountHostComponents(finishedRoot, current, renderPriorityLevel) {
  29050. // We only have the top Fiber that was deleted but we need to recurse down its
  29051. // children to find all the terminal nodes.
  29052. var node = current; // Each iteration, currentParent is populated with node's host parent if not
  29053. // currentParentIsValid.
  29054. var currentParentIsValid = false; // Note: these two variables *must* always be updated together.
  29055. var currentParent;
  29056. var currentParentIsContainer;
  29057. while (true) {
  29058. if (!currentParentIsValid) {
  29059. var parent = node.return;
  29060. findParent: while (true) {
  29061. if (!(parent !== null)) {
  29062. {
  29063. throw Error( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." );
  29064. }
  29065. }
  29066. var parentStateNode = parent.stateNode;
  29067. switch (parent.tag) {
  29068. case HostComponent:
  29069. currentParent = parentStateNode;
  29070. currentParentIsContainer = false;
  29071. break findParent;
  29072. case HostRoot:
  29073. currentParent = parentStateNode.containerInfo;
  29074. currentParentIsContainer = true;
  29075. break findParent;
  29076. case HostPortal:
  29077. currentParent = parentStateNode.containerInfo;
  29078. currentParentIsContainer = true;
  29079. break findParent;
  29080. }
  29081. parent = parent.return;
  29082. }
  29083. currentParentIsValid = true;
  29084. }
  29085. if (node.tag === HostComponent || node.tag === HostText) {
  29086. commitNestedUnmounts(finishedRoot, node, renderPriorityLevel); // After all the children have unmounted, it is now safe to remove the
  29087. // node from the tree.
  29088. if (currentParentIsContainer) {
  29089. removeChildFromContainer(currentParent, node.stateNode);
  29090. } else {
  29091. removeChild(currentParent, node.stateNode);
  29092. } // Don't visit children because we already visited them.
  29093. } else if (node.tag === HostPortal) {
  29094. if (node.child !== null) {
  29095. // When we go into a portal, it becomes the parent to remove from.
  29096. // We will reassign it back when we pop the portal on the way up.
  29097. currentParent = node.stateNode.containerInfo;
  29098. currentParentIsContainer = true; // Visit children because portals might contain host components.
  29099. node.child.return = node;
  29100. node = node.child;
  29101. continue;
  29102. }
  29103. } else {
  29104. commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because we may find more host components below.
  29105. if (node.child !== null) {
  29106. node.child.return = node;
  29107. node = node.child;
  29108. continue;
  29109. }
  29110. }
  29111. if (node === current) {
  29112. return;
  29113. }
  29114. while (node.sibling === null) {
  29115. if (node.return === null || node.return === current) {
  29116. return;
  29117. }
  29118. node = node.return;
  29119. if (node.tag === HostPortal) {
  29120. // When we go out of the portal, we need to restore the parent.
  29121. // Since we don't keep a stack of them, we will search for it.
  29122. currentParentIsValid = false;
  29123. }
  29124. }
  29125. node.sibling.return = node.return;
  29126. node = node.sibling;
  29127. }
  29128. }
  29129. function commitDeletion(finishedRoot, current, renderPriorityLevel) {
  29130. {
  29131. // Recursively delete all host nodes from the parent.
  29132. // Detach refs and call componentWillUnmount() on the whole subtree.
  29133. unmountHostComponents(finishedRoot, current, renderPriorityLevel);
  29134. }
  29135. detachFiber(current);
  29136. }
  29137. function commitWork(current, finishedWork) {
  29138. switch (finishedWork.tag) {
  29139. case FunctionComponent:
  29140. case ForwardRef:
  29141. case MemoComponent:
  29142. case SimpleMemoComponent:
  29143. case Block:
  29144. {
  29145. // Layout effects are destroyed during the mutation phase so that all
  29146. // destroy functions for all fibers are called before any create functions.
  29147. // This prevents sibling component effects from interfering with each other,
  29148. // e.g. a destroy function in one component should never override a ref set
  29149. // by a create function in another component during the same commit.
  29150. commitHookEffectListUnmount(Layout | HasEffect, finishedWork);
  29151. return;
  29152. }
  29153. case ClassComponent:
  29154. {
  29155. return;
  29156. }
  29157. case HostComponent:
  29158. {
  29159. var instance = finishedWork.stateNode;
  29160. if (instance != null) {
  29161. // Commit the work prepared earlier.
  29162. var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps
  29163. // as the newProps. The updatePayload will contain the real change in
  29164. // this case.
  29165. var oldProps = current !== null ? current.memoizedProps : newProps;
  29166. var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components.
  29167. var updatePayload = finishedWork.updateQueue;
  29168. finishedWork.updateQueue = null;
  29169. if (updatePayload !== null) {
  29170. commitUpdate(instance, updatePayload, type, oldProps, newProps);
  29171. }
  29172. }
  29173. return;
  29174. }
  29175. case HostText:
  29176. {
  29177. if (!(finishedWork.stateNode !== null)) {
  29178. {
  29179. throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." );
  29180. }
  29181. }
  29182. var textInstance = finishedWork.stateNode;
  29183. var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps
  29184. // as the newProps. The updatePayload will contain the real change in
  29185. // this case.
  29186. var oldText = current !== null ? current.memoizedProps : newText;
  29187. commitTextUpdate(textInstance, oldText, newText);
  29188. return;
  29189. }
  29190. case HostRoot:
  29191. {
  29192. {
  29193. var _root = finishedWork.stateNode;
  29194. if (_root.hydrate) {
  29195. // We've just hydrated. No need to hydrate again.
  29196. _root.hydrate = false;
  29197. commitHydratedContainer(_root.containerInfo);
  29198. }
  29199. }
  29200. return;
  29201. }
  29202. case Profiler:
  29203. {
  29204. return;
  29205. }
  29206. case SuspenseComponent:
  29207. {
  29208. commitSuspenseComponent(finishedWork);
  29209. attachSuspenseRetryListeners(finishedWork);
  29210. return;
  29211. }
  29212. case SuspenseListComponent:
  29213. {
  29214. attachSuspenseRetryListeners(finishedWork);
  29215. return;
  29216. }
  29217. case IncompleteClassComponent:
  29218. {
  29219. return;
  29220. }
  29221. }
  29222. {
  29223. {
  29224. throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
  29225. }
  29226. }
  29227. }
  29228. function commitSuspenseComponent(finishedWork) {
  29229. var newState = finishedWork.memoizedState;
  29230. var newDidTimeout;
  29231. var primaryChildParent = finishedWork;
  29232. if (newState === null) {
  29233. newDidTimeout = false;
  29234. } else {
  29235. newDidTimeout = true;
  29236. primaryChildParent = finishedWork.child;
  29237. markCommitTimeOfFallback();
  29238. }
  29239. if ( primaryChildParent !== null) {
  29240. hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);
  29241. }
  29242. }
  29243. function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
  29244. var newState = finishedWork.memoizedState;
  29245. if (newState === null) {
  29246. var current = finishedWork.alternate;
  29247. if (current !== null) {
  29248. var prevState = current.memoizedState;
  29249. if (prevState !== null) {
  29250. var suspenseInstance = prevState.dehydrated;
  29251. if (suspenseInstance !== null) {
  29252. commitHydratedSuspenseInstance(suspenseInstance);
  29253. }
  29254. }
  29255. }
  29256. }
  29257. }
  29258. function attachSuspenseRetryListeners(finishedWork) {
  29259. // If this boundary just timed out, then it will have a set of thenables.
  29260. // For each thenable, attach a listener so that when it resolves, React
  29261. // attempts to re-render the boundary in the primary (pre-timeout) state.
  29262. var thenables = finishedWork.updateQueue;
  29263. if (thenables !== null) {
  29264. finishedWork.updateQueue = null;
  29265. var retryCache = finishedWork.stateNode;
  29266. if (retryCache === null) {
  29267. retryCache = finishedWork.stateNode = new PossiblyWeakSet();
  29268. }
  29269. thenables.forEach(function (thenable) {
  29270. // Memoize using the boundary fiber to prevent redundant listeners.
  29271. var retry = resolveRetryThenable.bind(null, finishedWork, thenable);
  29272. if (!retryCache.has(thenable)) {
  29273. {
  29274. if (thenable.__reactDoNotTraceInteractions !== true) {
  29275. retry = tracing.unstable_wrap(retry);
  29276. }
  29277. }
  29278. retryCache.add(thenable);
  29279. thenable.then(retry, retry);
  29280. }
  29281. });
  29282. }
  29283. }
  29284. function commitResetTextContent(current) {
  29285. resetTextContent(current.stateNode);
  29286. }
  29287. var PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;
  29288. function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
  29289. var update = createUpdate(expirationTime, null); // Unmount the root by rendering null.
  29290. update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property
  29291. // being called "element".
  29292. update.payload = {
  29293. element: null
  29294. };
  29295. var error = errorInfo.value;
  29296. update.callback = function () {
  29297. onUncaughtError(error);
  29298. logError(fiber, errorInfo);
  29299. };
  29300. return update;
  29301. }
  29302. function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
  29303. var update = createUpdate(expirationTime, null);
  29304. update.tag = CaptureUpdate;
  29305. var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
  29306. if (typeof getDerivedStateFromError === 'function') {
  29307. var error$1 = errorInfo.value;
  29308. update.payload = function () {
  29309. logError(fiber, errorInfo);
  29310. return getDerivedStateFromError(error$1);
  29311. };
  29312. }
  29313. var inst = fiber.stateNode;
  29314. if (inst !== null && typeof inst.componentDidCatch === 'function') {
  29315. update.callback = function callback() {
  29316. {
  29317. markFailedErrorBoundaryForHotReloading(fiber);
  29318. }
  29319. if (typeof getDerivedStateFromError !== 'function') {
  29320. // To preserve the preexisting retry behavior of error boundaries,
  29321. // we keep track of which ones already failed during this batch.
  29322. // This gets reset before we yield back to the browser.
  29323. // TODO: Warn in strict mode if getDerivedStateFromError is
  29324. // not defined.
  29325. markLegacyErrorBoundaryAsFailed(this); // Only log here if componentDidCatch is the only error boundary method defined
  29326. logError(fiber, errorInfo);
  29327. }
  29328. var error$1 = errorInfo.value;
  29329. var stack = errorInfo.stack;
  29330. this.componentDidCatch(error$1, {
  29331. componentStack: stack !== null ? stack : ''
  29332. });
  29333. {
  29334. if (typeof getDerivedStateFromError !== 'function') {
  29335. // If componentDidCatch is the only error boundary method defined,
  29336. // then it needs to call setState to recover from errors.
  29337. // If no state update is scheduled then the boundary will swallow the error.
  29338. if (fiber.expirationTime !== Sync) {
  29339. error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown');
  29340. }
  29341. }
  29342. }
  29343. };
  29344. } else {
  29345. update.callback = function () {
  29346. markFailedErrorBoundaryForHotReloading(fiber);
  29347. };
  29348. }
  29349. return update;
  29350. }
  29351. function attachPingListener(root, renderExpirationTime, thenable) {
  29352. // Attach a listener to the promise to "ping" the root and retry. But
  29353. // only if one does not already exist for the current render expiration
  29354. // time (which acts like a "thread ID" here).
  29355. var pingCache = root.pingCache;
  29356. var threadIDs;
  29357. if (pingCache === null) {
  29358. pingCache = root.pingCache = new PossiblyWeakMap$1();
  29359. threadIDs = new Set();
  29360. pingCache.set(thenable, threadIDs);
  29361. } else {
  29362. threadIDs = pingCache.get(thenable);
  29363. if (threadIDs === undefined) {
  29364. threadIDs = new Set();
  29365. pingCache.set(thenable, threadIDs);
  29366. }
  29367. }
  29368. if (!threadIDs.has(renderExpirationTime)) {
  29369. // Memoize using the thread ID to prevent redundant listeners.
  29370. threadIDs.add(renderExpirationTime);
  29371. var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);
  29372. thenable.then(ping, ping);
  29373. }
  29374. }
  29375. function throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) {
  29376. // The source fiber did not complete.
  29377. sourceFiber.effectTag |= Incomplete; // Its effect list is no longer valid.
  29378. sourceFiber.firstEffect = sourceFiber.lastEffect = null;
  29379. if (value !== null && typeof value === 'object' && typeof value.then === 'function') {
  29380. // This is a thenable.
  29381. var thenable = value;
  29382. if ((sourceFiber.mode & BlockingMode) === NoMode) {
  29383. // Reset the memoizedState to what it was before we attempted
  29384. // to render it.
  29385. var currentSource = sourceFiber.alternate;
  29386. if (currentSource) {
  29387. sourceFiber.updateQueue = currentSource.updateQueue;
  29388. sourceFiber.memoizedState = currentSource.memoizedState;
  29389. sourceFiber.expirationTime = currentSource.expirationTime;
  29390. } else {
  29391. sourceFiber.updateQueue = null;
  29392. sourceFiber.memoizedState = null;
  29393. }
  29394. }
  29395. var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext); // Schedule the nearest Suspense to re-render the timed out view.
  29396. var _workInProgress = returnFiber;
  29397. do {
  29398. if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {
  29399. // Found the nearest boundary.
  29400. // Stash the promise on the boundary fiber. If the boundary times out, we'll
  29401. // attach another listener to flip the boundary back to its normal state.
  29402. var thenables = _workInProgress.updateQueue;
  29403. if (thenables === null) {
  29404. var updateQueue = new Set();
  29405. updateQueue.add(thenable);
  29406. _workInProgress.updateQueue = updateQueue;
  29407. } else {
  29408. thenables.add(thenable);
  29409. } // If the boundary is outside of blocking mode, we should *not*
  29410. // suspend the commit. Pretend as if the suspended component rendered
  29411. // null and keep rendering. In the commit phase, we'll schedule a
  29412. // subsequent synchronous update to re-render the Suspense.
  29413. //
  29414. // Note: It doesn't matter whether the component that suspended was
  29415. // inside a blocking mode tree. If the Suspense is outside of it, we
  29416. // should *not* suspend the commit.
  29417. if ((_workInProgress.mode & BlockingMode) === NoMode) {
  29418. _workInProgress.effectTag |= DidCapture; // We're going to commit this fiber even though it didn't complete.
  29419. // But we shouldn't call any lifecycle methods or callbacks. Remove
  29420. // all lifecycle effect tags.
  29421. sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);
  29422. if (sourceFiber.tag === ClassComponent) {
  29423. var currentSourceFiber = sourceFiber.alternate;
  29424. if (currentSourceFiber === null) {
  29425. // This is a new mount. Change the tag so it's not mistaken for a
  29426. // completed class component. For example, we should not call
  29427. // componentWillUnmount if it is deleted.
  29428. sourceFiber.tag = IncompleteClassComponent;
  29429. } else {
  29430. // When we try rendering again, we should not reuse the current fiber,
  29431. // since it's known to be in an inconsistent state. Use a force update to
  29432. // prevent a bail out.
  29433. var update = createUpdate(Sync, null);
  29434. update.tag = ForceUpdate;
  29435. enqueueUpdate(sourceFiber, update);
  29436. }
  29437. } // The source fiber did not complete. Mark it with Sync priority to
  29438. // indicate that it still has pending work.
  29439. sourceFiber.expirationTime = Sync; // Exit without suspending.
  29440. return;
  29441. } // Confirmed that the boundary is in a concurrent mode tree. Continue
  29442. // with the normal suspend path.
  29443. //
  29444. // After this we'll use a set of heuristics to determine whether this
  29445. // render pass will run to completion or restart or "suspend" the commit.
  29446. // The actual logic for this is spread out in different places.
  29447. //
  29448. // This first principle is that if we're going to suspend when we complete
  29449. // a root, then we should also restart if we get an update or ping that
  29450. // might unsuspend it, and vice versa. The only reason to suspend is
  29451. // because you think you might want to restart before committing. However,
  29452. // it doesn't make sense to restart only while in the period we're suspended.
  29453. //
  29454. // Restarting too aggressively is also not good because it starves out any
  29455. // intermediate loading state. So we use heuristics to determine when.
  29456. // Suspense Heuristics
  29457. //
  29458. // If nothing threw a Promise or all the same fallbacks are already showing,
  29459. // then don't suspend/restart.
  29460. //
  29461. // If this is an initial render of a new tree of Suspense boundaries and
  29462. // those trigger a fallback, then don't suspend/restart. We want to ensure
  29463. // that we can show the initial loading state as quickly as possible.
  29464. //
  29465. // If we hit a "Delayed" case, such as when we'd switch from content back into
  29466. // a fallback, then we should always suspend/restart. SuspenseConfig applies to
  29467. // this case. If none is defined, JND is used instead.
  29468. //
  29469. // If we're already showing a fallback and it gets "retried", allowing us to show
  29470. // another level, but there's still an inner boundary that would show a fallback,
  29471. // then we suspend/restart for 500ms since the last time we showed a fallback
  29472. // anywhere in the tree. This effectively throttles progressive loading into a
  29473. // consistent train of commits. This also gives us an opportunity to restart to
  29474. // get to the completed state slightly earlier.
  29475. //
  29476. // If there's ambiguity due to batching it's resolved in preference of:
  29477. // 1) "delayed", 2) "initial render", 3) "retry".
  29478. //
  29479. // We want to ensure that a "busy" state doesn't get force committed. We want to
  29480. // ensure that new initial loading states can commit as soon as possible.
  29481. attachPingListener(root, renderExpirationTime, thenable);
  29482. _workInProgress.effectTag |= ShouldCapture;
  29483. _workInProgress.expirationTime = renderExpirationTime;
  29484. return;
  29485. } // This boundary already captured during this render. Continue to the next
  29486. // boundary.
  29487. _workInProgress = _workInProgress.return;
  29488. } while (_workInProgress !== null); // No boundary was found. Fallthrough to error mode.
  29489. // TODO: Use invariant so the message is stripped in prod?
  29490. value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\n' + '\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.' + getStackByFiberInDevAndProd(sourceFiber));
  29491. } // We didn't find a boundary that could handle this type of exception. Start
  29492. // over and traverse parent path again, this time treating the exception
  29493. // as an error.
  29494. renderDidError();
  29495. value = createCapturedValue(value, sourceFiber);
  29496. var workInProgress = returnFiber;
  29497. do {
  29498. switch (workInProgress.tag) {
  29499. case HostRoot:
  29500. {
  29501. var _errorInfo = value;
  29502. workInProgress.effectTag |= ShouldCapture;
  29503. workInProgress.expirationTime = renderExpirationTime;
  29504. var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);
  29505. enqueueCapturedUpdate(workInProgress, _update);
  29506. return;
  29507. }
  29508. case ClassComponent:
  29509. // Capture and retry
  29510. var errorInfo = value;
  29511. var ctor = workInProgress.type;
  29512. var instance = workInProgress.stateNode;
  29513. if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {
  29514. workInProgress.effectTag |= ShouldCapture;
  29515. workInProgress.expirationTime = renderExpirationTime; // Schedule the error boundary to re-render using updated state
  29516. var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);
  29517. enqueueCapturedUpdate(workInProgress, _update2);
  29518. return;
  29519. }
  29520. break;
  29521. }
  29522. workInProgress = workInProgress.return;
  29523. } while (workInProgress !== null);
  29524. }
  29525. var ceil = Math.ceil;
  29526. var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
  29527. ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,
  29528. IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;
  29529. var NoContext =
  29530. /* */
  29531. 0;
  29532. var BatchedContext =
  29533. /* */
  29534. 1;
  29535. var EventContext =
  29536. /* */
  29537. 2;
  29538. var DiscreteEventContext =
  29539. /* */
  29540. 4;
  29541. var LegacyUnbatchedContext =
  29542. /* */
  29543. 8;
  29544. var RenderContext =
  29545. /* */
  29546. 16;
  29547. var CommitContext =
  29548. /* */
  29549. 32;
  29550. var RootIncomplete = 0;
  29551. var RootFatalErrored = 1;
  29552. var RootErrored = 2;
  29553. var RootSuspended = 3;
  29554. var RootSuspendedWithDelay = 4;
  29555. var RootCompleted = 5;
  29556. // Describes where we are in the React execution stack
  29557. var executionContext = NoContext; // The root we're working on
  29558. var workInProgressRoot = null; // The fiber we're working on
  29559. var workInProgress = null; // The expiration time we're rendering
  29560. var renderExpirationTime$1 = NoWork; // Whether to root completed, errored, suspended, etc.
  29561. var workInProgressRootExitStatus = RootIncomplete; // A fatal error, if one is thrown
  29562. var workInProgressRootFatalError = null; // Most recent event time among processed updates during this render.
  29563. // This is conceptually a time stamp but expressed in terms of an ExpirationTime
  29564. // because we deal mostly with expiration times in the hot path, so this avoids
  29565. // the conversion happening in the hot path.
  29566. var workInProgressRootLatestProcessedExpirationTime = Sync;
  29567. var workInProgressRootLatestSuspenseTimeout = Sync;
  29568. var workInProgressRootCanSuspendUsingConfig = null; // The work left over by components that were visited during this render. Only
  29569. // includes unprocessed updates, not work in bailed out children.
  29570. var workInProgressRootNextUnprocessedUpdateTime = NoWork; // If we're pinged while rendering we don't always restart immediately.
  29571. // This flag determines if it might be worthwhile to restart if an opportunity
  29572. // happens latere.
  29573. var workInProgressRootHasPendingPing = false; // The most recent time we committed a fallback. This lets us ensure a train
  29574. // model where we don't commit new loading states in too quick succession.
  29575. var globalMostRecentFallbackTime = 0;
  29576. var FALLBACK_THROTTLE_MS = 500;
  29577. var nextEffect = null;
  29578. var hasUncaughtError = false;
  29579. var firstUncaughtError = null;
  29580. var legacyErrorBoundariesThatAlreadyFailed = null;
  29581. var rootDoesHavePassiveEffects = false;
  29582. var rootWithPendingPassiveEffects = null;
  29583. var pendingPassiveEffectsRenderPriority = NoPriority;
  29584. var pendingPassiveEffectsExpirationTime = NoWork;
  29585. var rootsWithPendingDiscreteUpdates = null; // Use these to prevent an infinite loop of nested updates
  29586. var NESTED_UPDATE_LIMIT = 50;
  29587. var nestedUpdateCount = 0;
  29588. var rootWithNestedUpdates = null;
  29589. var NESTED_PASSIVE_UPDATE_LIMIT = 50;
  29590. var nestedPassiveUpdateCount = 0;
  29591. var interruptedBy = null; // Marks the need to reschedule pending interactions at these expiration times
  29592. // during the commit phase. This enables them to be traced across components
  29593. // that spawn new work during render. E.g. hidden boundaries, suspended SSR
  29594. // hydration or SuspenseList.
  29595. var spawnedWorkDuringRender = null; // Expiration times are computed by adding to the current time (the start
  29596. // time). However, if two updates are scheduled within the same event, we
  29597. // should treat their start times as simultaneous, even if the actual clock
  29598. // time has advanced between the first and second call.
  29599. // In other words, because expiration times determine how updates are batched,
  29600. // we want all updates of like priority that occur within the same event to
  29601. // receive the same expiration time. Otherwise we get tearing.
  29602. var currentEventTime = NoWork;
  29603. function requestCurrentTimeForUpdate() {
  29604. if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
  29605. // We're inside React, so it's fine to read the actual time.
  29606. return msToExpirationTime(now());
  29607. } // We're not inside React, so we may be in the middle of a browser event.
  29608. if (currentEventTime !== NoWork) {
  29609. // Use the same start time for all updates until we enter React again.
  29610. return currentEventTime;
  29611. } // This is the first update since React yielded. Compute a new start time.
  29612. currentEventTime = msToExpirationTime(now());
  29613. return currentEventTime;
  29614. }
  29615. function getCurrentTime() {
  29616. return msToExpirationTime(now());
  29617. }
  29618. function computeExpirationForFiber(currentTime, fiber, suspenseConfig) {
  29619. var mode = fiber.mode;
  29620. if ((mode & BlockingMode) === NoMode) {
  29621. return Sync;
  29622. }
  29623. var priorityLevel = getCurrentPriorityLevel();
  29624. if ((mode & ConcurrentMode) === NoMode) {
  29625. return priorityLevel === ImmediatePriority ? Sync : Batched;
  29626. }
  29627. if ((executionContext & RenderContext) !== NoContext) {
  29628. // Use whatever time we're already rendering
  29629. // TODO: Should there be a way to opt out, like with `runWithPriority`?
  29630. return renderExpirationTime$1;
  29631. }
  29632. var expirationTime;
  29633. if (suspenseConfig !== null) {
  29634. // Compute an expiration time based on the Suspense timeout.
  29635. expirationTime = computeSuspenseExpiration(currentTime, suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
  29636. } else {
  29637. // Compute an expiration time based on the Scheduler priority.
  29638. switch (priorityLevel) {
  29639. case ImmediatePriority:
  29640. expirationTime = Sync;
  29641. break;
  29642. case UserBlockingPriority$1:
  29643. // TODO: Rename this to computeUserBlockingExpiration
  29644. expirationTime = computeInteractiveExpiration(currentTime);
  29645. break;
  29646. case NormalPriority:
  29647. case LowPriority:
  29648. // TODO: Handle LowPriority
  29649. // TODO: Rename this to... something better.
  29650. expirationTime = computeAsyncExpiration(currentTime);
  29651. break;
  29652. case IdlePriority:
  29653. expirationTime = Idle;
  29654. break;
  29655. default:
  29656. {
  29657. {
  29658. throw Error( "Expected a valid priority level" );
  29659. }
  29660. }
  29661. }
  29662. } // If we're in the middle of rendering a tree, do not update at the same
  29663. // expiration time that is already rendering.
  29664. // TODO: We shouldn't have to do this if the update is on a different root.
  29665. // Refactor computeExpirationForFiber + scheduleUpdate so we have access to
  29666. // the root when we check for this condition.
  29667. if (workInProgressRoot !== null && expirationTime === renderExpirationTime$1) {
  29668. // This is a trick to move this update into a separate batch
  29669. expirationTime -= 1;
  29670. }
  29671. return expirationTime;
  29672. }
  29673. function scheduleUpdateOnFiber(fiber, expirationTime) {
  29674. checkForNestedUpdates();
  29675. warnAboutRenderPhaseUpdatesInDEV(fiber);
  29676. var root = markUpdateTimeFromFiberToRoot(fiber, expirationTime);
  29677. if (root === null) {
  29678. warnAboutUpdateOnUnmountedFiberInDEV(fiber);
  29679. return;
  29680. }
  29681. checkForInterruption(fiber, expirationTime);
  29682. recordScheduleUpdate(); // TODO: computeExpirationForFiber also reads the priority. Pass the
  29683. // priority as an argument to that function and this one.
  29684. var priorityLevel = getCurrentPriorityLevel();
  29685. if (expirationTime === Sync) {
  29686. if ( // Check if we're inside unbatchedUpdates
  29687. (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering
  29688. (executionContext & (RenderContext | CommitContext)) === NoContext) {
  29689. // Register pending interactions on the root to avoid losing traced interaction data.
  29690. schedulePendingInteractions(root, expirationTime); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed
  29691. // root inside of batchedUpdates should be synchronous, but layout updates
  29692. // should be deferred until the end of the batch.
  29693. performSyncWorkOnRoot(root);
  29694. } else {
  29695. ensureRootIsScheduled(root);
  29696. schedulePendingInteractions(root, expirationTime);
  29697. if (executionContext === NoContext) {
  29698. // Flush the synchronous work now, unless we're already working or inside
  29699. // a batch. This is intentionally inside scheduleUpdateOnFiber instead of
  29700. // scheduleCallbackForFiber to preserve the ability to schedule a callback
  29701. // without immediately flushing it. We only do this for user-initiated
  29702. // updates, to preserve historical behavior of legacy mode.
  29703. flushSyncCallbackQueue();
  29704. }
  29705. }
  29706. } else {
  29707. ensureRootIsScheduled(root);
  29708. schedulePendingInteractions(root, expirationTime);
  29709. }
  29710. if ((executionContext & DiscreteEventContext) !== NoContext && ( // Only updates at user-blocking priority or greater are considered
  29711. // discrete, even inside a discrete event.
  29712. priorityLevel === UserBlockingPriority$1 || priorityLevel === ImmediatePriority)) {
  29713. // This is the result of a discrete event. Track the lowest priority
  29714. // discrete update per root so we can flush them early, if needed.
  29715. if (rootsWithPendingDiscreteUpdates === null) {
  29716. rootsWithPendingDiscreteUpdates = new Map([[root, expirationTime]]);
  29717. } else {
  29718. var lastDiscreteTime = rootsWithPendingDiscreteUpdates.get(root);
  29719. if (lastDiscreteTime === undefined || lastDiscreteTime > expirationTime) {
  29720. rootsWithPendingDiscreteUpdates.set(root, expirationTime);
  29721. }
  29722. }
  29723. }
  29724. }
  29725. var scheduleWork = scheduleUpdateOnFiber; // This is split into a separate function so we can mark a fiber with pending
  29726. // work without treating it as a typical update that originates from an event;
  29727. // e.g. retrying a Suspense boundary isn't an update, but it does schedule work
  29728. // on a fiber.
  29729. function markUpdateTimeFromFiberToRoot(fiber, expirationTime) {
  29730. // Update the source fiber's expiration time
  29731. if (fiber.expirationTime < expirationTime) {
  29732. fiber.expirationTime = expirationTime;
  29733. }
  29734. var alternate = fiber.alternate;
  29735. if (alternate !== null && alternate.expirationTime < expirationTime) {
  29736. alternate.expirationTime = expirationTime;
  29737. } // Walk the parent path to the root and update the child expiration time.
  29738. var node = fiber.return;
  29739. var root = null;
  29740. if (node === null && fiber.tag === HostRoot) {
  29741. root = fiber.stateNode;
  29742. } else {
  29743. while (node !== null) {
  29744. alternate = node.alternate;
  29745. if (node.childExpirationTime < expirationTime) {
  29746. node.childExpirationTime = expirationTime;
  29747. if (alternate !== null && alternate.childExpirationTime < expirationTime) {
  29748. alternate.childExpirationTime = expirationTime;
  29749. }
  29750. } else if (alternate !== null && alternate.childExpirationTime < expirationTime) {
  29751. alternate.childExpirationTime = expirationTime;
  29752. }
  29753. if (node.return === null && node.tag === HostRoot) {
  29754. root = node.stateNode;
  29755. break;
  29756. }
  29757. node = node.return;
  29758. }
  29759. }
  29760. if (root !== null) {
  29761. if (workInProgressRoot === root) {
  29762. // Received an update to a tree that's in the middle of rendering. Mark
  29763. // that's unprocessed work on this root.
  29764. markUnprocessedUpdateTime(expirationTime);
  29765. if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
  29766. // The root already suspended with a delay, which means this render
  29767. // definitely won't finish. Since we have a new update, let's mark it as
  29768. // suspended now, right before marking the incoming update. This has the
  29769. // effect of interrupting the current render and switching to the update.
  29770. // TODO: This happens to work when receiving an update during the render
  29771. // phase, because of the trick inside computeExpirationForFiber to
  29772. // subtract 1 from `renderExpirationTime` to move it into a
  29773. // separate bucket. But we should probably model it with an exception,
  29774. // using the same mechanism we use to force hydration of a subtree.
  29775. // TODO: This does not account for low pri updates that were already
  29776. // scheduled before the root started rendering. Need to track the next
  29777. // pending expiration time (perhaps by backtracking the return path) and
  29778. // then trigger a restart in the `renderDidSuspendDelayIfPossible` path.
  29779. markRootSuspendedAtTime(root, renderExpirationTime$1);
  29780. }
  29781. } // Mark that the root has a pending update.
  29782. markRootUpdatedAtTime(root, expirationTime);
  29783. }
  29784. return root;
  29785. }
  29786. function getNextRootExpirationTimeToWorkOn(root) {
  29787. // Determines the next expiration time that the root should render, taking
  29788. // into account levels that may be suspended, or levels that may have
  29789. // received a ping.
  29790. var lastExpiredTime = root.lastExpiredTime;
  29791. if (lastExpiredTime !== NoWork) {
  29792. return lastExpiredTime;
  29793. } // "Pending" refers to any update that hasn't committed yet, including if it
  29794. // suspended. The "suspended" range is therefore a subset.
  29795. var firstPendingTime = root.firstPendingTime;
  29796. if (!isRootSuspendedAtTime(root, firstPendingTime)) {
  29797. // The highest priority pending time is not suspended. Let's work on that.
  29798. return firstPendingTime;
  29799. } // If the first pending time is suspended, check if there's a lower priority
  29800. // pending level that we know about. Or check if we received a ping. Work
  29801. // on whichever is higher priority.
  29802. var lastPingedTime = root.lastPingedTime;
  29803. var nextKnownPendingLevel = root.nextKnownPendingLevel;
  29804. var nextLevel = lastPingedTime > nextKnownPendingLevel ? lastPingedTime : nextKnownPendingLevel;
  29805. if ( nextLevel <= Idle && firstPendingTime !== nextLevel) {
  29806. // Don't work on Idle/Never priority unless everything else is committed.
  29807. return NoWork;
  29808. }
  29809. return nextLevel;
  29810. } // Use this function to schedule a task for a root. There's only one task per
  29811. // root; if a task was already scheduled, we'll check to make sure the
  29812. // expiration time of the existing task is the same as the expiration time of
  29813. // the next level that the root has work on. This function is called on every
  29814. // update, and right before exiting a task.
  29815. function ensureRootIsScheduled(root) {
  29816. var lastExpiredTime = root.lastExpiredTime;
  29817. if (lastExpiredTime !== NoWork) {
  29818. // Special case: Expired work should flush synchronously.
  29819. root.callbackExpirationTime = Sync;
  29820. root.callbackPriority = ImmediatePriority;
  29821. root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));
  29822. return;
  29823. }
  29824. var expirationTime = getNextRootExpirationTimeToWorkOn(root);
  29825. var existingCallbackNode = root.callbackNode;
  29826. if (expirationTime === NoWork) {
  29827. // There's nothing to work on.
  29828. if (existingCallbackNode !== null) {
  29829. root.callbackNode = null;
  29830. root.callbackExpirationTime = NoWork;
  29831. root.callbackPriority = NoPriority;
  29832. }
  29833. return;
  29834. } // TODO: If this is an update, we already read the current time. Pass the
  29835. // time as an argument.
  29836. var currentTime = requestCurrentTimeForUpdate();
  29837. var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and
  29838. // expiration time. Otherwise, we'll cancel it and schedule a new one.
  29839. if (existingCallbackNode !== null) {
  29840. var existingCallbackPriority = root.callbackPriority;
  29841. var existingCallbackExpirationTime = root.callbackExpirationTime;
  29842. if ( // Callback must have the exact same expiration time.
  29843. existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.
  29844. existingCallbackPriority >= priorityLevel) {
  29845. // Existing callback is sufficient.
  29846. return;
  29847. } // Need to schedule a new task.
  29848. // TODO: Instead of scheduling a new task, we should be able to change the
  29849. // priority of the existing one.
  29850. cancelCallback(existingCallbackNode);
  29851. }
  29852. root.callbackExpirationTime = expirationTime;
  29853. root.callbackPriority = priorityLevel;
  29854. var callbackNode;
  29855. if (expirationTime === Sync) {
  29856. // Sync React callbacks are scheduled on a special internal queue
  29857. callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));
  29858. } else {
  29859. callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects
  29860. // ordering because tasks are processed in timeout order.
  29861. {
  29862. timeout: expirationTimeToMs(expirationTime) - now()
  29863. });
  29864. }
  29865. root.callbackNode = callbackNode;
  29866. } // This is the entry point for every concurrent task, i.e. anything that
  29867. // goes through Scheduler.
  29868. function performConcurrentWorkOnRoot(root, didTimeout) {
  29869. // Since we know we're in a React event, we can clear the current
  29870. // event time. The next update will compute a new event time.
  29871. currentEventTime = NoWork;
  29872. if (didTimeout) {
  29873. // The render task took too long to complete. Mark the current time as
  29874. // expired to synchronously render all expired work in a single batch.
  29875. var currentTime = requestCurrentTimeForUpdate();
  29876. markRootExpiredAtTime(root, currentTime); // This will schedule a synchronous callback.
  29877. ensureRootIsScheduled(root);
  29878. return null;
  29879. } // Determine the next expiration time to work on, using the fields stored
  29880. // on the root.
  29881. var expirationTime = getNextRootExpirationTimeToWorkOn(root);
  29882. if (expirationTime !== NoWork) {
  29883. var originalCallbackNode = root.callbackNode;
  29884. if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
  29885. {
  29886. throw Error( "Should not already be working." );
  29887. }
  29888. }
  29889. flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack
  29890. // and prepare a fresh one. Otherwise we'll continue where we left off.
  29891. if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {
  29892. prepareFreshStack(root, expirationTime);
  29893. startWorkOnPendingInteractions(root, expirationTime);
  29894. } // If we have a work-in-progress fiber, it means there's still work to do
  29895. // in this root.
  29896. if (workInProgress !== null) {
  29897. var prevExecutionContext = executionContext;
  29898. executionContext |= RenderContext;
  29899. var prevDispatcher = pushDispatcher();
  29900. var prevInteractions = pushInteractions(root);
  29901. startWorkLoopTimer(workInProgress);
  29902. do {
  29903. try {
  29904. workLoopConcurrent();
  29905. break;
  29906. } catch (thrownValue) {
  29907. handleError(root, thrownValue);
  29908. }
  29909. } while (true);
  29910. resetContextDependencies();
  29911. executionContext = prevExecutionContext;
  29912. popDispatcher(prevDispatcher);
  29913. {
  29914. popInteractions(prevInteractions);
  29915. }
  29916. if (workInProgressRootExitStatus === RootFatalErrored) {
  29917. var fatalError = workInProgressRootFatalError;
  29918. stopInterruptedWorkLoopTimer();
  29919. prepareFreshStack(root, expirationTime);
  29920. markRootSuspendedAtTime(root, expirationTime);
  29921. ensureRootIsScheduled(root);
  29922. throw fatalError;
  29923. }
  29924. if (workInProgress !== null) {
  29925. // There's still work left over. Exit without committing.
  29926. stopInterruptedWorkLoopTimer();
  29927. } else {
  29928. // We now have a consistent tree. The next step is either to commit it,
  29929. // or, if something suspended, wait to commit it after a timeout.
  29930. stopFinishedWorkLoopTimer();
  29931. var finishedWork = root.finishedWork = root.current.alternate;
  29932. root.finishedExpirationTime = expirationTime;
  29933. finishConcurrentRender(root, finishedWork, workInProgressRootExitStatus, expirationTime);
  29934. }
  29935. ensureRootIsScheduled(root);
  29936. if (root.callbackNode === originalCallbackNode) {
  29937. // The task node scheduled for this root is the same one that's
  29938. // currently executed. Need to return a continuation.
  29939. return performConcurrentWorkOnRoot.bind(null, root);
  29940. }
  29941. }
  29942. }
  29943. return null;
  29944. }
  29945. function finishConcurrentRender(root, finishedWork, exitStatus, expirationTime) {
  29946. // Set this to null to indicate there's no in-progress render.
  29947. workInProgressRoot = null;
  29948. switch (exitStatus) {
  29949. case RootIncomplete:
  29950. case RootFatalErrored:
  29951. {
  29952. {
  29953. {
  29954. throw Error( "Root did not complete. This is a bug in React." );
  29955. }
  29956. }
  29957. }
  29958. // Flow knows about invariant, so it complains if I add a break
  29959. // statement, but eslint doesn't know about invariant, so it complains
  29960. // if I do. eslint-disable-next-line no-fallthrough
  29961. case RootErrored:
  29962. {
  29963. // If this was an async render, the error may have happened due to
  29964. // a mutation in a concurrent event. Try rendering one more time,
  29965. // synchronously, to see if the error goes away. If there are
  29966. // lower priority updates, let's include those, too, in case they
  29967. // fix the inconsistency. Render at Idle to include all updates.
  29968. // If it was Idle or Never or some not-yet-invented time, render
  29969. // at that time.
  29970. markRootExpiredAtTime(root, expirationTime > Idle ? Idle : expirationTime); // We assume that this second render pass will be synchronous
  29971. // and therefore not hit this path again.
  29972. break;
  29973. }
  29974. case RootSuspended:
  29975. {
  29976. markRootSuspendedAtTime(root, expirationTime);
  29977. var lastSuspendedTime = root.lastSuspendedTime;
  29978. if (expirationTime === lastSuspendedTime) {
  29979. root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);
  29980. } // We have an acceptable loading state. We need to figure out if we
  29981. // should immediately commit it or wait a bit.
  29982. // If we have processed new updates during this render, we may now
  29983. // have a new loading state ready. We want to ensure that we commit
  29984. // that as soon as possible.
  29985. var hasNotProcessedNewUpdates = workInProgressRootLatestProcessedExpirationTime === Sync;
  29986. if (hasNotProcessedNewUpdates && // do not delay if we're inside an act() scope
  29987. !( IsThisRendererActing.current)) {
  29988. // If we have not processed any new updates during this pass, then
  29989. // this is either a retry of an existing fallback state or a
  29990. // hidden tree. Hidden trees shouldn't be batched with other work
  29991. // and after that's fixed it can only be a retry. We're going to
  29992. // throttle committing retries so that we don't show too many
  29993. // loading states too quickly.
  29994. var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time.
  29995. if (msUntilTimeout > 10) {
  29996. if (workInProgressRootHasPendingPing) {
  29997. var lastPingedTime = root.lastPingedTime;
  29998. if (lastPingedTime === NoWork || lastPingedTime >= expirationTime) {
  29999. // This render was pinged but we didn't get to restart
  30000. // earlier so try restarting now instead.
  30001. root.lastPingedTime = expirationTime;
  30002. prepareFreshStack(root, expirationTime);
  30003. break;
  30004. }
  30005. }
  30006. var nextTime = getNextRootExpirationTimeToWorkOn(root);
  30007. if (nextTime !== NoWork && nextTime !== expirationTime) {
  30008. // There's additional work on this root.
  30009. break;
  30010. }
  30011. if (lastSuspendedTime !== NoWork && lastSuspendedTime !== expirationTime) {
  30012. // We should prefer to render the fallback of at the last
  30013. // suspended level. Ping the last suspended level to try
  30014. // rendering it again.
  30015. root.lastPingedTime = lastSuspendedTime;
  30016. break;
  30017. } // The render is suspended, it hasn't timed out, and there's no
  30018. // lower priority work to do. Instead of committing the fallback
  30019. // immediately, wait for more data to arrive.
  30020. root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);
  30021. break;
  30022. }
  30023. } // The work expired. Commit immediately.
  30024. commitRoot(root);
  30025. break;
  30026. }
  30027. case RootSuspendedWithDelay:
  30028. {
  30029. markRootSuspendedAtTime(root, expirationTime);
  30030. var _lastSuspendedTime = root.lastSuspendedTime;
  30031. if (expirationTime === _lastSuspendedTime) {
  30032. root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);
  30033. }
  30034. if ( // do not delay if we're inside an act() scope
  30035. !( IsThisRendererActing.current)) {
  30036. // We're suspended in a state that should be avoided. We'll try to
  30037. // avoid committing it for as long as the timeouts let us.
  30038. if (workInProgressRootHasPendingPing) {
  30039. var _lastPingedTime = root.lastPingedTime;
  30040. if (_lastPingedTime === NoWork || _lastPingedTime >= expirationTime) {
  30041. // This render was pinged but we didn't get to restart earlier
  30042. // so try restarting now instead.
  30043. root.lastPingedTime = expirationTime;
  30044. prepareFreshStack(root, expirationTime);
  30045. break;
  30046. }
  30047. }
  30048. var _nextTime = getNextRootExpirationTimeToWorkOn(root);
  30049. if (_nextTime !== NoWork && _nextTime !== expirationTime) {
  30050. // There's additional work on this root.
  30051. break;
  30052. }
  30053. if (_lastSuspendedTime !== NoWork && _lastSuspendedTime !== expirationTime) {
  30054. // We should prefer to render the fallback of at the last
  30055. // suspended level. Ping the last suspended level to try
  30056. // rendering it again.
  30057. root.lastPingedTime = _lastSuspendedTime;
  30058. break;
  30059. }
  30060. var _msUntilTimeout;
  30061. if (workInProgressRootLatestSuspenseTimeout !== Sync) {
  30062. // We have processed a suspense config whose expiration time we
  30063. // can use as the timeout.
  30064. _msUntilTimeout = expirationTimeToMs(workInProgressRootLatestSuspenseTimeout) - now();
  30065. } else if (workInProgressRootLatestProcessedExpirationTime === Sync) {
  30066. // This should never normally happen because only new updates
  30067. // cause delayed states, so we should have processed something.
  30068. // However, this could also happen in an offscreen tree.
  30069. _msUntilTimeout = 0;
  30070. } else {
  30071. // If we don't have a suspense config, we're going to use a
  30072. // heuristic to determine how long we can suspend.
  30073. var eventTimeMs = inferTimeFromExpirationTime(workInProgressRootLatestProcessedExpirationTime);
  30074. var currentTimeMs = now();
  30075. var timeUntilExpirationMs = expirationTimeToMs(expirationTime) - currentTimeMs;
  30076. var timeElapsed = currentTimeMs - eventTimeMs;
  30077. if (timeElapsed < 0) {
  30078. // We get this wrong some time since we estimate the time.
  30079. timeElapsed = 0;
  30080. }
  30081. _msUntilTimeout = jnd(timeElapsed) - timeElapsed; // Clamp the timeout to the expiration time. TODO: Once the
  30082. // event time is exact instead of inferred from expiration time
  30083. // we don't need this.
  30084. if (timeUntilExpirationMs < _msUntilTimeout) {
  30085. _msUntilTimeout = timeUntilExpirationMs;
  30086. }
  30087. } // Don't bother with a very short suspense time.
  30088. if (_msUntilTimeout > 10) {
  30089. // The render is suspended, it hasn't timed out, and there's no
  30090. // lower priority work to do. Instead of committing the fallback
  30091. // immediately, wait for more data to arrive.
  30092. root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);
  30093. break;
  30094. }
  30095. } // The work expired. Commit immediately.
  30096. commitRoot(root);
  30097. break;
  30098. }
  30099. case RootCompleted:
  30100. {
  30101. // The work completed. Ready to commit.
  30102. if ( // do not delay if we're inside an act() scope
  30103. !( IsThisRendererActing.current) && workInProgressRootLatestProcessedExpirationTime !== Sync && workInProgressRootCanSuspendUsingConfig !== null) {
  30104. // If we have exceeded the minimum loading delay, which probably
  30105. // means we have shown a spinner already, we might have to suspend
  30106. // a bit longer to ensure that the spinner is shown for
  30107. // enough time.
  30108. var _msUntilTimeout2 = computeMsUntilSuspenseLoadingDelay(workInProgressRootLatestProcessedExpirationTime, expirationTime, workInProgressRootCanSuspendUsingConfig);
  30109. if (_msUntilTimeout2 > 10) {
  30110. markRootSuspendedAtTime(root, expirationTime);
  30111. root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout2);
  30112. break;
  30113. }
  30114. }
  30115. commitRoot(root);
  30116. break;
  30117. }
  30118. default:
  30119. {
  30120. {
  30121. {
  30122. throw Error( "Unknown root exit status." );
  30123. }
  30124. }
  30125. }
  30126. }
  30127. } // This is the entry point for synchronous tasks that don't go
  30128. // through Scheduler
  30129. function performSyncWorkOnRoot(root) {
  30130. // Check if there's expired work on this root. Otherwise, render at Sync.
  30131. var lastExpiredTime = root.lastExpiredTime;
  30132. var expirationTime = lastExpiredTime !== NoWork ? lastExpiredTime : Sync;
  30133. if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
  30134. {
  30135. throw Error( "Should not already be working." );
  30136. }
  30137. }
  30138. flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack
  30139. // and prepare a fresh one. Otherwise we'll continue where we left off.
  30140. if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {
  30141. prepareFreshStack(root, expirationTime);
  30142. startWorkOnPendingInteractions(root, expirationTime);
  30143. } // If we have a work-in-progress fiber, it means there's still work to do
  30144. // in this root.
  30145. if (workInProgress !== null) {
  30146. var prevExecutionContext = executionContext;
  30147. executionContext |= RenderContext;
  30148. var prevDispatcher = pushDispatcher();
  30149. var prevInteractions = pushInteractions(root);
  30150. startWorkLoopTimer(workInProgress);
  30151. do {
  30152. try {
  30153. workLoopSync();
  30154. break;
  30155. } catch (thrownValue) {
  30156. handleError(root, thrownValue);
  30157. }
  30158. } while (true);
  30159. resetContextDependencies();
  30160. executionContext = prevExecutionContext;
  30161. popDispatcher(prevDispatcher);
  30162. {
  30163. popInteractions(prevInteractions);
  30164. }
  30165. if (workInProgressRootExitStatus === RootFatalErrored) {
  30166. var fatalError = workInProgressRootFatalError;
  30167. stopInterruptedWorkLoopTimer();
  30168. prepareFreshStack(root, expirationTime);
  30169. markRootSuspendedAtTime(root, expirationTime);
  30170. ensureRootIsScheduled(root);
  30171. throw fatalError;
  30172. }
  30173. if (workInProgress !== null) {
  30174. // This is a sync render, so we should have finished the whole tree.
  30175. {
  30176. {
  30177. throw Error( "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." );
  30178. }
  30179. }
  30180. } else {
  30181. // We now have a consistent tree. Because this is a sync render, we
  30182. // will commit it even if something suspended.
  30183. stopFinishedWorkLoopTimer();
  30184. root.finishedWork = root.current.alternate;
  30185. root.finishedExpirationTime = expirationTime;
  30186. finishSyncRender(root);
  30187. } // Before exiting, make sure there's a callback scheduled for the next
  30188. // pending level.
  30189. ensureRootIsScheduled(root);
  30190. }
  30191. return null;
  30192. }
  30193. function finishSyncRender(root) {
  30194. // Set this to null to indicate there's no in-progress render.
  30195. workInProgressRoot = null;
  30196. commitRoot(root);
  30197. }
  30198. function flushDiscreteUpdates() {
  30199. // TODO: Should be able to flush inside batchedUpdates, but not inside `act`.
  30200. // However, `act` uses `batchedUpdates`, so there's no way to distinguish
  30201. // those two cases. Need to fix this before exposing flushDiscreteUpdates
  30202. // as a public API.
  30203. if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
  30204. {
  30205. if ((executionContext & RenderContext) !== NoContext) {
  30206. error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');
  30207. }
  30208. } // We're already rendering, so we can't synchronously flush pending work.
  30209. // This is probably a nested event dispatch triggered by a lifecycle/effect,
  30210. // like `el.focus()`. Exit.
  30211. return;
  30212. }
  30213. flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that
  30214. // they fire before the next serial event.
  30215. flushPassiveEffects();
  30216. }
  30217. function syncUpdates(fn, a, b, c) {
  30218. return runWithPriority$1(ImmediatePriority, fn.bind(null, a, b, c));
  30219. }
  30220. function flushPendingDiscreteUpdates() {
  30221. if (rootsWithPendingDiscreteUpdates !== null) {
  30222. // For each root with pending discrete updates, schedule a callback to
  30223. // immediately flush them.
  30224. var roots = rootsWithPendingDiscreteUpdates;
  30225. rootsWithPendingDiscreteUpdates = null;
  30226. roots.forEach(function (expirationTime, root) {
  30227. markRootExpiredAtTime(root, expirationTime);
  30228. ensureRootIsScheduled(root);
  30229. }); // Now flush the immediate queue.
  30230. flushSyncCallbackQueue();
  30231. }
  30232. }
  30233. function batchedUpdates$1(fn, a) {
  30234. var prevExecutionContext = executionContext;
  30235. executionContext |= BatchedContext;
  30236. try {
  30237. return fn(a);
  30238. } finally {
  30239. executionContext = prevExecutionContext;
  30240. if (executionContext === NoContext) {
  30241. // Flush the immediate callbacks that were scheduled during this batch
  30242. flushSyncCallbackQueue();
  30243. }
  30244. }
  30245. }
  30246. function batchedEventUpdates$1(fn, a) {
  30247. var prevExecutionContext = executionContext;
  30248. executionContext |= EventContext;
  30249. try {
  30250. return fn(a);
  30251. } finally {
  30252. executionContext = prevExecutionContext;
  30253. if (executionContext === NoContext) {
  30254. // Flush the immediate callbacks that were scheduled during this batch
  30255. flushSyncCallbackQueue();
  30256. }
  30257. }
  30258. }
  30259. function discreteUpdates$1(fn, a, b, c, d) {
  30260. var prevExecutionContext = executionContext;
  30261. executionContext |= DiscreteEventContext;
  30262. try {
  30263. // Should this
  30264. return runWithPriority$1(UserBlockingPriority$1, fn.bind(null, a, b, c, d));
  30265. } finally {
  30266. executionContext = prevExecutionContext;
  30267. if (executionContext === NoContext) {
  30268. // Flush the immediate callbacks that were scheduled during this batch
  30269. flushSyncCallbackQueue();
  30270. }
  30271. }
  30272. }
  30273. function unbatchedUpdates(fn, a) {
  30274. var prevExecutionContext = executionContext;
  30275. executionContext &= ~BatchedContext;
  30276. executionContext |= LegacyUnbatchedContext;
  30277. try {
  30278. return fn(a);
  30279. } finally {
  30280. executionContext = prevExecutionContext;
  30281. if (executionContext === NoContext) {
  30282. // Flush the immediate callbacks that were scheduled during this batch
  30283. flushSyncCallbackQueue();
  30284. }
  30285. }
  30286. }
  30287. function flushSync(fn, a) {
  30288. if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
  30289. {
  30290. {
  30291. throw Error( "flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering." );
  30292. }
  30293. }
  30294. }
  30295. var prevExecutionContext = executionContext;
  30296. executionContext |= BatchedContext;
  30297. try {
  30298. return runWithPriority$1(ImmediatePriority, fn.bind(null, a));
  30299. } finally {
  30300. executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch.
  30301. // Note that this will happen even if batchedUpdates is higher up
  30302. // the stack.
  30303. flushSyncCallbackQueue();
  30304. }
  30305. }
  30306. function prepareFreshStack(root, expirationTime) {
  30307. root.finishedWork = null;
  30308. root.finishedExpirationTime = NoWork;
  30309. var timeoutHandle = root.timeoutHandle;
  30310. if (timeoutHandle !== noTimeout) {
  30311. // The root previous suspended and scheduled a timeout to commit a fallback
  30312. // state. Now that we have additional work, cancel the timeout.
  30313. root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above
  30314. cancelTimeout(timeoutHandle);
  30315. }
  30316. if (workInProgress !== null) {
  30317. var interruptedWork = workInProgress.return;
  30318. while (interruptedWork !== null) {
  30319. unwindInterruptedWork(interruptedWork);
  30320. interruptedWork = interruptedWork.return;
  30321. }
  30322. }
  30323. workInProgressRoot = root;
  30324. workInProgress = createWorkInProgress(root.current, null);
  30325. renderExpirationTime$1 = expirationTime;
  30326. workInProgressRootExitStatus = RootIncomplete;
  30327. workInProgressRootFatalError = null;
  30328. workInProgressRootLatestProcessedExpirationTime = Sync;
  30329. workInProgressRootLatestSuspenseTimeout = Sync;
  30330. workInProgressRootCanSuspendUsingConfig = null;
  30331. workInProgressRootNextUnprocessedUpdateTime = NoWork;
  30332. workInProgressRootHasPendingPing = false;
  30333. {
  30334. spawnedWorkDuringRender = null;
  30335. }
  30336. {
  30337. ReactStrictModeWarnings.discardPendingWarnings();
  30338. }
  30339. }
  30340. function handleError(root, thrownValue) {
  30341. do {
  30342. try {
  30343. // Reset module-level state that was set during the render phase.
  30344. resetContextDependencies();
  30345. resetHooksAfterThrow();
  30346. resetCurrentFiber();
  30347. if (workInProgress === null || workInProgress.return === null) {
  30348. // Expected to be working on a non-root fiber. This is a fatal error
  30349. // because there's no ancestor that can handle it; the root is
  30350. // supposed to capture all errors that weren't caught by an error
  30351. // boundary.
  30352. workInProgressRootExitStatus = RootFatalErrored;
  30353. workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next
  30354. // sibling, or the parent if there are no siblings. But since the root
  30355. // has no siblings nor a parent, we set it to null. Usually this is
  30356. // handled by `completeUnitOfWork` or `unwindWork`, but since we're
  30357. // interntionally not calling those, we need set it here.
  30358. // TODO: Consider calling `unwindWork` to pop the contexts.
  30359. workInProgress = null;
  30360. return null;
  30361. }
  30362. if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
  30363. // Record the time spent rendering before an error was thrown. This
  30364. // avoids inaccurate Profiler durations in the case of a
  30365. // suspended render.
  30366. stopProfilerTimerIfRunningAndRecordDelta(workInProgress, true);
  30367. }
  30368. throwException(root, workInProgress.return, workInProgress, thrownValue, renderExpirationTime$1);
  30369. workInProgress = completeUnitOfWork(workInProgress);
  30370. } catch (yetAnotherThrownValue) {
  30371. // Something in the return path also threw.
  30372. thrownValue = yetAnotherThrownValue;
  30373. continue;
  30374. } // Return to the normal work loop.
  30375. return;
  30376. } while (true);
  30377. }
  30378. function pushDispatcher(root) {
  30379. var prevDispatcher = ReactCurrentDispatcher$1.current;
  30380. ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
  30381. if (prevDispatcher === null) {
  30382. // The React isomorphic package does not include a default dispatcher.
  30383. // Instead the first renderer will lazily attach one, in order to give
  30384. // nicer error messages.
  30385. return ContextOnlyDispatcher;
  30386. } else {
  30387. return prevDispatcher;
  30388. }
  30389. }
  30390. function popDispatcher(prevDispatcher) {
  30391. ReactCurrentDispatcher$1.current = prevDispatcher;
  30392. }
  30393. function pushInteractions(root) {
  30394. {
  30395. var prevInteractions = tracing.__interactionsRef.current;
  30396. tracing.__interactionsRef.current = root.memoizedInteractions;
  30397. return prevInteractions;
  30398. }
  30399. }
  30400. function popInteractions(prevInteractions) {
  30401. {
  30402. tracing.__interactionsRef.current = prevInteractions;
  30403. }
  30404. }
  30405. function markCommitTimeOfFallback() {
  30406. globalMostRecentFallbackTime = now();
  30407. }
  30408. function markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {
  30409. if (expirationTime < workInProgressRootLatestProcessedExpirationTime && expirationTime > Idle) {
  30410. workInProgressRootLatestProcessedExpirationTime = expirationTime;
  30411. }
  30412. if (suspenseConfig !== null) {
  30413. if (expirationTime < workInProgressRootLatestSuspenseTimeout && expirationTime > Idle) {
  30414. workInProgressRootLatestSuspenseTimeout = expirationTime; // Most of the time we only have one config and getting wrong is not bad.
  30415. workInProgressRootCanSuspendUsingConfig = suspenseConfig;
  30416. }
  30417. }
  30418. }
  30419. function markUnprocessedUpdateTime(expirationTime) {
  30420. if (expirationTime > workInProgressRootNextUnprocessedUpdateTime) {
  30421. workInProgressRootNextUnprocessedUpdateTime = expirationTime;
  30422. }
  30423. }
  30424. function renderDidSuspend() {
  30425. if (workInProgressRootExitStatus === RootIncomplete) {
  30426. workInProgressRootExitStatus = RootSuspended;
  30427. }
  30428. }
  30429. function renderDidSuspendDelayIfPossible() {
  30430. if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {
  30431. workInProgressRootExitStatus = RootSuspendedWithDelay;
  30432. } // Check if there's a lower priority update somewhere else in the tree.
  30433. if (workInProgressRootNextUnprocessedUpdateTime !== NoWork && workInProgressRoot !== null) {
  30434. // Mark the current render as suspended, and then mark that there's a
  30435. // pending update.
  30436. // TODO: This should immediately interrupt the current render, instead
  30437. // of waiting until the next time we yield.
  30438. markRootSuspendedAtTime(workInProgressRoot, renderExpirationTime$1);
  30439. markRootUpdatedAtTime(workInProgressRoot, workInProgressRootNextUnprocessedUpdateTime);
  30440. }
  30441. }
  30442. function renderDidError() {
  30443. if (workInProgressRootExitStatus !== RootCompleted) {
  30444. workInProgressRootExitStatus = RootErrored;
  30445. }
  30446. } // Called during render to determine if anything has suspended.
  30447. // Returns false if we're not sure.
  30448. function renderHasNotSuspendedYet() {
  30449. // If something errored or completed, we can't really be sure,
  30450. // so those are false.
  30451. return workInProgressRootExitStatus === RootIncomplete;
  30452. }
  30453. function inferTimeFromExpirationTime(expirationTime) {
  30454. // We don't know exactly when the update was scheduled, but we can infer an
  30455. // approximate start time from the expiration time.
  30456. var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
  30457. return earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION;
  30458. }
  30459. function inferTimeFromExpirationTimeWithSuspenseConfig(expirationTime, suspenseConfig) {
  30460. // We don't know exactly when the update was scheduled, but we can infer an
  30461. // approximate start time from the expiration time by subtracting the timeout
  30462. // that was added to the event time.
  30463. var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
  30464. return earliestExpirationTimeMs - (suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
  30465. } // The work loop is an extremely hot path. Tell Closure not to inline it.
  30466. /** @noinline */
  30467. function workLoopSync() {
  30468. // Already timed out, so perform work without checking if we need to yield.
  30469. while (workInProgress !== null) {
  30470. workInProgress = performUnitOfWork(workInProgress);
  30471. }
  30472. }
  30473. /** @noinline */
  30474. function workLoopConcurrent() {
  30475. // Perform work until Scheduler asks us to yield
  30476. while (workInProgress !== null && !shouldYield()) {
  30477. workInProgress = performUnitOfWork(workInProgress);
  30478. }
  30479. }
  30480. function performUnitOfWork(unitOfWork) {
  30481. // The current, flushed, state of this fiber is the alternate. Ideally
  30482. // nothing should rely on this, but relying on it here means that we don't
  30483. // need an additional field on the work in progress.
  30484. var current = unitOfWork.alternate;
  30485. startWorkTimer(unitOfWork);
  30486. setCurrentFiber(unitOfWork);
  30487. var next;
  30488. if ( (unitOfWork.mode & ProfileMode) !== NoMode) {
  30489. startProfilerTimer(unitOfWork);
  30490. next = beginWork$1(current, unitOfWork, renderExpirationTime$1);
  30491. stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
  30492. } else {
  30493. next = beginWork$1(current, unitOfWork, renderExpirationTime$1);
  30494. }
  30495. resetCurrentFiber();
  30496. unitOfWork.memoizedProps = unitOfWork.pendingProps;
  30497. if (next === null) {
  30498. // If this doesn't spawn new work, complete the current work.
  30499. next = completeUnitOfWork(unitOfWork);
  30500. }
  30501. ReactCurrentOwner$2.current = null;
  30502. return next;
  30503. }
  30504. function completeUnitOfWork(unitOfWork) {
  30505. // Attempt to complete the current unit of work, then move to the next
  30506. // sibling. If there are no more siblings, return to the parent fiber.
  30507. workInProgress = unitOfWork;
  30508. do {
  30509. // The current, flushed, state of this fiber is the alternate. Ideally
  30510. // nothing should rely on this, but relying on it here means that we don't
  30511. // need an additional field on the work in progress.
  30512. var current = workInProgress.alternate;
  30513. var returnFiber = workInProgress.return; // Check if the work completed or if something threw.
  30514. if ((workInProgress.effectTag & Incomplete) === NoEffect) {
  30515. setCurrentFiber(workInProgress);
  30516. var next = void 0;
  30517. if ( (workInProgress.mode & ProfileMode) === NoMode) {
  30518. next = completeWork(current, workInProgress, renderExpirationTime$1);
  30519. } else {
  30520. startProfilerTimer(workInProgress);
  30521. next = completeWork(current, workInProgress, renderExpirationTime$1); // Update render duration assuming we didn't error.
  30522. stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);
  30523. }
  30524. stopWorkTimer(workInProgress);
  30525. resetCurrentFiber();
  30526. resetChildExpirationTime(workInProgress);
  30527. if (next !== null) {
  30528. // Completing this fiber spawned new work. Work on that next.
  30529. return next;
  30530. }
  30531. if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete
  30532. (returnFiber.effectTag & Incomplete) === NoEffect) {
  30533. // Append all the effects of the subtree and this fiber onto the effect
  30534. // list of the parent. The completion order of the children affects the
  30535. // side-effect order.
  30536. if (returnFiber.firstEffect === null) {
  30537. returnFiber.firstEffect = workInProgress.firstEffect;
  30538. }
  30539. if (workInProgress.lastEffect !== null) {
  30540. if (returnFiber.lastEffect !== null) {
  30541. returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;
  30542. }
  30543. returnFiber.lastEffect = workInProgress.lastEffect;
  30544. } // If this fiber had side-effects, we append it AFTER the children's
  30545. // side-effects. We can perform certain side-effects earlier if needed,
  30546. // by doing multiple passes over the effect list. We don't want to
  30547. // schedule our own side-effect on our own list because if end up
  30548. // reusing children we'll schedule this effect onto itself since we're
  30549. // at the end.
  30550. var effectTag = workInProgress.effectTag; // Skip both NoWork and PerformedWork tags when creating the effect
  30551. // list. PerformedWork effect is read by React DevTools but shouldn't be
  30552. // committed.
  30553. if (effectTag > PerformedWork) {
  30554. if (returnFiber.lastEffect !== null) {
  30555. returnFiber.lastEffect.nextEffect = workInProgress;
  30556. } else {
  30557. returnFiber.firstEffect = workInProgress;
  30558. }
  30559. returnFiber.lastEffect = workInProgress;
  30560. }
  30561. }
  30562. } else {
  30563. // This fiber did not complete because something threw. Pop values off
  30564. // the stack without entering the complete phase. If this is a boundary,
  30565. // capture values if possible.
  30566. var _next = unwindWork(workInProgress); // Because this fiber did not complete, don't reset its expiration time.
  30567. if ( (workInProgress.mode & ProfileMode) !== NoMode) {
  30568. // Record the render duration for the fiber that errored.
  30569. stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false); // Include the time spent working on failed children before continuing.
  30570. var actualDuration = workInProgress.actualDuration;
  30571. var child = workInProgress.child;
  30572. while (child !== null) {
  30573. actualDuration += child.actualDuration;
  30574. child = child.sibling;
  30575. }
  30576. workInProgress.actualDuration = actualDuration;
  30577. }
  30578. if (_next !== null) {
  30579. // If completing this work spawned new work, do that next. We'll come
  30580. // back here again.
  30581. // Since we're restarting, remove anything that is not a host effect
  30582. // from the effect tag.
  30583. // TODO: The name stopFailedWorkTimer is misleading because Suspense
  30584. // also captures and restarts.
  30585. stopFailedWorkTimer(workInProgress);
  30586. _next.effectTag &= HostEffectMask;
  30587. return _next;
  30588. }
  30589. stopWorkTimer(workInProgress);
  30590. if (returnFiber !== null) {
  30591. // Mark the parent fiber as incomplete and clear its effect list.
  30592. returnFiber.firstEffect = returnFiber.lastEffect = null;
  30593. returnFiber.effectTag |= Incomplete;
  30594. }
  30595. }
  30596. var siblingFiber = workInProgress.sibling;
  30597. if (siblingFiber !== null) {
  30598. // If there is more work to do in this returnFiber, do that next.
  30599. return siblingFiber;
  30600. } // Otherwise, return to the parent
  30601. workInProgress = returnFiber;
  30602. } while (workInProgress !== null); // We've reached the root.
  30603. if (workInProgressRootExitStatus === RootIncomplete) {
  30604. workInProgressRootExitStatus = RootCompleted;
  30605. }
  30606. return null;
  30607. }
  30608. function getRemainingExpirationTime(fiber) {
  30609. var updateExpirationTime = fiber.expirationTime;
  30610. var childExpirationTime = fiber.childExpirationTime;
  30611. return updateExpirationTime > childExpirationTime ? updateExpirationTime : childExpirationTime;
  30612. }
  30613. function resetChildExpirationTime(completedWork) {
  30614. if (renderExpirationTime$1 !== Never && completedWork.childExpirationTime === Never) {
  30615. // The children of this component are hidden. Don't bubble their
  30616. // expiration times.
  30617. return;
  30618. }
  30619. var newChildExpirationTime = NoWork; // Bubble up the earliest expiration time.
  30620. if ( (completedWork.mode & ProfileMode) !== NoMode) {
  30621. // In profiling mode, resetChildExpirationTime is also used to reset
  30622. // profiler durations.
  30623. var actualDuration = completedWork.actualDuration;
  30624. var treeBaseDuration = completedWork.selfBaseDuration; // When a fiber is cloned, its actualDuration is reset to 0. This value will
  30625. // only be updated if work is done on the fiber (i.e. it doesn't bailout).
  30626. // When work is done, it should bubble to the parent's actualDuration. If
  30627. // the fiber has not been cloned though, (meaning no work was done), then
  30628. // this value will reflect the amount of time spent working on a previous
  30629. // render. In that case it should not bubble. We determine whether it was
  30630. // cloned by comparing the child pointer.
  30631. var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;
  30632. var child = completedWork.child;
  30633. while (child !== null) {
  30634. var childUpdateExpirationTime = child.expirationTime;
  30635. var childChildExpirationTime = child.childExpirationTime;
  30636. if (childUpdateExpirationTime > newChildExpirationTime) {
  30637. newChildExpirationTime = childUpdateExpirationTime;
  30638. }
  30639. if (childChildExpirationTime > newChildExpirationTime) {
  30640. newChildExpirationTime = childChildExpirationTime;
  30641. }
  30642. if (shouldBubbleActualDurations) {
  30643. actualDuration += child.actualDuration;
  30644. }
  30645. treeBaseDuration += child.treeBaseDuration;
  30646. child = child.sibling;
  30647. }
  30648. completedWork.actualDuration = actualDuration;
  30649. completedWork.treeBaseDuration = treeBaseDuration;
  30650. } else {
  30651. var _child = completedWork.child;
  30652. while (_child !== null) {
  30653. var _childUpdateExpirationTime = _child.expirationTime;
  30654. var _childChildExpirationTime = _child.childExpirationTime;
  30655. if (_childUpdateExpirationTime > newChildExpirationTime) {
  30656. newChildExpirationTime = _childUpdateExpirationTime;
  30657. }
  30658. if (_childChildExpirationTime > newChildExpirationTime) {
  30659. newChildExpirationTime = _childChildExpirationTime;
  30660. }
  30661. _child = _child.sibling;
  30662. }
  30663. }
  30664. completedWork.childExpirationTime = newChildExpirationTime;
  30665. }
  30666. function commitRoot(root) {
  30667. var renderPriorityLevel = getCurrentPriorityLevel();
  30668. runWithPriority$1(ImmediatePriority, commitRootImpl.bind(null, root, renderPriorityLevel));
  30669. return null;
  30670. }
  30671. function commitRootImpl(root, renderPriorityLevel) {
  30672. do {
  30673. // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which
  30674. // means `flushPassiveEffects` will sometimes result in additional
  30675. // passive effects. So we need to keep flushing in a loop until there are
  30676. // no more pending effects.
  30677. // TODO: Might be better if `flushPassiveEffects` did not automatically
  30678. // flush synchronous work at the end, to avoid factoring hazards like this.
  30679. flushPassiveEffects();
  30680. } while (rootWithPendingPassiveEffects !== null);
  30681. flushRenderPhaseStrictModeWarningsInDEV();
  30682. if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
  30683. {
  30684. throw Error( "Should not already be working." );
  30685. }
  30686. }
  30687. var finishedWork = root.finishedWork;
  30688. var expirationTime = root.finishedExpirationTime;
  30689. if (finishedWork === null) {
  30690. return null;
  30691. }
  30692. root.finishedWork = null;
  30693. root.finishedExpirationTime = NoWork;
  30694. if (!(finishedWork !== root.current)) {
  30695. {
  30696. throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." );
  30697. }
  30698. } // commitRoot never returns a continuation; it always finishes synchronously.
  30699. // So we can clear these now to allow a new callback to be scheduled.
  30700. root.callbackNode = null;
  30701. root.callbackExpirationTime = NoWork;
  30702. root.callbackPriority = NoPriority;
  30703. root.nextKnownPendingLevel = NoWork;
  30704. startCommitTimer(); // Update the first and last pending times on this root. The new first
  30705. // pending time is whatever is left on the root fiber.
  30706. var remainingExpirationTimeBeforeCommit = getRemainingExpirationTime(finishedWork);
  30707. markRootFinishedAtTime(root, expirationTime, remainingExpirationTimeBeforeCommit);
  30708. if (root === workInProgressRoot) {
  30709. // We can reset these now that they are finished.
  30710. workInProgressRoot = null;
  30711. workInProgress = null;
  30712. renderExpirationTime$1 = NoWork;
  30713. } // This indicates that the last root we worked on is not the same one that
  30714. // we're committing now. This most commonly happens when a suspended root
  30715. // times out.
  30716. // Get the list of effects.
  30717. var firstEffect;
  30718. if (finishedWork.effectTag > PerformedWork) {
  30719. // A fiber's effect list consists only of its children, not itself. So if
  30720. // the root has an effect, we need to add it to the end of the list. The
  30721. // resulting list is the set that would belong to the root's parent, if it
  30722. // had one; that is, all the effects in the tree including the root.
  30723. if (finishedWork.lastEffect !== null) {
  30724. finishedWork.lastEffect.nextEffect = finishedWork;
  30725. firstEffect = finishedWork.firstEffect;
  30726. } else {
  30727. firstEffect = finishedWork;
  30728. }
  30729. } else {
  30730. // There is no effect on the root.
  30731. firstEffect = finishedWork.firstEffect;
  30732. }
  30733. if (firstEffect !== null) {
  30734. var prevExecutionContext = executionContext;
  30735. executionContext |= CommitContext;
  30736. var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles
  30737. ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass
  30738. // of the effect list for each phase: all mutation effects come before all
  30739. // layout effects, and so on.
  30740. // The first phase a "before mutation" phase. We use this phase to read the
  30741. // state of the host tree right before we mutate it. This is where
  30742. // getSnapshotBeforeUpdate is called.
  30743. startCommitSnapshotEffectsTimer();
  30744. prepareForCommit(root.containerInfo);
  30745. nextEffect = firstEffect;
  30746. do {
  30747. {
  30748. invokeGuardedCallback(null, commitBeforeMutationEffects, null);
  30749. if (hasCaughtError()) {
  30750. if (!(nextEffect !== null)) {
  30751. {
  30752. throw Error( "Should be working on an effect." );
  30753. }
  30754. }
  30755. var error = clearCaughtError();
  30756. captureCommitPhaseError(nextEffect, error);
  30757. nextEffect = nextEffect.nextEffect;
  30758. }
  30759. }
  30760. } while (nextEffect !== null);
  30761. stopCommitSnapshotEffectsTimer();
  30762. {
  30763. // Mark the current commit time to be shared by all Profilers in this
  30764. // batch. This enables them to be grouped later.
  30765. recordCommitTime();
  30766. } // The next phase is the mutation phase, where we mutate the host tree.
  30767. startCommitHostEffectsTimer();
  30768. nextEffect = firstEffect;
  30769. do {
  30770. {
  30771. invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel);
  30772. if (hasCaughtError()) {
  30773. if (!(nextEffect !== null)) {
  30774. {
  30775. throw Error( "Should be working on an effect." );
  30776. }
  30777. }
  30778. var _error = clearCaughtError();
  30779. captureCommitPhaseError(nextEffect, _error);
  30780. nextEffect = nextEffect.nextEffect;
  30781. }
  30782. }
  30783. } while (nextEffect !== null);
  30784. stopCommitHostEffectsTimer();
  30785. resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after
  30786. // the mutation phase, so that the previous tree is still current during
  30787. // componentWillUnmount, but before the layout phase, so that the finished
  30788. // work is current during componentDidMount/Update.
  30789. root.current = finishedWork; // The next phase is the layout phase, where we call effects that read
  30790. // the host tree after it's been mutated. The idiomatic use case for this is
  30791. // layout, but class component lifecycles also fire here for legacy reasons.
  30792. startCommitLifeCyclesTimer();
  30793. nextEffect = firstEffect;
  30794. do {
  30795. {
  30796. invokeGuardedCallback(null, commitLayoutEffects, null, root, expirationTime);
  30797. if (hasCaughtError()) {
  30798. if (!(nextEffect !== null)) {
  30799. {
  30800. throw Error( "Should be working on an effect." );
  30801. }
  30802. }
  30803. var _error2 = clearCaughtError();
  30804. captureCommitPhaseError(nextEffect, _error2);
  30805. nextEffect = nextEffect.nextEffect;
  30806. }
  30807. }
  30808. } while (nextEffect !== null);
  30809. stopCommitLifeCyclesTimer();
  30810. nextEffect = null; // Tell Scheduler to yield at the end of the frame, so the browser has an
  30811. // opportunity to paint.
  30812. requestPaint();
  30813. {
  30814. popInteractions(prevInteractions);
  30815. }
  30816. executionContext = prevExecutionContext;
  30817. } else {
  30818. // No effects.
  30819. root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were
  30820. // no effects.
  30821. // TODO: Maybe there's a better way to report this.
  30822. startCommitSnapshotEffectsTimer();
  30823. stopCommitSnapshotEffectsTimer();
  30824. {
  30825. recordCommitTime();
  30826. }
  30827. startCommitHostEffectsTimer();
  30828. stopCommitHostEffectsTimer();
  30829. startCommitLifeCyclesTimer();
  30830. stopCommitLifeCyclesTimer();
  30831. }
  30832. stopCommitTimer();
  30833. var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
  30834. if (rootDoesHavePassiveEffects) {
  30835. // This commit has passive effects. Stash a reference to them. But don't
  30836. // schedule a callback until after flushing layout work.
  30837. rootDoesHavePassiveEffects = false;
  30838. rootWithPendingPassiveEffects = root;
  30839. pendingPassiveEffectsExpirationTime = expirationTime;
  30840. pendingPassiveEffectsRenderPriority = renderPriorityLevel;
  30841. } else {
  30842. // We are done with the effect chain at this point so let's clear the
  30843. // nextEffect pointers to assist with GC. If we have passive effects, we'll
  30844. // clear this in flushPassiveEffects.
  30845. nextEffect = firstEffect;
  30846. while (nextEffect !== null) {
  30847. var nextNextEffect = nextEffect.nextEffect;
  30848. nextEffect.nextEffect = null;
  30849. nextEffect = nextNextEffect;
  30850. }
  30851. } // Check if there's remaining work on this root
  30852. var remainingExpirationTime = root.firstPendingTime;
  30853. if (remainingExpirationTime !== NoWork) {
  30854. {
  30855. if (spawnedWorkDuringRender !== null) {
  30856. var expirationTimes = spawnedWorkDuringRender;
  30857. spawnedWorkDuringRender = null;
  30858. for (var i = 0; i < expirationTimes.length; i++) {
  30859. scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);
  30860. }
  30861. }
  30862. schedulePendingInteractions(root, remainingExpirationTime);
  30863. }
  30864. } else {
  30865. // If there's no remaining work, we can clear the set of already failed
  30866. // error boundaries.
  30867. legacyErrorBoundariesThatAlreadyFailed = null;
  30868. }
  30869. {
  30870. if (!rootDidHavePassiveEffects) {
  30871. // If there are no passive effects, then we can complete the pending interactions.
  30872. // Otherwise, we'll wait until after the passive effects are flushed.
  30873. // Wait to do this until after remaining work has been scheduled,
  30874. // so that we don't prematurely signal complete for interactions when there's e.g. hidden work.
  30875. finishPendingInteractions(root, expirationTime);
  30876. }
  30877. }
  30878. if (remainingExpirationTime === Sync) {
  30879. // Count the number of times the root synchronously re-renders without
  30880. // finishing. If there are too many, it indicates an infinite update loop.
  30881. if (root === rootWithNestedUpdates) {
  30882. nestedUpdateCount++;
  30883. } else {
  30884. nestedUpdateCount = 0;
  30885. rootWithNestedUpdates = root;
  30886. }
  30887. } else {
  30888. nestedUpdateCount = 0;
  30889. }
  30890. onCommitRoot(finishedWork.stateNode, expirationTime); // Always call this before exiting `commitRoot`, to ensure that any
  30891. // additional work on this root is scheduled.
  30892. ensureRootIsScheduled(root);
  30893. if (hasUncaughtError) {
  30894. hasUncaughtError = false;
  30895. var _error3 = firstUncaughtError;
  30896. firstUncaughtError = null;
  30897. throw _error3;
  30898. }
  30899. if ((executionContext & LegacyUnbatchedContext) !== NoContext) {
  30900. // This is a legacy edge case. We just committed the initial mount of
  30901. // a ReactDOM.render-ed root inside of batchedUpdates. The commit fired
  30902. // synchronously, but layout updates should be deferred until the end
  30903. // of the batch.
  30904. return null;
  30905. } // If layout work was scheduled, flush it now.
  30906. flushSyncCallbackQueue();
  30907. return null;
  30908. }
  30909. function commitBeforeMutationEffects() {
  30910. while (nextEffect !== null) {
  30911. var effectTag = nextEffect.effectTag;
  30912. if ((effectTag & Snapshot) !== NoEffect) {
  30913. setCurrentFiber(nextEffect);
  30914. recordEffect();
  30915. var current = nextEffect.alternate;
  30916. commitBeforeMutationLifeCycles(current, nextEffect);
  30917. resetCurrentFiber();
  30918. }
  30919. if ((effectTag & Passive) !== NoEffect) {
  30920. // If there are passive effects, schedule a callback to flush at
  30921. // the earliest opportunity.
  30922. if (!rootDoesHavePassiveEffects) {
  30923. rootDoesHavePassiveEffects = true;
  30924. scheduleCallback(NormalPriority, function () {
  30925. flushPassiveEffects();
  30926. return null;
  30927. });
  30928. }
  30929. }
  30930. nextEffect = nextEffect.nextEffect;
  30931. }
  30932. }
  30933. function commitMutationEffects(root, renderPriorityLevel) {
  30934. // TODO: Should probably move the bulk of this function to commitWork.
  30935. while (nextEffect !== null) {
  30936. setCurrentFiber(nextEffect);
  30937. var effectTag = nextEffect.effectTag;
  30938. if (effectTag & ContentReset) {
  30939. commitResetTextContent(nextEffect);
  30940. }
  30941. if (effectTag & Ref) {
  30942. var current = nextEffect.alternate;
  30943. if (current !== null) {
  30944. commitDetachRef(current);
  30945. }
  30946. } // The following switch statement is only concerned about placement,
  30947. // updates, and deletions. To avoid needing to add a case for every possible
  30948. // bitmap value, we remove the secondary effects from the effect tag and
  30949. // switch on that value.
  30950. var primaryEffectTag = effectTag & (Placement | Update | Deletion | Hydrating);
  30951. switch (primaryEffectTag) {
  30952. case Placement:
  30953. {
  30954. commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
  30955. // inserted, before any life-cycles like componentDidMount gets called.
  30956. // TODO: findDOMNode doesn't rely on this any more but isMounted does
  30957. // and isMounted is deprecated anyway so we should be able to kill this.
  30958. nextEffect.effectTag &= ~Placement;
  30959. break;
  30960. }
  30961. case PlacementAndUpdate:
  30962. {
  30963. // Placement
  30964. commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
  30965. // inserted, before any life-cycles like componentDidMount gets called.
  30966. nextEffect.effectTag &= ~Placement; // Update
  30967. var _current = nextEffect.alternate;
  30968. commitWork(_current, nextEffect);
  30969. break;
  30970. }
  30971. case Hydrating:
  30972. {
  30973. nextEffect.effectTag &= ~Hydrating;
  30974. break;
  30975. }
  30976. case HydratingAndUpdate:
  30977. {
  30978. nextEffect.effectTag &= ~Hydrating; // Update
  30979. var _current2 = nextEffect.alternate;
  30980. commitWork(_current2, nextEffect);
  30981. break;
  30982. }
  30983. case Update:
  30984. {
  30985. var _current3 = nextEffect.alternate;
  30986. commitWork(_current3, nextEffect);
  30987. break;
  30988. }
  30989. case Deletion:
  30990. {
  30991. commitDeletion(root, nextEffect, renderPriorityLevel);
  30992. break;
  30993. }
  30994. } // TODO: Only record a mutation effect if primaryEffectTag is non-zero.
  30995. recordEffect();
  30996. resetCurrentFiber();
  30997. nextEffect = nextEffect.nextEffect;
  30998. }
  30999. }
  31000. function commitLayoutEffects(root, committedExpirationTime) {
  31001. // TODO: Should probably move the bulk of this function to commitWork.
  31002. while (nextEffect !== null) {
  31003. setCurrentFiber(nextEffect);
  31004. var effectTag = nextEffect.effectTag;
  31005. if (effectTag & (Update | Callback)) {
  31006. recordEffect();
  31007. var current = nextEffect.alternate;
  31008. commitLifeCycles(root, current, nextEffect);
  31009. }
  31010. if (effectTag & Ref) {
  31011. recordEffect();
  31012. commitAttachRef(nextEffect);
  31013. }
  31014. resetCurrentFiber();
  31015. nextEffect = nextEffect.nextEffect;
  31016. }
  31017. }
  31018. function flushPassiveEffects() {
  31019. if (pendingPassiveEffectsRenderPriority !== NoPriority) {
  31020. var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority ? NormalPriority : pendingPassiveEffectsRenderPriority;
  31021. pendingPassiveEffectsRenderPriority = NoPriority;
  31022. return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);
  31023. }
  31024. }
  31025. function flushPassiveEffectsImpl() {
  31026. if (rootWithPendingPassiveEffects === null) {
  31027. return false;
  31028. }
  31029. var root = rootWithPendingPassiveEffects;
  31030. var expirationTime = pendingPassiveEffectsExpirationTime;
  31031. rootWithPendingPassiveEffects = null;
  31032. pendingPassiveEffectsExpirationTime = NoWork;
  31033. if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
  31034. {
  31035. throw Error( "Cannot flush passive effects while already rendering." );
  31036. }
  31037. }
  31038. var prevExecutionContext = executionContext;
  31039. executionContext |= CommitContext;
  31040. var prevInteractions = pushInteractions(root);
  31041. {
  31042. // Note: This currently assumes there are no passive effects on the root fiber
  31043. // because the root is not part of its own effect list.
  31044. // This could change in the future.
  31045. var _effect2 = root.current.firstEffect;
  31046. while (_effect2 !== null) {
  31047. {
  31048. setCurrentFiber(_effect2);
  31049. invokeGuardedCallback(null, commitPassiveHookEffects, null, _effect2);
  31050. if (hasCaughtError()) {
  31051. if (!(_effect2 !== null)) {
  31052. {
  31053. throw Error( "Should be working on an effect." );
  31054. }
  31055. }
  31056. var _error5 = clearCaughtError();
  31057. captureCommitPhaseError(_effect2, _error5);
  31058. }
  31059. resetCurrentFiber();
  31060. }
  31061. var nextNextEffect = _effect2.nextEffect; // Remove nextEffect pointer to assist GC
  31062. _effect2.nextEffect = null;
  31063. _effect2 = nextNextEffect;
  31064. }
  31065. }
  31066. {
  31067. popInteractions(prevInteractions);
  31068. finishPendingInteractions(root, expirationTime);
  31069. }
  31070. executionContext = prevExecutionContext;
  31071. flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this
  31072. // exceeds the limit, we'll fire a warning.
  31073. nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;
  31074. return true;
  31075. }
  31076. function isAlreadyFailedLegacyErrorBoundary(instance) {
  31077. return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
  31078. }
  31079. function markLegacyErrorBoundaryAsFailed(instance) {
  31080. if (legacyErrorBoundariesThatAlreadyFailed === null) {
  31081. legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);
  31082. } else {
  31083. legacyErrorBoundariesThatAlreadyFailed.add(instance);
  31084. }
  31085. }
  31086. function prepareToThrowUncaughtError(error) {
  31087. if (!hasUncaughtError) {
  31088. hasUncaughtError = true;
  31089. firstUncaughtError = error;
  31090. }
  31091. }
  31092. var onUncaughtError = prepareToThrowUncaughtError;
  31093. function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
  31094. var errorInfo = createCapturedValue(error, sourceFiber);
  31095. var update = createRootErrorUpdate(rootFiber, errorInfo, Sync);
  31096. enqueueUpdate(rootFiber, update);
  31097. var root = markUpdateTimeFromFiberToRoot(rootFiber, Sync);
  31098. if (root !== null) {
  31099. ensureRootIsScheduled(root);
  31100. schedulePendingInteractions(root, Sync);
  31101. }
  31102. }
  31103. function captureCommitPhaseError(sourceFiber, error) {
  31104. if (sourceFiber.tag === HostRoot) {
  31105. // Error was thrown at the root. There is no parent, so the root
  31106. // itself should capture it.
  31107. captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
  31108. return;
  31109. }
  31110. var fiber = sourceFiber.return;
  31111. while (fiber !== null) {
  31112. if (fiber.tag === HostRoot) {
  31113. captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
  31114. return;
  31115. } else if (fiber.tag === ClassComponent) {
  31116. var ctor = fiber.type;
  31117. var instance = fiber.stateNode;
  31118. if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
  31119. var errorInfo = createCapturedValue(error, sourceFiber);
  31120. var update = createClassErrorUpdate(fiber, errorInfo, // TODO: This is always sync
  31121. Sync);
  31122. enqueueUpdate(fiber, update);
  31123. var root = markUpdateTimeFromFiberToRoot(fiber, Sync);
  31124. if (root !== null) {
  31125. ensureRootIsScheduled(root);
  31126. schedulePendingInteractions(root, Sync);
  31127. }
  31128. return;
  31129. }
  31130. }
  31131. fiber = fiber.return;
  31132. }
  31133. }
  31134. function pingSuspendedRoot(root, thenable, suspendedTime) {
  31135. var pingCache = root.pingCache;
  31136. if (pingCache !== null) {
  31137. // The thenable resolved, so we no longer need to memoize, because it will
  31138. // never be thrown again.
  31139. pingCache.delete(thenable);
  31140. }
  31141. if (workInProgressRoot === root && renderExpirationTime$1 === suspendedTime) {
  31142. // Received a ping at the same priority level at which we're currently
  31143. // rendering. We might want to restart this render. This should mirror
  31144. // the logic of whether or not a root suspends once it completes.
  31145. // TODO: If we're rendering sync either due to Sync, Batched or expired,
  31146. // we should probably never restart.
  31147. // If we're suspended with delay, we'll always suspend so we can always
  31148. // restart. If we're suspended without any updates, it might be a retry.
  31149. // If it's early in the retry we can restart. We can't know for sure
  31150. // whether we'll eventually process an update during this render pass,
  31151. // but it's somewhat unlikely that we get to a ping before that, since
  31152. // getting to the root most update is usually very fast.
  31153. if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && workInProgressRootLatestProcessedExpirationTime === Sync && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
  31154. // Restart from the root. Don't need to schedule a ping because
  31155. // we're already working on this tree.
  31156. prepareFreshStack(root, renderExpirationTime$1);
  31157. } else {
  31158. // Even though we can't restart right now, we might get an
  31159. // opportunity later. So we mark this render as having a ping.
  31160. workInProgressRootHasPendingPing = true;
  31161. }
  31162. return;
  31163. }
  31164. if (!isRootSuspendedAtTime(root, suspendedTime)) {
  31165. // The root is no longer suspended at this time.
  31166. return;
  31167. }
  31168. var lastPingedTime = root.lastPingedTime;
  31169. if (lastPingedTime !== NoWork && lastPingedTime < suspendedTime) {
  31170. // There's already a lower priority ping scheduled.
  31171. return;
  31172. } // Mark the time at which this ping was scheduled.
  31173. root.lastPingedTime = suspendedTime;
  31174. ensureRootIsScheduled(root);
  31175. schedulePendingInteractions(root, suspendedTime);
  31176. }
  31177. function retryTimedOutBoundary(boundaryFiber, retryTime) {
  31178. // The boundary fiber (a Suspense component or SuspenseList component)
  31179. // previously was rendered in its fallback state. One of the promises that
  31180. // suspended it has resolved, which means at least part of the tree was
  31181. // likely unblocked. Try rendering again, at a new expiration time.
  31182. if (retryTime === NoWork) {
  31183. var suspenseConfig = null; // Retries don't carry over the already committed update.
  31184. var currentTime = requestCurrentTimeForUpdate();
  31185. retryTime = computeExpirationForFiber(currentTime, boundaryFiber, suspenseConfig);
  31186. } // TODO: Special case idle priority?
  31187. var root = markUpdateTimeFromFiberToRoot(boundaryFiber, retryTime);
  31188. if (root !== null) {
  31189. ensureRootIsScheduled(root);
  31190. schedulePendingInteractions(root, retryTime);
  31191. }
  31192. }
  31193. function resolveRetryThenable(boundaryFiber, thenable) {
  31194. var retryTime = NoWork; // Default
  31195. var retryCache;
  31196. {
  31197. retryCache = boundaryFiber.stateNode;
  31198. }
  31199. if (retryCache !== null) {
  31200. // The thenable resolved, so we no longer need to memoize, because it will
  31201. // never be thrown again.
  31202. retryCache.delete(thenable);
  31203. }
  31204. retryTimedOutBoundary(boundaryFiber, retryTime);
  31205. } // Computes the next Just Noticeable Difference (JND) boundary.
  31206. // The theory is that a person can't tell the difference between small differences in time.
  31207. // Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
  31208. // difference in the experience. However, waiting for longer might mean that we can avoid
  31209. // showing an intermediate loading state. The longer we have already waited, the harder it
  31210. // is to tell small differences in time. Therefore, the longer we've already waited,
  31211. // the longer we can wait additionally. At some point we have to give up though.
  31212. // We pick a train model where the next boundary commits at a consistent schedule.
  31213. // These particular numbers are vague estimates. We expect to adjust them based on research.
  31214. function jnd(timeElapsed) {
  31215. return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
  31216. }
  31217. function computeMsUntilSuspenseLoadingDelay(mostRecentEventTime, committedExpirationTime, suspenseConfig) {
  31218. var busyMinDurationMs = suspenseConfig.busyMinDurationMs | 0;
  31219. if (busyMinDurationMs <= 0) {
  31220. return 0;
  31221. }
  31222. var busyDelayMs = suspenseConfig.busyDelayMs | 0; // Compute the time until this render pass would expire.
  31223. var currentTimeMs = now();
  31224. var eventTimeMs = inferTimeFromExpirationTimeWithSuspenseConfig(mostRecentEventTime, suspenseConfig);
  31225. var timeElapsed = currentTimeMs - eventTimeMs;
  31226. if (timeElapsed <= busyDelayMs) {
  31227. // If we haven't yet waited longer than the initial delay, we don't
  31228. // have to wait any additional time.
  31229. return 0;
  31230. }
  31231. var msUntilTimeout = busyDelayMs + busyMinDurationMs - timeElapsed; // This is the value that is passed to `setTimeout`.
  31232. return msUntilTimeout;
  31233. }
  31234. function checkForNestedUpdates() {
  31235. if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
  31236. nestedUpdateCount = 0;
  31237. rootWithNestedUpdates = null;
  31238. {
  31239. {
  31240. throw Error( "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." );
  31241. }
  31242. }
  31243. }
  31244. {
  31245. if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
  31246. nestedPassiveUpdateCount = 0;
  31247. error('Maximum update depth exceeded. This can happen when a component ' + "calls setState inside useEffect, but useEffect either doesn't " + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');
  31248. }
  31249. }
  31250. }
  31251. function flushRenderPhaseStrictModeWarningsInDEV() {
  31252. {
  31253. ReactStrictModeWarnings.flushLegacyContextWarning();
  31254. {
  31255. ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
  31256. }
  31257. }
  31258. }
  31259. function stopFinishedWorkLoopTimer() {
  31260. var didCompleteRoot = true;
  31261. stopWorkLoopTimer(interruptedBy, didCompleteRoot);
  31262. interruptedBy = null;
  31263. }
  31264. function stopInterruptedWorkLoopTimer() {
  31265. // TODO: Track which fiber caused the interruption.
  31266. var didCompleteRoot = false;
  31267. stopWorkLoopTimer(interruptedBy, didCompleteRoot);
  31268. interruptedBy = null;
  31269. }
  31270. function checkForInterruption(fiberThatReceivedUpdate, updateExpirationTime) {
  31271. if ( workInProgressRoot !== null && updateExpirationTime > renderExpirationTime$1) {
  31272. interruptedBy = fiberThatReceivedUpdate;
  31273. }
  31274. }
  31275. var didWarnStateUpdateForUnmountedComponent = null;
  31276. function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
  31277. {
  31278. var tag = fiber.tag;
  31279. if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
  31280. // Only warn for user-defined components, not internal ones like Suspense.
  31281. return;
  31282. }
  31283. // the problematic code almost always lies inside that component.
  31284. var componentName = getComponentName(fiber.type) || 'ReactComponent';
  31285. if (didWarnStateUpdateForUnmountedComponent !== null) {
  31286. if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {
  31287. return;
  31288. }
  31289. didWarnStateUpdateForUnmountedComponent.add(componentName);
  31290. } else {
  31291. didWarnStateUpdateForUnmountedComponent = new Set([componentName]);
  31292. }
  31293. error("Can't perform a React state update on an unmounted component. This " + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.%s', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function', getStackByFiberInDevAndProd(fiber));
  31294. }
  31295. }
  31296. var beginWork$1;
  31297. {
  31298. var dummyFiber = null;
  31299. beginWork$1 = function (current, unitOfWork, expirationTime) {
  31300. // If a component throws an error, we replay it again in a synchronously
  31301. // dispatched event, so that the debugger will treat it as an uncaught
  31302. // error See ReactErrorUtils for more information.
  31303. // Before entering the begin phase, copy the work-in-progress onto a dummy
  31304. // fiber. If beginWork throws, we'll use this to reset the state.
  31305. var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
  31306. try {
  31307. return beginWork(current, unitOfWork, expirationTime);
  31308. } catch (originalError) {
  31309. if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {
  31310. // Don't replay promises. Treat everything else like an error.
  31311. throw originalError;
  31312. } // Keep this code in sync with handleError; any changes here must have
  31313. // corresponding changes there.
  31314. resetContextDependencies();
  31315. resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the
  31316. // same fiber again.
  31317. // Unwind the failed stack frame
  31318. unwindInterruptedWork(unitOfWork); // Restore the original properties of the fiber.
  31319. assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
  31320. if ( unitOfWork.mode & ProfileMode) {
  31321. // Reset the profiler timer.
  31322. startProfilerTimer(unitOfWork);
  31323. } // Run beginWork again.
  31324. invokeGuardedCallback(null, beginWork, null, current, unitOfWork, expirationTime);
  31325. if (hasCaughtError()) {
  31326. var replayError = clearCaughtError(); // `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`.
  31327. // Rethrow this error instead of the original one.
  31328. throw replayError;
  31329. } else {
  31330. // This branch is reachable if the render phase is impure.
  31331. throw originalError;
  31332. }
  31333. }
  31334. };
  31335. }
  31336. var didWarnAboutUpdateInRender = false;
  31337. var didWarnAboutUpdateInRenderForAnotherComponent;
  31338. {
  31339. didWarnAboutUpdateInRenderForAnotherComponent = new Set();
  31340. }
  31341. function warnAboutRenderPhaseUpdatesInDEV(fiber) {
  31342. {
  31343. if (isRendering && (executionContext & RenderContext) !== NoContext) {
  31344. switch (fiber.tag) {
  31345. case FunctionComponent:
  31346. case ForwardRef:
  31347. case SimpleMemoComponent:
  31348. {
  31349. var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed.
  31350. var dedupeKey = renderingComponentName;
  31351. if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
  31352. didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
  31353. var setStateComponentName = getComponentName(fiber.type) || 'Unknown';
  31354. error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://fb.me/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);
  31355. }
  31356. break;
  31357. }
  31358. case ClassComponent:
  31359. {
  31360. if (!didWarnAboutUpdateInRender) {
  31361. error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');
  31362. didWarnAboutUpdateInRender = true;
  31363. }
  31364. break;
  31365. }
  31366. }
  31367. }
  31368. }
  31369. } // a 'shared' variable that changes when act() opens/closes in tests.
  31370. var IsThisRendererActing = {
  31371. current: false
  31372. };
  31373. function warnIfNotScopedWithMatchingAct(fiber) {
  31374. {
  31375. if ( IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {
  31376. error("It looks like you're using the wrong act() around your test interactions.\n" + 'Be sure to use the matching version of act() corresponding to your renderer:\n\n' + '// for react-dom:\n' + "import {act} from 'react-dom/test-utils';\n" + '// ...\n' + 'act(() => ...);\n\n' + '// for react-test-renderer:\n' + "import TestRenderer from 'react-test-renderer';\n" + 'const {act} = TestRenderer;\n' + '// ...\n' + 'act(() => ...);' + '%s', getStackByFiberInDevAndProd(fiber));
  31377. }
  31378. }
  31379. }
  31380. function warnIfNotCurrentlyActingEffectsInDEV(fiber) {
  31381. {
  31382. if ( (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
  31383. error('An update to %s ran an effect, but was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
  31384. }
  31385. }
  31386. }
  31387. function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
  31388. {
  31389. if ( executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
  31390. error('An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
  31391. }
  31392. }
  31393. }
  31394. var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV; // In tests, we want to enforce a mocked scheduler.
  31395. var didWarnAboutUnmockedScheduler = false; // TODO Before we release concurrent mode, revisit this and decide whether a mocked
  31396. // scheduler is the actual recommendation. The alternative could be a testing build,
  31397. // a new lib, or whatever; we dunno just yet. This message is for early adopters
  31398. // to get their tests right.
  31399. function warnIfUnmockedScheduler(fiber) {
  31400. {
  31401. if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {
  31402. if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {
  31403. didWarnAboutUnmockedScheduler = true;
  31404. error('In Concurrent or Sync modes, the "scheduler" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + "jest.mock('scheduler', () => require('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://fb.me/react-mock-scheduler');
  31405. }
  31406. }
  31407. }
  31408. }
  31409. function computeThreadID(root, expirationTime) {
  31410. // Interaction threads are unique per root and expiration time.
  31411. return expirationTime * 1000 + root.interactionThreadID;
  31412. }
  31413. function markSpawnedWork(expirationTime) {
  31414. if (spawnedWorkDuringRender === null) {
  31415. spawnedWorkDuringRender = [expirationTime];
  31416. } else {
  31417. spawnedWorkDuringRender.push(expirationTime);
  31418. }
  31419. }
  31420. function scheduleInteractions(root, expirationTime, interactions) {
  31421. if (interactions.size > 0) {
  31422. var pendingInteractionMap = root.pendingInteractionMap;
  31423. var pendingInteractions = pendingInteractionMap.get(expirationTime);
  31424. if (pendingInteractions != null) {
  31425. interactions.forEach(function (interaction) {
  31426. if (!pendingInteractions.has(interaction)) {
  31427. // Update the pending async work count for previously unscheduled interaction.
  31428. interaction.__count++;
  31429. }
  31430. pendingInteractions.add(interaction);
  31431. });
  31432. } else {
  31433. pendingInteractionMap.set(expirationTime, new Set(interactions)); // Update the pending async work count for the current interactions.
  31434. interactions.forEach(function (interaction) {
  31435. interaction.__count++;
  31436. });
  31437. }
  31438. var subscriber = tracing.__subscriberRef.current;
  31439. if (subscriber !== null) {
  31440. var threadID = computeThreadID(root, expirationTime);
  31441. subscriber.onWorkScheduled(interactions, threadID);
  31442. }
  31443. }
  31444. }
  31445. function schedulePendingInteractions(root, expirationTime) {
  31446. scheduleInteractions(root, expirationTime, tracing.__interactionsRef.current);
  31447. }
  31448. function startWorkOnPendingInteractions(root, expirationTime) {
  31449. // we can accurately attribute time spent working on it, And so that cascading
  31450. // work triggered during the render phase will be associated with it.
  31451. var interactions = new Set();
  31452. root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
  31453. if (scheduledExpirationTime >= expirationTime) {
  31454. scheduledInteractions.forEach(function (interaction) {
  31455. return interactions.add(interaction);
  31456. });
  31457. }
  31458. }); // Store the current set of interactions on the FiberRoot for a few reasons:
  31459. // We can re-use it in hot functions like performConcurrentWorkOnRoot()
  31460. // without having to recalculate it. We will also use it in commitWork() to
  31461. // pass to any Profiler onRender() hooks. This also provides DevTools with a
  31462. // way to access it when the onCommitRoot() hook is called.
  31463. root.memoizedInteractions = interactions;
  31464. if (interactions.size > 0) {
  31465. var subscriber = tracing.__subscriberRef.current;
  31466. if (subscriber !== null) {
  31467. var threadID = computeThreadID(root, expirationTime);
  31468. try {
  31469. subscriber.onWorkStarted(interactions, threadID);
  31470. } catch (error) {
  31471. // If the subscriber throws, rethrow it in a separate task
  31472. scheduleCallback(ImmediatePriority, function () {
  31473. throw error;
  31474. });
  31475. }
  31476. }
  31477. }
  31478. }
  31479. function finishPendingInteractions(root, committedExpirationTime) {
  31480. var earliestRemainingTimeAfterCommit = root.firstPendingTime;
  31481. var subscriber;
  31482. try {
  31483. subscriber = tracing.__subscriberRef.current;
  31484. if (subscriber !== null && root.memoizedInteractions.size > 0) {
  31485. var threadID = computeThreadID(root, committedExpirationTime);
  31486. subscriber.onWorkStopped(root.memoizedInteractions, threadID);
  31487. }
  31488. } catch (error) {
  31489. // If the subscriber throws, rethrow it in a separate task
  31490. scheduleCallback(ImmediatePriority, function () {
  31491. throw error;
  31492. });
  31493. } finally {
  31494. // Clear completed interactions from the pending Map.
  31495. // Unless the render was suspended or cascading work was scheduled,
  31496. // In which case– leave pending interactions until the subsequent render.
  31497. var pendingInteractionMap = root.pendingInteractionMap;
  31498. pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
  31499. // Only decrement the pending interaction count if we're done.
  31500. // If there's still work at the current priority,
  31501. // That indicates that we are waiting for suspense data.
  31502. if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) {
  31503. pendingInteractionMap.delete(scheduledExpirationTime);
  31504. scheduledInteractions.forEach(function (interaction) {
  31505. interaction.__count--;
  31506. if (subscriber !== null && interaction.__count === 0) {
  31507. try {
  31508. subscriber.onInteractionScheduledWorkCompleted(interaction);
  31509. } catch (error) {
  31510. // If the subscriber throws, rethrow it in a separate task
  31511. scheduleCallback(ImmediatePriority, function () {
  31512. throw error;
  31513. });
  31514. }
  31515. }
  31516. });
  31517. }
  31518. });
  31519. }
  31520. }
  31521. var onScheduleFiberRoot = null;
  31522. var onCommitFiberRoot = null;
  31523. var onCommitFiberUnmount = null;
  31524. var hasLoggedError = false;
  31525. var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';
  31526. function injectInternals(internals) {
  31527. if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
  31528. // No DevTools
  31529. return false;
  31530. }
  31531. var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  31532. if (hook.isDisabled) {
  31533. // This isn't a real property on the hook, but it can be set to opt out
  31534. // of DevTools integration and associated warnings and logs.
  31535. // https://github.com/facebook/react/issues/3877
  31536. return true;
  31537. }
  31538. if (!hook.supportsFiber) {
  31539. {
  31540. error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');
  31541. } // DevTools exists, even though it doesn't support Fiber.
  31542. return true;
  31543. }
  31544. try {
  31545. var rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks.
  31546. if (true) {
  31547. // Only used by Fast Refresh
  31548. if (typeof hook.onScheduleFiberRoot === 'function') {
  31549. onScheduleFiberRoot = function (root, children) {
  31550. try {
  31551. hook.onScheduleFiberRoot(rendererID, root, children);
  31552. } catch (err) {
  31553. if ( true && !hasLoggedError) {
  31554. hasLoggedError = true;
  31555. error('React instrumentation encountered an error: %s', err);
  31556. }
  31557. }
  31558. };
  31559. }
  31560. }
  31561. onCommitFiberRoot = function (root, expirationTime) {
  31562. try {
  31563. var didError = (root.current.effectTag & DidCapture) === DidCapture;
  31564. if (enableProfilerTimer) {
  31565. var currentTime = getCurrentTime();
  31566. var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime);
  31567. hook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);
  31568. } else {
  31569. hook.onCommitFiberRoot(rendererID, root, undefined, didError);
  31570. }
  31571. } catch (err) {
  31572. if (true) {
  31573. if (!hasLoggedError) {
  31574. hasLoggedError = true;
  31575. error('React instrumentation encountered an error: %s', err);
  31576. }
  31577. }
  31578. }
  31579. };
  31580. onCommitFiberUnmount = function (fiber) {
  31581. try {
  31582. hook.onCommitFiberUnmount(rendererID, fiber);
  31583. } catch (err) {
  31584. if (true) {
  31585. if (!hasLoggedError) {
  31586. hasLoggedError = true;
  31587. error('React instrumentation encountered an error: %s', err);
  31588. }
  31589. }
  31590. }
  31591. };
  31592. } catch (err) {
  31593. // Catch all errors because it is unsafe to throw during initialization.
  31594. {
  31595. error('React instrumentation encountered an error: %s.', err);
  31596. }
  31597. } // DevTools exists
  31598. return true;
  31599. }
  31600. function onScheduleRoot(root, children) {
  31601. if (typeof onScheduleFiberRoot === 'function') {
  31602. onScheduleFiberRoot(root, children);
  31603. }
  31604. }
  31605. function onCommitRoot(root, expirationTime) {
  31606. if (typeof onCommitFiberRoot === 'function') {
  31607. onCommitFiberRoot(root, expirationTime);
  31608. }
  31609. }
  31610. function onCommitUnmount(fiber) {
  31611. if (typeof onCommitFiberUnmount === 'function') {
  31612. onCommitFiberUnmount(fiber);
  31613. }
  31614. }
  31615. var hasBadMapPolyfill;
  31616. {
  31617. hasBadMapPolyfill = false;
  31618. try {
  31619. var nonExtensibleObject = Object.preventExtensions({});
  31620. var testMap = new Map([[nonExtensibleObject, null]]);
  31621. var testSet = new Set([nonExtensibleObject]); // This is necessary for Rollup to not consider these unused.
  31622. // https://github.com/rollup/rollup/issues/1771
  31623. // TODO: we can remove these if Rollup fixes the bug.
  31624. testMap.set(0, 0);
  31625. testSet.add(0);
  31626. } catch (e) {
  31627. // TODO: Consider warning about bad polyfills
  31628. hasBadMapPolyfill = true;
  31629. }
  31630. }
  31631. var debugCounter = 1;
  31632. function FiberNode(tag, pendingProps, key, mode) {
  31633. // Instance
  31634. this.tag = tag;
  31635. this.key = key;
  31636. this.elementType = null;
  31637. this.type = null;
  31638. this.stateNode = null; // Fiber
  31639. this.return = null;
  31640. this.child = null;
  31641. this.sibling = null;
  31642. this.index = 0;
  31643. this.ref = null;
  31644. this.pendingProps = pendingProps;
  31645. this.memoizedProps = null;
  31646. this.updateQueue = null;
  31647. this.memoizedState = null;
  31648. this.dependencies = null;
  31649. this.mode = mode; // Effects
  31650. this.effectTag = NoEffect;
  31651. this.nextEffect = null;
  31652. this.firstEffect = null;
  31653. this.lastEffect = null;
  31654. this.expirationTime = NoWork;
  31655. this.childExpirationTime = NoWork;
  31656. this.alternate = null;
  31657. {
  31658. // Note: The following is done to avoid a v8 performance cliff.
  31659. //
  31660. // Initializing the fields below to smis and later updating them with
  31661. // double values will cause Fibers to end up having separate shapes.
  31662. // This behavior/bug has something to do with Object.preventExtension().
  31663. // Fortunately this only impacts DEV builds.
  31664. // Unfortunately it makes React unusably slow for some applications.
  31665. // To work around this, initialize the fields below with doubles.
  31666. //
  31667. // Learn more about this here:
  31668. // https://github.com/facebook/react/issues/14365
  31669. // https://bugs.chromium.org/p/v8/issues/detail?id=8538
  31670. this.actualDuration = Number.NaN;
  31671. this.actualStartTime = Number.NaN;
  31672. this.selfBaseDuration = Number.NaN;
  31673. this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization.
  31674. // This won't trigger the performance cliff mentioned above,
  31675. // and it simplifies other profiler code (including DevTools).
  31676. this.actualDuration = 0;
  31677. this.actualStartTime = -1;
  31678. this.selfBaseDuration = 0;
  31679. this.treeBaseDuration = 0;
  31680. } // This is normally DEV-only except www when it adds listeners.
  31681. // TODO: remove the User Timing integration in favor of Root Events.
  31682. {
  31683. this._debugID = debugCounter++;
  31684. this._debugIsCurrentlyTiming = false;
  31685. }
  31686. {
  31687. this._debugSource = null;
  31688. this._debugOwner = null;
  31689. this._debugNeedsRemount = false;
  31690. this._debugHookTypes = null;
  31691. if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
  31692. Object.preventExtensions(this);
  31693. }
  31694. }
  31695. } // This is a constructor function, rather than a POJO constructor, still
  31696. // please ensure we do the following:
  31697. // 1) Nobody should add any instance methods on this. Instance methods can be
  31698. // more difficult to predict when they get optimized and they are almost
  31699. // never inlined properly in static compilers.
  31700. // 2) Nobody should rely on `instanceof Fiber` for type testing. We should
  31701. // always know when it is a fiber.
  31702. // 3) We might want to experiment with using numeric keys since they are easier
  31703. // to optimize in a non-JIT environment.
  31704. // 4) We can easily go from a constructor to a createFiber object literal if that
  31705. // is faster.
  31706. // 5) It should be easy to port this to a C struct and keep a C implementation
  31707. // compatible.
  31708. var createFiber = function (tag, pendingProps, key, mode) {
  31709. // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors
  31710. return new FiberNode(tag, pendingProps, key, mode);
  31711. };
  31712. function shouldConstruct(Component) {
  31713. var prototype = Component.prototype;
  31714. return !!(prototype && prototype.isReactComponent);
  31715. }
  31716. function isSimpleFunctionComponent(type) {
  31717. return typeof type === 'function' && !shouldConstruct(type) && type.defaultProps === undefined;
  31718. }
  31719. function resolveLazyComponentTag(Component) {
  31720. if (typeof Component === 'function') {
  31721. return shouldConstruct(Component) ? ClassComponent : FunctionComponent;
  31722. } else if (Component !== undefined && Component !== null) {
  31723. var $$typeof = Component.$$typeof;
  31724. if ($$typeof === REACT_FORWARD_REF_TYPE) {
  31725. return ForwardRef;
  31726. }
  31727. if ($$typeof === REACT_MEMO_TYPE) {
  31728. return MemoComponent;
  31729. }
  31730. }
  31731. return IndeterminateComponent;
  31732. } // This is used to create an alternate fiber to do work on.
  31733. function createWorkInProgress(current, pendingProps) {
  31734. var workInProgress = current.alternate;
  31735. if (workInProgress === null) {
  31736. // We use a double buffering pooling technique because we know that we'll
  31737. // only ever need at most two versions of a tree. We pool the "other" unused
  31738. // node that we're free to reuse. This is lazily created to avoid allocating
  31739. // extra objects for things that are never updated. It also allow us to
  31740. // reclaim the extra memory if needed.
  31741. workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);
  31742. workInProgress.elementType = current.elementType;
  31743. workInProgress.type = current.type;
  31744. workInProgress.stateNode = current.stateNode;
  31745. {
  31746. // DEV-only fields
  31747. {
  31748. workInProgress._debugID = current._debugID;
  31749. }
  31750. workInProgress._debugSource = current._debugSource;
  31751. workInProgress._debugOwner = current._debugOwner;
  31752. workInProgress._debugHookTypes = current._debugHookTypes;
  31753. }
  31754. workInProgress.alternate = current;
  31755. current.alternate = workInProgress;
  31756. } else {
  31757. workInProgress.pendingProps = pendingProps; // We already have an alternate.
  31758. // Reset the effect tag.
  31759. workInProgress.effectTag = NoEffect; // The effect list is no longer valid.
  31760. workInProgress.nextEffect = null;
  31761. workInProgress.firstEffect = null;
  31762. workInProgress.lastEffect = null;
  31763. {
  31764. // We intentionally reset, rather than copy, actualDuration & actualStartTime.
  31765. // This prevents time from endlessly accumulating in new commits.
  31766. // This has the downside of resetting values for different priority renders,
  31767. // But works for yielding (the common case) and should support resuming.
  31768. workInProgress.actualDuration = 0;
  31769. workInProgress.actualStartTime = -1;
  31770. }
  31771. }
  31772. workInProgress.childExpirationTime = current.childExpirationTime;
  31773. workInProgress.expirationTime = current.expirationTime;
  31774. workInProgress.child = current.child;
  31775. workInProgress.memoizedProps = current.memoizedProps;
  31776. workInProgress.memoizedState = current.memoizedState;
  31777. workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so
  31778. // it cannot be shared with the current fiber.
  31779. var currentDependencies = current.dependencies;
  31780. workInProgress.dependencies = currentDependencies === null ? null : {
  31781. expirationTime: currentDependencies.expirationTime,
  31782. firstContext: currentDependencies.firstContext,
  31783. responders: currentDependencies.responders
  31784. }; // These will be overridden during the parent's reconciliation
  31785. workInProgress.sibling = current.sibling;
  31786. workInProgress.index = current.index;
  31787. workInProgress.ref = current.ref;
  31788. {
  31789. workInProgress.selfBaseDuration = current.selfBaseDuration;
  31790. workInProgress.treeBaseDuration = current.treeBaseDuration;
  31791. }
  31792. {
  31793. workInProgress._debugNeedsRemount = current._debugNeedsRemount;
  31794. switch (workInProgress.tag) {
  31795. case IndeterminateComponent:
  31796. case FunctionComponent:
  31797. case SimpleMemoComponent:
  31798. workInProgress.type = resolveFunctionForHotReloading(current.type);
  31799. break;
  31800. case ClassComponent:
  31801. workInProgress.type = resolveClassForHotReloading(current.type);
  31802. break;
  31803. case ForwardRef:
  31804. workInProgress.type = resolveForwardRefForHotReloading(current.type);
  31805. break;
  31806. }
  31807. }
  31808. return workInProgress;
  31809. } // Used to reuse a Fiber for a second pass.
  31810. function resetWorkInProgress(workInProgress, renderExpirationTime) {
  31811. // This resets the Fiber to what createFiber or createWorkInProgress would
  31812. // have set the values to before during the first pass. Ideally this wouldn't
  31813. // be necessary but unfortunately many code paths reads from the workInProgress
  31814. // when they should be reading from current and writing to workInProgress.
  31815. // We assume pendingProps, index, key, ref, return are still untouched to
  31816. // avoid doing another reconciliation.
  31817. // Reset the effect tag but keep any Placement tags, since that's something
  31818. // that child fiber is setting, not the reconciliation.
  31819. workInProgress.effectTag &= Placement; // The effect list is no longer valid.
  31820. workInProgress.nextEffect = null;
  31821. workInProgress.firstEffect = null;
  31822. workInProgress.lastEffect = null;
  31823. var current = workInProgress.alternate;
  31824. if (current === null) {
  31825. // Reset to createFiber's initial values.
  31826. workInProgress.childExpirationTime = NoWork;
  31827. workInProgress.expirationTime = renderExpirationTime;
  31828. workInProgress.child = null;
  31829. workInProgress.memoizedProps = null;
  31830. workInProgress.memoizedState = null;
  31831. workInProgress.updateQueue = null;
  31832. workInProgress.dependencies = null;
  31833. {
  31834. // Note: We don't reset the actualTime counts. It's useful to accumulate
  31835. // actual time across multiple render passes.
  31836. workInProgress.selfBaseDuration = 0;
  31837. workInProgress.treeBaseDuration = 0;
  31838. }
  31839. } else {
  31840. // Reset to the cloned values that createWorkInProgress would've.
  31841. workInProgress.childExpirationTime = current.childExpirationTime;
  31842. workInProgress.expirationTime = current.expirationTime;
  31843. workInProgress.child = current.child;
  31844. workInProgress.memoizedProps = current.memoizedProps;
  31845. workInProgress.memoizedState = current.memoizedState;
  31846. workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so
  31847. // it cannot be shared with the current fiber.
  31848. var currentDependencies = current.dependencies;
  31849. workInProgress.dependencies = currentDependencies === null ? null : {
  31850. expirationTime: currentDependencies.expirationTime,
  31851. firstContext: currentDependencies.firstContext,
  31852. responders: currentDependencies.responders
  31853. };
  31854. {
  31855. // Note: We don't reset the actualTime counts. It's useful to accumulate
  31856. // actual time across multiple render passes.
  31857. workInProgress.selfBaseDuration = current.selfBaseDuration;
  31858. workInProgress.treeBaseDuration = current.treeBaseDuration;
  31859. }
  31860. }
  31861. return workInProgress;
  31862. }
  31863. function createHostRootFiber(tag) {
  31864. var mode;
  31865. if (tag === ConcurrentRoot) {
  31866. mode = ConcurrentMode | BlockingMode | StrictMode;
  31867. } else if (tag === BlockingRoot) {
  31868. mode = BlockingMode | StrictMode;
  31869. } else {
  31870. mode = NoMode;
  31871. }
  31872. if ( isDevToolsPresent) {
  31873. // Always collect profile timings when DevTools are present.
  31874. // This enables DevTools to start capturing timing at any point–
  31875. // Without some nodes in the tree having empty base times.
  31876. mode |= ProfileMode;
  31877. }
  31878. return createFiber(HostRoot, null, null, mode);
  31879. }
  31880. function createFiberFromTypeAndProps(type, // React$ElementType
  31881. key, pendingProps, owner, mode, expirationTime) {
  31882. var fiber;
  31883. var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy.
  31884. var resolvedType = type;
  31885. if (typeof type === 'function') {
  31886. if (shouldConstruct(type)) {
  31887. fiberTag = ClassComponent;
  31888. {
  31889. resolvedType = resolveClassForHotReloading(resolvedType);
  31890. }
  31891. } else {
  31892. {
  31893. resolvedType = resolveFunctionForHotReloading(resolvedType);
  31894. }
  31895. }
  31896. } else if (typeof type === 'string') {
  31897. fiberTag = HostComponent;
  31898. } else {
  31899. getTag: switch (type) {
  31900. case REACT_FRAGMENT_TYPE:
  31901. return createFiberFromFragment(pendingProps.children, mode, expirationTime, key);
  31902. case REACT_CONCURRENT_MODE_TYPE:
  31903. fiberTag = Mode;
  31904. mode |= ConcurrentMode | BlockingMode | StrictMode;
  31905. break;
  31906. case REACT_STRICT_MODE_TYPE:
  31907. fiberTag = Mode;
  31908. mode |= StrictMode;
  31909. break;
  31910. case REACT_PROFILER_TYPE:
  31911. return createFiberFromProfiler(pendingProps, mode, expirationTime, key);
  31912. case REACT_SUSPENSE_TYPE:
  31913. return createFiberFromSuspense(pendingProps, mode, expirationTime, key);
  31914. case REACT_SUSPENSE_LIST_TYPE:
  31915. return createFiberFromSuspenseList(pendingProps, mode, expirationTime, key);
  31916. default:
  31917. {
  31918. if (typeof type === 'object' && type !== null) {
  31919. switch (type.$$typeof) {
  31920. case REACT_PROVIDER_TYPE:
  31921. fiberTag = ContextProvider;
  31922. break getTag;
  31923. case REACT_CONTEXT_TYPE:
  31924. // This is a consumer
  31925. fiberTag = ContextConsumer;
  31926. break getTag;
  31927. case REACT_FORWARD_REF_TYPE:
  31928. fiberTag = ForwardRef;
  31929. {
  31930. resolvedType = resolveForwardRefForHotReloading(resolvedType);
  31931. }
  31932. break getTag;
  31933. case REACT_MEMO_TYPE:
  31934. fiberTag = MemoComponent;
  31935. break getTag;
  31936. case REACT_LAZY_TYPE:
  31937. fiberTag = LazyComponent;
  31938. resolvedType = null;
  31939. break getTag;
  31940. case REACT_BLOCK_TYPE:
  31941. fiberTag = Block;
  31942. break getTag;
  31943. }
  31944. }
  31945. var info = '';
  31946. {
  31947. if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
  31948. info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
  31949. }
  31950. var ownerName = owner ? getComponentName(owner.type) : null;
  31951. if (ownerName) {
  31952. info += '\n\nCheck the render method of `' + ownerName + '`.';
  31953. }
  31954. }
  31955. {
  31956. {
  31957. throw Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info );
  31958. }
  31959. }
  31960. }
  31961. }
  31962. }
  31963. fiber = createFiber(fiberTag, pendingProps, key, mode);
  31964. fiber.elementType = type;
  31965. fiber.type = resolvedType;
  31966. fiber.expirationTime = expirationTime;
  31967. return fiber;
  31968. }
  31969. function createFiberFromElement(element, mode, expirationTime) {
  31970. var owner = null;
  31971. {
  31972. owner = element._owner;
  31973. }
  31974. var type = element.type;
  31975. var key = element.key;
  31976. var pendingProps = element.props;
  31977. var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime);
  31978. {
  31979. fiber._debugSource = element._source;
  31980. fiber._debugOwner = element._owner;
  31981. }
  31982. return fiber;
  31983. }
  31984. function createFiberFromFragment(elements, mode, expirationTime, key) {
  31985. var fiber = createFiber(Fragment, elements, key, mode);
  31986. fiber.expirationTime = expirationTime;
  31987. return fiber;
  31988. }
  31989. function createFiberFromProfiler(pendingProps, mode, expirationTime, key) {
  31990. {
  31991. if (typeof pendingProps.id !== 'string' || typeof pendingProps.onRender !== 'function') {
  31992. error('Profiler must specify an "id" string and "onRender" function as props');
  31993. }
  31994. }
  31995. var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); // TODO: The Profiler fiber shouldn't have a type. It has a tag.
  31996. fiber.elementType = REACT_PROFILER_TYPE;
  31997. fiber.type = REACT_PROFILER_TYPE;
  31998. fiber.expirationTime = expirationTime;
  31999. return fiber;
  32000. }
  32001. function createFiberFromSuspense(pendingProps, mode, expirationTime, key) {
  32002. var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.
  32003. // This needs to be fixed in getComponentName so that it relies on the tag
  32004. // instead.
  32005. fiber.type = REACT_SUSPENSE_TYPE;
  32006. fiber.elementType = REACT_SUSPENSE_TYPE;
  32007. fiber.expirationTime = expirationTime;
  32008. return fiber;
  32009. }
  32010. function createFiberFromSuspenseList(pendingProps, mode, expirationTime, key) {
  32011. var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
  32012. {
  32013. // TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag.
  32014. // This needs to be fixed in getComponentName so that it relies on the tag
  32015. // instead.
  32016. fiber.type = REACT_SUSPENSE_LIST_TYPE;
  32017. }
  32018. fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
  32019. fiber.expirationTime = expirationTime;
  32020. return fiber;
  32021. }
  32022. function createFiberFromText(content, mode, expirationTime) {
  32023. var fiber = createFiber(HostText, content, null, mode);
  32024. fiber.expirationTime = expirationTime;
  32025. return fiber;
  32026. }
  32027. function createFiberFromHostInstanceForDeletion() {
  32028. var fiber = createFiber(HostComponent, null, null, NoMode); // TODO: These should not need a type.
  32029. fiber.elementType = 'DELETED';
  32030. fiber.type = 'DELETED';
  32031. return fiber;
  32032. }
  32033. function createFiberFromPortal(portal, mode, expirationTime) {
  32034. var pendingProps = portal.children !== null ? portal.children : [];
  32035. var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
  32036. fiber.expirationTime = expirationTime;
  32037. fiber.stateNode = {
  32038. containerInfo: portal.containerInfo,
  32039. pendingChildren: null,
  32040. // Used by persistent updates
  32041. implementation: portal.implementation
  32042. };
  32043. return fiber;
  32044. } // Used for stashing WIP properties to replay failed work in DEV.
  32045. function assignFiberPropertiesInDEV(target, source) {
  32046. if (target === null) {
  32047. // This Fiber's initial properties will always be overwritten.
  32048. // We only use a Fiber to ensure the same hidden class so DEV isn't slow.
  32049. target = createFiber(IndeterminateComponent, null, null, NoMode);
  32050. } // This is intentionally written as a list of all properties.
  32051. // We tried to use Object.assign() instead but this is called in
  32052. // the hottest path, and Object.assign() was too slow:
  32053. // https://github.com/facebook/react/issues/12502
  32054. // This code is DEV-only so size is not a concern.
  32055. target.tag = source.tag;
  32056. target.key = source.key;
  32057. target.elementType = source.elementType;
  32058. target.type = source.type;
  32059. target.stateNode = source.stateNode;
  32060. target.return = source.return;
  32061. target.child = source.child;
  32062. target.sibling = source.sibling;
  32063. target.index = source.index;
  32064. target.ref = source.ref;
  32065. target.pendingProps = source.pendingProps;
  32066. target.memoizedProps = source.memoizedProps;
  32067. target.updateQueue = source.updateQueue;
  32068. target.memoizedState = source.memoizedState;
  32069. target.dependencies = source.dependencies;
  32070. target.mode = source.mode;
  32071. target.effectTag = source.effectTag;
  32072. target.nextEffect = source.nextEffect;
  32073. target.firstEffect = source.firstEffect;
  32074. target.lastEffect = source.lastEffect;
  32075. target.expirationTime = source.expirationTime;
  32076. target.childExpirationTime = source.childExpirationTime;
  32077. target.alternate = source.alternate;
  32078. {
  32079. target.actualDuration = source.actualDuration;
  32080. target.actualStartTime = source.actualStartTime;
  32081. target.selfBaseDuration = source.selfBaseDuration;
  32082. target.treeBaseDuration = source.treeBaseDuration;
  32083. }
  32084. {
  32085. target._debugID = source._debugID;
  32086. }
  32087. target._debugSource = source._debugSource;
  32088. target._debugOwner = source._debugOwner;
  32089. target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
  32090. target._debugNeedsRemount = source._debugNeedsRemount;
  32091. target._debugHookTypes = source._debugHookTypes;
  32092. return target;
  32093. }
  32094. function FiberRootNode(containerInfo, tag, hydrate) {
  32095. this.tag = tag;
  32096. this.current = null;
  32097. this.containerInfo = containerInfo;
  32098. this.pendingChildren = null;
  32099. this.pingCache = null;
  32100. this.finishedExpirationTime = NoWork;
  32101. this.finishedWork = null;
  32102. this.timeoutHandle = noTimeout;
  32103. this.context = null;
  32104. this.pendingContext = null;
  32105. this.hydrate = hydrate;
  32106. this.callbackNode = null;
  32107. this.callbackPriority = NoPriority;
  32108. this.firstPendingTime = NoWork;
  32109. this.firstSuspendedTime = NoWork;
  32110. this.lastSuspendedTime = NoWork;
  32111. this.nextKnownPendingLevel = NoWork;
  32112. this.lastPingedTime = NoWork;
  32113. this.lastExpiredTime = NoWork;
  32114. {
  32115. this.interactionThreadID = tracing.unstable_getThreadID();
  32116. this.memoizedInteractions = new Set();
  32117. this.pendingInteractionMap = new Map();
  32118. }
  32119. }
  32120. function createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) {
  32121. var root = new FiberRootNode(containerInfo, tag, hydrate);
  32122. // stateNode is any.
  32123. var uninitializedFiber = createHostRootFiber(tag);
  32124. root.current = uninitializedFiber;
  32125. uninitializedFiber.stateNode = root;
  32126. initializeUpdateQueue(uninitializedFiber);
  32127. return root;
  32128. }
  32129. function isRootSuspendedAtTime(root, expirationTime) {
  32130. var firstSuspendedTime = root.firstSuspendedTime;
  32131. var lastSuspendedTime = root.lastSuspendedTime;
  32132. return firstSuspendedTime !== NoWork && firstSuspendedTime >= expirationTime && lastSuspendedTime <= expirationTime;
  32133. }
  32134. function markRootSuspendedAtTime(root, expirationTime) {
  32135. var firstSuspendedTime = root.firstSuspendedTime;
  32136. var lastSuspendedTime = root.lastSuspendedTime;
  32137. if (firstSuspendedTime < expirationTime) {
  32138. root.firstSuspendedTime = expirationTime;
  32139. }
  32140. if (lastSuspendedTime > expirationTime || firstSuspendedTime === NoWork) {
  32141. root.lastSuspendedTime = expirationTime;
  32142. }
  32143. if (expirationTime <= root.lastPingedTime) {
  32144. root.lastPingedTime = NoWork;
  32145. }
  32146. if (expirationTime <= root.lastExpiredTime) {
  32147. root.lastExpiredTime = NoWork;
  32148. }
  32149. }
  32150. function markRootUpdatedAtTime(root, expirationTime) {
  32151. // Update the range of pending times
  32152. var firstPendingTime = root.firstPendingTime;
  32153. if (expirationTime > firstPendingTime) {
  32154. root.firstPendingTime = expirationTime;
  32155. } // Update the range of suspended times. Treat everything lower priority or
  32156. // equal to this update as unsuspended.
  32157. var firstSuspendedTime = root.firstSuspendedTime;
  32158. if (firstSuspendedTime !== NoWork) {
  32159. if (expirationTime >= firstSuspendedTime) {
  32160. // The entire suspended range is now unsuspended.
  32161. root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;
  32162. } else if (expirationTime >= root.lastSuspendedTime) {
  32163. root.lastSuspendedTime = expirationTime + 1;
  32164. } // This is a pending level. Check if it's higher priority than the next
  32165. // known pending level.
  32166. if (expirationTime > root.nextKnownPendingLevel) {
  32167. root.nextKnownPendingLevel = expirationTime;
  32168. }
  32169. }
  32170. }
  32171. function markRootFinishedAtTime(root, finishedExpirationTime, remainingExpirationTime) {
  32172. // Update the range of pending times
  32173. root.firstPendingTime = remainingExpirationTime; // Update the range of suspended times. Treat everything higher priority or
  32174. // equal to this update as unsuspended.
  32175. if (finishedExpirationTime <= root.lastSuspendedTime) {
  32176. // The entire suspended range is now unsuspended.
  32177. root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;
  32178. } else if (finishedExpirationTime <= root.firstSuspendedTime) {
  32179. // Part of the suspended range is now unsuspended. Narrow the range to
  32180. // include everything between the unsuspended time (non-inclusive) and the
  32181. // last suspended time.
  32182. root.firstSuspendedTime = finishedExpirationTime - 1;
  32183. }
  32184. if (finishedExpirationTime <= root.lastPingedTime) {
  32185. // Clear the pinged time
  32186. root.lastPingedTime = NoWork;
  32187. }
  32188. if (finishedExpirationTime <= root.lastExpiredTime) {
  32189. // Clear the expired time
  32190. root.lastExpiredTime = NoWork;
  32191. }
  32192. }
  32193. function markRootExpiredAtTime(root, expirationTime) {
  32194. var lastExpiredTime = root.lastExpiredTime;
  32195. if (lastExpiredTime === NoWork || lastExpiredTime > expirationTime) {
  32196. root.lastExpiredTime = expirationTime;
  32197. }
  32198. }
  32199. var didWarnAboutNestedUpdates;
  32200. var didWarnAboutFindNodeInStrictMode;
  32201. {
  32202. didWarnAboutNestedUpdates = false;
  32203. didWarnAboutFindNodeInStrictMode = {};
  32204. }
  32205. function getContextForSubtree(parentComponent) {
  32206. if (!parentComponent) {
  32207. return emptyContextObject;
  32208. }
  32209. var fiber = get(parentComponent);
  32210. var parentContext = findCurrentUnmaskedContext(fiber);
  32211. if (fiber.tag === ClassComponent) {
  32212. var Component = fiber.type;
  32213. if (isContextProvider(Component)) {
  32214. return processChildContext(fiber, Component, parentContext);
  32215. }
  32216. }
  32217. return parentContext;
  32218. }
  32219. function findHostInstanceWithWarning(component, methodName) {
  32220. {
  32221. var fiber = get(component);
  32222. if (fiber === undefined) {
  32223. if (typeof component.render === 'function') {
  32224. {
  32225. {
  32226. throw Error( "Unable to find node on an unmounted component." );
  32227. }
  32228. }
  32229. } else {
  32230. {
  32231. {
  32232. throw Error( "Argument appears to not be a ReactComponent. Keys: " + Object.keys(component) );
  32233. }
  32234. }
  32235. }
  32236. }
  32237. var hostFiber = findCurrentHostFiber(fiber);
  32238. if (hostFiber === null) {
  32239. return null;
  32240. }
  32241. if (hostFiber.mode & StrictMode) {
  32242. var componentName = getComponentName(fiber.type) || 'Component';
  32243. if (!didWarnAboutFindNodeInStrictMode[componentName]) {
  32244. didWarnAboutFindNodeInStrictMode[componentName] = true;
  32245. if (fiber.mode & StrictMode) {
  32246. error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
  32247. } else {
  32248. error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
  32249. }
  32250. }
  32251. }
  32252. return hostFiber.stateNode;
  32253. }
  32254. }
  32255. function createContainer(containerInfo, tag, hydrate, hydrationCallbacks) {
  32256. return createFiberRoot(containerInfo, tag, hydrate);
  32257. }
  32258. function updateContainer(element, container, parentComponent, callback) {
  32259. {
  32260. onScheduleRoot(container, element);
  32261. }
  32262. var current$1 = container.current;
  32263. var currentTime = requestCurrentTimeForUpdate();
  32264. {
  32265. // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
  32266. if ('undefined' !== typeof jest) {
  32267. warnIfUnmockedScheduler(current$1);
  32268. warnIfNotScopedWithMatchingAct(current$1);
  32269. }
  32270. }
  32271. var suspenseConfig = requestCurrentSuspenseConfig();
  32272. var expirationTime = computeExpirationForFiber(currentTime, current$1, suspenseConfig);
  32273. var context = getContextForSubtree(parentComponent);
  32274. if (container.context === null) {
  32275. container.context = context;
  32276. } else {
  32277. container.pendingContext = context;
  32278. }
  32279. {
  32280. if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
  32281. didWarnAboutNestedUpdates = true;
  32282. error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
  32283. }
  32284. }
  32285. var update = createUpdate(expirationTime, suspenseConfig); // Caution: React DevTools currently depends on this property
  32286. // being called "element".
  32287. update.payload = {
  32288. element: element
  32289. };
  32290. callback = callback === undefined ? null : callback;
  32291. if (callback !== null) {
  32292. {
  32293. if (typeof callback !== 'function') {
  32294. error('render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);
  32295. }
  32296. }
  32297. update.callback = callback;
  32298. }
  32299. enqueueUpdate(current$1, update);
  32300. scheduleWork(current$1, expirationTime);
  32301. return expirationTime;
  32302. }
  32303. function getPublicRootInstance(container) {
  32304. var containerFiber = container.current;
  32305. if (!containerFiber.child) {
  32306. return null;
  32307. }
  32308. switch (containerFiber.child.tag) {
  32309. case HostComponent:
  32310. return getPublicInstance(containerFiber.child.stateNode);
  32311. default:
  32312. return containerFiber.child.stateNode;
  32313. }
  32314. }
  32315. function markRetryTimeImpl(fiber, retryTime) {
  32316. var suspenseState = fiber.memoizedState;
  32317. if (suspenseState !== null && suspenseState.dehydrated !== null) {
  32318. if (suspenseState.retryTime < retryTime) {
  32319. suspenseState.retryTime = retryTime;
  32320. }
  32321. }
  32322. } // Increases the priority of thennables when they resolve within this boundary.
  32323. function markRetryTimeIfNotHydrated(fiber, retryTime) {
  32324. markRetryTimeImpl(fiber, retryTime);
  32325. var alternate = fiber.alternate;
  32326. if (alternate) {
  32327. markRetryTimeImpl(alternate, retryTime);
  32328. }
  32329. }
  32330. function attemptUserBlockingHydration$1(fiber) {
  32331. if (fiber.tag !== SuspenseComponent) {
  32332. // We ignore HostRoots here because we can't increase
  32333. // their priority and they should not suspend on I/O,
  32334. // since you have to wrap anything that might suspend in
  32335. // Suspense.
  32336. return;
  32337. }
  32338. var expTime = computeInteractiveExpiration(requestCurrentTimeForUpdate());
  32339. scheduleWork(fiber, expTime);
  32340. markRetryTimeIfNotHydrated(fiber, expTime);
  32341. }
  32342. function attemptContinuousHydration$1(fiber) {
  32343. if (fiber.tag !== SuspenseComponent) {
  32344. // We ignore HostRoots here because we can't increase
  32345. // their priority and they should not suspend on I/O,
  32346. // since you have to wrap anything that might suspend in
  32347. // Suspense.
  32348. return;
  32349. }
  32350. scheduleWork(fiber, ContinuousHydration);
  32351. markRetryTimeIfNotHydrated(fiber, ContinuousHydration);
  32352. }
  32353. function attemptHydrationAtCurrentPriority$1(fiber) {
  32354. if (fiber.tag !== SuspenseComponent) {
  32355. // We ignore HostRoots here because we can't increase
  32356. // their priority other than synchronously flush it.
  32357. return;
  32358. }
  32359. var currentTime = requestCurrentTimeForUpdate();
  32360. var expTime = computeExpirationForFiber(currentTime, fiber, null);
  32361. scheduleWork(fiber, expTime);
  32362. markRetryTimeIfNotHydrated(fiber, expTime);
  32363. }
  32364. function findHostInstanceWithNoPortals(fiber) {
  32365. var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
  32366. if (hostFiber === null) {
  32367. return null;
  32368. }
  32369. if (hostFiber.tag === FundamentalComponent) {
  32370. return hostFiber.stateNode.instance;
  32371. }
  32372. return hostFiber.stateNode;
  32373. }
  32374. var shouldSuspendImpl = function (fiber) {
  32375. return false;
  32376. };
  32377. function shouldSuspend(fiber) {
  32378. return shouldSuspendImpl(fiber);
  32379. }
  32380. var overrideHookState = null;
  32381. var overrideProps = null;
  32382. var scheduleUpdate = null;
  32383. var setSuspenseHandler = null;
  32384. {
  32385. var copyWithSetImpl = function (obj, path, idx, value) {
  32386. if (idx >= path.length) {
  32387. return value;
  32388. }
  32389. var key = path[idx];
  32390. var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); // $FlowFixMe number or string is fine here
  32391. updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);
  32392. return updated;
  32393. };
  32394. var copyWithSet = function (obj, path, value) {
  32395. return copyWithSetImpl(obj, path, 0, value);
  32396. }; // Support DevTools editable values for useState and useReducer.
  32397. overrideHookState = function (fiber, id, path, value) {
  32398. // For now, the "id" of stateful hooks is just the stateful hook index.
  32399. // This may change in the future with e.g. nested hooks.
  32400. var currentHook = fiber.memoizedState;
  32401. while (currentHook !== null && id > 0) {
  32402. currentHook = currentHook.next;
  32403. id--;
  32404. }
  32405. if (currentHook !== null) {
  32406. var newState = copyWithSet(currentHook.memoizedState, path, value);
  32407. currentHook.memoizedState = newState;
  32408. currentHook.baseState = newState; // We aren't actually adding an update to the queue,
  32409. // because there is no update we can add for useReducer hooks that won't trigger an error.
  32410. // (There's no appropriate action type for DevTools overrides.)
  32411. // As a result though, React will see the scheduled update as a noop and bailout.
  32412. // Shallow cloning props works as a workaround for now to bypass the bailout check.
  32413. fiber.memoizedProps = _assign({}, fiber.memoizedProps);
  32414. scheduleWork(fiber, Sync);
  32415. }
  32416. }; // Support DevTools props for function components, forwardRef, memo, host components, etc.
  32417. overrideProps = function (fiber, path, value) {
  32418. fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
  32419. if (fiber.alternate) {
  32420. fiber.alternate.pendingProps = fiber.pendingProps;
  32421. }
  32422. scheduleWork(fiber, Sync);
  32423. };
  32424. scheduleUpdate = function (fiber) {
  32425. scheduleWork(fiber, Sync);
  32426. };
  32427. setSuspenseHandler = function (newShouldSuspendImpl) {
  32428. shouldSuspendImpl = newShouldSuspendImpl;
  32429. };
  32430. }
  32431. function injectIntoDevTools(devToolsConfig) {
  32432. var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
  32433. var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
  32434. return injectInternals(_assign({}, devToolsConfig, {
  32435. overrideHookState: overrideHookState,
  32436. overrideProps: overrideProps,
  32437. setSuspenseHandler: setSuspenseHandler,
  32438. scheduleUpdate: scheduleUpdate,
  32439. currentDispatcherRef: ReactCurrentDispatcher,
  32440. findHostInstanceByFiber: function (fiber) {
  32441. var hostFiber = findCurrentHostFiber(fiber);
  32442. if (hostFiber === null) {
  32443. return null;
  32444. }
  32445. return hostFiber.stateNode;
  32446. },
  32447. findFiberByHostInstance: function (instance) {
  32448. if (!findFiberByHostInstance) {
  32449. // Might not be implemented by the renderer.
  32450. return null;
  32451. }
  32452. return findFiberByHostInstance(instance);
  32453. },
  32454. // React Refresh
  32455. findHostInstancesForRefresh: findHostInstancesForRefresh ,
  32456. scheduleRefresh: scheduleRefresh ,
  32457. scheduleRoot: scheduleRoot ,
  32458. setRefreshHandler: setRefreshHandler ,
  32459. // Enables DevTools to append owner stacks to error messages in DEV mode.
  32460. getCurrentFiber: function () {
  32461. return current;
  32462. }
  32463. }));
  32464. }
  32465. var IsSomeRendererActing$1 = ReactSharedInternals.IsSomeRendererActing;
  32466. function ReactDOMRoot(container, options) {
  32467. this._internalRoot = createRootImpl(container, ConcurrentRoot, options);
  32468. }
  32469. function ReactDOMBlockingRoot(container, tag, options) {
  32470. this._internalRoot = createRootImpl(container, tag, options);
  32471. }
  32472. ReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function (children) {
  32473. var root = this._internalRoot;
  32474. {
  32475. if (typeof arguments[1] === 'function') {
  32476. error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');
  32477. }
  32478. var container = root.containerInfo;
  32479. if (container.nodeType !== COMMENT_NODE) {
  32480. var hostInstance = findHostInstanceWithNoPortals(root.current);
  32481. if (hostInstance) {
  32482. if (hostInstance.parentNode !== container) {
  32483. error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + "root.unmount() to empty a root's container.");
  32484. }
  32485. }
  32486. }
  32487. }
  32488. updateContainer(children, root, null, null);
  32489. };
  32490. ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function () {
  32491. {
  32492. if (typeof arguments[0] === 'function') {
  32493. error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');
  32494. }
  32495. }
  32496. var root = this._internalRoot;
  32497. var container = root.containerInfo;
  32498. updateContainer(null, root, null, function () {
  32499. unmarkContainerAsRoot(container);
  32500. });
  32501. };
  32502. function createRootImpl(container, tag, options) {
  32503. // Tag is either LegacyRoot or Concurrent Root
  32504. var hydrate = options != null && options.hydrate === true;
  32505. var hydrationCallbacks = options != null && options.hydrationOptions || null;
  32506. var root = createContainer(container, tag, hydrate);
  32507. markContainerAsRoot(root.current, container);
  32508. if (hydrate && tag !== LegacyRoot) {
  32509. var doc = container.nodeType === DOCUMENT_NODE ? container : container.ownerDocument;
  32510. eagerlyTrapReplayableEvents(container, doc);
  32511. }
  32512. return root;
  32513. }
  32514. function createLegacyRoot(container, options) {
  32515. return new ReactDOMBlockingRoot(container, LegacyRoot, options);
  32516. }
  32517. function isValidContainer(node) {
  32518. return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));
  32519. }
  32520. var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
  32521. var topLevelUpdateWarnings;
  32522. var warnedAboutHydrateAPI = false;
  32523. {
  32524. topLevelUpdateWarnings = function (container) {
  32525. if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
  32526. var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);
  32527. if (hostInstance) {
  32528. if (hostInstance.parentNode !== container) {
  32529. error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');
  32530. }
  32531. }
  32532. }
  32533. var isRootRenderedBySomeReact = !!container._reactRootContainer;
  32534. var rootEl = getReactRootElementInContainer(container);
  32535. var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));
  32536. if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
  32537. error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');
  32538. }
  32539. if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {
  32540. error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');
  32541. }
  32542. };
  32543. }
  32544. function getReactRootElementInContainer(container) {
  32545. if (!container) {
  32546. return null;
  32547. }
  32548. if (container.nodeType === DOCUMENT_NODE) {
  32549. return container.documentElement;
  32550. } else {
  32551. return container.firstChild;
  32552. }
  32553. }
  32554. function shouldHydrateDueToLegacyHeuristic(container) {
  32555. var rootElement = getReactRootElementInContainer(container);
  32556. return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
  32557. }
  32558. function legacyCreateRootFromDOMContainer(container, forceHydrate) {
  32559. var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); // First clear any existing content.
  32560. if (!shouldHydrate) {
  32561. var warned = false;
  32562. var rootSibling;
  32563. while (rootSibling = container.lastChild) {
  32564. {
  32565. if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
  32566. warned = true;
  32567. error('render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');
  32568. }
  32569. }
  32570. container.removeChild(rootSibling);
  32571. }
  32572. }
  32573. {
  32574. if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
  32575. warnedAboutHydrateAPI = true;
  32576. warn('render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');
  32577. }
  32578. }
  32579. return createLegacyRoot(container, shouldHydrate ? {
  32580. hydrate: true
  32581. } : undefined);
  32582. }
  32583. function warnOnInvalidCallback$1(callback, callerName) {
  32584. {
  32585. if (callback !== null && typeof callback !== 'function') {
  32586. error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
  32587. }
  32588. }
  32589. }
  32590. function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
  32591. {
  32592. topLevelUpdateWarnings(container);
  32593. warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render');
  32594. } // TODO: Without `any` type, Flow says "Property cannot be accessed on any
  32595. // member of intersection type." Whyyyyyy.
  32596. var root = container._reactRootContainer;
  32597. var fiberRoot;
  32598. if (!root) {
  32599. // Initial mount
  32600. root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
  32601. fiberRoot = root._internalRoot;
  32602. if (typeof callback === 'function') {
  32603. var originalCallback = callback;
  32604. callback = function () {
  32605. var instance = getPublicRootInstance(fiberRoot);
  32606. originalCallback.call(instance);
  32607. };
  32608. } // Initial mount should not be batched.
  32609. unbatchedUpdates(function () {
  32610. updateContainer(children, fiberRoot, parentComponent, callback);
  32611. });
  32612. } else {
  32613. fiberRoot = root._internalRoot;
  32614. if (typeof callback === 'function') {
  32615. var _originalCallback = callback;
  32616. callback = function () {
  32617. var instance = getPublicRootInstance(fiberRoot);
  32618. _originalCallback.call(instance);
  32619. };
  32620. } // Update
  32621. updateContainer(children, fiberRoot, parentComponent, callback);
  32622. }
  32623. return getPublicRootInstance(fiberRoot);
  32624. }
  32625. function findDOMNode(componentOrElement) {
  32626. {
  32627. var owner = ReactCurrentOwner$3.current;
  32628. if (owner !== null && owner.stateNode !== null) {
  32629. var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
  32630. if (!warnedAboutRefsInRender) {
  32631. error('%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component');
  32632. }
  32633. owner.stateNode._warnedAboutRefsInRender = true;
  32634. }
  32635. }
  32636. if (componentOrElement == null) {
  32637. return null;
  32638. }
  32639. if (componentOrElement.nodeType === ELEMENT_NODE) {
  32640. return componentOrElement;
  32641. }
  32642. {
  32643. return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');
  32644. }
  32645. }
  32646. function hydrate(element, container, callback) {
  32647. if (!isValidContainer(container)) {
  32648. {
  32649. throw Error( "Target container is not a DOM element." );
  32650. }
  32651. }
  32652. {
  32653. var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
  32654. if (isModernRoot) {
  32655. error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');
  32656. }
  32657. } // TODO: throw or warn if we couldn't hydrate?
  32658. return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
  32659. }
  32660. function render(element, container, callback) {
  32661. if (!isValidContainer(container)) {
  32662. {
  32663. throw Error( "Target container is not a DOM element." );
  32664. }
  32665. }
  32666. {
  32667. var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
  32668. if (isModernRoot) {
  32669. error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');
  32670. }
  32671. }
  32672. return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
  32673. }
  32674. function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
  32675. if (!isValidContainer(containerNode)) {
  32676. {
  32677. throw Error( "Target container is not a DOM element." );
  32678. }
  32679. }
  32680. if (!(parentComponent != null && has(parentComponent))) {
  32681. {
  32682. throw Error( "parentComponent must be a valid React Component" );
  32683. }
  32684. }
  32685. return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
  32686. }
  32687. function unmountComponentAtNode(container) {
  32688. if (!isValidContainer(container)) {
  32689. {
  32690. throw Error( "unmountComponentAtNode(...): Target container is not a DOM element." );
  32691. }
  32692. }
  32693. {
  32694. var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
  32695. if (isModernRoot) {
  32696. error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?');
  32697. }
  32698. }
  32699. if (container._reactRootContainer) {
  32700. {
  32701. var rootEl = getReactRootElementInContainer(container);
  32702. var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);
  32703. if (renderedByDifferentReact) {
  32704. error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.');
  32705. }
  32706. } // Unmount should not be batched.
  32707. unbatchedUpdates(function () {
  32708. legacyRenderSubtreeIntoContainer(null, null, container, false, function () {
  32709. // $FlowFixMe This should probably use `delete container._reactRootContainer`
  32710. container._reactRootContainer = null;
  32711. unmarkContainerAsRoot(container);
  32712. });
  32713. }); // If you call unmountComponentAtNode twice in quick succession, you'll
  32714. // get `true` twice. That's probably fine?
  32715. return true;
  32716. } else {
  32717. {
  32718. var _rootEl = getReactRootElementInContainer(container);
  32719. var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl)); // Check if the container itself is a React root node.
  32720. var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;
  32721. if (hasNonRootReactChild) {
  32722. error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');
  32723. }
  32724. }
  32725. return false;
  32726. }
  32727. }
  32728. function createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
  32729. implementation) {
  32730. var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  32731. return {
  32732. // This tag allow us to uniquely identify this as a React Portal
  32733. $$typeof: REACT_PORTAL_TYPE,
  32734. key: key == null ? null : '' + key,
  32735. children: children,
  32736. containerInfo: containerInfo,
  32737. implementation: implementation
  32738. };
  32739. }
  32740. var ReactVersion = '16.13.1';
  32741. setAttemptUserBlockingHydration(attemptUserBlockingHydration$1);
  32742. setAttemptContinuousHydration(attemptContinuousHydration$1);
  32743. setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
  32744. var didWarnAboutUnstableCreatePortal = false;
  32745. {
  32746. if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype
  32747. Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype
  32748. Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {
  32749. error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
  32750. }
  32751. }
  32752. setRestoreImplementation(restoreControlledState$3);
  32753. setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);
  32754. function createPortal$1(children, container) {
  32755. var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  32756. if (!isValidContainer(container)) {
  32757. {
  32758. throw Error( "Target container is not a DOM element." );
  32759. }
  32760. } // TODO: pass ReactDOM portal implementation as third argument
  32761. // $FlowFixMe The Flow type is opaque but there's no way to actually create it.
  32762. return createPortal(children, container, null, key);
  32763. }
  32764. function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
  32765. return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
  32766. }
  32767. function unstable_createPortal(children, container) {
  32768. var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  32769. {
  32770. if (!didWarnAboutUnstableCreatePortal) {
  32771. didWarnAboutUnstableCreatePortal = true;
  32772. warn('The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.');
  32773. }
  32774. }
  32775. return createPortal$1(children, container, key);
  32776. }
  32777. var Internals = {
  32778. // Keep in sync with ReactDOMUnstableNativeDependencies.js
  32779. // ReactTestUtils.js, and ReactTestUtilsAct.js. This is an array for better minification.
  32780. Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch, flushPassiveEffects, IsThisRendererActing]
  32781. };
  32782. var foundDevTools = injectIntoDevTools({
  32783. findFiberByHostInstance: getClosestInstanceFromNode,
  32784. bundleType: 1 ,
  32785. version: ReactVersion,
  32786. rendererPackageName: 'react-dom'
  32787. });
  32788. {
  32789. if (!foundDevTools && canUseDOM && window.top === window.self) {
  32790. // If we're in Chrome or Firefox, provide a download link if not installed.
  32791. if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
  32792. var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://.
  32793. if (/^(https?|file):$/.test(protocol)) {
  32794. // eslint-disable-next-line react-internal/no-production-logging
  32795. console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');
  32796. }
  32797. }
  32798. }
  32799. }
  32800. exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
  32801. exports.createPortal = createPortal$1;
  32802. exports.findDOMNode = findDOMNode;
  32803. exports.flushSync = flushSync;
  32804. exports.hydrate = hydrate;
  32805. exports.render = render;
  32806. exports.unmountComponentAtNode = unmountComponentAtNode;
  32807. exports.unstable_batchedUpdates = batchedUpdates$1;
  32808. exports.unstable_createPortal = unstable_createPortal;
  32809. exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
  32810. exports.version = ReactVersion;
  32811. })();
  32812. }
  32813. /***/ }),
  32814. /***/ "../../node_modules/react-dom/index.js":
  32815. /*!***********************************************************!*\
  32816. !*** C:/Repos/Babylon.js/node_modules/react-dom/index.js ***!
  32817. \***********************************************************/
  32818. /*! no static exports found */
  32819. /***/ (function(module, exports, __webpack_require__) {
  32820. "use strict";
  32821. function checkDCE() {
  32822. /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
  32823. if (
  32824. typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
  32825. typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
  32826. ) {
  32827. return;
  32828. }
  32829. if (true) {
  32830. // This branch is unreachable because this function is only called
  32831. // in production, but the condition is true only in development.
  32832. // Therefore if the branch is still here, dead code elimination wasn't
  32833. // properly applied.
  32834. // Don't change the message. React DevTools relies on it. Also make sure
  32835. // this message doesn't occur elsewhere in this function, or it will cause
  32836. // a false positive.
  32837. throw new Error('^_^');
  32838. }
  32839. try {
  32840. // Verify that the code above has been dead code eliminated (DCE'd).
  32841. __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  32842. } catch (err) {
  32843. // DevTools shouldn't crash React, no matter what.
  32844. // We should still report in case we break this code.
  32845. console.error(err);
  32846. }
  32847. }
  32848. if (false) {} else {
  32849. module.exports = __webpack_require__(/*! ./cjs/react-dom.development.js */ "../../node_modules/react-dom/cjs/react-dom.development.js");
  32850. }
  32851. /***/ }),
  32852. /***/ "../../node_modules/react/cjs/react.development.js":
  32853. /*!***********************************************************************!*\
  32854. !*** C:/Repos/Babylon.js/node_modules/react/cjs/react.development.js ***!
  32855. \***********************************************************************/
  32856. /*! no static exports found */
  32857. /***/ (function(module, exports, __webpack_require__) {
  32858. "use strict";
  32859. /** @license React v16.13.1
  32860. * react.development.js
  32861. *
  32862. * Copyright (c) Facebook, Inc. and its affiliates.
  32863. *
  32864. * This source code is licensed under the MIT license found in the
  32865. * LICENSE file in the root directory of this source tree.
  32866. */
  32867. if (true) {
  32868. (function() {
  32869. 'use strict';
  32870. var _assign = __webpack_require__(/*! object-assign */ "../../node_modules/object-assign/index.js");
  32871. var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "../../node_modules/prop-types/checkPropTypes.js");
  32872. var ReactVersion = '16.13.1';
  32873. // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  32874. // nor polyfill, then a plain number is used for performance.
  32875. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  32876. var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
  32877. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  32878. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  32879. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  32880. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  32881. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  32882. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
  32883. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  32884. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  32885. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  32886. var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
  32887. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  32888. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  32889. var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
  32890. var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
  32891. var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
  32892. var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
  32893. var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  32894. var FAUX_ITERATOR_SYMBOL = '@@iterator';
  32895. function getIteratorFn(maybeIterable) {
  32896. if (maybeIterable === null || typeof maybeIterable !== 'object') {
  32897. return null;
  32898. }
  32899. var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
  32900. if (typeof maybeIterator === 'function') {
  32901. return maybeIterator;
  32902. }
  32903. return null;
  32904. }
  32905. /**
  32906. * Keeps track of the current dispatcher.
  32907. */
  32908. var ReactCurrentDispatcher = {
  32909. /**
  32910. * @internal
  32911. * @type {ReactComponent}
  32912. */
  32913. current: null
  32914. };
  32915. /**
  32916. * Keeps track of the current batch's configuration such as how long an update
  32917. * should suspend for if it needs to.
  32918. */
  32919. var ReactCurrentBatchConfig = {
  32920. suspense: null
  32921. };
  32922. /**
  32923. * Keeps track of the current owner.
  32924. *
  32925. * The current owner is the component who should own any components that are
  32926. * currently being constructed.
  32927. */
  32928. var ReactCurrentOwner = {
  32929. /**
  32930. * @internal
  32931. * @type {ReactComponent}
  32932. */
  32933. current: null
  32934. };
  32935. var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
  32936. function describeComponentFrame (name, source, ownerName) {
  32937. var sourceInfo = '';
  32938. if (source) {
  32939. var path = source.fileName;
  32940. var fileName = path.replace(BEFORE_SLASH_RE, '');
  32941. {
  32942. // In DEV, include code for a common special case:
  32943. // prefer "folder/index.js" instead of just "index.js".
  32944. if (/^index\./.test(fileName)) {
  32945. var match = path.match(BEFORE_SLASH_RE);
  32946. if (match) {
  32947. var pathBeforeSlash = match[1];
  32948. if (pathBeforeSlash) {
  32949. var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
  32950. fileName = folderName + '/' + fileName;
  32951. }
  32952. }
  32953. }
  32954. }
  32955. sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
  32956. } else if (ownerName) {
  32957. sourceInfo = ' (created by ' + ownerName + ')';
  32958. }
  32959. return '\n in ' + (name || 'Unknown') + sourceInfo;
  32960. }
  32961. var Resolved = 1;
  32962. function refineResolvedLazyComponent(lazyComponent) {
  32963. return lazyComponent._status === Resolved ? lazyComponent._result : null;
  32964. }
  32965. function getWrappedName(outerType, innerType, wrapperName) {
  32966. var functionName = innerType.displayName || innerType.name || '';
  32967. return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
  32968. }
  32969. function getComponentName(type) {
  32970. if (type == null) {
  32971. // Host root, text node or just invalid type.
  32972. return null;
  32973. }
  32974. {
  32975. if (typeof type.tag === 'number') {
  32976. error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
  32977. }
  32978. }
  32979. if (typeof type === 'function') {
  32980. return type.displayName || type.name || null;
  32981. }
  32982. if (typeof type === 'string') {
  32983. return type;
  32984. }
  32985. switch (type) {
  32986. case REACT_FRAGMENT_TYPE:
  32987. return 'Fragment';
  32988. case REACT_PORTAL_TYPE:
  32989. return 'Portal';
  32990. case REACT_PROFILER_TYPE:
  32991. return "Profiler";
  32992. case REACT_STRICT_MODE_TYPE:
  32993. return 'StrictMode';
  32994. case REACT_SUSPENSE_TYPE:
  32995. return 'Suspense';
  32996. case REACT_SUSPENSE_LIST_TYPE:
  32997. return 'SuspenseList';
  32998. }
  32999. if (typeof type === 'object') {
  33000. switch (type.$$typeof) {
  33001. case REACT_CONTEXT_TYPE:
  33002. return 'Context.Consumer';
  33003. case REACT_PROVIDER_TYPE:
  33004. return 'Context.Provider';
  33005. case REACT_FORWARD_REF_TYPE:
  33006. return getWrappedName(type, type.render, 'ForwardRef');
  33007. case REACT_MEMO_TYPE:
  33008. return getComponentName(type.type);
  33009. case REACT_BLOCK_TYPE:
  33010. return getComponentName(type.render);
  33011. case REACT_LAZY_TYPE:
  33012. {
  33013. var thenable = type;
  33014. var resolvedThenable = refineResolvedLazyComponent(thenable);
  33015. if (resolvedThenable) {
  33016. return getComponentName(resolvedThenable);
  33017. }
  33018. break;
  33019. }
  33020. }
  33021. }
  33022. return null;
  33023. }
  33024. var ReactDebugCurrentFrame = {};
  33025. var currentlyValidatingElement = null;
  33026. function setCurrentlyValidatingElement(element) {
  33027. {
  33028. currentlyValidatingElement = element;
  33029. }
  33030. }
  33031. {
  33032. // Stack implementation injected by the current renderer.
  33033. ReactDebugCurrentFrame.getCurrentStack = null;
  33034. ReactDebugCurrentFrame.getStackAddendum = function () {
  33035. var stack = ''; // Add an extra top frame while an element is being validated
  33036. if (currentlyValidatingElement) {
  33037. var name = getComponentName(currentlyValidatingElement.type);
  33038. var owner = currentlyValidatingElement._owner;
  33039. stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
  33040. } // Delegate to the injected renderer-specific implementation
  33041. var impl = ReactDebugCurrentFrame.getCurrentStack;
  33042. if (impl) {
  33043. stack += impl() || '';
  33044. }
  33045. return stack;
  33046. };
  33047. }
  33048. /**
  33049. * Used by act() to track whether you're inside an act() scope.
  33050. */
  33051. var IsSomeRendererActing = {
  33052. current: false
  33053. };
  33054. var ReactSharedInternals = {
  33055. ReactCurrentDispatcher: ReactCurrentDispatcher,
  33056. ReactCurrentBatchConfig: ReactCurrentBatchConfig,
  33057. ReactCurrentOwner: ReactCurrentOwner,
  33058. IsSomeRendererActing: IsSomeRendererActing,
  33059. // Used by renderers to avoid bundling object-assign twice in UMD bundles:
  33060. assign: _assign
  33061. };
  33062. {
  33063. _assign(ReactSharedInternals, {
  33064. // These should not be included in production.
  33065. ReactDebugCurrentFrame: ReactDebugCurrentFrame,
  33066. // Shim for React DOM 16.0.0 which still destructured (but not used) this.
  33067. // TODO: remove in React 17.0.
  33068. ReactComponentTreeHook: {}
  33069. });
  33070. }
  33071. // by calls to these methods by a Babel plugin.
  33072. //
  33073. // In PROD (or in packages without access to React internals),
  33074. // they are left as they are instead.
  33075. function warn(format) {
  33076. {
  33077. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  33078. args[_key - 1] = arguments[_key];
  33079. }
  33080. printWarning('warn', format, args);
  33081. }
  33082. }
  33083. function error(format) {
  33084. {
  33085. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  33086. args[_key2 - 1] = arguments[_key2];
  33087. }
  33088. printWarning('error', format, args);
  33089. }
  33090. }
  33091. function printWarning(level, format, args) {
  33092. // When changing this logic, you might want to also
  33093. // update consoleWithStackDev.www.js as well.
  33094. {
  33095. var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0;
  33096. if (!hasExistingStack) {
  33097. var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
  33098. var stack = ReactDebugCurrentFrame.getStackAddendum();
  33099. if (stack !== '') {
  33100. format += '%s';
  33101. args = args.concat([stack]);
  33102. }
  33103. }
  33104. var argsWithFormat = args.map(function (item) {
  33105. return '' + item;
  33106. }); // Careful: RN currently depends on this prefix
  33107. argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
  33108. // breaks IE9: https://github.com/facebook/react/issues/13610
  33109. // eslint-disable-next-line react-internal/no-production-logging
  33110. Function.prototype.apply.call(console[level], console, argsWithFormat);
  33111. try {
  33112. // --- Welcome to debugging React ---
  33113. // This error was thrown as a convenience so that you can use this stack
  33114. // to find the callsite that caused this warning to fire.
  33115. var argIndex = 0;
  33116. var message = 'Warning: ' + format.replace(/%s/g, function () {
  33117. return args[argIndex++];
  33118. });
  33119. throw new Error(message);
  33120. } catch (x) {}
  33121. }
  33122. }
  33123. var didWarnStateUpdateForUnmountedComponent = {};
  33124. function warnNoop(publicInstance, callerName) {
  33125. {
  33126. var _constructor = publicInstance.constructor;
  33127. var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
  33128. var warningKey = componentName + "." + callerName;
  33129. if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
  33130. return;
  33131. }
  33132. error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
  33133. didWarnStateUpdateForUnmountedComponent[warningKey] = true;
  33134. }
  33135. }
  33136. /**
  33137. * This is the abstract API for an update queue.
  33138. */
  33139. var ReactNoopUpdateQueue = {
  33140. /**
  33141. * Checks whether or not this composite component is mounted.
  33142. * @param {ReactClass} publicInstance The instance we want to test.
  33143. * @return {boolean} True if mounted, false otherwise.
  33144. * @protected
  33145. * @final
  33146. */
  33147. isMounted: function (publicInstance) {
  33148. return false;
  33149. },
  33150. /**
  33151. * Forces an update. This should only be invoked when it is known with
  33152. * certainty that we are **not** in a DOM transaction.
  33153. *
  33154. * You may want to call this when you know that some deeper aspect of the
  33155. * component's state has changed but `setState` was not called.
  33156. *
  33157. * This will not invoke `shouldComponentUpdate`, but it will invoke
  33158. * `componentWillUpdate` and `componentDidUpdate`.
  33159. *
  33160. * @param {ReactClass} publicInstance The instance that should rerender.
  33161. * @param {?function} callback Called after component is updated.
  33162. * @param {?string} callerName name of the calling function in the public API.
  33163. * @internal
  33164. */
  33165. enqueueForceUpdate: function (publicInstance, callback, callerName) {
  33166. warnNoop(publicInstance, 'forceUpdate');
  33167. },
  33168. /**
  33169. * Replaces all of the state. Always use this or `setState` to mutate state.
  33170. * You should treat `this.state` as immutable.
  33171. *
  33172. * There is no guarantee that `this.state` will be immediately updated, so
  33173. * accessing `this.state` after calling this method may return the old value.
  33174. *
  33175. * @param {ReactClass} publicInstance The instance that should rerender.
  33176. * @param {object} completeState Next state.
  33177. * @param {?function} callback Called after component is updated.
  33178. * @param {?string} callerName name of the calling function in the public API.
  33179. * @internal
  33180. */
  33181. enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
  33182. warnNoop(publicInstance, 'replaceState');
  33183. },
  33184. /**
  33185. * Sets a subset of the state. This only exists because _pendingState is
  33186. * internal. This provides a merging strategy that is not available to deep
  33187. * properties which is confusing. TODO: Expose pendingState or don't use it
  33188. * during the merge.
  33189. *
  33190. * @param {ReactClass} publicInstance The instance that should rerender.
  33191. * @param {object} partialState Next partial state to be merged with state.
  33192. * @param {?function} callback Called after component is updated.
  33193. * @param {?string} Name of the calling function in the public API.
  33194. * @internal
  33195. */
  33196. enqueueSetState: function (publicInstance, partialState, callback, callerName) {
  33197. warnNoop(publicInstance, 'setState');
  33198. }
  33199. };
  33200. var emptyObject = {};
  33201. {
  33202. Object.freeze(emptyObject);
  33203. }
  33204. /**
  33205. * Base class helpers for the updating state of a component.
  33206. */
  33207. function Component(props, context, updater) {
  33208. this.props = props;
  33209. this.context = context; // If a component has string refs, we will assign a different object later.
  33210. this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
  33211. // renderer.
  33212. this.updater = updater || ReactNoopUpdateQueue;
  33213. }
  33214. Component.prototype.isReactComponent = {};
  33215. /**
  33216. * Sets a subset of the state. Always use this to mutate
  33217. * state. You should treat `this.state` as immutable.
  33218. *
  33219. * There is no guarantee that `this.state` will be immediately updated, so
  33220. * accessing `this.state` after calling this method may return the old value.
  33221. *
  33222. * There is no guarantee that calls to `setState` will run synchronously,
  33223. * as they may eventually be batched together. You can provide an optional
  33224. * callback that will be executed when the call to setState is actually
  33225. * completed.
  33226. *
  33227. * When a function is provided to setState, it will be called at some point in
  33228. * the future (not synchronously). It will be called with the up to date
  33229. * component arguments (state, props, context). These values can be different
  33230. * from this.* because your function may be called after receiveProps but before
  33231. * shouldComponentUpdate, and this new state, props, and context will not yet be
  33232. * assigned to this.
  33233. *
  33234. * @param {object|function} partialState Next partial state or function to
  33235. * produce next partial state to be merged with current state.
  33236. * @param {?function} callback Called after state is updated.
  33237. * @final
  33238. * @protected
  33239. */
  33240. Component.prototype.setState = function (partialState, callback) {
  33241. if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
  33242. {
  33243. throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
  33244. }
  33245. }
  33246. this.updater.enqueueSetState(this, partialState, callback, 'setState');
  33247. };
  33248. /**
  33249. * Forces an update. This should only be invoked when it is known with
  33250. * certainty that we are **not** in a DOM transaction.
  33251. *
  33252. * You may want to call this when you know that some deeper aspect of the
  33253. * component's state has changed but `setState` was not called.
  33254. *
  33255. * This will not invoke `shouldComponentUpdate`, but it will invoke
  33256. * `componentWillUpdate` and `componentDidUpdate`.
  33257. *
  33258. * @param {?function} callback Called after update is complete.
  33259. * @final
  33260. * @protected
  33261. */
  33262. Component.prototype.forceUpdate = function (callback) {
  33263. this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
  33264. };
  33265. /**
  33266. * Deprecated APIs. These APIs used to exist on classic React classes but since
  33267. * we would like to deprecate them, we're not going to move them over to this
  33268. * modern base class. Instead, we define a getter that warns if it's accessed.
  33269. */
  33270. {
  33271. var deprecatedAPIs = {
  33272. isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
  33273. replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
  33274. };
  33275. var defineDeprecationWarning = function (methodName, info) {
  33276. Object.defineProperty(Component.prototype, methodName, {
  33277. get: function () {
  33278. warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
  33279. return undefined;
  33280. }
  33281. });
  33282. };
  33283. for (var fnName in deprecatedAPIs) {
  33284. if (deprecatedAPIs.hasOwnProperty(fnName)) {
  33285. defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
  33286. }
  33287. }
  33288. }
  33289. function ComponentDummy() {}
  33290. ComponentDummy.prototype = Component.prototype;
  33291. /**
  33292. * Convenience component with default shallow equality check for sCU.
  33293. */
  33294. function PureComponent(props, context, updater) {
  33295. this.props = props;
  33296. this.context = context; // If a component has string refs, we will assign a different object later.
  33297. this.refs = emptyObject;
  33298. this.updater = updater || ReactNoopUpdateQueue;
  33299. }
  33300. var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
  33301. pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
  33302. _assign(pureComponentPrototype, Component.prototype);
  33303. pureComponentPrototype.isPureReactComponent = true;
  33304. // an immutable object with a single mutable value
  33305. function createRef() {
  33306. var refObject = {
  33307. current: null
  33308. };
  33309. {
  33310. Object.seal(refObject);
  33311. }
  33312. return refObject;
  33313. }
  33314. var hasOwnProperty = Object.prototype.hasOwnProperty;
  33315. var RESERVED_PROPS = {
  33316. key: true,
  33317. ref: true,
  33318. __self: true,
  33319. __source: true
  33320. };
  33321. var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
  33322. {
  33323. didWarnAboutStringRefs = {};
  33324. }
  33325. function hasValidRef(config) {
  33326. {
  33327. if (hasOwnProperty.call(config, 'ref')) {
  33328. var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
  33329. if (getter && getter.isReactWarning) {
  33330. return false;
  33331. }
  33332. }
  33333. }
  33334. return config.ref !== undefined;
  33335. }
  33336. function hasValidKey(config) {
  33337. {
  33338. if (hasOwnProperty.call(config, 'key')) {
  33339. var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
  33340. if (getter && getter.isReactWarning) {
  33341. return false;
  33342. }
  33343. }
  33344. }
  33345. return config.key !== undefined;
  33346. }
  33347. function defineKeyPropWarningGetter(props, displayName) {
  33348. var warnAboutAccessingKey = function () {
  33349. {
  33350. if (!specialPropKeyWarningShown) {
  33351. specialPropKeyWarningShown = true;
  33352. error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
  33353. }
  33354. }
  33355. };
  33356. warnAboutAccessingKey.isReactWarning = true;
  33357. Object.defineProperty(props, 'key', {
  33358. get: warnAboutAccessingKey,
  33359. configurable: true
  33360. });
  33361. }
  33362. function defineRefPropWarningGetter(props, displayName) {
  33363. var warnAboutAccessingRef = function () {
  33364. {
  33365. if (!specialPropRefWarningShown) {
  33366. specialPropRefWarningShown = true;
  33367. error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
  33368. }
  33369. }
  33370. };
  33371. warnAboutAccessingRef.isReactWarning = true;
  33372. Object.defineProperty(props, 'ref', {
  33373. get: warnAboutAccessingRef,
  33374. configurable: true
  33375. });
  33376. }
  33377. function warnIfStringRefCannotBeAutoConverted(config) {
  33378. {
  33379. if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
  33380. var componentName = getComponentName(ReactCurrentOwner.current.type);
  33381. if (!didWarnAboutStringRefs[componentName]) {
  33382. error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
  33383. didWarnAboutStringRefs[componentName] = true;
  33384. }
  33385. }
  33386. }
  33387. }
  33388. /**
  33389. * Factory method to create a new React element. This no longer adheres to
  33390. * the class pattern, so do not use new to call it. Also, instanceof check
  33391. * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
  33392. * if something is a React Element.
  33393. *
  33394. * @param {*} type
  33395. * @param {*} props
  33396. * @param {*} key
  33397. * @param {string|object} ref
  33398. * @param {*} owner
  33399. * @param {*} self A *temporary* helper to detect places where `this` is
  33400. * different from the `owner` when React.createElement is called, so that we
  33401. * can warn. We want to get rid of owner and replace string `ref`s with arrow
  33402. * functions, and as long as `this` and owner are the same, there will be no
  33403. * change in behavior.
  33404. * @param {*} source An annotation object (added by a transpiler or otherwise)
  33405. * indicating filename, line number, and/or other information.
  33406. * @internal
  33407. */
  33408. var ReactElement = function (type, key, ref, self, source, owner, props) {
  33409. var element = {
  33410. // This tag allows us to uniquely identify this as a React Element
  33411. $$typeof: REACT_ELEMENT_TYPE,
  33412. // Built-in properties that belong on the element
  33413. type: type,
  33414. key: key,
  33415. ref: ref,
  33416. props: props,
  33417. // Record the component responsible for creating this element.
  33418. _owner: owner
  33419. };
  33420. {
  33421. // The validation flag is currently mutative. We put it on
  33422. // an external backing store so that we can freeze the whole object.
  33423. // This can be replaced with a WeakMap once they are implemented in
  33424. // commonly used development environments.
  33425. element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
  33426. // the validation flag non-enumerable (where possible, which should
  33427. // include every environment we run tests in), so the test framework
  33428. // ignores it.
  33429. Object.defineProperty(element._store, 'validated', {
  33430. configurable: false,
  33431. enumerable: false,
  33432. writable: true,
  33433. value: false
  33434. }); // self and source are DEV only properties.
  33435. Object.defineProperty(element, '_self', {
  33436. configurable: false,
  33437. enumerable: false,
  33438. writable: false,
  33439. value: self
  33440. }); // Two elements created in two different places should be considered
  33441. // equal for testing purposes and therefore we hide it from enumeration.
  33442. Object.defineProperty(element, '_source', {
  33443. configurable: false,
  33444. enumerable: false,
  33445. writable: false,
  33446. value: source
  33447. });
  33448. if (Object.freeze) {
  33449. Object.freeze(element.props);
  33450. Object.freeze(element);
  33451. }
  33452. }
  33453. return element;
  33454. };
  33455. /**
  33456. * Create and return a new ReactElement of the given type.
  33457. * See https://reactjs.org/docs/react-api.html#createelement
  33458. */
  33459. function createElement(type, config, children) {
  33460. var propName; // Reserved names are extracted
  33461. var props = {};
  33462. var key = null;
  33463. var ref = null;
  33464. var self = null;
  33465. var source = null;
  33466. if (config != null) {
  33467. if (hasValidRef(config)) {
  33468. ref = config.ref;
  33469. {
  33470. warnIfStringRefCannotBeAutoConverted(config);
  33471. }
  33472. }
  33473. if (hasValidKey(config)) {
  33474. key = '' + config.key;
  33475. }
  33476. self = config.__self === undefined ? null : config.__self;
  33477. source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
  33478. for (propName in config) {
  33479. if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  33480. props[propName] = config[propName];
  33481. }
  33482. }
  33483. } // Children can be more than one argument, and those are transferred onto
  33484. // the newly allocated props object.
  33485. var childrenLength = arguments.length - 2;
  33486. if (childrenLength === 1) {
  33487. props.children = children;
  33488. } else if (childrenLength > 1) {
  33489. var childArray = Array(childrenLength);
  33490. for (var i = 0; i < childrenLength; i++) {
  33491. childArray[i] = arguments[i + 2];
  33492. }
  33493. {
  33494. if (Object.freeze) {
  33495. Object.freeze(childArray);
  33496. }
  33497. }
  33498. props.children = childArray;
  33499. } // Resolve default props
  33500. if (type && type.defaultProps) {
  33501. var defaultProps = type.defaultProps;
  33502. for (propName in defaultProps) {
  33503. if (props[propName] === undefined) {
  33504. props[propName] = defaultProps[propName];
  33505. }
  33506. }
  33507. }
  33508. {
  33509. if (key || ref) {
  33510. var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
  33511. if (key) {
  33512. defineKeyPropWarningGetter(props, displayName);
  33513. }
  33514. if (ref) {
  33515. defineRefPropWarningGetter(props, displayName);
  33516. }
  33517. }
  33518. }
  33519. return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
  33520. }
  33521. function cloneAndReplaceKey(oldElement, newKey) {
  33522. var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
  33523. return newElement;
  33524. }
  33525. /**
  33526. * Clone and return a new ReactElement using element as the starting point.
  33527. * See https://reactjs.org/docs/react-api.html#cloneelement
  33528. */
  33529. function cloneElement(element, config, children) {
  33530. if (!!(element === null || element === undefined)) {
  33531. {
  33532. throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
  33533. }
  33534. }
  33535. var propName; // Original props are copied
  33536. var props = _assign({}, element.props); // Reserved names are extracted
  33537. var key = element.key;
  33538. var ref = element.ref; // Self is preserved since the owner is preserved.
  33539. var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
  33540. // transpiler, and the original source is probably a better indicator of the
  33541. // true owner.
  33542. var source = element._source; // Owner will be preserved, unless ref is overridden
  33543. var owner = element._owner;
  33544. if (config != null) {
  33545. if (hasValidRef(config)) {
  33546. // Silently steal the ref from the parent.
  33547. ref = config.ref;
  33548. owner = ReactCurrentOwner.current;
  33549. }
  33550. if (hasValidKey(config)) {
  33551. key = '' + config.key;
  33552. } // Remaining properties override existing props
  33553. var defaultProps;
  33554. if (element.type && element.type.defaultProps) {
  33555. defaultProps = element.type.defaultProps;
  33556. }
  33557. for (propName in config) {
  33558. if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  33559. if (config[propName] === undefined && defaultProps !== undefined) {
  33560. // Resolve default props
  33561. props[propName] = defaultProps[propName];
  33562. } else {
  33563. props[propName] = config[propName];
  33564. }
  33565. }
  33566. }
  33567. } // Children can be more than one argument, and those are transferred onto
  33568. // the newly allocated props object.
  33569. var childrenLength = arguments.length - 2;
  33570. if (childrenLength === 1) {
  33571. props.children = children;
  33572. } else if (childrenLength > 1) {
  33573. var childArray = Array(childrenLength);
  33574. for (var i = 0; i < childrenLength; i++) {
  33575. childArray[i] = arguments[i + 2];
  33576. }
  33577. props.children = childArray;
  33578. }
  33579. return ReactElement(element.type, key, ref, self, source, owner, props);
  33580. }
  33581. /**
  33582. * Verifies the object is a ReactElement.
  33583. * See https://reactjs.org/docs/react-api.html#isvalidelement
  33584. * @param {?object} object
  33585. * @return {boolean} True if `object` is a ReactElement.
  33586. * @final
  33587. */
  33588. function isValidElement(object) {
  33589. return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  33590. }
  33591. var SEPARATOR = '.';
  33592. var SUBSEPARATOR = ':';
  33593. /**
  33594. * Escape and wrap key so it is safe to use as a reactid
  33595. *
  33596. * @param {string} key to be escaped.
  33597. * @return {string} the escaped key.
  33598. */
  33599. function escape(key) {
  33600. var escapeRegex = /[=:]/g;
  33601. var escaperLookup = {
  33602. '=': '=0',
  33603. ':': '=2'
  33604. };
  33605. var escapedString = ('' + key).replace(escapeRegex, function (match) {
  33606. return escaperLookup[match];
  33607. });
  33608. return '$' + escapedString;
  33609. }
  33610. /**
  33611. * TODO: Test that a single child and an array with one item have the same key
  33612. * pattern.
  33613. */
  33614. var didWarnAboutMaps = false;
  33615. var userProvidedKeyEscapeRegex = /\/+/g;
  33616. function escapeUserProvidedKey(text) {
  33617. return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
  33618. }
  33619. var POOL_SIZE = 10;
  33620. var traverseContextPool = [];
  33621. function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
  33622. if (traverseContextPool.length) {
  33623. var traverseContext = traverseContextPool.pop();
  33624. traverseContext.result = mapResult;
  33625. traverseContext.keyPrefix = keyPrefix;
  33626. traverseContext.func = mapFunction;
  33627. traverseContext.context = mapContext;
  33628. traverseContext.count = 0;
  33629. return traverseContext;
  33630. } else {
  33631. return {
  33632. result: mapResult,
  33633. keyPrefix: keyPrefix,
  33634. func: mapFunction,
  33635. context: mapContext,
  33636. count: 0
  33637. };
  33638. }
  33639. }
  33640. function releaseTraverseContext(traverseContext) {
  33641. traverseContext.result = null;
  33642. traverseContext.keyPrefix = null;
  33643. traverseContext.func = null;
  33644. traverseContext.context = null;
  33645. traverseContext.count = 0;
  33646. if (traverseContextPool.length < POOL_SIZE) {
  33647. traverseContextPool.push(traverseContext);
  33648. }
  33649. }
  33650. /**
  33651. * @param {?*} children Children tree container.
  33652. * @param {!string} nameSoFar Name of the key path so far.
  33653. * @param {!function} callback Callback to invoke with each child found.
  33654. * @param {?*} traverseContext Used to pass information throughout the traversal
  33655. * process.
  33656. * @return {!number} The number of children in this subtree.
  33657. */
  33658. function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
  33659. var type = typeof children;
  33660. if (type === 'undefined' || type === 'boolean') {
  33661. // All of the above are perceived as null.
  33662. children = null;
  33663. }
  33664. var invokeCallback = false;
  33665. if (children === null) {
  33666. invokeCallback = true;
  33667. } else {
  33668. switch (type) {
  33669. case 'string':
  33670. case 'number':
  33671. invokeCallback = true;
  33672. break;
  33673. case 'object':
  33674. switch (children.$$typeof) {
  33675. case REACT_ELEMENT_TYPE:
  33676. case REACT_PORTAL_TYPE:
  33677. invokeCallback = true;
  33678. }
  33679. }
  33680. }
  33681. if (invokeCallback) {
  33682. callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array
  33683. // so that it's consistent if the number of children grows.
  33684. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
  33685. return 1;
  33686. }
  33687. var child;
  33688. var nextName;
  33689. var subtreeCount = 0; // Count of children found in the current subtree.
  33690. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
  33691. if (Array.isArray(children)) {
  33692. for (var i = 0; i < children.length; i++) {
  33693. child = children[i];
  33694. nextName = nextNamePrefix + getComponentKey(child, i);
  33695. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  33696. }
  33697. } else {
  33698. var iteratorFn = getIteratorFn(children);
  33699. if (typeof iteratorFn === 'function') {
  33700. {
  33701. // Warn about using Maps as children
  33702. if (iteratorFn === children.entries) {
  33703. if (!didWarnAboutMaps) {
  33704. warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.');
  33705. }
  33706. didWarnAboutMaps = true;
  33707. }
  33708. }
  33709. var iterator = iteratorFn.call(children);
  33710. var step;
  33711. var ii = 0;
  33712. while (!(step = iterator.next()).done) {
  33713. child = step.value;
  33714. nextName = nextNamePrefix + getComponentKey(child, ii++);
  33715. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  33716. }
  33717. } else if (type === 'object') {
  33718. var addendum = '';
  33719. {
  33720. addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
  33721. }
  33722. var childrenString = '' + children;
  33723. {
  33724. {
  33725. throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum );
  33726. }
  33727. }
  33728. }
  33729. }
  33730. return subtreeCount;
  33731. }
  33732. /**
  33733. * Traverses children that are typically specified as `props.children`, but
  33734. * might also be specified through attributes:
  33735. *
  33736. * - `traverseAllChildren(this.props.children, ...)`
  33737. * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
  33738. *
  33739. * The `traverseContext` is an optional argument that is passed through the
  33740. * entire traversal. It can be used to store accumulations or anything else that
  33741. * the callback might find relevant.
  33742. *
  33743. * @param {?*} children Children tree object.
  33744. * @param {!function} callback To invoke upon traversing each child.
  33745. * @param {?*} traverseContext Context for traversal.
  33746. * @return {!number} The number of children in this subtree.
  33747. */
  33748. function traverseAllChildren(children, callback, traverseContext) {
  33749. if (children == null) {
  33750. return 0;
  33751. }
  33752. return traverseAllChildrenImpl(children, '', callback, traverseContext);
  33753. }
  33754. /**
  33755. * Generate a key string that identifies a component within a set.
  33756. *
  33757. * @param {*} component A component that could contain a manual key.
  33758. * @param {number} index Index that is used if a manual key is not provided.
  33759. * @return {string}
  33760. */
  33761. function getComponentKey(component, index) {
  33762. // Do some typechecking here since we call this blindly. We want to ensure
  33763. // that we don't block potential future ES APIs.
  33764. if (typeof component === 'object' && component !== null && component.key != null) {
  33765. // Explicit key
  33766. return escape(component.key);
  33767. } // Implicit key determined by the index in the set
  33768. return index.toString(36);
  33769. }
  33770. function forEachSingleChild(bookKeeping, child, name) {
  33771. var func = bookKeeping.func,
  33772. context = bookKeeping.context;
  33773. func.call(context, child, bookKeeping.count++);
  33774. }
  33775. /**
  33776. * Iterates through children that are typically specified as `props.children`.
  33777. *
  33778. * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
  33779. *
  33780. * The provided forEachFunc(child, index) will be called for each
  33781. * leaf child.
  33782. *
  33783. * @param {?*} children Children tree container.
  33784. * @param {function(*, int)} forEachFunc
  33785. * @param {*} forEachContext Context for forEachContext.
  33786. */
  33787. function forEachChildren(children, forEachFunc, forEachContext) {
  33788. if (children == null) {
  33789. return children;
  33790. }
  33791. var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
  33792. traverseAllChildren(children, forEachSingleChild, traverseContext);
  33793. releaseTraverseContext(traverseContext);
  33794. }
  33795. function mapSingleChildIntoContext(bookKeeping, child, childKey) {
  33796. var result = bookKeeping.result,
  33797. keyPrefix = bookKeeping.keyPrefix,
  33798. func = bookKeeping.func,
  33799. context = bookKeeping.context;
  33800. var mappedChild = func.call(context, child, bookKeeping.count++);
  33801. if (Array.isArray(mappedChild)) {
  33802. mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
  33803. return c;
  33804. });
  33805. } else if (mappedChild != null) {
  33806. if (isValidElement(mappedChild)) {
  33807. mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
  33808. // traverseAllChildren used to do for objects as children
  33809. keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
  33810. }
  33811. result.push(mappedChild);
  33812. }
  33813. }
  33814. function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
  33815. var escapedPrefix = '';
  33816. if (prefix != null) {
  33817. escapedPrefix = escapeUserProvidedKey(prefix) + '/';
  33818. }
  33819. var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
  33820. traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
  33821. releaseTraverseContext(traverseContext);
  33822. }
  33823. /**
  33824. * Maps children that are typically specified as `props.children`.
  33825. *
  33826. * See https://reactjs.org/docs/react-api.html#reactchildrenmap
  33827. *
  33828. * The provided mapFunction(child, key, index) will be called for each
  33829. * leaf child.
  33830. *
  33831. * @param {?*} children Children tree container.
  33832. * @param {function(*, int)} func The map function.
  33833. * @param {*} context Context for mapFunction.
  33834. * @return {object} Object containing the ordered map of results.
  33835. */
  33836. function mapChildren(children, func, context) {
  33837. if (children == null) {
  33838. return children;
  33839. }
  33840. var result = [];
  33841. mapIntoWithKeyPrefixInternal(children, result, null, func, context);
  33842. return result;
  33843. }
  33844. /**
  33845. * Count the number of children that are typically specified as
  33846. * `props.children`.
  33847. *
  33848. * See https://reactjs.org/docs/react-api.html#reactchildrencount
  33849. *
  33850. * @param {?*} children Children tree container.
  33851. * @return {number} The number of children.
  33852. */
  33853. function countChildren(children) {
  33854. return traverseAllChildren(children, function () {
  33855. return null;
  33856. }, null);
  33857. }
  33858. /**
  33859. * Flatten a children object (typically specified as `props.children`) and
  33860. * return an array with appropriately re-keyed children.
  33861. *
  33862. * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
  33863. */
  33864. function toArray(children) {
  33865. var result = [];
  33866. mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
  33867. return child;
  33868. });
  33869. return result;
  33870. }
  33871. /**
  33872. * Returns the first child in a collection of children and verifies that there
  33873. * is only one child in the collection.
  33874. *
  33875. * See https://reactjs.org/docs/react-api.html#reactchildrenonly
  33876. *
  33877. * The current implementation of this function assumes that a single child gets
  33878. * passed without a wrapper, but the purpose of this helper function is to
  33879. * abstract away the particular structure of children.
  33880. *
  33881. * @param {?object} children Child collection structure.
  33882. * @return {ReactElement} The first and only `ReactElement` contained in the
  33883. * structure.
  33884. */
  33885. function onlyChild(children) {
  33886. if (!isValidElement(children)) {
  33887. {
  33888. throw Error( "React.Children.only expected to receive a single React element child." );
  33889. }
  33890. }
  33891. return children;
  33892. }
  33893. function createContext(defaultValue, calculateChangedBits) {
  33894. if (calculateChangedBits === undefined) {
  33895. calculateChangedBits = null;
  33896. } else {
  33897. {
  33898. if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
  33899. error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
  33900. }
  33901. }
  33902. }
  33903. var context = {
  33904. $$typeof: REACT_CONTEXT_TYPE,
  33905. _calculateChangedBits: calculateChangedBits,
  33906. // As a workaround to support multiple concurrent renderers, we categorize
  33907. // some renderers as primary and others as secondary. We only expect
  33908. // there to be two concurrent renderers at most: React Native (primary) and
  33909. // Fabric (secondary); React DOM (primary) and React ART (secondary).
  33910. // Secondary renderers store their context values on separate fields.
  33911. _currentValue: defaultValue,
  33912. _currentValue2: defaultValue,
  33913. // Used to track how many concurrent renderers this context currently
  33914. // supports within in a single renderer. Such as parallel server rendering.
  33915. _threadCount: 0,
  33916. // These are circular
  33917. Provider: null,
  33918. Consumer: null
  33919. };
  33920. context.Provider = {
  33921. $$typeof: REACT_PROVIDER_TYPE,
  33922. _context: context
  33923. };
  33924. var hasWarnedAboutUsingNestedContextConsumers = false;
  33925. var hasWarnedAboutUsingConsumerProvider = false;
  33926. {
  33927. // A separate object, but proxies back to the original context object for
  33928. // backwards compatibility. It has a different $$typeof, so we can properly
  33929. // warn for the incorrect usage of Context as a Consumer.
  33930. var Consumer = {
  33931. $$typeof: REACT_CONTEXT_TYPE,
  33932. _context: context,
  33933. _calculateChangedBits: context._calculateChangedBits
  33934. }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
  33935. Object.defineProperties(Consumer, {
  33936. Provider: {
  33937. get: function () {
  33938. if (!hasWarnedAboutUsingConsumerProvider) {
  33939. hasWarnedAboutUsingConsumerProvider = true;
  33940. error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
  33941. }
  33942. return context.Provider;
  33943. },
  33944. set: function (_Provider) {
  33945. context.Provider = _Provider;
  33946. }
  33947. },
  33948. _currentValue: {
  33949. get: function () {
  33950. return context._currentValue;
  33951. },
  33952. set: function (_currentValue) {
  33953. context._currentValue = _currentValue;
  33954. }
  33955. },
  33956. _currentValue2: {
  33957. get: function () {
  33958. return context._currentValue2;
  33959. },
  33960. set: function (_currentValue2) {
  33961. context._currentValue2 = _currentValue2;
  33962. }
  33963. },
  33964. _threadCount: {
  33965. get: function () {
  33966. return context._threadCount;
  33967. },
  33968. set: function (_threadCount) {
  33969. context._threadCount = _threadCount;
  33970. }
  33971. },
  33972. Consumer: {
  33973. get: function () {
  33974. if (!hasWarnedAboutUsingNestedContextConsumers) {
  33975. hasWarnedAboutUsingNestedContextConsumers = true;
  33976. error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
  33977. }
  33978. return context.Consumer;
  33979. }
  33980. }
  33981. }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
  33982. context.Consumer = Consumer;
  33983. }
  33984. {
  33985. context._currentRenderer = null;
  33986. context._currentRenderer2 = null;
  33987. }
  33988. return context;
  33989. }
  33990. function lazy(ctor) {
  33991. var lazyType = {
  33992. $$typeof: REACT_LAZY_TYPE,
  33993. _ctor: ctor,
  33994. // React uses these fields to store the result.
  33995. _status: -1,
  33996. _result: null
  33997. };
  33998. {
  33999. // In production, this would just set it on the object.
  34000. var defaultProps;
  34001. var propTypes;
  34002. Object.defineProperties(lazyType, {
  34003. defaultProps: {
  34004. configurable: true,
  34005. get: function () {
  34006. return defaultProps;
  34007. },
  34008. set: function (newDefaultProps) {
  34009. error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
  34010. defaultProps = newDefaultProps; // Match production behavior more closely:
  34011. Object.defineProperty(lazyType, 'defaultProps', {
  34012. enumerable: true
  34013. });
  34014. }
  34015. },
  34016. propTypes: {
  34017. configurable: true,
  34018. get: function () {
  34019. return propTypes;
  34020. },
  34021. set: function (newPropTypes) {
  34022. error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
  34023. propTypes = newPropTypes; // Match production behavior more closely:
  34024. Object.defineProperty(lazyType, 'propTypes', {
  34025. enumerable: true
  34026. });
  34027. }
  34028. }
  34029. });
  34030. }
  34031. return lazyType;
  34032. }
  34033. function forwardRef(render) {
  34034. {
  34035. if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
  34036. error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
  34037. } else if (typeof render !== 'function') {
  34038. error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
  34039. } else {
  34040. if (render.length !== 0 && render.length !== 2) {
  34041. error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
  34042. }
  34043. }
  34044. if (render != null) {
  34045. if (render.defaultProps != null || render.propTypes != null) {
  34046. error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
  34047. }
  34048. }
  34049. }
  34050. return {
  34051. $$typeof: REACT_FORWARD_REF_TYPE,
  34052. render: render
  34053. };
  34054. }
  34055. function isValidElementType(type) {
  34056. return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  34057. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
  34058. }
  34059. function memo(type, compare) {
  34060. {
  34061. if (!isValidElementType(type)) {
  34062. error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
  34063. }
  34064. }
  34065. return {
  34066. $$typeof: REACT_MEMO_TYPE,
  34067. type: type,
  34068. compare: compare === undefined ? null : compare
  34069. };
  34070. }
  34071. function resolveDispatcher() {
  34072. var dispatcher = ReactCurrentDispatcher.current;
  34073. if (!(dispatcher !== null)) {
  34074. {
  34075. throw Error( "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." );
  34076. }
  34077. }
  34078. return dispatcher;
  34079. }
  34080. function useContext(Context, unstable_observedBits) {
  34081. var dispatcher = resolveDispatcher();
  34082. {
  34083. if (unstable_observedBits !== undefined) {
  34084. error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '');
  34085. } // TODO: add a more generic warning for invalid values.
  34086. if (Context._context !== undefined) {
  34087. var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
  34088. // and nobody should be using this in existing code.
  34089. if (realContext.Consumer === Context) {
  34090. error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
  34091. } else if (realContext.Provider === Context) {
  34092. error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
  34093. }
  34094. }
  34095. }
  34096. return dispatcher.useContext(Context, unstable_observedBits);
  34097. }
  34098. function useState(initialState) {
  34099. var dispatcher = resolveDispatcher();
  34100. return dispatcher.useState(initialState);
  34101. }
  34102. function useReducer(reducer, initialArg, init) {
  34103. var dispatcher = resolveDispatcher();
  34104. return dispatcher.useReducer(reducer, initialArg, init);
  34105. }
  34106. function useRef(initialValue) {
  34107. var dispatcher = resolveDispatcher();
  34108. return dispatcher.useRef(initialValue);
  34109. }
  34110. function useEffect(create, deps) {
  34111. var dispatcher = resolveDispatcher();
  34112. return dispatcher.useEffect(create, deps);
  34113. }
  34114. function useLayoutEffect(create, deps) {
  34115. var dispatcher = resolveDispatcher();
  34116. return dispatcher.useLayoutEffect(create, deps);
  34117. }
  34118. function useCallback(callback, deps) {
  34119. var dispatcher = resolveDispatcher();
  34120. return dispatcher.useCallback(callback, deps);
  34121. }
  34122. function useMemo(create, deps) {
  34123. var dispatcher = resolveDispatcher();
  34124. return dispatcher.useMemo(create, deps);
  34125. }
  34126. function useImperativeHandle(ref, create, deps) {
  34127. var dispatcher = resolveDispatcher();
  34128. return dispatcher.useImperativeHandle(ref, create, deps);
  34129. }
  34130. function useDebugValue(value, formatterFn) {
  34131. {
  34132. var dispatcher = resolveDispatcher();
  34133. return dispatcher.useDebugValue(value, formatterFn);
  34134. }
  34135. }
  34136. var propTypesMisspellWarningShown;
  34137. {
  34138. propTypesMisspellWarningShown = false;
  34139. }
  34140. function getDeclarationErrorAddendum() {
  34141. if (ReactCurrentOwner.current) {
  34142. var name = getComponentName(ReactCurrentOwner.current.type);
  34143. if (name) {
  34144. return '\n\nCheck the render method of `' + name + '`.';
  34145. }
  34146. }
  34147. return '';
  34148. }
  34149. function getSourceInfoErrorAddendum(source) {
  34150. if (source !== undefined) {
  34151. var fileName = source.fileName.replace(/^.*[\\\/]/, '');
  34152. var lineNumber = source.lineNumber;
  34153. return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
  34154. }
  34155. return '';
  34156. }
  34157. function getSourceInfoErrorAddendumForProps(elementProps) {
  34158. if (elementProps !== null && elementProps !== undefined) {
  34159. return getSourceInfoErrorAddendum(elementProps.__source);
  34160. }
  34161. return '';
  34162. }
  34163. /**
  34164. * Warn if there's no key explicitly set on dynamic arrays of children or
  34165. * object keys are not valid. This allows us to keep track of children between
  34166. * updates.
  34167. */
  34168. var ownerHasKeyUseWarning = {};
  34169. function getCurrentComponentErrorInfo(parentType) {
  34170. var info = getDeclarationErrorAddendum();
  34171. if (!info) {
  34172. var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
  34173. if (parentName) {
  34174. info = "\n\nCheck the top-level render call using <" + parentName + ">.";
  34175. }
  34176. }
  34177. return info;
  34178. }
  34179. /**
  34180. * Warn if the element doesn't have an explicit key assigned to it.
  34181. * This element is in an array. The array could grow and shrink or be
  34182. * reordered. All children that haven't already been validated are required to
  34183. * have a "key" property assigned to it. Error statuses are cached so a warning
  34184. * will only be shown once.
  34185. *
  34186. * @internal
  34187. * @param {ReactElement} element Element that requires a key.
  34188. * @param {*} parentType element's parent's type.
  34189. */
  34190. function validateExplicitKey(element, parentType) {
  34191. if (!element._store || element._store.validated || element.key != null) {
  34192. return;
  34193. }
  34194. element._store.validated = true;
  34195. var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
  34196. if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
  34197. return;
  34198. }
  34199. ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
  34200. // property, it may be the creator of the child that's responsible for
  34201. // assigning it a key.
  34202. var childOwner = '';
  34203. if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
  34204. // Give the component that originally created this child.
  34205. childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
  34206. }
  34207. setCurrentlyValidatingElement(element);
  34208. {
  34209. error('Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
  34210. }
  34211. setCurrentlyValidatingElement(null);
  34212. }
  34213. /**
  34214. * Ensure that every element either is passed in a static location, in an
  34215. * array with an explicit keys property defined, or in an object literal
  34216. * with valid key property.
  34217. *
  34218. * @internal
  34219. * @param {ReactNode} node Statically passed child of any type.
  34220. * @param {*} parentType node's parent's type.
  34221. */
  34222. function validateChildKeys(node, parentType) {
  34223. if (typeof node !== 'object') {
  34224. return;
  34225. }
  34226. if (Array.isArray(node)) {
  34227. for (var i = 0; i < node.length; i++) {
  34228. var child = node[i];
  34229. if (isValidElement(child)) {
  34230. validateExplicitKey(child, parentType);
  34231. }
  34232. }
  34233. } else if (isValidElement(node)) {
  34234. // This element was passed in a valid location.
  34235. if (node._store) {
  34236. node._store.validated = true;
  34237. }
  34238. } else if (node) {
  34239. var iteratorFn = getIteratorFn(node);
  34240. if (typeof iteratorFn === 'function') {
  34241. // Entry iterators used to provide implicit keys,
  34242. // but now we print a separate warning for them later.
  34243. if (iteratorFn !== node.entries) {
  34244. var iterator = iteratorFn.call(node);
  34245. var step;
  34246. while (!(step = iterator.next()).done) {
  34247. if (isValidElement(step.value)) {
  34248. validateExplicitKey(step.value, parentType);
  34249. }
  34250. }
  34251. }
  34252. }
  34253. }
  34254. }
  34255. /**
  34256. * Given an element, validate that its props follow the propTypes definition,
  34257. * provided by the type.
  34258. *
  34259. * @param {ReactElement} element
  34260. */
  34261. function validatePropTypes(element) {
  34262. {
  34263. var type = element.type;
  34264. if (type === null || type === undefined || typeof type === 'string') {
  34265. return;
  34266. }
  34267. var name = getComponentName(type);
  34268. var propTypes;
  34269. if (typeof type === 'function') {
  34270. propTypes = type.propTypes;
  34271. } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
  34272. // Inner props are checked in the reconciler.
  34273. type.$$typeof === REACT_MEMO_TYPE)) {
  34274. propTypes = type.propTypes;
  34275. } else {
  34276. return;
  34277. }
  34278. if (propTypes) {
  34279. setCurrentlyValidatingElement(element);
  34280. checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
  34281. setCurrentlyValidatingElement(null);
  34282. } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
  34283. propTypesMisspellWarningShown = true;
  34284. error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
  34285. }
  34286. if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
  34287. error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
  34288. }
  34289. }
  34290. }
  34291. /**
  34292. * Given a fragment, validate that it can only be provided with fragment props
  34293. * @param {ReactElement} fragment
  34294. */
  34295. function validateFragmentProps(fragment) {
  34296. {
  34297. setCurrentlyValidatingElement(fragment);
  34298. var keys = Object.keys(fragment.props);
  34299. for (var i = 0; i < keys.length; i++) {
  34300. var key = keys[i];
  34301. if (key !== 'children' && key !== 'key') {
  34302. error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
  34303. break;
  34304. }
  34305. }
  34306. if (fragment.ref !== null) {
  34307. error('Invalid attribute `ref` supplied to `React.Fragment`.');
  34308. }
  34309. setCurrentlyValidatingElement(null);
  34310. }
  34311. }
  34312. function createElementWithValidation(type, props, children) {
  34313. var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
  34314. // succeed and there will likely be errors in render.
  34315. if (!validType) {
  34316. var info = '';
  34317. if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
  34318. info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
  34319. }
  34320. var sourceInfo = getSourceInfoErrorAddendumForProps(props);
  34321. if (sourceInfo) {
  34322. info += sourceInfo;
  34323. } else {
  34324. info += getDeclarationErrorAddendum();
  34325. }
  34326. var typeString;
  34327. if (type === null) {
  34328. typeString = 'null';
  34329. } else if (Array.isArray(type)) {
  34330. typeString = 'array';
  34331. } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
  34332. typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
  34333. info = ' Did you accidentally export a JSX literal instead of a component?';
  34334. } else {
  34335. typeString = typeof type;
  34336. }
  34337. {
  34338. error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
  34339. }
  34340. }
  34341. var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
  34342. // TODO: Drop this when these are no longer allowed as the type argument.
  34343. if (element == null) {
  34344. return element;
  34345. } // Skip key warning if the type isn't valid since our key validation logic
  34346. // doesn't expect a non-string/function type and can throw confusing errors.
  34347. // We don't want exception behavior to differ between dev and prod.
  34348. // (Rendering will throw with a helpful message and as soon as the type is
  34349. // fixed, the key warnings will appear.)
  34350. if (validType) {
  34351. for (var i = 2; i < arguments.length; i++) {
  34352. validateChildKeys(arguments[i], type);
  34353. }
  34354. }
  34355. if (type === REACT_FRAGMENT_TYPE) {
  34356. validateFragmentProps(element);
  34357. } else {
  34358. validatePropTypes(element);
  34359. }
  34360. return element;
  34361. }
  34362. var didWarnAboutDeprecatedCreateFactory = false;
  34363. function createFactoryWithValidation(type) {
  34364. var validatedFactory = createElementWithValidation.bind(null, type);
  34365. validatedFactory.type = type;
  34366. {
  34367. if (!didWarnAboutDeprecatedCreateFactory) {
  34368. didWarnAboutDeprecatedCreateFactory = true;
  34369. warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
  34370. } // Legacy hook: remove it
  34371. Object.defineProperty(validatedFactory, 'type', {
  34372. enumerable: false,
  34373. get: function () {
  34374. warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
  34375. Object.defineProperty(this, 'type', {
  34376. value: type
  34377. });
  34378. return type;
  34379. }
  34380. });
  34381. }
  34382. return validatedFactory;
  34383. }
  34384. function cloneElementWithValidation(element, props, children) {
  34385. var newElement = cloneElement.apply(this, arguments);
  34386. for (var i = 2; i < arguments.length; i++) {
  34387. validateChildKeys(arguments[i], newElement.type);
  34388. }
  34389. validatePropTypes(newElement);
  34390. return newElement;
  34391. }
  34392. {
  34393. try {
  34394. var frozenObject = Object.freeze({});
  34395. var testMap = new Map([[frozenObject, null]]);
  34396. var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
  34397. // https://github.com/rollup/rollup/issues/1771
  34398. // TODO: we can remove these if Rollup fixes the bug.
  34399. testMap.set(0, 0);
  34400. testSet.add(0);
  34401. } catch (e) {
  34402. }
  34403. }
  34404. var createElement$1 = createElementWithValidation ;
  34405. var cloneElement$1 = cloneElementWithValidation ;
  34406. var createFactory = createFactoryWithValidation ;
  34407. var Children = {
  34408. map: mapChildren,
  34409. forEach: forEachChildren,
  34410. count: countChildren,
  34411. toArray: toArray,
  34412. only: onlyChild
  34413. };
  34414. exports.Children = Children;
  34415. exports.Component = Component;
  34416. exports.Fragment = REACT_FRAGMENT_TYPE;
  34417. exports.Profiler = REACT_PROFILER_TYPE;
  34418. exports.PureComponent = PureComponent;
  34419. exports.StrictMode = REACT_STRICT_MODE_TYPE;
  34420. exports.Suspense = REACT_SUSPENSE_TYPE;
  34421. exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
  34422. exports.cloneElement = cloneElement$1;
  34423. exports.createContext = createContext;
  34424. exports.createElement = createElement$1;
  34425. exports.createFactory = createFactory;
  34426. exports.createRef = createRef;
  34427. exports.forwardRef = forwardRef;
  34428. exports.isValidElement = isValidElement;
  34429. exports.lazy = lazy;
  34430. exports.memo = memo;
  34431. exports.useCallback = useCallback;
  34432. exports.useContext = useContext;
  34433. exports.useDebugValue = useDebugValue;
  34434. exports.useEffect = useEffect;
  34435. exports.useImperativeHandle = useImperativeHandle;
  34436. exports.useLayoutEffect = useLayoutEffect;
  34437. exports.useMemo = useMemo;
  34438. exports.useReducer = useReducer;
  34439. exports.useRef = useRef;
  34440. exports.useState = useState;
  34441. exports.version = ReactVersion;
  34442. })();
  34443. }
  34444. /***/ }),
  34445. /***/ "../../node_modules/react/index.js":
  34446. /*!*******************************************************!*\
  34447. !*** C:/Repos/Babylon.js/node_modules/react/index.js ***!
  34448. \*******************************************************/
  34449. /*! no static exports found */
  34450. /***/ (function(module, exports, __webpack_require__) {
  34451. "use strict";
  34452. if (false) {} else {
  34453. module.exports = __webpack_require__(/*! ./cjs/react.development.js */ "../../node_modules/react/cjs/react.development.js");
  34454. }
  34455. /***/ }),
  34456. /***/ "../../node_modules/scheduler/cjs/scheduler-tracing.development.js":
  34457. /*!***************************************************************************************!*\
  34458. !*** C:/Repos/Babylon.js/node_modules/scheduler/cjs/scheduler-tracing.development.js ***!
  34459. \***************************************************************************************/
  34460. /*! no static exports found */
  34461. /***/ (function(module, exports, __webpack_require__) {
  34462. "use strict";
  34463. /** @license React v0.19.1
  34464. * scheduler-tracing.development.js
  34465. *
  34466. * Copyright (c) Facebook, Inc. and its affiliates.
  34467. *
  34468. * This source code is licensed under the MIT license found in the
  34469. * LICENSE file in the root directory of this source tree.
  34470. */
  34471. if (true) {
  34472. (function() {
  34473. 'use strict';
  34474. var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.
  34475. var interactionIDCounter = 0;
  34476. var threadIDCounter = 0; // Set of currently traced interactions.
  34477. // Interactions "stack"–
  34478. // Meaning that newly traced interactions are appended to the previously active set.
  34479. // When an interaction goes out of scope, the previous set (if any) is restored.
  34480. exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.
  34481. exports.__subscriberRef = null;
  34482. {
  34483. exports.__interactionsRef = {
  34484. current: new Set()
  34485. };
  34486. exports.__subscriberRef = {
  34487. current: null
  34488. };
  34489. }
  34490. function unstable_clear(callback) {
  34491. var prevInteractions = exports.__interactionsRef.current;
  34492. exports.__interactionsRef.current = new Set();
  34493. try {
  34494. return callback();
  34495. } finally {
  34496. exports.__interactionsRef.current = prevInteractions;
  34497. }
  34498. }
  34499. function unstable_getCurrent() {
  34500. {
  34501. return exports.__interactionsRef.current;
  34502. }
  34503. }
  34504. function unstable_getThreadID() {
  34505. return ++threadIDCounter;
  34506. }
  34507. function unstable_trace(name, timestamp, callback) {
  34508. var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;
  34509. var interaction = {
  34510. __count: 1,
  34511. id: interactionIDCounter++,
  34512. name: name,
  34513. timestamp: timestamp
  34514. };
  34515. var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.
  34516. // To do that, clone the current interactions.
  34517. // The previous set will be restored upon completion.
  34518. var interactions = new Set(prevInteractions);
  34519. interactions.add(interaction);
  34520. exports.__interactionsRef.current = interactions;
  34521. var subscriber = exports.__subscriberRef.current;
  34522. var returnValue;
  34523. try {
  34524. if (subscriber !== null) {
  34525. subscriber.onInteractionTraced(interaction);
  34526. }
  34527. } finally {
  34528. try {
  34529. if (subscriber !== null) {
  34530. subscriber.onWorkStarted(interactions, threadID);
  34531. }
  34532. } finally {
  34533. try {
  34534. returnValue = callback();
  34535. } finally {
  34536. exports.__interactionsRef.current = prevInteractions;
  34537. try {
  34538. if (subscriber !== null) {
  34539. subscriber.onWorkStopped(interactions, threadID);
  34540. }
  34541. } finally {
  34542. interaction.__count--; // If no async work was scheduled for this interaction,
  34543. // Notify subscribers that it's completed.
  34544. if (subscriber !== null && interaction.__count === 0) {
  34545. subscriber.onInteractionScheduledWorkCompleted(interaction);
  34546. }
  34547. }
  34548. }
  34549. }
  34550. }
  34551. return returnValue;
  34552. }
  34553. function unstable_wrap(callback) {
  34554. var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;
  34555. var wrappedInteractions = exports.__interactionsRef.current;
  34556. var subscriber = exports.__subscriberRef.current;
  34557. if (subscriber !== null) {
  34558. subscriber.onWorkScheduled(wrappedInteractions, threadID);
  34559. } // Update the pending async work count for the current interactions.
  34560. // Update after calling subscribers in case of error.
  34561. wrappedInteractions.forEach(function (interaction) {
  34562. interaction.__count++;
  34563. });
  34564. var hasRun = false;
  34565. function wrapped() {
  34566. var prevInteractions = exports.__interactionsRef.current;
  34567. exports.__interactionsRef.current = wrappedInteractions;
  34568. subscriber = exports.__subscriberRef.current;
  34569. try {
  34570. var returnValue;
  34571. try {
  34572. if (subscriber !== null) {
  34573. subscriber.onWorkStarted(wrappedInteractions, threadID);
  34574. }
  34575. } finally {
  34576. try {
  34577. returnValue = callback.apply(undefined, arguments);
  34578. } finally {
  34579. exports.__interactionsRef.current = prevInteractions;
  34580. if (subscriber !== null) {
  34581. subscriber.onWorkStopped(wrappedInteractions, threadID);
  34582. }
  34583. }
  34584. }
  34585. return returnValue;
  34586. } finally {
  34587. if (!hasRun) {
  34588. // We only expect a wrapped function to be executed once,
  34589. // But in the event that it's executed more than once–
  34590. // Only decrement the outstanding interaction counts once.
  34591. hasRun = true; // Update pending async counts for all wrapped interactions.
  34592. // If this was the last scheduled async work for any of them,
  34593. // Mark them as completed.
  34594. wrappedInteractions.forEach(function (interaction) {
  34595. interaction.__count--;
  34596. if (subscriber !== null && interaction.__count === 0) {
  34597. subscriber.onInteractionScheduledWorkCompleted(interaction);
  34598. }
  34599. });
  34600. }
  34601. }
  34602. }
  34603. wrapped.cancel = function cancel() {
  34604. subscriber = exports.__subscriberRef.current;
  34605. try {
  34606. if (subscriber !== null) {
  34607. subscriber.onWorkCanceled(wrappedInteractions, threadID);
  34608. }
  34609. } finally {
  34610. // Update pending async counts for all wrapped interactions.
  34611. // If this was the last scheduled async work for any of them,
  34612. // Mark them as completed.
  34613. wrappedInteractions.forEach(function (interaction) {
  34614. interaction.__count--;
  34615. if (subscriber && interaction.__count === 0) {
  34616. subscriber.onInteractionScheduledWorkCompleted(interaction);
  34617. }
  34618. });
  34619. }
  34620. };
  34621. return wrapped;
  34622. }
  34623. var subscribers = null;
  34624. {
  34625. subscribers = new Set();
  34626. }
  34627. function unstable_subscribe(subscriber) {
  34628. {
  34629. subscribers.add(subscriber);
  34630. if (subscribers.size === 1) {
  34631. exports.__subscriberRef.current = {
  34632. onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,
  34633. onInteractionTraced: onInteractionTraced,
  34634. onWorkCanceled: onWorkCanceled,
  34635. onWorkScheduled: onWorkScheduled,
  34636. onWorkStarted: onWorkStarted,
  34637. onWorkStopped: onWorkStopped
  34638. };
  34639. }
  34640. }
  34641. }
  34642. function unstable_unsubscribe(subscriber) {
  34643. {
  34644. subscribers.delete(subscriber);
  34645. if (subscribers.size === 0) {
  34646. exports.__subscriberRef.current = null;
  34647. }
  34648. }
  34649. }
  34650. function onInteractionTraced(interaction) {
  34651. var didCatchError = false;
  34652. var caughtError = null;
  34653. subscribers.forEach(function (subscriber) {
  34654. try {
  34655. subscriber.onInteractionTraced(interaction);
  34656. } catch (error) {
  34657. if (!didCatchError) {
  34658. didCatchError = true;
  34659. caughtError = error;
  34660. }
  34661. }
  34662. });
  34663. if (didCatchError) {
  34664. throw caughtError;
  34665. }
  34666. }
  34667. function onInteractionScheduledWorkCompleted(interaction) {
  34668. var didCatchError = false;
  34669. var caughtError = null;
  34670. subscribers.forEach(function (subscriber) {
  34671. try {
  34672. subscriber.onInteractionScheduledWorkCompleted(interaction);
  34673. } catch (error) {
  34674. if (!didCatchError) {
  34675. didCatchError = true;
  34676. caughtError = error;
  34677. }
  34678. }
  34679. });
  34680. if (didCatchError) {
  34681. throw caughtError;
  34682. }
  34683. }
  34684. function onWorkScheduled(interactions, threadID) {
  34685. var didCatchError = false;
  34686. var caughtError = null;
  34687. subscribers.forEach(function (subscriber) {
  34688. try {
  34689. subscriber.onWorkScheduled(interactions, threadID);
  34690. } catch (error) {
  34691. if (!didCatchError) {
  34692. didCatchError = true;
  34693. caughtError = error;
  34694. }
  34695. }
  34696. });
  34697. if (didCatchError) {
  34698. throw caughtError;
  34699. }
  34700. }
  34701. function onWorkStarted(interactions, threadID) {
  34702. var didCatchError = false;
  34703. var caughtError = null;
  34704. subscribers.forEach(function (subscriber) {
  34705. try {
  34706. subscriber.onWorkStarted(interactions, threadID);
  34707. } catch (error) {
  34708. if (!didCatchError) {
  34709. didCatchError = true;
  34710. caughtError = error;
  34711. }
  34712. }
  34713. });
  34714. if (didCatchError) {
  34715. throw caughtError;
  34716. }
  34717. }
  34718. function onWorkStopped(interactions, threadID) {
  34719. var didCatchError = false;
  34720. var caughtError = null;
  34721. subscribers.forEach(function (subscriber) {
  34722. try {
  34723. subscriber.onWorkStopped(interactions, threadID);
  34724. } catch (error) {
  34725. if (!didCatchError) {
  34726. didCatchError = true;
  34727. caughtError = error;
  34728. }
  34729. }
  34730. });
  34731. if (didCatchError) {
  34732. throw caughtError;
  34733. }
  34734. }
  34735. function onWorkCanceled(interactions, threadID) {
  34736. var didCatchError = false;
  34737. var caughtError = null;
  34738. subscribers.forEach(function (subscriber) {
  34739. try {
  34740. subscriber.onWorkCanceled(interactions, threadID);
  34741. } catch (error) {
  34742. if (!didCatchError) {
  34743. didCatchError = true;
  34744. caughtError = error;
  34745. }
  34746. }
  34747. });
  34748. if (didCatchError) {
  34749. throw caughtError;
  34750. }
  34751. }
  34752. exports.unstable_clear = unstable_clear;
  34753. exports.unstable_getCurrent = unstable_getCurrent;
  34754. exports.unstable_getThreadID = unstable_getThreadID;
  34755. exports.unstable_subscribe = unstable_subscribe;
  34756. exports.unstable_trace = unstable_trace;
  34757. exports.unstable_unsubscribe = unstable_unsubscribe;
  34758. exports.unstable_wrap = unstable_wrap;
  34759. })();
  34760. }
  34761. /***/ }),
  34762. /***/ "../../node_modules/scheduler/cjs/scheduler.development.js":
  34763. /*!*******************************************************************************!*\
  34764. !*** C:/Repos/Babylon.js/node_modules/scheduler/cjs/scheduler.development.js ***!
  34765. \*******************************************************************************/
  34766. /*! no static exports found */
  34767. /***/ (function(module, exports, __webpack_require__) {
  34768. "use strict";
  34769. /** @license React v0.19.1
  34770. * scheduler.development.js
  34771. *
  34772. * Copyright (c) Facebook, Inc. and its affiliates.
  34773. *
  34774. * This source code is licensed under the MIT license found in the
  34775. * LICENSE file in the root directory of this source tree.
  34776. */
  34777. if (true) {
  34778. (function() {
  34779. 'use strict';
  34780. var enableSchedulerDebugging = false;
  34781. var enableProfiling = true;
  34782. var requestHostCallback;
  34783. var requestHostTimeout;
  34784. var cancelHostTimeout;
  34785. var shouldYieldToHost;
  34786. var requestPaint;
  34787. if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive
  34788. // implementation using setTimeout.
  34789. typeof window === 'undefined' || // Check if MessageChannel is supported, too.
  34790. typeof MessageChannel !== 'function') {
  34791. // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,
  34792. // fallback to a naive implementation.
  34793. var _callback = null;
  34794. var _timeoutID = null;
  34795. var _flushCallback = function () {
  34796. if (_callback !== null) {
  34797. try {
  34798. var currentTime = exports.unstable_now();
  34799. var hasRemainingTime = true;
  34800. _callback(hasRemainingTime, currentTime);
  34801. _callback = null;
  34802. } catch (e) {
  34803. setTimeout(_flushCallback, 0);
  34804. throw e;
  34805. }
  34806. }
  34807. };
  34808. var initialTime = Date.now();
  34809. exports.unstable_now = function () {
  34810. return Date.now() - initialTime;
  34811. };
  34812. requestHostCallback = function (cb) {
  34813. if (_callback !== null) {
  34814. // Protect against re-entrancy.
  34815. setTimeout(requestHostCallback, 0, cb);
  34816. } else {
  34817. _callback = cb;
  34818. setTimeout(_flushCallback, 0);
  34819. }
  34820. };
  34821. requestHostTimeout = function (cb, ms) {
  34822. _timeoutID = setTimeout(cb, ms);
  34823. };
  34824. cancelHostTimeout = function () {
  34825. clearTimeout(_timeoutID);
  34826. };
  34827. shouldYieldToHost = function () {
  34828. return false;
  34829. };
  34830. requestPaint = exports.unstable_forceFrameRate = function () {};
  34831. } else {
  34832. // Capture local references to native APIs, in case a polyfill overrides them.
  34833. var performance = window.performance;
  34834. var _Date = window.Date;
  34835. var _setTimeout = window.setTimeout;
  34836. var _clearTimeout = window.clearTimeout;
  34837. if (typeof console !== 'undefined') {
  34838. // TODO: Scheduler no longer requires these methods to be polyfilled. But
  34839. // maybe we want to continue warning if they don't exist, to preserve the
  34840. // option to rely on it in the future?
  34841. var requestAnimationFrame = window.requestAnimationFrame;
  34842. var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link
  34843. if (typeof requestAnimationFrame !== 'function') {
  34844. // Using console['error'] to evade Babel and ESLint
  34845. console['error']("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
  34846. }
  34847. if (typeof cancelAnimationFrame !== 'function') {
  34848. // Using console['error'] to evade Babel and ESLint
  34849. console['error']("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
  34850. }
  34851. }
  34852. if (typeof performance === 'object' && typeof performance.now === 'function') {
  34853. exports.unstable_now = function () {
  34854. return performance.now();
  34855. };
  34856. } else {
  34857. var _initialTime = _Date.now();
  34858. exports.unstable_now = function () {
  34859. return _Date.now() - _initialTime;
  34860. };
  34861. }
  34862. var isMessageLoopRunning = false;
  34863. var scheduledHostCallback = null;
  34864. var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
  34865. // thread, like user events. By default, it yields multiple times per frame.
  34866. // It does not attempt to align with frame boundaries, since most tasks don't
  34867. // need to be frame aligned; for those that do, use requestAnimationFrame.
  34868. var yieldInterval = 5;
  34869. var deadline = 0; // TODO: Make this configurable
  34870. {
  34871. // `isInputPending` is not available. Since we have no way of knowing if
  34872. // there's pending input, always yield at the end of the frame.
  34873. shouldYieldToHost = function () {
  34874. return exports.unstable_now() >= deadline;
  34875. }; // Since we yield every frame regardless, `requestPaint` has no effect.
  34876. requestPaint = function () {};
  34877. }
  34878. exports.unstable_forceFrameRate = function (fps) {
  34879. if (fps < 0 || fps > 125) {
  34880. // Using console['error'] to evade Babel and ESLint
  34881. console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported');
  34882. return;
  34883. }
  34884. if (fps > 0) {
  34885. yieldInterval = Math.floor(1000 / fps);
  34886. } else {
  34887. // reset the framerate
  34888. yieldInterval = 5;
  34889. }
  34890. };
  34891. var performWorkUntilDeadline = function () {
  34892. if (scheduledHostCallback !== null) {
  34893. var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync
  34894. // cycle. This means there's always time remaining at the beginning of
  34895. // the message event.
  34896. deadline = currentTime + yieldInterval;
  34897. var hasTimeRemaining = true;
  34898. try {
  34899. var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
  34900. if (!hasMoreWork) {
  34901. isMessageLoopRunning = false;
  34902. scheduledHostCallback = null;
  34903. } else {
  34904. // If there's more work, schedule the next message event at the end
  34905. // of the preceding one.
  34906. port.postMessage(null);
  34907. }
  34908. } catch (error) {
  34909. // If a scheduler task throws, exit the current browser task so the
  34910. // error can be observed.
  34911. port.postMessage(null);
  34912. throw error;
  34913. }
  34914. } else {
  34915. isMessageLoopRunning = false;
  34916. } // Yielding to the browser will give it a chance to paint, so we can
  34917. };
  34918. var channel = new MessageChannel();
  34919. var port = channel.port2;
  34920. channel.port1.onmessage = performWorkUntilDeadline;
  34921. requestHostCallback = function (callback) {
  34922. scheduledHostCallback = callback;
  34923. if (!isMessageLoopRunning) {
  34924. isMessageLoopRunning = true;
  34925. port.postMessage(null);
  34926. }
  34927. };
  34928. requestHostTimeout = function (callback, ms) {
  34929. taskTimeoutID = _setTimeout(function () {
  34930. callback(exports.unstable_now());
  34931. }, ms);
  34932. };
  34933. cancelHostTimeout = function () {
  34934. _clearTimeout(taskTimeoutID);
  34935. taskTimeoutID = -1;
  34936. };
  34937. }
  34938. function push(heap, node) {
  34939. var index = heap.length;
  34940. heap.push(node);
  34941. siftUp(heap, node, index);
  34942. }
  34943. function peek(heap) {
  34944. var first = heap[0];
  34945. return first === undefined ? null : first;
  34946. }
  34947. function pop(heap) {
  34948. var first = heap[0];
  34949. if (first !== undefined) {
  34950. var last = heap.pop();
  34951. if (last !== first) {
  34952. heap[0] = last;
  34953. siftDown(heap, last, 0);
  34954. }
  34955. return first;
  34956. } else {
  34957. return null;
  34958. }
  34959. }
  34960. function siftUp(heap, node, i) {
  34961. var index = i;
  34962. while (true) {
  34963. var parentIndex = index - 1 >>> 1;
  34964. var parent = heap[parentIndex];
  34965. if (parent !== undefined && compare(parent, node) > 0) {
  34966. // The parent is larger. Swap positions.
  34967. heap[parentIndex] = node;
  34968. heap[index] = parent;
  34969. index = parentIndex;
  34970. } else {
  34971. // The parent is smaller. Exit.
  34972. return;
  34973. }
  34974. }
  34975. }
  34976. function siftDown(heap, node, i) {
  34977. var index = i;
  34978. var length = heap.length;
  34979. while (index < length) {
  34980. var leftIndex = (index + 1) * 2 - 1;
  34981. var left = heap[leftIndex];
  34982. var rightIndex = leftIndex + 1;
  34983. var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.
  34984. if (left !== undefined && compare(left, node) < 0) {
  34985. if (right !== undefined && compare(right, left) < 0) {
  34986. heap[index] = right;
  34987. heap[rightIndex] = node;
  34988. index = rightIndex;
  34989. } else {
  34990. heap[index] = left;
  34991. heap[leftIndex] = node;
  34992. index = leftIndex;
  34993. }
  34994. } else if (right !== undefined && compare(right, node) < 0) {
  34995. heap[index] = right;
  34996. heap[rightIndex] = node;
  34997. index = rightIndex;
  34998. } else {
  34999. // Neither child is smaller. Exit.
  35000. return;
  35001. }
  35002. }
  35003. }
  35004. function compare(a, b) {
  35005. // Compare sort index first, then task id.
  35006. var diff = a.sortIndex - b.sortIndex;
  35007. return diff !== 0 ? diff : a.id - b.id;
  35008. }
  35009. // TODO: Use symbols?
  35010. var NoPriority = 0;
  35011. var ImmediatePriority = 1;
  35012. var UserBlockingPriority = 2;
  35013. var NormalPriority = 3;
  35014. var LowPriority = 4;
  35015. var IdlePriority = 5;
  35016. var runIdCounter = 0;
  35017. var mainThreadIdCounter = 0;
  35018. var profilingStateSize = 4;
  35019. var sharedProfilingBuffer = // $FlowFixMe Flow doesn't know about SharedArrayBuffer
  35020. typeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer
  35021. typeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9
  35022. ;
  35023. var profilingState = sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks
  35024. var PRIORITY = 0;
  35025. var CURRENT_TASK_ID = 1;
  35026. var CURRENT_RUN_ID = 2;
  35027. var QUEUE_SIZE = 3;
  35028. {
  35029. profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue
  35030. // array might include canceled tasks.
  35031. profilingState[QUEUE_SIZE] = 0;
  35032. profilingState[CURRENT_TASK_ID] = 0;
  35033. } // Bytes per element is 4
  35034. var INITIAL_EVENT_LOG_SIZE = 131072;
  35035. var MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes
  35036. var eventLogSize = 0;
  35037. var eventLogBuffer = null;
  35038. var eventLog = null;
  35039. var eventLogIndex = 0;
  35040. var TaskStartEvent = 1;
  35041. var TaskCompleteEvent = 2;
  35042. var TaskErrorEvent = 3;
  35043. var TaskCancelEvent = 4;
  35044. var TaskRunEvent = 5;
  35045. var TaskYieldEvent = 6;
  35046. var SchedulerSuspendEvent = 7;
  35047. var SchedulerResumeEvent = 8;
  35048. function logEvent(entries) {
  35049. if (eventLog !== null) {
  35050. var offset = eventLogIndex;
  35051. eventLogIndex += entries.length;
  35052. if (eventLogIndex + 1 > eventLogSize) {
  35053. eventLogSize *= 2;
  35054. if (eventLogSize > MAX_EVENT_LOG_SIZE) {
  35055. // Using console['error'] to evade Babel and ESLint
  35056. console['error']("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.');
  35057. stopLoggingProfilingEvents();
  35058. return;
  35059. }
  35060. var newEventLog = new Int32Array(eventLogSize * 4);
  35061. newEventLog.set(eventLog);
  35062. eventLogBuffer = newEventLog.buffer;
  35063. eventLog = newEventLog;
  35064. }
  35065. eventLog.set(entries, offset);
  35066. }
  35067. }
  35068. function startLoggingProfilingEvents() {
  35069. eventLogSize = INITIAL_EVENT_LOG_SIZE;
  35070. eventLogBuffer = new ArrayBuffer(eventLogSize * 4);
  35071. eventLog = new Int32Array(eventLogBuffer);
  35072. eventLogIndex = 0;
  35073. }
  35074. function stopLoggingProfilingEvents() {
  35075. var buffer = eventLogBuffer;
  35076. eventLogSize = 0;
  35077. eventLogBuffer = null;
  35078. eventLog = null;
  35079. eventLogIndex = 0;
  35080. return buffer;
  35081. }
  35082. function markTaskStart(task, ms) {
  35083. {
  35084. profilingState[QUEUE_SIZE]++;
  35085. if (eventLog !== null) {
  35086. // performance.now returns a float, representing milliseconds. When the
  35087. // event is logged, it's coerced to an int. Convert to microseconds to
  35088. // maintain extra degrees of precision.
  35089. logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]);
  35090. }
  35091. }
  35092. }
  35093. function markTaskCompleted(task, ms) {
  35094. {
  35095. profilingState[PRIORITY] = NoPriority;
  35096. profilingState[CURRENT_TASK_ID] = 0;
  35097. profilingState[QUEUE_SIZE]--;
  35098. if (eventLog !== null) {
  35099. logEvent([TaskCompleteEvent, ms * 1000, task.id]);
  35100. }
  35101. }
  35102. }
  35103. function markTaskCanceled(task, ms) {
  35104. {
  35105. profilingState[QUEUE_SIZE]--;
  35106. if (eventLog !== null) {
  35107. logEvent([TaskCancelEvent, ms * 1000, task.id]);
  35108. }
  35109. }
  35110. }
  35111. function markTaskErrored(task, ms) {
  35112. {
  35113. profilingState[PRIORITY] = NoPriority;
  35114. profilingState[CURRENT_TASK_ID] = 0;
  35115. profilingState[QUEUE_SIZE]--;
  35116. if (eventLog !== null) {
  35117. logEvent([TaskErrorEvent, ms * 1000, task.id]);
  35118. }
  35119. }
  35120. }
  35121. function markTaskRun(task, ms) {
  35122. {
  35123. runIdCounter++;
  35124. profilingState[PRIORITY] = task.priorityLevel;
  35125. profilingState[CURRENT_TASK_ID] = task.id;
  35126. profilingState[CURRENT_RUN_ID] = runIdCounter;
  35127. if (eventLog !== null) {
  35128. logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]);
  35129. }
  35130. }
  35131. }
  35132. function markTaskYield(task, ms) {
  35133. {
  35134. profilingState[PRIORITY] = NoPriority;
  35135. profilingState[CURRENT_TASK_ID] = 0;
  35136. profilingState[CURRENT_RUN_ID] = 0;
  35137. if (eventLog !== null) {
  35138. logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]);
  35139. }
  35140. }
  35141. }
  35142. function markSchedulerSuspended(ms) {
  35143. {
  35144. mainThreadIdCounter++;
  35145. if (eventLog !== null) {
  35146. logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]);
  35147. }
  35148. }
  35149. }
  35150. function markSchedulerUnsuspended(ms) {
  35151. {
  35152. if (eventLog !== null) {
  35153. logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]);
  35154. }
  35155. }
  35156. }
  35157. /* eslint-disable no-var */
  35158. // Math.pow(2, 30) - 1
  35159. // 0b111111111111111111111111111111
  35160. var maxSigned31BitInt = 1073741823; // Times out immediately
  35161. var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
  35162. var USER_BLOCKING_PRIORITY = 250;
  35163. var NORMAL_PRIORITY_TIMEOUT = 5000;
  35164. var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
  35165. var IDLE_PRIORITY = maxSigned31BitInt; // Tasks are stored on a min heap
  35166. var taskQueue = [];
  35167. var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
  35168. var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
  35169. var currentTask = null;
  35170. var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.
  35171. var isPerformingWork = false;
  35172. var isHostCallbackScheduled = false;
  35173. var isHostTimeoutScheduled = false;
  35174. function advanceTimers(currentTime) {
  35175. // Check for tasks that are no longer delayed and add them to the queue.
  35176. var timer = peek(timerQueue);
  35177. while (timer !== null) {
  35178. if (timer.callback === null) {
  35179. // Timer was cancelled.
  35180. pop(timerQueue);
  35181. } else if (timer.startTime <= currentTime) {
  35182. // Timer fired. Transfer to the task queue.
  35183. pop(timerQueue);
  35184. timer.sortIndex = timer.expirationTime;
  35185. push(taskQueue, timer);
  35186. {
  35187. markTaskStart(timer, currentTime);
  35188. timer.isQueued = true;
  35189. }
  35190. } else {
  35191. // Remaining timers are pending.
  35192. return;
  35193. }
  35194. timer = peek(timerQueue);
  35195. }
  35196. }
  35197. function handleTimeout(currentTime) {
  35198. isHostTimeoutScheduled = false;
  35199. advanceTimers(currentTime);
  35200. if (!isHostCallbackScheduled) {
  35201. if (peek(taskQueue) !== null) {
  35202. isHostCallbackScheduled = true;
  35203. requestHostCallback(flushWork);
  35204. } else {
  35205. var firstTimer = peek(timerQueue);
  35206. if (firstTimer !== null) {
  35207. requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
  35208. }
  35209. }
  35210. }
  35211. }
  35212. function flushWork(hasTimeRemaining, initialTime) {
  35213. {
  35214. markSchedulerUnsuspended(initialTime);
  35215. } // We'll need a host callback the next time work is scheduled.
  35216. isHostCallbackScheduled = false;
  35217. if (isHostTimeoutScheduled) {
  35218. // We scheduled a timeout but it's no longer needed. Cancel it.
  35219. isHostTimeoutScheduled = false;
  35220. cancelHostTimeout();
  35221. }
  35222. isPerformingWork = true;
  35223. var previousPriorityLevel = currentPriorityLevel;
  35224. try {
  35225. if (enableProfiling) {
  35226. try {
  35227. return workLoop(hasTimeRemaining, initialTime);
  35228. } catch (error) {
  35229. if (currentTask !== null) {
  35230. var currentTime = exports.unstable_now();
  35231. markTaskErrored(currentTask, currentTime);
  35232. currentTask.isQueued = false;
  35233. }
  35234. throw error;
  35235. }
  35236. } else {
  35237. // No catch in prod codepath.
  35238. return workLoop(hasTimeRemaining, initialTime);
  35239. }
  35240. } finally {
  35241. currentTask = null;
  35242. currentPriorityLevel = previousPriorityLevel;
  35243. isPerformingWork = false;
  35244. {
  35245. var _currentTime = exports.unstable_now();
  35246. markSchedulerSuspended(_currentTime);
  35247. }
  35248. }
  35249. }
  35250. function workLoop(hasTimeRemaining, initialTime) {
  35251. var currentTime = initialTime;
  35252. advanceTimers(currentTime);
  35253. currentTask = peek(taskQueue);
  35254. while (currentTask !== null && !(enableSchedulerDebugging )) {
  35255. if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
  35256. // This currentTask hasn't expired, and we've reached the deadline.
  35257. break;
  35258. }
  35259. var callback = currentTask.callback;
  35260. if (callback !== null) {
  35261. currentTask.callback = null;
  35262. currentPriorityLevel = currentTask.priorityLevel;
  35263. var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
  35264. markTaskRun(currentTask, currentTime);
  35265. var continuationCallback = callback(didUserCallbackTimeout);
  35266. currentTime = exports.unstable_now();
  35267. if (typeof continuationCallback === 'function') {
  35268. currentTask.callback = continuationCallback;
  35269. markTaskYield(currentTask, currentTime);
  35270. } else {
  35271. {
  35272. markTaskCompleted(currentTask, currentTime);
  35273. currentTask.isQueued = false;
  35274. }
  35275. if (currentTask === peek(taskQueue)) {
  35276. pop(taskQueue);
  35277. }
  35278. }
  35279. advanceTimers(currentTime);
  35280. } else {
  35281. pop(taskQueue);
  35282. }
  35283. currentTask = peek(taskQueue);
  35284. } // Return whether there's additional work
  35285. if (currentTask !== null) {
  35286. return true;
  35287. } else {
  35288. var firstTimer = peek(timerQueue);
  35289. if (firstTimer !== null) {
  35290. requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
  35291. }
  35292. return false;
  35293. }
  35294. }
  35295. function unstable_runWithPriority(priorityLevel, eventHandler) {
  35296. switch (priorityLevel) {
  35297. case ImmediatePriority:
  35298. case UserBlockingPriority:
  35299. case NormalPriority:
  35300. case LowPriority:
  35301. case IdlePriority:
  35302. break;
  35303. default:
  35304. priorityLevel = NormalPriority;
  35305. }
  35306. var previousPriorityLevel = currentPriorityLevel;
  35307. currentPriorityLevel = priorityLevel;
  35308. try {
  35309. return eventHandler();
  35310. } finally {
  35311. currentPriorityLevel = previousPriorityLevel;
  35312. }
  35313. }
  35314. function unstable_next(eventHandler) {
  35315. var priorityLevel;
  35316. switch (currentPriorityLevel) {
  35317. case ImmediatePriority:
  35318. case UserBlockingPriority:
  35319. case NormalPriority:
  35320. // Shift down to normal priority
  35321. priorityLevel = NormalPriority;
  35322. break;
  35323. default:
  35324. // Anything lower than normal priority should remain at the current level.
  35325. priorityLevel = currentPriorityLevel;
  35326. break;
  35327. }
  35328. var previousPriorityLevel = currentPriorityLevel;
  35329. currentPriorityLevel = priorityLevel;
  35330. try {
  35331. return eventHandler();
  35332. } finally {
  35333. currentPriorityLevel = previousPriorityLevel;
  35334. }
  35335. }
  35336. function unstable_wrapCallback(callback) {
  35337. var parentPriorityLevel = currentPriorityLevel;
  35338. return function () {
  35339. // This is a fork of runWithPriority, inlined for performance.
  35340. var previousPriorityLevel = currentPriorityLevel;
  35341. currentPriorityLevel = parentPriorityLevel;
  35342. try {
  35343. return callback.apply(this, arguments);
  35344. } finally {
  35345. currentPriorityLevel = previousPriorityLevel;
  35346. }
  35347. };
  35348. }
  35349. function timeoutForPriorityLevel(priorityLevel) {
  35350. switch (priorityLevel) {
  35351. case ImmediatePriority:
  35352. return IMMEDIATE_PRIORITY_TIMEOUT;
  35353. case UserBlockingPriority:
  35354. return USER_BLOCKING_PRIORITY;
  35355. case IdlePriority:
  35356. return IDLE_PRIORITY;
  35357. case LowPriority:
  35358. return LOW_PRIORITY_TIMEOUT;
  35359. case NormalPriority:
  35360. default:
  35361. return NORMAL_PRIORITY_TIMEOUT;
  35362. }
  35363. }
  35364. function unstable_scheduleCallback(priorityLevel, callback, options) {
  35365. var currentTime = exports.unstable_now();
  35366. var startTime;
  35367. var timeout;
  35368. if (typeof options === 'object' && options !== null) {
  35369. var delay = options.delay;
  35370. if (typeof delay === 'number' && delay > 0) {
  35371. startTime = currentTime + delay;
  35372. } else {
  35373. startTime = currentTime;
  35374. }
  35375. timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel);
  35376. } else {
  35377. timeout = timeoutForPriorityLevel(priorityLevel);
  35378. startTime = currentTime;
  35379. }
  35380. var expirationTime = startTime + timeout;
  35381. var newTask = {
  35382. id: taskIdCounter++,
  35383. callback: callback,
  35384. priorityLevel: priorityLevel,
  35385. startTime: startTime,
  35386. expirationTime: expirationTime,
  35387. sortIndex: -1
  35388. };
  35389. {
  35390. newTask.isQueued = false;
  35391. }
  35392. if (startTime > currentTime) {
  35393. // This is a delayed task.
  35394. newTask.sortIndex = startTime;
  35395. push(timerQueue, newTask);
  35396. if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
  35397. // All tasks are delayed, and this is the task with the earliest delay.
  35398. if (isHostTimeoutScheduled) {
  35399. // Cancel an existing timeout.
  35400. cancelHostTimeout();
  35401. } else {
  35402. isHostTimeoutScheduled = true;
  35403. } // Schedule a timeout.
  35404. requestHostTimeout(handleTimeout, startTime - currentTime);
  35405. }
  35406. } else {
  35407. newTask.sortIndex = expirationTime;
  35408. push(taskQueue, newTask);
  35409. {
  35410. markTaskStart(newTask, currentTime);
  35411. newTask.isQueued = true;
  35412. } // Schedule a host callback, if needed. If we're already performing work,
  35413. // wait until the next time we yield.
  35414. if (!isHostCallbackScheduled && !isPerformingWork) {
  35415. isHostCallbackScheduled = true;
  35416. requestHostCallback(flushWork);
  35417. }
  35418. }
  35419. return newTask;
  35420. }
  35421. function unstable_pauseExecution() {
  35422. }
  35423. function unstable_continueExecution() {
  35424. if (!isHostCallbackScheduled && !isPerformingWork) {
  35425. isHostCallbackScheduled = true;
  35426. requestHostCallback(flushWork);
  35427. }
  35428. }
  35429. function unstable_getFirstCallbackNode() {
  35430. return peek(taskQueue);
  35431. }
  35432. function unstable_cancelCallback(task) {
  35433. {
  35434. if (task.isQueued) {
  35435. var currentTime = exports.unstable_now();
  35436. markTaskCanceled(task, currentTime);
  35437. task.isQueued = false;
  35438. }
  35439. } // Null out the callback to indicate the task has been canceled. (Can't
  35440. // remove from the queue because you can't remove arbitrary nodes from an
  35441. // array based heap, only the first one.)
  35442. task.callback = null;
  35443. }
  35444. function unstable_getCurrentPriorityLevel() {
  35445. return currentPriorityLevel;
  35446. }
  35447. function unstable_shouldYield() {
  35448. var currentTime = exports.unstable_now();
  35449. advanceTimers(currentTime);
  35450. var firstTask = peek(taskQueue);
  35451. return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost();
  35452. }
  35453. var unstable_requestPaint = requestPaint;
  35454. var unstable_Profiling = {
  35455. startLoggingProfilingEvents: startLoggingProfilingEvents,
  35456. stopLoggingProfilingEvents: stopLoggingProfilingEvents,
  35457. sharedProfilingBuffer: sharedProfilingBuffer
  35458. } ;
  35459. exports.unstable_IdlePriority = IdlePriority;
  35460. exports.unstable_ImmediatePriority = ImmediatePriority;
  35461. exports.unstable_LowPriority = LowPriority;
  35462. exports.unstable_NormalPriority = NormalPriority;
  35463. exports.unstable_Profiling = unstable_Profiling;
  35464. exports.unstable_UserBlockingPriority = UserBlockingPriority;
  35465. exports.unstable_cancelCallback = unstable_cancelCallback;
  35466. exports.unstable_continueExecution = unstable_continueExecution;
  35467. exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
  35468. exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
  35469. exports.unstable_next = unstable_next;
  35470. exports.unstable_pauseExecution = unstable_pauseExecution;
  35471. exports.unstable_requestPaint = unstable_requestPaint;
  35472. exports.unstable_runWithPriority = unstable_runWithPriority;
  35473. exports.unstable_scheduleCallback = unstable_scheduleCallback;
  35474. exports.unstable_shouldYield = unstable_shouldYield;
  35475. exports.unstable_wrapCallback = unstable_wrapCallback;
  35476. })();
  35477. }
  35478. /***/ }),
  35479. /***/ "../../node_modules/scheduler/index.js":
  35480. /*!***********************************************************!*\
  35481. !*** C:/Repos/Babylon.js/node_modules/scheduler/index.js ***!
  35482. \***********************************************************/
  35483. /*! no static exports found */
  35484. /***/ (function(module, exports, __webpack_require__) {
  35485. "use strict";
  35486. if (false) {} else {
  35487. module.exports = __webpack_require__(/*! ./cjs/scheduler.development.js */ "../../node_modules/scheduler/cjs/scheduler.development.js");
  35488. }
  35489. /***/ }),
  35490. /***/ "../../node_modules/scheduler/tracing.js":
  35491. /*!*************************************************************!*\
  35492. !*** C:/Repos/Babylon.js/node_modules/scheduler/tracing.js ***!
  35493. \*************************************************************/
  35494. /*! no static exports found */
  35495. /***/ (function(module, exports, __webpack_require__) {
  35496. "use strict";
  35497. if (false) {} else {
  35498. module.exports = __webpack_require__(/*! ./cjs/scheduler-tracing.development.js */ "../../node_modules/scheduler/cjs/scheduler-tracing.development.js");
  35499. }
  35500. /***/ }),
  35501. /***/ "../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
  35502. /*!**********************************************************************************************!*\
  35503. !*** C:/Repos/Babylon.js/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
  35504. \**********************************************************************************************/
  35505. /*! no static exports found */
  35506. /***/ (function(module, exports, __webpack_require__) {
  35507. "use strict";
  35508. var isOldIE = function isOldIE() {
  35509. var memo;
  35510. return function memorize() {
  35511. if (typeof memo === 'undefined') {
  35512. // Test for IE <= 9 as proposed by Browserhacks
  35513. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  35514. // Tests for existence of standard globals is to allow style-loader
  35515. // to operate correctly into non-standard environments
  35516. // @see https://github.com/webpack-contrib/style-loader/issues/177
  35517. memo = Boolean(window && document && document.all && !window.atob);
  35518. }
  35519. return memo;
  35520. };
  35521. }();
  35522. var getTarget = function getTarget() {
  35523. var memo = {};
  35524. return function memorize(target) {
  35525. if (typeof memo[target] === 'undefined') {
  35526. var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
  35527. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  35528. try {
  35529. // This will throw an exception if access to iframe is blocked
  35530. // due to cross-origin restrictions
  35531. styleTarget = styleTarget.contentDocument.head;
  35532. } catch (e) {
  35533. // istanbul ignore next
  35534. styleTarget = null;
  35535. }
  35536. }
  35537. memo[target] = styleTarget;
  35538. }
  35539. return memo[target];
  35540. };
  35541. }();
  35542. var stylesInDom = [];
  35543. function getIndexByIdentifier(identifier) {
  35544. var result = -1;
  35545. for (var i = 0; i < stylesInDom.length; i++) {
  35546. if (stylesInDom[i].identifier === identifier) {
  35547. result = i;
  35548. break;
  35549. }
  35550. }
  35551. return result;
  35552. }
  35553. function modulesToDom(list, options) {
  35554. var idCountMap = {};
  35555. var identifiers = [];
  35556. for (var i = 0; i < list.length; i++) {
  35557. var item = list[i];
  35558. var id = options.base ? item[0] + options.base : item[0];
  35559. var count = idCountMap[id] || 0;
  35560. var identifier = "".concat(id, " ").concat(count);
  35561. idCountMap[id] = count + 1;
  35562. var index = getIndexByIdentifier(identifier);
  35563. var obj = {
  35564. css: item[1],
  35565. media: item[2],
  35566. sourceMap: item[3]
  35567. };
  35568. if (index !== -1) {
  35569. stylesInDom[index].references++;
  35570. stylesInDom[index].updater(obj);
  35571. } else {
  35572. stylesInDom.push({
  35573. identifier: identifier,
  35574. updater: addStyle(obj, options),
  35575. references: 1
  35576. });
  35577. }
  35578. identifiers.push(identifier);
  35579. }
  35580. return identifiers;
  35581. }
  35582. function insertStyleElement(options) {
  35583. var style = document.createElement('style');
  35584. var attributes = options.attributes || {};
  35585. if (typeof attributes.nonce === 'undefined') {
  35586. var nonce = true ? __webpack_require__.nc : undefined;
  35587. if (nonce) {
  35588. attributes.nonce = nonce;
  35589. }
  35590. }
  35591. Object.keys(attributes).forEach(function (key) {
  35592. style.setAttribute(key, attributes[key]);
  35593. });
  35594. if (typeof options.insert === 'function') {
  35595. options.insert(style);
  35596. } else {
  35597. var target = getTarget(options.insert || 'head');
  35598. if (!target) {
  35599. throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  35600. }
  35601. target.appendChild(style);
  35602. }
  35603. return style;
  35604. }
  35605. function removeStyleElement(style) {
  35606. // istanbul ignore if
  35607. if (style.parentNode === null) {
  35608. return false;
  35609. }
  35610. style.parentNode.removeChild(style);
  35611. }
  35612. /* istanbul ignore next */
  35613. var replaceText = function replaceText() {
  35614. var textStore = [];
  35615. return function replace(index, replacement) {
  35616. textStore[index] = replacement;
  35617. return textStore.filter(Boolean).join('\n');
  35618. };
  35619. }();
  35620. function applyToSingletonTag(style, index, remove, obj) {
  35621. var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE
  35622. /* istanbul ignore if */
  35623. if (style.styleSheet) {
  35624. style.styleSheet.cssText = replaceText(index, css);
  35625. } else {
  35626. var cssNode = document.createTextNode(css);
  35627. var childNodes = style.childNodes;
  35628. if (childNodes[index]) {
  35629. style.removeChild(childNodes[index]);
  35630. }
  35631. if (childNodes.length) {
  35632. style.insertBefore(cssNode, childNodes[index]);
  35633. } else {
  35634. style.appendChild(cssNode);
  35635. }
  35636. }
  35637. }
  35638. function applyToTag(style, options, obj) {
  35639. var css = obj.css;
  35640. var media = obj.media;
  35641. var sourceMap = obj.sourceMap;
  35642. if (media) {
  35643. style.setAttribute('media', media);
  35644. } else {
  35645. style.removeAttribute('media');
  35646. }
  35647. if (sourceMap && btoa) {
  35648. css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  35649. } // For old IE
  35650. /* istanbul ignore if */
  35651. if (style.styleSheet) {
  35652. style.styleSheet.cssText = css;
  35653. } else {
  35654. while (style.firstChild) {
  35655. style.removeChild(style.firstChild);
  35656. }
  35657. style.appendChild(document.createTextNode(css));
  35658. }
  35659. }
  35660. var singleton = null;
  35661. var singletonCounter = 0;
  35662. function addStyle(obj, options) {
  35663. var style;
  35664. var update;
  35665. var remove;
  35666. if (options.singleton) {
  35667. var styleIndex = singletonCounter++;
  35668. style = singleton || (singleton = insertStyleElement(options));
  35669. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  35670. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  35671. } else {
  35672. style = insertStyleElement(options);
  35673. update = applyToTag.bind(null, style, options);
  35674. remove = function remove() {
  35675. removeStyleElement(style);
  35676. };
  35677. }
  35678. update(obj);
  35679. return function updateStyle(newObj) {
  35680. if (newObj) {
  35681. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
  35682. return;
  35683. }
  35684. update(obj = newObj);
  35685. } else {
  35686. remove();
  35687. }
  35688. };
  35689. }
  35690. module.exports = function (list, options) {
  35691. options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  35692. // tags it will allow on a page
  35693. if (!options.singleton && typeof options.singleton !== 'boolean') {
  35694. options.singleton = isOldIE();
  35695. }
  35696. list = list || [];
  35697. var lastIdentifiers = modulesToDom(list, options);
  35698. return function update(newList) {
  35699. newList = newList || [];
  35700. if (Object.prototype.toString.call(newList) !== '[object Array]') {
  35701. return;
  35702. }
  35703. for (var i = 0; i < lastIdentifiers.length; i++) {
  35704. var identifier = lastIdentifiers[i];
  35705. var index = getIndexByIdentifier(identifier);
  35706. stylesInDom[index].references--;
  35707. }
  35708. var newLastIdentifiers = modulesToDom(newList, options);
  35709. for (var _i = 0; _i < lastIdentifiers.length; _i++) {
  35710. var _identifier = lastIdentifiers[_i];
  35711. var _index = getIndexByIdentifier(_identifier);
  35712. if (stylesInDom[_index].references === 0) {
  35713. stylesInDom[_index].updater();
  35714. stylesInDom.splice(_index, 1);
  35715. }
  35716. }
  35717. lastIdentifiers = newLastIdentifiers;
  35718. };
  35719. };
  35720. /***/ }),
  35721. /***/ "../../node_modules/tslib/tslib.es6.js":
  35722. /*!***********************************************************!*\
  35723. !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
  35724. \***********************************************************/
  35725. /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
  35726. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35727. "use strict";
  35728. __webpack_require__.r(__webpack_exports__);
  35729. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
  35730. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
  35731. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
  35732. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
  35733. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
  35734. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
  35735. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
  35736. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
  35737. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; });
  35738. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
  35739. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
  35740. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
  35741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
  35742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
  35743. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
  35744. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
  35745. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
  35746. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
  35747. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
  35748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
  35749. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
  35750. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });
  35751. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });
  35752. /*! *****************************************************************************
  35753. Copyright (c) Microsoft Corporation.
  35754. Permission to use, copy, modify, and/or distribute this software for any
  35755. purpose with or without fee is hereby granted.
  35756. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  35757. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  35758. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  35759. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  35760. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  35761. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  35762. PERFORMANCE OF THIS SOFTWARE.
  35763. ***************************************************************************** */
  35764. /* global Reflect, Promise */
  35765. var extendStatics = function(d, b) {
  35766. extendStatics = Object.setPrototypeOf ||
  35767. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  35768. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  35769. return extendStatics(d, b);
  35770. };
  35771. function __extends(d, b) {
  35772. extendStatics(d, b);
  35773. function __() { this.constructor = d; }
  35774. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  35775. }
  35776. var __assign = function() {
  35777. __assign = Object.assign || function __assign(t) {
  35778. for (var s, i = 1, n = arguments.length; i < n; i++) {
  35779. s = arguments[i];
  35780. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  35781. }
  35782. return t;
  35783. }
  35784. return __assign.apply(this, arguments);
  35785. }
  35786. function __rest(s, e) {
  35787. var t = {};
  35788. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  35789. t[p] = s[p];
  35790. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  35791. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  35792. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  35793. t[p[i]] = s[p[i]];
  35794. }
  35795. return t;
  35796. }
  35797. function __decorate(decorators, target, key, desc) {
  35798. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  35799. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  35800. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  35801. return c > 3 && r && Object.defineProperty(target, key, r), r;
  35802. }
  35803. function __param(paramIndex, decorator) {
  35804. return function (target, key) { decorator(target, key, paramIndex); }
  35805. }
  35806. function __metadata(metadataKey, metadataValue) {
  35807. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  35808. }
  35809. function __awaiter(thisArg, _arguments, P, generator) {
  35810. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  35811. return new (P || (P = Promise))(function (resolve, reject) {
  35812. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  35813. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  35814. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  35815. step((generator = generator.apply(thisArg, _arguments || [])).next());
  35816. });
  35817. }
  35818. function __generator(thisArg, body) {
  35819. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  35820. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  35821. function verb(n) { return function (v) { return step([n, v]); }; }
  35822. function step(op) {
  35823. if (f) throw new TypeError("Generator is already executing.");
  35824. while (_) try {
  35825. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  35826. if (y = 0, t) op = [op[0] & 2, t.value];
  35827. switch (op[0]) {
  35828. case 0: case 1: t = op; break;
  35829. case 4: _.label++; return { value: op[1], done: false };
  35830. case 5: _.label++; y = op[1]; op = [0]; continue;
  35831. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  35832. default:
  35833. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  35834. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  35835. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  35836. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  35837. if (t[2]) _.ops.pop();
  35838. _.trys.pop(); continue;
  35839. }
  35840. op = body.call(thisArg, _);
  35841. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  35842. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  35843. }
  35844. }
  35845. var __createBinding = Object.create ? (function(o, m, k, k2) {
  35846. if (k2 === undefined) k2 = k;
  35847. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  35848. }) : (function(o, m, k, k2) {
  35849. if (k2 === undefined) k2 = k;
  35850. o[k2] = m[k];
  35851. });
  35852. function __exportStar(m, o) {
  35853. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
  35854. }
  35855. function __values(o) {
  35856. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  35857. if (m) return m.call(o);
  35858. if (o && typeof o.length === "number") return {
  35859. next: function () {
  35860. if (o && i >= o.length) o = void 0;
  35861. return { value: o && o[i++], done: !o };
  35862. }
  35863. };
  35864. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  35865. }
  35866. function __read(o, n) {
  35867. var m = typeof Symbol === "function" && o[Symbol.iterator];
  35868. if (!m) return o;
  35869. var i = m.call(o), r, ar = [], e;
  35870. try {
  35871. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  35872. }
  35873. catch (error) { e = { error: error }; }
  35874. finally {
  35875. try {
  35876. if (r && !r.done && (m = i["return"])) m.call(i);
  35877. }
  35878. finally { if (e) throw e.error; }
  35879. }
  35880. return ar;
  35881. }
  35882. function __spread() {
  35883. for (var ar = [], i = 0; i < arguments.length; i++)
  35884. ar = ar.concat(__read(arguments[i]));
  35885. return ar;
  35886. }
  35887. function __spreadArrays() {
  35888. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  35889. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  35890. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  35891. r[k] = a[j];
  35892. return r;
  35893. };
  35894. function __await(v) {
  35895. return this instanceof __await ? (this.v = v, this) : new __await(v);
  35896. }
  35897. function __asyncGenerator(thisArg, _arguments, generator) {
  35898. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  35899. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  35900. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  35901. function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  35902. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  35903. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  35904. function fulfill(value) { resume("next", value); }
  35905. function reject(value) { resume("throw", value); }
  35906. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  35907. }
  35908. function __asyncDelegator(o) {
  35909. var i, p;
  35910. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  35911. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  35912. }
  35913. function __asyncValues(o) {
  35914. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  35915. var m = o[Symbol.asyncIterator], i;
  35916. return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  35917. function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
  35918. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  35919. }
  35920. function __makeTemplateObject(cooked, raw) {
  35921. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  35922. return cooked;
  35923. };
  35924. var __setModuleDefault = Object.create ? (function(o, v) {
  35925. Object.defineProperty(o, "default", { enumerable: true, value: v });
  35926. }) : function(o, v) {
  35927. o["default"] = v;
  35928. };
  35929. function __importStar(mod) {
  35930. if (mod && mod.__esModule) return mod;
  35931. var result = {};
  35932. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  35933. __setModuleDefault(result, mod);
  35934. return result;
  35935. }
  35936. function __importDefault(mod) {
  35937. return (mod && mod.__esModule) ? mod : { default: mod };
  35938. }
  35939. function __classPrivateFieldGet(receiver, privateMap) {
  35940. if (!privateMap.has(receiver)) {
  35941. throw new TypeError("attempted to get private field on non-instance");
  35942. }
  35943. return privateMap.get(receiver);
  35944. }
  35945. function __classPrivateFieldSet(receiver, privateMap, value) {
  35946. if (!privateMap.has(receiver)) {
  35947. throw new TypeError("attempted to set private field on non-instance");
  35948. }
  35949. privateMap.set(receiver, value);
  35950. return value;
  35951. }
  35952. /***/ }),
  35953. /***/ "../../node_modules/webpack/buildin/global.js":
  35954. /*!***********************************!*\
  35955. !*** (webpack)/buildin/global.js ***!
  35956. \***********************************/
  35957. /*! no static exports found */
  35958. /***/ (function(module, exports) {
  35959. var g;
  35960. // This works in non-strict mode
  35961. g = (function() {
  35962. return this;
  35963. })();
  35964. try {
  35965. // This works if eval is allowed (see CSP)
  35966. g = g || new Function("return this")();
  35967. } catch (e) {
  35968. // This works if the window reference is available
  35969. if (typeof window === "object") g = window;
  35970. }
  35971. // g can still be undefined, but nothing to do about it...
  35972. // We return undefined, instead of nothing here, so it's
  35973. // easier to handle this case. if(!global) { ...}
  35974. module.exports = g;
  35975. /***/ }),
  35976. /***/ "../../node_modules/webpack/buildin/module.js":
  35977. /*!***********************************!*\
  35978. !*** (webpack)/buildin/module.js ***!
  35979. \***********************************/
  35980. /*! no static exports found */
  35981. /***/ (function(module, exports) {
  35982. module.exports = function(module) {
  35983. if (!module.webpackPolyfill) {
  35984. module.deprecate = function() {};
  35985. module.paths = [];
  35986. // module.parent = undefined by default
  35987. if (!module.children) module.children = [];
  35988. Object.defineProperty(module, "loaded", {
  35989. enumerable: true,
  35990. get: function() {
  35991. return module.l;
  35992. }
  35993. });
  35994. Object.defineProperty(module, "id", {
  35995. enumerable: true,
  35996. get: function() {
  35997. return module.i;
  35998. }
  35999. });
  36000. module.webpackPolyfill = 1;
  36001. }
  36002. return module;
  36003. };
  36004. /***/ }),
  36005. /***/ "./components/guiList/guiList.scss":
  36006. /*!*****************************************!*\
  36007. !*** ./components/guiList/guiList.scss ***!
  36008. \*****************************************/
  36009. /*! no static exports found */
  36010. /***/ (function(module, exports, __webpack_require__) {
  36011. var api = __webpack_require__(/*! ../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  36012. var content = __webpack_require__(/*! !../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./guiList.scss */ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./components/guiList/guiList.scss");
  36013. content = content.__esModule ? content.default : content;
  36014. if (typeof content === 'string') {
  36015. content = [[module.i, content, '']];
  36016. }
  36017. var options = {};
  36018. options.insert = "head";
  36019. options.singleton = false;
  36020. var update = api(content, options);
  36021. module.exports = content.locals || {};
  36022. /***/ }),
  36023. /***/ "./components/guiList/guiListComponent.tsx":
  36024. /*!*************************************************!*\
  36025. !*** ./components/guiList/guiListComponent.tsx ***!
  36026. \*************************************************/
  36027. /*! exports provided: GuiListComponent */
  36028. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36029. "use strict";
  36030. __webpack_require__.r(__webpack_exports__);
  36031. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GuiListComponent", function() { return GuiListComponent; });
  36032. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  36033. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  36034. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  36035. /* harmony import */ var _sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../sharedUiComponents/lines/lineContainerComponent */ "./sharedUiComponents/lines/lineContainerComponent.tsx");
  36036. /* harmony import */ var _sharedUiComponents_lines_draggableLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../sharedUiComponents/lines/draggableLineComponent */ "./sharedUiComponents/lines/draggableLineComponent.tsx");
  36037. __webpack_require__(/*! ./guiList.scss */ "./components/guiList/guiList.scss");
  36038. var GuiListComponent = /** @class */ (function (_super) {
  36039. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GuiListComponent, _super);
  36040. function GuiListComponent(props) {
  36041. var _this = _super.call(this, props) || this;
  36042. _this.state = { filter: "" };
  36043. _this._onResetRequiredObserver = _this.props.globalState.onResetRequiredObservable.add(function () {
  36044. _this.forceUpdate();
  36045. });
  36046. return _this;
  36047. }
  36048. GuiListComponent.prototype.componentWillUnmount = function () {
  36049. this.props.globalState.onResetRequiredObservable.remove(this._onResetRequiredObserver);
  36050. };
  36051. GuiListComponent.prototype.filterContent = function (filter) {
  36052. this.setState({ filter: filter });
  36053. };
  36054. GuiListComponent.prototype.render = function () {
  36055. var _this = this;
  36056. // Block types used to create the menu from
  36057. var allBlocks = {
  36058. Buttons: ["TextButton", "ImageButton"],
  36059. Controls: ["Slider", "Checkbox", "ColorPicker", "VisualKeyboard"],
  36060. Containers: ["DisplayGrid", "Grid", "StackPanel"],
  36061. Shapes: ["Ellipse", "Image", "Line", "Rectangle"],
  36062. Inputs: ["Text", "IntputText", "InputPassword"],
  36063. };
  36064. // Create node menu
  36065. var blockMenu = [];
  36066. for (var key in allBlocks) {
  36067. var blockList = allBlocks[key]
  36068. .filter(function (b) { return !_this.state.filter || b.toLowerCase().indexOf(_this.state.filter.toLowerCase()) !== -1; })
  36069. .sort(function (a, b) { return a.localeCompare(b); })
  36070. .map(function (block, i) {
  36071. return react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_draggableLineComponent__WEBPACK_IMPORTED_MODULE_3__["DraggableLineComponent"], { key: block, data: block, tooltip: GuiListComponent._Tooltips[block] || "" });
  36072. });
  36073. if (blockList.length) {
  36074. blockMenu.push(react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__["LineContainerComponent"], { key: key + " blocks", title: key.replace("__", ": ").replace("_", " "), closed: false }, blockList));
  36075. }
  36076. }
  36077. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "guiList" },
  36078. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "panes" },
  36079. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "pane" },
  36080. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "filter" },
  36081. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("input", { type: "text", placeholder: "Filter", onFocus: function () { return (_this.props.globalState.blockKeyboardEvents = true); }, onBlur: function (evt) {
  36082. _this.props.globalState.blockKeyboardEvents = false;
  36083. }, onChange: function (evt) { return _this.filterContent(evt.target.value); } })),
  36084. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "list-container" }, blockMenu)))));
  36085. };
  36086. GuiListComponent._Tooltips = {
  36087. Button: "A simple button",
  36088. };
  36089. return GuiListComponent;
  36090. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  36091. /***/ }),
  36092. /***/ "./components/log/log.scss":
  36093. /*!*********************************!*\
  36094. !*** ./components/log/log.scss ***!
  36095. \*********************************/
  36096. /*! no static exports found */
  36097. /***/ (function(module, exports, __webpack_require__) {
  36098. var api = __webpack_require__(/*! ../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  36099. var content = __webpack_require__(/*! !../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./log.scss */ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./components/log/log.scss");
  36100. content = content.__esModule ? content.default : content;
  36101. if (typeof content === 'string') {
  36102. content = [[module.i, content, '']];
  36103. }
  36104. var options = {};
  36105. options.insert = "head";
  36106. options.singleton = false;
  36107. var update = api(content, options);
  36108. module.exports = content.locals || {};
  36109. /***/ }),
  36110. /***/ "./components/log/logComponent.tsx":
  36111. /*!*****************************************!*\
  36112. !*** ./components/log/logComponent.tsx ***!
  36113. \*****************************************/
  36114. /*! exports provided: LogEntry, LogComponent */
  36115. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36116. "use strict";
  36117. __webpack_require__.r(__webpack_exports__);
  36118. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogEntry", function() { return LogEntry; });
  36119. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogComponent", function() { return LogComponent; });
  36120. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  36121. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  36122. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  36123. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "../../node_modules/react-dom/index.js");
  36124. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
  36125. __webpack_require__(/*! ./log.scss */ "./components/log/log.scss");
  36126. var LogEntry = /** @class */ (function () {
  36127. function LogEntry(message, isError) {
  36128. this.message = message;
  36129. this.isError = isError;
  36130. }
  36131. return LogEntry;
  36132. }());
  36133. var LogComponent = /** @class */ (function (_super) {
  36134. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LogComponent, _super);
  36135. function LogComponent(props) {
  36136. var _this = _super.call(this, props) || this;
  36137. _this.state = { logs: [] };
  36138. return _this;
  36139. }
  36140. LogComponent.prototype.componentDidMount = function () {
  36141. var _this = this;
  36142. this.props.globalState.onLogRequiredObservable.add(function (log) {
  36143. var newLogArray = _this.state.logs.map(function (number) { return number; });
  36144. newLogArray.push(log);
  36145. _this.setState({ logs: newLogArray });
  36146. });
  36147. };
  36148. LogComponent.prototype.componentDidUpdate = function () {
  36149. var logConsole = react_dom__WEBPACK_IMPORTED_MODULE_2__["findDOMNode"](this.refs["log-console"]);
  36150. if (!logConsole) {
  36151. return;
  36152. }
  36153. logConsole.scrollTop = logConsole.scrollHeight;
  36154. };
  36155. LogComponent.prototype.render = function () {
  36156. var today = new Date();
  36157. var h = today.getHours();
  36158. var m = today.getMinutes();
  36159. var s = today.getSeconds();
  36160. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "log-console", ref: "log-console" }, this.state.logs.map(function (l, i) {
  36161. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { key: i, className: "log" + (l.isError ? " error" : "") }, h + ":" + m + ":" + s + ": " + l.message));
  36162. })));
  36163. };
  36164. return LogComponent;
  36165. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  36166. /***/ }),
  36167. /***/ "./components/propertyTab/propertyTab.scss":
  36168. /*!*************************************************!*\
  36169. !*** ./components/propertyTab/propertyTab.scss ***!
  36170. \*************************************************/
  36171. /*! no static exports found */
  36172. /***/ (function(module, exports, __webpack_require__) {
  36173. var api = __webpack_require__(/*! ../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  36174. var content = __webpack_require__(/*! !../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./propertyTab.scss */ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./components/propertyTab/propertyTab.scss");
  36175. content = content.__esModule ? content.default : content;
  36176. if (typeof content === 'string') {
  36177. content = [[module.i, content, '']];
  36178. }
  36179. var options = {};
  36180. options.insert = "head";
  36181. options.singleton = false;
  36182. var update = api(content, options);
  36183. module.exports = content.locals || {};
  36184. /***/ }),
  36185. /***/ "./components/propertyTab/propertyTabComponent.tsx":
  36186. /*!*********************************************************!*\
  36187. !*** ./components/propertyTab/propertyTabComponent.tsx ***!
  36188. \*********************************************************/
  36189. /*! exports provided: PropertyTabComponent */
  36190. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36191. "use strict";
  36192. __webpack_require__.r(__webpack_exports__);
  36193. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyTabComponent", function() { return PropertyTabComponent; });
  36194. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  36195. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  36196. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  36197. /* harmony import */ var _sharedUiComponents_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../sharedUiComponents/lines/buttonLineComponent */ "./sharedUiComponents/lines/buttonLineComponent.tsx");
  36198. /* harmony import */ var _sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../sharedUiComponents/lines/lineContainerComponent */ "./sharedUiComponents/lines/lineContainerComponent.tsx");
  36199. /* harmony import */ var _sharedUiComponents_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../sharedUiComponents/lines/fileButtonLineComponent */ "./sharedUiComponents/lines/fileButtonLineComponent.tsx");
  36200. /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
  36201. /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_5__);
  36202. /* harmony import */ var _sharedUiComponents_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../sharedUiComponents/lines/checkBoxLineComponent */ "./sharedUiComponents/lines/checkBoxLineComponent.tsx");
  36203. /* harmony import */ var _diagram_guiNode__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../diagram/guiNode */ "./diagram/guiNode.ts");
  36204. /* harmony import */ var _sharedUiComponents_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../sharedUiComponents/lines/textLineComponent */ "./sharedUiComponents/lines/textLineComponent.tsx");
  36205. /* harmony import */ var _serializationTools__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../serializationTools */ "./serializationTools.ts");
  36206. __webpack_require__(/*! ./propertyTab.scss */ "./components/propertyTab/propertyTab.scss");
  36207. var PropertyTabComponent = /** @class */ (function (_super) {
  36208. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PropertyTabComponent, _super);
  36209. function PropertyTabComponent(props) {
  36210. var _this = _super.call(this, props) || this;
  36211. _this.state = { currentNode: null };
  36212. return _this;
  36213. }
  36214. PropertyTabComponent.prototype.componentDidMount = function () {
  36215. var _this = this;
  36216. this.props.globalState.onSelectionChangedObservable.add(function (selection) {
  36217. if (selection instanceof _diagram_guiNode__WEBPACK_IMPORTED_MODULE_7__["GUINode"]) {
  36218. _this.setState({ currentNode: selection });
  36219. }
  36220. else {
  36221. _this.setState({ currentNode: null });
  36222. }
  36223. });
  36224. this._onBuiltObserver = this.props.globalState.onBuiltObservable.add(function () {
  36225. _this.forceUpdate();
  36226. });
  36227. };
  36228. PropertyTabComponent.prototype.componentWillUnmount = function () {
  36229. this.props.globalState.onBuiltObservable.remove(this._onBuiltObserver);
  36230. };
  36231. PropertyTabComponent.prototype.load = function (file) {
  36232. var _this = this;
  36233. babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_5__["Tools"].ReadFile(file, function (data) {
  36234. var decoder = new TextDecoder("utf-8");
  36235. _serializationTools__WEBPACK_IMPORTED_MODULE_9__["SerializationTools"].Deserialize(JSON.parse(decoder.decode(data)), _this.props.globalState);
  36236. _this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
  36237. }, undefined, true);
  36238. };
  36239. PropertyTabComponent.prototype.loadFrame = function (file) {
  36240. babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_5__["Tools"].ReadFile(file, function (data) {
  36241. // get Frame Data from file
  36242. //let decoder = new TextDecoder("utf-8");
  36243. // const frameData = JSON.parse(decoder.decode(data));
  36244. // SerializationTools.AddFrameToMaterial(frameData, this.props.globalState, this.props.globalState.nodeMaterial);
  36245. }, undefined, true);
  36246. };
  36247. PropertyTabComponent.prototype.save = function () {
  36248. //let json = SerializationTools.Serialize(this.props.globalState.nodeMaterial, this.props.globalState);
  36249. //StringTools.DownloadAsFile(this.props.globalState.hostDocument, json, "nodeMaterial.json");
  36250. };
  36251. PropertyTabComponent.prototype.customSave = function () {
  36252. /*this.props.globalState.onLogRequiredObservable.notifyObservers({message: "Saving your material to Babylon.js snippet server...", isError: false});
  36253. this.props.globalState.customSave!.action(SerializationTools.Serialize(this.props.globalState.nodeMaterial, this.props.globalState)).then(() => {
  36254. this.props.globalState.onLogRequiredObservable.notifyObservers({message: "Material saved successfully", isError: false});
  36255. }).catch((err) => {
  36256. this.props.globalState.onLogRequiredObservable.notifyObservers({message: err, isError: true});
  36257. });*/
  36258. };
  36259. PropertyTabComponent.prototype.saveToSnippetServer = function () {
  36260. /*const material = this.props.globalState.nodeMaterial;
  36261. const xmlHttp = new XMLHttpRequest();
  36262. let json = SerializationTools.Serialize(material, this.props.globalState);
  36263. xmlHttp.onreadystatechange = () => {
  36264. if (xmlHttp.readyState == 4) {
  36265. if (xmlHttp.status == 200) {
  36266. var snippet = JSON.parse(xmlHttp.responseText);
  36267. const oldId = material.snippetId;
  36268. material.snippetId = snippet.id;
  36269. if (snippet.version && snippet.version != "0") {
  36270. material.snippetId += "#" + snippet.version;
  36271. }
  36272. this.forceUpdate();
  36273. if (navigator.clipboard) {
  36274. navigator.clipboard.writeText(material.snippetId);
  36275. }
  36276. let windowAsAny = window as any;
  36277. if (windowAsAny.Playground && oldId) {
  36278. windowAsAny.Playground.onRequestCodeChangeObservable.notifyObservers({
  36279. regex: new RegExp(oldId, "g"),
  36280. replace: material.snippetId
  36281. });
  36282. }
  36283. this.props.globalState.hostDocument.defaultView!.alert("NodeMaterial saved with ID: " + material.snippetId + " (please note that the id was also saved to your clipboard)");
  36284. }
  36285. else {
  36286. this.props.globalState.hostDocument.defaultView!.alert(`Unable to save your node material. It may be too large (${(dataToSend.payload.length / 1024).toFixed(2)} KB) because of embedded textures. Please reduce texture sizes or point to a specific url instead of embedding them and try again.`);
  36287. }
  36288. }
  36289. };
  36290. xmlHttp.open("POST", NodeMaterial.SnippetUrl + (material.snippetId ? "/" + material.snippetId : ""), true);
  36291. xmlHttp.setRequestHeader("Content-Type", "application/json");
  36292. var dataToSend = {
  36293. payload : JSON.stringify({
  36294. nodeMaterial: json
  36295. }),
  36296. name: "",
  36297. description: "",
  36298. tags: ""
  36299. };
  36300. xmlHttp.send(JSON.stringify(dataToSend));*/
  36301. };
  36302. PropertyTabComponent.prototype.loadFromSnippet = function () {
  36303. /*const material = this.props.globalState.nodeMaterial;
  36304. const scene = material.getScene();
  36305. let snippedID = window.prompt("Please enter the snippet ID to use");
  36306. if (!snippedID) {
  36307. return;
  36308. }
  36309. this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
  36310. NodeMaterial.ParseFromSnippetAsync(snippedID, scene, "", material).then(() => {
  36311. material.build();
  36312. if (!this.changeMode(this.props.globalState.nodeMaterial!.mode, true, false)) {
  36313. this.props.globalState.onResetRequiredObservable.notifyObservers();
  36314. }
  36315. }).catch((err) => {
  36316. this.props.globalState.hostDocument.defaultView!.alert("Unable to load your node material: " + err);
  36317. });*/
  36318. };
  36319. PropertyTabComponent.prototype.render = function () {
  36320. var _this = this;
  36321. var _a;
  36322. if (this.state.currentNode) {
  36323. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "propertyTab" },
  36324. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "header" },
  36325. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("img", { id: "logo", src: "https://www.babylonjs.com/Assets/logo-babylonjs-social-twitter.png" }),
  36326. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "title" }, "GUI EDITOR")), (_a = this.state.currentNode) === null || _a === void 0 ? void 0 :
  36327. _a.renderProperties()));
  36328. }
  36329. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "propertyTab" },
  36330. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "header" },
  36331. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("img", { id: "logo", src: "https://www.babylonjs.com/Assets/logo-babylonjs-social-twitter.png" }),
  36332. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "title" }, "GUI EDITOR")),
  36333. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", null,
  36334. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { title: "GENERAL" },
  36335. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_8__["TextLineComponent"], { label: "Version", value: babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_5__["Engine"].Version }),
  36336. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_8__["TextLineComponent"], { label: "Help", value: "doc.babylonjs.com", underline: true, onLink: function () { return window.open('https://doc.babylonjs.com', '_blank'); } }),
  36337. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__["ButtonLineComponent"], { label: "Reset to default", onClick: function () {
  36338. _this.props.globalState.onResetRequiredObservable.notifyObservers();
  36339. } })),
  36340. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { title: "OPTIONS" },
  36341. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__["CheckBoxLineComponent"], { label: "Show grid", isSelected: function () { return babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_5__["DataStorage"].ReadBoolean("ShowGrid", true); }, onSelect: function (value) {
  36342. babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_5__["DataStorage"].WriteBoolean("ShowGrid", value);
  36343. } })),
  36344. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { title: "FILE" },
  36345. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_4__["FileButtonLineComponent"], { label: "Load", onClick: function (file) { return _this.load(file); }, accept: ".json" }),
  36346. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__["ButtonLineComponent"], { label: "Save", onClick: function () {
  36347. _this.save();
  36348. } }),
  36349. this.props.globalState.customSave &&
  36350. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__["ButtonLineComponent"], { label: this.props.globalState.customSave.label, onClick: function () {
  36351. _this.customSave();
  36352. } })),
  36353. !this.props.globalState.customSave &&
  36354. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { title: "SNIPPET" },
  36355. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__["ButtonLineComponent"], { label: "Load from snippet server", onClick: function () { return _this.loadFromSnippet(); } }),
  36356. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__["ButtonLineComponent"], { label: "Save to snippet server", onClick: function () {
  36357. _this.saveToSnippetServer();
  36358. } })))));
  36359. };
  36360. return PropertyTabComponent;
  36361. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  36362. /***/ }),
  36363. /***/ "./diagram/guiNode.ts":
  36364. /*!****************************!*\
  36365. !*** ./diagram/guiNode.ts ***!
  36366. \****************************/
  36367. /*! exports provided: GUINode */
  36368. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36369. "use strict";
  36370. __webpack_require__.r(__webpack_exports__);
  36371. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GUINode", function() { return GUINode; });
  36372. /* harmony import */ var _propertyLedger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./propertyLedger */ "./diagram/propertyLedger.ts");
  36373. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  36374. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  36375. /* harmony import */ var _properties_genericNodePropertyComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./properties/genericNodePropertyComponent */ "./diagram/properties/genericNodePropertyComponent.tsx");
  36376. var GUINode = /** @class */ (function () {
  36377. function GUINode(globalState, guiControl) {
  36378. var _this = this;
  36379. this.guiControl = guiControl;
  36380. this._x = 0;
  36381. this._y = 0;
  36382. this._gridAlignedX = 0;
  36383. this._gridAlignedY = 0;
  36384. this._isVisible = true;
  36385. this._enclosingFrameId = -1;
  36386. this._globalState = globalState;
  36387. this._ownerCanvas = this._globalState.workbench;
  36388. guiControl.onPointerUpObservable.add(function (evt) {
  36389. _this.clicked = false;
  36390. console.log("up");
  36391. });
  36392. guiControl.onPointerDownObservable.add(function (evt) {
  36393. _this.clicked = true;
  36394. _this.isSelected = true;
  36395. console.log("down");
  36396. });
  36397. guiControl.onPointerEnterObservable.add(function (evt) {
  36398. _this._ownerCanvas.isOverGUINode = true;
  36399. console.log("in");
  36400. });
  36401. guiControl.onPointerOutObservable.add(function (evt) {
  36402. _this._ownerCanvas.isOverGUINode = false;
  36403. console.log("out");
  36404. });
  36405. //TODO: Implement
  36406. this._onSelectionBoxMovedObserver = this._globalState.onSelectionBoxMoved.add(function (rect1) {
  36407. });
  36408. }
  36409. Object.defineProperty(GUINode.prototype, "isVisible", {
  36410. get: function () {
  36411. return this._isVisible;
  36412. },
  36413. set: function (value) {
  36414. this._isVisible = value;
  36415. },
  36416. enumerable: false,
  36417. configurable: true
  36418. });
  36419. Object.defineProperty(GUINode.prototype, "gridAlignedX", {
  36420. get: function () {
  36421. return this._gridAlignedX;
  36422. },
  36423. enumerable: false,
  36424. configurable: true
  36425. });
  36426. Object.defineProperty(GUINode.prototype, "gridAlignedY", {
  36427. get: function () {
  36428. return this._gridAlignedY;
  36429. },
  36430. enumerable: false,
  36431. configurable: true
  36432. });
  36433. Object.defineProperty(GUINode.prototype, "x", {
  36434. get: function () {
  36435. return this._x;
  36436. },
  36437. set: function (value) {
  36438. if (this._x === value) {
  36439. return;
  36440. }
  36441. this._x = value;
  36442. this._gridAlignedX = this._ownerCanvas.getGridPosition(value);
  36443. },
  36444. enumerable: false,
  36445. configurable: true
  36446. });
  36447. Object.defineProperty(GUINode.prototype, "y", {
  36448. get: function () {
  36449. return this._y;
  36450. },
  36451. set: function (value) {
  36452. if (this._y === value) {
  36453. return;
  36454. }
  36455. this._y = value;
  36456. this._gridAlignedY = this._ownerCanvas.getGridPosition(value);
  36457. },
  36458. enumerable: false,
  36459. configurable: true
  36460. });
  36461. Object.defineProperty(GUINode.prototype, "width", {
  36462. get: function () {
  36463. return this.guiControl.widthInPixels;
  36464. },
  36465. enumerable: false,
  36466. configurable: true
  36467. });
  36468. Object.defineProperty(GUINode.prototype, "height", {
  36469. get: function () {
  36470. return this.guiControl.heightInPixels;
  36471. },
  36472. enumerable: false,
  36473. configurable: true
  36474. });
  36475. Object.defineProperty(GUINode.prototype, "id", {
  36476. get: function () {
  36477. return this.guiControl.uniqueId;
  36478. },
  36479. enumerable: false,
  36480. configurable: true
  36481. });
  36482. Object.defineProperty(GUINode.prototype, "name", {
  36483. get: function () {
  36484. return this.guiControl.name;
  36485. },
  36486. enumerable: false,
  36487. configurable: true
  36488. });
  36489. Object.defineProperty(GUINode.prototype, "isSelected", {
  36490. get: function () {
  36491. return this._isSelected;
  36492. },
  36493. set: function (value) {
  36494. this._isSelected = value;
  36495. if (value) {
  36496. this._globalState.onSelectionChangedObservable.notifyObservers(this);
  36497. }
  36498. },
  36499. enumerable: false,
  36500. configurable: true
  36501. });
  36502. Object.defineProperty(GUINode.prototype, "enclosingFrameId", {
  36503. get: function () {
  36504. return this._enclosingFrameId;
  36505. },
  36506. set: function (value) {
  36507. this._enclosingFrameId = value;
  36508. },
  36509. enumerable: false,
  36510. configurable: true
  36511. });
  36512. GUINode.prototype.cleanAccumulation = function (useCeil) {
  36513. if (useCeil === void 0) { useCeil = false; }
  36514. this.x = this._ownerCanvas.getGridPosition(this.x, useCeil);
  36515. this.y = this._ownerCanvas.getGridPosition(this.y, useCeil);
  36516. };
  36517. GUINode.prototype._onMove = function (evt, startPos) {
  36518. if (!this.clicked)
  36519. return false;
  36520. console.log("moving");
  36521. //TODO: Implement move with zoom factor.
  36522. var newX = (evt.x - startPos.x); // / this._ownerCanvas.zoom;
  36523. var newY = (evt.y - startPos.y); // / this._ownerCanvas.zoom;
  36524. this.x += newX;
  36525. this.y += newY;
  36526. return true;
  36527. //evt.stopPropagation();
  36528. };
  36529. GUINode.prototype.renderProperties = function () {
  36530. var className = this.guiControl.getClassName();
  36531. var control = _propertyLedger__WEBPACK_IMPORTED_MODULE_0__["PropertyGuiLedger"].RegisteredControls[className];
  36532. if (!control) {
  36533. control = _properties_genericNodePropertyComponent__WEBPACK_IMPORTED_MODULE_2__["GenericPropertyComponent"];
  36534. }
  36535. return react__WEBPACK_IMPORTED_MODULE_1__["createElement"](control, {
  36536. globalState: this._globalState,
  36537. guiControl: this.guiControl
  36538. });
  36539. };
  36540. GUINode.prototype.updateVisual = function () {
  36541. this.guiControl.leftInPixels = this.x;
  36542. this.guiControl.topInPixels = this.y;
  36543. };
  36544. GUINode.prototype.dispose = function () {
  36545. // notify frame observers that this node is being deleted
  36546. this._globalState.onGuiNodeRemovalObservable.notifyObservers(this);
  36547. if (this._onSelectionChangedObserver) {
  36548. this._globalState.onSelectionChangedObservable.remove(this._onSelectionChangedObserver);
  36549. }
  36550. if (this._onUpdateRequiredObserver) {
  36551. this._globalState.onUpdateRequiredObservable.remove(this._onUpdateRequiredObserver);
  36552. }
  36553. if (this._onSelectionBoxMovedObserver) {
  36554. this._globalState.onSelectionBoxMoved.remove(this._onSelectionBoxMovedObserver);
  36555. }
  36556. this.guiControl.dispose();
  36557. };
  36558. return GUINode;
  36559. }());
  36560. /***/ }),
  36561. /***/ "./diagram/properties/genericNodePropertyComponent.tsx":
  36562. /*!*************************************************************!*\
  36563. !*** ./diagram/properties/genericNodePropertyComponent.tsx ***!
  36564. \*************************************************************/
  36565. /*! exports provided: GenericPropertyComponent, GeneralPropertyTabComponent, GenericPropertyTabComponent */
  36566. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36567. "use strict";
  36568. __webpack_require__.r(__webpack_exports__);
  36569. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GenericPropertyComponent", function() { return GenericPropertyComponent; });
  36570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeneralPropertyTabComponent", function() { return GeneralPropertyTabComponent; });
  36571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GenericPropertyTabComponent", function() { return GenericPropertyTabComponent; });
  36572. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  36573. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  36574. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  36575. /* harmony import */ var _sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../sharedUiComponents/lines/lineContainerComponent */ "./sharedUiComponents/lines/lineContainerComponent.tsx");
  36576. /* harmony import */ var _sharedUiComponents_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../sharedUiComponents/lines/checkBoxLineComponent */ "./sharedUiComponents/lines/checkBoxLineComponent.tsx");
  36577. /* harmony import */ var _sharedComponents_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../sharedComponents/floatLineComponent */ "./sharedComponents/floatLineComponent.tsx");
  36578. /* harmony import */ var _sharedComponents_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../sharedComponents/sliderLineComponent */ "./sharedComponents/sliderLineComponent.tsx");
  36579. /* harmony import */ var babylonjs_Materials_Node_nodeMaterialDecorator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! babylonjs/Materials/Node/nodeMaterialDecorator */ "babylonjs/Misc/observable");
  36580. /* harmony import */ var babylonjs_Materials_Node_nodeMaterialDecorator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_Node_nodeMaterialDecorator__WEBPACK_IMPORTED_MODULE_6__);
  36581. var GenericPropertyComponent = /** @class */ (function (_super) {
  36582. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GenericPropertyComponent, _super);
  36583. function GenericPropertyComponent(props) {
  36584. return _super.call(this, props) || this;
  36585. }
  36586. GenericPropertyComponent.prototype.render = function () {
  36587. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null,
  36588. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](GeneralPropertyTabComponent, { globalState: this.props.globalState, guiControl: this.props.guiControl }),
  36589. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](GenericPropertyTabComponent, { globalState: this.props.globalState, guiControl: this.props.guiControl })));
  36590. };
  36591. return GenericPropertyComponent;
  36592. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  36593. var GeneralPropertyTabComponent = /** @class */ (function (_super) {
  36594. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GeneralPropertyTabComponent, _super);
  36595. function GeneralPropertyTabComponent(props) {
  36596. return _super.call(this, props) || this;
  36597. }
  36598. GeneralPropertyTabComponent.prototype.render = function () {
  36599. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null,
  36600. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__["LineContainerComponent"], { title: "GENERAL" })));
  36601. };
  36602. return GeneralPropertyTabComponent;
  36603. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  36604. var GenericPropertyTabComponent = /** @class */ (function (_super) {
  36605. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GenericPropertyTabComponent, _super);
  36606. function GenericPropertyTabComponent(props) {
  36607. return _super.call(this, props) || this;
  36608. }
  36609. GenericPropertyTabComponent.prototype.forceRebuild = function (notifiers) {
  36610. if (!notifiers || notifiers.update) {
  36611. this.props.globalState.onUpdateRequiredObservable.notifyObservers();
  36612. }
  36613. if (!notifiers || notifiers.rebuild) {
  36614. this.props.globalState.onRebuildRequiredObservable.notifyObservers();
  36615. }
  36616. };
  36617. GenericPropertyTabComponent.prototype.render = function () {
  36618. var _this = this;
  36619. var block = this.props.guiControl, propStore = block._propStore;
  36620. if (!propStore) {
  36621. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null));
  36622. }
  36623. var componentList = {}, groups = [];
  36624. var _loop_1 = function (propertyName, displayName, type, groupName, options) {
  36625. var components = componentList[groupName];
  36626. if (!components) {
  36627. components = [];
  36628. componentList[groupName] = components;
  36629. groups.push(groupName);
  36630. }
  36631. switch (type) {
  36632. case babylonjs_Materials_Node_nodeMaterialDecorator__WEBPACK_IMPORTED_MODULE_6__["PropertyTypeForEdition"].Boolean: {
  36633. components.push(react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__["CheckBoxLineComponent"], { label: displayName, target: this_1.props.guiControl, propertyName: propertyName, onValueChanged: function () { return _this.forceRebuild(options.notifiers); } }));
  36634. break;
  36635. }
  36636. case babylonjs_Materials_Node_nodeMaterialDecorator__WEBPACK_IMPORTED_MODULE_6__["PropertyTypeForEdition"].Float: {
  36637. var cantDisplaySlider = (isNaN(options.min) || isNaN(options.max) || options.min === options.max);
  36638. if (cantDisplaySlider) {
  36639. components.push(react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedComponents_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__["FloatLineComponent"], { globalState: this_1.props.globalState, label: displayName, propertyName: propertyName, target: this_1.props.guiControl, onChange: function () { return _this.forceRebuild(options.notifiers); } }));
  36640. }
  36641. else {
  36642. components.push(react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedComponents_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__["SliderLineComponent"], { label: displayName, target: this_1.props.guiControl, globalState: this_1.props.globalState, propertyName: propertyName, step: Math.abs(options.max - options.min) / 100.0, minimum: Math.min(options.min, options.max), maximum: options.max, onChange: function () { return _this.forceRebuild(options.notifiers); } }));
  36643. }
  36644. break;
  36645. }
  36646. }
  36647. };
  36648. var this_1 = this;
  36649. for (var _i = 0, propStore_1 = propStore; _i < propStore_1.length; _i++) {
  36650. var _a = propStore_1[_i], propertyName = _a.propertyName, displayName = _a.displayName, type = _a.type, groupName = _a.groupName, options = _a.options;
  36651. _loop_1(propertyName, displayName, type, groupName, options);
  36652. }
  36653. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, groups.map(function (group) {
  36654. return react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__["LineContainerComponent"], { title: group }, componentList[group]);
  36655. })));
  36656. };
  36657. return GenericPropertyTabComponent;
  36658. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  36659. /***/ }),
  36660. /***/ "./diagram/properties/sliderGuiPropertyComponent.tsx":
  36661. /*!***********************************************************!*\
  36662. !*** ./diagram/properties/sliderGuiPropertyComponent.tsx ***!
  36663. \***********************************************************/
  36664. /*! exports provided: SliderPropertyTabComponent */
  36665. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36666. "use strict";
  36667. __webpack_require__.r(__webpack_exports__);
  36668. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SliderPropertyTabComponent", function() { return SliderPropertyTabComponent; });
  36669. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  36670. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  36671. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  36672. /* harmony import */ var _sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../sharedUiComponents/lines/lineContainerComponent */ "./sharedUiComponents/lines/lineContainerComponent.tsx");
  36673. /* harmony import */ var _genericNodePropertyComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./genericNodePropertyComponent */ "./diagram/properties/genericNodePropertyComponent.tsx");
  36674. /* harmony import */ var _sharedComponents_numericInputComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../sharedComponents/numericInputComponent */ "./sharedComponents/numericInputComponent.tsx");
  36675. /* harmony import */ var _sharedUiComponents_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../sharedUiComponents/lines/textLineComponent */ "./sharedUiComponents/lines/textLineComponent.tsx");
  36676. var SliderPropertyTabComponent = /** @class */ (function (_super) {
  36677. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SliderPropertyTabComponent, _super);
  36678. function SliderPropertyTabComponent(props) {
  36679. var _this = _super.call(this, props) || this;
  36680. _this._slider = _this.props.guiControl;
  36681. return _this;
  36682. }
  36683. SliderPropertyTabComponent.prototype.render = function () {
  36684. var _this = this;
  36685. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null,
  36686. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_genericNodePropertyComponent__WEBPACK_IMPORTED_MODULE_3__["GeneralPropertyTabComponent"], { globalState: this.props.globalState, guiControl: this.props.guiControl }),
  36687. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__["LineContainerComponent"], { title: "PROPERTIES" },
  36688. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedComponents_numericInputComponent__WEBPACK_IMPORTED_MODULE_4__["NumericInputComponent"], { globalState: this.props.globalState, label: "Minimum Value", value: this._slider.minimum, onChange: function (evt) {
  36689. _this._slider.minimum = evt;
  36690. } }),
  36691. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedComponents_numericInputComponent__WEBPACK_IMPORTED_MODULE_4__["NumericInputComponent"], { globalState: this.props.globalState, label: "Maximum Value", value: this._slider.maximum, onChange: function (evt) {
  36692. _this._slider.maximum = evt;
  36693. } }),
  36694. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedComponents_numericInputComponent__WEBPACK_IMPORTED_MODULE_4__["NumericInputComponent"], { globalState: this.props.globalState, label: "Value", value: this._slider.value, onChange: function (evt) {
  36695. _this._slider.value = evt;
  36696. } }),
  36697. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedComponents_numericInputComponent__WEBPACK_IMPORTED_MODULE_4__["NumericInputComponent"], { globalState: this.props.globalState, label: "Height", value: this._slider.heightInPixels, onChange: function (evt) {
  36698. _this._slider.height = evt;
  36699. } }),
  36700. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedComponents_numericInputComponent__WEBPACK_IMPORTED_MODULE_4__["NumericInputComponent"], { globalState: this.props.globalState, label: "Width", value: this._slider.widthInPixels, onChange: function (evt) {
  36701. _this._slider.width = evt;
  36702. } }),
  36703. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedUiComponents_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__["TextLineComponent"], { label: "Color", value: this._slider.background }))));
  36704. };
  36705. return SliderPropertyTabComponent;
  36706. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  36707. /***/ }),
  36708. /***/ "./diagram/propertyLedger.ts":
  36709. /*!***********************************!*\
  36710. !*** ./diagram/propertyLedger.ts ***!
  36711. \***********************************/
  36712. /*! exports provided: PropertyGuiLedger */
  36713. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36714. "use strict";
  36715. __webpack_require__.r(__webpack_exports__);
  36716. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGuiLedger", function() { return PropertyGuiLedger; });
  36717. /* harmony import */ var _properties_sliderGuiPropertyComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./properties/sliderGuiPropertyComponent */ "./diagram/properties/sliderGuiPropertyComponent.tsx");
  36718. var PropertyGuiLedger = /** @class */ (function () {
  36719. function PropertyGuiLedger() {
  36720. }
  36721. PropertyGuiLedger.RegisteredControls = {};
  36722. return PropertyGuiLedger;
  36723. }());
  36724. PropertyGuiLedger.RegisteredControls["Slider"] = _properties_sliderGuiPropertyComponent__WEBPACK_IMPORTED_MODULE_0__["SliderPropertyTabComponent"];
  36725. /***/ }),
  36726. /***/ "./diagram/workbench.tsx":
  36727. /*!*******************************!*\
  36728. !*** ./diagram/workbench.tsx ***!
  36729. \*******************************/
  36730. /*! exports provided: isFramePortData, WorkbenchComponent */
  36731. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36732. "use strict";
  36733. __webpack_require__.r(__webpack_exports__);
  36734. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFramePortData", function() { return isFramePortData; });
  36735. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchComponent", function() { return WorkbenchComponent; });
  36736. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  36737. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  36738. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  36739. /* harmony import */ var _guiNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./guiNode */ "./diagram/guiNode.ts");
  36740. /* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dagre */ "../../node_modules/dagre/index.js");
  36741. /* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_3__);
  36742. /* harmony import */ var babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babylonjs/Misc/dataStorage */ "babylonjs/Misc/observable");
  36743. /* harmony import */ var babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__);
  36744. /* harmony import */ var babylonjs_gui_2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! babylonjs-gui/2D/advancedDynamicTexture */ "babylonjs-gui/2D/controls/button");
  36745. /* harmony import */ var babylonjs_gui_2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(babylonjs_gui_2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_5__);
  36746. __webpack_require__(/*! ./workbenchCanvas.scss */ "./diagram/workbenchCanvas.scss");
  36747. var isFramePortData = function (variableToCheck) {
  36748. if (variableToCheck) {
  36749. return variableToCheck !== undefined;
  36750. }
  36751. else
  36752. return false;
  36753. };
  36754. var WorkbenchComponent = /** @class */ (function (_super) {
  36755. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(WorkbenchComponent, _super);
  36756. function WorkbenchComponent(props) {
  36757. var _this = _super.call(this, props) || this;
  36758. _this.MinZoom = 0.1;
  36759. _this.MaxZoom = 4;
  36760. _this._guiNodes = [];
  36761. _this._mouseStartPointX = null;
  36762. _this._mouseStartPointY = null;
  36763. _this._selectionStartX = 0;
  36764. _this._selectionStartY = 0;
  36765. _this._x = 0;
  36766. _this._y = 0;
  36767. _this._zoom = 1;
  36768. _this._selectedGuiNodes = [];
  36769. _this._gridSize = 20;
  36770. _this._selectionBox = null;
  36771. _this._frameCandidate = null;
  36772. _this._altKeyIsPressed = false;
  36773. _this._ctrlKeyIsPressed = false;
  36774. _this._oldY = -1;
  36775. _this._frameIsMoving = false;
  36776. _this._isLoading = false;
  36777. _this.isOverGUINode = false;
  36778. props.globalState.onSelectionChangedObservable.add(function (selection) {
  36779. console.log(selection);
  36780. _this.selectedGuiNodes.forEach(function (element) {
  36781. element.isSelected = false;
  36782. });
  36783. if (!selection) {
  36784. _this._selectedGuiNodes = [];
  36785. }
  36786. else {
  36787. if (selection instanceof _guiNode__WEBPACK_IMPORTED_MODULE_2__["GUINode"]) {
  36788. if (_this._ctrlKeyIsPressed) {
  36789. if (_this._selectedGuiNodes.indexOf(selection) === -1) {
  36790. _this._selectedGuiNodes.push(selection);
  36791. }
  36792. }
  36793. else {
  36794. _this._selectedGuiNodes = [selection];
  36795. }
  36796. }
  36797. }
  36798. });
  36799. _this.props.globalState.hostDocument.addEventListener("keyup", function () { return _this.onKeyUp(); }, false);
  36800. _this.props.globalState.hostDocument.addEventListener("keydown", function (evt) {
  36801. _this._altKeyIsPressed = evt.altKey;
  36802. _this._ctrlKeyIsPressed = evt.ctrlKey;
  36803. }, false);
  36804. _this.props.globalState.hostDocument.defaultView.addEventListener("blur", function () {
  36805. _this._altKeyIsPressed = false;
  36806. _this._ctrlKeyIsPressed = false;
  36807. }, false);
  36808. // Store additional data to serialization object
  36809. _this.props.globalState.storeEditorData = function (editorData) {
  36810. editorData.x = _this.x;
  36811. editorData.y = _this.y;
  36812. editorData.zoom = _this.zoom;
  36813. };
  36814. _this.props.globalState.workbench = _this;
  36815. return _this;
  36816. }
  36817. Object.defineProperty(WorkbenchComponent.prototype, "gridSize", {
  36818. get: function () {
  36819. return this._gridSize;
  36820. },
  36821. set: function (value) {
  36822. this._gridSize = value;
  36823. this.updateTransform();
  36824. },
  36825. enumerable: false,
  36826. configurable: true
  36827. });
  36828. Object.defineProperty(WorkbenchComponent.prototype, "globalState", {
  36829. get: function () {
  36830. return this.props.globalState;
  36831. },
  36832. enumerable: false,
  36833. configurable: true
  36834. });
  36835. Object.defineProperty(WorkbenchComponent.prototype, "nodes", {
  36836. get: function () {
  36837. return this._guiNodes;
  36838. },
  36839. enumerable: false,
  36840. configurable: true
  36841. });
  36842. Object.defineProperty(WorkbenchComponent.prototype, "zoom", {
  36843. get: function () {
  36844. return this._zoom;
  36845. },
  36846. set: function (value) {
  36847. if (this._zoom === value) {
  36848. return;
  36849. }
  36850. this._zoom = value;
  36851. this.updateTransform();
  36852. },
  36853. enumerable: false,
  36854. configurable: true
  36855. });
  36856. Object.defineProperty(WorkbenchComponent.prototype, "x", {
  36857. get: function () {
  36858. return this._x;
  36859. },
  36860. set: function (value) {
  36861. this._x = value;
  36862. this.updateTransform();
  36863. },
  36864. enumerable: false,
  36865. configurable: true
  36866. });
  36867. Object.defineProperty(WorkbenchComponent.prototype, "y", {
  36868. get: function () {
  36869. return this._y;
  36870. },
  36871. set: function (value) {
  36872. this._y = value;
  36873. this.updateTransform();
  36874. },
  36875. enumerable: false,
  36876. configurable: true
  36877. });
  36878. Object.defineProperty(WorkbenchComponent.prototype, "selectedGuiNodes", {
  36879. get: function () {
  36880. return this._selectedGuiNodes;
  36881. },
  36882. enumerable: false,
  36883. configurable: true
  36884. });
  36885. Object.defineProperty(WorkbenchComponent.prototype, "canvasContainer", {
  36886. get: function () {
  36887. return this._gridCanvas;
  36888. },
  36889. enumerable: false,
  36890. configurable: true
  36891. });
  36892. Object.defineProperty(WorkbenchComponent.prototype, "hostCanvas", {
  36893. get: function () {
  36894. return this._hostCanvas;
  36895. },
  36896. enumerable: false,
  36897. configurable: true
  36898. });
  36899. Object.defineProperty(WorkbenchComponent.prototype, "svgCanvas", {
  36900. get: function () {
  36901. return this._svgCanvas;
  36902. },
  36903. enumerable: false,
  36904. configurable: true
  36905. });
  36906. Object.defineProperty(WorkbenchComponent.prototype, "selectionContainer", {
  36907. get: function () {
  36908. return this._selectionContainer;
  36909. },
  36910. enumerable: false,
  36911. configurable: true
  36912. });
  36913. Object.defineProperty(WorkbenchComponent.prototype, "frameContainer", {
  36914. get: function () {
  36915. return this._frameContainer;
  36916. },
  36917. enumerable: false,
  36918. configurable: true
  36919. });
  36920. WorkbenchComponent.prototype.getGridPosition = function (position, useCeil) {
  36921. if (useCeil === void 0) { useCeil = false; }
  36922. var gridSize = this.gridSize;
  36923. if (gridSize === 0) {
  36924. return position;
  36925. }
  36926. if (useCeil) {
  36927. return gridSize * Math.ceil(position / gridSize);
  36928. }
  36929. return gridSize * Math.floor(position / gridSize);
  36930. };
  36931. WorkbenchComponent.prototype.getGridPositionCeil = function (position) {
  36932. var gridSize = this.gridSize;
  36933. if (gridSize === 0) {
  36934. return position;
  36935. }
  36936. return gridSize * Math.ceil(position / gridSize);
  36937. };
  36938. WorkbenchComponent.prototype.updateTransform = function () {
  36939. this._rootContainer.style.transform = "translate(" + this._x + "px, " + this._y + "px) scale(" + this._zoom + ")";
  36940. if (babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__["DataStorage"].ReadBoolean("ShowGrid", true)) {
  36941. this._hostCanvas.style.backgroundSize = this._gridSize * this._zoom + "px " + this._gridSize * this._zoom + "px";
  36942. this._hostCanvas.style.backgroundPosition = this._x + "px " + this._y + "px";
  36943. }
  36944. else {
  36945. this._hostCanvas.style.backgroundSize = "0";
  36946. }
  36947. };
  36948. WorkbenchComponent.prototype.onKeyUp = function () {
  36949. this._altKeyIsPressed = false;
  36950. this._ctrlKeyIsPressed = false;
  36951. this._oldY = -1;
  36952. };
  36953. WorkbenchComponent.prototype.findNodeFromGuiElement = function (guiControl) {
  36954. return this._guiNodes.filter(function (n) { return n.guiControl === guiControl; })[0];
  36955. };
  36956. WorkbenchComponent.prototype.reset = function () {
  36957. for (var _i = 0, _a = this._guiNodes; _i < _a.length; _i++) {
  36958. var node = _a[_i];
  36959. node.dispose();
  36960. }
  36961. this._guiNodes = [];
  36962. this._gridCanvas.innerHTML = "";
  36963. this._svgCanvas.innerHTML = "";
  36964. };
  36965. WorkbenchComponent.prototype.appendBlock = function (guiElement) {
  36966. var newGuiNode = new _guiNode__WEBPACK_IMPORTED_MODULE_2__["GUINode"](this.props.globalState, guiElement);
  36967. this._guiNodes.push(newGuiNode);
  36968. this.globalState.guiTexture.addControl(guiElement);
  36969. return newGuiNode;
  36970. };
  36971. WorkbenchComponent.prototype.distributeGraph = function () {
  36972. var _this = this;
  36973. this.x = 0;
  36974. this.y = 0;
  36975. this.zoom = 1;
  36976. var graph = new dagre__WEBPACK_IMPORTED_MODULE_3__["graphlib"].Graph();
  36977. graph.setGraph({});
  36978. graph.setDefaultEdgeLabel(function () { return ({}); });
  36979. graph.graph().rankdir = "LR";
  36980. // Build dagre graph
  36981. this._guiNodes.forEach(function (node) {
  36982. graph.setNode(node.id.toString(), {
  36983. id: node.id,
  36984. type: "node",
  36985. width: node.width,
  36986. height: node.height
  36987. });
  36988. });
  36989. // Distribute
  36990. dagre__WEBPACK_IMPORTED_MODULE_3__["layout"](graph);
  36991. // Update graph
  36992. var dagreNodes = graph.nodes().map(function (node) { return graph.node(node); });
  36993. dagreNodes.forEach(function (dagreNode) {
  36994. if (!dagreNode) {
  36995. return;
  36996. }
  36997. if (dagreNode.type === "node") {
  36998. for (var _i = 0, _a = _this._guiNodes; _i < _a.length; _i++) {
  36999. var node = _a[_i];
  37000. if (node.id === dagreNode.id) {
  37001. node.x = dagreNode.x - dagreNode.width / 2;
  37002. node.y = dagreNode.y - dagreNode.height / 2;
  37003. node.cleanAccumulation();
  37004. return;
  37005. }
  37006. }
  37007. return;
  37008. }
  37009. });
  37010. };
  37011. WorkbenchComponent.prototype.componentDidMount = function () {
  37012. this._hostCanvas = this.props.globalState.hostDocument.getElementById("workbench-canvas");
  37013. this._rootContainer = this.props.globalState.hostDocument.getElementById("workbench-container");
  37014. this._gridCanvas = this.props.globalState.hostDocument.getElementById("workbench-canvas-container");
  37015. this._svgCanvas = this.props.globalState.hostDocument.getElementById("workbench-svg-container");
  37016. this._selectionContainer = this.props.globalState.hostDocument.getElementById("selection-container");
  37017. this._frameContainer = this.props.globalState.hostDocument.getElementById("frame-container");
  37018. this.gridSize = babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__["DataStorage"].ReadNumber("GridSize", 20);
  37019. this.updateTransform();
  37020. };
  37021. WorkbenchComponent.prototype.onMove = function (evt) {
  37022. // Selection box
  37023. if (this._selectionBox) {
  37024. var rootRect = this.canvasContainer.getBoundingClientRect();
  37025. var localX = evt.pageX - rootRect.left;
  37026. var localY = evt.pageY - rootRect.top;
  37027. if (localX > this._selectionStartX) {
  37028. this._selectionBox.style.left = this._selectionStartX / this.zoom + "px";
  37029. this._selectionBox.style.width = (localX - this._selectionStartX) / this.zoom + "px";
  37030. }
  37031. else {
  37032. this._selectionBox.style.left = localX / this.zoom + "px";
  37033. this._selectionBox.style.width = (this._selectionStartX - localX) / this.zoom + "px";
  37034. }
  37035. if (localY > this._selectionStartY) {
  37036. this._selectionBox.style.top = this._selectionStartY / this.zoom + "px";
  37037. this._selectionBox.style.height = (localY - this._selectionStartY) / this.zoom + "px";
  37038. }
  37039. else {
  37040. this._selectionBox.style.top = localY / this.zoom + "px";
  37041. this._selectionBox.style.height = (this._selectionStartY - localY) / this.zoom + "px";
  37042. }
  37043. this.props.globalState.onSelectionBoxMoved.notifyObservers(this._selectionBox.getBoundingClientRect());
  37044. return;
  37045. }
  37046. // Zoom with mouse + alt
  37047. if (this._altKeyIsPressed && evt.buttons === 1) {
  37048. if (this._oldY < 0) {
  37049. this._oldY = evt.pageY;
  37050. }
  37051. var zoomDelta = (evt.pageY - this._oldY) / 10;
  37052. if (Math.abs(zoomDelta) > 5) {
  37053. var oldZoom = this.zoom;
  37054. this.zoom = Math.max(Math.min(this.MaxZoom, this.zoom + zoomDelta / 100), this.MinZoom);
  37055. var boundingRect = evt.currentTarget.getBoundingClientRect();
  37056. var clientWidth = boundingRect.width;
  37057. var widthDiff = clientWidth * this.zoom - clientWidth * oldZoom;
  37058. var clientX = evt.clientX - boundingRect.left;
  37059. var xFactor = (clientX - this.x) / oldZoom / clientWidth;
  37060. this.x = this.x - widthDiff * xFactor;
  37061. this._oldY = evt.pageY;
  37062. }
  37063. return;
  37064. }
  37065. // Move canvas and/or guiNodes
  37066. if (this._mouseStartPointX != null && this._mouseStartPointY != null) {
  37067. var x = this._mouseStartPointX;
  37068. var y = this._mouseStartPointY;
  37069. var selected_1 = false;
  37070. this.selectedGuiNodes.forEach(function (element) {
  37071. selected_1 = element._onMove(new babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__["Vector2"](evt.clientX, evt.clientY), new babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__["Vector2"](x, y)) || selected_1;
  37072. });
  37073. if (!selected_1) {
  37074. this._rootContainer.style.cursor = "move";
  37075. this.x += evt.clientX - this._mouseStartPointX;
  37076. this.y += evt.clientY - this._mouseStartPointY;
  37077. }
  37078. this._mouseStartPointX = evt.clientX;
  37079. this._mouseStartPointY = evt.clientY;
  37080. }
  37081. };
  37082. WorkbenchComponent.prototype.onDown = function (evt) {
  37083. this._rootContainer.setPointerCapture(evt.pointerId);
  37084. //TODO: Inplement group selection
  37085. // Selection?
  37086. /*if (evt.currentTarget === this._hostCanvas && evt.ctrlKey) {
  37087. this._selectionBox = this.props.globalState.hostDocument.createElement("div");
  37088. this._selectionBox.classList.add("selection-box");
  37089. this._selectionContainer.appendChild(this._selectionBox);
  37090. const rootRect = this.canvasContainer.getBoundingClientRect();
  37091. this._selectionStartX = (evt.pageX - rootRect.left);
  37092. this._selectionStartY = (evt.pageY - rootRect.top);
  37093. this._selectionBox.style.left = `${this._selectionStartX / this.zoom}px`;
  37094. this._selectionBox.style.top = `${this._selectionStartY / this.zoom}px`;
  37095. this._selectionBox.style.width = "0px";
  37096. this._selectionBox.style.height = "0px";
  37097. return;
  37098. }*/
  37099. console.log('workbench click');
  37100. if (!this.isOverGUINode) {
  37101. console.log('unclicked');
  37102. this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
  37103. }
  37104. this._mouseStartPointX = evt.clientX;
  37105. this._mouseStartPointY = evt.clientY;
  37106. };
  37107. WorkbenchComponent.prototype.onUp = function (evt) {
  37108. this._mouseStartPointX = null;
  37109. this._mouseStartPointY = null;
  37110. this._rootContainer.releasePointerCapture(evt.pointerId);
  37111. this._oldY = -1;
  37112. if (this._selectionBox) {
  37113. this._selectionBox.parentElement.removeChild(this._selectionBox);
  37114. this._selectionBox = null;
  37115. }
  37116. if (this._frameCandidate) {
  37117. this._frameCandidate.parentElement.removeChild(this._frameCandidate);
  37118. this._frameCandidate = null;
  37119. }
  37120. };
  37121. WorkbenchComponent.prototype.onWheel = function (evt) {
  37122. var delta = evt.deltaY < 0 ? 0.1 : -0.1;
  37123. var oldZoom = this.zoom;
  37124. this.zoom = Math.min(Math.max(this.MinZoom, this.zoom + delta * this.zoom), this.MaxZoom);
  37125. var boundingRect = evt.currentTarget.getBoundingClientRect();
  37126. var clientWidth = boundingRect.width;
  37127. var clientHeight = boundingRect.height;
  37128. var widthDiff = clientWidth * this.zoom - clientWidth * oldZoom;
  37129. var heightDiff = clientHeight * this.zoom - clientHeight * oldZoom;
  37130. var clientX = evt.clientX - boundingRect.left;
  37131. var clientY = evt.clientY - boundingRect.top;
  37132. var xFactor = (clientX - this.x) / oldZoom / clientWidth;
  37133. var yFactor = (clientY - this.y) / oldZoom / clientHeight;
  37134. this.x = this.x - widthDiff * xFactor;
  37135. this.y = this.y - heightDiff * yFactor;
  37136. evt.stopPropagation();
  37137. };
  37138. WorkbenchComponent.prototype.zoomToFit = function () {
  37139. // Get negative offset
  37140. var minX = 0;
  37141. var minY = 0;
  37142. this._guiNodes.forEach(function (node) {
  37143. if (node.x < minX) {
  37144. minX = node.x;
  37145. }
  37146. if (node.y < minY) {
  37147. minY = node.y;
  37148. }
  37149. });
  37150. // Restore to 0
  37151. this._guiNodes.forEach(function (node) {
  37152. node.x += -minX;
  37153. node.y += -minY;
  37154. node.cleanAccumulation();
  37155. });
  37156. // Get correct zoom
  37157. var xFactor = this._rootContainer.clientWidth / this._rootContainer.scrollWidth;
  37158. var yFactor = this._rootContainer.clientHeight / this._rootContainer.scrollHeight;
  37159. var zoomFactor = xFactor < yFactor ? xFactor : yFactor;
  37160. this.zoom = zoomFactor;
  37161. this.x = 0;
  37162. this.y = 0;
  37163. };
  37164. WorkbenchComponent.prototype.createGUICanvas = function () {
  37165. var _this = this;
  37166. // Get the canvas element from the DOM.
  37167. var canvas = document.getElementById("workbench-canvas");
  37168. // Associate a Babylon Engine to it.
  37169. var engine = new babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__["Engine"](canvas);
  37170. // Create our first scene.
  37171. var scene = new babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__["Scene"](engine);
  37172. scene.clearColor = new babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__["Color4"](0.2, 0.2, 0.3, 0.1);
  37173. // This creates and positions a free camera (non-mesh)
  37174. var camera = new babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__["FreeCamera"]("camera1", new babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__["Vector3"](0, 5, -10), scene);
  37175. // This targets the camera to scene origin
  37176. camera.setTarget(babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_4__["Vector3"].Zero());
  37177. // This attaches the camera to the canvas
  37178. //camera.attachControl(true);
  37179. // GUI
  37180. this.globalState.guiTexture = babylonjs_gui_2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_5__["AdvancedDynamicTexture"].CreateFullscreenUI("UI");
  37181. scene.getEngine().onCanvasPointerOutObservable.clear();
  37182. // Watch for browser/canvas resize events
  37183. window.addEventListener("resize", function () {
  37184. engine.resize();
  37185. });
  37186. engine.runRenderLoop(function () { _this.updateGUIs(); scene.render(); });
  37187. };
  37188. WorkbenchComponent.prototype.updateGUIs = function () {
  37189. this._guiNodes.forEach(function (element) {
  37190. element.updateVisual();
  37191. });
  37192. };
  37193. WorkbenchComponent.prototype.render = function () {
  37194. var _this = this;
  37195. return react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("canvas", { id: "workbench-canvas", onWheel: function (evt) { return _this.onWheel(evt); }, onPointerMove: function (evt) { return _this.onMove(evt); }, onPointerDown: function (evt) { return _this.onDown(evt); }, onPointerUp: function (evt) { return _this.onUp(evt); } },
  37196. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "workbench-container" },
  37197. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "workbench-canvas-container" }),
  37198. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "frame-container" }),
  37199. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("svg", { id: "workbench-svg-container" }),
  37200. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "selection-container" })));
  37201. };
  37202. return WorkbenchComponent;
  37203. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  37204. /***/ }),
  37205. /***/ "./diagram/workbenchCanvas.scss":
  37206. /*!**************************************!*\
  37207. !*** ./diagram/workbenchCanvas.scss ***!
  37208. \**************************************/
  37209. /*! no static exports found */
  37210. /***/ (function(module, exports, __webpack_require__) {
  37211. var api = __webpack_require__(/*! ../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  37212. var content = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./workbenchCanvas.scss */ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./diagram/workbenchCanvas.scss");
  37213. content = content.__esModule ? content.default : content;
  37214. if (typeof content === 'string') {
  37215. content = [[module.i, content, '']];
  37216. }
  37217. var options = {};
  37218. options.insert = "head";
  37219. options.singleton = false;
  37220. var update = api(content, options);
  37221. module.exports = content.locals || {};
  37222. /***/ }),
  37223. /***/ "./globalState.ts":
  37224. /*!************************!*\
  37225. !*** ./globalState.ts ***!
  37226. \************************/
  37227. /*! exports provided: GlobalState */
  37228. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37229. "use strict";
  37230. __webpack_require__.r(__webpack_exports__);
  37231. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlobalState", function() { return GlobalState; });
  37232. /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
  37233. /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
  37234. var GlobalState = /** @class */ (function () {
  37235. function GlobalState() {
  37236. this.onSelectionChangedObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
  37237. this.onRebuildRequiredObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
  37238. this.onBuiltObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
  37239. this.onResetRequiredObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
  37240. this.onUpdateRequiredObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
  37241. this.onReOrganizedRequiredObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
  37242. this.onLogRequiredObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
  37243. this.onErrorMessageDialogRequiredObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
  37244. this.onIsLoadingChanged = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
  37245. this.onSelectionBoxMoved = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
  37246. this.onGuiNodeRemovalObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
  37247. this.blockKeyboardEvents = false;
  37248. this.controlCamera = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["DataStorage"].ReadBoolean("ControlCamera", true);
  37249. var r = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["DataStorage"].ReadNumber("BackgroundColorR", 0.12549019607843137);
  37250. var g = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["DataStorage"].ReadNumber("BackgroundColorG", 0.09803921568627451);
  37251. var b = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["DataStorage"].ReadNumber("BackgroundColorB", 0.25098039215686274);
  37252. this.backgroundColor = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Color4"](r, g, b, 1.0);
  37253. }
  37254. return GlobalState;
  37255. }());
  37256. /***/ }),
  37257. /***/ "./guiEditor.ts":
  37258. /*!**********************!*\
  37259. !*** ./guiEditor.ts ***!
  37260. \**********************/
  37261. /*! exports provided: GUIEditor */
  37262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37263. "use strict";
  37264. __webpack_require__.r(__webpack_exports__);
  37265. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GUIEditor", function() { return GUIEditor; });
  37266. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  37267. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  37268. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "../../node_modules/react-dom/index.js");
  37269. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
  37270. /* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./globalState */ "./globalState.ts");
  37271. /* harmony import */ var _workbenchEditor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./workbenchEditor */ "./workbenchEditor.tsx");
  37272. /* harmony import */ var _sharedUiComponents_lines_popup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sharedUiComponents/lines/popup */ "./sharedUiComponents/lines/popup.ts");
  37273. /* harmony import */ var _serializationTools__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./serializationTools */ "./serializationTools.ts");
  37274. /**
  37275. * Class used to create a gui editor
  37276. */
  37277. var GUIEditor = /** @class */ (function () {
  37278. function GUIEditor() {
  37279. }
  37280. /**
  37281. * Show the gui editor
  37282. * @param options defines the options to use to configure the gui editor
  37283. */
  37284. GUIEditor.Show = function (options) {
  37285. if (this._CurrentState) {
  37286. var popupWindow = _sharedUiComponents_lines_popup__WEBPACK_IMPORTED_MODULE_4__["Popup"]["gui-editor"];
  37287. if (popupWindow) {
  37288. popupWindow.close();
  37289. }
  37290. }
  37291. var hostElement = options.hostElement;
  37292. if (!hostElement) {
  37293. hostElement = _sharedUiComponents_lines_popup__WEBPACK_IMPORTED_MODULE_4__["Popup"].CreatePopup("BABYLON.JS GUI EDITOR", "gui-editor", 1000, 800);
  37294. }
  37295. var globalState = new _globalState__WEBPACK_IMPORTED_MODULE_2__["GlobalState"]();
  37296. globalState.hostElement = hostElement;
  37297. globalState.hostDocument = hostElement.ownerDocument;
  37298. globalState.customSave = options.customSave;
  37299. globalState.hostWindow = hostElement.ownerDocument.defaultView;
  37300. var graphEditor = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_workbenchEditor__WEBPACK_IMPORTED_MODULE_3__["WorkbenchEditor"], {
  37301. globalState: globalState,
  37302. });
  37303. react_dom__WEBPACK_IMPORTED_MODULE_1__["render"](graphEditor, hostElement);
  37304. // create the middle workbench canvas
  37305. if (!globalState.guiTexture) {
  37306. globalState.workbench.createGUICanvas();
  37307. }
  37308. if (options.customLoadObservable) {
  37309. options.customLoadObservable.add(function (data) {
  37310. _serializationTools__WEBPACK_IMPORTED_MODULE_5__["SerializationTools"].Deserialize(data, globalState);
  37311. globalState.onResetRequiredObservable.notifyObservers();
  37312. globalState.onBuiltObservable.notifyObservers();
  37313. });
  37314. }
  37315. this._CurrentState = globalState;
  37316. // Close the popup window when the page is refreshed or scene is disposed
  37317. var popupWindow = _sharedUiComponents_lines_popup__WEBPACK_IMPORTED_MODULE_4__["Popup"]["gui-editor"];
  37318. if (popupWindow) {
  37319. window.onbeforeunload = function () {
  37320. var popupWindow = _sharedUiComponents_lines_popup__WEBPACK_IMPORTED_MODULE_4__["Popup"]["gui-editor"];
  37321. if (popupWindow) {
  37322. popupWindow.close();
  37323. }
  37324. };
  37325. }
  37326. window.addEventListener("beforeunload", function () { });
  37327. };
  37328. return GUIEditor;
  37329. }());
  37330. /***/ }),
  37331. /***/ "./guiNodeTools.ts":
  37332. /*!*************************!*\
  37333. !*** ./guiNodeTools.ts ***!
  37334. \*************************/
  37335. /*! exports provided: GUINodeTools */
  37336. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37337. "use strict";
  37338. __webpack_require__.r(__webpack_exports__);
  37339. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GUINodeTools", function() { return GUINodeTools; });
  37340. /* harmony import */ var babylonjs_gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs-gui/2D/controls/button */ "babylonjs-gui/2D/controls/button");
  37341. /* harmony import */ var babylonjs_gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__);
  37342. var GUINodeTools = /** @class */ (function () {
  37343. function GUINodeTools() {
  37344. }
  37345. GUINodeTools.CreateControlFromString = function (data) {
  37346. //TODO: Add more elements and create default values for certain types.
  37347. var element;
  37348. switch (data) {
  37349. case "Slider":
  37350. element = new babylonjs_gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__["Slider"]("Slider");
  37351. break;
  37352. case "Checkbox":
  37353. element = new babylonjs_gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__["Checkbox"]("Checkbox");
  37354. break;
  37355. case "ColorPicker":
  37356. element = new babylonjs_gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__["ColorPicker"]("ColorPicker");
  37357. break;
  37358. case "Ellipse":
  37359. element = new babylonjs_gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__["Ellipse"]("Ellipse");
  37360. break;
  37361. case "Rectangle":
  37362. element = new babylonjs_gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__["Rectangle"]("Rectangle");
  37363. break;
  37364. case "Line":
  37365. element = new babylonjs_gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__["Line"]();
  37366. element.x1 = 10;
  37367. element.y1 = 10;
  37368. element.x2 = 100;
  37369. element.y2 = 100;
  37370. element.lineWidth = 5;
  37371. element.dash = [50, 10];
  37372. return element;
  37373. case "Text":
  37374. element = new babylonjs_gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__["TextBlock"]("Textblock");
  37375. element.text = "My Text";
  37376. return element;
  37377. default:
  37378. element = babylonjs_gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__["Button"].CreateSimpleButton("Button", "Click Me");
  37379. break;
  37380. }
  37381. element.width = "150px";
  37382. element.height = "40px";
  37383. element.color = "#FFFFFFFF";
  37384. element.isPointerBlocker = true;
  37385. return element;
  37386. };
  37387. return GUINodeTools;
  37388. }());
  37389. /***/ }),
  37390. /***/ "./index.ts":
  37391. /*!******************!*\
  37392. !*** ./index.ts ***!
  37393. \******************/
  37394. /*! exports provided: GUIEditor */
  37395. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37396. "use strict";
  37397. __webpack_require__.r(__webpack_exports__);
  37398. /* harmony import */ var _guiEditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./guiEditor */ "./guiEditor.ts");
  37399. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GUIEditor", function() { return _guiEditor__WEBPACK_IMPORTED_MODULE_0__["GUIEditor"]; });
  37400. /***/ }),
  37401. /***/ "./legacy/legacy.ts":
  37402. /*!**************************!*\
  37403. !*** ./legacy/legacy.ts ***!
  37404. \**************************/
  37405. /*! exports provided: GUIEditor */
  37406. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37407. "use strict";
  37408. __webpack_require__.r(__webpack_exports__);
  37409. /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "./index.ts");
  37410. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GUIEditor", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["GUIEditor"]; });
  37411. var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);
  37412. if (typeof globalObject !== "undefined") {
  37413. globalObject.BABYLON = globalObject.BABYLON || {};
  37414. globalObject.BABYLON.GuiEditor = _index__WEBPACK_IMPORTED_MODULE_0__["GUIEditor"];
  37415. }
  37416. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
  37417. /***/ }),
  37418. /***/ "./main.scss":
  37419. /*!*******************!*\
  37420. !*** ./main.scss ***!
  37421. \*******************/
  37422. /*! no static exports found */
  37423. /***/ (function(module, exports, __webpack_require__) {
  37424. var api = __webpack_require__(/*! ../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  37425. var content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./main.scss */ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./main.scss");
  37426. content = content.__esModule ? content.default : content;
  37427. if (typeof content === 'string') {
  37428. content = [[module.i, content, '']];
  37429. }
  37430. var options = {};
  37431. options.insert = "head";
  37432. options.singleton = false;
  37433. var update = api(content, options);
  37434. module.exports = content.locals || {};
  37435. /***/ }),
  37436. /***/ "./portal.tsx":
  37437. /*!********************!*\
  37438. !*** ./portal.tsx ***!
  37439. \********************/
  37440. /*! exports provided: Portal */
  37441. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37442. "use strict";
  37443. __webpack_require__.r(__webpack_exports__);
  37444. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Portal", function() { return Portal; });
  37445. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  37446. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  37447. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  37448. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "../../node_modules/react-dom/index.js");
  37449. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
  37450. var Portal = /** @class */ (function (_super) {
  37451. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Portal, _super);
  37452. function Portal() {
  37453. return _super !== null && _super.apply(this, arguments) || this;
  37454. }
  37455. Portal.prototype.render = function () {
  37456. return react_dom__WEBPACK_IMPORTED_MODULE_2__["createPortal"](this.props.children, this.props.globalState.hostElement);
  37457. };
  37458. return Portal;
  37459. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  37460. /***/ }),
  37461. /***/ "./serializationTools.ts":
  37462. /*!*******************************!*\
  37463. !*** ./serializationTools.ts ***!
  37464. \*******************************/
  37465. /*! exports provided: SerializationTools */
  37466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37467. "use strict";
  37468. __webpack_require__.r(__webpack_exports__);
  37469. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SerializationTools", function() { return SerializationTools; });
  37470. var SerializationTools = /** @class */ (function () {
  37471. function SerializationTools() {
  37472. }
  37473. SerializationTools.Deserialize = function (serializationObject, globalState) {
  37474. globalState.onIsLoadingChanged.notifyObservers(true);
  37475. };
  37476. return SerializationTools;
  37477. }());
  37478. /***/ }),
  37479. /***/ "./sharedComponents/floatLineComponent.tsx":
  37480. /*!*************************************************!*\
  37481. !*** ./sharedComponents/floatLineComponent.tsx ***!
  37482. \*************************************************/
  37483. /*! exports provided: FloatLineComponent */
  37484. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37485. "use strict";
  37486. __webpack_require__.r(__webpack_exports__);
  37487. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FloatLineComponent", function() { return FloatLineComponent; });
  37488. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  37489. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  37490. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  37491. var FloatLineComponent = /** @class */ (function (_super) {
  37492. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FloatLineComponent, _super);
  37493. function FloatLineComponent(props) {
  37494. var _this = _super.call(this, props) || this;
  37495. _this._localChange = false;
  37496. var currentValue = _this.props.target[_this.props.propertyName];
  37497. _this._digits == _this.props.digits == undefined ? 2 : _this.props.digits;
  37498. _this.state = { value: currentValue ? (_this.props.isInteger ? currentValue.toFixed(0) : currentValue.toFixed(_this._digits)) : "0" };
  37499. _this._store = currentValue;
  37500. var rexp = "(.*\\.";
  37501. var numDigits = _this._digits;
  37502. while (numDigits--) {
  37503. rexp += ".";
  37504. }
  37505. rexp += ").+";
  37506. _this._regExp = new RegExp(rexp);
  37507. return _this;
  37508. }
  37509. FloatLineComponent.prototype.shouldComponentUpdate = function (nextProps, nextState) {
  37510. if (this._localChange) {
  37511. this._localChange = false;
  37512. return true;
  37513. }
  37514. var newValue = nextProps.target[nextProps.propertyName];
  37515. var newValueString = newValue ? this.props.isInteger ? newValue.toFixed(0) : newValue.toFixed(this._digits) : "0";
  37516. if (newValueString !== nextState.value) {
  37517. nextState.value = newValueString;
  37518. return true;
  37519. }
  37520. return false;
  37521. };
  37522. FloatLineComponent.prototype.raiseOnPropertyChanged = function (newValue, previousValue) {
  37523. if (this.props.onChange) {
  37524. this.props.onChange(newValue);
  37525. }
  37526. if (!this.props.onPropertyChangedObservable) {
  37527. return;
  37528. }
  37529. this.props.onPropertyChangedObservable.notifyObservers({
  37530. object: this.props.target,
  37531. property: this.props.propertyName,
  37532. value: newValue,
  37533. initialValue: previousValue
  37534. });
  37535. };
  37536. FloatLineComponent.prototype.updateValue = function (valueString) {
  37537. if (/[^0-9\.\-]/g.test(valueString)) {
  37538. return;
  37539. }
  37540. valueString = valueString.replace(this._regExp, "$1");
  37541. var valueAsNumber;
  37542. if (this.props.isInteger) {
  37543. valueAsNumber = parseInt(valueString);
  37544. }
  37545. else {
  37546. valueAsNumber = parseFloat(valueString);
  37547. }
  37548. this._localChange = true;
  37549. this.setState({ value: valueString });
  37550. if (isNaN(valueAsNumber)) {
  37551. return;
  37552. }
  37553. if (this.props.max != undefined && (valueAsNumber > this.props.max)) {
  37554. valueAsNumber = this.props.max;
  37555. }
  37556. if (this.props.min != undefined && (valueAsNumber < this.props.min)) {
  37557. valueAsNumber = this.props.min;
  37558. }
  37559. this.props.target[this.props.propertyName] = valueAsNumber;
  37560. this.raiseOnPropertyChanged(valueAsNumber, this._store);
  37561. this._store = valueAsNumber;
  37562. };
  37563. FloatLineComponent.prototype.render = function () {
  37564. var _this = this;
  37565. var className = this.props.smallUI ? "short" : "value";
  37566. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", null, react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: this.props.additionalClass ? this.props.additionalClass + " floatLine" : "floatLine" },
  37567. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "label" }, this.props.label),
  37568. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: className },
  37569. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("input", { type: "number", step: this.props.step || "0.01", className: "numeric-input", onBlur: function (evt) {
  37570. _this.props.globalState.blockKeyboardEvents = false;
  37571. if (_this.props.onEnter) {
  37572. _this.props.onEnter(_this._store);
  37573. }
  37574. }, onKeyDown: function (evt) {
  37575. if (evt.keyCode !== 13) {
  37576. return;
  37577. }
  37578. if (_this.props.onEnter) {
  37579. _this.props.onEnter(_this._store);
  37580. }
  37581. }, onFocus: function () { return _this.props.globalState.blockKeyboardEvents = true; }, value: this.state.value, onChange: function (evt) { return _this.updateValue(evt.target.value); } })))));
  37582. };
  37583. return FloatLineComponent;
  37584. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  37585. /***/ }),
  37586. /***/ "./sharedComponents/messageDialog.tsx":
  37587. /*!********************************************!*\
  37588. !*** ./sharedComponents/messageDialog.tsx ***!
  37589. \********************************************/
  37590. /*! exports provided: MessageDialogComponent */
  37591. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37592. "use strict";
  37593. __webpack_require__.r(__webpack_exports__);
  37594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MessageDialogComponent", function() { return MessageDialogComponent; });
  37595. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  37596. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  37597. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  37598. var MessageDialogComponent = /** @class */ (function (_super) {
  37599. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MessageDialogComponent, _super);
  37600. function MessageDialogComponent(props) {
  37601. var _this = _super.call(this, props) || this;
  37602. _this.state = { message: "", isError: false };
  37603. _this.props.globalState.onErrorMessageDialogRequiredObservable.add(function (message) {
  37604. _this.setState({ message: message, isError: true });
  37605. });
  37606. return _this;
  37607. }
  37608. MessageDialogComponent.prototype.render = function () {
  37609. var _this = this;
  37610. if (!this.state.message) {
  37611. return null;
  37612. }
  37613. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "dialog-container" },
  37614. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "dialog" },
  37615. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "dialog-message" }, this.state.message),
  37616. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "dialog-buttons" },
  37617. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "dialog-button-ok" + (this.state.isError ? " error" : ""), onClick: function () { return _this.setState({ message: "" }); } }, "OK")))));
  37618. };
  37619. return MessageDialogComponent;
  37620. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  37621. /***/ }),
  37622. /***/ "./sharedComponents/numericInputComponent.tsx":
  37623. /*!****************************************************!*\
  37624. !*** ./sharedComponents/numericInputComponent.tsx ***!
  37625. \****************************************************/
  37626. /*! exports provided: NumericInputComponent */
  37627. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37628. "use strict";
  37629. __webpack_require__.r(__webpack_exports__);
  37630. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumericInputComponent", function() { return NumericInputComponent; });
  37631. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  37632. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  37633. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  37634. var NumericInputComponent = /** @class */ (function (_super) {
  37635. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NumericInputComponent, _super);
  37636. function NumericInputComponent(props) {
  37637. var _this = _super.call(this, props) || this;
  37638. _this._localChange = false;
  37639. _this.state = { value: _this.props.value.toFixed(3) };
  37640. return _this;
  37641. }
  37642. NumericInputComponent.prototype.shouldComponentUpdate = function (nextProps, nextState) {
  37643. if (this._localChange) {
  37644. this._localChange = false;
  37645. return true;
  37646. }
  37647. if (nextProps.value.toString() !== nextState.value) {
  37648. nextState.value = nextProps.value.toFixed(3);
  37649. return true;
  37650. }
  37651. return false;
  37652. };
  37653. NumericInputComponent.prototype.updateValue = function (evt) {
  37654. var value = evt.target.value;
  37655. if (/[^0-9\.\-]/g.test(value)) {
  37656. return;
  37657. }
  37658. var valueAsNumber = parseFloat(value);
  37659. this._localChange = true;
  37660. this.setState({ value: value });
  37661. if (isNaN(valueAsNumber)) {
  37662. return;
  37663. }
  37664. this.props.onChange(valueAsNumber);
  37665. };
  37666. NumericInputComponent.prototype.render = function () {
  37667. var _this = this;
  37668. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "numeric" },
  37669. this.props.label &&
  37670. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "numeric-label" }, this.props.label + ": "),
  37671. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("input", { type: "number", onFocus: function () { return _this.props.globalState.blockKeyboardEvents = true; }, onBlur: function (evt) {
  37672. _this.props.globalState.blockKeyboardEvents = false;
  37673. }, step: this.props.step, className: "numeric-input", value: this.state.value, onChange: function (evt) { return _this.updateValue(evt); } })));
  37674. };
  37675. NumericInputComponent.defaultProps = {
  37676. step: 1,
  37677. };
  37678. return NumericInputComponent;
  37679. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  37680. /***/ }),
  37681. /***/ "./sharedComponents/sliderLineComponent.tsx":
  37682. /*!**************************************************!*\
  37683. !*** ./sharedComponents/sliderLineComponent.tsx ***!
  37684. \**************************************************/
  37685. /*! exports provided: SliderLineComponent */
  37686. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37687. "use strict";
  37688. __webpack_require__.r(__webpack_exports__);
  37689. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SliderLineComponent", function() { return SliderLineComponent; });
  37690. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  37691. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  37692. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  37693. /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
  37694. /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_2__);
  37695. /* harmony import */ var _floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./floatLineComponent */ "./sharedComponents/floatLineComponent.tsx");
  37696. var SliderLineComponent = /** @class */ (function (_super) {
  37697. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SliderLineComponent, _super);
  37698. function SliderLineComponent(props) {
  37699. var _this = _super.call(this, props) || this;
  37700. _this._localChange = false;
  37701. if (_this.props.directValue !== undefined) {
  37702. _this.state = {
  37703. value: _this.props.directValue
  37704. };
  37705. }
  37706. else {
  37707. var value = _this.props.target[_this.props.propertyName];
  37708. if (value === undefined) {
  37709. value = _this.props.maximum;
  37710. }
  37711. _this.state = { value: value };
  37712. }
  37713. return _this;
  37714. }
  37715. SliderLineComponent.prototype.shouldComponentUpdate = function (nextProps, nextState) {
  37716. if (nextProps.directValue !== undefined) {
  37717. nextState.value = nextProps.directValue;
  37718. return true;
  37719. }
  37720. var currentState = nextProps.target[nextProps.propertyName];
  37721. if (currentState === undefined) {
  37722. currentState = nextProps.maximum;
  37723. }
  37724. if (currentState !== nextState.value || nextProps.minimum !== this.props.minimum || nextProps.maximum !== this.props.maximum || this._localChange) {
  37725. nextState.value = Math.min(Math.max(currentState, nextProps.minimum), nextProps.maximum);
  37726. this._localChange = false;
  37727. return true;
  37728. }
  37729. return false;
  37730. };
  37731. SliderLineComponent.prototype.onChange = function (newValueString) {
  37732. this._localChange = true;
  37733. var newValue = parseFloat(newValueString);
  37734. if (this.props.useEuler) {
  37735. newValue = babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_2__["Tools"].ToRadians(newValue);
  37736. }
  37737. if (this.props.target) {
  37738. if (this.props.onPropertyChangedObservable) {
  37739. this.props.onPropertyChangedObservable.notifyObservers({
  37740. object: this.props.target,
  37741. property: this.props.propertyName,
  37742. value: newValue,
  37743. initialValue: this.state.value
  37744. });
  37745. }
  37746. this.props.target[this.props.propertyName] = newValue;
  37747. }
  37748. if (this.props.onChange) {
  37749. this.props.onChange(newValue);
  37750. }
  37751. this.setState({ value: newValue });
  37752. };
  37753. SliderLineComponent.prototype.onInput = function (newValueString) {
  37754. var newValue = parseFloat(newValueString);
  37755. if (this.props.onInput) {
  37756. this.props.onInput(newValue);
  37757. }
  37758. };
  37759. SliderLineComponent.prototype.prepareDataToRead = function (value) {
  37760. if (this.props.useEuler) {
  37761. return babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_2__["Tools"].ToDegrees(value);
  37762. }
  37763. return value;
  37764. };
  37765. SliderLineComponent.prototype.render = function () {
  37766. var _this = this;
  37767. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "sliderLine" },
  37768. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "label" }, this.props.label),
  37769. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__["FloatLineComponent"], { globalState: this.props.globalState, smallUI: true, label: "", target: this.state, propertyName: "value", min: this.prepareDataToRead(this.props.minimum), max: this.prepareDataToRead(this.props.maximum), onEnter: function () {
  37770. _this.onChange(_this.state.value);
  37771. } }),
  37772. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "slider" },
  37773. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("input", { className: "range", type: "range", step: this.props.step, min: this.prepareDataToRead(this.props.minimum), max: this.prepareDataToRead(this.props.maximum), value: this.prepareDataToRead(this.state.value), onInput: function (evt) { return _this.onInput(evt.target.value); }, onChange: function (evt) { return _this.onChange(evt.target.value); } }))));
  37774. };
  37775. return SliderLineComponent;
  37776. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  37777. /***/ }),
  37778. /***/ "./sharedUiComponents/lines/buttonLineComponent.tsx":
  37779. /*!**********************************************************!*\
  37780. !*** ./sharedUiComponents/lines/buttonLineComponent.tsx ***!
  37781. \**********************************************************/
  37782. /*! exports provided: ButtonLineComponent */
  37783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37784. "use strict";
  37785. __webpack_require__.r(__webpack_exports__);
  37786. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ButtonLineComponent", function() { return ButtonLineComponent; });
  37787. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  37788. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  37789. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  37790. var ButtonLineComponent = /** @class */ (function (_super) {
  37791. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ButtonLineComponent, _super);
  37792. function ButtonLineComponent(props) {
  37793. return _super.call(this, props) || this;
  37794. }
  37795. ButtonLineComponent.prototype.render = function () {
  37796. var _this = this;
  37797. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "buttonLine" },
  37798. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("button", { onClick: function () { return _this.props.onClick(); } }, this.props.label)));
  37799. };
  37800. return ButtonLineComponent;
  37801. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  37802. /***/ }),
  37803. /***/ "./sharedUiComponents/lines/checkBoxLineComponent.tsx":
  37804. /*!************************************************************!*\
  37805. !*** ./sharedUiComponents/lines/checkBoxLineComponent.tsx ***!
  37806. \************************************************************/
  37807. /*! exports provided: CheckBoxLineComponent */
  37808. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37809. "use strict";
  37810. __webpack_require__.r(__webpack_exports__);
  37811. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CheckBoxLineComponent", function() { return CheckBoxLineComponent; });
  37812. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  37813. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  37814. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  37815. var CheckBoxLineComponent = /** @class */ (function (_super) {
  37816. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CheckBoxLineComponent, _super);
  37817. function CheckBoxLineComponent(props) {
  37818. var _this = _super.call(this, props) || this;
  37819. _this._localChange = false;
  37820. _this._uniqueId = CheckBoxLineComponent._UniqueIdSeed++;
  37821. if (_this.props.isSelected) {
  37822. _this.state = { isSelected: _this.props.isSelected() };
  37823. }
  37824. else {
  37825. _this.state = { isSelected: _this.props.target[_this.props.propertyName] == true };
  37826. }
  37827. if (_this.props.disabled) {
  37828. _this.state = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, _this.state), { isDisabled: _this.props.disabled });
  37829. }
  37830. return _this;
  37831. }
  37832. CheckBoxLineComponent.prototype.shouldComponentUpdate = function (nextProps, nextState) {
  37833. var currentState;
  37834. if (nextProps.isSelected) {
  37835. currentState = nextProps.isSelected();
  37836. }
  37837. else {
  37838. currentState = nextProps.target[nextProps.propertyName] == true;
  37839. }
  37840. if (currentState !== nextState.isSelected || this._localChange) {
  37841. nextState.isSelected = currentState;
  37842. this._localChange = false;
  37843. return true;
  37844. }
  37845. if (nextProps.disabled !== nextState.isDisabled) {
  37846. return true;
  37847. }
  37848. return nextProps.label !== this.props.label || nextProps.target !== this.props.target;
  37849. };
  37850. CheckBoxLineComponent.prototype.onChange = function () {
  37851. this._localChange = true;
  37852. if (this.props.onSelect) {
  37853. this.props.onSelect(!this.state.isSelected);
  37854. }
  37855. else {
  37856. if (this.props.onPropertyChangedObservable) {
  37857. this.props.onPropertyChangedObservable.notifyObservers({
  37858. object: this.props.target,
  37859. property: this.props.propertyName,
  37860. value: !this.state.isSelected,
  37861. initialValue: this.state.isSelected
  37862. });
  37863. }
  37864. this.props.target[this.props.propertyName] = !this.state.isSelected;
  37865. }
  37866. if (this.props.onValueChanged) {
  37867. this.props.onValueChanged();
  37868. }
  37869. this.setState({ isSelected: !this.state.isSelected });
  37870. };
  37871. CheckBoxLineComponent.prototype.render = function () {
  37872. var _this = this;
  37873. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "checkBoxLine" },
  37874. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "label" }, this.props.label),
  37875. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "checkBox" },
  37876. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("input", { type: "checkbox", id: "checkbox" + this._uniqueId, className: "cbx hidden", checked: this.state.isSelected, onChange: function () { return _this.onChange(); }, disabled: !!this.props.disabled }),
  37877. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("label", { htmlFor: "checkbox" + this._uniqueId, className: "lbl" + (!!this.props.disabled ? ' disabled' : '') }))));
  37878. };
  37879. CheckBoxLineComponent._UniqueIdSeed = 0;
  37880. return CheckBoxLineComponent;
  37881. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  37882. /***/ }),
  37883. /***/ "./sharedUiComponents/lines/downArrow.svg":
  37884. /*!************************************************!*\
  37885. !*** ./sharedUiComponents/lines/downArrow.svg ***!
  37886. \************************************************/
  37887. /*! no static exports found */
  37888. /***/ (function(module, exports) {
  37889. module.exports = "data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' width='17' height='17'%3E %3Cpath d='M4.21967 8.46967C4.51256 8.17678 4.98744 8.17678 5.28033 8.46967L12 15.1893L18.7197 8.46967C19.0126 8.17678 19.4874 8.17678 19.7803 8.46967C20.0732 8.76256 20.0732 9.23744 19.7803 9.53033L12.5303 16.7803C12.2374 17.0732 11.7626 17.0732 11.4697 16.7803L4.21967 9.53033C3.92678 9.23744 3.92678 8.76256 4.21967 8.46967Z' fill='white' /%3E %3C/svg%3E"
  37890. /***/ }),
  37891. /***/ "./sharedUiComponents/lines/draggableLineComponent.tsx":
  37892. /*!*************************************************************!*\
  37893. !*** ./sharedUiComponents/lines/draggableLineComponent.tsx ***!
  37894. \*************************************************************/
  37895. /*! exports provided: DraggableLineComponent */
  37896. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37897. "use strict";
  37898. __webpack_require__.r(__webpack_exports__);
  37899. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DraggableLineComponent", function() { return DraggableLineComponent; });
  37900. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  37901. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  37902. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  37903. var DraggableLineComponent = /** @class */ (function (_super) {
  37904. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(DraggableLineComponent, _super);
  37905. function DraggableLineComponent(props) {
  37906. return _super.call(this, props) || this;
  37907. }
  37908. DraggableLineComponent.prototype.render = function () {
  37909. var _this = this;
  37910. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "draggableLine", title: this.props.tooltip, draggable: true, onDragStart: function (event) {
  37911. event.dataTransfer.setData("babylonjs-gui-node", _this.props.data);
  37912. } }, this.props.data.replace("Block", "")));
  37913. };
  37914. return DraggableLineComponent;
  37915. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  37916. /***/ }),
  37917. /***/ "./sharedUiComponents/lines/fileButtonLineComponent.tsx":
  37918. /*!**************************************************************!*\
  37919. !*** ./sharedUiComponents/lines/fileButtonLineComponent.tsx ***!
  37920. \**************************************************************/
  37921. /*! exports provided: FileButtonLineComponent */
  37922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37923. "use strict";
  37924. __webpack_require__.r(__webpack_exports__);
  37925. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FileButtonLineComponent", function() { return FileButtonLineComponent; });
  37926. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  37927. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  37928. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  37929. var FileButtonLineComponent = /** @class */ (function (_super) {
  37930. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FileButtonLineComponent, _super);
  37931. function FileButtonLineComponent(props) {
  37932. var _this = _super.call(this, props) || this;
  37933. _this._id = FileButtonLineComponent._IDGenerator++;
  37934. _this.uploadInputRef = react__WEBPACK_IMPORTED_MODULE_1__["createRef"]();
  37935. return _this;
  37936. }
  37937. FileButtonLineComponent.prototype.onChange = function (evt) {
  37938. var files = evt.target.files;
  37939. if (files && files.length) {
  37940. this.props.onClick(files[0]);
  37941. }
  37942. evt.target.value = "";
  37943. };
  37944. FileButtonLineComponent.prototype.render = function () {
  37945. var _this = this;
  37946. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "buttonLine" },
  37947. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("label", { htmlFor: "file-upload" + this._id, className: "file-upload" }, this.props.label),
  37948. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("input", { ref: this.uploadInputRef, id: "file-upload" + this._id, type: "file", accept: this.props.accept, onChange: function (evt) { return _this.onChange(evt); } })));
  37949. };
  37950. FileButtonLineComponent._IDGenerator = 0;
  37951. return FileButtonLineComponent;
  37952. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  37953. /***/ }),
  37954. /***/ "./sharedUiComponents/lines/lineContainerComponent.tsx":
  37955. /*!*************************************************************!*\
  37956. !*** ./sharedUiComponents/lines/lineContainerComponent.tsx ***!
  37957. \*************************************************************/
  37958. /*! exports provided: LineContainerComponent */
  37959. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37960. "use strict";
  37961. __webpack_require__.r(__webpack_exports__);
  37962. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineContainerComponent", function() { return LineContainerComponent; });
  37963. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  37964. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  37965. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  37966. /* harmony import */ var babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babylonjs/Misc/dataStorage */ "babylonjs/Misc/observable");
  37967. /* harmony import */ var babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_2__);
  37968. var downArrow = __webpack_require__(/*! ./downArrow.svg */ "./sharedUiComponents/lines/downArrow.svg");
  37969. var LineContainerComponent = /** @class */ (function (_super) {
  37970. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LineContainerComponent, _super);
  37971. function LineContainerComponent(props) {
  37972. var _this = _super.call(this, props) || this;
  37973. var initialState = babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_2__["DataStorage"].ReadBoolean(_this.props.title, !_this.props.closed);
  37974. _this.state = { isExpanded: initialState };
  37975. return _this;
  37976. }
  37977. LineContainerComponent.prototype.switchExpandedState = function () {
  37978. var newState = !this.state.isExpanded;
  37979. babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_2__["DataStorage"].WriteBoolean(this.props.title, newState);
  37980. this.setState({ isExpanded: newState });
  37981. };
  37982. LineContainerComponent.prototype.renderHeader = function () {
  37983. var _this = this;
  37984. var className = this.state.isExpanded ? "collapse" : "collapse closed";
  37985. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "header", onClick: function () { return _this.switchExpandedState(); } },
  37986. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "title" }, this.props.title),
  37987. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: className },
  37988. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("img", { className: "img", title: this.props.title, src: downArrow }))));
  37989. };
  37990. LineContainerComponent.prototype.render = function () {
  37991. if (!this.state.isExpanded) {
  37992. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "paneContainer" },
  37993. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "paneContainer-content" }, this.renderHeader())));
  37994. }
  37995. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "paneContainer" },
  37996. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "paneContainer-content" },
  37997. this.renderHeader(),
  37998. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "paneList" }, this.props.children))));
  37999. };
  38000. return LineContainerComponent;
  38001. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  38002. /***/ }),
  38003. /***/ "./sharedUiComponents/lines/popup.ts":
  38004. /*!*******************************************!*\
  38005. !*** ./sharedUiComponents/lines/popup.ts ***!
  38006. \*******************************************/
  38007. /*! exports provided: Popup */
  38008. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38009. "use strict";
  38010. __webpack_require__.r(__webpack_exports__);
  38011. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Popup", function() { return Popup; });
  38012. var Popup = /** @class */ (function () {
  38013. function Popup() {
  38014. }
  38015. Popup.CreatePopup = function (title, windowVariableName, width, height) {
  38016. var _this = this;
  38017. if (width === void 0) { width = 300; }
  38018. if (height === void 0) { height = 800; }
  38019. var windowCreationOptionsList = {
  38020. width: width,
  38021. height: height,
  38022. top: (window.innerHeight - width) / 2 + window.screenY,
  38023. left: (window.innerWidth - height) / 2 + window.screenX
  38024. };
  38025. var windowCreationOptions = Object.keys(windowCreationOptionsList)
  38026. .map(function (key) { return key + '=' + windowCreationOptionsList[key]; })
  38027. .join(',');
  38028. var popupWindow = window.open("", title, windowCreationOptions);
  38029. if (!popupWindow) {
  38030. return null;
  38031. }
  38032. var parentDocument = popupWindow.document;
  38033. // Font
  38034. var newLinkEl = parentDocument.createElement('link');
  38035. newLinkEl.rel = 'stylesheet';
  38036. newLinkEl.href = "https://use.typekit.net/cta4xsb.css";
  38037. parentDocument.head.appendChild(newLinkEl);
  38038. parentDocument.title = title;
  38039. parentDocument.body.style.width = "100%";
  38040. parentDocument.body.style.height = "100%";
  38041. parentDocument.body.style.margin = "0";
  38042. parentDocument.body.style.padding = "0";
  38043. var parentControl = parentDocument.createElement("div");
  38044. parentControl.style.width = "100%";
  38045. parentControl.style.height = "100%";
  38046. parentControl.style.margin = "0";
  38047. parentControl.style.padding = "0";
  38048. popupWindow.document.body.appendChild(parentControl);
  38049. this._CopyStyles(window.document, parentDocument);
  38050. setTimeout(function () {
  38051. _this._CopyStyles(window.document, parentDocument);
  38052. }, 0);
  38053. this[windowVariableName] = popupWindow;
  38054. return parentControl;
  38055. };
  38056. Popup._CopyStyles = function (sourceDoc, targetDoc) {
  38057. for (var index = 0; index < sourceDoc.styleSheets.length; index++) {
  38058. var styleSheet = sourceDoc.styleSheets[index];
  38059. try {
  38060. if (styleSheet.cssRules) { // for <style> elements
  38061. var newStyleEl = sourceDoc.createElement('style');
  38062. for (var _i = 0, _a = styleSheet.cssRules; _i < _a.length; _i++) {
  38063. var cssRule = _a[_i];
  38064. // write the text of each rule into the body of the style element
  38065. newStyleEl.appendChild(sourceDoc.createTextNode(cssRule.cssText));
  38066. }
  38067. targetDoc.head.appendChild(newStyleEl);
  38068. }
  38069. else if (styleSheet.href) { // for <link> elements loading CSS from a URL
  38070. var newLinkEl = sourceDoc.createElement('link');
  38071. newLinkEl.rel = 'stylesheet';
  38072. newLinkEl.href = styleSheet.href;
  38073. targetDoc.head.appendChild(newLinkEl);
  38074. }
  38075. }
  38076. catch (e) {
  38077. console.log(e);
  38078. }
  38079. }
  38080. };
  38081. return Popup;
  38082. }());
  38083. /***/ }),
  38084. /***/ "./sharedUiComponents/lines/textLineComponent.tsx":
  38085. /*!********************************************************!*\
  38086. !*** ./sharedUiComponents/lines/textLineComponent.tsx ***!
  38087. \********************************************************/
  38088. /*! exports provided: TextLineComponent */
  38089. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38090. "use strict";
  38091. __webpack_require__.r(__webpack_exports__);
  38092. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextLineComponent", function() { return TextLineComponent; });
  38093. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  38094. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  38095. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  38096. var TextLineComponent = /** @class */ (function (_super) {
  38097. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TextLineComponent, _super);
  38098. function TextLineComponent(props) {
  38099. return _super.call(this, props) || this;
  38100. }
  38101. TextLineComponent.prototype.onLink = function () {
  38102. if (this.props.url) {
  38103. window.open(this.props.url, '_blank');
  38104. return;
  38105. }
  38106. if (!this.props.onLink) {
  38107. return;
  38108. }
  38109. this.props.onLink();
  38110. };
  38111. TextLineComponent.prototype.renderContent = function () {
  38112. var _this = this;
  38113. if (this.props.ignoreValue) {
  38114. return null;
  38115. }
  38116. if (this.props.onLink || this.props.url) {
  38117. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "link-value", title: this.props.value, onClick: function () { return _this.onLink(); } }, this.props.url ? "doc" : (this.props.value || "no name")));
  38118. }
  38119. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "value", title: this.props.value, style: { color: this.props.color ? this.props.color : "" } }, this.props.value || "no name"));
  38120. };
  38121. TextLineComponent.prototype.render = function () {
  38122. var _a, _b;
  38123. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: this.props.underline ? "textLine underline" : "textLine" + (this.props.additionalClass ? " " + this.props.additionalClass : "") },
  38124. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "label", title: (_a = this.props.label) !== null && _a !== void 0 ? _a : "" }, (_b = this.props.label) !== null && _b !== void 0 ? _b : ""),
  38125. this.renderContent()));
  38126. };
  38127. return TextLineComponent;
  38128. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  38129. /***/ }),
  38130. /***/ "./workbenchEditor.tsx":
  38131. /*!*****************************!*\
  38132. !*** ./workbenchEditor.tsx ***!
  38133. \*****************************/
  38134. /*! exports provided: WorkbenchEditor */
  38135. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38136. "use strict";
  38137. __webpack_require__.r(__webpack_exports__);
  38138. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchEditor", function() { return WorkbenchEditor; });
  38139. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  38140. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  38141. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  38142. /* harmony import */ var _components_guiList_guiListComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/guiList/guiListComponent */ "./components/guiList/guiListComponent.tsx");
  38143. /* harmony import */ var _components_propertyTab_propertyTabComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/propertyTab/propertyTabComponent */ "./components/propertyTab/propertyTabComponent.tsx");
  38144. /* harmony import */ var _portal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./portal */ "./portal.tsx");
  38145. /* harmony import */ var _components_log_logComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/log/logComponent */ "./components/log/logComponent.tsx");
  38146. /* harmony import */ var babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! babylonjs/Misc/dataStorage */ "babylonjs/Misc/observable");
  38147. /* harmony import */ var babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__);
  38148. /* harmony import */ var _guiNodeTools__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./guiNodeTools */ "./guiNodeTools.ts");
  38149. /* harmony import */ var _diagram_workbench__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagram/workbench */ "./diagram/workbench.tsx");
  38150. /* harmony import */ var _sharedComponents_messageDialog__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sharedComponents/messageDialog */ "./sharedComponents/messageDialog.tsx");
  38151. __webpack_require__(/*! ./main.scss */ "./main.scss");
  38152. var WorkbenchEditor = /** @class */ (function (_super) {
  38153. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(WorkbenchEditor, _super);
  38154. function WorkbenchEditor(props) {
  38155. var _this = _super.call(this, props) || this;
  38156. _this._leftWidth = babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__["DataStorage"].ReadNumber("LeftWidth", 200);
  38157. _this._rightWidth = babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__["DataStorage"].ReadNumber("RightWidth", 300);
  38158. _this._blocks = new Array();
  38159. _this.handlePopUp = function () {
  38160. _this.setState({
  38161. showPreviewPopUp: true,
  38162. });
  38163. _this.props.globalState.hostWindow.addEventListener("beforeunload", _this.handleClosingPopUp);
  38164. };
  38165. _this.handleClosingPopUp = function () {
  38166. _this._popUpWindow.close();
  38167. };
  38168. _this.createPopupWindow = function (title, windowVariableName, width, height) {
  38169. if (width === void 0) { width = 500; }
  38170. if (height === void 0) { height = 500; }
  38171. var windowCreationOptionsList = {
  38172. width: width,
  38173. height: height,
  38174. top: (_this.props.globalState.hostWindow.innerHeight - width) / 2 + window.screenY,
  38175. left: (_this.props.globalState.hostWindow.innerWidth - height) / 2 + window.screenX,
  38176. };
  38177. var windowCreationOptions = Object.keys(windowCreationOptionsList)
  38178. .map(function (key) { return key + "=" + windowCreationOptionsList[key]; })
  38179. .join(",");
  38180. var popupWindow = _this.props.globalState.hostWindow.open("", title, windowCreationOptions);
  38181. if (!popupWindow) {
  38182. return null;
  38183. }
  38184. var parentDocument = popupWindow.document;
  38185. parentDocument.title = title;
  38186. parentDocument.body.style.width = "100%";
  38187. parentDocument.body.style.height = "100%";
  38188. parentDocument.body.style.margin = "0";
  38189. parentDocument.body.style.padding = "0";
  38190. var parentControl = parentDocument.createElement("div");
  38191. parentControl.style.width = "100%";
  38192. parentControl.style.height = "100%";
  38193. parentControl.style.margin = "0";
  38194. parentControl.style.padding = "0";
  38195. parentControl.style.display = "grid";
  38196. parentControl.style.gridTemplateRows = "40px auto";
  38197. parentControl.id = "gui-editor-workbench-root";
  38198. parentControl.className = "right-panel";
  38199. popupWindow.document.body.appendChild(parentControl);
  38200. _this.copyStyles(_this.props.globalState.hostWindow.document, parentDocument);
  38201. _this[windowVariableName] = popupWindow;
  38202. _this._popUpWindow = popupWindow;
  38203. return popupWindow;
  38204. };
  38205. _this.copyStyles = function (sourceDoc, targetDoc) {
  38206. var styleContainer = [];
  38207. for (var index = 0; index < sourceDoc.styleSheets.length; index++) {
  38208. var styleSheet = sourceDoc.styleSheets[index];
  38209. try {
  38210. if (styleSheet.href) {
  38211. // for <link> elements loading CSS from a URL
  38212. var newLinkEl = sourceDoc.createElement("link");
  38213. newLinkEl.rel = "stylesheet";
  38214. newLinkEl.href = styleSheet.href;
  38215. targetDoc.head.appendChild(newLinkEl);
  38216. styleContainer.push(newLinkEl);
  38217. }
  38218. else if (styleSheet.cssRules) {
  38219. // for <style> elements
  38220. var newStyleEl = sourceDoc.createElement("style");
  38221. for (var _i = 0, _a = styleSheet.cssRules; _i < _a.length; _i++) {
  38222. var cssRule = _a[_i];
  38223. newStyleEl.appendChild(sourceDoc.createTextNode(cssRule.cssText));
  38224. }
  38225. targetDoc.head.appendChild(newStyleEl);
  38226. styleContainer.push(newStyleEl);
  38227. }
  38228. }
  38229. catch (e) {
  38230. console.log(e);
  38231. }
  38232. }
  38233. };
  38234. _this.fixPopUpStyles = function (document) {
  38235. var previewContainer = document.getElementById("preview");
  38236. if (previewContainer) {
  38237. previewContainer.style.height = "auto";
  38238. previewContainer.style.gridRow = "1";
  38239. }
  38240. var previewConfigBar = document.getElementById("preview-config-bar");
  38241. if (previewConfigBar) {
  38242. previewConfigBar.style.gridRow = "2";
  38243. }
  38244. var newWindowButton = document.getElementById("preview-new-window");
  38245. if (newWindowButton) {
  38246. newWindowButton.style.display = "none";
  38247. }
  38248. var previewMeshBar = document.getElementById("preview-mesh-bar");
  38249. if (previewMeshBar) {
  38250. previewMeshBar.style.gridTemplateColumns = "auto 1fr 40px 40px";
  38251. }
  38252. };
  38253. _this.state = {
  38254. showPreviewPopUp: false,
  38255. };
  38256. _this.props.globalState.hostDocument.addEventListener("keydown", function (evt) {
  38257. if ((evt.keyCode === 46 || evt.keyCode === 8) && !_this.props.globalState.blockKeyboardEvents) {
  38258. // Delete
  38259. var selectedItems = _this._workbenchCanvas.selectedGuiNodes;
  38260. for (var _i = 0, selectedItems_1 = selectedItems; _i < selectedItems_1.length; _i++) {
  38261. var selectedItem = selectedItems_1[_i];
  38262. selectedItem.dispose();
  38263. }
  38264. _this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
  38265. return;
  38266. }
  38267. if (!evt.ctrlKey || _this.props.globalState.blockKeyboardEvents) {
  38268. return;
  38269. }
  38270. if (evt.key === "c") {
  38271. // Copy
  38272. var selectedItems = _this._workbenchCanvas.selectedGuiNodes;
  38273. if (!selectedItems.length) {
  38274. return;
  38275. }
  38276. var selectedItem_1 = selectedItems[0];
  38277. if (!selectedItem_1.guiControl) {
  38278. return;
  38279. }
  38280. }
  38281. else if (evt.key === "v") {
  38282. // Paste
  38283. //TODO: Implement
  38284. }
  38285. }, false);
  38286. return _this;
  38287. }
  38288. /**
  38289. * Creates a node and recursivly creates its parent nodes from it's input
  38290. * @param block
  38291. */
  38292. WorkbenchEditor.prototype.createNodeFromObject = function (block, recursion) {
  38293. if (recursion === void 0) { recursion = true; }
  38294. if (this._blocks.indexOf(block) !== -1) {
  38295. return this._workbenchCanvas.nodes.filter(function (n) { return n.guiControl === block; })[0];
  38296. }
  38297. this._blocks.push(block);
  38298. //TODO: Implement
  38299. var node = null;
  38300. return node;
  38301. };
  38302. WorkbenchEditor.prototype.componentDidMount = function () {
  38303. if (this.props.globalState.hostDocument) {
  38304. this._workbenchCanvas = this.refs["graphCanvas"];
  38305. }
  38306. if (navigator.userAgent.indexOf("Mobile") !== -1) {
  38307. (this.props.globalState.hostDocument || document).querySelector(".blocker").style.visibility = "visible";
  38308. }
  38309. };
  38310. WorkbenchEditor.prototype.componentWillUnmount = function () {
  38311. if (this.props.globalState.hostDocument) {
  38312. this.props.globalState.hostDocument.removeEventListener("keyup", this._onWidgetKeyUpPointer, false);
  38313. }
  38314. };
  38315. WorkbenchEditor.prototype.pasteSelection = function (copiedNodes, currentX, currentY, selectNew) {
  38316. //let originalNode: Nullable<GUINode> = null;
  38317. if (selectNew === void 0) { selectNew = false; }
  38318. var newNodes = [];
  38319. // Copy to prevent recursive side effects while creating nodes.
  38320. copiedNodes = copiedNodes.slice();
  38321. // Cancel selection
  38322. this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
  38323. // Create new nodes
  38324. for (var _i = 0, copiedNodes_1 = copiedNodes; _i < copiedNodes_1.length; _i++) {
  38325. var node = copiedNodes_1[_i];
  38326. var block = node.guiControl;
  38327. if (!block) {
  38328. continue;
  38329. }
  38330. }
  38331. return newNodes;
  38332. };
  38333. WorkbenchEditor.prototype.zoomToFit = function () {
  38334. this._workbenchCanvas.zoomToFit();
  38335. };
  38336. WorkbenchEditor.prototype.showWaitScreen = function () {
  38337. var _a;
  38338. (_a = this.props.globalState.hostDocument.querySelector(".wait-screen")) === null || _a === void 0 ? void 0 : _a.classList.remove("hidden");
  38339. };
  38340. WorkbenchEditor.prototype.hideWaitScreen = function () {
  38341. var _a;
  38342. (_a = this.props.globalState.hostDocument.querySelector(".wait-screen")) === null || _a === void 0 ? void 0 : _a.classList.add("hidden");
  38343. };
  38344. WorkbenchEditor.prototype.reOrganize = function (editorData, isImportingAFrame) {
  38345. var _this = this;
  38346. if (editorData === void 0) { editorData = null; }
  38347. if (isImportingAFrame === void 0) { isImportingAFrame = false; }
  38348. this.showWaitScreen();
  38349. this._workbenchCanvas._isLoading = true; // Will help loading large graphes
  38350. setTimeout(function () {
  38351. if (!editorData || !editorData.locations) {
  38352. _this._workbenchCanvas.distributeGraph();
  38353. }
  38354. else {
  38355. // Locations
  38356. for (var _i = 0, _a = editorData.locations; _i < _a.length; _i++) {
  38357. var location = _a[_i];
  38358. for (var _b = 0, _c = _this._workbenchCanvas.nodes; _b < _c.length; _b++) {
  38359. var node = _c[_b];
  38360. if (node.guiControl && node.guiControl.uniqueId === location.blockId) {
  38361. node.x = location.x;
  38362. node.y = location.y;
  38363. node.cleanAccumulation();
  38364. break;
  38365. }
  38366. }
  38367. }
  38368. }
  38369. _this._workbenchCanvas._isLoading = false;
  38370. for (var _d = 0, _e = _this._workbenchCanvas.nodes; _d < _e.length; _d++) {
  38371. var node = _e[_d];
  38372. }
  38373. _this.hideWaitScreen();
  38374. });
  38375. };
  38376. WorkbenchEditor.prototype.onPointerDown = function (evt) {
  38377. this._startX = evt.clientX;
  38378. this._moveInProgress = true;
  38379. evt.currentTarget.setPointerCapture(evt.pointerId);
  38380. };
  38381. WorkbenchEditor.prototype.onPointerUp = function (evt) {
  38382. this._moveInProgress = false;
  38383. evt.currentTarget.releasePointerCapture(evt.pointerId);
  38384. };
  38385. WorkbenchEditor.prototype.resizeColumns = function (evt, forLeft) {
  38386. if (forLeft === void 0) { forLeft = true; }
  38387. if (!this._moveInProgress) {
  38388. return;
  38389. }
  38390. var deltaX = evt.clientX - this._startX;
  38391. var rootElement = evt.currentTarget.ownerDocument.getElementById("workbench-editor-workbench-root");
  38392. if (forLeft) {
  38393. this._leftWidth += deltaX;
  38394. this._leftWidth = Math.max(150, Math.min(400, this._leftWidth));
  38395. babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__["DataStorage"].WriteNumber("LeftWidth", this._leftWidth);
  38396. }
  38397. else {
  38398. this._rightWidth -= deltaX;
  38399. this._rightWidth = Math.max(250, Math.min(500, this._rightWidth));
  38400. babylonjs_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__["DataStorage"].WriteNumber("RightWidth", this._rightWidth);
  38401. rootElement.ownerDocument.getElementById("preview").style.height = this._rightWidth + "px";
  38402. }
  38403. rootElement.style.gridTemplateColumns = this.buildColumnLayout();
  38404. this._startX = evt.clientX;
  38405. };
  38406. WorkbenchEditor.prototype.buildColumnLayout = function () {
  38407. return this._leftWidth + "px 4px calc(100% - " + (this._leftWidth + 8 + this._rightWidth) + "px) 4px " + this._rightWidth + "px";
  38408. };
  38409. WorkbenchEditor.prototype.emitNewBlock = function (event) {
  38410. var data = event.dataTransfer.getData("babylonjs-gui-node");
  38411. var guiElement = _guiNodeTools__WEBPACK_IMPORTED_MODULE_7__["GUINodeTools"].CreateControlFromString(data);
  38412. var newGuiNode = this._workbenchCanvas.appendBlock(guiElement);
  38413. //TODO: Get correct positioning
  38414. /*let x = event.clientX; // - event.currentTarget.offsetLeft - this._workbenchCanvas.x;
  38415. let y = event.clientY; // - event.currentTarget.offsetTop - this._workbenchCanvas.y - 20;
  38416. newGuiNode.x += (x - newGuiNode.x);
  38417. newGuiNode.y += y - newGuiNode.y;
  38418. //newGuiNode.cleanAccumulation();*/
  38419. this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
  38420. this.props.globalState.onSelectionChangedObservable.notifyObservers(newGuiNode);
  38421. this.forceUpdate();
  38422. };
  38423. WorkbenchEditor.prototype.render = function () {
  38424. var _this = this;
  38425. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_portal__WEBPACK_IMPORTED_MODULE_4__["Portal"], { globalState: this.props.globalState },
  38426. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "gui-editor-workbench-root", style: {
  38427. gridTemplateColumns: this.buildColumnLayout(),
  38428. }, onMouseMove: function (evt) {
  38429. // this._mouseLocationX = evt.pageX;
  38430. // this._mouseLocationY = evt.pageY;
  38431. }, onMouseDown: function (evt) {
  38432. if (evt.target.nodeName === "INPUT") {
  38433. return;
  38434. }
  38435. _this.props.globalState.blockKeyboardEvents = false;
  38436. } },
  38437. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_components_guiList_guiListComponent__WEBPACK_IMPORTED_MODULE_2__["GuiListComponent"], { globalState: this.props.globalState }),
  38438. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "leftGrab", onPointerDown: function (evt) { return _this.onPointerDown(evt); }, onPointerUp: function (evt) { return _this.onPointerUp(evt); }, onPointerMove: function (evt) { return _this.resizeColumns(evt); } }),
  38439. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "diagram-container", onDrop: function (event) {
  38440. _this.emitNewBlock(event);
  38441. }, onDragOver: function (event) {
  38442. event.preventDefault();
  38443. } },
  38444. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_diagram_workbench__WEBPACK_IMPORTED_MODULE_8__["WorkbenchComponent"], { ref: "graphCanvas", globalState: this.props.globalState })),
  38445. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: "rightGrab", onPointerDown: function (evt) { return _this.onPointerDown(evt); }, onPointerUp: function (evt) { return _this.onPointerUp(evt); }, onPointerMove: function (evt) { return _this.resizeColumns(evt, false); } }),
  38446. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "right-panel" },
  38447. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_components_propertyTab_propertyTabComponent__WEBPACK_IMPORTED_MODULE_3__["PropertyTabComponent"], { globalState: this.props.globalState })),
  38448. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_components_log_logComponent__WEBPACK_IMPORTED_MODULE_5__["LogComponent"], { globalState: this.props.globalState })),
  38449. react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_sharedComponents_messageDialog__WEBPACK_IMPORTED_MODULE_9__["MessageDialogComponent"], { globalState: this.props.globalState }),
  38450. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "blocker" }, "Node Material Editor runs only on desktop"),
  38451. react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "wait-screen hidden" }, "Processing...please wait")));
  38452. };
  38453. return WorkbenchEditor;
  38454. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  38455. /***/ }),
  38456. /***/ "babylonjs-gui/2D/controls/button":
  38457. /*!************************************************************************************************************************!*\
  38458. !*** external {"root":["BABYLON","GUI"],"commonjs":"babylonjs-gui","commonjs2":"babylonjs-gui","amd":"babylonjs-gui"} ***!
  38459. \************************************************************************************************************************/
  38460. /*! no static exports found */
  38461. /***/ (function(module, exports) {
  38462. module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_gui_2D_controls_button__;
  38463. /***/ }),
  38464. /***/ "babylonjs/Misc/observable":
  38465. /*!****************************************************************************************************!*\
  38466. !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
  38467. \****************************************************************************************************/
  38468. /*! no static exports found */
  38469. /***/ (function(module, exports) {
  38470. module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_observable__;
  38471. /***/ })
  38472. /******/ });
  38473. });
  38474. //# sourceMappingURL=babylon.guiEditor.max.js.map