lodash.js 498 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421
  1. 'use strict';var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};/**
  2. * @license
  3. * Lodash <https://lodash.com/>
  4. * Copyright JS Foundation and other contributors <https://js.foundation/>
  5. * Released under MIT license <https://lodash.com/license>
  6. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  7. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  8. *//*eslint-disable*/(function(){/** Used as a safe reference for `undefined` in pre-ES5 environments. */var undefined;/** Used as the semantic version number. */var VERSION='4.17.10';/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE=200;/** Error message constants. */var CORE_ERROR_TEXT='Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',FUNC_ERROR_TEXT='Expected a function';/** Used to stand-in for `undefined` hash values. */var HASH_UNDEFINED='__lodash_hash_undefined__';/** Used as the maximum memoize cache size. */var MAX_MEMOIZE_SIZE=500;/** Used as the internal argument placeholder. */var PLACEHOLDER='__lodash_placeholder__';/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4;/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG=8,WRAP_CURRY_RIGHT_FLAG=16,WRAP_PARTIAL_FLAG=32,WRAP_PARTIAL_RIGHT_FLAG=64,WRAP_ARY_FLAG=128,WRAP_REARG_FLAG=256,WRAP_FLIP_FLAG=512;/** Used as default options for `_.truncate`. */var DEFAULT_TRUNC_LENGTH=30,DEFAULT_TRUNC_OMISSION='...';/** Used to detect hot functions by number of calls within a span of milliseconds. */var HOT_COUNT=800,HOT_SPAN=16;/** Used to indicate the type of lazy iteratees. */var LAZY_FILTER_FLAG=1,LAZY_MAP_FLAG=2,LAZY_WHILE_FLAG=3;/** Used as references for various `Number` constants. */var INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=0/0;/** Used as references for the maximum length and index of an array. */var MAX_ARRAY_LENGTH=4294967295,MAX_ARRAY_INDEX=MAX_ARRAY_LENGTH-1,HALF_MAX_ARRAY_LENGTH=MAX_ARRAY_LENGTH>>>1;/** Used to associate wrap methods with their bit flags. */var wrapFlags=[['ary',WRAP_ARY_FLAG],['bind',WRAP_BIND_FLAG],['bindKey',WRAP_BIND_KEY_FLAG],['curry',WRAP_CURRY_FLAG],['curryRight',WRAP_CURRY_RIGHT_FLAG],['flip',WRAP_FLIP_FLAG],['partial',WRAP_PARTIAL_FLAG],['partialRight',WRAP_PARTIAL_RIGHT_FLAG],['rearg',WRAP_REARG_FLAG]];/** `Object#toString` result references. */var argsTag='[object Arguments]',arrayTag='[object Array]',asyncTag='[object AsyncFunction]',boolTag='[object Boolean]',dateTag='[object Date]',domExcTag='[object DOMException]',errorTag='[object Error]',funcTag='[object Function]',genTag='[object GeneratorFunction]',mapTag='[object Map]',numberTag='[object Number]',nullTag='[object Null]',objectTag='[object Object]',promiseTag='[object Promise]',proxyTag='[object Proxy]',regexpTag='[object RegExp]',setTag='[object Set]',stringTag='[object String]',symbolTag='[object Symbol]',undefinedTag='[object Undefined]',weakMapTag='[object WeakMap]',weakSetTag='[object WeakSet]';var arrayBufferTag='[object ArrayBuffer]',dataViewTag='[object DataView]',float32Tag='[object Float32Array]',float64Tag='[object Float64Array]',int8Tag='[object Int8Array]',int16Tag='[object Int16Array]',int32Tag='[object Int32Array]',uint8Tag='[object Uint8Array]',uint8ClampedTag='[object Uint8ClampedArray]',uint16Tag='[object Uint16Array]',uint32Tag='[object Uint32Array]';/** Used to match empty string literals in compiled template source. */var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;/** Used to match HTML entities and HTML characters. */var reEscapedHtml=/&(?:amp|lt|gt|quot|#39);/g,reUnescapedHtml=/[&<>"']/g,reHasEscapedHtml=RegExp(reEscapedHtml.source),reHasUnescapedHtml=RegExp(reUnescapedHtml.source);/** Used to match template delimiters. */var reEscape=/<%-([\s\S]+?)%>/g,reEvaluate=/<%([\s\S]+?)%>/g,reInterpolate=/<%=([\s\S]+?)%>/g;/** Used to match property names within property paths. */var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;/**
  9. * Used to match `RegExp`
  10. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  11. */var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reHasRegExpChar=RegExp(reRegExpChar.source);/** Used to match leading and trailing whitespace. */var reTrim=/^\s+|\s+$/g,reTrimStart=/^\s+/,reTrimEnd=/\s+$/;/** Used to match wrap detail comments. */var reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /;/** Used to match words composed of alphanumeric characters. */var reAsciiWord=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;/** Used to match backslashes in property paths. */var reEscapeChar=/\\(\\)?/g;/**
  12. * Used to match
  13. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  14. */var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;/** Used to match `RegExp` flags from their coerced string values. */var reFlags=/\w*$/;/** Used to detect bad signed hexadecimal string values. */var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;/** Used to detect binary string values. */var reIsBinary=/^0b[01]+$/i;/** Used to detect host constructors (Safari). */var reIsHostCtor=/^\[object .+?Constructor\]$/;/** Used to detect octal string values. */var reIsOctal=/^0o[0-7]+$/i;/** Used to detect unsigned integer values. */var reIsUint=/^(?:0|[1-9]\d*)$/;/** Used to match Latin Unicode letters (excluding mathematical operators). */var reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;/** Used to ensure capturing order of template delimiters. */var reNoMatch=/($^)/;/** Used to match unescaped characters in compiled string literals. */var reUnescapedString=/['\n\r\u2028\u2029\\]/g;/** Used to compose unicode character classes. */var rsAstralRange='\\ud800-\\udfff',rsComboMarksRange='\\u0300-\\u036f',reComboHalfMarksRange='\\ufe20-\\ufe2f',rsComboSymbolsRange='\\u20d0-\\u20ff',rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsDingbatRange='\\u2700-\\u27bf',rsLowerRange='a-z\\xdf-\\xf6\\xf8-\\xff',rsMathOpRange='\\xac\\xb1\\xd7\\xf7',rsNonCharRange='\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',rsPunctuationRange='\\u2000-\\u206f',rsSpaceRange=' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',rsUpperRange='A-Z\\xc0-\\xd6\\xd8-\\xde',rsVarRange='\\ufe0e\\ufe0f',rsBreakRange=rsMathOpRange+rsNonCharRange+rsPunctuationRange+rsSpaceRange;/** Used to compose unicode capture groups. */var rsApos='[\'\u2019]',rsAstral='['+rsAstralRange+']',rsBreak='['+rsBreakRange+']',rsCombo='['+rsComboRange+']',rsDigits='\\d+',rsDingbat='['+rsDingbatRange+']',rsLower='['+rsLowerRange+']',rsMisc='[^'+rsAstralRange+rsBreakRange+rsDigits+rsDingbatRange+rsLowerRange+rsUpperRange+']',rsFitz='\\ud83c[\\udffb-\\udfff]',rsModifier='(?:'+rsCombo+'|'+rsFitz+')',rsNonAstral='[^'+rsAstralRange+']',rsRegional='(?:\\ud83c[\\udde6-\\uddff]){2}',rsSurrPair='[\\ud800-\\udbff][\\udc00-\\udfff]',rsUpper='['+rsUpperRange+']',rsZWJ='\\u200d';/** Used to compose unicode regexes. */var rsMiscLower='(?:'+rsLower+'|'+rsMisc+')',rsMiscUpper='(?:'+rsUpper+'|'+rsMisc+')',rsOptContrLower='(?:'+rsApos+'(?:d|ll|m|re|s|t|ve))?',rsOptContrUpper='(?:'+rsApos+'(?:D|LL|M|RE|S|T|VE))?',reOptMod=rsModifier+'?',rsOptVar='['+rsVarRange+']?',rsOptJoin='(?:'+rsZWJ+'(?:'+[rsNonAstral,rsRegional,rsSurrPair].join('|')+')'+rsOptVar+reOptMod+')*',rsOrdLower='\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',rsOrdUpper='\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',rsSeq=rsOptVar+reOptMod+rsOptJoin,rsEmoji='(?:'+[rsDingbat,rsRegional,rsSurrPair].join('|')+')'+rsSeq,rsSymbol='(?:'+[rsNonAstral+rsCombo+'?',rsCombo,rsRegional,rsSurrPair,rsAstral].join('|')+')';/** Used to match apostrophes. */var reApos=RegExp(rsApos,'g');/**
  15. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  16. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  17. */var reComboMark=RegExp(rsCombo,'g');/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */var reUnicode=RegExp(rsFitz+'(?='+rsFitz+')|'+rsSymbol+rsSeq,'g');/** Used to match complex or compound words. */var reUnicodeWord=RegExp([rsUpper+'?'+rsLower+'+'+rsOptContrLower+'(?='+[rsBreak,rsUpper,'$'].join('|')+')',rsMiscUpper+'+'+rsOptContrUpper+'(?='+[rsBreak,rsUpper+rsMiscLower,'$'].join('|')+')',rsUpper+'?'+rsMiscLower+'+'+rsOptContrLower,rsUpper+'+'+rsOptContrUpper,rsOrdUpper,rsOrdLower,rsDigits,rsEmoji].join('|'),'g');/** 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/). */var reHasUnicode=RegExp('['+rsZWJ+rsAstralRange+rsComboRange+rsVarRange+']');/** Used to detect strings that need a more robust regexp to match words. */var reHasUnicodeWord=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;/** Used to assign default `context` object properties. */var contextProps=['Array','Buffer','DataView','Date','Error','Float32Array','Float64Array','Function','Int8Array','Int16Array','Int32Array','Map','Math','Object','Promise','RegExp','Set','String','Symbol','TypeError','Uint8Array','Uint8ClampedArray','Uint16Array','Uint32Array','WeakMap','_','clearTimeout','isFinite','parseInt','setTimeout'];/** Used to make template sourceURLs easier to identify. */var templateCounter=-1;/** Used to identify `toStringTag` values of typed arrays. */var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;/** Used to identify `toStringTag` values supported by `_.clone`. */var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=true;cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=false;/** Used to map Latin Unicode letters to basic Latin letters. */var deburredLetters={// Latin-1 Supplement block.
  18. À:'A',Á:'A',Â:'A',Ã:'A',Ä:'A',Å:'A',à:'a',á:'a',â:'a',ã:'a',ä:'a',å:'a',Ç:'C',ç:'c',Ð:'D',ð:'d',È:'E',É:'E',Ê:'E',Ë:'E',è:'e',é:'e',ê:'e',ë:'e',Ì:'I',Í:'I',Î:'I',Ï:'I',ì:'i',í:'i',î:'i',ï:'i',Ñ:'N',ñ:'n',Ò:'O',Ó:'O',Ô:'O',Õ:'O',Ö:'O',Ø:'O',ò:'o',ó:'o',ô:'o',õ:'o',ö:'o',ø:'o',Ù:'U',Ú:'U',Û:'U',Ü:'U',ù:'u',ú:'u',û:'u',ü:'u',Ý:'Y',ý:'y',ÿ:'y',Æ:'Ae',æ:'ae',Þ:'Th',þ:'th',ß:'ss',// Latin Extended-A block.
  19. Ā:'A',Ă:'A',Ą:'A',ā:'a',ă:'a',ą:'a',Ć:'C',Ĉ:'C',Ċ:'C',Č:'C',ć:'c',ĉ:'c',ċ:'c',č:'c',Ď:'D',Đ:'D',ď:'d',đ:'d',Ē:'E',Ĕ:'E',Ė:'E',Ę:'E',Ě:'E',ē:'e',ĕ:'e',ė:'e',ę:'e',ě:'e',Ĝ:'G',Ğ:'G',Ġ:'G',Ģ:'G',ĝ:'g',ğ:'g',ġ:'g',ģ:'g',Ĥ:'H',Ħ:'H',ĥ:'h',ħ:'h',Ĩ:'I',Ī:'I',Ĭ:'I',Į:'I',İ:'I',ĩ:'i',ī:'i',ĭ:'i',į:'i',ı:'i',Ĵ:'J',ĵ:'j',Ķ:'K',ķ:'k',ĸ:'k',Ĺ:'L',Ļ:'L',Ľ:'L',Ŀ:'L',Ł:'L',ĺ:'l',ļ:'l',ľ:'l',ŀ:'l',ł:'l',Ń:'N',Ņ:'N',Ň:'N',Ŋ:'N',ń:'n',ņ:'n',ň:'n',ŋ:'n',Ō:'O',Ŏ:'O',Ő:'O',ō:'o',ŏ:'o',ő:'o',Ŕ:'R',Ŗ:'R',Ř:'R',ŕ:'r',ŗ:'r',ř:'r',Ś:'S',Ŝ:'S',Ş:'S',Š:'S',ś:'s',ŝ:'s',ş:'s',š:'s',Ţ:'T',Ť:'T',Ŧ:'T',ţ:'t',ť:'t',ŧ:'t',Ũ:'U',Ū:'U',Ŭ:'U',Ů:'U',Ű:'U',Ų:'U',ũ:'u',ū:'u',ŭ:'u',ů:'u',ű:'u',ų:'u',Ŵ:'W',ŵ:'w',Ŷ:'Y',ŷ:'y',Ÿ:'Y',Ź:'Z',Ż:'Z',Ž:'Z',ź:'z',ż:'z',ž:'z',IJ:'IJ',ij:'ij',Œ:'Oe',œ:'oe',ʼn:"'n",ſ:'s'};/** Used to map characters to HTML entities. */var htmlEscapes={'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'};/** Used to map HTML entities to characters. */var htmlUnescapes={'&amp;':'&','&lt;':'<','&gt;':'>','&quot;':'"','&#39;':"'"};/** Used to escape characters for inclusion in compiled string literals. */var stringEscapes={'\\':'\\',"'":"'",'\n':'n','\r':'r','\u2028':'u2028','\u2029':'u2029'};/** Built-in method references without a dependency on `root`. */var freeParseFloat=parseFloat,freeParseInt=parseInt;/** Detect free variable `global` from Node.js. */var freeGlobal=(typeof global==='undefined'?'undefined':_typeof(global))==='object'&&global&&global.Object===Object&&global;/** Detect free variable `self`. */var freeSelf=(typeof self==='undefined'?'undefined':_typeof(self))==='object'&&self&&self.Object===Object&&self;/** Used as a reference to the global object. */var root=freeGlobal||freeSelf||Function('return this')();/** Detect free variable `exports`. */var freeExports=(typeof exports==='undefined'?'undefined':_typeof(exports))==='object'&&exports&&!exports.nodeType&&exports;/** Detect free variable `module`. */var freeModule=freeExports&&(typeof module==='undefined'?'undefined':_typeof(module))==='object'&&module&&!module.nodeType&&module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports;/** Detect free variable `process` from Node.js. */var freeProcess=moduleExports&&freeGlobal.process;/** Used to access faster Node.js helpers. */var nodeUtil=function(){try{// Use `util.types` for Node.js 10+.
  20. var types=freeModule&&freeModule.require&&freeModule.require('util').types;if(types){return types;}// Legacy `process.binding('util')` for Node.js < 10.
  21. return freeProcess&&freeProcess.binding&&freeProcess.binding('util');}catch(e){}}();/* Node.js helper references. */var nodeIsArrayBuffer=nodeUtil&&nodeUtil.isArrayBuffer,nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;/* --------------------------------------------------------------------------*//**
  22. * A faster alternative to `Function#apply`, this function invokes `func`
  23. * with the `this` binding of `thisArg` and the arguments of `args`.
  24. *
  25. * @private
  26. * @param {Function} func The function to invoke.
  27. * @param {*} thisArg The `this` binding of `func`.
  28. * @param {Array} args The arguments to invoke `func` with.
  29. * @returns {*} Returns the result of `func`.
  30. */function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2]);}return func.apply(thisArg,args);}/**
  31. * A specialized version of `baseAggregator` for arrays.
  32. *
  33. * @private
  34. * @param {Array} [array] The array to iterate over.
  35. * @param {Function} setter The function to set `accumulator` values.
  36. * @param {Function} iteratee The iteratee to transform keys.
  37. * @param {Object} accumulator The initial aggregated object.
  38. * @returns {Function} Returns `accumulator`.
  39. */function arrayAggregator(array,setter,iteratee,accumulator){var index=-1,length=array==null?0:array.length;while(++index<length){var value=array[index];setter(accumulator,value,iteratee(value),array);}return accumulator;}/**
  40. * A specialized version of `_.forEach` for arrays without support for
  41. * iteratee shorthands.
  42. *
  43. * @private
  44. * @param {Array} [array] The array to iterate over.
  45. * @param {Function} iteratee The function invoked per iteration.
  46. * @returns {Array} Returns `array`.
  47. */function arrayEach(array,iteratee){var index=-1,length=array==null?0:array.length;while(++index<length){if(iteratee(array[index],index,array)===false){break;}}return array;}/**
  48. * A specialized version of `_.forEachRight` for arrays without support for
  49. * iteratee shorthands.
  50. *
  51. * @private
  52. * @param {Array} [array] The array to iterate over.
  53. * @param {Function} iteratee The function invoked per iteration.
  54. * @returns {Array} Returns `array`.
  55. */function arrayEachRight(array,iteratee){var length=array==null?0:array.length;while(length--){if(iteratee(array[length],length,array)===false){break;}}return array;}/**
  56. * A specialized version of `_.every` for arrays without support for
  57. * iteratee shorthands.
  58. *
  59. * @private
  60. * @param {Array} [array] The array to iterate over.
  61. * @param {Function} predicate The function invoked per iteration.
  62. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  63. * else `false`.
  64. */function arrayEvery(array,predicate){var index=-1,length=array==null?0:array.length;while(++index<length){if(!predicate(array[index],index,array)){return false;}}return true;}/**
  65. * A specialized version of `_.filter` for arrays without support for
  66. * iteratee shorthands.
  67. *
  68. * @private
  69. * @param {Array} [array] The array to iterate over.
  70. * @param {Function} predicate The function invoked per iteration.
  71. * @returns {Array} Returns the new filtered array.
  72. */function arrayFilter(array,predicate){var index=-1,length=array==null?0:array.length,resIndex=0,result=[];while(++index<length){var value=array[index];if(predicate(value,index,array)){result[resIndex++]=value;}}return result;}/**
  73. * A specialized version of `_.includes` for arrays without support for
  74. * specifying an index to search from.
  75. *
  76. * @private
  77. * @param {Array} [array] The array to inspect.
  78. * @param {*} target The value to search for.
  79. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  80. */function arrayIncludes(array,value){var length=array==null?0:array.length;return!!length&&baseIndexOf(array,value,0)>-1;}/**
  81. * This function is like `arrayIncludes` except that it accepts a comparator.
  82. *
  83. * @private
  84. * @param {Array} [array] The array to inspect.
  85. * @param {*} target The value to search for.
  86. * @param {Function} comparator The comparator invoked per element.
  87. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  88. */function arrayIncludesWith(array,value,comparator){var index=-1,length=array==null?0:array.length;while(++index<length){if(comparator(value,array[index])){return true;}}return false;}/**
  89. * A specialized version of `_.map` for arrays without support for iteratee
  90. * shorthands.
  91. *
  92. * @private
  93. * @param {Array} [array] The array to iterate over.
  94. * @param {Function} iteratee The function invoked per iteration.
  95. * @returns {Array} Returns the new mapped array.
  96. */function arrayMap(array,iteratee){var index=-1,length=array==null?0:array.length,result=Array(length);while(++index<length){result[index]=iteratee(array[index],index,array);}return result;}/**
  97. * Appends the elements of `values` to `array`.
  98. *
  99. * @private
  100. * @param {Array} array The array to modify.
  101. * @param {Array} values The values to append.
  102. * @returns {Array} Returns `array`.
  103. */function arrayPush(array,values){var index=-1,length=values.length,offset=array.length;while(++index<length){array[offset+index]=values[index];}return array;}/**
  104. * A specialized version of `_.reduce` for arrays without support for
  105. * iteratee shorthands.
  106. *
  107. * @private
  108. * @param {Array} [array] The array to iterate over.
  109. * @param {Function} iteratee The function invoked per iteration.
  110. * @param {*} [accumulator] The initial value.
  111. * @param {boolean} [initAccum] Specify using the first element of `array` as
  112. * the initial value.
  113. * @returns {*} Returns the accumulated value.
  114. */function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=array==null?0:array.length;if(initAccum&&length){accumulator=array[++index];}while(++index<length){accumulator=iteratee(accumulator,array[index],index,array);}return accumulator;}/**
  115. * A specialized version of `_.reduceRight` for arrays without support for
  116. * iteratee shorthands.
  117. *
  118. * @private
  119. * @param {Array} [array] The array to iterate over.
  120. * @param {Function} iteratee The function invoked per iteration.
  121. * @param {*} [accumulator] The initial value.
  122. * @param {boolean} [initAccum] Specify using the last element of `array` as
  123. * the initial value.
  124. * @returns {*} Returns the accumulated value.
  125. */function arrayReduceRight(array,iteratee,accumulator,initAccum){var length=array==null?0:array.length;if(initAccum&&length){accumulator=array[--length];}while(length--){accumulator=iteratee(accumulator,array[length],length,array);}return accumulator;}/**
  126. * A specialized version of `_.some` for arrays without support for iteratee
  127. * shorthands.
  128. *
  129. * @private
  130. * @param {Array} [array] The array to iterate over.
  131. * @param {Function} predicate The function invoked per iteration.
  132. * @returns {boolean} Returns `true` if any element passes the predicate check,
  133. * else `false`.
  134. */function arraySome(array,predicate){var index=-1,length=array==null?0:array.length;while(++index<length){if(predicate(array[index],index,array)){return true;}}return false;}/**
  135. * Gets the size of an ASCII `string`.
  136. *
  137. * @private
  138. * @param {string} string The string inspect.
  139. * @returns {number} Returns the string size.
  140. */var asciiSize=baseProperty('length');/**
  141. * Converts an ASCII `string` to an array.
  142. *
  143. * @private
  144. * @param {string} string The string to convert.
  145. * @returns {Array} Returns the converted array.
  146. */function asciiToArray(string){return string.split('');}/**
  147. * Splits an ASCII `string` into an array of its words.
  148. *
  149. * @private
  150. * @param {string} The string to inspect.
  151. * @returns {Array} Returns the words of `string`.
  152. */function asciiWords(string){return string.match(reAsciiWord)||[];}/**
  153. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  154. * without support for iteratee shorthands, which iterates over `collection`
  155. * using `eachFunc`.
  156. *
  157. * @private
  158. * @param {Array|Object} collection The collection to inspect.
  159. * @param {Function} predicate The function invoked per iteration.
  160. * @param {Function} eachFunc The function to iterate over `collection`.
  161. * @returns {*} Returns the found element or its key, else `undefined`.
  162. */function baseFindKey(collection,predicate,eachFunc){var result;eachFunc(collection,function(value,key,collection){if(predicate(value,key,collection)){result=key;return false;}});return result;}/**
  163. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  164. * support for iteratee shorthands.
  165. *
  166. * @private
  167. * @param {Array} array The array to inspect.
  168. * @param {Function} predicate The function invoked per iteration.
  169. * @param {number} fromIndex The index to search from.
  170. * @param {boolean} [fromRight] Specify iterating from right to left.
  171. * @returns {number} Returns the index of the matched value, else `-1`.
  172. */function baseFindIndex(array,predicate,fromIndex,fromRight){var length=array.length,index=fromIndex+(fromRight?1:-1);while(fromRight?index--:++index<length){if(predicate(array[index],index,array)){return index;}}return-1;}/**
  173. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  174. *
  175. * @private
  176. * @param {Array} array The array to inspect.
  177. * @param {*} value The value to search for.
  178. * @param {number} fromIndex The index to search from.
  179. * @returns {number} Returns the index of the matched value, else `-1`.
  180. */function baseIndexOf(array,value,fromIndex){return value===value?strictIndexOf(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex);}/**
  181. * This function is like `baseIndexOf` except that it accepts a comparator.
  182. *
  183. * @private
  184. * @param {Array} array The array to inspect.
  185. * @param {*} value The value to search for.
  186. * @param {number} fromIndex The index to search from.
  187. * @param {Function} comparator The comparator invoked per element.
  188. * @returns {number} Returns the index of the matched value, else `-1`.
  189. */function baseIndexOfWith(array,value,fromIndex,comparator){var index=fromIndex-1,length=array.length;while(++index<length){if(comparator(array[index],value)){return index;}}return-1;}/**
  190. * The base implementation of `_.isNaN` without support for number objects.
  191. *
  192. * @private
  193. * @param {*} value The value to check.
  194. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  195. */function baseIsNaN(value){return value!==value;}/**
  196. * The base implementation of `_.mean` and `_.meanBy` without support for
  197. * iteratee shorthands.
  198. *
  199. * @private
  200. * @param {Array} array The array to iterate over.
  201. * @param {Function} iteratee The function invoked per iteration.
  202. * @returns {number} Returns the mean.
  203. */function baseMean(array,iteratee){var length=array==null?0:array.length;return length?baseSum(array,iteratee)/length:NAN;}/**
  204. * The base implementation of `_.property` without support for deep paths.
  205. *
  206. * @private
  207. * @param {string} key The key of the property to get.
  208. * @returns {Function} Returns the new accessor function.
  209. */function baseProperty(key){return function(object){return object==null?undefined:object[key];};}/**
  210. * The base implementation of `_.propertyOf` without support for deep paths.
  211. *
  212. * @private
  213. * @param {Object} object The object to query.
  214. * @returns {Function} Returns the new accessor function.
  215. */function basePropertyOf(object){return function(key){return object==null?undefined:object[key];};}/**
  216. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  217. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  218. *
  219. * @private
  220. * @param {Array|Object} collection The collection to iterate over.
  221. * @param {Function} iteratee The function invoked per iteration.
  222. * @param {*} accumulator The initial value.
  223. * @param {boolean} initAccum Specify using the first or last element of
  224. * `collection` as the initial value.
  225. * @param {Function} eachFunc The function to iterate over `collection`.
  226. * @returns {*} Returns the accumulated value.
  227. */function baseReduce(collection,iteratee,accumulator,initAccum,eachFunc){eachFunc(collection,function(value,index,collection){accumulator=initAccum?(initAccum=false,value):iteratee(accumulator,value,index,collection);});return accumulator;}/**
  228. * The base implementation of `_.sortBy` which uses `comparer` to define the
  229. * sort order of `array` and replaces criteria objects with their corresponding
  230. * values.
  231. *
  232. * @private
  233. * @param {Array} array The array to sort.
  234. * @param {Function} comparer The function to define sort order.
  235. * @returns {Array} Returns `array`.
  236. */function baseSortBy(array,comparer){var length=array.length;array.sort(comparer);while(length--){array[length]=array[length].value;}return array;}/**
  237. * The base implementation of `_.sum` and `_.sumBy` without support for
  238. * iteratee shorthands.
  239. *
  240. * @private
  241. * @param {Array} array The array to iterate over.
  242. * @param {Function} iteratee The function invoked per iteration.
  243. * @returns {number} Returns the sum.
  244. */function baseSum(array,iteratee){var result,index=-1,length=array.length;while(++index<length){var current=iteratee(array[index]);if(current!==undefined){result=result===undefined?current:result+current;}}return result;}/**
  245. * The base implementation of `_.times` without support for iteratee shorthands
  246. * or max array length checks.
  247. *
  248. * @private
  249. * @param {number} n The number of times to invoke `iteratee`.
  250. * @param {Function} iteratee The function invoked per iteration.
  251. * @returns {Array} Returns the array of results.
  252. */function baseTimes(n,iteratee){var index=-1,result=Array(n);while(++index<n){result[index]=iteratee(index);}return result;}/**
  253. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  254. * of key-value pairs for `object` corresponding to the property names of `props`.
  255. *
  256. * @private
  257. * @param {Object} object The object to query.
  258. * @param {Array} props The property names to get values for.
  259. * @returns {Object} Returns the key-value pairs.
  260. */function baseToPairs(object,props){return arrayMap(props,function(key){return[key,object[key]];});}/**
  261. * The base implementation of `_.unary` without support for storing metadata.
  262. *
  263. * @private
  264. * @param {Function} func The function to cap arguments for.
  265. * @returns {Function} Returns the new capped function.
  266. */function baseUnary(func){return function(value){return func(value);};}/**
  267. * The base implementation of `_.values` and `_.valuesIn` which creates an
  268. * array of `object` property values corresponding to the property names
  269. * of `props`.
  270. *
  271. * @private
  272. * @param {Object} object The object to query.
  273. * @param {Array} props The property names to get values for.
  274. * @returns {Object} Returns the array of property values.
  275. */function baseValues(object,props){return arrayMap(props,function(key){return object[key];});}/**
  276. * Checks if a `cache` value for `key` exists.
  277. *
  278. * @private
  279. * @param {Object} cache The cache to query.
  280. * @param {string} key The key of the entry to check.
  281. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  282. */function cacheHas(cache,key){return cache.has(key);}/**
  283. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  284. * that is not found in the character symbols.
  285. *
  286. * @private
  287. * @param {Array} strSymbols The string symbols to inspect.
  288. * @param {Array} chrSymbols The character symbols to find.
  289. * @returns {number} Returns the index of the first unmatched string symbol.
  290. */function charsStartIndex(strSymbols,chrSymbols){var index=-1,length=strSymbols.length;while(++index<length&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1){}return index;}/**
  291. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  292. * that is not found in the character symbols.
  293. *
  294. * @private
  295. * @param {Array} strSymbols The string symbols to inspect.
  296. * @param {Array} chrSymbols The character symbols to find.
  297. * @returns {number} Returns the index of the last unmatched string symbol.
  298. */function charsEndIndex(strSymbols,chrSymbols){var index=strSymbols.length;while(index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1){}return index;}/**
  299. * Gets the number of `placeholder` occurrences in `array`.
  300. *
  301. * @private
  302. * @param {Array} array The array to inspect.
  303. * @param {*} placeholder The placeholder to search for.
  304. * @returns {number} Returns the placeholder count.
  305. */function countHolders(array,placeholder){var length=array.length,result=0;while(length--){if(array[length]===placeholder){++result;}}return result;}/**
  306. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  307. * letters to basic Latin letters.
  308. *
  309. * @private
  310. * @param {string} letter The matched letter to deburr.
  311. * @returns {string} Returns the deburred letter.
  312. */var deburrLetter=basePropertyOf(deburredLetters);/**
  313. * Used by `_.escape` to convert characters to HTML entities.
  314. *
  315. * @private
  316. * @param {string} chr The matched character to escape.
  317. * @returns {string} Returns the escaped character.
  318. */var escapeHtmlChar=basePropertyOf(htmlEscapes);/**
  319. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  320. *
  321. * @private
  322. * @param {string} chr The matched character to escape.
  323. * @returns {string} Returns the escaped character.
  324. */function escapeStringChar(chr){return'\\'+stringEscapes[chr];}/**
  325. * Gets the value at `key` of `object`.
  326. *
  327. * @private
  328. * @param {Object} [object] The object to query.
  329. * @param {string} key The key of the property to get.
  330. * @returns {*} Returns the property value.
  331. */function getValue(object,key){return object==null?undefined:object[key];}/**
  332. * Checks if `string` contains Unicode symbols.
  333. *
  334. * @private
  335. * @param {string} string The string to inspect.
  336. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  337. */function hasUnicode(string){return reHasUnicode.test(string);}/**
  338. * Checks if `string` contains a word composed of Unicode symbols.
  339. *
  340. * @private
  341. * @param {string} string The string to inspect.
  342. * @returns {boolean} Returns `true` if a word is found, else `false`.
  343. */function hasUnicodeWord(string){return reHasUnicodeWord.test(string);}/**
  344. * Converts `iterator` to an array.
  345. *
  346. * @private
  347. * @param {Object} iterator The iterator to convert.
  348. * @returns {Array} Returns the converted array.
  349. */function iteratorToArray(iterator){var data,result=[];while(!(data=iterator.next()).done){result.push(data.value);}return result;}/**
  350. * Converts `map` to its key-value pairs.
  351. *
  352. * @private
  353. * @param {Object} map The map to convert.
  354. * @returns {Array} Returns the key-value pairs.
  355. */function mapToArray(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value];});return result;}/**
  356. * Creates a unary function that invokes `func` with its argument transformed.
  357. *
  358. * @private
  359. * @param {Function} func The function to wrap.
  360. * @param {Function} transform The argument transform.
  361. * @returns {Function} Returns the new function.
  362. */function overArg(func,transform){return function(arg){return func(transform(arg));};}/**
  363. * Replaces all `placeholder` elements in `array` with an internal placeholder
  364. * and returns an array of their indexes.
  365. *
  366. * @private
  367. * @param {Array} array The array to modify.
  368. * @param {*} placeholder The placeholder to replace.
  369. * @returns {Array} Returns the new array of placeholder indexes.
  370. */function replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=0,result=[];while(++index<length){var value=array[index];if(value===placeholder||value===PLACEHOLDER){array[index]=PLACEHOLDER;result[resIndex++]=index;}}return result;}/**
  371. * Gets the value at `key`, unless `key` is "__proto__".
  372. *
  373. * @private
  374. * @param {Object} object The object to query.
  375. * @param {string} key The key of the property to get.
  376. * @returns {*} Returns the property value.
  377. */function safeGet(object,key){return key=='__proto__'?undefined:object[key];}/**
  378. * Converts `set` to an array of its values.
  379. *
  380. * @private
  381. * @param {Object} set The set to convert.
  382. * @returns {Array} Returns the values.
  383. */function setToArray(set){var index=-1,result=Array(set.size);set.forEach(function(value){result[++index]=value;});return result;}/**
  384. * Converts `set` to its value-value pairs.
  385. *
  386. * @private
  387. * @param {Object} set The set to convert.
  388. * @returns {Array} Returns the value-value pairs.
  389. */function setToPairs(set){var index=-1,result=Array(set.size);set.forEach(function(value){result[++index]=[value,value];});return result;}/**
  390. * A specialized version of `_.indexOf` which performs strict equality
  391. * comparisons of values, i.e. `===`.
  392. *
  393. * @private
  394. * @param {Array} array The array to inspect.
  395. * @param {*} value The value to search for.
  396. * @param {number} fromIndex The index to search from.
  397. * @returns {number} Returns the index of the matched value, else `-1`.
  398. */function strictIndexOf(array,value,fromIndex){var index=fromIndex-1,length=array.length;while(++index<length){if(array[index]===value){return index;}}return-1;}/**
  399. * A specialized version of `_.lastIndexOf` which performs strict equality
  400. * comparisons of values, i.e. `===`.
  401. *
  402. * @private
  403. * @param {Array} array The array to inspect.
  404. * @param {*} value The value to search for.
  405. * @param {number} fromIndex The index to search from.
  406. * @returns {number} Returns the index of the matched value, else `-1`.
  407. */function strictLastIndexOf(array,value,fromIndex){var index=fromIndex+1;while(index--){if(array[index]===value){return index;}}return index;}/**
  408. * Gets the number of symbols in `string`.
  409. *
  410. * @private
  411. * @param {string} string The string to inspect.
  412. * @returns {number} Returns the string size.
  413. */function stringSize(string){return hasUnicode(string)?unicodeSize(string):asciiSize(string);}/**
  414. * Converts `string` to an array.
  415. *
  416. * @private
  417. * @param {string} string The string to convert.
  418. * @returns {Array} Returns the converted array.
  419. */function stringToArray(string){return hasUnicode(string)?unicodeToArray(string):asciiToArray(string);}/**
  420. * Used by `_.unescape` to convert HTML entities to characters.
  421. *
  422. * @private
  423. * @param {string} chr The matched character to unescape.
  424. * @returns {string} Returns the unescaped character.
  425. */var unescapeHtmlChar=basePropertyOf(htmlUnescapes);/**
  426. * Gets the size of a Unicode `string`.
  427. *
  428. * @private
  429. * @param {string} string The string inspect.
  430. * @returns {number} Returns the string size.
  431. */function unicodeSize(string){var result=reUnicode.lastIndex=0;while(reUnicode.test(string)){++result;}return result;}/**
  432. * Converts a Unicode `string` to an array.
  433. *
  434. * @private
  435. * @param {string} string The string to convert.
  436. * @returns {Array} Returns the converted array.
  437. */function unicodeToArray(string){return string.match(reUnicode)||[];}/**
  438. * Splits a Unicode `string` into an array of its words.
  439. *
  440. * @private
  441. * @param {string} The string to inspect.
  442. * @returns {Array} Returns the words of `string`.
  443. */function unicodeWords(string){return string.match(reUnicodeWord)||[];}/* --------------------------------------------------------------------------*//**
  444. * Create a new pristine `lodash` function using the `context` object.
  445. *
  446. * @static
  447. * @memberOf _
  448. * @since 1.1.0
  449. * @category Util
  450. * @param {Object} [context=root] The context object.
  451. * @returns {Function} Returns a new `lodash` function.
  452. * @example
  453. *
  454. * _.mixin({ 'foo': _.constant('foo') });
  455. *
  456. * var lodash = _.runInContext();
  457. * lodash.mixin({ 'bar': lodash.constant('bar') });
  458. *
  459. * _.isFunction(_.foo);
  460. * // => true
  461. * _.isFunction(_.bar);
  462. * // => false
  463. *
  464. * lodash.isFunction(lodash.foo);
  465. * // => false
  466. * lodash.isFunction(lodash.bar);
  467. * // => true
  468. *
  469. * // Create a suped-up `defer` in Node.js.
  470. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  471. */var runInContext=function runInContext(context){context=context==null?root:_.defaults(root.Object(),context,_.pick(root,contextProps));/** Built-in constructor references. */var Array=context.Array,Date=context.Date,Error=context.Error,Function=context.Function,Math=context.Math,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;/** Used for built-in method references. */var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype;/** Used to detect overreaching core-js shims. */var coreJsData=context['__core-js_shared__'];/** Used to resolve the decompiled source of functions. */var funcToString=funcProto.toString;/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty;/** Used to generate unique IDs. */var idCounter=0;/** Used to detect methods masquerading as native. */var maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||'');return uid?'Symbol(src)_1.'+uid:'';}();/**
  472. * Used to resolve the
  473. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  474. * of values.
  475. */var nativeObjectToString=objectProto.toString;/** Used to infer the `Object` constructor. */var objectCtorString=funcToString.call(Object);/** Used to restore the original `_` reference in `_.noConflict`. */var oldDash=root._;/** Used to detect if a method is native. */var reIsNative=RegExp('^'+funcToString.call(hasOwnProperty).replace(reRegExpChar,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$');/** Built-in value references. */var Buffer=moduleExports?context.Buffer:undefined,_Symbol=context.Symbol,Uint8Array=context.Uint8Array,allocUnsafe=Buffer?Buffer.allocUnsafe:undefined,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=_Symbol?_Symbol.isConcatSpreadable:undefined,symIterator=_Symbol?_Symbol.iterator:undefined,symToStringTag=_Symbol?_Symbol.toStringTag:undefined;var defineProperty=function(){try{var func=getNative(Object,'defineProperty');func({},'',{});return func;}catch(e){}}();/** Mocked built-ins. */var ctxClearTimeout=context.clearTimeout!==root.clearTimeout&&context.clearTimeout,ctxNow=Date&&Date.now!==root.Date.now&&Date.now,ctxSetTimeout=context.setTimeout!==root.setTimeout&&context.setTimeout;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeCeil=Math.ceil,nativeFloor=Math.floor,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeIsFinite=context.isFinite,nativeJoin=arrayProto.join,nativeKeys=overArg(Object.keys,Object),nativeMax=Math.max,nativeMin=Math.min,nativeNow=Date.now,nativeParseInt=context.parseInt,nativeRandom=Math.random,nativeReverse=arrayProto.reverse;/* Built-in method references that are verified to be native. */var DataView=getNative(context,'DataView'),Map=getNative(context,'Map'),Promise=getNative(context,'Promise'),Set=getNative(context,'Set'),WeakMap=getNative(context,'WeakMap'),nativeCreate=getNative(Object,'create');/** Used to store function metadata. */var metaMap=WeakMap&&new WeakMap();/** Used to lookup unminified function names. */var realNames={};/** Used to detect maps, sets, and weakmaps. */var dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap);/** Used to convert symbols to primitives and strings. */var symbolProto=_Symbol?_Symbol.prototype:undefined,symbolValueOf=symbolProto?symbolProto.valueOf:undefined,symbolToString=symbolProto?symbolProto.toString:undefined;/* ------------------------------------------------------------------------*//**
  476. * Creates a `lodash` object which wraps `value` to enable implicit method
  477. * chain sequences. Methods that operate on and return arrays, collections,
  478. * and functions can be chained together. Methods that retrieve a single value
  479. * or may return a primitive value will automatically end the chain sequence
  480. * and return the unwrapped value. Otherwise, the value must be unwrapped
  481. * with `_#value`.
  482. *
  483. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  484. * enabled using `_.chain`.
  485. *
  486. * The execution of chained methods is lazy, that is, it's deferred until
  487. * `_#value` is implicitly or explicitly called.
  488. *
  489. * Lazy evaluation allows several methods to support shortcut fusion.
  490. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  491. * the creation of intermediate arrays and can greatly reduce the number of
  492. * iteratee executions. Sections of a chain sequence qualify for shortcut
  493. * fusion if the section is applied to an array and iteratees accept only
  494. * one argument. The heuristic for whether a section qualifies for shortcut
  495. * fusion is subject to change.
  496. *
  497. * Chaining is supported in custom builds as long as the `_#value` method is
  498. * directly or indirectly included in the build.
  499. *
  500. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  501. *
  502. * The wrapper `Array` methods are:
  503. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  504. *
  505. * The wrapper `String` methods are:
  506. * `replace` and `split`
  507. *
  508. * The wrapper methods that support shortcut fusion are:
  509. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  510. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  511. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  512. *
  513. * The chainable wrapper methods are:
  514. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  515. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  516. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  517. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  518. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  519. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  520. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  521. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  522. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  523. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  524. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  525. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  526. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  527. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  528. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  529. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  530. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  531. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  532. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  533. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  534. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  535. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  536. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  537. * `zipObject`, `zipObjectDeep`, and `zipWith`
  538. *
  539. * The wrapper methods that are **not** chainable by default are:
  540. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  541. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  542. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  543. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  544. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  545. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  546. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  547. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  548. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  549. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  550. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  551. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  552. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  553. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  554. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  555. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  556. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  557. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  558. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  559. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  560. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  561. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  562. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  563. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  564. * `upperFirst`, `value`, and `words`
  565. *
  566. * @name _
  567. * @constructor
  568. * @category Seq
  569. * @param {*} value The value to wrap in a `lodash` instance.
  570. * @returns {Object} Returns the new `lodash` wrapper instance.
  571. * @example
  572. *
  573. * function square(n) {
  574. * return n * n;
  575. * }
  576. *
  577. * var wrapped = _([1, 2, 3]);
  578. *
  579. * // Returns an unwrapped value.
  580. * wrapped.reduce(_.add);
  581. * // => 6
  582. *
  583. * // Returns a wrapped value.
  584. * var squares = wrapped.map(square);
  585. *
  586. * _.isArray(squares);
  587. * // => false
  588. *
  589. * _.isArray(squares.value());
  590. * // => true
  591. */function lodash(value){if(isObjectLike(value)&&!isArray(value)&&!(value instanceof LazyWrapper)){if(value instanceof LodashWrapper){return value;}if(hasOwnProperty.call(value,'__wrapped__')){return wrapperClone(value);}}return new LodashWrapper(value);}/**
  592. * The base implementation of `_.create` without support for assigning
  593. * properties to the created object.
  594. *
  595. * @private
  596. * @param {Object} proto The object to inherit from.
  597. * @returns {Object} Returns the new object.
  598. */var baseCreate=function(){function object(){}return function(proto){if(!isObject(proto)){return{};}if(objectCreate){return objectCreate(proto);}object.prototype=proto;var result=new object();object.prototype=undefined;return result;};}();/**
  599. * The function whose prototype chain sequence wrappers inherit from.
  600. *
  601. * @private
  602. */function baseLodash(){}// No operation performed.
  603. /**
  604. * The base constructor for creating `lodash` wrapper objects.
  605. *
  606. * @private
  607. * @param {*} value The value to wrap.
  608. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  609. */function LodashWrapper(value,chainAll){this.__wrapped__=value;this.__actions__=[];this.__chain__=!!chainAll;this.__index__=0;this.__values__=undefined;}/**
  610. * By default, the template delimiters used by lodash are like those in
  611. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  612. * following template settings to use alternative delimiters.
  613. *
  614. * @static
  615. * @memberOf _
  616. * @type {Object}
  617. */lodash.templateSettings={/**
  618. * Used to detect `data` property values to be HTML-escaped.
  619. *
  620. * @memberOf _.templateSettings
  621. * @type {RegExp}
  622. */escape:reEscape,/**
  623. * Used to detect code to be evaluated.
  624. *
  625. * @memberOf _.templateSettings
  626. * @type {RegExp}
  627. */evaluate:reEvaluate,/**
  628. * Used to detect `data` property values to inject.
  629. *
  630. * @memberOf _.templateSettings
  631. * @type {RegExp}
  632. */interpolate:reInterpolate,/**
  633. * Used to reference the data object in the template text.
  634. *
  635. * @memberOf _.templateSettings
  636. * @type {string}
  637. */variable:'',/**
  638. * Used to import variables into the compiled template.
  639. *
  640. * @memberOf _.templateSettings
  641. * @type {Object}
  642. */imports:{/**
  643. * A reference to the `lodash` function.
  644. *
  645. * @memberOf _.templateSettings.imports
  646. * @type {Function}
  647. */_:lodash}};// Ensure wrappers are instances of `baseLodash`.
  648. lodash.prototype=baseLodash.prototype;lodash.prototype.constructor=lodash;LodashWrapper.prototype=baseCreate(baseLodash.prototype);LodashWrapper.prototype.constructor=LodashWrapper;/* ------------------------------------------------------------------------*//**
  649. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  650. *
  651. * @private
  652. * @constructor
  653. * @param {*} value The value to wrap.
  654. */function LazyWrapper(value){this.__wrapped__=value;this.__actions__=[];this.__dir__=1;this.__filtered__=false;this.__iteratees__=[];this.__takeCount__=MAX_ARRAY_LENGTH;this.__views__=[];}/**
  655. * Creates a clone of the lazy wrapper object.
  656. *
  657. * @private
  658. * @name clone
  659. * @memberOf LazyWrapper
  660. * @returns {Object} Returns the cloned `LazyWrapper` object.
  661. */function lazyClone(){var result=new LazyWrapper(this.__wrapped__);result.__actions__=copyArray(this.__actions__);result.__dir__=this.__dir__;result.__filtered__=this.__filtered__;result.__iteratees__=copyArray(this.__iteratees__);result.__takeCount__=this.__takeCount__;result.__views__=copyArray(this.__views__);return result;}/**
  662. * Reverses the direction of lazy iteration.
  663. *
  664. * @private
  665. * @name reverse
  666. * @memberOf LazyWrapper
  667. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  668. */function lazyReverse(){if(this.__filtered__){var result=new LazyWrapper(this);result.__dir__=-1;result.__filtered__=true;}else{result=this.clone();result.__dir__*=-1;}return result;}/**
  669. * Extracts the unwrapped value from its lazy wrapper.
  670. *
  671. * @private
  672. * @name value
  673. * @memberOf LazyWrapper
  674. * @returns {*} Returns the unwrapped value.
  675. */function lazyValue(){var array=this.__wrapped__.value(),dir=this.__dir__,isArr=isArray(array),isRight=dir<0,arrLength=isArr?array.length:0,view=getView(0,arrLength,this.__views__),start=view.start,end=view.end,length=end-start,index=isRight?end:start-1,iteratees=this.__iteratees__,iterLength=iteratees.length,resIndex=0,takeCount=nativeMin(length,this.__takeCount__);if(!isArr||!isRight&&arrLength==length&&takeCount==length){return baseWrapperValue(array,this.__actions__);}var result=[];outer:while(length--&&resIndex<takeCount){index+=dir;var iterIndex=-1,value=array[index];while(++iterIndex<iterLength){var data=iteratees[iterIndex],iteratee=data.iteratee,type=data.type,computed=iteratee(value);if(type==LAZY_MAP_FLAG){value=computed;}else if(!computed){if(type==LAZY_FILTER_FLAG){continue outer;}else{break outer;}}}result[resIndex++]=value;}return result;}// Ensure `LazyWrapper` is an instance of `baseLodash`.
  676. LazyWrapper.prototype=baseCreate(baseLodash.prototype);LazyWrapper.prototype.constructor=LazyWrapper;/* ------------------------------------------------------------------------*//**
  677. * Creates a hash object.
  678. *
  679. * @private
  680. * @constructor
  681. * @param {Array} [entries] The key-value pairs to cache.
  682. */function Hash(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}/**
  683. * Removes all key-value entries from the hash.
  684. *
  685. * @private
  686. * @name clear
  687. * @memberOf Hash
  688. */function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{};this.size=0;}/**
  689. * Removes `key` and its value from the hash.
  690. *
  691. * @private
  692. * @name delete
  693. * @memberOf Hash
  694. * @param {Object} hash The hash to modify.
  695. * @param {string} key The key of the value to remove.
  696. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  697. */function hashDelete(key){var result=this.has(key)&&delete this.__data__[key];this.size-=result?1:0;return result;}/**
  698. * Gets the hash value for `key`.
  699. *
  700. * @private
  701. * @name get
  702. * @memberOf Hash
  703. * @param {string} key The key of the value to get.
  704. * @returns {*} Returns the entry value.
  705. */function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?undefined:result;}return hasOwnProperty.call(data,key)?data[key]:undefined;}/**
  706. * Checks if a hash value for `key` exists.
  707. *
  708. * @private
  709. * @name has
  710. * @memberOf Hash
  711. * @param {string} key The key of the entry to check.
  712. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  713. */function hashHas(key){var data=this.__data__;return nativeCreate?data[key]!==undefined:hasOwnProperty.call(data,key);}/**
  714. * Sets the hash `key` to `value`.
  715. *
  716. * @private
  717. * @name set
  718. * @memberOf Hash
  719. * @param {string} key The key of the value to set.
  720. * @param {*} value The value to set.
  721. * @returns {Object} Returns the hash instance.
  722. */function hashSet(key,value){var data=this.__data__;this.size+=this.has(key)?0:1;data[key]=nativeCreate&&value===undefined?HASH_UNDEFINED:value;return this;}// Add methods to `Hash`.
  723. Hash.prototype.clear=hashClear;Hash.prototype['delete']=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;/* ------------------------------------------------------------------------*//**
  724. * Creates an list cache object.
  725. *
  726. * @private
  727. * @constructor
  728. * @param {Array} [entries] The key-value pairs to cache.
  729. */function ListCache(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}/**
  730. * Removes all key-value entries from the list cache.
  731. *
  732. * @private
  733. * @name clear
  734. * @memberOf ListCache
  735. */function listCacheClear(){this.__data__=[];this.size=0;}/**
  736. * Removes `key` and its value from the list cache.
  737. *
  738. * @private
  739. * @name delete
  740. * @memberOf ListCache
  741. * @param {string} key The key of the value to remove.
  742. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  743. */function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){return false;}var lastIndex=data.length-1;if(index==lastIndex){data.pop();}else{splice.call(data,index,1);}--this.size;return true;}/**
  744. * Gets the list cache value for `key`.
  745. *
  746. * @private
  747. * @name get
  748. * @memberOf ListCache
  749. * @param {string} key The key of the value to get.
  750. * @returns {*} Returns the entry value.
  751. */function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?undefined:data[index][1];}/**
  752. * Checks if a list cache value for `key` exists.
  753. *
  754. * @private
  755. * @name has
  756. * @memberOf ListCache
  757. * @param {string} key The key of the entry to check.
  758. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  759. */function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1;}/**
  760. * Sets the list cache `key` to `value`.
  761. *
  762. * @private
  763. * @name set
  764. * @memberOf ListCache
  765. * @param {string} key The key of the value to set.
  766. * @param {*} value The value to set.
  767. * @returns {Object} Returns the list cache instance.
  768. */function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value]);}else{data[index][1]=value;}return this;}// Add methods to `ListCache`.
  769. ListCache.prototype.clear=listCacheClear;ListCache.prototype['delete']=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;/* ------------------------------------------------------------------------*//**
  770. * Creates a map cache object to store key-value pairs.
  771. *
  772. * @private
  773. * @constructor
  774. * @param {Array} [entries] The key-value pairs to cache.
  775. */function MapCache(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}/**
  776. * Removes all key-value entries from the map.
  777. *
  778. * @private
  779. * @name clear
  780. * @memberOf MapCache
  781. */function mapCacheClear(){this.size=0;this.__data__={hash:new Hash(),map:new(Map||ListCache)(),string:new Hash()};}/**
  782. * Removes `key` and its value from the map.
  783. *
  784. * @private
  785. * @name delete
  786. * @memberOf MapCache
  787. * @param {string} key The key of the value to remove.
  788. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  789. */function mapCacheDelete(key){var result=getMapData(this,key)['delete'](key);this.size-=result?1:0;return result;}/**
  790. * Gets the map value for `key`.
  791. *
  792. * @private
  793. * @name get
  794. * @memberOf MapCache
  795. * @param {string} key The key of the value to get.
  796. * @returns {*} Returns the entry value.
  797. */function mapCacheGet(key){return getMapData(this,key).get(key);}/**
  798. * Checks if a map value for `key` exists.
  799. *
  800. * @private
  801. * @name has
  802. * @memberOf MapCache
  803. * @param {string} key The key of the entry to check.
  804. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  805. */function mapCacheHas(key){return getMapData(this,key).has(key);}/**
  806. * Sets the map `key` to `value`.
  807. *
  808. * @private
  809. * @name set
  810. * @memberOf MapCache
  811. * @param {string} key The key of the value to set.
  812. * @param {*} value The value to set.
  813. * @returns {Object} Returns the map cache instance.
  814. */function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;data.set(key,value);this.size+=data.size==size?0:1;return this;}// Add methods to `MapCache`.
  815. MapCache.prototype.clear=mapCacheClear;MapCache.prototype['delete']=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;/* ------------------------------------------------------------------------*//**
  816. *
  817. * Creates an array cache object to store unique values.
  818. *
  819. * @private
  820. * @constructor
  821. * @param {Array} [values] The values to cache.
  822. */function SetCache(values){var index=-1,length=values==null?0:values.length;this.__data__=new MapCache();while(++index<length){this.add(values[index]);}}/**
  823. * Adds `value` to the array cache.
  824. *
  825. * @private
  826. * @name add
  827. * @memberOf SetCache
  828. * @alias push
  829. * @param {*} value The value to cache.
  830. * @returns {Object} Returns the cache instance.
  831. */function setCacheAdd(value){this.__data__.set(value,HASH_UNDEFINED);return this;}/**
  832. * Checks if `value` is in the array cache.
  833. *
  834. * @private
  835. * @name has
  836. * @memberOf SetCache
  837. * @param {*} value The value to search for.
  838. * @returns {number} Returns `true` if `value` is found, else `false`.
  839. */function setCacheHas(value){return this.__data__.has(value);}// Add methods to `SetCache`.
  840. SetCache.prototype.add=SetCache.prototype.push=setCacheAdd;SetCache.prototype.has=setCacheHas;/* ------------------------------------------------------------------------*//**
  841. * Creates a stack cache object to store key-value pairs.
  842. *
  843. * @private
  844. * @constructor
  845. * @param {Array} [entries] The key-value pairs to cache.
  846. */function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size;}/**
  847. * Removes all key-value entries from the stack.
  848. *
  849. * @private
  850. * @name clear
  851. * @memberOf Stack
  852. */function stackClear(){this.__data__=new ListCache();this.size=0;}/**
  853. * Removes `key` and its value from the stack.
  854. *
  855. * @private
  856. * @name delete
  857. * @memberOf Stack
  858. * @param {string} key The key of the value to remove.
  859. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  860. */function stackDelete(key){var data=this.__data__,result=data['delete'](key);this.size=data.size;return result;}/**
  861. * Gets the stack value for `key`.
  862. *
  863. * @private
  864. * @name get
  865. * @memberOf Stack
  866. * @param {string} key The key of the value to get.
  867. * @returns {*} Returns the entry value.
  868. */function stackGet(key){return this.__data__.get(key);}/**
  869. * Checks if a stack value for `key` exists.
  870. *
  871. * @private
  872. * @name has
  873. * @memberOf Stack
  874. * @param {string} key The key of the entry to check.
  875. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  876. */function stackHas(key){return this.__data__.has(key);}/**
  877. * Sets the stack `key` to `value`.
  878. *
  879. * @private
  880. * @name set
  881. * @memberOf Stack
  882. * @param {string} key The key of the value to set.
  883. * @param {*} value The value to set.
  884. * @returns {Object} Returns the stack cache instance.
  885. */function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<LARGE_ARRAY_SIZE-1){pairs.push([key,value]);this.size=++data.size;return this;}data=this.__data__=new MapCache(pairs);}data.set(key,value);this.size=data.size;return this;}// Add methods to `Stack`.
  886. Stack.prototype.clear=stackClear;Stack.prototype['delete']=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;/* ------------------------------------------------------------------------*//**
  887. * Creates an array of the enumerable property names of the array-like `value`.
  888. *
  889. * @private
  890. * @param {*} value The value to query.
  891. * @param {boolean} inherited Specify returning inherited property names.
  892. * @returns {Array} Returns the array of property names.
  893. */function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value){if((inherited||hasOwnProperty.call(value,key))&&!(skipIndexes&&(// Safari 9 has enumerable `arguments.length` in strict mode.
  894. key=='length'||// Node.js 0.10 has enumerable non-index properties on buffers.
  895. isBuff&&(key=='offset'||key=='parent')||// PhantomJS 2 has enumerable non-index properties on typed arrays.
  896. isType&&(key=='buffer'||key=='byteLength'||key=='byteOffset')||// Skip index properties.
  897. isIndex(key,length)))){result.push(key);}}return result;}/**
  898. * A specialized version of `_.sample` for arrays.
  899. *
  900. * @private
  901. * @param {Array} array The array to sample.
  902. * @returns {*} Returns the random element.
  903. */function arraySample(array){var length=array.length;return length?array[baseRandom(0,length-1)]:undefined;}/**
  904. * A specialized version of `_.sampleSize` for arrays.
  905. *
  906. * @private
  907. * @param {Array} array The array to sample.
  908. * @param {number} n The number of elements to sample.
  909. * @returns {Array} Returns the random elements.
  910. */function arraySampleSize(array,n){return shuffleSelf(copyArray(array),baseClamp(n,0,array.length));}/**
  911. * A specialized version of `_.shuffle` for arrays.
  912. *
  913. * @private
  914. * @param {Array} array The array to shuffle.
  915. * @returns {Array} Returns the new shuffled array.
  916. */function arrayShuffle(array){return shuffleSelf(copyArray(array));}/**
  917. * This function is like `assignValue` except that it doesn't assign
  918. * `undefined` values.
  919. *
  920. * @private
  921. * @param {Object} object The object to modify.
  922. * @param {string} key The key of the property to assign.
  923. * @param {*} value The value to assign.
  924. */function assignMergeValue(object,key,value){if(value!==undefined&&!eq(object[key],value)||value===undefined&&!(key in object)){baseAssignValue(object,key,value);}}/**
  925. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  926. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  927. * for equality comparisons.
  928. *
  929. * @private
  930. * @param {Object} object The object to modify.
  931. * @param {string} key The key of the property to assign.
  932. * @param {*} value The value to assign.
  933. */function assignValue(object,key,value){var objValue=object[key];if(!(hasOwnProperty.call(object,key)&&eq(objValue,value))||value===undefined&&!(key in object)){baseAssignValue(object,key,value);}}/**
  934. * Gets the index at which the `key` is found in `array` of key-value pairs.
  935. *
  936. * @private
  937. * @param {Array} array The array to inspect.
  938. * @param {*} key The key to search for.
  939. * @returns {number} Returns the index of the matched value, else `-1`.
  940. */function assocIndexOf(array,key){var length=array.length;while(length--){if(eq(array[length][0],key)){return length;}}return-1;}/**
  941. * Aggregates elements of `collection` on `accumulator` with keys transformed
  942. * by `iteratee` and values set by `setter`.
  943. *
  944. * @private
  945. * @param {Array|Object} collection The collection to iterate over.
  946. * @param {Function} setter The function to set `accumulator` values.
  947. * @param {Function} iteratee The iteratee to transform keys.
  948. * @param {Object} accumulator The initial aggregated object.
  949. * @returns {Function} Returns `accumulator`.
  950. */function baseAggregator(collection,setter,iteratee,accumulator){baseEach(collection,function(value,key,collection){setter(accumulator,value,iteratee(value),collection);});return accumulator;}/**
  951. * The base implementation of `_.assign` without support for multiple sources
  952. * or `customizer` functions.
  953. *
  954. * @private
  955. * @param {Object} object The destination object.
  956. * @param {Object} source The source object.
  957. * @returns {Object} Returns `object`.
  958. */function baseAssign(object,source){return object&&copyObject(source,keys(source),object);}/**
  959. * The base implementation of `_.assignIn` without support for multiple sources
  960. * or `customizer` functions.
  961. *
  962. * @private
  963. * @param {Object} object The destination object.
  964. * @param {Object} source The source object.
  965. * @returns {Object} Returns `object`.
  966. */function baseAssignIn(object,source){return object&&copyObject(source,keysIn(source),object);}/**
  967. * The base implementation of `assignValue` and `assignMergeValue` without
  968. * value checks.
  969. *
  970. * @private
  971. * @param {Object} object The object to modify.
  972. * @param {string} key The key of the property to assign.
  973. * @param {*} value The value to assign.
  974. */function baseAssignValue(object,key,value){if(key=='__proto__'&&defineProperty){defineProperty(object,key,{configurable:true,enumerable:true,value:value,writable:true});}else{object[key]=value;}}/**
  975. * The base implementation of `_.at` without support for individual paths.
  976. *
  977. * @private
  978. * @param {Object} object The object to iterate over.
  979. * @param {string[]} paths The property paths to pick.
  980. * @returns {Array} Returns the picked elements.
  981. */function baseAt(object,paths){var index=-1,length=paths.length,result=Array(length),skip=object==null;while(++index<length){result[index]=skip?undefined:get(object,paths[index]);}return result;}/**
  982. * The base implementation of `_.clamp` which doesn't coerce arguments.
  983. *
  984. * @private
  985. * @param {number} number The number to clamp.
  986. * @param {number} [lower] The lower bound.
  987. * @param {number} upper The upper bound.
  988. * @returns {number} Returns the clamped number.
  989. */function baseClamp(number,lower,upper){if(number===number){if(upper!==undefined){number=number<=upper?number:upper;}if(lower!==undefined){number=number>=lower?number:lower;}}return number;}/**
  990. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  991. * traversed objects.
  992. *
  993. * @private
  994. * @param {*} value The value to clone.
  995. * @param {boolean} bitmask The bitmask flags.
  996. * 1 - Deep clone
  997. * 2 - Flatten inherited properties
  998. * 4 - Clone symbols
  999. * @param {Function} [customizer] The function to customize cloning.
  1000. * @param {string} [key] The key of `value`.
  1001. * @param {Object} [object] The parent object of `value`.
  1002. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  1003. * @returns {*} Returns the cloned value.
  1004. */function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=bitmask&CLONE_DEEP_FLAG,isFlat=bitmask&CLONE_FLAT_FLAG,isFull=bitmask&CLONE_SYMBOLS_FLAG;if(customizer){result=object?customizer(value,key,object,stack):customizer(value);}if(result!==undefined){return result;}if(!isObject(value)){return value;}var isArr=isArray(value);if(isArr){result=initCloneArray(value);if(!isDeep){return copyArray(value,result);}}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value)){return cloneBuffer(value,isDeep);}if(tag==objectTag||tag==argsTag||isFunc&&!object){result=isFlat||isFunc?{}:initCloneObject(value);if(!isDeep){return isFlat?copySymbolsIn(value,baseAssignIn(result,value)):copySymbols(value,baseAssign(result,value));}}else{if(!cloneableTags[tag]){return object?value:{};}result=initCloneByTag(value,tag,isDeep);}}// Check for circular references and return its corresponding clone.
  1005. stack||(stack=new Stack());var stacked=stack.get(value);if(stacked){return stacked;}stack.set(value,result);if(isSet(value)){value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack));});return result;}if(isMap(value)){value.forEach(function(subValue,key){result.set(key,baseClone(subValue,bitmask,customizer,key,value,stack));});return result;}var keysFunc=isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys;var props=isArr?undefined:keysFunc(value);arrayEach(props||value,function(subValue,key){if(props){key=subValue;subValue=value[key];}// Recursively populate clone (susceptible to call stack limits).
  1006. assignValue(result,key,baseClone(subValue,bitmask,customizer,key,value,stack));});return result;}/**
  1007. * The base implementation of `_.conforms` which doesn't clone `source`.
  1008. *
  1009. * @private
  1010. * @param {Object} source The object of property predicates to conform to.
  1011. * @returns {Function} Returns the new spec function.
  1012. */function baseConforms(source){var props=keys(source);return function(object){return baseConformsTo(object,source,props);};}/**
  1013. * The base implementation of `_.conformsTo` which accepts `props` to check.
  1014. *
  1015. * @private
  1016. * @param {Object} object The object to inspect.
  1017. * @param {Object} source The object of property predicates to conform to.
  1018. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  1019. */function baseConformsTo(object,source,props){var length=props.length;if(object==null){return!length;}object=Object(object);while(length--){var key=props[length],predicate=source[key],value=object[key];if(value===undefined&&!(key in object)||!predicate(value)){return false;}}return true;}/**
  1020. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  1021. * to provide to `func`.
  1022. *
  1023. * @private
  1024. * @param {Function} func The function to delay.
  1025. * @param {number} wait The number of milliseconds to delay invocation.
  1026. * @param {Array} args The arguments to provide to `func`.
  1027. * @returns {number|Object} Returns the timer id or timeout object.
  1028. */function baseDelay(func,wait,args){if(typeof func!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}return setTimeout(function(){func.apply(undefined,args);},wait);}/**
  1029. * The base implementation of methods like `_.difference` without support
  1030. * for excluding multiple arrays or iteratee shorthands.
  1031. *
  1032. * @private
  1033. * @param {Array} array The array to inspect.
  1034. * @param {Array} values The values to exclude.
  1035. * @param {Function} [iteratee] The iteratee invoked per element.
  1036. * @param {Function} [comparator] The comparator invoked per element.
  1037. * @returns {Array} Returns the new array of filtered values.
  1038. */function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=true,length=array.length,result=[],valuesLength=values.length;if(!length){return result;}if(iteratee){values=arrayMap(values,baseUnary(iteratee));}if(comparator){includes=arrayIncludesWith;isCommon=false;}else if(values.length>=LARGE_ARRAY_SIZE){includes=cacheHas;isCommon=false;values=new SetCache(values);}outer:while(++index<length){var value=array[index],computed=iteratee==null?value:iteratee(value);value=comparator||value!==0?value:0;if(isCommon&&computed===computed){var valuesIndex=valuesLength;while(valuesIndex--){if(values[valuesIndex]===computed){continue outer;}}result.push(value);}else if(!includes(values,computed,comparator)){result.push(value);}}return result;}/**
  1039. * The base implementation of `_.forEach` without support for iteratee shorthands.
  1040. *
  1041. * @private
  1042. * @param {Array|Object} collection The collection to iterate over.
  1043. * @param {Function} iteratee The function invoked per iteration.
  1044. * @returns {Array|Object} Returns `collection`.
  1045. */var baseEach=createBaseEach(baseForOwn);/**
  1046. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  1047. *
  1048. * @private
  1049. * @param {Array|Object} collection The collection to iterate over.
  1050. * @param {Function} iteratee The function invoked per iteration.
  1051. * @returns {Array|Object} Returns `collection`.
  1052. */var baseEachRight=createBaseEach(baseForOwnRight,true);/**
  1053. * The base implementation of `_.every` without support for iteratee shorthands.
  1054. *
  1055. * @private
  1056. * @param {Array|Object} collection The collection to iterate over.
  1057. * @param {Function} predicate The function invoked per iteration.
  1058. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1059. * else `false`
  1060. */function baseEvery(collection,predicate){var result=true;baseEach(collection,function(value,index,collection){result=!!predicate(value,index,collection);return result;});return result;}/**
  1061. * The base implementation of methods like `_.max` and `_.min` which accepts a
  1062. * `comparator` to determine the extremum value.
  1063. *
  1064. * @private
  1065. * @param {Array} array The array to iterate over.
  1066. * @param {Function} iteratee The iteratee invoked per iteration.
  1067. * @param {Function} comparator The comparator used to compare values.
  1068. * @returns {*} Returns the extremum value.
  1069. */function baseExtremum(array,iteratee,comparator){var index=-1,length=array.length;while(++index<length){var value=array[index],current=iteratee(value);if(current!=null&&(computed===undefined?current===current&&!isSymbol(current):comparator(current,computed))){var computed=current,result=value;}}return result;}/**
  1070. * The base implementation of `_.fill` without an iteratee call guard.
  1071. *
  1072. * @private
  1073. * @param {Array} array The array to fill.
  1074. * @param {*} value The value to fill `array` with.
  1075. * @param {number} [start=0] The start position.
  1076. * @param {number} [end=array.length] The end position.
  1077. * @returns {Array} Returns `array`.
  1078. */function baseFill(array,value,start,end){var length=array.length;start=toInteger(start);if(start<0){start=-start>length?0:length+start;}end=end===undefined||end>length?length:toInteger(end);if(end<0){end+=length;}end=start>end?0:toLength(end);while(start<end){array[start++]=value;}return array;}/**
  1079. * The base implementation of `_.filter` without support for iteratee shorthands.
  1080. *
  1081. * @private
  1082. * @param {Array|Object} collection The collection to iterate over.
  1083. * @param {Function} predicate The function invoked per iteration.
  1084. * @returns {Array} Returns the new filtered array.
  1085. */function baseFilter(collection,predicate){var result=[];baseEach(collection,function(value,index,collection){if(predicate(value,index,collection)){result.push(value);}});return result;}/**
  1086. * The base implementation of `_.flatten` with support for restricting flattening.
  1087. *
  1088. * @private
  1089. * @param {Array} array The array to flatten.
  1090. * @param {number} depth The maximum recursion depth.
  1091. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  1092. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  1093. * @param {Array} [result=[]] The initial result value.
  1094. * @returns {Array} Returns the new flattened array.
  1095. */function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;predicate||(predicate=isFlattenable);result||(result=[]);while(++index<length){var value=array[index];if(depth>0&&predicate(value)){if(depth>1){// Recursively flatten arrays (susceptible to call stack limits).
  1096. baseFlatten(value,depth-1,predicate,isStrict,result);}else{arrayPush(result,value);}}else if(!isStrict){result[result.length]=value;}}return result;}/**
  1097. * The base implementation of `baseForOwn` which iterates over `object`
  1098. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  1099. * Iteratee functions may exit iteration early by explicitly returning `false`.
  1100. *
  1101. * @private
  1102. * @param {Object} object The object to iterate over.
  1103. * @param {Function} iteratee The function invoked per iteration.
  1104. * @param {Function} keysFunc The function to get the keys of `object`.
  1105. * @returns {Object} Returns `object`.
  1106. */var baseFor=createBaseFor();/**
  1107. * This function is like `baseFor` except that it iterates over properties
  1108. * in the opposite order.
  1109. *
  1110. * @private
  1111. * @param {Object} object The object to iterate over.
  1112. * @param {Function} iteratee The function invoked per iteration.
  1113. * @param {Function} keysFunc The function to get the keys of `object`.
  1114. * @returns {Object} Returns `object`.
  1115. */var baseForRight=createBaseFor(true);/**
  1116. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  1117. *
  1118. * @private
  1119. * @param {Object} object The object to iterate over.
  1120. * @param {Function} iteratee The function invoked per iteration.
  1121. * @returns {Object} Returns `object`.
  1122. */function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys);}/**
  1123. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  1124. *
  1125. * @private
  1126. * @param {Object} object The object to iterate over.
  1127. * @param {Function} iteratee The function invoked per iteration.
  1128. * @returns {Object} Returns `object`.
  1129. */function baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys);}/**
  1130. * The base implementation of `_.functions` which creates an array of
  1131. * `object` function property names filtered from `props`.
  1132. *
  1133. * @private
  1134. * @param {Object} object The object to inspect.
  1135. * @param {Array} props The property names to filter.
  1136. * @returns {Array} Returns the function names.
  1137. */function baseFunctions(object,props){return arrayFilter(props,function(key){return isFunction(object[key]);});}/**
  1138. * The base implementation of `_.get` without support for default values.
  1139. *
  1140. * @private
  1141. * @param {Object} object The object to query.
  1142. * @param {Array|string} path The path of the property to get.
  1143. * @returns {*} Returns the resolved value.
  1144. */function baseGet(object,path){path=castPath(path,object);var index=0,length=path.length;while(object!=null&&index<length){object=object[toKey(path[index++])];}return index&&index==length?object:undefined;}/**
  1145. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  1146. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  1147. * symbols of `object`.
  1148. *
  1149. * @private
  1150. * @param {Object} object The object to query.
  1151. * @param {Function} keysFunc The function to get the keys of `object`.
  1152. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  1153. * @returns {Array} Returns the array of property names and symbols.
  1154. */function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object));}/**
  1155. * The base implementation of `getTag` without fallbacks for buggy environments.
  1156. *
  1157. * @private
  1158. * @param {*} value The value to query.
  1159. * @returns {string} Returns the `toStringTag`.
  1160. */function baseGetTag(value){if(value==null){return value===undefined?undefinedTag:nullTag;}return symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value);}/**
  1161. * The base implementation of `_.gt` which doesn't coerce arguments.
  1162. *
  1163. * @private
  1164. * @param {*} value The value to compare.
  1165. * @param {*} other The other value to compare.
  1166. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  1167. * else `false`.
  1168. */function baseGt(value,other){return value>other;}/**
  1169. * The base implementation of `_.has` without support for deep paths.
  1170. *
  1171. * @private
  1172. * @param {Object} [object] The object to query.
  1173. * @param {Array|string} key The key to check.
  1174. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  1175. */function baseHas(object,key){return object!=null&&hasOwnProperty.call(object,key);}/**
  1176. * The base implementation of `_.hasIn` without support for deep paths.
  1177. *
  1178. * @private
  1179. * @param {Object} [object] The object to query.
  1180. * @param {Array|string} key The key to check.
  1181. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  1182. */function baseHasIn(object,key){return object!=null&&key in Object(object);}/**
  1183. * The base implementation of `_.inRange` which doesn't coerce arguments.
  1184. *
  1185. * @private
  1186. * @param {number} number The number to check.
  1187. * @param {number} start The start of the range.
  1188. * @param {number} end The end of the range.
  1189. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  1190. */function baseInRange(number,start,end){return number>=nativeMin(start,end)&&number<nativeMax(start,end);}/**
  1191. * The base implementation of methods like `_.intersection`, without support
  1192. * for iteratee shorthands, that accepts an array of arrays to inspect.
  1193. *
  1194. * @private
  1195. * @param {Array} arrays The arrays to inspect.
  1196. * @param {Function} [iteratee] The iteratee invoked per element.
  1197. * @param {Function} [comparator] The comparator invoked per element.
  1198. * @returns {Array} Returns the new array of shared values.
  1199. */function baseIntersection(arrays,iteratee,comparator){var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=Infinity,result=[];while(othIndex--){var array=arrays[othIndex];if(othIndex&&iteratee){array=arrayMap(array,baseUnary(iteratee));}maxLength=nativeMin(array.length,maxLength);caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):undefined;}array=arrays[0];var index=-1,seen=caches[0];outer:while(++index<length&&result.length<maxLength){var value=array[index],computed=iteratee?iteratee(value):value;value=comparator||value!==0?value:0;if(!(seen?cacheHas(seen,computed):includes(result,computed,comparator))){othIndex=othLength;while(--othIndex){var cache=caches[othIndex];if(!(cache?cacheHas(cache,computed):includes(arrays[othIndex],computed,comparator))){continue outer;}}if(seen){seen.push(computed);}result.push(value);}}return result;}/**
  1200. * The base implementation of `_.invert` and `_.invertBy` which inverts
  1201. * `object` with values transformed by `iteratee` and set by `setter`.
  1202. *
  1203. * @private
  1204. * @param {Object} object The object to iterate over.
  1205. * @param {Function} setter The function to set `accumulator` values.
  1206. * @param {Function} iteratee The iteratee to transform values.
  1207. * @param {Object} accumulator The initial inverted object.
  1208. * @returns {Function} Returns `accumulator`.
  1209. */function baseInverter(object,setter,iteratee,accumulator){baseForOwn(object,function(value,key,object){setter(accumulator,iteratee(value),key,object);});return accumulator;}/**
  1210. * The base implementation of `_.invoke` without support for individual
  1211. * method arguments.
  1212. *
  1213. * @private
  1214. * @param {Object} object The object to query.
  1215. * @param {Array|string} path The path of the method to invoke.
  1216. * @param {Array} args The arguments to invoke the method with.
  1217. * @returns {*} Returns the result of the invoked method.
  1218. */function baseInvoke(object,path,args){path=castPath(path,object);object=parent(object,path);var func=object==null?object:object[toKey(last(path))];return func==null?undefined:apply(func,object,args);}/**
  1219. * The base implementation of `_.isArguments`.
  1220. *
  1221. * @private
  1222. * @param {*} value The value to check.
  1223. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  1224. */function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag;}/**
  1225. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  1226. *
  1227. * @private
  1228. * @param {*} value The value to check.
  1229. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  1230. */function baseIsArrayBuffer(value){return isObjectLike(value)&&baseGetTag(value)==arrayBufferTag;}/**
  1231. * The base implementation of `_.isDate` without Node.js optimizations.
  1232. *
  1233. * @private
  1234. * @param {*} value The value to check.
  1235. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  1236. */function baseIsDate(value){return isObjectLike(value)&&baseGetTag(value)==dateTag;}/**
  1237. * The base implementation of `_.isEqual` which supports partial comparisons
  1238. * and tracks traversed objects.
  1239. *
  1240. * @private
  1241. * @param {*} value The value to compare.
  1242. * @param {*} other The other value to compare.
  1243. * @param {boolean} bitmask The bitmask flags.
  1244. * 1 - Unordered comparison
  1245. * 2 - Partial comparison
  1246. * @param {Function} [customizer] The function to customize comparisons.
  1247. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  1248. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1249. */function baseIsEqual(value,other,bitmask,customizer,stack){if(value===other){return true;}if(value==null||other==null||!isObjectLike(value)&&!isObjectLike(other)){return value!==value&&other!==other;}return baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack);}/**
  1250. * A specialized version of `baseIsEqual` for arrays and objects which performs
  1251. * deep comparisons and tracks traversed objects enabling objects with circular
  1252. * references to be compared.
  1253. *
  1254. * @private
  1255. * @param {Object} object The object to compare.
  1256. * @param {Object} other The other object to compare.
  1257. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  1258. * @param {Function} customizer The function to customize comparisons.
  1259. * @param {Function} equalFunc The function to determine equivalents of values.
  1260. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  1261. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  1262. */function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag:getTag(object),othTag=othIsArr?arrayTag:getTag(other);objTag=objTag==argsTag?objectTag:objTag;othTag=othTag==argsTag?objectTag:othTag;var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other)){return false;}objIsArr=true;objIsObj=false;}if(isSameTag&&!objIsObj){stack||(stack=new Stack());return objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):equalByTag(object,other,objTag,bitmask,customizer,equalFunc,stack);}if(!(bitmask&COMPARE_PARTIAL_FLAG)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,'__wrapped__'),othIsWrapped=othIsObj&&hasOwnProperty.call(other,'__wrapped__');if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;stack||(stack=new Stack());return equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack);}}if(!isSameTag){return false;}stack||(stack=new Stack());return equalObjects(object,other,bitmask,customizer,equalFunc,stack);}/**
  1263. * The base implementation of `_.isMap` without Node.js optimizations.
  1264. *
  1265. * @private
  1266. * @param {*} value The value to check.
  1267. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  1268. */function baseIsMap(value){return isObjectLike(value)&&getTag(value)==mapTag;}/**
  1269. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  1270. *
  1271. * @private
  1272. * @param {Object} object The object to inspect.
  1273. * @param {Object} source The object of property values to match.
  1274. * @param {Array} matchData The property names, values, and compare flags to match.
  1275. * @param {Function} [customizer] The function to customize comparisons.
  1276. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  1277. */function baseIsMatch(object,source,matchData,customizer){var index=matchData.length,length=index,noCustomizer=!customizer;if(object==null){return!length;}object=Object(object);while(index--){var data=matchData[index];if(noCustomizer&&data[2]?data[1]!==object[data[0]]:!(data[0]in object)){return false;}}while(++index<length){data=matchData[index];var key=data[0],objValue=object[key],srcValue=data[1];if(noCustomizer&&data[2]){if(objValue===undefined&&!(key in object)){return false;}}else{var stack=new Stack();if(customizer){var result=customizer(objValue,srcValue,key,object,source,stack);}if(!(result===undefined?baseIsEqual(srcValue,objValue,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG,customizer,stack):result)){return false;}}}return true;}/**
  1278. * The base implementation of `_.isNative` without bad shim checks.
  1279. *
  1280. * @private
  1281. * @param {*} value The value to check.
  1282. * @returns {boolean} Returns `true` if `value` is a native function,
  1283. * else `false`.
  1284. */function baseIsNative(value){if(!isObject(value)||isMasked(value)){return false;}var pattern=isFunction(value)?reIsNative:reIsHostCtor;return pattern.test(toSource(value));}/**
  1285. * The base implementation of `_.isRegExp` without Node.js optimizations.
  1286. *
  1287. * @private
  1288. * @param {*} value The value to check.
  1289. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  1290. */function baseIsRegExp(value){return isObjectLike(value)&&baseGetTag(value)==regexpTag;}/**
  1291. * The base implementation of `_.isSet` without Node.js optimizations.
  1292. *
  1293. * @private
  1294. * @param {*} value The value to check.
  1295. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  1296. */function baseIsSet(value){return isObjectLike(value)&&getTag(value)==setTag;}/**
  1297. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  1298. *
  1299. * @private
  1300. * @param {*} value The value to check.
  1301. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  1302. */function baseIsTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)];}/**
  1303. * The base implementation of `_.iteratee`.
  1304. *
  1305. * @private
  1306. * @param {*} [value=_.identity] The value to convert to an iteratee.
  1307. * @returns {Function} Returns the iteratee.
  1308. */function baseIteratee(value){// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  1309. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  1310. if(typeof value==='function'){return value;}if(value==null){return identity;}if((typeof value==='undefined'?'undefined':_typeof(value))==='object'){return isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value);}return property(value);}/**
  1311. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  1312. *
  1313. * @private
  1314. * @param {Object} object The object to query.
  1315. * @returns {Array} Returns the array of property names.
  1316. */function baseKeys(object){if(!isPrototype(object)){return nativeKeys(object);}var result=[];for(var key in Object(object)){if(hasOwnProperty.call(object,key)&&key!='constructor'){result.push(key);}}return result;}/**
  1317. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  1318. *
  1319. * @private
  1320. * @param {Object} object The object to query.
  1321. * @returns {Array} Returns the array of property names.
  1322. */function baseKeysIn(object){if(!isObject(object)){return nativeKeysIn(object);}var isProto=isPrototype(object),result=[];for(var key in object){if(!(key=='constructor'&&(isProto||!hasOwnProperty.call(object,key)))){result.push(key);}}return result;}/**
  1323. * The base implementation of `_.lt` which doesn't coerce arguments.
  1324. *
  1325. * @private
  1326. * @param {*} value The value to compare.
  1327. * @param {*} other The other value to compare.
  1328. * @returns {boolean} Returns `true` if `value` is less than `other`,
  1329. * else `false`.
  1330. */function baseLt(value,other){return value<other;}/**
  1331. * The base implementation of `_.map` without support for iteratee shorthands.
  1332. *
  1333. * @private
  1334. * @param {Array|Object} collection The collection to iterate over.
  1335. * @param {Function} iteratee The function invoked per iteration.
  1336. * @returns {Array} Returns the new mapped array.
  1337. */function baseMap(collection,iteratee){var index=-1,result=isArrayLike(collection)?Array(collection.length):[];baseEach(collection,function(value,key,collection){result[++index]=iteratee(value,key,collection);});return result;}/**
  1338. * The base implementation of `_.matches` which doesn't clone `source`.
  1339. *
  1340. * @private
  1341. * @param {Object} source The object of property values to match.
  1342. * @returns {Function} Returns the new spec function.
  1343. */function baseMatches(source){var matchData=getMatchData(source);if(matchData.length==1&&matchData[0][2]){return matchesStrictComparable(matchData[0][0],matchData[0][1]);}return function(object){return object===source||baseIsMatch(object,source,matchData);};}/**
  1344. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  1345. *
  1346. * @private
  1347. * @param {string} path The path of the property to get.
  1348. * @param {*} srcValue The value to match.
  1349. * @returns {Function} Returns the new spec function.
  1350. */function baseMatchesProperty(path,srcValue){if(isKey(path)&&isStrictComparable(srcValue)){return matchesStrictComparable(toKey(path),srcValue);}return function(object){var objValue=get(object,path);return objValue===undefined&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG);};}/**
  1351. * The base implementation of `_.merge` without support for multiple sources.
  1352. *
  1353. * @private
  1354. * @param {Object} object The destination object.
  1355. * @param {Object} source The source object.
  1356. * @param {number} srcIndex The index of `source`.
  1357. * @param {Function} [customizer] The function to customize merged values.
  1358. * @param {Object} [stack] Tracks traversed source values and their merged
  1359. * counterparts.
  1360. */function baseMerge(object,source,srcIndex,customizer,stack){if(object===source){return;}baseFor(source,function(srcValue,key){if(isObject(srcValue)){stack||(stack=new Stack());baseMergeDeep(object,source,key,srcIndex,baseMerge,customizer,stack);}else{var newValue=customizer?customizer(safeGet(object,key),srcValue,key+'',object,source,stack):undefined;if(newValue===undefined){newValue=srcValue;}assignMergeValue(object,key,newValue);}},keysIn);}/**
  1361. * A specialized version of `baseMerge` for arrays and objects which performs
  1362. * deep merges and tracks traversed objects enabling objects with circular
  1363. * references to be merged.
  1364. *
  1365. * @private
  1366. * @param {Object} object The destination object.
  1367. * @param {Object} source The source object.
  1368. * @param {string} key The key of the value to merge.
  1369. * @param {number} srcIndex The index of `source`.
  1370. * @param {Function} mergeFunc The function to merge values.
  1371. * @param {Function} [customizer] The function to customize assigned values.
  1372. * @param {Object} [stack] Tracks traversed source values and their merged
  1373. * counterparts.
  1374. */function baseMergeDeep(object,source,key,srcIndex,mergeFunc,customizer,stack){var objValue=safeGet(object,key),srcValue=safeGet(source,key),stacked=stack.get(srcValue);if(stacked){assignMergeValue(object,key,stacked);return;}var newValue=customizer?customizer(objValue,srcValue,key+'',object,source,stack):undefined;var isCommon=newValue===undefined;if(isCommon){var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue;if(isArr||isBuff||isTyped){if(isArray(objValue)){newValue=objValue;}else if(isArrayLikeObject(objValue)){newValue=copyArray(objValue);}else if(isBuff){isCommon=false;newValue=cloneBuffer(srcValue,true);}else if(isTyped){isCommon=false;newValue=cloneTypedArray(srcValue,true);}else{newValue=[];}}else if(isPlainObject(srcValue)||isArguments(srcValue)){newValue=objValue;if(isArguments(objValue)){newValue=toPlainObject(objValue);}else if(!isObject(objValue)||srcIndex&&isFunction(objValue)){newValue=initCloneObject(srcValue);}}else{isCommon=false;}}if(isCommon){// Recursively merge objects and arrays (susceptible to call stack limits).
  1375. stack.set(srcValue,newValue);mergeFunc(newValue,srcValue,srcIndex,customizer,stack);stack['delete'](srcValue);}assignMergeValue(object,key,newValue);}/**
  1376. * The base implementation of `_.nth` which doesn't coerce arguments.
  1377. *
  1378. * @private
  1379. * @param {Array} array The array to query.
  1380. * @param {number} n The index of the element to return.
  1381. * @returns {*} Returns the nth element of `array`.
  1382. */function baseNth(array,n){var length=array.length;if(!length){return;}n+=n<0?length:0;return isIndex(n,length)?array[n]:undefined;}/**
  1383. * The base implementation of `_.orderBy` without param guards.
  1384. *
  1385. * @private
  1386. * @param {Array|Object} collection The collection to iterate over.
  1387. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  1388. * @param {string[]} orders The sort orders of `iteratees`.
  1389. * @returns {Array} Returns the new sorted array.
  1390. */function baseOrderBy(collection,iteratees,orders){var index=-1;iteratees=arrayMap(iteratees.length?iteratees:[identity],baseUnary(getIteratee()));var result=baseMap(collection,function(value,key,collection){var criteria=arrayMap(iteratees,function(iteratee){return iteratee(value);});return{criteria:criteria,index:++index,value:value};});return baseSortBy(result,function(object,other){return compareMultiple(object,other,orders);});}/**
  1391. * The base implementation of `_.pick` without support for individual
  1392. * property identifiers.
  1393. *
  1394. * @private
  1395. * @param {Object} object The source object.
  1396. * @param {string[]} paths The property paths to pick.
  1397. * @returns {Object} Returns the new object.
  1398. */function basePick(object,paths){return basePickBy(object,paths,function(value,path){return hasIn(object,path);});}/**
  1399. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  1400. *
  1401. * @private
  1402. * @param {Object} object The source object.
  1403. * @param {string[]} paths The property paths to pick.
  1404. * @param {Function} predicate The function invoked per property.
  1405. * @returns {Object} Returns the new object.
  1406. */function basePickBy(object,paths,predicate){var index=-1,length=paths.length,result={};while(++index<length){var path=paths[index],value=baseGet(object,path);if(predicate(value,path)){baseSet(result,castPath(path,object),value);}}return result;}/**
  1407. * A specialized version of `baseProperty` which supports deep paths.
  1408. *
  1409. * @private
  1410. * @param {Array|string} path The path of the property to get.
  1411. * @returns {Function} Returns the new accessor function.
  1412. */function basePropertyDeep(path){return function(object){return baseGet(object,path);};}/**
  1413. * The base implementation of `_.pullAllBy` without support for iteratee
  1414. * shorthands.
  1415. *
  1416. * @private
  1417. * @param {Array} array The array to modify.
  1418. * @param {Array} values The values to remove.
  1419. * @param {Function} [iteratee] The iteratee invoked per element.
  1420. * @param {Function} [comparator] The comparator invoked per element.
  1421. * @returns {Array} Returns `array`.
  1422. */function basePullAll(array,values,iteratee,comparator){var indexOf=comparator?baseIndexOfWith:baseIndexOf,index=-1,length=values.length,seen=array;if(array===values){values=copyArray(values);}if(iteratee){seen=arrayMap(array,baseUnary(iteratee));}while(++index<length){var fromIndex=0,value=values[index],computed=iteratee?iteratee(value):value;while((fromIndex=indexOf(seen,computed,fromIndex,comparator))>-1){if(seen!==array){splice.call(seen,fromIndex,1);}splice.call(array,fromIndex,1);}}return array;}/**
  1423. * The base implementation of `_.pullAt` without support for individual
  1424. * indexes or capturing the removed elements.
  1425. *
  1426. * @private
  1427. * @param {Array} array The array to modify.
  1428. * @param {number[]} indexes The indexes of elements to remove.
  1429. * @returns {Array} Returns `array`.
  1430. */function basePullAt(array,indexes){var length=array?indexes.length:0,lastIndex=length-1;while(length--){var index=indexes[length];if(length==lastIndex||index!==previous){var previous=index;if(isIndex(index)){splice.call(array,index,1);}else{baseUnset(array,index);}}}return array;}/**
  1431. * The base implementation of `_.random` without support for returning
  1432. * floating-point numbers.
  1433. *
  1434. * @private
  1435. * @param {number} lower The lower bound.
  1436. * @param {number} upper The upper bound.
  1437. * @returns {number} Returns the random number.
  1438. */function baseRandom(lower,upper){return lower+nativeFloor(nativeRandom()*(upper-lower+1));}/**
  1439. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  1440. * coerce arguments.
  1441. *
  1442. * @private
  1443. * @param {number} start The start of the range.
  1444. * @param {number} end The end of the range.
  1445. * @param {number} step The value to increment or decrement by.
  1446. * @param {boolean} [fromRight] Specify iterating from right to left.
  1447. * @returns {Array} Returns the range of numbers.
  1448. */function baseRange(start,end,step,fromRight){var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);while(length--){result[fromRight?length:++index]=start;start+=step;}return result;}/**
  1449. * The base implementation of `_.repeat` which doesn't coerce arguments.
  1450. *
  1451. * @private
  1452. * @param {string} string The string to repeat.
  1453. * @param {number} n The number of times to repeat the string.
  1454. * @returns {string} Returns the repeated string.
  1455. */function baseRepeat(string,n){var result='';if(!string||n<1||n>MAX_SAFE_INTEGER){return result;}// Leverage the exponentiation by squaring algorithm for a faster repeat.
  1456. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  1457. do{if(n%2){result+=string;}n=nativeFloor(n/2);if(n){string+=string;}}while(n);return result;}/**
  1458. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  1459. *
  1460. * @private
  1461. * @param {Function} func The function to apply a rest parameter to.
  1462. * @param {number} [start=func.length-1] The start position of the rest parameter.
  1463. * @returns {Function} Returns the new function.
  1464. */function baseRest(func,start){return setToString(overRest(func,start,identity),func+'');}/**
  1465. * The base implementation of `_.sample`.
  1466. *
  1467. * @private
  1468. * @param {Array|Object} collection The collection to sample.
  1469. * @returns {*} Returns the random element.
  1470. */function baseSample(collection){return arraySample(values(collection));}/**
  1471. * The base implementation of `_.sampleSize` without param guards.
  1472. *
  1473. * @private
  1474. * @param {Array|Object} collection The collection to sample.
  1475. * @param {number} n The number of elements to sample.
  1476. * @returns {Array} Returns the random elements.
  1477. */function baseSampleSize(collection,n){var array=values(collection);return shuffleSelf(array,baseClamp(n,0,array.length));}/**
  1478. * The base implementation of `_.set`.
  1479. *
  1480. * @private
  1481. * @param {Object} object The object to modify.
  1482. * @param {Array|string} path The path of the property to set.
  1483. * @param {*} value The value to set.
  1484. * @param {Function} [customizer] The function to customize path creation.
  1485. * @returns {Object} Returns `object`.
  1486. */function baseSet(object,path,value,customizer){if(!isObject(object)){return object;}path=castPath(path,object);var index=-1,length=path.length,lastIndex=length-1,nested=object;while(nested!=null&&++index<length){var key=toKey(path[index]),newValue=value;if(index!=lastIndex){var objValue=nested[key];newValue=customizer?customizer(objValue,key,nested):undefined;if(newValue===undefined){newValue=isObject(objValue)?objValue:isIndex(path[index+1])?[]:{};}}assignValue(nested,key,newValue);nested=nested[key];}return object;}/**
  1487. * The base implementation of `setData` without support for hot loop shorting.
  1488. *
  1489. * @private
  1490. * @param {Function} func The function to associate metadata with.
  1491. * @param {*} data The metadata.
  1492. * @returns {Function} Returns `func`.
  1493. */var baseSetData=!metaMap?identity:function(func,data){metaMap.set(func,data);return func;};/**
  1494. * The base implementation of `setToString` without support for hot loop shorting.
  1495. *
  1496. * @private
  1497. * @param {Function} func The function to modify.
  1498. * @param {Function} string The `toString` result.
  1499. * @returns {Function} Returns `func`.
  1500. */var baseSetToString=!defineProperty?identity:function(func,string){return defineProperty(func,'toString',{configurable:true,enumerable:false,value:constant(string),writable:true});};/**
  1501. * The base implementation of `_.shuffle`.
  1502. *
  1503. * @private
  1504. * @param {Array|Object} collection The collection to shuffle.
  1505. * @returns {Array} Returns the new shuffled array.
  1506. */function baseShuffle(collection){return shuffleSelf(values(collection));}/**
  1507. * The base implementation of `_.slice` without an iteratee call guard.
  1508. *
  1509. * @private
  1510. * @param {Array} array The array to slice.
  1511. * @param {number} [start=0] The start position.
  1512. * @param {number} [end=array.length] The end position.
  1513. * @returns {Array} Returns the slice of `array`.
  1514. */function baseSlice(array,start,end){var index=-1,length=array.length;if(start<0){start=-start>length?0:length+start;}end=end>length?length:end;if(end<0){end+=length;}length=start>end?0:end-start>>>0;start>>>=0;var result=Array(length);while(++index<length){result[index]=array[index+start];}return result;}/**
  1515. * The base implementation of `_.some` without support for iteratee shorthands.
  1516. *
  1517. * @private
  1518. * @param {Array|Object} collection The collection to iterate over.
  1519. * @param {Function} predicate The function invoked per iteration.
  1520. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1521. * else `false`.
  1522. */function baseSome(collection,predicate){var result;baseEach(collection,function(value,index,collection){result=predicate(value,index,collection);return!result;});return!!result;}/**
  1523. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  1524. * performs a binary search of `array` to determine the index at which `value`
  1525. * should be inserted into `array` in order to maintain its sort order.
  1526. *
  1527. * @private
  1528. * @param {Array} array The sorted array to inspect.
  1529. * @param {*} value The value to evaluate.
  1530. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  1531. * @returns {number} Returns the index at which `value` should be inserted
  1532. * into `array`.
  1533. */function baseSortedIndex(array,value,retHighest){var low=0,high=array==null?low:array.length;if(typeof value==='number'&&value===value&&high<=HALF_MAX_ARRAY_LENGTH){while(low<high){var mid=low+high>>>1,computed=array[mid];if(computed!==null&&!isSymbol(computed)&&(retHighest?computed<=value:computed<value)){low=mid+1;}else{high=mid;}}return high;}return baseSortedIndexBy(array,value,identity,retHighest);}/**
  1534. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  1535. * which invokes `iteratee` for `value` and each element of `array` to compute
  1536. * their sort ranking. The iteratee is invoked with one argument; (value).
  1537. *
  1538. * @private
  1539. * @param {Array} array The sorted array to inspect.
  1540. * @param {*} value The value to evaluate.
  1541. * @param {Function} iteratee The iteratee invoked per element.
  1542. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  1543. * @returns {number} Returns the index at which `value` should be inserted
  1544. * into `array`.
  1545. */function baseSortedIndexBy(array,value,iteratee,retHighest){value=iteratee(value);var low=0,high=array==null?0:array.length,valIsNaN=value!==value,valIsNull=value===null,valIsSymbol=isSymbol(value),valIsUndefined=value===undefined;while(low<high){var mid=nativeFloor((low+high)/2),computed=iteratee(array[mid]),othIsDefined=computed!==undefined,othIsNull=computed===null,othIsReflexive=computed===computed,othIsSymbol=isSymbol(computed);if(valIsNaN){var setLow=retHighest||othIsReflexive;}else if(valIsUndefined){setLow=othIsReflexive&&(retHighest||othIsDefined);}else if(valIsNull){setLow=othIsReflexive&&othIsDefined&&(retHighest||!othIsNull);}else if(valIsSymbol){setLow=othIsReflexive&&othIsDefined&&!othIsNull&&(retHighest||!othIsSymbol);}else if(othIsNull||othIsSymbol){setLow=false;}else{setLow=retHighest?computed<=value:computed<value;}if(setLow){low=mid+1;}else{high=mid;}}return nativeMin(high,MAX_ARRAY_INDEX);}/**
  1546. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  1547. * support for iteratee shorthands.
  1548. *
  1549. * @private
  1550. * @param {Array} array The array to inspect.
  1551. * @param {Function} [iteratee] The iteratee invoked per element.
  1552. * @returns {Array} Returns the new duplicate free array.
  1553. */function baseSortedUniq(array,iteratee){var index=-1,length=array.length,resIndex=0,result=[];while(++index<length){var value=array[index],computed=iteratee?iteratee(value):value;if(!index||!eq(computed,seen)){var seen=computed;result[resIndex++]=value===0?0:value;}}return result;}/**
  1554. * The base implementation of `_.toNumber` which doesn't ensure correct
  1555. * conversions of binary, hexadecimal, or octal string values.
  1556. *
  1557. * @private
  1558. * @param {*} value The value to process.
  1559. * @returns {number} Returns the number.
  1560. */function baseToNumber(value){if(typeof value==='number'){return value;}if(isSymbol(value)){return NAN;}return+value;}/**
  1561. * The base implementation of `_.toString` which doesn't convert nullish
  1562. * values to empty strings.
  1563. *
  1564. * @private
  1565. * @param {*} value The value to process.
  1566. * @returns {string} Returns the string.
  1567. */function baseToString(value){// Exit early for strings to avoid a performance hit in some environments.
  1568. if(typeof value==='string'){return value;}if(isArray(value)){// Recursively convert values (susceptible to call stack limits).
  1569. return arrayMap(value,baseToString)+'';}if(isSymbol(value)){return symbolToString?symbolToString.call(value):'';}var result=value+'';return result=='0'&&1/value==-INFINITY?'-0':result;}/**
  1570. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1571. *
  1572. * @private
  1573. * @param {Array} array The array to inspect.
  1574. * @param {Function} [iteratee] The iteratee invoked per element.
  1575. * @param {Function} [comparator] The comparator invoked per element.
  1576. * @returns {Array} Returns the new duplicate free array.
  1577. */function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=true,result=[],seen=result;if(comparator){isCommon=false;includes=arrayIncludesWith;}else if(length>=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set){return setToArray(set);}isCommon=false;includes=cacheHas;seen=new SetCache();}else{seen=iteratee?[]:result;}outer:while(++index<length){var value=array[index],computed=iteratee?iteratee(value):value;value=comparator||value!==0?value:0;if(isCommon&&computed===computed){var seenIndex=seen.length;while(seenIndex--){if(seen[seenIndex]===computed){continue outer;}}if(iteratee){seen.push(computed);}result.push(value);}else if(!includes(seen,computed,comparator)){if(seen!==result){seen.push(computed);}result.push(value);}}return result;}/**
  1578. * The base implementation of `_.unset`.
  1579. *
  1580. * @private
  1581. * @param {Object} object The object to modify.
  1582. * @param {Array|string} path The property path to unset.
  1583. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  1584. */function baseUnset(object,path){path=castPath(path,object);object=parent(object,path);return object==null||delete object[toKey(last(path))];}/**
  1585. * The base implementation of `_.update`.
  1586. *
  1587. * @private
  1588. * @param {Object} object The object to modify.
  1589. * @param {Array|string} path The path of the property to update.
  1590. * @param {Function} updater The function to produce the updated value.
  1591. * @param {Function} [customizer] The function to customize path creation.
  1592. * @returns {Object} Returns `object`.
  1593. */function baseUpdate(object,path,updater,customizer){return baseSet(object,path,updater(baseGet(object,path)),customizer);}/**
  1594. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  1595. * without support for iteratee shorthands.
  1596. *
  1597. * @private
  1598. * @param {Array} array The array to query.
  1599. * @param {Function} predicate The function invoked per iteration.
  1600. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  1601. * @param {boolean} [fromRight] Specify iterating from right to left.
  1602. * @returns {Array} Returns the slice of `array`.
  1603. */function baseWhile(array,predicate,isDrop,fromRight){var length=array.length,index=fromRight?length:-1;while((fromRight?index--:++index<length)&&predicate(array[index],index,array)){}return isDrop?baseSlice(array,fromRight?0:index,fromRight?index+1:length):baseSlice(array,fromRight?index+1:0,fromRight?length:index);}/**
  1604. * The base implementation of `wrapperValue` which returns the result of
  1605. * performing a sequence of actions on the unwrapped `value`, where each
  1606. * successive action is supplied the return value of the previous.
  1607. *
  1608. * @private
  1609. * @param {*} value The unwrapped value.
  1610. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  1611. * @returns {*} Returns the resolved value.
  1612. */function baseWrapperValue(value,actions){var result=value;if(result instanceof LazyWrapper){result=result.value();}return arrayReduce(actions,function(result,action){return action.func.apply(action.thisArg,arrayPush([result],action.args));},result);}/**
  1613. * The base implementation of methods like `_.xor`, without support for
  1614. * iteratee shorthands, that accepts an array of arrays to inspect.
  1615. *
  1616. * @private
  1617. * @param {Array} arrays The arrays to inspect.
  1618. * @param {Function} [iteratee] The iteratee invoked per element.
  1619. * @param {Function} [comparator] The comparator invoked per element.
  1620. * @returns {Array} Returns the new array of values.
  1621. */function baseXor(arrays,iteratee,comparator){var length=arrays.length;if(length<2){return length?baseUniq(arrays[0]):[];}var index=-1,result=Array(length);while(++index<length){var array=arrays[index],othIndex=-1;while(++othIndex<length){if(othIndex!=index){result[index]=baseDifference(result[index]||array,arrays[othIndex],iteratee,comparator);}}}return baseUniq(baseFlatten(result,1),iteratee,comparator);}/**
  1622. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  1623. *
  1624. * @private
  1625. * @param {Array} props The property identifiers.
  1626. * @param {Array} values The property values.
  1627. * @param {Function} assignFunc The function to assign values.
  1628. * @returns {Object} Returns the new object.
  1629. */function baseZipObject(props,values,assignFunc){var index=-1,length=props.length,valsLength=values.length,result={};while(++index<length){var value=index<valsLength?values[index]:undefined;assignFunc(result,props[index],value);}return result;}/**
  1630. * Casts `value` to an empty array if it's not an array like object.
  1631. *
  1632. * @private
  1633. * @param {*} value The value to inspect.
  1634. * @returns {Array|Object} Returns the cast array-like object.
  1635. */function castArrayLikeObject(value){return isArrayLikeObject(value)?value:[];}/**
  1636. * Casts `value` to `identity` if it's not a function.
  1637. *
  1638. * @private
  1639. * @param {*} value The value to inspect.
  1640. * @returns {Function} Returns cast function.
  1641. */function castFunction(value){return typeof value==='function'?value:identity;}/**
  1642. * Casts `value` to a path array if it's not one.
  1643. *
  1644. * @private
  1645. * @param {*} value The value to inspect.
  1646. * @param {Object} [object] The object to query keys on.
  1647. * @returns {Array} Returns the cast property path array.
  1648. */function castPath(value,object){if(isArray(value)){return value;}return isKey(value,object)?[value]:stringToPath(toString(value));}/**
  1649. * A `baseRest` alias which can be replaced with `identity` by module
  1650. * replacement plugins.
  1651. *
  1652. * @private
  1653. * @type {Function}
  1654. * @param {Function} func The function to apply a rest parameter to.
  1655. * @returns {Function} Returns the new function.
  1656. */var castRest=baseRest;/**
  1657. * Casts `array` to a slice if it's needed.
  1658. *
  1659. * @private
  1660. * @param {Array} array The array to inspect.
  1661. * @param {number} start The start position.
  1662. * @param {number} [end=array.length] The end position.
  1663. * @returns {Array} Returns the cast slice.
  1664. */function castSlice(array,start,end){var length=array.length;end=end===undefined?length:end;return!start&&end>=length?array:baseSlice(array,start,end);}/**
  1665. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  1666. *
  1667. * @private
  1668. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  1669. */var clearTimeout=ctxClearTimeout||function(id){return root.clearTimeout(id);};/**
  1670. * Creates a clone of `buffer`.
  1671. *
  1672. * @private
  1673. * @param {Buffer} buffer The buffer to clone.
  1674. * @param {boolean} [isDeep] Specify a deep clone.
  1675. * @returns {Buffer} Returns the cloned buffer.
  1676. */function cloneBuffer(buffer,isDeep){if(isDeep){return buffer.slice();}var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);buffer.copy(result);return result;}/**
  1677. * Creates a clone of `arrayBuffer`.
  1678. *
  1679. * @private
  1680. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  1681. * @returns {ArrayBuffer} Returns the cloned array buffer.
  1682. */function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);new Uint8Array(result).set(new Uint8Array(arrayBuffer));return result;}/**
  1683. * Creates a clone of `dataView`.
  1684. *
  1685. * @private
  1686. * @param {Object} dataView The data view to clone.
  1687. * @param {boolean} [isDeep] Specify a deep clone.
  1688. * @returns {Object} Returns the cloned data view.
  1689. */function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength);}/**
  1690. * Creates a clone of `regexp`.
  1691. *
  1692. * @private
  1693. * @param {Object} regexp The regexp to clone.
  1694. * @returns {Object} Returns the cloned regexp.
  1695. */function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));result.lastIndex=regexp.lastIndex;return result;}/**
  1696. * Creates a clone of the `symbol` object.
  1697. *
  1698. * @private
  1699. * @param {Object} symbol The symbol object to clone.
  1700. * @returns {Object} Returns the cloned symbol object.
  1701. */function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{};}/**
  1702. * Creates a clone of `typedArray`.
  1703. *
  1704. * @private
  1705. * @param {Object} typedArray The typed array to clone.
  1706. * @param {boolean} [isDeep] Specify a deep clone.
  1707. * @returns {Object} Returns the cloned typed array.
  1708. */function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length);}/**
  1709. * Compares values to sort them in ascending order.
  1710. *
  1711. * @private
  1712. * @param {*} value The value to compare.
  1713. * @param {*} other The other value to compare.
  1714. * @returns {number} Returns the sort order indicator for `value`.
  1715. */function compareAscending(value,other){if(value!==other){var valIsDefined=value!==undefined,valIsNull=value===null,valIsReflexive=value===value,valIsSymbol=isSymbol(value);var othIsDefined=other!==undefined,othIsNull=other===null,othIsReflexive=other===other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive){return 1;}if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value<other||othIsSymbol&&valIsDefined&&valIsReflexive&&!valIsNull&&!valIsSymbol||othIsNull&&valIsDefined&&valIsReflexive||!othIsDefined&&valIsReflexive||!othIsReflexive){return-1;}}return 0;}/**
  1716. * Used by `_.orderBy` to compare multiple properties of a value to another
  1717. * and stable sort them.
  1718. *
  1719. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  1720. * specify an order of "desc" for descending or "asc" for ascending sort order
  1721. * of corresponding values.
  1722. *
  1723. * @private
  1724. * @param {Object} object The object to compare.
  1725. * @param {Object} other The other object to compare.
  1726. * @param {boolean[]|string[]} orders The order to sort by for each property.
  1727. * @returns {number} Returns the sort order indicator for `object`.
  1728. */function compareMultiple(object,other,orders){var index=-1,objCriteria=object.criteria,othCriteria=other.criteria,length=objCriteria.length,ordersLength=orders.length;while(++index<length){var result=compareAscending(objCriteria[index],othCriteria[index]);if(result){if(index>=ordersLength){return result;}var order=orders[index];return result*(order=='desc'?-1:1);}}// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  1729. // that causes it, under certain circumstances, to provide the same value for
  1730. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  1731. // for more details.
  1732. //
  1733. // This also ensures a stable sort in V8 and other engines.
  1734. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  1735. return object.index-other.index;}/**
  1736. * Creates an array that is the composition of partially applied arguments,
  1737. * placeholders, and provided arguments into a single array of arguments.
  1738. *
  1739. * @private
  1740. * @param {Array} args The provided arguments.
  1741. * @param {Array} partials The arguments to prepend to those provided.
  1742. * @param {Array} holders The `partials` placeholder indexes.
  1743. * @params {boolean} [isCurried] Specify composing for a curried function.
  1744. * @returns {Array} Returns the new array of composed arguments.
  1745. */function composeArgs(args,partials,holders,isCurried){var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;while(++leftIndex<leftLength){result[leftIndex]=partials[leftIndex];}while(++argsIndex<holdersLength){if(isUncurried||argsIndex<argsLength){result[holders[argsIndex]]=args[argsIndex];}}while(rangeLength--){result[leftIndex++]=args[argsIndex++];}return result;}/**
  1746. * This function is like `composeArgs` except that the arguments composition
  1747. * is tailored for `_.partialRight`.
  1748. *
  1749. * @private
  1750. * @param {Array} args The provided arguments.
  1751. * @param {Array} partials The arguments to append to those provided.
  1752. * @param {Array} holders The `partials` placeholder indexes.
  1753. * @params {boolean} [isCurried] Specify composing for a curried function.
  1754. * @returns {Array} Returns the new array of composed arguments.
  1755. */function composeArgsRight(args,partials,holders,isCurried){var argsIndex=-1,argsLength=args.length,holdersIndex=-1,holdersLength=holders.length,rightIndex=-1,rightLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(rangeLength+rightLength),isUncurried=!isCurried;while(++argsIndex<rangeLength){result[argsIndex]=args[argsIndex];}var offset=argsIndex;while(++rightIndex<rightLength){result[offset+rightIndex]=partials[rightIndex];}while(++holdersIndex<holdersLength){if(isUncurried||argsIndex<argsLength){result[offset+holders[holdersIndex]]=args[argsIndex++];}}return result;}/**
  1756. * Copies the values of `source` to `array`.
  1757. *
  1758. * @private
  1759. * @param {Array} source The array to copy values from.
  1760. * @param {Array} [array=[]] The array to copy values to.
  1761. * @returns {Array} Returns `array`.
  1762. */function copyArray(source,array){var index=-1,length=source.length;array||(array=Array(length));while(++index<length){array[index]=source[index];}return array;}/**
  1763. * Copies properties of `source` to `object`.
  1764. *
  1765. * @private
  1766. * @param {Object} source The object to copy properties from.
  1767. * @param {Array} props The property identifiers to copy.
  1768. * @param {Object} [object={}] The object to copy properties to.
  1769. * @param {Function} [customizer] The function to customize copied values.
  1770. * @returns {Object} Returns `object`.
  1771. */function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});var index=-1,length=props.length;while(++index<length){var key=props[index];var newValue=customizer?customizer(object[key],source[key],key,object,source):undefined;if(newValue===undefined){newValue=source[key];}if(isNew){baseAssignValue(object,key,newValue);}else{assignValue(object,key,newValue);}}return object;}/**
  1772. * Copies own symbols of `source` to `object`.
  1773. *
  1774. * @private
  1775. * @param {Object} source The object to copy symbols from.
  1776. * @param {Object} [object={}] The object to copy symbols to.
  1777. * @returns {Object} Returns `object`.
  1778. */function copySymbols(source,object){return copyObject(source,getSymbols(source),object);}/**
  1779. * Copies own and inherited symbols of `source` to `object`.
  1780. *
  1781. * @private
  1782. * @param {Object} source The object to copy symbols from.
  1783. * @param {Object} [object={}] The object to copy symbols to.
  1784. * @returns {Object} Returns `object`.
  1785. */function copySymbolsIn(source,object){return copyObject(source,getSymbolsIn(source),object);}/**
  1786. * Creates a function like `_.groupBy`.
  1787. *
  1788. * @private
  1789. * @param {Function} setter The function to set accumulator values.
  1790. * @param {Function} [initializer] The accumulator object initializer.
  1791. * @returns {Function} Returns the new aggregator function.
  1792. */function createAggregator(setter,initializer){return function(collection,iteratee){var func=isArray(collection)?arrayAggregator:baseAggregator,accumulator=initializer?initializer():{};return func(collection,setter,getIteratee(iteratee,2),accumulator);};}/**
  1793. * Creates a function like `_.assign`.
  1794. *
  1795. * @private
  1796. * @param {Function} assigner The function to assign values.
  1797. * @returns {Function} Returns the new assigner function.
  1798. */function createAssigner(assigner){return baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;customizer=assigner.length>3&&typeof customizer==='function'?(length--,customizer):undefined;if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1;}object=Object(object);while(++index<length){var source=sources[index];if(source){assigner(object,source,index,customizer);}}return object;});}/**
  1799. * Creates a `baseEach` or `baseEachRight` function.
  1800. *
  1801. * @private
  1802. * @param {Function} eachFunc The function to iterate over a collection.
  1803. * @param {boolean} [fromRight] Specify iterating from right to left.
  1804. * @returns {Function} Returns the new base function.
  1805. */function createBaseEach(eachFunc,fromRight){return function(collection,iteratee){if(collection==null){return collection;}if(!isArrayLike(collection)){return eachFunc(collection,iteratee);}var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);while(fromRight?index--:++index<length){if(iteratee(iterable[index],index,iterable)===false){break;}}return collection;};}/**
  1806. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  1807. *
  1808. * @private
  1809. * @param {boolean} [fromRight] Specify iterating from right to left.
  1810. * @returns {Function} Returns the new base function.
  1811. */function createBaseFor(fromRight){return function(object,iteratee,keysFunc){var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;while(length--){var key=props[fromRight?length:++index];if(iteratee(iterable[key],key,iterable)===false){break;}}return object;};}/**
  1812. * Creates a function that wraps `func` to invoke it with the optional `this`
  1813. * binding of `thisArg`.
  1814. *
  1815. * @private
  1816. * @param {Function} func The function to wrap.
  1817. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  1818. * @param {*} [thisArg] The `this` binding of `func`.
  1819. * @returns {Function} Returns the new wrapped function.
  1820. */function createBind(func,bitmask,thisArg){var isBind=bitmask&WRAP_BIND_FLAG,Ctor=createCtor(func);function wrapper(){var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return fn.apply(isBind?thisArg:this,arguments);}return wrapper;}/**
  1821. * Creates a function like `_.lowerFirst`.
  1822. *
  1823. * @private
  1824. * @param {string} methodName The name of the `String` case method to use.
  1825. * @returns {Function} Returns the new case function.
  1826. */function createCaseFirst(methodName){return function(string){string=toString(string);var strSymbols=hasUnicode(string)?stringToArray(string):undefined;var chr=strSymbols?strSymbols[0]:string.charAt(0);var trailing=strSymbols?castSlice(strSymbols,1).join(''):string.slice(1);return chr[methodName]()+trailing;};}/**
  1827. * Creates a function like `_.camelCase`.
  1828. *
  1829. * @private
  1830. * @param {Function} callback The function to combine each word.
  1831. * @returns {Function} Returns the new compounder function.
  1832. */function createCompounder(callback){return function(string){return arrayReduce(words(deburr(string).replace(reApos,'')),callback,'');};}/**
  1833. * Creates a function that produces an instance of `Ctor` regardless of
  1834. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  1835. *
  1836. * @private
  1837. * @param {Function} Ctor The constructor to wrap.
  1838. * @returns {Function} Returns the new wrapped function.
  1839. */function createCtor(Ctor){return function(){// Use a `switch` statement to work with class constructors. See
  1840. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  1841. // for more details.
  1842. var args=arguments;switch(args.length){case 0:return new Ctor();case 1:return new Ctor(args[0]);case 2:return new Ctor(args[0],args[1]);case 3:return new Ctor(args[0],args[1],args[2]);case 4:return new Ctor(args[0],args[1],args[2],args[3]);case 5:return new Ctor(args[0],args[1],args[2],args[3],args[4]);case 6:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5]);case 7:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);}var thisBinding=baseCreate(Ctor.prototype),result=Ctor.apply(thisBinding,args);// Mimic the constructor's `return` behavior.
  1843. // See https://es5.github.io/#x13.2.2 for more details.
  1844. return isObject(result)?result:thisBinding;};}/**
  1845. * Creates a function that wraps `func` to enable currying.
  1846. *
  1847. * @private
  1848. * @param {Function} func The function to wrap.
  1849. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  1850. * @param {number} arity The arity of `func`.
  1851. * @returns {Function} Returns the new wrapped function.
  1852. */function createCurry(func,bitmask,arity){var Ctor=createCtor(func);function wrapper(){var length=arguments.length,args=Array(length),index=length,placeholder=getHolder(wrapper);while(index--){args[index]=arguments[index];}var holders=length<3&&args[0]!==placeholder&&args[length-1]!==placeholder?[]:replaceHolders(args,placeholder);length-=holders.length;if(length<arity){return createRecurry(func,bitmask,createHybrid,wrapper.placeholder,undefined,args,holders,undefined,undefined,arity-length);}var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return apply(fn,this,args);}return wrapper;}/**
  1853. * Creates a `_.find` or `_.findLast` function.
  1854. *
  1855. * @private
  1856. * @param {Function} findIndexFunc The function to find the collection index.
  1857. * @returns {Function} Returns the new find function.
  1858. */function createFind(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=getIteratee(predicate,3);collection=keys(collection);predicate=function predicate(key){return iteratee(iterable[key],key,iterable);};}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:undefined;};}/**
  1859. * Creates a `_.flow` or `_.flowRight` function.
  1860. *
  1861. * @private
  1862. * @param {boolean} [fromRight] Specify iterating from right to left.
  1863. * @returns {Function} Returns the new flow function.
  1864. */function createFlow(fromRight){return flatRest(function(funcs){var length=funcs.length,index=length,prereq=LodashWrapper.prototype.thru;if(fromRight){funcs.reverse();}while(index--){var func=funcs[index];if(typeof func!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}if(prereq&&!wrapper&&getFuncName(func)=='wrapper'){var wrapper=new LodashWrapper([],true);}}index=wrapper?index:length;while(++index<length){func=funcs[index];var funcName=getFuncName(func),data=funcName=='wrapper'?getData(func):undefined;if(data&&isLaziable(data[0])&&data[1]==(WRAP_ARY_FLAG|WRAP_CURRY_FLAG|WRAP_PARTIAL_FLAG|WRAP_REARG_FLAG)&&!data[4].length&&data[9]==1){wrapper=wrapper[getFuncName(data[0])].apply(wrapper,data[3]);}else{wrapper=func.length==1&&isLaziable(func)?wrapper[funcName]():wrapper.thru(func);}}return function(){var args=arguments,value=args[0];if(wrapper&&args.length==1&&isArray(value)){return wrapper.plant(value).value();}var index=0,result=length?funcs[index].apply(this,args):value;while(++index<length){result=funcs[index].call(this,result);}return result;};});}/**
  1865. * Creates a function that wraps `func` to invoke it with optional `this`
  1866. * binding of `thisArg`, partial application, and currying.
  1867. *
  1868. * @private
  1869. * @param {Function|string} func The function or method name to wrap.
  1870. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  1871. * @param {*} [thisArg] The `this` binding of `func`.
  1872. * @param {Array} [partials] The arguments to prepend to those provided to
  1873. * the new function.
  1874. * @param {Array} [holders] The `partials` placeholder indexes.
  1875. * @param {Array} [partialsRight] The arguments to append to those provided
  1876. * to the new function.
  1877. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  1878. * @param {Array} [argPos] The argument positions of the new function.
  1879. * @param {number} [ary] The arity cap of `func`.
  1880. * @param {number} [arity] The arity of `func`.
  1881. * @returns {Function} Returns the new wrapped function.
  1882. */function createHybrid(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){var isAry=bitmask&WRAP_ARY_FLAG,isBind=bitmask&WRAP_BIND_FLAG,isBindKey=bitmask&WRAP_BIND_KEY_FLAG,isCurried=bitmask&(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG),isFlip=bitmask&WRAP_FLIP_FLAG,Ctor=isBindKey?undefined:createCtor(func);function wrapper(){var length=arguments.length,args=Array(length),index=length;while(index--){args[index]=arguments[index];}if(isCurried){var placeholder=getHolder(wrapper),holdersCount=countHolders(args,placeholder);}if(partials){args=composeArgs(args,partials,holders,isCurried);}if(partialsRight){args=composeArgsRight(args,partialsRight,holdersRight,isCurried);}length-=holdersCount;if(isCurried&&length<arity){var newHolders=replaceHolders(args,placeholder);return createRecurry(func,bitmask,createHybrid,wrapper.placeholder,thisArg,args,newHolders,argPos,ary,arity-length);}var thisBinding=isBind?thisArg:this,fn=isBindKey?thisBinding[func]:func;length=args.length;if(argPos){args=reorder(args,argPos);}else if(isFlip&&length>1){args.reverse();}if(isAry&&ary<length){args.length=ary;}if(this&&this!==root&&this instanceof wrapper){fn=Ctor||createCtor(fn);}return fn.apply(thisBinding,args);}return wrapper;}/**
  1883. * Creates a function like `_.invertBy`.
  1884. *
  1885. * @private
  1886. * @param {Function} setter The function to set accumulator values.
  1887. * @param {Function} toIteratee The function to resolve iteratees.
  1888. * @returns {Function} Returns the new inverter function.
  1889. */function createInverter(setter,toIteratee){return function(object,iteratee){return baseInverter(object,setter,toIteratee(iteratee),{});};}/**
  1890. * Creates a function that performs a mathematical operation on two values.
  1891. *
  1892. * @private
  1893. * @param {Function} operator The function to perform the operation.
  1894. * @param {number} [defaultValue] The value used for `undefined` arguments.
  1895. * @returns {Function} Returns the new mathematical operation function.
  1896. */function createMathOperation(operator,defaultValue){return function(value,other){var result;if(value===undefined&&other===undefined){return defaultValue;}if(value!==undefined){result=value;}if(other!==undefined){if(result===undefined){return other;}if(typeof value==='string'||typeof other==='string'){value=baseToString(value);other=baseToString(other);}else{value=baseToNumber(value);other=baseToNumber(other);}result=operator(value,other);}return result;};}/**
  1897. * Creates a function like `_.over`.
  1898. *
  1899. * @private
  1900. * @param {Function} arrayFunc The function to iterate over iteratees.
  1901. * @returns {Function} Returns the new over function.
  1902. */function createOver(arrayFunc){return flatRest(function(iteratees){iteratees=arrayMap(iteratees,baseUnary(getIteratee()));return baseRest(function(args){var thisArg=this;return arrayFunc(iteratees,function(iteratee){return apply(iteratee,thisArg,args);});});});}/**
  1903. * Creates the padding for `string` based on `length`. The `chars` string
  1904. * is truncated if the number of characters exceeds `length`.
  1905. *
  1906. * @private
  1907. * @param {number} length The padding length.
  1908. * @param {string} [chars=' '] The string used as padding.
  1909. * @returns {string} Returns the padding for `string`.
  1910. */function createPadding(length,chars){chars=chars===undefined?' ':baseToString(chars);var charsLength=chars.length;if(charsLength<2){return charsLength?baseRepeat(chars,length):chars;}var result=baseRepeat(chars,nativeCeil(length/stringSize(chars)));return hasUnicode(chars)?castSlice(stringToArray(result),0,length).join(''):result.slice(0,length);}/**
  1911. * Creates a function that wraps `func` to invoke it with the `this` binding
  1912. * of `thisArg` and `partials` prepended to the arguments it receives.
  1913. *
  1914. * @private
  1915. * @param {Function} func The function to wrap.
  1916. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  1917. * @param {*} thisArg The `this` binding of `func`.
  1918. * @param {Array} partials The arguments to prepend to those provided to
  1919. * the new function.
  1920. * @returns {Function} Returns the new wrapped function.
  1921. */function createPartial(func,bitmask,thisArg,partials){var isBind=bitmask&WRAP_BIND_FLAG,Ctor=createCtor(func);function wrapper(){var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(leftLength+argsLength),fn=this&&this!==root&&this instanceof wrapper?Ctor:func;while(++leftIndex<leftLength){args[leftIndex]=partials[leftIndex];}while(argsLength--){args[leftIndex++]=arguments[++argsIndex];}return apply(fn,isBind?thisArg:this,args);}return wrapper;}/**
  1922. * Creates a `_.range` or `_.rangeRight` function.
  1923. *
  1924. * @private
  1925. * @param {boolean} [fromRight] Specify iterating from right to left.
  1926. * @returns {Function} Returns the new range function.
  1927. */function createRange(fromRight){return function(start,end,step){if(step&&typeof step!=='number'&&isIterateeCall(start,end,step)){end=step=undefined;}// Ensure the sign of `-0` is preserved.
  1928. start=toFinite(start);if(end===undefined){end=start;start=0;}else{end=toFinite(end);}step=step===undefined?start<end?1:-1:toFinite(step);return baseRange(start,end,step,fromRight);};}/**
  1929. * Creates a function that performs a relational operation on two values.
  1930. *
  1931. * @private
  1932. * @param {Function} operator The function to perform the operation.
  1933. * @returns {Function} Returns the new relational operation function.
  1934. */function createRelationalOperation(operator){return function(value,other){if(!(typeof value==='string'&&typeof other==='string')){value=toNumber(value);other=toNumber(other);}return operator(value,other);};}/**
  1935. * Creates a function that wraps `func` to continue currying.
  1936. *
  1937. * @private
  1938. * @param {Function} func The function to wrap.
  1939. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  1940. * @param {Function} wrapFunc The function to create the `func` wrapper.
  1941. * @param {*} placeholder The placeholder value.
  1942. * @param {*} [thisArg] The `this` binding of `func`.
  1943. * @param {Array} [partials] The arguments to prepend to those provided to
  1944. * the new function.
  1945. * @param {Array} [holders] The `partials` placeholder indexes.
  1946. * @param {Array} [argPos] The argument positions of the new function.
  1947. * @param {number} [ary] The arity cap of `func`.
  1948. * @param {number} [arity] The arity of `func`.
  1949. * @returns {Function} Returns the new wrapped function.
  1950. */function createRecurry(func,bitmask,wrapFunc,placeholder,thisArg,partials,holders,argPos,ary,arity){var isCurry=bitmask&WRAP_CURRY_FLAG,newHolders=isCurry?holders:undefined,newHoldersRight=isCurry?undefined:holders,newPartials=isCurry?partials:undefined,newPartialsRight=isCurry?undefined:partials;bitmask|=isCurry?WRAP_PARTIAL_FLAG:WRAP_PARTIAL_RIGHT_FLAG;bitmask&=~(isCurry?WRAP_PARTIAL_RIGHT_FLAG:WRAP_PARTIAL_FLAG);if(!(bitmask&WRAP_CURRY_BOUND_FLAG)){bitmask&=~(WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG);}var newData=[func,bitmask,thisArg,newPartials,newHolders,newPartialsRight,newHoldersRight,argPos,ary,arity];var result=wrapFunc.apply(undefined,newData);if(isLaziable(func)){setData(result,newData);}result.placeholder=placeholder;return setWrapToString(result,func,bitmask);}/**
  1951. * Creates a function like `_.round`.
  1952. *
  1953. * @private
  1954. * @param {string} methodName The name of the `Math` method to use when rounding.
  1955. * @returns {Function} Returns the new round function.
  1956. */function createRound(methodName){var func=Math[methodName];return function(number,precision){number=toNumber(number);precision=precision==null?0:nativeMin(toInteger(precision),292);if(precision){// Shift with exponential notation to avoid floating-point issues.
  1957. // See [MDN](https://mdn.io/round#Examples) for more details.
  1958. var pair=(toString(number)+'e').split('e'),value=func(pair[0]+'e'+(+pair[1]+precision));pair=(toString(value)+'e').split('e');return+(pair[0]+'e'+(+pair[1]-precision));}return func(number);};}/**
  1959. * Creates a set object of `values`.
  1960. *
  1961. * @private
  1962. * @param {Array} values The values to add to the set.
  1963. * @returns {Object} Returns the new set.
  1964. */var createSet=!(Set&&1/setToArray(new Set([,-0]))[1]==INFINITY)?noop:function(values){return new Set(values);};/**
  1965. * Creates a `_.toPairs` or `_.toPairsIn` function.
  1966. *
  1967. * @private
  1968. * @param {Function} keysFunc The function to get the keys of a given object.
  1969. * @returns {Function} Returns the new pairs function.
  1970. */function createToPairs(keysFunc){return function(object){var tag=getTag(object);if(tag==mapTag){return mapToArray(object);}if(tag==setTag){return setToPairs(object);}return baseToPairs(object,keysFunc(object));};}/**
  1971. * Creates a function that either curries or invokes `func` with optional
  1972. * `this` binding and partially applied arguments.
  1973. *
  1974. * @private
  1975. * @param {Function|string} func The function or method name to wrap.
  1976. * @param {number} bitmask The bitmask flags.
  1977. * 1 - `_.bind`
  1978. * 2 - `_.bindKey`
  1979. * 4 - `_.curry` or `_.curryRight` of a bound function
  1980. * 8 - `_.curry`
  1981. * 16 - `_.curryRight`
  1982. * 32 - `_.partial`
  1983. * 64 - `_.partialRight`
  1984. * 128 - `_.rearg`
  1985. * 256 - `_.ary`
  1986. * 512 - `_.flip`
  1987. * @param {*} [thisArg] The `this` binding of `func`.
  1988. * @param {Array} [partials] The arguments to be partially applied.
  1989. * @param {Array} [holders] The `partials` placeholder indexes.
  1990. * @param {Array} [argPos] The argument positions of the new function.
  1991. * @param {number} [ary] The arity cap of `func`.
  1992. * @param {number} [arity] The arity of `func`.
  1993. * @returns {Function} Returns the new wrapped function.
  1994. */function createWrap(func,bitmask,thisArg,partials,holders,argPos,ary,arity){var isBindKey=bitmask&WRAP_BIND_KEY_FLAG;if(!isBindKey&&typeof func!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}var length=partials?partials.length:0;if(!length){bitmask&=~(WRAP_PARTIAL_FLAG|WRAP_PARTIAL_RIGHT_FLAG);partials=holders=undefined;}ary=ary===undefined?ary:nativeMax(toInteger(ary),0);arity=arity===undefined?arity:toInteger(arity);length-=holders?holders.length:0;if(bitmask&WRAP_PARTIAL_RIGHT_FLAG){var partialsRight=partials,holdersRight=holders;partials=holders=undefined;}var data=isBindKey?undefined:getData(func);var newData=[func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity];if(data){mergeData(newData,data);}func=newData[0];bitmask=newData[1];thisArg=newData[2];partials=newData[3];holders=newData[4];arity=newData[9]=newData[9]===undefined?isBindKey?0:func.length:nativeMax(newData[9]-length,0);if(!arity&&bitmask&(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG)){bitmask&=~(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG);}if(!bitmask||bitmask==WRAP_BIND_FLAG){var result=createBind(func,bitmask,thisArg);}else if(bitmask==WRAP_CURRY_FLAG||bitmask==WRAP_CURRY_RIGHT_FLAG){result=createCurry(func,bitmask,arity);}else if((bitmask==WRAP_PARTIAL_FLAG||bitmask==(WRAP_BIND_FLAG|WRAP_PARTIAL_FLAG))&&!holders.length){result=createPartial(func,bitmask,thisArg,partials);}else{result=createHybrid.apply(undefined,newData);}var setter=data?baseSetData:setData;return setWrapToString(setter(result,newData),func,bitmask);}/**
  1995. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  1996. * of source objects to the destination object for all destination properties
  1997. * that resolve to `undefined`.
  1998. *
  1999. * @private
  2000. * @param {*} objValue The destination value.
  2001. * @param {*} srcValue The source value.
  2002. * @param {string} key The key of the property to assign.
  2003. * @param {Object} object The parent object of `objValue`.
  2004. * @returns {*} Returns the value to assign.
  2005. */function customDefaultsAssignIn(objValue,srcValue,key,object){if(objValue===undefined||eq(objValue,objectProto[key])&&!hasOwnProperty.call(object,key)){return srcValue;}return objValue;}/**
  2006. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  2007. * objects into destination objects that are passed thru.
  2008. *
  2009. * @private
  2010. * @param {*} objValue The destination value.
  2011. * @param {*} srcValue The source value.
  2012. * @param {string} key The key of the property to merge.
  2013. * @param {Object} object The parent object of `objValue`.
  2014. * @param {Object} source The parent object of `srcValue`.
  2015. * @param {Object} [stack] Tracks traversed source values and their merged
  2016. * counterparts.
  2017. * @returns {*} Returns the value to assign.
  2018. */function customDefaultsMerge(objValue,srcValue,key,object,source,stack){if(isObject(objValue)&&isObject(srcValue)){// Recursively merge objects and arrays (susceptible to call stack limits).
  2019. stack.set(srcValue,objValue);baseMerge(objValue,srcValue,undefined,customDefaultsMerge,stack);stack['delete'](srcValue);}return objValue;}/**
  2020. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  2021. * objects.
  2022. *
  2023. * @private
  2024. * @param {*} value The value to inspect.
  2025. * @param {string} key The key of the property to inspect.
  2026. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  2027. */function customOmitClone(value){return isPlainObject(value)?undefined:value;}/**
  2028. * A specialized version of `baseIsEqualDeep` for arrays with support for
  2029. * partial deep comparisons.
  2030. *
  2031. * @private
  2032. * @param {Array} array The array to compare.
  2033. * @param {Array} other The other array to compare.
  2034. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  2035. * @param {Function} customizer The function to customize comparisons.
  2036. * @param {Function} equalFunc The function to determine equivalents of values.
  2037. * @param {Object} stack Tracks traversed `array` and `other` objects.
  2038. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  2039. */function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength)){return false;}// Assume cyclic values are equal.
  2040. var stacked=stack.get(array);if(stacked&&stack.get(other)){return stacked==other;}var index=-1,result=true,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache():undefined;stack.set(array,other);stack.set(other,array);// Ignore non-index properties.
  2041. while(++index<arrLength){var arrValue=array[index],othValue=other[index];if(customizer){var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);}if(compared!==undefined){if(compared){continue;}result=false;break;}// Recursively compare arrays (susceptible to call stack limits).
  2042. if(seen){if(!arraySome(other,function(othValue,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack))){return seen.push(othIndex);}})){result=false;break;}}else if(!(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack))){result=false;break;}}stack['delete'](array);stack['delete'](other);return result;}/**
  2043. * A specialized version of `baseIsEqualDeep` for comparing objects of
  2044. * the same `toStringTag`.
  2045. *
  2046. * **Note:** This function only supports comparing values with tags of
  2047. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  2048. *
  2049. * @private
  2050. * @param {Object} object The object to compare.
  2051. * @param {Object} other The other object to compare.
  2052. * @param {string} tag The `toStringTag` of the objects to compare.
  2053. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  2054. * @param {Function} customizer The function to customize comparisons.
  2055. * @param {Function} equalFunc The function to determine equivalents of values.
  2056. * @param {Object} stack Tracks traversed `object` and `other` objects.
  2057. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  2058. */function equalByTag(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case dataViewTag:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset){return false;}object=object.buffer;other=other.buffer;case arrayBufferTag:if(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other))){return false;}return true;case boolTag:case dateTag:case numberTag:// Coerce booleans to `1` or `0` and dates to milliseconds.
  2059. // Invalid dates are coerced to `NaN`.
  2060. return eq(+object,+other);case errorTag:return object.name==other.name&&object.message==other.message;case regexpTag:case stringTag:// Coerce regexes to strings and treat strings, primitives and objects,
  2061. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  2062. // for more details.
  2063. return object==other+'';case mapTag:var convert=mapToArray;case setTag:var isPartial=bitmask&COMPARE_PARTIAL_FLAG;convert||(convert=setToArray);if(object.size!=other.size&&!isPartial){return false;}// Assume cyclic values are equal.
  2064. var stacked=stack.get(object);if(stacked){return stacked==other;}bitmask|=COMPARE_UNORDERED_FLAG;// Recursively compare objects (susceptible to call stack limits).
  2065. stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);stack['delete'](object);return result;case symbolTag:if(symbolValueOf){return symbolValueOf.call(object)==symbolValueOf.call(other);}}return false;}/**
  2066. * A specialized version of `baseIsEqualDeep` for objects with support for
  2067. * partial deep comparisons.
  2068. *
  2069. * @private
  2070. * @param {Object} object The object to compare.
  2071. * @param {Object} other The other object to compare.
  2072. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  2073. * @param {Function} customizer The function to customize comparisons.
  2074. * @param {Function} equalFunc The function to determine equivalents of values.
  2075. * @param {Object} stack Tracks traversed `object` and `other` objects.
  2076. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  2077. */function equalObjects(object,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG,objProps=getAllKeys(object),objLength=objProps.length,othProps=getAllKeys(other),othLength=othProps.length;if(objLength!=othLength&&!isPartial){return false;}var index=objLength;while(index--){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty.call(other,key))){return false;}}// Assume cyclic values are equal.
  2078. var stacked=stack.get(object);if(stacked&&stack.get(other)){return stacked==other;}var result=true;stack.set(object,other);stack.set(other,object);var skipCtor=isPartial;while(++index<objLength){key=objProps[index];var objValue=object[key],othValue=other[key];if(customizer){var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);}// Recursively compare objects (susceptible to call stack limits).
  2079. if(!(compared===undefined?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=false;break;}skipCtor||(skipCtor=key=='constructor');}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;// Non `Object` object instances with different constructors are not equal.
  2080. if(objCtor!=othCtor&&'constructor'in object&&'constructor'in other&&!(typeof objCtor==='function'&&objCtor instanceof objCtor&&typeof othCtor==='function'&&othCtor instanceof othCtor)){result=false;}}stack['delete'](object);stack['delete'](other);return result;}/**
  2081. * A specialized version of `baseRest` which flattens the rest array.
  2082. *
  2083. * @private
  2084. * @param {Function} func The function to apply a rest parameter to.
  2085. * @returns {Function} Returns the new function.
  2086. */function flatRest(func){return setToString(overRest(func,undefined,flatten),func+'');}/**
  2087. * Creates an array of own enumerable property names and symbols of `object`.
  2088. *
  2089. * @private
  2090. * @param {Object} object The object to query.
  2091. * @returns {Array} Returns the array of property names and symbols.
  2092. */function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols);}/**
  2093. * Creates an array of own and inherited enumerable property names and
  2094. * symbols of `object`.
  2095. *
  2096. * @private
  2097. * @param {Object} object The object to query.
  2098. * @returns {Array} Returns the array of property names and symbols.
  2099. */function getAllKeysIn(object){return baseGetAllKeys(object,keysIn,getSymbolsIn);}/**
  2100. * Gets metadata for `func`.
  2101. *
  2102. * @private
  2103. * @param {Function} func The function to query.
  2104. * @returns {*} Returns the metadata for `func`.
  2105. */var getData=!metaMap?noop:function(func){return metaMap.get(func);};/**
  2106. * Gets the name of `func`.
  2107. *
  2108. * @private
  2109. * @param {Function} func The function to query.
  2110. * @returns {string} Returns the function name.
  2111. */function getFuncName(func){var result=func.name+'',array=realNames[result],length=hasOwnProperty.call(realNames,result)?array.length:0;while(length--){var data=array[length],otherFunc=data.func;if(otherFunc==null||otherFunc==func){return data.name;}}return result;}/**
  2112. * Gets the argument placeholder value for `func`.
  2113. *
  2114. * @private
  2115. * @param {Function} func The function to inspect.
  2116. * @returns {*} Returns the placeholder value.
  2117. */function getHolder(func){var object=hasOwnProperty.call(lodash,'placeholder')?lodash:func;return object.placeholder;}/**
  2118. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  2119. * this function returns the custom method, otherwise it returns `baseIteratee`.
  2120. * If arguments are provided, the chosen function is invoked with them and
  2121. * its result is returned.
  2122. *
  2123. * @private
  2124. * @param {*} [value] The value to convert to an iteratee.
  2125. * @param {number} [arity] The arity of the created iteratee.
  2126. * @returns {Function} Returns the chosen function or its result.
  2127. */function getIteratee(){var result=lodash.iteratee||iteratee;result=result===iteratee?baseIteratee:result;return arguments.length?result(arguments[0],arguments[1]):result;}/**
  2128. * Gets the data for `map`.
  2129. *
  2130. * @private
  2131. * @param {Object} map The map to query.
  2132. * @param {string} key The reference key.
  2133. * @returns {*} Returns the map data.
  2134. */function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data[typeof key==='string'?'string':'hash']:data.map;}/**
  2135. * Gets the property names, values, and compare flags of `object`.
  2136. *
  2137. * @private
  2138. * @param {Object} object The object to query.
  2139. * @returns {Array} Returns the match data of `object`.
  2140. */function getMatchData(object){var result=keys(object),length=result.length;while(length--){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)];}return result;}/**
  2141. * Gets the native function at `key` of `object`.
  2142. *
  2143. * @private
  2144. * @param {Object} object The object to query.
  2145. * @param {string} key The key of the method to get.
  2146. * @returns {*} Returns the function if it's native, else `undefined`.
  2147. */function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:undefined;}/**
  2148. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  2149. *
  2150. * @private
  2151. * @param {*} value The value to query.
  2152. * @returns {string} Returns the raw `toStringTag`.
  2153. */function getRawTag(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{value[symToStringTag]=undefined;var unmasked=true;}catch(e){}var result=nativeObjectToString.call(value);if(unmasked){if(isOwn){value[symToStringTag]=tag;}else{delete value[symToStringTag];}}return result;}/**
  2154. * Creates an array of the own enumerable symbols of `object`.
  2155. *
  2156. * @private
  2157. * @param {Object} object The object to query.
  2158. * @returns {Array} Returns the array of symbols.
  2159. */var getSymbols=!nativeGetSymbols?stubArray:function(object){if(object==null){return[];}object=Object(object);return arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol);});};/**
  2160. * Creates an array of the own and inherited enumerable symbols of `object`.
  2161. *
  2162. * @private
  2163. * @param {Object} object The object to query.
  2164. * @returns {Array} Returns the array of symbols.
  2165. */var getSymbolsIn=!nativeGetSymbols?stubArray:function(object){var result=[];while(object){arrayPush(result,getSymbols(object));object=getPrototype(object);}return result;};/**
  2166. * Gets the `toStringTag` of `value`.
  2167. *
  2168. * @private
  2169. * @param {*} value The value to query.
  2170. * @returns {string} Returns the `toStringTag`.
  2171. */var getTag=baseGetTag;// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  2172. if(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map())!=mapTag||Promise&&getTag(Promise.resolve())!=promiseTag||Set&&getTag(new Set())!=setTag||WeakMap&&getTag(new WeakMap())!=weakMapTag){getTag=function getTag(value){var result=baseGetTag(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):'';if(ctorString){switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag;}}return result;};}/**
  2173. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  2174. *
  2175. * @private
  2176. * @param {number} start The start of the view.
  2177. * @param {number} end The end of the view.
  2178. * @param {Array} transforms The transformations to apply to the view.
  2179. * @returns {Object} Returns an object containing the `start` and `end`
  2180. * positions of the view.
  2181. */function getView(start,end,transforms){var index=-1,length=transforms.length;while(++index<length){var data=transforms[index],size=data.size;switch(data.type){case'drop':start+=size;break;case'dropRight':end-=size;break;case'take':end=nativeMin(end,start+size);break;case'takeRight':start=nativeMax(start,end-size);break;}}return{start:start,end:end};}/**
  2182. * Extracts wrapper details from the `source` body comment.
  2183. *
  2184. * @private
  2185. * @param {string} source The source to inspect.
  2186. * @returns {Array} Returns the wrapper details.
  2187. */function getWrapDetails(source){var match=source.match(reWrapDetails);return match?match[1].split(reSplitDetails):[];}/**
  2188. * Checks if `path` exists on `object`.
  2189. *
  2190. * @private
  2191. * @param {Object} object The object to query.
  2192. * @param {Array|string} path The path to check.
  2193. * @param {Function} hasFunc The function to check properties.
  2194. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  2195. */function hasPath(object,path,hasFunc){path=castPath(path,object);var index=-1,length=path.length,result=false;while(++index<length){var key=toKey(path[index]);if(!(result=object!=null&&hasFunc(object,key))){break;}object=object[key];}if(result||++index!=length){return result;}length=object==null?0:object.length;return!!length&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object));}/**
  2196. * Initializes an array clone.
  2197. *
  2198. * @private
  2199. * @param {Array} array The array to clone.
  2200. * @returns {Array} Returns the initialized clone.
  2201. */function initCloneArray(array){var length=array.length,result=new array.constructor(length);// Add properties assigned by `RegExp#exec`.
  2202. if(length&&typeof array[0]==='string'&&hasOwnProperty.call(array,'index')){result.index=array.index;result.input=array.input;}return result;}/**
  2203. * Initializes an object clone.
  2204. *
  2205. * @private
  2206. * @param {Object} object The object to clone.
  2207. * @returns {Object} Returns the initialized clone.
  2208. */function initCloneObject(object){return typeof object.constructor==='function'&&!isPrototype(object)?baseCreate(getPrototype(object)):{};}/**
  2209. * Initializes an object clone based on its `toStringTag`.
  2210. *
  2211. * **Note:** This function only supports cloning values with tags of
  2212. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  2213. *
  2214. * @private
  2215. * @param {Object} object The object to clone.
  2216. * @param {string} tag The `toStringTag` of the object to clone.
  2217. * @param {boolean} [isDeep] Specify a deep clone.
  2218. * @returns {Object} Returns the initialized clone.
  2219. */function initCloneByTag(object,tag,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return cloneArrayBuffer(object);case boolTag:case dateTag:return new Ctor(+object);case dataViewTag:return cloneDataView(object,isDeep);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:return cloneTypedArray(object,isDeep);case mapTag:return new Ctor();case numberTag:case stringTag:return new Ctor(object);case regexpTag:return cloneRegExp(object);case setTag:return new Ctor();case symbolTag:return cloneSymbol(object);}}/**
  2220. * Inserts wrapper `details` in a comment at the top of the `source` body.
  2221. *
  2222. * @private
  2223. * @param {string} source The source to modify.
  2224. * @returns {Array} details The details to insert.
  2225. * @returns {string} Returns the modified source.
  2226. */function insertWrapDetails(source,details){var length=details.length;if(!length){return source;}var lastIndex=length-1;details[lastIndex]=(length>1?'& ':'')+details[lastIndex];details=details.join(length>2?', ':' ');return source.replace(reWrapComment,'{\n/* [wrapped with '+details+'] */\n');}/**
  2227. * Checks if `value` is a flattenable `arguments` object or array.
  2228. *
  2229. * @private
  2230. * @param {*} value The value to check.
  2231. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  2232. */function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol]);}/**
  2233. * Checks if `value` is a valid array-like index.
  2234. *
  2235. * @private
  2236. * @param {*} value The value to check.
  2237. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  2238. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  2239. */function isIndex(value,length){var type=typeof value==='undefined'?'undefined':_typeof(value);length=length==null?MAX_SAFE_INTEGER:length;return!!length&&(type=='number'||type!='symbol'&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length;}/**
  2240. * Checks if the given arguments are from an iteratee call.
  2241. *
  2242. * @private
  2243. * @param {*} value The potential iteratee value argument.
  2244. * @param {*} index The potential iteratee index or key argument.
  2245. * @param {*} object The potential iteratee object argument.
  2246. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  2247. * else `false`.
  2248. */function isIterateeCall(value,index,object){if(!isObject(object)){return false;}var type=typeof index==='undefined'?'undefined':_typeof(index);if(type=='number'?isArrayLike(object)&&isIndex(index,object.length):type=='string'&&index in object){return eq(object[index],value);}return false;}/**
  2249. * Checks if `value` is a property name and not a property path.
  2250. *
  2251. * @private
  2252. * @param {*} value The value to check.
  2253. * @param {Object} [object] The object to query keys on.
  2254. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  2255. */function isKey(value,object){if(isArray(value)){return false;}var type=typeof value==='undefined'?'undefined':_typeof(value);if(type=='number'||type=='symbol'||type=='boolean'||value==null||isSymbol(value)){return true;}return reIsPlainProp.test(value)||!reIsDeepProp.test(value)||object!=null&&value in Object(object);}/**
  2256. * Checks if `value` is suitable for use as unique object key.
  2257. *
  2258. * @private
  2259. * @param {*} value The value to check.
  2260. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  2261. */function isKeyable(value){var type=typeof value==='undefined'?'undefined':_typeof(value);return type=='string'||type=='number'||type=='symbol'||type=='boolean'?value!=='__proto__':value===null;}/**
  2262. * Checks if `func` has a lazy counterpart.
  2263. *
  2264. * @private
  2265. * @param {Function} func The function to check.
  2266. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  2267. * else `false`.
  2268. */function isLaziable(func){var funcName=getFuncName(func),other=lodash[funcName];if(typeof other!=='function'||!(funcName in LazyWrapper.prototype)){return false;}if(func===other){return true;}var data=getData(other);return!!data&&func===data[0];}/**
  2269. * Checks if `func` has its source masked.
  2270. *
  2271. * @private
  2272. * @param {Function} func The function to check.
  2273. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  2274. */function isMasked(func){return!!maskSrcKey&&maskSrcKey in func;}/**
  2275. * Checks if `func` is capable of being masked.
  2276. *
  2277. * @private
  2278. * @param {*} value The value to check.
  2279. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  2280. */var isMaskable=coreJsData?isFunction:stubFalse;/**
  2281. * Checks if `value` is likely a prototype object.
  2282. *
  2283. * @private
  2284. * @param {*} value The value to check.
  2285. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  2286. */function isPrototype(value){var Ctor=value&&value.constructor,proto=typeof Ctor==='function'&&Ctor.prototype||objectProto;return value===proto;}/**
  2287. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  2288. *
  2289. * @private
  2290. * @param {*} value The value to check.
  2291. * @returns {boolean} Returns `true` if `value` if suitable for strict
  2292. * equality comparisons, else `false`.
  2293. */function isStrictComparable(value){return value===value&&!isObject(value);}/**
  2294. * A specialized version of `matchesProperty` for source values suitable
  2295. * for strict equality comparisons, i.e. `===`.
  2296. *
  2297. * @private
  2298. * @param {string} key The key of the property to get.
  2299. * @param {*} srcValue The value to match.
  2300. * @returns {Function} Returns the new spec function.
  2301. */function matchesStrictComparable(key,srcValue){return function(object){if(object==null){return false;}return object[key]===srcValue&&(srcValue!==undefined||key in Object(object));};}/**
  2302. * A specialized version of `_.memoize` which clears the memoized function's
  2303. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  2304. *
  2305. * @private
  2306. * @param {Function} func The function to have its output memoized.
  2307. * @returns {Function} Returns the new memoized function.
  2308. */function memoizeCapped(func){var result=memoize(func,function(key){if(cache.size===MAX_MEMOIZE_SIZE){cache.clear();}return key;});var cache=result.cache;return result;}/**
  2309. * Merges the function metadata of `source` into `data`.
  2310. *
  2311. * Merging metadata reduces the number of wrappers used to invoke a function.
  2312. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  2313. * may be applied regardless of execution order. Methods like `_.ary` and
  2314. * `_.rearg` modify function arguments, making the order in which they are
  2315. * executed important, preventing the merging of metadata. However, we make
  2316. * an exception for a safe combined case where curried functions have `_.ary`
  2317. * and or `_.rearg` applied.
  2318. *
  2319. * @private
  2320. * @param {Array} data The destination metadata.
  2321. * @param {Array} source The source metadata.
  2322. * @returns {Array} Returns `data`.
  2323. */function mergeData(data,source){var bitmask=data[1],srcBitmask=source[1],newBitmask=bitmask|srcBitmask,isCommon=newBitmask<(WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG|WRAP_ARY_FLAG);var isCombo=srcBitmask==WRAP_ARY_FLAG&&bitmask==WRAP_CURRY_FLAG||srcBitmask==WRAP_ARY_FLAG&&bitmask==WRAP_REARG_FLAG&&data[7].length<=source[8]||srcBitmask==(WRAP_ARY_FLAG|WRAP_REARG_FLAG)&&source[7].length<=source[8]&&bitmask==WRAP_CURRY_FLAG;// Exit early if metadata can't be merged.
  2324. if(!(isCommon||isCombo)){return data;}// Use source `thisArg` if available.
  2325. if(srcBitmask&WRAP_BIND_FLAG){data[2]=source[2];// Set when currying a bound function.
  2326. newBitmask|=bitmask&WRAP_BIND_FLAG?0:WRAP_CURRY_BOUND_FLAG;}// Compose partial arguments.
  2327. var value=source[3];if(value){var partials=data[3];data[3]=partials?composeArgs(partials,value,source[4]):value;data[4]=partials?replaceHolders(data[3],PLACEHOLDER):source[4];}// Compose partial right arguments.
  2328. value=source[5];if(value){partials=data[5];data[5]=partials?composeArgsRight(partials,value,source[6]):value;data[6]=partials?replaceHolders(data[5],PLACEHOLDER):source[6];}// Use source `argPos` if available.
  2329. value=source[7];if(value){data[7]=value;}// Use source `ary` if it's smaller.
  2330. if(srcBitmask&WRAP_ARY_FLAG){data[8]=data[8]==null?source[8]:nativeMin(data[8],source[8]);}// Use source `arity` if one is not provided.
  2331. if(data[9]==null){data[9]=source[9];}// Use source `func` and merge bitmasks.
  2332. data[0]=source[0];data[1]=newBitmask;return data;}/**
  2333. * This function is like
  2334. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  2335. * except that it includes inherited enumerable properties.
  2336. *
  2337. * @private
  2338. * @param {Object} object The object to query.
  2339. * @returns {Array} Returns the array of property names.
  2340. */function nativeKeysIn(object){var result=[];if(object!=null){for(var key in Object(object)){result.push(key);}}return result;}/**
  2341. * Converts `value` to a string using `Object.prototype.toString`.
  2342. *
  2343. * @private
  2344. * @param {*} value The value to convert.
  2345. * @returns {string} Returns the converted string.
  2346. */function objectToString(value){return nativeObjectToString.call(value);}/**
  2347. * A specialized version of `baseRest` which transforms the rest array.
  2348. *
  2349. * @private
  2350. * @param {Function} func The function to apply a rest parameter to.
  2351. * @param {number} [start=func.length-1] The start position of the rest parameter.
  2352. * @param {Function} transform The rest array transform.
  2353. * @returns {Function} Returns the new function.
  2354. */function overRest(func,start,transform){start=nativeMax(start===undefined?func.length-1:start,0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);while(++index<length){array[index]=args[start+index];}index=-1;var otherArgs=Array(start+1);while(++index<start){otherArgs[index]=args[index];}otherArgs[start]=transform(array);return apply(func,this,otherArgs);};}/**
  2355. * Gets the parent value at `path` of `object`.
  2356. *
  2357. * @private
  2358. * @param {Object} object The object to query.
  2359. * @param {Array} path The path to get the parent value of.
  2360. * @returns {*} Returns the parent value.
  2361. */function parent(object,path){return path.length<2?object:baseGet(object,baseSlice(path,0,-1));}/**
  2362. * Reorder `array` according to the specified indexes where the element at
  2363. * the first index is assigned as the first element, the element at
  2364. * the second index is assigned as the second element, and so on.
  2365. *
  2366. * @private
  2367. * @param {Array} array The array to reorder.
  2368. * @param {Array} indexes The arranged array indexes.
  2369. * @returns {Array} Returns `array`.
  2370. */function reorder(array,indexes){var arrLength=array.length,length=nativeMin(indexes.length,arrLength),oldArray=copyArray(array);while(length--){var index=indexes[length];array[length]=isIndex(index,arrLength)?oldArray[index]:undefined;}return array;}/**
  2371. * Sets metadata for `func`.
  2372. *
  2373. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  2374. * period of time, it will trip its breaker and transition to an identity
  2375. * function to avoid garbage collection pauses in V8. See
  2376. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  2377. * for more details.
  2378. *
  2379. * @private
  2380. * @param {Function} func The function to associate metadata with.
  2381. * @param {*} data The metadata.
  2382. * @returns {Function} Returns `func`.
  2383. */var setData=shortOut(baseSetData);/**
  2384. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  2385. *
  2386. * @private
  2387. * @param {Function} func The function to delay.
  2388. * @param {number} wait The number of milliseconds to delay invocation.
  2389. * @returns {number|Object} Returns the timer id or timeout object.
  2390. */var setTimeout=ctxSetTimeout||function(func,wait){return root.setTimeout(func,wait);};/**
  2391. * Sets the `toString` method of `func` to return `string`.
  2392. *
  2393. * @private
  2394. * @param {Function} func The function to modify.
  2395. * @param {Function} string The `toString` result.
  2396. * @returns {Function} Returns `func`.
  2397. */var setToString=shortOut(baseSetToString);/**
  2398. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  2399. * with wrapper details in a comment at the top of the source body.
  2400. *
  2401. * @private
  2402. * @param {Function} wrapper The function to modify.
  2403. * @param {Function} reference The reference function.
  2404. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  2405. * @returns {Function} Returns `wrapper`.
  2406. */function setWrapToString(wrapper,reference,bitmask){var source=reference+'';return setToString(wrapper,insertWrapDetails(source,updateWrapDetails(getWrapDetails(source),bitmask)));}/**
  2407. * Creates a function that'll short out and invoke `identity` instead
  2408. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  2409. * milliseconds.
  2410. *
  2411. * @private
  2412. * @param {Function} func The function to restrict.
  2413. * @returns {Function} Returns the new shortable function.
  2414. */function shortOut(func){var count=0,lastCalled=0;return function(){var stamp=nativeNow(),remaining=HOT_SPAN-(stamp-lastCalled);lastCalled=stamp;if(remaining>0){if(++count>=HOT_COUNT){return arguments[0];}}else{count=0;}return func.apply(undefined,arguments);};}/**
  2415. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  2416. *
  2417. * @private
  2418. * @param {Array} array The array to shuffle.
  2419. * @param {number} [size=array.length] The size of `array`.
  2420. * @returns {Array} Returns `array`.
  2421. */function shuffleSelf(array,size){var index=-1,length=array.length,lastIndex=length-1;size=size===undefined?length:size;while(++index<size){var rand=baseRandom(index,lastIndex),value=array[rand];array[rand]=array[index];array[index]=value;}array.length=size;return array;}/**
  2422. * Converts `string` to a property path array.
  2423. *
  2424. * @private
  2425. * @param {string} string The string to convert.
  2426. * @returns {Array} Returns the property path array.
  2427. */var stringToPath=memoizeCapped(function(string){var result=[];if(string.charCodeAt(0)===46/* . */){result.push('');}string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,'$1'):number||match);});return result;});/**
  2428. * Converts `value` to a string key if it's not a string or symbol.
  2429. *
  2430. * @private
  2431. * @param {*} value The value to inspect.
  2432. * @returns {string|symbol} Returns the key.
  2433. */function toKey(value){if(typeof value==='string'||isSymbol(value)){return value;}var result=value+'';return result=='0'&&1/value==-INFINITY?'-0':result;}/**
  2434. * Converts `func` to its source code.
  2435. *
  2436. * @private
  2437. * @param {Function} func The function to convert.
  2438. * @returns {string} Returns the source code.
  2439. */function toSource(func){if(func!=null){try{return funcToString.call(func);}catch(e){}try{return func+'';}catch(e){}}return'';}/**
  2440. * Updates wrapper `details` based on `bitmask` flags.
  2441. *
  2442. * @private
  2443. * @returns {Array} details The details to modify.
  2444. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  2445. * @returns {Array} Returns `details`.
  2446. */function updateWrapDetails(details,bitmask){arrayEach(wrapFlags,function(pair){var value='_.'+pair[0];if(bitmask&pair[1]&&!arrayIncludes(details,value)){details.push(value);}});return details.sort();}/**
  2447. * Creates a clone of `wrapper`.
  2448. *
  2449. * @private
  2450. * @param {Object} wrapper The wrapper to clone.
  2451. * @returns {Object} Returns the cloned wrapper.
  2452. */function wrapperClone(wrapper){if(wrapper instanceof LazyWrapper){return wrapper.clone();}var result=new LodashWrapper(wrapper.__wrapped__,wrapper.__chain__);result.__actions__=copyArray(wrapper.__actions__);result.__index__=wrapper.__index__;result.__values__=wrapper.__values__;return result;}/* ------------------------------------------------------------------------*//**
  2453. * Creates an array of elements split into groups the length of `size`.
  2454. * If `array` can't be split evenly, the final chunk will be the remaining
  2455. * elements.
  2456. *
  2457. * @static
  2458. * @memberOf _
  2459. * @since 3.0.0
  2460. * @category Array
  2461. * @param {Array} array The array to process.
  2462. * @param {number} [size=1] The length of each chunk
  2463. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  2464. * @returns {Array} Returns the new array of chunks.
  2465. * @example
  2466. *
  2467. * _.chunk(['a', 'b', 'c', 'd'], 2);
  2468. * // => [['a', 'b'], ['c', 'd']]
  2469. *
  2470. * _.chunk(['a', 'b', 'c', 'd'], 3);
  2471. * // => [['a', 'b', 'c'], ['d']]
  2472. */function chunk(array,size,guard){if(guard?isIterateeCall(array,size,guard):size===undefined){size=1;}else{size=nativeMax(toInteger(size),0);}var length=array==null?0:array.length;if(!length||size<1){return[];}var index=0,resIndex=0,result=Array(nativeCeil(length/size));while(index<length){result[resIndex++]=baseSlice(array,index,index+=size);}return result;}/**
  2473. * Creates an array with all falsey values removed. The values `false`, `null`,
  2474. * `0`, `""`, `undefined`, and `NaN` are falsey.
  2475. *
  2476. * @static
  2477. * @memberOf _
  2478. * @since 0.1.0
  2479. * @category Array
  2480. * @param {Array} array The array to compact.
  2481. * @returns {Array} Returns the new array of filtered values.
  2482. * @example
  2483. *
  2484. * _.compact([0, 1, false, 2, '', 3]);
  2485. * // => [1, 2, 3]
  2486. */function compact(array){var index=-1,length=array==null?0:array.length,resIndex=0,result=[];while(++index<length){var value=array[index];if(value){result[resIndex++]=value;}}return result;}/**
  2487. * Creates a new array concatenating `array` with any additional arrays
  2488. * and/or values.
  2489. *
  2490. * @static
  2491. * @memberOf _
  2492. * @since 4.0.0
  2493. * @category Array
  2494. * @param {Array} array The array to concatenate.
  2495. * @param {...*} [values] The values to concatenate.
  2496. * @returns {Array} Returns the new concatenated array.
  2497. * @example
  2498. *
  2499. * var array = [1];
  2500. * var other = _.concat(array, 2, [3], [[4]]);
  2501. *
  2502. * console.log(other);
  2503. * // => [1, 2, 3, [4]]
  2504. *
  2505. * console.log(array);
  2506. * // => [1]
  2507. */function concat(){var length=arguments.length;if(!length){return[];}var args=Array(length-1),array=arguments[0],index=length;while(index--){args[index-1]=arguments[index];}return arrayPush(isArray(array)?copyArray(array):[array],baseFlatten(args,1));}/**
  2508. * Creates an array of `array` values not included in the other given arrays
  2509. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2510. * for equality comparisons. The order and references of result values are
  2511. * determined by the first array.
  2512. *
  2513. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  2514. *
  2515. * @static
  2516. * @memberOf _
  2517. * @since 0.1.0
  2518. * @category Array
  2519. * @param {Array} array The array to inspect.
  2520. * @param {...Array} [values] The values to exclude.
  2521. * @returns {Array} Returns the new array of filtered values.
  2522. * @see _.without, _.xor
  2523. * @example
  2524. *
  2525. * _.difference([2, 1], [2, 3]);
  2526. * // => [1]
  2527. */var difference=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,true)):[];});/**
  2528. * This method is like `_.difference` except that it accepts `iteratee` which
  2529. * is invoked for each element of `array` and `values` to generate the criterion
  2530. * by which they're compared. The order and references of result values are
  2531. * determined by the first array. The iteratee is invoked with one argument:
  2532. * (value).
  2533. *
  2534. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  2535. *
  2536. * @static
  2537. * @memberOf _
  2538. * @since 4.0.0
  2539. * @category Array
  2540. * @param {Array} array The array to inspect.
  2541. * @param {...Array} [values] The values to exclude.
  2542. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  2543. * @returns {Array} Returns the new array of filtered values.
  2544. * @example
  2545. *
  2546. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  2547. * // => [1.2]
  2548. *
  2549. * // The `_.property` iteratee shorthand.
  2550. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  2551. * // => [{ 'x': 2 }]
  2552. */var differenceBy=baseRest(function(array,values){var iteratee=last(values);if(isArrayLikeObject(iteratee)){iteratee=undefined;}return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,true),getIteratee(iteratee,2)):[];});/**
  2553. * This method is like `_.difference` except that it accepts `comparator`
  2554. * which is invoked to compare elements of `array` to `values`. The order and
  2555. * references of result values are determined by the first array. The comparator
  2556. * is invoked with two arguments: (arrVal, othVal).
  2557. *
  2558. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  2559. *
  2560. * @static
  2561. * @memberOf _
  2562. * @since 4.0.0
  2563. * @category Array
  2564. * @param {Array} array The array to inspect.
  2565. * @param {...Array} [values] The values to exclude.
  2566. * @param {Function} [comparator] The comparator invoked per element.
  2567. * @returns {Array} Returns the new array of filtered values.
  2568. * @example
  2569. *
  2570. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  2571. *
  2572. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  2573. * // => [{ 'x': 2, 'y': 1 }]
  2574. */var differenceWith=baseRest(function(array,values){var comparator=last(values);if(isArrayLikeObject(comparator)){comparator=undefined;}return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,true),undefined,comparator):[];});/**
  2575. * Creates a slice of `array` with `n` elements dropped from the beginning.
  2576. *
  2577. * @static
  2578. * @memberOf _
  2579. * @since 0.5.0
  2580. * @category Array
  2581. * @param {Array} array The array to query.
  2582. * @param {number} [n=1] The number of elements to drop.
  2583. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  2584. * @returns {Array} Returns the slice of `array`.
  2585. * @example
  2586. *
  2587. * _.drop([1, 2, 3]);
  2588. * // => [2, 3]
  2589. *
  2590. * _.drop([1, 2, 3], 2);
  2591. * // => [3]
  2592. *
  2593. * _.drop([1, 2, 3], 5);
  2594. * // => []
  2595. *
  2596. * _.drop([1, 2, 3], 0);
  2597. * // => [1, 2, 3]
  2598. */function drop(array,n,guard){var length=array==null?0:array.length;if(!length){return[];}n=guard||n===undefined?1:toInteger(n);return baseSlice(array,n<0?0:n,length);}/**
  2599. * Creates a slice of `array` with `n` elements dropped from the end.
  2600. *
  2601. * @static
  2602. * @memberOf _
  2603. * @since 3.0.0
  2604. * @category Array
  2605. * @param {Array} array The array to query.
  2606. * @param {number} [n=1] The number of elements to drop.
  2607. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  2608. * @returns {Array} Returns the slice of `array`.
  2609. * @example
  2610. *
  2611. * _.dropRight([1, 2, 3]);
  2612. * // => [1, 2]
  2613. *
  2614. * _.dropRight([1, 2, 3], 2);
  2615. * // => [1]
  2616. *
  2617. * _.dropRight([1, 2, 3], 5);
  2618. * // => []
  2619. *
  2620. * _.dropRight([1, 2, 3], 0);
  2621. * // => [1, 2, 3]
  2622. */function dropRight(array,n,guard){var length=array==null?0:array.length;if(!length){return[];}n=guard||n===undefined?1:toInteger(n);n=length-n;return baseSlice(array,0,n<0?0:n);}/**
  2623. * Creates a slice of `array` excluding elements dropped from the end.
  2624. * Elements are dropped until `predicate` returns falsey. The predicate is
  2625. * invoked with three arguments: (value, index, array).
  2626. *
  2627. * @static
  2628. * @memberOf _
  2629. * @since 3.0.0
  2630. * @category Array
  2631. * @param {Array} array The array to query.
  2632. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  2633. * @returns {Array} Returns the slice of `array`.
  2634. * @example
  2635. *
  2636. * var users = [
  2637. * { 'user': 'barney', 'active': true },
  2638. * { 'user': 'fred', 'active': false },
  2639. * { 'user': 'pebbles', 'active': false }
  2640. * ];
  2641. *
  2642. * _.dropRightWhile(users, function(o) { return !o.active; });
  2643. * // => objects for ['barney']
  2644. *
  2645. * // The `_.matches` iteratee shorthand.
  2646. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  2647. * // => objects for ['barney', 'fred']
  2648. *
  2649. * // The `_.matchesProperty` iteratee shorthand.
  2650. * _.dropRightWhile(users, ['active', false]);
  2651. * // => objects for ['barney']
  2652. *
  2653. * // The `_.property` iteratee shorthand.
  2654. * _.dropRightWhile(users, 'active');
  2655. * // => objects for ['barney', 'fred', 'pebbles']
  2656. */function dropRightWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),true,true):[];}/**
  2657. * Creates a slice of `array` excluding elements dropped from the beginning.
  2658. * Elements are dropped until `predicate` returns falsey. The predicate is
  2659. * invoked with three arguments: (value, index, array).
  2660. *
  2661. * @static
  2662. * @memberOf _
  2663. * @since 3.0.0
  2664. * @category Array
  2665. * @param {Array} array The array to query.
  2666. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  2667. * @returns {Array} Returns the slice of `array`.
  2668. * @example
  2669. *
  2670. * var users = [
  2671. * { 'user': 'barney', 'active': false },
  2672. * { 'user': 'fred', 'active': false },
  2673. * { 'user': 'pebbles', 'active': true }
  2674. * ];
  2675. *
  2676. * _.dropWhile(users, function(o) { return !o.active; });
  2677. * // => objects for ['pebbles']
  2678. *
  2679. * // The `_.matches` iteratee shorthand.
  2680. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  2681. * // => objects for ['fred', 'pebbles']
  2682. *
  2683. * // The `_.matchesProperty` iteratee shorthand.
  2684. * _.dropWhile(users, ['active', false]);
  2685. * // => objects for ['pebbles']
  2686. *
  2687. * // The `_.property` iteratee shorthand.
  2688. * _.dropWhile(users, 'active');
  2689. * // => objects for ['barney', 'fred', 'pebbles']
  2690. */function dropWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),true):[];}/**
  2691. * Fills elements of `array` with `value` from `start` up to, but not
  2692. * including, `end`.
  2693. *
  2694. * **Note:** This method mutates `array`.
  2695. *
  2696. * @static
  2697. * @memberOf _
  2698. * @since 3.2.0
  2699. * @category Array
  2700. * @param {Array} array The array to fill.
  2701. * @param {*} value The value to fill `array` with.
  2702. * @param {number} [start=0] The start position.
  2703. * @param {number} [end=array.length] The end position.
  2704. * @returns {Array} Returns `array`.
  2705. * @example
  2706. *
  2707. * var array = [1, 2, 3];
  2708. *
  2709. * _.fill(array, 'a');
  2710. * console.log(array);
  2711. * // => ['a', 'a', 'a']
  2712. *
  2713. * _.fill(Array(3), 2);
  2714. * // => [2, 2, 2]
  2715. *
  2716. * _.fill([4, 6, 8, 10], '*', 1, 3);
  2717. * // => [4, '*', '*', 10]
  2718. */function fill(array,value,start,end){var length=array==null?0:array.length;if(!length){return[];}if(start&&typeof start!=='number'&&isIterateeCall(array,value,start)){start=0;end=length;}return baseFill(array,value,start,end);}/**
  2719. * This method is like `_.find` except that it returns the index of the first
  2720. * element `predicate` returns truthy for instead of the element itself.
  2721. *
  2722. * @static
  2723. * @memberOf _
  2724. * @since 1.1.0
  2725. * @category Array
  2726. * @param {Array} array The array to inspect.
  2727. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  2728. * @param {number} [fromIndex=0] The index to search from.
  2729. * @returns {number} Returns the index of the found element, else `-1`.
  2730. * @example
  2731. *
  2732. * var users = [
  2733. * { 'user': 'barney', 'active': false },
  2734. * { 'user': 'fred', 'active': false },
  2735. * { 'user': 'pebbles', 'active': true }
  2736. * ];
  2737. *
  2738. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  2739. * // => 0
  2740. *
  2741. * // The `_.matches` iteratee shorthand.
  2742. * _.findIndex(users, { 'user': 'fred', 'active': false });
  2743. * // => 1
  2744. *
  2745. * // The `_.matchesProperty` iteratee shorthand.
  2746. * _.findIndex(users, ['active', false]);
  2747. * // => 0
  2748. *
  2749. * // The `_.property` iteratee shorthand.
  2750. * _.findIndex(users, 'active');
  2751. * // => 2
  2752. */function findIndex(array,predicate,fromIndex){var length=array==null?0:array.length;if(!length){return-1;}var index=fromIndex==null?0:toInteger(fromIndex);if(index<0){index=nativeMax(length+index,0);}return baseFindIndex(array,getIteratee(predicate,3),index);}/**
  2753. * This method is like `_.findIndex` except that it iterates over elements
  2754. * of `collection` from right to left.
  2755. *
  2756. * @static
  2757. * @memberOf _
  2758. * @since 2.0.0
  2759. * @category Array
  2760. * @param {Array} array The array to inspect.
  2761. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  2762. * @param {number} [fromIndex=array.length-1] The index to search from.
  2763. * @returns {number} Returns the index of the found element, else `-1`.
  2764. * @example
  2765. *
  2766. * var users = [
  2767. * { 'user': 'barney', 'active': true },
  2768. * { 'user': 'fred', 'active': false },
  2769. * { 'user': 'pebbles', 'active': false }
  2770. * ];
  2771. *
  2772. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  2773. * // => 2
  2774. *
  2775. * // The `_.matches` iteratee shorthand.
  2776. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  2777. * // => 0
  2778. *
  2779. * // The `_.matchesProperty` iteratee shorthand.
  2780. * _.findLastIndex(users, ['active', false]);
  2781. * // => 2
  2782. *
  2783. * // The `_.property` iteratee shorthand.
  2784. * _.findLastIndex(users, 'active');
  2785. * // => 0
  2786. */function findLastIndex(array,predicate,fromIndex){var length=array==null?0:array.length;if(!length){return-1;}var index=length-1;if(fromIndex!==undefined){index=toInteger(fromIndex);index=fromIndex<0?nativeMax(length+index,0):nativeMin(index,length-1);}return baseFindIndex(array,getIteratee(predicate,3),index,true);}/**
  2787. * Flattens `array` a single level deep.
  2788. *
  2789. * @static
  2790. * @memberOf _
  2791. * @since 0.1.0
  2792. * @category Array
  2793. * @param {Array} array The array to flatten.
  2794. * @returns {Array} Returns the new flattened array.
  2795. * @example
  2796. *
  2797. * _.flatten([1, [2, [3, [4]], 5]]);
  2798. * // => [1, 2, [3, [4]], 5]
  2799. */function flatten(array){var length=array==null?0:array.length;return length?baseFlatten(array,1):[];}/**
  2800. * Recursively flattens `array`.
  2801. *
  2802. * @static
  2803. * @memberOf _
  2804. * @since 3.0.0
  2805. * @category Array
  2806. * @param {Array} array The array to flatten.
  2807. * @returns {Array} Returns the new flattened array.
  2808. * @example
  2809. *
  2810. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  2811. * // => [1, 2, 3, 4, 5]
  2812. */function flattenDeep(array){var length=array==null?0:array.length;return length?baseFlatten(array,INFINITY):[];}/**
  2813. * Recursively flatten `array` up to `depth` times.
  2814. *
  2815. * @static
  2816. * @memberOf _
  2817. * @since 4.4.0
  2818. * @category Array
  2819. * @param {Array} array The array to flatten.
  2820. * @param {number} [depth=1] The maximum recursion depth.
  2821. * @returns {Array} Returns the new flattened array.
  2822. * @example
  2823. *
  2824. * var array = [1, [2, [3, [4]], 5]];
  2825. *
  2826. * _.flattenDepth(array, 1);
  2827. * // => [1, 2, [3, [4]], 5]
  2828. *
  2829. * _.flattenDepth(array, 2);
  2830. * // => [1, 2, 3, [4], 5]
  2831. */function flattenDepth(array,depth){var length=array==null?0:array.length;if(!length){return[];}depth=depth===undefined?1:toInteger(depth);return baseFlatten(array,depth);}/**
  2832. * The inverse of `_.toPairs`; this method returns an object composed
  2833. * from key-value `pairs`.
  2834. *
  2835. * @static
  2836. * @memberOf _
  2837. * @since 4.0.0
  2838. * @category Array
  2839. * @param {Array} pairs The key-value pairs.
  2840. * @returns {Object} Returns the new object.
  2841. * @example
  2842. *
  2843. * _.fromPairs([['a', 1], ['b', 2]]);
  2844. * // => { 'a': 1, 'b': 2 }
  2845. */function fromPairs(pairs){var index=-1,length=pairs==null?0:pairs.length,result={};while(++index<length){var pair=pairs[index];result[pair[0]]=pair[1];}return result;}/**
  2846. * Gets the first element of `array`.
  2847. *
  2848. * @static
  2849. * @memberOf _
  2850. * @since 0.1.0
  2851. * @alias first
  2852. * @category Array
  2853. * @param {Array} array The array to query.
  2854. * @returns {*} Returns the first element of `array`.
  2855. * @example
  2856. *
  2857. * _.head([1, 2, 3]);
  2858. * // => 1
  2859. *
  2860. * _.head([]);
  2861. * // => undefined
  2862. */function head(array){return array&&array.length?array[0]:undefined;}/**
  2863. * Gets the index at which the first occurrence of `value` is found in `array`
  2864. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2865. * for equality comparisons. If `fromIndex` is negative, it's used as the
  2866. * offset from the end of `array`.
  2867. *
  2868. * @static
  2869. * @memberOf _
  2870. * @since 0.1.0
  2871. * @category Array
  2872. * @param {Array} array The array to inspect.
  2873. * @param {*} value The value to search for.
  2874. * @param {number} [fromIndex=0] The index to search from.
  2875. * @returns {number} Returns the index of the matched value, else `-1`.
  2876. * @example
  2877. *
  2878. * _.indexOf([1, 2, 1, 2], 2);
  2879. * // => 1
  2880. *
  2881. * // Search from the `fromIndex`.
  2882. * _.indexOf([1, 2, 1, 2], 2, 2);
  2883. * // => 3
  2884. */function indexOf(array,value,fromIndex){var length=array==null?0:array.length;if(!length){return-1;}var index=fromIndex==null?0:toInteger(fromIndex);if(index<0){index=nativeMax(length+index,0);}return baseIndexOf(array,value,index);}/**
  2885. * Gets all but the last element of `array`.
  2886. *
  2887. * @static
  2888. * @memberOf _
  2889. * @since 0.1.0
  2890. * @category Array
  2891. * @param {Array} array The array to query.
  2892. * @returns {Array} Returns the slice of `array`.
  2893. * @example
  2894. *
  2895. * _.initial([1, 2, 3]);
  2896. * // => [1, 2]
  2897. */function initial(array){var length=array==null?0:array.length;return length?baseSlice(array,0,-1):[];}/**
  2898. * Creates an array of unique values that are included in all given arrays
  2899. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2900. * for equality comparisons. The order and references of result values are
  2901. * determined by the first array.
  2902. *
  2903. * @static
  2904. * @memberOf _
  2905. * @since 0.1.0
  2906. * @category Array
  2907. * @param {...Array} [arrays] The arrays to inspect.
  2908. * @returns {Array} Returns the new array of intersecting values.
  2909. * @example
  2910. *
  2911. * _.intersection([2, 1], [2, 3]);
  2912. * // => [2]
  2913. */var intersection=baseRest(function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[];});/**
  2914. * This method is like `_.intersection` except that it accepts `iteratee`
  2915. * which is invoked for each element of each `arrays` to generate the criterion
  2916. * by which they're compared. The order and references of result values are
  2917. * determined by the first array. The iteratee is invoked with one argument:
  2918. * (value).
  2919. *
  2920. * @static
  2921. * @memberOf _
  2922. * @since 4.0.0
  2923. * @category Array
  2924. * @param {...Array} [arrays] The arrays to inspect.
  2925. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  2926. * @returns {Array} Returns the new array of intersecting values.
  2927. * @example
  2928. *
  2929. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  2930. * // => [2.1]
  2931. *
  2932. * // The `_.property` iteratee shorthand.
  2933. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  2934. * // => [{ 'x': 1 }]
  2935. */var intersectionBy=baseRest(function(arrays){var iteratee=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);if(iteratee===last(mapped)){iteratee=undefined;}else{mapped.pop();}return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,getIteratee(iteratee,2)):[];});/**
  2936. * This method is like `_.intersection` except that it accepts `comparator`
  2937. * which is invoked to compare elements of `arrays`. The order and references
  2938. * of result values are determined by the first array. The comparator is
  2939. * invoked with two arguments: (arrVal, othVal).
  2940. *
  2941. * @static
  2942. * @memberOf _
  2943. * @since 4.0.0
  2944. * @category Array
  2945. * @param {...Array} [arrays] The arrays to inspect.
  2946. * @param {Function} [comparator] The comparator invoked per element.
  2947. * @returns {Array} Returns the new array of intersecting values.
  2948. * @example
  2949. *
  2950. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  2951. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  2952. *
  2953. * _.intersectionWith(objects, others, _.isEqual);
  2954. * // => [{ 'x': 1, 'y': 2 }]
  2955. */var intersectionWith=baseRest(function(arrays){var comparator=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);comparator=typeof comparator==='function'?comparator:undefined;if(comparator){mapped.pop();}return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,undefined,comparator):[];});/**
  2956. * Converts all elements in `array` into a string separated by `separator`.
  2957. *
  2958. * @static
  2959. * @memberOf _
  2960. * @since 4.0.0
  2961. * @category Array
  2962. * @param {Array} array The array to convert.
  2963. * @param {string} [separator=','] The element separator.
  2964. * @returns {string} Returns the joined string.
  2965. * @example
  2966. *
  2967. * _.join(['a', 'b', 'c'], '~');
  2968. * // => 'a~b~c'
  2969. */function join(array,separator){return array==null?'':nativeJoin.call(array,separator);}/**
  2970. * Gets the last element of `array`.
  2971. *
  2972. * @static
  2973. * @memberOf _
  2974. * @since 0.1.0
  2975. * @category Array
  2976. * @param {Array} array The array to query.
  2977. * @returns {*} Returns the last element of `array`.
  2978. * @example
  2979. *
  2980. * _.last([1, 2, 3]);
  2981. * // => 3
  2982. */function last(array){var length=array==null?0:array.length;return length?array[length-1]:undefined;}/**
  2983. * This method is like `_.indexOf` except that it iterates over elements of
  2984. * `array` from right to left.
  2985. *
  2986. * @static
  2987. * @memberOf _
  2988. * @since 0.1.0
  2989. * @category Array
  2990. * @param {Array} array The array to inspect.
  2991. * @param {*} value The value to search for.
  2992. * @param {number} [fromIndex=array.length-1] The index to search from.
  2993. * @returns {number} Returns the index of the matched value, else `-1`.
  2994. * @example
  2995. *
  2996. * _.lastIndexOf([1, 2, 1, 2], 2);
  2997. * // => 3
  2998. *
  2999. * // Search from the `fromIndex`.
  3000. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  3001. * // => 1
  3002. */function lastIndexOf(array,value,fromIndex){var length=array==null?0:array.length;if(!length){return-1;}var index=length;if(fromIndex!==undefined){index=toInteger(fromIndex);index=index<0?nativeMax(length+index,0):nativeMin(index,length-1);}return value===value?strictLastIndexOf(array,value,index):baseFindIndex(array,baseIsNaN,index,true);}/**
  3003. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  3004. * element from the end is returned.
  3005. *
  3006. * @static
  3007. * @memberOf _
  3008. * @since 4.11.0
  3009. * @category Array
  3010. * @param {Array} array The array to query.
  3011. * @param {number} [n=0] The index of the element to return.
  3012. * @returns {*} Returns the nth element of `array`.
  3013. * @example
  3014. *
  3015. * var array = ['a', 'b', 'c', 'd'];
  3016. *
  3017. * _.nth(array, 1);
  3018. * // => 'b'
  3019. *
  3020. * _.nth(array, -2);
  3021. * // => 'c';
  3022. */function nth(array,n){return array&&array.length?baseNth(array,toInteger(n)):undefined;}/**
  3023. * Removes all given values from `array` using
  3024. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3025. * for equality comparisons.
  3026. *
  3027. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  3028. * to remove elements from an array by predicate.
  3029. *
  3030. * @static
  3031. * @memberOf _
  3032. * @since 2.0.0
  3033. * @category Array
  3034. * @param {Array} array The array to modify.
  3035. * @param {...*} [values] The values to remove.
  3036. * @returns {Array} Returns `array`.
  3037. * @example
  3038. *
  3039. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  3040. *
  3041. * _.pull(array, 'a', 'c');
  3042. * console.log(array);
  3043. * // => ['b', 'b']
  3044. */var pull=baseRest(pullAll);/**
  3045. * This method is like `_.pull` except that it accepts an array of values to remove.
  3046. *
  3047. * **Note:** Unlike `_.difference`, this method mutates `array`.
  3048. *
  3049. * @static
  3050. * @memberOf _
  3051. * @since 4.0.0
  3052. * @category Array
  3053. * @param {Array} array The array to modify.
  3054. * @param {Array} values The values to remove.
  3055. * @returns {Array} Returns `array`.
  3056. * @example
  3057. *
  3058. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  3059. *
  3060. * _.pullAll(array, ['a', 'c']);
  3061. * console.log(array);
  3062. * // => ['b', 'b']
  3063. */function pullAll(array,values){return array&&array.length&&values&&values.length?basePullAll(array,values):array;}/**
  3064. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  3065. * invoked for each element of `array` and `values` to generate the criterion
  3066. * by which they're compared. The iteratee is invoked with one argument: (value).
  3067. *
  3068. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  3069. *
  3070. * @static
  3071. * @memberOf _
  3072. * @since 4.0.0
  3073. * @category Array
  3074. * @param {Array} array The array to modify.
  3075. * @param {Array} values The values to remove.
  3076. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  3077. * @returns {Array} Returns `array`.
  3078. * @example
  3079. *
  3080. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  3081. *
  3082. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  3083. * console.log(array);
  3084. * // => [{ 'x': 2 }]
  3085. */function pullAllBy(array,values,iteratee){return array&&array.length&&values&&values.length?basePullAll(array,values,getIteratee(iteratee,2)):array;}/**
  3086. * This method is like `_.pullAll` except that it accepts `comparator` which
  3087. * is invoked to compare elements of `array` to `values`. The comparator is
  3088. * invoked with two arguments: (arrVal, othVal).
  3089. *
  3090. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  3091. *
  3092. * @static
  3093. * @memberOf _
  3094. * @since 4.6.0
  3095. * @category Array
  3096. * @param {Array} array The array to modify.
  3097. * @param {Array} values The values to remove.
  3098. * @param {Function} [comparator] The comparator invoked per element.
  3099. * @returns {Array} Returns `array`.
  3100. * @example
  3101. *
  3102. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  3103. *
  3104. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  3105. * console.log(array);
  3106. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  3107. */function pullAllWith(array,values,comparator){return array&&array.length&&values&&values.length?basePullAll(array,values,undefined,comparator):array;}/**
  3108. * Removes elements from `array` corresponding to `indexes` and returns an
  3109. * array of removed elements.
  3110. *
  3111. * **Note:** Unlike `_.at`, this method mutates `array`.
  3112. *
  3113. * @static
  3114. * @memberOf _
  3115. * @since 3.0.0
  3116. * @category Array
  3117. * @param {Array} array The array to modify.
  3118. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  3119. * @returns {Array} Returns the new array of removed elements.
  3120. * @example
  3121. *
  3122. * var array = ['a', 'b', 'c', 'd'];
  3123. * var pulled = _.pullAt(array, [1, 3]);
  3124. *
  3125. * console.log(array);
  3126. * // => ['a', 'c']
  3127. *
  3128. * console.log(pulled);
  3129. * // => ['b', 'd']
  3130. */var pullAt=flatRest(function(array,indexes){var length=array==null?0:array.length,result=baseAt(array,indexes);basePullAt(array,arrayMap(indexes,function(index){return isIndex(index,length)?+index:index;}).sort(compareAscending));return result;});/**
  3131. * Removes all elements from `array` that `predicate` returns truthy for
  3132. * and returns an array of the removed elements. The predicate is invoked
  3133. * with three arguments: (value, index, array).
  3134. *
  3135. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  3136. * to pull elements from an array by value.
  3137. *
  3138. * @static
  3139. * @memberOf _
  3140. * @since 2.0.0
  3141. * @category Array
  3142. * @param {Array} array The array to modify.
  3143. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  3144. * @returns {Array} Returns the new array of removed elements.
  3145. * @example
  3146. *
  3147. * var array = [1, 2, 3, 4];
  3148. * var evens = _.remove(array, function(n) {
  3149. * return n % 2 == 0;
  3150. * });
  3151. *
  3152. * console.log(array);
  3153. * // => [1, 3]
  3154. *
  3155. * console.log(evens);
  3156. * // => [2, 4]
  3157. */function remove(array,predicate){var result=[];if(!(array&&array.length)){return result;}var index=-1,indexes=[],length=array.length;predicate=getIteratee(predicate,3);while(++index<length){var value=array[index];if(predicate(value,index,array)){result.push(value);indexes.push(index);}}basePullAt(array,indexes);return result;}/**
  3158. * Reverses `array` so that the first element becomes the last, the second
  3159. * element becomes the second to last, and so on.
  3160. *
  3161. * **Note:** This method mutates `array` and is based on
  3162. * [`Array#reverse`](https://mdn.io/Array/reverse).
  3163. *
  3164. * @static
  3165. * @memberOf _
  3166. * @since 4.0.0
  3167. * @category Array
  3168. * @param {Array} array The array to modify.
  3169. * @returns {Array} Returns `array`.
  3170. * @example
  3171. *
  3172. * var array = [1, 2, 3];
  3173. *
  3174. * _.reverse(array);
  3175. * // => [3, 2, 1]
  3176. *
  3177. * console.log(array);
  3178. * // => [3, 2, 1]
  3179. */function reverse(array){return array==null?array:nativeReverse.call(array);}/**
  3180. * Creates a slice of `array` from `start` up to, but not including, `end`.
  3181. *
  3182. * **Note:** This method is used instead of
  3183. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  3184. * returned.
  3185. *
  3186. * @static
  3187. * @memberOf _
  3188. * @since 3.0.0
  3189. * @category Array
  3190. * @param {Array} array The array to slice.
  3191. * @param {number} [start=0] The start position.
  3192. * @param {number} [end=array.length] The end position.
  3193. * @returns {Array} Returns the slice of `array`.
  3194. */function slice(array,start,end){var length=array==null?0:array.length;if(!length){return[];}if(end&&typeof end!=='number'&&isIterateeCall(array,start,end)){start=0;end=length;}else{start=start==null?0:toInteger(start);end=end===undefined?length:toInteger(end);}return baseSlice(array,start,end);}/**
  3195. * Uses a binary search to determine the lowest index at which `value`
  3196. * should be inserted into `array` in order to maintain its sort order.
  3197. *
  3198. * @static
  3199. * @memberOf _
  3200. * @since 0.1.0
  3201. * @category Array
  3202. * @param {Array} array The sorted array to inspect.
  3203. * @param {*} value The value to evaluate.
  3204. * @returns {number} Returns the index at which `value` should be inserted
  3205. * into `array`.
  3206. * @example
  3207. *
  3208. * _.sortedIndex([30, 50], 40);
  3209. * // => 1
  3210. */function sortedIndex(array,value){return baseSortedIndex(array,value);}/**
  3211. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  3212. * which is invoked for `value` and each element of `array` to compute their
  3213. * sort ranking. The iteratee is invoked with one argument: (value).
  3214. *
  3215. * @static
  3216. * @memberOf _
  3217. * @since 4.0.0
  3218. * @category Array
  3219. * @param {Array} array The sorted array to inspect.
  3220. * @param {*} value The value to evaluate.
  3221. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  3222. * @returns {number} Returns the index at which `value` should be inserted
  3223. * into `array`.
  3224. * @example
  3225. *
  3226. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  3227. *
  3228. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  3229. * // => 0
  3230. *
  3231. * // The `_.property` iteratee shorthand.
  3232. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  3233. * // => 0
  3234. */function sortedIndexBy(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2));}/**
  3235. * This method is like `_.indexOf` except that it performs a binary
  3236. * search on a sorted `array`.
  3237. *
  3238. * @static
  3239. * @memberOf _
  3240. * @since 4.0.0
  3241. * @category Array
  3242. * @param {Array} array The array to inspect.
  3243. * @param {*} value The value to search for.
  3244. * @returns {number} Returns the index of the matched value, else `-1`.
  3245. * @example
  3246. *
  3247. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  3248. * // => 1
  3249. */function sortedIndexOf(array,value){var length=array==null?0:array.length;if(length){var index=baseSortedIndex(array,value);if(index<length&&eq(array[index],value)){return index;}}return-1;}/**
  3250. * This method is like `_.sortedIndex` except that it returns the highest
  3251. * index at which `value` should be inserted into `array` in order to
  3252. * maintain its sort order.
  3253. *
  3254. * @static
  3255. * @memberOf _
  3256. * @since 3.0.0
  3257. * @category Array
  3258. * @param {Array} array The sorted array to inspect.
  3259. * @param {*} value The value to evaluate.
  3260. * @returns {number} Returns the index at which `value` should be inserted
  3261. * into `array`.
  3262. * @example
  3263. *
  3264. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  3265. * // => 4
  3266. */function sortedLastIndex(array,value){return baseSortedIndex(array,value,true);}/**
  3267. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  3268. * which is invoked for `value` and each element of `array` to compute their
  3269. * sort ranking. The iteratee is invoked with one argument: (value).
  3270. *
  3271. * @static
  3272. * @memberOf _
  3273. * @since 4.0.0
  3274. * @category Array
  3275. * @param {Array} array The sorted array to inspect.
  3276. * @param {*} value The value to evaluate.
  3277. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  3278. * @returns {number} Returns the index at which `value` should be inserted
  3279. * into `array`.
  3280. * @example
  3281. *
  3282. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  3283. *
  3284. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  3285. * // => 1
  3286. *
  3287. * // The `_.property` iteratee shorthand.
  3288. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  3289. * // => 1
  3290. */function sortedLastIndexBy(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2),true);}/**
  3291. * This method is like `_.lastIndexOf` except that it performs a binary
  3292. * search on a sorted `array`.
  3293. *
  3294. * @static
  3295. * @memberOf _
  3296. * @since 4.0.0
  3297. * @category Array
  3298. * @param {Array} array The array to inspect.
  3299. * @param {*} value The value to search for.
  3300. * @returns {number} Returns the index of the matched value, else `-1`.
  3301. * @example
  3302. *
  3303. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  3304. * // => 3
  3305. */function sortedLastIndexOf(array,value){var length=array==null?0:array.length;if(length){var index=baseSortedIndex(array,value,true)-1;if(eq(array[index],value)){return index;}}return-1;}/**
  3306. * This method is like `_.uniq` except that it's designed and optimized
  3307. * for sorted arrays.
  3308. *
  3309. * @static
  3310. * @memberOf _
  3311. * @since 4.0.0
  3312. * @category Array
  3313. * @param {Array} array The array to inspect.
  3314. * @returns {Array} Returns the new duplicate free array.
  3315. * @example
  3316. *
  3317. * _.sortedUniq([1, 1, 2]);
  3318. * // => [1, 2]
  3319. */function sortedUniq(array){return array&&array.length?baseSortedUniq(array):[];}/**
  3320. * This method is like `_.uniqBy` except that it's designed and optimized
  3321. * for sorted arrays.
  3322. *
  3323. * @static
  3324. * @memberOf _
  3325. * @since 4.0.0
  3326. * @category Array
  3327. * @param {Array} array The array to inspect.
  3328. * @param {Function} [iteratee] The iteratee invoked per element.
  3329. * @returns {Array} Returns the new duplicate free array.
  3330. * @example
  3331. *
  3332. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  3333. * // => [1.1, 2.3]
  3334. */function sortedUniqBy(array,iteratee){return array&&array.length?baseSortedUniq(array,getIteratee(iteratee,2)):[];}/**
  3335. * Gets all but the first element of `array`.
  3336. *
  3337. * @static
  3338. * @memberOf _
  3339. * @since 4.0.0
  3340. * @category Array
  3341. * @param {Array} array The array to query.
  3342. * @returns {Array} Returns the slice of `array`.
  3343. * @example
  3344. *
  3345. * _.tail([1, 2, 3]);
  3346. * // => [2, 3]
  3347. */function tail(array){var length=array==null?0:array.length;return length?baseSlice(array,1,length):[];}/**
  3348. * Creates a slice of `array` with `n` elements taken from the beginning.
  3349. *
  3350. * @static
  3351. * @memberOf _
  3352. * @since 0.1.0
  3353. * @category Array
  3354. * @param {Array} array The array to query.
  3355. * @param {number} [n=1] The number of elements to take.
  3356. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  3357. * @returns {Array} Returns the slice of `array`.
  3358. * @example
  3359. *
  3360. * _.take([1, 2, 3]);
  3361. * // => [1]
  3362. *
  3363. * _.take([1, 2, 3], 2);
  3364. * // => [1, 2]
  3365. *
  3366. * _.take([1, 2, 3], 5);
  3367. * // => [1, 2, 3]
  3368. *
  3369. * _.take([1, 2, 3], 0);
  3370. * // => []
  3371. */function take(array,n,guard){if(!(array&&array.length)){return[];}n=guard||n===undefined?1:toInteger(n);return baseSlice(array,0,n<0?0:n);}/**
  3372. * Creates a slice of `array` with `n` elements taken from the end.
  3373. *
  3374. * @static
  3375. * @memberOf _
  3376. * @since 3.0.0
  3377. * @category Array
  3378. * @param {Array} array The array to query.
  3379. * @param {number} [n=1] The number of elements to take.
  3380. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  3381. * @returns {Array} Returns the slice of `array`.
  3382. * @example
  3383. *
  3384. * _.takeRight([1, 2, 3]);
  3385. * // => [3]
  3386. *
  3387. * _.takeRight([1, 2, 3], 2);
  3388. * // => [2, 3]
  3389. *
  3390. * _.takeRight([1, 2, 3], 5);
  3391. * // => [1, 2, 3]
  3392. *
  3393. * _.takeRight([1, 2, 3], 0);
  3394. * // => []
  3395. */function takeRight(array,n,guard){var length=array==null?0:array.length;if(!length){return[];}n=guard||n===undefined?1:toInteger(n);n=length-n;return baseSlice(array,n<0?0:n,length);}/**
  3396. * Creates a slice of `array` with elements taken from the end. Elements are
  3397. * taken until `predicate` returns falsey. The predicate is invoked with
  3398. * three arguments: (value, index, array).
  3399. *
  3400. * @static
  3401. * @memberOf _
  3402. * @since 3.0.0
  3403. * @category Array
  3404. * @param {Array} array The array to query.
  3405. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  3406. * @returns {Array} Returns the slice of `array`.
  3407. * @example
  3408. *
  3409. * var users = [
  3410. * { 'user': 'barney', 'active': true },
  3411. * { 'user': 'fred', 'active': false },
  3412. * { 'user': 'pebbles', 'active': false }
  3413. * ];
  3414. *
  3415. * _.takeRightWhile(users, function(o) { return !o.active; });
  3416. * // => objects for ['fred', 'pebbles']
  3417. *
  3418. * // The `_.matches` iteratee shorthand.
  3419. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  3420. * // => objects for ['pebbles']
  3421. *
  3422. * // The `_.matchesProperty` iteratee shorthand.
  3423. * _.takeRightWhile(users, ['active', false]);
  3424. * // => objects for ['fred', 'pebbles']
  3425. *
  3426. * // The `_.property` iteratee shorthand.
  3427. * _.takeRightWhile(users, 'active');
  3428. * // => []
  3429. */function takeRightWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),false,true):[];}/**
  3430. * Creates a slice of `array` with elements taken from the beginning. Elements
  3431. * are taken until `predicate` returns falsey. The predicate is invoked with
  3432. * three arguments: (value, index, array).
  3433. *
  3434. * @static
  3435. * @memberOf _
  3436. * @since 3.0.0
  3437. * @category Array
  3438. * @param {Array} array The array to query.
  3439. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  3440. * @returns {Array} Returns the slice of `array`.
  3441. * @example
  3442. *
  3443. * var users = [
  3444. * { 'user': 'barney', 'active': false },
  3445. * { 'user': 'fred', 'active': false },
  3446. * { 'user': 'pebbles', 'active': true }
  3447. * ];
  3448. *
  3449. * _.takeWhile(users, function(o) { return !o.active; });
  3450. * // => objects for ['barney', 'fred']
  3451. *
  3452. * // The `_.matches` iteratee shorthand.
  3453. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  3454. * // => objects for ['barney']
  3455. *
  3456. * // The `_.matchesProperty` iteratee shorthand.
  3457. * _.takeWhile(users, ['active', false]);
  3458. * // => objects for ['barney', 'fred']
  3459. *
  3460. * // The `_.property` iteratee shorthand.
  3461. * _.takeWhile(users, 'active');
  3462. * // => []
  3463. */function takeWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3)):[];}/**
  3464. * Creates an array of unique values, in order, from all given arrays using
  3465. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3466. * for equality comparisons.
  3467. *
  3468. * @static
  3469. * @memberOf _
  3470. * @since 0.1.0
  3471. * @category Array
  3472. * @param {...Array} [arrays] The arrays to inspect.
  3473. * @returns {Array} Returns the new array of combined values.
  3474. * @example
  3475. *
  3476. * _.union([2], [1, 2]);
  3477. * // => [2, 1]
  3478. */var union=baseRest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,true));});/**
  3479. * This method is like `_.union` except that it accepts `iteratee` which is
  3480. * invoked for each element of each `arrays` to generate the criterion by
  3481. * which uniqueness is computed. Result values are chosen from the first
  3482. * array in which the value occurs. The iteratee is invoked with one argument:
  3483. * (value).
  3484. *
  3485. * @static
  3486. * @memberOf _
  3487. * @since 4.0.0
  3488. * @category Array
  3489. * @param {...Array} [arrays] The arrays to inspect.
  3490. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  3491. * @returns {Array} Returns the new array of combined values.
  3492. * @example
  3493. *
  3494. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  3495. * // => [2.1, 1.2]
  3496. *
  3497. * // The `_.property` iteratee shorthand.
  3498. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  3499. * // => [{ 'x': 1 }, { 'x': 2 }]
  3500. */var unionBy=baseRest(function(arrays){var iteratee=last(arrays);if(isArrayLikeObject(iteratee)){iteratee=undefined;}return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,true),getIteratee(iteratee,2));});/**
  3501. * This method is like `_.union` except that it accepts `comparator` which
  3502. * is invoked to compare elements of `arrays`. Result values are chosen from
  3503. * the first array in which the value occurs. The comparator is invoked
  3504. * with two arguments: (arrVal, othVal).
  3505. *
  3506. * @static
  3507. * @memberOf _
  3508. * @since 4.0.0
  3509. * @category Array
  3510. * @param {...Array} [arrays] The arrays to inspect.
  3511. * @param {Function} [comparator] The comparator invoked per element.
  3512. * @returns {Array} Returns the new array of combined values.
  3513. * @example
  3514. *
  3515. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  3516. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  3517. *
  3518. * _.unionWith(objects, others, _.isEqual);
  3519. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  3520. */var unionWith=baseRest(function(arrays){var comparator=last(arrays);comparator=typeof comparator==='function'?comparator:undefined;return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,true),undefined,comparator);});/**
  3521. * Creates a duplicate-free version of an array, using
  3522. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3523. * for equality comparisons, in which only the first occurrence of each element
  3524. * is kept. The order of result values is determined by the order they occur
  3525. * in the array.
  3526. *
  3527. * @static
  3528. * @memberOf _
  3529. * @since 0.1.0
  3530. * @category Array
  3531. * @param {Array} array The array to inspect.
  3532. * @returns {Array} Returns the new duplicate free array.
  3533. * @example
  3534. *
  3535. * _.uniq([2, 1, 2]);
  3536. * // => [2, 1]
  3537. */function uniq(array){return array&&array.length?baseUniq(array):[];}/**
  3538. * This method is like `_.uniq` except that it accepts `iteratee` which is
  3539. * invoked for each element in `array` to generate the criterion by which
  3540. * uniqueness is computed. The order of result values is determined by the
  3541. * order they occur in the array. The iteratee is invoked with one argument:
  3542. * (value).
  3543. *
  3544. * @static
  3545. * @memberOf _
  3546. * @since 4.0.0
  3547. * @category Array
  3548. * @param {Array} array The array to inspect.
  3549. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  3550. * @returns {Array} Returns the new duplicate free array.
  3551. * @example
  3552. *
  3553. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  3554. * // => [2.1, 1.2]
  3555. *
  3556. * // The `_.property` iteratee shorthand.
  3557. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  3558. * // => [{ 'x': 1 }, { 'x': 2 }]
  3559. */function uniqBy(array,iteratee){return array&&array.length?baseUniq(array,getIteratee(iteratee,2)):[];}/**
  3560. * This method is like `_.uniq` except that it accepts `comparator` which
  3561. * is invoked to compare elements of `array`. The order of result values is
  3562. * determined by the order they occur in the array.The comparator is invoked
  3563. * with two arguments: (arrVal, othVal).
  3564. *
  3565. * @static
  3566. * @memberOf _
  3567. * @since 4.0.0
  3568. * @category Array
  3569. * @param {Array} array The array to inspect.
  3570. * @param {Function} [comparator] The comparator invoked per element.
  3571. * @returns {Array} Returns the new duplicate free array.
  3572. * @example
  3573. *
  3574. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  3575. *
  3576. * _.uniqWith(objects, _.isEqual);
  3577. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  3578. */function uniqWith(array,comparator){comparator=typeof comparator==='function'?comparator:undefined;return array&&array.length?baseUniq(array,undefined,comparator):[];}/**
  3579. * This method is like `_.zip` except that it accepts an array of grouped
  3580. * elements and creates an array regrouping the elements to their pre-zip
  3581. * configuration.
  3582. *
  3583. * @static
  3584. * @memberOf _
  3585. * @since 1.2.0
  3586. * @category Array
  3587. * @param {Array} array The array of grouped elements to process.
  3588. * @returns {Array} Returns the new array of regrouped elements.
  3589. * @example
  3590. *
  3591. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  3592. * // => [['a', 1, true], ['b', 2, false]]
  3593. *
  3594. * _.unzip(zipped);
  3595. * // => [['a', 'b'], [1, 2], [true, false]]
  3596. */function unzip(array){if(!(array&&array.length)){return[];}var length=0;array=arrayFilter(array,function(group){if(isArrayLikeObject(group)){length=nativeMax(group.length,length);return true;}});return baseTimes(length,function(index){return arrayMap(array,baseProperty(index));});}/**
  3597. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  3598. * how regrouped values should be combined. The iteratee is invoked with the
  3599. * elements of each group: (...group).
  3600. *
  3601. * @static
  3602. * @memberOf _
  3603. * @since 3.8.0
  3604. * @category Array
  3605. * @param {Array} array The array of grouped elements to process.
  3606. * @param {Function} [iteratee=_.identity] The function to combine
  3607. * regrouped values.
  3608. * @returns {Array} Returns the new array of regrouped elements.
  3609. * @example
  3610. *
  3611. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  3612. * // => [[1, 10, 100], [2, 20, 200]]
  3613. *
  3614. * _.unzipWith(zipped, _.add);
  3615. * // => [3, 30, 300]
  3616. */function unzipWith(array,iteratee){if(!(array&&array.length)){return[];}var result=unzip(array);if(iteratee==null){return result;}return arrayMap(result,function(group){return apply(iteratee,undefined,group);});}/**
  3617. * Creates an array excluding all given values using
  3618. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3619. * for equality comparisons.
  3620. *
  3621. * **Note:** Unlike `_.pull`, this method returns a new array.
  3622. *
  3623. * @static
  3624. * @memberOf _
  3625. * @since 0.1.0
  3626. * @category Array
  3627. * @param {Array} array The array to inspect.
  3628. * @param {...*} [values] The values to exclude.
  3629. * @returns {Array} Returns the new array of filtered values.
  3630. * @see _.difference, _.xor
  3631. * @example
  3632. *
  3633. * _.without([2, 1, 2, 3], 1, 2);
  3634. * // => [3]
  3635. */var without=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,values):[];});/**
  3636. * Creates an array of unique values that is the
  3637. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  3638. * of the given arrays. The order of result values is determined by the order
  3639. * they occur in the arrays.
  3640. *
  3641. * @static
  3642. * @memberOf _
  3643. * @since 2.4.0
  3644. * @category Array
  3645. * @param {...Array} [arrays] The arrays to inspect.
  3646. * @returns {Array} Returns the new array of filtered values.
  3647. * @see _.difference, _.without
  3648. * @example
  3649. *
  3650. * _.xor([2, 1], [2, 3]);
  3651. * // => [1, 3]
  3652. */var xor=baseRest(function(arrays){return baseXor(arrayFilter(arrays,isArrayLikeObject));});/**
  3653. * This method is like `_.xor` except that it accepts `iteratee` which is
  3654. * invoked for each element of each `arrays` to generate the criterion by
  3655. * which by which they're compared. The order of result values is determined
  3656. * by the order they occur in the arrays. The iteratee is invoked with one
  3657. * argument: (value).
  3658. *
  3659. * @static
  3660. * @memberOf _
  3661. * @since 4.0.0
  3662. * @category Array
  3663. * @param {...Array} [arrays] The arrays to inspect.
  3664. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  3665. * @returns {Array} Returns the new array of filtered values.
  3666. * @example
  3667. *
  3668. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  3669. * // => [1.2, 3.4]
  3670. *
  3671. * // The `_.property` iteratee shorthand.
  3672. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  3673. * // => [{ 'x': 2 }]
  3674. */var xorBy=baseRest(function(arrays){var iteratee=last(arrays);if(isArrayLikeObject(iteratee)){iteratee=undefined;}return baseXor(arrayFilter(arrays,isArrayLikeObject),getIteratee(iteratee,2));});/**
  3675. * This method is like `_.xor` except that it accepts `comparator` which is
  3676. * invoked to compare elements of `arrays`. The order of result values is
  3677. * determined by the order they occur in the arrays. The comparator is invoked
  3678. * with two arguments: (arrVal, othVal).
  3679. *
  3680. * @static
  3681. * @memberOf _
  3682. * @since 4.0.0
  3683. * @category Array
  3684. * @param {...Array} [arrays] The arrays to inspect.
  3685. * @param {Function} [comparator] The comparator invoked per element.
  3686. * @returns {Array} Returns the new array of filtered values.
  3687. * @example
  3688. *
  3689. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  3690. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  3691. *
  3692. * _.xorWith(objects, others, _.isEqual);
  3693. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  3694. */var xorWith=baseRest(function(arrays){var comparator=last(arrays);comparator=typeof comparator==='function'?comparator:undefined;return baseXor(arrayFilter(arrays,isArrayLikeObject),undefined,comparator);});/**
  3695. * Creates an array of grouped elements, the first of which contains the
  3696. * first elements of the given arrays, the second of which contains the
  3697. * second elements of the given arrays, and so on.
  3698. *
  3699. * @static
  3700. * @memberOf _
  3701. * @since 0.1.0
  3702. * @category Array
  3703. * @param {...Array} [arrays] The arrays to process.
  3704. * @returns {Array} Returns the new array of grouped elements.
  3705. * @example
  3706. *
  3707. * _.zip(['a', 'b'], [1, 2], [true, false]);
  3708. * // => [['a', 1, true], ['b', 2, false]]
  3709. */var zip=baseRest(unzip);/**
  3710. * This method is like `_.fromPairs` except that it accepts two arrays,
  3711. * one of property identifiers and one of corresponding values.
  3712. *
  3713. * @static
  3714. * @memberOf _
  3715. * @since 0.4.0
  3716. * @category Array
  3717. * @param {Array} [props=[]] The property identifiers.
  3718. * @param {Array} [values=[]] The property values.
  3719. * @returns {Object} Returns the new object.
  3720. * @example
  3721. *
  3722. * _.zipObject(['a', 'b'], [1, 2]);
  3723. * // => { 'a': 1, 'b': 2 }
  3724. */function zipObject(props,values){return baseZipObject(props||[],values||[],assignValue);}/**
  3725. * This method is like `_.zipObject` except that it supports property paths.
  3726. *
  3727. * @static
  3728. * @memberOf _
  3729. * @since 4.1.0
  3730. * @category Array
  3731. * @param {Array} [props=[]] The property identifiers.
  3732. * @param {Array} [values=[]] The property values.
  3733. * @returns {Object} Returns the new object.
  3734. * @example
  3735. *
  3736. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  3737. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  3738. */function zipObjectDeep(props,values){return baseZipObject(props||[],values||[],baseSet);}/**
  3739. * This method is like `_.zip` except that it accepts `iteratee` to specify
  3740. * how grouped values should be combined. The iteratee is invoked with the
  3741. * elements of each group: (...group).
  3742. *
  3743. * @static
  3744. * @memberOf _
  3745. * @since 3.8.0
  3746. * @category Array
  3747. * @param {...Array} [arrays] The arrays to process.
  3748. * @param {Function} [iteratee=_.identity] The function to combine
  3749. * grouped values.
  3750. * @returns {Array} Returns the new array of grouped elements.
  3751. * @example
  3752. *
  3753. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  3754. * return a + b + c;
  3755. * });
  3756. * // => [111, 222]
  3757. */var zipWith=baseRest(function(arrays){var length=arrays.length,iteratee=length>1?arrays[length-1]:undefined;iteratee=typeof iteratee==='function'?(arrays.pop(),iteratee):undefined;return unzipWith(arrays,iteratee);});/* ------------------------------------------------------------------------*//**
  3758. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  3759. * chain sequences enabled. The result of such sequences must be unwrapped
  3760. * with `_#value`.
  3761. *
  3762. * @static
  3763. * @memberOf _
  3764. * @since 1.3.0
  3765. * @category Seq
  3766. * @param {*} value The value to wrap.
  3767. * @returns {Object} Returns the new `lodash` wrapper instance.
  3768. * @example
  3769. *
  3770. * var users = [
  3771. * { 'user': 'barney', 'age': 36 },
  3772. * { 'user': 'fred', 'age': 40 },
  3773. * { 'user': 'pebbles', 'age': 1 }
  3774. * ];
  3775. *
  3776. * var youngest = _
  3777. * .chain(users)
  3778. * .sortBy('age')
  3779. * .map(function(o) {
  3780. * return o.user + ' is ' + o.age;
  3781. * })
  3782. * .head()
  3783. * .value();
  3784. * // => 'pebbles is 1'
  3785. */function chain(value){var result=lodash(value);result.__chain__=true;return result;}/**
  3786. * This method invokes `interceptor` and returns `value`. The interceptor
  3787. * is invoked with one argument; (value). The purpose of this method is to
  3788. * "tap into" a method chain sequence in order to modify intermediate results.
  3789. *
  3790. * @static
  3791. * @memberOf _
  3792. * @since 0.1.0
  3793. * @category Seq
  3794. * @param {*} value The value to provide to `interceptor`.
  3795. * @param {Function} interceptor The function to invoke.
  3796. * @returns {*} Returns `value`.
  3797. * @example
  3798. *
  3799. * _([1, 2, 3])
  3800. * .tap(function(array) {
  3801. * // Mutate input array.
  3802. * array.pop();
  3803. * })
  3804. * .reverse()
  3805. * .value();
  3806. * // => [2, 1]
  3807. */function tap(value,interceptor){interceptor(value);return value;}/**
  3808. * This method is like `_.tap` except that it returns the result of `interceptor`.
  3809. * The purpose of this method is to "pass thru" values replacing intermediate
  3810. * results in a method chain sequence.
  3811. *
  3812. * @static
  3813. * @memberOf _
  3814. * @since 3.0.0
  3815. * @category Seq
  3816. * @param {*} value The value to provide to `interceptor`.
  3817. * @param {Function} interceptor The function to invoke.
  3818. * @returns {*} Returns the result of `interceptor`.
  3819. * @example
  3820. *
  3821. * _(' abc ')
  3822. * .chain()
  3823. * .trim()
  3824. * .thru(function(value) {
  3825. * return [value];
  3826. * })
  3827. * .value();
  3828. * // => ['abc']
  3829. */function thru(value,interceptor){return interceptor(value);}/**
  3830. * This method is the wrapper version of `_.at`.
  3831. *
  3832. * @name at
  3833. * @memberOf _
  3834. * @since 1.0.0
  3835. * @category Seq
  3836. * @param {...(string|string[])} [paths] The property paths to pick.
  3837. * @returns {Object} Returns the new `lodash` wrapper instance.
  3838. * @example
  3839. *
  3840. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  3841. *
  3842. * _(object).at(['a[0].b.c', 'a[1]']).value();
  3843. * // => [3, 4]
  3844. */var wrapperAt=flatRest(function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function interceptor(object){return baseAt(object,paths);};if(length>1||this.__actions__.length||!(value instanceof LazyWrapper)||!isIndex(start)){return this.thru(interceptor);}value=value.slice(start,+start+(length?1:0));value.__actions__.push({func:thru,args:[interceptor],thisArg:undefined});return new LodashWrapper(value,this.__chain__).thru(function(array){if(length&&!array.length){array.push(undefined);}return array;});});/**
  3845. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  3846. *
  3847. * @name chain
  3848. * @memberOf _
  3849. * @since 0.1.0
  3850. * @category Seq
  3851. * @returns {Object} Returns the new `lodash` wrapper instance.
  3852. * @example
  3853. *
  3854. * var users = [
  3855. * { 'user': 'barney', 'age': 36 },
  3856. * { 'user': 'fred', 'age': 40 }
  3857. * ];
  3858. *
  3859. * // A sequence without explicit chaining.
  3860. * _(users).head();
  3861. * // => { 'user': 'barney', 'age': 36 }
  3862. *
  3863. * // A sequence with explicit chaining.
  3864. * _(users)
  3865. * .chain()
  3866. * .head()
  3867. * .pick('user')
  3868. * .value();
  3869. * // => { 'user': 'barney' }
  3870. */function wrapperChain(){return chain(this);}/**
  3871. * Executes the chain sequence and returns the wrapped result.
  3872. *
  3873. * @name commit
  3874. * @memberOf _
  3875. * @since 3.2.0
  3876. * @category Seq
  3877. * @returns {Object} Returns the new `lodash` wrapper instance.
  3878. * @example
  3879. *
  3880. * var array = [1, 2];
  3881. * var wrapped = _(array).push(3);
  3882. *
  3883. * console.log(array);
  3884. * // => [1, 2]
  3885. *
  3886. * wrapped = wrapped.commit();
  3887. * console.log(array);
  3888. * // => [1, 2, 3]
  3889. *
  3890. * wrapped.last();
  3891. * // => 3
  3892. *
  3893. * console.log(array);
  3894. * // => [1, 2, 3]
  3895. */function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__);}/**
  3896. * Gets the next value on a wrapped object following the
  3897. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  3898. *
  3899. * @name next
  3900. * @memberOf _
  3901. * @since 4.0.0
  3902. * @category Seq
  3903. * @returns {Object} Returns the next iterator value.
  3904. * @example
  3905. *
  3906. * var wrapped = _([1, 2]);
  3907. *
  3908. * wrapped.next();
  3909. * // => { 'done': false, 'value': 1 }
  3910. *
  3911. * wrapped.next();
  3912. * // => { 'done': false, 'value': 2 }
  3913. *
  3914. * wrapped.next();
  3915. * // => { 'done': true, 'value': undefined }
  3916. */function wrapperNext(){if(this.__values__===undefined){this.__values__=toArray(this.value());}var done=this.__index__>=this.__values__.length,value=done?undefined:this.__values__[this.__index__++];return{done:done,value:value};}/**
  3917. * Enables the wrapper to be iterable.
  3918. *
  3919. * @name Symbol.iterator
  3920. * @memberOf _
  3921. * @since 4.0.0
  3922. * @category Seq
  3923. * @returns {Object} Returns the wrapper object.
  3924. * @example
  3925. *
  3926. * var wrapped = _([1, 2]);
  3927. *
  3928. * wrapped[Symbol.iterator]() === wrapped;
  3929. * // => true
  3930. *
  3931. * Array.from(wrapped);
  3932. * // => [1, 2]
  3933. */function wrapperToIterator(){return this;}/**
  3934. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  3935. *
  3936. * @name plant
  3937. * @memberOf _
  3938. * @since 3.2.0
  3939. * @category Seq
  3940. * @param {*} value The value to plant.
  3941. * @returns {Object} Returns the new `lodash` wrapper instance.
  3942. * @example
  3943. *
  3944. * function square(n) {
  3945. * return n * n;
  3946. * }
  3947. *
  3948. * var wrapped = _([1, 2]).map(square);
  3949. * var other = wrapped.plant([3, 4]);
  3950. *
  3951. * other.value();
  3952. * // => [9, 16]
  3953. *
  3954. * wrapped.value();
  3955. * // => [1, 4]
  3956. */function wrapperPlant(value){var result,parent=this;while(parent instanceof baseLodash){var clone=wrapperClone(parent);clone.__index__=0;clone.__values__=undefined;if(result){previous.__wrapped__=clone;}else{result=clone;}var previous=clone;parent=parent.__wrapped__;}previous.__wrapped__=value;return result;}/**
  3957. * This method is the wrapper version of `_.reverse`.
  3958. *
  3959. * **Note:** This method mutates the wrapped array.
  3960. *
  3961. * @name reverse
  3962. * @memberOf _
  3963. * @since 0.1.0
  3964. * @category Seq
  3965. * @returns {Object} Returns the new `lodash` wrapper instance.
  3966. * @example
  3967. *
  3968. * var array = [1, 2, 3];
  3969. *
  3970. * _(array).reverse().value()
  3971. * // => [3, 2, 1]
  3972. *
  3973. * console.log(array);
  3974. * // => [3, 2, 1]
  3975. */function wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;if(this.__actions__.length){wrapped=new LazyWrapper(this);}wrapped=wrapped.reverse();wrapped.__actions__.push({func:thru,args:[reverse],thisArg:undefined});return new LodashWrapper(wrapped,this.__chain__);}return this.thru(reverse);}/**
  3976. * Executes the chain sequence to resolve the unwrapped value.
  3977. *
  3978. * @name value
  3979. * @memberOf _
  3980. * @since 0.1.0
  3981. * @alias toJSON, valueOf
  3982. * @category Seq
  3983. * @returns {*} Returns the resolved unwrapped value.
  3984. * @example
  3985. *
  3986. * _([1, 2, 3]).value();
  3987. * // => [1, 2, 3]
  3988. */function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__);}/* ------------------------------------------------------------------------*//**
  3989. * Creates an object composed of keys generated from the results of running
  3990. * each element of `collection` thru `iteratee`. The corresponding value of
  3991. * each key is the number of times the key was returned by `iteratee`. The
  3992. * iteratee is invoked with one argument: (value).
  3993. *
  3994. * @static
  3995. * @memberOf _
  3996. * @since 0.5.0
  3997. * @category Collection
  3998. * @param {Array|Object} collection The collection to iterate over.
  3999. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  4000. * @returns {Object} Returns the composed aggregate object.
  4001. * @example
  4002. *
  4003. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  4004. * // => { '4': 1, '6': 2 }
  4005. *
  4006. * // The `_.property` iteratee shorthand.
  4007. * _.countBy(['one', 'two', 'three'], 'length');
  4008. * // => { '3': 2, '5': 1 }
  4009. */var countBy=createAggregator(function(result,value,key){if(hasOwnProperty.call(result,key)){++result[key];}else{baseAssignValue(result,key,1);}});/**
  4010. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  4011. * Iteration is stopped once `predicate` returns falsey. The predicate is
  4012. * invoked with three arguments: (value, index|key, collection).
  4013. *
  4014. * **Note:** This method returns `true` for
  4015. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  4016. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  4017. * elements of empty collections.
  4018. *
  4019. * @static
  4020. * @memberOf _
  4021. * @since 0.1.0
  4022. * @category Collection
  4023. * @param {Array|Object} collection The collection to iterate over.
  4024. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  4025. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  4026. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  4027. * else `false`.
  4028. * @example
  4029. *
  4030. * _.every([true, 1, null, 'yes'], Boolean);
  4031. * // => false
  4032. *
  4033. * var users = [
  4034. * { 'user': 'barney', 'age': 36, 'active': false },
  4035. * { 'user': 'fred', 'age': 40, 'active': false }
  4036. * ];
  4037. *
  4038. * // The `_.matches` iteratee shorthand.
  4039. * _.every(users, { 'user': 'barney', 'active': false });
  4040. * // => false
  4041. *
  4042. * // The `_.matchesProperty` iteratee shorthand.
  4043. * _.every(users, ['active', false]);
  4044. * // => true
  4045. *
  4046. * // The `_.property` iteratee shorthand.
  4047. * _.every(users, 'active');
  4048. * // => false
  4049. */function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;if(guard&&isIterateeCall(collection,predicate,guard)){predicate=undefined;}return func(collection,getIteratee(predicate,3));}/**
  4050. * Iterates over elements of `collection`, returning an array of all elements
  4051. * `predicate` returns truthy for. The predicate is invoked with three
  4052. * arguments: (value, index|key, collection).
  4053. *
  4054. * **Note:** Unlike `_.remove`, this method returns a new array.
  4055. *
  4056. * @static
  4057. * @memberOf _
  4058. * @since 0.1.0
  4059. * @category Collection
  4060. * @param {Array|Object} collection The collection to iterate over.
  4061. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  4062. * @returns {Array} Returns the new filtered array.
  4063. * @see _.reject
  4064. * @example
  4065. *
  4066. * var users = [
  4067. * { 'user': 'barney', 'age': 36, 'active': true },
  4068. * { 'user': 'fred', 'age': 40, 'active': false }
  4069. * ];
  4070. *
  4071. * _.filter(users, function(o) { return !o.active; });
  4072. * // => objects for ['fred']
  4073. *
  4074. * // The `_.matches` iteratee shorthand.
  4075. * _.filter(users, { 'age': 36, 'active': true });
  4076. * // => objects for ['barney']
  4077. *
  4078. * // The `_.matchesProperty` iteratee shorthand.
  4079. * _.filter(users, ['active', false]);
  4080. * // => objects for ['fred']
  4081. *
  4082. * // The `_.property` iteratee shorthand.
  4083. * _.filter(users, 'active');
  4084. * // => objects for ['barney']
  4085. */function filter(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,getIteratee(predicate,3));}/**
  4086. * Iterates over elements of `collection`, returning the first element
  4087. * `predicate` returns truthy for. The predicate is invoked with three
  4088. * arguments: (value, index|key, collection).
  4089. *
  4090. * @static
  4091. * @memberOf _
  4092. * @since 0.1.0
  4093. * @category Collection
  4094. * @param {Array|Object} collection The collection to inspect.
  4095. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  4096. * @param {number} [fromIndex=0] The index to search from.
  4097. * @returns {*} Returns the matched element, else `undefined`.
  4098. * @example
  4099. *
  4100. * var users = [
  4101. * { 'user': 'barney', 'age': 36, 'active': true },
  4102. * { 'user': 'fred', 'age': 40, 'active': false },
  4103. * { 'user': 'pebbles', 'age': 1, 'active': true }
  4104. * ];
  4105. *
  4106. * _.find(users, function(o) { return o.age < 40; });
  4107. * // => object for 'barney'
  4108. *
  4109. * // The `_.matches` iteratee shorthand.
  4110. * _.find(users, { 'age': 1, 'active': true });
  4111. * // => object for 'pebbles'
  4112. *
  4113. * // The `_.matchesProperty` iteratee shorthand.
  4114. * _.find(users, ['active', false]);
  4115. * // => object for 'fred'
  4116. *
  4117. * // The `_.property` iteratee shorthand.
  4118. * _.find(users, 'active');
  4119. * // => object for 'barney'
  4120. */var find=createFind(findIndex);/**
  4121. * This method is like `_.find` except that it iterates over elements of
  4122. * `collection` from right to left.
  4123. *
  4124. * @static
  4125. * @memberOf _
  4126. * @since 2.0.0
  4127. * @category Collection
  4128. * @param {Array|Object} collection The collection to inspect.
  4129. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  4130. * @param {number} [fromIndex=collection.length-1] The index to search from.
  4131. * @returns {*} Returns the matched element, else `undefined`.
  4132. * @example
  4133. *
  4134. * _.findLast([1, 2, 3, 4], function(n) {
  4135. * return n % 2 == 1;
  4136. * });
  4137. * // => 3
  4138. */var findLast=createFind(findLastIndex);/**
  4139. * Creates a flattened array of values by running each element in `collection`
  4140. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  4141. * with three arguments: (value, index|key, collection).
  4142. *
  4143. * @static
  4144. * @memberOf _
  4145. * @since 4.0.0
  4146. * @category Collection
  4147. * @param {Array|Object} collection The collection to iterate over.
  4148. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  4149. * @returns {Array} Returns the new flattened array.
  4150. * @example
  4151. *
  4152. * function duplicate(n) {
  4153. * return [n, n];
  4154. * }
  4155. *
  4156. * _.flatMap([1, 2], duplicate);
  4157. * // => [1, 1, 2, 2]
  4158. */function flatMap(collection,iteratee){return baseFlatten(map(collection,iteratee),1);}/**
  4159. * This method is like `_.flatMap` except that it recursively flattens the
  4160. * mapped results.
  4161. *
  4162. * @static
  4163. * @memberOf _
  4164. * @since 4.7.0
  4165. * @category Collection
  4166. * @param {Array|Object} collection The collection to iterate over.
  4167. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  4168. * @returns {Array} Returns the new flattened array.
  4169. * @example
  4170. *
  4171. * function duplicate(n) {
  4172. * return [[[n, n]]];
  4173. * }
  4174. *
  4175. * _.flatMapDeep([1, 2], duplicate);
  4176. * // => [1, 1, 2, 2]
  4177. */function flatMapDeep(collection,iteratee){return baseFlatten(map(collection,iteratee),INFINITY);}/**
  4178. * This method is like `_.flatMap` except that it recursively flattens the
  4179. * mapped results up to `depth` times.
  4180. *
  4181. * @static
  4182. * @memberOf _
  4183. * @since 4.7.0
  4184. * @category Collection
  4185. * @param {Array|Object} collection The collection to iterate over.
  4186. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  4187. * @param {number} [depth=1] The maximum recursion depth.
  4188. * @returns {Array} Returns the new flattened array.
  4189. * @example
  4190. *
  4191. * function duplicate(n) {
  4192. * return [[[n, n]]];
  4193. * }
  4194. *
  4195. * _.flatMapDepth([1, 2], duplicate, 2);
  4196. * // => [[1, 1], [2, 2]]
  4197. */function flatMapDepth(collection,iteratee,depth){depth=depth===undefined?1:toInteger(depth);return baseFlatten(map(collection,iteratee),depth);}/**
  4198. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  4199. * The iteratee is invoked with three arguments: (value, index|key, collection).
  4200. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4201. *
  4202. * **Note:** As with other "Collections" methods, objects with a "length"
  4203. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  4204. * or `_.forOwn` for object iteration.
  4205. *
  4206. * @static
  4207. * @memberOf _
  4208. * @since 0.1.0
  4209. * @alias each
  4210. * @category Collection
  4211. * @param {Array|Object} collection The collection to iterate over.
  4212. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  4213. * @returns {Array|Object} Returns `collection`.
  4214. * @see _.forEachRight
  4215. * @example
  4216. *
  4217. * _.forEach([1, 2], function(value) {
  4218. * console.log(value);
  4219. * });
  4220. * // => Logs `1` then `2`.
  4221. *
  4222. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  4223. * console.log(key);
  4224. * });
  4225. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  4226. */function forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,getIteratee(iteratee,3));}/**
  4227. * This method is like `_.forEach` except that it iterates over elements of
  4228. * `collection` from right to left.
  4229. *
  4230. * @static
  4231. * @memberOf _
  4232. * @since 2.0.0
  4233. * @alias eachRight
  4234. * @category Collection
  4235. * @param {Array|Object} collection The collection to iterate over.
  4236. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  4237. * @returns {Array|Object} Returns `collection`.
  4238. * @see _.forEach
  4239. * @example
  4240. *
  4241. * _.forEachRight([1, 2], function(value) {
  4242. * console.log(value);
  4243. * });
  4244. * // => Logs `2` then `1`.
  4245. */function forEachRight(collection,iteratee){var func=isArray(collection)?arrayEachRight:baseEachRight;return func(collection,getIteratee(iteratee,3));}/**
  4246. * Creates an object composed of keys generated from the results of running
  4247. * each element of `collection` thru `iteratee`. The order of grouped values
  4248. * is determined by the order they occur in `collection`. The corresponding
  4249. * value of each key is an array of elements responsible for generating the
  4250. * key. The iteratee is invoked with one argument: (value).
  4251. *
  4252. * @static
  4253. * @memberOf _
  4254. * @since 0.1.0
  4255. * @category Collection
  4256. * @param {Array|Object} collection The collection to iterate over.
  4257. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  4258. * @returns {Object} Returns the composed aggregate object.
  4259. * @example
  4260. *
  4261. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  4262. * // => { '4': [4.2], '6': [6.1, 6.3] }
  4263. *
  4264. * // The `_.property` iteratee shorthand.
  4265. * _.groupBy(['one', 'two', 'three'], 'length');
  4266. * // => { '3': ['one', 'two'], '5': ['three'] }
  4267. */var groupBy=createAggregator(function(result,value,key){if(hasOwnProperty.call(result,key)){result[key].push(value);}else{baseAssignValue(result,key,[value]);}});/**
  4268. * Checks if `value` is in `collection`. If `collection` is a string, it's
  4269. * checked for a substring of `value`, otherwise
  4270. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  4271. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  4272. * the offset from the end of `collection`.
  4273. *
  4274. * @static
  4275. * @memberOf _
  4276. * @since 0.1.0
  4277. * @category Collection
  4278. * @param {Array|Object|string} collection The collection to inspect.
  4279. * @param {*} value The value to search for.
  4280. * @param {number} [fromIndex=0] The index to search from.
  4281. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  4282. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  4283. * @example
  4284. *
  4285. * _.includes([1, 2, 3], 1);
  4286. * // => true
  4287. *
  4288. * _.includes([1, 2, 3], 1, 2);
  4289. * // => false
  4290. *
  4291. * _.includes({ 'a': 1, 'b': 2 }, 1);
  4292. * // => true
  4293. *
  4294. * _.includes('abcd', 'bc');
  4295. * // => true
  4296. */function includes(collection,value,fromIndex,guard){collection=isArrayLike(collection)?collection:values(collection);fromIndex=fromIndex&&!guard?toInteger(fromIndex):0;var length=collection.length;if(fromIndex<0){fromIndex=nativeMax(length+fromIndex,0);}return isString(collection)?fromIndex<=length&&collection.indexOf(value,fromIndex)>-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1;}/**
  4297. * Invokes the method at `path` of each element in `collection`, returning
  4298. * an array of the results of each invoked method. Any additional arguments
  4299. * are provided to each invoked method. If `path` is a function, it's invoked
  4300. * for, and `this` bound to, each element in `collection`.
  4301. *
  4302. * @static
  4303. * @memberOf _
  4304. * @since 4.0.0
  4305. * @category Collection
  4306. * @param {Array|Object} collection The collection to iterate over.
  4307. * @param {Array|Function|string} path The path of the method to invoke or
  4308. * the function invoked per iteration.
  4309. * @param {...*} [args] The arguments to invoke each method with.
  4310. * @returns {Array} Returns the array of results.
  4311. * @example
  4312. *
  4313. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  4314. * // => [[1, 5, 7], [1, 2, 3]]
  4315. *
  4316. * _.invokeMap([123, 456], String.prototype.split, '');
  4317. * // => [['1', '2', '3'], ['4', '5', '6']]
  4318. */var invokeMap=baseRest(function(collection,path,args){var index=-1,isFunc=typeof path==='function',result=isArrayLike(collection)?Array(collection.length):[];baseEach(collection,function(value){result[++index]=isFunc?apply(path,value,args):baseInvoke(value,path,args);});return result;});/**
  4319. * Creates an object composed of keys generated from the results of running
  4320. * each element of `collection` thru `iteratee`. The corresponding value of
  4321. * each key is the last element responsible for generating the key. The
  4322. * iteratee is invoked with one argument: (value).
  4323. *
  4324. * @static
  4325. * @memberOf _
  4326. * @since 4.0.0
  4327. * @category Collection
  4328. * @param {Array|Object} collection The collection to iterate over.
  4329. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  4330. * @returns {Object} Returns the composed aggregate object.
  4331. * @example
  4332. *
  4333. * var array = [
  4334. * { 'dir': 'left', 'code': 97 },
  4335. * { 'dir': 'right', 'code': 100 }
  4336. * ];
  4337. *
  4338. * _.keyBy(array, function(o) {
  4339. * return String.fromCharCode(o.code);
  4340. * });
  4341. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  4342. *
  4343. * _.keyBy(array, 'dir');
  4344. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  4345. */var keyBy=createAggregator(function(result,value,key){baseAssignValue(result,key,value);});/**
  4346. * Creates an array of values by running each element in `collection` thru
  4347. * `iteratee`. The iteratee is invoked with three arguments:
  4348. * (value, index|key, collection).
  4349. *
  4350. * Many lodash methods are guarded to work as iteratees for methods like
  4351. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  4352. *
  4353. * The guarded methods are:
  4354. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  4355. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  4356. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  4357. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  4358. *
  4359. * @static
  4360. * @memberOf _
  4361. * @since 0.1.0
  4362. * @category Collection
  4363. * @param {Array|Object} collection The collection to iterate over.
  4364. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  4365. * @returns {Array} Returns the new mapped array.
  4366. * @example
  4367. *
  4368. * function square(n) {
  4369. * return n * n;
  4370. * }
  4371. *
  4372. * _.map([4, 8], square);
  4373. * // => [16, 64]
  4374. *
  4375. * _.map({ 'a': 4, 'b': 8 }, square);
  4376. * // => [16, 64] (iteration order is not guaranteed)
  4377. *
  4378. * var users = [
  4379. * { 'user': 'barney' },
  4380. * { 'user': 'fred' }
  4381. * ];
  4382. *
  4383. * // The `_.property` iteratee shorthand.
  4384. * _.map(users, 'user');
  4385. * // => ['barney', 'fred']
  4386. */function map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,getIteratee(iteratee,3));}/**
  4387. * This method is like `_.sortBy` except that it allows specifying the sort
  4388. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  4389. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  4390. * descending or "asc" for ascending sort order of corresponding values.
  4391. *
  4392. * @static
  4393. * @memberOf _
  4394. * @since 4.0.0
  4395. * @category Collection
  4396. * @param {Array|Object} collection The collection to iterate over.
  4397. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  4398. * The iteratees to sort by.
  4399. * @param {string[]} [orders] The sort orders of `iteratees`.
  4400. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  4401. * @returns {Array} Returns the new sorted array.
  4402. * @example
  4403. *
  4404. * var users = [
  4405. * { 'user': 'fred', 'age': 48 },
  4406. * { 'user': 'barney', 'age': 34 },
  4407. * { 'user': 'fred', 'age': 40 },
  4408. * { 'user': 'barney', 'age': 36 }
  4409. * ];
  4410. *
  4411. * // Sort by `user` in ascending order and by `age` in descending order.
  4412. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  4413. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  4414. */function orderBy(collection,iteratees,orders,guard){if(collection==null){return[];}if(!isArray(iteratees)){iteratees=iteratees==null?[]:[iteratees];}orders=guard?undefined:orders;if(!isArray(orders)){orders=orders==null?[]:[orders];}return baseOrderBy(collection,iteratees,orders);}/**
  4415. * Creates an array of elements split into two groups, the first of which
  4416. * contains elements `predicate` returns truthy for, the second of which
  4417. * contains elements `predicate` returns falsey for. The predicate is
  4418. * invoked with one argument: (value).
  4419. *
  4420. * @static
  4421. * @memberOf _
  4422. * @since 3.0.0
  4423. * @category Collection
  4424. * @param {Array|Object} collection The collection to iterate over.
  4425. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  4426. * @returns {Array} Returns the array of grouped elements.
  4427. * @example
  4428. *
  4429. * var users = [
  4430. * { 'user': 'barney', 'age': 36, 'active': false },
  4431. * { 'user': 'fred', 'age': 40, 'active': true },
  4432. * { 'user': 'pebbles', 'age': 1, 'active': false }
  4433. * ];
  4434. *
  4435. * _.partition(users, function(o) { return o.active; });
  4436. * // => objects for [['fred'], ['barney', 'pebbles']]
  4437. *
  4438. * // The `_.matches` iteratee shorthand.
  4439. * _.partition(users, { 'age': 1, 'active': false });
  4440. * // => objects for [['pebbles'], ['barney', 'fred']]
  4441. *
  4442. * // The `_.matchesProperty` iteratee shorthand.
  4443. * _.partition(users, ['active', false]);
  4444. * // => objects for [['barney', 'pebbles'], ['fred']]
  4445. *
  4446. * // The `_.property` iteratee shorthand.
  4447. * _.partition(users, 'active');
  4448. * // => objects for [['fred'], ['barney', 'pebbles']]
  4449. */var partition=createAggregator(function(result,value,key){result[key?0:1].push(value);},function(){return[[],[]];});/**
  4450. * Reduces `collection` to a value which is the accumulated result of running
  4451. * each element in `collection` thru `iteratee`, where each successive
  4452. * invocation is supplied the return value of the previous. If `accumulator`
  4453. * is not given, the first element of `collection` is used as the initial
  4454. * value. The iteratee is invoked with four arguments:
  4455. * (accumulator, value, index|key, collection).
  4456. *
  4457. * Many lodash methods are guarded to work as iteratees for methods like
  4458. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  4459. *
  4460. * The guarded methods are:
  4461. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  4462. * and `sortBy`
  4463. *
  4464. * @static
  4465. * @memberOf _
  4466. * @since 0.1.0
  4467. * @category Collection
  4468. * @param {Array|Object} collection The collection to iterate over.
  4469. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  4470. * @param {*} [accumulator] The initial value.
  4471. * @returns {*} Returns the accumulated value.
  4472. * @see _.reduceRight
  4473. * @example
  4474. *
  4475. * _.reduce([1, 2], function(sum, n) {
  4476. * return sum + n;
  4477. * }, 0);
  4478. * // => 3
  4479. *
  4480. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  4481. * (result[value] || (result[value] = [])).push(key);
  4482. * return result;
  4483. * }, {});
  4484. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  4485. */function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEach);}/**
  4486. * This method is like `_.reduce` except that it iterates over elements of
  4487. * `collection` from right to left.
  4488. *
  4489. * @static
  4490. * @memberOf _
  4491. * @since 0.1.0
  4492. * @category Collection
  4493. * @param {Array|Object} collection The collection to iterate over.
  4494. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  4495. * @param {*} [accumulator] The initial value.
  4496. * @returns {*} Returns the accumulated value.
  4497. * @see _.reduce
  4498. * @example
  4499. *
  4500. * var array = [[0, 1], [2, 3], [4, 5]];
  4501. *
  4502. * _.reduceRight(array, function(flattened, other) {
  4503. * return flattened.concat(other);
  4504. * }, []);
  4505. * // => [4, 5, 2, 3, 0, 1]
  4506. */function reduceRight(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduceRight:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEachRight);}/**
  4507. * The opposite of `_.filter`; this method returns the elements of `collection`
  4508. * that `predicate` does **not** return truthy for.
  4509. *
  4510. * @static
  4511. * @memberOf _
  4512. * @since 0.1.0
  4513. * @category Collection
  4514. * @param {Array|Object} collection The collection to iterate over.
  4515. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  4516. * @returns {Array} Returns the new filtered array.
  4517. * @see _.filter
  4518. * @example
  4519. *
  4520. * var users = [
  4521. * { 'user': 'barney', 'age': 36, 'active': false },
  4522. * { 'user': 'fred', 'age': 40, 'active': true }
  4523. * ];
  4524. *
  4525. * _.reject(users, function(o) { return !o.active; });
  4526. * // => objects for ['fred']
  4527. *
  4528. * // The `_.matches` iteratee shorthand.
  4529. * _.reject(users, { 'age': 40, 'active': true });
  4530. * // => objects for ['barney']
  4531. *
  4532. * // The `_.matchesProperty` iteratee shorthand.
  4533. * _.reject(users, ['active', false]);
  4534. * // => objects for ['fred']
  4535. *
  4536. * // The `_.property` iteratee shorthand.
  4537. * _.reject(users, 'active');
  4538. * // => objects for ['barney']
  4539. */function reject(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,negate(getIteratee(predicate,3)));}/**
  4540. * Gets a random element from `collection`.
  4541. *
  4542. * @static
  4543. * @memberOf _
  4544. * @since 2.0.0
  4545. * @category Collection
  4546. * @param {Array|Object} collection The collection to sample.
  4547. * @returns {*} Returns the random element.
  4548. * @example
  4549. *
  4550. * _.sample([1, 2, 3, 4]);
  4551. * // => 2
  4552. */function sample(collection){var func=isArray(collection)?arraySample:baseSample;return func(collection);}/**
  4553. * Gets `n` random elements at unique keys from `collection` up to the
  4554. * size of `collection`.
  4555. *
  4556. * @static
  4557. * @memberOf _
  4558. * @since 4.0.0
  4559. * @category Collection
  4560. * @param {Array|Object} collection The collection to sample.
  4561. * @param {number} [n=1] The number of elements to sample.
  4562. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  4563. * @returns {Array} Returns the random elements.
  4564. * @example
  4565. *
  4566. * _.sampleSize([1, 2, 3], 2);
  4567. * // => [3, 1]
  4568. *
  4569. * _.sampleSize([1, 2, 3], 4);
  4570. * // => [2, 3, 1]
  4571. */function sampleSize(collection,n,guard){if(guard?isIterateeCall(collection,n,guard):n===undefined){n=1;}else{n=toInteger(n);}var func=isArray(collection)?arraySampleSize:baseSampleSize;return func(collection,n);}/**
  4572. * Creates an array of shuffled values, using a version of the
  4573. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  4574. *
  4575. * @static
  4576. * @memberOf _
  4577. * @since 0.1.0
  4578. * @category Collection
  4579. * @param {Array|Object} collection The collection to shuffle.
  4580. * @returns {Array} Returns the new shuffled array.
  4581. * @example
  4582. *
  4583. * _.shuffle([1, 2, 3, 4]);
  4584. * // => [4, 1, 3, 2]
  4585. */function shuffle(collection){var func=isArray(collection)?arrayShuffle:baseShuffle;return func(collection);}/**
  4586. * Gets the size of `collection` by returning its length for array-like
  4587. * values or the number of own enumerable string keyed properties for objects.
  4588. *
  4589. * @static
  4590. * @memberOf _
  4591. * @since 0.1.0
  4592. * @category Collection
  4593. * @param {Array|Object|string} collection The collection to inspect.
  4594. * @returns {number} Returns the collection size.
  4595. * @example
  4596. *
  4597. * _.size([1, 2, 3]);
  4598. * // => 3
  4599. *
  4600. * _.size({ 'a': 1, 'b': 2 });
  4601. * // => 2
  4602. *
  4603. * _.size('pebbles');
  4604. * // => 7
  4605. */function size(collection){if(collection==null){return 0;}if(isArrayLike(collection)){return isString(collection)?stringSize(collection):collection.length;}var tag=getTag(collection);if(tag==mapTag||tag==setTag){return collection.size;}return baseKeys(collection).length;}/**
  4606. * Checks if `predicate` returns truthy for **any** element of `collection`.
  4607. * Iteration is stopped once `predicate` returns truthy. The predicate is
  4608. * invoked with three arguments: (value, index|key, collection).
  4609. *
  4610. * @static
  4611. * @memberOf _
  4612. * @since 0.1.0
  4613. * @category Collection
  4614. * @param {Array|Object} collection The collection to iterate over.
  4615. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  4616. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  4617. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4618. * else `false`.
  4619. * @example
  4620. *
  4621. * _.some([null, 0, 'yes', false], Boolean);
  4622. * // => true
  4623. *
  4624. * var users = [
  4625. * { 'user': 'barney', 'active': true },
  4626. * { 'user': 'fred', 'active': false }
  4627. * ];
  4628. *
  4629. * // The `_.matches` iteratee shorthand.
  4630. * _.some(users, { 'user': 'barney', 'active': false });
  4631. * // => false
  4632. *
  4633. * // The `_.matchesProperty` iteratee shorthand.
  4634. * _.some(users, ['active', false]);
  4635. * // => true
  4636. *
  4637. * // The `_.property` iteratee shorthand.
  4638. * _.some(users, 'active');
  4639. * // => true
  4640. */function some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;if(guard&&isIterateeCall(collection,predicate,guard)){predicate=undefined;}return func(collection,getIteratee(predicate,3));}/**
  4641. * Creates an array of elements, sorted in ascending order by the results of
  4642. * running each element in a collection thru each iteratee. This method
  4643. * performs a stable sort, that is, it preserves the original sort order of
  4644. * equal elements. The iteratees are invoked with one argument: (value).
  4645. *
  4646. * @static
  4647. * @memberOf _
  4648. * @since 0.1.0
  4649. * @category Collection
  4650. * @param {Array|Object} collection The collection to iterate over.
  4651. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  4652. * The iteratees to sort by.
  4653. * @returns {Array} Returns the new sorted array.
  4654. * @example
  4655. *
  4656. * var users = [
  4657. * { 'user': 'fred', 'age': 48 },
  4658. * { 'user': 'barney', 'age': 36 },
  4659. * { 'user': 'fred', 'age': 40 },
  4660. * { 'user': 'barney', 'age': 34 }
  4661. * ];
  4662. *
  4663. * _.sortBy(users, [function(o) { return o.user; }]);
  4664. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  4665. *
  4666. * _.sortBy(users, ['user', 'age']);
  4667. * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
  4668. */var sortBy=baseRest(function(collection,iteratees){if(collection==null){return[];}var length=iteratees.length;if(length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])){iteratees=[];}else if(length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])){iteratees=[iteratees[0]];}return baseOrderBy(collection,baseFlatten(iteratees,1),[]);});/* ------------------------------------------------------------------------*//**
  4669. * Gets the timestamp of the number of milliseconds that have elapsed since
  4670. * the Unix epoch (1 January 1970 00:00:00 UTC).
  4671. *
  4672. * @static
  4673. * @memberOf _
  4674. * @since 2.4.0
  4675. * @category Date
  4676. * @returns {number} Returns the timestamp.
  4677. * @example
  4678. *
  4679. * _.defer(function(stamp) {
  4680. * console.log(_.now() - stamp);
  4681. * }, _.now());
  4682. * // => Logs the number of milliseconds it took for the deferred invocation.
  4683. */var now=ctxNow||function(){return root.Date.now();};/* ------------------------------------------------------------------------*//**
  4684. * The opposite of `_.before`; this method creates a function that invokes
  4685. * `func` once it's called `n` or more times.
  4686. *
  4687. * @static
  4688. * @memberOf _
  4689. * @since 0.1.0
  4690. * @category Function
  4691. * @param {number} n The number of calls before `func` is invoked.
  4692. * @param {Function} func The function to restrict.
  4693. * @returns {Function} Returns the new restricted function.
  4694. * @example
  4695. *
  4696. * var saves = ['profile', 'settings'];
  4697. *
  4698. * var done = _.after(saves.length, function() {
  4699. * console.log('done saving!');
  4700. * });
  4701. *
  4702. * _.forEach(saves, function(type) {
  4703. * asyncSave({ 'type': type, 'complete': done });
  4704. * });
  4705. * // => Logs 'done saving!' after the two async saves have completed.
  4706. */function after(n,func){if(typeof func!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}n=toInteger(n);return function(){if(--n<1){return func.apply(this,arguments);}};}/**
  4707. * Creates a function that invokes `func`, with up to `n` arguments,
  4708. * ignoring any additional arguments.
  4709. *
  4710. * @static
  4711. * @memberOf _
  4712. * @since 3.0.0
  4713. * @category Function
  4714. * @param {Function} func The function to cap arguments for.
  4715. * @param {number} [n=func.length] The arity cap.
  4716. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  4717. * @returns {Function} Returns the new capped function.
  4718. * @example
  4719. *
  4720. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  4721. * // => [6, 8, 10]
  4722. */function ary(func,n,guard){n=guard?undefined:n;n=func&&n==null?func.length:n;return createWrap(func,WRAP_ARY_FLAG,undefined,undefined,undefined,undefined,n);}/**
  4723. * Creates a function that invokes `func`, with the `this` binding and arguments
  4724. * of the created function, while it's called less than `n` times. Subsequent
  4725. * calls to the created function return the result of the last `func` invocation.
  4726. *
  4727. * @static
  4728. * @memberOf _
  4729. * @since 3.0.0
  4730. * @category Function
  4731. * @param {number} n The number of calls at which `func` is no longer invoked.
  4732. * @param {Function} func The function to restrict.
  4733. * @returns {Function} Returns the new restricted function.
  4734. * @example
  4735. *
  4736. * jQuery(element).on('click', _.before(5, addContactToList));
  4737. * // => Allows adding up to 4 contacts to the list.
  4738. */function before(n,func){var result;if(typeof func!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}n=toInteger(n);return function(){if(--n>0){result=func.apply(this,arguments);}if(n<=1){func=undefined;}return result;};}/**
  4739. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  4740. * and `partials` prepended to the arguments it receives.
  4741. *
  4742. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  4743. * may be used as a placeholder for partially applied arguments.
  4744. *
  4745. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  4746. * property of bound functions.
  4747. *
  4748. * @static
  4749. * @memberOf _
  4750. * @since 0.1.0
  4751. * @category Function
  4752. * @param {Function} func The function to bind.
  4753. * @param {*} thisArg The `this` binding of `func`.
  4754. * @param {...*} [partials] The arguments to be partially applied.
  4755. * @returns {Function} Returns the new bound function.
  4756. * @example
  4757. *
  4758. * function greet(greeting, punctuation) {
  4759. * return greeting + ' ' + this.user + punctuation;
  4760. * }
  4761. *
  4762. * var object = { 'user': 'fred' };
  4763. *
  4764. * var bound = _.bind(greet, object, 'hi');
  4765. * bound('!');
  4766. * // => 'hi fred!'
  4767. *
  4768. * // Bound with placeholders.
  4769. * var bound = _.bind(greet, object, _, '!');
  4770. * bound('hi');
  4771. * // => 'hi fred!'
  4772. */var bind=baseRest(function(func,thisArg,partials){var bitmask=WRAP_BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=WRAP_PARTIAL_FLAG;}return createWrap(func,bitmask,thisArg,partials,holders);});/**
  4773. * Creates a function that invokes the method at `object[key]` with `partials`
  4774. * prepended to the arguments it receives.
  4775. *
  4776. * This method differs from `_.bind` by allowing bound functions to reference
  4777. * methods that may be redefined or don't yet exist. See
  4778. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  4779. * for more details.
  4780. *
  4781. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  4782. * builds, may be used as a placeholder for partially applied arguments.
  4783. *
  4784. * @static
  4785. * @memberOf _
  4786. * @since 0.10.0
  4787. * @category Function
  4788. * @param {Object} object The object to invoke the method on.
  4789. * @param {string} key The key of the method.
  4790. * @param {...*} [partials] The arguments to be partially applied.
  4791. * @returns {Function} Returns the new bound function.
  4792. * @example
  4793. *
  4794. * var object = {
  4795. * 'user': 'fred',
  4796. * 'greet': function(greeting, punctuation) {
  4797. * return greeting + ' ' + this.user + punctuation;
  4798. * }
  4799. * };
  4800. *
  4801. * var bound = _.bindKey(object, 'greet', 'hi');
  4802. * bound('!');
  4803. * // => 'hi fred!'
  4804. *
  4805. * object.greet = function(greeting, punctuation) {
  4806. * return greeting + 'ya ' + this.user + punctuation;
  4807. * };
  4808. *
  4809. * bound('!');
  4810. * // => 'hiya fred!'
  4811. *
  4812. * // Bound with placeholders.
  4813. * var bound = _.bindKey(object, 'greet', _, '!');
  4814. * bound('hi');
  4815. * // => 'hiya fred!'
  4816. */var bindKey=baseRest(function(object,key,partials){var bitmask=WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bindKey));bitmask|=WRAP_PARTIAL_FLAG;}return createWrap(key,bitmask,object,partials,holders);});/**
  4817. * Creates a function that accepts arguments of `func` and either invokes
  4818. * `func` returning its result, if at least `arity` number of arguments have
  4819. * been provided, or returns a function that accepts the remaining `func`
  4820. * arguments, and so on. The arity of `func` may be specified if `func.length`
  4821. * is not sufficient.
  4822. *
  4823. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  4824. * may be used as a placeholder for provided arguments.
  4825. *
  4826. * **Note:** This method doesn't set the "length" property of curried functions.
  4827. *
  4828. * @static
  4829. * @memberOf _
  4830. * @since 2.0.0
  4831. * @category Function
  4832. * @param {Function} func The function to curry.
  4833. * @param {number} [arity=func.length] The arity of `func`.
  4834. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  4835. * @returns {Function} Returns the new curried function.
  4836. * @example
  4837. *
  4838. * var abc = function(a, b, c) {
  4839. * return [a, b, c];
  4840. * };
  4841. *
  4842. * var curried = _.curry(abc);
  4843. *
  4844. * curried(1)(2)(3);
  4845. * // => [1, 2, 3]
  4846. *
  4847. * curried(1, 2)(3);
  4848. * // => [1, 2, 3]
  4849. *
  4850. * curried(1, 2, 3);
  4851. * // => [1, 2, 3]
  4852. *
  4853. * // Curried with placeholders.
  4854. * curried(1)(_, 3)(2);
  4855. * // => [1, 2, 3]
  4856. */function curry(func,arity,guard){arity=guard?undefined:arity;var result=createWrap(func,WRAP_CURRY_FLAG,undefined,undefined,undefined,undefined,undefined,arity);result.placeholder=curry.placeholder;return result;}/**
  4857. * This method is like `_.curry` except that arguments are applied to `func`
  4858. * in the manner of `_.partialRight` instead of `_.partial`.
  4859. *
  4860. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  4861. * builds, may be used as a placeholder for provided arguments.
  4862. *
  4863. * **Note:** This method doesn't set the "length" property of curried functions.
  4864. *
  4865. * @static
  4866. * @memberOf _
  4867. * @since 3.0.0
  4868. * @category Function
  4869. * @param {Function} func The function to curry.
  4870. * @param {number} [arity=func.length] The arity of `func`.
  4871. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  4872. * @returns {Function} Returns the new curried function.
  4873. * @example
  4874. *
  4875. * var abc = function(a, b, c) {
  4876. * return [a, b, c];
  4877. * };
  4878. *
  4879. * var curried = _.curryRight(abc);
  4880. *
  4881. * curried(3)(2)(1);
  4882. * // => [1, 2, 3]
  4883. *
  4884. * curried(2, 3)(1);
  4885. * // => [1, 2, 3]
  4886. *
  4887. * curried(1, 2, 3);
  4888. * // => [1, 2, 3]
  4889. *
  4890. * // Curried with placeholders.
  4891. * curried(3)(1, _)(2);
  4892. * // => [1, 2, 3]
  4893. */function curryRight(func,arity,guard){arity=guard?undefined:arity;var result=createWrap(func,WRAP_CURRY_RIGHT_FLAG,undefined,undefined,undefined,undefined,undefined,arity);result.placeholder=curryRight.placeholder;return result;}/**
  4894. * Creates a debounced function that delays invoking `func` until after `wait`
  4895. * milliseconds have elapsed since the last time the debounced function was
  4896. * invoked. The debounced function comes with a `cancel` method to cancel
  4897. * delayed `func` invocations and a `flush` method to immediately invoke them.
  4898. * Provide `options` to indicate whether `func` should be invoked on the
  4899. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  4900. * with the last arguments provided to the debounced function. Subsequent
  4901. * calls to the debounced function return the result of the last `func`
  4902. * invocation.
  4903. *
  4904. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  4905. * invoked on the trailing edge of the timeout only if the debounced function
  4906. * is invoked more than once during the `wait` timeout.
  4907. *
  4908. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  4909. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  4910. *
  4911. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  4912. * for details over the differences between `_.debounce` and `_.throttle`.
  4913. *
  4914. * @static
  4915. * @memberOf _
  4916. * @since 0.1.0
  4917. * @category Function
  4918. * @param {Function} func The function to debounce.
  4919. * @param {number} [wait=0] The number of milliseconds to delay.
  4920. * @param {Object} [options={}] The options object.
  4921. * @param {boolean} [options.leading=false]
  4922. * Specify invoking on the leading edge of the timeout.
  4923. * @param {number} [options.maxWait]
  4924. * The maximum time `func` is allowed to be delayed before it's invoked.
  4925. * @param {boolean} [options.trailing=true]
  4926. * Specify invoking on the trailing edge of the timeout.
  4927. * @returns {Function} Returns the new debounced function.
  4928. * @example
  4929. *
  4930. * // Avoid costly calculations while the window size is in flux.
  4931. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  4932. *
  4933. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  4934. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  4935. * 'leading': true,
  4936. * 'trailing': false
  4937. * }));
  4938. *
  4939. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  4940. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  4941. * var source = new EventSource('/stream');
  4942. * jQuery(source).on('message', debounced);
  4943. *
  4944. * // Cancel the trailing debounced invocation.
  4945. * jQuery(window).on('popstate', debounced.cancel);
  4946. */function debounce(func,wait,options){var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=false,maxing=false,trailing=true;if(typeof func!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}wait=toNumber(wait)||0;if(isObject(options)){leading=!!options.leading;maxing='maxWait'in options;maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait;trailing='trailing'in options?!!options.trailing:trailing;}function invokeFunc(time){var args=lastArgs,thisArg=lastThis;lastArgs=lastThis=undefined;lastInvokeTime=time;result=func.apply(thisArg,args);return result;}function leadingEdge(time){// Reset any `maxWait` timer.
  4947. lastInvokeTime=time;// Start the timer for the trailing edge.
  4948. timerId=setTimeout(timerExpired,wait);// Invoke the leading edge.
  4949. return leading?invokeFunc(time):result;}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,timeWaiting=wait-timeSinceLastCall;return maxing?nativeMin(timeWaiting,maxWait-timeSinceLastInvoke):timeWaiting;}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;// Either this is the first call, activity has stopped and we're at the
  4950. // trailing edge, the system time has gone backwards and we're treating
  4951. // it as the trailing edge, or we've hit the `maxWait` limit.
  4952. return lastCallTime===undefined||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait;}function timerExpired(){var time=now();if(shouldInvoke(time)){return trailingEdge(time);}// Restart the timer.
  4953. timerId=setTimeout(timerExpired,remainingWait(time));}function trailingEdge(time){timerId=undefined;// Only invoke if we have `lastArgs` which means `func` has been
  4954. // debounced at least once.
  4955. if(trailing&&lastArgs){return invokeFunc(time);}lastArgs=lastThis=undefined;return result;}function cancel(){if(timerId!==undefined){clearTimeout(timerId);}lastInvokeTime=0;lastArgs=lastCallTime=lastThis=timerId=undefined;}function flush(){return timerId===undefined?result:trailingEdge(now());}function debounced(){var time=now(),isInvoking=shouldInvoke(time);lastArgs=arguments;lastThis=this;lastCallTime=time;if(isInvoking){if(timerId===undefined){return leadingEdge(lastCallTime);}if(maxing){// Handle invocations in a tight loop.
  4956. timerId=setTimeout(timerExpired,wait);return invokeFunc(lastCallTime);}}if(timerId===undefined){timerId=setTimeout(timerExpired,wait);}return result;}debounced.cancel=cancel;debounced.flush=flush;return debounced;}/**
  4957. * Defers invoking the `func` until the current call stack has cleared. Any
  4958. * additional arguments are provided to `func` when it's invoked.
  4959. *
  4960. * @static
  4961. * @memberOf _
  4962. * @since 0.1.0
  4963. * @category Function
  4964. * @param {Function} func The function to defer.
  4965. * @param {...*} [args] The arguments to invoke `func` with.
  4966. * @returns {number} Returns the timer id.
  4967. * @example
  4968. *
  4969. * _.defer(function(text) {
  4970. * console.log(text);
  4971. * }, 'deferred');
  4972. * // => Logs 'deferred' after one millisecond.
  4973. */var defer=baseRest(function(func,args){return baseDelay(func,1,args);});/**
  4974. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  4975. * provided to `func` when it's invoked.
  4976. *
  4977. * @static
  4978. * @memberOf _
  4979. * @since 0.1.0
  4980. * @category Function
  4981. * @param {Function} func The function to delay.
  4982. * @param {number} wait The number of milliseconds to delay invocation.
  4983. * @param {...*} [args] The arguments to invoke `func` with.
  4984. * @returns {number} Returns the timer id.
  4985. * @example
  4986. *
  4987. * _.delay(function(text) {
  4988. * console.log(text);
  4989. * }, 1000, 'later');
  4990. * // => Logs 'later' after one second.
  4991. */var delay=baseRest(function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args);});/**
  4992. * Creates a function that invokes `func` with arguments reversed.
  4993. *
  4994. * @static
  4995. * @memberOf _
  4996. * @since 4.0.0
  4997. * @category Function
  4998. * @param {Function} func The function to flip arguments for.
  4999. * @returns {Function} Returns the new flipped function.
  5000. * @example
  5001. *
  5002. * var flipped = _.flip(function() {
  5003. * return _.toArray(arguments);
  5004. * });
  5005. *
  5006. * flipped('a', 'b', 'c', 'd');
  5007. * // => ['d', 'c', 'b', 'a']
  5008. */function flip(func){return createWrap(func,WRAP_FLIP_FLAG);}/**
  5009. * Creates a function that memoizes the result of `func`. If `resolver` is
  5010. * provided, it determines the cache key for storing the result based on the
  5011. * arguments provided to the memoized function. By default, the first argument
  5012. * provided to the memoized function is used as the map cache key. The `func`
  5013. * is invoked with the `this` binding of the memoized function.
  5014. *
  5015. * **Note:** The cache is exposed as the `cache` property on the memoized
  5016. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  5017. * constructor with one whose instances implement the
  5018. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  5019. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  5020. *
  5021. * @static
  5022. * @memberOf _
  5023. * @since 0.1.0
  5024. * @category Function
  5025. * @param {Function} func The function to have its output memoized.
  5026. * @param {Function} [resolver] The function to resolve the cache key.
  5027. * @returns {Function} Returns the new memoized function.
  5028. * @example
  5029. *
  5030. * var object = { 'a': 1, 'b': 2 };
  5031. * var other = { 'c': 3, 'd': 4 };
  5032. *
  5033. * var values = _.memoize(_.values);
  5034. * values(object);
  5035. * // => [1, 2]
  5036. *
  5037. * values(other);
  5038. * // => [3, 4]
  5039. *
  5040. * object.a = 2;
  5041. * values(object);
  5042. * // => [1, 2]
  5043. *
  5044. * // Modify the result cache.
  5045. * values.cache.set(object, ['a', 'b']);
  5046. * values(object);
  5047. * // => ['a', 'b']
  5048. *
  5049. * // Replace `_.memoize.Cache`.
  5050. * _.memoize.Cache = WeakMap;
  5051. */function memoize(func,resolver){if(typeof func!=='function'||resolver!=null&&typeof resolver!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}var memoized=function memoized(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key)){return cache.get(key);}var result=func.apply(this,args);memoized.cache=cache.set(key,result)||cache;return result;};memoized.cache=new(memoize.Cache||MapCache)();return memoized;}// Expose `MapCache`.
  5052. memoize.Cache=MapCache;/**
  5053. * Creates a function that negates the result of the predicate `func`. The
  5054. * `func` predicate is invoked with the `this` binding and arguments of the
  5055. * created function.
  5056. *
  5057. * @static
  5058. * @memberOf _
  5059. * @since 3.0.0
  5060. * @category Function
  5061. * @param {Function} predicate The predicate to negate.
  5062. * @returns {Function} Returns the new negated function.
  5063. * @example
  5064. *
  5065. * function isEven(n) {
  5066. * return n % 2 == 0;
  5067. * }
  5068. *
  5069. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  5070. * // => [1, 3, 5]
  5071. */function negate(predicate){if(typeof predicate!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}return function(){var args=arguments;switch(args.length){case 0:return!predicate.call(this);case 1:return!predicate.call(this,args[0]);case 2:return!predicate.call(this,args[0],args[1]);case 3:return!predicate.call(this,args[0],args[1],args[2]);}return!predicate.apply(this,args);};}/**
  5072. * Creates a function that is restricted to invoking `func` once. Repeat calls
  5073. * to the function return the value of the first invocation. The `func` is
  5074. * invoked with the `this` binding and arguments of the created function.
  5075. *
  5076. * @static
  5077. * @memberOf _
  5078. * @since 0.1.0
  5079. * @category Function
  5080. * @param {Function} func The function to restrict.
  5081. * @returns {Function} Returns the new restricted function.
  5082. * @example
  5083. *
  5084. * var initialize = _.once(createApplication);
  5085. * initialize();
  5086. * initialize();
  5087. * // => `createApplication` is invoked once
  5088. */function once(func){return before(2,func);}/**
  5089. * Creates a function that invokes `func` with its arguments transformed.
  5090. *
  5091. * @static
  5092. * @since 4.0.0
  5093. * @memberOf _
  5094. * @category Function
  5095. * @param {Function} func The function to wrap.
  5096. * @param {...(Function|Function[])} [transforms=[_.identity]]
  5097. * The argument transforms.
  5098. * @returns {Function} Returns the new function.
  5099. * @example
  5100. *
  5101. * function doubled(n) {
  5102. * return n * 2;
  5103. * }
  5104. *
  5105. * function square(n) {
  5106. * return n * n;
  5107. * }
  5108. *
  5109. * var func = _.overArgs(function(x, y) {
  5110. * return [x, y];
  5111. * }, [square, doubled]);
  5112. *
  5113. * func(9, 3);
  5114. * // => [81, 6]
  5115. *
  5116. * func(10, 5);
  5117. * // => [100, 10]
  5118. */var overArgs=castRest(function(func,transforms){transforms=transforms.length==1&&isArray(transforms[0])?arrayMap(transforms[0],baseUnary(getIteratee())):arrayMap(baseFlatten(transforms,1),baseUnary(getIteratee()));var funcsLength=transforms.length;return baseRest(function(args){var index=-1,length=nativeMin(args.length,funcsLength);while(++index<length){args[index]=transforms[index].call(this,args[index]);}return apply(func,this,args);});});/**
  5119. * Creates a function that invokes `func` with `partials` prepended to the
  5120. * arguments it receives. This method is like `_.bind` except it does **not**
  5121. * alter the `this` binding.
  5122. *
  5123. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  5124. * builds, may be used as a placeholder for partially applied arguments.
  5125. *
  5126. * **Note:** This method doesn't set the "length" property of partially
  5127. * applied functions.
  5128. *
  5129. * @static
  5130. * @memberOf _
  5131. * @since 0.2.0
  5132. * @category Function
  5133. * @param {Function} func The function to partially apply arguments to.
  5134. * @param {...*} [partials] The arguments to be partially applied.
  5135. * @returns {Function} Returns the new partially applied function.
  5136. * @example
  5137. *
  5138. * function greet(greeting, name) {
  5139. * return greeting + ' ' + name;
  5140. * }
  5141. *
  5142. * var sayHelloTo = _.partial(greet, 'hello');
  5143. * sayHelloTo('fred');
  5144. * // => 'hello fred'
  5145. *
  5146. * // Partially applied with placeholders.
  5147. * var greetFred = _.partial(greet, _, 'fred');
  5148. * greetFred('hi');
  5149. * // => 'hi fred'
  5150. */var partial=baseRest(function(func,partials){var holders=replaceHolders(partials,getHolder(partial));return createWrap(func,WRAP_PARTIAL_FLAG,undefined,partials,holders);});/**
  5151. * This method is like `_.partial` except that partially applied arguments
  5152. * are appended to the arguments it receives.
  5153. *
  5154. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  5155. * builds, may be used as a placeholder for partially applied arguments.
  5156. *
  5157. * **Note:** This method doesn't set the "length" property of partially
  5158. * applied functions.
  5159. *
  5160. * @static
  5161. * @memberOf _
  5162. * @since 1.0.0
  5163. * @category Function
  5164. * @param {Function} func The function to partially apply arguments to.
  5165. * @param {...*} [partials] The arguments to be partially applied.
  5166. * @returns {Function} Returns the new partially applied function.
  5167. * @example
  5168. *
  5169. * function greet(greeting, name) {
  5170. * return greeting + ' ' + name;
  5171. * }
  5172. *
  5173. * var greetFred = _.partialRight(greet, 'fred');
  5174. * greetFred('hi');
  5175. * // => 'hi fred'
  5176. *
  5177. * // Partially applied with placeholders.
  5178. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  5179. * sayHelloTo('fred');
  5180. * // => 'hello fred'
  5181. */var partialRight=baseRest(function(func,partials){var holders=replaceHolders(partials,getHolder(partialRight));return createWrap(func,WRAP_PARTIAL_RIGHT_FLAG,undefined,partials,holders);});/**
  5182. * Creates a function that invokes `func` with arguments arranged according
  5183. * to the specified `indexes` where the argument value at the first index is
  5184. * provided as the first argument, the argument value at the second index is
  5185. * provided as the second argument, and so on.
  5186. *
  5187. * @static
  5188. * @memberOf _
  5189. * @since 3.0.0
  5190. * @category Function
  5191. * @param {Function} func The function to rearrange arguments for.
  5192. * @param {...(number|number[])} indexes The arranged argument indexes.
  5193. * @returns {Function} Returns the new function.
  5194. * @example
  5195. *
  5196. * var rearged = _.rearg(function(a, b, c) {
  5197. * return [a, b, c];
  5198. * }, [2, 0, 1]);
  5199. *
  5200. * rearged('b', 'c', 'a')
  5201. * // => ['a', 'b', 'c']
  5202. */var rearg=flatRest(function(func,indexes){return createWrap(func,WRAP_REARG_FLAG,undefined,undefined,undefined,indexes);});/**
  5203. * Creates a function that invokes `func` with the `this` binding of the
  5204. * created function and arguments from `start` and beyond provided as
  5205. * an array.
  5206. *
  5207. * **Note:** This method is based on the
  5208. * [rest parameter](https://mdn.io/rest_parameters).
  5209. *
  5210. * @static
  5211. * @memberOf _
  5212. * @since 4.0.0
  5213. * @category Function
  5214. * @param {Function} func The function to apply a rest parameter to.
  5215. * @param {number} [start=func.length-1] The start position of the rest parameter.
  5216. * @returns {Function} Returns the new function.
  5217. * @example
  5218. *
  5219. * var say = _.rest(function(what, names) {
  5220. * return what + ' ' + _.initial(names).join(', ') +
  5221. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  5222. * });
  5223. *
  5224. * say('hello', 'fred', 'barney', 'pebbles');
  5225. * // => 'hello fred, barney, & pebbles'
  5226. */function rest(func,start){if(typeof func!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}start=start===undefined?start:toInteger(start);return baseRest(func,start);}/**
  5227. * Creates a function that invokes `func` with the `this` binding of the
  5228. * create function and an array of arguments much like
  5229. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  5230. *
  5231. * **Note:** This method is based on the
  5232. * [spread operator](https://mdn.io/spread_operator).
  5233. *
  5234. * @static
  5235. * @memberOf _
  5236. * @since 3.2.0
  5237. * @category Function
  5238. * @param {Function} func The function to spread arguments over.
  5239. * @param {number} [start=0] The start position of the spread.
  5240. * @returns {Function} Returns the new function.
  5241. * @example
  5242. *
  5243. * var say = _.spread(function(who, what) {
  5244. * return who + ' says ' + what;
  5245. * });
  5246. *
  5247. * say(['fred', 'hello']);
  5248. * // => 'fred says hello'
  5249. *
  5250. * var numbers = Promise.all([
  5251. * Promise.resolve(40),
  5252. * Promise.resolve(36)
  5253. * ]);
  5254. *
  5255. * numbers.then(_.spread(function(x, y) {
  5256. * return x + y;
  5257. * }));
  5258. * // => a Promise of 76
  5259. */function spread(func,start){if(typeof func!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}start=start==null?0:nativeMax(toInteger(start),0);return baseRest(function(args){var array=args[start],otherArgs=castSlice(args,0,start);if(array){arrayPush(otherArgs,array);}return apply(func,this,otherArgs);});}/**
  5260. * Creates a throttled function that only invokes `func` at most once per
  5261. * every `wait` milliseconds. The throttled function comes with a `cancel`
  5262. * method to cancel delayed `func` invocations and a `flush` method to
  5263. * immediately invoke them. Provide `options` to indicate whether `func`
  5264. * should be invoked on the leading and/or trailing edge of the `wait`
  5265. * timeout. The `func` is invoked with the last arguments provided to the
  5266. * throttled function. Subsequent calls to the throttled function return the
  5267. * result of the last `func` invocation.
  5268. *
  5269. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  5270. * invoked on the trailing edge of the timeout only if the throttled function
  5271. * is invoked more than once during the `wait` timeout.
  5272. *
  5273. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  5274. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  5275. *
  5276. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  5277. * for details over the differences between `_.throttle` and `_.debounce`.
  5278. *
  5279. * @static
  5280. * @memberOf _
  5281. * @since 0.1.0
  5282. * @category Function
  5283. * @param {Function} func The function to throttle.
  5284. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  5285. * @param {Object} [options={}] The options object.
  5286. * @param {boolean} [options.leading=true]
  5287. * Specify invoking on the leading edge of the timeout.
  5288. * @param {boolean} [options.trailing=true]
  5289. * Specify invoking on the trailing edge of the timeout.
  5290. * @returns {Function} Returns the new throttled function.
  5291. * @example
  5292. *
  5293. * // Avoid excessively updating the position while scrolling.
  5294. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  5295. *
  5296. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  5297. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  5298. * jQuery(element).on('click', throttled);
  5299. *
  5300. * // Cancel the trailing throttled invocation.
  5301. * jQuery(window).on('popstate', throttled.cancel);
  5302. */function throttle(func,wait,options){var leading=true,trailing=true;if(typeof func!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}if(isObject(options)){leading='leading'in options?!!options.leading:leading;trailing='trailing'in options?!!options.trailing:trailing;}return debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing});}/**
  5303. * Creates a function that accepts up to one argument, ignoring any
  5304. * additional arguments.
  5305. *
  5306. * @static
  5307. * @memberOf _
  5308. * @since 4.0.0
  5309. * @category Function
  5310. * @param {Function} func The function to cap arguments for.
  5311. * @returns {Function} Returns the new capped function.
  5312. * @example
  5313. *
  5314. * _.map(['6', '8', '10'], _.unary(parseInt));
  5315. * // => [6, 8, 10]
  5316. */function unary(func){return ary(func,1);}/**
  5317. * Creates a function that provides `value` to `wrapper` as its first
  5318. * argument. Any additional arguments provided to the function are appended
  5319. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  5320. * binding of the created function.
  5321. *
  5322. * @static
  5323. * @memberOf _
  5324. * @since 0.1.0
  5325. * @category Function
  5326. * @param {*} value The value to wrap.
  5327. * @param {Function} [wrapper=identity] The wrapper function.
  5328. * @returns {Function} Returns the new function.
  5329. * @example
  5330. *
  5331. * var p = _.wrap(_.escape, function(func, text) {
  5332. * return '<p>' + func(text) + '</p>';
  5333. * });
  5334. *
  5335. * p('fred, barney, & pebbles');
  5336. * // => '<p>fred, barney, &amp; pebbles</p>'
  5337. */function wrap(value,wrapper){return partial(castFunction(wrapper),value);}/* ------------------------------------------------------------------------*//**
  5338. * Casts `value` as an array if it's not one.
  5339. *
  5340. * @static
  5341. * @memberOf _
  5342. * @since 4.4.0
  5343. * @category Lang
  5344. * @param {*} value The value to inspect.
  5345. * @returns {Array} Returns the cast array.
  5346. * @example
  5347. *
  5348. * _.castArray(1);
  5349. * // => [1]
  5350. *
  5351. * _.castArray({ 'a': 1 });
  5352. * // => [{ 'a': 1 }]
  5353. *
  5354. * _.castArray('abc');
  5355. * // => ['abc']
  5356. *
  5357. * _.castArray(null);
  5358. * // => [null]
  5359. *
  5360. * _.castArray(undefined);
  5361. * // => [undefined]
  5362. *
  5363. * _.castArray();
  5364. * // => []
  5365. *
  5366. * var array = [1, 2, 3];
  5367. * console.log(_.castArray(array) === array);
  5368. * // => true
  5369. */function castArray(){if(!arguments.length){return[];}var value=arguments[0];return isArray(value)?value:[value];}/**
  5370. * Creates a shallow clone of `value`.
  5371. *
  5372. * **Note:** This method is loosely based on the
  5373. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  5374. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  5375. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  5376. * arrays. The own enumerable properties of `arguments` objects are cloned
  5377. * as plain objects. An empty object is returned for uncloneable values such
  5378. * as error objects, functions, DOM nodes, and WeakMaps.
  5379. *
  5380. * @static
  5381. * @memberOf _
  5382. * @since 0.1.0
  5383. * @category Lang
  5384. * @param {*} value The value to clone.
  5385. * @returns {*} Returns the cloned value.
  5386. * @see _.cloneDeep
  5387. * @example
  5388. *
  5389. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  5390. *
  5391. * var shallow = _.clone(objects);
  5392. * console.log(shallow[0] === objects[0]);
  5393. * // => true
  5394. */function clone(value){return baseClone(value,CLONE_SYMBOLS_FLAG);}/**
  5395. * This method is like `_.clone` except that it accepts `customizer` which
  5396. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  5397. * cloning is handled by the method instead. The `customizer` is invoked with
  5398. * up to four arguments; (value [, index|key, object, stack]).
  5399. *
  5400. * @static
  5401. * @memberOf _
  5402. * @since 4.0.0
  5403. * @category Lang
  5404. * @param {*} value The value to clone.
  5405. * @param {Function} [customizer] The function to customize cloning.
  5406. * @returns {*} Returns the cloned value.
  5407. * @see _.cloneDeepWith
  5408. * @example
  5409. *
  5410. * function customizer(value) {
  5411. * if (_.isElement(value)) {
  5412. * return value.cloneNode(false);
  5413. * }
  5414. * }
  5415. *
  5416. * var el = _.cloneWith(document.body, customizer);
  5417. *
  5418. * console.log(el === document.body);
  5419. * // => false
  5420. * console.log(el.nodeName);
  5421. * // => 'BODY'
  5422. * console.log(el.childNodes.length);
  5423. * // => 0
  5424. */function cloneWith(value,customizer){customizer=typeof customizer==='function'?customizer:undefined;return baseClone(value,CLONE_SYMBOLS_FLAG,customizer);}/**
  5425. * This method is like `_.clone` except that it recursively clones `value`.
  5426. *
  5427. * @static
  5428. * @memberOf _
  5429. * @since 1.0.0
  5430. * @category Lang
  5431. * @param {*} value The value to recursively clone.
  5432. * @returns {*} Returns the deep cloned value.
  5433. * @see _.clone
  5434. * @example
  5435. *
  5436. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  5437. *
  5438. * var deep = _.cloneDeep(objects);
  5439. * console.log(deep[0] === objects[0]);
  5440. * // => false
  5441. */function cloneDeep(value){return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG);}/**
  5442. * This method is like `_.cloneWith` except that it recursively clones `value`.
  5443. *
  5444. * @static
  5445. * @memberOf _
  5446. * @since 4.0.0
  5447. * @category Lang
  5448. * @param {*} value The value to recursively clone.
  5449. * @param {Function} [customizer] The function to customize cloning.
  5450. * @returns {*} Returns the deep cloned value.
  5451. * @see _.cloneWith
  5452. * @example
  5453. *
  5454. * function customizer(value) {
  5455. * if (_.isElement(value)) {
  5456. * return value.cloneNode(true);
  5457. * }
  5458. * }
  5459. *
  5460. * var el = _.cloneDeepWith(document.body, customizer);
  5461. *
  5462. * console.log(el === document.body);
  5463. * // => false
  5464. * console.log(el.nodeName);
  5465. * // => 'BODY'
  5466. * console.log(el.childNodes.length);
  5467. * // => 20
  5468. */function cloneDeepWith(value,customizer){customizer=typeof customizer==='function'?customizer:undefined;return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG,customizer);}/**
  5469. * Checks if `object` conforms to `source` by invoking the predicate
  5470. * properties of `source` with the corresponding property values of `object`.
  5471. *
  5472. * **Note:** This method is equivalent to `_.conforms` when `source` is
  5473. * partially applied.
  5474. *
  5475. * @static
  5476. * @memberOf _
  5477. * @since 4.14.0
  5478. * @category Lang
  5479. * @param {Object} object The object to inspect.
  5480. * @param {Object} source The object of property predicates to conform to.
  5481. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  5482. * @example
  5483. *
  5484. * var object = { 'a': 1, 'b': 2 };
  5485. *
  5486. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  5487. * // => true
  5488. *
  5489. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  5490. * // => false
  5491. */function conformsTo(object,source){return source==null||baseConformsTo(object,source,keys(source));}/**
  5492. * Performs a
  5493. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  5494. * comparison between two values to determine if they are equivalent.
  5495. *
  5496. * @static
  5497. * @memberOf _
  5498. * @since 4.0.0
  5499. * @category Lang
  5500. * @param {*} value The value to compare.
  5501. * @param {*} other The other value to compare.
  5502. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  5503. * @example
  5504. *
  5505. * var object = { 'a': 1 };
  5506. * var other = { 'a': 1 };
  5507. *
  5508. * _.eq(object, object);
  5509. * // => true
  5510. *
  5511. * _.eq(object, other);
  5512. * // => false
  5513. *
  5514. * _.eq('a', 'a');
  5515. * // => true
  5516. *
  5517. * _.eq('a', Object('a'));
  5518. * // => false
  5519. *
  5520. * _.eq(NaN, NaN);
  5521. * // => true
  5522. */function eq(value,other){return value===other||value!==value&&other!==other;}/**
  5523. * Checks if `value` is greater than `other`.
  5524. *
  5525. * @static
  5526. * @memberOf _
  5527. * @since 3.9.0
  5528. * @category Lang
  5529. * @param {*} value The value to compare.
  5530. * @param {*} other The other value to compare.
  5531. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  5532. * else `false`.
  5533. * @see _.lt
  5534. * @example
  5535. *
  5536. * _.gt(3, 1);
  5537. * // => true
  5538. *
  5539. * _.gt(3, 3);
  5540. * // => false
  5541. *
  5542. * _.gt(1, 3);
  5543. * // => false
  5544. */var gt=createRelationalOperation(baseGt);/**
  5545. * Checks if `value` is greater than or equal to `other`.
  5546. *
  5547. * @static
  5548. * @memberOf _
  5549. * @since 3.9.0
  5550. * @category Lang
  5551. * @param {*} value The value to compare.
  5552. * @param {*} other The other value to compare.
  5553. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  5554. * `other`, else `false`.
  5555. * @see _.lte
  5556. * @example
  5557. *
  5558. * _.gte(3, 1);
  5559. * // => true
  5560. *
  5561. * _.gte(3, 3);
  5562. * // => true
  5563. *
  5564. * _.gte(1, 3);
  5565. * // => false
  5566. */var gte=createRelationalOperation(function(value,other){return value>=other;});/**
  5567. * Checks if `value` is likely an `arguments` object.
  5568. *
  5569. * @static
  5570. * @memberOf _
  5571. * @since 0.1.0
  5572. * @category Lang
  5573. * @param {*} value The value to check.
  5574. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  5575. * else `false`.
  5576. * @example
  5577. *
  5578. * _.isArguments(function() { return arguments; }());
  5579. * // => true
  5580. *
  5581. * _.isArguments([1, 2, 3]);
  5582. * // => false
  5583. */var isArguments=baseIsArguments(function(){return arguments;}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,'callee')&&!propertyIsEnumerable.call(value,'callee');};/**
  5584. * Checks if `value` is classified as an `Array` object.
  5585. *
  5586. * @static
  5587. * @memberOf _
  5588. * @since 0.1.0
  5589. * @category Lang
  5590. * @param {*} value The value to check.
  5591. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  5592. * @example
  5593. *
  5594. * _.isArray([1, 2, 3]);
  5595. * // => true
  5596. *
  5597. * _.isArray(document.body.children);
  5598. * // => false
  5599. *
  5600. * _.isArray('abc');
  5601. * // => false
  5602. *
  5603. * _.isArray(_.noop);
  5604. * // => false
  5605. */var isArray=Array.isArray;/**
  5606. * Checks if `value` is classified as an `ArrayBuffer` object.
  5607. *
  5608. * @static
  5609. * @memberOf _
  5610. * @since 4.3.0
  5611. * @category Lang
  5612. * @param {*} value The value to check.
  5613. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  5614. * @example
  5615. *
  5616. * _.isArrayBuffer(new ArrayBuffer(2));
  5617. * // => true
  5618. *
  5619. * _.isArrayBuffer(new Array(2));
  5620. * // => false
  5621. */var isArrayBuffer=nodeIsArrayBuffer?baseUnary(nodeIsArrayBuffer):baseIsArrayBuffer;/**
  5622. * Checks if `value` is array-like. A value is considered array-like if it's
  5623. * not a function and has a `value.length` that's an integer greater than or
  5624. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  5625. *
  5626. * @static
  5627. * @memberOf _
  5628. * @since 4.0.0
  5629. * @category Lang
  5630. * @param {*} value The value to check.
  5631. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  5632. * @example
  5633. *
  5634. * _.isArrayLike([1, 2, 3]);
  5635. * // => true
  5636. *
  5637. * _.isArrayLike(document.body.children);
  5638. * // => true
  5639. *
  5640. * _.isArrayLike('abc');
  5641. * // => true
  5642. *
  5643. * _.isArrayLike(_.noop);
  5644. * // => false
  5645. */function isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value);}/**
  5646. * This method is like `_.isArrayLike` except that it also checks if `value`
  5647. * is an object.
  5648. *
  5649. * @static
  5650. * @memberOf _
  5651. * @since 4.0.0
  5652. * @category Lang
  5653. * @param {*} value The value to check.
  5654. * @returns {boolean} Returns `true` if `value` is an array-like object,
  5655. * else `false`.
  5656. * @example
  5657. *
  5658. * _.isArrayLikeObject([1, 2, 3]);
  5659. * // => true
  5660. *
  5661. * _.isArrayLikeObject(document.body.children);
  5662. * // => true
  5663. *
  5664. * _.isArrayLikeObject('abc');
  5665. * // => false
  5666. *
  5667. * _.isArrayLikeObject(_.noop);
  5668. * // => false
  5669. */function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value);}/**
  5670. * Checks if `value` is classified as a boolean primitive or object.
  5671. *
  5672. * @static
  5673. * @memberOf _
  5674. * @since 0.1.0
  5675. * @category Lang
  5676. * @param {*} value The value to check.
  5677. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  5678. * @example
  5679. *
  5680. * _.isBoolean(false);
  5681. * // => true
  5682. *
  5683. * _.isBoolean(null);
  5684. * // => false
  5685. */function isBoolean(value){return value===true||value===false||isObjectLike(value)&&baseGetTag(value)==boolTag;}/**
  5686. * Checks if `value` is a buffer.
  5687. *
  5688. * @static
  5689. * @memberOf _
  5690. * @since 4.3.0
  5691. * @category Lang
  5692. * @param {*} value The value to check.
  5693. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  5694. * @example
  5695. *
  5696. * _.isBuffer(new Buffer(2));
  5697. * // => true
  5698. *
  5699. * _.isBuffer(new Uint8Array(2));
  5700. * // => false
  5701. */var isBuffer=nativeIsBuffer||stubFalse;/**
  5702. * Checks if `value` is classified as a `Date` object.
  5703. *
  5704. * @static
  5705. * @memberOf _
  5706. * @since 0.1.0
  5707. * @category Lang
  5708. * @param {*} value The value to check.
  5709. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  5710. * @example
  5711. *
  5712. * _.isDate(new Date);
  5713. * // => true
  5714. *
  5715. * _.isDate('Mon April 23 2012');
  5716. * // => false
  5717. */var isDate=nodeIsDate?baseUnary(nodeIsDate):baseIsDate;/**
  5718. * Checks if `value` is likely a DOM element.
  5719. *
  5720. * @static
  5721. * @memberOf _
  5722. * @since 0.1.0
  5723. * @category Lang
  5724. * @param {*} value The value to check.
  5725. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  5726. * @example
  5727. *
  5728. * _.isElement(document.body);
  5729. * // => true
  5730. *
  5731. * _.isElement('<body>');
  5732. * // => false
  5733. */function isElement(value){return isObjectLike(value)&&value.nodeType===1&&!isPlainObject(value);}/**
  5734. * Checks if `value` is an empty object, collection, map, or set.
  5735. *
  5736. * Objects are considered empty if they have no own enumerable string keyed
  5737. * properties.
  5738. *
  5739. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  5740. * jQuery-like collections are considered empty if they have a `length` of `0`.
  5741. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  5742. *
  5743. * @static
  5744. * @memberOf _
  5745. * @since 0.1.0
  5746. * @category Lang
  5747. * @param {*} value The value to check.
  5748. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  5749. * @example
  5750. *
  5751. * _.isEmpty(null);
  5752. * // => true
  5753. *
  5754. * _.isEmpty(true);
  5755. * // => true
  5756. *
  5757. * _.isEmpty(1);
  5758. * // => true
  5759. *
  5760. * _.isEmpty([1, 2, 3]);
  5761. * // => false
  5762. *
  5763. * _.isEmpty({ 'a': 1 });
  5764. * // => false
  5765. */function isEmpty(value){if(value==null){return true;}if(isArrayLike(value)&&(isArray(value)||typeof value==='string'||typeof value.splice==='function'||isBuffer(value)||isTypedArray(value)||isArguments(value))){return!value.length;}var tag=getTag(value);if(tag==mapTag||tag==setTag){return!value.size;}if(isPrototype(value)){return!baseKeys(value).length;}for(var key in value){if(hasOwnProperty.call(value,key)){return false;}}return true;}/**
  5766. * Performs a deep comparison between two values to determine if they are
  5767. * equivalent.
  5768. *
  5769. * **Note:** This method supports comparing arrays, array buffers, booleans,
  5770. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  5771. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  5772. * by their own, not inherited, enumerable properties. Functions and DOM
  5773. * nodes are compared by strict equality, i.e. `===`.
  5774. *
  5775. * @static
  5776. * @memberOf _
  5777. * @since 0.1.0
  5778. * @category Lang
  5779. * @param {*} value The value to compare.
  5780. * @param {*} other The other value to compare.
  5781. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  5782. * @example
  5783. *
  5784. * var object = { 'a': 1 };
  5785. * var other = { 'a': 1 };
  5786. *
  5787. * _.isEqual(object, other);
  5788. * // => true
  5789. *
  5790. * object === other;
  5791. * // => false
  5792. */function isEqual(value,other){return baseIsEqual(value,other);}/**
  5793. * This method is like `_.isEqual` except that it accepts `customizer` which
  5794. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  5795. * are handled by the method instead. The `customizer` is invoked with up to
  5796. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  5797. *
  5798. * @static
  5799. * @memberOf _
  5800. * @since 4.0.0
  5801. * @category Lang
  5802. * @param {*} value The value to compare.
  5803. * @param {*} other The other value to compare.
  5804. * @param {Function} [customizer] The function to customize comparisons.
  5805. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  5806. * @example
  5807. *
  5808. * function isGreeting(value) {
  5809. * return /^h(?:i|ello)$/.test(value);
  5810. * }
  5811. *
  5812. * function customizer(objValue, othValue) {
  5813. * if (isGreeting(objValue) && isGreeting(othValue)) {
  5814. * return true;
  5815. * }
  5816. * }
  5817. *
  5818. * var array = ['hello', 'goodbye'];
  5819. * var other = ['hi', 'goodbye'];
  5820. *
  5821. * _.isEqualWith(array, other, customizer);
  5822. * // => true
  5823. */function isEqualWith(value,other,customizer){customizer=typeof customizer==='function'?customizer:undefined;var result=customizer?customizer(value,other):undefined;return result===undefined?baseIsEqual(value,other,undefined,customizer):!!result;}/**
  5824. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  5825. * `SyntaxError`, `TypeError`, or `URIError` object.
  5826. *
  5827. * @static
  5828. * @memberOf _
  5829. * @since 3.0.0
  5830. * @category Lang
  5831. * @param {*} value The value to check.
  5832. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  5833. * @example
  5834. *
  5835. * _.isError(new Error);
  5836. * // => true
  5837. *
  5838. * _.isError(Error);
  5839. * // => false
  5840. */function isError(value){if(!isObjectLike(value)){return false;}var tag=baseGetTag(value);return tag==errorTag||tag==domExcTag||typeof value.message==='string'&&typeof value.name==='string'&&!isPlainObject(value);}/**
  5841. * Checks if `value` is a finite primitive number.
  5842. *
  5843. * **Note:** This method is based on
  5844. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  5845. *
  5846. * @static
  5847. * @memberOf _
  5848. * @since 0.1.0
  5849. * @category Lang
  5850. * @param {*} value The value to check.
  5851. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  5852. * @example
  5853. *
  5854. * _.isFinite(3);
  5855. * // => true
  5856. *
  5857. * _.isFinite(Number.MIN_VALUE);
  5858. * // => true
  5859. *
  5860. * _.isFinite(Infinity);
  5861. * // => false
  5862. *
  5863. * _.isFinite('3');
  5864. * // => false
  5865. */function isFinite(value){return typeof value==='number'&&nativeIsFinite(value);}/**
  5866. * Checks if `value` is classified as a `Function` object.
  5867. *
  5868. * @static
  5869. * @memberOf _
  5870. * @since 0.1.0
  5871. * @category Lang
  5872. * @param {*} value The value to check.
  5873. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  5874. * @example
  5875. *
  5876. * _.isFunction(_);
  5877. * // => true
  5878. *
  5879. * _.isFunction(/abc/);
  5880. * // => false
  5881. */function isFunction(value){if(!isObject(value)){return false;}// The use of `Object#toString` avoids issues with the `typeof` operator
  5882. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  5883. var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag;}/**
  5884. * Checks if `value` is an integer.
  5885. *
  5886. * **Note:** This method is based on
  5887. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  5888. *
  5889. * @static
  5890. * @memberOf _
  5891. * @since 4.0.0
  5892. * @category Lang
  5893. * @param {*} value The value to check.
  5894. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  5895. * @example
  5896. *
  5897. * _.isInteger(3);
  5898. * // => true
  5899. *
  5900. * _.isInteger(Number.MIN_VALUE);
  5901. * // => false
  5902. *
  5903. * _.isInteger(Infinity);
  5904. * // => false
  5905. *
  5906. * _.isInteger('3');
  5907. * // => false
  5908. */function isInteger(value){return typeof value==='number'&&value==toInteger(value);}/**
  5909. * Checks if `value` is a valid array-like length.
  5910. *
  5911. * **Note:** This method is loosely based on
  5912. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  5913. *
  5914. * @static
  5915. * @memberOf _
  5916. * @since 4.0.0
  5917. * @category Lang
  5918. * @param {*} value The value to check.
  5919. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  5920. * @example
  5921. *
  5922. * _.isLength(3);
  5923. * // => true
  5924. *
  5925. * _.isLength(Number.MIN_VALUE);
  5926. * // => false
  5927. *
  5928. * _.isLength(Infinity);
  5929. * // => false
  5930. *
  5931. * _.isLength('3');
  5932. * // => false
  5933. */function isLength(value){return typeof value==='number'&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}/**
  5934. * Checks if `value` is the
  5935. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  5936. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  5937. *
  5938. * @static
  5939. * @memberOf _
  5940. * @since 0.1.0
  5941. * @category Lang
  5942. * @param {*} value The value to check.
  5943. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  5944. * @example
  5945. *
  5946. * _.isObject({});
  5947. * // => true
  5948. *
  5949. * _.isObject([1, 2, 3]);
  5950. * // => true
  5951. *
  5952. * _.isObject(_.noop);
  5953. * // => true
  5954. *
  5955. * _.isObject(null);
  5956. * // => false
  5957. */function isObject(value){var type=typeof value==='undefined'?'undefined':_typeof(value);return value!=null&&(type=='object'||type=='function');}/**
  5958. * Checks if `value` is object-like. A value is object-like if it's not `null`
  5959. * and has a `typeof` result of "object".
  5960. *
  5961. * @static
  5962. * @memberOf _
  5963. * @since 4.0.0
  5964. * @category Lang
  5965. * @param {*} value The value to check.
  5966. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  5967. * @example
  5968. *
  5969. * _.isObjectLike({});
  5970. * // => true
  5971. *
  5972. * _.isObjectLike([1, 2, 3]);
  5973. * // => true
  5974. *
  5975. * _.isObjectLike(_.noop);
  5976. * // => false
  5977. *
  5978. * _.isObjectLike(null);
  5979. * // => false
  5980. */function isObjectLike(value){return value!=null&&(typeof value==='undefined'?'undefined':_typeof(value))==='object';}/**
  5981. * Checks if `value` is classified as a `Map` object.
  5982. *
  5983. * @static
  5984. * @memberOf _
  5985. * @since 4.3.0
  5986. * @category Lang
  5987. * @param {*} value The value to check.
  5988. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  5989. * @example
  5990. *
  5991. * _.isMap(new Map);
  5992. * // => true
  5993. *
  5994. * _.isMap(new WeakMap);
  5995. * // => false
  5996. */var isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap;/**
  5997. * Performs a partial deep comparison between `object` and `source` to
  5998. * determine if `object` contains equivalent property values.
  5999. *
  6000. * **Note:** This method is equivalent to `_.matches` when `source` is
  6001. * partially applied.
  6002. *
  6003. * Partial comparisons will match empty array and empty object `source`
  6004. * values against any array or object value, respectively. See `_.isEqual`
  6005. * for a list of supported value comparisons.
  6006. *
  6007. * @static
  6008. * @memberOf _
  6009. * @since 3.0.0
  6010. * @category Lang
  6011. * @param {Object} object The object to inspect.
  6012. * @param {Object} source The object of property values to match.
  6013. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  6014. * @example
  6015. *
  6016. * var object = { 'a': 1, 'b': 2 };
  6017. *
  6018. * _.isMatch(object, { 'b': 2 });
  6019. * // => true
  6020. *
  6021. * _.isMatch(object, { 'b': 1 });
  6022. * // => false
  6023. */function isMatch(object,source){return object===source||baseIsMatch(object,source,getMatchData(source));}/**
  6024. * This method is like `_.isMatch` except that it accepts `customizer` which
  6025. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  6026. * are handled by the method instead. The `customizer` is invoked with five
  6027. * arguments: (objValue, srcValue, index|key, object, source).
  6028. *
  6029. * @static
  6030. * @memberOf _
  6031. * @since 4.0.0
  6032. * @category Lang
  6033. * @param {Object} object The object to inspect.
  6034. * @param {Object} source The object of property values to match.
  6035. * @param {Function} [customizer] The function to customize comparisons.
  6036. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  6037. * @example
  6038. *
  6039. * function isGreeting(value) {
  6040. * return /^h(?:i|ello)$/.test(value);
  6041. * }
  6042. *
  6043. * function customizer(objValue, srcValue) {
  6044. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  6045. * return true;
  6046. * }
  6047. * }
  6048. *
  6049. * var object = { 'greeting': 'hello' };
  6050. * var source = { 'greeting': 'hi' };
  6051. *
  6052. * _.isMatchWith(object, source, customizer);
  6053. * // => true
  6054. */function isMatchWith(object,source,customizer){customizer=typeof customizer==='function'?customizer:undefined;return baseIsMatch(object,source,getMatchData(source),customizer);}/**
  6055. * Checks if `value` is `NaN`.
  6056. *
  6057. * **Note:** This method is based on
  6058. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  6059. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  6060. * `undefined` and other non-number values.
  6061. *
  6062. * @static
  6063. * @memberOf _
  6064. * @since 0.1.0
  6065. * @category Lang
  6066. * @param {*} value The value to check.
  6067. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  6068. * @example
  6069. *
  6070. * _.isNaN(NaN);
  6071. * // => true
  6072. *
  6073. * _.isNaN(new Number(NaN));
  6074. * // => true
  6075. *
  6076. * isNaN(undefined);
  6077. * // => true
  6078. *
  6079. * _.isNaN(undefined);
  6080. * // => false
  6081. */function isNaN(value){// An `NaN` primitive is the only value that is not equal to itself.
  6082. // Perform the `toStringTag` check first to avoid errors with some
  6083. // ActiveX objects in IE.
  6084. return isNumber(value)&&value!=+value;}/**
  6085. * Checks if `value` is a pristine native function.
  6086. *
  6087. * **Note:** This method can't reliably detect native functions in the presence
  6088. * of the core-js package because core-js circumvents this kind of detection.
  6089. * Despite multiple requests, the core-js maintainer has made it clear: any
  6090. * attempt to fix the detection will be obstructed. As a result, we're left
  6091. * with little choice but to throw an error. Unfortunately, this also affects
  6092. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  6093. * which rely on core-js.
  6094. *
  6095. * @static
  6096. * @memberOf _
  6097. * @since 3.0.0
  6098. * @category Lang
  6099. * @param {*} value The value to check.
  6100. * @returns {boolean} Returns `true` if `value` is a native function,
  6101. * else `false`.
  6102. * @example
  6103. *
  6104. * _.isNative(Array.prototype.push);
  6105. * // => true
  6106. *
  6107. * _.isNative(_);
  6108. * // => false
  6109. */function isNative(value){if(isMaskable(value)){throw new Error(CORE_ERROR_TEXT);}return baseIsNative(value);}/**
  6110. * Checks if `value` is `null`.
  6111. *
  6112. * @static
  6113. * @memberOf _
  6114. * @since 0.1.0
  6115. * @category Lang
  6116. * @param {*} value The value to check.
  6117. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  6118. * @example
  6119. *
  6120. * _.isNull(null);
  6121. * // => true
  6122. *
  6123. * _.isNull(void 0);
  6124. * // => false
  6125. */function isNull(value){return value===null;}/**
  6126. * Checks if `value` is `null` or `undefined`.
  6127. *
  6128. * @static
  6129. * @memberOf _
  6130. * @since 4.0.0
  6131. * @category Lang
  6132. * @param {*} value The value to check.
  6133. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  6134. * @example
  6135. *
  6136. * _.isNil(null);
  6137. * // => true
  6138. *
  6139. * _.isNil(void 0);
  6140. * // => true
  6141. *
  6142. * _.isNil(NaN);
  6143. * // => false
  6144. */function isNil(value){return value==null;}/**
  6145. * Checks if `value` is classified as a `Number` primitive or object.
  6146. *
  6147. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  6148. * classified as numbers, use the `_.isFinite` method.
  6149. *
  6150. * @static
  6151. * @memberOf _
  6152. * @since 0.1.0
  6153. * @category Lang
  6154. * @param {*} value The value to check.
  6155. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  6156. * @example
  6157. *
  6158. * _.isNumber(3);
  6159. * // => true
  6160. *
  6161. * _.isNumber(Number.MIN_VALUE);
  6162. * // => true
  6163. *
  6164. * _.isNumber(Infinity);
  6165. * // => true
  6166. *
  6167. * _.isNumber('3');
  6168. * // => false
  6169. */function isNumber(value){return typeof value==='number'||isObjectLike(value)&&baseGetTag(value)==numberTag;}/**
  6170. * Checks if `value` is a plain object, that is, an object created by the
  6171. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  6172. *
  6173. * @static
  6174. * @memberOf _
  6175. * @since 0.8.0
  6176. * @category Lang
  6177. * @param {*} value The value to check.
  6178. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  6179. * @example
  6180. *
  6181. * function Foo() {
  6182. * this.a = 1;
  6183. * }
  6184. *
  6185. * _.isPlainObject(new Foo);
  6186. * // => false
  6187. *
  6188. * _.isPlainObject([1, 2, 3]);
  6189. * // => false
  6190. *
  6191. * _.isPlainObject({ 'x': 0, 'y': 0 });
  6192. * // => true
  6193. *
  6194. * _.isPlainObject(Object.create(null));
  6195. * // => true
  6196. */function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag){return false;}var proto=getPrototype(value);if(proto===null){return true;}var Ctor=hasOwnProperty.call(proto,'constructor')&&proto.constructor;return typeof Ctor==='function'&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString;}/**
  6197. * Checks if `value` is classified as a `RegExp` object.
  6198. *
  6199. * @static
  6200. * @memberOf _
  6201. * @since 0.1.0
  6202. * @category Lang
  6203. * @param {*} value The value to check.
  6204. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  6205. * @example
  6206. *
  6207. * _.isRegExp(/abc/);
  6208. * // => true
  6209. *
  6210. * _.isRegExp('/abc/');
  6211. * // => false
  6212. */var isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):baseIsRegExp;/**
  6213. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  6214. * double precision number which isn't the result of a rounded unsafe integer.
  6215. *
  6216. * **Note:** This method is based on
  6217. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  6218. *
  6219. * @static
  6220. * @memberOf _
  6221. * @since 4.0.0
  6222. * @category Lang
  6223. * @param {*} value The value to check.
  6224. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  6225. * @example
  6226. *
  6227. * _.isSafeInteger(3);
  6228. * // => true
  6229. *
  6230. * _.isSafeInteger(Number.MIN_VALUE);
  6231. * // => false
  6232. *
  6233. * _.isSafeInteger(Infinity);
  6234. * // => false
  6235. *
  6236. * _.isSafeInteger('3');
  6237. * // => false
  6238. */function isSafeInteger(value){return isInteger(value)&&value>=-MAX_SAFE_INTEGER&&value<=MAX_SAFE_INTEGER;}/**
  6239. * Checks if `value` is classified as a `Set` object.
  6240. *
  6241. * @static
  6242. * @memberOf _
  6243. * @since 4.3.0
  6244. * @category Lang
  6245. * @param {*} value The value to check.
  6246. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  6247. * @example
  6248. *
  6249. * _.isSet(new Set);
  6250. * // => true
  6251. *
  6252. * _.isSet(new WeakSet);
  6253. * // => false
  6254. */var isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet;/**
  6255. * Checks if `value` is classified as a `String` primitive or object.
  6256. *
  6257. * @static
  6258. * @since 0.1.0
  6259. * @memberOf _
  6260. * @category Lang
  6261. * @param {*} value The value to check.
  6262. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  6263. * @example
  6264. *
  6265. * _.isString('abc');
  6266. * // => true
  6267. *
  6268. * _.isString(1);
  6269. * // => false
  6270. */function isString(value){return typeof value==='string'||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag;}/**
  6271. * Checks if `value` is classified as a `Symbol` primitive or object.
  6272. *
  6273. * @static
  6274. * @memberOf _
  6275. * @since 4.0.0
  6276. * @category Lang
  6277. * @param {*} value The value to check.
  6278. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  6279. * @example
  6280. *
  6281. * _.isSymbol(Symbol.iterator);
  6282. * // => true
  6283. *
  6284. * _.isSymbol('abc');
  6285. * // => false
  6286. */function isSymbol(value){return(typeof value==='undefined'?'undefined':_typeof(value))==='symbol'||isObjectLike(value)&&baseGetTag(value)==symbolTag;}/**
  6287. * Checks if `value` is classified as a typed array.
  6288. *
  6289. * @static
  6290. * @memberOf _
  6291. * @since 3.0.0
  6292. * @category Lang
  6293. * @param {*} value The value to check.
  6294. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  6295. * @example
  6296. *
  6297. * _.isTypedArray(new Uint8Array);
  6298. * // => true
  6299. *
  6300. * _.isTypedArray([]);
  6301. * // => false
  6302. */var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;/**
  6303. * Checks if `value` is `undefined`.
  6304. *
  6305. * @static
  6306. * @since 0.1.0
  6307. * @memberOf _
  6308. * @category Lang
  6309. * @param {*} value The value to check.
  6310. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  6311. * @example
  6312. *
  6313. * _.isUndefined(void 0);
  6314. * // => true
  6315. *
  6316. * _.isUndefined(null);
  6317. * // => false
  6318. */function isUndefined(value){return value===undefined;}/**
  6319. * Checks if `value` is classified as a `WeakMap` object.
  6320. *
  6321. * @static
  6322. * @memberOf _
  6323. * @since 4.3.0
  6324. * @category Lang
  6325. * @param {*} value The value to check.
  6326. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  6327. * @example
  6328. *
  6329. * _.isWeakMap(new WeakMap);
  6330. * // => true
  6331. *
  6332. * _.isWeakMap(new Map);
  6333. * // => false
  6334. */function isWeakMap(value){return isObjectLike(value)&&getTag(value)==weakMapTag;}/**
  6335. * Checks if `value` is classified as a `WeakSet` object.
  6336. *
  6337. * @static
  6338. * @memberOf _
  6339. * @since 4.3.0
  6340. * @category Lang
  6341. * @param {*} value The value to check.
  6342. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  6343. * @example
  6344. *
  6345. * _.isWeakSet(new WeakSet);
  6346. * // => true
  6347. *
  6348. * _.isWeakSet(new Set);
  6349. * // => false
  6350. */function isWeakSet(value){return isObjectLike(value)&&baseGetTag(value)==weakSetTag;}/**
  6351. * Checks if `value` is less than `other`.
  6352. *
  6353. * @static
  6354. * @memberOf _
  6355. * @since 3.9.0
  6356. * @category Lang
  6357. * @param {*} value The value to compare.
  6358. * @param {*} other The other value to compare.
  6359. * @returns {boolean} Returns `true` if `value` is less than `other`,
  6360. * else `false`.
  6361. * @see _.gt
  6362. * @example
  6363. *
  6364. * _.lt(1, 3);
  6365. * // => true
  6366. *
  6367. * _.lt(3, 3);
  6368. * // => false
  6369. *
  6370. * _.lt(3, 1);
  6371. * // => false
  6372. */var lt=createRelationalOperation(baseLt);/**
  6373. * Checks if `value` is less than or equal to `other`.
  6374. *
  6375. * @static
  6376. * @memberOf _
  6377. * @since 3.9.0
  6378. * @category Lang
  6379. * @param {*} value The value to compare.
  6380. * @param {*} other The other value to compare.
  6381. * @returns {boolean} Returns `true` if `value` is less than or equal to
  6382. * `other`, else `false`.
  6383. * @see _.gte
  6384. * @example
  6385. *
  6386. * _.lte(1, 3);
  6387. * // => true
  6388. *
  6389. * _.lte(3, 3);
  6390. * // => true
  6391. *
  6392. * _.lte(3, 1);
  6393. * // => false
  6394. */var lte=createRelationalOperation(function(value,other){return value<=other;});/**
  6395. * Converts `value` to an array.
  6396. *
  6397. * @static
  6398. * @since 0.1.0
  6399. * @memberOf _
  6400. * @category Lang
  6401. * @param {*} value The value to convert.
  6402. * @returns {Array} Returns the converted array.
  6403. * @example
  6404. *
  6405. * _.toArray({ 'a': 1, 'b': 2 });
  6406. * // => [1, 2]
  6407. *
  6408. * _.toArray('abc');
  6409. * // => ['a', 'b', 'c']
  6410. *
  6411. * _.toArray(1);
  6412. * // => []
  6413. *
  6414. * _.toArray(null);
  6415. * // => []
  6416. */function toArray(value){if(!value){return[];}if(isArrayLike(value)){return isString(value)?stringToArray(value):copyArray(value);}if(symIterator&&value[symIterator]){return iteratorToArray(value[symIterator]());}var tag=getTag(value),func=tag==mapTag?mapToArray:tag==setTag?setToArray:values;return func(value);}/**
  6417. * Converts `value` to a finite number.
  6418. *
  6419. * @static
  6420. * @memberOf _
  6421. * @since 4.12.0
  6422. * @category Lang
  6423. * @param {*} value The value to convert.
  6424. * @returns {number} Returns the converted number.
  6425. * @example
  6426. *
  6427. * _.toFinite(3.2);
  6428. * // => 3.2
  6429. *
  6430. * _.toFinite(Number.MIN_VALUE);
  6431. * // => 5e-324
  6432. *
  6433. * _.toFinite(Infinity);
  6434. * // => 1.7976931348623157e+308
  6435. *
  6436. * _.toFinite('3.2');
  6437. * // => 3.2
  6438. */function toFinite(value){if(!value){return value===0?value:0;}value=toNumber(value);if(value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER;}return value===value?value:0;}/**
  6439. * Converts `value` to an integer.
  6440. *
  6441. * **Note:** This method is loosely based on
  6442. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  6443. *
  6444. * @static
  6445. * @memberOf _
  6446. * @since 4.0.0
  6447. * @category Lang
  6448. * @param {*} value The value to convert.
  6449. * @returns {number} Returns the converted integer.
  6450. * @example
  6451. *
  6452. * _.toInteger(3.2);
  6453. * // => 3
  6454. *
  6455. * _.toInteger(Number.MIN_VALUE);
  6456. * // => 0
  6457. *
  6458. * _.toInteger(Infinity);
  6459. * // => 1.7976931348623157e+308
  6460. *
  6461. * _.toInteger('3.2');
  6462. * // => 3
  6463. */function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0;}/**
  6464. * Converts `value` to an integer suitable for use as the length of an
  6465. * array-like object.
  6466. *
  6467. * **Note:** This method is based on
  6468. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  6469. *
  6470. * @static
  6471. * @memberOf _
  6472. * @since 4.0.0
  6473. * @category Lang
  6474. * @param {*} value The value to convert.
  6475. * @returns {number} Returns the converted integer.
  6476. * @example
  6477. *
  6478. * _.toLength(3.2);
  6479. * // => 3
  6480. *
  6481. * _.toLength(Number.MIN_VALUE);
  6482. * // => 0
  6483. *
  6484. * _.toLength(Infinity);
  6485. * // => 4294967295
  6486. *
  6487. * _.toLength('3.2');
  6488. * // => 3
  6489. */function toLength(value){return value?baseClamp(toInteger(value),0,MAX_ARRAY_LENGTH):0;}/**
  6490. * Converts `value` to a number.
  6491. *
  6492. * @static
  6493. * @memberOf _
  6494. * @since 4.0.0
  6495. * @category Lang
  6496. * @param {*} value The value to process.
  6497. * @returns {number} Returns the number.
  6498. * @example
  6499. *
  6500. * _.toNumber(3.2);
  6501. * // => 3.2
  6502. *
  6503. * _.toNumber(Number.MIN_VALUE);
  6504. * // => 5e-324
  6505. *
  6506. * _.toNumber(Infinity);
  6507. * // => Infinity
  6508. *
  6509. * _.toNumber('3.2');
  6510. * // => 3.2
  6511. */function toNumber(value){if(typeof value==='number'){return value;}if(isSymbol(value)){return NAN;}if(isObject(value)){var other=typeof value.valueOf==='function'?value.valueOf():value;value=isObject(other)?other+'':other;}if(typeof value!=='string'){return value===0?value:+value;}value=value.replace(reTrim,'');var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value;}/**
  6512. * Converts `value` to a plain object flattening inherited enumerable string
  6513. * keyed properties of `value` to own properties of the plain object.
  6514. *
  6515. * @static
  6516. * @memberOf _
  6517. * @since 3.0.0
  6518. * @category Lang
  6519. * @param {*} value The value to convert.
  6520. * @returns {Object} Returns the converted plain object.
  6521. * @example
  6522. *
  6523. * function Foo() {
  6524. * this.b = 2;
  6525. * }
  6526. *
  6527. * Foo.prototype.c = 3;
  6528. *
  6529. * _.assign({ 'a': 1 }, new Foo);
  6530. * // => { 'a': 1, 'b': 2 }
  6531. *
  6532. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  6533. * // => { 'a': 1, 'b': 2, 'c': 3 }
  6534. */function toPlainObject(value){return copyObject(value,keysIn(value));}/**
  6535. * Converts `value` to a safe integer. A safe integer can be compared and
  6536. * represented correctly.
  6537. *
  6538. * @static
  6539. * @memberOf _
  6540. * @since 4.0.0
  6541. * @category Lang
  6542. * @param {*} value The value to convert.
  6543. * @returns {number} Returns the converted integer.
  6544. * @example
  6545. *
  6546. * _.toSafeInteger(3.2);
  6547. * // => 3
  6548. *
  6549. * _.toSafeInteger(Number.MIN_VALUE);
  6550. * // => 0
  6551. *
  6552. * _.toSafeInteger(Infinity);
  6553. * // => 9007199254740991
  6554. *
  6555. * _.toSafeInteger('3.2');
  6556. * // => 3
  6557. */function toSafeInteger(value){return value?baseClamp(toInteger(value),-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER):value===0?value:0;}/**
  6558. * Converts `value` to a string. An empty string is returned for `null`
  6559. * and `undefined` values. The sign of `-0` is preserved.
  6560. *
  6561. * @static
  6562. * @memberOf _
  6563. * @since 4.0.0
  6564. * @category Lang
  6565. * @param {*} value The value to convert.
  6566. * @returns {string} Returns the converted string.
  6567. * @example
  6568. *
  6569. * _.toString(null);
  6570. * // => ''
  6571. *
  6572. * _.toString(-0);
  6573. * // => '-0'
  6574. *
  6575. * _.toString([1, 2, 3]);
  6576. * // => '1,2,3'
  6577. */function toString(value){return value==null?'':baseToString(value);}/* ------------------------------------------------------------------------*//**
  6578. * Assigns own enumerable string keyed properties of source objects to the
  6579. * destination object. Source objects are applied from left to right.
  6580. * Subsequent sources overwrite property assignments of previous sources.
  6581. *
  6582. * **Note:** This method mutates `object` and is loosely based on
  6583. * [`Object.assign`](https://mdn.io/Object/assign).
  6584. *
  6585. * @static
  6586. * @memberOf _
  6587. * @since 0.10.0
  6588. * @category Object
  6589. * @param {Object} object The destination object.
  6590. * @param {...Object} [sources] The source objects.
  6591. * @returns {Object} Returns `object`.
  6592. * @see _.assignIn
  6593. * @example
  6594. *
  6595. * function Foo() {
  6596. * this.a = 1;
  6597. * }
  6598. *
  6599. * function Bar() {
  6600. * this.c = 3;
  6601. * }
  6602. *
  6603. * Foo.prototype.b = 2;
  6604. * Bar.prototype.d = 4;
  6605. *
  6606. * _.assign({ 'a': 0 }, new Foo, new Bar);
  6607. * // => { 'a': 1, 'c': 3 }
  6608. */var assign=createAssigner(function(object,source){if(isPrototype(source)||isArrayLike(source)){copyObject(source,keys(source),object);return;}for(var key in source){if(hasOwnProperty.call(source,key)){assignValue(object,key,source[key]);}}});/**
  6609. * This method is like `_.assign` except that it iterates over own and
  6610. * inherited source properties.
  6611. *
  6612. * **Note:** This method mutates `object`.
  6613. *
  6614. * @static
  6615. * @memberOf _
  6616. * @since 4.0.0
  6617. * @alias extend
  6618. * @category Object
  6619. * @param {Object} object The destination object.
  6620. * @param {...Object} [sources] The source objects.
  6621. * @returns {Object} Returns `object`.
  6622. * @see _.assign
  6623. * @example
  6624. *
  6625. * function Foo() {
  6626. * this.a = 1;
  6627. * }
  6628. *
  6629. * function Bar() {
  6630. * this.c = 3;
  6631. * }
  6632. *
  6633. * Foo.prototype.b = 2;
  6634. * Bar.prototype.d = 4;
  6635. *
  6636. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  6637. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  6638. */var assignIn=createAssigner(function(object,source){copyObject(source,keysIn(source),object);});/**
  6639. * This method is like `_.assignIn` except that it accepts `customizer`
  6640. * which is invoked to produce the assigned values. If `customizer` returns
  6641. * `undefined`, assignment is handled by the method instead. The `customizer`
  6642. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  6643. *
  6644. * **Note:** This method mutates `object`.
  6645. *
  6646. * @static
  6647. * @memberOf _
  6648. * @since 4.0.0
  6649. * @alias extendWith
  6650. * @category Object
  6651. * @param {Object} object The destination object.
  6652. * @param {...Object} sources The source objects.
  6653. * @param {Function} [customizer] The function to customize assigned values.
  6654. * @returns {Object} Returns `object`.
  6655. * @see _.assignWith
  6656. * @example
  6657. *
  6658. * function customizer(objValue, srcValue) {
  6659. * return _.isUndefined(objValue) ? srcValue : objValue;
  6660. * }
  6661. *
  6662. * var defaults = _.partialRight(_.assignInWith, customizer);
  6663. *
  6664. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  6665. * // => { 'a': 1, 'b': 2 }
  6666. */var assignInWith=createAssigner(function(object,source,srcIndex,customizer){copyObject(source,keysIn(source),object,customizer);});/**
  6667. * This method is like `_.assign` except that it accepts `customizer`
  6668. * which is invoked to produce the assigned values. If `customizer` returns
  6669. * `undefined`, assignment is handled by the method instead. The `customizer`
  6670. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  6671. *
  6672. * **Note:** This method mutates `object`.
  6673. *
  6674. * @static
  6675. * @memberOf _
  6676. * @since 4.0.0
  6677. * @category Object
  6678. * @param {Object} object The destination object.
  6679. * @param {...Object} sources The source objects.
  6680. * @param {Function} [customizer] The function to customize assigned values.
  6681. * @returns {Object} Returns `object`.
  6682. * @see _.assignInWith
  6683. * @example
  6684. *
  6685. * function customizer(objValue, srcValue) {
  6686. * return _.isUndefined(objValue) ? srcValue : objValue;
  6687. * }
  6688. *
  6689. * var defaults = _.partialRight(_.assignWith, customizer);
  6690. *
  6691. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  6692. * // => { 'a': 1, 'b': 2 }
  6693. */var assignWith=createAssigner(function(object,source,srcIndex,customizer){copyObject(source,keys(source),object,customizer);});/**
  6694. * Creates an array of values corresponding to `paths` of `object`.
  6695. *
  6696. * @static
  6697. * @memberOf _
  6698. * @since 1.0.0
  6699. * @category Object
  6700. * @param {Object} object The object to iterate over.
  6701. * @param {...(string|string[])} [paths] The property paths to pick.
  6702. * @returns {Array} Returns the picked values.
  6703. * @example
  6704. *
  6705. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  6706. *
  6707. * _.at(object, ['a[0].b.c', 'a[1]']);
  6708. * // => [3, 4]
  6709. */var at=flatRest(baseAt);/**
  6710. * Creates an object that inherits from the `prototype` object. If a
  6711. * `properties` object is given, its own enumerable string keyed properties
  6712. * are assigned to the created object.
  6713. *
  6714. * @static
  6715. * @memberOf _
  6716. * @since 2.3.0
  6717. * @category Object
  6718. * @param {Object} prototype The object to inherit from.
  6719. * @param {Object} [properties] The properties to assign to the object.
  6720. * @returns {Object} Returns the new object.
  6721. * @example
  6722. *
  6723. * function Shape() {
  6724. * this.x = 0;
  6725. * this.y = 0;
  6726. * }
  6727. *
  6728. * function Circle() {
  6729. * Shape.call(this);
  6730. * }
  6731. *
  6732. * Circle.prototype = _.create(Shape.prototype, {
  6733. * 'constructor': Circle
  6734. * });
  6735. *
  6736. * var circle = new Circle;
  6737. * circle instanceof Circle;
  6738. * // => true
  6739. *
  6740. * circle instanceof Shape;
  6741. * // => true
  6742. */function create(prototype,properties){var result=baseCreate(prototype);return properties==null?result:baseAssign(result,properties);}/**
  6743. * Assigns own and inherited enumerable string keyed properties of source
  6744. * objects to the destination object for all destination properties that
  6745. * resolve to `undefined`. Source objects are applied from left to right.
  6746. * Once a property is set, additional values of the same property are ignored.
  6747. *
  6748. * **Note:** This method mutates `object`.
  6749. *
  6750. * @static
  6751. * @since 0.1.0
  6752. * @memberOf _
  6753. * @category Object
  6754. * @param {Object} object The destination object.
  6755. * @param {...Object} [sources] The source objects.
  6756. * @returns {Object} Returns `object`.
  6757. * @see _.defaultsDeep
  6758. * @example
  6759. *
  6760. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  6761. * // => { 'a': 1, 'b': 2 }
  6762. */var defaults=baseRest(function(object,sources){object=Object(object);var index=-1;var length=sources.length;var guard=length>2?sources[2]:undefined;if(guard&&isIterateeCall(sources[0],sources[1],guard)){length=1;}while(++index<length){var source=sources[index];var props=keysIn(source);var propsIndex=-1;var propsLength=props.length;while(++propsIndex<propsLength){var key=props[propsIndex];var value=object[key];if(value===undefined||eq(value,objectProto[key])&&!hasOwnProperty.call(object,key)){object[key]=source[key];}}}return object;});/**
  6763. * This method is like `_.defaults` except that it recursively assigns
  6764. * default properties.
  6765. *
  6766. * **Note:** This method mutates `object`.
  6767. *
  6768. * @static
  6769. * @memberOf _
  6770. * @since 3.10.0
  6771. * @category Object
  6772. * @param {Object} object The destination object.
  6773. * @param {...Object} [sources] The source objects.
  6774. * @returns {Object} Returns `object`.
  6775. * @see _.defaults
  6776. * @example
  6777. *
  6778. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  6779. * // => { 'a': { 'b': 2, 'c': 3 } }
  6780. */var defaultsDeep=baseRest(function(args){args.push(undefined,customDefaultsMerge);return apply(mergeWith,undefined,args);});/**
  6781. * This method is like `_.find` except that it returns the key of the first
  6782. * element `predicate` returns truthy for instead of the element itself.
  6783. *
  6784. * @static
  6785. * @memberOf _
  6786. * @since 1.1.0
  6787. * @category Object
  6788. * @param {Object} object The object to inspect.
  6789. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  6790. * @returns {string|undefined} Returns the key of the matched element,
  6791. * else `undefined`.
  6792. * @example
  6793. *
  6794. * var users = {
  6795. * 'barney': { 'age': 36, 'active': true },
  6796. * 'fred': { 'age': 40, 'active': false },
  6797. * 'pebbles': { 'age': 1, 'active': true }
  6798. * };
  6799. *
  6800. * _.findKey(users, function(o) { return o.age < 40; });
  6801. * // => 'barney' (iteration order is not guaranteed)
  6802. *
  6803. * // The `_.matches` iteratee shorthand.
  6804. * _.findKey(users, { 'age': 1, 'active': true });
  6805. * // => 'pebbles'
  6806. *
  6807. * // The `_.matchesProperty` iteratee shorthand.
  6808. * _.findKey(users, ['active', false]);
  6809. * // => 'fred'
  6810. *
  6811. * // The `_.property` iteratee shorthand.
  6812. * _.findKey(users, 'active');
  6813. * // => 'barney'
  6814. */function findKey(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwn);}/**
  6815. * This method is like `_.findKey` except that it iterates over elements of
  6816. * a collection in the opposite order.
  6817. *
  6818. * @static
  6819. * @memberOf _
  6820. * @since 2.0.0
  6821. * @category Object
  6822. * @param {Object} object The object to inspect.
  6823. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  6824. * @returns {string|undefined} Returns the key of the matched element,
  6825. * else `undefined`.
  6826. * @example
  6827. *
  6828. * var users = {
  6829. * 'barney': { 'age': 36, 'active': true },
  6830. * 'fred': { 'age': 40, 'active': false },
  6831. * 'pebbles': { 'age': 1, 'active': true }
  6832. * };
  6833. *
  6834. * _.findLastKey(users, function(o) { return o.age < 40; });
  6835. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  6836. *
  6837. * // The `_.matches` iteratee shorthand.
  6838. * _.findLastKey(users, { 'age': 36, 'active': true });
  6839. * // => 'barney'
  6840. *
  6841. * // The `_.matchesProperty` iteratee shorthand.
  6842. * _.findLastKey(users, ['active', false]);
  6843. * // => 'fred'
  6844. *
  6845. * // The `_.property` iteratee shorthand.
  6846. * _.findLastKey(users, 'active');
  6847. * // => 'pebbles'
  6848. */function findLastKey(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwnRight);}/**
  6849. * Iterates over own and inherited enumerable string keyed properties of an
  6850. * object and invokes `iteratee` for each property. The iteratee is invoked
  6851. * with three arguments: (value, key, object). Iteratee functions may exit
  6852. * iteration early by explicitly returning `false`.
  6853. *
  6854. * @static
  6855. * @memberOf _
  6856. * @since 0.3.0
  6857. * @category Object
  6858. * @param {Object} object The object to iterate over.
  6859. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  6860. * @returns {Object} Returns `object`.
  6861. * @see _.forInRight
  6862. * @example
  6863. *
  6864. * function Foo() {
  6865. * this.a = 1;
  6866. * this.b = 2;
  6867. * }
  6868. *
  6869. * Foo.prototype.c = 3;
  6870. *
  6871. * _.forIn(new Foo, function(value, key) {
  6872. * console.log(key);
  6873. * });
  6874. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  6875. */function forIn(object,iteratee){return object==null?object:baseFor(object,getIteratee(iteratee,3),keysIn);}/**
  6876. * This method is like `_.forIn` except that it iterates over properties of
  6877. * `object` in the opposite order.
  6878. *
  6879. * @static
  6880. * @memberOf _
  6881. * @since 2.0.0
  6882. * @category Object
  6883. * @param {Object} object The object to iterate over.
  6884. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  6885. * @returns {Object} Returns `object`.
  6886. * @see _.forIn
  6887. * @example
  6888. *
  6889. * function Foo() {
  6890. * this.a = 1;
  6891. * this.b = 2;
  6892. * }
  6893. *
  6894. * Foo.prototype.c = 3;
  6895. *
  6896. * _.forInRight(new Foo, function(value, key) {
  6897. * console.log(key);
  6898. * });
  6899. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  6900. */function forInRight(object,iteratee){return object==null?object:baseForRight(object,getIteratee(iteratee,3),keysIn);}/**
  6901. * Iterates over own enumerable string keyed properties of an object and
  6902. * invokes `iteratee` for each property. The iteratee is invoked with three
  6903. * arguments: (value, key, object). Iteratee functions may exit iteration
  6904. * early by explicitly returning `false`.
  6905. *
  6906. * @static
  6907. * @memberOf _
  6908. * @since 0.3.0
  6909. * @category Object
  6910. * @param {Object} object The object to iterate over.
  6911. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  6912. * @returns {Object} Returns `object`.
  6913. * @see _.forOwnRight
  6914. * @example
  6915. *
  6916. * function Foo() {
  6917. * this.a = 1;
  6918. * this.b = 2;
  6919. * }
  6920. *
  6921. * Foo.prototype.c = 3;
  6922. *
  6923. * _.forOwn(new Foo, function(value, key) {
  6924. * console.log(key);
  6925. * });
  6926. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  6927. */function forOwn(object,iteratee){return object&&baseForOwn(object,getIteratee(iteratee,3));}/**
  6928. * This method is like `_.forOwn` except that it iterates over properties of
  6929. * `object` in the opposite order.
  6930. *
  6931. * @static
  6932. * @memberOf _
  6933. * @since 2.0.0
  6934. * @category Object
  6935. * @param {Object} object The object to iterate over.
  6936. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  6937. * @returns {Object} Returns `object`.
  6938. * @see _.forOwn
  6939. * @example
  6940. *
  6941. * function Foo() {
  6942. * this.a = 1;
  6943. * this.b = 2;
  6944. * }
  6945. *
  6946. * Foo.prototype.c = 3;
  6947. *
  6948. * _.forOwnRight(new Foo, function(value, key) {
  6949. * console.log(key);
  6950. * });
  6951. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  6952. */function forOwnRight(object,iteratee){return object&&baseForOwnRight(object,getIteratee(iteratee,3));}/**
  6953. * Creates an array of function property names from own enumerable properties
  6954. * of `object`.
  6955. *
  6956. * @static
  6957. * @since 0.1.0
  6958. * @memberOf _
  6959. * @category Object
  6960. * @param {Object} object The object to inspect.
  6961. * @returns {Array} Returns the function names.
  6962. * @see _.functionsIn
  6963. * @example
  6964. *
  6965. * function Foo() {
  6966. * this.a = _.constant('a');
  6967. * this.b = _.constant('b');
  6968. * }
  6969. *
  6970. * Foo.prototype.c = _.constant('c');
  6971. *
  6972. * _.functions(new Foo);
  6973. * // => ['a', 'b']
  6974. */function functions(object){return object==null?[]:baseFunctions(object,keys(object));}/**
  6975. * Creates an array of function property names from own and inherited
  6976. * enumerable properties of `object`.
  6977. *
  6978. * @static
  6979. * @memberOf _
  6980. * @since 4.0.0
  6981. * @category Object
  6982. * @param {Object} object The object to inspect.
  6983. * @returns {Array} Returns the function names.
  6984. * @see _.functions
  6985. * @example
  6986. *
  6987. * function Foo() {
  6988. * this.a = _.constant('a');
  6989. * this.b = _.constant('b');
  6990. * }
  6991. *
  6992. * Foo.prototype.c = _.constant('c');
  6993. *
  6994. * _.functionsIn(new Foo);
  6995. * // => ['a', 'b', 'c']
  6996. */function functionsIn(object){return object==null?[]:baseFunctions(object,keysIn(object));}/**
  6997. * Gets the value at `path` of `object`. If the resolved value is
  6998. * `undefined`, the `defaultValue` is returned in its place.
  6999. *
  7000. * @static
  7001. * @memberOf _
  7002. * @since 3.7.0
  7003. * @category Object
  7004. * @param {Object} object The object to query.
  7005. * @param {Array|string} path The path of the property to get.
  7006. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  7007. * @returns {*} Returns the resolved value.
  7008. * @example
  7009. *
  7010. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  7011. *
  7012. * _.get(object, 'a[0].b.c');
  7013. * // => 3
  7014. *
  7015. * _.get(object, ['a', '0', 'b', 'c']);
  7016. * // => 3
  7017. *
  7018. * _.get(object, 'a.b.c', 'default');
  7019. * // => 'default'
  7020. */function get(object,path,defaultValue){var result=object==null?undefined:baseGet(object,path);return result===undefined?defaultValue:result;}/**
  7021. * Checks if `path` is a direct property of `object`.
  7022. *
  7023. * @static
  7024. * @since 0.1.0
  7025. * @memberOf _
  7026. * @category Object
  7027. * @param {Object} object The object to query.
  7028. * @param {Array|string} path The path to check.
  7029. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7030. * @example
  7031. *
  7032. * var object = { 'a': { 'b': 2 } };
  7033. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  7034. *
  7035. * _.has(object, 'a');
  7036. * // => true
  7037. *
  7038. * _.has(object, 'a.b');
  7039. * // => true
  7040. *
  7041. * _.has(object, ['a', 'b']);
  7042. * // => true
  7043. *
  7044. * _.has(other, 'a');
  7045. * // => false
  7046. */function has(object,path){return object!=null&&hasPath(object,path,baseHas);}/**
  7047. * Checks if `path` is a direct or inherited property of `object`.
  7048. *
  7049. * @static
  7050. * @memberOf _
  7051. * @since 4.0.0
  7052. * @category Object
  7053. * @param {Object} object The object to query.
  7054. * @param {Array|string} path The path to check.
  7055. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7056. * @example
  7057. *
  7058. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  7059. *
  7060. * _.hasIn(object, 'a');
  7061. * // => true
  7062. *
  7063. * _.hasIn(object, 'a.b');
  7064. * // => true
  7065. *
  7066. * _.hasIn(object, ['a', 'b']);
  7067. * // => true
  7068. *
  7069. * _.hasIn(object, 'b');
  7070. * // => false
  7071. */function hasIn(object,path){return object!=null&&hasPath(object,path,baseHasIn);}/**
  7072. * Creates an object composed of the inverted keys and values of `object`.
  7073. * If `object` contains duplicate values, subsequent values overwrite
  7074. * property assignments of previous values.
  7075. *
  7076. * @static
  7077. * @memberOf _
  7078. * @since 0.7.0
  7079. * @category Object
  7080. * @param {Object} object The object to invert.
  7081. * @returns {Object} Returns the new inverted object.
  7082. * @example
  7083. *
  7084. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  7085. *
  7086. * _.invert(object);
  7087. * // => { '1': 'c', '2': 'b' }
  7088. */var invert=createInverter(function(result,value,key){if(value!=null&&typeof value.toString!=='function'){value=nativeObjectToString.call(value);}result[value]=key;},constant(identity));/**
  7089. * This method is like `_.invert` except that the inverted object is generated
  7090. * from the results of running each element of `object` thru `iteratee`. The
  7091. * corresponding inverted value of each inverted key is an array of keys
  7092. * responsible for generating the inverted value. The iteratee is invoked
  7093. * with one argument: (value).
  7094. *
  7095. * @static
  7096. * @memberOf _
  7097. * @since 4.1.0
  7098. * @category Object
  7099. * @param {Object} object The object to invert.
  7100. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7101. * @returns {Object} Returns the new inverted object.
  7102. * @example
  7103. *
  7104. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  7105. *
  7106. * _.invertBy(object);
  7107. * // => { '1': ['a', 'c'], '2': ['b'] }
  7108. *
  7109. * _.invertBy(object, function(value) {
  7110. * return 'group' + value;
  7111. * });
  7112. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  7113. */var invertBy=createInverter(function(result,value,key){if(value!=null&&typeof value.toString!=='function'){value=nativeObjectToString.call(value);}if(hasOwnProperty.call(result,value)){result[value].push(key);}else{result[value]=[key];}},getIteratee);/**
  7114. * Invokes the method at `path` of `object`.
  7115. *
  7116. * @static
  7117. * @memberOf _
  7118. * @since 4.0.0
  7119. * @category Object
  7120. * @param {Object} object The object to query.
  7121. * @param {Array|string} path The path of the method to invoke.
  7122. * @param {...*} [args] The arguments to invoke the method with.
  7123. * @returns {*} Returns the result of the invoked method.
  7124. * @example
  7125. *
  7126. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  7127. *
  7128. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  7129. * // => [2, 3]
  7130. */var invoke=baseRest(baseInvoke);/**
  7131. * Creates an array of the own enumerable property names of `object`.
  7132. *
  7133. * **Note:** Non-object values are coerced to objects. See the
  7134. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7135. * for more details.
  7136. *
  7137. * @static
  7138. * @since 0.1.0
  7139. * @memberOf _
  7140. * @category Object
  7141. * @param {Object} object The object to query.
  7142. * @returns {Array} Returns the array of property names.
  7143. * @example
  7144. *
  7145. * function Foo() {
  7146. * this.a = 1;
  7147. * this.b = 2;
  7148. * }
  7149. *
  7150. * Foo.prototype.c = 3;
  7151. *
  7152. * _.keys(new Foo);
  7153. * // => ['a', 'b'] (iteration order is not guaranteed)
  7154. *
  7155. * _.keys('hi');
  7156. * // => ['0', '1']
  7157. */function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object);}/**
  7158. * Creates an array of the own and inherited enumerable property names of `object`.
  7159. *
  7160. * **Note:** Non-object values are coerced to objects.
  7161. *
  7162. * @static
  7163. * @memberOf _
  7164. * @since 3.0.0
  7165. * @category Object
  7166. * @param {Object} object The object to query.
  7167. * @returns {Array} Returns the array of property names.
  7168. * @example
  7169. *
  7170. * function Foo() {
  7171. * this.a = 1;
  7172. * this.b = 2;
  7173. * }
  7174. *
  7175. * Foo.prototype.c = 3;
  7176. *
  7177. * _.keysIn(new Foo);
  7178. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  7179. */function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,true):baseKeysIn(object);}/**
  7180. * The opposite of `_.mapValues`; this method creates an object with the
  7181. * same values as `object` and keys generated by running each own enumerable
  7182. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  7183. * with three arguments: (value, key, object).
  7184. *
  7185. * @static
  7186. * @memberOf _
  7187. * @since 3.8.0
  7188. * @category Object
  7189. * @param {Object} object The object to iterate over.
  7190. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  7191. * @returns {Object} Returns the new mapped object.
  7192. * @see _.mapValues
  7193. * @example
  7194. *
  7195. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  7196. * return key + value;
  7197. * });
  7198. * // => { 'a1': 1, 'b2': 2 }
  7199. */function mapKeys(object,iteratee){var result={};iteratee=getIteratee(iteratee,3);baseForOwn(object,function(value,key,object){baseAssignValue(result,iteratee(value,key,object),value);});return result;}/**
  7200. * Creates an object with the same keys as `object` and values generated
  7201. * by running each own enumerable string keyed property of `object` thru
  7202. * `iteratee`. The iteratee is invoked with three arguments:
  7203. * (value, key, object).
  7204. *
  7205. * @static
  7206. * @memberOf _
  7207. * @since 2.4.0
  7208. * @category Object
  7209. * @param {Object} object The object to iterate over.
  7210. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  7211. * @returns {Object} Returns the new mapped object.
  7212. * @see _.mapKeys
  7213. * @example
  7214. *
  7215. * var users = {
  7216. * 'fred': { 'user': 'fred', 'age': 40 },
  7217. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  7218. * };
  7219. *
  7220. * _.mapValues(users, function(o) { return o.age; });
  7221. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  7222. *
  7223. * // The `_.property` iteratee shorthand.
  7224. * _.mapValues(users, 'age');
  7225. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  7226. */function mapValues(object,iteratee){var result={};iteratee=getIteratee(iteratee,3);baseForOwn(object,function(value,key,object){baseAssignValue(result,key,iteratee(value,key,object));});return result;}/**
  7227. * This method is like `_.assign` except that it recursively merges own and
  7228. * inherited enumerable string keyed properties of source objects into the
  7229. * destination object. Source properties that resolve to `undefined` are
  7230. * skipped if a destination value exists. Array and plain object properties
  7231. * are merged recursively. Other objects and value types are overridden by
  7232. * assignment. Source objects are applied from left to right. Subsequent
  7233. * sources overwrite property assignments of previous sources.
  7234. *
  7235. * **Note:** This method mutates `object`.
  7236. *
  7237. * @static
  7238. * @memberOf _
  7239. * @since 0.5.0
  7240. * @category Object
  7241. * @param {Object} object The destination object.
  7242. * @param {...Object} [sources] The source objects.
  7243. * @returns {Object} Returns `object`.
  7244. * @example
  7245. *
  7246. * var object = {
  7247. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  7248. * };
  7249. *
  7250. * var other = {
  7251. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  7252. * };
  7253. *
  7254. * _.merge(object, other);
  7255. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  7256. */var merge=createAssigner(function(object,source,srcIndex){baseMerge(object,source,srcIndex);});/**
  7257. * This method is like `_.merge` except that it accepts `customizer` which
  7258. * is invoked to produce the merged values of the destination and source
  7259. * properties. If `customizer` returns `undefined`, merging is handled by the
  7260. * method instead. The `customizer` is invoked with six arguments:
  7261. * (objValue, srcValue, key, object, source, stack).
  7262. *
  7263. * **Note:** This method mutates `object`.
  7264. *
  7265. * @static
  7266. * @memberOf _
  7267. * @since 4.0.0
  7268. * @category Object
  7269. * @param {Object} object The destination object.
  7270. * @param {...Object} sources The source objects.
  7271. * @param {Function} customizer The function to customize assigned values.
  7272. * @returns {Object} Returns `object`.
  7273. * @example
  7274. *
  7275. * function customizer(objValue, srcValue) {
  7276. * if (_.isArray(objValue)) {
  7277. * return objValue.concat(srcValue);
  7278. * }
  7279. * }
  7280. *
  7281. * var object = { 'a': [1], 'b': [2] };
  7282. * var other = { 'a': [3], 'b': [4] };
  7283. *
  7284. * _.mergeWith(object, other, customizer);
  7285. * // => { 'a': [1, 3], 'b': [2, 4] }
  7286. */var mergeWith=createAssigner(function(object,source,srcIndex,customizer){baseMerge(object,source,srcIndex,customizer);});/**
  7287. * The opposite of `_.pick`; this method creates an object composed of the
  7288. * own and inherited enumerable property paths of `object` that are not omitted.
  7289. *
  7290. * **Note:** This method is considerably slower than `_.pick`.
  7291. *
  7292. * @static
  7293. * @since 0.1.0
  7294. * @memberOf _
  7295. * @category Object
  7296. * @param {Object} object The source object.
  7297. * @param {...(string|string[])} [paths] The property paths to omit.
  7298. * @returns {Object} Returns the new object.
  7299. * @example
  7300. *
  7301. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  7302. *
  7303. * _.omit(object, ['a', 'c']);
  7304. * // => { 'b': '2' }
  7305. */var omit=flatRest(function(object,paths){var result={};if(object==null){return result;}var isDeep=false;paths=arrayMap(paths,function(path){path=castPath(path,object);isDeep||(isDeep=path.length>1);return path;});copyObject(object,getAllKeysIn(object),result);if(isDeep){result=baseClone(result,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone);}var length=paths.length;while(length--){baseUnset(result,paths[length]);}return result;});/**
  7306. * The opposite of `_.pickBy`; this method creates an object composed of
  7307. * the own and inherited enumerable string keyed properties of `object` that
  7308. * `predicate` doesn't return truthy for. The predicate is invoked with two
  7309. * arguments: (value, key).
  7310. *
  7311. * @static
  7312. * @memberOf _
  7313. * @since 4.0.0
  7314. * @category Object
  7315. * @param {Object} object The source object.
  7316. * @param {Function} [predicate=_.identity] The function invoked per property.
  7317. * @returns {Object} Returns the new object.
  7318. * @example
  7319. *
  7320. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  7321. *
  7322. * _.omitBy(object, _.isNumber);
  7323. * // => { 'b': '2' }
  7324. */function omitBy(object,predicate){return pickBy(object,negate(getIteratee(predicate)));}/**
  7325. * Creates an object composed of the picked `object` properties.
  7326. *
  7327. * @static
  7328. * @since 0.1.0
  7329. * @memberOf _
  7330. * @category Object
  7331. * @param {Object} object The source object.
  7332. * @param {...(string|string[])} [paths] The property paths to pick.
  7333. * @returns {Object} Returns the new object.
  7334. * @example
  7335. *
  7336. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  7337. *
  7338. * _.pick(object, ['a', 'c']);
  7339. * // => { 'a': 1, 'c': 3 }
  7340. */var pick=flatRest(function(object,paths){return object==null?{}:basePick(object,paths);});/**
  7341. * Creates an object composed of the `object` properties `predicate` returns
  7342. * truthy for. The predicate is invoked with two arguments: (value, key).
  7343. *
  7344. * @static
  7345. * @memberOf _
  7346. * @since 4.0.0
  7347. * @category Object
  7348. * @param {Object} object The source object.
  7349. * @param {Function} [predicate=_.identity] The function invoked per property.
  7350. * @returns {Object} Returns the new object.
  7351. * @example
  7352. *
  7353. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  7354. *
  7355. * _.pickBy(object, _.isNumber);
  7356. * // => { 'a': 1, 'c': 3 }
  7357. */function pickBy(object,predicate){if(object==null){return{};}var props=arrayMap(getAllKeysIn(object),function(prop){return[prop];});predicate=getIteratee(predicate);return basePickBy(object,props,function(value,path){return predicate(value,path[0]);});}/**
  7358. * This method is like `_.get` except that if the resolved value is a
  7359. * function it's invoked with the `this` binding of its parent object and
  7360. * its result is returned.
  7361. *
  7362. * @static
  7363. * @since 0.1.0
  7364. * @memberOf _
  7365. * @category Object
  7366. * @param {Object} object The object to query.
  7367. * @param {Array|string} path The path of the property to resolve.
  7368. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  7369. * @returns {*} Returns the resolved value.
  7370. * @example
  7371. *
  7372. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  7373. *
  7374. * _.result(object, 'a[0].b.c1');
  7375. * // => 3
  7376. *
  7377. * _.result(object, 'a[0].b.c2');
  7378. * // => 4
  7379. *
  7380. * _.result(object, 'a[0].b.c3', 'default');
  7381. * // => 'default'
  7382. *
  7383. * _.result(object, 'a[0].b.c3', _.constant('default'));
  7384. * // => 'default'
  7385. */function result(object,path,defaultValue){path=castPath(path,object);var index=-1,length=path.length;// Ensure the loop is entered when path is empty.
  7386. if(!length){length=1;object=undefined;}while(++index<length){var value=object==null?undefined:object[toKey(path[index])];if(value===undefined){index=length;value=defaultValue;}object=isFunction(value)?value.call(object):value;}return object;}/**
  7387. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  7388. * it's created. Arrays are created for missing index properties while objects
  7389. * are created for all other missing properties. Use `_.setWith` to customize
  7390. * `path` creation.
  7391. *
  7392. * **Note:** This method mutates `object`.
  7393. *
  7394. * @static
  7395. * @memberOf _
  7396. * @since 3.7.0
  7397. * @category Object
  7398. * @param {Object} object The object to modify.
  7399. * @param {Array|string} path The path of the property to set.
  7400. * @param {*} value The value to set.
  7401. * @returns {Object} Returns `object`.
  7402. * @example
  7403. *
  7404. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  7405. *
  7406. * _.set(object, 'a[0].b.c', 4);
  7407. * console.log(object.a[0].b.c);
  7408. * // => 4
  7409. *
  7410. * _.set(object, ['x', '0', 'y', 'z'], 5);
  7411. * console.log(object.x[0].y.z);
  7412. * // => 5
  7413. */function set(object,path,value){return object==null?object:baseSet(object,path,value);}/**
  7414. * This method is like `_.set` except that it accepts `customizer` which is
  7415. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  7416. * path creation is handled by the method instead. The `customizer` is invoked
  7417. * with three arguments: (nsValue, key, nsObject).
  7418. *
  7419. * **Note:** This method mutates `object`.
  7420. *
  7421. * @static
  7422. * @memberOf _
  7423. * @since 4.0.0
  7424. * @category Object
  7425. * @param {Object} object The object to modify.
  7426. * @param {Array|string} path The path of the property to set.
  7427. * @param {*} value The value to set.
  7428. * @param {Function} [customizer] The function to customize assigned values.
  7429. * @returns {Object} Returns `object`.
  7430. * @example
  7431. *
  7432. * var object = {};
  7433. *
  7434. * _.setWith(object, '[0][1]', 'a', Object);
  7435. * // => { '0': { '1': 'a' } }
  7436. */function setWith(object,path,value,customizer){customizer=typeof customizer==='function'?customizer:undefined;return object==null?object:baseSet(object,path,value,customizer);}/**
  7437. * Creates an array of own enumerable string keyed-value pairs for `object`
  7438. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  7439. * entries are returned.
  7440. *
  7441. * @static
  7442. * @memberOf _
  7443. * @since 4.0.0
  7444. * @alias entries
  7445. * @category Object
  7446. * @param {Object} object The object to query.
  7447. * @returns {Array} Returns the key-value pairs.
  7448. * @example
  7449. *
  7450. * function Foo() {
  7451. * this.a = 1;
  7452. * this.b = 2;
  7453. * }
  7454. *
  7455. * Foo.prototype.c = 3;
  7456. *
  7457. * _.toPairs(new Foo);
  7458. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  7459. */var toPairs=createToPairs(keys);/**
  7460. * Creates an array of own and inherited enumerable string keyed-value pairs
  7461. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  7462. * or set, its entries are returned.
  7463. *
  7464. * @static
  7465. * @memberOf _
  7466. * @since 4.0.0
  7467. * @alias entriesIn
  7468. * @category Object
  7469. * @param {Object} object The object to query.
  7470. * @returns {Array} Returns the key-value pairs.
  7471. * @example
  7472. *
  7473. * function Foo() {
  7474. * this.a = 1;
  7475. * this.b = 2;
  7476. * }
  7477. *
  7478. * Foo.prototype.c = 3;
  7479. *
  7480. * _.toPairsIn(new Foo);
  7481. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  7482. */var toPairsIn=createToPairs(keysIn);/**
  7483. * An alternative to `_.reduce`; this method transforms `object` to a new
  7484. * `accumulator` object which is the result of running each of its own
  7485. * enumerable string keyed properties thru `iteratee`, with each invocation
  7486. * potentially mutating the `accumulator` object. If `accumulator` is not
  7487. * provided, a new object with the same `[[Prototype]]` will be used. The
  7488. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  7489. * Iteratee functions may exit iteration early by explicitly returning `false`.
  7490. *
  7491. * @static
  7492. * @memberOf _
  7493. * @since 1.3.0
  7494. * @category Object
  7495. * @param {Object} object The object to iterate over.
  7496. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  7497. * @param {*} [accumulator] The custom accumulator value.
  7498. * @returns {*} Returns the accumulated value.
  7499. * @example
  7500. *
  7501. * _.transform([2, 3, 4], function(result, n) {
  7502. * result.push(n *= n);
  7503. * return n % 2 == 0;
  7504. * }, []);
  7505. * // => [4, 9]
  7506. *
  7507. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  7508. * (result[value] || (result[value] = [])).push(key);
  7509. * }, {});
  7510. * // => { '1': ['a', 'c'], '2': ['b'] }
  7511. */function transform(object,iteratee,accumulator){var isArr=isArray(object),isArrLike=isArr||isBuffer(object)||isTypedArray(object);iteratee=getIteratee(iteratee,4);if(accumulator==null){var Ctor=object&&object.constructor;if(isArrLike){accumulator=isArr?new Ctor():[];}else if(isObject(object)){accumulator=isFunction(Ctor)?baseCreate(getPrototype(object)):{};}else{accumulator={};}}(isArrLike?arrayEach:baseForOwn)(object,function(value,index,object){return iteratee(accumulator,value,index,object);});return accumulator;}/**
  7512. * Removes the property at `path` of `object`.
  7513. *
  7514. * **Note:** This method mutates `object`.
  7515. *
  7516. * @static
  7517. * @memberOf _
  7518. * @since 4.0.0
  7519. * @category Object
  7520. * @param {Object} object The object to modify.
  7521. * @param {Array|string} path The path of the property to unset.
  7522. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  7523. * @example
  7524. *
  7525. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  7526. * _.unset(object, 'a[0].b.c');
  7527. * // => true
  7528. *
  7529. * console.log(object);
  7530. * // => { 'a': [{ 'b': {} }] };
  7531. *
  7532. * _.unset(object, ['a', '0', 'b', 'c']);
  7533. * // => true
  7534. *
  7535. * console.log(object);
  7536. * // => { 'a': [{ 'b': {} }] };
  7537. */function unset(object,path){return object==null?true:baseUnset(object,path);}/**
  7538. * This method is like `_.set` except that accepts `updater` to produce the
  7539. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  7540. * is invoked with one argument: (value).
  7541. *
  7542. * **Note:** This method mutates `object`.
  7543. *
  7544. * @static
  7545. * @memberOf _
  7546. * @since 4.6.0
  7547. * @category Object
  7548. * @param {Object} object The object to modify.
  7549. * @param {Array|string} path The path of the property to set.
  7550. * @param {Function} updater The function to produce the updated value.
  7551. * @returns {Object} Returns `object`.
  7552. * @example
  7553. *
  7554. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  7555. *
  7556. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  7557. * console.log(object.a[0].b.c);
  7558. * // => 9
  7559. *
  7560. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  7561. * console.log(object.x[0].y.z);
  7562. * // => 0
  7563. */function update(object,path,updater){return object==null?object:baseUpdate(object,path,castFunction(updater));}/**
  7564. * This method is like `_.update` except that it accepts `customizer` which is
  7565. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  7566. * path creation is handled by the method instead. The `customizer` is invoked
  7567. * with three arguments: (nsValue, key, nsObject).
  7568. *
  7569. * **Note:** This method mutates `object`.
  7570. *
  7571. * @static
  7572. * @memberOf _
  7573. * @since 4.6.0
  7574. * @category Object
  7575. * @param {Object} object The object to modify.
  7576. * @param {Array|string} path The path of the property to set.
  7577. * @param {Function} updater The function to produce the updated value.
  7578. * @param {Function} [customizer] The function to customize assigned values.
  7579. * @returns {Object} Returns `object`.
  7580. * @example
  7581. *
  7582. * var object = {};
  7583. *
  7584. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  7585. * // => { '0': { '1': 'a' } }
  7586. */function updateWith(object,path,updater,customizer){customizer=typeof customizer==='function'?customizer:undefined;return object==null?object:baseUpdate(object,path,castFunction(updater),customizer);}/**
  7587. * Creates an array of the own enumerable string keyed property values of `object`.
  7588. *
  7589. * **Note:** Non-object values are coerced to objects.
  7590. *
  7591. * @static
  7592. * @since 0.1.0
  7593. * @memberOf _
  7594. * @category Object
  7595. * @param {Object} object The object to query.
  7596. * @returns {Array} Returns the array of property values.
  7597. * @example
  7598. *
  7599. * function Foo() {
  7600. * this.a = 1;
  7601. * this.b = 2;
  7602. * }
  7603. *
  7604. * Foo.prototype.c = 3;
  7605. *
  7606. * _.values(new Foo);
  7607. * // => [1, 2] (iteration order is not guaranteed)
  7608. *
  7609. * _.values('hi');
  7610. * // => ['h', 'i']
  7611. */function values(object){return object==null?[]:baseValues(object,keys(object));}/**
  7612. * Creates an array of the own and inherited enumerable string keyed property
  7613. * values of `object`.
  7614. *
  7615. * **Note:** Non-object values are coerced to objects.
  7616. *
  7617. * @static
  7618. * @memberOf _
  7619. * @since 3.0.0
  7620. * @category Object
  7621. * @param {Object} object The object to query.
  7622. * @returns {Array} Returns the array of property values.
  7623. * @example
  7624. *
  7625. * function Foo() {
  7626. * this.a = 1;
  7627. * this.b = 2;
  7628. * }
  7629. *
  7630. * Foo.prototype.c = 3;
  7631. *
  7632. * _.valuesIn(new Foo);
  7633. * // => [1, 2, 3] (iteration order is not guaranteed)
  7634. */function valuesIn(object){return object==null?[]:baseValues(object,keysIn(object));}/* ------------------------------------------------------------------------*//**
  7635. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  7636. *
  7637. * @static
  7638. * @memberOf _
  7639. * @since 4.0.0
  7640. * @category Number
  7641. * @param {number} number The number to clamp.
  7642. * @param {number} [lower] The lower bound.
  7643. * @param {number} upper The upper bound.
  7644. * @returns {number} Returns the clamped number.
  7645. * @example
  7646. *
  7647. * _.clamp(-10, -5, 5);
  7648. * // => -5
  7649. *
  7650. * _.clamp(10, -5, 5);
  7651. * // => 5
  7652. */function clamp(number,lower,upper){if(upper===undefined){upper=lower;lower=undefined;}if(upper!==undefined){upper=toNumber(upper);upper=upper===upper?upper:0;}if(lower!==undefined){lower=toNumber(lower);lower=lower===lower?lower:0;}return baseClamp(toNumber(number),lower,upper);}/**
  7653. * Checks if `n` is between `start` and up to, but not including, `end`. If
  7654. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  7655. * If `start` is greater than `end` the params are swapped to support
  7656. * negative ranges.
  7657. *
  7658. * @static
  7659. * @memberOf _
  7660. * @since 3.3.0
  7661. * @category Number
  7662. * @param {number} number The number to check.
  7663. * @param {number} [start=0] The start of the range.
  7664. * @param {number} end The end of the range.
  7665. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  7666. * @see _.range, _.rangeRight
  7667. * @example
  7668. *
  7669. * _.inRange(3, 2, 4);
  7670. * // => true
  7671. *
  7672. * _.inRange(4, 8);
  7673. * // => true
  7674. *
  7675. * _.inRange(4, 2);
  7676. * // => false
  7677. *
  7678. * _.inRange(2, 2);
  7679. * // => false
  7680. *
  7681. * _.inRange(1.2, 2);
  7682. * // => true
  7683. *
  7684. * _.inRange(5.2, 4);
  7685. * // => false
  7686. *
  7687. * _.inRange(-3, -2, -6);
  7688. * // => true
  7689. */function inRange(number,start,end){start=toFinite(start);if(end===undefined){end=start;start=0;}else{end=toFinite(end);}number=toNumber(number);return baseInRange(number,start,end);}/**
  7690. * Produces a random number between the inclusive `lower` and `upper` bounds.
  7691. * If only one argument is provided a number between `0` and the given number
  7692. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  7693. * floats, a floating-point number is returned instead of an integer.
  7694. *
  7695. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  7696. * floating-point values which can produce unexpected results.
  7697. *
  7698. * @static
  7699. * @memberOf _
  7700. * @since 0.7.0
  7701. * @category Number
  7702. * @param {number} [lower=0] The lower bound.
  7703. * @param {number} [upper=1] The upper bound.
  7704. * @param {boolean} [floating] Specify returning a floating-point number.
  7705. * @returns {number} Returns the random number.
  7706. * @example
  7707. *
  7708. * _.random(0, 5);
  7709. * // => an integer between 0 and 5
  7710. *
  7711. * _.random(5);
  7712. * // => also an integer between 0 and 5
  7713. *
  7714. * _.random(5, true);
  7715. * // => a floating-point number between 0 and 5
  7716. *
  7717. * _.random(1.2, 5.2);
  7718. * // => a floating-point number between 1.2 and 5.2
  7719. */function random(lower,upper,floating){if(floating&&typeof floating!=='boolean'&&isIterateeCall(lower,upper,floating)){upper=floating=undefined;}if(floating===undefined){if(typeof upper==='boolean'){floating=upper;upper=undefined;}else if(typeof lower==='boolean'){floating=lower;lower=undefined;}}if(lower===undefined&&upper===undefined){lower=0;upper=1;}else{lower=toFinite(lower);if(upper===undefined){upper=lower;lower=0;}else{upper=toFinite(upper);}}if(lower>upper){var temp=lower;lower=upper;upper=temp;}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat('1e-'+((rand+'').length-1))),upper);}return baseRandom(lower,upper);}/* ------------------------------------------------------------------------*//**
  7720. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  7721. *
  7722. * @static
  7723. * @memberOf _
  7724. * @since 3.0.0
  7725. * @category String
  7726. * @param {string} [string=''] The string to convert.
  7727. * @returns {string} Returns the camel cased string.
  7728. * @example
  7729. *
  7730. * _.camelCase('Foo Bar');
  7731. * // => 'fooBar'
  7732. *
  7733. * _.camelCase('--foo-bar--');
  7734. * // => 'fooBar'
  7735. *
  7736. * _.camelCase('__FOO_BAR__');
  7737. * // => 'fooBar'
  7738. */var camelCase=createCompounder(function(result,word,index){word=word.toLowerCase();return result+(index?capitalize(word):word);});/**
  7739. * Converts the first character of `string` to upper case and the remaining
  7740. * to lower case.
  7741. *
  7742. * @static
  7743. * @memberOf _
  7744. * @since 3.0.0
  7745. * @category String
  7746. * @param {string} [string=''] The string to capitalize.
  7747. * @returns {string} Returns the capitalized string.
  7748. * @example
  7749. *
  7750. * _.capitalize('FRED');
  7751. * // => 'Fred'
  7752. */function capitalize(string){return upperFirst(toString(string).toLowerCase());}/**
  7753. * Deburrs `string` by converting
  7754. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  7755. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  7756. * letters to basic Latin letters and removing
  7757. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  7758. *
  7759. * @static
  7760. * @memberOf _
  7761. * @since 3.0.0
  7762. * @category String
  7763. * @param {string} [string=''] The string to deburr.
  7764. * @returns {string} Returns the deburred string.
  7765. * @example
  7766. *
  7767. * _.deburr('déjà vu');
  7768. * // => 'deja vu'
  7769. */function deburr(string){string=toString(string);return string&&string.replace(reLatin,deburrLetter).replace(reComboMark,'');}/**
  7770. * Checks if `string` ends with the given target string.
  7771. *
  7772. * @static
  7773. * @memberOf _
  7774. * @since 3.0.0
  7775. * @category String
  7776. * @param {string} [string=''] The string to inspect.
  7777. * @param {string} [target] The string to search for.
  7778. * @param {number} [position=string.length] The position to search up to.
  7779. * @returns {boolean} Returns `true` if `string` ends with `target`,
  7780. * else `false`.
  7781. * @example
  7782. *
  7783. * _.endsWith('abc', 'c');
  7784. * // => true
  7785. *
  7786. * _.endsWith('abc', 'b');
  7787. * // => false
  7788. *
  7789. * _.endsWith('abc', 'b', 2);
  7790. * // => true
  7791. */function endsWith(string,target,position){string=toString(string);target=baseToString(target);var length=string.length;position=position===undefined?length:baseClamp(toInteger(position),0,length);var end=position;position-=target.length;return position>=0&&string.slice(position,end)==target;}/**
  7792. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  7793. * corresponding HTML entities.
  7794. *
  7795. * **Note:** No other characters are escaped. To escape additional
  7796. * characters use a third-party library like [_he_](https://mths.be/he).
  7797. *
  7798. * Though the ">" character is escaped for symmetry, characters like
  7799. * ">" and "/" don't need escaping in HTML and have no special meaning
  7800. * unless they're part of a tag or unquoted attribute value. See
  7801. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  7802. * (under "semi-related fun fact") for more details.
  7803. *
  7804. * When working with HTML you should always
  7805. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  7806. * XSS vectors.
  7807. *
  7808. * @static
  7809. * @since 0.1.0
  7810. * @memberOf _
  7811. * @category String
  7812. * @param {string} [string=''] The string to escape.
  7813. * @returns {string} Returns the escaped string.
  7814. * @example
  7815. *
  7816. * _.escape('fred, barney, & pebbles');
  7817. * // => 'fred, barney, &amp; pebbles'
  7818. */function escape(string){string=toString(string);return string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string;}/**
  7819. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  7820. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  7821. *
  7822. * @static
  7823. * @memberOf _
  7824. * @since 3.0.0
  7825. * @category String
  7826. * @param {string} [string=''] The string to escape.
  7827. * @returns {string} Returns the escaped string.
  7828. * @example
  7829. *
  7830. * _.escapeRegExp('[lodash](https://lodash.com/)');
  7831. * // => '\[lodash\]\(https://lodash\.com/\)'
  7832. */function escapeRegExp(string){string=toString(string);return string&&reHasRegExpChar.test(string)?string.replace(reRegExpChar,'\\$&'):string;}/**
  7833. * Converts `string` to
  7834. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  7835. *
  7836. * @static
  7837. * @memberOf _
  7838. * @since 3.0.0
  7839. * @category String
  7840. * @param {string} [string=''] The string to convert.
  7841. * @returns {string} Returns the kebab cased string.
  7842. * @example
  7843. *
  7844. * _.kebabCase('Foo Bar');
  7845. * // => 'foo-bar'
  7846. *
  7847. * _.kebabCase('fooBar');
  7848. * // => 'foo-bar'
  7849. *
  7850. * _.kebabCase('__FOO_BAR__');
  7851. * // => 'foo-bar'
  7852. */var kebabCase=createCompounder(function(result,word,index){return result+(index?'-':'')+word.toLowerCase();});/**
  7853. * Converts `string`, as space separated words, to lower case.
  7854. *
  7855. * @static
  7856. * @memberOf _
  7857. * @since 4.0.0
  7858. * @category String
  7859. * @param {string} [string=''] The string to convert.
  7860. * @returns {string} Returns the lower cased string.
  7861. * @example
  7862. *
  7863. * _.lowerCase('--Foo-Bar--');
  7864. * // => 'foo bar'
  7865. *
  7866. * _.lowerCase('fooBar');
  7867. * // => 'foo bar'
  7868. *
  7869. * _.lowerCase('__FOO_BAR__');
  7870. * // => 'foo bar'
  7871. */var lowerCase=createCompounder(function(result,word,index){return result+(index?' ':'')+word.toLowerCase();});/**
  7872. * Converts the first character of `string` to lower case.
  7873. *
  7874. * @static
  7875. * @memberOf _
  7876. * @since 4.0.0
  7877. * @category String
  7878. * @param {string} [string=''] The string to convert.
  7879. * @returns {string} Returns the converted string.
  7880. * @example
  7881. *
  7882. * _.lowerFirst('Fred');
  7883. * // => 'fred'
  7884. *
  7885. * _.lowerFirst('FRED');
  7886. * // => 'fRED'
  7887. */var lowerFirst=createCaseFirst('toLowerCase');/**
  7888. * Pads `string` on the left and right sides if it's shorter than `length`.
  7889. * Padding characters are truncated if they can't be evenly divided by `length`.
  7890. *
  7891. * @static
  7892. * @memberOf _
  7893. * @since 3.0.0
  7894. * @category String
  7895. * @param {string} [string=''] The string to pad.
  7896. * @param {number} [length=0] The padding length.
  7897. * @param {string} [chars=' '] The string used as padding.
  7898. * @returns {string} Returns the padded string.
  7899. * @example
  7900. *
  7901. * _.pad('abc', 8);
  7902. * // => ' abc '
  7903. *
  7904. * _.pad('abc', 8, '_-');
  7905. * // => '_-abc_-_'
  7906. *
  7907. * _.pad('abc', 3);
  7908. * // => 'abc'
  7909. */function pad(string,length,chars){string=toString(string);length=toInteger(length);var strLength=length?stringSize(string):0;if(!length||strLength>=length){return string;}var mid=(length-strLength)/2;return createPadding(nativeFloor(mid),chars)+string+createPadding(nativeCeil(mid),chars);}/**
  7910. * Pads `string` on the right side if it's shorter than `length`. Padding
  7911. * characters are truncated if they exceed `length`.
  7912. *
  7913. * @static
  7914. * @memberOf _
  7915. * @since 4.0.0
  7916. * @category String
  7917. * @param {string} [string=''] The string to pad.
  7918. * @param {number} [length=0] The padding length.
  7919. * @param {string} [chars=' '] The string used as padding.
  7920. * @returns {string} Returns the padded string.
  7921. * @example
  7922. *
  7923. * _.padEnd('abc', 6);
  7924. * // => 'abc '
  7925. *
  7926. * _.padEnd('abc', 6, '_-');
  7927. * // => 'abc_-_'
  7928. *
  7929. * _.padEnd('abc', 3);
  7930. * // => 'abc'
  7931. */function padEnd(string,length,chars){string=toString(string);length=toInteger(length);var strLength=length?stringSize(string):0;return length&&strLength<length?string+createPadding(length-strLength,chars):string;}/**
  7932. * Pads `string` on the left side if it's shorter than `length`. Padding
  7933. * characters are truncated if they exceed `length`.
  7934. *
  7935. * @static
  7936. * @memberOf _
  7937. * @since 4.0.0
  7938. * @category String
  7939. * @param {string} [string=''] The string to pad.
  7940. * @param {number} [length=0] The padding length.
  7941. * @param {string} [chars=' '] The string used as padding.
  7942. * @returns {string} Returns the padded string.
  7943. * @example
  7944. *
  7945. * _.padStart('abc', 6);
  7946. * // => ' abc'
  7947. *
  7948. * _.padStart('abc', 6, '_-');
  7949. * // => '_-_abc'
  7950. *
  7951. * _.padStart('abc', 3);
  7952. * // => 'abc'
  7953. */function padStart(string,length,chars){string=toString(string);length=toInteger(length);var strLength=length?stringSize(string):0;return length&&strLength<length?createPadding(length-strLength,chars)+string:string;}/**
  7954. * Converts `string` to an integer of the specified radix. If `radix` is
  7955. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  7956. * hexadecimal, in which case a `radix` of `16` is used.
  7957. *
  7958. * **Note:** This method aligns with the
  7959. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  7960. *
  7961. * @static
  7962. * @memberOf _
  7963. * @since 1.1.0
  7964. * @category String
  7965. * @param {string} string The string to convert.
  7966. * @param {number} [radix=10] The radix to interpret `value` by.
  7967. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7968. * @returns {number} Returns the converted integer.
  7969. * @example
  7970. *
  7971. * _.parseInt('08');
  7972. * // => 8
  7973. *
  7974. * _.map(['6', '08', '10'], _.parseInt);
  7975. * // => [6, 8, 10]
  7976. */function parseInt(string,radix,guard){if(guard||radix==null){radix=0;}else if(radix){radix=+radix;}return nativeParseInt(toString(string).replace(reTrimStart,''),radix||0);}/**
  7977. * Repeats the given string `n` times.
  7978. *
  7979. * @static
  7980. * @memberOf _
  7981. * @since 3.0.0
  7982. * @category String
  7983. * @param {string} [string=''] The string to repeat.
  7984. * @param {number} [n=1] The number of times to repeat the string.
  7985. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7986. * @returns {string} Returns the repeated string.
  7987. * @example
  7988. *
  7989. * _.repeat('*', 3);
  7990. * // => '***'
  7991. *
  7992. * _.repeat('abc', 2);
  7993. * // => 'abcabc'
  7994. *
  7995. * _.repeat('abc', 0);
  7996. * // => ''
  7997. */function repeat(string,n,guard){if(guard?isIterateeCall(string,n,guard):n===undefined){n=1;}else{n=toInteger(n);}return baseRepeat(toString(string),n);}/**
  7998. * Replaces matches for `pattern` in `string` with `replacement`.
  7999. *
  8000. * **Note:** This method is based on
  8001. * [`String#replace`](https://mdn.io/String/replace).
  8002. *
  8003. * @static
  8004. * @memberOf _
  8005. * @since 4.0.0
  8006. * @category String
  8007. * @param {string} [string=''] The string to modify.
  8008. * @param {RegExp|string} pattern The pattern to replace.
  8009. * @param {Function|string} replacement The match replacement.
  8010. * @returns {string} Returns the modified string.
  8011. * @example
  8012. *
  8013. * _.replace('Hi Fred', 'Fred', 'Barney');
  8014. * // => 'Hi Barney'
  8015. */function replace(){var args=arguments,string=toString(args[0]);return args.length<3?string:string.replace(args[1],args[2]);}/**
  8016. * Converts `string` to
  8017. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  8018. *
  8019. * @static
  8020. * @memberOf _
  8021. * @since 3.0.0
  8022. * @category String
  8023. * @param {string} [string=''] The string to convert.
  8024. * @returns {string} Returns the snake cased string.
  8025. * @example
  8026. *
  8027. * _.snakeCase('Foo Bar');
  8028. * // => 'foo_bar'
  8029. *
  8030. * _.snakeCase('fooBar');
  8031. * // => 'foo_bar'
  8032. *
  8033. * _.snakeCase('--FOO-BAR--');
  8034. * // => 'foo_bar'
  8035. */var snakeCase=createCompounder(function(result,word,index){return result+(index?'_':'')+word.toLowerCase();});/**
  8036. * Splits `string` by `separator`.
  8037. *
  8038. * **Note:** This method is based on
  8039. * [`String#split`](https://mdn.io/String/split).
  8040. *
  8041. * @static
  8042. * @memberOf _
  8043. * @since 4.0.0
  8044. * @category String
  8045. * @param {string} [string=''] The string to split.
  8046. * @param {RegExp|string} separator The separator pattern to split by.
  8047. * @param {number} [limit] The length to truncate results to.
  8048. * @returns {Array} Returns the string segments.
  8049. * @example
  8050. *
  8051. * _.split('a-b-c', '-', 2);
  8052. * // => ['a', 'b']
  8053. */function split(string,separator,limit){if(limit&&typeof limit!=='number'&&isIterateeCall(string,separator,limit)){separator=limit=undefined;}limit=limit===undefined?MAX_ARRAY_LENGTH:limit>>>0;if(!limit){return[];}string=toString(string);if(string&&(typeof separator==='string'||separator!=null&&!isRegExp(separator))){separator=baseToString(separator);if(!separator&&hasUnicode(string)){return castSlice(stringToArray(string),0,limit);}}return string.split(separator,limit);}/**
  8054. * Converts `string` to
  8055. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  8056. *
  8057. * @static
  8058. * @memberOf _
  8059. * @since 3.1.0
  8060. * @category String
  8061. * @param {string} [string=''] The string to convert.
  8062. * @returns {string} Returns the start cased string.
  8063. * @example
  8064. *
  8065. * _.startCase('--foo-bar--');
  8066. * // => 'Foo Bar'
  8067. *
  8068. * _.startCase('fooBar');
  8069. * // => 'Foo Bar'
  8070. *
  8071. * _.startCase('__FOO_BAR__');
  8072. * // => 'FOO BAR'
  8073. */var startCase=createCompounder(function(result,word,index){return result+(index?' ':'')+upperFirst(word);});/**
  8074. * Checks if `string` starts with the given target string.
  8075. *
  8076. * @static
  8077. * @memberOf _
  8078. * @since 3.0.0
  8079. * @category String
  8080. * @param {string} [string=''] The string to inspect.
  8081. * @param {string} [target] The string to search for.
  8082. * @param {number} [position=0] The position to search from.
  8083. * @returns {boolean} Returns `true` if `string` starts with `target`,
  8084. * else `false`.
  8085. * @example
  8086. *
  8087. * _.startsWith('abc', 'a');
  8088. * // => true
  8089. *
  8090. * _.startsWith('abc', 'b');
  8091. * // => false
  8092. *
  8093. * _.startsWith('abc', 'b', 1);
  8094. * // => true
  8095. */function startsWith(string,target,position){string=toString(string);position=position==null?0:baseClamp(toInteger(position),0,string.length);target=baseToString(target);return string.slice(position,position+target.length)==target;}/**
  8096. * Creates a compiled template function that can interpolate data properties
  8097. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  8098. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  8099. * properties may be accessed as free variables in the template. If a setting
  8100. * object is given, it takes precedence over `_.templateSettings` values.
  8101. *
  8102. * **Note:** In the development build `_.template` utilizes
  8103. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  8104. * for easier debugging.
  8105. *
  8106. * For more information on precompiling templates see
  8107. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  8108. *
  8109. * For more information on Chrome extension sandboxes see
  8110. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  8111. *
  8112. * @static
  8113. * @since 0.1.0
  8114. * @memberOf _
  8115. * @category String
  8116. * @param {string} [string=''] The template string.
  8117. * @param {Object} [options={}] The options object.
  8118. * @param {RegExp} [options.escape=_.templateSettings.escape]
  8119. * The HTML "escape" delimiter.
  8120. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  8121. * The "evaluate" delimiter.
  8122. * @param {Object} [options.imports=_.templateSettings.imports]
  8123. * An object to import into the template as free variables.
  8124. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  8125. * The "interpolate" delimiter.
  8126. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  8127. * The sourceURL of the compiled template.
  8128. * @param {string} [options.variable='obj']
  8129. * The data object variable name.
  8130. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8131. * @returns {Function} Returns the compiled template function.
  8132. * @example
  8133. *
  8134. * // Use the "interpolate" delimiter to create a compiled template.
  8135. * var compiled = _.template('hello <%= user %>!');
  8136. * compiled({ 'user': 'fred' });
  8137. * // => 'hello fred!'
  8138. *
  8139. * // Use the HTML "escape" delimiter to escape data property values.
  8140. * var compiled = _.template('<b><%- value %></b>');
  8141. * compiled({ 'value': '<script>' });
  8142. * // => '<b>&lt;script&gt;</b>'
  8143. *
  8144. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  8145. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  8146. * compiled({ 'users': ['fred', 'barney'] });
  8147. * // => '<li>fred</li><li>barney</li>'
  8148. *
  8149. * // Use the internal `print` function in "evaluate" delimiters.
  8150. * var compiled = _.template('<% print("hello " + user); %>!');
  8151. * compiled({ 'user': 'barney' });
  8152. * // => 'hello barney!'
  8153. *
  8154. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  8155. * // Disable support by replacing the "interpolate" delimiter.
  8156. * var compiled = _.template('hello ${ user }!');
  8157. * compiled({ 'user': 'pebbles' });
  8158. * // => 'hello pebbles!'
  8159. *
  8160. * // Use backslashes to treat delimiters as plain text.
  8161. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  8162. * compiled({ 'value': 'ignored' });
  8163. * // => '<%- value %>'
  8164. *
  8165. * // Use the `imports` option to import `jQuery` as `jq`.
  8166. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  8167. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  8168. * compiled({ 'users': ['fred', 'barney'] });
  8169. * // => '<li>fred</li><li>barney</li>'
  8170. *
  8171. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  8172. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  8173. * compiled(data);
  8174. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  8175. *
  8176. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  8177. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  8178. * compiled.source;
  8179. * // => function(data) {
  8180. * // var __t, __p = '';
  8181. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  8182. * // return __p;
  8183. * // }
  8184. *
  8185. * // Use custom template delimiters.
  8186. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  8187. * var compiled = _.template('hello {{ user }}!');
  8188. * compiled({ 'user': 'mustache' });
  8189. * // => 'hello mustache!'
  8190. *
  8191. * // Use the `source` property to inline compiled templates for meaningful
  8192. * // line numbers in error messages and stack traces.
  8193. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  8194. * var JST = {\
  8195. * "main": ' + _.template(mainText).source + '\
  8196. * };\
  8197. * ');
  8198. */function template(string,options,guard){// Based on John Resig's `tmpl` implementation
  8199. // (http://ejohn.org/blog/javascript-micro-templating/)
  8200. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  8201. var settings=lodash.templateSettings;if(guard&&isIterateeCall(string,options,guard)){options=undefined;}string=toString(string);options=assignInWith({},options,settings,customDefaultsAssignIn);var imports=assignInWith({},options.imports,settings.imports,customDefaultsAssignIn),importsKeys=keys(imports),importsValues=baseValues(imports,importsKeys);var isEscaping,isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";// Compile the regexp to match each delimiter.
  8202. var reDelimiters=RegExp((options.escape||reNoMatch).source+'|'+interpolate.source+'|'+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+'|'+(options.evaluate||reNoMatch).source+'|$','g');// Use a sourceURL for easier debugging.
  8203. var sourceURL='//# sourceURL='+('sourceURL'in options?options.sourceURL:'lodash.templateSources['+ ++templateCounter+']')+'\n';string.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);// Escape characters that can't be included in string literals.
  8204. source+=string.slice(index,offset).replace(reUnescapedString,escapeStringChar);// Replace delimiters with snippets.
  8205. if(escapeValue){isEscaping=true;source+="' +\n__e("+escapeValue+") +\n'";}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '";}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'";}index=offset+match.length;// The JS engine embedded in Adobe products needs `match` returned in
  8206. // order to produce the correct `offset` value.
  8207. return match;});source+="';\n";// If `variable` is not specified wrap a with-statement around the generated
  8208. // code to add the data object to the top of the scope chain.
  8209. var variable=options.variable;if(!variable){source='with (obj) {\n'+source+'\n}\n';}// Cleanup code by stripping empty strings.
  8210. source=(isEvaluating?source.replace(reEmptyStringLeading,''):source).replace(reEmptyStringMiddle,'$1').replace(reEmptyStringTrailing,'$1;');// Frame code as the function body.
  8211. source='function('+(variable||'obj')+') {\n'+(variable?'':'obj || (obj = {});\n')+"var __t, __p = ''"+(isEscaping?', __e = _.escape':'')+(isEvaluating?', __j = Array.prototype.join;\n'+"function print() { __p += __j.call(arguments, '') }\n":';\n')+source+'return __p\n}';var result=attempt(function(){return Function(importsKeys,sourceURL+'return '+source).apply(undefined,importsValues);});// Provide the compiled function's source by its `toString` method or
  8212. // the `source` property as a convenience for inlining compiled templates.
  8213. result.source=source;if(isError(result)){throw result;}return result;}/**
  8214. * Converts `string`, as a whole, to lower case just like
  8215. * [String#toLowerCase](https://mdn.io/toLowerCase).
  8216. *
  8217. * @static
  8218. * @memberOf _
  8219. * @since 4.0.0
  8220. * @category String
  8221. * @param {string} [string=''] The string to convert.
  8222. * @returns {string} Returns the lower cased string.
  8223. * @example
  8224. *
  8225. * _.toLower('--Foo-Bar--');
  8226. * // => '--foo-bar--'
  8227. *
  8228. * _.toLower('fooBar');
  8229. * // => 'foobar'
  8230. *
  8231. * _.toLower('__FOO_BAR__');
  8232. * // => '__foo_bar__'
  8233. */function toLower(value){return toString(value).toLowerCase();}/**
  8234. * Converts `string`, as a whole, to upper case just like
  8235. * [String#toUpperCase](https://mdn.io/toUpperCase).
  8236. *
  8237. * @static
  8238. * @memberOf _
  8239. * @since 4.0.0
  8240. * @category String
  8241. * @param {string} [string=''] The string to convert.
  8242. * @returns {string} Returns the upper cased string.
  8243. * @example
  8244. *
  8245. * _.toUpper('--foo-bar--');
  8246. * // => '--FOO-BAR--'
  8247. *
  8248. * _.toUpper('fooBar');
  8249. * // => 'FOOBAR'
  8250. *
  8251. * _.toUpper('__foo_bar__');
  8252. * // => '__FOO_BAR__'
  8253. */function toUpper(value){return toString(value).toUpperCase();}/**
  8254. * Removes leading and trailing whitespace or specified characters from `string`.
  8255. *
  8256. * @static
  8257. * @memberOf _
  8258. * @since 3.0.0
  8259. * @category String
  8260. * @param {string} [string=''] The string to trim.
  8261. * @param {string} [chars=whitespace] The characters to trim.
  8262. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8263. * @returns {string} Returns the trimmed string.
  8264. * @example
  8265. *
  8266. * _.trim(' abc ');
  8267. * // => 'abc'
  8268. *
  8269. * _.trim('-_-abc-_-', '_-');
  8270. * // => 'abc'
  8271. *
  8272. * _.map([' foo ', ' bar '], _.trim);
  8273. * // => ['foo', 'bar']
  8274. */function trim(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined)){return string.replace(reTrim,'');}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars),start=charsStartIndex(strSymbols,chrSymbols),end=charsEndIndex(strSymbols,chrSymbols)+1;return castSlice(strSymbols,start,end).join('');}/**
  8275. * Removes trailing whitespace or specified characters from `string`.
  8276. *
  8277. * @static
  8278. * @memberOf _
  8279. * @since 4.0.0
  8280. * @category String
  8281. * @param {string} [string=''] The string to trim.
  8282. * @param {string} [chars=whitespace] The characters to trim.
  8283. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8284. * @returns {string} Returns the trimmed string.
  8285. * @example
  8286. *
  8287. * _.trimEnd(' abc ');
  8288. * // => ' abc'
  8289. *
  8290. * _.trimEnd('-_-abc-_-', '_-');
  8291. * // => '-_-abc'
  8292. */function trimEnd(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined)){return string.replace(reTrimEnd,'');}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),end=charsEndIndex(strSymbols,stringToArray(chars))+1;return castSlice(strSymbols,0,end).join('');}/**
  8293. * Removes leading whitespace or specified characters from `string`.
  8294. *
  8295. * @static
  8296. * @memberOf _
  8297. * @since 4.0.0
  8298. * @category String
  8299. * @param {string} [string=''] The string to trim.
  8300. * @param {string} [chars=whitespace] The characters to trim.
  8301. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8302. * @returns {string} Returns the trimmed string.
  8303. * @example
  8304. *
  8305. * _.trimStart(' abc ');
  8306. * // => 'abc '
  8307. *
  8308. * _.trimStart('-_-abc-_-', '_-');
  8309. * // => 'abc-_-'
  8310. */function trimStart(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined)){return string.replace(reTrimStart,'');}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),start=charsStartIndex(strSymbols,stringToArray(chars));return castSlice(strSymbols,start).join('');}/**
  8311. * Truncates `string` if it's longer than the given maximum string length.
  8312. * The last characters of the truncated string are replaced with the omission
  8313. * string which defaults to "...".
  8314. *
  8315. * @static
  8316. * @memberOf _
  8317. * @since 4.0.0
  8318. * @category String
  8319. * @param {string} [string=''] The string to truncate.
  8320. * @param {Object} [options={}] The options object.
  8321. * @param {number} [options.length=30] The maximum string length.
  8322. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  8323. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  8324. * @returns {string} Returns the truncated string.
  8325. * @example
  8326. *
  8327. * _.truncate('hi-diddly-ho there, neighborino');
  8328. * // => 'hi-diddly-ho there, neighbo...'
  8329. *
  8330. * _.truncate('hi-diddly-ho there, neighborino', {
  8331. * 'length': 24,
  8332. * 'separator': ' '
  8333. * });
  8334. * // => 'hi-diddly-ho there,...'
  8335. *
  8336. * _.truncate('hi-diddly-ho there, neighborino', {
  8337. * 'length': 24,
  8338. * 'separator': /,? +/
  8339. * });
  8340. * // => 'hi-diddly-ho there...'
  8341. *
  8342. * _.truncate('hi-diddly-ho there, neighborino', {
  8343. * 'omission': ' [...]'
  8344. * });
  8345. * // => 'hi-diddly-ho there, neig [...]'
  8346. */function truncate(string,options){var length=DEFAULT_TRUNC_LENGTH,omission=DEFAULT_TRUNC_OMISSION;if(isObject(options)){var separator='separator'in options?options.separator:separator;length='length'in options?toInteger(options.length):length;omission='omission'in options?baseToString(options.omission):omission;}string=toString(string);var strLength=string.length;if(hasUnicode(string)){var strSymbols=stringToArray(string);strLength=strSymbols.length;}if(length>=strLength){return string;}var end=length-stringSize(omission);if(end<1){return omission;}var result=strSymbols?castSlice(strSymbols,0,end).join(''):string.slice(0,end);if(separator===undefined){return result+omission;}if(strSymbols){end+=result.length-end;}if(isRegExp(separator)){if(string.slice(end).search(separator)){var match,substring=result;if(!separator.global){separator=RegExp(separator.source,toString(reFlags.exec(separator))+'g');}separator.lastIndex=0;while(match=separator.exec(substring)){var newEnd=match.index;}result=result.slice(0,newEnd===undefined?end:newEnd);}}else if(string.indexOf(baseToString(separator),end)!=end){var index=result.lastIndexOf(separator);if(index>-1){result=result.slice(0,index);}}return result+omission;}/**
  8347. * The inverse of `_.escape`; this method converts the HTML entities
  8348. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  8349. * their corresponding characters.
  8350. *
  8351. * **Note:** No other HTML entities are unescaped. To unescape additional
  8352. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  8353. *
  8354. * @static
  8355. * @memberOf _
  8356. * @since 0.6.0
  8357. * @category String
  8358. * @param {string} [string=''] The string to unescape.
  8359. * @returns {string} Returns the unescaped string.
  8360. * @example
  8361. *
  8362. * _.unescape('fred, barney, &amp; pebbles');
  8363. * // => 'fred, barney, & pebbles'
  8364. */function unescape(string){string=toString(string);return string&&reHasEscapedHtml.test(string)?string.replace(reEscapedHtml,unescapeHtmlChar):string;}/**
  8365. * Converts `string`, as space separated words, to upper case.
  8366. *
  8367. * @static
  8368. * @memberOf _
  8369. * @since 4.0.0
  8370. * @category String
  8371. * @param {string} [string=''] The string to convert.
  8372. * @returns {string} Returns the upper cased string.
  8373. * @example
  8374. *
  8375. * _.upperCase('--foo-bar');
  8376. * // => 'FOO BAR'
  8377. *
  8378. * _.upperCase('fooBar');
  8379. * // => 'FOO BAR'
  8380. *
  8381. * _.upperCase('__foo_bar__');
  8382. * // => 'FOO BAR'
  8383. */var upperCase=createCompounder(function(result,word,index){return result+(index?' ':'')+word.toUpperCase();});/**
  8384. * Converts the first character of `string` to upper case.
  8385. *
  8386. * @static
  8387. * @memberOf _
  8388. * @since 4.0.0
  8389. * @category String
  8390. * @param {string} [string=''] The string to convert.
  8391. * @returns {string} Returns the converted string.
  8392. * @example
  8393. *
  8394. * _.upperFirst('fred');
  8395. * // => 'Fred'
  8396. *
  8397. * _.upperFirst('FRED');
  8398. * // => 'FRED'
  8399. */var upperFirst=createCaseFirst('toUpperCase');/**
  8400. * Splits `string` into an array of its words.
  8401. *
  8402. * @static
  8403. * @memberOf _
  8404. * @since 3.0.0
  8405. * @category String
  8406. * @param {string} [string=''] The string to inspect.
  8407. * @param {RegExp|string} [pattern] The pattern to match words.
  8408. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8409. * @returns {Array} Returns the words of `string`.
  8410. * @example
  8411. *
  8412. * _.words('fred, barney, & pebbles');
  8413. * // => ['fred', 'barney', 'pebbles']
  8414. *
  8415. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  8416. * // => ['fred', 'barney', '&', 'pebbles']
  8417. */function words(string,pattern,guard){string=toString(string);pattern=guard?undefined:pattern;if(pattern===undefined){return hasUnicodeWord(string)?unicodeWords(string):asciiWords(string);}return string.match(pattern)||[];}/* ------------------------------------------------------------------------*//**
  8418. * Attempts to invoke `func`, returning either the result or the caught error
  8419. * object. Any additional arguments are provided to `func` when it's invoked.
  8420. *
  8421. * @static
  8422. * @memberOf _
  8423. * @since 3.0.0
  8424. * @category Util
  8425. * @param {Function} func The function to attempt.
  8426. * @param {...*} [args] The arguments to invoke `func` with.
  8427. * @returns {*} Returns the `func` result or error object.
  8428. * @example
  8429. *
  8430. * // Avoid throwing errors for invalid selectors.
  8431. * var elements = _.attempt(function(selector) {
  8432. * return document.querySelectorAll(selector);
  8433. * }, '>_>');
  8434. *
  8435. * if (_.isError(elements)) {
  8436. * elements = [];
  8437. * }
  8438. */var attempt=baseRest(function(func,args){try{return apply(func,undefined,args);}catch(e){return isError(e)?e:new Error(e);}});/**
  8439. * Binds methods of an object to the object itself, overwriting the existing
  8440. * method.
  8441. *
  8442. * **Note:** This method doesn't set the "length" property of bound functions.
  8443. *
  8444. * @static
  8445. * @since 0.1.0
  8446. * @memberOf _
  8447. * @category Util
  8448. * @param {Object} object The object to bind and assign the bound methods to.
  8449. * @param {...(string|string[])} methodNames The object method names to bind.
  8450. * @returns {Object} Returns `object`.
  8451. * @example
  8452. *
  8453. * var view = {
  8454. * 'label': 'docs',
  8455. * 'click': function() {
  8456. * console.log('clicked ' + this.label);
  8457. * }
  8458. * };
  8459. *
  8460. * _.bindAll(view, ['click']);
  8461. * jQuery(element).on('click', view.click);
  8462. * // => Logs 'clicked docs' when clicked.
  8463. */var bindAll=flatRest(function(object,methodNames){arrayEach(methodNames,function(key){key=toKey(key);baseAssignValue(object,key,bind(object[key],object));});return object;});/**
  8464. * Creates a function that iterates over `pairs` and invokes the corresponding
  8465. * function of the first predicate to return truthy. The predicate-function
  8466. * pairs are invoked with the `this` binding and arguments of the created
  8467. * function.
  8468. *
  8469. * @static
  8470. * @memberOf _
  8471. * @since 4.0.0
  8472. * @category Util
  8473. * @param {Array} pairs The predicate-function pairs.
  8474. * @returns {Function} Returns the new composite function.
  8475. * @example
  8476. *
  8477. * var func = _.cond([
  8478. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  8479. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  8480. * [_.stubTrue, _.constant('no match')]
  8481. * ]);
  8482. *
  8483. * func({ 'a': 1, 'b': 2 });
  8484. * // => 'matches A'
  8485. *
  8486. * func({ 'a': 0, 'b': 1 });
  8487. * // => 'matches B'
  8488. *
  8489. * func({ 'a': '1', 'b': '2' });
  8490. * // => 'no match'
  8491. */function cond(pairs){var length=pairs==null?0:pairs.length,toIteratee=getIteratee();pairs=!length?[]:arrayMap(pairs,function(pair){if(typeof pair[1]!=='function'){throw new TypeError(FUNC_ERROR_TEXT);}return[toIteratee(pair[0]),pair[1]];});return baseRest(function(args){var index=-1;while(++index<length){var pair=pairs[index];if(apply(pair[0],this,args)){return apply(pair[1],this,args);}}});}/**
  8492. * Creates a function that invokes the predicate properties of `source` with
  8493. * the corresponding property values of a given object, returning `true` if
  8494. * all predicates return truthy, else `false`.
  8495. *
  8496. * **Note:** The created function is equivalent to `_.conformsTo` with
  8497. * `source` partially applied.
  8498. *
  8499. * @static
  8500. * @memberOf _
  8501. * @since 4.0.0
  8502. * @category Util
  8503. * @param {Object} source The object of property predicates to conform to.
  8504. * @returns {Function} Returns the new spec function.
  8505. * @example
  8506. *
  8507. * var objects = [
  8508. * { 'a': 2, 'b': 1 },
  8509. * { 'a': 1, 'b': 2 }
  8510. * ];
  8511. *
  8512. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  8513. * // => [{ 'a': 1, 'b': 2 }]
  8514. */function conforms(source){return baseConforms(baseClone(source,CLONE_DEEP_FLAG));}/**
  8515. * Creates a function that returns `value`.
  8516. *
  8517. * @static
  8518. * @memberOf _
  8519. * @since 2.4.0
  8520. * @category Util
  8521. * @param {*} value The value to return from the new function.
  8522. * @returns {Function} Returns the new constant function.
  8523. * @example
  8524. *
  8525. * var objects = _.times(2, _.constant({ 'a': 1 }));
  8526. *
  8527. * console.log(objects);
  8528. * // => [{ 'a': 1 }, { 'a': 1 }]
  8529. *
  8530. * console.log(objects[0] === objects[1]);
  8531. * // => true
  8532. */function constant(value){return function(){return value;};}/**
  8533. * Checks `value` to determine whether a default value should be returned in
  8534. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  8535. * or `undefined`.
  8536. *
  8537. * @static
  8538. * @memberOf _
  8539. * @since 4.14.0
  8540. * @category Util
  8541. * @param {*} value The value to check.
  8542. * @param {*} defaultValue The default value.
  8543. * @returns {*} Returns the resolved value.
  8544. * @example
  8545. *
  8546. * _.defaultTo(1, 10);
  8547. * // => 1
  8548. *
  8549. * _.defaultTo(undefined, 10);
  8550. * // => 10
  8551. */function defaultTo(value,defaultValue){return value==null||value!==value?defaultValue:value;}/**
  8552. * Creates a function that returns the result of invoking the given functions
  8553. * with the `this` binding of the created function, where each successive
  8554. * invocation is supplied the return value of the previous.
  8555. *
  8556. * @static
  8557. * @memberOf _
  8558. * @since 3.0.0
  8559. * @category Util
  8560. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  8561. * @returns {Function} Returns the new composite function.
  8562. * @see _.flowRight
  8563. * @example
  8564. *
  8565. * function square(n) {
  8566. * return n * n;
  8567. * }
  8568. *
  8569. * var addSquare = _.flow([_.add, square]);
  8570. * addSquare(1, 2);
  8571. * // => 9
  8572. */var flow=createFlow();/**
  8573. * This method is like `_.flow` except that it creates a function that
  8574. * invokes the given functions from right to left.
  8575. *
  8576. * @static
  8577. * @since 3.0.0
  8578. * @memberOf _
  8579. * @category Util
  8580. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  8581. * @returns {Function} Returns the new composite function.
  8582. * @see _.flow
  8583. * @example
  8584. *
  8585. * function square(n) {
  8586. * return n * n;
  8587. * }
  8588. *
  8589. * var addSquare = _.flowRight([square, _.add]);
  8590. * addSquare(1, 2);
  8591. * // => 9
  8592. */var flowRight=createFlow(true);/**
  8593. * This method returns the first argument it receives.
  8594. *
  8595. * @static
  8596. * @since 0.1.0
  8597. * @memberOf _
  8598. * @category Util
  8599. * @param {*} value Any value.
  8600. * @returns {*} Returns `value`.
  8601. * @example
  8602. *
  8603. * var object = { 'a': 1 };
  8604. *
  8605. * console.log(_.identity(object) === object);
  8606. * // => true
  8607. */function identity(value){return value;}/**
  8608. * Creates a function that invokes `func` with the arguments of the created
  8609. * function. If `func` is a property name, the created function returns the
  8610. * property value for a given element. If `func` is an array or object, the
  8611. * created function returns `true` for elements that contain the equivalent
  8612. * source properties, otherwise it returns `false`.
  8613. *
  8614. * @static
  8615. * @since 4.0.0
  8616. * @memberOf _
  8617. * @category Util
  8618. * @param {*} [func=_.identity] The value to convert to a callback.
  8619. * @returns {Function} Returns the callback.
  8620. * @example
  8621. *
  8622. * var users = [
  8623. * { 'user': 'barney', 'age': 36, 'active': true },
  8624. * { 'user': 'fred', 'age': 40, 'active': false }
  8625. * ];
  8626. *
  8627. * // The `_.matches` iteratee shorthand.
  8628. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  8629. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  8630. *
  8631. * // The `_.matchesProperty` iteratee shorthand.
  8632. * _.filter(users, _.iteratee(['user', 'fred']));
  8633. * // => [{ 'user': 'fred', 'age': 40 }]
  8634. *
  8635. * // The `_.property` iteratee shorthand.
  8636. * _.map(users, _.iteratee('user'));
  8637. * // => ['barney', 'fred']
  8638. *
  8639. * // Create custom iteratee shorthands.
  8640. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  8641. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  8642. * return func.test(string);
  8643. * };
  8644. * });
  8645. *
  8646. * _.filter(['abc', 'def'], /ef/);
  8647. * // => ['def']
  8648. */function iteratee(func){return baseIteratee(typeof func==='function'?func:baseClone(func,CLONE_DEEP_FLAG));}/**
  8649. * Creates a function that performs a partial deep comparison between a given
  8650. * object and `source`, returning `true` if the given object has equivalent
  8651. * property values, else `false`.
  8652. *
  8653. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  8654. * partially applied.
  8655. *
  8656. * Partial comparisons will match empty array and empty object `source`
  8657. * values against any array or object value, respectively. See `_.isEqual`
  8658. * for a list of supported value comparisons.
  8659. *
  8660. * @static
  8661. * @memberOf _
  8662. * @since 3.0.0
  8663. * @category Util
  8664. * @param {Object} source The object of property values to match.
  8665. * @returns {Function} Returns the new spec function.
  8666. * @example
  8667. *
  8668. * var objects = [
  8669. * { 'a': 1, 'b': 2, 'c': 3 },
  8670. * { 'a': 4, 'b': 5, 'c': 6 }
  8671. * ];
  8672. *
  8673. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  8674. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  8675. */function matches(source){return baseMatches(baseClone(source,CLONE_DEEP_FLAG));}/**
  8676. * Creates a function that performs a partial deep comparison between the
  8677. * value at `path` of a given object to `srcValue`, returning `true` if the
  8678. * object value is equivalent, else `false`.
  8679. *
  8680. * **Note:** Partial comparisons will match empty array and empty object
  8681. * `srcValue` values against any array or object value, respectively. See
  8682. * `_.isEqual` for a list of supported value comparisons.
  8683. *
  8684. * @static
  8685. * @memberOf _
  8686. * @since 3.2.0
  8687. * @category Util
  8688. * @param {Array|string} path The path of the property to get.
  8689. * @param {*} srcValue The value to match.
  8690. * @returns {Function} Returns the new spec function.
  8691. * @example
  8692. *
  8693. * var objects = [
  8694. * { 'a': 1, 'b': 2, 'c': 3 },
  8695. * { 'a': 4, 'b': 5, 'c': 6 }
  8696. * ];
  8697. *
  8698. * _.find(objects, _.matchesProperty('a', 4));
  8699. * // => { 'a': 4, 'b': 5, 'c': 6 }
  8700. */function matchesProperty(path,srcValue){return baseMatchesProperty(path,baseClone(srcValue,CLONE_DEEP_FLAG));}/**
  8701. * Creates a function that invokes the method at `path` of a given object.
  8702. * Any additional arguments are provided to the invoked method.
  8703. *
  8704. * @static
  8705. * @memberOf _
  8706. * @since 3.7.0
  8707. * @category Util
  8708. * @param {Array|string} path The path of the method to invoke.
  8709. * @param {...*} [args] The arguments to invoke the method with.
  8710. * @returns {Function} Returns the new invoker function.
  8711. * @example
  8712. *
  8713. * var objects = [
  8714. * { 'a': { 'b': _.constant(2) } },
  8715. * { 'a': { 'b': _.constant(1) } }
  8716. * ];
  8717. *
  8718. * _.map(objects, _.method('a.b'));
  8719. * // => [2, 1]
  8720. *
  8721. * _.map(objects, _.method(['a', 'b']));
  8722. * // => [2, 1]
  8723. */var method=baseRest(function(path,args){return function(object){return baseInvoke(object,path,args);};});/**
  8724. * The opposite of `_.method`; this method creates a function that invokes
  8725. * the method at a given path of `object`. Any additional arguments are
  8726. * provided to the invoked method.
  8727. *
  8728. * @static
  8729. * @memberOf _
  8730. * @since 3.7.0
  8731. * @category Util
  8732. * @param {Object} object The object to query.
  8733. * @param {...*} [args] The arguments to invoke the method with.
  8734. * @returns {Function} Returns the new invoker function.
  8735. * @example
  8736. *
  8737. * var array = _.times(3, _.constant),
  8738. * object = { 'a': array, 'b': array, 'c': array };
  8739. *
  8740. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  8741. * // => [2, 0]
  8742. *
  8743. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  8744. * // => [2, 0]
  8745. */var methodOf=baseRest(function(object,args){return function(path){return baseInvoke(object,path,args);};});/**
  8746. * Adds all own enumerable string keyed function properties of a source
  8747. * object to the destination object. If `object` is a function, then methods
  8748. * are added to its prototype as well.
  8749. *
  8750. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  8751. * avoid conflicts caused by modifying the original.
  8752. *
  8753. * @static
  8754. * @since 0.1.0
  8755. * @memberOf _
  8756. * @category Util
  8757. * @param {Function|Object} [object=lodash] The destination object.
  8758. * @param {Object} source The object of functions to add.
  8759. * @param {Object} [options={}] The options object.
  8760. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  8761. * @returns {Function|Object} Returns `object`.
  8762. * @example
  8763. *
  8764. * function vowels(string) {
  8765. * return _.filter(string, function(v) {
  8766. * return /[aeiou]/i.test(v);
  8767. * });
  8768. * }
  8769. *
  8770. * _.mixin({ 'vowels': vowels });
  8771. * _.vowels('fred');
  8772. * // => ['e']
  8773. *
  8774. * _('fred').vowels().value();
  8775. * // => ['e']
  8776. *
  8777. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  8778. * _('fred').vowels();
  8779. * // => ['e']
  8780. */function mixin(object,source,options){var props=keys(source),methodNames=baseFunctions(source,props);if(options==null&&!(isObject(source)&&(methodNames.length||!props.length))){options=source;source=object;object=this;methodNames=baseFunctions(source,keys(source));}var chain=!(isObject(options)&&'chain'in options)||!!options.chain,isFunc=isFunction(object);arrayEach(methodNames,function(methodName){var func=source[methodName];object[methodName]=func;if(isFunc){object.prototype[methodName]=function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__),actions=result.__actions__=copyArray(this.__actions__);actions.push({func:func,args:arguments,thisArg:object});result.__chain__=chainAll;return result;}return func.apply(object,arrayPush([this.value()],arguments));};}});return object;}/**
  8781. * Reverts the `_` variable to its previous value and returns a reference to
  8782. * the `lodash` function.
  8783. *
  8784. * @static
  8785. * @since 0.1.0
  8786. * @memberOf _
  8787. * @category Util
  8788. * @returns {Function} Returns the `lodash` function.
  8789. * @example
  8790. *
  8791. * var lodash = _.noConflict();
  8792. */function noConflict(){if(root._===this){root._=oldDash;}return this;}/**
  8793. * This method returns `undefined`.
  8794. *
  8795. * @static
  8796. * @memberOf _
  8797. * @since 2.3.0
  8798. * @category Util
  8799. * @example
  8800. *
  8801. * _.times(2, _.noop);
  8802. * // => [undefined, undefined]
  8803. */function noop(){}// No operation performed.
  8804. /**
  8805. * Creates a function that gets the argument at index `n`. If `n` is negative,
  8806. * the nth argument from the end is returned.
  8807. *
  8808. * @static
  8809. * @memberOf _
  8810. * @since 4.0.0
  8811. * @category Util
  8812. * @param {number} [n=0] The index of the argument to return.
  8813. * @returns {Function} Returns the new pass-thru function.
  8814. * @example
  8815. *
  8816. * var func = _.nthArg(1);
  8817. * func('a', 'b', 'c', 'd');
  8818. * // => 'b'
  8819. *
  8820. * var func = _.nthArg(-2);
  8821. * func('a', 'b', 'c', 'd');
  8822. * // => 'c'
  8823. */function nthArg(n){n=toInteger(n);return baseRest(function(args){return baseNth(args,n);});}/**
  8824. * Creates a function that invokes `iteratees` with the arguments it receives
  8825. * and returns their results.
  8826. *
  8827. * @static
  8828. * @memberOf _
  8829. * @since 4.0.0
  8830. * @category Util
  8831. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  8832. * The iteratees to invoke.
  8833. * @returns {Function} Returns the new function.
  8834. * @example
  8835. *
  8836. * var func = _.over([Math.max, Math.min]);
  8837. *
  8838. * func(1, 2, 3, 4);
  8839. * // => [4, 1]
  8840. */var over=createOver(arrayMap);/**
  8841. * Creates a function that checks if **all** of the `predicates` return
  8842. * truthy when invoked with the arguments it receives.
  8843. *
  8844. * @static
  8845. * @memberOf _
  8846. * @since 4.0.0
  8847. * @category Util
  8848. * @param {...(Function|Function[])} [predicates=[_.identity]]
  8849. * The predicates to check.
  8850. * @returns {Function} Returns the new function.
  8851. * @example
  8852. *
  8853. * var func = _.overEvery([Boolean, isFinite]);
  8854. *
  8855. * func('1');
  8856. * // => true
  8857. *
  8858. * func(null);
  8859. * // => false
  8860. *
  8861. * func(NaN);
  8862. * // => false
  8863. */var overEvery=createOver(arrayEvery);/**
  8864. * Creates a function that checks if **any** of the `predicates` return
  8865. * truthy when invoked with the arguments it receives.
  8866. *
  8867. * @static
  8868. * @memberOf _
  8869. * @since 4.0.0
  8870. * @category Util
  8871. * @param {...(Function|Function[])} [predicates=[_.identity]]
  8872. * The predicates to check.
  8873. * @returns {Function} Returns the new function.
  8874. * @example
  8875. *
  8876. * var func = _.overSome([Boolean, isFinite]);
  8877. *
  8878. * func('1');
  8879. * // => true
  8880. *
  8881. * func(null);
  8882. * // => true
  8883. *
  8884. * func(NaN);
  8885. * // => false
  8886. */var overSome=createOver(arraySome);/**
  8887. * Creates a function that returns the value at `path` of a given object.
  8888. *
  8889. * @static
  8890. * @memberOf _
  8891. * @since 2.4.0
  8892. * @category Util
  8893. * @param {Array|string} path The path of the property to get.
  8894. * @returns {Function} Returns the new accessor function.
  8895. * @example
  8896. *
  8897. * var objects = [
  8898. * { 'a': { 'b': 2 } },
  8899. * { 'a': { 'b': 1 } }
  8900. * ];
  8901. *
  8902. * _.map(objects, _.property('a.b'));
  8903. * // => [2, 1]
  8904. *
  8905. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  8906. * // => [1, 2]
  8907. */function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path);}/**
  8908. * The opposite of `_.property`; this method creates a function that returns
  8909. * the value at a given path of `object`.
  8910. *
  8911. * @static
  8912. * @memberOf _
  8913. * @since 3.0.0
  8914. * @category Util
  8915. * @param {Object} object The object to query.
  8916. * @returns {Function} Returns the new accessor function.
  8917. * @example
  8918. *
  8919. * var array = [0, 1, 2],
  8920. * object = { 'a': array, 'b': array, 'c': array };
  8921. *
  8922. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  8923. * // => [2, 0]
  8924. *
  8925. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  8926. * // => [2, 0]
  8927. */function propertyOf(object){return function(path){return object==null?undefined:baseGet(object,path);};}/**
  8928. * Creates an array of numbers (positive and/or negative) progressing from
  8929. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  8930. * `start` is specified without an `end` or `step`. If `end` is not specified,
  8931. * it's set to `start` with `start` then set to `0`.
  8932. *
  8933. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  8934. * floating-point values which can produce unexpected results.
  8935. *
  8936. * @static
  8937. * @since 0.1.0
  8938. * @memberOf _
  8939. * @category Util
  8940. * @param {number} [start=0] The start of the range.
  8941. * @param {number} end The end of the range.
  8942. * @param {number} [step=1] The value to increment or decrement by.
  8943. * @returns {Array} Returns the range of numbers.
  8944. * @see _.inRange, _.rangeRight
  8945. * @example
  8946. *
  8947. * _.range(4);
  8948. * // => [0, 1, 2, 3]
  8949. *
  8950. * _.range(-4);
  8951. * // => [0, -1, -2, -3]
  8952. *
  8953. * _.range(1, 5);
  8954. * // => [1, 2, 3, 4]
  8955. *
  8956. * _.range(0, 20, 5);
  8957. * // => [0, 5, 10, 15]
  8958. *
  8959. * _.range(0, -4, -1);
  8960. * // => [0, -1, -2, -3]
  8961. *
  8962. * _.range(1, 4, 0);
  8963. * // => [1, 1, 1]
  8964. *
  8965. * _.range(0);
  8966. * // => []
  8967. */var range=createRange();/**
  8968. * This method is like `_.range` except that it populates values in
  8969. * descending order.
  8970. *
  8971. * @static
  8972. * @memberOf _
  8973. * @since 4.0.0
  8974. * @category Util
  8975. * @param {number} [start=0] The start of the range.
  8976. * @param {number} end The end of the range.
  8977. * @param {number} [step=1] The value to increment or decrement by.
  8978. * @returns {Array} Returns the range of numbers.
  8979. * @see _.inRange, _.range
  8980. * @example
  8981. *
  8982. * _.rangeRight(4);
  8983. * // => [3, 2, 1, 0]
  8984. *
  8985. * _.rangeRight(-4);
  8986. * // => [-3, -2, -1, 0]
  8987. *
  8988. * _.rangeRight(1, 5);
  8989. * // => [4, 3, 2, 1]
  8990. *
  8991. * _.rangeRight(0, 20, 5);
  8992. * // => [15, 10, 5, 0]
  8993. *
  8994. * _.rangeRight(0, -4, -1);
  8995. * // => [-3, -2, -1, 0]
  8996. *
  8997. * _.rangeRight(1, 4, 0);
  8998. * // => [1, 1, 1]
  8999. *
  9000. * _.rangeRight(0);
  9001. * // => []
  9002. */var rangeRight=createRange(true);/**
  9003. * This method returns a new empty array.
  9004. *
  9005. * @static
  9006. * @memberOf _
  9007. * @since 4.13.0
  9008. * @category Util
  9009. * @returns {Array} Returns the new empty array.
  9010. * @example
  9011. *
  9012. * var arrays = _.times(2, _.stubArray);
  9013. *
  9014. * console.log(arrays);
  9015. * // => [[], []]
  9016. *
  9017. * console.log(arrays[0] === arrays[1]);
  9018. * // => false
  9019. */function stubArray(){return[];}/**
  9020. * This method returns `false`.
  9021. *
  9022. * @static
  9023. * @memberOf _
  9024. * @since 4.13.0
  9025. * @category Util
  9026. * @returns {boolean} Returns `false`.
  9027. * @example
  9028. *
  9029. * _.times(2, _.stubFalse);
  9030. * // => [false, false]
  9031. */function stubFalse(){return false;}/**
  9032. * This method returns a new empty object.
  9033. *
  9034. * @static
  9035. * @memberOf _
  9036. * @since 4.13.0
  9037. * @category Util
  9038. * @returns {Object} Returns the new empty object.
  9039. * @example
  9040. *
  9041. * var objects = _.times(2, _.stubObject);
  9042. *
  9043. * console.log(objects);
  9044. * // => [{}, {}]
  9045. *
  9046. * console.log(objects[0] === objects[1]);
  9047. * // => false
  9048. */function stubObject(){return{};}/**
  9049. * This method returns an empty string.
  9050. *
  9051. * @static
  9052. * @memberOf _
  9053. * @since 4.13.0
  9054. * @category Util
  9055. * @returns {string} Returns the empty string.
  9056. * @example
  9057. *
  9058. * _.times(2, _.stubString);
  9059. * // => ['', '']
  9060. */function stubString(){return'';}/**
  9061. * This method returns `true`.
  9062. *
  9063. * @static
  9064. * @memberOf _
  9065. * @since 4.13.0
  9066. * @category Util
  9067. * @returns {boolean} Returns `true`.
  9068. * @example
  9069. *
  9070. * _.times(2, _.stubTrue);
  9071. * // => [true, true]
  9072. */function stubTrue(){return true;}/**
  9073. * Invokes the iteratee `n` times, returning an array of the results of
  9074. * each invocation. The iteratee is invoked with one argument; (index).
  9075. *
  9076. * @static
  9077. * @since 0.1.0
  9078. * @memberOf _
  9079. * @category Util
  9080. * @param {number} n The number of times to invoke `iteratee`.
  9081. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9082. * @returns {Array} Returns the array of results.
  9083. * @example
  9084. *
  9085. * _.times(3, String);
  9086. * // => ['0', '1', '2']
  9087. *
  9088. * _.times(4, _.constant(0));
  9089. * // => [0, 0, 0, 0]
  9090. */function times(n,iteratee){n=toInteger(n);if(n<1||n>MAX_SAFE_INTEGER){return[];}var index=MAX_ARRAY_LENGTH,length=nativeMin(n,MAX_ARRAY_LENGTH);iteratee=getIteratee(iteratee);n-=MAX_ARRAY_LENGTH;var result=baseTimes(length,iteratee);while(++index<n){iteratee(index);}return result;}/**
  9091. * Converts `value` to a property path array.
  9092. *
  9093. * @static
  9094. * @memberOf _
  9095. * @since 4.0.0
  9096. * @category Util
  9097. * @param {*} value The value to convert.
  9098. * @returns {Array} Returns the new property path array.
  9099. * @example
  9100. *
  9101. * _.toPath('a.b.c');
  9102. * // => ['a', 'b', 'c']
  9103. *
  9104. * _.toPath('a[0].b.c');
  9105. * // => ['a', '0', 'b', 'c']
  9106. */function toPath(value){if(isArray(value)){return arrayMap(value,toKey);}return isSymbol(value)?[value]:copyArray(stringToPath(toString(value)));}/**
  9107. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  9108. *
  9109. * @static
  9110. * @since 0.1.0
  9111. * @memberOf _
  9112. * @category Util
  9113. * @param {string} [prefix=''] The value to prefix the ID with.
  9114. * @returns {string} Returns the unique ID.
  9115. * @example
  9116. *
  9117. * _.uniqueId('contact_');
  9118. * // => 'contact_104'
  9119. *
  9120. * _.uniqueId();
  9121. * // => '105'
  9122. */function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id;}/* ------------------------------------------------------------------------*//**
  9123. * Adds two numbers.
  9124. *
  9125. * @static
  9126. * @memberOf _
  9127. * @since 3.4.0
  9128. * @category Math
  9129. * @param {number} augend The first number in an addition.
  9130. * @param {number} addend The second number in an addition.
  9131. * @returns {number} Returns the total.
  9132. * @example
  9133. *
  9134. * _.add(6, 4);
  9135. * // => 10
  9136. */var add=createMathOperation(function(augend,addend){return augend+addend;},0);/**
  9137. * Computes `number` rounded up to `precision`.
  9138. *
  9139. * @static
  9140. * @memberOf _
  9141. * @since 3.10.0
  9142. * @category Math
  9143. * @param {number} number The number to round up.
  9144. * @param {number} [precision=0] The precision to round up to.
  9145. * @returns {number} Returns the rounded up number.
  9146. * @example
  9147. *
  9148. * _.ceil(4.006);
  9149. * // => 5
  9150. *
  9151. * _.ceil(6.004, 2);
  9152. * // => 6.01
  9153. *
  9154. * _.ceil(6040, -2);
  9155. * // => 6100
  9156. */var ceil=createRound('ceil');/**
  9157. * Divide two numbers.
  9158. *
  9159. * @static
  9160. * @memberOf _
  9161. * @since 4.7.0
  9162. * @category Math
  9163. * @param {number} dividend The first number in a division.
  9164. * @param {number} divisor The second number in a division.
  9165. * @returns {number} Returns the quotient.
  9166. * @example
  9167. *
  9168. * _.divide(6, 4);
  9169. * // => 1.5
  9170. */var divide=createMathOperation(function(dividend,divisor){return dividend/divisor;},1);/**
  9171. * Computes `number` rounded down to `precision`.
  9172. *
  9173. * @static
  9174. * @memberOf _
  9175. * @since 3.10.0
  9176. * @category Math
  9177. * @param {number} number The number to round down.
  9178. * @param {number} [precision=0] The precision to round down to.
  9179. * @returns {number} Returns the rounded down number.
  9180. * @example
  9181. *
  9182. * _.floor(4.006);
  9183. * // => 4
  9184. *
  9185. * _.floor(0.046, 2);
  9186. * // => 0.04
  9187. *
  9188. * _.floor(4060, -2);
  9189. * // => 4000
  9190. */var floor=createRound('floor');/**
  9191. * Computes the maximum value of `array`. If `array` is empty or falsey,
  9192. * `undefined` is returned.
  9193. *
  9194. * @static
  9195. * @since 0.1.0
  9196. * @memberOf _
  9197. * @category Math
  9198. * @param {Array} array The array to iterate over.
  9199. * @returns {*} Returns the maximum value.
  9200. * @example
  9201. *
  9202. * _.max([4, 2, 8, 6]);
  9203. * // => 8
  9204. *
  9205. * _.max([]);
  9206. * // => undefined
  9207. */function max(array){return array&&array.length?baseExtremum(array,identity,baseGt):undefined;}/**
  9208. * This method is like `_.max` except that it accepts `iteratee` which is
  9209. * invoked for each element in `array` to generate the criterion by which
  9210. * the value is ranked. The iteratee is invoked with one argument: (value).
  9211. *
  9212. * @static
  9213. * @memberOf _
  9214. * @since 4.0.0
  9215. * @category Math
  9216. * @param {Array} array The array to iterate over.
  9217. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9218. * @returns {*} Returns the maximum value.
  9219. * @example
  9220. *
  9221. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  9222. *
  9223. * _.maxBy(objects, function(o) { return o.n; });
  9224. * // => { 'n': 2 }
  9225. *
  9226. * // The `_.property` iteratee shorthand.
  9227. * _.maxBy(objects, 'n');
  9228. * // => { 'n': 2 }
  9229. */function maxBy(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseGt):undefined;}/**
  9230. * Computes the mean of the values in `array`.
  9231. *
  9232. * @static
  9233. * @memberOf _
  9234. * @since 4.0.0
  9235. * @category Math
  9236. * @param {Array} array The array to iterate over.
  9237. * @returns {number} Returns the mean.
  9238. * @example
  9239. *
  9240. * _.mean([4, 2, 8, 6]);
  9241. * // => 5
  9242. */function mean(array){return baseMean(array,identity);}/**
  9243. * This method is like `_.mean` except that it accepts `iteratee` which is
  9244. * invoked for each element in `array` to generate the value to be averaged.
  9245. * The iteratee is invoked with one argument: (value).
  9246. *
  9247. * @static
  9248. * @memberOf _
  9249. * @since 4.7.0
  9250. * @category Math
  9251. * @param {Array} array The array to iterate over.
  9252. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9253. * @returns {number} Returns the mean.
  9254. * @example
  9255. *
  9256. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  9257. *
  9258. * _.meanBy(objects, function(o) { return o.n; });
  9259. * // => 5
  9260. *
  9261. * // The `_.property` iteratee shorthand.
  9262. * _.meanBy(objects, 'n');
  9263. * // => 5
  9264. */function meanBy(array,iteratee){return baseMean(array,getIteratee(iteratee,2));}/**
  9265. * Computes the minimum value of `array`. If `array` is empty or falsey,
  9266. * `undefined` is returned.
  9267. *
  9268. * @static
  9269. * @since 0.1.0
  9270. * @memberOf _
  9271. * @category Math
  9272. * @param {Array} array The array to iterate over.
  9273. * @returns {*} Returns the minimum value.
  9274. * @example
  9275. *
  9276. * _.min([4, 2, 8, 6]);
  9277. * // => 2
  9278. *
  9279. * _.min([]);
  9280. * // => undefined
  9281. */function min(array){return array&&array.length?baseExtremum(array,identity,baseLt):undefined;}/**
  9282. * This method is like `_.min` except that it accepts `iteratee` which is
  9283. * invoked for each element in `array` to generate the criterion by which
  9284. * the value is ranked. The iteratee is invoked with one argument: (value).
  9285. *
  9286. * @static
  9287. * @memberOf _
  9288. * @since 4.0.0
  9289. * @category Math
  9290. * @param {Array} array The array to iterate over.
  9291. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9292. * @returns {*} Returns the minimum value.
  9293. * @example
  9294. *
  9295. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  9296. *
  9297. * _.minBy(objects, function(o) { return o.n; });
  9298. * // => { 'n': 1 }
  9299. *
  9300. * // The `_.property` iteratee shorthand.
  9301. * _.minBy(objects, 'n');
  9302. * // => { 'n': 1 }
  9303. */function minBy(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseLt):undefined;}/**
  9304. * Multiply two numbers.
  9305. *
  9306. * @static
  9307. * @memberOf _
  9308. * @since 4.7.0
  9309. * @category Math
  9310. * @param {number} multiplier The first number in a multiplication.
  9311. * @param {number} multiplicand The second number in a multiplication.
  9312. * @returns {number} Returns the product.
  9313. * @example
  9314. *
  9315. * _.multiply(6, 4);
  9316. * // => 24
  9317. */var multiply=createMathOperation(function(multiplier,multiplicand){return multiplier*multiplicand;},1);/**
  9318. * Computes `number` rounded to `precision`.
  9319. *
  9320. * @static
  9321. * @memberOf _
  9322. * @since 3.10.0
  9323. * @category Math
  9324. * @param {number} number The number to round.
  9325. * @param {number} [precision=0] The precision to round to.
  9326. * @returns {number} Returns the rounded number.
  9327. * @example
  9328. *
  9329. * _.round(4.006);
  9330. * // => 4
  9331. *
  9332. * _.round(4.006, 2);
  9333. * // => 4.01
  9334. *
  9335. * _.round(4060, -2);
  9336. * // => 4100
  9337. */var round=createRound('round');/**
  9338. * Subtract two numbers.
  9339. *
  9340. * @static
  9341. * @memberOf _
  9342. * @since 4.0.0
  9343. * @category Math
  9344. * @param {number} minuend The first number in a subtraction.
  9345. * @param {number} subtrahend The second number in a subtraction.
  9346. * @returns {number} Returns the difference.
  9347. * @example
  9348. *
  9349. * _.subtract(6, 4);
  9350. * // => 2
  9351. */var subtract=createMathOperation(function(minuend,subtrahend){return minuend-subtrahend;},0);/**
  9352. * Computes the sum of the values in `array`.
  9353. *
  9354. * @static
  9355. * @memberOf _
  9356. * @since 3.4.0
  9357. * @category Math
  9358. * @param {Array} array The array to iterate over.
  9359. * @returns {number} Returns the sum.
  9360. * @example
  9361. *
  9362. * _.sum([4, 2, 8, 6]);
  9363. * // => 20
  9364. */function sum(array){return array&&array.length?baseSum(array,identity):0;}/**
  9365. * This method is like `_.sum` except that it accepts `iteratee` which is
  9366. * invoked for each element in `array` to generate the value to be summed.
  9367. * The iteratee is invoked with one argument: (value).
  9368. *
  9369. * @static
  9370. * @memberOf _
  9371. * @since 4.0.0
  9372. * @category Math
  9373. * @param {Array} array The array to iterate over.
  9374. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9375. * @returns {number} Returns the sum.
  9376. * @example
  9377. *
  9378. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  9379. *
  9380. * _.sumBy(objects, function(o) { return o.n; });
  9381. * // => 20
  9382. *
  9383. * // The `_.property` iteratee shorthand.
  9384. * _.sumBy(objects, 'n');
  9385. * // => 20
  9386. */function sumBy(array,iteratee){return array&&array.length?baseSum(array,getIteratee(iteratee,2)):0;}/* ------------------------------------------------------------------------*/// Add methods that return wrapped values in chain sequences.
  9387. lodash.after=after;lodash.ary=ary;lodash.assign=assign;lodash.assignIn=assignIn;lodash.assignInWith=assignInWith;lodash.assignWith=assignWith;lodash.at=at;lodash.before=before;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.castArray=castArray;lodash.chain=chain;lodash.chunk=chunk;lodash.compact=compact;lodash.concat=concat;lodash.cond=cond;lodash.conforms=conforms;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.curry=curry;lodash.curryRight=curryRight;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defaultsDeep=defaultsDeep;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.differenceBy=differenceBy;lodash.differenceWith=differenceWith;lodash.drop=drop;lodash.dropRight=dropRight;lodash.dropRightWhile=dropRightWhile;lodash.dropWhile=dropWhile;lodash.fill=fill;lodash.filter=filter;lodash.flatMap=flatMap;lodash.flatMapDeep=flatMapDeep;lodash.flatMapDepth=flatMapDepth;lodash.flatten=flatten;lodash.flattenDeep=flattenDeep;lodash.flattenDepth=flattenDepth;lodash.flip=flip;lodash.flow=flow;lodash.flowRight=flowRight;lodash.fromPairs=fromPairs;lodash.functions=functions;lodash.functionsIn=functionsIn;lodash.groupBy=groupBy;lodash.initial=initial;lodash.intersection=intersection;lodash.intersectionBy=intersectionBy;lodash.intersectionWith=intersectionWith;lodash.invert=invert;lodash.invertBy=invertBy;lodash.invokeMap=invokeMap;lodash.iteratee=iteratee;lodash.keyBy=keyBy;lodash.keys=keys;lodash.keysIn=keysIn;lodash.map=map;lodash.mapKeys=mapKeys;lodash.mapValues=mapValues;lodash.matches=matches;lodash.matchesProperty=matchesProperty;lodash.memoize=memoize;lodash.merge=merge;lodash.mergeWith=mergeWith;lodash.method=method;lodash.methodOf=methodOf;lodash.mixin=mixin;lodash.negate=negate;lodash.nthArg=nthArg;lodash.omit=omit;lodash.omitBy=omitBy;lodash.once=once;lodash.orderBy=orderBy;lodash.over=over;lodash.overArgs=overArgs;lodash.overEvery=overEvery;lodash.overSome=overSome;lodash.partial=partial;lodash.partialRight=partialRight;lodash.partition=partition;lodash.pick=pick;lodash.pickBy=pickBy;lodash.property=property;lodash.propertyOf=propertyOf;lodash.pull=pull;lodash.pullAll=pullAll;lodash.pullAllBy=pullAllBy;lodash.pullAllWith=pullAllWith;lodash.pullAt=pullAt;lodash.range=range;lodash.rangeRight=rangeRight;lodash.rearg=rearg;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.reverse=reverse;lodash.sampleSize=sampleSize;lodash.set=set;lodash.setWith=setWith;lodash.shuffle=shuffle;lodash.slice=slice;lodash.sortBy=sortBy;lodash.sortedUniq=sortedUniq;lodash.sortedUniqBy=sortedUniqBy;lodash.split=split;lodash.spread=spread;lodash.tail=tail;lodash.take=take;lodash.takeRight=takeRight;lodash.takeRightWhile=takeRightWhile;lodash.takeWhile=takeWhile;lodash.tap=tap;lodash.throttle=throttle;lodash.thru=thru;lodash.toArray=toArray;lodash.toPairs=toPairs;lodash.toPairsIn=toPairsIn;lodash.toPath=toPath;lodash.toPlainObject=toPlainObject;lodash.transform=transform;lodash.unary=unary;lodash.union=union;lodash.unionBy=unionBy;lodash.unionWith=unionWith;lodash.uniq=uniq;lodash.uniqBy=uniqBy;lodash.uniqWith=uniqWith;lodash.unset=unset;lodash.unzip=unzip;lodash.unzipWith=unzipWith;lodash.update=update;lodash.updateWith=updateWith;lodash.values=values;lodash.valuesIn=valuesIn;lodash.without=without;lodash.words=words;lodash.wrap=wrap;lodash.xor=xor;lodash.xorBy=xorBy;lodash.xorWith=xorWith;lodash.zip=zip;lodash.zipObject=zipObject;lodash.zipObjectDeep=zipObjectDeep;lodash.zipWith=zipWith;// Add aliases.
  9388. lodash.entries=toPairs;lodash.entriesIn=toPairsIn;lodash.extend=assignIn;lodash.extendWith=assignInWith;// Add methods to `lodash.prototype`.
  9389. mixin(lodash,lodash);/* ------------------------------------------------------------------------*/// Add methods that return unwrapped values in chain sequences.
  9390. lodash.add=add;lodash.attempt=attempt;lodash.camelCase=camelCase;lodash.capitalize=capitalize;lodash.ceil=ceil;lodash.clamp=clamp;lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.cloneDeepWith=cloneDeepWith;lodash.cloneWith=cloneWith;lodash.conformsTo=conformsTo;lodash.deburr=deburr;lodash.defaultTo=defaultTo;lodash.divide=divide;lodash.endsWith=endsWith;lodash.eq=eq;lodash.escape=escape;lodash.escapeRegExp=escapeRegExp;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.floor=floor;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.get=get;lodash.gt=gt;lodash.gte=gte;lodash.has=has;lodash.hasIn=hasIn;lodash.head=head;lodash.identity=identity;lodash.includes=includes;lodash.indexOf=indexOf;lodash.inRange=inRange;lodash.invoke=invoke;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isArrayBuffer=isArrayBuffer;lodash.isArrayLike=isArrayLike;lodash.isArrayLikeObject=isArrayLikeObject;lodash.isBoolean=isBoolean;lodash.isBuffer=isBuffer;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isEqualWith=isEqualWith;lodash.isError=isError;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isInteger=isInteger;lodash.isLength=isLength;lodash.isMap=isMap;lodash.isMatch=isMatch;lodash.isMatchWith=isMatchWith;lodash.isNaN=isNaN;lodash.isNative=isNative;lodash.isNil=isNil;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isObjectLike=isObjectLike;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isSafeInteger=isSafeInteger;lodash.isSet=isSet;lodash.isString=isString;lodash.isSymbol=isSymbol;lodash.isTypedArray=isTypedArray;lodash.isUndefined=isUndefined;lodash.isWeakMap=isWeakMap;lodash.isWeakSet=isWeakSet;lodash.join=join;lodash.kebabCase=kebabCase;lodash.last=last;lodash.lastIndexOf=lastIndexOf;lodash.lowerCase=lowerCase;lodash.lowerFirst=lowerFirst;lodash.lt=lt;lodash.lte=lte;lodash.max=max;lodash.maxBy=maxBy;lodash.mean=mean;lodash.meanBy=meanBy;lodash.min=min;lodash.minBy=minBy;lodash.stubArray=stubArray;lodash.stubFalse=stubFalse;lodash.stubObject=stubObject;lodash.stubString=stubString;lodash.stubTrue=stubTrue;lodash.multiply=multiply;lodash.nth=nth;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.pad=pad;lodash.padEnd=padEnd;lodash.padStart=padStart;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.repeat=repeat;lodash.replace=replace;lodash.result=result;lodash.round=round;lodash.runInContext=runInContext;lodash.sample=sample;lodash.size=size;lodash.snakeCase=snakeCase;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.sortedIndexBy=sortedIndexBy;lodash.sortedIndexOf=sortedIndexOf;lodash.sortedLastIndex=sortedLastIndex;lodash.sortedLastIndexBy=sortedLastIndexBy;lodash.sortedLastIndexOf=sortedLastIndexOf;lodash.startCase=startCase;lodash.startsWith=startsWith;lodash.subtract=subtract;lodash.sum=sum;lodash.sumBy=sumBy;lodash.template=template;lodash.times=times;lodash.toFinite=toFinite;lodash.toInteger=toInteger;lodash.toLength=toLength;lodash.toLower=toLower;lodash.toNumber=toNumber;lodash.toSafeInteger=toSafeInteger;lodash.toString=toString;lodash.toUpper=toUpper;lodash.trim=trim;lodash.trimEnd=trimEnd;lodash.trimStart=trimStart;lodash.truncate=truncate;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.upperCase=upperCase;lodash.upperFirst=upperFirst;// Add aliases.
  9391. lodash.each=forEach;lodash.eachRight=forEachRight;lodash.first=head;mixin(lodash,function(){var source={};baseForOwn(lodash,function(func,methodName){if(!hasOwnProperty.call(lodash.prototype,methodName)){source[methodName]=func;}});return source;}(),{chain:false});/* ------------------------------------------------------------------------*//**
  9392. * The semantic version number.
  9393. *
  9394. * @static
  9395. * @memberOf _
  9396. * @type {string}
  9397. */lodash.VERSION=VERSION;// Assign default placeholders.
  9398. arrayEach(['bind','bindKey','curry','curryRight','partial','partialRight'],function(methodName){lodash[methodName].placeholder=lodash;});// Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  9399. arrayEach(['drop','take'],function(methodName,index){LazyWrapper.prototype[methodName]=function(n){n=n===undefined?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();if(result.__filtered__){result.__takeCount__=nativeMin(n,result.__takeCount__);}else{result.__views__.push({size:nativeMin(n,MAX_ARRAY_LENGTH),type:methodName+(result.__dir__<0?'Right':'')});}return result;};LazyWrapper.prototype[methodName+'Right']=function(n){return this.reverse()[methodName](n).reverse();};});// Add `LazyWrapper` methods that accept an `iteratee` value.
  9400. arrayEach(['filter','map','takeWhile'],function(methodName,index){var type=index+1,isFilter=type==LAZY_FILTER_FLAG||type==LAZY_WHILE_FLAG;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();result.__iteratees__.push({iteratee:getIteratee(iteratee,3),type:type});result.__filtered__=result.__filtered__||isFilter;return result;};});// Add `LazyWrapper` methods for `_.head` and `_.last`.
  9401. arrayEach(['head','last'],function(methodName,index){var takeName='take'+(index?'Right':'');LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0];};});// Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  9402. arrayEach(['initial','tail'],function(methodName,index){var dropName='drop'+(index?'':'Right');LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1);};});LazyWrapper.prototype.compact=function(){return this.filter(identity);};LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head();};LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate);};LazyWrapper.prototype.invokeMap=baseRest(function(path,args){if(typeof path==='function'){return new LazyWrapper(this);}return this.map(function(value){return baseInvoke(value,path,args);});});LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)));};LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;if(result.__filtered__&&(start>0||end<0)){return new LazyWrapper(result);}if(start<0){result=result.takeRight(-start);}else if(start){result=result.drop(start);}if(end!==undefined){end=toInteger(end);result=end<0?result.dropRight(-end):result.take(end-start);}return result;};LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse();};LazyWrapper.prototype.toArray=function(){return this.take(MAX_ARRAY_LENGTH);};// Add `LazyWrapper` methods to `lodash.prototype`.
  9403. baseForOwn(LazyWrapper.prototype,function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?'take'+(methodName=='last'?'Right':''):methodName],retUnwrapped=isTaker||/^find/.test(methodName);if(!lodashFunc){return;}lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value);var interceptor=function interceptor(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result;};if(useLazy&&checkIteratee&&typeof iteratee==='function'&&iteratee.length!=1){// Avoid lazy use if the iteratee has a "length" value other than `1`.
  9404. isLazy=useLazy=false;}var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);result.__actions__.push({func:thru,args:[interceptor],thisArg:undefined});return new LodashWrapper(result,chainAll);}if(isUnwrapped&&onlyLazy){return func.apply(this,args);}result=this.thru(interceptor);return isUnwrapped?isTaker?result.value()[0]:result.value():result;};});// Add `Array` methods to `lodash.prototype`.
  9405. arrayEach(['pop','push','shift','sort','splice','unshift'],function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?'tap':'thru',retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args);}return this[chainName](function(value){return func.apply(isArray(value)?value:[],args);});};});// Map minified method names to their real names.
  9406. baseForOwn(LazyWrapper.prototype,function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+'',names=realNames[key]||(realNames[key]=[]);names.push({name:methodName,func:lodashFunc});}});realNames[createHybrid(undefined,WRAP_BIND_KEY_FLAG).name]=[{name:'wrapper',func:undefined}];// Add methods to `LazyWrapper`.
  9407. LazyWrapper.prototype.clone=lazyClone;LazyWrapper.prototype.reverse=lazyReverse;LazyWrapper.prototype.value=lazyValue;// Add chain sequence methods to the `lodash` wrapper.
  9408. lodash.prototype.at=wrapperAt;lodash.prototype.chain=wrapperChain;lodash.prototype.commit=wrapperCommit;lodash.prototype.next=wrapperNext;lodash.prototype.plant=wrapperPlant;lodash.prototype.reverse=wrapperReverse;lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=wrapperValue;// Add lazy aliases.
  9409. lodash.prototype.first=lodash.prototype.head;if(symIterator){lodash.prototype[symIterator]=wrapperToIterator;}return lodash;};/* --------------------------------------------------------------------------*/// Export lodash.
  9410. var _=runInContext();// Some AMD build optimizers, like r.js, check for condition patterns like:
  9411. if(typeof define==='function'&&_typeof(define.amd)==='object'&&define.amd){// Expose Lodash on the global object to prevent errors when Lodash is
  9412. // loaded by a script tag in the presence of an AMD loader.
  9413. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  9414. // Use `_.noConflict` to remove Lodash from the global object.
  9415. root._=_;// Define as an anonymous module so, through path mapping, it can be
  9416. // referenced as the "underscore" module.
  9417. define(function(){return _;});}// Check for `exports` after `define` in case a build optimizer adds it.
  9418. else if(freeModule){// Export for Node.js.
  9419. (freeModule.exports=_)._=_;// Export for CommonJS support.
  9420. freeExports._=_;}else{// Export to the global object.
  9421. root._=_;}}).call(undefined);