resources_js_pages_home_Index_vue.js 643KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_home_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppCardStatistic.vue?vue&type=script&setup=true&lang=js":
  3. /*!*********************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppCardStatistic.vue?vue&type=script&setup=true&lang=js ***!
  5. \*********************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  13. props: {
  14. data: {
  15. type: Object,
  16. required: true
  17. }
  18. },
  19. setup: function setup(__props, _ref) {
  20. var expose = _ref.expose;
  21. expose();
  22. var __returned__ = {};
  23. Object.defineProperty(__returned__, '__isScriptSetup', {
  24. enumerable: false,
  25. value: true
  26. });
  27. return __returned__;
  28. }
  29. });
  30. /***/ }),
  31. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  32. /*!***************************************************************************************************************************************************************************************************************!*\
  33. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  34. \***************************************************************************************************************************************************************************************************************/
  35. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  36. "use strict";
  37. __webpack_require__.r(__webpack_exports__);
  38. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  39. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  40. /* harmony export */ });
  41. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  42. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  43. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  44. setup: function setup(__props, _ref) {
  45. var expose = _ref.expose;
  46. expose();
  47. var flashMessage = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  48. return (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.usePage)().props.value.flash;
  49. });
  50. var messageDisplay = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)({});
  51. var onClose = function onClose() {
  52. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.usePage)().props.value.errors = {};
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.usePage)().props.value.flash.success = null;
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.usePage)().props.value.flash.error = null;
  55. messageDisplay.value = {
  56. display: 'none'
  57. };
  58. };
  59. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(flashMessage, function () {
  60. messageDisplay.value = {
  61. display: ''
  62. };
  63. }, {
  64. deep: true
  65. });
  66. var __returned__ = {
  67. flashMessage: flashMessage,
  68. messageDisplay: messageDisplay,
  69. onClose: onClose,
  70. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  71. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  72. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  73. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.usePage
  74. };
  75. Object.defineProperty(__returned__, '__isScriptSetup', {
  76. enumerable: false,
  77. value: true
  78. });
  79. return __returned__;
  80. }
  81. });
  82. /***/ }),
  83. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  84. /*!***************************************************************************************************************************************************************************************************************!*\
  85. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  86. \***************************************************************************************************************************************************************************************************************/
  87. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  88. "use strict";
  89. __webpack_require__.r(__webpack_exports__);
  90. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  91. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  92. /* harmony export */ });
  93. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  94. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  95. props: {
  96. model: Array
  97. },
  98. emits: ['menuitem-click'],
  99. setup: function setup(__props, _ref) {
  100. var expose = _ref.expose,
  101. emits = _ref.emit;
  102. expose();
  103. var onKeyDown = function onKeyDown(event) {
  104. var nodeElement = event.target;
  105. if (event.code === 'Enter' || event.code === 'Space') {
  106. nodeElement.click();
  107. event.preventDefault();
  108. }
  109. };
  110. var onMenuItemClick = function onMenuItemClick(event) {
  111. emits('menuitem-click', event);
  112. };
  113. var __returned__ = {
  114. emits: emits,
  115. onKeyDown: onKeyDown,
  116. onMenuItemClick: onMenuItemClick,
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  138. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  139. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  140. props: {
  141. items: Array,
  142. root: {
  143. type: Boolean,
  144. "default": false
  145. }
  146. },
  147. emits: ['menuitem-click'],
  148. setup: function setup(__props, _ref) {
  149. var expose = _ref.expose,
  150. emits = _ref.emit;
  151. expose();
  152. var activeIndex = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  153. var onMenuItemClick = function onMenuItemClick(event, item, index) {
  154. if (item.disabled) {
  155. event.preventDefault();
  156. return;
  157. }
  158. if (!item.to && !item.url) {
  159. event.preventDefault();
  160. }
  161. if (item.command) {
  162. item.command({
  163. originalEvent: event,
  164. item: item
  165. });
  166. }
  167. activeIndex.value = index === activeIndex.value ? null : index;
  168. emits('menuitem-click', {
  169. originalEvent: event,
  170. item: item
  171. });
  172. };
  173. var visible = function visible(item) {
  174. return typeof item.visible === 'function' ? item.visible() : item.visible !== false;
  175. };
  176. var __returned__ = {
  177. emits: emits,
  178. activeIndex: activeIndex,
  179. onMenuItemClick: onMenuItemClick,
  180. visible: visible,
  181. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  182. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Link
  183. };
  184. Object.defineProperty(__returned__, '__isScriptSetup', {
  185. enumerable: false,
  186. value: true
  187. });
  188. return __returned__;
  189. }
  190. });
  191. /***/ }),
  192. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  193. /*!**************************************************************************************************************************************************************************************************************!*\
  194. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  195. \**************************************************************************************************************************************************************************************************************/
  196. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  197. "use strict";
  198. __webpack_require__.r(__webpack_exports__);
  199. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  200. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  201. /* harmony export */ });
  202. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. emits: ['menu-toggle'],
  205. setup: function setup(__props, _ref) {
  206. var expose = _ref.expose;
  207. expose();
  208. var __returned__ = {
  209. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  210. };
  211. Object.defineProperty(__returned__, '__isScriptSetup', {
  212. enumerable: false,
  213. value: true
  214. });
  215. return __returned__;
  216. }
  217. });
  218. /***/ }),
  219. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/AppLayout.vue?vue&type=script&setup=true&lang=js":
  220. /*!***********************************************************************************************************************************************************************************************************!*\
  221. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/AppLayout.vue?vue&type=script&setup=true&lang=js ***!
  222. \***********************************************************************************************************************************************************************************************************/
  223. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  224. "use strict";
  225. __webpack_require__.r(__webpack_exports__);
  226. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  227. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  228. /* harmony export */ });
  229. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  230. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  231. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  232. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  233. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  234. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  235. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  236. setup: function setup(__props, _ref) {
  237. var expose = _ref.expose;
  238. expose();
  239. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  240. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  241. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  242. var isDesktop = function isDesktop() {
  243. return window.innerWidth >= 992;
  244. };
  245. var addClass = function addClass(element, className) {
  246. if (element.classList) element.classList.add(className);else element.className += ' ' + className;
  247. };
  248. var removeClass = function removeClass(element, className) {
  249. if (element.classList) element.classList.remove(className);else element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
  250. };
  251. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onBeforeUpdate)(function () {
  252. if (mobileMenuActive.value) {
  253. addClass(document.body, 'body-overflow-hidden');
  254. } else {
  255. removeClass(document.body, 'body-overflow-hidden');
  256. }
  257. });
  258. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  259. return ['layout-wrapper', 'layout-static', {
  260. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  261. 'layout-mobile-sidebar-active': mobileMenuActive.value
  262. }];
  263. });
  264. var onWrapperClick = function onWrapperClick() {
  265. if (!menuClick.value) {
  266. mobileMenuActive.value = false;
  267. }
  268. menuClick.value = false;
  269. };
  270. var onMenuToggle = function onMenuToggle(event) {
  271. menuClick.value = true;
  272. if (isDesktop()) {
  273. staticMenuInactive.value = !staticMenuInactive.value;
  274. } else {
  275. mobileMenuActive.value = !mobileMenuActive.value;
  276. }
  277. event.preventDefault();
  278. };
  279. var onSidebarClick = function onSidebarClick() {
  280. menuClick.value = true;
  281. };
  282. var onMenuItemClick = function onMenuItemClick(event) {
  283. if (event.item && !event.item.items) {
  284. mobileMenuActive.value = false;
  285. }
  286. };
  287. var __returned__ = {
  288. mobileMenuActive: mobileMenuActive,
  289. staticMenuInactive: staticMenuInactive,
  290. menuClick: menuClick,
  291. isDesktop: isDesktop,
  292. addClass: addClass,
  293. removeClass: removeClass,
  294. containerClass: containerClass,
  295. onWrapperClick: onWrapperClick,
  296. onMenuToggle: onMenuToggle,
  297. onSidebarClick: onSidebarClick,
  298. onMenuItemClick: onMenuItemClick,
  299. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  300. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  301. onBeforeUpdate: vue__WEBPACK_IMPORTED_MODULE_0__.onBeforeUpdate,
  302. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  303. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  304. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  305. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  306. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  307. };
  308. Object.defineProperty(__returned__, '__isScriptSetup', {
  309. enumerable: false,
  310. value: true
  311. });
  312. return __returned__;
  313. }
  314. });
  315. /***/ }),
  316. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js":
  317. /*!**********************************************************************************************************************************************************************************************************!*\
  318. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js ***!
  319. \**********************************************************************************************************************************************************************************************************/
  320. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  321. "use strict";
  322. __webpack_require__.r(__webpack_exports__);
  323. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  324. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  325. /* harmony export */ });
  326. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  327. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  328. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
  329. /* harmony import */ var _components_AppCardStatistic_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppCardStatistic.vue */ "./resources/js/components/AppCardStatistic.vue");
  330. /* harmony import */ var _layouts_AppLayout_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/layouts/AppLayout.vue */ "./resources/js/layouts/AppLayout.vue");
  331. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  332. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  333. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  334. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  335. props: {
  336. cardStatistics: Object,
  337. barStatistics: Object,
  338. barHorizontalStatistics: Object
  339. },
  340. setup: function setup(__props, _ref) {
  341. var expose = _ref.expose;
  342. expose();
  343. var colors = ['#349dcf', '#00b2da', '#00c7dd', '#1fdbdb', '#57eed3', '#88ffc9', '#96ed9a', '#a8d96c', '#bbc242', '#cda91d'];
  344. var barChart = function barChart(chartData) {
  345. var colors = ['#349dcf', '#a8d96c'];
  346. var data = {
  347. datasets: []
  348. };
  349. var id = 0;
  350. for (var key in chartData) {
  351. data.datasets.push({
  352. label: key,
  353. backgroundColor: colors[id],
  354. data: chartData[key]
  355. });
  356. id++;
  357. }
  358. return data;
  359. };
  360. var barChartOption = {
  361. maintainAspectRatio: false,
  362. datasetFill: false
  363. };
  364. var barHorizontalChart = function barHorizontalChart(chartData) {
  365. // const data = {
  366. // datasets: [],
  367. // }
  368. // let id = 0
  369. // for (const key in chartData) {
  370. // data.datasets.push({
  371. // label: key,
  372. // backgroundColor: colors[id],
  373. // data: chartData[key],
  374. // })
  375. // id++
  376. // }
  377. // return data
  378. var labels = [];
  379. var data = [];
  380. var _iterator = _createForOfIteratorHelper(chartData),
  381. _step;
  382. try {
  383. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  384. var _chartData = _step.value;
  385. labels.push([_chartData.phone, _chartData.name]);
  386. data.push(_chartData.amount);
  387. }
  388. } catch (err) {
  389. _iterator.e(err);
  390. } finally {
  391. _iterator.f();
  392. }
  393. return {
  394. labels: labels,
  395. datasets: [{
  396. data: data,
  397. backgroundColor: colors
  398. }]
  399. };
  400. };
  401. var barHorizontalChartOption = {
  402. maintainAspectRatio: false,
  403. datasetFill: false,
  404. indexAxis: 'y',
  405. plugins: {
  406. legend: {
  407. display: false
  408. }
  409. }
  410. };
  411. var pieChart = function pieChart(chartData) {
  412. var labels = [];
  413. var data = [];
  414. for (var key in chartData) {
  415. labels.push(key);
  416. data.push(chartData[key]);
  417. }
  418. return {
  419. labels: labels,
  420. datasets: [{
  421. data: data,
  422. backgroundColor: colors
  423. }]
  424. };
  425. };
  426. var pieChartOption = {
  427. maintainAspectRatio: false,
  428. datasetFill: false
  429. };
  430. var __returned__ = {
  431. colors: colors,
  432. barChart: barChart,
  433. barChartOption: barChartOption,
  434. barHorizontalChart: barHorizontalChart,
  435. barHorizontalChartOption: barHorizontalChartOption,
  436. pieChart: pieChart,
  437. pieChartOption: pieChartOption,
  438. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Head,
  439. orderBy: lodash__WEBPACK_IMPORTED_MODULE_1__.orderBy,
  440. AppCardStatistic: _components_AppCardStatistic_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  441. AppLayout: _layouts_AppLayout_vue__WEBPACK_IMPORTED_MODULE_3__["default"]
  442. };
  443. Object.defineProperty(__returned__, '__isScriptSetup', {
  444. enumerable: false,
  445. value: true
  446. });
  447. return __returned__;
  448. }
  449. });
  450. /***/ }),
  451. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppCardStatistic.vue?vue&type=template&id=29d9832c":
  452. /*!**************************************************************************************************************************************************************************************************************************************************************************************!*\
  453. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppCardStatistic.vue?vue&type=template&id=29d9832c ***!
  454. \**************************************************************************************************************************************************************************************************************************************************************************************/
  455. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  456. "use strict";
  457. __webpack_require__.r(__webpack_exports__);
  458. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  459. /* harmony export */ "render": () => (/* binding */ render)
  460. /* harmony export */ });
  461. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  462. var _hoisted_1 = {
  463. "class": "flex justify-content-between mb-3"
  464. };
  465. var _hoisted_2 = {
  466. "class": "block text-500 font-medium mb-3"
  467. };
  468. var _hoisted_3 = {
  469. key: 0,
  470. "class": "text-900 font-medium text-xl"
  471. };
  472. var _hoisted_4 = {
  473. "class": "flex align-items-center justify-content-center bg-orange-100 border-round",
  474. style: {
  475. "width": "2.5rem",
  476. "height": "2.5rem"
  477. }
  478. };
  479. var _hoisted_5 = {
  480. "class": "text-green-500 font-medium"
  481. };
  482. var _hoisted_6 = {
  483. "class": "text-500"
  484. };
  485. function render(_ctx, _cache, $props, $setup, $data, $options) {
  486. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  487. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Card, {
  488. "class": "h-full"
  489. }, {
  490. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  491. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.data.title), 1
  492. /* TEXT */
  493. ), $props.data.value ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.data.value), 1
  494. /* TEXT */
  495. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  496. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["text-orange-500 text-xl", $props.data.icon])
  497. }, null, 2
  498. /* CLASS */
  499. )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_5, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.data.amount), 1
  500. /* TEXT */
  501. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_6, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(' ' + $props.data.amountLabel), 1
  502. /* TEXT */
  503. )];
  504. }),
  505. _: 1
  506. /* STABLE */
  507. });
  508. }
  509. /***/ }),
  510. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e":
  511. /*!*******************************************************************************************************************************************************************************************************************************************************************************!*\
  512. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e ***!
  513. \*******************************************************************************************************************************************************************************************************************************************************************************/
  514. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  515. "use strict";
  516. __webpack_require__.r(__webpack_exports__);
  517. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  518. /* harmony export */ "render": () => (/* binding */ render)
  519. /* harmony export */ });
  520. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  521. var _hoisted_1 = {
  522. "class": "layout-footer"
  523. };
  524. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  525. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  526. href: "https://dijitalcode.com",
  527. target: "_blank",
  528. "class": "font-medium ml-2"
  529. }, "DijitalCODE", -1
  530. /* HOISTED */
  531. );
  532. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  533. function render(_ctx, _cache) {
  534. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  535. }
  536. /***/ }),
  537. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  538. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  539. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  540. \********************************************************************************************************************************************************************************************************************************************************************************/
  541. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  542. "use strict";
  543. __webpack_require__.r(__webpack_exports__);
  544. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  545. /* harmony export */ "render": () => (/* binding */ render)
  546. /* harmony export */ });
  547. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  548. var _hoisted_1 = {
  549. "class": "grid"
  550. };
  551. var _hoisted_2 = {
  552. "class": "col-12"
  553. };
  554. var _hoisted_3 = {
  555. key: 0
  556. };
  557. var _hoisted_4 = {
  558. key: 1
  559. };
  560. function render(_ctx, _cache, $props, $setup, $data, $options) {
  561. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  562. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  563. key: 0,
  564. severity: "success",
  565. style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)($setup.messageDisplay),
  566. onClose: $setup.onClose
  567. }, {
  568. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  569. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  570. /* TEXT */
  571. )];
  572. }),
  573. _: 1
  574. /* STABLE */
  575. }, 8
  576. /* PROPS */
  577. , ["style"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error || Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  578. key: 1
  579. }, [_ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  580. key: 0,
  581. severity: "error",
  582. style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)($setup.messageDisplay),
  583. onClose: $setup.onClose
  584. }, {
  585. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  586. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  587. /* TEXT */
  588. )];
  589. }),
  590. _: 1
  591. /* STABLE */
  592. }, 8
  593. /* PROPS */
  594. , ["style"])) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  595. key: 1,
  596. severity: "error",
  597. style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)($setup.messageDisplay),
  598. onClose: $setup.onClose
  599. }, {
  600. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  601. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3, "Ditemukan satu error pada form")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4, "Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form", 1
  602. /* TEXT */
  603. ))];
  604. }),
  605. _: 1
  606. /* STABLE */
  607. }, 8
  608. /* PROPS */
  609. , ["style"]))], 2112
  610. /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
  611. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])]);
  612. }
  613. /***/ }),
  614. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926":
  615. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  616. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926 ***!
  617. \********************************************************************************************************************************************************************************************************************************************************************************/
  618. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  619. "use strict";
  620. __webpack_require__.r(__webpack_exports__);
  621. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  622. /* harmony export */ "render": () => (/* binding */ render)
  623. /* harmony export */ });
  624. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  625. var _hoisted_1 = {
  626. "class": "layout-menu-container"
  627. };
  628. function render(_ctx, _cache, $props, $setup, $data, $options) {
  629. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  630. "class": "layout-menu",
  631. items: $props.model,
  632. root: true,
  633. onKeydown: $setup.onKeyDown,
  634. onMenuitemClick: $setup.onMenuItemClick
  635. }, null, 8
  636. /* PROPS */
  637. , ["items"])]);
  638. }
  639. /***/ }),
  640. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc":
  641. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  642. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc ***!
  643. \***********************************************************************************************************************************************************************************************************************************************************************************/
  644. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  645. "use strict";
  646. __webpack_require__.r(__webpack_exports__);
  647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  648. /* harmony export */ "render": () => (/* binding */ render)
  649. /* harmony export */ });
  650. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  651. var _hoisted_1 = {
  652. key: 0
  653. };
  654. var _hoisted_2 = ["aria-label"];
  655. var _hoisted_3 = {
  656. key: 0,
  657. "class": "pi pi-fw pi-angle-down menuitem-toggle-icon"
  658. };
  659. var _hoisted_4 = ["href", "target", "aria-label", "onClick"];
  660. var _hoisted_5 = {
  661. key: 0,
  662. "class": "pi pi-fw pi-angle-down menuitem-toggle-icon"
  663. };
  664. function render(_ctx, _cache, $props, $setup, $data, $options) {
  665. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  666. var _component_Badge = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Badge");
  667. var _directive_ripple = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("ripple");
  668. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  669. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [$setup.visible(item) && !item.separator ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  670. key: item.label || i,
  671. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  672. 'layout-menuitem-category': $props.root,
  673. 'active-menuitem': $setup.activeIndex === i && !item.to && !item.disabled
  674. }]),
  675. role: "none"
  676. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  677. key: 0
  678. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  679. "class": "layout-menuitem-root-text",
  680. "aria-label": item.label
  681. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  682. /* TEXT, PROPS */
  683. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  684. items: $setup.visible(item) && item.items,
  685. onMenuitemClick: _cache[0] || (_cache[0] = function ($event) {
  686. return _ctx.$emit('menuitem-click', $event);
  687. })
  688. }, null, 8
  689. /* PROPS */
  690. , ["items"])], 64
  691. /* STABLE_FRAGMENT */
  692. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  693. key: 1
  694. }, [item.to ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  695. key: 0,
  696. role: "menuitem",
  697. href: item.to,
  698. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([item["class"], 'p-ripple', {
  699. 'p-disabled': item.disabled,
  700. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  701. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  702. }]),
  703. style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)(item.style),
  704. target: item.target,
  705. "aria-label": item.label,
  706. onClick: function onClick($event) {
  707. return $setup.onMenuItemClick($event, item, i);
  708. }
  709. }, {
  710. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  711. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  712. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  713. }, null, 2
  714. /* CLASS */
  715. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  716. /* TEXT */
  717. ), item.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("i", _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), item.badge ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Badge, {
  718. key: 1,
  719. value: item.badge
  720. }, null, 8
  721. /* PROPS */
  722. , ["value"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  723. }),
  724. _: 2
  725. /* DYNAMIC */
  726. }, 1032
  727. /* PROPS, DYNAMIC_SLOTS */
  728. , ["href", "class", "style", "target", "aria-label", "onClick"])), [[_directive_ripple]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  729. key: 1,
  730. role: "menuitem",
  731. style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)(item.style),
  732. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([item["class"], 'p-ripple', {
  733. 'p-disabled': item.disabled
  734. }]),
  735. href: item.url || '#',
  736. target: item.target,
  737. "aria-label": item.label,
  738. onClick: function onClick($event) {
  739. return $setup.onMenuItemClick($event, item, i);
  740. }
  741. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  742. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  743. }, null, 2
  744. /* CLASS */
  745. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  746. /* TEXT */
  747. ), item.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("i", _hoisted_5)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), item.badge ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Badge, {
  748. key: 1,
  749. value: item.badge
  750. }, null, 8
  751. /* PROPS */
  752. , ["value"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 14
  753. /* CLASS, STYLE, PROPS */
  754. , _hoisted_4)), [[_directive_ripple]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  755. name: "layout-submenu-wrapper"
  756. }, {
  757. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  758. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  759. items: $setup.visible(item) && item.items,
  760. onMenuitemClick: _cache[1] || (_cache[1] = function ($event) {
  761. return _ctx.$emit('menuitem-click', $event);
  762. })
  763. }, null, 8
  764. /* PROPS */
  765. , ["items"]), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $setup.activeIndex === i]])];
  766. }),
  767. _: 2
  768. /* DYNAMIC */
  769. }, 1024
  770. /* DYNAMIC_SLOTS */
  771. )], 64
  772. /* STABLE_FRAGMENT */
  773. ))], 2
  774. /* CLASS */
  775. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $setup.visible(item) && item.separator ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  776. "class": "p-menu-separator",
  777. role: "separator",
  778. style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)(item.style),
  779. key: 'separator' + i
  780. }, null, 4
  781. /* STYLE */
  782. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  783. /* STABLE_FRAGMENT */
  784. );
  785. }), 256
  786. /* UNKEYED_FRAGMENT */
  787. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  788. }
  789. /***/ }),
  790. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4":
  791. /*!*******************************************************************************************************************************************************************************************************************************************************************************!*\
  792. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4 ***!
  793. \*******************************************************************************************************************************************************************************************************************************************************************************/
  794. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  795. "use strict";
  796. __webpack_require__.r(__webpack_exports__);
  797. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  798. /* harmony export */ "render": () => (/* binding */ render)
  799. /* harmony export */ });
  800. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  801. var _hoisted_1 = {
  802. "class": "layout-topbar"
  803. };
  804. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  805. alt: "Logo",
  806. src: "/images/logo.svg",
  807. "class": "md:mr-3"
  808. }, null, -1
  809. /* HOISTED */
  810. );
  811. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  812. /* HOISTED */
  813. );
  814. var _hoisted_4 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  815. "class": "pi pi-bars"
  816. }, null, -1
  817. /* HOISTED */
  818. );
  819. var _hoisted_5 = [_hoisted_4];
  820. var _hoisted_6 = {
  821. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  822. };
  823. var _hoisted_7 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  824. "class": "pi pi-ellipsis-v"
  825. }, null, -1
  826. /* HOISTED */
  827. );
  828. var _hoisted_8 = [_hoisted_7];
  829. var _hoisted_9 = {
  830. "class": "layout-topbar-menu hidden lg:flex origin-top"
  831. };
  832. var _hoisted_10 = {
  833. "class": "align-self-center"
  834. };
  835. var _hoisted_11 = {
  836. "class": "hidden lg:inline"
  837. };
  838. var _hoisted_12 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  839. "class": "pi pi-user"
  840. }, null, -1
  841. /* HOISTED */
  842. );
  843. var _hoisted_13 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Profil Saya", -1
  844. /* HOISTED */
  845. );
  846. var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  847. "class": "pi pi-sign-out"
  848. }, null, -1
  849. /* HOISTED */
  850. );
  851. var _hoisted_15 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Sign Out", -1
  852. /* HOISTED */
  853. );
  854. function render(_ctx, _cache, $props, $setup, $data, $options) {
  855. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  856. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  857. href: "/",
  858. "class": "layout-topbar-logo"
  859. }, {
  860. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  861. return [_hoisted_2, _hoisted_3];
  862. }),
  863. _: 1
  864. /* STABLE */
  865. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  866. "class": "p-link layout-menu-button layout-topbar-button",
  867. onClick: _cache[0] || (_cache[0] = function ($event) {
  868. return _ctx.$emit('menu-toggle', $event);
  869. })
  870. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  871. selector: '@next',
  872. enterClass: 'hidden',
  873. enterActiveClass: 'scalein',
  874. leaveToClass: 'hidden',
  875. leaveActiveClass: 'fadeout',
  876. hideOnOutsideClick: true
  877. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  878. /* TEXT */
  879. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  880. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  881. "class": "p-link layout-topbar-button"
  882. }, {
  883. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  884. return [_hoisted_12, _hoisted_13];
  885. }),
  886. _: 1
  887. /* STABLE */
  888. }, 8
  889. /* PROPS */
  890. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  891. href: _ctx.route('logout'),
  892. as: "button",
  893. method: "post",
  894. "class": "p-link layout-topbar-button"
  895. }, {
  896. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  897. return [_hoisted_14, _hoisted_15];
  898. }),
  899. _: 1
  900. /* STABLE */
  901. }, 8
  902. /* PROPS */
  903. , ["href"])])])]);
  904. }
  905. /***/ }),
  906. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/AppLayout.vue?vue&type=template&id=2cfb4112":
  907. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  908. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/AppLayout.vue?vue&type=template&id=2cfb4112 ***!
  909. \****************************************************************************************************************************************************************************************************************************************************************************/
  910. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  911. "use strict";
  912. __webpack_require__.r(__webpack_exports__);
  913. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  914. /* harmony export */ "render": () => (/* binding */ render)
  915. /* harmony export */ });
  916. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  917. var _hoisted_1 = {
  918. "class": "layout-main-container"
  919. };
  920. var _hoisted_2 = {
  921. "class": "layout-main"
  922. };
  923. var _hoisted_3 = {
  924. key: 0,
  925. "class": "layout-mask p-component-overlay"
  926. };
  927. function render(_ctx, _cache, $props, $setup, $data, $options) {
  928. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  929. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  930. onClick: $setup.onWrapperClick
  931. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  932. onMenuToggle: $setup.onMenuToggle
  933. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  934. "class": "layout-sidebar",
  935. onClick: $setup.onSidebarClick
  936. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  937. model: $setup.menu[_ctx.$page.props.auth.user.role_id],
  938. onMenuitemClick: $setup.onMenuItemClick
  939. }, null, 8
  940. /* PROPS */
  941. , ["model"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default")]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  942. name: "layout-mask"
  943. }, {
  944. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  945. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  946. }),
  947. _: 1
  948. /* STABLE */
  949. })], 2
  950. /* CLASS */
  951. );
  952. }
  953. /***/ }),
  954. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa&scoped=true":
  955. /*!***************************************************************************************************************************************************************************************************************************************************************************************!*\
  956. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa&scoped=true ***!
  957. \***************************************************************************************************************************************************************************************************************************************************************************************/
  958. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  959. "use strict";
  960. __webpack_require__.r(__webpack_exports__);
  961. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  962. /* harmony export */ "render": () => (/* binding */ render)
  963. /* harmony export */ });
  964. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  965. var _withScopeId = function _withScopeId(n) {
  966. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-9329f6aa"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  967. };
  968. var _hoisted_1 = {
  969. "class": "grid"
  970. };
  971. var _hoisted_2 = {
  972. "class": "col-12 flex flex-wrap justify-content-between card-statistic"
  973. };
  974. var _hoisted_3 = {
  975. "class": "flex-grow-1"
  976. };
  977. var _hoisted_4 = {
  978. "class": "col-12 md:col-6"
  979. };
  980. var _hoisted_5 = {
  981. "class": "flex flex-column"
  982. };
  983. var _hoisted_6 = {
  984. key: 0,
  985. "class": "text-base font-normal"
  986. };
  987. var _hoisted_7 = {
  988. "class": "col-12 md:col-6"
  989. };
  990. var _hoisted_8 = {
  991. "class": "flex flex-column"
  992. };
  993. var _hoisted_9 = {
  994. key: 0,
  995. "class": "text-base font-normal"
  996. };
  997. function render(_ctx, _cache, $props, $setup, $data, $options) {
  998. var _component_Chart = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Chart");
  999. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  1000. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["AppLayout"], null, {
  1001. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1002. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  1003. title: "Dashboard"
  1004. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.cardStatistics, function (cardStatistic) {
  1005. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppCardStatistic"], {
  1006. data: cardStatistic
  1007. }, null, 8
  1008. /* PROPS */
  1009. , ["data"])]);
  1010. }), 256
  1011. /* UNKEYED_FRAGMENT */
  1012. ))]), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.barStatistics, function (barStatistic) {
  1013. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
  1014. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1015. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(barStatistic.title), 1
  1016. /* TEXT */
  1017. ), barStatistic.description ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_6, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(barStatistic.description), 1
  1018. /* TEXT */
  1019. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])];
  1020. }),
  1021. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1022. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Chart, {
  1023. type: "bar",
  1024. width: 600,
  1025. height: 300,
  1026. data: $setup.barChart(barStatistic.data),
  1027. options: $setup.barChartOption
  1028. }, null, 8
  1029. /* PROPS */
  1030. , ["data"])];
  1031. }),
  1032. _: 2
  1033. /* DYNAMIC */
  1034. }, 1024
  1035. /* DYNAMIC_SLOTS */
  1036. )]);
  1037. }), 256
  1038. /* UNKEYED_FRAGMENT */
  1039. )), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.barHorizontalStatistics, function (barHorizontalStatistic) {
  1040. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
  1041. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1042. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(barHorizontalStatistic.title), 1
  1043. /* TEXT */
  1044. ), barHorizontalStatistic.description ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_9, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(barHorizontalStatistic.description), 1
  1045. /* TEXT */
  1046. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])];
  1047. }),
  1048. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1049. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Chart, {
  1050. type: "bar",
  1051. width: 600,
  1052. height: 300,
  1053. data: $setup.barHorizontalChart(barHorizontalStatistic.data),
  1054. options: $setup.barHorizontalChartOption
  1055. }, null, 8
  1056. /* PROPS */
  1057. , ["data"])];
  1058. }),
  1059. _: 2
  1060. /* DYNAMIC */
  1061. }, 1024
  1062. /* DYNAMIC_SLOTS */
  1063. )]);
  1064. }), 256
  1065. /* UNKEYED_FRAGMENT */
  1066. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" <div v-for=\"pieStatistic in pieStatistics\" class=\"col-12 md:col-6\">\n <Card>\n <template #title>\n <div class=\"flex flex-column\">\n <span>{{ pieStatistic.title }}</span>\n <span v-if=\"pieStatistic.description\" class=\"text-base font-normal\">{{ pieStatistic.description }}</span>\n </div>\n </template>\n <template #content>\n <Chart\n type=\"pie\"\n :width=\"600\"\n :height=\"300\"\n :data=\"pieChart(pieStatistic.data)\"\n :options=\"pieChartOption\"\n />\n </template>\n </Card>\n </div> ")])];
  1067. }),
  1068. _: 1
  1069. /* STABLE */
  1070. });
  1071. }
  1072. /***/ }),
  1073. /***/ "./resources/js/utils/menu.js":
  1074. /*!************************************!*\
  1075. !*** ./resources/js/utils/menu.js ***!
  1076. \************************************/
  1077. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1078. "use strict";
  1079. __webpack_require__.r(__webpack_exports__);
  1080. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1081. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1082. /* harmony export */ });
  1083. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1084. // Admin
  1085. 1: [{
  1086. label: 'Home',
  1087. items: [{
  1088. label: 'Dashboard',
  1089. icon: 'pi pi-home',
  1090. to: '/dashboards',
  1091. component: 'home/Index'
  1092. }]
  1093. }, {
  1094. label: 'Master',
  1095. items: [{
  1096. label: 'User',
  1097. icon: 'pi pi-user',
  1098. to: '/users',
  1099. component: 'user/Index'
  1100. }]
  1101. }],
  1102. // Supervisor
  1103. 2: [{
  1104. label: 'Home',
  1105. items: [{
  1106. label: 'Dashboard',
  1107. icon: 'pi pi-home',
  1108. to: '/dashboards',
  1109. component: 'home/Index'
  1110. }]
  1111. }, {
  1112. label: 'Menu',
  1113. items: [{
  1114. label: 'Pengeluaran',
  1115. icon: 'pi pi-wallet',
  1116. to: '/expenses',
  1117. component: 'expense/Index'
  1118. }, {
  1119. label: 'Laporan',
  1120. icon: 'pi pi-book',
  1121. items: [{
  1122. label: 'Mutasi',
  1123. icon: 'pi pi-circle',
  1124. to: '/reports/mutations',
  1125. component: 'mutation/Report'
  1126. }]
  1127. }]
  1128. }, {
  1129. label: 'Master',
  1130. items: [{
  1131. label: 'Jenis Kendaraan',
  1132. icon: 'pi pi-car',
  1133. to: '/type-vehicles',
  1134. component: 'typevehicle/Index'
  1135. }, {
  1136. label: 'Jenis Member',
  1137. icon: 'pi pi-id-card',
  1138. to: '/type-members',
  1139. component: 'typemember/Index'
  1140. }]
  1141. }],
  1142. // Operator
  1143. 3: [{
  1144. label: 'Home',
  1145. items: [{
  1146. label: 'Dashboard',
  1147. icon: 'pi pi-home',
  1148. to: '/dashboards',
  1149. component: 'home/Index'
  1150. }]
  1151. }, {
  1152. label: 'Menu',
  1153. items: [{
  1154. label: 'Pengeluaran',
  1155. icon: 'pi pi-wallet',
  1156. to: '/expenses',
  1157. component: 'expense/Index'
  1158. }, {
  1159. label: 'Member',
  1160. icon: 'pi pi-id-card',
  1161. to: '/members',
  1162. component: 'member/Index'
  1163. }, {
  1164. label: 'Top Up',
  1165. icon: 'pi pi-wallet',
  1166. to: '/top-ups',
  1167. component: 'topup/Index'
  1168. }]
  1169. }]
  1170. });
  1171. /***/ }),
  1172. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-8.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-8.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css":
  1173. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1174. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-8.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-8.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css ***!
  1175. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1176. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1177. "use strict";
  1178. __webpack_require__.r(__webpack_exports__);
  1179. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1180. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1181. /* harmony export */ });
  1182. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1183. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1184. // Imports
  1185. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1186. // Module
  1187. ___CSS_LOADER_EXPORT___.push([module.id, "\n.card-statistic[data-v-9329f6aa] {\n gap: 1rem;\n}\n", ""]);
  1188. // Exports
  1189. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1190. /***/ }),
  1191. /***/ "./node_modules/lodash/lodash.js":
  1192. /*!***************************************!*\
  1193. !*** ./node_modules/lodash/lodash.js ***!
  1194. \***************************************/
  1195. /***/ (function(module, exports, __webpack_require__) {
  1196. /* module decorator */ module = __webpack_require__.nmd(module);
  1197. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1198. * @license
  1199. * Lodash <https://lodash.com/>
  1200. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1201. * Released under MIT license <https://lodash.com/license>
  1202. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1203. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1204. */
  1205. ;(function() {
  1206. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1207. var undefined;
  1208. /** Used as the semantic version number. */
  1209. var VERSION = '4.17.21';
  1210. /** Used as the size to enable large array optimizations. */
  1211. var LARGE_ARRAY_SIZE = 200;
  1212. /** Error message constants. */
  1213. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1214. FUNC_ERROR_TEXT = 'Expected a function',
  1215. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1216. /** Used to stand-in for `undefined` hash values. */
  1217. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1218. /** Used as the maximum memoize cache size. */
  1219. var MAX_MEMOIZE_SIZE = 500;
  1220. /** Used as the internal argument placeholder. */
  1221. var PLACEHOLDER = '__lodash_placeholder__';
  1222. /** Used to compose bitmasks for cloning. */
  1223. var CLONE_DEEP_FLAG = 1,
  1224. CLONE_FLAT_FLAG = 2,
  1225. CLONE_SYMBOLS_FLAG = 4;
  1226. /** Used to compose bitmasks for value comparisons. */
  1227. var COMPARE_PARTIAL_FLAG = 1,
  1228. COMPARE_UNORDERED_FLAG = 2;
  1229. /** Used to compose bitmasks for function metadata. */
  1230. var WRAP_BIND_FLAG = 1,
  1231. WRAP_BIND_KEY_FLAG = 2,
  1232. WRAP_CURRY_BOUND_FLAG = 4,
  1233. WRAP_CURRY_FLAG = 8,
  1234. WRAP_CURRY_RIGHT_FLAG = 16,
  1235. WRAP_PARTIAL_FLAG = 32,
  1236. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1237. WRAP_ARY_FLAG = 128,
  1238. WRAP_REARG_FLAG = 256,
  1239. WRAP_FLIP_FLAG = 512;
  1240. /** Used as default options for `_.truncate`. */
  1241. var DEFAULT_TRUNC_LENGTH = 30,
  1242. DEFAULT_TRUNC_OMISSION = '...';
  1243. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1244. var HOT_COUNT = 800,
  1245. HOT_SPAN = 16;
  1246. /** Used to indicate the type of lazy iteratees. */
  1247. var LAZY_FILTER_FLAG = 1,
  1248. LAZY_MAP_FLAG = 2,
  1249. LAZY_WHILE_FLAG = 3;
  1250. /** Used as references for various `Number` constants. */
  1251. var INFINITY = 1 / 0,
  1252. MAX_SAFE_INTEGER = 9007199254740991,
  1253. MAX_INTEGER = 1.7976931348623157e+308,
  1254. NAN = 0 / 0;
  1255. /** Used as references for the maximum length and index of an array. */
  1256. var MAX_ARRAY_LENGTH = 4294967295,
  1257. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1258. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1259. /** Used to associate wrap methods with their bit flags. */
  1260. var wrapFlags = [
  1261. ['ary', WRAP_ARY_FLAG],
  1262. ['bind', WRAP_BIND_FLAG],
  1263. ['bindKey', WRAP_BIND_KEY_FLAG],
  1264. ['curry', WRAP_CURRY_FLAG],
  1265. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1266. ['flip', WRAP_FLIP_FLAG],
  1267. ['partial', WRAP_PARTIAL_FLAG],
  1268. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1269. ['rearg', WRAP_REARG_FLAG]
  1270. ];
  1271. /** `Object#toString` result references. */
  1272. var argsTag = '[object Arguments]',
  1273. arrayTag = '[object Array]',
  1274. asyncTag = '[object AsyncFunction]',
  1275. boolTag = '[object Boolean]',
  1276. dateTag = '[object Date]',
  1277. domExcTag = '[object DOMException]',
  1278. errorTag = '[object Error]',
  1279. funcTag = '[object Function]',
  1280. genTag = '[object GeneratorFunction]',
  1281. mapTag = '[object Map]',
  1282. numberTag = '[object Number]',
  1283. nullTag = '[object Null]',
  1284. objectTag = '[object Object]',
  1285. promiseTag = '[object Promise]',
  1286. proxyTag = '[object Proxy]',
  1287. regexpTag = '[object RegExp]',
  1288. setTag = '[object Set]',
  1289. stringTag = '[object String]',
  1290. symbolTag = '[object Symbol]',
  1291. undefinedTag = '[object Undefined]',
  1292. weakMapTag = '[object WeakMap]',
  1293. weakSetTag = '[object WeakSet]';
  1294. var arrayBufferTag = '[object ArrayBuffer]',
  1295. dataViewTag = '[object DataView]',
  1296. float32Tag = '[object Float32Array]',
  1297. float64Tag = '[object Float64Array]',
  1298. int8Tag = '[object Int8Array]',
  1299. int16Tag = '[object Int16Array]',
  1300. int32Tag = '[object Int32Array]',
  1301. uint8Tag = '[object Uint8Array]',
  1302. uint8ClampedTag = '[object Uint8ClampedArray]',
  1303. uint16Tag = '[object Uint16Array]',
  1304. uint32Tag = '[object Uint32Array]';
  1305. /** Used to match empty string literals in compiled template source. */
  1306. var reEmptyStringLeading = /\b__p \+= '';/g,
  1307. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1308. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1309. /** Used to match HTML entities and HTML characters. */
  1310. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1311. reUnescapedHtml = /[&<>"']/g,
  1312. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1313. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1314. /** Used to match template delimiters. */
  1315. var reEscape = /<%-([\s\S]+?)%>/g,
  1316. reEvaluate = /<%([\s\S]+?)%>/g,
  1317. reInterpolate = /<%=([\s\S]+?)%>/g;
  1318. /** Used to match property names within property paths. */
  1319. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1320. reIsPlainProp = /^\w*$/,
  1321. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1322. /**
  1323. * Used to match `RegExp`
  1324. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1325. */
  1326. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1327. reHasRegExpChar = RegExp(reRegExpChar.source);
  1328. /** Used to match leading whitespace. */
  1329. var reTrimStart = /^\s+/;
  1330. /** Used to match a single whitespace character. */
  1331. var reWhitespace = /\s/;
  1332. /** Used to match wrap detail comments. */
  1333. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1334. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1335. reSplitDetails = /,? & /;
  1336. /** Used to match words composed of alphanumeric characters. */
  1337. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1338. /**
  1339. * Used to validate the `validate` option in `_.template` variable.
  1340. *
  1341. * Forbids characters which could potentially change the meaning of the function argument definition:
  1342. * - "()," (modification of function parameters)
  1343. * - "=" (default value)
  1344. * - "[]{}" (destructuring of function parameters)
  1345. * - "/" (beginning of a comment)
  1346. * - whitespace
  1347. */
  1348. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1349. /** Used to match backslashes in property paths. */
  1350. var reEscapeChar = /\\(\\)?/g;
  1351. /**
  1352. * Used to match
  1353. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1354. */
  1355. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1356. /** Used to match `RegExp` flags from their coerced string values. */
  1357. var reFlags = /\w*$/;
  1358. /** Used to detect bad signed hexadecimal string values. */
  1359. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1360. /** Used to detect binary string values. */
  1361. var reIsBinary = /^0b[01]+$/i;
  1362. /** Used to detect host constructors (Safari). */
  1363. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1364. /** Used to detect octal string values. */
  1365. var reIsOctal = /^0o[0-7]+$/i;
  1366. /** Used to detect unsigned integer values. */
  1367. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1368. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1369. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1370. /** Used to ensure capturing order of template delimiters. */
  1371. var reNoMatch = /($^)/;
  1372. /** Used to match unescaped characters in compiled string literals. */
  1373. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1374. /** Used to compose unicode character classes. */
  1375. var rsAstralRange = '\\ud800-\\udfff',
  1376. rsComboMarksRange = '\\u0300-\\u036f',
  1377. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1378. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1379. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1380. rsDingbatRange = '\\u2700-\\u27bf',
  1381. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1382. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1383. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1384. rsPunctuationRange = '\\u2000-\\u206f',
  1385. 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',
  1386. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1387. rsVarRange = '\\ufe0e\\ufe0f',
  1388. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1389. /** Used to compose unicode capture groups. */
  1390. var rsApos = "['\u2019]",
  1391. rsAstral = '[' + rsAstralRange + ']',
  1392. rsBreak = '[' + rsBreakRange + ']',
  1393. rsCombo = '[' + rsComboRange + ']',
  1394. rsDigits = '\\d+',
  1395. rsDingbat = '[' + rsDingbatRange + ']',
  1396. rsLower = '[' + rsLowerRange + ']',
  1397. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1398. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1399. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1400. rsNonAstral = '[^' + rsAstralRange + ']',
  1401. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1402. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1403. rsUpper = '[' + rsUpperRange + ']',
  1404. rsZWJ = '\\u200d';
  1405. /** Used to compose unicode regexes. */
  1406. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1407. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1408. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1409. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1410. reOptMod = rsModifier + '?',
  1411. rsOptVar = '[' + rsVarRange + ']?',
  1412. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1413. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1414. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1415. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1416. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1417. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1418. /** Used to match apostrophes. */
  1419. var reApos = RegExp(rsApos, 'g');
  1420. /**
  1421. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1422. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1423. */
  1424. var reComboMark = RegExp(rsCombo, 'g');
  1425. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1426. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1427. /** Used to match complex or compound words. */
  1428. var reUnicodeWord = RegExp([
  1429. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1430. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1431. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1432. rsUpper + '+' + rsOptContrUpper,
  1433. rsOrdUpper,
  1434. rsOrdLower,
  1435. rsDigits,
  1436. rsEmoji
  1437. ].join('|'), 'g');
  1438. /** 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/). */
  1439. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1440. /** Used to detect strings that need a more robust regexp to match words. */
  1441. 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 ]/;
  1442. /** Used to assign default `context` object properties. */
  1443. var contextProps = [
  1444. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1445. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1446. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1447. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1448. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1449. ];
  1450. /** Used to make template sourceURLs easier to identify. */
  1451. var templateCounter = -1;
  1452. /** Used to identify `toStringTag` values of typed arrays. */
  1453. var typedArrayTags = {};
  1454. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1455. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1456. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1457. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1458. typedArrayTags[uint32Tag] = true;
  1459. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1460. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1461. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1462. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1463. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1464. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1465. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1466. typedArrayTags[weakMapTag] = false;
  1467. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1468. var cloneableTags = {};
  1469. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1470. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1471. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1472. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1473. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1474. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1475. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1476. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1477. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1478. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1479. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1480. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1481. cloneableTags[weakMapTag] = false;
  1482. /** Used to map Latin Unicode letters to basic Latin letters. */
  1483. var deburredLetters = {
  1484. // Latin-1 Supplement block.
  1485. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1486. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1487. '\xc7': 'C', '\xe7': 'c',
  1488. '\xd0': 'D', '\xf0': 'd',
  1489. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1490. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1491. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1492. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1493. '\xd1': 'N', '\xf1': 'n',
  1494. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1495. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1496. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1497. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1498. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1499. '\xc6': 'Ae', '\xe6': 'ae',
  1500. '\xde': 'Th', '\xfe': 'th',
  1501. '\xdf': 'ss',
  1502. // Latin Extended-A block.
  1503. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1504. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1505. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1506. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1507. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1508. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1509. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1510. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1511. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1512. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1513. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1514. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1515. '\u0134': 'J', '\u0135': 'j',
  1516. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1517. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1518. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1519. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1520. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1521. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1522. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1523. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1524. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1525. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1526. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1527. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1528. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1529. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1530. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1531. '\u0174': 'W', '\u0175': 'w',
  1532. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1533. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1534. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1535. '\u0132': 'IJ', '\u0133': 'ij',
  1536. '\u0152': 'Oe', '\u0153': 'oe',
  1537. '\u0149': "'n", '\u017f': 's'
  1538. };
  1539. /** Used to map characters to HTML entities. */
  1540. var htmlEscapes = {
  1541. '&': '&amp;',
  1542. '<': '&lt;',
  1543. '>': '&gt;',
  1544. '"': '&quot;',
  1545. "'": '&#39;'
  1546. };
  1547. /** Used to map HTML entities to characters. */
  1548. var htmlUnescapes = {
  1549. '&amp;': '&',
  1550. '&lt;': '<',
  1551. '&gt;': '>',
  1552. '&quot;': '"',
  1553. '&#39;': "'"
  1554. };
  1555. /** Used to escape characters for inclusion in compiled string literals. */
  1556. var stringEscapes = {
  1557. '\\': '\\',
  1558. "'": "'",
  1559. '\n': 'n',
  1560. '\r': 'r',
  1561. '\u2028': 'u2028',
  1562. '\u2029': 'u2029'
  1563. };
  1564. /** Built-in method references without a dependency on `root`. */
  1565. var freeParseFloat = parseFloat,
  1566. freeParseInt = parseInt;
  1567. /** Detect free variable `global` from Node.js. */
  1568. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1569. /** Detect free variable `self`. */
  1570. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1571. /** Used as a reference to the global object. */
  1572. var root = freeGlobal || freeSelf || Function('return this')();
  1573. /** Detect free variable `exports`. */
  1574. var freeExports = true && exports && !exports.nodeType && exports;
  1575. /** Detect free variable `module`. */
  1576. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1577. /** Detect the popular CommonJS extension `module.exports`. */
  1578. var moduleExports = freeModule && freeModule.exports === freeExports;
  1579. /** Detect free variable `process` from Node.js. */
  1580. var freeProcess = moduleExports && freeGlobal.process;
  1581. /** Used to access faster Node.js helpers. */
  1582. var nodeUtil = (function() {
  1583. try {
  1584. // Use `util.types` for Node.js 10+.
  1585. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1586. if (types) {
  1587. return types;
  1588. }
  1589. // Legacy `process.binding('util')` for Node.js < 10.
  1590. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1591. } catch (e) {}
  1592. }());
  1593. /* Node.js helper references. */
  1594. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1595. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1596. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1597. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1598. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1599. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1600. /*--------------------------------------------------------------------------*/
  1601. /**
  1602. * A faster alternative to `Function#apply`, this function invokes `func`
  1603. * with the `this` binding of `thisArg` and the arguments of `args`.
  1604. *
  1605. * @private
  1606. * @param {Function} func The function to invoke.
  1607. * @param {*} thisArg The `this` binding of `func`.
  1608. * @param {Array} args The arguments to invoke `func` with.
  1609. * @returns {*} Returns the result of `func`.
  1610. */
  1611. function apply(func, thisArg, args) {
  1612. switch (args.length) {
  1613. case 0: return func.call(thisArg);
  1614. case 1: return func.call(thisArg, args[0]);
  1615. case 2: return func.call(thisArg, args[0], args[1]);
  1616. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1617. }
  1618. return func.apply(thisArg, args);
  1619. }
  1620. /**
  1621. * A specialized version of `baseAggregator` for arrays.
  1622. *
  1623. * @private
  1624. * @param {Array} [array] The array to iterate over.
  1625. * @param {Function} setter The function to set `accumulator` values.
  1626. * @param {Function} iteratee The iteratee to transform keys.
  1627. * @param {Object} accumulator The initial aggregated object.
  1628. * @returns {Function} Returns `accumulator`.
  1629. */
  1630. function arrayAggregator(array, setter, iteratee, accumulator) {
  1631. var index = -1,
  1632. length = array == null ? 0 : array.length;
  1633. while (++index < length) {
  1634. var value = array[index];
  1635. setter(accumulator, value, iteratee(value), array);
  1636. }
  1637. return accumulator;
  1638. }
  1639. /**
  1640. * A specialized version of `_.forEach` for arrays without support for
  1641. * iteratee shorthands.
  1642. *
  1643. * @private
  1644. * @param {Array} [array] The array to iterate over.
  1645. * @param {Function} iteratee The function invoked per iteration.
  1646. * @returns {Array} Returns `array`.
  1647. */
  1648. function arrayEach(array, iteratee) {
  1649. var index = -1,
  1650. length = array == null ? 0 : array.length;
  1651. while (++index < length) {
  1652. if (iteratee(array[index], index, array) === false) {
  1653. break;
  1654. }
  1655. }
  1656. return array;
  1657. }
  1658. /**
  1659. * A specialized version of `_.forEachRight` for arrays without support for
  1660. * iteratee shorthands.
  1661. *
  1662. * @private
  1663. * @param {Array} [array] The array to iterate over.
  1664. * @param {Function} iteratee The function invoked per iteration.
  1665. * @returns {Array} Returns `array`.
  1666. */
  1667. function arrayEachRight(array, iteratee) {
  1668. var length = array == null ? 0 : array.length;
  1669. while (length--) {
  1670. if (iteratee(array[length], length, array) === false) {
  1671. break;
  1672. }
  1673. }
  1674. return array;
  1675. }
  1676. /**
  1677. * A specialized version of `_.every` for arrays without support for
  1678. * iteratee shorthands.
  1679. *
  1680. * @private
  1681. * @param {Array} [array] The array to iterate over.
  1682. * @param {Function} predicate The function invoked per iteration.
  1683. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1684. * else `false`.
  1685. */
  1686. function arrayEvery(array, predicate) {
  1687. var index = -1,
  1688. length = array == null ? 0 : array.length;
  1689. while (++index < length) {
  1690. if (!predicate(array[index], index, array)) {
  1691. return false;
  1692. }
  1693. }
  1694. return true;
  1695. }
  1696. /**
  1697. * A specialized version of `_.filter` for arrays without support for
  1698. * iteratee shorthands.
  1699. *
  1700. * @private
  1701. * @param {Array} [array] The array to iterate over.
  1702. * @param {Function} predicate The function invoked per iteration.
  1703. * @returns {Array} Returns the new filtered array.
  1704. */
  1705. function arrayFilter(array, predicate) {
  1706. var index = -1,
  1707. length = array == null ? 0 : array.length,
  1708. resIndex = 0,
  1709. result = [];
  1710. while (++index < length) {
  1711. var value = array[index];
  1712. if (predicate(value, index, array)) {
  1713. result[resIndex++] = value;
  1714. }
  1715. }
  1716. return result;
  1717. }
  1718. /**
  1719. * A specialized version of `_.includes` for arrays without support for
  1720. * specifying an index to search from.
  1721. *
  1722. * @private
  1723. * @param {Array} [array] The array to inspect.
  1724. * @param {*} target The value to search for.
  1725. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1726. */
  1727. function arrayIncludes(array, value) {
  1728. var length = array == null ? 0 : array.length;
  1729. return !!length && baseIndexOf(array, value, 0) > -1;
  1730. }
  1731. /**
  1732. * This function is like `arrayIncludes` except that it accepts a comparator.
  1733. *
  1734. * @private
  1735. * @param {Array} [array] The array to inspect.
  1736. * @param {*} target The value to search for.
  1737. * @param {Function} comparator The comparator invoked per element.
  1738. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1739. */
  1740. function arrayIncludesWith(array, value, comparator) {
  1741. var index = -1,
  1742. length = array == null ? 0 : array.length;
  1743. while (++index < length) {
  1744. if (comparator(value, array[index])) {
  1745. return true;
  1746. }
  1747. }
  1748. return false;
  1749. }
  1750. /**
  1751. * A specialized version of `_.map` for arrays without support for iteratee
  1752. * shorthands.
  1753. *
  1754. * @private
  1755. * @param {Array} [array] The array to iterate over.
  1756. * @param {Function} iteratee The function invoked per iteration.
  1757. * @returns {Array} Returns the new mapped array.
  1758. */
  1759. function arrayMap(array, iteratee) {
  1760. var index = -1,
  1761. length = array == null ? 0 : array.length,
  1762. result = Array(length);
  1763. while (++index < length) {
  1764. result[index] = iteratee(array[index], index, array);
  1765. }
  1766. return result;
  1767. }
  1768. /**
  1769. * Appends the elements of `values` to `array`.
  1770. *
  1771. * @private
  1772. * @param {Array} array The array to modify.
  1773. * @param {Array} values The values to append.
  1774. * @returns {Array} Returns `array`.
  1775. */
  1776. function arrayPush(array, values) {
  1777. var index = -1,
  1778. length = values.length,
  1779. offset = array.length;
  1780. while (++index < length) {
  1781. array[offset + index] = values[index];
  1782. }
  1783. return array;
  1784. }
  1785. /**
  1786. * A specialized version of `_.reduce` for arrays without support for
  1787. * iteratee shorthands.
  1788. *
  1789. * @private
  1790. * @param {Array} [array] The array to iterate over.
  1791. * @param {Function} iteratee The function invoked per iteration.
  1792. * @param {*} [accumulator] The initial value.
  1793. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1794. * the initial value.
  1795. * @returns {*} Returns the accumulated value.
  1796. */
  1797. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1798. var index = -1,
  1799. length = array == null ? 0 : array.length;
  1800. if (initAccum && length) {
  1801. accumulator = array[++index];
  1802. }
  1803. while (++index < length) {
  1804. accumulator = iteratee(accumulator, array[index], index, array);
  1805. }
  1806. return accumulator;
  1807. }
  1808. /**
  1809. * A specialized version of `_.reduceRight` for arrays without support for
  1810. * iteratee shorthands.
  1811. *
  1812. * @private
  1813. * @param {Array} [array] The array to iterate over.
  1814. * @param {Function} iteratee The function invoked per iteration.
  1815. * @param {*} [accumulator] The initial value.
  1816. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1817. * the initial value.
  1818. * @returns {*} Returns the accumulated value.
  1819. */
  1820. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1821. var length = array == null ? 0 : array.length;
  1822. if (initAccum && length) {
  1823. accumulator = array[--length];
  1824. }
  1825. while (length--) {
  1826. accumulator = iteratee(accumulator, array[length], length, array);
  1827. }
  1828. return accumulator;
  1829. }
  1830. /**
  1831. * A specialized version of `_.some` for arrays without support for iteratee
  1832. * shorthands.
  1833. *
  1834. * @private
  1835. * @param {Array} [array] The array to iterate over.
  1836. * @param {Function} predicate The function invoked per iteration.
  1837. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1838. * else `false`.
  1839. */
  1840. function arraySome(array, predicate) {
  1841. var index = -1,
  1842. length = array == null ? 0 : array.length;
  1843. while (++index < length) {
  1844. if (predicate(array[index], index, array)) {
  1845. return true;
  1846. }
  1847. }
  1848. return false;
  1849. }
  1850. /**
  1851. * Gets the size of an ASCII `string`.
  1852. *
  1853. * @private
  1854. * @param {string} string The string inspect.
  1855. * @returns {number} Returns the string size.
  1856. */
  1857. var asciiSize = baseProperty('length');
  1858. /**
  1859. * Converts an ASCII `string` to an array.
  1860. *
  1861. * @private
  1862. * @param {string} string The string to convert.
  1863. * @returns {Array} Returns the converted array.
  1864. */
  1865. function asciiToArray(string) {
  1866. return string.split('');
  1867. }
  1868. /**
  1869. * Splits an ASCII `string` into an array of its words.
  1870. *
  1871. * @private
  1872. * @param {string} The string to inspect.
  1873. * @returns {Array} Returns the words of `string`.
  1874. */
  1875. function asciiWords(string) {
  1876. return string.match(reAsciiWord) || [];
  1877. }
  1878. /**
  1879. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1880. * without support for iteratee shorthands, which iterates over `collection`
  1881. * using `eachFunc`.
  1882. *
  1883. * @private
  1884. * @param {Array|Object} collection The collection to inspect.
  1885. * @param {Function} predicate The function invoked per iteration.
  1886. * @param {Function} eachFunc The function to iterate over `collection`.
  1887. * @returns {*} Returns the found element or its key, else `undefined`.
  1888. */
  1889. function baseFindKey(collection, predicate, eachFunc) {
  1890. var result;
  1891. eachFunc(collection, function(value, key, collection) {
  1892. if (predicate(value, key, collection)) {
  1893. result = key;
  1894. return false;
  1895. }
  1896. });
  1897. return result;
  1898. }
  1899. /**
  1900. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1901. * support for iteratee shorthands.
  1902. *
  1903. * @private
  1904. * @param {Array} array The array to inspect.
  1905. * @param {Function} predicate The function invoked per iteration.
  1906. * @param {number} fromIndex The index to search from.
  1907. * @param {boolean} [fromRight] Specify iterating from right to left.
  1908. * @returns {number} Returns the index of the matched value, else `-1`.
  1909. */
  1910. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1911. var length = array.length,
  1912. index = fromIndex + (fromRight ? 1 : -1);
  1913. while ((fromRight ? index-- : ++index < length)) {
  1914. if (predicate(array[index], index, array)) {
  1915. return index;
  1916. }
  1917. }
  1918. return -1;
  1919. }
  1920. /**
  1921. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1922. *
  1923. * @private
  1924. * @param {Array} array The array to inspect.
  1925. * @param {*} value The value to search for.
  1926. * @param {number} fromIndex The index to search from.
  1927. * @returns {number} Returns the index of the matched value, else `-1`.
  1928. */
  1929. function baseIndexOf(array, value, fromIndex) {
  1930. return value === value
  1931. ? strictIndexOf(array, value, fromIndex)
  1932. : baseFindIndex(array, baseIsNaN, fromIndex);
  1933. }
  1934. /**
  1935. * This function is like `baseIndexOf` except that it accepts a comparator.
  1936. *
  1937. * @private
  1938. * @param {Array} array The array to inspect.
  1939. * @param {*} value The value to search for.
  1940. * @param {number} fromIndex The index to search from.
  1941. * @param {Function} comparator The comparator invoked per element.
  1942. * @returns {number} Returns the index of the matched value, else `-1`.
  1943. */
  1944. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1945. var index = fromIndex - 1,
  1946. length = array.length;
  1947. while (++index < length) {
  1948. if (comparator(array[index], value)) {
  1949. return index;
  1950. }
  1951. }
  1952. return -1;
  1953. }
  1954. /**
  1955. * The base implementation of `_.isNaN` without support for number objects.
  1956. *
  1957. * @private
  1958. * @param {*} value The value to check.
  1959. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1960. */
  1961. function baseIsNaN(value) {
  1962. return value !== value;
  1963. }
  1964. /**
  1965. * The base implementation of `_.mean` and `_.meanBy` without support for
  1966. * iteratee shorthands.
  1967. *
  1968. * @private
  1969. * @param {Array} array The array to iterate over.
  1970. * @param {Function} iteratee The function invoked per iteration.
  1971. * @returns {number} Returns the mean.
  1972. */
  1973. function baseMean(array, iteratee) {
  1974. var length = array == null ? 0 : array.length;
  1975. return length ? (baseSum(array, iteratee) / length) : NAN;
  1976. }
  1977. /**
  1978. * The base implementation of `_.property` without support for deep paths.
  1979. *
  1980. * @private
  1981. * @param {string} key The key of the property to get.
  1982. * @returns {Function} Returns the new accessor function.
  1983. */
  1984. function baseProperty(key) {
  1985. return function(object) {
  1986. return object == null ? undefined : object[key];
  1987. };
  1988. }
  1989. /**
  1990. * The base implementation of `_.propertyOf` without support for deep paths.
  1991. *
  1992. * @private
  1993. * @param {Object} object The object to query.
  1994. * @returns {Function} Returns the new accessor function.
  1995. */
  1996. function basePropertyOf(object) {
  1997. return function(key) {
  1998. return object == null ? undefined : object[key];
  1999. };
  2000. }
  2001. /**
  2002. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2003. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2004. *
  2005. * @private
  2006. * @param {Array|Object} collection The collection to iterate over.
  2007. * @param {Function} iteratee The function invoked per iteration.
  2008. * @param {*} accumulator The initial value.
  2009. * @param {boolean} initAccum Specify using the first or last element of
  2010. * `collection` as the initial value.
  2011. * @param {Function} eachFunc The function to iterate over `collection`.
  2012. * @returns {*} Returns the accumulated value.
  2013. */
  2014. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2015. eachFunc(collection, function(value, index, collection) {
  2016. accumulator = initAccum
  2017. ? (initAccum = false, value)
  2018. : iteratee(accumulator, value, index, collection);
  2019. });
  2020. return accumulator;
  2021. }
  2022. /**
  2023. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2024. * sort order of `array` and replaces criteria objects with their corresponding
  2025. * values.
  2026. *
  2027. * @private
  2028. * @param {Array} array The array to sort.
  2029. * @param {Function} comparer The function to define sort order.
  2030. * @returns {Array} Returns `array`.
  2031. */
  2032. function baseSortBy(array, comparer) {
  2033. var length = array.length;
  2034. array.sort(comparer);
  2035. while (length--) {
  2036. array[length] = array[length].value;
  2037. }
  2038. return array;
  2039. }
  2040. /**
  2041. * The base implementation of `_.sum` and `_.sumBy` without support for
  2042. * iteratee shorthands.
  2043. *
  2044. * @private
  2045. * @param {Array} array The array to iterate over.
  2046. * @param {Function} iteratee The function invoked per iteration.
  2047. * @returns {number} Returns the sum.
  2048. */
  2049. function baseSum(array, iteratee) {
  2050. var result,
  2051. index = -1,
  2052. length = array.length;
  2053. while (++index < length) {
  2054. var current = iteratee(array[index]);
  2055. if (current !== undefined) {
  2056. result = result === undefined ? current : (result + current);
  2057. }
  2058. }
  2059. return result;
  2060. }
  2061. /**
  2062. * The base implementation of `_.times` without support for iteratee shorthands
  2063. * or max array length checks.
  2064. *
  2065. * @private
  2066. * @param {number} n The number of times to invoke `iteratee`.
  2067. * @param {Function} iteratee The function invoked per iteration.
  2068. * @returns {Array} Returns the array of results.
  2069. */
  2070. function baseTimes(n, iteratee) {
  2071. var index = -1,
  2072. result = Array(n);
  2073. while (++index < n) {
  2074. result[index] = iteratee(index);
  2075. }
  2076. return result;
  2077. }
  2078. /**
  2079. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2080. * of key-value pairs for `object` corresponding to the property names of `props`.
  2081. *
  2082. * @private
  2083. * @param {Object} object The object to query.
  2084. * @param {Array} props The property names to get values for.
  2085. * @returns {Object} Returns the key-value pairs.
  2086. */
  2087. function baseToPairs(object, props) {
  2088. return arrayMap(props, function(key) {
  2089. return [key, object[key]];
  2090. });
  2091. }
  2092. /**
  2093. * The base implementation of `_.trim`.
  2094. *
  2095. * @private
  2096. * @param {string} string The string to trim.
  2097. * @returns {string} Returns the trimmed string.
  2098. */
  2099. function baseTrim(string) {
  2100. return string
  2101. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2102. : string;
  2103. }
  2104. /**
  2105. * The base implementation of `_.unary` without support for storing metadata.
  2106. *
  2107. * @private
  2108. * @param {Function} func The function to cap arguments for.
  2109. * @returns {Function} Returns the new capped function.
  2110. */
  2111. function baseUnary(func) {
  2112. return function(value) {
  2113. return func(value);
  2114. };
  2115. }
  2116. /**
  2117. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2118. * array of `object` property values corresponding to the property names
  2119. * of `props`.
  2120. *
  2121. * @private
  2122. * @param {Object} object The object to query.
  2123. * @param {Array} props The property names to get values for.
  2124. * @returns {Object} Returns the array of property values.
  2125. */
  2126. function baseValues(object, props) {
  2127. return arrayMap(props, function(key) {
  2128. return object[key];
  2129. });
  2130. }
  2131. /**
  2132. * Checks if a `cache` value for `key` exists.
  2133. *
  2134. * @private
  2135. * @param {Object} cache The cache to query.
  2136. * @param {string} key The key of the entry to check.
  2137. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2138. */
  2139. function cacheHas(cache, key) {
  2140. return cache.has(key);
  2141. }
  2142. /**
  2143. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2144. * that is not found in the character symbols.
  2145. *
  2146. * @private
  2147. * @param {Array} strSymbols The string symbols to inspect.
  2148. * @param {Array} chrSymbols The character symbols to find.
  2149. * @returns {number} Returns the index of the first unmatched string symbol.
  2150. */
  2151. function charsStartIndex(strSymbols, chrSymbols) {
  2152. var index = -1,
  2153. length = strSymbols.length;
  2154. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2155. return index;
  2156. }
  2157. /**
  2158. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2159. * that is not found in the character symbols.
  2160. *
  2161. * @private
  2162. * @param {Array} strSymbols The string symbols to inspect.
  2163. * @param {Array} chrSymbols The character symbols to find.
  2164. * @returns {number} Returns the index of the last unmatched string symbol.
  2165. */
  2166. function charsEndIndex(strSymbols, chrSymbols) {
  2167. var index = strSymbols.length;
  2168. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2169. return index;
  2170. }
  2171. /**
  2172. * Gets the number of `placeholder` occurrences in `array`.
  2173. *
  2174. * @private
  2175. * @param {Array} array The array to inspect.
  2176. * @param {*} placeholder The placeholder to search for.
  2177. * @returns {number} Returns the placeholder count.
  2178. */
  2179. function countHolders(array, placeholder) {
  2180. var length = array.length,
  2181. result = 0;
  2182. while (length--) {
  2183. if (array[length] === placeholder) {
  2184. ++result;
  2185. }
  2186. }
  2187. return result;
  2188. }
  2189. /**
  2190. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2191. * letters to basic Latin letters.
  2192. *
  2193. * @private
  2194. * @param {string} letter The matched letter to deburr.
  2195. * @returns {string} Returns the deburred letter.
  2196. */
  2197. var deburrLetter = basePropertyOf(deburredLetters);
  2198. /**
  2199. * Used by `_.escape` to convert characters to HTML entities.
  2200. *
  2201. * @private
  2202. * @param {string} chr The matched character to escape.
  2203. * @returns {string} Returns the escaped character.
  2204. */
  2205. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2206. /**
  2207. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2208. *
  2209. * @private
  2210. * @param {string} chr The matched character to escape.
  2211. * @returns {string} Returns the escaped character.
  2212. */
  2213. function escapeStringChar(chr) {
  2214. return '\\' + stringEscapes[chr];
  2215. }
  2216. /**
  2217. * Gets the value at `key` of `object`.
  2218. *
  2219. * @private
  2220. * @param {Object} [object] The object to query.
  2221. * @param {string} key The key of the property to get.
  2222. * @returns {*} Returns the property value.
  2223. */
  2224. function getValue(object, key) {
  2225. return object == null ? undefined : object[key];
  2226. }
  2227. /**
  2228. * Checks if `string` contains Unicode symbols.
  2229. *
  2230. * @private
  2231. * @param {string} string The string to inspect.
  2232. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2233. */
  2234. function hasUnicode(string) {
  2235. return reHasUnicode.test(string);
  2236. }
  2237. /**
  2238. * Checks if `string` contains a word composed of Unicode symbols.
  2239. *
  2240. * @private
  2241. * @param {string} string The string to inspect.
  2242. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2243. */
  2244. function hasUnicodeWord(string) {
  2245. return reHasUnicodeWord.test(string);
  2246. }
  2247. /**
  2248. * Converts `iterator` to an array.
  2249. *
  2250. * @private
  2251. * @param {Object} iterator The iterator to convert.
  2252. * @returns {Array} Returns the converted array.
  2253. */
  2254. function iteratorToArray(iterator) {
  2255. var data,
  2256. result = [];
  2257. while (!(data = iterator.next()).done) {
  2258. result.push(data.value);
  2259. }
  2260. return result;
  2261. }
  2262. /**
  2263. * Converts `map` to its key-value pairs.
  2264. *
  2265. * @private
  2266. * @param {Object} map The map to convert.
  2267. * @returns {Array} Returns the key-value pairs.
  2268. */
  2269. function mapToArray(map) {
  2270. var index = -1,
  2271. result = Array(map.size);
  2272. map.forEach(function(value, key) {
  2273. result[++index] = [key, value];
  2274. });
  2275. return result;
  2276. }
  2277. /**
  2278. * Creates a unary function that invokes `func` with its argument transformed.
  2279. *
  2280. * @private
  2281. * @param {Function} func The function to wrap.
  2282. * @param {Function} transform The argument transform.
  2283. * @returns {Function} Returns the new function.
  2284. */
  2285. function overArg(func, transform) {
  2286. return function(arg) {
  2287. return func(transform(arg));
  2288. };
  2289. }
  2290. /**
  2291. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2292. * and returns an array of their indexes.
  2293. *
  2294. * @private
  2295. * @param {Array} array The array to modify.
  2296. * @param {*} placeholder The placeholder to replace.
  2297. * @returns {Array} Returns the new array of placeholder indexes.
  2298. */
  2299. function replaceHolders(array, placeholder) {
  2300. var index = -1,
  2301. length = array.length,
  2302. resIndex = 0,
  2303. result = [];
  2304. while (++index < length) {
  2305. var value = array[index];
  2306. if (value === placeholder || value === PLACEHOLDER) {
  2307. array[index] = PLACEHOLDER;
  2308. result[resIndex++] = index;
  2309. }
  2310. }
  2311. return result;
  2312. }
  2313. /**
  2314. * Converts `set` to an array of its values.
  2315. *
  2316. * @private
  2317. * @param {Object} set The set to convert.
  2318. * @returns {Array} Returns the values.
  2319. */
  2320. function setToArray(set) {
  2321. var index = -1,
  2322. result = Array(set.size);
  2323. set.forEach(function(value) {
  2324. result[++index] = value;
  2325. });
  2326. return result;
  2327. }
  2328. /**
  2329. * Converts `set` to its value-value pairs.
  2330. *
  2331. * @private
  2332. * @param {Object} set The set to convert.
  2333. * @returns {Array} Returns the value-value pairs.
  2334. */
  2335. function setToPairs(set) {
  2336. var index = -1,
  2337. result = Array(set.size);
  2338. set.forEach(function(value) {
  2339. result[++index] = [value, value];
  2340. });
  2341. return result;
  2342. }
  2343. /**
  2344. * A specialized version of `_.indexOf` which performs strict equality
  2345. * comparisons of values, i.e. `===`.
  2346. *
  2347. * @private
  2348. * @param {Array} array The array to inspect.
  2349. * @param {*} value The value to search for.
  2350. * @param {number} fromIndex The index to search from.
  2351. * @returns {number} Returns the index of the matched value, else `-1`.
  2352. */
  2353. function strictIndexOf(array, value, fromIndex) {
  2354. var index = fromIndex - 1,
  2355. length = array.length;
  2356. while (++index < length) {
  2357. if (array[index] === value) {
  2358. return index;
  2359. }
  2360. }
  2361. return -1;
  2362. }
  2363. /**
  2364. * A specialized version of `_.lastIndexOf` which performs strict equality
  2365. * comparisons of values, i.e. `===`.
  2366. *
  2367. * @private
  2368. * @param {Array} array The array to inspect.
  2369. * @param {*} value The value to search for.
  2370. * @param {number} fromIndex The index to search from.
  2371. * @returns {number} Returns the index of the matched value, else `-1`.
  2372. */
  2373. function strictLastIndexOf(array, value, fromIndex) {
  2374. var index = fromIndex + 1;
  2375. while (index--) {
  2376. if (array[index] === value) {
  2377. return index;
  2378. }
  2379. }
  2380. return index;
  2381. }
  2382. /**
  2383. * Gets the number of symbols in `string`.
  2384. *
  2385. * @private
  2386. * @param {string} string The string to inspect.
  2387. * @returns {number} Returns the string size.
  2388. */
  2389. function stringSize(string) {
  2390. return hasUnicode(string)
  2391. ? unicodeSize(string)
  2392. : asciiSize(string);
  2393. }
  2394. /**
  2395. * Converts `string` to an array.
  2396. *
  2397. * @private
  2398. * @param {string} string The string to convert.
  2399. * @returns {Array} Returns the converted array.
  2400. */
  2401. function stringToArray(string) {
  2402. return hasUnicode(string)
  2403. ? unicodeToArray(string)
  2404. : asciiToArray(string);
  2405. }
  2406. /**
  2407. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2408. * character of `string`.
  2409. *
  2410. * @private
  2411. * @param {string} string The string to inspect.
  2412. * @returns {number} Returns the index of the last non-whitespace character.
  2413. */
  2414. function trimmedEndIndex(string) {
  2415. var index = string.length;
  2416. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2417. return index;
  2418. }
  2419. /**
  2420. * Used by `_.unescape` to convert HTML entities to characters.
  2421. *
  2422. * @private
  2423. * @param {string} chr The matched character to unescape.
  2424. * @returns {string} Returns the unescaped character.
  2425. */
  2426. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2427. /**
  2428. * Gets the size of a Unicode `string`.
  2429. *
  2430. * @private
  2431. * @param {string} string The string inspect.
  2432. * @returns {number} Returns the string size.
  2433. */
  2434. function unicodeSize(string) {
  2435. var result = reUnicode.lastIndex = 0;
  2436. while (reUnicode.test(string)) {
  2437. ++result;
  2438. }
  2439. return result;
  2440. }
  2441. /**
  2442. * Converts a Unicode `string` to an array.
  2443. *
  2444. * @private
  2445. * @param {string} string The string to convert.
  2446. * @returns {Array} Returns the converted array.
  2447. */
  2448. function unicodeToArray(string) {
  2449. return string.match(reUnicode) || [];
  2450. }
  2451. /**
  2452. * Splits a Unicode `string` into an array of its words.
  2453. *
  2454. * @private
  2455. * @param {string} The string to inspect.
  2456. * @returns {Array} Returns the words of `string`.
  2457. */
  2458. function unicodeWords(string) {
  2459. return string.match(reUnicodeWord) || [];
  2460. }
  2461. /*--------------------------------------------------------------------------*/
  2462. /**
  2463. * Create a new pristine `lodash` function using the `context` object.
  2464. *
  2465. * @static
  2466. * @memberOf _
  2467. * @since 1.1.0
  2468. * @category Util
  2469. * @param {Object} [context=root] The context object.
  2470. * @returns {Function} Returns a new `lodash` function.
  2471. * @example
  2472. *
  2473. * _.mixin({ 'foo': _.constant('foo') });
  2474. *
  2475. * var lodash = _.runInContext();
  2476. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2477. *
  2478. * _.isFunction(_.foo);
  2479. * // => true
  2480. * _.isFunction(_.bar);
  2481. * // => false
  2482. *
  2483. * lodash.isFunction(lodash.foo);
  2484. * // => false
  2485. * lodash.isFunction(lodash.bar);
  2486. * // => true
  2487. *
  2488. * // Create a suped-up `defer` in Node.js.
  2489. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2490. */
  2491. var runInContext = (function runInContext(context) {
  2492. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2493. /** Built-in constructor references. */
  2494. var Array = context.Array,
  2495. Date = context.Date,
  2496. Error = context.Error,
  2497. Function = context.Function,
  2498. Math = context.Math,
  2499. Object = context.Object,
  2500. RegExp = context.RegExp,
  2501. String = context.String,
  2502. TypeError = context.TypeError;
  2503. /** Used for built-in method references. */
  2504. var arrayProto = Array.prototype,
  2505. funcProto = Function.prototype,
  2506. objectProto = Object.prototype;
  2507. /** Used to detect overreaching core-js shims. */
  2508. var coreJsData = context['__core-js_shared__'];
  2509. /** Used to resolve the decompiled source of functions. */
  2510. var funcToString = funcProto.toString;
  2511. /** Used to check objects for own properties. */
  2512. var hasOwnProperty = objectProto.hasOwnProperty;
  2513. /** Used to generate unique IDs. */
  2514. var idCounter = 0;
  2515. /** Used to detect methods masquerading as native. */
  2516. var maskSrcKey = (function() {
  2517. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2518. return uid ? ('Symbol(src)_1.' + uid) : '';
  2519. }());
  2520. /**
  2521. * Used to resolve the
  2522. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2523. * of values.
  2524. */
  2525. var nativeObjectToString = objectProto.toString;
  2526. /** Used to infer the `Object` constructor. */
  2527. var objectCtorString = funcToString.call(Object);
  2528. /** Used to restore the original `_` reference in `_.noConflict`. */
  2529. var oldDash = root._;
  2530. /** Used to detect if a method is native. */
  2531. var reIsNative = RegExp('^' +
  2532. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2533. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2534. );
  2535. /** Built-in value references. */
  2536. var Buffer = moduleExports ? context.Buffer : undefined,
  2537. Symbol = context.Symbol,
  2538. Uint8Array = context.Uint8Array,
  2539. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2540. getPrototype = overArg(Object.getPrototypeOf, Object),
  2541. objectCreate = Object.create,
  2542. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2543. splice = arrayProto.splice,
  2544. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2545. symIterator = Symbol ? Symbol.iterator : undefined,
  2546. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2547. var defineProperty = (function() {
  2548. try {
  2549. var func = getNative(Object, 'defineProperty');
  2550. func({}, '', {});
  2551. return func;
  2552. } catch (e) {}
  2553. }());
  2554. /** Mocked built-ins. */
  2555. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2556. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2557. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2558. /* Built-in method references for those with the same name as other `lodash` methods. */
  2559. var nativeCeil = Math.ceil,
  2560. nativeFloor = Math.floor,
  2561. nativeGetSymbols = Object.getOwnPropertySymbols,
  2562. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2563. nativeIsFinite = context.isFinite,
  2564. nativeJoin = arrayProto.join,
  2565. nativeKeys = overArg(Object.keys, Object),
  2566. nativeMax = Math.max,
  2567. nativeMin = Math.min,
  2568. nativeNow = Date.now,
  2569. nativeParseInt = context.parseInt,
  2570. nativeRandom = Math.random,
  2571. nativeReverse = arrayProto.reverse;
  2572. /* Built-in method references that are verified to be native. */
  2573. var DataView = getNative(context, 'DataView'),
  2574. Map = getNative(context, 'Map'),
  2575. Promise = getNative(context, 'Promise'),
  2576. Set = getNative(context, 'Set'),
  2577. WeakMap = getNative(context, 'WeakMap'),
  2578. nativeCreate = getNative(Object, 'create');
  2579. /** Used to store function metadata. */
  2580. var metaMap = WeakMap && new WeakMap;
  2581. /** Used to lookup unminified function names. */
  2582. var realNames = {};
  2583. /** Used to detect maps, sets, and weakmaps. */
  2584. var dataViewCtorString = toSource(DataView),
  2585. mapCtorString = toSource(Map),
  2586. promiseCtorString = toSource(Promise),
  2587. setCtorString = toSource(Set),
  2588. weakMapCtorString = toSource(WeakMap);
  2589. /** Used to convert symbols to primitives and strings. */
  2590. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2591. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2592. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2593. /*------------------------------------------------------------------------*/
  2594. /**
  2595. * Creates a `lodash` object which wraps `value` to enable implicit method
  2596. * chain sequences. Methods that operate on and return arrays, collections,
  2597. * and functions can be chained together. Methods that retrieve a single value
  2598. * or may return a primitive value will automatically end the chain sequence
  2599. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2600. * with `_#value`.
  2601. *
  2602. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2603. * enabled using `_.chain`.
  2604. *
  2605. * The execution of chained methods is lazy, that is, it's deferred until
  2606. * `_#value` is implicitly or explicitly called.
  2607. *
  2608. * Lazy evaluation allows several methods to support shortcut fusion.
  2609. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2610. * the creation of intermediate arrays and can greatly reduce the number of
  2611. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2612. * fusion if the section is applied to an array and iteratees accept only
  2613. * one argument. The heuristic for whether a section qualifies for shortcut
  2614. * fusion is subject to change.
  2615. *
  2616. * Chaining is supported in custom builds as long as the `_#value` method is
  2617. * directly or indirectly included in the build.
  2618. *
  2619. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2620. *
  2621. * The wrapper `Array` methods are:
  2622. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2623. *
  2624. * The wrapper `String` methods are:
  2625. * `replace` and `split`
  2626. *
  2627. * The wrapper methods that support shortcut fusion are:
  2628. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2629. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2630. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2631. *
  2632. * The chainable wrapper methods are:
  2633. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2634. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2635. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2636. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2637. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2638. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2639. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2640. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2641. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2642. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2643. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2644. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2645. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2646. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2647. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2648. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2649. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2650. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2651. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2652. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2653. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2654. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2655. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2656. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2657. *
  2658. * The wrapper methods that are **not** chainable by default are:
  2659. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2660. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2661. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2662. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2663. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2664. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2665. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2666. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2667. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2668. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2669. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2670. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2671. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2672. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2673. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2674. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2675. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2676. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2677. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2678. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2679. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2680. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2681. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2682. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2683. * `upperFirst`, `value`, and `words`
  2684. *
  2685. * @name _
  2686. * @constructor
  2687. * @category Seq
  2688. * @param {*} value The value to wrap in a `lodash` instance.
  2689. * @returns {Object} Returns the new `lodash` wrapper instance.
  2690. * @example
  2691. *
  2692. * function square(n) {
  2693. * return n * n;
  2694. * }
  2695. *
  2696. * var wrapped = _([1, 2, 3]);
  2697. *
  2698. * // Returns an unwrapped value.
  2699. * wrapped.reduce(_.add);
  2700. * // => 6
  2701. *
  2702. * // Returns a wrapped value.
  2703. * var squares = wrapped.map(square);
  2704. *
  2705. * _.isArray(squares);
  2706. * // => false
  2707. *
  2708. * _.isArray(squares.value());
  2709. * // => true
  2710. */
  2711. function lodash(value) {
  2712. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2713. if (value instanceof LodashWrapper) {
  2714. return value;
  2715. }
  2716. if (hasOwnProperty.call(value, '__wrapped__')) {
  2717. return wrapperClone(value);
  2718. }
  2719. }
  2720. return new LodashWrapper(value);
  2721. }
  2722. /**
  2723. * The base implementation of `_.create` without support for assigning
  2724. * properties to the created object.
  2725. *
  2726. * @private
  2727. * @param {Object} proto The object to inherit from.
  2728. * @returns {Object} Returns the new object.
  2729. */
  2730. var baseCreate = (function() {
  2731. function object() {}
  2732. return function(proto) {
  2733. if (!isObject(proto)) {
  2734. return {};
  2735. }
  2736. if (objectCreate) {
  2737. return objectCreate(proto);
  2738. }
  2739. object.prototype = proto;
  2740. var result = new object;
  2741. object.prototype = undefined;
  2742. return result;
  2743. };
  2744. }());
  2745. /**
  2746. * The function whose prototype chain sequence wrappers inherit from.
  2747. *
  2748. * @private
  2749. */
  2750. function baseLodash() {
  2751. // No operation performed.
  2752. }
  2753. /**
  2754. * The base constructor for creating `lodash` wrapper objects.
  2755. *
  2756. * @private
  2757. * @param {*} value The value to wrap.
  2758. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2759. */
  2760. function LodashWrapper(value, chainAll) {
  2761. this.__wrapped__ = value;
  2762. this.__actions__ = [];
  2763. this.__chain__ = !!chainAll;
  2764. this.__index__ = 0;
  2765. this.__values__ = undefined;
  2766. }
  2767. /**
  2768. * By default, the template delimiters used by lodash are like those in
  2769. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2770. * following template settings to use alternative delimiters.
  2771. *
  2772. * @static
  2773. * @memberOf _
  2774. * @type {Object}
  2775. */
  2776. lodash.templateSettings = {
  2777. /**
  2778. * Used to detect `data` property values to be HTML-escaped.
  2779. *
  2780. * @memberOf _.templateSettings
  2781. * @type {RegExp}
  2782. */
  2783. 'escape': reEscape,
  2784. /**
  2785. * Used to detect code to be evaluated.
  2786. *
  2787. * @memberOf _.templateSettings
  2788. * @type {RegExp}
  2789. */
  2790. 'evaluate': reEvaluate,
  2791. /**
  2792. * Used to detect `data` property values to inject.
  2793. *
  2794. * @memberOf _.templateSettings
  2795. * @type {RegExp}
  2796. */
  2797. 'interpolate': reInterpolate,
  2798. /**
  2799. * Used to reference the data object in the template text.
  2800. *
  2801. * @memberOf _.templateSettings
  2802. * @type {string}
  2803. */
  2804. 'variable': '',
  2805. /**
  2806. * Used to import variables into the compiled template.
  2807. *
  2808. * @memberOf _.templateSettings
  2809. * @type {Object}
  2810. */
  2811. 'imports': {
  2812. /**
  2813. * A reference to the `lodash` function.
  2814. *
  2815. * @memberOf _.templateSettings.imports
  2816. * @type {Function}
  2817. */
  2818. '_': lodash
  2819. }
  2820. };
  2821. // Ensure wrappers are instances of `baseLodash`.
  2822. lodash.prototype = baseLodash.prototype;
  2823. lodash.prototype.constructor = lodash;
  2824. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2825. LodashWrapper.prototype.constructor = LodashWrapper;
  2826. /*------------------------------------------------------------------------*/
  2827. /**
  2828. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2829. *
  2830. * @private
  2831. * @constructor
  2832. * @param {*} value The value to wrap.
  2833. */
  2834. function LazyWrapper(value) {
  2835. this.__wrapped__ = value;
  2836. this.__actions__ = [];
  2837. this.__dir__ = 1;
  2838. this.__filtered__ = false;
  2839. this.__iteratees__ = [];
  2840. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2841. this.__views__ = [];
  2842. }
  2843. /**
  2844. * Creates a clone of the lazy wrapper object.
  2845. *
  2846. * @private
  2847. * @name clone
  2848. * @memberOf LazyWrapper
  2849. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2850. */
  2851. function lazyClone() {
  2852. var result = new LazyWrapper(this.__wrapped__);
  2853. result.__actions__ = copyArray(this.__actions__);
  2854. result.__dir__ = this.__dir__;
  2855. result.__filtered__ = this.__filtered__;
  2856. result.__iteratees__ = copyArray(this.__iteratees__);
  2857. result.__takeCount__ = this.__takeCount__;
  2858. result.__views__ = copyArray(this.__views__);
  2859. return result;
  2860. }
  2861. /**
  2862. * Reverses the direction of lazy iteration.
  2863. *
  2864. * @private
  2865. * @name reverse
  2866. * @memberOf LazyWrapper
  2867. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2868. */
  2869. function lazyReverse() {
  2870. if (this.__filtered__) {
  2871. var result = new LazyWrapper(this);
  2872. result.__dir__ = -1;
  2873. result.__filtered__ = true;
  2874. } else {
  2875. result = this.clone();
  2876. result.__dir__ *= -1;
  2877. }
  2878. return result;
  2879. }
  2880. /**
  2881. * Extracts the unwrapped value from its lazy wrapper.
  2882. *
  2883. * @private
  2884. * @name value
  2885. * @memberOf LazyWrapper
  2886. * @returns {*} Returns the unwrapped value.
  2887. */
  2888. function lazyValue() {
  2889. var array = this.__wrapped__.value(),
  2890. dir = this.__dir__,
  2891. isArr = isArray(array),
  2892. isRight = dir < 0,
  2893. arrLength = isArr ? array.length : 0,
  2894. view = getView(0, arrLength, this.__views__),
  2895. start = view.start,
  2896. end = view.end,
  2897. length = end - start,
  2898. index = isRight ? end : (start - 1),
  2899. iteratees = this.__iteratees__,
  2900. iterLength = iteratees.length,
  2901. resIndex = 0,
  2902. takeCount = nativeMin(length, this.__takeCount__);
  2903. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2904. return baseWrapperValue(array, this.__actions__);
  2905. }
  2906. var result = [];
  2907. outer:
  2908. while (length-- && resIndex < takeCount) {
  2909. index += dir;
  2910. var iterIndex = -1,
  2911. value = array[index];
  2912. while (++iterIndex < iterLength) {
  2913. var data = iteratees[iterIndex],
  2914. iteratee = data.iteratee,
  2915. type = data.type,
  2916. computed = iteratee(value);
  2917. if (type == LAZY_MAP_FLAG) {
  2918. value = computed;
  2919. } else if (!computed) {
  2920. if (type == LAZY_FILTER_FLAG) {
  2921. continue outer;
  2922. } else {
  2923. break outer;
  2924. }
  2925. }
  2926. }
  2927. result[resIndex++] = value;
  2928. }
  2929. return result;
  2930. }
  2931. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2932. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2933. LazyWrapper.prototype.constructor = LazyWrapper;
  2934. /*------------------------------------------------------------------------*/
  2935. /**
  2936. * Creates a hash object.
  2937. *
  2938. * @private
  2939. * @constructor
  2940. * @param {Array} [entries] The key-value pairs to cache.
  2941. */
  2942. function Hash(entries) {
  2943. var index = -1,
  2944. length = entries == null ? 0 : entries.length;
  2945. this.clear();
  2946. while (++index < length) {
  2947. var entry = entries[index];
  2948. this.set(entry[0], entry[1]);
  2949. }
  2950. }
  2951. /**
  2952. * Removes all key-value entries from the hash.
  2953. *
  2954. * @private
  2955. * @name clear
  2956. * @memberOf Hash
  2957. */
  2958. function hashClear() {
  2959. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2960. this.size = 0;
  2961. }
  2962. /**
  2963. * Removes `key` and its value from the hash.
  2964. *
  2965. * @private
  2966. * @name delete
  2967. * @memberOf Hash
  2968. * @param {Object} hash The hash to modify.
  2969. * @param {string} key The key of the value to remove.
  2970. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2971. */
  2972. function hashDelete(key) {
  2973. var result = this.has(key) && delete this.__data__[key];
  2974. this.size -= result ? 1 : 0;
  2975. return result;
  2976. }
  2977. /**
  2978. * Gets the hash value for `key`.
  2979. *
  2980. * @private
  2981. * @name get
  2982. * @memberOf Hash
  2983. * @param {string} key The key of the value to get.
  2984. * @returns {*} Returns the entry value.
  2985. */
  2986. function hashGet(key) {
  2987. var data = this.__data__;
  2988. if (nativeCreate) {
  2989. var result = data[key];
  2990. return result === HASH_UNDEFINED ? undefined : result;
  2991. }
  2992. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2993. }
  2994. /**
  2995. * Checks if a hash value for `key` exists.
  2996. *
  2997. * @private
  2998. * @name has
  2999. * @memberOf Hash
  3000. * @param {string} key The key of the entry to check.
  3001. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3002. */
  3003. function hashHas(key) {
  3004. var data = this.__data__;
  3005. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3006. }
  3007. /**
  3008. * Sets the hash `key` to `value`.
  3009. *
  3010. * @private
  3011. * @name set
  3012. * @memberOf Hash
  3013. * @param {string} key The key of the value to set.
  3014. * @param {*} value The value to set.
  3015. * @returns {Object} Returns the hash instance.
  3016. */
  3017. function hashSet(key, value) {
  3018. var data = this.__data__;
  3019. this.size += this.has(key) ? 0 : 1;
  3020. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3021. return this;
  3022. }
  3023. // Add methods to `Hash`.
  3024. Hash.prototype.clear = hashClear;
  3025. Hash.prototype['delete'] = hashDelete;
  3026. Hash.prototype.get = hashGet;
  3027. Hash.prototype.has = hashHas;
  3028. Hash.prototype.set = hashSet;
  3029. /*------------------------------------------------------------------------*/
  3030. /**
  3031. * Creates an list cache object.
  3032. *
  3033. * @private
  3034. * @constructor
  3035. * @param {Array} [entries] The key-value pairs to cache.
  3036. */
  3037. function ListCache(entries) {
  3038. var index = -1,
  3039. length = entries == null ? 0 : entries.length;
  3040. this.clear();
  3041. while (++index < length) {
  3042. var entry = entries[index];
  3043. this.set(entry[0], entry[1]);
  3044. }
  3045. }
  3046. /**
  3047. * Removes all key-value entries from the list cache.
  3048. *
  3049. * @private
  3050. * @name clear
  3051. * @memberOf ListCache
  3052. */
  3053. function listCacheClear() {
  3054. this.__data__ = [];
  3055. this.size = 0;
  3056. }
  3057. /**
  3058. * Removes `key` and its value from the list cache.
  3059. *
  3060. * @private
  3061. * @name delete
  3062. * @memberOf ListCache
  3063. * @param {string} key The key of the value to remove.
  3064. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3065. */
  3066. function listCacheDelete(key) {
  3067. var data = this.__data__,
  3068. index = assocIndexOf(data, key);
  3069. if (index < 0) {
  3070. return false;
  3071. }
  3072. var lastIndex = data.length - 1;
  3073. if (index == lastIndex) {
  3074. data.pop();
  3075. } else {
  3076. splice.call(data, index, 1);
  3077. }
  3078. --this.size;
  3079. return true;
  3080. }
  3081. /**
  3082. * Gets the list cache value for `key`.
  3083. *
  3084. * @private
  3085. * @name get
  3086. * @memberOf ListCache
  3087. * @param {string} key The key of the value to get.
  3088. * @returns {*} Returns the entry value.
  3089. */
  3090. function listCacheGet(key) {
  3091. var data = this.__data__,
  3092. index = assocIndexOf(data, key);
  3093. return index < 0 ? undefined : data[index][1];
  3094. }
  3095. /**
  3096. * Checks if a list cache value for `key` exists.
  3097. *
  3098. * @private
  3099. * @name has
  3100. * @memberOf ListCache
  3101. * @param {string} key The key of the entry to check.
  3102. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3103. */
  3104. function listCacheHas(key) {
  3105. return assocIndexOf(this.__data__, key) > -1;
  3106. }
  3107. /**
  3108. * Sets the list cache `key` to `value`.
  3109. *
  3110. * @private
  3111. * @name set
  3112. * @memberOf ListCache
  3113. * @param {string} key The key of the value to set.
  3114. * @param {*} value The value to set.
  3115. * @returns {Object} Returns the list cache instance.
  3116. */
  3117. function listCacheSet(key, value) {
  3118. var data = this.__data__,
  3119. index = assocIndexOf(data, key);
  3120. if (index < 0) {
  3121. ++this.size;
  3122. data.push([key, value]);
  3123. } else {
  3124. data[index][1] = value;
  3125. }
  3126. return this;
  3127. }
  3128. // Add methods to `ListCache`.
  3129. ListCache.prototype.clear = listCacheClear;
  3130. ListCache.prototype['delete'] = listCacheDelete;
  3131. ListCache.prototype.get = listCacheGet;
  3132. ListCache.prototype.has = listCacheHas;
  3133. ListCache.prototype.set = listCacheSet;
  3134. /*------------------------------------------------------------------------*/
  3135. /**
  3136. * Creates a map cache object to store key-value pairs.
  3137. *
  3138. * @private
  3139. * @constructor
  3140. * @param {Array} [entries] The key-value pairs to cache.
  3141. */
  3142. function MapCache(entries) {
  3143. var index = -1,
  3144. length = entries == null ? 0 : entries.length;
  3145. this.clear();
  3146. while (++index < length) {
  3147. var entry = entries[index];
  3148. this.set(entry[0], entry[1]);
  3149. }
  3150. }
  3151. /**
  3152. * Removes all key-value entries from the map.
  3153. *
  3154. * @private
  3155. * @name clear
  3156. * @memberOf MapCache
  3157. */
  3158. function mapCacheClear() {
  3159. this.size = 0;
  3160. this.__data__ = {
  3161. 'hash': new Hash,
  3162. 'map': new (Map || ListCache),
  3163. 'string': new Hash
  3164. };
  3165. }
  3166. /**
  3167. * Removes `key` and its value from the map.
  3168. *
  3169. * @private
  3170. * @name delete
  3171. * @memberOf MapCache
  3172. * @param {string} key The key of the value to remove.
  3173. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3174. */
  3175. function mapCacheDelete(key) {
  3176. var result = getMapData(this, key)['delete'](key);
  3177. this.size -= result ? 1 : 0;
  3178. return result;
  3179. }
  3180. /**
  3181. * Gets the map value for `key`.
  3182. *
  3183. * @private
  3184. * @name get
  3185. * @memberOf MapCache
  3186. * @param {string} key The key of the value to get.
  3187. * @returns {*} Returns the entry value.
  3188. */
  3189. function mapCacheGet(key) {
  3190. return getMapData(this, key).get(key);
  3191. }
  3192. /**
  3193. * Checks if a map value for `key` exists.
  3194. *
  3195. * @private
  3196. * @name has
  3197. * @memberOf MapCache
  3198. * @param {string} key The key of the entry to check.
  3199. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3200. */
  3201. function mapCacheHas(key) {
  3202. return getMapData(this, key).has(key);
  3203. }
  3204. /**
  3205. * Sets the map `key` to `value`.
  3206. *
  3207. * @private
  3208. * @name set
  3209. * @memberOf MapCache
  3210. * @param {string} key The key of the value to set.
  3211. * @param {*} value The value to set.
  3212. * @returns {Object} Returns the map cache instance.
  3213. */
  3214. function mapCacheSet(key, value) {
  3215. var data = getMapData(this, key),
  3216. size = data.size;
  3217. data.set(key, value);
  3218. this.size += data.size == size ? 0 : 1;
  3219. return this;
  3220. }
  3221. // Add methods to `MapCache`.
  3222. MapCache.prototype.clear = mapCacheClear;
  3223. MapCache.prototype['delete'] = mapCacheDelete;
  3224. MapCache.prototype.get = mapCacheGet;
  3225. MapCache.prototype.has = mapCacheHas;
  3226. MapCache.prototype.set = mapCacheSet;
  3227. /*------------------------------------------------------------------------*/
  3228. /**
  3229. *
  3230. * Creates an array cache object to store unique values.
  3231. *
  3232. * @private
  3233. * @constructor
  3234. * @param {Array} [values] The values to cache.
  3235. */
  3236. function SetCache(values) {
  3237. var index = -1,
  3238. length = values == null ? 0 : values.length;
  3239. this.__data__ = new MapCache;
  3240. while (++index < length) {
  3241. this.add(values[index]);
  3242. }
  3243. }
  3244. /**
  3245. * Adds `value` to the array cache.
  3246. *
  3247. * @private
  3248. * @name add
  3249. * @memberOf SetCache
  3250. * @alias push
  3251. * @param {*} value The value to cache.
  3252. * @returns {Object} Returns the cache instance.
  3253. */
  3254. function setCacheAdd(value) {
  3255. this.__data__.set(value, HASH_UNDEFINED);
  3256. return this;
  3257. }
  3258. /**
  3259. * Checks if `value` is in the array cache.
  3260. *
  3261. * @private
  3262. * @name has
  3263. * @memberOf SetCache
  3264. * @param {*} value The value to search for.
  3265. * @returns {number} Returns `true` if `value` is found, else `false`.
  3266. */
  3267. function setCacheHas(value) {
  3268. return this.__data__.has(value);
  3269. }
  3270. // Add methods to `SetCache`.
  3271. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3272. SetCache.prototype.has = setCacheHas;
  3273. /*------------------------------------------------------------------------*/
  3274. /**
  3275. * Creates a stack cache object to store key-value pairs.
  3276. *
  3277. * @private
  3278. * @constructor
  3279. * @param {Array} [entries] The key-value pairs to cache.
  3280. */
  3281. function Stack(entries) {
  3282. var data = this.__data__ = new ListCache(entries);
  3283. this.size = data.size;
  3284. }
  3285. /**
  3286. * Removes all key-value entries from the stack.
  3287. *
  3288. * @private
  3289. * @name clear
  3290. * @memberOf Stack
  3291. */
  3292. function stackClear() {
  3293. this.__data__ = new ListCache;
  3294. this.size = 0;
  3295. }
  3296. /**
  3297. * Removes `key` and its value from the stack.
  3298. *
  3299. * @private
  3300. * @name delete
  3301. * @memberOf Stack
  3302. * @param {string} key The key of the value to remove.
  3303. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3304. */
  3305. function stackDelete(key) {
  3306. var data = this.__data__,
  3307. result = data['delete'](key);
  3308. this.size = data.size;
  3309. return result;
  3310. }
  3311. /**
  3312. * Gets the stack value for `key`.
  3313. *
  3314. * @private
  3315. * @name get
  3316. * @memberOf Stack
  3317. * @param {string} key The key of the value to get.
  3318. * @returns {*} Returns the entry value.
  3319. */
  3320. function stackGet(key) {
  3321. return this.__data__.get(key);
  3322. }
  3323. /**
  3324. * Checks if a stack value for `key` exists.
  3325. *
  3326. * @private
  3327. * @name has
  3328. * @memberOf Stack
  3329. * @param {string} key The key of the entry to check.
  3330. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3331. */
  3332. function stackHas(key) {
  3333. return this.__data__.has(key);
  3334. }
  3335. /**
  3336. * Sets the stack `key` to `value`.
  3337. *
  3338. * @private
  3339. * @name set
  3340. * @memberOf Stack
  3341. * @param {string} key The key of the value to set.
  3342. * @param {*} value The value to set.
  3343. * @returns {Object} Returns the stack cache instance.
  3344. */
  3345. function stackSet(key, value) {
  3346. var data = this.__data__;
  3347. if (data instanceof ListCache) {
  3348. var pairs = data.__data__;
  3349. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3350. pairs.push([key, value]);
  3351. this.size = ++data.size;
  3352. return this;
  3353. }
  3354. data = this.__data__ = new MapCache(pairs);
  3355. }
  3356. data.set(key, value);
  3357. this.size = data.size;
  3358. return this;
  3359. }
  3360. // Add methods to `Stack`.
  3361. Stack.prototype.clear = stackClear;
  3362. Stack.prototype['delete'] = stackDelete;
  3363. Stack.prototype.get = stackGet;
  3364. Stack.prototype.has = stackHas;
  3365. Stack.prototype.set = stackSet;
  3366. /*------------------------------------------------------------------------*/
  3367. /**
  3368. * Creates an array of the enumerable property names of the array-like `value`.
  3369. *
  3370. * @private
  3371. * @param {*} value The value to query.
  3372. * @param {boolean} inherited Specify returning inherited property names.
  3373. * @returns {Array} Returns the array of property names.
  3374. */
  3375. function arrayLikeKeys(value, inherited) {
  3376. var isArr = isArray(value),
  3377. isArg = !isArr && isArguments(value),
  3378. isBuff = !isArr && !isArg && isBuffer(value),
  3379. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3380. skipIndexes = isArr || isArg || isBuff || isType,
  3381. result = skipIndexes ? baseTimes(value.length, String) : [],
  3382. length = result.length;
  3383. for (var key in value) {
  3384. if ((inherited || hasOwnProperty.call(value, key)) &&
  3385. !(skipIndexes && (
  3386. // Safari 9 has enumerable `arguments.length` in strict mode.
  3387. key == 'length' ||
  3388. // Node.js 0.10 has enumerable non-index properties on buffers.
  3389. (isBuff && (key == 'offset' || key == 'parent')) ||
  3390. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3391. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3392. // Skip index properties.
  3393. isIndex(key, length)
  3394. ))) {
  3395. result.push(key);
  3396. }
  3397. }
  3398. return result;
  3399. }
  3400. /**
  3401. * A specialized version of `_.sample` for arrays.
  3402. *
  3403. * @private
  3404. * @param {Array} array The array to sample.
  3405. * @returns {*} Returns the random element.
  3406. */
  3407. function arraySample(array) {
  3408. var length = array.length;
  3409. return length ? array[baseRandom(0, length - 1)] : undefined;
  3410. }
  3411. /**
  3412. * A specialized version of `_.sampleSize` for arrays.
  3413. *
  3414. * @private
  3415. * @param {Array} array The array to sample.
  3416. * @param {number} n The number of elements to sample.
  3417. * @returns {Array} Returns the random elements.
  3418. */
  3419. function arraySampleSize(array, n) {
  3420. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3421. }
  3422. /**
  3423. * A specialized version of `_.shuffle` for arrays.
  3424. *
  3425. * @private
  3426. * @param {Array} array The array to shuffle.
  3427. * @returns {Array} Returns the new shuffled array.
  3428. */
  3429. function arrayShuffle(array) {
  3430. return shuffleSelf(copyArray(array));
  3431. }
  3432. /**
  3433. * This function is like `assignValue` except that it doesn't assign
  3434. * `undefined` values.
  3435. *
  3436. * @private
  3437. * @param {Object} object The object to modify.
  3438. * @param {string} key The key of the property to assign.
  3439. * @param {*} value The value to assign.
  3440. */
  3441. function assignMergeValue(object, key, value) {
  3442. if ((value !== undefined && !eq(object[key], value)) ||
  3443. (value === undefined && !(key in object))) {
  3444. baseAssignValue(object, key, value);
  3445. }
  3446. }
  3447. /**
  3448. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3449. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3450. * for equality comparisons.
  3451. *
  3452. * @private
  3453. * @param {Object} object The object to modify.
  3454. * @param {string} key The key of the property to assign.
  3455. * @param {*} value The value to assign.
  3456. */
  3457. function assignValue(object, key, value) {
  3458. var objValue = object[key];
  3459. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3460. (value === undefined && !(key in object))) {
  3461. baseAssignValue(object, key, value);
  3462. }
  3463. }
  3464. /**
  3465. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3466. *
  3467. * @private
  3468. * @param {Array} array The array to inspect.
  3469. * @param {*} key The key to search for.
  3470. * @returns {number} Returns the index of the matched value, else `-1`.
  3471. */
  3472. function assocIndexOf(array, key) {
  3473. var length = array.length;
  3474. while (length--) {
  3475. if (eq(array[length][0], key)) {
  3476. return length;
  3477. }
  3478. }
  3479. return -1;
  3480. }
  3481. /**
  3482. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3483. * by `iteratee` and values set by `setter`.
  3484. *
  3485. * @private
  3486. * @param {Array|Object} collection The collection to iterate over.
  3487. * @param {Function} setter The function to set `accumulator` values.
  3488. * @param {Function} iteratee The iteratee to transform keys.
  3489. * @param {Object} accumulator The initial aggregated object.
  3490. * @returns {Function} Returns `accumulator`.
  3491. */
  3492. function baseAggregator(collection, setter, iteratee, accumulator) {
  3493. baseEach(collection, function(value, key, collection) {
  3494. setter(accumulator, value, iteratee(value), collection);
  3495. });
  3496. return accumulator;
  3497. }
  3498. /**
  3499. * The base implementation of `_.assign` without support for multiple sources
  3500. * or `customizer` functions.
  3501. *
  3502. * @private
  3503. * @param {Object} object The destination object.
  3504. * @param {Object} source The source object.
  3505. * @returns {Object} Returns `object`.
  3506. */
  3507. function baseAssign(object, source) {
  3508. return object && copyObject(source, keys(source), object);
  3509. }
  3510. /**
  3511. * The base implementation of `_.assignIn` without support for multiple sources
  3512. * or `customizer` functions.
  3513. *
  3514. * @private
  3515. * @param {Object} object The destination object.
  3516. * @param {Object} source The source object.
  3517. * @returns {Object} Returns `object`.
  3518. */
  3519. function baseAssignIn(object, source) {
  3520. return object && copyObject(source, keysIn(source), object);
  3521. }
  3522. /**
  3523. * The base implementation of `assignValue` and `assignMergeValue` without
  3524. * value checks.
  3525. *
  3526. * @private
  3527. * @param {Object} object The object to modify.
  3528. * @param {string} key The key of the property to assign.
  3529. * @param {*} value The value to assign.
  3530. */
  3531. function baseAssignValue(object, key, value) {
  3532. if (key == '__proto__' && defineProperty) {
  3533. defineProperty(object, key, {
  3534. 'configurable': true,
  3535. 'enumerable': true,
  3536. 'value': value,
  3537. 'writable': true
  3538. });
  3539. } else {
  3540. object[key] = value;
  3541. }
  3542. }
  3543. /**
  3544. * The base implementation of `_.at` without support for individual paths.
  3545. *
  3546. * @private
  3547. * @param {Object} object The object to iterate over.
  3548. * @param {string[]} paths The property paths to pick.
  3549. * @returns {Array} Returns the picked elements.
  3550. */
  3551. function baseAt(object, paths) {
  3552. var index = -1,
  3553. length = paths.length,
  3554. result = Array(length),
  3555. skip = object == null;
  3556. while (++index < length) {
  3557. result[index] = skip ? undefined : get(object, paths[index]);
  3558. }
  3559. return result;
  3560. }
  3561. /**
  3562. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3563. *
  3564. * @private
  3565. * @param {number} number The number to clamp.
  3566. * @param {number} [lower] The lower bound.
  3567. * @param {number} upper The upper bound.
  3568. * @returns {number} Returns the clamped number.
  3569. */
  3570. function baseClamp(number, lower, upper) {
  3571. if (number === number) {
  3572. if (upper !== undefined) {
  3573. number = number <= upper ? number : upper;
  3574. }
  3575. if (lower !== undefined) {
  3576. number = number >= lower ? number : lower;
  3577. }
  3578. }
  3579. return number;
  3580. }
  3581. /**
  3582. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3583. * traversed objects.
  3584. *
  3585. * @private
  3586. * @param {*} value The value to clone.
  3587. * @param {boolean} bitmask The bitmask flags.
  3588. * 1 - Deep clone
  3589. * 2 - Flatten inherited properties
  3590. * 4 - Clone symbols
  3591. * @param {Function} [customizer] The function to customize cloning.
  3592. * @param {string} [key] The key of `value`.
  3593. * @param {Object} [object] The parent object of `value`.
  3594. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3595. * @returns {*} Returns the cloned value.
  3596. */
  3597. function baseClone(value, bitmask, customizer, key, object, stack) {
  3598. var result,
  3599. isDeep = bitmask & CLONE_DEEP_FLAG,
  3600. isFlat = bitmask & CLONE_FLAT_FLAG,
  3601. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3602. if (customizer) {
  3603. result = object ? customizer(value, key, object, stack) : customizer(value);
  3604. }
  3605. if (result !== undefined) {
  3606. return result;
  3607. }
  3608. if (!isObject(value)) {
  3609. return value;
  3610. }
  3611. var isArr = isArray(value);
  3612. if (isArr) {
  3613. result = initCloneArray(value);
  3614. if (!isDeep) {
  3615. return copyArray(value, result);
  3616. }
  3617. } else {
  3618. var tag = getTag(value),
  3619. isFunc = tag == funcTag || tag == genTag;
  3620. if (isBuffer(value)) {
  3621. return cloneBuffer(value, isDeep);
  3622. }
  3623. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3624. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3625. if (!isDeep) {
  3626. return isFlat
  3627. ? copySymbolsIn(value, baseAssignIn(result, value))
  3628. : copySymbols(value, baseAssign(result, value));
  3629. }
  3630. } else {
  3631. if (!cloneableTags[tag]) {
  3632. return object ? value : {};
  3633. }
  3634. result = initCloneByTag(value, tag, isDeep);
  3635. }
  3636. }
  3637. // Check for circular references and return its corresponding clone.
  3638. stack || (stack = new Stack);
  3639. var stacked = stack.get(value);
  3640. if (stacked) {
  3641. return stacked;
  3642. }
  3643. stack.set(value, result);
  3644. if (isSet(value)) {
  3645. value.forEach(function(subValue) {
  3646. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3647. });
  3648. } else if (isMap(value)) {
  3649. value.forEach(function(subValue, key) {
  3650. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3651. });
  3652. }
  3653. var keysFunc = isFull
  3654. ? (isFlat ? getAllKeysIn : getAllKeys)
  3655. : (isFlat ? keysIn : keys);
  3656. var props = isArr ? undefined : keysFunc(value);
  3657. arrayEach(props || value, function(subValue, key) {
  3658. if (props) {
  3659. key = subValue;
  3660. subValue = value[key];
  3661. }
  3662. // Recursively populate clone (susceptible to call stack limits).
  3663. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3664. });
  3665. return result;
  3666. }
  3667. /**
  3668. * The base implementation of `_.conforms` which doesn't clone `source`.
  3669. *
  3670. * @private
  3671. * @param {Object} source The object of property predicates to conform to.
  3672. * @returns {Function} Returns the new spec function.
  3673. */
  3674. function baseConforms(source) {
  3675. var props = keys(source);
  3676. return function(object) {
  3677. return baseConformsTo(object, source, props);
  3678. };
  3679. }
  3680. /**
  3681. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3682. *
  3683. * @private
  3684. * @param {Object} object The object to inspect.
  3685. * @param {Object} source The object of property predicates to conform to.
  3686. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3687. */
  3688. function baseConformsTo(object, source, props) {
  3689. var length = props.length;
  3690. if (object == null) {
  3691. return !length;
  3692. }
  3693. object = Object(object);
  3694. while (length--) {
  3695. var key = props[length],
  3696. predicate = source[key],
  3697. value = object[key];
  3698. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3699. return false;
  3700. }
  3701. }
  3702. return true;
  3703. }
  3704. /**
  3705. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3706. * to provide to `func`.
  3707. *
  3708. * @private
  3709. * @param {Function} func The function to delay.
  3710. * @param {number} wait The number of milliseconds to delay invocation.
  3711. * @param {Array} args The arguments to provide to `func`.
  3712. * @returns {number|Object} Returns the timer id or timeout object.
  3713. */
  3714. function baseDelay(func, wait, args) {
  3715. if (typeof func != 'function') {
  3716. throw new TypeError(FUNC_ERROR_TEXT);
  3717. }
  3718. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3719. }
  3720. /**
  3721. * The base implementation of methods like `_.difference` without support
  3722. * for excluding multiple arrays or iteratee shorthands.
  3723. *
  3724. * @private
  3725. * @param {Array} array The array to inspect.
  3726. * @param {Array} values The values to exclude.
  3727. * @param {Function} [iteratee] The iteratee invoked per element.
  3728. * @param {Function} [comparator] The comparator invoked per element.
  3729. * @returns {Array} Returns the new array of filtered values.
  3730. */
  3731. function baseDifference(array, values, iteratee, comparator) {
  3732. var index = -1,
  3733. includes = arrayIncludes,
  3734. isCommon = true,
  3735. length = array.length,
  3736. result = [],
  3737. valuesLength = values.length;
  3738. if (!length) {
  3739. return result;
  3740. }
  3741. if (iteratee) {
  3742. values = arrayMap(values, baseUnary(iteratee));
  3743. }
  3744. if (comparator) {
  3745. includes = arrayIncludesWith;
  3746. isCommon = false;
  3747. }
  3748. else if (values.length >= LARGE_ARRAY_SIZE) {
  3749. includes = cacheHas;
  3750. isCommon = false;
  3751. values = new SetCache(values);
  3752. }
  3753. outer:
  3754. while (++index < length) {
  3755. var value = array[index],
  3756. computed = iteratee == null ? value : iteratee(value);
  3757. value = (comparator || value !== 0) ? value : 0;
  3758. if (isCommon && computed === computed) {
  3759. var valuesIndex = valuesLength;
  3760. while (valuesIndex--) {
  3761. if (values[valuesIndex] === computed) {
  3762. continue outer;
  3763. }
  3764. }
  3765. result.push(value);
  3766. }
  3767. else if (!includes(values, computed, comparator)) {
  3768. result.push(value);
  3769. }
  3770. }
  3771. return result;
  3772. }
  3773. /**
  3774. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3775. *
  3776. * @private
  3777. * @param {Array|Object} collection The collection to iterate over.
  3778. * @param {Function} iteratee The function invoked per iteration.
  3779. * @returns {Array|Object} Returns `collection`.
  3780. */
  3781. var baseEach = createBaseEach(baseForOwn);
  3782. /**
  3783. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3784. *
  3785. * @private
  3786. * @param {Array|Object} collection The collection to iterate over.
  3787. * @param {Function} iteratee The function invoked per iteration.
  3788. * @returns {Array|Object} Returns `collection`.
  3789. */
  3790. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3791. /**
  3792. * The base implementation of `_.every` without support for iteratee shorthands.
  3793. *
  3794. * @private
  3795. * @param {Array|Object} collection The collection to iterate over.
  3796. * @param {Function} predicate The function invoked per iteration.
  3797. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3798. * else `false`
  3799. */
  3800. function baseEvery(collection, predicate) {
  3801. var result = true;
  3802. baseEach(collection, function(value, index, collection) {
  3803. result = !!predicate(value, index, collection);
  3804. return result;
  3805. });
  3806. return result;
  3807. }
  3808. /**
  3809. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3810. * `comparator` to determine the extremum value.
  3811. *
  3812. * @private
  3813. * @param {Array} array The array to iterate over.
  3814. * @param {Function} iteratee The iteratee invoked per iteration.
  3815. * @param {Function} comparator The comparator used to compare values.
  3816. * @returns {*} Returns the extremum value.
  3817. */
  3818. function baseExtremum(array, iteratee, comparator) {
  3819. var index = -1,
  3820. length = array.length;
  3821. while (++index < length) {
  3822. var value = array[index],
  3823. current = iteratee(value);
  3824. if (current != null && (computed === undefined
  3825. ? (current === current && !isSymbol(current))
  3826. : comparator(current, computed)
  3827. )) {
  3828. var computed = current,
  3829. result = value;
  3830. }
  3831. }
  3832. return result;
  3833. }
  3834. /**
  3835. * The base implementation of `_.fill` without an iteratee call guard.
  3836. *
  3837. * @private
  3838. * @param {Array} array The array to fill.
  3839. * @param {*} value The value to fill `array` with.
  3840. * @param {number} [start=0] The start position.
  3841. * @param {number} [end=array.length] The end position.
  3842. * @returns {Array} Returns `array`.
  3843. */
  3844. function baseFill(array, value, start, end) {
  3845. var length = array.length;
  3846. start = toInteger(start);
  3847. if (start < 0) {
  3848. start = -start > length ? 0 : (length + start);
  3849. }
  3850. end = (end === undefined || end > length) ? length : toInteger(end);
  3851. if (end < 0) {
  3852. end += length;
  3853. }
  3854. end = start > end ? 0 : toLength(end);
  3855. while (start < end) {
  3856. array[start++] = value;
  3857. }
  3858. return array;
  3859. }
  3860. /**
  3861. * The base implementation of `_.filter` without support for iteratee shorthands.
  3862. *
  3863. * @private
  3864. * @param {Array|Object} collection The collection to iterate over.
  3865. * @param {Function} predicate The function invoked per iteration.
  3866. * @returns {Array} Returns the new filtered array.
  3867. */
  3868. function baseFilter(collection, predicate) {
  3869. var result = [];
  3870. baseEach(collection, function(value, index, collection) {
  3871. if (predicate(value, index, collection)) {
  3872. result.push(value);
  3873. }
  3874. });
  3875. return result;
  3876. }
  3877. /**
  3878. * The base implementation of `_.flatten` with support for restricting flattening.
  3879. *
  3880. * @private
  3881. * @param {Array} array The array to flatten.
  3882. * @param {number} depth The maximum recursion depth.
  3883. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3884. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3885. * @param {Array} [result=[]] The initial result value.
  3886. * @returns {Array} Returns the new flattened array.
  3887. */
  3888. function baseFlatten(array, depth, predicate, isStrict, result) {
  3889. var index = -1,
  3890. length = array.length;
  3891. predicate || (predicate = isFlattenable);
  3892. result || (result = []);
  3893. while (++index < length) {
  3894. var value = array[index];
  3895. if (depth > 0 && predicate(value)) {
  3896. if (depth > 1) {
  3897. // Recursively flatten arrays (susceptible to call stack limits).
  3898. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3899. } else {
  3900. arrayPush(result, value);
  3901. }
  3902. } else if (!isStrict) {
  3903. result[result.length] = value;
  3904. }
  3905. }
  3906. return result;
  3907. }
  3908. /**
  3909. * The base implementation of `baseForOwn` which iterates over `object`
  3910. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3911. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3912. *
  3913. * @private
  3914. * @param {Object} object The object to iterate over.
  3915. * @param {Function} iteratee The function invoked per iteration.
  3916. * @param {Function} keysFunc The function to get the keys of `object`.
  3917. * @returns {Object} Returns `object`.
  3918. */
  3919. var baseFor = createBaseFor();
  3920. /**
  3921. * This function is like `baseFor` except that it iterates over properties
  3922. * in the opposite order.
  3923. *
  3924. * @private
  3925. * @param {Object} object The object to iterate over.
  3926. * @param {Function} iteratee The function invoked per iteration.
  3927. * @param {Function} keysFunc The function to get the keys of `object`.
  3928. * @returns {Object} Returns `object`.
  3929. */
  3930. var baseForRight = createBaseFor(true);
  3931. /**
  3932. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3933. *
  3934. * @private
  3935. * @param {Object} object The object to iterate over.
  3936. * @param {Function} iteratee The function invoked per iteration.
  3937. * @returns {Object} Returns `object`.
  3938. */
  3939. function baseForOwn(object, iteratee) {
  3940. return object && baseFor(object, iteratee, keys);
  3941. }
  3942. /**
  3943. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3944. *
  3945. * @private
  3946. * @param {Object} object The object to iterate over.
  3947. * @param {Function} iteratee The function invoked per iteration.
  3948. * @returns {Object} Returns `object`.
  3949. */
  3950. function baseForOwnRight(object, iteratee) {
  3951. return object && baseForRight(object, iteratee, keys);
  3952. }
  3953. /**
  3954. * The base implementation of `_.functions` which creates an array of
  3955. * `object` function property names filtered from `props`.
  3956. *
  3957. * @private
  3958. * @param {Object} object The object to inspect.
  3959. * @param {Array} props The property names to filter.
  3960. * @returns {Array} Returns the function names.
  3961. */
  3962. function baseFunctions(object, props) {
  3963. return arrayFilter(props, function(key) {
  3964. return isFunction(object[key]);
  3965. });
  3966. }
  3967. /**
  3968. * The base implementation of `_.get` without support for default values.
  3969. *
  3970. * @private
  3971. * @param {Object} object The object to query.
  3972. * @param {Array|string} path The path of the property to get.
  3973. * @returns {*} Returns the resolved value.
  3974. */
  3975. function baseGet(object, path) {
  3976. path = castPath(path, object);
  3977. var index = 0,
  3978. length = path.length;
  3979. while (object != null && index < length) {
  3980. object = object[toKey(path[index++])];
  3981. }
  3982. return (index && index == length) ? object : undefined;
  3983. }
  3984. /**
  3985. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3986. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3987. * symbols of `object`.
  3988. *
  3989. * @private
  3990. * @param {Object} object The object to query.
  3991. * @param {Function} keysFunc The function to get the keys of `object`.
  3992. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3993. * @returns {Array} Returns the array of property names and symbols.
  3994. */
  3995. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3996. var result = keysFunc(object);
  3997. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3998. }
  3999. /**
  4000. * The base implementation of `getTag` without fallbacks for buggy environments.
  4001. *
  4002. * @private
  4003. * @param {*} value The value to query.
  4004. * @returns {string} Returns the `toStringTag`.
  4005. */
  4006. function baseGetTag(value) {
  4007. if (value == null) {
  4008. return value === undefined ? undefinedTag : nullTag;
  4009. }
  4010. return (symToStringTag && symToStringTag in Object(value))
  4011. ? getRawTag(value)
  4012. : objectToString(value);
  4013. }
  4014. /**
  4015. * The base implementation of `_.gt` which doesn't coerce arguments.
  4016. *
  4017. * @private
  4018. * @param {*} value The value to compare.
  4019. * @param {*} other The other value to compare.
  4020. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4021. * else `false`.
  4022. */
  4023. function baseGt(value, other) {
  4024. return value > other;
  4025. }
  4026. /**
  4027. * The base implementation of `_.has` without support for deep paths.
  4028. *
  4029. * @private
  4030. * @param {Object} [object] The object to query.
  4031. * @param {Array|string} key The key to check.
  4032. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4033. */
  4034. function baseHas(object, key) {
  4035. return object != null && hasOwnProperty.call(object, key);
  4036. }
  4037. /**
  4038. * The base implementation of `_.hasIn` without support for deep paths.
  4039. *
  4040. * @private
  4041. * @param {Object} [object] The object to query.
  4042. * @param {Array|string} key The key to check.
  4043. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4044. */
  4045. function baseHasIn(object, key) {
  4046. return object != null && key in Object(object);
  4047. }
  4048. /**
  4049. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4050. *
  4051. * @private
  4052. * @param {number} number The number to check.
  4053. * @param {number} start The start of the range.
  4054. * @param {number} end The end of the range.
  4055. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4056. */
  4057. function baseInRange(number, start, end) {
  4058. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4059. }
  4060. /**
  4061. * The base implementation of methods like `_.intersection`, without support
  4062. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4063. *
  4064. * @private
  4065. * @param {Array} arrays The arrays to inspect.
  4066. * @param {Function} [iteratee] The iteratee invoked per element.
  4067. * @param {Function} [comparator] The comparator invoked per element.
  4068. * @returns {Array} Returns the new array of shared values.
  4069. */
  4070. function baseIntersection(arrays, iteratee, comparator) {
  4071. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4072. length = arrays[0].length,
  4073. othLength = arrays.length,
  4074. othIndex = othLength,
  4075. caches = Array(othLength),
  4076. maxLength = Infinity,
  4077. result = [];
  4078. while (othIndex--) {
  4079. var array = arrays[othIndex];
  4080. if (othIndex && iteratee) {
  4081. array = arrayMap(array, baseUnary(iteratee));
  4082. }
  4083. maxLength = nativeMin(array.length, maxLength);
  4084. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4085. ? new SetCache(othIndex && array)
  4086. : undefined;
  4087. }
  4088. array = arrays[0];
  4089. var index = -1,
  4090. seen = caches[0];
  4091. outer:
  4092. while (++index < length && result.length < maxLength) {
  4093. var value = array[index],
  4094. computed = iteratee ? iteratee(value) : value;
  4095. value = (comparator || value !== 0) ? value : 0;
  4096. if (!(seen
  4097. ? cacheHas(seen, computed)
  4098. : includes(result, computed, comparator)
  4099. )) {
  4100. othIndex = othLength;
  4101. while (--othIndex) {
  4102. var cache = caches[othIndex];
  4103. if (!(cache
  4104. ? cacheHas(cache, computed)
  4105. : includes(arrays[othIndex], computed, comparator))
  4106. ) {
  4107. continue outer;
  4108. }
  4109. }
  4110. if (seen) {
  4111. seen.push(computed);
  4112. }
  4113. result.push(value);
  4114. }
  4115. }
  4116. return result;
  4117. }
  4118. /**
  4119. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4120. * `object` with values transformed by `iteratee` and set by `setter`.
  4121. *
  4122. * @private
  4123. * @param {Object} object The object to iterate over.
  4124. * @param {Function} setter The function to set `accumulator` values.
  4125. * @param {Function} iteratee The iteratee to transform values.
  4126. * @param {Object} accumulator The initial inverted object.
  4127. * @returns {Function} Returns `accumulator`.
  4128. */
  4129. function baseInverter(object, setter, iteratee, accumulator) {
  4130. baseForOwn(object, function(value, key, object) {
  4131. setter(accumulator, iteratee(value), key, object);
  4132. });
  4133. return accumulator;
  4134. }
  4135. /**
  4136. * The base implementation of `_.invoke` without support for individual
  4137. * method arguments.
  4138. *
  4139. * @private
  4140. * @param {Object} object The object to query.
  4141. * @param {Array|string} path The path of the method to invoke.
  4142. * @param {Array} args The arguments to invoke the method with.
  4143. * @returns {*} Returns the result of the invoked method.
  4144. */
  4145. function baseInvoke(object, path, args) {
  4146. path = castPath(path, object);
  4147. object = parent(object, path);
  4148. var func = object == null ? object : object[toKey(last(path))];
  4149. return func == null ? undefined : apply(func, object, args);
  4150. }
  4151. /**
  4152. * The base implementation of `_.isArguments`.
  4153. *
  4154. * @private
  4155. * @param {*} value The value to check.
  4156. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4157. */
  4158. function baseIsArguments(value) {
  4159. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4160. }
  4161. /**
  4162. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4163. *
  4164. * @private
  4165. * @param {*} value The value to check.
  4166. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4167. */
  4168. function baseIsArrayBuffer(value) {
  4169. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4170. }
  4171. /**
  4172. * The base implementation of `_.isDate` without Node.js optimizations.
  4173. *
  4174. * @private
  4175. * @param {*} value The value to check.
  4176. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4177. */
  4178. function baseIsDate(value) {
  4179. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4180. }
  4181. /**
  4182. * The base implementation of `_.isEqual` which supports partial comparisons
  4183. * and tracks traversed objects.
  4184. *
  4185. * @private
  4186. * @param {*} value The value to compare.
  4187. * @param {*} other The other value to compare.
  4188. * @param {boolean} bitmask The bitmask flags.
  4189. * 1 - Unordered comparison
  4190. * 2 - Partial comparison
  4191. * @param {Function} [customizer] The function to customize comparisons.
  4192. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4193. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4194. */
  4195. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4196. if (value === other) {
  4197. return true;
  4198. }
  4199. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4200. return value !== value && other !== other;
  4201. }
  4202. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4203. }
  4204. /**
  4205. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4206. * deep comparisons and tracks traversed objects enabling objects with circular
  4207. * references to be compared.
  4208. *
  4209. * @private
  4210. * @param {Object} object The object to compare.
  4211. * @param {Object} other The other object to compare.
  4212. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4213. * @param {Function} customizer The function to customize comparisons.
  4214. * @param {Function} equalFunc The function to determine equivalents of values.
  4215. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4216. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4217. */
  4218. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4219. var objIsArr = isArray(object),
  4220. othIsArr = isArray(other),
  4221. objTag = objIsArr ? arrayTag : getTag(object),
  4222. othTag = othIsArr ? arrayTag : getTag(other);
  4223. objTag = objTag == argsTag ? objectTag : objTag;
  4224. othTag = othTag == argsTag ? objectTag : othTag;
  4225. var objIsObj = objTag == objectTag,
  4226. othIsObj = othTag == objectTag,
  4227. isSameTag = objTag == othTag;
  4228. if (isSameTag && isBuffer(object)) {
  4229. if (!isBuffer(other)) {
  4230. return false;
  4231. }
  4232. objIsArr = true;
  4233. objIsObj = false;
  4234. }
  4235. if (isSameTag && !objIsObj) {
  4236. stack || (stack = new Stack);
  4237. return (objIsArr || isTypedArray(object))
  4238. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4239. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4240. }
  4241. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4242. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4243. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4244. if (objIsWrapped || othIsWrapped) {
  4245. var objUnwrapped = objIsWrapped ? object.value() : object,
  4246. othUnwrapped = othIsWrapped ? other.value() : other;
  4247. stack || (stack = new Stack);
  4248. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4249. }
  4250. }
  4251. if (!isSameTag) {
  4252. return false;
  4253. }
  4254. stack || (stack = new Stack);
  4255. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4256. }
  4257. /**
  4258. * The base implementation of `_.isMap` without Node.js optimizations.
  4259. *
  4260. * @private
  4261. * @param {*} value The value to check.
  4262. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4263. */
  4264. function baseIsMap(value) {
  4265. return isObjectLike(value) && getTag(value) == mapTag;
  4266. }
  4267. /**
  4268. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4269. *
  4270. * @private
  4271. * @param {Object} object The object to inspect.
  4272. * @param {Object} source The object of property values to match.
  4273. * @param {Array} matchData The property names, values, and compare flags to match.
  4274. * @param {Function} [customizer] The function to customize comparisons.
  4275. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4276. */
  4277. function baseIsMatch(object, source, matchData, customizer) {
  4278. var index = matchData.length,
  4279. length = index,
  4280. noCustomizer = !customizer;
  4281. if (object == null) {
  4282. return !length;
  4283. }
  4284. object = Object(object);
  4285. while (index--) {
  4286. var data = matchData[index];
  4287. if ((noCustomizer && data[2])
  4288. ? data[1] !== object[data[0]]
  4289. : !(data[0] in object)
  4290. ) {
  4291. return false;
  4292. }
  4293. }
  4294. while (++index < length) {
  4295. data = matchData[index];
  4296. var key = data[0],
  4297. objValue = object[key],
  4298. srcValue = data[1];
  4299. if (noCustomizer && data[2]) {
  4300. if (objValue === undefined && !(key in object)) {
  4301. return false;
  4302. }
  4303. } else {
  4304. var stack = new Stack;
  4305. if (customizer) {
  4306. var result = customizer(objValue, srcValue, key, object, source, stack);
  4307. }
  4308. if (!(result === undefined
  4309. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4310. : result
  4311. )) {
  4312. return false;
  4313. }
  4314. }
  4315. }
  4316. return true;
  4317. }
  4318. /**
  4319. * The base implementation of `_.isNative` without bad shim checks.
  4320. *
  4321. * @private
  4322. * @param {*} value The value to check.
  4323. * @returns {boolean} Returns `true` if `value` is a native function,
  4324. * else `false`.
  4325. */
  4326. function baseIsNative(value) {
  4327. if (!isObject(value) || isMasked(value)) {
  4328. return false;
  4329. }
  4330. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4331. return pattern.test(toSource(value));
  4332. }
  4333. /**
  4334. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4335. *
  4336. * @private
  4337. * @param {*} value The value to check.
  4338. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4339. */
  4340. function baseIsRegExp(value) {
  4341. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4342. }
  4343. /**
  4344. * The base implementation of `_.isSet` without Node.js optimizations.
  4345. *
  4346. * @private
  4347. * @param {*} value The value to check.
  4348. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4349. */
  4350. function baseIsSet(value) {
  4351. return isObjectLike(value) && getTag(value) == setTag;
  4352. }
  4353. /**
  4354. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4355. *
  4356. * @private
  4357. * @param {*} value The value to check.
  4358. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4359. */
  4360. function baseIsTypedArray(value) {
  4361. return isObjectLike(value) &&
  4362. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4363. }
  4364. /**
  4365. * The base implementation of `_.iteratee`.
  4366. *
  4367. * @private
  4368. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4369. * @returns {Function} Returns the iteratee.
  4370. */
  4371. function baseIteratee(value) {
  4372. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4373. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4374. if (typeof value == 'function') {
  4375. return value;
  4376. }
  4377. if (value == null) {
  4378. return identity;
  4379. }
  4380. if (typeof value == 'object') {
  4381. return isArray(value)
  4382. ? baseMatchesProperty(value[0], value[1])
  4383. : baseMatches(value);
  4384. }
  4385. return property(value);
  4386. }
  4387. /**
  4388. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4389. *
  4390. * @private
  4391. * @param {Object} object The object to query.
  4392. * @returns {Array} Returns the array of property names.
  4393. */
  4394. function baseKeys(object) {
  4395. if (!isPrototype(object)) {
  4396. return nativeKeys(object);
  4397. }
  4398. var result = [];
  4399. for (var key in Object(object)) {
  4400. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4401. result.push(key);
  4402. }
  4403. }
  4404. return result;
  4405. }
  4406. /**
  4407. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4408. *
  4409. * @private
  4410. * @param {Object} object The object to query.
  4411. * @returns {Array} Returns the array of property names.
  4412. */
  4413. function baseKeysIn(object) {
  4414. if (!isObject(object)) {
  4415. return nativeKeysIn(object);
  4416. }
  4417. var isProto = isPrototype(object),
  4418. result = [];
  4419. for (var key in object) {
  4420. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4421. result.push(key);
  4422. }
  4423. }
  4424. return result;
  4425. }
  4426. /**
  4427. * The base implementation of `_.lt` which doesn't coerce arguments.
  4428. *
  4429. * @private
  4430. * @param {*} value The value to compare.
  4431. * @param {*} other The other value to compare.
  4432. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4433. * else `false`.
  4434. */
  4435. function baseLt(value, other) {
  4436. return value < other;
  4437. }
  4438. /**
  4439. * The base implementation of `_.map` without support for iteratee shorthands.
  4440. *
  4441. * @private
  4442. * @param {Array|Object} collection The collection to iterate over.
  4443. * @param {Function} iteratee The function invoked per iteration.
  4444. * @returns {Array} Returns the new mapped array.
  4445. */
  4446. function baseMap(collection, iteratee) {
  4447. var index = -1,
  4448. result = isArrayLike(collection) ? Array(collection.length) : [];
  4449. baseEach(collection, function(value, key, collection) {
  4450. result[++index] = iteratee(value, key, collection);
  4451. });
  4452. return result;
  4453. }
  4454. /**
  4455. * The base implementation of `_.matches` which doesn't clone `source`.
  4456. *
  4457. * @private
  4458. * @param {Object} source The object of property values to match.
  4459. * @returns {Function} Returns the new spec function.
  4460. */
  4461. function baseMatches(source) {
  4462. var matchData = getMatchData(source);
  4463. if (matchData.length == 1 && matchData[0][2]) {
  4464. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4465. }
  4466. return function(object) {
  4467. return object === source || baseIsMatch(object, source, matchData);
  4468. };
  4469. }
  4470. /**
  4471. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4472. *
  4473. * @private
  4474. * @param {string} path The path of the property to get.
  4475. * @param {*} srcValue The value to match.
  4476. * @returns {Function} Returns the new spec function.
  4477. */
  4478. function baseMatchesProperty(path, srcValue) {
  4479. if (isKey(path) && isStrictComparable(srcValue)) {
  4480. return matchesStrictComparable(toKey(path), srcValue);
  4481. }
  4482. return function(object) {
  4483. var objValue = get(object, path);
  4484. return (objValue === undefined && objValue === srcValue)
  4485. ? hasIn(object, path)
  4486. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4487. };
  4488. }
  4489. /**
  4490. * The base implementation of `_.merge` without support for multiple sources.
  4491. *
  4492. * @private
  4493. * @param {Object} object The destination object.
  4494. * @param {Object} source The source object.
  4495. * @param {number} srcIndex The index of `source`.
  4496. * @param {Function} [customizer] The function to customize merged values.
  4497. * @param {Object} [stack] Tracks traversed source values and their merged
  4498. * counterparts.
  4499. */
  4500. function baseMerge(object, source, srcIndex, customizer, stack) {
  4501. if (object === source) {
  4502. return;
  4503. }
  4504. baseFor(source, function(srcValue, key) {
  4505. stack || (stack = new Stack);
  4506. if (isObject(srcValue)) {
  4507. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4508. }
  4509. else {
  4510. var newValue = customizer
  4511. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4512. : undefined;
  4513. if (newValue === undefined) {
  4514. newValue = srcValue;
  4515. }
  4516. assignMergeValue(object, key, newValue);
  4517. }
  4518. }, keysIn);
  4519. }
  4520. /**
  4521. * A specialized version of `baseMerge` for arrays and objects which performs
  4522. * deep merges and tracks traversed objects enabling objects with circular
  4523. * references to be merged.
  4524. *
  4525. * @private
  4526. * @param {Object} object The destination object.
  4527. * @param {Object} source The source object.
  4528. * @param {string} key The key of the value to merge.
  4529. * @param {number} srcIndex The index of `source`.
  4530. * @param {Function} mergeFunc The function to merge values.
  4531. * @param {Function} [customizer] The function to customize assigned values.
  4532. * @param {Object} [stack] Tracks traversed source values and their merged
  4533. * counterparts.
  4534. */
  4535. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4536. var objValue = safeGet(object, key),
  4537. srcValue = safeGet(source, key),
  4538. stacked = stack.get(srcValue);
  4539. if (stacked) {
  4540. assignMergeValue(object, key, stacked);
  4541. return;
  4542. }
  4543. var newValue = customizer
  4544. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4545. : undefined;
  4546. var isCommon = newValue === undefined;
  4547. if (isCommon) {
  4548. var isArr = isArray(srcValue),
  4549. isBuff = !isArr && isBuffer(srcValue),
  4550. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4551. newValue = srcValue;
  4552. if (isArr || isBuff || isTyped) {
  4553. if (isArray(objValue)) {
  4554. newValue = objValue;
  4555. }
  4556. else if (isArrayLikeObject(objValue)) {
  4557. newValue = copyArray(objValue);
  4558. }
  4559. else if (isBuff) {
  4560. isCommon = false;
  4561. newValue = cloneBuffer(srcValue, true);
  4562. }
  4563. else if (isTyped) {
  4564. isCommon = false;
  4565. newValue = cloneTypedArray(srcValue, true);
  4566. }
  4567. else {
  4568. newValue = [];
  4569. }
  4570. }
  4571. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4572. newValue = objValue;
  4573. if (isArguments(objValue)) {
  4574. newValue = toPlainObject(objValue);
  4575. }
  4576. else if (!isObject(objValue) || isFunction(objValue)) {
  4577. newValue = initCloneObject(srcValue);
  4578. }
  4579. }
  4580. else {
  4581. isCommon = false;
  4582. }
  4583. }
  4584. if (isCommon) {
  4585. // Recursively merge objects and arrays (susceptible to call stack limits).
  4586. stack.set(srcValue, newValue);
  4587. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4588. stack['delete'](srcValue);
  4589. }
  4590. assignMergeValue(object, key, newValue);
  4591. }
  4592. /**
  4593. * The base implementation of `_.nth` which doesn't coerce arguments.
  4594. *
  4595. * @private
  4596. * @param {Array} array The array to query.
  4597. * @param {number} n The index of the element to return.
  4598. * @returns {*} Returns the nth element of `array`.
  4599. */
  4600. function baseNth(array, n) {
  4601. var length = array.length;
  4602. if (!length) {
  4603. return;
  4604. }
  4605. n += n < 0 ? length : 0;
  4606. return isIndex(n, length) ? array[n] : undefined;
  4607. }
  4608. /**
  4609. * The base implementation of `_.orderBy` without param guards.
  4610. *
  4611. * @private
  4612. * @param {Array|Object} collection The collection to iterate over.
  4613. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4614. * @param {string[]} orders The sort orders of `iteratees`.
  4615. * @returns {Array} Returns the new sorted array.
  4616. */
  4617. function baseOrderBy(collection, iteratees, orders) {
  4618. if (iteratees.length) {
  4619. iteratees = arrayMap(iteratees, function(iteratee) {
  4620. if (isArray(iteratee)) {
  4621. return function(value) {
  4622. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4623. }
  4624. }
  4625. return iteratee;
  4626. });
  4627. } else {
  4628. iteratees = [identity];
  4629. }
  4630. var index = -1;
  4631. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4632. var result = baseMap(collection, function(value, key, collection) {
  4633. var criteria = arrayMap(iteratees, function(iteratee) {
  4634. return iteratee(value);
  4635. });
  4636. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4637. });
  4638. return baseSortBy(result, function(object, other) {
  4639. return compareMultiple(object, other, orders);
  4640. });
  4641. }
  4642. /**
  4643. * The base implementation of `_.pick` without support for individual
  4644. * property identifiers.
  4645. *
  4646. * @private
  4647. * @param {Object} object The source object.
  4648. * @param {string[]} paths The property paths to pick.
  4649. * @returns {Object} Returns the new object.
  4650. */
  4651. function basePick(object, paths) {
  4652. return basePickBy(object, paths, function(value, path) {
  4653. return hasIn(object, path);
  4654. });
  4655. }
  4656. /**
  4657. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4658. *
  4659. * @private
  4660. * @param {Object} object The source object.
  4661. * @param {string[]} paths The property paths to pick.
  4662. * @param {Function} predicate The function invoked per property.
  4663. * @returns {Object} Returns the new object.
  4664. */
  4665. function basePickBy(object, paths, predicate) {
  4666. var index = -1,
  4667. length = paths.length,
  4668. result = {};
  4669. while (++index < length) {
  4670. var path = paths[index],
  4671. value = baseGet(object, path);
  4672. if (predicate(value, path)) {
  4673. baseSet(result, castPath(path, object), value);
  4674. }
  4675. }
  4676. return result;
  4677. }
  4678. /**
  4679. * A specialized version of `baseProperty` which supports deep paths.
  4680. *
  4681. * @private
  4682. * @param {Array|string} path The path of the property to get.
  4683. * @returns {Function} Returns the new accessor function.
  4684. */
  4685. function basePropertyDeep(path) {
  4686. return function(object) {
  4687. return baseGet(object, path);
  4688. };
  4689. }
  4690. /**
  4691. * The base implementation of `_.pullAllBy` without support for iteratee
  4692. * shorthands.
  4693. *
  4694. * @private
  4695. * @param {Array} array The array to modify.
  4696. * @param {Array} values The values to remove.
  4697. * @param {Function} [iteratee] The iteratee invoked per element.
  4698. * @param {Function} [comparator] The comparator invoked per element.
  4699. * @returns {Array} Returns `array`.
  4700. */
  4701. function basePullAll(array, values, iteratee, comparator) {
  4702. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4703. index = -1,
  4704. length = values.length,
  4705. seen = array;
  4706. if (array === values) {
  4707. values = copyArray(values);
  4708. }
  4709. if (iteratee) {
  4710. seen = arrayMap(array, baseUnary(iteratee));
  4711. }
  4712. while (++index < length) {
  4713. var fromIndex = 0,
  4714. value = values[index],
  4715. computed = iteratee ? iteratee(value) : value;
  4716. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4717. if (seen !== array) {
  4718. splice.call(seen, fromIndex, 1);
  4719. }
  4720. splice.call(array, fromIndex, 1);
  4721. }
  4722. }
  4723. return array;
  4724. }
  4725. /**
  4726. * The base implementation of `_.pullAt` without support for individual
  4727. * indexes or capturing the removed elements.
  4728. *
  4729. * @private
  4730. * @param {Array} array The array to modify.
  4731. * @param {number[]} indexes The indexes of elements to remove.
  4732. * @returns {Array} Returns `array`.
  4733. */
  4734. function basePullAt(array, indexes) {
  4735. var length = array ? indexes.length : 0,
  4736. lastIndex = length - 1;
  4737. while (length--) {
  4738. var index = indexes[length];
  4739. if (length == lastIndex || index !== previous) {
  4740. var previous = index;
  4741. if (isIndex(index)) {
  4742. splice.call(array, index, 1);
  4743. } else {
  4744. baseUnset(array, index);
  4745. }
  4746. }
  4747. }
  4748. return array;
  4749. }
  4750. /**
  4751. * The base implementation of `_.random` without support for returning
  4752. * floating-point numbers.
  4753. *
  4754. * @private
  4755. * @param {number} lower The lower bound.
  4756. * @param {number} upper The upper bound.
  4757. * @returns {number} Returns the random number.
  4758. */
  4759. function baseRandom(lower, upper) {
  4760. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4761. }
  4762. /**
  4763. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4764. * coerce arguments.
  4765. *
  4766. * @private
  4767. * @param {number} start The start of the range.
  4768. * @param {number} end The end of the range.
  4769. * @param {number} step The value to increment or decrement by.
  4770. * @param {boolean} [fromRight] Specify iterating from right to left.
  4771. * @returns {Array} Returns the range of numbers.
  4772. */
  4773. function baseRange(start, end, step, fromRight) {
  4774. var index = -1,
  4775. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4776. result = Array(length);
  4777. while (length--) {
  4778. result[fromRight ? length : ++index] = start;
  4779. start += step;
  4780. }
  4781. return result;
  4782. }
  4783. /**
  4784. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4785. *
  4786. * @private
  4787. * @param {string} string The string to repeat.
  4788. * @param {number} n The number of times to repeat the string.
  4789. * @returns {string} Returns the repeated string.
  4790. */
  4791. function baseRepeat(string, n) {
  4792. var result = '';
  4793. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4794. return result;
  4795. }
  4796. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4797. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4798. do {
  4799. if (n % 2) {
  4800. result += string;
  4801. }
  4802. n = nativeFloor(n / 2);
  4803. if (n) {
  4804. string += string;
  4805. }
  4806. } while (n);
  4807. return result;
  4808. }
  4809. /**
  4810. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4811. *
  4812. * @private
  4813. * @param {Function} func The function to apply a rest parameter to.
  4814. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4815. * @returns {Function} Returns the new function.
  4816. */
  4817. function baseRest(func, start) {
  4818. return setToString(overRest(func, start, identity), func + '');
  4819. }
  4820. /**
  4821. * The base implementation of `_.sample`.
  4822. *
  4823. * @private
  4824. * @param {Array|Object} collection The collection to sample.
  4825. * @returns {*} Returns the random element.
  4826. */
  4827. function baseSample(collection) {
  4828. return arraySample(values(collection));
  4829. }
  4830. /**
  4831. * The base implementation of `_.sampleSize` without param guards.
  4832. *
  4833. * @private
  4834. * @param {Array|Object} collection The collection to sample.
  4835. * @param {number} n The number of elements to sample.
  4836. * @returns {Array} Returns the random elements.
  4837. */
  4838. function baseSampleSize(collection, n) {
  4839. var array = values(collection);
  4840. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4841. }
  4842. /**
  4843. * The base implementation of `_.set`.
  4844. *
  4845. * @private
  4846. * @param {Object} object The object to modify.
  4847. * @param {Array|string} path The path of the property to set.
  4848. * @param {*} value The value to set.
  4849. * @param {Function} [customizer] The function to customize path creation.
  4850. * @returns {Object} Returns `object`.
  4851. */
  4852. function baseSet(object, path, value, customizer) {
  4853. if (!isObject(object)) {
  4854. return object;
  4855. }
  4856. path = castPath(path, object);
  4857. var index = -1,
  4858. length = path.length,
  4859. lastIndex = length - 1,
  4860. nested = object;
  4861. while (nested != null && ++index < length) {
  4862. var key = toKey(path[index]),
  4863. newValue = value;
  4864. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4865. return object;
  4866. }
  4867. if (index != lastIndex) {
  4868. var objValue = nested[key];
  4869. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4870. if (newValue === undefined) {
  4871. newValue = isObject(objValue)
  4872. ? objValue
  4873. : (isIndex(path[index + 1]) ? [] : {});
  4874. }
  4875. }
  4876. assignValue(nested, key, newValue);
  4877. nested = nested[key];
  4878. }
  4879. return object;
  4880. }
  4881. /**
  4882. * The base implementation of `setData` without support for hot loop shorting.
  4883. *
  4884. * @private
  4885. * @param {Function} func The function to associate metadata with.
  4886. * @param {*} data The metadata.
  4887. * @returns {Function} Returns `func`.
  4888. */
  4889. var baseSetData = !metaMap ? identity : function(func, data) {
  4890. metaMap.set(func, data);
  4891. return func;
  4892. };
  4893. /**
  4894. * The base implementation of `setToString` without support for hot loop shorting.
  4895. *
  4896. * @private
  4897. * @param {Function} func The function to modify.
  4898. * @param {Function} string The `toString` result.
  4899. * @returns {Function} Returns `func`.
  4900. */
  4901. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4902. return defineProperty(func, 'toString', {
  4903. 'configurable': true,
  4904. 'enumerable': false,
  4905. 'value': constant(string),
  4906. 'writable': true
  4907. });
  4908. };
  4909. /**
  4910. * The base implementation of `_.shuffle`.
  4911. *
  4912. * @private
  4913. * @param {Array|Object} collection The collection to shuffle.
  4914. * @returns {Array} Returns the new shuffled array.
  4915. */
  4916. function baseShuffle(collection) {
  4917. return shuffleSelf(values(collection));
  4918. }
  4919. /**
  4920. * The base implementation of `_.slice` without an iteratee call guard.
  4921. *
  4922. * @private
  4923. * @param {Array} array The array to slice.
  4924. * @param {number} [start=0] The start position.
  4925. * @param {number} [end=array.length] The end position.
  4926. * @returns {Array} Returns the slice of `array`.
  4927. */
  4928. function baseSlice(array, start, end) {
  4929. var index = -1,
  4930. length = array.length;
  4931. if (start < 0) {
  4932. start = -start > length ? 0 : (length + start);
  4933. }
  4934. end = end > length ? length : end;
  4935. if (end < 0) {
  4936. end += length;
  4937. }
  4938. length = start > end ? 0 : ((end - start) >>> 0);
  4939. start >>>= 0;
  4940. var result = Array(length);
  4941. while (++index < length) {
  4942. result[index] = array[index + start];
  4943. }
  4944. return result;
  4945. }
  4946. /**
  4947. * The base implementation of `_.some` without support for iteratee shorthands.
  4948. *
  4949. * @private
  4950. * @param {Array|Object} collection The collection to iterate over.
  4951. * @param {Function} predicate The function invoked per iteration.
  4952. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4953. * else `false`.
  4954. */
  4955. function baseSome(collection, predicate) {
  4956. var result;
  4957. baseEach(collection, function(value, index, collection) {
  4958. result = predicate(value, index, collection);
  4959. return !result;
  4960. });
  4961. return !!result;
  4962. }
  4963. /**
  4964. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4965. * performs a binary search of `array` to determine the index at which `value`
  4966. * should be inserted into `array` in order to maintain its sort order.
  4967. *
  4968. * @private
  4969. * @param {Array} array The sorted array to inspect.
  4970. * @param {*} value The value to evaluate.
  4971. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4972. * @returns {number} Returns the index at which `value` should be inserted
  4973. * into `array`.
  4974. */
  4975. function baseSortedIndex(array, value, retHighest) {
  4976. var low = 0,
  4977. high = array == null ? low : array.length;
  4978. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4979. while (low < high) {
  4980. var mid = (low + high) >>> 1,
  4981. computed = array[mid];
  4982. if (computed !== null && !isSymbol(computed) &&
  4983. (retHighest ? (computed <= value) : (computed < value))) {
  4984. low = mid + 1;
  4985. } else {
  4986. high = mid;
  4987. }
  4988. }
  4989. return high;
  4990. }
  4991. return baseSortedIndexBy(array, value, identity, retHighest);
  4992. }
  4993. /**
  4994. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4995. * which invokes `iteratee` for `value` and each element of `array` to compute
  4996. * their sort ranking. The iteratee is invoked with one argument; (value).
  4997. *
  4998. * @private
  4999. * @param {Array} array The sorted array to inspect.
  5000. * @param {*} value The value to evaluate.
  5001. * @param {Function} iteratee The iteratee invoked per element.
  5002. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5003. * @returns {number} Returns the index at which `value` should be inserted
  5004. * into `array`.
  5005. */
  5006. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5007. var low = 0,
  5008. high = array == null ? 0 : array.length;
  5009. if (high === 0) {
  5010. return 0;
  5011. }
  5012. value = iteratee(value);
  5013. var valIsNaN = value !== value,
  5014. valIsNull = value === null,
  5015. valIsSymbol = isSymbol(value),
  5016. valIsUndefined = value === undefined;
  5017. while (low < high) {
  5018. var mid = nativeFloor((low + high) / 2),
  5019. computed = iteratee(array[mid]),
  5020. othIsDefined = computed !== undefined,
  5021. othIsNull = computed === null,
  5022. othIsReflexive = computed === computed,
  5023. othIsSymbol = isSymbol(computed);
  5024. if (valIsNaN) {
  5025. var setLow = retHighest || othIsReflexive;
  5026. } else if (valIsUndefined) {
  5027. setLow = othIsReflexive && (retHighest || othIsDefined);
  5028. } else if (valIsNull) {
  5029. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5030. } else if (valIsSymbol) {
  5031. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5032. } else if (othIsNull || othIsSymbol) {
  5033. setLow = false;
  5034. } else {
  5035. setLow = retHighest ? (computed <= value) : (computed < value);
  5036. }
  5037. if (setLow) {
  5038. low = mid + 1;
  5039. } else {
  5040. high = mid;
  5041. }
  5042. }
  5043. return nativeMin(high, MAX_ARRAY_INDEX);
  5044. }
  5045. /**
  5046. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5047. * support for iteratee shorthands.
  5048. *
  5049. * @private
  5050. * @param {Array} array The array to inspect.
  5051. * @param {Function} [iteratee] The iteratee invoked per element.
  5052. * @returns {Array} Returns the new duplicate free array.
  5053. */
  5054. function baseSortedUniq(array, iteratee) {
  5055. var index = -1,
  5056. length = array.length,
  5057. resIndex = 0,
  5058. result = [];
  5059. while (++index < length) {
  5060. var value = array[index],
  5061. computed = iteratee ? iteratee(value) : value;
  5062. if (!index || !eq(computed, seen)) {
  5063. var seen = computed;
  5064. result[resIndex++] = value === 0 ? 0 : value;
  5065. }
  5066. }
  5067. return result;
  5068. }
  5069. /**
  5070. * The base implementation of `_.toNumber` which doesn't ensure correct
  5071. * conversions of binary, hexadecimal, or octal string values.
  5072. *
  5073. * @private
  5074. * @param {*} value The value to process.
  5075. * @returns {number} Returns the number.
  5076. */
  5077. function baseToNumber(value) {
  5078. if (typeof value == 'number') {
  5079. return value;
  5080. }
  5081. if (isSymbol(value)) {
  5082. return NAN;
  5083. }
  5084. return +value;
  5085. }
  5086. /**
  5087. * The base implementation of `_.toString` which doesn't convert nullish
  5088. * values to empty strings.
  5089. *
  5090. * @private
  5091. * @param {*} value The value to process.
  5092. * @returns {string} Returns the string.
  5093. */
  5094. function baseToString(value) {
  5095. // Exit early for strings to avoid a performance hit in some environments.
  5096. if (typeof value == 'string') {
  5097. return value;
  5098. }
  5099. if (isArray(value)) {
  5100. // Recursively convert values (susceptible to call stack limits).
  5101. return arrayMap(value, baseToString) + '';
  5102. }
  5103. if (isSymbol(value)) {
  5104. return symbolToString ? symbolToString.call(value) : '';
  5105. }
  5106. var result = (value + '');
  5107. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5108. }
  5109. /**
  5110. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5111. *
  5112. * @private
  5113. * @param {Array} array The array to inspect.
  5114. * @param {Function} [iteratee] The iteratee invoked per element.
  5115. * @param {Function} [comparator] The comparator invoked per element.
  5116. * @returns {Array} Returns the new duplicate free array.
  5117. */
  5118. function baseUniq(array, iteratee, comparator) {
  5119. var index = -1,
  5120. includes = arrayIncludes,
  5121. length = array.length,
  5122. isCommon = true,
  5123. result = [],
  5124. seen = result;
  5125. if (comparator) {
  5126. isCommon = false;
  5127. includes = arrayIncludesWith;
  5128. }
  5129. else if (length >= LARGE_ARRAY_SIZE) {
  5130. var set = iteratee ? null : createSet(array);
  5131. if (set) {
  5132. return setToArray(set);
  5133. }
  5134. isCommon = false;
  5135. includes = cacheHas;
  5136. seen = new SetCache;
  5137. }
  5138. else {
  5139. seen = iteratee ? [] : result;
  5140. }
  5141. outer:
  5142. while (++index < length) {
  5143. var value = array[index],
  5144. computed = iteratee ? iteratee(value) : value;
  5145. value = (comparator || value !== 0) ? value : 0;
  5146. if (isCommon && computed === computed) {
  5147. var seenIndex = seen.length;
  5148. while (seenIndex--) {
  5149. if (seen[seenIndex] === computed) {
  5150. continue outer;
  5151. }
  5152. }
  5153. if (iteratee) {
  5154. seen.push(computed);
  5155. }
  5156. result.push(value);
  5157. }
  5158. else if (!includes(seen, computed, comparator)) {
  5159. if (seen !== result) {
  5160. seen.push(computed);
  5161. }
  5162. result.push(value);
  5163. }
  5164. }
  5165. return result;
  5166. }
  5167. /**
  5168. * The base implementation of `_.unset`.
  5169. *
  5170. * @private
  5171. * @param {Object} object The object to modify.
  5172. * @param {Array|string} path The property path to unset.
  5173. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5174. */
  5175. function baseUnset(object, path) {
  5176. path = castPath(path, object);
  5177. object = parent(object, path);
  5178. return object == null || delete object[toKey(last(path))];
  5179. }
  5180. /**
  5181. * The base implementation of `_.update`.
  5182. *
  5183. * @private
  5184. * @param {Object} object The object to modify.
  5185. * @param {Array|string} path The path of the property to update.
  5186. * @param {Function} updater The function to produce the updated value.
  5187. * @param {Function} [customizer] The function to customize path creation.
  5188. * @returns {Object} Returns `object`.
  5189. */
  5190. function baseUpdate(object, path, updater, customizer) {
  5191. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5192. }
  5193. /**
  5194. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5195. * without support for iteratee shorthands.
  5196. *
  5197. * @private
  5198. * @param {Array} array The array to query.
  5199. * @param {Function} predicate The function invoked per iteration.
  5200. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5201. * @param {boolean} [fromRight] Specify iterating from right to left.
  5202. * @returns {Array} Returns the slice of `array`.
  5203. */
  5204. function baseWhile(array, predicate, isDrop, fromRight) {
  5205. var length = array.length,
  5206. index = fromRight ? length : -1;
  5207. while ((fromRight ? index-- : ++index < length) &&
  5208. predicate(array[index], index, array)) {}
  5209. return isDrop
  5210. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5211. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5212. }
  5213. /**
  5214. * The base implementation of `wrapperValue` which returns the result of
  5215. * performing a sequence of actions on the unwrapped `value`, where each
  5216. * successive action is supplied the return value of the previous.
  5217. *
  5218. * @private
  5219. * @param {*} value The unwrapped value.
  5220. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5221. * @returns {*} Returns the resolved value.
  5222. */
  5223. function baseWrapperValue(value, actions) {
  5224. var result = value;
  5225. if (result instanceof LazyWrapper) {
  5226. result = result.value();
  5227. }
  5228. return arrayReduce(actions, function(result, action) {
  5229. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5230. }, result);
  5231. }
  5232. /**
  5233. * The base implementation of methods like `_.xor`, without support for
  5234. * iteratee shorthands, that accepts an array of arrays to inspect.
  5235. *
  5236. * @private
  5237. * @param {Array} arrays The arrays to inspect.
  5238. * @param {Function} [iteratee] The iteratee invoked per element.
  5239. * @param {Function} [comparator] The comparator invoked per element.
  5240. * @returns {Array} Returns the new array of values.
  5241. */
  5242. function baseXor(arrays, iteratee, comparator) {
  5243. var length = arrays.length;
  5244. if (length < 2) {
  5245. return length ? baseUniq(arrays[0]) : [];
  5246. }
  5247. var index = -1,
  5248. result = Array(length);
  5249. while (++index < length) {
  5250. var array = arrays[index],
  5251. othIndex = -1;
  5252. while (++othIndex < length) {
  5253. if (othIndex != index) {
  5254. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5255. }
  5256. }
  5257. }
  5258. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5259. }
  5260. /**
  5261. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5262. *
  5263. * @private
  5264. * @param {Array} props The property identifiers.
  5265. * @param {Array} values The property values.
  5266. * @param {Function} assignFunc The function to assign values.
  5267. * @returns {Object} Returns the new object.
  5268. */
  5269. function baseZipObject(props, values, assignFunc) {
  5270. var index = -1,
  5271. length = props.length,
  5272. valsLength = values.length,
  5273. result = {};
  5274. while (++index < length) {
  5275. var value = index < valsLength ? values[index] : undefined;
  5276. assignFunc(result, props[index], value);
  5277. }
  5278. return result;
  5279. }
  5280. /**
  5281. * Casts `value` to an empty array if it's not an array like object.
  5282. *
  5283. * @private
  5284. * @param {*} value The value to inspect.
  5285. * @returns {Array|Object} Returns the cast array-like object.
  5286. */
  5287. function castArrayLikeObject(value) {
  5288. return isArrayLikeObject(value) ? value : [];
  5289. }
  5290. /**
  5291. * Casts `value` to `identity` if it's not a function.
  5292. *
  5293. * @private
  5294. * @param {*} value The value to inspect.
  5295. * @returns {Function} Returns cast function.
  5296. */
  5297. function castFunction(value) {
  5298. return typeof value == 'function' ? value : identity;
  5299. }
  5300. /**
  5301. * Casts `value` to a path array if it's not one.
  5302. *
  5303. * @private
  5304. * @param {*} value The value to inspect.
  5305. * @param {Object} [object] The object to query keys on.
  5306. * @returns {Array} Returns the cast property path array.
  5307. */
  5308. function castPath(value, object) {
  5309. if (isArray(value)) {
  5310. return value;
  5311. }
  5312. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5313. }
  5314. /**
  5315. * A `baseRest` alias which can be replaced with `identity` by module
  5316. * replacement plugins.
  5317. *
  5318. * @private
  5319. * @type {Function}
  5320. * @param {Function} func The function to apply a rest parameter to.
  5321. * @returns {Function} Returns the new function.
  5322. */
  5323. var castRest = baseRest;
  5324. /**
  5325. * Casts `array` to a slice if it's needed.
  5326. *
  5327. * @private
  5328. * @param {Array} array The array to inspect.
  5329. * @param {number} start The start position.
  5330. * @param {number} [end=array.length] The end position.
  5331. * @returns {Array} Returns the cast slice.
  5332. */
  5333. function castSlice(array, start, end) {
  5334. var length = array.length;
  5335. end = end === undefined ? length : end;
  5336. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5337. }
  5338. /**
  5339. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5340. *
  5341. * @private
  5342. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5343. */
  5344. var clearTimeout = ctxClearTimeout || function(id) {
  5345. return root.clearTimeout(id);
  5346. };
  5347. /**
  5348. * Creates a clone of `buffer`.
  5349. *
  5350. * @private
  5351. * @param {Buffer} buffer The buffer to clone.
  5352. * @param {boolean} [isDeep] Specify a deep clone.
  5353. * @returns {Buffer} Returns the cloned buffer.
  5354. */
  5355. function cloneBuffer(buffer, isDeep) {
  5356. if (isDeep) {
  5357. return buffer.slice();
  5358. }
  5359. var length = buffer.length,
  5360. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5361. buffer.copy(result);
  5362. return result;
  5363. }
  5364. /**
  5365. * Creates a clone of `arrayBuffer`.
  5366. *
  5367. * @private
  5368. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5369. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5370. */
  5371. function cloneArrayBuffer(arrayBuffer) {
  5372. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5373. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5374. return result;
  5375. }
  5376. /**
  5377. * Creates a clone of `dataView`.
  5378. *
  5379. * @private
  5380. * @param {Object} dataView The data view to clone.
  5381. * @param {boolean} [isDeep] Specify a deep clone.
  5382. * @returns {Object} Returns the cloned data view.
  5383. */
  5384. function cloneDataView(dataView, isDeep) {
  5385. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5386. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5387. }
  5388. /**
  5389. * Creates a clone of `regexp`.
  5390. *
  5391. * @private
  5392. * @param {Object} regexp The regexp to clone.
  5393. * @returns {Object} Returns the cloned regexp.
  5394. */
  5395. function cloneRegExp(regexp) {
  5396. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5397. result.lastIndex = regexp.lastIndex;
  5398. return result;
  5399. }
  5400. /**
  5401. * Creates a clone of the `symbol` object.
  5402. *
  5403. * @private
  5404. * @param {Object} symbol The symbol object to clone.
  5405. * @returns {Object} Returns the cloned symbol object.
  5406. */
  5407. function cloneSymbol(symbol) {
  5408. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5409. }
  5410. /**
  5411. * Creates a clone of `typedArray`.
  5412. *
  5413. * @private
  5414. * @param {Object} typedArray The typed array to clone.
  5415. * @param {boolean} [isDeep] Specify a deep clone.
  5416. * @returns {Object} Returns the cloned typed array.
  5417. */
  5418. function cloneTypedArray(typedArray, isDeep) {
  5419. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5420. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5421. }
  5422. /**
  5423. * Compares values to sort them in ascending order.
  5424. *
  5425. * @private
  5426. * @param {*} value The value to compare.
  5427. * @param {*} other The other value to compare.
  5428. * @returns {number} Returns the sort order indicator for `value`.
  5429. */
  5430. function compareAscending(value, other) {
  5431. if (value !== other) {
  5432. var valIsDefined = value !== undefined,
  5433. valIsNull = value === null,
  5434. valIsReflexive = value === value,
  5435. valIsSymbol = isSymbol(value);
  5436. var othIsDefined = other !== undefined,
  5437. othIsNull = other === null,
  5438. othIsReflexive = other === other,
  5439. othIsSymbol = isSymbol(other);
  5440. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5441. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5442. (valIsNull && othIsDefined && othIsReflexive) ||
  5443. (!valIsDefined && othIsReflexive) ||
  5444. !valIsReflexive) {
  5445. return 1;
  5446. }
  5447. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5448. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5449. (othIsNull && valIsDefined && valIsReflexive) ||
  5450. (!othIsDefined && valIsReflexive) ||
  5451. !othIsReflexive) {
  5452. return -1;
  5453. }
  5454. }
  5455. return 0;
  5456. }
  5457. /**
  5458. * Used by `_.orderBy` to compare multiple properties of a value to another
  5459. * and stable sort them.
  5460. *
  5461. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5462. * specify an order of "desc" for descending or "asc" for ascending sort order
  5463. * of corresponding values.
  5464. *
  5465. * @private
  5466. * @param {Object} object The object to compare.
  5467. * @param {Object} other The other object to compare.
  5468. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5469. * @returns {number} Returns the sort order indicator for `object`.
  5470. */
  5471. function compareMultiple(object, other, orders) {
  5472. var index = -1,
  5473. objCriteria = object.criteria,
  5474. othCriteria = other.criteria,
  5475. length = objCriteria.length,
  5476. ordersLength = orders.length;
  5477. while (++index < length) {
  5478. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5479. if (result) {
  5480. if (index >= ordersLength) {
  5481. return result;
  5482. }
  5483. var order = orders[index];
  5484. return result * (order == 'desc' ? -1 : 1);
  5485. }
  5486. }
  5487. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5488. // that causes it, under certain circumstances, to provide the same value for
  5489. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5490. // for more details.
  5491. //
  5492. // This also ensures a stable sort in V8 and other engines.
  5493. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5494. return object.index - other.index;
  5495. }
  5496. /**
  5497. * Creates an array that is the composition of partially applied arguments,
  5498. * placeholders, and provided arguments into a single array of arguments.
  5499. *
  5500. * @private
  5501. * @param {Array} args The provided arguments.
  5502. * @param {Array} partials The arguments to prepend to those provided.
  5503. * @param {Array} holders The `partials` placeholder indexes.
  5504. * @params {boolean} [isCurried] Specify composing for a curried function.
  5505. * @returns {Array} Returns the new array of composed arguments.
  5506. */
  5507. function composeArgs(args, partials, holders, isCurried) {
  5508. var argsIndex = -1,
  5509. argsLength = args.length,
  5510. holdersLength = holders.length,
  5511. leftIndex = -1,
  5512. leftLength = partials.length,
  5513. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5514. result = Array(leftLength + rangeLength),
  5515. isUncurried = !isCurried;
  5516. while (++leftIndex < leftLength) {
  5517. result[leftIndex] = partials[leftIndex];
  5518. }
  5519. while (++argsIndex < holdersLength) {
  5520. if (isUncurried || argsIndex < argsLength) {
  5521. result[holders[argsIndex]] = args[argsIndex];
  5522. }
  5523. }
  5524. while (rangeLength--) {
  5525. result[leftIndex++] = args[argsIndex++];
  5526. }
  5527. return result;
  5528. }
  5529. /**
  5530. * This function is like `composeArgs` except that the arguments composition
  5531. * is tailored for `_.partialRight`.
  5532. *
  5533. * @private
  5534. * @param {Array} args The provided arguments.
  5535. * @param {Array} partials The arguments to append to those provided.
  5536. * @param {Array} holders The `partials` placeholder indexes.
  5537. * @params {boolean} [isCurried] Specify composing for a curried function.
  5538. * @returns {Array} Returns the new array of composed arguments.
  5539. */
  5540. function composeArgsRight(args, partials, holders, isCurried) {
  5541. var argsIndex = -1,
  5542. argsLength = args.length,
  5543. holdersIndex = -1,
  5544. holdersLength = holders.length,
  5545. rightIndex = -1,
  5546. rightLength = partials.length,
  5547. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5548. result = Array(rangeLength + rightLength),
  5549. isUncurried = !isCurried;
  5550. while (++argsIndex < rangeLength) {
  5551. result[argsIndex] = args[argsIndex];
  5552. }
  5553. var offset = argsIndex;
  5554. while (++rightIndex < rightLength) {
  5555. result[offset + rightIndex] = partials[rightIndex];
  5556. }
  5557. while (++holdersIndex < holdersLength) {
  5558. if (isUncurried || argsIndex < argsLength) {
  5559. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5560. }
  5561. }
  5562. return result;
  5563. }
  5564. /**
  5565. * Copies the values of `source` to `array`.
  5566. *
  5567. * @private
  5568. * @param {Array} source The array to copy values from.
  5569. * @param {Array} [array=[]] The array to copy values to.
  5570. * @returns {Array} Returns `array`.
  5571. */
  5572. function copyArray(source, array) {
  5573. var index = -1,
  5574. length = source.length;
  5575. array || (array = Array(length));
  5576. while (++index < length) {
  5577. array[index] = source[index];
  5578. }
  5579. return array;
  5580. }
  5581. /**
  5582. * Copies properties of `source` to `object`.
  5583. *
  5584. * @private
  5585. * @param {Object} source The object to copy properties from.
  5586. * @param {Array} props The property identifiers to copy.
  5587. * @param {Object} [object={}] The object to copy properties to.
  5588. * @param {Function} [customizer] The function to customize copied values.
  5589. * @returns {Object} Returns `object`.
  5590. */
  5591. function copyObject(source, props, object, customizer) {
  5592. var isNew = !object;
  5593. object || (object = {});
  5594. var index = -1,
  5595. length = props.length;
  5596. while (++index < length) {
  5597. var key = props[index];
  5598. var newValue = customizer
  5599. ? customizer(object[key], source[key], key, object, source)
  5600. : undefined;
  5601. if (newValue === undefined) {
  5602. newValue = source[key];
  5603. }
  5604. if (isNew) {
  5605. baseAssignValue(object, key, newValue);
  5606. } else {
  5607. assignValue(object, key, newValue);
  5608. }
  5609. }
  5610. return object;
  5611. }
  5612. /**
  5613. * Copies own symbols of `source` to `object`.
  5614. *
  5615. * @private
  5616. * @param {Object} source The object to copy symbols from.
  5617. * @param {Object} [object={}] The object to copy symbols to.
  5618. * @returns {Object} Returns `object`.
  5619. */
  5620. function copySymbols(source, object) {
  5621. return copyObject(source, getSymbols(source), object);
  5622. }
  5623. /**
  5624. * Copies own and inherited symbols of `source` to `object`.
  5625. *
  5626. * @private
  5627. * @param {Object} source The object to copy symbols from.
  5628. * @param {Object} [object={}] The object to copy symbols to.
  5629. * @returns {Object} Returns `object`.
  5630. */
  5631. function copySymbolsIn(source, object) {
  5632. return copyObject(source, getSymbolsIn(source), object);
  5633. }
  5634. /**
  5635. * Creates a function like `_.groupBy`.
  5636. *
  5637. * @private
  5638. * @param {Function} setter The function to set accumulator values.
  5639. * @param {Function} [initializer] The accumulator object initializer.
  5640. * @returns {Function} Returns the new aggregator function.
  5641. */
  5642. function createAggregator(setter, initializer) {
  5643. return function(collection, iteratee) {
  5644. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5645. accumulator = initializer ? initializer() : {};
  5646. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5647. };
  5648. }
  5649. /**
  5650. * Creates a function like `_.assign`.
  5651. *
  5652. * @private
  5653. * @param {Function} assigner The function to assign values.
  5654. * @returns {Function} Returns the new assigner function.
  5655. */
  5656. function createAssigner(assigner) {
  5657. return baseRest(function(object, sources) {
  5658. var index = -1,
  5659. length = sources.length,
  5660. customizer = length > 1 ? sources[length - 1] : undefined,
  5661. guard = length > 2 ? sources[2] : undefined;
  5662. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5663. ? (length--, customizer)
  5664. : undefined;
  5665. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5666. customizer = length < 3 ? undefined : customizer;
  5667. length = 1;
  5668. }
  5669. object = Object(object);
  5670. while (++index < length) {
  5671. var source = sources[index];
  5672. if (source) {
  5673. assigner(object, source, index, customizer);
  5674. }
  5675. }
  5676. return object;
  5677. });
  5678. }
  5679. /**
  5680. * Creates a `baseEach` or `baseEachRight` function.
  5681. *
  5682. * @private
  5683. * @param {Function} eachFunc The function to iterate over a collection.
  5684. * @param {boolean} [fromRight] Specify iterating from right to left.
  5685. * @returns {Function} Returns the new base function.
  5686. */
  5687. function createBaseEach(eachFunc, fromRight) {
  5688. return function(collection, iteratee) {
  5689. if (collection == null) {
  5690. return collection;
  5691. }
  5692. if (!isArrayLike(collection)) {
  5693. return eachFunc(collection, iteratee);
  5694. }
  5695. var length = collection.length,
  5696. index = fromRight ? length : -1,
  5697. iterable = Object(collection);
  5698. while ((fromRight ? index-- : ++index < length)) {
  5699. if (iteratee(iterable[index], index, iterable) === false) {
  5700. break;
  5701. }
  5702. }
  5703. return collection;
  5704. };
  5705. }
  5706. /**
  5707. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5708. *
  5709. * @private
  5710. * @param {boolean} [fromRight] Specify iterating from right to left.
  5711. * @returns {Function} Returns the new base function.
  5712. */
  5713. function createBaseFor(fromRight) {
  5714. return function(object, iteratee, keysFunc) {
  5715. var index = -1,
  5716. iterable = Object(object),
  5717. props = keysFunc(object),
  5718. length = props.length;
  5719. while (length--) {
  5720. var key = props[fromRight ? length : ++index];
  5721. if (iteratee(iterable[key], key, iterable) === false) {
  5722. break;
  5723. }
  5724. }
  5725. return object;
  5726. };
  5727. }
  5728. /**
  5729. * Creates a function that wraps `func` to invoke it with the optional `this`
  5730. * binding of `thisArg`.
  5731. *
  5732. * @private
  5733. * @param {Function} func The function to wrap.
  5734. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5735. * @param {*} [thisArg] The `this` binding of `func`.
  5736. * @returns {Function} Returns the new wrapped function.
  5737. */
  5738. function createBind(func, bitmask, thisArg) {
  5739. var isBind = bitmask & WRAP_BIND_FLAG,
  5740. Ctor = createCtor(func);
  5741. function wrapper() {
  5742. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5743. return fn.apply(isBind ? thisArg : this, arguments);
  5744. }
  5745. return wrapper;
  5746. }
  5747. /**
  5748. * Creates a function like `_.lowerFirst`.
  5749. *
  5750. * @private
  5751. * @param {string} methodName The name of the `String` case method to use.
  5752. * @returns {Function} Returns the new case function.
  5753. */
  5754. function createCaseFirst(methodName) {
  5755. return function(string) {
  5756. string = toString(string);
  5757. var strSymbols = hasUnicode(string)
  5758. ? stringToArray(string)
  5759. : undefined;
  5760. var chr = strSymbols
  5761. ? strSymbols[0]
  5762. : string.charAt(0);
  5763. var trailing = strSymbols
  5764. ? castSlice(strSymbols, 1).join('')
  5765. : string.slice(1);
  5766. return chr[methodName]() + trailing;
  5767. };
  5768. }
  5769. /**
  5770. * Creates a function like `_.camelCase`.
  5771. *
  5772. * @private
  5773. * @param {Function} callback The function to combine each word.
  5774. * @returns {Function} Returns the new compounder function.
  5775. */
  5776. function createCompounder(callback) {
  5777. return function(string) {
  5778. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5779. };
  5780. }
  5781. /**
  5782. * Creates a function that produces an instance of `Ctor` regardless of
  5783. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5784. *
  5785. * @private
  5786. * @param {Function} Ctor The constructor to wrap.
  5787. * @returns {Function} Returns the new wrapped function.
  5788. */
  5789. function createCtor(Ctor) {
  5790. return function() {
  5791. // Use a `switch` statement to work with class constructors. See
  5792. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5793. // for more details.
  5794. var args = arguments;
  5795. switch (args.length) {
  5796. case 0: return new Ctor;
  5797. case 1: return new Ctor(args[0]);
  5798. case 2: return new Ctor(args[0], args[1]);
  5799. case 3: return new Ctor(args[0], args[1], args[2]);
  5800. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5801. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5802. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5803. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5804. }
  5805. var thisBinding = baseCreate(Ctor.prototype),
  5806. result = Ctor.apply(thisBinding, args);
  5807. // Mimic the constructor's `return` behavior.
  5808. // See https://es5.github.io/#x13.2.2 for more details.
  5809. return isObject(result) ? result : thisBinding;
  5810. };
  5811. }
  5812. /**
  5813. * Creates a function that wraps `func` to enable currying.
  5814. *
  5815. * @private
  5816. * @param {Function} func The function to wrap.
  5817. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5818. * @param {number} arity The arity of `func`.
  5819. * @returns {Function} Returns the new wrapped function.
  5820. */
  5821. function createCurry(func, bitmask, arity) {
  5822. var Ctor = createCtor(func);
  5823. function wrapper() {
  5824. var length = arguments.length,
  5825. args = Array(length),
  5826. index = length,
  5827. placeholder = getHolder(wrapper);
  5828. while (index--) {
  5829. args[index] = arguments[index];
  5830. }
  5831. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5832. ? []
  5833. : replaceHolders(args, placeholder);
  5834. length -= holders.length;
  5835. if (length < arity) {
  5836. return createRecurry(
  5837. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5838. args, holders, undefined, undefined, arity - length);
  5839. }
  5840. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5841. return apply(fn, this, args);
  5842. }
  5843. return wrapper;
  5844. }
  5845. /**
  5846. * Creates a `_.find` or `_.findLast` function.
  5847. *
  5848. * @private
  5849. * @param {Function} findIndexFunc The function to find the collection index.
  5850. * @returns {Function} Returns the new find function.
  5851. */
  5852. function createFind(findIndexFunc) {
  5853. return function(collection, predicate, fromIndex) {
  5854. var iterable = Object(collection);
  5855. if (!isArrayLike(collection)) {
  5856. var iteratee = getIteratee(predicate, 3);
  5857. collection = keys(collection);
  5858. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5859. }
  5860. var index = findIndexFunc(collection, predicate, fromIndex);
  5861. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5862. };
  5863. }
  5864. /**
  5865. * Creates a `_.flow` or `_.flowRight` function.
  5866. *
  5867. * @private
  5868. * @param {boolean} [fromRight] Specify iterating from right to left.
  5869. * @returns {Function} Returns the new flow function.
  5870. */
  5871. function createFlow(fromRight) {
  5872. return flatRest(function(funcs) {
  5873. var length = funcs.length,
  5874. index = length,
  5875. prereq = LodashWrapper.prototype.thru;
  5876. if (fromRight) {
  5877. funcs.reverse();
  5878. }
  5879. while (index--) {
  5880. var func = funcs[index];
  5881. if (typeof func != 'function') {
  5882. throw new TypeError(FUNC_ERROR_TEXT);
  5883. }
  5884. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5885. var wrapper = new LodashWrapper([], true);
  5886. }
  5887. }
  5888. index = wrapper ? index : length;
  5889. while (++index < length) {
  5890. func = funcs[index];
  5891. var funcName = getFuncName(func),
  5892. data = funcName == 'wrapper' ? getData(func) : undefined;
  5893. if (data && isLaziable(data[0]) &&
  5894. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5895. !data[4].length && data[9] == 1
  5896. ) {
  5897. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5898. } else {
  5899. wrapper = (func.length == 1 && isLaziable(func))
  5900. ? wrapper[funcName]()
  5901. : wrapper.thru(func);
  5902. }
  5903. }
  5904. return function() {
  5905. var args = arguments,
  5906. value = args[0];
  5907. if (wrapper && args.length == 1 && isArray(value)) {
  5908. return wrapper.plant(value).value();
  5909. }
  5910. var index = 0,
  5911. result = length ? funcs[index].apply(this, args) : value;
  5912. while (++index < length) {
  5913. result = funcs[index].call(this, result);
  5914. }
  5915. return result;
  5916. };
  5917. });
  5918. }
  5919. /**
  5920. * Creates a function that wraps `func` to invoke it with optional `this`
  5921. * binding of `thisArg`, partial application, and currying.
  5922. *
  5923. * @private
  5924. * @param {Function|string} func The function or method name to wrap.
  5925. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5926. * @param {*} [thisArg] The `this` binding of `func`.
  5927. * @param {Array} [partials] The arguments to prepend to those provided to
  5928. * the new function.
  5929. * @param {Array} [holders] The `partials` placeholder indexes.
  5930. * @param {Array} [partialsRight] The arguments to append to those provided
  5931. * to the new function.
  5932. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5933. * @param {Array} [argPos] The argument positions of the new function.
  5934. * @param {number} [ary] The arity cap of `func`.
  5935. * @param {number} [arity] The arity of `func`.
  5936. * @returns {Function} Returns the new wrapped function.
  5937. */
  5938. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5939. var isAry = bitmask & WRAP_ARY_FLAG,
  5940. isBind = bitmask & WRAP_BIND_FLAG,
  5941. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5942. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5943. isFlip = bitmask & WRAP_FLIP_FLAG,
  5944. Ctor = isBindKey ? undefined : createCtor(func);
  5945. function wrapper() {
  5946. var length = arguments.length,
  5947. args = Array(length),
  5948. index = length;
  5949. while (index--) {
  5950. args[index] = arguments[index];
  5951. }
  5952. if (isCurried) {
  5953. var placeholder = getHolder(wrapper),
  5954. holdersCount = countHolders(args, placeholder);
  5955. }
  5956. if (partials) {
  5957. args = composeArgs(args, partials, holders, isCurried);
  5958. }
  5959. if (partialsRight) {
  5960. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5961. }
  5962. length -= holdersCount;
  5963. if (isCurried && length < arity) {
  5964. var newHolders = replaceHolders(args, placeholder);
  5965. return createRecurry(
  5966. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5967. args, newHolders, argPos, ary, arity - length
  5968. );
  5969. }
  5970. var thisBinding = isBind ? thisArg : this,
  5971. fn = isBindKey ? thisBinding[func] : func;
  5972. length = args.length;
  5973. if (argPos) {
  5974. args = reorder(args, argPos);
  5975. } else if (isFlip && length > 1) {
  5976. args.reverse();
  5977. }
  5978. if (isAry && ary < length) {
  5979. args.length = ary;
  5980. }
  5981. if (this && this !== root && this instanceof wrapper) {
  5982. fn = Ctor || createCtor(fn);
  5983. }
  5984. return fn.apply(thisBinding, args);
  5985. }
  5986. return wrapper;
  5987. }
  5988. /**
  5989. * Creates a function like `_.invertBy`.
  5990. *
  5991. * @private
  5992. * @param {Function} setter The function to set accumulator values.
  5993. * @param {Function} toIteratee The function to resolve iteratees.
  5994. * @returns {Function} Returns the new inverter function.
  5995. */
  5996. function createInverter(setter, toIteratee) {
  5997. return function(object, iteratee) {
  5998. return baseInverter(object, setter, toIteratee(iteratee), {});
  5999. };
  6000. }
  6001. /**
  6002. * Creates a function that performs a mathematical operation on two values.
  6003. *
  6004. * @private
  6005. * @param {Function} operator The function to perform the operation.
  6006. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6007. * @returns {Function} Returns the new mathematical operation function.
  6008. */
  6009. function createMathOperation(operator, defaultValue) {
  6010. return function(value, other) {
  6011. var result;
  6012. if (value === undefined && other === undefined) {
  6013. return defaultValue;
  6014. }
  6015. if (value !== undefined) {
  6016. result = value;
  6017. }
  6018. if (other !== undefined) {
  6019. if (result === undefined) {
  6020. return other;
  6021. }
  6022. if (typeof value == 'string' || typeof other == 'string') {
  6023. value = baseToString(value);
  6024. other = baseToString(other);
  6025. } else {
  6026. value = baseToNumber(value);
  6027. other = baseToNumber(other);
  6028. }
  6029. result = operator(value, other);
  6030. }
  6031. return result;
  6032. };
  6033. }
  6034. /**
  6035. * Creates a function like `_.over`.
  6036. *
  6037. * @private
  6038. * @param {Function} arrayFunc The function to iterate over iteratees.
  6039. * @returns {Function} Returns the new over function.
  6040. */
  6041. function createOver(arrayFunc) {
  6042. return flatRest(function(iteratees) {
  6043. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6044. return baseRest(function(args) {
  6045. var thisArg = this;
  6046. return arrayFunc(iteratees, function(iteratee) {
  6047. return apply(iteratee, thisArg, args);
  6048. });
  6049. });
  6050. });
  6051. }
  6052. /**
  6053. * Creates the padding for `string` based on `length`. The `chars` string
  6054. * is truncated if the number of characters exceeds `length`.
  6055. *
  6056. * @private
  6057. * @param {number} length The padding length.
  6058. * @param {string} [chars=' '] The string used as padding.
  6059. * @returns {string} Returns the padding for `string`.
  6060. */
  6061. function createPadding(length, chars) {
  6062. chars = chars === undefined ? ' ' : baseToString(chars);
  6063. var charsLength = chars.length;
  6064. if (charsLength < 2) {
  6065. return charsLength ? baseRepeat(chars, length) : chars;
  6066. }
  6067. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6068. return hasUnicode(chars)
  6069. ? castSlice(stringToArray(result), 0, length).join('')
  6070. : result.slice(0, length);
  6071. }
  6072. /**
  6073. * Creates a function that wraps `func` to invoke it with the `this` binding
  6074. * of `thisArg` and `partials` prepended to the arguments it receives.
  6075. *
  6076. * @private
  6077. * @param {Function} func The function to wrap.
  6078. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6079. * @param {*} thisArg The `this` binding of `func`.
  6080. * @param {Array} partials The arguments to prepend to those provided to
  6081. * the new function.
  6082. * @returns {Function} Returns the new wrapped function.
  6083. */
  6084. function createPartial(func, bitmask, thisArg, partials) {
  6085. var isBind = bitmask & WRAP_BIND_FLAG,
  6086. Ctor = createCtor(func);
  6087. function wrapper() {
  6088. var argsIndex = -1,
  6089. argsLength = arguments.length,
  6090. leftIndex = -1,
  6091. leftLength = partials.length,
  6092. args = Array(leftLength + argsLength),
  6093. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6094. while (++leftIndex < leftLength) {
  6095. args[leftIndex] = partials[leftIndex];
  6096. }
  6097. while (argsLength--) {
  6098. args[leftIndex++] = arguments[++argsIndex];
  6099. }
  6100. return apply(fn, isBind ? thisArg : this, args);
  6101. }
  6102. return wrapper;
  6103. }
  6104. /**
  6105. * Creates a `_.range` or `_.rangeRight` function.
  6106. *
  6107. * @private
  6108. * @param {boolean} [fromRight] Specify iterating from right to left.
  6109. * @returns {Function} Returns the new range function.
  6110. */
  6111. function createRange(fromRight) {
  6112. return function(start, end, step) {
  6113. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6114. end = step = undefined;
  6115. }
  6116. // Ensure the sign of `-0` is preserved.
  6117. start = toFinite(start);
  6118. if (end === undefined) {
  6119. end = start;
  6120. start = 0;
  6121. } else {
  6122. end = toFinite(end);
  6123. }
  6124. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6125. return baseRange(start, end, step, fromRight);
  6126. };
  6127. }
  6128. /**
  6129. * Creates a function that performs a relational operation on two values.
  6130. *
  6131. * @private
  6132. * @param {Function} operator The function to perform the operation.
  6133. * @returns {Function} Returns the new relational operation function.
  6134. */
  6135. function createRelationalOperation(operator) {
  6136. return function(value, other) {
  6137. if (!(typeof value == 'string' && typeof other == 'string')) {
  6138. value = toNumber(value);
  6139. other = toNumber(other);
  6140. }
  6141. return operator(value, other);
  6142. };
  6143. }
  6144. /**
  6145. * Creates a function that wraps `func` to continue currying.
  6146. *
  6147. * @private
  6148. * @param {Function} func The function to wrap.
  6149. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6150. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6151. * @param {*} placeholder The placeholder value.
  6152. * @param {*} [thisArg] The `this` binding of `func`.
  6153. * @param {Array} [partials] The arguments to prepend to those provided to
  6154. * the new function.
  6155. * @param {Array} [holders] The `partials` placeholder indexes.
  6156. * @param {Array} [argPos] The argument positions of the new function.
  6157. * @param {number} [ary] The arity cap of `func`.
  6158. * @param {number} [arity] The arity of `func`.
  6159. * @returns {Function} Returns the new wrapped function.
  6160. */
  6161. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6162. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6163. newHolders = isCurry ? holders : undefined,
  6164. newHoldersRight = isCurry ? undefined : holders,
  6165. newPartials = isCurry ? partials : undefined,
  6166. newPartialsRight = isCurry ? undefined : partials;
  6167. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6168. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6169. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6170. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6171. }
  6172. var newData = [
  6173. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6174. newHoldersRight, argPos, ary, arity
  6175. ];
  6176. var result = wrapFunc.apply(undefined, newData);
  6177. if (isLaziable(func)) {
  6178. setData(result, newData);
  6179. }
  6180. result.placeholder = placeholder;
  6181. return setWrapToString(result, func, bitmask);
  6182. }
  6183. /**
  6184. * Creates a function like `_.round`.
  6185. *
  6186. * @private
  6187. * @param {string} methodName The name of the `Math` method to use when rounding.
  6188. * @returns {Function} Returns the new round function.
  6189. */
  6190. function createRound(methodName) {
  6191. var func = Math[methodName];
  6192. return function(number, precision) {
  6193. number = toNumber(number);
  6194. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6195. if (precision && nativeIsFinite(number)) {
  6196. // Shift with exponential notation to avoid floating-point issues.
  6197. // See [MDN](https://mdn.io/round#Examples) for more details.
  6198. var pair = (toString(number) + 'e').split('e'),
  6199. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6200. pair = (toString(value) + 'e').split('e');
  6201. return +(pair[0] + 'e' + (+pair[1] - precision));
  6202. }
  6203. return func(number);
  6204. };
  6205. }
  6206. /**
  6207. * Creates a set object of `values`.
  6208. *
  6209. * @private
  6210. * @param {Array} values The values to add to the set.
  6211. * @returns {Object} Returns the new set.
  6212. */
  6213. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6214. return new Set(values);
  6215. };
  6216. /**
  6217. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6218. *
  6219. * @private
  6220. * @param {Function} keysFunc The function to get the keys of a given object.
  6221. * @returns {Function} Returns the new pairs function.
  6222. */
  6223. function createToPairs(keysFunc) {
  6224. return function(object) {
  6225. var tag = getTag(object);
  6226. if (tag == mapTag) {
  6227. return mapToArray(object);
  6228. }
  6229. if (tag == setTag) {
  6230. return setToPairs(object);
  6231. }
  6232. return baseToPairs(object, keysFunc(object));
  6233. };
  6234. }
  6235. /**
  6236. * Creates a function that either curries or invokes `func` with optional
  6237. * `this` binding and partially applied arguments.
  6238. *
  6239. * @private
  6240. * @param {Function|string} func The function or method name to wrap.
  6241. * @param {number} bitmask The bitmask flags.
  6242. * 1 - `_.bind`
  6243. * 2 - `_.bindKey`
  6244. * 4 - `_.curry` or `_.curryRight` of a bound function
  6245. * 8 - `_.curry`
  6246. * 16 - `_.curryRight`
  6247. * 32 - `_.partial`
  6248. * 64 - `_.partialRight`
  6249. * 128 - `_.rearg`
  6250. * 256 - `_.ary`
  6251. * 512 - `_.flip`
  6252. * @param {*} [thisArg] The `this` binding of `func`.
  6253. * @param {Array} [partials] The arguments to be partially applied.
  6254. * @param {Array} [holders] The `partials` placeholder indexes.
  6255. * @param {Array} [argPos] The argument positions of the new function.
  6256. * @param {number} [ary] The arity cap of `func`.
  6257. * @param {number} [arity] The arity of `func`.
  6258. * @returns {Function} Returns the new wrapped function.
  6259. */
  6260. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6261. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6262. if (!isBindKey && typeof func != 'function') {
  6263. throw new TypeError(FUNC_ERROR_TEXT);
  6264. }
  6265. var length = partials ? partials.length : 0;
  6266. if (!length) {
  6267. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6268. partials = holders = undefined;
  6269. }
  6270. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6271. arity = arity === undefined ? arity : toInteger(arity);
  6272. length -= holders ? holders.length : 0;
  6273. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6274. var partialsRight = partials,
  6275. holdersRight = holders;
  6276. partials = holders = undefined;
  6277. }
  6278. var data = isBindKey ? undefined : getData(func);
  6279. var newData = [
  6280. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6281. argPos, ary, arity
  6282. ];
  6283. if (data) {
  6284. mergeData(newData, data);
  6285. }
  6286. func = newData[0];
  6287. bitmask = newData[1];
  6288. thisArg = newData[2];
  6289. partials = newData[3];
  6290. holders = newData[4];
  6291. arity = newData[9] = newData[9] === undefined
  6292. ? (isBindKey ? 0 : func.length)
  6293. : nativeMax(newData[9] - length, 0);
  6294. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6295. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6296. }
  6297. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6298. var result = createBind(func, bitmask, thisArg);
  6299. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6300. result = createCurry(func, bitmask, arity);
  6301. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6302. result = createPartial(func, bitmask, thisArg, partials);
  6303. } else {
  6304. result = createHybrid.apply(undefined, newData);
  6305. }
  6306. var setter = data ? baseSetData : setData;
  6307. return setWrapToString(setter(result, newData), func, bitmask);
  6308. }
  6309. /**
  6310. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6311. * of source objects to the destination object for all destination properties
  6312. * that resolve to `undefined`.
  6313. *
  6314. * @private
  6315. * @param {*} objValue The destination value.
  6316. * @param {*} srcValue The source value.
  6317. * @param {string} key The key of the property to assign.
  6318. * @param {Object} object The parent object of `objValue`.
  6319. * @returns {*} Returns the value to assign.
  6320. */
  6321. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6322. if (objValue === undefined ||
  6323. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6324. return srcValue;
  6325. }
  6326. return objValue;
  6327. }
  6328. /**
  6329. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6330. * objects into destination objects that are passed thru.
  6331. *
  6332. * @private
  6333. * @param {*} objValue The destination value.
  6334. * @param {*} srcValue The source value.
  6335. * @param {string} key The key of the property to merge.
  6336. * @param {Object} object The parent object of `objValue`.
  6337. * @param {Object} source The parent object of `srcValue`.
  6338. * @param {Object} [stack] Tracks traversed source values and their merged
  6339. * counterparts.
  6340. * @returns {*} Returns the value to assign.
  6341. */
  6342. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6343. if (isObject(objValue) && isObject(srcValue)) {
  6344. // Recursively merge objects and arrays (susceptible to call stack limits).
  6345. stack.set(srcValue, objValue);
  6346. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6347. stack['delete'](srcValue);
  6348. }
  6349. return objValue;
  6350. }
  6351. /**
  6352. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6353. * objects.
  6354. *
  6355. * @private
  6356. * @param {*} value The value to inspect.
  6357. * @param {string} key The key of the property to inspect.
  6358. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6359. */
  6360. function customOmitClone(value) {
  6361. return isPlainObject(value) ? undefined : value;
  6362. }
  6363. /**
  6364. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6365. * partial deep comparisons.
  6366. *
  6367. * @private
  6368. * @param {Array} array The array to compare.
  6369. * @param {Array} other The other array to compare.
  6370. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6371. * @param {Function} customizer The function to customize comparisons.
  6372. * @param {Function} equalFunc The function to determine equivalents of values.
  6373. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6374. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6375. */
  6376. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6377. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6378. arrLength = array.length,
  6379. othLength = other.length;
  6380. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6381. return false;
  6382. }
  6383. // Check that cyclic values are equal.
  6384. var arrStacked = stack.get(array);
  6385. var othStacked = stack.get(other);
  6386. if (arrStacked && othStacked) {
  6387. return arrStacked == other && othStacked == array;
  6388. }
  6389. var index = -1,
  6390. result = true,
  6391. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6392. stack.set(array, other);
  6393. stack.set(other, array);
  6394. // Ignore non-index properties.
  6395. while (++index < arrLength) {
  6396. var arrValue = array[index],
  6397. othValue = other[index];
  6398. if (customizer) {
  6399. var compared = isPartial
  6400. ? customizer(othValue, arrValue, index, other, array, stack)
  6401. : customizer(arrValue, othValue, index, array, other, stack);
  6402. }
  6403. if (compared !== undefined) {
  6404. if (compared) {
  6405. continue;
  6406. }
  6407. result = false;
  6408. break;
  6409. }
  6410. // Recursively compare arrays (susceptible to call stack limits).
  6411. if (seen) {
  6412. if (!arraySome(other, function(othValue, othIndex) {
  6413. if (!cacheHas(seen, othIndex) &&
  6414. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6415. return seen.push(othIndex);
  6416. }
  6417. })) {
  6418. result = false;
  6419. break;
  6420. }
  6421. } else if (!(
  6422. arrValue === othValue ||
  6423. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6424. )) {
  6425. result = false;
  6426. break;
  6427. }
  6428. }
  6429. stack['delete'](array);
  6430. stack['delete'](other);
  6431. return result;
  6432. }
  6433. /**
  6434. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6435. * the same `toStringTag`.
  6436. *
  6437. * **Note:** This function only supports comparing values with tags of
  6438. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6439. *
  6440. * @private
  6441. * @param {Object} object The object to compare.
  6442. * @param {Object} other The other object to compare.
  6443. * @param {string} tag The `toStringTag` of the objects to compare.
  6444. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6445. * @param {Function} customizer The function to customize comparisons.
  6446. * @param {Function} equalFunc The function to determine equivalents of values.
  6447. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6448. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6449. */
  6450. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6451. switch (tag) {
  6452. case dataViewTag:
  6453. if ((object.byteLength != other.byteLength) ||
  6454. (object.byteOffset != other.byteOffset)) {
  6455. return false;
  6456. }
  6457. object = object.buffer;
  6458. other = other.buffer;
  6459. case arrayBufferTag:
  6460. if ((object.byteLength != other.byteLength) ||
  6461. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6462. return false;
  6463. }
  6464. return true;
  6465. case boolTag:
  6466. case dateTag:
  6467. case numberTag:
  6468. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6469. // Invalid dates are coerced to `NaN`.
  6470. return eq(+object, +other);
  6471. case errorTag:
  6472. return object.name == other.name && object.message == other.message;
  6473. case regexpTag:
  6474. case stringTag:
  6475. // Coerce regexes to strings and treat strings, primitives and objects,
  6476. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6477. // for more details.
  6478. return object == (other + '');
  6479. case mapTag:
  6480. var convert = mapToArray;
  6481. case setTag:
  6482. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6483. convert || (convert = setToArray);
  6484. if (object.size != other.size && !isPartial) {
  6485. return false;
  6486. }
  6487. // Assume cyclic values are equal.
  6488. var stacked = stack.get(object);
  6489. if (stacked) {
  6490. return stacked == other;
  6491. }
  6492. bitmask |= COMPARE_UNORDERED_FLAG;
  6493. // Recursively compare objects (susceptible to call stack limits).
  6494. stack.set(object, other);
  6495. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6496. stack['delete'](object);
  6497. return result;
  6498. case symbolTag:
  6499. if (symbolValueOf) {
  6500. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6501. }
  6502. }
  6503. return false;
  6504. }
  6505. /**
  6506. * A specialized version of `baseIsEqualDeep` for objects with support for
  6507. * partial deep comparisons.
  6508. *
  6509. * @private
  6510. * @param {Object} object The object to compare.
  6511. * @param {Object} other The other object to compare.
  6512. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6513. * @param {Function} customizer The function to customize comparisons.
  6514. * @param {Function} equalFunc The function to determine equivalents of values.
  6515. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6516. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6517. */
  6518. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6519. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6520. objProps = getAllKeys(object),
  6521. objLength = objProps.length,
  6522. othProps = getAllKeys(other),
  6523. othLength = othProps.length;
  6524. if (objLength != othLength && !isPartial) {
  6525. return false;
  6526. }
  6527. var index = objLength;
  6528. while (index--) {
  6529. var key = objProps[index];
  6530. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6531. return false;
  6532. }
  6533. }
  6534. // Check that cyclic values are equal.
  6535. var objStacked = stack.get(object);
  6536. var othStacked = stack.get(other);
  6537. if (objStacked && othStacked) {
  6538. return objStacked == other && othStacked == object;
  6539. }
  6540. var result = true;
  6541. stack.set(object, other);
  6542. stack.set(other, object);
  6543. var skipCtor = isPartial;
  6544. while (++index < objLength) {
  6545. key = objProps[index];
  6546. var objValue = object[key],
  6547. othValue = other[key];
  6548. if (customizer) {
  6549. var compared = isPartial
  6550. ? customizer(othValue, objValue, key, other, object, stack)
  6551. : customizer(objValue, othValue, key, object, other, stack);
  6552. }
  6553. // Recursively compare objects (susceptible to call stack limits).
  6554. if (!(compared === undefined
  6555. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6556. : compared
  6557. )) {
  6558. result = false;
  6559. break;
  6560. }
  6561. skipCtor || (skipCtor = key == 'constructor');
  6562. }
  6563. if (result && !skipCtor) {
  6564. var objCtor = object.constructor,
  6565. othCtor = other.constructor;
  6566. // Non `Object` object instances with different constructors are not equal.
  6567. if (objCtor != othCtor &&
  6568. ('constructor' in object && 'constructor' in other) &&
  6569. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6570. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6571. result = false;
  6572. }
  6573. }
  6574. stack['delete'](object);
  6575. stack['delete'](other);
  6576. return result;
  6577. }
  6578. /**
  6579. * A specialized version of `baseRest` which flattens the rest array.
  6580. *
  6581. * @private
  6582. * @param {Function} func The function to apply a rest parameter to.
  6583. * @returns {Function} Returns the new function.
  6584. */
  6585. function flatRest(func) {
  6586. return setToString(overRest(func, undefined, flatten), func + '');
  6587. }
  6588. /**
  6589. * Creates an array of own enumerable property names and symbols of `object`.
  6590. *
  6591. * @private
  6592. * @param {Object} object The object to query.
  6593. * @returns {Array} Returns the array of property names and symbols.
  6594. */
  6595. function getAllKeys(object) {
  6596. return baseGetAllKeys(object, keys, getSymbols);
  6597. }
  6598. /**
  6599. * Creates an array of own and inherited enumerable property names and
  6600. * symbols of `object`.
  6601. *
  6602. * @private
  6603. * @param {Object} object The object to query.
  6604. * @returns {Array} Returns the array of property names and symbols.
  6605. */
  6606. function getAllKeysIn(object) {
  6607. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6608. }
  6609. /**
  6610. * Gets metadata for `func`.
  6611. *
  6612. * @private
  6613. * @param {Function} func The function to query.
  6614. * @returns {*} Returns the metadata for `func`.
  6615. */
  6616. var getData = !metaMap ? noop : function(func) {
  6617. return metaMap.get(func);
  6618. };
  6619. /**
  6620. * Gets the name of `func`.
  6621. *
  6622. * @private
  6623. * @param {Function} func The function to query.
  6624. * @returns {string} Returns the function name.
  6625. */
  6626. function getFuncName(func) {
  6627. var result = (func.name + ''),
  6628. array = realNames[result],
  6629. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6630. while (length--) {
  6631. var data = array[length],
  6632. otherFunc = data.func;
  6633. if (otherFunc == null || otherFunc == func) {
  6634. return data.name;
  6635. }
  6636. }
  6637. return result;
  6638. }
  6639. /**
  6640. * Gets the argument placeholder value for `func`.
  6641. *
  6642. * @private
  6643. * @param {Function} func The function to inspect.
  6644. * @returns {*} Returns the placeholder value.
  6645. */
  6646. function getHolder(func) {
  6647. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6648. return object.placeholder;
  6649. }
  6650. /**
  6651. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6652. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6653. * If arguments are provided, the chosen function is invoked with them and
  6654. * its result is returned.
  6655. *
  6656. * @private
  6657. * @param {*} [value] The value to convert to an iteratee.
  6658. * @param {number} [arity] The arity of the created iteratee.
  6659. * @returns {Function} Returns the chosen function or its result.
  6660. */
  6661. function getIteratee() {
  6662. var result = lodash.iteratee || iteratee;
  6663. result = result === iteratee ? baseIteratee : result;
  6664. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6665. }
  6666. /**
  6667. * Gets the data for `map`.
  6668. *
  6669. * @private
  6670. * @param {Object} map The map to query.
  6671. * @param {string} key The reference key.
  6672. * @returns {*} Returns the map data.
  6673. */
  6674. function getMapData(map, key) {
  6675. var data = map.__data__;
  6676. return isKeyable(key)
  6677. ? data[typeof key == 'string' ? 'string' : 'hash']
  6678. : data.map;
  6679. }
  6680. /**
  6681. * Gets the property names, values, and compare flags of `object`.
  6682. *
  6683. * @private
  6684. * @param {Object} object The object to query.
  6685. * @returns {Array} Returns the match data of `object`.
  6686. */
  6687. function getMatchData(object) {
  6688. var result = keys(object),
  6689. length = result.length;
  6690. while (length--) {
  6691. var key = result[length],
  6692. value = object[key];
  6693. result[length] = [key, value, isStrictComparable(value)];
  6694. }
  6695. return result;
  6696. }
  6697. /**
  6698. * Gets the native function at `key` of `object`.
  6699. *
  6700. * @private
  6701. * @param {Object} object The object to query.
  6702. * @param {string} key The key of the method to get.
  6703. * @returns {*} Returns the function if it's native, else `undefined`.
  6704. */
  6705. function getNative(object, key) {
  6706. var value = getValue(object, key);
  6707. return baseIsNative(value) ? value : undefined;
  6708. }
  6709. /**
  6710. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6711. *
  6712. * @private
  6713. * @param {*} value The value to query.
  6714. * @returns {string} Returns the raw `toStringTag`.
  6715. */
  6716. function getRawTag(value) {
  6717. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6718. tag = value[symToStringTag];
  6719. try {
  6720. value[symToStringTag] = undefined;
  6721. var unmasked = true;
  6722. } catch (e) {}
  6723. var result = nativeObjectToString.call(value);
  6724. if (unmasked) {
  6725. if (isOwn) {
  6726. value[symToStringTag] = tag;
  6727. } else {
  6728. delete value[symToStringTag];
  6729. }
  6730. }
  6731. return result;
  6732. }
  6733. /**
  6734. * Creates an array of the own enumerable symbols of `object`.
  6735. *
  6736. * @private
  6737. * @param {Object} object The object to query.
  6738. * @returns {Array} Returns the array of symbols.
  6739. */
  6740. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6741. if (object == null) {
  6742. return [];
  6743. }
  6744. object = Object(object);
  6745. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6746. return propertyIsEnumerable.call(object, symbol);
  6747. });
  6748. };
  6749. /**
  6750. * Creates an array of the own and inherited enumerable symbols of `object`.
  6751. *
  6752. * @private
  6753. * @param {Object} object The object to query.
  6754. * @returns {Array} Returns the array of symbols.
  6755. */
  6756. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6757. var result = [];
  6758. while (object) {
  6759. arrayPush(result, getSymbols(object));
  6760. object = getPrototype(object);
  6761. }
  6762. return result;
  6763. };
  6764. /**
  6765. * Gets the `toStringTag` of `value`.
  6766. *
  6767. * @private
  6768. * @param {*} value The value to query.
  6769. * @returns {string} Returns the `toStringTag`.
  6770. */
  6771. var getTag = baseGetTag;
  6772. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6773. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6774. (Map && getTag(new Map) != mapTag) ||
  6775. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6776. (Set && getTag(new Set) != setTag) ||
  6777. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6778. getTag = function(value) {
  6779. var result = baseGetTag(value),
  6780. Ctor = result == objectTag ? value.constructor : undefined,
  6781. ctorString = Ctor ? toSource(Ctor) : '';
  6782. if (ctorString) {
  6783. switch (ctorString) {
  6784. case dataViewCtorString: return dataViewTag;
  6785. case mapCtorString: return mapTag;
  6786. case promiseCtorString: return promiseTag;
  6787. case setCtorString: return setTag;
  6788. case weakMapCtorString: return weakMapTag;
  6789. }
  6790. }
  6791. return result;
  6792. };
  6793. }
  6794. /**
  6795. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6796. *
  6797. * @private
  6798. * @param {number} start The start of the view.
  6799. * @param {number} end The end of the view.
  6800. * @param {Array} transforms The transformations to apply to the view.
  6801. * @returns {Object} Returns an object containing the `start` and `end`
  6802. * positions of the view.
  6803. */
  6804. function getView(start, end, transforms) {
  6805. var index = -1,
  6806. length = transforms.length;
  6807. while (++index < length) {
  6808. var data = transforms[index],
  6809. size = data.size;
  6810. switch (data.type) {
  6811. case 'drop': start += size; break;
  6812. case 'dropRight': end -= size; break;
  6813. case 'take': end = nativeMin(end, start + size); break;
  6814. case 'takeRight': start = nativeMax(start, end - size); break;
  6815. }
  6816. }
  6817. return { 'start': start, 'end': end };
  6818. }
  6819. /**
  6820. * Extracts wrapper details from the `source` body comment.
  6821. *
  6822. * @private
  6823. * @param {string} source The source to inspect.
  6824. * @returns {Array} Returns the wrapper details.
  6825. */
  6826. function getWrapDetails(source) {
  6827. var match = source.match(reWrapDetails);
  6828. return match ? match[1].split(reSplitDetails) : [];
  6829. }
  6830. /**
  6831. * Checks if `path` exists on `object`.
  6832. *
  6833. * @private
  6834. * @param {Object} object The object to query.
  6835. * @param {Array|string} path The path to check.
  6836. * @param {Function} hasFunc The function to check properties.
  6837. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6838. */
  6839. function hasPath(object, path, hasFunc) {
  6840. path = castPath(path, object);
  6841. var index = -1,
  6842. length = path.length,
  6843. result = false;
  6844. while (++index < length) {
  6845. var key = toKey(path[index]);
  6846. if (!(result = object != null && hasFunc(object, key))) {
  6847. break;
  6848. }
  6849. object = object[key];
  6850. }
  6851. if (result || ++index != length) {
  6852. return result;
  6853. }
  6854. length = object == null ? 0 : object.length;
  6855. return !!length && isLength(length) && isIndex(key, length) &&
  6856. (isArray(object) || isArguments(object));
  6857. }
  6858. /**
  6859. * Initializes an array clone.
  6860. *
  6861. * @private
  6862. * @param {Array} array The array to clone.
  6863. * @returns {Array} Returns the initialized clone.
  6864. */
  6865. function initCloneArray(array) {
  6866. var length = array.length,
  6867. result = new array.constructor(length);
  6868. // Add properties assigned by `RegExp#exec`.
  6869. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6870. result.index = array.index;
  6871. result.input = array.input;
  6872. }
  6873. return result;
  6874. }
  6875. /**
  6876. * Initializes an object clone.
  6877. *
  6878. * @private
  6879. * @param {Object} object The object to clone.
  6880. * @returns {Object} Returns the initialized clone.
  6881. */
  6882. function initCloneObject(object) {
  6883. return (typeof object.constructor == 'function' && !isPrototype(object))
  6884. ? baseCreate(getPrototype(object))
  6885. : {};
  6886. }
  6887. /**
  6888. * Initializes an object clone based on its `toStringTag`.
  6889. *
  6890. * **Note:** This function only supports cloning values with tags of
  6891. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6892. *
  6893. * @private
  6894. * @param {Object} object The object to clone.
  6895. * @param {string} tag The `toStringTag` of the object to clone.
  6896. * @param {boolean} [isDeep] Specify a deep clone.
  6897. * @returns {Object} Returns the initialized clone.
  6898. */
  6899. function initCloneByTag(object, tag, isDeep) {
  6900. var Ctor = object.constructor;
  6901. switch (tag) {
  6902. case arrayBufferTag:
  6903. return cloneArrayBuffer(object);
  6904. case boolTag:
  6905. case dateTag:
  6906. return new Ctor(+object);
  6907. case dataViewTag:
  6908. return cloneDataView(object, isDeep);
  6909. case float32Tag: case float64Tag:
  6910. case int8Tag: case int16Tag: case int32Tag:
  6911. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6912. return cloneTypedArray(object, isDeep);
  6913. case mapTag:
  6914. return new Ctor;
  6915. case numberTag:
  6916. case stringTag:
  6917. return new Ctor(object);
  6918. case regexpTag:
  6919. return cloneRegExp(object);
  6920. case setTag:
  6921. return new Ctor;
  6922. case symbolTag:
  6923. return cloneSymbol(object);
  6924. }
  6925. }
  6926. /**
  6927. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6928. *
  6929. * @private
  6930. * @param {string} source The source to modify.
  6931. * @returns {Array} details The details to insert.
  6932. * @returns {string} Returns the modified source.
  6933. */
  6934. function insertWrapDetails(source, details) {
  6935. var length = details.length;
  6936. if (!length) {
  6937. return source;
  6938. }
  6939. var lastIndex = length - 1;
  6940. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6941. details = details.join(length > 2 ? ', ' : ' ');
  6942. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6943. }
  6944. /**
  6945. * Checks if `value` is a flattenable `arguments` object or array.
  6946. *
  6947. * @private
  6948. * @param {*} value The value to check.
  6949. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6950. */
  6951. function isFlattenable(value) {
  6952. return isArray(value) || isArguments(value) ||
  6953. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6954. }
  6955. /**
  6956. * Checks if `value` is a valid array-like index.
  6957. *
  6958. * @private
  6959. * @param {*} value The value to check.
  6960. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6961. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6962. */
  6963. function isIndex(value, length) {
  6964. var type = typeof value;
  6965. length = length == null ? MAX_SAFE_INTEGER : length;
  6966. return !!length &&
  6967. (type == 'number' ||
  6968. (type != 'symbol' && reIsUint.test(value))) &&
  6969. (value > -1 && value % 1 == 0 && value < length);
  6970. }
  6971. /**
  6972. * Checks if the given arguments are from an iteratee call.
  6973. *
  6974. * @private
  6975. * @param {*} value The potential iteratee value argument.
  6976. * @param {*} index The potential iteratee index or key argument.
  6977. * @param {*} object The potential iteratee object argument.
  6978. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6979. * else `false`.
  6980. */
  6981. function isIterateeCall(value, index, object) {
  6982. if (!isObject(object)) {
  6983. return false;
  6984. }
  6985. var type = typeof index;
  6986. if (type == 'number'
  6987. ? (isArrayLike(object) && isIndex(index, object.length))
  6988. : (type == 'string' && index in object)
  6989. ) {
  6990. return eq(object[index], value);
  6991. }
  6992. return false;
  6993. }
  6994. /**
  6995. * Checks if `value` is a property name and not a property path.
  6996. *
  6997. * @private
  6998. * @param {*} value The value to check.
  6999. * @param {Object} [object] The object to query keys on.
  7000. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7001. */
  7002. function isKey(value, object) {
  7003. if (isArray(value)) {
  7004. return false;
  7005. }
  7006. var type = typeof value;
  7007. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7008. value == null || isSymbol(value)) {
  7009. return true;
  7010. }
  7011. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7012. (object != null && value in Object(object));
  7013. }
  7014. /**
  7015. * Checks if `value` is suitable for use as unique object key.
  7016. *
  7017. * @private
  7018. * @param {*} value The value to check.
  7019. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7020. */
  7021. function isKeyable(value) {
  7022. var type = typeof value;
  7023. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7024. ? (value !== '__proto__')
  7025. : (value === null);
  7026. }
  7027. /**
  7028. * Checks if `func` has a lazy counterpart.
  7029. *
  7030. * @private
  7031. * @param {Function} func The function to check.
  7032. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7033. * else `false`.
  7034. */
  7035. function isLaziable(func) {
  7036. var funcName = getFuncName(func),
  7037. other = lodash[funcName];
  7038. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7039. return false;
  7040. }
  7041. if (func === other) {
  7042. return true;
  7043. }
  7044. var data = getData(other);
  7045. return !!data && func === data[0];
  7046. }
  7047. /**
  7048. * Checks if `func` has its source masked.
  7049. *
  7050. * @private
  7051. * @param {Function} func The function to check.
  7052. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7053. */
  7054. function isMasked(func) {
  7055. return !!maskSrcKey && (maskSrcKey in func);
  7056. }
  7057. /**
  7058. * Checks if `func` is capable of being masked.
  7059. *
  7060. * @private
  7061. * @param {*} value The value to check.
  7062. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7063. */
  7064. var isMaskable = coreJsData ? isFunction : stubFalse;
  7065. /**
  7066. * Checks if `value` is likely a prototype object.
  7067. *
  7068. * @private
  7069. * @param {*} value The value to check.
  7070. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7071. */
  7072. function isPrototype(value) {
  7073. var Ctor = value && value.constructor,
  7074. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7075. return value === proto;
  7076. }
  7077. /**
  7078. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7079. *
  7080. * @private
  7081. * @param {*} value The value to check.
  7082. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7083. * equality comparisons, else `false`.
  7084. */
  7085. function isStrictComparable(value) {
  7086. return value === value && !isObject(value);
  7087. }
  7088. /**
  7089. * A specialized version of `matchesProperty` for source values suitable
  7090. * for strict equality comparisons, i.e. `===`.
  7091. *
  7092. * @private
  7093. * @param {string} key The key of the property to get.
  7094. * @param {*} srcValue The value to match.
  7095. * @returns {Function} Returns the new spec function.
  7096. */
  7097. function matchesStrictComparable(key, srcValue) {
  7098. return function(object) {
  7099. if (object == null) {
  7100. return false;
  7101. }
  7102. return object[key] === srcValue &&
  7103. (srcValue !== undefined || (key in Object(object)));
  7104. };
  7105. }
  7106. /**
  7107. * A specialized version of `_.memoize` which clears the memoized function's
  7108. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7109. *
  7110. * @private
  7111. * @param {Function} func The function to have its output memoized.
  7112. * @returns {Function} Returns the new memoized function.
  7113. */
  7114. function memoizeCapped(func) {
  7115. var result = memoize(func, function(key) {
  7116. if (cache.size === MAX_MEMOIZE_SIZE) {
  7117. cache.clear();
  7118. }
  7119. return key;
  7120. });
  7121. var cache = result.cache;
  7122. return result;
  7123. }
  7124. /**
  7125. * Merges the function metadata of `source` into `data`.
  7126. *
  7127. * Merging metadata reduces the number of wrappers used to invoke a function.
  7128. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7129. * may be applied regardless of execution order. Methods like `_.ary` and
  7130. * `_.rearg` modify function arguments, making the order in which they are
  7131. * executed important, preventing the merging of metadata. However, we make
  7132. * an exception for a safe combined case where curried functions have `_.ary`
  7133. * and or `_.rearg` applied.
  7134. *
  7135. * @private
  7136. * @param {Array} data The destination metadata.
  7137. * @param {Array} source The source metadata.
  7138. * @returns {Array} Returns `data`.
  7139. */
  7140. function mergeData(data, source) {
  7141. var bitmask = data[1],
  7142. srcBitmask = source[1],
  7143. newBitmask = bitmask | srcBitmask,
  7144. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7145. var isCombo =
  7146. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7147. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7148. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7149. // Exit early if metadata can't be merged.
  7150. if (!(isCommon || isCombo)) {
  7151. return data;
  7152. }
  7153. // Use source `thisArg` if available.
  7154. if (srcBitmask & WRAP_BIND_FLAG) {
  7155. data[2] = source[2];
  7156. // Set when currying a bound function.
  7157. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7158. }
  7159. // Compose partial arguments.
  7160. var value = source[3];
  7161. if (value) {
  7162. var partials = data[3];
  7163. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7164. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7165. }
  7166. // Compose partial right arguments.
  7167. value = source[5];
  7168. if (value) {
  7169. partials = data[5];
  7170. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7171. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7172. }
  7173. // Use source `argPos` if available.
  7174. value = source[7];
  7175. if (value) {
  7176. data[7] = value;
  7177. }
  7178. // Use source `ary` if it's smaller.
  7179. if (srcBitmask & WRAP_ARY_FLAG) {
  7180. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7181. }
  7182. // Use source `arity` if one is not provided.
  7183. if (data[9] == null) {
  7184. data[9] = source[9];
  7185. }
  7186. // Use source `func` and merge bitmasks.
  7187. data[0] = source[0];
  7188. data[1] = newBitmask;
  7189. return data;
  7190. }
  7191. /**
  7192. * This function is like
  7193. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7194. * except that it includes inherited enumerable properties.
  7195. *
  7196. * @private
  7197. * @param {Object} object The object to query.
  7198. * @returns {Array} Returns the array of property names.
  7199. */
  7200. function nativeKeysIn(object) {
  7201. var result = [];
  7202. if (object != null) {
  7203. for (var key in Object(object)) {
  7204. result.push(key);
  7205. }
  7206. }
  7207. return result;
  7208. }
  7209. /**
  7210. * Converts `value` to a string using `Object.prototype.toString`.
  7211. *
  7212. * @private
  7213. * @param {*} value The value to convert.
  7214. * @returns {string} Returns the converted string.
  7215. */
  7216. function objectToString(value) {
  7217. return nativeObjectToString.call(value);
  7218. }
  7219. /**
  7220. * A specialized version of `baseRest` which transforms the rest array.
  7221. *
  7222. * @private
  7223. * @param {Function} func The function to apply a rest parameter to.
  7224. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7225. * @param {Function} transform The rest array transform.
  7226. * @returns {Function} Returns the new function.
  7227. */
  7228. function overRest(func, start, transform) {
  7229. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7230. return function() {
  7231. var args = arguments,
  7232. index = -1,
  7233. length = nativeMax(args.length - start, 0),
  7234. array = Array(length);
  7235. while (++index < length) {
  7236. array[index] = args[start + index];
  7237. }
  7238. index = -1;
  7239. var otherArgs = Array(start + 1);
  7240. while (++index < start) {
  7241. otherArgs[index] = args[index];
  7242. }
  7243. otherArgs[start] = transform(array);
  7244. return apply(func, this, otherArgs);
  7245. };
  7246. }
  7247. /**
  7248. * Gets the parent value at `path` of `object`.
  7249. *
  7250. * @private
  7251. * @param {Object} object The object to query.
  7252. * @param {Array} path The path to get the parent value of.
  7253. * @returns {*} Returns the parent value.
  7254. */
  7255. function parent(object, path) {
  7256. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7257. }
  7258. /**
  7259. * Reorder `array` according to the specified indexes where the element at
  7260. * the first index is assigned as the first element, the element at
  7261. * the second index is assigned as the second element, and so on.
  7262. *
  7263. * @private
  7264. * @param {Array} array The array to reorder.
  7265. * @param {Array} indexes The arranged array indexes.
  7266. * @returns {Array} Returns `array`.
  7267. */
  7268. function reorder(array, indexes) {
  7269. var arrLength = array.length,
  7270. length = nativeMin(indexes.length, arrLength),
  7271. oldArray = copyArray(array);
  7272. while (length--) {
  7273. var index = indexes[length];
  7274. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7275. }
  7276. return array;
  7277. }
  7278. /**
  7279. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7280. *
  7281. * @private
  7282. * @param {Object} object The object to query.
  7283. * @param {string} key The key of the property to get.
  7284. * @returns {*} Returns the property value.
  7285. */
  7286. function safeGet(object, key) {
  7287. if (key === 'constructor' && typeof object[key] === 'function') {
  7288. return;
  7289. }
  7290. if (key == '__proto__') {
  7291. return;
  7292. }
  7293. return object[key];
  7294. }
  7295. /**
  7296. * Sets metadata for `func`.
  7297. *
  7298. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7299. * period of time, it will trip its breaker and transition to an identity
  7300. * function to avoid garbage collection pauses in V8. See
  7301. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7302. * for more details.
  7303. *
  7304. * @private
  7305. * @param {Function} func The function to associate metadata with.
  7306. * @param {*} data The metadata.
  7307. * @returns {Function} Returns `func`.
  7308. */
  7309. var setData = shortOut(baseSetData);
  7310. /**
  7311. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7312. *
  7313. * @private
  7314. * @param {Function} func The function to delay.
  7315. * @param {number} wait The number of milliseconds to delay invocation.
  7316. * @returns {number|Object} Returns the timer id or timeout object.
  7317. */
  7318. var setTimeout = ctxSetTimeout || function(func, wait) {
  7319. return root.setTimeout(func, wait);
  7320. };
  7321. /**
  7322. * Sets the `toString` method of `func` to return `string`.
  7323. *
  7324. * @private
  7325. * @param {Function} func The function to modify.
  7326. * @param {Function} string The `toString` result.
  7327. * @returns {Function} Returns `func`.
  7328. */
  7329. var setToString = shortOut(baseSetToString);
  7330. /**
  7331. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7332. * with wrapper details in a comment at the top of the source body.
  7333. *
  7334. * @private
  7335. * @param {Function} wrapper The function to modify.
  7336. * @param {Function} reference The reference function.
  7337. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7338. * @returns {Function} Returns `wrapper`.
  7339. */
  7340. function setWrapToString(wrapper, reference, bitmask) {
  7341. var source = (reference + '');
  7342. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7343. }
  7344. /**
  7345. * Creates a function that'll short out and invoke `identity` instead
  7346. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7347. * milliseconds.
  7348. *
  7349. * @private
  7350. * @param {Function} func The function to restrict.
  7351. * @returns {Function} Returns the new shortable function.
  7352. */
  7353. function shortOut(func) {
  7354. var count = 0,
  7355. lastCalled = 0;
  7356. return function() {
  7357. var stamp = nativeNow(),
  7358. remaining = HOT_SPAN - (stamp - lastCalled);
  7359. lastCalled = stamp;
  7360. if (remaining > 0) {
  7361. if (++count >= HOT_COUNT) {
  7362. return arguments[0];
  7363. }
  7364. } else {
  7365. count = 0;
  7366. }
  7367. return func.apply(undefined, arguments);
  7368. };
  7369. }
  7370. /**
  7371. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7372. *
  7373. * @private
  7374. * @param {Array} array The array to shuffle.
  7375. * @param {number} [size=array.length] The size of `array`.
  7376. * @returns {Array} Returns `array`.
  7377. */
  7378. function shuffleSelf(array, size) {
  7379. var index = -1,
  7380. length = array.length,
  7381. lastIndex = length - 1;
  7382. size = size === undefined ? length : size;
  7383. while (++index < size) {
  7384. var rand = baseRandom(index, lastIndex),
  7385. value = array[rand];
  7386. array[rand] = array[index];
  7387. array[index] = value;
  7388. }
  7389. array.length = size;
  7390. return array;
  7391. }
  7392. /**
  7393. * Converts `string` to a property path array.
  7394. *
  7395. * @private
  7396. * @param {string} string The string to convert.
  7397. * @returns {Array} Returns the property path array.
  7398. */
  7399. var stringToPath = memoizeCapped(function(string) {
  7400. var result = [];
  7401. if (string.charCodeAt(0) === 46 /* . */) {
  7402. result.push('');
  7403. }
  7404. string.replace(rePropName, function(match, number, quote, subString) {
  7405. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7406. });
  7407. return result;
  7408. });
  7409. /**
  7410. * Converts `value` to a string key if it's not a string or symbol.
  7411. *
  7412. * @private
  7413. * @param {*} value The value to inspect.
  7414. * @returns {string|symbol} Returns the key.
  7415. */
  7416. function toKey(value) {
  7417. if (typeof value == 'string' || isSymbol(value)) {
  7418. return value;
  7419. }
  7420. var result = (value + '');
  7421. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7422. }
  7423. /**
  7424. * Converts `func` to its source code.
  7425. *
  7426. * @private
  7427. * @param {Function} func The function to convert.
  7428. * @returns {string} Returns the source code.
  7429. */
  7430. function toSource(func) {
  7431. if (func != null) {
  7432. try {
  7433. return funcToString.call(func);
  7434. } catch (e) {}
  7435. try {
  7436. return (func + '');
  7437. } catch (e) {}
  7438. }
  7439. return '';
  7440. }
  7441. /**
  7442. * Updates wrapper `details` based on `bitmask` flags.
  7443. *
  7444. * @private
  7445. * @returns {Array} details The details to modify.
  7446. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7447. * @returns {Array} Returns `details`.
  7448. */
  7449. function updateWrapDetails(details, bitmask) {
  7450. arrayEach(wrapFlags, function(pair) {
  7451. var value = '_.' + pair[0];
  7452. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7453. details.push(value);
  7454. }
  7455. });
  7456. return details.sort();
  7457. }
  7458. /**
  7459. * Creates a clone of `wrapper`.
  7460. *
  7461. * @private
  7462. * @param {Object} wrapper The wrapper to clone.
  7463. * @returns {Object} Returns the cloned wrapper.
  7464. */
  7465. function wrapperClone(wrapper) {
  7466. if (wrapper instanceof LazyWrapper) {
  7467. return wrapper.clone();
  7468. }
  7469. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7470. result.__actions__ = copyArray(wrapper.__actions__);
  7471. result.__index__ = wrapper.__index__;
  7472. result.__values__ = wrapper.__values__;
  7473. return result;
  7474. }
  7475. /*------------------------------------------------------------------------*/
  7476. /**
  7477. * Creates an array of elements split into groups the length of `size`.
  7478. * If `array` can't be split evenly, the final chunk will be the remaining
  7479. * elements.
  7480. *
  7481. * @static
  7482. * @memberOf _
  7483. * @since 3.0.0
  7484. * @category Array
  7485. * @param {Array} array The array to process.
  7486. * @param {number} [size=1] The length of each chunk
  7487. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7488. * @returns {Array} Returns the new array of chunks.
  7489. * @example
  7490. *
  7491. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7492. * // => [['a', 'b'], ['c', 'd']]
  7493. *
  7494. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7495. * // => [['a', 'b', 'c'], ['d']]
  7496. */
  7497. function chunk(array, size, guard) {
  7498. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7499. size = 1;
  7500. } else {
  7501. size = nativeMax(toInteger(size), 0);
  7502. }
  7503. var length = array == null ? 0 : array.length;
  7504. if (!length || size < 1) {
  7505. return [];
  7506. }
  7507. var index = 0,
  7508. resIndex = 0,
  7509. result = Array(nativeCeil(length / size));
  7510. while (index < length) {
  7511. result[resIndex++] = baseSlice(array, index, (index += size));
  7512. }
  7513. return result;
  7514. }
  7515. /**
  7516. * Creates an array with all falsey values removed. The values `false`, `null`,
  7517. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7518. *
  7519. * @static
  7520. * @memberOf _
  7521. * @since 0.1.0
  7522. * @category Array
  7523. * @param {Array} array The array to compact.
  7524. * @returns {Array} Returns the new array of filtered values.
  7525. * @example
  7526. *
  7527. * _.compact([0, 1, false, 2, '', 3]);
  7528. * // => [1, 2, 3]
  7529. */
  7530. function compact(array) {
  7531. var index = -1,
  7532. length = array == null ? 0 : array.length,
  7533. resIndex = 0,
  7534. result = [];
  7535. while (++index < length) {
  7536. var value = array[index];
  7537. if (value) {
  7538. result[resIndex++] = value;
  7539. }
  7540. }
  7541. return result;
  7542. }
  7543. /**
  7544. * Creates a new array concatenating `array` with any additional arrays
  7545. * and/or values.
  7546. *
  7547. * @static
  7548. * @memberOf _
  7549. * @since 4.0.0
  7550. * @category Array
  7551. * @param {Array} array The array to concatenate.
  7552. * @param {...*} [values] The values to concatenate.
  7553. * @returns {Array} Returns the new concatenated array.
  7554. * @example
  7555. *
  7556. * var array = [1];
  7557. * var other = _.concat(array, 2, [3], [[4]]);
  7558. *
  7559. * console.log(other);
  7560. * // => [1, 2, 3, [4]]
  7561. *
  7562. * console.log(array);
  7563. * // => [1]
  7564. */
  7565. function concat() {
  7566. var length = arguments.length;
  7567. if (!length) {
  7568. return [];
  7569. }
  7570. var args = Array(length - 1),
  7571. array = arguments[0],
  7572. index = length;
  7573. while (index--) {
  7574. args[index - 1] = arguments[index];
  7575. }
  7576. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7577. }
  7578. /**
  7579. * Creates an array of `array` values not included in the other given arrays
  7580. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7581. * for equality comparisons. The order and references of result values are
  7582. * determined by the first array.
  7583. *
  7584. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7585. *
  7586. * @static
  7587. * @memberOf _
  7588. * @since 0.1.0
  7589. * @category Array
  7590. * @param {Array} array The array to inspect.
  7591. * @param {...Array} [values] The values to exclude.
  7592. * @returns {Array} Returns the new array of filtered values.
  7593. * @see _.without, _.xor
  7594. * @example
  7595. *
  7596. * _.difference([2, 1], [2, 3]);
  7597. * // => [1]
  7598. */
  7599. var difference = baseRest(function(array, values) {
  7600. return isArrayLikeObject(array)
  7601. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7602. : [];
  7603. });
  7604. /**
  7605. * This method is like `_.difference` except that it accepts `iteratee` which
  7606. * is invoked for each element of `array` and `values` to generate the criterion
  7607. * by which they're compared. The order and references of result values are
  7608. * determined by the first array. The iteratee is invoked with one argument:
  7609. * (value).
  7610. *
  7611. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7612. *
  7613. * @static
  7614. * @memberOf _
  7615. * @since 4.0.0
  7616. * @category Array
  7617. * @param {Array} array The array to inspect.
  7618. * @param {...Array} [values] The values to exclude.
  7619. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7620. * @returns {Array} Returns the new array of filtered values.
  7621. * @example
  7622. *
  7623. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7624. * // => [1.2]
  7625. *
  7626. * // The `_.property` iteratee shorthand.
  7627. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7628. * // => [{ 'x': 2 }]
  7629. */
  7630. var differenceBy = baseRest(function(array, values) {
  7631. var iteratee = last(values);
  7632. if (isArrayLikeObject(iteratee)) {
  7633. iteratee = undefined;
  7634. }
  7635. return isArrayLikeObject(array)
  7636. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7637. : [];
  7638. });
  7639. /**
  7640. * This method is like `_.difference` except that it accepts `comparator`
  7641. * which is invoked to compare elements of `array` to `values`. The order and
  7642. * references of result values are determined by the first array. The comparator
  7643. * is invoked with two arguments: (arrVal, othVal).
  7644. *
  7645. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7646. *
  7647. * @static
  7648. * @memberOf _
  7649. * @since 4.0.0
  7650. * @category Array
  7651. * @param {Array} array The array to inspect.
  7652. * @param {...Array} [values] The values to exclude.
  7653. * @param {Function} [comparator] The comparator invoked per element.
  7654. * @returns {Array} Returns the new array of filtered values.
  7655. * @example
  7656. *
  7657. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7658. *
  7659. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7660. * // => [{ 'x': 2, 'y': 1 }]
  7661. */
  7662. var differenceWith = baseRest(function(array, values) {
  7663. var comparator = last(values);
  7664. if (isArrayLikeObject(comparator)) {
  7665. comparator = undefined;
  7666. }
  7667. return isArrayLikeObject(array)
  7668. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7669. : [];
  7670. });
  7671. /**
  7672. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7673. *
  7674. * @static
  7675. * @memberOf _
  7676. * @since 0.5.0
  7677. * @category Array
  7678. * @param {Array} array The array to query.
  7679. * @param {number} [n=1] The number of elements to drop.
  7680. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7681. * @returns {Array} Returns the slice of `array`.
  7682. * @example
  7683. *
  7684. * _.drop([1, 2, 3]);
  7685. * // => [2, 3]
  7686. *
  7687. * _.drop([1, 2, 3], 2);
  7688. * // => [3]
  7689. *
  7690. * _.drop([1, 2, 3], 5);
  7691. * // => []
  7692. *
  7693. * _.drop([1, 2, 3], 0);
  7694. * // => [1, 2, 3]
  7695. */
  7696. function drop(array, n, guard) {
  7697. var length = array == null ? 0 : array.length;
  7698. if (!length) {
  7699. return [];
  7700. }
  7701. n = (guard || n === undefined) ? 1 : toInteger(n);
  7702. return baseSlice(array, n < 0 ? 0 : n, length);
  7703. }
  7704. /**
  7705. * Creates a slice of `array` with `n` elements dropped from the end.
  7706. *
  7707. * @static
  7708. * @memberOf _
  7709. * @since 3.0.0
  7710. * @category Array
  7711. * @param {Array} array The array to query.
  7712. * @param {number} [n=1] The number of elements to drop.
  7713. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7714. * @returns {Array} Returns the slice of `array`.
  7715. * @example
  7716. *
  7717. * _.dropRight([1, 2, 3]);
  7718. * // => [1, 2]
  7719. *
  7720. * _.dropRight([1, 2, 3], 2);
  7721. * // => [1]
  7722. *
  7723. * _.dropRight([1, 2, 3], 5);
  7724. * // => []
  7725. *
  7726. * _.dropRight([1, 2, 3], 0);
  7727. * // => [1, 2, 3]
  7728. */
  7729. function dropRight(array, n, guard) {
  7730. var length = array == null ? 0 : array.length;
  7731. if (!length) {
  7732. return [];
  7733. }
  7734. n = (guard || n === undefined) ? 1 : toInteger(n);
  7735. n = length - n;
  7736. return baseSlice(array, 0, n < 0 ? 0 : n);
  7737. }
  7738. /**
  7739. * Creates a slice of `array` excluding elements dropped from the end.
  7740. * Elements are dropped until `predicate` returns falsey. The predicate is
  7741. * invoked with three arguments: (value, index, array).
  7742. *
  7743. * @static
  7744. * @memberOf _
  7745. * @since 3.0.0
  7746. * @category Array
  7747. * @param {Array} array The array to query.
  7748. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7749. * @returns {Array} Returns the slice of `array`.
  7750. * @example
  7751. *
  7752. * var users = [
  7753. * { 'user': 'barney', 'active': true },
  7754. * { 'user': 'fred', 'active': false },
  7755. * { 'user': 'pebbles', 'active': false }
  7756. * ];
  7757. *
  7758. * _.dropRightWhile(users, function(o) { return !o.active; });
  7759. * // => objects for ['barney']
  7760. *
  7761. * // The `_.matches` iteratee shorthand.
  7762. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7763. * // => objects for ['barney', 'fred']
  7764. *
  7765. * // The `_.matchesProperty` iteratee shorthand.
  7766. * _.dropRightWhile(users, ['active', false]);
  7767. * // => objects for ['barney']
  7768. *
  7769. * // The `_.property` iteratee shorthand.
  7770. * _.dropRightWhile(users, 'active');
  7771. * // => objects for ['barney', 'fred', 'pebbles']
  7772. */
  7773. function dropRightWhile(array, predicate) {
  7774. return (array && array.length)
  7775. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7776. : [];
  7777. }
  7778. /**
  7779. * Creates a slice of `array` excluding elements dropped from the beginning.
  7780. * Elements are dropped until `predicate` returns falsey. The predicate is
  7781. * invoked with three arguments: (value, index, array).
  7782. *
  7783. * @static
  7784. * @memberOf _
  7785. * @since 3.0.0
  7786. * @category Array
  7787. * @param {Array} array The array to query.
  7788. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7789. * @returns {Array} Returns the slice of `array`.
  7790. * @example
  7791. *
  7792. * var users = [
  7793. * { 'user': 'barney', 'active': false },
  7794. * { 'user': 'fred', 'active': false },
  7795. * { 'user': 'pebbles', 'active': true }
  7796. * ];
  7797. *
  7798. * _.dropWhile(users, function(o) { return !o.active; });
  7799. * // => objects for ['pebbles']
  7800. *
  7801. * // The `_.matches` iteratee shorthand.
  7802. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7803. * // => objects for ['fred', 'pebbles']
  7804. *
  7805. * // The `_.matchesProperty` iteratee shorthand.
  7806. * _.dropWhile(users, ['active', false]);
  7807. * // => objects for ['pebbles']
  7808. *
  7809. * // The `_.property` iteratee shorthand.
  7810. * _.dropWhile(users, 'active');
  7811. * // => objects for ['barney', 'fred', 'pebbles']
  7812. */
  7813. function dropWhile(array, predicate) {
  7814. return (array && array.length)
  7815. ? baseWhile(array, getIteratee(predicate, 3), true)
  7816. : [];
  7817. }
  7818. /**
  7819. * Fills elements of `array` with `value` from `start` up to, but not
  7820. * including, `end`.
  7821. *
  7822. * **Note:** This method mutates `array`.
  7823. *
  7824. * @static
  7825. * @memberOf _
  7826. * @since 3.2.0
  7827. * @category Array
  7828. * @param {Array} array The array to fill.
  7829. * @param {*} value The value to fill `array` with.
  7830. * @param {number} [start=0] The start position.
  7831. * @param {number} [end=array.length] The end position.
  7832. * @returns {Array} Returns `array`.
  7833. * @example
  7834. *
  7835. * var array = [1, 2, 3];
  7836. *
  7837. * _.fill(array, 'a');
  7838. * console.log(array);
  7839. * // => ['a', 'a', 'a']
  7840. *
  7841. * _.fill(Array(3), 2);
  7842. * // => [2, 2, 2]
  7843. *
  7844. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7845. * // => [4, '*', '*', 10]
  7846. */
  7847. function fill(array, value, start, end) {
  7848. var length = array == null ? 0 : array.length;
  7849. if (!length) {
  7850. return [];
  7851. }
  7852. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7853. start = 0;
  7854. end = length;
  7855. }
  7856. return baseFill(array, value, start, end);
  7857. }
  7858. /**
  7859. * This method is like `_.find` except that it returns the index of the first
  7860. * element `predicate` returns truthy for instead of the element itself.
  7861. *
  7862. * @static
  7863. * @memberOf _
  7864. * @since 1.1.0
  7865. * @category Array
  7866. * @param {Array} array The array to inspect.
  7867. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7868. * @param {number} [fromIndex=0] The index to search from.
  7869. * @returns {number} Returns the index of the found element, else `-1`.
  7870. * @example
  7871. *
  7872. * var users = [
  7873. * { 'user': 'barney', 'active': false },
  7874. * { 'user': 'fred', 'active': false },
  7875. * { 'user': 'pebbles', 'active': true }
  7876. * ];
  7877. *
  7878. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7879. * // => 0
  7880. *
  7881. * // The `_.matches` iteratee shorthand.
  7882. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7883. * // => 1
  7884. *
  7885. * // The `_.matchesProperty` iteratee shorthand.
  7886. * _.findIndex(users, ['active', false]);
  7887. * // => 0
  7888. *
  7889. * // The `_.property` iteratee shorthand.
  7890. * _.findIndex(users, 'active');
  7891. * // => 2
  7892. */
  7893. function findIndex(array, predicate, fromIndex) {
  7894. var length = array == null ? 0 : array.length;
  7895. if (!length) {
  7896. return -1;
  7897. }
  7898. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7899. if (index < 0) {
  7900. index = nativeMax(length + index, 0);
  7901. }
  7902. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7903. }
  7904. /**
  7905. * This method is like `_.findIndex` except that it iterates over elements
  7906. * of `collection` from right to left.
  7907. *
  7908. * @static
  7909. * @memberOf _
  7910. * @since 2.0.0
  7911. * @category Array
  7912. * @param {Array} array The array to inspect.
  7913. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7914. * @param {number} [fromIndex=array.length-1] The index to search from.
  7915. * @returns {number} Returns the index of the found element, else `-1`.
  7916. * @example
  7917. *
  7918. * var users = [
  7919. * { 'user': 'barney', 'active': true },
  7920. * { 'user': 'fred', 'active': false },
  7921. * { 'user': 'pebbles', 'active': false }
  7922. * ];
  7923. *
  7924. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7925. * // => 2
  7926. *
  7927. * // The `_.matches` iteratee shorthand.
  7928. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7929. * // => 0
  7930. *
  7931. * // The `_.matchesProperty` iteratee shorthand.
  7932. * _.findLastIndex(users, ['active', false]);
  7933. * // => 2
  7934. *
  7935. * // The `_.property` iteratee shorthand.
  7936. * _.findLastIndex(users, 'active');
  7937. * // => 0
  7938. */
  7939. function findLastIndex(array, predicate, fromIndex) {
  7940. var length = array == null ? 0 : array.length;
  7941. if (!length) {
  7942. return -1;
  7943. }
  7944. var index = length - 1;
  7945. if (fromIndex !== undefined) {
  7946. index = toInteger(fromIndex);
  7947. index = fromIndex < 0
  7948. ? nativeMax(length + index, 0)
  7949. : nativeMin(index, length - 1);
  7950. }
  7951. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7952. }
  7953. /**
  7954. * Flattens `array` a single level deep.
  7955. *
  7956. * @static
  7957. * @memberOf _
  7958. * @since 0.1.0
  7959. * @category Array
  7960. * @param {Array} array The array to flatten.
  7961. * @returns {Array} Returns the new flattened array.
  7962. * @example
  7963. *
  7964. * _.flatten([1, [2, [3, [4]], 5]]);
  7965. * // => [1, 2, [3, [4]], 5]
  7966. */
  7967. function flatten(array) {
  7968. var length = array == null ? 0 : array.length;
  7969. return length ? baseFlatten(array, 1) : [];
  7970. }
  7971. /**
  7972. * Recursively flattens `array`.
  7973. *
  7974. * @static
  7975. * @memberOf _
  7976. * @since 3.0.0
  7977. * @category Array
  7978. * @param {Array} array The array to flatten.
  7979. * @returns {Array} Returns the new flattened array.
  7980. * @example
  7981. *
  7982. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7983. * // => [1, 2, 3, 4, 5]
  7984. */
  7985. function flattenDeep(array) {
  7986. var length = array == null ? 0 : array.length;
  7987. return length ? baseFlatten(array, INFINITY) : [];
  7988. }
  7989. /**
  7990. * Recursively flatten `array` up to `depth` times.
  7991. *
  7992. * @static
  7993. * @memberOf _
  7994. * @since 4.4.0
  7995. * @category Array
  7996. * @param {Array} array The array to flatten.
  7997. * @param {number} [depth=1] The maximum recursion depth.
  7998. * @returns {Array} Returns the new flattened array.
  7999. * @example
  8000. *
  8001. * var array = [1, [2, [3, [4]], 5]];
  8002. *
  8003. * _.flattenDepth(array, 1);
  8004. * // => [1, 2, [3, [4]], 5]
  8005. *
  8006. * _.flattenDepth(array, 2);
  8007. * // => [1, 2, 3, [4], 5]
  8008. */
  8009. function flattenDepth(array, depth) {
  8010. var length = array == null ? 0 : array.length;
  8011. if (!length) {
  8012. return [];
  8013. }
  8014. depth = depth === undefined ? 1 : toInteger(depth);
  8015. return baseFlatten(array, depth);
  8016. }
  8017. /**
  8018. * The inverse of `_.toPairs`; this method returns an object composed
  8019. * from key-value `pairs`.
  8020. *
  8021. * @static
  8022. * @memberOf _
  8023. * @since 4.0.0
  8024. * @category Array
  8025. * @param {Array} pairs The key-value pairs.
  8026. * @returns {Object} Returns the new object.
  8027. * @example
  8028. *
  8029. * _.fromPairs([['a', 1], ['b', 2]]);
  8030. * // => { 'a': 1, 'b': 2 }
  8031. */
  8032. function fromPairs(pairs) {
  8033. var index = -1,
  8034. length = pairs == null ? 0 : pairs.length,
  8035. result = {};
  8036. while (++index < length) {
  8037. var pair = pairs[index];
  8038. result[pair[0]] = pair[1];
  8039. }
  8040. return result;
  8041. }
  8042. /**
  8043. * Gets the first element of `array`.
  8044. *
  8045. * @static
  8046. * @memberOf _
  8047. * @since 0.1.0
  8048. * @alias first
  8049. * @category Array
  8050. * @param {Array} array The array to query.
  8051. * @returns {*} Returns the first element of `array`.
  8052. * @example
  8053. *
  8054. * _.head([1, 2, 3]);
  8055. * // => 1
  8056. *
  8057. * _.head([]);
  8058. * // => undefined
  8059. */
  8060. function head(array) {
  8061. return (array && array.length) ? array[0] : undefined;
  8062. }
  8063. /**
  8064. * Gets the index at which the first occurrence of `value` is found in `array`
  8065. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8066. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8067. * offset from the end of `array`.
  8068. *
  8069. * @static
  8070. * @memberOf _
  8071. * @since 0.1.0
  8072. * @category Array
  8073. * @param {Array} array The array to inspect.
  8074. * @param {*} value The value to search for.
  8075. * @param {number} [fromIndex=0] The index to search from.
  8076. * @returns {number} Returns the index of the matched value, else `-1`.
  8077. * @example
  8078. *
  8079. * _.indexOf([1, 2, 1, 2], 2);
  8080. * // => 1
  8081. *
  8082. * // Search from the `fromIndex`.
  8083. * _.indexOf([1, 2, 1, 2], 2, 2);
  8084. * // => 3
  8085. */
  8086. function indexOf(array, value, fromIndex) {
  8087. var length = array == null ? 0 : array.length;
  8088. if (!length) {
  8089. return -1;
  8090. }
  8091. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8092. if (index < 0) {
  8093. index = nativeMax(length + index, 0);
  8094. }
  8095. return baseIndexOf(array, value, index);
  8096. }
  8097. /**
  8098. * Gets all but the last element of `array`.
  8099. *
  8100. * @static
  8101. * @memberOf _
  8102. * @since 0.1.0
  8103. * @category Array
  8104. * @param {Array} array The array to query.
  8105. * @returns {Array} Returns the slice of `array`.
  8106. * @example
  8107. *
  8108. * _.initial([1, 2, 3]);
  8109. * // => [1, 2]
  8110. */
  8111. function initial(array) {
  8112. var length = array == null ? 0 : array.length;
  8113. return length ? baseSlice(array, 0, -1) : [];
  8114. }
  8115. /**
  8116. * Creates an array of unique values that are included in all given arrays
  8117. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8118. * for equality comparisons. The order and references of result values are
  8119. * determined by the first array.
  8120. *
  8121. * @static
  8122. * @memberOf _
  8123. * @since 0.1.0
  8124. * @category Array
  8125. * @param {...Array} [arrays] The arrays to inspect.
  8126. * @returns {Array} Returns the new array of intersecting values.
  8127. * @example
  8128. *
  8129. * _.intersection([2, 1], [2, 3]);
  8130. * // => [2]
  8131. */
  8132. var intersection = baseRest(function(arrays) {
  8133. var mapped = arrayMap(arrays, castArrayLikeObject);
  8134. return (mapped.length && mapped[0] === arrays[0])
  8135. ? baseIntersection(mapped)
  8136. : [];
  8137. });
  8138. /**
  8139. * This method is like `_.intersection` except that it accepts `iteratee`
  8140. * which is invoked for each element of each `arrays` to generate the criterion
  8141. * by which they're compared. The order and references of result values are
  8142. * determined by the first array. The iteratee is invoked with one argument:
  8143. * (value).
  8144. *
  8145. * @static
  8146. * @memberOf _
  8147. * @since 4.0.0
  8148. * @category Array
  8149. * @param {...Array} [arrays] The arrays to inspect.
  8150. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8151. * @returns {Array} Returns the new array of intersecting values.
  8152. * @example
  8153. *
  8154. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8155. * // => [2.1]
  8156. *
  8157. * // The `_.property` iteratee shorthand.
  8158. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8159. * // => [{ 'x': 1 }]
  8160. */
  8161. var intersectionBy = baseRest(function(arrays) {
  8162. var iteratee = last(arrays),
  8163. mapped = arrayMap(arrays, castArrayLikeObject);
  8164. if (iteratee === last(mapped)) {
  8165. iteratee = undefined;
  8166. } else {
  8167. mapped.pop();
  8168. }
  8169. return (mapped.length && mapped[0] === arrays[0])
  8170. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8171. : [];
  8172. });
  8173. /**
  8174. * This method is like `_.intersection` except that it accepts `comparator`
  8175. * which is invoked to compare elements of `arrays`. The order and references
  8176. * of result values are determined by the first array. The comparator is
  8177. * invoked with two arguments: (arrVal, othVal).
  8178. *
  8179. * @static
  8180. * @memberOf _
  8181. * @since 4.0.0
  8182. * @category Array
  8183. * @param {...Array} [arrays] The arrays to inspect.
  8184. * @param {Function} [comparator] The comparator invoked per element.
  8185. * @returns {Array} Returns the new array of intersecting values.
  8186. * @example
  8187. *
  8188. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8189. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8190. *
  8191. * _.intersectionWith(objects, others, _.isEqual);
  8192. * // => [{ 'x': 1, 'y': 2 }]
  8193. */
  8194. var intersectionWith = baseRest(function(arrays) {
  8195. var comparator = last(arrays),
  8196. mapped = arrayMap(arrays, castArrayLikeObject);
  8197. comparator = typeof comparator == 'function' ? comparator : undefined;
  8198. if (comparator) {
  8199. mapped.pop();
  8200. }
  8201. return (mapped.length && mapped[0] === arrays[0])
  8202. ? baseIntersection(mapped, undefined, comparator)
  8203. : [];
  8204. });
  8205. /**
  8206. * Converts all elements in `array` into a string separated by `separator`.
  8207. *
  8208. * @static
  8209. * @memberOf _
  8210. * @since 4.0.0
  8211. * @category Array
  8212. * @param {Array} array The array to convert.
  8213. * @param {string} [separator=','] The element separator.
  8214. * @returns {string} Returns the joined string.
  8215. * @example
  8216. *
  8217. * _.join(['a', 'b', 'c'], '~');
  8218. * // => 'a~b~c'
  8219. */
  8220. function join(array, separator) {
  8221. return array == null ? '' : nativeJoin.call(array, separator);
  8222. }
  8223. /**
  8224. * Gets the last element of `array`.
  8225. *
  8226. * @static
  8227. * @memberOf _
  8228. * @since 0.1.0
  8229. * @category Array
  8230. * @param {Array} array The array to query.
  8231. * @returns {*} Returns the last element of `array`.
  8232. * @example
  8233. *
  8234. * _.last([1, 2, 3]);
  8235. * // => 3
  8236. */
  8237. function last(array) {
  8238. var length = array == null ? 0 : array.length;
  8239. return length ? array[length - 1] : undefined;
  8240. }
  8241. /**
  8242. * This method is like `_.indexOf` except that it iterates over elements of
  8243. * `array` from right to left.
  8244. *
  8245. * @static
  8246. * @memberOf _
  8247. * @since 0.1.0
  8248. * @category Array
  8249. * @param {Array} array The array to inspect.
  8250. * @param {*} value The value to search for.
  8251. * @param {number} [fromIndex=array.length-1] The index to search from.
  8252. * @returns {number} Returns the index of the matched value, else `-1`.
  8253. * @example
  8254. *
  8255. * _.lastIndexOf([1, 2, 1, 2], 2);
  8256. * // => 3
  8257. *
  8258. * // Search from the `fromIndex`.
  8259. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8260. * // => 1
  8261. */
  8262. function lastIndexOf(array, value, fromIndex) {
  8263. var length = array == null ? 0 : array.length;
  8264. if (!length) {
  8265. return -1;
  8266. }
  8267. var index = length;
  8268. if (fromIndex !== undefined) {
  8269. index = toInteger(fromIndex);
  8270. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8271. }
  8272. return value === value
  8273. ? strictLastIndexOf(array, value, index)
  8274. : baseFindIndex(array, baseIsNaN, index, true);
  8275. }
  8276. /**
  8277. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8278. * element from the end is returned.
  8279. *
  8280. * @static
  8281. * @memberOf _
  8282. * @since 4.11.0
  8283. * @category Array
  8284. * @param {Array} array The array to query.
  8285. * @param {number} [n=0] The index of the element to return.
  8286. * @returns {*} Returns the nth element of `array`.
  8287. * @example
  8288. *
  8289. * var array = ['a', 'b', 'c', 'd'];
  8290. *
  8291. * _.nth(array, 1);
  8292. * // => 'b'
  8293. *
  8294. * _.nth(array, -2);
  8295. * // => 'c';
  8296. */
  8297. function nth(array, n) {
  8298. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8299. }
  8300. /**
  8301. * Removes all given values from `array` using
  8302. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8303. * for equality comparisons.
  8304. *
  8305. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8306. * to remove elements from an array by predicate.
  8307. *
  8308. * @static
  8309. * @memberOf _
  8310. * @since 2.0.0
  8311. * @category Array
  8312. * @param {Array} array The array to modify.
  8313. * @param {...*} [values] The values to remove.
  8314. * @returns {Array} Returns `array`.
  8315. * @example
  8316. *
  8317. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8318. *
  8319. * _.pull(array, 'a', 'c');
  8320. * console.log(array);
  8321. * // => ['b', 'b']
  8322. */
  8323. var pull = baseRest(pullAll);
  8324. /**
  8325. * This method is like `_.pull` except that it accepts an array of values to remove.
  8326. *
  8327. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8328. *
  8329. * @static
  8330. * @memberOf _
  8331. * @since 4.0.0
  8332. * @category Array
  8333. * @param {Array} array The array to modify.
  8334. * @param {Array} values The values to remove.
  8335. * @returns {Array} Returns `array`.
  8336. * @example
  8337. *
  8338. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8339. *
  8340. * _.pullAll(array, ['a', 'c']);
  8341. * console.log(array);
  8342. * // => ['b', 'b']
  8343. */
  8344. function pullAll(array, values) {
  8345. return (array && array.length && values && values.length)
  8346. ? basePullAll(array, values)
  8347. : array;
  8348. }
  8349. /**
  8350. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8351. * invoked for each element of `array` and `values` to generate the criterion
  8352. * by which they're compared. The iteratee is invoked with one argument: (value).
  8353. *
  8354. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8355. *
  8356. * @static
  8357. * @memberOf _
  8358. * @since 4.0.0
  8359. * @category Array
  8360. * @param {Array} array The array to modify.
  8361. * @param {Array} values The values to remove.
  8362. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8363. * @returns {Array} Returns `array`.
  8364. * @example
  8365. *
  8366. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8367. *
  8368. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8369. * console.log(array);
  8370. * // => [{ 'x': 2 }]
  8371. */
  8372. function pullAllBy(array, values, iteratee) {
  8373. return (array && array.length && values && values.length)
  8374. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8375. : array;
  8376. }
  8377. /**
  8378. * This method is like `_.pullAll` except that it accepts `comparator` which
  8379. * is invoked to compare elements of `array` to `values`. The comparator is
  8380. * invoked with two arguments: (arrVal, othVal).
  8381. *
  8382. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8383. *
  8384. * @static
  8385. * @memberOf _
  8386. * @since 4.6.0
  8387. * @category Array
  8388. * @param {Array} array The array to modify.
  8389. * @param {Array} values The values to remove.
  8390. * @param {Function} [comparator] The comparator invoked per element.
  8391. * @returns {Array} Returns `array`.
  8392. * @example
  8393. *
  8394. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8395. *
  8396. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8397. * console.log(array);
  8398. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8399. */
  8400. function pullAllWith(array, values, comparator) {
  8401. return (array && array.length && values && values.length)
  8402. ? basePullAll(array, values, undefined, comparator)
  8403. : array;
  8404. }
  8405. /**
  8406. * Removes elements from `array` corresponding to `indexes` and returns an
  8407. * array of removed elements.
  8408. *
  8409. * **Note:** Unlike `_.at`, this method mutates `array`.
  8410. *
  8411. * @static
  8412. * @memberOf _
  8413. * @since 3.0.0
  8414. * @category Array
  8415. * @param {Array} array The array to modify.
  8416. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8417. * @returns {Array} Returns the new array of removed elements.
  8418. * @example
  8419. *
  8420. * var array = ['a', 'b', 'c', 'd'];
  8421. * var pulled = _.pullAt(array, [1, 3]);
  8422. *
  8423. * console.log(array);
  8424. * // => ['a', 'c']
  8425. *
  8426. * console.log(pulled);
  8427. * // => ['b', 'd']
  8428. */
  8429. var pullAt = flatRest(function(array, indexes) {
  8430. var length = array == null ? 0 : array.length,
  8431. result = baseAt(array, indexes);
  8432. basePullAt(array, arrayMap(indexes, function(index) {
  8433. return isIndex(index, length) ? +index : index;
  8434. }).sort(compareAscending));
  8435. return result;
  8436. });
  8437. /**
  8438. * Removes all elements from `array` that `predicate` returns truthy for
  8439. * and returns an array of the removed elements. The predicate is invoked
  8440. * with three arguments: (value, index, array).
  8441. *
  8442. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8443. * to pull elements from an array by value.
  8444. *
  8445. * @static
  8446. * @memberOf _
  8447. * @since 2.0.0
  8448. * @category Array
  8449. * @param {Array} array The array to modify.
  8450. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8451. * @returns {Array} Returns the new array of removed elements.
  8452. * @example
  8453. *
  8454. * var array = [1, 2, 3, 4];
  8455. * var evens = _.remove(array, function(n) {
  8456. * return n % 2 == 0;
  8457. * });
  8458. *
  8459. * console.log(array);
  8460. * // => [1, 3]
  8461. *
  8462. * console.log(evens);
  8463. * // => [2, 4]
  8464. */
  8465. function remove(array, predicate) {
  8466. var result = [];
  8467. if (!(array && array.length)) {
  8468. return result;
  8469. }
  8470. var index = -1,
  8471. indexes = [],
  8472. length = array.length;
  8473. predicate = getIteratee(predicate, 3);
  8474. while (++index < length) {
  8475. var value = array[index];
  8476. if (predicate(value, index, array)) {
  8477. result.push(value);
  8478. indexes.push(index);
  8479. }
  8480. }
  8481. basePullAt(array, indexes);
  8482. return result;
  8483. }
  8484. /**
  8485. * Reverses `array` so that the first element becomes the last, the second
  8486. * element becomes the second to last, and so on.
  8487. *
  8488. * **Note:** This method mutates `array` and is based on
  8489. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8490. *
  8491. * @static
  8492. * @memberOf _
  8493. * @since 4.0.0
  8494. * @category Array
  8495. * @param {Array} array The array to modify.
  8496. * @returns {Array} Returns `array`.
  8497. * @example
  8498. *
  8499. * var array = [1, 2, 3];
  8500. *
  8501. * _.reverse(array);
  8502. * // => [3, 2, 1]
  8503. *
  8504. * console.log(array);
  8505. * // => [3, 2, 1]
  8506. */
  8507. function reverse(array) {
  8508. return array == null ? array : nativeReverse.call(array);
  8509. }
  8510. /**
  8511. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8512. *
  8513. * **Note:** This method is used instead of
  8514. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8515. * returned.
  8516. *
  8517. * @static
  8518. * @memberOf _
  8519. * @since 3.0.0
  8520. * @category Array
  8521. * @param {Array} array The array to slice.
  8522. * @param {number} [start=0] The start position.
  8523. * @param {number} [end=array.length] The end position.
  8524. * @returns {Array} Returns the slice of `array`.
  8525. */
  8526. function slice(array, start, end) {
  8527. var length = array == null ? 0 : array.length;
  8528. if (!length) {
  8529. return [];
  8530. }
  8531. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8532. start = 0;
  8533. end = length;
  8534. }
  8535. else {
  8536. start = start == null ? 0 : toInteger(start);
  8537. end = end === undefined ? length : toInteger(end);
  8538. }
  8539. return baseSlice(array, start, end);
  8540. }
  8541. /**
  8542. * Uses a binary search to determine the lowest index at which `value`
  8543. * should be inserted into `array` in order to maintain its sort order.
  8544. *
  8545. * @static
  8546. * @memberOf _
  8547. * @since 0.1.0
  8548. * @category Array
  8549. * @param {Array} array The sorted array to inspect.
  8550. * @param {*} value The value to evaluate.
  8551. * @returns {number} Returns the index at which `value` should be inserted
  8552. * into `array`.
  8553. * @example
  8554. *
  8555. * _.sortedIndex([30, 50], 40);
  8556. * // => 1
  8557. */
  8558. function sortedIndex(array, value) {
  8559. return baseSortedIndex(array, value);
  8560. }
  8561. /**
  8562. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8563. * which is invoked for `value` and each element of `array` to compute their
  8564. * sort ranking. The iteratee is invoked with one argument: (value).
  8565. *
  8566. * @static
  8567. * @memberOf _
  8568. * @since 4.0.0
  8569. * @category Array
  8570. * @param {Array} array The sorted array to inspect.
  8571. * @param {*} value The value to evaluate.
  8572. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8573. * @returns {number} Returns the index at which `value` should be inserted
  8574. * into `array`.
  8575. * @example
  8576. *
  8577. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8578. *
  8579. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8580. * // => 0
  8581. *
  8582. * // The `_.property` iteratee shorthand.
  8583. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8584. * // => 0
  8585. */
  8586. function sortedIndexBy(array, value, iteratee) {
  8587. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8588. }
  8589. /**
  8590. * This method is like `_.indexOf` except that it performs a binary
  8591. * search on a sorted `array`.
  8592. *
  8593. * @static
  8594. * @memberOf _
  8595. * @since 4.0.0
  8596. * @category Array
  8597. * @param {Array} array The array to inspect.
  8598. * @param {*} value The value to search for.
  8599. * @returns {number} Returns the index of the matched value, else `-1`.
  8600. * @example
  8601. *
  8602. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8603. * // => 1
  8604. */
  8605. function sortedIndexOf(array, value) {
  8606. var length = array == null ? 0 : array.length;
  8607. if (length) {
  8608. var index = baseSortedIndex(array, value);
  8609. if (index < length && eq(array[index], value)) {
  8610. return index;
  8611. }
  8612. }
  8613. return -1;
  8614. }
  8615. /**
  8616. * This method is like `_.sortedIndex` except that it returns the highest
  8617. * index at which `value` should be inserted into `array` in order to
  8618. * maintain its sort order.
  8619. *
  8620. * @static
  8621. * @memberOf _
  8622. * @since 3.0.0
  8623. * @category Array
  8624. * @param {Array} array The sorted array to inspect.
  8625. * @param {*} value The value to evaluate.
  8626. * @returns {number} Returns the index at which `value` should be inserted
  8627. * into `array`.
  8628. * @example
  8629. *
  8630. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8631. * // => 4
  8632. */
  8633. function sortedLastIndex(array, value) {
  8634. return baseSortedIndex(array, value, true);
  8635. }
  8636. /**
  8637. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8638. * which is invoked for `value` and each element of `array` to compute their
  8639. * sort ranking. The iteratee is invoked with one argument: (value).
  8640. *
  8641. * @static
  8642. * @memberOf _
  8643. * @since 4.0.0
  8644. * @category Array
  8645. * @param {Array} array The sorted array to inspect.
  8646. * @param {*} value The value to evaluate.
  8647. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8648. * @returns {number} Returns the index at which `value` should be inserted
  8649. * into `array`.
  8650. * @example
  8651. *
  8652. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8653. *
  8654. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8655. * // => 1
  8656. *
  8657. * // The `_.property` iteratee shorthand.
  8658. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8659. * // => 1
  8660. */
  8661. function sortedLastIndexBy(array, value, iteratee) {
  8662. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8663. }
  8664. /**
  8665. * This method is like `_.lastIndexOf` except that it performs a binary
  8666. * search on a sorted `array`.
  8667. *
  8668. * @static
  8669. * @memberOf _
  8670. * @since 4.0.0
  8671. * @category Array
  8672. * @param {Array} array The array to inspect.
  8673. * @param {*} value The value to search for.
  8674. * @returns {number} Returns the index of the matched value, else `-1`.
  8675. * @example
  8676. *
  8677. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8678. * // => 3
  8679. */
  8680. function sortedLastIndexOf(array, value) {
  8681. var length = array == null ? 0 : array.length;
  8682. if (length) {
  8683. var index = baseSortedIndex(array, value, true) - 1;
  8684. if (eq(array[index], value)) {
  8685. return index;
  8686. }
  8687. }
  8688. return -1;
  8689. }
  8690. /**
  8691. * This method is like `_.uniq` except that it's designed and optimized
  8692. * for sorted arrays.
  8693. *
  8694. * @static
  8695. * @memberOf _
  8696. * @since 4.0.0
  8697. * @category Array
  8698. * @param {Array} array The array to inspect.
  8699. * @returns {Array} Returns the new duplicate free array.
  8700. * @example
  8701. *
  8702. * _.sortedUniq([1, 1, 2]);
  8703. * // => [1, 2]
  8704. */
  8705. function sortedUniq(array) {
  8706. return (array && array.length)
  8707. ? baseSortedUniq(array)
  8708. : [];
  8709. }
  8710. /**
  8711. * This method is like `_.uniqBy` except that it's designed and optimized
  8712. * for sorted arrays.
  8713. *
  8714. * @static
  8715. * @memberOf _
  8716. * @since 4.0.0
  8717. * @category Array
  8718. * @param {Array} array The array to inspect.
  8719. * @param {Function} [iteratee] The iteratee invoked per element.
  8720. * @returns {Array} Returns the new duplicate free array.
  8721. * @example
  8722. *
  8723. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8724. * // => [1.1, 2.3]
  8725. */
  8726. function sortedUniqBy(array, iteratee) {
  8727. return (array && array.length)
  8728. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8729. : [];
  8730. }
  8731. /**
  8732. * Gets all but the first element of `array`.
  8733. *
  8734. * @static
  8735. * @memberOf _
  8736. * @since 4.0.0
  8737. * @category Array
  8738. * @param {Array} array The array to query.
  8739. * @returns {Array} Returns the slice of `array`.
  8740. * @example
  8741. *
  8742. * _.tail([1, 2, 3]);
  8743. * // => [2, 3]
  8744. */
  8745. function tail(array) {
  8746. var length = array == null ? 0 : array.length;
  8747. return length ? baseSlice(array, 1, length) : [];
  8748. }
  8749. /**
  8750. * Creates a slice of `array` with `n` elements taken from the beginning.
  8751. *
  8752. * @static
  8753. * @memberOf _
  8754. * @since 0.1.0
  8755. * @category Array
  8756. * @param {Array} array The array to query.
  8757. * @param {number} [n=1] The number of elements to take.
  8758. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8759. * @returns {Array} Returns the slice of `array`.
  8760. * @example
  8761. *
  8762. * _.take([1, 2, 3]);
  8763. * // => [1]
  8764. *
  8765. * _.take([1, 2, 3], 2);
  8766. * // => [1, 2]
  8767. *
  8768. * _.take([1, 2, 3], 5);
  8769. * // => [1, 2, 3]
  8770. *
  8771. * _.take([1, 2, 3], 0);
  8772. * // => []
  8773. */
  8774. function take(array, n, guard) {
  8775. if (!(array && array.length)) {
  8776. return [];
  8777. }
  8778. n = (guard || n === undefined) ? 1 : toInteger(n);
  8779. return baseSlice(array, 0, n < 0 ? 0 : n);
  8780. }
  8781. /**
  8782. * Creates a slice of `array` with `n` elements taken from the end.
  8783. *
  8784. * @static
  8785. * @memberOf _
  8786. * @since 3.0.0
  8787. * @category Array
  8788. * @param {Array} array The array to query.
  8789. * @param {number} [n=1] The number of elements to take.
  8790. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8791. * @returns {Array} Returns the slice of `array`.
  8792. * @example
  8793. *
  8794. * _.takeRight([1, 2, 3]);
  8795. * // => [3]
  8796. *
  8797. * _.takeRight([1, 2, 3], 2);
  8798. * // => [2, 3]
  8799. *
  8800. * _.takeRight([1, 2, 3], 5);
  8801. * // => [1, 2, 3]
  8802. *
  8803. * _.takeRight([1, 2, 3], 0);
  8804. * // => []
  8805. */
  8806. function takeRight(array, n, guard) {
  8807. var length = array == null ? 0 : array.length;
  8808. if (!length) {
  8809. return [];
  8810. }
  8811. n = (guard || n === undefined) ? 1 : toInteger(n);
  8812. n = length - n;
  8813. return baseSlice(array, n < 0 ? 0 : n, length);
  8814. }
  8815. /**
  8816. * Creates a slice of `array` with elements taken from the end. Elements are
  8817. * taken until `predicate` returns falsey. The predicate is invoked with
  8818. * three arguments: (value, index, array).
  8819. *
  8820. * @static
  8821. * @memberOf _
  8822. * @since 3.0.0
  8823. * @category Array
  8824. * @param {Array} array The array to query.
  8825. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8826. * @returns {Array} Returns the slice of `array`.
  8827. * @example
  8828. *
  8829. * var users = [
  8830. * { 'user': 'barney', 'active': true },
  8831. * { 'user': 'fred', 'active': false },
  8832. * { 'user': 'pebbles', 'active': false }
  8833. * ];
  8834. *
  8835. * _.takeRightWhile(users, function(o) { return !o.active; });
  8836. * // => objects for ['fred', 'pebbles']
  8837. *
  8838. * // The `_.matches` iteratee shorthand.
  8839. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8840. * // => objects for ['pebbles']
  8841. *
  8842. * // The `_.matchesProperty` iteratee shorthand.
  8843. * _.takeRightWhile(users, ['active', false]);
  8844. * // => objects for ['fred', 'pebbles']
  8845. *
  8846. * // The `_.property` iteratee shorthand.
  8847. * _.takeRightWhile(users, 'active');
  8848. * // => []
  8849. */
  8850. function takeRightWhile(array, predicate) {
  8851. return (array && array.length)
  8852. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8853. : [];
  8854. }
  8855. /**
  8856. * Creates a slice of `array` with elements taken from the beginning. Elements
  8857. * are taken until `predicate` returns falsey. The predicate is invoked with
  8858. * three arguments: (value, index, array).
  8859. *
  8860. * @static
  8861. * @memberOf _
  8862. * @since 3.0.0
  8863. * @category Array
  8864. * @param {Array} array The array to query.
  8865. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8866. * @returns {Array} Returns the slice of `array`.
  8867. * @example
  8868. *
  8869. * var users = [
  8870. * { 'user': 'barney', 'active': false },
  8871. * { 'user': 'fred', 'active': false },
  8872. * { 'user': 'pebbles', 'active': true }
  8873. * ];
  8874. *
  8875. * _.takeWhile(users, function(o) { return !o.active; });
  8876. * // => objects for ['barney', 'fred']
  8877. *
  8878. * // The `_.matches` iteratee shorthand.
  8879. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8880. * // => objects for ['barney']
  8881. *
  8882. * // The `_.matchesProperty` iteratee shorthand.
  8883. * _.takeWhile(users, ['active', false]);
  8884. * // => objects for ['barney', 'fred']
  8885. *
  8886. * // The `_.property` iteratee shorthand.
  8887. * _.takeWhile(users, 'active');
  8888. * // => []
  8889. */
  8890. function takeWhile(array, predicate) {
  8891. return (array && array.length)
  8892. ? baseWhile(array, getIteratee(predicate, 3))
  8893. : [];
  8894. }
  8895. /**
  8896. * Creates an array of unique values, in order, from all given arrays using
  8897. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8898. * for equality comparisons.
  8899. *
  8900. * @static
  8901. * @memberOf _
  8902. * @since 0.1.0
  8903. * @category Array
  8904. * @param {...Array} [arrays] The arrays to inspect.
  8905. * @returns {Array} Returns the new array of combined values.
  8906. * @example
  8907. *
  8908. * _.union([2], [1, 2]);
  8909. * // => [2, 1]
  8910. */
  8911. var union = baseRest(function(arrays) {
  8912. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8913. });
  8914. /**
  8915. * This method is like `_.union` except that it accepts `iteratee` which is
  8916. * invoked for each element of each `arrays` to generate the criterion by
  8917. * which uniqueness is computed. Result values are chosen from the first
  8918. * array in which the value occurs. The iteratee is invoked with one argument:
  8919. * (value).
  8920. *
  8921. * @static
  8922. * @memberOf _
  8923. * @since 4.0.0
  8924. * @category Array
  8925. * @param {...Array} [arrays] The arrays to inspect.
  8926. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8927. * @returns {Array} Returns the new array of combined values.
  8928. * @example
  8929. *
  8930. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8931. * // => [2.1, 1.2]
  8932. *
  8933. * // The `_.property` iteratee shorthand.
  8934. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8935. * // => [{ 'x': 1 }, { 'x': 2 }]
  8936. */
  8937. var unionBy = baseRest(function(arrays) {
  8938. var iteratee = last(arrays);
  8939. if (isArrayLikeObject(iteratee)) {
  8940. iteratee = undefined;
  8941. }
  8942. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8943. });
  8944. /**
  8945. * This method is like `_.union` except that it accepts `comparator` which
  8946. * is invoked to compare elements of `arrays`. Result values are chosen from
  8947. * the first array in which the value occurs. The comparator is invoked
  8948. * with two arguments: (arrVal, othVal).
  8949. *
  8950. * @static
  8951. * @memberOf _
  8952. * @since 4.0.0
  8953. * @category Array
  8954. * @param {...Array} [arrays] The arrays to inspect.
  8955. * @param {Function} [comparator] The comparator invoked per element.
  8956. * @returns {Array} Returns the new array of combined values.
  8957. * @example
  8958. *
  8959. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8960. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8961. *
  8962. * _.unionWith(objects, others, _.isEqual);
  8963. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8964. */
  8965. var unionWith = baseRest(function(arrays) {
  8966. var comparator = last(arrays);
  8967. comparator = typeof comparator == 'function' ? comparator : undefined;
  8968. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8969. });
  8970. /**
  8971. * Creates a duplicate-free version of an array, using
  8972. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8973. * for equality comparisons, in which only the first occurrence of each element
  8974. * is kept. The order of result values is determined by the order they occur
  8975. * in the array.
  8976. *
  8977. * @static
  8978. * @memberOf _
  8979. * @since 0.1.0
  8980. * @category Array
  8981. * @param {Array} array The array to inspect.
  8982. * @returns {Array} Returns the new duplicate free array.
  8983. * @example
  8984. *
  8985. * _.uniq([2, 1, 2]);
  8986. * // => [2, 1]
  8987. */
  8988. function uniq(array) {
  8989. return (array && array.length) ? baseUniq(array) : [];
  8990. }
  8991. /**
  8992. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8993. * invoked for each element in `array` to generate the criterion by which
  8994. * uniqueness is computed. The order of result values is determined by the
  8995. * order they occur in the array. The iteratee is invoked with one argument:
  8996. * (value).
  8997. *
  8998. * @static
  8999. * @memberOf _
  9000. * @since 4.0.0
  9001. * @category Array
  9002. * @param {Array} array The array to inspect.
  9003. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9004. * @returns {Array} Returns the new duplicate free array.
  9005. * @example
  9006. *
  9007. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9008. * // => [2.1, 1.2]
  9009. *
  9010. * // The `_.property` iteratee shorthand.
  9011. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9012. * // => [{ 'x': 1 }, { 'x': 2 }]
  9013. */
  9014. function uniqBy(array, iteratee) {
  9015. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9016. }
  9017. /**
  9018. * This method is like `_.uniq` except that it accepts `comparator` which
  9019. * is invoked to compare elements of `array`. The order of result values is
  9020. * determined by the order they occur in the array.The comparator is invoked
  9021. * with two arguments: (arrVal, othVal).
  9022. *
  9023. * @static
  9024. * @memberOf _
  9025. * @since 4.0.0
  9026. * @category Array
  9027. * @param {Array} array The array to inspect.
  9028. * @param {Function} [comparator] The comparator invoked per element.
  9029. * @returns {Array} Returns the new duplicate free array.
  9030. * @example
  9031. *
  9032. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9033. *
  9034. * _.uniqWith(objects, _.isEqual);
  9035. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9036. */
  9037. function uniqWith(array, comparator) {
  9038. comparator = typeof comparator == 'function' ? comparator : undefined;
  9039. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9040. }
  9041. /**
  9042. * This method is like `_.zip` except that it accepts an array of grouped
  9043. * elements and creates an array regrouping the elements to their pre-zip
  9044. * configuration.
  9045. *
  9046. * @static
  9047. * @memberOf _
  9048. * @since 1.2.0
  9049. * @category Array
  9050. * @param {Array} array The array of grouped elements to process.
  9051. * @returns {Array} Returns the new array of regrouped elements.
  9052. * @example
  9053. *
  9054. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9055. * // => [['a', 1, true], ['b', 2, false]]
  9056. *
  9057. * _.unzip(zipped);
  9058. * // => [['a', 'b'], [1, 2], [true, false]]
  9059. */
  9060. function unzip(array) {
  9061. if (!(array && array.length)) {
  9062. return [];
  9063. }
  9064. var length = 0;
  9065. array = arrayFilter(array, function(group) {
  9066. if (isArrayLikeObject(group)) {
  9067. length = nativeMax(group.length, length);
  9068. return true;
  9069. }
  9070. });
  9071. return baseTimes(length, function(index) {
  9072. return arrayMap(array, baseProperty(index));
  9073. });
  9074. }
  9075. /**
  9076. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9077. * how regrouped values should be combined. The iteratee is invoked with the
  9078. * elements of each group: (...group).
  9079. *
  9080. * @static
  9081. * @memberOf _
  9082. * @since 3.8.0
  9083. * @category Array
  9084. * @param {Array} array The array of grouped elements to process.
  9085. * @param {Function} [iteratee=_.identity] The function to combine
  9086. * regrouped values.
  9087. * @returns {Array} Returns the new array of regrouped elements.
  9088. * @example
  9089. *
  9090. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9091. * // => [[1, 10, 100], [2, 20, 200]]
  9092. *
  9093. * _.unzipWith(zipped, _.add);
  9094. * // => [3, 30, 300]
  9095. */
  9096. function unzipWith(array, iteratee) {
  9097. if (!(array && array.length)) {
  9098. return [];
  9099. }
  9100. var result = unzip(array);
  9101. if (iteratee == null) {
  9102. return result;
  9103. }
  9104. return arrayMap(result, function(group) {
  9105. return apply(iteratee, undefined, group);
  9106. });
  9107. }
  9108. /**
  9109. * Creates an array excluding all given values using
  9110. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9111. * for equality comparisons.
  9112. *
  9113. * **Note:** Unlike `_.pull`, this method returns a new array.
  9114. *
  9115. * @static
  9116. * @memberOf _
  9117. * @since 0.1.0
  9118. * @category Array
  9119. * @param {Array} array The array to inspect.
  9120. * @param {...*} [values] The values to exclude.
  9121. * @returns {Array} Returns the new array of filtered values.
  9122. * @see _.difference, _.xor
  9123. * @example
  9124. *
  9125. * _.without([2, 1, 2, 3], 1, 2);
  9126. * // => [3]
  9127. */
  9128. var without = baseRest(function(array, values) {
  9129. return isArrayLikeObject(array)
  9130. ? baseDifference(array, values)
  9131. : [];
  9132. });
  9133. /**
  9134. * Creates an array of unique values that is the
  9135. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9136. * of the given arrays. The order of result values is determined by the order
  9137. * they occur in the arrays.
  9138. *
  9139. * @static
  9140. * @memberOf _
  9141. * @since 2.4.0
  9142. * @category Array
  9143. * @param {...Array} [arrays] The arrays to inspect.
  9144. * @returns {Array} Returns the new array of filtered values.
  9145. * @see _.difference, _.without
  9146. * @example
  9147. *
  9148. * _.xor([2, 1], [2, 3]);
  9149. * // => [1, 3]
  9150. */
  9151. var xor = baseRest(function(arrays) {
  9152. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9153. });
  9154. /**
  9155. * This method is like `_.xor` except that it accepts `iteratee` which is
  9156. * invoked for each element of each `arrays` to generate the criterion by
  9157. * which by which they're compared. The order of result values is determined
  9158. * by the order they occur in the arrays. The iteratee is invoked with one
  9159. * argument: (value).
  9160. *
  9161. * @static
  9162. * @memberOf _
  9163. * @since 4.0.0
  9164. * @category Array
  9165. * @param {...Array} [arrays] The arrays to inspect.
  9166. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9167. * @returns {Array} Returns the new array of filtered values.
  9168. * @example
  9169. *
  9170. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9171. * // => [1.2, 3.4]
  9172. *
  9173. * // The `_.property` iteratee shorthand.
  9174. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9175. * // => [{ 'x': 2 }]
  9176. */
  9177. var xorBy = baseRest(function(arrays) {
  9178. var iteratee = last(arrays);
  9179. if (isArrayLikeObject(iteratee)) {
  9180. iteratee = undefined;
  9181. }
  9182. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9183. });
  9184. /**
  9185. * This method is like `_.xor` except that it accepts `comparator` which is
  9186. * invoked to compare elements of `arrays`. The order of result values is
  9187. * determined by the order they occur in the arrays. The comparator is invoked
  9188. * with two arguments: (arrVal, othVal).
  9189. *
  9190. * @static
  9191. * @memberOf _
  9192. * @since 4.0.0
  9193. * @category Array
  9194. * @param {...Array} [arrays] The arrays to inspect.
  9195. * @param {Function} [comparator] The comparator invoked per element.
  9196. * @returns {Array} Returns the new array of filtered values.
  9197. * @example
  9198. *
  9199. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9200. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9201. *
  9202. * _.xorWith(objects, others, _.isEqual);
  9203. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9204. */
  9205. var xorWith = baseRest(function(arrays) {
  9206. var comparator = last(arrays);
  9207. comparator = typeof comparator == 'function' ? comparator : undefined;
  9208. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9209. });
  9210. /**
  9211. * Creates an array of grouped elements, the first of which contains the
  9212. * first elements of the given arrays, the second of which contains the
  9213. * second elements of the given arrays, and so on.
  9214. *
  9215. * @static
  9216. * @memberOf _
  9217. * @since 0.1.0
  9218. * @category Array
  9219. * @param {...Array} [arrays] The arrays to process.
  9220. * @returns {Array} Returns the new array of grouped elements.
  9221. * @example
  9222. *
  9223. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9224. * // => [['a', 1, true], ['b', 2, false]]
  9225. */
  9226. var zip = baseRest(unzip);
  9227. /**
  9228. * This method is like `_.fromPairs` except that it accepts two arrays,
  9229. * one of property identifiers and one of corresponding values.
  9230. *
  9231. * @static
  9232. * @memberOf _
  9233. * @since 0.4.0
  9234. * @category Array
  9235. * @param {Array} [props=[]] The property identifiers.
  9236. * @param {Array} [values=[]] The property values.
  9237. * @returns {Object} Returns the new object.
  9238. * @example
  9239. *
  9240. * _.zipObject(['a', 'b'], [1, 2]);
  9241. * // => { 'a': 1, 'b': 2 }
  9242. */
  9243. function zipObject(props, values) {
  9244. return baseZipObject(props || [], values || [], assignValue);
  9245. }
  9246. /**
  9247. * This method is like `_.zipObject` except that it supports property paths.
  9248. *
  9249. * @static
  9250. * @memberOf _
  9251. * @since 4.1.0
  9252. * @category Array
  9253. * @param {Array} [props=[]] The property identifiers.
  9254. * @param {Array} [values=[]] The property values.
  9255. * @returns {Object} Returns the new object.
  9256. * @example
  9257. *
  9258. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9259. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9260. */
  9261. function zipObjectDeep(props, values) {
  9262. return baseZipObject(props || [], values || [], baseSet);
  9263. }
  9264. /**
  9265. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9266. * how grouped values should be combined. The iteratee is invoked with the
  9267. * elements of each group: (...group).
  9268. *
  9269. * @static
  9270. * @memberOf _
  9271. * @since 3.8.0
  9272. * @category Array
  9273. * @param {...Array} [arrays] The arrays to process.
  9274. * @param {Function} [iteratee=_.identity] The function to combine
  9275. * grouped values.
  9276. * @returns {Array} Returns the new array of grouped elements.
  9277. * @example
  9278. *
  9279. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9280. * return a + b + c;
  9281. * });
  9282. * // => [111, 222]
  9283. */
  9284. var zipWith = baseRest(function(arrays) {
  9285. var length = arrays.length,
  9286. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9287. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9288. return unzipWith(arrays, iteratee);
  9289. });
  9290. /*------------------------------------------------------------------------*/
  9291. /**
  9292. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9293. * chain sequences enabled. The result of such sequences must be unwrapped
  9294. * with `_#value`.
  9295. *
  9296. * @static
  9297. * @memberOf _
  9298. * @since 1.3.0
  9299. * @category Seq
  9300. * @param {*} value The value to wrap.
  9301. * @returns {Object} Returns the new `lodash` wrapper instance.
  9302. * @example
  9303. *
  9304. * var users = [
  9305. * { 'user': 'barney', 'age': 36 },
  9306. * { 'user': 'fred', 'age': 40 },
  9307. * { 'user': 'pebbles', 'age': 1 }
  9308. * ];
  9309. *
  9310. * var youngest = _
  9311. * .chain(users)
  9312. * .sortBy('age')
  9313. * .map(function(o) {
  9314. * return o.user + ' is ' + o.age;
  9315. * })
  9316. * .head()
  9317. * .value();
  9318. * // => 'pebbles is 1'
  9319. */
  9320. function chain(value) {
  9321. var result = lodash(value);
  9322. result.__chain__ = true;
  9323. return result;
  9324. }
  9325. /**
  9326. * This method invokes `interceptor` and returns `value`. The interceptor
  9327. * is invoked with one argument; (value). The purpose of this method is to
  9328. * "tap into" a method chain sequence in order to modify intermediate results.
  9329. *
  9330. * @static
  9331. * @memberOf _
  9332. * @since 0.1.0
  9333. * @category Seq
  9334. * @param {*} value The value to provide to `interceptor`.
  9335. * @param {Function} interceptor The function to invoke.
  9336. * @returns {*} Returns `value`.
  9337. * @example
  9338. *
  9339. * _([1, 2, 3])
  9340. * .tap(function(array) {
  9341. * // Mutate input array.
  9342. * array.pop();
  9343. * })
  9344. * .reverse()
  9345. * .value();
  9346. * // => [2, 1]
  9347. */
  9348. function tap(value, interceptor) {
  9349. interceptor(value);
  9350. return value;
  9351. }
  9352. /**
  9353. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9354. * The purpose of this method is to "pass thru" values replacing intermediate
  9355. * results in a method chain sequence.
  9356. *
  9357. * @static
  9358. * @memberOf _
  9359. * @since 3.0.0
  9360. * @category Seq
  9361. * @param {*} value The value to provide to `interceptor`.
  9362. * @param {Function} interceptor The function to invoke.
  9363. * @returns {*} Returns the result of `interceptor`.
  9364. * @example
  9365. *
  9366. * _(' abc ')
  9367. * .chain()
  9368. * .trim()
  9369. * .thru(function(value) {
  9370. * return [value];
  9371. * })
  9372. * .value();
  9373. * // => ['abc']
  9374. */
  9375. function thru(value, interceptor) {
  9376. return interceptor(value);
  9377. }
  9378. /**
  9379. * This method is the wrapper version of `_.at`.
  9380. *
  9381. * @name at
  9382. * @memberOf _
  9383. * @since 1.0.0
  9384. * @category Seq
  9385. * @param {...(string|string[])} [paths] The property paths to pick.
  9386. * @returns {Object} Returns the new `lodash` wrapper instance.
  9387. * @example
  9388. *
  9389. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9390. *
  9391. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9392. * // => [3, 4]
  9393. */
  9394. var wrapperAt = flatRest(function(paths) {
  9395. var length = paths.length,
  9396. start = length ? paths[0] : 0,
  9397. value = this.__wrapped__,
  9398. interceptor = function(object) { return baseAt(object, paths); };
  9399. if (length > 1 || this.__actions__.length ||
  9400. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9401. return this.thru(interceptor);
  9402. }
  9403. value = value.slice(start, +start + (length ? 1 : 0));
  9404. value.__actions__.push({
  9405. 'func': thru,
  9406. 'args': [interceptor],
  9407. 'thisArg': undefined
  9408. });
  9409. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9410. if (length && !array.length) {
  9411. array.push(undefined);
  9412. }
  9413. return array;
  9414. });
  9415. });
  9416. /**
  9417. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9418. *
  9419. * @name chain
  9420. * @memberOf _
  9421. * @since 0.1.0
  9422. * @category Seq
  9423. * @returns {Object} Returns the new `lodash` wrapper instance.
  9424. * @example
  9425. *
  9426. * var users = [
  9427. * { 'user': 'barney', 'age': 36 },
  9428. * { 'user': 'fred', 'age': 40 }
  9429. * ];
  9430. *
  9431. * // A sequence without explicit chaining.
  9432. * _(users).head();
  9433. * // => { 'user': 'barney', 'age': 36 }
  9434. *
  9435. * // A sequence with explicit chaining.
  9436. * _(users)
  9437. * .chain()
  9438. * .head()
  9439. * .pick('user')
  9440. * .value();
  9441. * // => { 'user': 'barney' }
  9442. */
  9443. function wrapperChain() {
  9444. return chain(this);
  9445. }
  9446. /**
  9447. * Executes the chain sequence and returns the wrapped result.
  9448. *
  9449. * @name commit
  9450. * @memberOf _
  9451. * @since 3.2.0
  9452. * @category Seq
  9453. * @returns {Object} Returns the new `lodash` wrapper instance.
  9454. * @example
  9455. *
  9456. * var array = [1, 2];
  9457. * var wrapped = _(array).push(3);
  9458. *
  9459. * console.log(array);
  9460. * // => [1, 2]
  9461. *
  9462. * wrapped = wrapped.commit();
  9463. * console.log(array);
  9464. * // => [1, 2, 3]
  9465. *
  9466. * wrapped.last();
  9467. * // => 3
  9468. *
  9469. * console.log(array);
  9470. * // => [1, 2, 3]
  9471. */
  9472. function wrapperCommit() {
  9473. return new LodashWrapper(this.value(), this.__chain__);
  9474. }
  9475. /**
  9476. * Gets the next value on a wrapped object following the
  9477. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9478. *
  9479. * @name next
  9480. * @memberOf _
  9481. * @since 4.0.0
  9482. * @category Seq
  9483. * @returns {Object} Returns the next iterator value.
  9484. * @example
  9485. *
  9486. * var wrapped = _([1, 2]);
  9487. *
  9488. * wrapped.next();
  9489. * // => { 'done': false, 'value': 1 }
  9490. *
  9491. * wrapped.next();
  9492. * // => { 'done': false, 'value': 2 }
  9493. *
  9494. * wrapped.next();
  9495. * // => { 'done': true, 'value': undefined }
  9496. */
  9497. function wrapperNext() {
  9498. if (this.__values__ === undefined) {
  9499. this.__values__ = toArray(this.value());
  9500. }
  9501. var done = this.__index__ >= this.__values__.length,
  9502. value = done ? undefined : this.__values__[this.__index__++];
  9503. return { 'done': done, 'value': value };
  9504. }
  9505. /**
  9506. * Enables the wrapper to be iterable.
  9507. *
  9508. * @name Symbol.iterator
  9509. * @memberOf _
  9510. * @since 4.0.0
  9511. * @category Seq
  9512. * @returns {Object} Returns the wrapper object.
  9513. * @example
  9514. *
  9515. * var wrapped = _([1, 2]);
  9516. *
  9517. * wrapped[Symbol.iterator]() === wrapped;
  9518. * // => true
  9519. *
  9520. * Array.from(wrapped);
  9521. * // => [1, 2]
  9522. */
  9523. function wrapperToIterator() {
  9524. return this;
  9525. }
  9526. /**
  9527. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9528. *
  9529. * @name plant
  9530. * @memberOf _
  9531. * @since 3.2.0
  9532. * @category Seq
  9533. * @param {*} value The value to plant.
  9534. * @returns {Object} Returns the new `lodash` wrapper instance.
  9535. * @example
  9536. *
  9537. * function square(n) {
  9538. * return n * n;
  9539. * }
  9540. *
  9541. * var wrapped = _([1, 2]).map(square);
  9542. * var other = wrapped.plant([3, 4]);
  9543. *
  9544. * other.value();
  9545. * // => [9, 16]
  9546. *
  9547. * wrapped.value();
  9548. * // => [1, 4]
  9549. */
  9550. function wrapperPlant(value) {
  9551. var result,
  9552. parent = this;
  9553. while (parent instanceof baseLodash) {
  9554. var clone = wrapperClone(parent);
  9555. clone.__index__ = 0;
  9556. clone.__values__ = undefined;
  9557. if (result) {
  9558. previous.__wrapped__ = clone;
  9559. } else {
  9560. result = clone;
  9561. }
  9562. var previous = clone;
  9563. parent = parent.__wrapped__;
  9564. }
  9565. previous.__wrapped__ = value;
  9566. return result;
  9567. }
  9568. /**
  9569. * This method is the wrapper version of `_.reverse`.
  9570. *
  9571. * **Note:** This method mutates the wrapped array.
  9572. *
  9573. * @name reverse
  9574. * @memberOf _
  9575. * @since 0.1.0
  9576. * @category Seq
  9577. * @returns {Object} Returns the new `lodash` wrapper instance.
  9578. * @example
  9579. *
  9580. * var array = [1, 2, 3];
  9581. *
  9582. * _(array).reverse().value()
  9583. * // => [3, 2, 1]
  9584. *
  9585. * console.log(array);
  9586. * // => [3, 2, 1]
  9587. */
  9588. function wrapperReverse() {
  9589. var value = this.__wrapped__;
  9590. if (value instanceof LazyWrapper) {
  9591. var wrapped = value;
  9592. if (this.__actions__.length) {
  9593. wrapped = new LazyWrapper(this);
  9594. }
  9595. wrapped = wrapped.reverse();
  9596. wrapped.__actions__.push({
  9597. 'func': thru,
  9598. 'args': [reverse],
  9599. 'thisArg': undefined
  9600. });
  9601. return new LodashWrapper(wrapped, this.__chain__);
  9602. }
  9603. return this.thru(reverse);
  9604. }
  9605. /**
  9606. * Executes the chain sequence to resolve the unwrapped value.
  9607. *
  9608. * @name value
  9609. * @memberOf _
  9610. * @since 0.1.0
  9611. * @alias toJSON, valueOf
  9612. * @category Seq
  9613. * @returns {*} Returns the resolved unwrapped value.
  9614. * @example
  9615. *
  9616. * _([1, 2, 3]).value();
  9617. * // => [1, 2, 3]
  9618. */
  9619. function wrapperValue() {
  9620. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9621. }
  9622. /*------------------------------------------------------------------------*/
  9623. /**
  9624. * Creates an object composed of keys generated from the results of running
  9625. * each element of `collection` thru `iteratee`. The corresponding value of
  9626. * each key is the number of times the key was returned by `iteratee`. The
  9627. * iteratee is invoked with one argument: (value).
  9628. *
  9629. * @static
  9630. * @memberOf _
  9631. * @since 0.5.0
  9632. * @category Collection
  9633. * @param {Array|Object} collection The collection to iterate over.
  9634. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9635. * @returns {Object} Returns the composed aggregate object.
  9636. * @example
  9637. *
  9638. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9639. * // => { '4': 1, '6': 2 }
  9640. *
  9641. * // The `_.property` iteratee shorthand.
  9642. * _.countBy(['one', 'two', 'three'], 'length');
  9643. * // => { '3': 2, '5': 1 }
  9644. */
  9645. var countBy = createAggregator(function(result, value, key) {
  9646. if (hasOwnProperty.call(result, key)) {
  9647. ++result[key];
  9648. } else {
  9649. baseAssignValue(result, key, 1);
  9650. }
  9651. });
  9652. /**
  9653. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9654. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9655. * invoked with three arguments: (value, index|key, collection).
  9656. *
  9657. * **Note:** This method returns `true` for
  9658. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9659. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9660. * elements of empty collections.
  9661. *
  9662. * @static
  9663. * @memberOf _
  9664. * @since 0.1.0
  9665. * @category Collection
  9666. * @param {Array|Object} collection The collection to iterate over.
  9667. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9668. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9669. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9670. * else `false`.
  9671. * @example
  9672. *
  9673. * _.every([true, 1, null, 'yes'], Boolean);
  9674. * // => false
  9675. *
  9676. * var users = [
  9677. * { 'user': 'barney', 'age': 36, 'active': false },
  9678. * { 'user': 'fred', 'age': 40, 'active': false }
  9679. * ];
  9680. *
  9681. * // The `_.matches` iteratee shorthand.
  9682. * _.every(users, { 'user': 'barney', 'active': false });
  9683. * // => false
  9684. *
  9685. * // The `_.matchesProperty` iteratee shorthand.
  9686. * _.every(users, ['active', false]);
  9687. * // => true
  9688. *
  9689. * // The `_.property` iteratee shorthand.
  9690. * _.every(users, 'active');
  9691. * // => false
  9692. */
  9693. function every(collection, predicate, guard) {
  9694. var func = isArray(collection) ? arrayEvery : baseEvery;
  9695. if (guard && isIterateeCall(collection, predicate, guard)) {
  9696. predicate = undefined;
  9697. }
  9698. return func(collection, getIteratee(predicate, 3));
  9699. }
  9700. /**
  9701. * Iterates over elements of `collection`, returning an array of all elements
  9702. * `predicate` returns truthy for. The predicate is invoked with three
  9703. * arguments: (value, index|key, collection).
  9704. *
  9705. * **Note:** Unlike `_.remove`, this method returns a new array.
  9706. *
  9707. * @static
  9708. * @memberOf _
  9709. * @since 0.1.0
  9710. * @category Collection
  9711. * @param {Array|Object} collection The collection to iterate over.
  9712. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9713. * @returns {Array} Returns the new filtered array.
  9714. * @see _.reject
  9715. * @example
  9716. *
  9717. * var users = [
  9718. * { 'user': 'barney', 'age': 36, 'active': true },
  9719. * { 'user': 'fred', 'age': 40, 'active': false }
  9720. * ];
  9721. *
  9722. * _.filter(users, function(o) { return !o.active; });
  9723. * // => objects for ['fred']
  9724. *
  9725. * // The `_.matches` iteratee shorthand.
  9726. * _.filter(users, { 'age': 36, 'active': true });
  9727. * // => objects for ['barney']
  9728. *
  9729. * // The `_.matchesProperty` iteratee shorthand.
  9730. * _.filter(users, ['active', false]);
  9731. * // => objects for ['fred']
  9732. *
  9733. * // The `_.property` iteratee shorthand.
  9734. * _.filter(users, 'active');
  9735. * // => objects for ['barney']
  9736. *
  9737. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9738. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9739. * // => objects for ['fred', 'barney']
  9740. */
  9741. function filter(collection, predicate) {
  9742. var func = isArray(collection) ? arrayFilter : baseFilter;
  9743. return func(collection, getIteratee(predicate, 3));
  9744. }
  9745. /**
  9746. * Iterates over elements of `collection`, returning the first element
  9747. * `predicate` returns truthy for. The predicate is invoked with three
  9748. * arguments: (value, index|key, collection).
  9749. *
  9750. * @static
  9751. * @memberOf _
  9752. * @since 0.1.0
  9753. * @category Collection
  9754. * @param {Array|Object} collection The collection to inspect.
  9755. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9756. * @param {number} [fromIndex=0] The index to search from.
  9757. * @returns {*} Returns the matched element, else `undefined`.
  9758. * @example
  9759. *
  9760. * var users = [
  9761. * { 'user': 'barney', 'age': 36, 'active': true },
  9762. * { 'user': 'fred', 'age': 40, 'active': false },
  9763. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9764. * ];
  9765. *
  9766. * _.find(users, function(o) { return o.age < 40; });
  9767. * // => object for 'barney'
  9768. *
  9769. * // The `_.matches` iteratee shorthand.
  9770. * _.find(users, { 'age': 1, 'active': true });
  9771. * // => object for 'pebbles'
  9772. *
  9773. * // The `_.matchesProperty` iteratee shorthand.
  9774. * _.find(users, ['active', false]);
  9775. * // => object for 'fred'
  9776. *
  9777. * // The `_.property` iteratee shorthand.
  9778. * _.find(users, 'active');
  9779. * // => object for 'barney'
  9780. */
  9781. var find = createFind(findIndex);
  9782. /**
  9783. * This method is like `_.find` except that it iterates over elements of
  9784. * `collection` from right to left.
  9785. *
  9786. * @static
  9787. * @memberOf _
  9788. * @since 2.0.0
  9789. * @category Collection
  9790. * @param {Array|Object} collection The collection to inspect.
  9791. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9792. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9793. * @returns {*} Returns the matched element, else `undefined`.
  9794. * @example
  9795. *
  9796. * _.findLast([1, 2, 3, 4], function(n) {
  9797. * return n % 2 == 1;
  9798. * });
  9799. * // => 3
  9800. */
  9801. var findLast = createFind(findLastIndex);
  9802. /**
  9803. * Creates a flattened array of values by running each element in `collection`
  9804. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9805. * with three arguments: (value, index|key, collection).
  9806. *
  9807. * @static
  9808. * @memberOf _
  9809. * @since 4.0.0
  9810. * @category Collection
  9811. * @param {Array|Object} collection The collection to iterate over.
  9812. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9813. * @returns {Array} Returns the new flattened array.
  9814. * @example
  9815. *
  9816. * function duplicate(n) {
  9817. * return [n, n];
  9818. * }
  9819. *
  9820. * _.flatMap([1, 2], duplicate);
  9821. * // => [1, 1, 2, 2]
  9822. */
  9823. function flatMap(collection, iteratee) {
  9824. return baseFlatten(map(collection, iteratee), 1);
  9825. }
  9826. /**
  9827. * This method is like `_.flatMap` except that it recursively flattens the
  9828. * mapped results.
  9829. *
  9830. * @static
  9831. * @memberOf _
  9832. * @since 4.7.0
  9833. * @category Collection
  9834. * @param {Array|Object} collection The collection to iterate over.
  9835. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9836. * @returns {Array} Returns the new flattened array.
  9837. * @example
  9838. *
  9839. * function duplicate(n) {
  9840. * return [[[n, n]]];
  9841. * }
  9842. *
  9843. * _.flatMapDeep([1, 2], duplicate);
  9844. * // => [1, 1, 2, 2]
  9845. */
  9846. function flatMapDeep(collection, iteratee) {
  9847. return baseFlatten(map(collection, iteratee), INFINITY);
  9848. }
  9849. /**
  9850. * This method is like `_.flatMap` except that it recursively flattens the
  9851. * mapped results up to `depth` times.
  9852. *
  9853. * @static
  9854. * @memberOf _
  9855. * @since 4.7.0
  9856. * @category Collection
  9857. * @param {Array|Object} collection The collection to iterate over.
  9858. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9859. * @param {number} [depth=1] The maximum recursion depth.
  9860. * @returns {Array} Returns the new flattened array.
  9861. * @example
  9862. *
  9863. * function duplicate(n) {
  9864. * return [[[n, n]]];
  9865. * }
  9866. *
  9867. * _.flatMapDepth([1, 2], duplicate, 2);
  9868. * // => [[1, 1], [2, 2]]
  9869. */
  9870. function flatMapDepth(collection, iteratee, depth) {
  9871. depth = depth === undefined ? 1 : toInteger(depth);
  9872. return baseFlatten(map(collection, iteratee), depth);
  9873. }
  9874. /**
  9875. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9876. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9877. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9878. *
  9879. * **Note:** As with other "Collections" methods, objects with a "length"
  9880. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9881. * or `_.forOwn` for object iteration.
  9882. *
  9883. * @static
  9884. * @memberOf _
  9885. * @since 0.1.0
  9886. * @alias each
  9887. * @category Collection
  9888. * @param {Array|Object} collection The collection to iterate over.
  9889. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9890. * @returns {Array|Object} Returns `collection`.
  9891. * @see _.forEachRight
  9892. * @example
  9893. *
  9894. * _.forEach([1, 2], function(value) {
  9895. * console.log(value);
  9896. * });
  9897. * // => Logs `1` then `2`.
  9898. *
  9899. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9900. * console.log(key);
  9901. * });
  9902. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9903. */
  9904. function forEach(collection, iteratee) {
  9905. var func = isArray(collection) ? arrayEach : baseEach;
  9906. return func(collection, getIteratee(iteratee, 3));
  9907. }
  9908. /**
  9909. * This method is like `_.forEach` except that it iterates over elements of
  9910. * `collection` from right to left.
  9911. *
  9912. * @static
  9913. * @memberOf _
  9914. * @since 2.0.0
  9915. * @alias eachRight
  9916. * @category Collection
  9917. * @param {Array|Object} collection The collection to iterate over.
  9918. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9919. * @returns {Array|Object} Returns `collection`.
  9920. * @see _.forEach
  9921. * @example
  9922. *
  9923. * _.forEachRight([1, 2], function(value) {
  9924. * console.log(value);
  9925. * });
  9926. * // => Logs `2` then `1`.
  9927. */
  9928. function forEachRight(collection, iteratee) {
  9929. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9930. return func(collection, getIteratee(iteratee, 3));
  9931. }
  9932. /**
  9933. * Creates an object composed of keys generated from the results of running
  9934. * each element of `collection` thru `iteratee`. The order of grouped values
  9935. * is determined by the order they occur in `collection`. The corresponding
  9936. * value of each key is an array of elements responsible for generating the
  9937. * key. The iteratee is invoked with one argument: (value).
  9938. *
  9939. * @static
  9940. * @memberOf _
  9941. * @since 0.1.0
  9942. * @category Collection
  9943. * @param {Array|Object} collection The collection to iterate over.
  9944. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9945. * @returns {Object} Returns the composed aggregate object.
  9946. * @example
  9947. *
  9948. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9949. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9950. *
  9951. * // The `_.property` iteratee shorthand.
  9952. * _.groupBy(['one', 'two', 'three'], 'length');
  9953. * // => { '3': ['one', 'two'], '5': ['three'] }
  9954. */
  9955. var groupBy = createAggregator(function(result, value, key) {
  9956. if (hasOwnProperty.call(result, key)) {
  9957. result[key].push(value);
  9958. } else {
  9959. baseAssignValue(result, key, [value]);
  9960. }
  9961. });
  9962. /**
  9963. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9964. * checked for a substring of `value`, otherwise
  9965. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9966. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9967. * the offset from the end of `collection`.
  9968. *
  9969. * @static
  9970. * @memberOf _
  9971. * @since 0.1.0
  9972. * @category Collection
  9973. * @param {Array|Object|string} collection The collection to inspect.
  9974. * @param {*} value The value to search for.
  9975. * @param {number} [fromIndex=0] The index to search from.
  9976. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9977. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9978. * @example
  9979. *
  9980. * _.includes([1, 2, 3], 1);
  9981. * // => true
  9982. *
  9983. * _.includes([1, 2, 3], 1, 2);
  9984. * // => false
  9985. *
  9986. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9987. * // => true
  9988. *
  9989. * _.includes('abcd', 'bc');
  9990. * // => true
  9991. */
  9992. function includes(collection, value, fromIndex, guard) {
  9993. collection = isArrayLike(collection) ? collection : values(collection);
  9994. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9995. var length = collection.length;
  9996. if (fromIndex < 0) {
  9997. fromIndex = nativeMax(length + fromIndex, 0);
  9998. }
  9999. return isString(collection)
  10000. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10001. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10002. }
  10003. /**
  10004. * Invokes the method at `path` of each element in `collection`, returning
  10005. * an array of the results of each invoked method. Any additional arguments
  10006. * are provided to each invoked method. If `path` is a function, it's invoked
  10007. * for, and `this` bound to, each element in `collection`.
  10008. *
  10009. * @static
  10010. * @memberOf _
  10011. * @since 4.0.0
  10012. * @category Collection
  10013. * @param {Array|Object} collection The collection to iterate over.
  10014. * @param {Array|Function|string} path The path of the method to invoke or
  10015. * the function invoked per iteration.
  10016. * @param {...*} [args] The arguments to invoke each method with.
  10017. * @returns {Array} Returns the array of results.
  10018. * @example
  10019. *
  10020. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10021. * // => [[1, 5, 7], [1, 2, 3]]
  10022. *
  10023. * _.invokeMap([123, 456], String.prototype.split, '');
  10024. * // => [['1', '2', '3'], ['4', '5', '6']]
  10025. */
  10026. var invokeMap = baseRest(function(collection, path, args) {
  10027. var index = -1,
  10028. isFunc = typeof path == 'function',
  10029. result = isArrayLike(collection) ? Array(collection.length) : [];
  10030. baseEach(collection, function(value) {
  10031. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10032. });
  10033. return result;
  10034. });
  10035. /**
  10036. * Creates an object composed of keys generated from the results of running
  10037. * each element of `collection` thru `iteratee`. The corresponding value of
  10038. * each key is the last element responsible for generating the key. The
  10039. * iteratee is invoked with one argument: (value).
  10040. *
  10041. * @static
  10042. * @memberOf _
  10043. * @since 4.0.0
  10044. * @category Collection
  10045. * @param {Array|Object} collection The collection to iterate over.
  10046. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10047. * @returns {Object} Returns the composed aggregate object.
  10048. * @example
  10049. *
  10050. * var array = [
  10051. * { 'dir': 'left', 'code': 97 },
  10052. * { 'dir': 'right', 'code': 100 }
  10053. * ];
  10054. *
  10055. * _.keyBy(array, function(o) {
  10056. * return String.fromCharCode(o.code);
  10057. * });
  10058. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10059. *
  10060. * _.keyBy(array, 'dir');
  10061. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10062. */
  10063. var keyBy = createAggregator(function(result, value, key) {
  10064. baseAssignValue(result, key, value);
  10065. });
  10066. /**
  10067. * Creates an array of values by running each element in `collection` thru
  10068. * `iteratee`. The iteratee is invoked with three arguments:
  10069. * (value, index|key, collection).
  10070. *
  10071. * Many lodash methods are guarded to work as iteratees for methods like
  10072. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10073. *
  10074. * The guarded methods are:
  10075. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10076. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10077. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10078. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10079. *
  10080. * @static
  10081. * @memberOf _
  10082. * @since 0.1.0
  10083. * @category Collection
  10084. * @param {Array|Object} collection The collection to iterate over.
  10085. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10086. * @returns {Array} Returns the new mapped array.
  10087. * @example
  10088. *
  10089. * function square(n) {
  10090. * return n * n;
  10091. * }
  10092. *
  10093. * _.map([4, 8], square);
  10094. * // => [16, 64]
  10095. *
  10096. * _.map({ 'a': 4, 'b': 8 }, square);
  10097. * // => [16, 64] (iteration order is not guaranteed)
  10098. *
  10099. * var users = [
  10100. * { 'user': 'barney' },
  10101. * { 'user': 'fred' }
  10102. * ];
  10103. *
  10104. * // The `_.property` iteratee shorthand.
  10105. * _.map(users, 'user');
  10106. * // => ['barney', 'fred']
  10107. */
  10108. function map(collection, iteratee) {
  10109. var func = isArray(collection) ? arrayMap : baseMap;
  10110. return func(collection, getIteratee(iteratee, 3));
  10111. }
  10112. /**
  10113. * This method is like `_.sortBy` except that it allows specifying the sort
  10114. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10115. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10116. * descending or "asc" for ascending sort order of corresponding values.
  10117. *
  10118. * @static
  10119. * @memberOf _
  10120. * @since 4.0.0
  10121. * @category Collection
  10122. * @param {Array|Object} collection The collection to iterate over.
  10123. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10124. * The iteratees to sort by.
  10125. * @param {string[]} [orders] The sort orders of `iteratees`.
  10126. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10127. * @returns {Array} Returns the new sorted array.
  10128. * @example
  10129. *
  10130. * var users = [
  10131. * { 'user': 'fred', 'age': 48 },
  10132. * { 'user': 'barney', 'age': 34 },
  10133. * { 'user': 'fred', 'age': 40 },
  10134. * { 'user': 'barney', 'age': 36 }
  10135. * ];
  10136. *
  10137. * // Sort by `user` in ascending order and by `age` in descending order.
  10138. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10139. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10140. */
  10141. function orderBy(collection, iteratees, orders, guard) {
  10142. if (collection == null) {
  10143. return [];
  10144. }
  10145. if (!isArray(iteratees)) {
  10146. iteratees = iteratees == null ? [] : [iteratees];
  10147. }
  10148. orders = guard ? undefined : orders;
  10149. if (!isArray(orders)) {
  10150. orders = orders == null ? [] : [orders];
  10151. }
  10152. return baseOrderBy(collection, iteratees, orders);
  10153. }
  10154. /**
  10155. * Creates an array of elements split into two groups, the first of which
  10156. * contains elements `predicate` returns truthy for, the second of which
  10157. * contains elements `predicate` returns falsey for. The predicate is
  10158. * invoked with one argument: (value).
  10159. *
  10160. * @static
  10161. * @memberOf _
  10162. * @since 3.0.0
  10163. * @category Collection
  10164. * @param {Array|Object} collection The collection to iterate over.
  10165. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10166. * @returns {Array} Returns the array of grouped elements.
  10167. * @example
  10168. *
  10169. * var users = [
  10170. * { 'user': 'barney', 'age': 36, 'active': false },
  10171. * { 'user': 'fred', 'age': 40, 'active': true },
  10172. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10173. * ];
  10174. *
  10175. * _.partition(users, function(o) { return o.active; });
  10176. * // => objects for [['fred'], ['barney', 'pebbles']]
  10177. *
  10178. * // The `_.matches` iteratee shorthand.
  10179. * _.partition(users, { 'age': 1, 'active': false });
  10180. * // => objects for [['pebbles'], ['barney', 'fred']]
  10181. *
  10182. * // The `_.matchesProperty` iteratee shorthand.
  10183. * _.partition(users, ['active', false]);
  10184. * // => objects for [['barney', 'pebbles'], ['fred']]
  10185. *
  10186. * // The `_.property` iteratee shorthand.
  10187. * _.partition(users, 'active');
  10188. * // => objects for [['fred'], ['barney', 'pebbles']]
  10189. */
  10190. var partition = createAggregator(function(result, value, key) {
  10191. result[key ? 0 : 1].push(value);
  10192. }, function() { return [[], []]; });
  10193. /**
  10194. * Reduces `collection` to a value which is the accumulated result of running
  10195. * each element in `collection` thru `iteratee`, where each successive
  10196. * invocation is supplied the return value of the previous. If `accumulator`
  10197. * is not given, the first element of `collection` is used as the initial
  10198. * value. The iteratee is invoked with four arguments:
  10199. * (accumulator, value, index|key, collection).
  10200. *
  10201. * Many lodash methods are guarded to work as iteratees for methods like
  10202. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10203. *
  10204. * The guarded methods are:
  10205. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10206. * and `sortBy`
  10207. *
  10208. * @static
  10209. * @memberOf _
  10210. * @since 0.1.0
  10211. * @category Collection
  10212. * @param {Array|Object} collection The collection to iterate over.
  10213. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10214. * @param {*} [accumulator] The initial value.
  10215. * @returns {*} Returns the accumulated value.
  10216. * @see _.reduceRight
  10217. * @example
  10218. *
  10219. * _.reduce([1, 2], function(sum, n) {
  10220. * return sum + n;
  10221. * }, 0);
  10222. * // => 3
  10223. *
  10224. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10225. * (result[value] || (result[value] = [])).push(key);
  10226. * return result;
  10227. * }, {});
  10228. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10229. */
  10230. function reduce(collection, iteratee, accumulator) {
  10231. var func = isArray(collection) ? arrayReduce : baseReduce,
  10232. initAccum = arguments.length < 3;
  10233. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10234. }
  10235. /**
  10236. * This method is like `_.reduce` except that it iterates over elements of
  10237. * `collection` from right to left.
  10238. *
  10239. * @static
  10240. * @memberOf _
  10241. * @since 0.1.0
  10242. * @category Collection
  10243. * @param {Array|Object} collection The collection to iterate over.
  10244. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10245. * @param {*} [accumulator] The initial value.
  10246. * @returns {*} Returns the accumulated value.
  10247. * @see _.reduce
  10248. * @example
  10249. *
  10250. * var array = [[0, 1], [2, 3], [4, 5]];
  10251. *
  10252. * _.reduceRight(array, function(flattened, other) {
  10253. * return flattened.concat(other);
  10254. * }, []);
  10255. * // => [4, 5, 2, 3, 0, 1]
  10256. */
  10257. function reduceRight(collection, iteratee, accumulator) {
  10258. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10259. initAccum = arguments.length < 3;
  10260. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10261. }
  10262. /**
  10263. * The opposite of `_.filter`; this method returns the elements of `collection`
  10264. * that `predicate` does **not** return truthy for.
  10265. *
  10266. * @static
  10267. * @memberOf _
  10268. * @since 0.1.0
  10269. * @category Collection
  10270. * @param {Array|Object} collection The collection to iterate over.
  10271. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10272. * @returns {Array} Returns the new filtered array.
  10273. * @see _.filter
  10274. * @example
  10275. *
  10276. * var users = [
  10277. * { 'user': 'barney', 'age': 36, 'active': false },
  10278. * { 'user': 'fred', 'age': 40, 'active': true }
  10279. * ];
  10280. *
  10281. * _.reject(users, function(o) { return !o.active; });
  10282. * // => objects for ['fred']
  10283. *
  10284. * // The `_.matches` iteratee shorthand.
  10285. * _.reject(users, { 'age': 40, 'active': true });
  10286. * // => objects for ['barney']
  10287. *
  10288. * // The `_.matchesProperty` iteratee shorthand.
  10289. * _.reject(users, ['active', false]);
  10290. * // => objects for ['fred']
  10291. *
  10292. * // The `_.property` iteratee shorthand.
  10293. * _.reject(users, 'active');
  10294. * // => objects for ['barney']
  10295. */
  10296. function reject(collection, predicate) {
  10297. var func = isArray(collection) ? arrayFilter : baseFilter;
  10298. return func(collection, negate(getIteratee(predicate, 3)));
  10299. }
  10300. /**
  10301. * Gets a random element from `collection`.
  10302. *
  10303. * @static
  10304. * @memberOf _
  10305. * @since 2.0.0
  10306. * @category Collection
  10307. * @param {Array|Object} collection The collection to sample.
  10308. * @returns {*} Returns the random element.
  10309. * @example
  10310. *
  10311. * _.sample([1, 2, 3, 4]);
  10312. * // => 2
  10313. */
  10314. function sample(collection) {
  10315. var func = isArray(collection) ? arraySample : baseSample;
  10316. return func(collection);
  10317. }
  10318. /**
  10319. * Gets `n` random elements at unique keys from `collection` up to the
  10320. * size of `collection`.
  10321. *
  10322. * @static
  10323. * @memberOf _
  10324. * @since 4.0.0
  10325. * @category Collection
  10326. * @param {Array|Object} collection The collection to sample.
  10327. * @param {number} [n=1] The number of elements to sample.
  10328. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10329. * @returns {Array} Returns the random elements.
  10330. * @example
  10331. *
  10332. * _.sampleSize([1, 2, 3], 2);
  10333. * // => [3, 1]
  10334. *
  10335. * _.sampleSize([1, 2, 3], 4);
  10336. * // => [2, 3, 1]
  10337. */
  10338. function sampleSize(collection, n, guard) {
  10339. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10340. n = 1;
  10341. } else {
  10342. n = toInteger(n);
  10343. }
  10344. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10345. return func(collection, n);
  10346. }
  10347. /**
  10348. * Creates an array of shuffled values, using a version of the
  10349. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10350. *
  10351. * @static
  10352. * @memberOf _
  10353. * @since 0.1.0
  10354. * @category Collection
  10355. * @param {Array|Object} collection The collection to shuffle.
  10356. * @returns {Array} Returns the new shuffled array.
  10357. * @example
  10358. *
  10359. * _.shuffle([1, 2, 3, 4]);
  10360. * // => [4, 1, 3, 2]
  10361. */
  10362. function shuffle(collection) {
  10363. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10364. return func(collection);
  10365. }
  10366. /**
  10367. * Gets the size of `collection` by returning its length for array-like
  10368. * values or the number of own enumerable string keyed properties for objects.
  10369. *
  10370. * @static
  10371. * @memberOf _
  10372. * @since 0.1.0
  10373. * @category Collection
  10374. * @param {Array|Object|string} collection The collection to inspect.
  10375. * @returns {number} Returns the collection size.
  10376. * @example
  10377. *
  10378. * _.size([1, 2, 3]);
  10379. * // => 3
  10380. *
  10381. * _.size({ 'a': 1, 'b': 2 });
  10382. * // => 2
  10383. *
  10384. * _.size('pebbles');
  10385. * // => 7
  10386. */
  10387. function size(collection) {
  10388. if (collection == null) {
  10389. return 0;
  10390. }
  10391. if (isArrayLike(collection)) {
  10392. return isString(collection) ? stringSize(collection) : collection.length;
  10393. }
  10394. var tag = getTag(collection);
  10395. if (tag == mapTag || tag == setTag) {
  10396. return collection.size;
  10397. }
  10398. return baseKeys(collection).length;
  10399. }
  10400. /**
  10401. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10402. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10403. * invoked with three arguments: (value, index|key, collection).
  10404. *
  10405. * @static
  10406. * @memberOf _
  10407. * @since 0.1.0
  10408. * @category Collection
  10409. * @param {Array|Object} collection The collection to iterate over.
  10410. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10411. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10412. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10413. * else `false`.
  10414. * @example
  10415. *
  10416. * _.some([null, 0, 'yes', false], Boolean);
  10417. * // => true
  10418. *
  10419. * var users = [
  10420. * { 'user': 'barney', 'active': true },
  10421. * { 'user': 'fred', 'active': false }
  10422. * ];
  10423. *
  10424. * // The `_.matches` iteratee shorthand.
  10425. * _.some(users, { 'user': 'barney', 'active': false });
  10426. * // => false
  10427. *
  10428. * // The `_.matchesProperty` iteratee shorthand.
  10429. * _.some(users, ['active', false]);
  10430. * // => true
  10431. *
  10432. * // The `_.property` iteratee shorthand.
  10433. * _.some(users, 'active');
  10434. * // => true
  10435. */
  10436. function some(collection, predicate, guard) {
  10437. var func = isArray(collection) ? arraySome : baseSome;
  10438. if (guard && isIterateeCall(collection, predicate, guard)) {
  10439. predicate = undefined;
  10440. }
  10441. return func(collection, getIteratee(predicate, 3));
  10442. }
  10443. /**
  10444. * Creates an array of elements, sorted in ascending order by the results of
  10445. * running each element in a collection thru each iteratee. This method
  10446. * performs a stable sort, that is, it preserves the original sort order of
  10447. * equal elements. The iteratees are invoked with one argument: (value).
  10448. *
  10449. * @static
  10450. * @memberOf _
  10451. * @since 0.1.0
  10452. * @category Collection
  10453. * @param {Array|Object} collection The collection to iterate over.
  10454. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10455. * The iteratees to sort by.
  10456. * @returns {Array} Returns the new sorted array.
  10457. * @example
  10458. *
  10459. * var users = [
  10460. * { 'user': 'fred', 'age': 48 },
  10461. * { 'user': 'barney', 'age': 36 },
  10462. * { 'user': 'fred', 'age': 30 },
  10463. * { 'user': 'barney', 'age': 34 }
  10464. * ];
  10465. *
  10466. * _.sortBy(users, [function(o) { return o.user; }]);
  10467. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10468. *
  10469. * _.sortBy(users, ['user', 'age']);
  10470. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10471. */
  10472. var sortBy = baseRest(function(collection, iteratees) {
  10473. if (collection == null) {
  10474. return [];
  10475. }
  10476. var length = iteratees.length;
  10477. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10478. iteratees = [];
  10479. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10480. iteratees = [iteratees[0]];
  10481. }
  10482. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10483. });
  10484. /*------------------------------------------------------------------------*/
  10485. /**
  10486. * Gets the timestamp of the number of milliseconds that have elapsed since
  10487. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10488. *
  10489. * @static
  10490. * @memberOf _
  10491. * @since 2.4.0
  10492. * @category Date
  10493. * @returns {number} Returns the timestamp.
  10494. * @example
  10495. *
  10496. * _.defer(function(stamp) {
  10497. * console.log(_.now() - stamp);
  10498. * }, _.now());
  10499. * // => Logs the number of milliseconds it took for the deferred invocation.
  10500. */
  10501. var now = ctxNow || function() {
  10502. return root.Date.now();
  10503. };
  10504. /*------------------------------------------------------------------------*/
  10505. /**
  10506. * The opposite of `_.before`; this method creates a function that invokes
  10507. * `func` once it's called `n` or more times.
  10508. *
  10509. * @static
  10510. * @memberOf _
  10511. * @since 0.1.0
  10512. * @category Function
  10513. * @param {number} n The number of calls before `func` is invoked.
  10514. * @param {Function} func The function to restrict.
  10515. * @returns {Function} Returns the new restricted function.
  10516. * @example
  10517. *
  10518. * var saves = ['profile', 'settings'];
  10519. *
  10520. * var done = _.after(saves.length, function() {
  10521. * console.log('done saving!');
  10522. * });
  10523. *
  10524. * _.forEach(saves, function(type) {
  10525. * asyncSave({ 'type': type, 'complete': done });
  10526. * });
  10527. * // => Logs 'done saving!' after the two async saves have completed.
  10528. */
  10529. function after(n, func) {
  10530. if (typeof func != 'function') {
  10531. throw new TypeError(FUNC_ERROR_TEXT);
  10532. }
  10533. n = toInteger(n);
  10534. return function() {
  10535. if (--n < 1) {
  10536. return func.apply(this, arguments);
  10537. }
  10538. };
  10539. }
  10540. /**
  10541. * Creates a function that invokes `func`, with up to `n` arguments,
  10542. * ignoring any additional arguments.
  10543. *
  10544. * @static
  10545. * @memberOf _
  10546. * @since 3.0.0
  10547. * @category Function
  10548. * @param {Function} func The function to cap arguments for.
  10549. * @param {number} [n=func.length] The arity cap.
  10550. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10551. * @returns {Function} Returns the new capped function.
  10552. * @example
  10553. *
  10554. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10555. * // => [6, 8, 10]
  10556. */
  10557. function ary(func, n, guard) {
  10558. n = guard ? undefined : n;
  10559. n = (func && n == null) ? func.length : n;
  10560. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10561. }
  10562. /**
  10563. * Creates a function that invokes `func`, with the `this` binding and arguments
  10564. * of the created function, while it's called less than `n` times. Subsequent
  10565. * calls to the created function return the result of the last `func` invocation.
  10566. *
  10567. * @static
  10568. * @memberOf _
  10569. * @since 3.0.0
  10570. * @category Function
  10571. * @param {number} n The number of calls at which `func` is no longer invoked.
  10572. * @param {Function} func The function to restrict.
  10573. * @returns {Function} Returns the new restricted function.
  10574. * @example
  10575. *
  10576. * jQuery(element).on('click', _.before(5, addContactToList));
  10577. * // => Allows adding up to 4 contacts to the list.
  10578. */
  10579. function before(n, func) {
  10580. var result;
  10581. if (typeof func != 'function') {
  10582. throw new TypeError(FUNC_ERROR_TEXT);
  10583. }
  10584. n = toInteger(n);
  10585. return function() {
  10586. if (--n > 0) {
  10587. result = func.apply(this, arguments);
  10588. }
  10589. if (n <= 1) {
  10590. func = undefined;
  10591. }
  10592. return result;
  10593. };
  10594. }
  10595. /**
  10596. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10597. * and `partials` prepended to the arguments it receives.
  10598. *
  10599. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10600. * may be used as a placeholder for partially applied arguments.
  10601. *
  10602. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10603. * property of bound functions.
  10604. *
  10605. * @static
  10606. * @memberOf _
  10607. * @since 0.1.0
  10608. * @category Function
  10609. * @param {Function} func The function to bind.
  10610. * @param {*} thisArg The `this` binding of `func`.
  10611. * @param {...*} [partials] The arguments to be partially applied.
  10612. * @returns {Function} Returns the new bound function.
  10613. * @example
  10614. *
  10615. * function greet(greeting, punctuation) {
  10616. * return greeting + ' ' + this.user + punctuation;
  10617. * }
  10618. *
  10619. * var object = { 'user': 'fred' };
  10620. *
  10621. * var bound = _.bind(greet, object, 'hi');
  10622. * bound('!');
  10623. * // => 'hi fred!'
  10624. *
  10625. * // Bound with placeholders.
  10626. * var bound = _.bind(greet, object, _, '!');
  10627. * bound('hi');
  10628. * // => 'hi fred!'
  10629. */
  10630. var bind = baseRest(function(func, thisArg, partials) {
  10631. var bitmask = WRAP_BIND_FLAG;
  10632. if (partials.length) {
  10633. var holders = replaceHolders(partials, getHolder(bind));
  10634. bitmask |= WRAP_PARTIAL_FLAG;
  10635. }
  10636. return createWrap(func, bitmask, thisArg, partials, holders);
  10637. });
  10638. /**
  10639. * Creates a function that invokes the method at `object[key]` with `partials`
  10640. * prepended to the arguments it receives.
  10641. *
  10642. * This method differs from `_.bind` by allowing bound functions to reference
  10643. * methods that may be redefined or don't yet exist. See
  10644. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10645. * for more details.
  10646. *
  10647. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10648. * builds, may be used as a placeholder for partially applied arguments.
  10649. *
  10650. * @static
  10651. * @memberOf _
  10652. * @since 0.10.0
  10653. * @category Function
  10654. * @param {Object} object The object to invoke the method on.
  10655. * @param {string} key The key of the method.
  10656. * @param {...*} [partials] The arguments to be partially applied.
  10657. * @returns {Function} Returns the new bound function.
  10658. * @example
  10659. *
  10660. * var object = {
  10661. * 'user': 'fred',
  10662. * 'greet': function(greeting, punctuation) {
  10663. * return greeting + ' ' + this.user + punctuation;
  10664. * }
  10665. * };
  10666. *
  10667. * var bound = _.bindKey(object, 'greet', 'hi');
  10668. * bound('!');
  10669. * // => 'hi fred!'
  10670. *
  10671. * object.greet = function(greeting, punctuation) {
  10672. * return greeting + 'ya ' + this.user + punctuation;
  10673. * };
  10674. *
  10675. * bound('!');
  10676. * // => 'hiya fred!'
  10677. *
  10678. * // Bound with placeholders.
  10679. * var bound = _.bindKey(object, 'greet', _, '!');
  10680. * bound('hi');
  10681. * // => 'hiya fred!'
  10682. */
  10683. var bindKey = baseRest(function(object, key, partials) {
  10684. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10685. if (partials.length) {
  10686. var holders = replaceHolders(partials, getHolder(bindKey));
  10687. bitmask |= WRAP_PARTIAL_FLAG;
  10688. }
  10689. return createWrap(key, bitmask, object, partials, holders);
  10690. });
  10691. /**
  10692. * Creates a function that accepts arguments of `func` and either invokes
  10693. * `func` returning its result, if at least `arity` number of arguments have
  10694. * been provided, or returns a function that accepts the remaining `func`
  10695. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10696. * is not sufficient.
  10697. *
  10698. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10699. * may be used as a placeholder for provided arguments.
  10700. *
  10701. * **Note:** This method doesn't set the "length" property of curried functions.
  10702. *
  10703. * @static
  10704. * @memberOf _
  10705. * @since 2.0.0
  10706. * @category Function
  10707. * @param {Function} func The function to curry.
  10708. * @param {number} [arity=func.length] The arity of `func`.
  10709. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10710. * @returns {Function} Returns the new curried function.
  10711. * @example
  10712. *
  10713. * var abc = function(a, b, c) {
  10714. * return [a, b, c];
  10715. * };
  10716. *
  10717. * var curried = _.curry(abc);
  10718. *
  10719. * curried(1)(2)(3);
  10720. * // => [1, 2, 3]
  10721. *
  10722. * curried(1, 2)(3);
  10723. * // => [1, 2, 3]
  10724. *
  10725. * curried(1, 2, 3);
  10726. * // => [1, 2, 3]
  10727. *
  10728. * // Curried with placeholders.
  10729. * curried(1)(_, 3)(2);
  10730. * // => [1, 2, 3]
  10731. */
  10732. function curry(func, arity, guard) {
  10733. arity = guard ? undefined : arity;
  10734. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10735. result.placeholder = curry.placeholder;
  10736. return result;
  10737. }
  10738. /**
  10739. * This method is like `_.curry` except that arguments are applied to `func`
  10740. * in the manner of `_.partialRight` instead of `_.partial`.
  10741. *
  10742. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10743. * builds, may be used as a placeholder for provided arguments.
  10744. *
  10745. * **Note:** This method doesn't set the "length" property of curried functions.
  10746. *
  10747. * @static
  10748. * @memberOf _
  10749. * @since 3.0.0
  10750. * @category Function
  10751. * @param {Function} func The function to curry.
  10752. * @param {number} [arity=func.length] The arity of `func`.
  10753. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10754. * @returns {Function} Returns the new curried function.
  10755. * @example
  10756. *
  10757. * var abc = function(a, b, c) {
  10758. * return [a, b, c];
  10759. * };
  10760. *
  10761. * var curried = _.curryRight(abc);
  10762. *
  10763. * curried(3)(2)(1);
  10764. * // => [1, 2, 3]
  10765. *
  10766. * curried(2, 3)(1);
  10767. * // => [1, 2, 3]
  10768. *
  10769. * curried(1, 2, 3);
  10770. * // => [1, 2, 3]
  10771. *
  10772. * // Curried with placeholders.
  10773. * curried(3)(1, _)(2);
  10774. * // => [1, 2, 3]
  10775. */
  10776. function curryRight(func, arity, guard) {
  10777. arity = guard ? undefined : arity;
  10778. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10779. result.placeholder = curryRight.placeholder;
  10780. return result;
  10781. }
  10782. /**
  10783. * Creates a debounced function that delays invoking `func` until after `wait`
  10784. * milliseconds have elapsed since the last time the debounced function was
  10785. * invoked. The debounced function comes with a `cancel` method to cancel
  10786. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10787. * Provide `options` to indicate whether `func` should be invoked on the
  10788. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10789. * with the last arguments provided to the debounced function. Subsequent
  10790. * calls to the debounced function return the result of the last `func`
  10791. * invocation.
  10792. *
  10793. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10794. * invoked on the trailing edge of the timeout only if the debounced function
  10795. * is invoked more than once during the `wait` timeout.
  10796. *
  10797. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10798. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10799. *
  10800. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10801. * for details over the differences between `_.debounce` and `_.throttle`.
  10802. *
  10803. * @static
  10804. * @memberOf _
  10805. * @since 0.1.0
  10806. * @category Function
  10807. * @param {Function} func The function to debounce.
  10808. * @param {number} [wait=0] The number of milliseconds to delay.
  10809. * @param {Object} [options={}] The options object.
  10810. * @param {boolean} [options.leading=false]
  10811. * Specify invoking on the leading edge of the timeout.
  10812. * @param {number} [options.maxWait]
  10813. * The maximum time `func` is allowed to be delayed before it's invoked.
  10814. * @param {boolean} [options.trailing=true]
  10815. * Specify invoking on the trailing edge of the timeout.
  10816. * @returns {Function} Returns the new debounced function.
  10817. * @example
  10818. *
  10819. * // Avoid costly calculations while the window size is in flux.
  10820. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10821. *
  10822. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10823. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10824. * 'leading': true,
  10825. * 'trailing': false
  10826. * }));
  10827. *
  10828. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10829. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10830. * var source = new EventSource('/stream');
  10831. * jQuery(source).on('message', debounced);
  10832. *
  10833. * // Cancel the trailing debounced invocation.
  10834. * jQuery(window).on('popstate', debounced.cancel);
  10835. */
  10836. function debounce(func, wait, options) {
  10837. var lastArgs,
  10838. lastThis,
  10839. maxWait,
  10840. result,
  10841. timerId,
  10842. lastCallTime,
  10843. lastInvokeTime = 0,
  10844. leading = false,
  10845. maxing = false,
  10846. trailing = true;
  10847. if (typeof func != 'function') {
  10848. throw new TypeError(FUNC_ERROR_TEXT);
  10849. }
  10850. wait = toNumber(wait) || 0;
  10851. if (isObject(options)) {
  10852. leading = !!options.leading;
  10853. maxing = 'maxWait' in options;
  10854. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10855. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10856. }
  10857. function invokeFunc(time) {
  10858. var args = lastArgs,
  10859. thisArg = lastThis;
  10860. lastArgs = lastThis = undefined;
  10861. lastInvokeTime = time;
  10862. result = func.apply(thisArg, args);
  10863. return result;
  10864. }
  10865. function leadingEdge(time) {
  10866. // Reset any `maxWait` timer.
  10867. lastInvokeTime = time;
  10868. // Start the timer for the trailing edge.
  10869. timerId = setTimeout(timerExpired, wait);
  10870. // Invoke the leading edge.
  10871. return leading ? invokeFunc(time) : result;
  10872. }
  10873. function remainingWait(time) {
  10874. var timeSinceLastCall = time - lastCallTime,
  10875. timeSinceLastInvoke = time - lastInvokeTime,
  10876. timeWaiting = wait - timeSinceLastCall;
  10877. return maxing
  10878. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10879. : timeWaiting;
  10880. }
  10881. function shouldInvoke(time) {
  10882. var timeSinceLastCall = time - lastCallTime,
  10883. timeSinceLastInvoke = time - lastInvokeTime;
  10884. // Either this is the first call, activity has stopped and we're at the
  10885. // trailing edge, the system time has gone backwards and we're treating
  10886. // it as the trailing edge, or we've hit the `maxWait` limit.
  10887. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10888. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10889. }
  10890. function timerExpired() {
  10891. var time = now();
  10892. if (shouldInvoke(time)) {
  10893. return trailingEdge(time);
  10894. }
  10895. // Restart the timer.
  10896. timerId = setTimeout(timerExpired, remainingWait(time));
  10897. }
  10898. function trailingEdge(time) {
  10899. timerId = undefined;
  10900. // Only invoke if we have `lastArgs` which means `func` has been
  10901. // debounced at least once.
  10902. if (trailing && lastArgs) {
  10903. return invokeFunc(time);
  10904. }
  10905. lastArgs = lastThis = undefined;
  10906. return result;
  10907. }
  10908. function cancel() {
  10909. if (timerId !== undefined) {
  10910. clearTimeout(timerId);
  10911. }
  10912. lastInvokeTime = 0;
  10913. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10914. }
  10915. function flush() {
  10916. return timerId === undefined ? result : trailingEdge(now());
  10917. }
  10918. function debounced() {
  10919. var time = now(),
  10920. isInvoking = shouldInvoke(time);
  10921. lastArgs = arguments;
  10922. lastThis = this;
  10923. lastCallTime = time;
  10924. if (isInvoking) {
  10925. if (timerId === undefined) {
  10926. return leadingEdge(lastCallTime);
  10927. }
  10928. if (maxing) {
  10929. // Handle invocations in a tight loop.
  10930. clearTimeout(timerId);
  10931. timerId = setTimeout(timerExpired, wait);
  10932. return invokeFunc(lastCallTime);
  10933. }
  10934. }
  10935. if (timerId === undefined) {
  10936. timerId = setTimeout(timerExpired, wait);
  10937. }
  10938. return result;
  10939. }
  10940. debounced.cancel = cancel;
  10941. debounced.flush = flush;
  10942. return debounced;
  10943. }
  10944. /**
  10945. * Defers invoking the `func` until the current call stack has cleared. Any
  10946. * additional arguments are provided to `func` when it's invoked.
  10947. *
  10948. * @static
  10949. * @memberOf _
  10950. * @since 0.1.0
  10951. * @category Function
  10952. * @param {Function} func The function to defer.
  10953. * @param {...*} [args] The arguments to invoke `func` with.
  10954. * @returns {number} Returns the timer id.
  10955. * @example
  10956. *
  10957. * _.defer(function(text) {
  10958. * console.log(text);
  10959. * }, 'deferred');
  10960. * // => Logs 'deferred' after one millisecond.
  10961. */
  10962. var defer = baseRest(function(func, args) {
  10963. return baseDelay(func, 1, args);
  10964. });
  10965. /**
  10966. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10967. * provided to `func` when it's invoked.
  10968. *
  10969. * @static
  10970. * @memberOf _
  10971. * @since 0.1.0
  10972. * @category Function
  10973. * @param {Function} func The function to delay.
  10974. * @param {number} wait The number of milliseconds to delay invocation.
  10975. * @param {...*} [args] The arguments to invoke `func` with.
  10976. * @returns {number} Returns the timer id.
  10977. * @example
  10978. *
  10979. * _.delay(function(text) {
  10980. * console.log(text);
  10981. * }, 1000, 'later');
  10982. * // => Logs 'later' after one second.
  10983. */
  10984. var delay = baseRest(function(func, wait, args) {
  10985. return baseDelay(func, toNumber(wait) || 0, args);
  10986. });
  10987. /**
  10988. * Creates a function that invokes `func` with arguments reversed.
  10989. *
  10990. * @static
  10991. * @memberOf _
  10992. * @since 4.0.0
  10993. * @category Function
  10994. * @param {Function} func The function to flip arguments for.
  10995. * @returns {Function} Returns the new flipped function.
  10996. * @example
  10997. *
  10998. * var flipped = _.flip(function() {
  10999. * return _.toArray(arguments);
  11000. * });
  11001. *
  11002. * flipped('a', 'b', 'c', 'd');
  11003. * // => ['d', 'c', 'b', 'a']
  11004. */
  11005. function flip(func) {
  11006. return createWrap(func, WRAP_FLIP_FLAG);
  11007. }
  11008. /**
  11009. * Creates a function that memoizes the result of `func`. If `resolver` is
  11010. * provided, it determines the cache key for storing the result based on the
  11011. * arguments provided to the memoized function. By default, the first argument
  11012. * provided to the memoized function is used as the map cache key. The `func`
  11013. * is invoked with the `this` binding of the memoized function.
  11014. *
  11015. * **Note:** The cache is exposed as the `cache` property on the memoized
  11016. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11017. * constructor with one whose instances implement the
  11018. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11019. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11020. *
  11021. * @static
  11022. * @memberOf _
  11023. * @since 0.1.0
  11024. * @category Function
  11025. * @param {Function} func The function to have its output memoized.
  11026. * @param {Function} [resolver] The function to resolve the cache key.
  11027. * @returns {Function} Returns the new memoized function.
  11028. * @example
  11029. *
  11030. * var object = { 'a': 1, 'b': 2 };
  11031. * var other = { 'c': 3, 'd': 4 };
  11032. *
  11033. * var values = _.memoize(_.values);
  11034. * values(object);
  11035. * // => [1, 2]
  11036. *
  11037. * values(other);
  11038. * // => [3, 4]
  11039. *
  11040. * object.a = 2;
  11041. * values(object);
  11042. * // => [1, 2]
  11043. *
  11044. * // Modify the result cache.
  11045. * values.cache.set(object, ['a', 'b']);
  11046. * values(object);
  11047. * // => ['a', 'b']
  11048. *
  11049. * // Replace `_.memoize.Cache`.
  11050. * _.memoize.Cache = WeakMap;
  11051. */
  11052. function memoize(func, resolver) {
  11053. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11054. throw new TypeError(FUNC_ERROR_TEXT);
  11055. }
  11056. var memoized = function() {
  11057. var args = arguments,
  11058. key = resolver ? resolver.apply(this, args) : args[0],
  11059. cache = memoized.cache;
  11060. if (cache.has(key)) {
  11061. return cache.get(key);
  11062. }
  11063. var result = func.apply(this, args);
  11064. memoized.cache = cache.set(key, result) || cache;
  11065. return result;
  11066. };
  11067. memoized.cache = new (memoize.Cache || MapCache);
  11068. return memoized;
  11069. }
  11070. // Expose `MapCache`.
  11071. memoize.Cache = MapCache;
  11072. /**
  11073. * Creates a function that negates the result of the predicate `func`. The
  11074. * `func` predicate is invoked with the `this` binding and arguments of the
  11075. * created function.
  11076. *
  11077. * @static
  11078. * @memberOf _
  11079. * @since 3.0.0
  11080. * @category Function
  11081. * @param {Function} predicate The predicate to negate.
  11082. * @returns {Function} Returns the new negated function.
  11083. * @example
  11084. *
  11085. * function isEven(n) {
  11086. * return n % 2 == 0;
  11087. * }
  11088. *
  11089. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11090. * // => [1, 3, 5]
  11091. */
  11092. function negate(predicate) {
  11093. if (typeof predicate != 'function') {
  11094. throw new TypeError(FUNC_ERROR_TEXT);
  11095. }
  11096. return function() {
  11097. var args = arguments;
  11098. switch (args.length) {
  11099. case 0: return !predicate.call(this);
  11100. case 1: return !predicate.call(this, args[0]);
  11101. case 2: return !predicate.call(this, args[0], args[1]);
  11102. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11103. }
  11104. return !predicate.apply(this, args);
  11105. };
  11106. }
  11107. /**
  11108. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11109. * to the function return the value of the first invocation. The `func` is
  11110. * invoked with the `this` binding and arguments of the created function.
  11111. *
  11112. * @static
  11113. * @memberOf _
  11114. * @since 0.1.0
  11115. * @category Function
  11116. * @param {Function} func The function to restrict.
  11117. * @returns {Function} Returns the new restricted function.
  11118. * @example
  11119. *
  11120. * var initialize = _.once(createApplication);
  11121. * initialize();
  11122. * initialize();
  11123. * // => `createApplication` is invoked once
  11124. */
  11125. function once(func) {
  11126. return before(2, func);
  11127. }
  11128. /**
  11129. * Creates a function that invokes `func` with its arguments transformed.
  11130. *
  11131. * @static
  11132. * @since 4.0.0
  11133. * @memberOf _
  11134. * @category Function
  11135. * @param {Function} func The function to wrap.
  11136. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11137. * The argument transforms.
  11138. * @returns {Function} Returns the new function.
  11139. * @example
  11140. *
  11141. * function doubled(n) {
  11142. * return n * 2;
  11143. * }
  11144. *
  11145. * function square(n) {
  11146. * return n * n;
  11147. * }
  11148. *
  11149. * var func = _.overArgs(function(x, y) {
  11150. * return [x, y];
  11151. * }, [square, doubled]);
  11152. *
  11153. * func(9, 3);
  11154. * // => [81, 6]
  11155. *
  11156. * func(10, 5);
  11157. * // => [100, 10]
  11158. */
  11159. var overArgs = castRest(function(func, transforms) {
  11160. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11161. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11162. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11163. var funcsLength = transforms.length;
  11164. return baseRest(function(args) {
  11165. var index = -1,
  11166. length = nativeMin(args.length, funcsLength);
  11167. while (++index < length) {
  11168. args[index] = transforms[index].call(this, args[index]);
  11169. }
  11170. return apply(func, this, args);
  11171. });
  11172. });
  11173. /**
  11174. * Creates a function that invokes `func` with `partials` prepended to the
  11175. * arguments it receives. This method is like `_.bind` except it does **not**
  11176. * alter the `this` binding.
  11177. *
  11178. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11179. * builds, may be used as a placeholder for partially applied arguments.
  11180. *
  11181. * **Note:** This method doesn't set the "length" property of partially
  11182. * applied functions.
  11183. *
  11184. * @static
  11185. * @memberOf _
  11186. * @since 0.2.0
  11187. * @category Function
  11188. * @param {Function} func The function to partially apply arguments to.
  11189. * @param {...*} [partials] The arguments to be partially applied.
  11190. * @returns {Function} Returns the new partially applied function.
  11191. * @example
  11192. *
  11193. * function greet(greeting, name) {
  11194. * return greeting + ' ' + name;
  11195. * }
  11196. *
  11197. * var sayHelloTo = _.partial(greet, 'hello');
  11198. * sayHelloTo('fred');
  11199. * // => 'hello fred'
  11200. *
  11201. * // Partially applied with placeholders.
  11202. * var greetFred = _.partial(greet, _, 'fred');
  11203. * greetFred('hi');
  11204. * // => 'hi fred'
  11205. */
  11206. var partial = baseRest(function(func, partials) {
  11207. var holders = replaceHolders(partials, getHolder(partial));
  11208. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11209. });
  11210. /**
  11211. * This method is like `_.partial` except that partially applied arguments
  11212. * are appended to the arguments it receives.
  11213. *
  11214. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11215. * builds, may be used as a placeholder for partially applied arguments.
  11216. *
  11217. * **Note:** This method doesn't set the "length" property of partially
  11218. * applied functions.
  11219. *
  11220. * @static
  11221. * @memberOf _
  11222. * @since 1.0.0
  11223. * @category Function
  11224. * @param {Function} func The function to partially apply arguments to.
  11225. * @param {...*} [partials] The arguments to be partially applied.
  11226. * @returns {Function} Returns the new partially applied function.
  11227. * @example
  11228. *
  11229. * function greet(greeting, name) {
  11230. * return greeting + ' ' + name;
  11231. * }
  11232. *
  11233. * var greetFred = _.partialRight(greet, 'fred');
  11234. * greetFred('hi');
  11235. * // => 'hi fred'
  11236. *
  11237. * // Partially applied with placeholders.
  11238. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11239. * sayHelloTo('fred');
  11240. * // => 'hello fred'
  11241. */
  11242. var partialRight = baseRest(function(func, partials) {
  11243. var holders = replaceHolders(partials, getHolder(partialRight));
  11244. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11245. });
  11246. /**
  11247. * Creates a function that invokes `func` with arguments arranged according
  11248. * to the specified `indexes` where the argument value at the first index is
  11249. * provided as the first argument, the argument value at the second index is
  11250. * provided as the second argument, and so on.
  11251. *
  11252. * @static
  11253. * @memberOf _
  11254. * @since 3.0.0
  11255. * @category Function
  11256. * @param {Function} func The function to rearrange arguments for.
  11257. * @param {...(number|number[])} indexes The arranged argument indexes.
  11258. * @returns {Function} Returns the new function.
  11259. * @example
  11260. *
  11261. * var rearged = _.rearg(function(a, b, c) {
  11262. * return [a, b, c];
  11263. * }, [2, 0, 1]);
  11264. *
  11265. * rearged('b', 'c', 'a')
  11266. * // => ['a', 'b', 'c']
  11267. */
  11268. var rearg = flatRest(function(func, indexes) {
  11269. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11270. });
  11271. /**
  11272. * Creates a function that invokes `func` with the `this` binding of the
  11273. * created function and arguments from `start` and beyond provided as
  11274. * an array.
  11275. *
  11276. * **Note:** This method is based on the
  11277. * [rest parameter](https://mdn.io/rest_parameters).
  11278. *
  11279. * @static
  11280. * @memberOf _
  11281. * @since 4.0.0
  11282. * @category Function
  11283. * @param {Function} func The function to apply a rest parameter to.
  11284. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11285. * @returns {Function} Returns the new function.
  11286. * @example
  11287. *
  11288. * var say = _.rest(function(what, names) {
  11289. * return what + ' ' + _.initial(names).join(', ') +
  11290. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11291. * });
  11292. *
  11293. * say('hello', 'fred', 'barney', 'pebbles');
  11294. * // => 'hello fred, barney, & pebbles'
  11295. */
  11296. function rest(func, start) {
  11297. if (typeof func != 'function') {
  11298. throw new TypeError(FUNC_ERROR_TEXT);
  11299. }
  11300. start = start === undefined ? start : toInteger(start);
  11301. return baseRest(func, start);
  11302. }
  11303. /**
  11304. * Creates a function that invokes `func` with the `this` binding of the
  11305. * create function and an array of arguments much like
  11306. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11307. *
  11308. * **Note:** This method is based on the
  11309. * [spread operator](https://mdn.io/spread_operator).
  11310. *
  11311. * @static
  11312. * @memberOf _
  11313. * @since 3.2.0
  11314. * @category Function
  11315. * @param {Function} func The function to spread arguments over.
  11316. * @param {number} [start=0] The start position of the spread.
  11317. * @returns {Function} Returns the new function.
  11318. * @example
  11319. *
  11320. * var say = _.spread(function(who, what) {
  11321. * return who + ' says ' + what;
  11322. * });
  11323. *
  11324. * say(['fred', 'hello']);
  11325. * // => 'fred says hello'
  11326. *
  11327. * var numbers = Promise.all([
  11328. * Promise.resolve(40),
  11329. * Promise.resolve(36)
  11330. * ]);
  11331. *
  11332. * numbers.then(_.spread(function(x, y) {
  11333. * return x + y;
  11334. * }));
  11335. * // => a Promise of 76
  11336. */
  11337. function spread(func, start) {
  11338. if (typeof func != 'function') {
  11339. throw new TypeError(FUNC_ERROR_TEXT);
  11340. }
  11341. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11342. return baseRest(function(args) {
  11343. var array = args[start],
  11344. otherArgs = castSlice(args, 0, start);
  11345. if (array) {
  11346. arrayPush(otherArgs, array);
  11347. }
  11348. return apply(func, this, otherArgs);
  11349. });
  11350. }
  11351. /**
  11352. * Creates a throttled function that only invokes `func` at most once per
  11353. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11354. * method to cancel delayed `func` invocations and a `flush` method to
  11355. * immediately invoke them. Provide `options` to indicate whether `func`
  11356. * should be invoked on the leading and/or trailing edge of the `wait`
  11357. * timeout. The `func` is invoked with the last arguments provided to the
  11358. * throttled function. Subsequent calls to the throttled function return the
  11359. * result of the last `func` invocation.
  11360. *
  11361. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11362. * invoked on the trailing edge of the timeout only if the throttled function
  11363. * is invoked more than once during the `wait` timeout.
  11364. *
  11365. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11366. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11367. *
  11368. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11369. * for details over the differences between `_.throttle` and `_.debounce`.
  11370. *
  11371. * @static
  11372. * @memberOf _
  11373. * @since 0.1.0
  11374. * @category Function
  11375. * @param {Function} func The function to throttle.
  11376. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11377. * @param {Object} [options={}] The options object.
  11378. * @param {boolean} [options.leading=true]
  11379. * Specify invoking on the leading edge of the timeout.
  11380. * @param {boolean} [options.trailing=true]
  11381. * Specify invoking on the trailing edge of the timeout.
  11382. * @returns {Function} Returns the new throttled function.
  11383. * @example
  11384. *
  11385. * // Avoid excessively updating the position while scrolling.
  11386. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11387. *
  11388. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11389. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11390. * jQuery(element).on('click', throttled);
  11391. *
  11392. * // Cancel the trailing throttled invocation.
  11393. * jQuery(window).on('popstate', throttled.cancel);
  11394. */
  11395. function throttle(func, wait, options) {
  11396. var leading = true,
  11397. trailing = true;
  11398. if (typeof func != 'function') {
  11399. throw new TypeError(FUNC_ERROR_TEXT);
  11400. }
  11401. if (isObject(options)) {
  11402. leading = 'leading' in options ? !!options.leading : leading;
  11403. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11404. }
  11405. return debounce(func, wait, {
  11406. 'leading': leading,
  11407. 'maxWait': wait,
  11408. 'trailing': trailing
  11409. });
  11410. }
  11411. /**
  11412. * Creates a function that accepts up to one argument, ignoring any
  11413. * additional arguments.
  11414. *
  11415. * @static
  11416. * @memberOf _
  11417. * @since 4.0.0
  11418. * @category Function
  11419. * @param {Function} func The function to cap arguments for.
  11420. * @returns {Function} Returns the new capped function.
  11421. * @example
  11422. *
  11423. * _.map(['6', '8', '10'], _.unary(parseInt));
  11424. * // => [6, 8, 10]
  11425. */
  11426. function unary(func) {
  11427. return ary(func, 1);
  11428. }
  11429. /**
  11430. * Creates a function that provides `value` to `wrapper` as its first
  11431. * argument. Any additional arguments provided to the function are appended
  11432. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11433. * binding of the created function.
  11434. *
  11435. * @static
  11436. * @memberOf _
  11437. * @since 0.1.0
  11438. * @category Function
  11439. * @param {*} value The value to wrap.
  11440. * @param {Function} [wrapper=identity] The wrapper function.
  11441. * @returns {Function} Returns the new function.
  11442. * @example
  11443. *
  11444. * var p = _.wrap(_.escape, function(func, text) {
  11445. * return '<p>' + func(text) + '</p>';
  11446. * });
  11447. *
  11448. * p('fred, barney, & pebbles');
  11449. * // => '<p>fred, barney, &amp; pebbles</p>'
  11450. */
  11451. function wrap(value, wrapper) {
  11452. return partial(castFunction(wrapper), value);
  11453. }
  11454. /*------------------------------------------------------------------------*/
  11455. /**
  11456. * Casts `value` as an array if it's not one.
  11457. *
  11458. * @static
  11459. * @memberOf _
  11460. * @since 4.4.0
  11461. * @category Lang
  11462. * @param {*} value The value to inspect.
  11463. * @returns {Array} Returns the cast array.
  11464. * @example
  11465. *
  11466. * _.castArray(1);
  11467. * // => [1]
  11468. *
  11469. * _.castArray({ 'a': 1 });
  11470. * // => [{ 'a': 1 }]
  11471. *
  11472. * _.castArray('abc');
  11473. * // => ['abc']
  11474. *
  11475. * _.castArray(null);
  11476. * // => [null]
  11477. *
  11478. * _.castArray(undefined);
  11479. * // => [undefined]
  11480. *
  11481. * _.castArray();
  11482. * // => []
  11483. *
  11484. * var array = [1, 2, 3];
  11485. * console.log(_.castArray(array) === array);
  11486. * // => true
  11487. */
  11488. function castArray() {
  11489. if (!arguments.length) {
  11490. return [];
  11491. }
  11492. var value = arguments[0];
  11493. return isArray(value) ? value : [value];
  11494. }
  11495. /**
  11496. * Creates a shallow clone of `value`.
  11497. *
  11498. * **Note:** This method is loosely based on the
  11499. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11500. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11501. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11502. * arrays. The own enumerable properties of `arguments` objects are cloned
  11503. * as plain objects. An empty object is returned for uncloneable values such
  11504. * as error objects, functions, DOM nodes, and WeakMaps.
  11505. *
  11506. * @static
  11507. * @memberOf _
  11508. * @since 0.1.0
  11509. * @category Lang
  11510. * @param {*} value The value to clone.
  11511. * @returns {*} Returns the cloned value.
  11512. * @see _.cloneDeep
  11513. * @example
  11514. *
  11515. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11516. *
  11517. * var shallow = _.clone(objects);
  11518. * console.log(shallow[0] === objects[0]);
  11519. * // => true
  11520. */
  11521. function clone(value) {
  11522. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11523. }
  11524. /**
  11525. * This method is like `_.clone` except that it accepts `customizer` which
  11526. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11527. * cloning is handled by the method instead. The `customizer` is invoked with
  11528. * up to four arguments; (value [, index|key, object, stack]).
  11529. *
  11530. * @static
  11531. * @memberOf _
  11532. * @since 4.0.0
  11533. * @category Lang
  11534. * @param {*} value The value to clone.
  11535. * @param {Function} [customizer] The function to customize cloning.
  11536. * @returns {*} Returns the cloned value.
  11537. * @see _.cloneDeepWith
  11538. * @example
  11539. *
  11540. * function customizer(value) {
  11541. * if (_.isElement(value)) {
  11542. * return value.cloneNode(false);
  11543. * }
  11544. * }
  11545. *
  11546. * var el = _.cloneWith(document.body, customizer);
  11547. *
  11548. * console.log(el === document.body);
  11549. * // => false
  11550. * console.log(el.nodeName);
  11551. * // => 'BODY'
  11552. * console.log(el.childNodes.length);
  11553. * // => 0
  11554. */
  11555. function cloneWith(value, customizer) {
  11556. customizer = typeof customizer == 'function' ? customizer : undefined;
  11557. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11558. }
  11559. /**
  11560. * This method is like `_.clone` except that it recursively clones `value`.
  11561. *
  11562. * @static
  11563. * @memberOf _
  11564. * @since 1.0.0
  11565. * @category Lang
  11566. * @param {*} value The value to recursively clone.
  11567. * @returns {*} Returns the deep cloned value.
  11568. * @see _.clone
  11569. * @example
  11570. *
  11571. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11572. *
  11573. * var deep = _.cloneDeep(objects);
  11574. * console.log(deep[0] === objects[0]);
  11575. * // => false
  11576. */
  11577. function cloneDeep(value) {
  11578. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11579. }
  11580. /**
  11581. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11582. *
  11583. * @static
  11584. * @memberOf _
  11585. * @since 4.0.0
  11586. * @category Lang
  11587. * @param {*} value The value to recursively clone.
  11588. * @param {Function} [customizer] The function to customize cloning.
  11589. * @returns {*} Returns the deep cloned value.
  11590. * @see _.cloneWith
  11591. * @example
  11592. *
  11593. * function customizer(value) {
  11594. * if (_.isElement(value)) {
  11595. * return value.cloneNode(true);
  11596. * }
  11597. * }
  11598. *
  11599. * var el = _.cloneDeepWith(document.body, customizer);
  11600. *
  11601. * console.log(el === document.body);
  11602. * // => false
  11603. * console.log(el.nodeName);
  11604. * // => 'BODY'
  11605. * console.log(el.childNodes.length);
  11606. * // => 20
  11607. */
  11608. function cloneDeepWith(value, customizer) {
  11609. customizer = typeof customizer == 'function' ? customizer : undefined;
  11610. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11611. }
  11612. /**
  11613. * Checks if `object` conforms to `source` by invoking the predicate
  11614. * properties of `source` with the corresponding property values of `object`.
  11615. *
  11616. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11617. * partially applied.
  11618. *
  11619. * @static
  11620. * @memberOf _
  11621. * @since 4.14.0
  11622. * @category Lang
  11623. * @param {Object} object The object to inspect.
  11624. * @param {Object} source The object of property predicates to conform to.
  11625. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11626. * @example
  11627. *
  11628. * var object = { 'a': 1, 'b': 2 };
  11629. *
  11630. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11631. * // => true
  11632. *
  11633. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11634. * // => false
  11635. */
  11636. function conformsTo(object, source) {
  11637. return source == null || baseConformsTo(object, source, keys(source));
  11638. }
  11639. /**
  11640. * Performs a
  11641. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11642. * comparison between two values to determine if they are equivalent.
  11643. *
  11644. * @static
  11645. * @memberOf _
  11646. * @since 4.0.0
  11647. * @category Lang
  11648. * @param {*} value The value to compare.
  11649. * @param {*} other The other value to compare.
  11650. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11651. * @example
  11652. *
  11653. * var object = { 'a': 1 };
  11654. * var other = { 'a': 1 };
  11655. *
  11656. * _.eq(object, object);
  11657. * // => true
  11658. *
  11659. * _.eq(object, other);
  11660. * // => false
  11661. *
  11662. * _.eq('a', 'a');
  11663. * // => true
  11664. *
  11665. * _.eq('a', Object('a'));
  11666. * // => false
  11667. *
  11668. * _.eq(NaN, NaN);
  11669. * // => true
  11670. */
  11671. function eq(value, other) {
  11672. return value === other || (value !== value && other !== other);
  11673. }
  11674. /**
  11675. * Checks if `value` is greater than `other`.
  11676. *
  11677. * @static
  11678. * @memberOf _
  11679. * @since 3.9.0
  11680. * @category Lang
  11681. * @param {*} value The value to compare.
  11682. * @param {*} other The other value to compare.
  11683. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11684. * else `false`.
  11685. * @see _.lt
  11686. * @example
  11687. *
  11688. * _.gt(3, 1);
  11689. * // => true
  11690. *
  11691. * _.gt(3, 3);
  11692. * // => false
  11693. *
  11694. * _.gt(1, 3);
  11695. * // => false
  11696. */
  11697. var gt = createRelationalOperation(baseGt);
  11698. /**
  11699. * Checks if `value` is greater than or equal to `other`.
  11700. *
  11701. * @static
  11702. * @memberOf _
  11703. * @since 3.9.0
  11704. * @category Lang
  11705. * @param {*} value The value to compare.
  11706. * @param {*} other The other value to compare.
  11707. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11708. * `other`, else `false`.
  11709. * @see _.lte
  11710. * @example
  11711. *
  11712. * _.gte(3, 1);
  11713. * // => true
  11714. *
  11715. * _.gte(3, 3);
  11716. * // => true
  11717. *
  11718. * _.gte(1, 3);
  11719. * // => false
  11720. */
  11721. var gte = createRelationalOperation(function(value, other) {
  11722. return value >= other;
  11723. });
  11724. /**
  11725. * Checks if `value` is likely an `arguments` object.
  11726. *
  11727. * @static
  11728. * @memberOf _
  11729. * @since 0.1.0
  11730. * @category Lang
  11731. * @param {*} value The value to check.
  11732. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11733. * else `false`.
  11734. * @example
  11735. *
  11736. * _.isArguments(function() { return arguments; }());
  11737. * // => true
  11738. *
  11739. * _.isArguments([1, 2, 3]);
  11740. * // => false
  11741. */
  11742. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11743. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11744. !propertyIsEnumerable.call(value, 'callee');
  11745. };
  11746. /**
  11747. * Checks if `value` is classified as an `Array` object.
  11748. *
  11749. * @static
  11750. * @memberOf _
  11751. * @since 0.1.0
  11752. * @category Lang
  11753. * @param {*} value The value to check.
  11754. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11755. * @example
  11756. *
  11757. * _.isArray([1, 2, 3]);
  11758. * // => true
  11759. *
  11760. * _.isArray(document.body.children);
  11761. * // => false
  11762. *
  11763. * _.isArray('abc');
  11764. * // => false
  11765. *
  11766. * _.isArray(_.noop);
  11767. * // => false
  11768. */
  11769. var isArray = Array.isArray;
  11770. /**
  11771. * Checks if `value` is classified as an `ArrayBuffer` object.
  11772. *
  11773. * @static
  11774. * @memberOf _
  11775. * @since 4.3.0
  11776. * @category Lang
  11777. * @param {*} value The value to check.
  11778. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11779. * @example
  11780. *
  11781. * _.isArrayBuffer(new ArrayBuffer(2));
  11782. * // => true
  11783. *
  11784. * _.isArrayBuffer(new Array(2));
  11785. * // => false
  11786. */
  11787. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11788. /**
  11789. * Checks if `value` is array-like. A value is considered array-like if it's
  11790. * not a function and has a `value.length` that's an integer greater than or
  11791. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11792. *
  11793. * @static
  11794. * @memberOf _
  11795. * @since 4.0.0
  11796. * @category Lang
  11797. * @param {*} value The value to check.
  11798. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11799. * @example
  11800. *
  11801. * _.isArrayLike([1, 2, 3]);
  11802. * // => true
  11803. *
  11804. * _.isArrayLike(document.body.children);
  11805. * // => true
  11806. *
  11807. * _.isArrayLike('abc');
  11808. * // => true
  11809. *
  11810. * _.isArrayLike(_.noop);
  11811. * // => false
  11812. */
  11813. function isArrayLike(value) {
  11814. return value != null && isLength(value.length) && !isFunction(value);
  11815. }
  11816. /**
  11817. * This method is like `_.isArrayLike` except that it also checks if `value`
  11818. * is an object.
  11819. *
  11820. * @static
  11821. * @memberOf _
  11822. * @since 4.0.0
  11823. * @category Lang
  11824. * @param {*} value The value to check.
  11825. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11826. * else `false`.
  11827. * @example
  11828. *
  11829. * _.isArrayLikeObject([1, 2, 3]);
  11830. * // => true
  11831. *
  11832. * _.isArrayLikeObject(document.body.children);
  11833. * // => true
  11834. *
  11835. * _.isArrayLikeObject('abc');
  11836. * // => false
  11837. *
  11838. * _.isArrayLikeObject(_.noop);
  11839. * // => false
  11840. */
  11841. function isArrayLikeObject(value) {
  11842. return isObjectLike(value) && isArrayLike(value);
  11843. }
  11844. /**
  11845. * Checks if `value` is classified as a boolean primitive or object.
  11846. *
  11847. * @static
  11848. * @memberOf _
  11849. * @since 0.1.0
  11850. * @category Lang
  11851. * @param {*} value The value to check.
  11852. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11853. * @example
  11854. *
  11855. * _.isBoolean(false);
  11856. * // => true
  11857. *
  11858. * _.isBoolean(null);
  11859. * // => false
  11860. */
  11861. function isBoolean(value) {
  11862. return value === true || value === false ||
  11863. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11864. }
  11865. /**
  11866. * Checks if `value` is a buffer.
  11867. *
  11868. * @static
  11869. * @memberOf _
  11870. * @since 4.3.0
  11871. * @category Lang
  11872. * @param {*} value The value to check.
  11873. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11874. * @example
  11875. *
  11876. * _.isBuffer(new Buffer(2));
  11877. * // => true
  11878. *
  11879. * _.isBuffer(new Uint8Array(2));
  11880. * // => false
  11881. */
  11882. var isBuffer = nativeIsBuffer || stubFalse;
  11883. /**
  11884. * Checks if `value` is classified as a `Date` object.
  11885. *
  11886. * @static
  11887. * @memberOf _
  11888. * @since 0.1.0
  11889. * @category Lang
  11890. * @param {*} value The value to check.
  11891. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11892. * @example
  11893. *
  11894. * _.isDate(new Date);
  11895. * // => true
  11896. *
  11897. * _.isDate('Mon April 23 2012');
  11898. * // => false
  11899. */
  11900. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11901. /**
  11902. * Checks if `value` is likely a DOM element.
  11903. *
  11904. * @static
  11905. * @memberOf _
  11906. * @since 0.1.0
  11907. * @category Lang
  11908. * @param {*} value The value to check.
  11909. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11910. * @example
  11911. *
  11912. * _.isElement(document.body);
  11913. * // => true
  11914. *
  11915. * _.isElement('<body>');
  11916. * // => false
  11917. */
  11918. function isElement(value) {
  11919. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11920. }
  11921. /**
  11922. * Checks if `value` is an empty object, collection, map, or set.
  11923. *
  11924. * Objects are considered empty if they have no own enumerable string keyed
  11925. * properties.
  11926. *
  11927. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11928. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11929. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11930. *
  11931. * @static
  11932. * @memberOf _
  11933. * @since 0.1.0
  11934. * @category Lang
  11935. * @param {*} value The value to check.
  11936. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11937. * @example
  11938. *
  11939. * _.isEmpty(null);
  11940. * // => true
  11941. *
  11942. * _.isEmpty(true);
  11943. * // => true
  11944. *
  11945. * _.isEmpty(1);
  11946. * // => true
  11947. *
  11948. * _.isEmpty([1, 2, 3]);
  11949. * // => false
  11950. *
  11951. * _.isEmpty({ 'a': 1 });
  11952. * // => false
  11953. */
  11954. function isEmpty(value) {
  11955. if (value == null) {
  11956. return true;
  11957. }
  11958. if (isArrayLike(value) &&
  11959. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11960. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11961. return !value.length;
  11962. }
  11963. var tag = getTag(value);
  11964. if (tag == mapTag || tag == setTag) {
  11965. return !value.size;
  11966. }
  11967. if (isPrototype(value)) {
  11968. return !baseKeys(value).length;
  11969. }
  11970. for (var key in value) {
  11971. if (hasOwnProperty.call(value, key)) {
  11972. return false;
  11973. }
  11974. }
  11975. return true;
  11976. }
  11977. /**
  11978. * Performs a deep comparison between two values to determine if they are
  11979. * equivalent.
  11980. *
  11981. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11982. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11983. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11984. * by their own, not inherited, enumerable properties. Functions and DOM
  11985. * nodes are compared by strict equality, i.e. `===`.
  11986. *
  11987. * @static
  11988. * @memberOf _
  11989. * @since 0.1.0
  11990. * @category Lang
  11991. * @param {*} value The value to compare.
  11992. * @param {*} other The other value to compare.
  11993. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11994. * @example
  11995. *
  11996. * var object = { 'a': 1 };
  11997. * var other = { 'a': 1 };
  11998. *
  11999. * _.isEqual(object, other);
  12000. * // => true
  12001. *
  12002. * object === other;
  12003. * // => false
  12004. */
  12005. function isEqual(value, other) {
  12006. return baseIsEqual(value, other);
  12007. }
  12008. /**
  12009. * This method is like `_.isEqual` except that it accepts `customizer` which
  12010. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12011. * are handled by the method instead. The `customizer` is invoked with up to
  12012. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12013. *
  12014. * @static
  12015. * @memberOf _
  12016. * @since 4.0.0
  12017. * @category Lang
  12018. * @param {*} value The value to compare.
  12019. * @param {*} other The other value to compare.
  12020. * @param {Function} [customizer] The function to customize comparisons.
  12021. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12022. * @example
  12023. *
  12024. * function isGreeting(value) {
  12025. * return /^h(?:i|ello)$/.test(value);
  12026. * }
  12027. *
  12028. * function customizer(objValue, othValue) {
  12029. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12030. * return true;
  12031. * }
  12032. * }
  12033. *
  12034. * var array = ['hello', 'goodbye'];
  12035. * var other = ['hi', 'goodbye'];
  12036. *
  12037. * _.isEqualWith(array, other, customizer);
  12038. * // => true
  12039. */
  12040. function isEqualWith(value, other, customizer) {
  12041. customizer = typeof customizer == 'function' ? customizer : undefined;
  12042. var result = customizer ? customizer(value, other) : undefined;
  12043. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12044. }
  12045. /**
  12046. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12047. * `SyntaxError`, `TypeError`, or `URIError` object.
  12048. *
  12049. * @static
  12050. * @memberOf _
  12051. * @since 3.0.0
  12052. * @category Lang
  12053. * @param {*} value The value to check.
  12054. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12055. * @example
  12056. *
  12057. * _.isError(new Error);
  12058. * // => true
  12059. *
  12060. * _.isError(Error);
  12061. * // => false
  12062. */
  12063. function isError(value) {
  12064. if (!isObjectLike(value)) {
  12065. return false;
  12066. }
  12067. var tag = baseGetTag(value);
  12068. return tag == errorTag || tag == domExcTag ||
  12069. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12070. }
  12071. /**
  12072. * Checks if `value` is a finite primitive number.
  12073. *
  12074. * **Note:** This method is based on
  12075. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12076. *
  12077. * @static
  12078. * @memberOf _
  12079. * @since 0.1.0
  12080. * @category Lang
  12081. * @param {*} value The value to check.
  12082. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12083. * @example
  12084. *
  12085. * _.isFinite(3);
  12086. * // => true
  12087. *
  12088. * _.isFinite(Number.MIN_VALUE);
  12089. * // => true
  12090. *
  12091. * _.isFinite(Infinity);
  12092. * // => false
  12093. *
  12094. * _.isFinite('3');
  12095. * // => false
  12096. */
  12097. function isFinite(value) {
  12098. return typeof value == 'number' && nativeIsFinite(value);
  12099. }
  12100. /**
  12101. * Checks if `value` is classified as a `Function` object.
  12102. *
  12103. * @static
  12104. * @memberOf _
  12105. * @since 0.1.0
  12106. * @category Lang
  12107. * @param {*} value The value to check.
  12108. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12109. * @example
  12110. *
  12111. * _.isFunction(_);
  12112. * // => true
  12113. *
  12114. * _.isFunction(/abc/);
  12115. * // => false
  12116. */
  12117. function isFunction(value) {
  12118. if (!isObject(value)) {
  12119. return false;
  12120. }
  12121. // The use of `Object#toString` avoids issues with the `typeof` operator
  12122. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12123. var tag = baseGetTag(value);
  12124. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12125. }
  12126. /**
  12127. * Checks if `value` is an integer.
  12128. *
  12129. * **Note:** This method is based on
  12130. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12131. *
  12132. * @static
  12133. * @memberOf _
  12134. * @since 4.0.0
  12135. * @category Lang
  12136. * @param {*} value The value to check.
  12137. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12138. * @example
  12139. *
  12140. * _.isInteger(3);
  12141. * // => true
  12142. *
  12143. * _.isInteger(Number.MIN_VALUE);
  12144. * // => false
  12145. *
  12146. * _.isInteger(Infinity);
  12147. * // => false
  12148. *
  12149. * _.isInteger('3');
  12150. * // => false
  12151. */
  12152. function isInteger(value) {
  12153. return typeof value == 'number' && value == toInteger(value);
  12154. }
  12155. /**
  12156. * Checks if `value` is a valid array-like length.
  12157. *
  12158. * **Note:** This method is loosely based on
  12159. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12160. *
  12161. * @static
  12162. * @memberOf _
  12163. * @since 4.0.0
  12164. * @category Lang
  12165. * @param {*} value The value to check.
  12166. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12167. * @example
  12168. *
  12169. * _.isLength(3);
  12170. * // => true
  12171. *
  12172. * _.isLength(Number.MIN_VALUE);
  12173. * // => false
  12174. *
  12175. * _.isLength(Infinity);
  12176. * // => false
  12177. *
  12178. * _.isLength('3');
  12179. * // => false
  12180. */
  12181. function isLength(value) {
  12182. return typeof value == 'number' &&
  12183. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12184. }
  12185. /**
  12186. * Checks if `value` is the
  12187. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12188. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12189. *
  12190. * @static
  12191. * @memberOf _
  12192. * @since 0.1.0
  12193. * @category Lang
  12194. * @param {*} value The value to check.
  12195. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12196. * @example
  12197. *
  12198. * _.isObject({});
  12199. * // => true
  12200. *
  12201. * _.isObject([1, 2, 3]);
  12202. * // => true
  12203. *
  12204. * _.isObject(_.noop);
  12205. * // => true
  12206. *
  12207. * _.isObject(null);
  12208. * // => false
  12209. */
  12210. function isObject(value) {
  12211. var type = typeof value;
  12212. return value != null && (type == 'object' || type == 'function');
  12213. }
  12214. /**
  12215. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12216. * and has a `typeof` result of "object".
  12217. *
  12218. * @static
  12219. * @memberOf _
  12220. * @since 4.0.0
  12221. * @category Lang
  12222. * @param {*} value The value to check.
  12223. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12224. * @example
  12225. *
  12226. * _.isObjectLike({});
  12227. * // => true
  12228. *
  12229. * _.isObjectLike([1, 2, 3]);
  12230. * // => true
  12231. *
  12232. * _.isObjectLike(_.noop);
  12233. * // => false
  12234. *
  12235. * _.isObjectLike(null);
  12236. * // => false
  12237. */
  12238. function isObjectLike(value) {
  12239. return value != null && typeof value == 'object';
  12240. }
  12241. /**
  12242. * Checks if `value` is classified as a `Map` object.
  12243. *
  12244. * @static
  12245. * @memberOf _
  12246. * @since 4.3.0
  12247. * @category Lang
  12248. * @param {*} value The value to check.
  12249. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12250. * @example
  12251. *
  12252. * _.isMap(new Map);
  12253. * // => true
  12254. *
  12255. * _.isMap(new WeakMap);
  12256. * // => false
  12257. */
  12258. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12259. /**
  12260. * Performs a partial deep comparison between `object` and `source` to
  12261. * determine if `object` contains equivalent property values.
  12262. *
  12263. * **Note:** This method is equivalent to `_.matches` when `source` is
  12264. * partially applied.
  12265. *
  12266. * Partial comparisons will match empty array and empty object `source`
  12267. * values against any array or object value, respectively. See `_.isEqual`
  12268. * for a list of supported value comparisons.
  12269. *
  12270. * @static
  12271. * @memberOf _
  12272. * @since 3.0.0
  12273. * @category Lang
  12274. * @param {Object} object The object to inspect.
  12275. * @param {Object} source The object of property values to match.
  12276. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12277. * @example
  12278. *
  12279. * var object = { 'a': 1, 'b': 2 };
  12280. *
  12281. * _.isMatch(object, { 'b': 2 });
  12282. * // => true
  12283. *
  12284. * _.isMatch(object, { 'b': 1 });
  12285. * // => false
  12286. */
  12287. function isMatch(object, source) {
  12288. return object === source || baseIsMatch(object, source, getMatchData(source));
  12289. }
  12290. /**
  12291. * This method is like `_.isMatch` except that it accepts `customizer` which
  12292. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12293. * are handled by the method instead. The `customizer` is invoked with five
  12294. * arguments: (objValue, srcValue, index|key, object, source).
  12295. *
  12296. * @static
  12297. * @memberOf _
  12298. * @since 4.0.0
  12299. * @category Lang
  12300. * @param {Object} object The object to inspect.
  12301. * @param {Object} source The object of property values to match.
  12302. * @param {Function} [customizer] The function to customize comparisons.
  12303. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12304. * @example
  12305. *
  12306. * function isGreeting(value) {
  12307. * return /^h(?:i|ello)$/.test(value);
  12308. * }
  12309. *
  12310. * function customizer(objValue, srcValue) {
  12311. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12312. * return true;
  12313. * }
  12314. * }
  12315. *
  12316. * var object = { 'greeting': 'hello' };
  12317. * var source = { 'greeting': 'hi' };
  12318. *
  12319. * _.isMatchWith(object, source, customizer);
  12320. * // => true
  12321. */
  12322. function isMatchWith(object, source, customizer) {
  12323. customizer = typeof customizer == 'function' ? customizer : undefined;
  12324. return baseIsMatch(object, source, getMatchData(source), customizer);
  12325. }
  12326. /**
  12327. * Checks if `value` is `NaN`.
  12328. *
  12329. * **Note:** This method is based on
  12330. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12331. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12332. * `undefined` and other non-number values.
  12333. *
  12334. * @static
  12335. * @memberOf _
  12336. * @since 0.1.0
  12337. * @category Lang
  12338. * @param {*} value The value to check.
  12339. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12340. * @example
  12341. *
  12342. * _.isNaN(NaN);
  12343. * // => true
  12344. *
  12345. * _.isNaN(new Number(NaN));
  12346. * // => true
  12347. *
  12348. * isNaN(undefined);
  12349. * // => true
  12350. *
  12351. * _.isNaN(undefined);
  12352. * // => false
  12353. */
  12354. function isNaN(value) {
  12355. // An `NaN` primitive is the only value that is not equal to itself.
  12356. // Perform the `toStringTag` check first to avoid errors with some
  12357. // ActiveX objects in IE.
  12358. return isNumber(value) && value != +value;
  12359. }
  12360. /**
  12361. * Checks if `value` is a pristine native function.
  12362. *
  12363. * **Note:** This method can't reliably detect native functions in the presence
  12364. * of the core-js package because core-js circumvents this kind of detection.
  12365. * Despite multiple requests, the core-js maintainer has made it clear: any
  12366. * attempt to fix the detection will be obstructed. As a result, we're left
  12367. * with little choice but to throw an error. Unfortunately, this also affects
  12368. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12369. * which rely on core-js.
  12370. *
  12371. * @static
  12372. * @memberOf _
  12373. * @since 3.0.0
  12374. * @category Lang
  12375. * @param {*} value The value to check.
  12376. * @returns {boolean} Returns `true` if `value` is a native function,
  12377. * else `false`.
  12378. * @example
  12379. *
  12380. * _.isNative(Array.prototype.push);
  12381. * // => true
  12382. *
  12383. * _.isNative(_);
  12384. * // => false
  12385. */
  12386. function isNative(value) {
  12387. if (isMaskable(value)) {
  12388. throw new Error(CORE_ERROR_TEXT);
  12389. }
  12390. return baseIsNative(value);
  12391. }
  12392. /**
  12393. * Checks if `value` is `null`.
  12394. *
  12395. * @static
  12396. * @memberOf _
  12397. * @since 0.1.0
  12398. * @category Lang
  12399. * @param {*} value The value to check.
  12400. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12401. * @example
  12402. *
  12403. * _.isNull(null);
  12404. * // => true
  12405. *
  12406. * _.isNull(void 0);
  12407. * // => false
  12408. */
  12409. function isNull(value) {
  12410. return value === null;
  12411. }
  12412. /**
  12413. * Checks if `value` is `null` or `undefined`.
  12414. *
  12415. * @static
  12416. * @memberOf _
  12417. * @since 4.0.0
  12418. * @category Lang
  12419. * @param {*} value The value to check.
  12420. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12421. * @example
  12422. *
  12423. * _.isNil(null);
  12424. * // => true
  12425. *
  12426. * _.isNil(void 0);
  12427. * // => true
  12428. *
  12429. * _.isNil(NaN);
  12430. * // => false
  12431. */
  12432. function isNil(value) {
  12433. return value == null;
  12434. }
  12435. /**
  12436. * Checks if `value` is classified as a `Number` primitive or object.
  12437. *
  12438. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12439. * classified as numbers, use the `_.isFinite` method.
  12440. *
  12441. * @static
  12442. * @memberOf _
  12443. * @since 0.1.0
  12444. * @category Lang
  12445. * @param {*} value The value to check.
  12446. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12447. * @example
  12448. *
  12449. * _.isNumber(3);
  12450. * // => true
  12451. *
  12452. * _.isNumber(Number.MIN_VALUE);
  12453. * // => true
  12454. *
  12455. * _.isNumber(Infinity);
  12456. * // => true
  12457. *
  12458. * _.isNumber('3');
  12459. * // => false
  12460. */
  12461. function isNumber(value) {
  12462. return typeof value == 'number' ||
  12463. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12464. }
  12465. /**
  12466. * Checks if `value` is a plain object, that is, an object created by the
  12467. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12468. *
  12469. * @static
  12470. * @memberOf _
  12471. * @since 0.8.0
  12472. * @category Lang
  12473. * @param {*} value The value to check.
  12474. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12475. * @example
  12476. *
  12477. * function Foo() {
  12478. * this.a = 1;
  12479. * }
  12480. *
  12481. * _.isPlainObject(new Foo);
  12482. * // => false
  12483. *
  12484. * _.isPlainObject([1, 2, 3]);
  12485. * // => false
  12486. *
  12487. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12488. * // => true
  12489. *
  12490. * _.isPlainObject(Object.create(null));
  12491. * // => true
  12492. */
  12493. function isPlainObject(value) {
  12494. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12495. return false;
  12496. }
  12497. var proto = getPrototype(value);
  12498. if (proto === null) {
  12499. return true;
  12500. }
  12501. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12502. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12503. funcToString.call(Ctor) == objectCtorString;
  12504. }
  12505. /**
  12506. * Checks if `value` is classified as a `RegExp` object.
  12507. *
  12508. * @static
  12509. * @memberOf _
  12510. * @since 0.1.0
  12511. * @category Lang
  12512. * @param {*} value The value to check.
  12513. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12514. * @example
  12515. *
  12516. * _.isRegExp(/abc/);
  12517. * // => true
  12518. *
  12519. * _.isRegExp('/abc/');
  12520. * // => false
  12521. */
  12522. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12523. /**
  12524. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12525. * double precision number which isn't the result of a rounded unsafe integer.
  12526. *
  12527. * **Note:** This method is based on
  12528. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12529. *
  12530. * @static
  12531. * @memberOf _
  12532. * @since 4.0.0
  12533. * @category Lang
  12534. * @param {*} value The value to check.
  12535. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12536. * @example
  12537. *
  12538. * _.isSafeInteger(3);
  12539. * // => true
  12540. *
  12541. * _.isSafeInteger(Number.MIN_VALUE);
  12542. * // => false
  12543. *
  12544. * _.isSafeInteger(Infinity);
  12545. * // => false
  12546. *
  12547. * _.isSafeInteger('3');
  12548. * // => false
  12549. */
  12550. function isSafeInteger(value) {
  12551. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12552. }
  12553. /**
  12554. * Checks if `value` is classified as a `Set` object.
  12555. *
  12556. * @static
  12557. * @memberOf _
  12558. * @since 4.3.0
  12559. * @category Lang
  12560. * @param {*} value The value to check.
  12561. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12562. * @example
  12563. *
  12564. * _.isSet(new Set);
  12565. * // => true
  12566. *
  12567. * _.isSet(new WeakSet);
  12568. * // => false
  12569. */
  12570. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12571. /**
  12572. * Checks if `value` is classified as a `String` primitive or object.
  12573. *
  12574. * @static
  12575. * @since 0.1.0
  12576. * @memberOf _
  12577. * @category Lang
  12578. * @param {*} value The value to check.
  12579. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12580. * @example
  12581. *
  12582. * _.isString('abc');
  12583. * // => true
  12584. *
  12585. * _.isString(1);
  12586. * // => false
  12587. */
  12588. function isString(value) {
  12589. return typeof value == 'string' ||
  12590. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12591. }
  12592. /**
  12593. * Checks if `value` is classified as a `Symbol` primitive or object.
  12594. *
  12595. * @static
  12596. * @memberOf _
  12597. * @since 4.0.0
  12598. * @category Lang
  12599. * @param {*} value The value to check.
  12600. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12601. * @example
  12602. *
  12603. * _.isSymbol(Symbol.iterator);
  12604. * // => true
  12605. *
  12606. * _.isSymbol('abc');
  12607. * // => false
  12608. */
  12609. function isSymbol(value) {
  12610. return typeof value == 'symbol' ||
  12611. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12612. }
  12613. /**
  12614. * Checks if `value` is classified as a typed array.
  12615. *
  12616. * @static
  12617. * @memberOf _
  12618. * @since 3.0.0
  12619. * @category Lang
  12620. * @param {*} value The value to check.
  12621. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12622. * @example
  12623. *
  12624. * _.isTypedArray(new Uint8Array);
  12625. * // => true
  12626. *
  12627. * _.isTypedArray([]);
  12628. * // => false
  12629. */
  12630. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12631. /**
  12632. * Checks if `value` is `undefined`.
  12633. *
  12634. * @static
  12635. * @since 0.1.0
  12636. * @memberOf _
  12637. * @category Lang
  12638. * @param {*} value The value to check.
  12639. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12640. * @example
  12641. *
  12642. * _.isUndefined(void 0);
  12643. * // => true
  12644. *
  12645. * _.isUndefined(null);
  12646. * // => false
  12647. */
  12648. function isUndefined(value) {
  12649. return value === undefined;
  12650. }
  12651. /**
  12652. * Checks if `value` is classified as a `WeakMap` object.
  12653. *
  12654. * @static
  12655. * @memberOf _
  12656. * @since 4.3.0
  12657. * @category Lang
  12658. * @param {*} value The value to check.
  12659. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12660. * @example
  12661. *
  12662. * _.isWeakMap(new WeakMap);
  12663. * // => true
  12664. *
  12665. * _.isWeakMap(new Map);
  12666. * // => false
  12667. */
  12668. function isWeakMap(value) {
  12669. return isObjectLike(value) && getTag(value) == weakMapTag;
  12670. }
  12671. /**
  12672. * Checks if `value` is classified as a `WeakSet` object.
  12673. *
  12674. * @static
  12675. * @memberOf _
  12676. * @since 4.3.0
  12677. * @category Lang
  12678. * @param {*} value The value to check.
  12679. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12680. * @example
  12681. *
  12682. * _.isWeakSet(new WeakSet);
  12683. * // => true
  12684. *
  12685. * _.isWeakSet(new Set);
  12686. * // => false
  12687. */
  12688. function isWeakSet(value) {
  12689. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12690. }
  12691. /**
  12692. * Checks if `value` is less than `other`.
  12693. *
  12694. * @static
  12695. * @memberOf _
  12696. * @since 3.9.0
  12697. * @category Lang
  12698. * @param {*} value The value to compare.
  12699. * @param {*} other The other value to compare.
  12700. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12701. * else `false`.
  12702. * @see _.gt
  12703. * @example
  12704. *
  12705. * _.lt(1, 3);
  12706. * // => true
  12707. *
  12708. * _.lt(3, 3);
  12709. * // => false
  12710. *
  12711. * _.lt(3, 1);
  12712. * // => false
  12713. */
  12714. var lt = createRelationalOperation(baseLt);
  12715. /**
  12716. * Checks if `value` is less than or equal to `other`.
  12717. *
  12718. * @static
  12719. * @memberOf _
  12720. * @since 3.9.0
  12721. * @category Lang
  12722. * @param {*} value The value to compare.
  12723. * @param {*} other The other value to compare.
  12724. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12725. * `other`, else `false`.
  12726. * @see _.gte
  12727. * @example
  12728. *
  12729. * _.lte(1, 3);
  12730. * // => true
  12731. *
  12732. * _.lte(3, 3);
  12733. * // => true
  12734. *
  12735. * _.lte(3, 1);
  12736. * // => false
  12737. */
  12738. var lte = createRelationalOperation(function(value, other) {
  12739. return value <= other;
  12740. });
  12741. /**
  12742. * Converts `value` to an array.
  12743. *
  12744. * @static
  12745. * @since 0.1.0
  12746. * @memberOf _
  12747. * @category Lang
  12748. * @param {*} value The value to convert.
  12749. * @returns {Array} Returns the converted array.
  12750. * @example
  12751. *
  12752. * _.toArray({ 'a': 1, 'b': 2 });
  12753. * // => [1, 2]
  12754. *
  12755. * _.toArray('abc');
  12756. * // => ['a', 'b', 'c']
  12757. *
  12758. * _.toArray(1);
  12759. * // => []
  12760. *
  12761. * _.toArray(null);
  12762. * // => []
  12763. */
  12764. function toArray(value) {
  12765. if (!value) {
  12766. return [];
  12767. }
  12768. if (isArrayLike(value)) {
  12769. return isString(value) ? stringToArray(value) : copyArray(value);
  12770. }
  12771. if (symIterator && value[symIterator]) {
  12772. return iteratorToArray(value[symIterator]());
  12773. }
  12774. var tag = getTag(value),
  12775. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12776. return func(value);
  12777. }
  12778. /**
  12779. * Converts `value` to a finite number.
  12780. *
  12781. * @static
  12782. * @memberOf _
  12783. * @since 4.12.0
  12784. * @category Lang
  12785. * @param {*} value The value to convert.
  12786. * @returns {number} Returns the converted number.
  12787. * @example
  12788. *
  12789. * _.toFinite(3.2);
  12790. * // => 3.2
  12791. *
  12792. * _.toFinite(Number.MIN_VALUE);
  12793. * // => 5e-324
  12794. *
  12795. * _.toFinite(Infinity);
  12796. * // => 1.7976931348623157e+308
  12797. *
  12798. * _.toFinite('3.2');
  12799. * // => 3.2
  12800. */
  12801. function toFinite(value) {
  12802. if (!value) {
  12803. return value === 0 ? value : 0;
  12804. }
  12805. value = toNumber(value);
  12806. if (value === INFINITY || value === -INFINITY) {
  12807. var sign = (value < 0 ? -1 : 1);
  12808. return sign * MAX_INTEGER;
  12809. }
  12810. return value === value ? value : 0;
  12811. }
  12812. /**
  12813. * Converts `value` to an integer.
  12814. *
  12815. * **Note:** This method is loosely based on
  12816. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12817. *
  12818. * @static
  12819. * @memberOf _
  12820. * @since 4.0.0
  12821. * @category Lang
  12822. * @param {*} value The value to convert.
  12823. * @returns {number} Returns the converted integer.
  12824. * @example
  12825. *
  12826. * _.toInteger(3.2);
  12827. * // => 3
  12828. *
  12829. * _.toInteger(Number.MIN_VALUE);
  12830. * // => 0
  12831. *
  12832. * _.toInteger(Infinity);
  12833. * // => 1.7976931348623157e+308
  12834. *
  12835. * _.toInteger('3.2');
  12836. * // => 3
  12837. */
  12838. function toInteger(value) {
  12839. var result = toFinite(value),
  12840. remainder = result % 1;
  12841. return result === result ? (remainder ? result - remainder : result) : 0;
  12842. }
  12843. /**
  12844. * Converts `value` to an integer suitable for use as the length of an
  12845. * array-like object.
  12846. *
  12847. * **Note:** This method is based on
  12848. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12849. *
  12850. * @static
  12851. * @memberOf _
  12852. * @since 4.0.0
  12853. * @category Lang
  12854. * @param {*} value The value to convert.
  12855. * @returns {number} Returns the converted integer.
  12856. * @example
  12857. *
  12858. * _.toLength(3.2);
  12859. * // => 3
  12860. *
  12861. * _.toLength(Number.MIN_VALUE);
  12862. * // => 0
  12863. *
  12864. * _.toLength(Infinity);
  12865. * // => 4294967295
  12866. *
  12867. * _.toLength('3.2');
  12868. * // => 3
  12869. */
  12870. function toLength(value) {
  12871. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12872. }
  12873. /**
  12874. * Converts `value` to a number.
  12875. *
  12876. * @static
  12877. * @memberOf _
  12878. * @since 4.0.0
  12879. * @category Lang
  12880. * @param {*} value The value to process.
  12881. * @returns {number} Returns the number.
  12882. * @example
  12883. *
  12884. * _.toNumber(3.2);
  12885. * // => 3.2
  12886. *
  12887. * _.toNumber(Number.MIN_VALUE);
  12888. * // => 5e-324
  12889. *
  12890. * _.toNumber(Infinity);
  12891. * // => Infinity
  12892. *
  12893. * _.toNumber('3.2');
  12894. * // => 3.2
  12895. */
  12896. function toNumber(value) {
  12897. if (typeof value == 'number') {
  12898. return value;
  12899. }
  12900. if (isSymbol(value)) {
  12901. return NAN;
  12902. }
  12903. if (isObject(value)) {
  12904. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12905. value = isObject(other) ? (other + '') : other;
  12906. }
  12907. if (typeof value != 'string') {
  12908. return value === 0 ? value : +value;
  12909. }
  12910. value = baseTrim(value);
  12911. var isBinary = reIsBinary.test(value);
  12912. return (isBinary || reIsOctal.test(value))
  12913. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12914. : (reIsBadHex.test(value) ? NAN : +value);
  12915. }
  12916. /**
  12917. * Converts `value` to a plain object flattening inherited enumerable string
  12918. * keyed properties of `value` to own properties of the plain object.
  12919. *
  12920. * @static
  12921. * @memberOf _
  12922. * @since 3.0.0
  12923. * @category Lang
  12924. * @param {*} value The value to convert.
  12925. * @returns {Object} Returns the converted plain object.
  12926. * @example
  12927. *
  12928. * function Foo() {
  12929. * this.b = 2;
  12930. * }
  12931. *
  12932. * Foo.prototype.c = 3;
  12933. *
  12934. * _.assign({ 'a': 1 }, new Foo);
  12935. * // => { 'a': 1, 'b': 2 }
  12936. *
  12937. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12938. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12939. */
  12940. function toPlainObject(value) {
  12941. return copyObject(value, keysIn(value));
  12942. }
  12943. /**
  12944. * Converts `value` to a safe integer. A safe integer can be compared and
  12945. * represented correctly.
  12946. *
  12947. * @static
  12948. * @memberOf _
  12949. * @since 4.0.0
  12950. * @category Lang
  12951. * @param {*} value The value to convert.
  12952. * @returns {number} Returns the converted integer.
  12953. * @example
  12954. *
  12955. * _.toSafeInteger(3.2);
  12956. * // => 3
  12957. *
  12958. * _.toSafeInteger(Number.MIN_VALUE);
  12959. * // => 0
  12960. *
  12961. * _.toSafeInteger(Infinity);
  12962. * // => 9007199254740991
  12963. *
  12964. * _.toSafeInteger('3.2');
  12965. * // => 3
  12966. */
  12967. function toSafeInteger(value) {
  12968. return value
  12969. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12970. : (value === 0 ? value : 0);
  12971. }
  12972. /**
  12973. * Converts `value` to a string. An empty string is returned for `null`
  12974. * and `undefined` values. The sign of `-0` is preserved.
  12975. *
  12976. * @static
  12977. * @memberOf _
  12978. * @since 4.0.0
  12979. * @category Lang
  12980. * @param {*} value The value to convert.
  12981. * @returns {string} Returns the converted string.
  12982. * @example
  12983. *
  12984. * _.toString(null);
  12985. * // => ''
  12986. *
  12987. * _.toString(-0);
  12988. * // => '-0'
  12989. *
  12990. * _.toString([1, 2, 3]);
  12991. * // => '1,2,3'
  12992. */
  12993. function toString(value) {
  12994. return value == null ? '' : baseToString(value);
  12995. }
  12996. /*------------------------------------------------------------------------*/
  12997. /**
  12998. * Assigns own enumerable string keyed properties of source objects to the
  12999. * destination object. Source objects are applied from left to right.
  13000. * Subsequent sources overwrite property assignments of previous sources.
  13001. *
  13002. * **Note:** This method mutates `object` and is loosely based on
  13003. * [`Object.assign`](https://mdn.io/Object/assign).
  13004. *
  13005. * @static
  13006. * @memberOf _
  13007. * @since 0.10.0
  13008. * @category Object
  13009. * @param {Object} object The destination object.
  13010. * @param {...Object} [sources] The source objects.
  13011. * @returns {Object} Returns `object`.
  13012. * @see _.assignIn
  13013. * @example
  13014. *
  13015. * function Foo() {
  13016. * this.a = 1;
  13017. * }
  13018. *
  13019. * function Bar() {
  13020. * this.c = 3;
  13021. * }
  13022. *
  13023. * Foo.prototype.b = 2;
  13024. * Bar.prototype.d = 4;
  13025. *
  13026. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13027. * // => { 'a': 1, 'c': 3 }
  13028. */
  13029. var assign = createAssigner(function(object, source) {
  13030. if (isPrototype(source) || isArrayLike(source)) {
  13031. copyObject(source, keys(source), object);
  13032. return;
  13033. }
  13034. for (var key in source) {
  13035. if (hasOwnProperty.call(source, key)) {
  13036. assignValue(object, key, source[key]);
  13037. }
  13038. }
  13039. });
  13040. /**
  13041. * This method is like `_.assign` except that it iterates over own and
  13042. * inherited source properties.
  13043. *
  13044. * **Note:** This method mutates `object`.
  13045. *
  13046. * @static
  13047. * @memberOf _
  13048. * @since 4.0.0
  13049. * @alias extend
  13050. * @category Object
  13051. * @param {Object} object The destination object.
  13052. * @param {...Object} [sources] The source objects.
  13053. * @returns {Object} Returns `object`.
  13054. * @see _.assign
  13055. * @example
  13056. *
  13057. * function Foo() {
  13058. * this.a = 1;
  13059. * }
  13060. *
  13061. * function Bar() {
  13062. * this.c = 3;
  13063. * }
  13064. *
  13065. * Foo.prototype.b = 2;
  13066. * Bar.prototype.d = 4;
  13067. *
  13068. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13069. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13070. */
  13071. var assignIn = createAssigner(function(object, source) {
  13072. copyObject(source, keysIn(source), object);
  13073. });
  13074. /**
  13075. * This method is like `_.assignIn` except that it accepts `customizer`
  13076. * which is invoked to produce the assigned values. If `customizer` returns
  13077. * `undefined`, assignment is handled by the method instead. The `customizer`
  13078. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13079. *
  13080. * **Note:** This method mutates `object`.
  13081. *
  13082. * @static
  13083. * @memberOf _
  13084. * @since 4.0.0
  13085. * @alias extendWith
  13086. * @category Object
  13087. * @param {Object} object The destination object.
  13088. * @param {...Object} sources The source objects.
  13089. * @param {Function} [customizer] The function to customize assigned values.
  13090. * @returns {Object} Returns `object`.
  13091. * @see _.assignWith
  13092. * @example
  13093. *
  13094. * function customizer(objValue, srcValue) {
  13095. * return _.isUndefined(objValue) ? srcValue : objValue;
  13096. * }
  13097. *
  13098. * var defaults = _.partialRight(_.assignInWith, customizer);
  13099. *
  13100. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13101. * // => { 'a': 1, 'b': 2 }
  13102. */
  13103. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13104. copyObject(source, keysIn(source), object, customizer);
  13105. });
  13106. /**
  13107. * This method is like `_.assign` except that it accepts `customizer`
  13108. * which is invoked to produce the assigned values. If `customizer` returns
  13109. * `undefined`, assignment is handled by the method instead. The `customizer`
  13110. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13111. *
  13112. * **Note:** This method mutates `object`.
  13113. *
  13114. * @static
  13115. * @memberOf _
  13116. * @since 4.0.0
  13117. * @category Object
  13118. * @param {Object} object The destination object.
  13119. * @param {...Object} sources The source objects.
  13120. * @param {Function} [customizer] The function to customize assigned values.
  13121. * @returns {Object} Returns `object`.
  13122. * @see _.assignInWith
  13123. * @example
  13124. *
  13125. * function customizer(objValue, srcValue) {
  13126. * return _.isUndefined(objValue) ? srcValue : objValue;
  13127. * }
  13128. *
  13129. * var defaults = _.partialRight(_.assignWith, customizer);
  13130. *
  13131. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13132. * // => { 'a': 1, 'b': 2 }
  13133. */
  13134. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13135. copyObject(source, keys(source), object, customizer);
  13136. });
  13137. /**
  13138. * Creates an array of values corresponding to `paths` of `object`.
  13139. *
  13140. * @static
  13141. * @memberOf _
  13142. * @since 1.0.0
  13143. * @category Object
  13144. * @param {Object} object The object to iterate over.
  13145. * @param {...(string|string[])} [paths] The property paths to pick.
  13146. * @returns {Array} Returns the picked values.
  13147. * @example
  13148. *
  13149. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13150. *
  13151. * _.at(object, ['a[0].b.c', 'a[1]']);
  13152. * // => [3, 4]
  13153. */
  13154. var at = flatRest(baseAt);
  13155. /**
  13156. * Creates an object that inherits from the `prototype` object. If a
  13157. * `properties` object is given, its own enumerable string keyed properties
  13158. * are assigned to the created object.
  13159. *
  13160. * @static
  13161. * @memberOf _
  13162. * @since 2.3.0
  13163. * @category Object
  13164. * @param {Object} prototype The object to inherit from.
  13165. * @param {Object} [properties] The properties to assign to the object.
  13166. * @returns {Object} Returns the new object.
  13167. * @example
  13168. *
  13169. * function Shape() {
  13170. * this.x = 0;
  13171. * this.y = 0;
  13172. * }
  13173. *
  13174. * function Circle() {
  13175. * Shape.call(this);
  13176. * }
  13177. *
  13178. * Circle.prototype = _.create(Shape.prototype, {
  13179. * 'constructor': Circle
  13180. * });
  13181. *
  13182. * var circle = new Circle;
  13183. * circle instanceof Circle;
  13184. * // => true
  13185. *
  13186. * circle instanceof Shape;
  13187. * // => true
  13188. */
  13189. function create(prototype, properties) {
  13190. var result = baseCreate(prototype);
  13191. return properties == null ? result : baseAssign(result, properties);
  13192. }
  13193. /**
  13194. * Assigns own and inherited enumerable string keyed properties of source
  13195. * objects to the destination object for all destination properties that
  13196. * resolve to `undefined`. Source objects are applied from left to right.
  13197. * Once a property is set, additional values of the same property are ignored.
  13198. *
  13199. * **Note:** This method mutates `object`.
  13200. *
  13201. * @static
  13202. * @since 0.1.0
  13203. * @memberOf _
  13204. * @category Object
  13205. * @param {Object} object The destination object.
  13206. * @param {...Object} [sources] The source objects.
  13207. * @returns {Object} Returns `object`.
  13208. * @see _.defaultsDeep
  13209. * @example
  13210. *
  13211. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13212. * // => { 'a': 1, 'b': 2 }
  13213. */
  13214. var defaults = baseRest(function(object, sources) {
  13215. object = Object(object);
  13216. var index = -1;
  13217. var length = sources.length;
  13218. var guard = length > 2 ? sources[2] : undefined;
  13219. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13220. length = 1;
  13221. }
  13222. while (++index < length) {
  13223. var source = sources[index];
  13224. var props = keysIn(source);
  13225. var propsIndex = -1;
  13226. var propsLength = props.length;
  13227. while (++propsIndex < propsLength) {
  13228. var key = props[propsIndex];
  13229. var value = object[key];
  13230. if (value === undefined ||
  13231. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13232. object[key] = source[key];
  13233. }
  13234. }
  13235. }
  13236. return object;
  13237. });
  13238. /**
  13239. * This method is like `_.defaults` except that it recursively assigns
  13240. * default properties.
  13241. *
  13242. * **Note:** This method mutates `object`.
  13243. *
  13244. * @static
  13245. * @memberOf _
  13246. * @since 3.10.0
  13247. * @category Object
  13248. * @param {Object} object The destination object.
  13249. * @param {...Object} [sources] The source objects.
  13250. * @returns {Object} Returns `object`.
  13251. * @see _.defaults
  13252. * @example
  13253. *
  13254. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13255. * // => { 'a': { 'b': 2, 'c': 3 } }
  13256. */
  13257. var defaultsDeep = baseRest(function(args) {
  13258. args.push(undefined, customDefaultsMerge);
  13259. return apply(mergeWith, undefined, args);
  13260. });
  13261. /**
  13262. * This method is like `_.find` except that it returns the key of the first
  13263. * element `predicate` returns truthy for instead of the element itself.
  13264. *
  13265. * @static
  13266. * @memberOf _
  13267. * @since 1.1.0
  13268. * @category Object
  13269. * @param {Object} object The object to inspect.
  13270. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13271. * @returns {string|undefined} Returns the key of the matched element,
  13272. * else `undefined`.
  13273. * @example
  13274. *
  13275. * var users = {
  13276. * 'barney': { 'age': 36, 'active': true },
  13277. * 'fred': { 'age': 40, 'active': false },
  13278. * 'pebbles': { 'age': 1, 'active': true }
  13279. * };
  13280. *
  13281. * _.findKey(users, function(o) { return o.age < 40; });
  13282. * // => 'barney' (iteration order is not guaranteed)
  13283. *
  13284. * // The `_.matches` iteratee shorthand.
  13285. * _.findKey(users, { 'age': 1, 'active': true });
  13286. * // => 'pebbles'
  13287. *
  13288. * // The `_.matchesProperty` iteratee shorthand.
  13289. * _.findKey(users, ['active', false]);
  13290. * // => 'fred'
  13291. *
  13292. * // The `_.property` iteratee shorthand.
  13293. * _.findKey(users, 'active');
  13294. * // => 'barney'
  13295. */
  13296. function findKey(object, predicate) {
  13297. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13298. }
  13299. /**
  13300. * This method is like `_.findKey` except that it iterates over elements of
  13301. * a collection in the opposite order.
  13302. *
  13303. * @static
  13304. * @memberOf _
  13305. * @since 2.0.0
  13306. * @category Object
  13307. * @param {Object} object The object to inspect.
  13308. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13309. * @returns {string|undefined} Returns the key of the matched element,
  13310. * else `undefined`.
  13311. * @example
  13312. *
  13313. * var users = {
  13314. * 'barney': { 'age': 36, 'active': true },
  13315. * 'fred': { 'age': 40, 'active': false },
  13316. * 'pebbles': { 'age': 1, 'active': true }
  13317. * };
  13318. *
  13319. * _.findLastKey(users, function(o) { return o.age < 40; });
  13320. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13321. *
  13322. * // The `_.matches` iteratee shorthand.
  13323. * _.findLastKey(users, { 'age': 36, 'active': true });
  13324. * // => 'barney'
  13325. *
  13326. * // The `_.matchesProperty` iteratee shorthand.
  13327. * _.findLastKey(users, ['active', false]);
  13328. * // => 'fred'
  13329. *
  13330. * // The `_.property` iteratee shorthand.
  13331. * _.findLastKey(users, 'active');
  13332. * // => 'pebbles'
  13333. */
  13334. function findLastKey(object, predicate) {
  13335. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13336. }
  13337. /**
  13338. * Iterates over own and inherited enumerable string keyed properties of an
  13339. * object and invokes `iteratee` for each property. The iteratee is invoked
  13340. * with three arguments: (value, key, object). Iteratee functions may exit
  13341. * iteration early by explicitly returning `false`.
  13342. *
  13343. * @static
  13344. * @memberOf _
  13345. * @since 0.3.0
  13346. * @category Object
  13347. * @param {Object} object The object to iterate over.
  13348. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13349. * @returns {Object} Returns `object`.
  13350. * @see _.forInRight
  13351. * @example
  13352. *
  13353. * function Foo() {
  13354. * this.a = 1;
  13355. * this.b = 2;
  13356. * }
  13357. *
  13358. * Foo.prototype.c = 3;
  13359. *
  13360. * _.forIn(new Foo, function(value, key) {
  13361. * console.log(key);
  13362. * });
  13363. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13364. */
  13365. function forIn(object, iteratee) {
  13366. return object == null
  13367. ? object
  13368. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13369. }
  13370. /**
  13371. * This method is like `_.forIn` except that it iterates over properties of
  13372. * `object` in the opposite order.
  13373. *
  13374. * @static
  13375. * @memberOf _
  13376. * @since 2.0.0
  13377. * @category Object
  13378. * @param {Object} object The object to iterate over.
  13379. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13380. * @returns {Object} Returns `object`.
  13381. * @see _.forIn
  13382. * @example
  13383. *
  13384. * function Foo() {
  13385. * this.a = 1;
  13386. * this.b = 2;
  13387. * }
  13388. *
  13389. * Foo.prototype.c = 3;
  13390. *
  13391. * _.forInRight(new Foo, function(value, key) {
  13392. * console.log(key);
  13393. * });
  13394. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13395. */
  13396. function forInRight(object, iteratee) {
  13397. return object == null
  13398. ? object
  13399. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13400. }
  13401. /**
  13402. * Iterates over own enumerable string keyed properties of an object and
  13403. * invokes `iteratee` for each property. The iteratee is invoked with three
  13404. * arguments: (value, key, object). Iteratee functions may exit iteration
  13405. * early by explicitly returning `false`.
  13406. *
  13407. * @static
  13408. * @memberOf _
  13409. * @since 0.3.0
  13410. * @category Object
  13411. * @param {Object} object The object to iterate over.
  13412. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13413. * @returns {Object} Returns `object`.
  13414. * @see _.forOwnRight
  13415. * @example
  13416. *
  13417. * function Foo() {
  13418. * this.a = 1;
  13419. * this.b = 2;
  13420. * }
  13421. *
  13422. * Foo.prototype.c = 3;
  13423. *
  13424. * _.forOwn(new Foo, function(value, key) {
  13425. * console.log(key);
  13426. * });
  13427. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13428. */
  13429. function forOwn(object, iteratee) {
  13430. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13431. }
  13432. /**
  13433. * This method is like `_.forOwn` except that it iterates over properties of
  13434. * `object` in the opposite order.
  13435. *
  13436. * @static
  13437. * @memberOf _
  13438. * @since 2.0.0
  13439. * @category Object
  13440. * @param {Object} object The object to iterate over.
  13441. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13442. * @returns {Object} Returns `object`.
  13443. * @see _.forOwn
  13444. * @example
  13445. *
  13446. * function Foo() {
  13447. * this.a = 1;
  13448. * this.b = 2;
  13449. * }
  13450. *
  13451. * Foo.prototype.c = 3;
  13452. *
  13453. * _.forOwnRight(new Foo, function(value, key) {
  13454. * console.log(key);
  13455. * });
  13456. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13457. */
  13458. function forOwnRight(object, iteratee) {
  13459. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13460. }
  13461. /**
  13462. * Creates an array of function property names from own enumerable properties
  13463. * of `object`.
  13464. *
  13465. * @static
  13466. * @since 0.1.0
  13467. * @memberOf _
  13468. * @category Object
  13469. * @param {Object} object The object to inspect.
  13470. * @returns {Array} Returns the function names.
  13471. * @see _.functionsIn
  13472. * @example
  13473. *
  13474. * function Foo() {
  13475. * this.a = _.constant('a');
  13476. * this.b = _.constant('b');
  13477. * }
  13478. *
  13479. * Foo.prototype.c = _.constant('c');
  13480. *
  13481. * _.functions(new Foo);
  13482. * // => ['a', 'b']
  13483. */
  13484. function functions(object) {
  13485. return object == null ? [] : baseFunctions(object, keys(object));
  13486. }
  13487. /**
  13488. * Creates an array of function property names from own and inherited
  13489. * enumerable properties of `object`.
  13490. *
  13491. * @static
  13492. * @memberOf _
  13493. * @since 4.0.0
  13494. * @category Object
  13495. * @param {Object} object The object to inspect.
  13496. * @returns {Array} Returns the function names.
  13497. * @see _.functions
  13498. * @example
  13499. *
  13500. * function Foo() {
  13501. * this.a = _.constant('a');
  13502. * this.b = _.constant('b');
  13503. * }
  13504. *
  13505. * Foo.prototype.c = _.constant('c');
  13506. *
  13507. * _.functionsIn(new Foo);
  13508. * // => ['a', 'b', 'c']
  13509. */
  13510. function functionsIn(object) {
  13511. return object == null ? [] : baseFunctions(object, keysIn(object));
  13512. }
  13513. /**
  13514. * Gets the value at `path` of `object`. If the resolved value is
  13515. * `undefined`, the `defaultValue` is returned in its place.
  13516. *
  13517. * @static
  13518. * @memberOf _
  13519. * @since 3.7.0
  13520. * @category Object
  13521. * @param {Object} object The object to query.
  13522. * @param {Array|string} path The path of the property to get.
  13523. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13524. * @returns {*} Returns the resolved value.
  13525. * @example
  13526. *
  13527. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13528. *
  13529. * _.get(object, 'a[0].b.c');
  13530. * // => 3
  13531. *
  13532. * _.get(object, ['a', '0', 'b', 'c']);
  13533. * // => 3
  13534. *
  13535. * _.get(object, 'a.b.c', 'default');
  13536. * // => 'default'
  13537. */
  13538. function get(object, path, defaultValue) {
  13539. var result = object == null ? undefined : baseGet(object, path);
  13540. return result === undefined ? defaultValue : result;
  13541. }
  13542. /**
  13543. * Checks if `path` is a direct property of `object`.
  13544. *
  13545. * @static
  13546. * @since 0.1.0
  13547. * @memberOf _
  13548. * @category Object
  13549. * @param {Object} object The object to query.
  13550. * @param {Array|string} path The path to check.
  13551. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13552. * @example
  13553. *
  13554. * var object = { 'a': { 'b': 2 } };
  13555. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13556. *
  13557. * _.has(object, 'a');
  13558. * // => true
  13559. *
  13560. * _.has(object, 'a.b');
  13561. * // => true
  13562. *
  13563. * _.has(object, ['a', 'b']);
  13564. * // => true
  13565. *
  13566. * _.has(other, 'a');
  13567. * // => false
  13568. */
  13569. function has(object, path) {
  13570. return object != null && hasPath(object, path, baseHas);
  13571. }
  13572. /**
  13573. * Checks if `path` is a direct or inherited property of `object`.
  13574. *
  13575. * @static
  13576. * @memberOf _
  13577. * @since 4.0.0
  13578. * @category Object
  13579. * @param {Object} object The object to query.
  13580. * @param {Array|string} path The path to check.
  13581. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13582. * @example
  13583. *
  13584. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13585. *
  13586. * _.hasIn(object, 'a');
  13587. * // => true
  13588. *
  13589. * _.hasIn(object, 'a.b');
  13590. * // => true
  13591. *
  13592. * _.hasIn(object, ['a', 'b']);
  13593. * // => true
  13594. *
  13595. * _.hasIn(object, 'b');
  13596. * // => false
  13597. */
  13598. function hasIn(object, path) {
  13599. return object != null && hasPath(object, path, baseHasIn);
  13600. }
  13601. /**
  13602. * Creates an object composed of the inverted keys and values of `object`.
  13603. * If `object` contains duplicate values, subsequent values overwrite
  13604. * property assignments of previous values.
  13605. *
  13606. * @static
  13607. * @memberOf _
  13608. * @since 0.7.0
  13609. * @category Object
  13610. * @param {Object} object The object to invert.
  13611. * @returns {Object} Returns the new inverted object.
  13612. * @example
  13613. *
  13614. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13615. *
  13616. * _.invert(object);
  13617. * // => { '1': 'c', '2': 'b' }
  13618. */
  13619. var invert = createInverter(function(result, value, key) {
  13620. if (value != null &&
  13621. typeof value.toString != 'function') {
  13622. value = nativeObjectToString.call(value);
  13623. }
  13624. result[value] = key;
  13625. }, constant(identity));
  13626. /**
  13627. * This method is like `_.invert` except that the inverted object is generated
  13628. * from the results of running each element of `object` thru `iteratee`. The
  13629. * corresponding inverted value of each inverted key is an array of keys
  13630. * responsible for generating the inverted value. The iteratee is invoked
  13631. * with one argument: (value).
  13632. *
  13633. * @static
  13634. * @memberOf _
  13635. * @since 4.1.0
  13636. * @category Object
  13637. * @param {Object} object The object to invert.
  13638. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13639. * @returns {Object} Returns the new inverted object.
  13640. * @example
  13641. *
  13642. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13643. *
  13644. * _.invertBy(object);
  13645. * // => { '1': ['a', 'c'], '2': ['b'] }
  13646. *
  13647. * _.invertBy(object, function(value) {
  13648. * return 'group' + value;
  13649. * });
  13650. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13651. */
  13652. var invertBy = createInverter(function(result, value, key) {
  13653. if (value != null &&
  13654. typeof value.toString != 'function') {
  13655. value = nativeObjectToString.call(value);
  13656. }
  13657. if (hasOwnProperty.call(result, value)) {
  13658. result[value].push(key);
  13659. } else {
  13660. result[value] = [key];
  13661. }
  13662. }, getIteratee);
  13663. /**
  13664. * Invokes the method at `path` of `object`.
  13665. *
  13666. * @static
  13667. * @memberOf _
  13668. * @since 4.0.0
  13669. * @category Object
  13670. * @param {Object} object The object to query.
  13671. * @param {Array|string} path The path of the method to invoke.
  13672. * @param {...*} [args] The arguments to invoke the method with.
  13673. * @returns {*} Returns the result of the invoked method.
  13674. * @example
  13675. *
  13676. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13677. *
  13678. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13679. * // => [2, 3]
  13680. */
  13681. var invoke = baseRest(baseInvoke);
  13682. /**
  13683. * Creates an array of the own enumerable property names of `object`.
  13684. *
  13685. * **Note:** Non-object values are coerced to objects. See the
  13686. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13687. * for more details.
  13688. *
  13689. * @static
  13690. * @since 0.1.0
  13691. * @memberOf _
  13692. * @category Object
  13693. * @param {Object} object The object to query.
  13694. * @returns {Array} Returns the array of property names.
  13695. * @example
  13696. *
  13697. * function Foo() {
  13698. * this.a = 1;
  13699. * this.b = 2;
  13700. * }
  13701. *
  13702. * Foo.prototype.c = 3;
  13703. *
  13704. * _.keys(new Foo);
  13705. * // => ['a', 'b'] (iteration order is not guaranteed)
  13706. *
  13707. * _.keys('hi');
  13708. * // => ['0', '1']
  13709. */
  13710. function keys(object) {
  13711. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13712. }
  13713. /**
  13714. * Creates an array of the own and inherited enumerable property names of `object`.
  13715. *
  13716. * **Note:** Non-object values are coerced to objects.
  13717. *
  13718. * @static
  13719. * @memberOf _
  13720. * @since 3.0.0
  13721. * @category Object
  13722. * @param {Object} object The object to query.
  13723. * @returns {Array} Returns the array of property names.
  13724. * @example
  13725. *
  13726. * function Foo() {
  13727. * this.a = 1;
  13728. * this.b = 2;
  13729. * }
  13730. *
  13731. * Foo.prototype.c = 3;
  13732. *
  13733. * _.keysIn(new Foo);
  13734. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13735. */
  13736. function keysIn(object) {
  13737. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13738. }
  13739. /**
  13740. * The opposite of `_.mapValues`; this method creates an object with the
  13741. * same values as `object` and keys generated by running each own enumerable
  13742. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13743. * with three arguments: (value, key, object).
  13744. *
  13745. * @static
  13746. * @memberOf _
  13747. * @since 3.8.0
  13748. * @category Object
  13749. * @param {Object} object The object to iterate over.
  13750. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13751. * @returns {Object} Returns the new mapped object.
  13752. * @see _.mapValues
  13753. * @example
  13754. *
  13755. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13756. * return key + value;
  13757. * });
  13758. * // => { 'a1': 1, 'b2': 2 }
  13759. */
  13760. function mapKeys(object, iteratee) {
  13761. var result = {};
  13762. iteratee = getIteratee(iteratee, 3);
  13763. baseForOwn(object, function(value, key, object) {
  13764. baseAssignValue(result, iteratee(value, key, object), value);
  13765. });
  13766. return result;
  13767. }
  13768. /**
  13769. * Creates an object with the same keys as `object` and values generated
  13770. * by running each own enumerable string keyed property of `object` thru
  13771. * `iteratee`. The iteratee is invoked with three arguments:
  13772. * (value, key, object).
  13773. *
  13774. * @static
  13775. * @memberOf _
  13776. * @since 2.4.0
  13777. * @category Object
  13778. * @param {Object} object The object to iterate over.
  13779. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13780. * @returns {Object} Returns the new mapped object.
  13781. * @see _.mapKeys
  13782. * @example
  13783. *
  13784. * var users = {
  13785. * 'fred': { 'user': 'fred', 'age': 40 },
  13786. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13787. * };
  13788. *
  13789. * _.mapValues(users, function(o) { return o.age; });
  13790. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13791. *
  13792. * // The `_.property` iteratee shorthand.
  13793. * _.mapValues(users, 'age');
  13794. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13795. */
  13796. function mapValues(object, iteratee) {
  13797. var result = {};
  13798. iteratee = getIteratee(iteratee, 3);
  13799. baseForOwn(object, function(value, key, object) {
  13800. baseAssignValue(result, key, iteratee(value, key, object));
  13801. });
  13802. return result;
  13803. }
  13804. /**
  13805. * This method is like `_.assign` except that it recursively merges own and
  13806. * inherited enumerable string keyed properties of source objects into the
  13807. * destination object. Source properties that resolve to `undefined` are
  13808. * skipped if a destination value exists. Array and plain object properties
  13809. * are merged recursively. Other objects and value types are overridden by
  13810. * assignment. Source objects are applied from left to right. Subsequent
  13811. * sources overwrite property assignments of previous sources.
  13812. *
  13813. * **Note:** This method mutates `object`.
  13814. *
  13815. * @static
  13816. * @memberOf _
  13817. * @since 0.5.0
  13818. * @category Object
  13819. * @param {Object} object The destination object.
  13820. * @param {...Object} [sources] The source objects.
  13821. * @returns {Object} Returns `object`.
  13822. * @example
  13823. *
  13824. * var object = {
  13825. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13826. * };
  13827. *
  13828. * var other = {
  13829. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13830. * };
  13831. *
  13832. * _.merge(object, other);
  13833. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13834. */
  13835. var merge = createAssigner(function(object, source, srcIndex) {
  13836. baseMerge(object, source, srcIndex);
  13837. });
  13838. /**
  13839. * This method is like `_.merge` except that it accepts `customizer` which
  13840. * is invoked to produce the merged values of the destination and source
  13841. * properties. If `customizer` returns `undefined`, merging is handled by the
  13842. * method instead. The `customizer` is invoked with six arguments:
  13843. * (objValue, srcValue, key, object, source, stack).
  13844. *
  13845. * **Note:** This method mutates `object`.
  13846. *
  13847. * @static
  13848. * @memberOf _
  13849. * @since 4.0.0
  13850. * @category Object
  13851. * @param {Object} object The destination object.
  13852. * @param {...Object} sources The source objects.
  13853. * @param {Function} customizer The function to customize assigned values.
  13854. * @returns {Object} Returns `object`.
  13855. * @example
  13856. *
  13857. * function customizer(objValue, srcValue) {
  13858. * if (_.isArray(objValue)) {
  13859. * return objValue.concat(srcValue);
  13860. * }
  13861. * }
  13862. *
  13863. * var object = { 'a': [1], 'b': [2] };
  13864. * var other = { 'a': [3], 'b': [4] };
  13865. *
  13866. * _.mergeWith(object, other, customizer);
  13867. * // => { 'a': [1, 3], 'b': [2, 4] }
  13868. */
  13869. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13870. baseMerge(object, source, srcIndex, customizer);
  13871. });
  13872. /**
  13873. * The opposite of `_.pick`; this method creates an object composed of the
  13874. * own and inherited enumerable property paths of `object` that are not omitted.
  13875. *
  13876. * **Note:** This method is considerably slower than `_.pick`.
  13877. *
  13878. * @static
  13879. * @since 0.1.0
  13880. * @memberOf _
  13881. * @category Object
  13882. * @param {Object} object The source object.
  13883. * @param {...(string|string[])} [paths] The property paths to omit.
  13884. * @returns {Object} Returns the new object.
  13885. * @example
  13886. *
  13887. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13888. *
  13889. * _.omit(object, ['a', 'c']);
  13890. * // => { 'b': '2' }
  13891. */
  13892. var omit = flatRest(function(object, paths) {
  13893. var result = {};
  13894. if (object == null) {
  13895. return result;
  13896. }
  13897. var isDeep = false;
  13898. paths = arrayMap(paths, function(path) {
  13899. path = castPath(path, object);
  13900. isDeep || (isDeep = path.length > 1);
  13901. return path;
  13902. });
  13903. copyObject(object, getAllKeysIn(object), result);
  13904. if (isDeep) {
  13905. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13906. }
  13907. var length = paths.length;
  13908. while (length--) {
  13909. baseUnset(result, paths[length]);
  13910. }
  13911. return result;
  13912. });
  13913. /**
  13914. * The opposite of `_.pickBy`; this method creates an object composed of
  13915. * the own and inherited enumerable string keyed properties of `object` that
  13916. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13917. * arguments: (value, key).
  13918. *
  13919. * @static
  13920. * @memberOf _
  13921. * @since 4.0.0
  13922. * @category Object
  13923. * @param {Object} object The source object.
  13924. * @param {Function} [predicate=_.identity] The function invoked per property.
  13925. * @returns {Object} Returns the new object.
  13926. * @example
  13927. *
  13928. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13929. *
  13930. * _.omitBy(object, _.isNumber);
  13931. * // => { 'b': '2' }
  13932. */
  13933. function omitBy(object, predicate) {
  13934. return pickBy(object, negate(getIteratee(predicate)));
  13935. }
  13936. /**
  13937. * Creates an object composed of the picked `object` properties.
  13938. *
  13939. * @static
  13940. * @since 0.1.0
  13941. * @memberOf _
  13942. * @category Object
  13943. * @param {Object} object The source object.
  13944. * @param {...(string|string[])} [paths] The property paths to pick.
  13945. * @returns {Object} Returns the new object.
  13946. * @example
  13947. *
  13948. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13949. *
  13950. * _.pick(object, ['a', 'c']);
  13951. * // => { 'a': 1, 'c': 3 }
  13952. */
  13953. var pick = flatRest(function(object, paths) {
  13954. return object == null ? {} : basePick(object, paths);
  13955. });
  13956. /**
  13957. * Creates an object composed of the `object` properties `predicate` returns
  13958. * truthy for. The predicate is invoked with two arguments: (value, key).
  13959. *
  13960. * @static
  13961. * @memberOf _
  13962. * @since 4.0.0
  13963. * @category Object
  13964. * @param {Object} object The source object.
  13965. * @param {Function} [predicate=_.identity] The function invoked per property.
  13966. * @returns {Object} Returns the new object.
  13967. * @example
  13968. *
  13969. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13970. *
  13971. * _.pickBy(object, _.isNumber);
  13972. * // => { 'a': 1, 'c': 3 }
  13973. */
  13974. function pickBy(object, predicate) {
  13975. if (object == null) {
  13976. return {};
  13977. }
  13978. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13979. return [prop];
  13980. });
  13981. predicate = getIteratee(predicate);
  13982. return basePickBy(object, props, function(value, path) {
  13983. return predicate(value, path[0]);
  13984. });
  13985. }
  13986. /**
  13987. * This method is like `_.get` except that if the resolved value is a
  13988. * function it's invoked with the `this` binding of its parent object and
  13989. * its result is returned.
  13990. *
  13991. * @static
  13992. * @since 0.1.0
  13993. * @memberOf _
  13994. * @category Object
  13995. * @param {Object} object The object to query.
  13996. * @param {Array|string} path The path of the property to resolve.
  13997. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13998. * @returns {*} Returns the resolved value.
  13999. * @example
  14000. *
  14001. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14002. *
  14003. * _.result(object, 'a[0].b.c1');
  14004. * // => 3
  14005. *
  14006. * _.result(object, 'a[0].b.c2');
  14007. * // => 4
  14008. *
  14009. * _.result(object, 'a[0].b.c3', 'default');
  14010. * // => 'default'
  14011. *
  14012. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14013. * // => 'default'
  14014. */
  14015. function result(object, path, defaultValue) {
  14016. path = castPath(path, object);
  14017. var index = -1,
  14018. length = path.length;
  14019. // Ensure the loop is entered when path is empty.
  14020. if (!length) {
  14021. length = 1;
  14022. object = undefined;
  14023. }
  14024. while (++index < length) {
  14025. var value = object == null ? undefined : object[toKey(path[index])];
  14026. if (value === undefined) {
  14027. index = length;
  14028. value = defaultValue;
  14029. }
  14030. object = isFunction(value) ? value.call(object) : value;
  14031. }
  14032. return object;
  14033. }
  14034. /**
  14035. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14036. * it's created. Arrays are created for missing index properties while objects
  14037. * are created for all other missing properties. Use `_.setWith` to customize
  14038. * `path` creation.
  14039. *
  14040. * **Note:** This method mutates `object`.
  14041. *
  14042. * @static
  14043. * @memberOf _
  14044. * @since 3.7.0
  14045. * @category Object
  14046. * @param {Object} object The object to modify.
  14047. * @param {Array|string} path The path of the property to set.
  14048. * @param {*} value The value to set.
  14049. * @returns {Object} Returns `object`.
  14050. * @example
  14051. *
  14052. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14053. *
  14054. * _.set(object, 'a[0].b.c', 4);
  14055. * console.log(object.a[0].b.c);
  14056. * // => 4
  14057. *
  14058. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14059. * console.log(object.x[0].y.z);
  14060. * // => 5
  14061. */
  14062. function set(object, path, value) {
  14063. return object == null ? object : baseSet(object, path, value);
  14064. }
  14065. /**
  14066. * This method is like `_.set` except that it accepts `customizer` which is
  14067. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14068. * path creation is handled by the method instead. The `customizer` is invoked
  14069. * with three arguments: (nsValue, key, nsObject).
  14070. *
  14071. * **Note:** This method mutates `object`.
  14072. *
  14073. * @static
  14074. * @memberOf _
  14075. * @since 4.0.0
  14076. * @category Object
  14077. * @param {Object} object The object to modify.
  14078. * @param {Array|string} path The path of the property to set.
  14079. * @param {*} value The value to set.
  14080. * @param {Function} [customizer] The function to customize assigned values.
  14081. * @returns {Object} Returns `object`.
  14082. * @example
  14083. *
  14084. * var object = {};
  14085. *
  14086. * _.setWith(object, '[0][1]', 'a', Object);
  14087. * // => { '0': { '1': 'a' } }
  14088. */
  14089. function setWith(object, path, value, customizer) {
  14090. customizer = typeof customizer == 'function' ? customizer : undefined;
  14091. return object == null ? object : baseSet(object, path, value, customizer);
  14092. }
  14093. /**
  14094. * Creates an array of own enumerable string keyed-value pairs for `object`
  14095. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14096. * entries are returned.
  14097. *
  14098. * @static
  14099. * @memberOf _
  14100. * @since 4.0.0
  14101. * @alias entries
  14102. * @category Object
  14103. * @param {Object} object The object to query.
  14104. * @returns {Array} Returns the key-value pairs.
  14105. * @example
  14106. *
  14107. * function Foo() {
  14108. * this.a = 1;
  14109. * this.b = 2;
  14110. * }
  14111. *
  14112. * Foo.prototype.c = 3;
  14113. *
  14114. * _.toPairs(new Foo);
  14115. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14116. */
  14117. var toPairs = createToPairs(keys);
  14118. /**
  14119. * Creates an array of own and inherited enumerable string keyed-value pairs
  14120. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14121. * or set, its entries are returned.
  14122. *
  14123. * @static
  14124. * @memberOf _
  14125. * @since 4.0.0
  14126. * @alias entriesIn
  14127. * @category Object
  14128. * @param {Object} object The object to query.
  14129. * @returns {Array} Returns the key-value pairs.
  14130. * @example
  14131. *
  14132. * function Foo() {
  14133. * this.a = 1;
  14134. * this.b = 2;
  14135. * }
  14136. *
  14137. * Foo.prototype.c = 3;
  14138. *
  14139. * _.toPairsIn(new Foo);
  14140. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14141. */
  14142. var toPairsIn = createToPairs(keysIn);
  14143. /**
  14144. * An alternative to `_.reduce`; this method transforms `object` to a new
  14145. * `accumulator` object which is the result of running each of its own
  14146. * enumerable string keyed properties thru `iteratee`, with each invocation
  14147. * potentially mutating the `accumulator` object. If `accumulator` is not
  14148. * provided, a new object with the same `[[Prototype]]` will be used. The
  14149. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14150. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14151. *
  14152. * @static
  14153. * @memberOf _
  14154. * @since 1.3.0
  14155. * @category Object
  14156. * @param {Object} object The object to iterate over.
  14157. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14158. * @param {*} [accumulator] The custom accumulator value.
  14159. * @returns {*} Returns the accumulated value.
  14160. * @example
  14161. *
  14162. * _.transform([2, 3, 4], function(result, n) {
  14163. * result.push(n *= n);
  14164. * return n % 2 == 0;
  14165. * }, []);
  14166. * // => [4, 9]
  14167. *
  14168. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14169. * (result[value] || (result[value] = [])).push(key);
  14170. * }, {});
  14171. * // => { '1': ['a', 'c'], '2': ['b'] }
  14172. */
  14173. function transform(object, iteratee, accumulator) {
  14174. var isArr = isArray(object),
  14175. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14176. iteratee = getIteratee(iteratee, 4);
  14177. if (accumulator == null) {
  14178. var Ctor = object && object.constructor;
  14179. if (isArrLike) {
  14180. accumulator = isArr ? new Ctor : [];
  14181. }
  14182. else if (isObject(object)) {
  14183. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14184. }
  14185. else {
  14186. accumulator = {};
  14187. }
  14188. }
  14189. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14190. return iteratee(accumulator, value, index, object);
  14191. });
  14192. return accumulator;
  14193. }
  14194. /**
  14195. * Removes the property at `path` of `object`.
  14196. *
  14197. * **Note:** This method mutates `object`.
  14198. *
  14199. * @static
  14200. * @memberOf _
  14201. * @since 4.0.0
  14202. * @category Object
  14203. * @param {Object} object The object to modify.
  14204. * @param {Array|string} path The path of the property to unset.
  14205. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14206. * @example
  14207. *
  14208. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14209. * _.unset(object, 'a[0].b.c');
  14210. * // => true
  14211. *
  14212. * console.log(object);
  14213. * // => { 'a': [{ 'b': {} }] };
  14214. *
  14215. * _.unset(object, ['a', '0', 'b', 'c']);
  14216. * // => true
  14217. *
  14218. * console.log(object);
  14219. * // => { 'a': [{ 'b': {} }] };
  14220. */
  14221. function unset(object, path) {
  14222. return object == null ? true : baseUnset(object, path);
  14223. }
  14224. /**
  14225. * This method is like `_.set` except that accepts `updater` to produce the
  14226. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14227. * is invoked with one argument: (value).
  14228. *
  14229. * **Note:** This method mutates `object`.
  14230. *
  14231. * @static
  14232. * @memberOf _
  14233. * @since 4.6.0
  14234. * @category Object
  14235. * @param {Object} object The object to modify.
  14236. * @param {Array|string} path The path of the property to set.
  14237. * @param {Function} updater The function to produce the updated value.
  14238. * @returns {Object} Returns `object`.
  14239. * @example
  14240. *
  14241. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14242. *
  14243. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14244. * console.log(object.a[0].b.c);
  14245. * // => 9
  14246. *
  14247. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14248. * console.log(object.x[0].y.z);
  14249. * // => 0
  14250. */
  14251. function update(object, path, updater) {
  14252. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14253. }
  14254. /**
  14255. * This method is like `_.update` except that it accepts `customizer` which is
  14256. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14257. * path creation is handled by the method instead. The `customizer` is invoked
  14258. * with three arguments: (nsValue, key, nsObject).
  14259. *
  14260. * **Note:** This method mutates `object`.
  14261. *
  14262. * @static
  14263. * @memberOf _
  14264. * @since 4.6.0
  14265. * @category Object
  14266. * @param {Object} object The object to modify.
  14267. * @param {Array|string} path The path of the property to set.
  14268. * @param {Function} updater The function to produce the updated value.
  14269. * @param {Function} [customizer] The function to customize assigned values.
  14270. * @returns {Object} Returns `object`.
  14271. * @example
  14272. *
  14273. * var object = {};
  14274. *
  14275. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14276. * // => { '0': { '1': 'a' } }
  14277. */
  14278. function updateWith(object, path, updater, customizer) {
  14279. customizer = typeof customizer == 'function' ? customizer : undefined;
  14280. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14281. }
  14282. /**
  14283. * Creates an array of the own enumerable string keyed property values of `object`.
  14284. *
  14285. * **Note:** Non-object values are coerced to objects.
  14286. *
  14287. * @static
  14288. * @since 0.1.0
  14289. * @memberOf _
  14290. * @category Object
  14291. * @param {Object} object The object to query.
  14292. * @returns {Array} Returns the array of property values.
  14293. * @example
  14294. *
  14295. * function Foo() {
  14296. * this.a = 1;
  14297. * this.b = 2;
  14298. * }
  14299. *
  14300. * Foo.prototype.c = 3;
  14301. *
  14302. * _.values(new Foo);
  14303. * // => [1, 2] (iteration order is not guaranteed)
  14304. *
  14305. * _.values('hi');
  14306. * // => ['h', 'i']
  14307. */
  14308. function values(object) {
  14309. return object == null ? [] : baseValues(object, keys(object));
  14310. }
  14311. /**
  14312. * Creates an array of the own and inherited enumerable string keyed property
  14313. * values of `object`.
  14314. *
  14315. * **Note:** Non-object values are coerced to objects.
  14316. *
  14317. * @static
  14318. * @memberOf _
  14319. * @since 3.0.0
  14320. * @category Object
  14321. * @param {Object} object The object to query.
  14322. * @returns {Array} Returns the array of property values.
  14323. * @example
  14324. *
  14325. * function Foo() {
  14326. * this.a = 1;
  14327. * this.b = 2;
  14328. * }
  14329. *
  14330. * Foo.prototype.c = 3;
  14331. *
  14332. * _.valuesIn(new Foo);
  14333. * // => [1, 2, 3] (iteration order is not guaranteed)
  14334. */
  14335. function valuesIn(object) {
  14336. return object == null ? [] : baseValues(object, keysIn(object));
  14337. }
  14338. /*------------------------------------------------------------------------*/
  14339. /**
  14340. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14341. *
  14342. * @static
  14343. * @memberOf _
  14344. * @since 4.0.0
  14345. * @category Number
  14346. * @param {number} number The number to clamp.
  14347. * @param {number} [lower] The lower bound.
  14348. * @param {number} upper The upper bound.
  14349. * @returns {number} Returns the clamped number.
  14350. * @example
  14351. *
  14352. * _.clamp(-10, -5, 5);
  14353. * // => -5
  14354. *
  14355. * _.clamp(10, -5, 5);
  14356. * // => 5
  14357. */
  14358. function clamp(number, lower, upper) {
  14359. if (upper === undefined) {
  14360. upper = lower;
  14361. lower = undefined;
  14362. }
  14363. if (upper !== undefined) {
  14364. upper = toNumber(upper);
  14365. upper = upper === upper ? upper : 0;
  14366. }
  14367. if (lower !== undefined) {
  14368. lower = toNumber(lower);
  14369. lower = lower === lower ? lower : 0;
  14370. }
  14371. return baseClamp(toNumber(number), lower, upper);
  14372. }
  14373. /**
  14374. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14375. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14376. * If `start` is greater than `end` the params are swapped to support
  14377. * negative ranges.
  14378. *
  14379. * @static
  14380. * @memberOf _
  14381. * @since 3.3.0
  14382. * @category Number
  14383. * @param {number} number The number to check.
  14384. * @param {number} [start=0] The start of the range.
  14385. * @param {number} end The end of the range.
  14386. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14387. * @see _.range, _.rangeRight
  14388. * @example
  14389. *
  14390. * _.inRange(3, 2, 4);
  14391. * // => true
  14392. *
  14393. * _.inRange(4, 8);
  14394. * // => true
  14395. *
  14396. * _.inRange(4, 2);
  14397. * // => false
  14398. *
  14399. * _.inRange(2, 2);
  14400. * // => false
  14401. *
  14402. * _.inRange(1.2, 2);
  14403. * // => true
  14404. *
  14405. * _.inRange(5.2, 4);
  14406. * // => false
  14407. *
  14408. * _.inRange(-3, -2, -6);
  14409. * // => true
  14410. */
  14411. function inRange(number, start, end) {
  14412. start = toFinite(start);
  14413. if (end === undefined) {
  14414. end = start;
  14415. start = 0;
  14416. } else {
  14417. end = toFinite(end);
  14418. }
  14419. number = toNumber(number);
  14420. return baseInRange(number, start, end);
  14421. }
  14422. /**
  14423. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14424. * If only one argument is provided a number between `0` and the given number
  14425. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14426. * floats, a floating-point number is returned instead of an integer.
  14427. *
  14428. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14429. * floating-point values which can produce unexpected results.
  14430. *
  14431. * @static
  14432. * @memberOf _
  14433. * @since 0.7.0
  14434. * @category Number
  14435. * @param {number} [lower=0] The lower bound.
  14436. * @param {number} [upper=1] The upper bound.
  14437. * @param {boolean} [floating] Specify returning a floating-point number.
  14438. * @returns {number} Returns the random number.
  14439. * @example
  14440. *
  14441. * _.random(0, 5);
  14442. * // => an integer between 0 and 5
  14443. *
  14444. * _.random(5);
  14445. * // => also an integer between 0 and 5
  14446. *
  14447. * _.random(5, true);
  14448. * // => a floating-point number between 0 and 5
  14449. *
  14450. * _.random(1.2, 5.2);
  14451. * // => a floating-point number between 1.2 and 5.2
  14452. */
  14453. function random(lower, upper, floating) {
  14454. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14455. upper = floating = undefined;
  14456. }
  14457. if (floating === undefined) {
  14458. if (typeof upper == 'boolean') {
  14459. floating = upper;
  14460. upper = undefined;
  14461. }
  14462. else if (typeof lower == 'boolean') {
  14463. floating = lower;
  14464. lower = undefined;
  14465. }
  14466. }
  14467. if (lower === undefined && upper === undefined) {
  14468. lower = 0;
  14469. upper = 1;
  14470. }
  14471. else {
  14472. lower = toFinite(lower);
  14473. if (upper === undefined) {
  14474. upper = lower;
  14475. lower = 0;
  14476. } else {
  14477. upper = toFinite(upper);
  14478. }
  14479. }
  14480. if (lower > upper) {
  14481. var temp = lower;
  14482. lower = upper;
  14483. upper = temp;
  14484. }
  14485. if (floating || lower % 1 || upper % 1) {
  14486. var rand = nativeRandom();
  14487. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14488. }
  14489. return baseRandom(lower, upper);
  14490. }
  14491. /*------------------------------------------------------------------------*/
  14492. /**
  14493. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14494. *
  14495. * @static
  14496. * @memberOf _
  14497. * @since 3.0.0
  14498. * @category String
  14499. * @param {string} [string=''] The string to convert.
  14500. * @returns {string} Returns the camel cased string.
  14501. * @example
  14502. *
  14503. * _.camelCase('Foo Bar');
  14504. * // => 'fooBar'
  14505. *
  14506. * _.camelCase('--foo-bar--');
  14507. * // => 'fooBar'
  14508. *
  14509. * _.camelCase('__FOO_BAR__');
  14510. * // => 'fooBar'
  14511. */
  14512. var camelCase = createCompounder(function(result, word, index) {
  14513. word = word.toLowerCase();
  14514. return result + (index ? capitalize(word) : word);
  14515. });
  14516. /**
  14517. * Converts the first character of `string` to upper case and the remaining
  14518. * to lower case.
  14519. *
  14520. * @static
  14521. * @memberOf _
  14522. * @since 3.0.0
  14523. * @category String
  14524. * @param {string} [string=''] The string to capitalize.
  14525. * @returns {string} Returns the capitalized string.
  14526. * @example
  14527. *
  14528. * _.capitalize('FRED');
  14529. * // => 'Fred'
  14530. */
  14531. function capitalize(string) {
  14532. return upperFirst(toString(string).toLowerCase());
  14533. }
  14534. /**
  14535. * Deburrs `string` by converting
  14536. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14537. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14538. * letters to basic Latin letters and removing
  14539. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14540. *
  14541. * @static
  14542. * @memberOf _
  14543. * @since 3.0.0
  14544. * @category String
  14545. * @param {string} [string=''] The string to deburr.
  14546. * @returns {string} Returns the deburred string.
  14547. * @example
  14548. *
  14549. * _.deburr('déjà vu');
  14550. * // => 'deja vu'
  14551. */
  14552. function deburr(string) {
  14553. string = toString(string);
  14554. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14555. }
  14556. /**
  14557. * Checks if `string` ends with the given target string.
  14558. *
  14559. * @static
  14560. * @memberOf _
  14561. * @since 3.0.0
  14562. * @category String
  14563. * @param {string} [string=''] The string to inspect.
  14564. * @param {string} [target] The string to search for.
  14565. * @param {number} [position=string.length] The position to search up to.
  14566. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14567. * else `false`.
  14568. * @example
  14569. *
  14570. * _.endsWith('abc', 'c');
  14571. * // => true
  14572. *
  14573. * _.endsWith('abc', 'b');
  14574. * // => false
  14575. *
  14576. * _.endsWith('abc', 'b', 2);
  14577. * // => true
  14578. */
  14579. function endsWith(string, target, position) {
  14580. string = toString(string);
  14581. target = baseToString(target);
  14582. var length = string.length;
  14583. position = position === undefined
  14584. ? length
  14585. : baseClamp(toInteger(position), 0, length);
  14586. var end = position;
  14587. position -= target.length;
  14588. return position >= 0 && string.slice(position, end) == target;
  14589. }
  14590. /**
  14591. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14592. * corresponding HTML entities.
  14593. *
  14594. * **Note:** No other characters are escaped. To escape additional
  14595. * characters use a third-party library like [_he_](https://mths.be/he).
  14596. *
  14597. * Though the ">" character is escaped for symmetry, characters like
  14598. * ">" and "/" don't need escaping in HTML and have no special meaning
  14599. * unless they're part of a tag or unquoted attribute value. See
  14600. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14601. * (under "semi-related fun fact") for more details.
  14602. *
  14603. * When working with HTML you should always
  14604. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14605. * XSS vectors.
  14606. *
  14607. * @static
  14608. * @since 0.1.0
  14609. * @memberOf _
  14610. * @category String
  14611. * @param {string} [string=''] The string to escape.
  14612. * @returns {string} Returns the escaped string.
  14613. * @example
  14614. *
  14615. * _.escape('fred, barney, & pebbles');
  14616. * // => 'fred, barney, &amp; pebbles'
  14617. */
  14618. function escape(string) {
  14619. string = toString(string);
  14620. return (string && reHasUnescapedHtml.test(string))
  14621. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14622. : string;
  14623. }
  14624. /**
  14625. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14626. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14627. *
  14628. * @static
  14629. * @memberOf _
  14630. * @since 3.0.0
  14631. * @category String
  14632. * @param {string} [string=''] The string to escape.
  14633. * @returns {string} Returns the escaped string.
  14634. * @example
  14635. *
  14636. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14637. * // => '\[lodash\]\(https://lodash\.com/\)'
  14638. */
  14639. function escapeRegExp(string) {
  14640. string = toString(string);
  14641. return (string && reHasRegExpChar.test(string))
  14642. ? string.replace(reRegExpChar, '\\$&')
  14643. : string;
  14644. }
  14645. /**
  14646. * Converts `string` to
  14647. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14648. *
  14649. * @static
  14650. * @memberOf _
  14651. * @since 3.0.0
  14652. * @category String
  14653. * @param {string} [string=''] The string to convert.
  14654. * @returns {string} Returns the kebab cased string.
  14655. * @example
  14656. *
  14657. * _.kebabCase('Foo Bar');
  14658. * // => 'foo-bar'
  14659. *
  14660. * _.kebabCase('fooBar');
  14661. * // => 'foo-bar'
  14662. *
  14663. * _.kebabCase('__FOO_BAR__');
  14664. * // => 'foo-bar'
  14665. */
  14666. var kebabCase = createCompounder(function(result, word, index) {
  14667. return result + (index ? '-' : '') + word.toLowerCase();
  14668. });
  14669. /**
  14670. * Converts `string`, as space separated words, to lower case.
  14671. *
  14672. * @static
  14673. * @memberOf _
  14674. * @since 4.0.0
  14675. * @category String
  14676. * @param {string} [string=''] The string to convert.
  14677. * @returns {string} Returns the lower cased string.
  14678. * @example
  14679. *
  14680. * _.lowerCase('--Foo-Bar--');
  14681. * // => 'foo bar'
  14682. *
  14683. * _.lowerCase('fooBar');
  14684. * // => 'foo bar'
  14685. *
  14686. * _.lowerCase('__FOO_BAR__');
  14687. * // => 'foo bar'
  14688. */
  14689. var lowerCase = createCompounder(function(result, word, index) {
  14690. return result + (index ? ' ' : '') + word.toLowerCase();
  14691. });
  14692. /**
  14693. * Converts the first character of `string` to lower case.
  14694. *
  14695. * @static
  14696. * @memberOf _
  14697. * @since 4.0.0
  14698. * @category String
  14699. * @param {string} [string=''] The string to convert.
  14700. * @returns {string} Returns the converted string.
  14701. * @example
  14702. *
  14703. * _.lowerFirst('Fred');
  14704. * // => 'fred'
  14705. *
  14706. * _.lowerFirst('FRED');
  14707. * // => 'fRED'
  14708. */
  14709. var lowerFirst = createCaseFirst('toLowerCase');
  14710. /**
  14711. * Pads `string` on the left and right sides if it's shorter than `length`.
  14712. * Padding characters are truncated if they can't be evenly divided by `length`.
  14713. *
  14714. * @static
  14715. * @memberOf _
  14716. * @since 3.0.0
  14717. * @category String
  14718. * @param {string} [string=''] The string to pad.
  14719. * @param {number} [length=0] The padding length.
  14720. * @param {string} [chars=' '] The string used as padding.
  14721. * @returns {string} Returns the padded string.
  14722. * @example
  14723. *
  14724. * _.pad('abc', 8);
  14725. * // => ' abc '
  14726. *
  14727. * _.pad('abc', 8, '_-');
  14728. * // => '_-abc_-_'
  14729. *
  14730. * _.pad('abc', 3);
  14731. * // => 'abc'
  14732. */
  14733. function pad(string, length, chars) {
  14734. string = toString(string);
  14735. length = toInteger(length);
  14736. var strLength = length ? stringSize(string) : 0;
  14737. if (!length || strLength >= length) {
  14738. return string;
  14739. }
  14740. var mid = (length - strLength) / 2;
  14741. return (
  14742. createPadding(nativeFloor(mid), chars) +
  14743. string +
  14744. createPadding(nativeCeil(mid), chars)
  14745. );
  14746. }
  14747. /**
  14748. * Pads `string` on the right side if it's shorter than `length`. Padding
  14749. * characters are truncated if they exceed `length`.
  14750. *
  14751. * @static
  14752. * @memberOf _
  14753. * @since 4.0.0
  14754. * @category String
  14755. * @param {string} [string=''] The string to pad.
  14756. * @param {number} [length=0] The padding length.
  14757. * @param {string} [chars=' '] The string used as padding.
  14758. * @returns {string} Returns the padded string.
  14759. * @example
  14760. *
  14761. * _.padEnd('abc', 6);
  14762. * // => 'abc '
  14763. *
  14764. * _.padEnd('abc', 6, '_-');
  14765. * // => 'abc_-_'
  14766. *
  14767. * _.padEnd('abc', 3);
  14768. * // => 'abc'
  14769. */
  14770. function padEnd(string, length, chars) {
  14771. string = toString(string);
  14772. length = toInteger(length);
  14773. var strLength = length ? stringSize(string) : 0;
  14774. return (length && strLength < length)
  14775. ? (string + createPadding(length - strLength, chars))
  14776. : string;
  14777. }
  14778. /**
  14779. * Pads `string` on the left side if it's shorter than `length`. Padding
  14780. * characters are truncated if they exceed `length`.
  14781. *
  14782. * @static
  14783. * @memberOf _
  14784. * @since 4.0.0
  14785. * @category String
  14786. * @param {string} [string=''] The string to pad.
  14787. * @param {number} [length=0] The padding length.
  14788. * @param {string} [chars=' '] The string used as padding.
  14789. * @returns {string} Returns the padded string.
  14790. * @example
  14791. *
  14792. * _.padStart('abc', 6);
  14793. * // => ' abc'
  14794. *
  14795. * _.padStart('abc', 6, '_-');
  14796. * // => '_-_abc'
  14797. *
  14798. * _.padStart('abc', 3);
  14799. * // => 'abc'
  14800. */
  14801. function padStart(string, length, chars) {
  14802. string = toString(string);
  14803. length = toInteger(length);
  14804. var strLength = length ? stringSize(string) : 0;
  14805. return (length && strLength < length)
  14806. ? (createPadding(length - strLength, chars) + string)
  14807. : string;
  14808. }
  14809. /**
  14810. * Converts `string` to an integer of the specified radix. If `radix` is
  14811. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14812. * hexadecimal, in which case a `radix` of `16` is used.
  14813. *
  14814. * **Note:** This method aligns with the
  14815. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14816. *
  14817. * @static
  14818. * @memberOf _
  14819. * @since 1.1.0
  14820. * @category String
  14821. * @param {string} string The string to convert.
  14822. * @param {number} [radix=10] The radix to interpret `value` by.
  14823. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14824. * @returns {number} Returns the converted integer.
  14825. * @example
  14826. *
  14827. * _.parseInt('08');
  14828. * // => 8
  14829. *
  14830. * _.map(['6', '08', '10'], _.parseInt);
  14831. * // => [6, 8, 10]
  14832. */
  14833. function parseInt(string, radix, guard) {
  14834. if (guard || radix == null) {
  14835. radix = 0;
  14836. } else if (radix) {
  14837. radix = +radix;
  14838. }
  14839. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14840. }
  14841. /**
  14842. * Repeats the given string `n` times.
  14843. *
  14844. * @static
  14845. * @memberOf _
  14846. * @since 3.0.0
  14847. * @category String
  14848. * @param {string} [string=''] The string to repeat.
  14849. * @param {number} [n=1] The number of times to repeat the string.
  14850. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14851. * @returns {string} Returns the repeated string.
  14852. * @example
  14853. *
  14854. * _.repeat('*', 3);
  14855. * // => '***'
  14856. *
  14857. * _.repeat('abc', 2);
  14858. * // => 'abcabc'
  14859. *
  14860. * _.repeat('abc', 0);
  14861. * // => ''
  14862. */
  14863. function repeat(string, n, guard) {
  14864. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14865. n = 1;
  14866. } else {
  14867. n = toInteger(n);
  14868. }
  14869. return baseRepeat(toString(string), n);
  14870. }
  14871. /**
  14872. * Replaces matches for `pattern` in `string` with `replacement`.
  14873. *
  14874. * **Note:** This method is based on
  14875. * [`String#replace`](https://mdn.io/String/replace).
  14876. *
  14877. * @static
  14878. * @memberOf _
  14879. * @since 4.0.0
  14880. * @category String
  14881. * @param {string} [string=''] The string to modify.
  14882. * @param {RegExp|string} pattern The pattern to replace.
  14883. * @param {Function|string} replacement The match replacement.
  14884. * @returns {string} Returns the modified string.
  14885. * @example
  14886. *
  14887. * _.replace('Hi Fred', 'Fred', 'Barney');
  14888. * // => 'Hi Barney'
  14889. */
  14890. function replace() {
  14891. var args = arguments,
  14892. string = toString(args[0]);
  14893. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14894. }
  14895. /**
  14896. * Converts `string` to
  14897. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14898. *
  14899. * @static
  14900. * @memberOf _
  14901. * @since 3.0.0
  14902. * @category String
  14903. * @param {string} [string=''] The string to convert.
  14904. * @returns {string} Returns the snake cased string.
  14905. * @example
  14906. *
  14907. * _.snakeCase('Foo Bar');
  14908. * // => 'foo_bar'
  14909. *
  14910. * _.snakeCase('fooBar');
  14911. * // => 'foo_bar'
  14912. *
  14913. * _.snakeCase('--FOO-BAR--');
  14914. * // => 'foo_bar'
  14915. */
  14916. var snakeCase = createCompounder(function(result, word, index) {
  14917. return result + (index ? '_' : '') + word.toLowerCase();
  14918. });
  14919. /**
  14920. * Splits `string` by `separator`.
  14921. *
  14922. * **Note:** This method is based on
  14923. * [`String#split`](https://mdn.io/String/split).
  14924. *
  14925. * @static
  14926. * @memberOf _
  14927. * @since 4.0.0
  14928. * @category String
  14929. * @param {string} [string=''] The string to split.
  14930. * @param {RegExp|string} separator The separator pattern to split by.
  14931. * @param {number} [limit] The length to truncate results to.
  14932. * @returns {Array} Returns the string segments.
  14933. * @example
  14934. *
  14935. * _.split('a-b-c', '-', 2);
  14936. * // => ['a', 'b']
  14937. */
  14938. function split(string, separator, limit) {
  14939. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14940. separator = limit = undefined;
  14941. }
  14942. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14943. if (!limit) {
  14944. return [];
  14945. }
  14946. string = toString(string);
  14947. if (string && (
  14948. typeof separator == 'string' ||
  14949. (separator != null && !isRegExp(separator))
  14950. )) {
  14951. separator = baseToString(separator);
  14952. if (!separator && hasUnicode(string)) {
  14953. return castSlice(stringToArray(string), 0, limit);
  14954. }
  14955. }
  14956. return string.split(separator, limit);
  14957. }
  14958. /**
  14959. * Converts `string` to
  14960. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14961. *
  14962. * @static
  14963. * @memberOf _
  14964. * @since 3.1.0
  14965. * @category String
  14966. * @param {string} [string=''] The string to convert.
  14967. * @returns {string} Returns the start cased string.
  14968. * @example
  14969. *
  14970. * _.startCase('--foo-bar--');
  14971. * // => 'Foo Bar'
  14972. *
  14973. * _.startCase('fooBar');
  14974. * // => 'Foo Bar'
  14975. *
  14976. * _.startCase('__FOO_BAR__');
  14977. * // => 'FOO BAR'
  14978. */
  14979. var startCase = createCompounder(function(result, word, index) {
  14980. return result + (index ? ' ' : '') + upperFirst(word);
  14981. });
  14982. /**
  14983. * Checks if `string` starts with the given target string.
  14984. *
  14985. * @static
  14986. * @memberOf _
  14987. * @since 3.0.0
  14988. * @category String
  14989. * @param {string} [string=''] The string to inspect.
  14990. * @param {string} [target] The string to search for.
  14991. * @param {number} [position=0] The position to search from.
  14992. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14993. * else `false`.
  14994. * @example
  14995. *
  14996. * _.startsWith('abc', 'a');
  14997. * // => true
  14998. *
  14999. * _.startsWith('abc', 'b');
  15000. * // => false
  15001. *
  15002. * _.startsWith('abc', 'b', 1);
  15003. * // => true
  15004. */
  15005. function startsWith(string, target, position) {
  15006. string = toString(string);
  15007. position = position == null
  15008. ? 0
  15009. : baseClamp(toInteger(position), 0, string.length);
  15010. target = baseToString(target);
  15011. return string.slice(position, position + target.length) == target;
  15012. }
  15013. /**
  15014. * Creates a compiled template function that can interpolate data properties
  15015. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15016. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15017. * properties may be accessed as free variables in the template. If a setting
  15018. * object is given, it takes precedence over `_.templateSettings` values.
  15019. *
  15020. * **Note:** In the development build `_.template` utilizes
  15021. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15022. * for easier debugging.
  15023. *
  15024. * For more information on precompiling templates see
  15025. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15026. *
  15027. * For more information on Chrome extension sandboxes see
  15028. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15029. *
  15030. * @static
  15031. * @since 0.1.0
  15032. * @memberOf _
  15033. * @category String
  15034. * @param {string} [string=''] The template string.
  15035. * @param {Object} [options={}] The options object.
  15036. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15037. * The HTML "escape" delimiter.
  15038. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15039. * The "evaluate" delimiter.
  15040. * @param {Object} [options.imports=_.templateSettings.imports]
  15041. * An object to import into the template as free variables.
  15042. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15043. * The "interpolate" delimiter.
  15044. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15045. * The sourceURL of the compiled template.
  15046. * @param {string} [options.variable='obj']
  15047. * The data object variable name.
  15048. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15049. * @returns {Function} Returns the compiled template function.
  15050. * @example
  15051. *
  15052. * // Use the "interpolate" delimiter to create a compiled template.
  15053. * var compiled = _.template('hello <%= user %>!');
  15054. * compiled({ 'user': 'fred' });
  15055. * // => 'hello fred!'
  15056. *
  15057. * // Use the HTML "escape" delimiter to escape data property values.
  15058. * var compiled = _.template('<b><%- value %></b>');
  15059. * compiled({ 'value': '<script>' });
  15060. * // => '<b>&lt;script&gt;</b>'
  15061. *
  15062. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15063. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15064. * compiled({ 'users': ['fred', 'barney'] });
  15065. * // => '<li>fred</li><li>barney</li>'
  15066. *
  15067. * // Use the internal `print` function in "evaluate" delimiters.
  15068. * var compiled = _.template('<% print("hello " + user); %>!');
  15069. * compiled({ 'user': 'barney' });
  15070. * // => 'hello barney!'
  15071. *
  15072. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15073. * // Disable support by replacing the "interpolate" delimiter.
  15074. * var compiled = _.template('hello ${ user }!');
  15075. * compiled({ 'user': 'pebbles' });
  15076. * // => 'hello pebbles!'
  15077. *
  15078. * // Use backslashes to treat delimiters as plain text.
  15079. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15080. * compiled({ 'value': 'ignored' });
  15081. * // => '<%- value %>'
  15082. *
  15083. * // Use the `imports` option to import `jQuery` as `jq`.
  15084. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15085. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15086. * compiled({ 'users': ['fred', 'barney'] });
  15087. * // => '<li>fred</li><li>barney</li>'
  15088. *
  15089. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15090. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15091. * compiled(data);
  15092. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15093. *
  15094. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15095. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15096. * compiled.source;
  15097. * // => function(data) {
  15098. * // var __t, __p = '';
  15099. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15100. * // return __p;
  15101. * // }
  15102. *
  15103. * // Use custom template delimiters.
  15104. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15105. * var compiled = _.template('hello {{ user }}!');
  15106. * compiled({ 'user': 'mustache' });
  15107. * // => 'hello mustache!'
  15108. *
  15109. * // Use the `source` property to inline compiled templates for meaningful
  15110. * // line numbers in error messages and stack traces.
  15111. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15112. * var JST = {\
  15113. * "main": ' + _.template(mainText).source + '\
  15114. * };\
  15115. * ');
  15116. */
  15117. function template(string, options, guard) {
  15118. // Based on John Resig's `tmpl` implementation
  15119. // (http://ejohn.org/blog/javascript-micro-templating/)
  15120. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15121. var settings = lodash.templateSettings;
  15122. if (guard && isIterateeCall(string, options, guard)) {
  15123. options = undefined;
  15124. }
  15125. string = toString(string);
  15126. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15127. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15128. importsKeys = keys(imports),
  15129. importsValues = baseValues(imports, importsKeys);
  15130. var isEscaping,
  15131. isEvaluating,
  15132. index = 0,
  15133. interpolate = options.interpolate || reNoMatch,
  15134. source = "__p += '";
  15135. // Compile the regexp to match each delimiter.
  15136. var reDelimiters = RegExp(
  15137. (options.escape || reNoMatch).source + '|' +
  15138. interpolate.source + '|' +
  15139. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15140. (options.evaluate || reNoMatch).source + '|$'
  15141. , 'g');
  15142. // Use a sourceURL for easier debugging.
  15143. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15144. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15145. // and escape the comment, thus injecting code that gets evaled.
  15146. var sourceURL = '//# sourceURL=' +
  15147. (hasOwnProperty.call(options, 'sourceURL')
  15148. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15149. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15150. ) + '\n';
  15151. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15152. interpolateValue || (interpolateValue = esTemplateValue);
  15153. // Escape characters that can't be included in string literals.
  15154. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15155. // Replace delimiters with snippets.
  15156. if (escapeValue) {
  15157. isEscaping = true;
  15158. source += "' +\n__e(" + escapeValue + ") +\n'";
  15159. }
  15160. if (evaluateValue) {
  15161. isEvaluating = true;
  15162. source += "';\n" + evaluateValue + ";\n__p += '";
  15163. }
  15164. if (interpolateValue) {
  15165. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15166. }
  15167. index = offset + match.length;
  15168. // The JS engine embedded in Adobe products needs `match` returned in
  15169. // order to produce the correct `offset` value.
  15170. return match;
  15171. });
  15172. source += "';\n";
  15173. // If `variable` is not specified wrap a with-statement around the generated
  15174. // code to add the data object to the top of the scope chain.
  15175. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15176. if (!variable) {
  15177. source = 'with (obj) {\n' + source + '\n}\n';
  15178. }
  15179. // Throw an error if a forbidden character was found in `variable`, to prevent
  15180. // potential command injection attacks.
  15181. else if (reForbiddenIdentifierChars.test(variable)) {
  15182. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15183. }
  15184. // Cleanup code by stripping empty strings.
  15185. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15186. .replace(reEmptyStringMiddle, '$1')
  15187. .replace(reEmptyStringTrailing, '$1;');
  15188. // Frame code as the function body.
  15189. source = 'function(' + (variable || 'obj') + ') {\n' +
  15190. (variable
  15191. ? ''
  15192. : 'obj || (obj = {});\n'
  15193. ) +
  15194. "var __t, __p = ''" +
  15195. (isEscaping
  15196. ? ', __e = _.escape'
  15197. : ''
  15198. ) +
  15199. (isEvaluating
  15200. ? ', __j = Array.prototype.join;\n' +
  15201. "function print() { __p += __j.call(arguments, '') }\n"
  15202. : ';\n'
  15203. ) +
  15204. source +
  15205. 'return __p\n}';
  15206. var result = attempt(function() {
  15207. return Function(importsKeys, sourceURL + 'return ' + source)
  15208. .apply(undefined, importsValues);
  15209. });
  15210. // Provide the compiled function's source by its `toString` method or
  15211. // the `source` property as a convenience for inlining compiled templates.
  15212. result.source = source;
  15213. if (isError(result)) {
  15214. throw result;
  15215. }
  15216. return result;
  15217. }
  15218. /**
  15219. * Converts `string`, as a whole, to lower case just like
  15220. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15221. *
  15222. * @static
  15223. * @memberOf _
  15224. * @since 4.0.0
  15225. * @category String
  15226. * @param {string} [string=''] The string to convert.
  15227. * @returns {string} Returns the lower cased string.
  15228. * @example
  15229. *
  15230. * _.toLower('--Foo-Bar--');
  15231. * // => '--foo-bar--'
  15232. *
  15233. * _.toLower('fooBar');
  15234. * // => 'foobar'
  15235. *
  15236. * _.toLower('__FOO_BAR__');
  15237. * // => '__foo_bar__'
  15238. */
  15239. function toLower(value) {
  15240. return toString(value).toLowerCase();
  15241. }
  15242. /**
  15243. * Converts `string`, as a whole, to upper case just like
  15244. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15245. *
  15246. * @static
  15247. * @memberOf _
  15248. * @since 4.0.0
  15249. * @category String
  15250. * @param {string} [string=''] The string to convert.
  15251. * @returns {string} Returns the upper cased string.
  15252. * @example
  15253. *
  15254. * _.toUpper('--foo-bar--');
  15255. * // => '--FOO-BAR--'
  15256. *
  15257. * _.toUpper('fooBar');
  15258. * // => 'FOOBAR'
  15259. *
  15260. * _.toUpper('__foo_bar__');
  15261. * // => '__FOO_BAR__'
  15262. */
  15263. function toUpper(value) {
  15264. return toString(value).toUpperCase();
  15265. }
  15266. /**
  15267. * Removes leading and trailing whitespace or specified characters from `string`.
  15268. *
  15269. * @static
  15270. * @memberOf _
  15271. * @since 3.0.0
  15272. * @category String
  15273. * @param {string} [string=''] The string to trim.
  15274. * @param {string} [chars=whitespace] The characters to trim.
  15275. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15276. * @returns {string} Returns the trimmed string.
  15277. * @example
  15278. *
  15279. * _.trim(' abc ');
  15280. * // => 'abc'
  15281. *
  15282. * _.trim('-_-abc-_-', '_-');
  15283. * // => 'abc'
  15284. *
  15285. * _.map([' foo ', ' bar '], _.trim);
  15286. * // => ['foo', 'bar']
  15287. */
  15288. function trim(string, chars, guard) {
  15289. string = toString(string);
  15290. if (string && (guard || chars === undefined)) {
  15291. return baseTrim(string);
  15292. }
  15293. if (!string || !(chars = baseToString(chars))) {
  15294. return string;
  15295. }
  15296. var strSymbols = stringToArray(string),
  15297. chrSymbols = stringToArray(chars),
  15298. start = charsStartIndex(strSymbols, chrSymbols),
  15299. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15300. return castSlice(strSymbols, start, end).join('');
  15301. }
  15302. /**
  15303. * Removes trailing whitespace or specified characters from `string`.
  15304. *
  15305. * @static
  15306. * @memberOf _
  15307. * @since 4.0.0
  15308. * @category String
  15309. * @param {string} [string=''] The string to trim.
  15310. * @param {string} [chars=whitespace] The characters to trim.
  15311. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15312. * @returns {string} Returns the trimmed string.
  15313. * @example
  15314. *
  15315. * _.trimEnd(' abc ');
  15316. * // => ' abc'
  15317. *
  15318. * _.trimEnd('-_-abc-_-', '_-');
  15319. * // => '-_-abc'
  15320. */
  15321. function trimEnd(string, chars, guard) {
  15322. string = toString(string);
  15323. if (string && (guard || chars === undefined)) {
  15324. return string.slice(0, trimmedEndIndex(string) + 1);
  15325. }
  15326. if (!string || !(chars = baseToString(chars))) {
  15327. return string;
  15328. }
  15329. var strSymbols = stringToArray(string),
  15330. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15331. return castSlice(strSymbols, 0, end).join('');
  15332. }
  15333. /**
  15334. * Removes leading whitespace or specified characters from `string`.
  15335. *
  15336. * @static
  15337. * @memberOf _
  15338. * @since 4.0.0
  15339. * @category String
  15340. * @param {string} [string=''] The string to trim.
  15341. * @param {string} [chars=whitespace] The characters to trim.
  15342. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15343. * @returns {string} Returns the trimmed string.
  15344. * @example
  15345. *
  15346. * _.trimStart(' abc ');
  15347. * // => 'abc '
  15348. *
  15349. * _.trimStart('-_-abc-_-', '_-');
  15350. * // => 'abc-_-'
  15351. */
  15352. function trimStart(string, chars, guard) {
  15353. string = toString(string);
  15354. if (string && (guard || chars === undefined)) {
  15355. return string.replace(reTrimStart, '');
  15356. }
  15357. if (!string || !(chars = baseToString(chars))) {
  15358. return string;
  15359. }
  15360. var strSymbols = stringToArray(string),
  15361. start = charsStartIndex(strSymbols, stringToArray(chars));
  15362. return castSlice(strSymbols, start).join('');
  15363. }
  15364. /**
  15365. * Truncates `string` if it's longer than the given maximum string length.
  15366. * The last characters of the truncated string are replaced with the omission
  15367. * string which defaults to "...".
  15368. *
  15369. * @static
  15370. * @memberOf _
  15371. * @since 4.0.0
  15372. * @category String
  15373. * @param {string} [string=''] The string to truncate.
  15374. * @param {Object} [options={}] The options object.
  15375. * @param {number} [options.length=30] The maximum string length.
  15376. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15377. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15378. * @returns {string} Returns the truncated string.
  15379. * @example
  15380. *
  15381. * _.truncate('hi-diddly-ho there, neighborino');
  15382. * // => 'hi-diddly-ho there, neighbo...'
  15383. *
  15384. * _.truncate('hi-diddly-ho there, neighborino', {
  15385. * 'length': 24,
  15386. * 'separator': ' '
  15387. * });
  15388. * // => 'hi-diddly-ho there,...'
  15389. *
  15390. * _.truncate('hi-diddly-ho there, neighborino', {
  15391. * 'length': 24,
  15392. * 'separator': /,? +/
  15393. * });
  15394. * // => 'hi-diddly-ho there...'
  15395. *
  15396. * _.truncate('hi-diddly-ho there, neighborino', {
  15397. * 'omission': ' [...]'
  15398. * });
  15399. * // => 'hi-diddly-ho there, neig [...]'
  15400. */
  15401. function truncate(string, options) {
  15402. var length = DEFAULT_TRUNC_LENGTH,
  15403. omission = DEFAULT_TRUNC_OMISSION;
  15404. if (isObject(options)) {
  15405. var separator = 'separator' in options ? options.separator : separator;
  15406. length = 'length' in options ? toInteger(options.length) : length;
  15407. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15408. }
  15409. string = toString(string);
  15410. var strLength = string.length;
  15411. if (hasUnicode(string)) {
  15412. var strSymbols = stringToArray(string);
  15413. strLength = strSymbols.length;
  15414. }
  15415. if (length >= strLength) {
  15416. return string;
  15417. }
  15418. var end = length - stringSize(omission);
  15419. if (end < 1) {
  15420. return omission;
  15421. }
  15422. var result = strSymbols
  15423. ? castSlice(strSymbols, 0, end).join('')
  15424. : string.slice(0, end);
  15425. if (separator === undefined) {
  15426. return result + omission;
  15427. }
  15428. if (strSymbols) {
  15429. end += (result.length - end);
  15430. }
  15431. if (isRegExp(separator)) {
  15432. if (string.slice(end).search(separator)) {
  15433. var match,
  15434. substring = result;
  15435. if (!separator.global) {
  15436. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15437. }
  15438. separator.lastIndex = 0;
  15439. while ((match = separator.exec(substring))) {
  15440. var newEnd = match.index;
  15441. }
  15442. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15443. }
  15444. } else if (string.indexOf(baseToString(separator), end) != end) {
  15445. var index = result.lastIndexOf(separator);
  15446. if (index > -1) {
  15447. result = result.slice(0, index);
  15448. }
  15449. }
  15450. return result + omission;
  15451. }
  15452. /**
  15453. * The inverse of `_.escape`; this method converts the HTML entities
  15454. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15455. * their corresponding characters.
  15456. *
  15457. * **Note:** No other HTML entities are unescaped. To unescape additional
  15458. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15459. *
  15460. * @static
  15461. * @memberOf _
  15462. * @since 0.6.0
  15463. * @category String
  15464. * @param {string} [string=''] The string to unescape.
  15465. * @returns {string} Returns the unescaped string.
  15466. * @example
  15467. *
  15468. * _.unescape('fred, barney, &amp; pebbles');
  15469. * // => 'fred, barney, & pebbles'
  15470. */
  15471. function unescape(string) {
  15472. string = toString(string);
  15473. return (string && reHasEscapedHtml.test(string))
  15474. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15475. : string;
  15476. }
  15477. /**
  15478. * Converts `string`, as space separated words, to upper case.
  15479. *
  15480. * @static
  15481. * @memberOf _
  15482. * @since 4.0.0
  15483. * @category String
  15484. * @param {string} [string=''] The string to convert.
  15485. * @returns {string} Returns the upper cased string.
  15486. * @example
  15487. *
  15488. * _.upperCase('--foo-bar');
  15489. * // => 'FOO BAR'
  15490. *
  15491. * _.upperCase('fooBar');
  15492. * // => 'FOO BAR'
  15493. *
  15494. * _.upperCase('__foo_bar__');
  15495. * // => 'FOO BAR'
  15496. */
  15497. var upperCase = createCompounder(function(result, word, index) {
  15498. return result + (index ? ' ' : '') + word.toUpperCase();
  15499. });
  15500. /**
  15501. * Converts the first character of `string` to upper case.
  15502. *
  15503. * @static
  15504. * @memberOf _
  15505. * @since 4.0.0
  15506. * @category String
  15507. * @param {string} [string=''] The string to convert.
  15508. * @returns {string} Returns the converted string.
  15509. * @example
  15510. *
  15511. * _.upperFirst('fred');
  15512. * // => 'Fred'
  15513. *
  15514. * _.upperFirst('FRED');
  15515. * // => 'FRED'
  15516. */
  15517. var upperFirst = createCaseFirst('toUpperCase');
  15518. /**
  15519. * Splits `string` into an array of its words.
  15520. *
  15521. * @static
  15522. * @memberOf _
  15523. * @since 3.0.0
  15524. * @category String
  15525. * @param {string} [string=''] The string to inspect.
  15526. * @param {RegExp|string} [pattern] The pattern to match words.
  15527. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15528. * @returns {Array} Returns the words of `string`.
  15529. * @example
  15530. *
  15531. * _.words('fred, barney, & pebbles');
  15532. * // => ['fred', 'barney', 'pebbles']
  15533. *
  15534. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15535. * // => ['fred', 'barney', '&', 'pebbles']
  15536. */
  15537. function words(string, pattern, guard) {
  15538. string = toString(string);
  15539. pattern = guard ? undefined : pattern;
  15540. if (pattern === undefined) {
  15541. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15542. }
  15543. return string.match(pattern) || [];
  15544. }
  15545. /*------------------------------------------------------------------------*/
  15546. /**
  15547. * Attempts to invoke `func`, returning either the result or the caught error
  15548. * object. Any additional arguments are provided to `func` when it's invoked.
  15549. *
  15550. * @static
  15551. * @memberOf _
  15552. * @since 3.0.0
  15553. * @category Util
  15554. * @param {Function} func The function to attempt.
  15555. * @param {...*} [args] The arguments to invoke `func` with.
  15556. * @returns {*} Returns the `func` result or error object.
  15557. * @example
  15558. *
  15559. * // Avoid throwing errors for invalid selectors.
  15560. * var elements = _.attempt(function(selector) {
  15561. * return document.querySelectorAll(selector);
  15562. * }, '>_>');
  15563. *
  15564. * if (_.isError(elements)) {
  15565. * elements = [];
  15566. * }
  15567. */
  15568. var attempt = baseRest(function(func, args) {
  15569. try {
  15570. return apply(func, undefined, args);
  15571. } catch (e) {
  15572. return isError(e) ? e : new Error(e);
  15573. }
  15574. });
  15575. /**
  15576. * Binds methods of an object to the object itself, overwriting the existing
  15577. * method.
  15578. *
  15579. * **Note:** This method doesn't set the "length" property of bound functions.
  15580. *
  15581. * @static
  15582. * @since 0.1.0
  15583. * @memberOf _
  15584. * @category Util
  15585. * @param {Object} object The object to bind and assign the bound methods to.
  15586. * @param {...(string|string[])} methodNames The object method names to bind.
  15587. * @returns {Object} Returns `object`.
  15588. * @example
  15589. *
  15590. * var view = {
  15591. * 'label': 'docs',
  15592. * 'click': function() {
  15593. * console.log('clicked ' + this.label);
  15594. * }
  15595. * };
  15596. *
  15597. * _.bindAll(view, ['click']);
  15598. * jQuery(element).on('click', view.click);
  15599. * // => Logs 'clicked docs' when clicked.
  15600. */
  15601. var bindAll = flatRest(function(object, methodNames) {
  15602. arrayEach(methodNames, function(key) {
  15603. key = toKey(key);
  15604. baseAssignValue(object, key, bind(object[key], object));
  15605. });
  15606. return object;
  15607. });
  15608. /**
  15609. * Creates a function that iterates over `pairs` and invokes the corresponding
  15610. * function of the first predicate to return truthy. The predicate-function
  15611. * pairs are invoked with the `this` binding and arguments of the created
  15612. * function.
  15613. *
  15614. * @static
  15615. * @memberOf _
  15616. * @since 4.0.0
  15617. * @category Util
  15618. * @param {Array} pairs The predicate-function pairs.
  15619. * @returns {Function} Returns the new composite function.
  15620. * @example
  15621. *
  15622. * var func = _.cond([
  15623. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15624. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15625. * [_.stubTrue, _.constant('no match')]
  15626. * ]);
  15627. *
  15628. * func({ 'a': 1, 'b': 2 });
  15629. * // => 'matches A'
  15630. *
  15631. * func({ 'a': 0, 'b': 1 });
  15632. * // => 'matches B'
  15633. *
  15634. * func({ 'a': '1', 'b': '2' });
  15635. * // => 'no match'
  15636. */
  15637. function cond(pairs) {
  15638. var length = pairs == null ? 0 : pairs.length,
  15639. toIteratee = getIteratee();
  15640. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15641. if (typeof pair[1] != 'function') {
  15642. throw new TypeError(FUNC_ERROR_TEXT);
  15643. }
  15644. return [toIteratee(pair[0]), pair[1]];
  15645. });
  15646. return baseRest(function(args) {
  15647. var index = -1;
  15648. while (++index < length) {
  15649. var pair = pairs[index];
  15650. if (apply(pair[0], this, args)) {
  15651. return apply(pair[1], this, args);
  15652. }
  15653. }
  15654. });
  15655. }
  15656. /**
  15657. * Creates a function that invokes the predicate properties of `source` with
  15658. * the corresponding property values of a given object, returning `true` if
  15659. * all predicates return truthy, else `false`.
  15660. *
  15661. * **Note:** The created function is equivalent to `_.conformsTo` with
  15662. * `source` partially applied.
  15663. *
  15664. * @static
  15665. * @memberOf _
  15666. * @since 4.0.0
  15667. * @category Util
  15668. * @param {Object} source The object of property predicates to conform to.
  15669. * @returns {Function} Returns the new spec function.
  15670. * @example
  15671. *
  15672. * var objects = [
  15673. * { 'a': 2, 'b': 1 },
  15674. * { 'a': 1, 'b': 2 }
  15675. * ];
  15676. *
  15677. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15678. * // => [{ 'a': 1, 'b': 2 }]
  15679. */
  15680. function conforms(source) {
  15681. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15682. }
  15683. /**
  15684. * Creates a function that returns `value`.
  15685. *
  15686. * @static
  15687. * @memberOf _
  15688. * @since 2.4.0
  15689. * @category Util
  15690. * @param {*} value The value to return from the new function.
  15691. * @returns {Function} Returns the new constant function.
  15692. * @example
  15693. *
  15694. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15695. *
  15696. * console.log(objects);
  15697. * // => [{ 'a': 1 }, { 'a': 1 }]
  15698. *
  15699. * console.log(objects[0] === objects[1]);
  15700. * // => true
  15701. */
  15702. function constant(value) {
  15703. return function() {
  15704. return value;
  15705. };
  15706. }
  15707. /**
  15708. * Checks `value` to determine whether a default value should be returned in
  15709. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15710. * or `undefined`.
  15711. *
  15712. * @static
  15713. * @memberOf _
  15714. * @since 4.14.0
  15715. * @category Util
  15716. * @param {*} value The value to check.
  15717. * @param {*} defaultValue The default value.
  15718. * @returns {*} Returns the resolved value.
  15719. * @example
  15720. *
  15721. * _.defaultTo(1, 10);
  15722. * // => 1
  15723. *
  15724. * _.defaultTo(undefined, 10);
  15725. * // => 10
  15726. */
  15727. function defaultTo(value, defaultValue) {
  15728. return (value == null || value !== value) ? defaultValue : value;
  15729. }
  15730. /**
  15731. * Creates a function that returns the result of invoking the given functions
  15732. * with the `this` binding of the created function, where each successive
  15733. * invocation is supplied the return value of the previous.
  15734. *
  15735. * @static
  15736. * @memberOf _
  15737. * @since 3.0.0
  15738. * @category Util
  15739. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15740. * @returns {Function} Returns the new composite function.
  15741. * @see _.flowRight
  15742. * @example
  15743. *
  15744. * function square(n) {
  15745. * return n * n;
  15746. * }
  15747. *
  15748. * var addSquare = _.flow([_.add, square]);
  15749. * addSquare(1, 2);
  15750. * // => 9
  15751. */
  15752. var flow = createFlow();
  15753. /**
  15754. * This method is like `_.flow` except that it creates a function that
  15755. * invokes the given functions from right to left.
  15756. *
  15757. * @static
  15758. * @since 3.0.0
  15759. * @memberOf _
  15760. * @category Util
  15761. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15762. * @returns {Function} Returns the new composite function.
  15763. * @see _.flow
  15764. * @example
  15765. *
  15766. * function square(n) {
  15767. * return n * n;
  15768. * }
  15769. *
  15770. * var addSquare = _.flowRight([square, _.add]);
  15771. * addSquare(1, 2);
  15772. * // => 9
  15773. */
  15774. var flowRight = createFlow(true);
  15775. /**
  15776. * This method returns the first argument it receives.
  15777. *
  15778. * @static
  15779. * @since 0.1.0
  15780. * @memberOf _
  15781. * @category Util
  15782. * @param {*} value Any value.
  15783. * @returns {*} Returns `value`.
  15784. * @example
  15785. *
  15786. * var object = { 'a': 1 };
  15787. *
  15788. * console.log(_.identity(object) === object);
  15789. * // => true
  15790. */
  15791. function identity(value) {
  15792. return value;
  15793. }
  15794. /**
  15795. * Creates a function that invokes `func` with the arguments of the created
  15796. * function. If `func` is a property name, the created function returns the
  15797. * property value for a given element. If `func` is an array or object, the
  15798. * created function returns `true` for elements that contain the equivalent
  15799. * source properties, otherwise it returns `false`.
  15800. *
  15801. * @static
  15802. * @since 4.0.0
  15803. * @memberOf _
  15804. * @category Util
  15805. * @param {*} [func=_.identity] The value to convert to a callback.
  15806. * @returns {Function} Returns the callback.
  15807. * @example
  15808. *
  15809. * var users = [
  15810. * { 'user': 'barney', 'age': 36, 'active': true },
  15811. * { 'user': 'fred', 'age': 40, 'active': false }
  15812. * ];
  15813. *
  15814. * // The `_.matches` iteratee shorthand.
  15815. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15816. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15817. *
  15818. * // The `_.matchesProperty` iteratee shorthand.
  15819. * _.filter(users, _.iteratee(['user', 'fred']));
  15820. * // => [{ 'user': 'fred', 'age': 40 }]
  15821. *
  15822. * // The `_.property` iteratee shorthand.
  15823. * _.map(users, _.iteratee('user'));
  15824. * // => ['barney', 'fred']
  15825. *
  15826. * // Create custom iteratee shorthands.
  15827. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15828. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15829. * return func.test(string);
  15830. * };
  15831. * });
  15832. *
  15833. * _.filter(['abc', 'def'], /ef/);
  15834. * // => ['def']
  15835. */
  15836. function iteratee(func) {
  15837. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15838. }
  15839. /**
  15840. * Creates a function that performs a partial deep comparison between a given
  15841. * object and `source`, returning `true` if the given object has equivalent
  15842. * property values, else `false`.
  15843. *
  15844. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15845. * partially applied.
  15846. *
  15847. * Partial comparisons will match empty array and empty object `source`
  15848. * values against any array or object value, respectively. See `_.isEqual`
  15849. * for a list of supported value comparisons.
  15850. *
  15851. * **Note:** Multiple values can be checked by combining several matchers
  15852. * using `_.overSome`
  15853. *
  15854. * @static
  15855. * @memberOf _
  15856. * @since 3.0.0
  15857. * @category Util
  15858. * @param {Object} source The object of property values to match.
  15859. * @returns {Function} Returns the new spec function.
  15860. * @example
  15861. *
  15862. * var objects = [
  15863. * { 'a': 1, 'b': 2, 'c': 3 },
  15864. * { 'a': 4, 'b': 5, 'c': 6 }
  15865. * ];
  15866. *
  15867. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15868. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15869. *
  15870. * // Checking for several possible values
  15871. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15872. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15873. */
  15874. function matches(source) {
  15875. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15876. }
  15877. /**
  15878. * Creates a function that performs a partial deep comparison between the
  15879. * value at `path` of a given object to `srcValue`, returning `true` if the
  15880. * object value is equivalent, else `false`.
  15881. *
  15882. * **Note:** Partial comparisons will match empty array and empty object
  15883. * `srcValue` values against any array or object value, respectively. See
  15884. * `_.isEqual` for a list of supported value comparisons.
  15885. *
  15886. * **Note:** Multiple values can be checked by combining several matchers
  15887. * using `_.overSome`
  15888. *
  15889. * @static
  15890. * @memberOf _
  15891. * @since 3.2.0
  15892. * @category Util
  15893. * @param {Array|string} path The path of the property to get.
  15894. * @param {*} srcValue The value to match.
  15895. * @returns {Function} Returns the new spec function.
  15896. * @example
  15897. *
  15898. * var objects = [
  15899. * { 'a': 1, 'b': 2, 'c': 3 },
  15900. * { 'a': 4, 'b': 5, 'c': 6 }
  15901. * ];
  15902. *
  15903. * _.find(objects, _.matchesProperty('a', 4));
  15904. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15905. *
  15906. * // Checking for several possible values
  15907. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15908. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15909. */
  15910. function matchesProperty(path, srcValue) {
  15911. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15912. }
  15913. /**
  15914. * Creates a function that invokes the method at `path` of a given object.
  15915. * Any additional arguments are provided to the invoked method.
  15916. *
  15917. * @static
  15918. * @memberOf _
  15919. * @since 3.7.0
  15920. * @category Util
  15921. * @param {Array|string} path The path of the method to invoke.
  15922. * @param {...*} [args] The arguments to invoke the method with.
  15923. * @returns {Function} Returns the new invoker function.
  15924. * @example
  15925. *
  15926. * var objects = [
  15927. * { 'a': { 'b': _.constant(2) } },
  15928. * { 'a': { 'b': _.constant(1) } }
  15929. * ];
  15930. *
  15931. * _.map(objects, _.method('a.b'));
  15932. * // => [2, 1]
  15933. *
  15934. * _.map(objects, _.method(['a', 'b']));
  15935. * // => [2, 1]
  15936. */
  15937. var method = baseRest(function(path, args) {
  15938. return function(object) {
  15939. return baseInvoke(object, path, args);
  15940. };
  15941. });
  15942. /**
  15943. * The opposite of `_.method`; this method creates a function that invokes
  15944. * the method at a given path of `object`. Any additional arguments are
  15945. * provided to the invoked method.
  15946. *
  15947. * @static
  15948. * @memberOf _
  15949. * @since 3.7.0
  15950. * @category Util
  15951. * @param {Object} object The object to query.
  15952. * @param {...*} [args] The arguments to invoke the method with.
  15953. * @returns {Function} Returns the new invoker function.
  15954. * @example
  15955. *
  15956. * var array = _.times(3, _.constant),
  15957. * object = { 'a': array, 'b': array, 'c': array };
  15958. *
  15959. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15960. * // => [2, 0]
  15961. *
  15962. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15963. * // => [2, 0]
  15964. */
  15965. var methodOf = baseRest(function(object, args) {
  15966. return function(path) {
  15967. return baseInvoke(object, path, args);
  15968. };
  15969. });
  15970. /**
  15971. * Adds all own enumerable string keyed function properties of a source
  15972. * object to the destination object. If `object` is a function, then methods
  15973. * are added to its prototype as well.
  15974. *
  15975. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15976. * avoid conflicts caused by modifying the original.
  15977. *
  15978. * @static
  15979. * @since 0.1.0
  15980. * @memberOf _
  15981. * @category Util
  15982. * @param {Function|Object} [object=lodash] The destination object.
  15983. * @param {Object} source The object of functions to add.
  15984. * @param {Object} [options={}] The options object.
  15985. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15986. * @returns {Function|Object} Returns `object`.
  15987. * @example
  15988. *
  15989. * function vowels(string) {
  15990. * return _.filter(string, function(v) {
  15991. * return /[aeiou]/i.test(v);
  15992. * });
  15993. * }
  15994. *
  15995. * _.mixin({ 'vowels': vowels });
  15996. * _.vowels('fred');
  15997. * // => ['e']
  15998. *
  15999. * _('fred').vowels().value();
  16000. * // => ['e']
  16001. *
  16002. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16003. * _('fred').vowels();
  16004. * // => ['e']
  16005. */
  16006. function mixin(object, source, options) {
  16007. var props = keys(source),
  16008. methodNames = baseFunctions(source, props);
  16009. if (options == null &&
  16010. !(isObject(source) && (methodNames.length || !props.length))) {
  16011. options = source;
  16012. source = object;
  16013. object = this;
  16014. methodNames = baseFunctions(source, keys(source));
  16015. }
  16016. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16017. isFunc = isFunction(object);
  16018. arrayEach(methodNames, function(methodName) {
  16019. var func = source[methodName];
  16020. object[methodName] = func;
  16021. if (isFunc) {
  16022. object.prototype[methodName] = function() {
  16023. var chainAll = this.__chain__;
  16024. if (chain || chainAll) {
  16025. var result = object(this.__wrapped__),
  16026. actions = result.__actions__ = copyArray(this.__actions__);
  16027. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16028. result.__chain__ = chainAll;
  16029. return result;
  16030. }
  16031. return func.apply(object, arrayPush([this.value()], arguments));
  16032. };
  16033. }
  16034. });
  16035. return object;
  16036. }
  16037. /**
  16038. * Reverts the `_` variable to its previous value and returns a reference to
  16039. * the `lodash` function.
  16040. *
  16041. * @static
  16042. * @since 0.1.0
  16043. * @memberOf _
  16044. * @category Util
  16045. * @returns {Function} Returns the `lodash` function.
  16046. * @example
  16047. *
  16048. * var lodash = _.noConflict();
  16049. */
  16050. function noConflict() {
  16051. if (root._ === this) {
  16052. root._ = oldDash;
  16053. }
  16054. return this;
  16055. }
  16056. /**
  16057. * This method returns `undefined`.
  16058. *
  16059. * @static
  16060. * @memberOf _
  16061. * @since 2.3.0
  16062. * @category Util
  16063. * @example
  16064. *
  16065. * _.times(2, _.noop);
  16066. * // => [undefined, undefined]
  16067. */
  16068. function noop() {
  16069. // No operation performed.
  16070. }
  16071. /**
  16072. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16073. * the nth argument from the end is returned.
  16074. *
  16075. * @static
  16076. * @memberOf _
  16077. * @since 4.0.0
  16078. * @category Util
  16079. * @param {number} [n=0] The index of the argument to return.
  16080. * @returns {Function} Returns the new pass-thru function.
  16081. * @example
  16082. *
  16083. * var func = _.nthArg(1);
  16084. * func('a', 'b', 'c', 'd');
  16085. * // => 'b'
  16086. *
  16087. * var func = _.nthArg(-2);
  16088. * func('a', 'b', 'c', 'd');
  16089. * // => 'c'
  16090. */
  16091. function nthArg(n) {
  16092. n = toInteger(n);
  16093. return baseRest(function(args) {
  16094. return baseNth(args, n);
  16095. });
  16096. }
  16097. /**
  16098. * Creates a function that invokes `iteratees` with the arguments it receives
  16099. * and returns their results.
  16100. *
  16101. * @static
  16102. * @memberOf _
  16103. * @since 4.0.0
  16104. * @category Util
  16105. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16106. * The iteratees to invoke.
  16107. * @returns {Function} Returns the new function.
  16108. * @example
  16109. *
  16110. * var func = _.over([Math.max, Math.min]);
  16111. *
  16112. * func(1, 2, 3, 4);
  16113. * // => [4, 1]
  16114. */
  16115. var over = createOver(arrayMap);
  16116. /**
  16117. * Creates a function that checks if **all** of the `predicates` return
  16118. * truthy when invoked with the arguments it receives.
  16119. *
  16120. * Following shorthands are possible for providing predicates.
  16121. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16122. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16123. *
  16124. * @static
  16125. * @memberOf _
  16126. * @since 4.0.0
  16127. * @category Util
  16128. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16129. * The predicates to check.
  16130. * @returns {Function} Returns the new function.
  16131. * @example
  16132. *
  16133. * var func = _.overEvery([Boolean, isFinite]);
  16134. *
  16135. * func('1');
  16136. * // => true
  16137. *
  16138. * func(null);
  16139. * // => false
  16140. *
  16141. * func(NaN);
  16142. * // => false
  16143. */
  16144. var overEvery = createOver(arrayEvery);
  16145. /**
  16146. * Creates a function that checks if **any** of the `predicates` return
  16147. * truthy when invoked with the arguments it receives.
  16148. *
  16149. * Following shorthands are possible for providing predicates.
  16150. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16151. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16152. *
  16153. * @static
  16154. * @memberOf _
  16155. * @since 4.0.0
  16156. * @category Util
  16157. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16158. * The predicates to check.
  16159. * @returns {Function} Returns the new function.
  16160. * @example
  16161. *
  16162. * var func = _.overSome([Boolean, isFinite]);
  16163. *
  16164. * func('1');
  16165. * // => true
  16166. *
  16167. * func(null);
  16168. * // => true
  16169. *
  16170. * func(NaN);
  16171. * // => false
  16172. *
  16173. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16174. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16175. */
  16176. var overSome = createOver(arraySome);
  16177. /**
  16178. * Creates a function that returns the value at `path` of a given object.
  16179. *
  16180. * @static
  16181. * @memberOf _
  16182. * @since 2.4.0
  16183. * @category Util
  16184. * @param {Array|string} path The path of the property to get.
  16185. * @returns {Function} Returns the new accessor function.
  16186. * @example
  16187. *
  16188. * var objects = [
  16189. * { 'a': { 'b': 2 } },
  16190. * { 'a': { 'b': 1 } }
  16191. * ];
  16192. *
  16193. * _.map(objects, _.property('a.b'));
  16194. * // => [2, 1]
  16195. *
  16196. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16197. * // => [1, 2]
  16198. */
  16199. function property(path) {
  16200. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16201. }
  16202. /**
  16203. * The opposite of `_.property`; this method creates a function that returns
  16204. * the value at a given path of `object`.
  16205. *
  16206. * @static
  16207. * @memberOf _
  16208. * @since 3.0.0
  16209. * @category Util
  16210. * @param {Object} object The object to query.
  16211. * @returns {Function} Returns the new accessor function.
  16212. * @example
  16213. *
  16214. * var array = [0, 1, 2],
  16215. * object = { 'a': array, 'b': array, 'c': array };
  16216. *
  16217. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16218. * // => [2, 0]
  16219. *
  16220. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16221. * // => [2, 0]
  16222. */
  16223. function propertyOf(object) {
  16224. return function(path) {
  16225. return object == null ? undefined : baseGet(object, path);
  16226. };
  16227. }
  16228. /**
  16229. * Creates an array of numbers (positive and/or negative) progressing from
  16230. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16231. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16232. * it's set to `start` with `start` then set to `0`.
  16233. *
  16234. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16235. * floating-point values which can produce unexpected results.
  16236. *
  16237. * @static
  16238. * @since 0.1.0
  16239. * @memberOf _
  16240. * @category Util
  16241. * @param {number} [start=0] The start of the range.
  16242. * @param {number} end The end of the range.
  16243. * @param {number} [step=1] The value to increment or decrement by.
  16244. * @returns {Array} Returns the range of numbers.
  16245. * @see _.inRange, _.rangeRight
  16246. * @example
  16247. *
  16248. * _.range(4);
  16249. * // => [0, 1, 2, 3]
  16250. *
  16251. * _.range(-4);
  16252. * // => [0, -1, -2, -3]
  16253. *
  16254. * _.range(1, 5);
  16255. * // => [1, 2, 3, 4]
  16256. *
  16257. * _.range(0, 20, 5);
  16258. * // => [0, 5, 10, 15]
  16259. *
  16260. * _.range(0, -4, -1);
  16261. * // => [0, -1, -2, -3]
  16262. *
  16263. * _.range(1, 4, 0);
  16264. * // => [1, 1, 1]
  16265. *
  16266. * _.range(0);
  16267. * // => []
  16268. */
  16269. var range = createRange();
  16270. /**
  16271. * This method is like `_.range` except that it populates values in
  16272. * descending order.
  16273. *
  16274. * @static
  16275. * @memberOf _
  16276. * @since 4.0.0
  16277. * @category Util
  16278. * @param {number} [start=0] The start of the range.
  16279. * @param {number} end The end of the range.
  16280. * @param {number} [step=1] The value to increment or decrement by.
  16281. * @returns {Array} Returns the range of numbers.
  16282. * @see _.inRange, _.range
  16283. * @example
  16284. *
  16285. * _.rangeRight(4);
  16286. * // => [3, 2, 1, 0]
  16287. *
  16288. * _.rangeRight(-4);
  16289. * // => [-3, -2, -1, 0]
  16290. *
  16291. * _.rangeRight(1, 5);
  16292. * // => [4, 3, 2, 1]
  16293. *
  16294. * _.rangeRight(0, 20, 5);
  16295. * // => [15, 10, 5, 0]
  16296. *
  16297. * _.rangeRight(0, -4, -1);
  16298. * // => [-3, -2, -1, 0]
  16299. *
  16300. * _.rangeRight(1, 4, 0);
  16301. * // => [1, 1, 1]
  16302. *
  16303. * _.rangeRight(0);
  16304. * // => []
  16305. */
  16306. var rangeRight = createRange(true);
  16307. /**
  16308. * This method returns a new empty array.
  16309. *
  16310. * @static
  16311. * @memberOf _
  16312. * @since 4.13.0
  16313. * @category Util
  16314. * @returns {Array} Returns the new empty array.
  16315. * @example
  16316. *
  16317. * var arrays = _.times(2, _.stubArray);
  16318. *
  16319. * console.log(arrays);
  16320. * // => [[], []]
  16321. *
  16322. * console.log(arrays[0] === arrays[1]);
  16323. * // => false
  16324. */
  16325. function stubArray() {
  16326. return [];
  16327. }
  16328. /**
  16329. * This method returns `false`.
  16330. *
  16331. * @static
  16332. * @memberOf _
  16333. * @since 4.13.0
  16334. * @category Util
  16335. * @returns {boolean} Returns `false`.
  16336. * @example
  16337. *
  16338. * _.times(2, _.stubFalse);
  16339. * // => [false, false]
  16340. */
  16341. function stubFalse() {
  16342. return false;
  16343. }
  16344. /**
  16345. * This method returns a new empty object.
  16346. *
  16347. * @static
  16348. * @memberOf _
  16349. * @since 4.13.0
  16350. * @category Util
  16351. * @returns {Object} Returns the new empty object.
  16352. * @example
  16353. *
  16354. * var objects = _.times(2, _.stubObject);
  16355. *
  16356. * console.log(objects);
  16357. * // => [{}, {}]
  16358. *
  16359. * console.log(objects[0] === objects[1]);
  16360. * // => false
  16361. */
  16362. function stubObject() {
  16363. return {};
  16364. }
  16365. /**
  16366. * This method returns an empty string.
  16367. *
  16368. * @static
  16369. * @memberOf _
  16370. * @since 4.13.0
  16371. * @category Util
  16372. * @returns {string} Returns the empty string.
  16373. * @example
  16374. *
  16375. * _.times(2, _.stubString);
  16376. * // => ['', '']
  16377. */
  16378. function stubString() {
  16379. return '';
  16380. }
  16381. /**
  16382. * This method returns `true`.
  16383. *
  16384. * @static
  16385. * @memberOf _
  16386. * @since 4.13.0
  16387. * @category Util
  16388. * @returns {boolean} Returns `true`.
  16389. * @example
  16390. *
  16391. * _.times(2, _.stubTrue);
  16392. * // => [true, true]
  16393. */
  16394. function stubTrue() {
  16395. return true;
  16396. }
  16397. /**
  16398. * Invokes the iteratee `n` times, returning an array of the results of
  16399. * each invocation. The iteratee is invoked with one argument; (index).
  16400. *
  16401. * @static
  16402. * @since 0.1.0
  16403. * @memberOf _
  16404. * @category Util
  16405. * @param {number} n The number of times to invoke `iteratee`.
  16406. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16407. * @returns {Array} Returns the array of results.
  16408. * @example
  16409. *
  16410. * _.times(3, String);
  16411. * // => ['0', '1', '2']
  16412. *
  16413. * _.times(4, _.constant(0));
  16414. * // => [0, 0, 0, 0]
  16415. */
  16416. function times(n, iteratee) {
  16417. n = toInteger(n);
  16418. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16419. return [];
  16420. }
  16421. var index = MAX_ARRAY_LENGTH,
  16422. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16423. iteratee = getIteratee(iteratee);
  16424. n -= MAX_ARRAY_LENGTH;
  16425. var result = baseTimes(length, iteratee);
  16426. while (++index < n) {
  16427. iteratee(index);
  16428. }
  16429. return result;
  16430. }
  16431. /**
  16432. * Converts `value` to a property path array.
  16433. *
  16434. * @static
  16435. * @memberOf _
  16436. * @since 4.0.0
  16437. * @category Util
  16438. * @param {*} value The value to convert.
  16439. * @returns {Array} Returns the new property path array.
  16440. * @example
  16441. *
  16442. * _.toPath('a.b.c');
  16443. * // => ['a', 'b', 'c']
  16444. *
  16445. * _.toPath('a[0].b.c');
  16446. * // => ['a', '0', 'b', 'c']
  16447. */
  16448. function toPath(value) {
  16449. if (isArray(value)) {
  16450. return arrayMap(value, toKey);
  16451. }
  16452. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16453. }
  16454. /**
  16455. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16456. *
  16457. * @static
  16458. * @since 0.1.0
  16459. * @memberOf _
  16460. * @category Util
  16461. * @param {string} [prefix=''] The value to prefix the ID with.
  16462. * @returns {string} Returns the unique ID.
  16463. * @example
  16464. *
  16465. * _.uniqueId('contact_');
  16466. * // => 'contact_104'
  16467. *
  16468. * _.uniqueId();
  16469. * // => '105'
  16470. */
  16471. function uniqueId(prefix) {
  16472. var id = ++idCounter;
  16473. return toString(prefix) + id;
  16474. }
  16475. /*------------------------------------------------------------------------*/
  16476. /**
  16477. * Adds two numbers.
  16478. *
  16479. * @static
  16480. * @memberOf _
  16481. * @since 3.4.0
  16482. * @category Math
  16483. * @param {number} augend The first number in an addition.
  16484. * @param {number} addend The second number in an addition.
  16485. * @returns {number} Returns the total.
  16486. * @example
  16487. *
  16488. * _.add(6, 4);
  16489. * // => 10
  16490. */
  16491. var add = createMathOperation(function(augend, addend) {
  16492. return augend + addend;
  16493. }, 0);
  16494. /**
  16495. * Computes `number` rounded up to `precision`.
  16496. *
  16497. * @static
  16498. * @memberOf _
  16499. * @since 3.10.0
  16500. * @category Math
  16501. * @param {number} number The number to round up.
  16502. * @param {number} [precision=0] The precision to round up to.
  16503. * @returns {number} Returns the rounded up number.
  16504. * @example
  16505. *
  16506. * _.ceil(4.006);
  16507. * // => 5
  16508. *
  16509. * _.ceil(6.004, 2);
  16510. * // => 6.01
  16511. *
  16512. * _.ceil(6040, -2);
  16513. * // => 6100
  16514. */
  16515. var ceil = createRound('ceil');
  16516. /**
  16517. * Divide two numbers.
  16518. *
  16519. * @static
  16520. * @memberOf _
  16521. * @since 4.7.0
  16522. * @category Math
  16523. * @param {number} dividend The first number in a division.
  16524. * @param {number} divisor The second number in a division.
  16525. * @returns {number} Returns the quotient.
  16526. * @example
  16527. *
  16528. * _.divide(6, 4);
  16529. * // => 1.5
  16530. */
  16531. var divide = createMathOperation(function(dividend, divisor) {
  16532. return dividend / divisor;
  16533. }, 1);
  16534. /**
  16535. * Computes `number` rounded down to `precision`.
  16536. *
  16537. * @static
  16538. * @memberOf _
  16539. * @since 3.10.0
  16540. * @category Math
  16541. * @param {number} number The number to round down.
  16542. * @param {number} [precision=0] The precision to round down to.
  16543. * @returns {number} Returns the rounded down number.
  16544. * @example
  16545. *
  16546. * _.floor(4.006);
  16547. * // => 4
  16548. *
  16549. * _.floor(0.046, 2);
  16550. * // => 0.04
  16551. *
  16552. * _.floor(4060, -2);
  16553. * // => 4000
  16554. */
  16555. var floor = createRound('floor');
  16556. /**
  16557. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16558. * `undefined` is returned.
  16559. *
  16560. * @static
  16561. * @since 0.1.0
  16562. * @memberOf _
  16563. * @category Math
  16564. * @param {Array} array The array to iterate over.
  16565. * @returns {*} Returns the maximum value.
  16566. * @example
  16567. *
  16568. * _.max([4, 2, 8, 6]);
  16569. * // => 8
  16570. *
  16571. * _.max([]);
  16572. * // => undefined
  16573. */
  16574. function max(array) {
  16575. return (array && array.length)
  16576. ? baseExtremum(array, identity, baseGt)
  16577. : undefined;
  16578. }
  16579. /**
  16580. * This method is like `_.max` except that it accepts `iteratee` which is
  16581. * invoked for each element in `array` to generate the criterion by which
  16582. * the value is ranked. The iteratee is invoked with one argument: (value).
  16583. *
  16584. * @static
  16585. * @memberOf _
  16586. * @since 4.0.0
  16587. * @category Math
  16588. * @param {Array} array The array to iterate over.
  16589. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16590. * @returns {*} Returns the maximum value.
  16591. * @example
  16592. *
  16593. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16594. *
  16595. * _.maxBy(objects, function(o) { return o.n; });
  16596. * // => { 'n': 2 }
  16597. *
  16598. * // The `_.property` iteratee shorthand.
  16599. * _.maxBy(objects, 'n');
  16600. * // => { 'n': 2 }
  16601. */
  16602. function maxBy(array, iteratee) {
  16603. return (array && array.length)
  16604. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16605. : undefined;
  16606. }
  16607. /**
  16608. * Computes the mean of the values in `array`.
  16609. *
  16610. * @static
  16611. * @memberOf _
  16612. * @since 4.0.0
  16613. * @category Math
  16614. * @param {Array} array The array to iterate over.
  16615. * @returns {number} Returns the mean.
  16616. * @example
  16617. *
  16618. * _.mean([4, 2, 8, 6]);
  16619. * // => 5
  16620. */
  16621. function mean(array) {
  16622. return baseMean(array, identity);
  16623. }
  16624. /**
  16625. * This method is like `_.mean` except that it accepts `iteratee` which is
  16626. * invoked for each element in `array` to generate the value to be averaged.
  16627. * The iteratee is invoked with one argument: (value).
  16628. *
  16629. * @static
  16630. * @memberOf _
  16631. * @since 4.7.0
  16632. * @category Math
  16633. * @param {Array} array The array to iterate over.
  16634. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16635. * @returns {number} Returns the mean.
  16636. * @example
  16637. *
  16638. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16639. *
  16640. * _.meanBy(objects, function(o) { return o.n; });
  16641. * // => 5
  16642. *
  16643. * // The `_.property` iteratee shorthand.
  16644. * _.meanBy(objects, 'n');
  16645. * // => 5
  16646. */
  16647. function meanBy(array, iteratee) {
  16648. return baseMean(array, getIteratee(iteratee, 2));
  16649. }
  16650. /**
  16651. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16652. * `undefined` is returned.
  16653. *
  16654. * @static
  16655. * @since 0.1.0
  16656. * @memberOf _
  16657. * @category Math
  16658. * @param {Array} array The array to iterate over.
  16659. * @returns {*} Returns the minimum value.
  16660. * @example
  16661. *
  16662. * _.min([4, 2, 8, 6]);
  16663. * // => 2
  16664. *
  16665. * _.min([]);
  16666. * // => undefined
  16667. */
  16668. function min(array) {
  16669. return (array && array.length)
  16670. ? baseExtremum(array, identity, baseLt)
  16671. : undefined;
  16672. }
  16673. /**
  16674. * This method is like `_.min` except that it accepts `iteratee` which is
  16675. * invoked for each element in `array` to generate the criterion by which
  16676. * the value is ranked. The iteratee is invoked with one argument: (value).
  16677. *
  16678. * @static
  16679. * @memberOf _
  16680. * @since 4.0.0
  16681. * @category Math
  16682. * @param {Array} array The array to iterate over.
  16683. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16684. * @returns {*} Returns the minimum value.
  16685. * @example
  16686. *
  16687. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16688. *
  16689. * _.minBy(objects, function(o) { return o.n; });
  16690. * // => { 'n': 1 }
  16691. *
  16692. * // The `_.property` iteratee shorthand.
  16693. * _.minBy(objects, 'n');
  16694. * // => { 'n': 1 }
  16695. */
  16696. function minBy(array, iteratee) {
  16697. return (array && array.length)
  16698. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16699. : undefined;
  16700. }
  16701. /**
  16702. * Multiply two numbers.
  16703. *
  16704. * @static
  16705. * @memberOf _
  16706. * @since 4.7.0
  16707. * @category Math
  16708. * @param {number} multiplier The first number in a multiplication.
  16709. * @param {number} multiplicand The second number in a multiplication.
  16710. * @returns {number} Returns the product.
  16711. * @example
  16712. *
  16713. * _.multiply(6, 4);
  16714. * // => 24
  16715. */
  16716. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16717. return multiplier * multiplicand;
  16718. }, 1);
  16719. /**
  16720. * Computes `number` rounded to `precision`.
  16721. *
  16722. * @static
  16723. * @memberOf _
  16724. * @since 3.10.0
  16725. * @category Math
  16726. * @param {number} number The number to round.
  16727. * @param {number} [precision=0] The precision to round to.
  16728. * @returns {number} Returns the rounded number.
  16729. * @example
  16730. *
  16731. * _.round(4.006);
  16732. * // => 4
  16733. *
  16734. * _.round(4.006, 2);
  16735. * // => 4.01
  16736. *
  16737. * _.round(4060, -2);
  16738. * // => 4100
  16739. */
  16740. var round = createRound('round');
  16741. /**
  16742. * Subtract two numbers.
  16743. *
  16744. * @static
  16745. * @memberOf _
  16746. * @since 4.0.0
  16747. * @category Math
  16748. * @param {number} minuend The first number in a subtraction.
  16749. * @param {number} subtrahend The second number in a subtraction.
  16750. * @returns {number} Returns the difference.
  16751. * @example
  16752. *
  16753. * _.subtract(6, 4);
  16754. * // => 2
  16755. */
  16756. var subtract = createMathOperation(function(minuend, subtrahend) {
  16757. return minuend - subtrahend;
  16758. }, 0);
  16759. /**
  16760. * Computes the sum of the values in `array`.
  16761. *
  16762. * @static
  16763. * @memberOf _
  16764. * @since 3.4.0
  16765. * @category Math
  16766. * @param {Array} array The array to iterate over.
  16767. * @returns {number} Returns the sum.
  16768. * @example
  16769. *
  16770. * _.sum([4, 2, 8, 6]);
  16771. * // => 20
  16772. */
  16773. function sum(array) {
  16774. return (array && array.length)
  16775. ? baseSum(array, identity)
  16776. : 0;
  16777. }
  16778. /**
  16779. * This method is like `_.sum` except that it accepts `iteratee` which is
  16780. * invoked for each element in `array` to generate the value to be summed.
  16781. * The iteratee is invoked with one argument: (value).
  16782. *
  16783. * @static
  16784. * @memberOf _
  16785. * @since 4.0.0
  16786. * @category Math
  16787. * @param {Array} array The array to iterate over.
  16788. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16789. * @returns {number} Returns the sum.
  16790. * @example
  16791. *
  16792. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16793. *
  16794. * _.sumBy(objects, function(o) { return o.n; });
  16795. * // => 20
  16796. *
  16797. * // The `_.property` iteratee shorthand.
  16798. * _.sumBy(objects, 'n');
  16799. * // => 20
  16800. */
  16801. function sumBy(array, iteratee) {
  16802. return (array && array.length)
  16803. ? baseSum(array, getIteratee(iteratee, 2))
  16804. : 0;
  16805. }
  16806. /*------------------------------------------------------------------------*/
  16807. // Add methods that return wrapped values in chain sequences.
  16808. lodash.after = after;
  16809. lodash.ary = ary;
  16810. lodash.assign = assign;
  16811. lodash.assignIn = assignIn;
  16812. lodash.assignInWith = assignInWith;
  16813. lodash.assignWith = assignWith;
  16814. lodash.at = at;
  16815. lodash.before = before;
  16816. lodash.bind = bind;
  16817. lodash.bindAll = bindAll;
  16818. lodash.bindKey = bindKey;
  16819. lodash.castArray = castArray;
  16820. lodash.chain = chain;
  16821. lodash.chunk = chunk;
  16822. lodash.compact = compact;
  16823. lodash.concat = concat;
  16824. lodash.cond = cond;
  16825. lodash.conforms = conforms;
  16826. lodash.constant = constant;
  16827. lodash.countBy = countBy;
  16828. lodash.create = create;
  16829. lodash.curry = curry;
  16830. lodash.curryRight = curryRight;
  16831. lodash.debounce = debounce;
  16832. lodash.defaults = defaults;
  16833. lodash.defaultsDeep = defaultsDeep;
  16834. lodash.defer = defer;
  16835. lodash.delay = delay;
  16836. lodash.difference = difference;
  16837. lodash.differenceBy = differenceBy;
  16838. lodash.differenceWith = differenceWith;
  16839. lodash.drop = drop;
  16840. lodash.dropRight = dropRight;
  16841. lodash.dropRightWhile = dropRightWhile;
  16842. lodash.dropWhile = dropWhile;
  16843. lodash.fill = fill;
  16844. lodash.filter = filter;
  16845. lodash.flatMap = flatMap;
  16846. lodash.flatMapDeep = flatMapDeep;
  16847. lodash.flatMapDepth = flatMapDepth;
  16848. lodash.flatten = flatten;
  16849. lodash.flattenDeep = flattenDeep;
  16850. lodash.flattenDepth = flattenDepth;
  16851. lodash.flip = flip;
  16852. lodash.flow = flow;
  16853. lodash.flowRight = flowRight;
  16854. lodash.fromPairs = fromPairs;
  16855. lodash.functions = functions;
  16856. lodash.functionsIn = functionsIn;
  16857. lodash.groupBy = groupBy;
  16858. lodash.initial = initial;
  16859. lodash.intersection = intersection;
  16860. lodash.intersectionBy = intersectionBy;
  16861. lodash.intersectionWith = intersectionWith;
  16862. lodash.invert = invert;
  16863. lodash.invertBy = invertBy;
  16864. lodash.invokeMap = invokeMap;
  16865. lodash.iteratee = iteratee;
  16866. lodash.keyBy = keyBy;
  16867. lodash.keys = keys;
  16868. lodash.keysIn = keysIn;
  16869. lodash.map = map;
  16870. lodash.mapKeys = mapKeys;
  16871. lodash.mapValues = mapValues;
  16872. lodash.matches = matches;
  16873. lodash.matchesProperty = matchesProperty;
  16874. lodash.memoize = memoize;
  16875. lodash.merge = merge;
  16876. lodash.mergeWith = mergeWith;
  16877. lodash.method = method;
  16878. lodash.methodOf = methodOf;
  16879. lodash.mixin = mixin;
  16880. lodash.negate = negate;
  16881. lodash.nthArg = nthArg;
  16882. lodash.omit = omit;
  16883. lodash.omitBy = omitBy;
  16884. lodash.once = once;
  16885. lodash.orderBy = orderBy;
  16886. lodash.over = over;
  16887. lodash.overArgs = overArgs;
  16888. lodash.overEvery = overEvery;
  16889. lodash.overSome = overSome;
  16890. lodash.partial = partial;
  16891. lodash.partialRight = partialRight;
  16892. lodash.partition = partition;
  16893. lodash.pick = pick;
  16894. lodash.pickBy = pickBy;
  16895. lodash.property = property;
  16896. lodash.propertyOf = propertyOf;
  16897. lodash.pull = pull;
  16898. lodash.pullAll = pullAll;
  16899. lodash.pullAllBy = pullAllBy;
  16900. lodash.pullAllWith = pullAllWith;
  16901. lodash.pullAt = pullAt;
  16902. lodash.range = range;
  16903. lodash.rangeRight = rangeRight;
  16904. lodash.rearg = rearg;
  16905. lodash.reject = reject;
  16906. lodash.remove = remove;
  16907. lodash.rest = rest;
  16908. lodash.reverse = reverse;
  16909. lodash.sampleSize = sampleSize;
  16910. lodash.set = set;
  16911. lodash.setWith = setWith;
  16912. lodash.shuffle = shuffle;
  16913. lodash.slice = slice;
  16914. lodash.sortBy = sortBy;
  16915. lodash.sortedUniq = sortedUniq;
  16916. lodash.sortedUniqBy = sortedUniqBy;
  16917. lodash.split = split;
  16918. lodash.spread = spread;
  16919. lodash.tail = tail;
  16920. lodash.take = take;
  16921. lodash.takeRight = takeRight;
  16922. lodash.takeRightWhile = takeRightWhile;
  16923. lodash.takeWhile = takeWhile;
  16924. lodash.tap = tap;
  16925. lodash.throttle = throttle;
  16926. lodash.thru = thru;
  16927. lodash.toArray = toArray;
  16928. lodash.toPairs = toPairs;
  16929. lodash.toPairsIn = toPairsIn;
  16930. lodash.toPath = toPath;
  16931. lodash.toPlainObject = toPlainObject;
  16932. lodash.transform = transform;
  16933. lodash.unary = unary;
  16934. lodash.union = union;
  16935. lodash.unionBy = unionBy;
  16936. lodash.unionWith = unionWith;
  16937. lodash.uniq = uniq;
  16938. lodash.uniqBy = uniqBy;
  16939. lodash.uniqWith = uniqWith;
  16940. lodash.unset = unset;
  16941. lodash.unzip = unzip;
  16942. lodash.unzipWith = unzipWith;
  16943. lodash.update = update;
  16944. lodash.updateWith = updateWith;
  16945. lodash.values = values;
  16946. lodash.valuesIn = valuesIn;
  16947. lodash.without = without;
  16948. lodash.words = words;
  16949. lodash.wrap = wrap;
  16950. lodash.xor = xor;
  16951. lodash.xorBy = xorBy;
  16952. lodash.xorWith = xorWith;
  16953. lodash.zip = zip;
  16954. lodash.zipObject = zipObject;
  16955. lodash.zipObjectDeep = zipObjectDeep;
  16956. lodash.zipWith = zipWith;
  16957. // Add aliases.
  16958. lodash.entries = toPairs;
  16959. lodash.entriesIn = toPairsIn;
  16960. lodash.extend = assignIn;
  16961. lodash.extendWith = assignInWith;
  16962. // Add methods to `lodash.prototype`.
  16963. mixin(lodash, lodash);
  16964. /*------------------------------------------------------------------------*/
  16965. // Add methods that return unwrapped values in chain sequences.
  16966. lodash.add = add;
  16967. lodash.attempt = attempt;
  16968. lodash.camelCase = camelCase;
  16969. lodash.capitalize = capitalize;
  16970. lodash.ceil = ceil;
  16971. lodash.clamp = clamp;
  16972. lodash.clone = clone;
  16973. lodash.cloneDeep = cloneDeep;
  16974. lodash.cloneDeepWith = cloneDeepWith;
  16975. lodash.cloneWith = cloneWith;
  16976. lodash.conformsTo = conformsTo;
  16977. lodash.deburr = deburr;
  16978. lodash.defaultTo = defaultTo;
  16979. lodash.divide = divide;
  16980. lodash.endsWith = endsWith;
  16981. lodash.eq = eq;
  16982. lodash.escape = escape;
  16983. lodash.escapeRegExp = escapeRegExp;
  16984. lodash.every = every;
  16985. lodash.find = find;
  16986. lodash.findIndex = findIndex;
  16987. lodash.findKey = findKey;
  16988. lodash.findLast = findLast;
  16989. lodash.findLastIndex = findLastIndex;
  16990. lodash.findLastKey = findLastKey;
  16991. lodash.floor = floor;
  16992. lodash.forEach = forEach;
  16993. lodash.forEachRight = forEachRight;
  16994. lodash.forIn = forIn;
  16995. lodash.forInRight = forInRight;
  16996. lodash.forOwn = forOwn;
  16997. lodash.forOwnRight = forOwnRight;
  16998. lodash.get = get;
  16999. lodash.gt = gt;
  17000. lodash.gte = gte;
  17001. lodash.has = has;
  17002. lodash.hasIn = hasIn;
  17003. lodash.head = head;
  17004. lodash.identity = identity;
  17005. lodash.includes = includes;
  17006. lodash.indexOf = indexOf;
  17007. lodash.inRange = inRange;
  17008. lodash.invoke = invoke;
  17009. lodash.isArguments = isArguments;
  17010. lodash.isArray = isArray;
  17011. lodash.isArrayBuffer = isArrayBuffer;
  17012. lodash.isArrayLike = isArrayLike;
  17013. lodash.isArrayLikeObject = isArrayLikeObject;
  17014. lodash.isBoolean = isBoolean;
  17015. lodash.isBuffer = isBuffer;
  17016. lodash.isDate = isDate;
  17017. lodash.isElement = isElement;
  17018. lodash.isEmpty = isEmpty;
  17019. lodash.isEqual = isEqual;
  17020. lodash.isEqualWith = isEqualWith;
  17021. lodash.isError = isError;
  17022. lodash.isFinite = isFinite;
  17023. lodash.isFunction = isFunction;
  17024. lodash.isInteger = isInteger;
  17025. lodash.isLength = isLength;
  17026. lodash.isMap = isMap;
  17027. lodash.isMatch = isMatch;
  17028. lodash.isMatchWith = isMatchWith;
  17029. lodash.isNaN = isNaN;
  17030. lodash.isNative = isNative;
  17031. lodash.isNil = isNil;
  17032. lodash.isNull = isNull;
  17033. lodash.isNumber = isNumber;
  17034. lodash.isObject = isObject;
  17035. lodash.isObjectLike = isObjectLike;
  17036. lodash.isPlainObject = isPlainObject;
  17037. lodash.isRegExp = isRegExp;
  17038. lodash.isSafeInteger = isSafeInteger;
  17039. lodash.isSet = isSet;
  17040. lodash.isString = isString;
  17041. lodash.isSymbol = isSymbol;
  17042. lodash.isTypedArray = isTypedArray;
  17043. lodash.isUndefined = isUndefined;
  17044. lodash.isWeakMap = isWeakMap;
  17045. lodash.isWeakSet = isWeakSet;
  17046. lodash.join = join;
  17047. lodash.kebabCase = kebabCase;
  17048. lodash.last = last;
  17049. lodash.lastIndexOf = lastIndexOf;
  17050. lodash.lowerCase = lowerCase;
  17051. lodash.lowerFirst = lowerFirst;
  17052. lodash.lt = lt;
  17053. lodash.lte = lte;
  17054. lodash.max = max;
  17055. lodash.maxBy = maxBy;
  17056. lodash.mean = mean;
  17057. lodash.meanBy = meanBy;
  17058. lodash.min = min;
  17059. lodash.minBy = minBy;
  17060. lodash.stubArray = stubArray;
  17061. lodash.stubFalse = stubFalse;
  17062. lodash.stubObject = stubObject;
  17063. lodash.stubString = stubString;
  17064. lodash.stubTrue = stubTrue;
  17065. lodash.multiply = multiply;
  17066. lodash.nth = nth;
  17067. lodash.noConflict = noConflict;
  17068. lodash.noop = noop;
  17069. lodash.now = now;
  17070. lodash.pad = pad;
  17071. lodash.padEnd = padEnd;
  17072. lodash.padStart = padStart;
  17073. lodash.parseInt = parseInt;
  17074. lodash.random = random;
  17075. lodash.reduce = reduce;
  17076. lodash.reduceRight = reduceRight;
  17077. lodash.repeat = repeat;
  17078. lodash.replace = replace;
  17079. lodash.result = result;
  17080. lodash.round = round;
  17081. lodash.runInContext = runInContext;
  17082. lodash.sample = sample;
  17083. lodash.size = size;
  17084. lodash.snakeCase = snakeCase;
  17085. lodash.some = some;
  17086. lodash.sortedIndex = sortedIndex;
  17087. lodash.sortedIndexBy = sortedIndexBy;
  17088. lodash.sortedIndexOf = sortedIndexOf;
  17089. lodash.sortedLastIndex = sortedLastIndex;
  17090. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17091. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17092. lodash.startCase = startCase;
  17093. lodash.startsWith = startsWith;
  17094. lodash.subtract = subtract;
  17095. lodash.sum = sum;
  17096. lodash.sumBy = sumBy;
  17097. lodash.template = template;
  17098. lodash.times = times;
  17099. lodash.toFinite = toFinite;
  17100. lodash.toInteger = toInteger;
  17101. lodash.toLength = toLength;
  17102. lodash.toLower = toLower;
  17103. lodash.toNumber = toNumber;
  17104. lodash.toSafeInteger = toSafeInteger;
  17105. lodash.toString = toString;
  17106. lodash.toUpper = toUpper;
  17107. lodash.trim = trim;
  17108. lodash.trimEnd = trimEnd;
  17109. lodash.trimStart = trimStart;
  17110. lodash.truncate = truncate;
  17111. lodash.unescape = unescape;
  17112. lodash.uniqueId = uniqueId;
  17113. lodash.upperCase = upperCase;
  17114. lodash.upperFirst = upperFirst;
  17115. // Add aliases.
  17116. lodash.each = forEach;
  17117. lodash.eachRight = forEachRight;
  17118. lodash.first = head;
  17119. mixin(lodash, (function() {
  17120. var source = {};
  17121. baseForOwn(lodash, function(func, methodName) {
  17122. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17123. source[methodName] = func;
  17124. }
  17125. });
  17126. return source;
  17127. }()), { 'chain': false });
  17128. /*------------------------------------------------------------------------*/
  17129. /**
  17130. * The semantic version number.
  17131. *
  17132. * @static
  17133. * @memberOf _
  17134. * @type {string}
  17135. */
  17136. lodash.VERSION = VERSION;
  17137. // Assign default placeholders.
  17138. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17139. lodash[methodName].placeholder = lodash;
  17140. });
  17141. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17142. arrayEach(['drop', 'take'], function(methodName, index) {
  17143. LazyWrapper.prototype[methodName] = function(n) {
  17144. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17145. var result = (this.__filtered__ && !index)
  17146. ? new LazyWrapper(this)
  17147. : this.clone();
  17148. if (result.__filtered__) {
  17149. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17150. } else {
  17151. result.__views__.push({
  17152. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17153. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17154. });
  17155. }
  17156. return result;
  17157. };
  17158. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17159. return this.reverse()[methodName](n).reverse();
  17160. };
  17161. });
  17162. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17163. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17164. var type = index + 1,
  17165. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17166. LazyWrapper.prototype[methodName] = function(iteratee) {
  17167. var result = this.clone();
  17168. result.__iteratees__.push({
  17169. 'iteratee': getIteratee(iteratee, 3),
  17170. 'type': type
  17171. });
  17172. result.__filtered__ = result.__filtered__ || isFilter;
  17173. return result;
  17174. };
  17175. });
  17176. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17177. arrayEach(['head', 'last'], function(methodName, index) {
  17178. var takeName = 'take' + (index ? 'Right' : '');
  17179. LazyWrapper.prototype[methodName] = function() {
  17180. return this[takeName](1).value()[0];
  17181. };
  17182. });
  17183. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17184. arrayEach(['initial', 'tail'], function(methodName, index) {
  17185. var dropName = 'drop' + (index ? '' : 'Right');
  17186. LazyWrapper.prototype[methodName] = function() {
  17187. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17188. };
  17189. });
  17190. LazyWrapper.prototype.compact = function() {
  17191. return this.filter(identity);
  17192. };
  17193. LazyWrapper.prototype.find = function(predicate) {
  17194. return this.filter(predicate).head();
  17195. };
  17196. LazyWrapper.prototype.findLast = function(predicate) {
  17197. return this.reverse().find(predicate);
  17198. };
  17199. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17200. if (typeof path == 'function') {
  17201. return new LazyWrapper(this);
  17202. }
  17203. return this.map(function(value) {
  17204. return baseInvoke(value, path, args);
  17205. });
  17206. });
  17207. LazyWrapper.prototype.reject = function(predicate) {
  17208. return this.filter(negate(getIteratee(predicate)));
  17209. };
  17210. LazyWrapper.prototype.slice = function(start, end) {
  17211. start = toInteger(start);
  17212. var result = this;
  17213. if (result.__filtered__ && (start > 0 || end < 0)) {
  17214. return new LazyWrapper(result);
  17215. }
  17216. if (start < 0) {
  17217. result = result.takeRight(-start);
  17218. } else if (start) {
  17219. result = result.drop(start);
  17220. }
  17221. if (end !== undefined) {
  17222. end = toInteger(end);
  17223. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17224. }
  17225. return result;
  17226. };
  17227. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17228. return this.reverse().takeWhile(predicate).reverse();
  17229. };
  17230. LazyWrapper.prototype.toArray = function() {
  17231. return this.take(MAX_ARRAY_LENGTH);
  17232. };
  17233. // Add `LazyWrapper` methods to `lodash.prototype`.
  17234. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17235. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17236. isTaker = /^(?:head|last)$/.test(methodName),
  17237. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17238. retUnwrapped = isTaker || /^find/.test(methodName);
  17239. if (!lodashFunc) {
  17240. return;
  17241. }
  17242. lodash.prototype[methodName] = function() {
  17243. var value = this.__wrapped__,
  17244. args = isTaker ? [1] : arguments,
  17245. isLazy = value instanceof LazyWrapper,
  17246. iteratee = args[0],
  17247. useLazy = isLazy || isArray(value);
  17248. var interceptor = function(value) {
  17249. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17250. return (isTaker && chainAll) ? result[0] : result;
  17251. };
  17252. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17253. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17254. isLazy = useLazy = false;
  17255. }
  17256. var chainAll = this.__chain__,
  17257. isHybrid = !!this.__actions__.length,
  17258. isUnwrapped = retUnwrapped && !chainAll,
  17259. onlyLazy = isLazy && !isHybrid;
  17260. if (!retUnwrapped && useLazy) {
  17261. value = onlyLazy ? value : new LazyWrapper(this);
  17262. var result = func.apply(value, args);
  17263. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17264. return new LodashWrapper(result, chainAll);
  17265. }
  17266. if (isUnwrapped && onlyLazy) {
  17267. return func.apply(this, args);
  17268. }
  17269. result = this.thru(interceptor);
  17270. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17271. };
  17272. });
  17273. // Add `Array` methods to `lodash.prototype`.
  17274. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17275. var func = arrayProto[methodName],
  17276. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17277. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17278. lodash.prototype[methodName] = function() {
  17279. var args = arguments;
  17280. if (retUnwrapped && !this.__chain__) {
  17281. var value = this.value();
  17282. return func.apply(isArray(value) ? value : [], args);
  17283. }
  17284. return this[chainName](function(value) {
  17285. return func.apply(isArray(value) ? value : [], args);
  17286. });
  17287. };
  17288. });
  17289. // Map minified method names to their real names.
  17290. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17291. var lodashFunc = lodash[methodName];
  17292. if (lodashFunc) {
  17293. var key = lodashFunc.name + '';
  17294. if (!hasOwnProperty.call(realNames, key)) {
  17295. realNames[key] = [];
  17296. }
  17297. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17298. }
  17299. });
  17300. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17301. 'name': 'wrapper',
  17302. 'func': undefined
  17303. }];
  17304. // Add methods to `LazyWrapper`.
  17305. LazyWrapper.prototype.clone = lazyClone;
  17306. LazyWrapper.prototype.reverse = lazyReverse;
  17307. LazyWrapper.prototype.value = lazyValue;
  17308. // Add chain sequence methods to the `lodash` wrapper.
  17309. lodash.prototype.at = wrapperAt;
  17310. lodash.prototype.chain = wrapperChain;
  17311. lodash.prototype.commit = wrapperCommit;
  17312. lodash.prototype.next = wrapperNext;
  17313. lodash.prototype.plant = wrapperPlant;
  17314. lodash.prototype.reverse = wrapperReverse;
  17315. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17316. // Add lazy aliases.
  17317. lodash.prototype.first = lodash.prototype.head;
  17318. if (symIterator) {
  17319. lodash.prototype[symIterator] = wrapperToIterator;
  17320. }
  17321. return lodash;
  17322. });
  17323. /*--------------------------------------------------------------------------*/
  17324. // Export lodash.
  17325. var _ = runInContext();
  17326. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17327. if (true) {
  17328. // Expose Lodash on the global object to prevent errors when Lodash is
  17329. // loaded by a script tag in the presence of an AMD loader.
  17330. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17331. // Use `_.noConflict` to remove Lodash from the global object.
  17332. root._ = _;
  17333. // Define as an anonymous module so, through path mapping, it can be
  17334. // referenced as the "underscore" module.
  17335. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17336. return _;
  17337. }).call(exports, __webpack_require__, exports, module),
  17338. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17339. }
  17340. // Check for `exports` after `define` in case a build optimizer adds it.
  17341. else {}
  17342. }.call(this));
  17343. /***/ }),
  17344. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-8.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-8.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css":
  17345. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17346. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-8.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-8.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css ***!
  17347. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17348. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17349. "use strict";
  17350. __webpack_require__.r(__webpack_exports__);
  17351. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17352. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17353. /* harmony export */ });
  17354. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17355. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17356. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_8_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_8_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_style_index_0_id_9329f6aa_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-8.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-8.use[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-8.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-8.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css");
  17357. var options = {};
  17358. options.insert = "head";
  17359. options.singleton = false;
  17360. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_8_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_8_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_style_index_0_id_9329f6aa_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17361. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_8_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_8_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_style_index_0_id_9329f6aa_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17362. /***/ }),
  17363. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17364. /*!******************************************************!*\
  17365. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17366. \******************************************************/
  17367. /***/ ((__unused_webpack_module, exports) => {
  17368. "use strict";
  17369. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17370. // runtime helper for setting properties on components
  17371. // in a tree-shakable way
  17372. exports["default"] = (sfc, props) => {
  17373. const target = sfc.__vccOpts || sfc;
  17374. for (const [key, val] of props) {
  17375. target[key] = val;
  17376. }
  17377. return target;
  17378. };
  17379. /***/ }),
  17380. /***/ "./resources/js/components/AppCardStatistic.vue":
  17381. /*!******************************************************!*\
  17382. !*** ./resources/js/components/AppCardStatistic.vue ***!
  17383. \******************************************************/
  17384. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17385. "use strict";
  17386. __webpack_require__.r(__webpack_exports__);
  17387. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17388. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17389. /* harmony export */ });
  17390. /* harmony import */ var _AppCardStatistic_vue_vue_type_template_id_29d9832c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppCardStatistic.vue?vue&type=template&id=29d9832c */ "./resources/js/components/AppCardStatistic.vue?vue&type=template&id=29d9832c");
  17391. /* harmony import */ var _AppCardStatistic_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppCardStatistic.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppCardStatistic.vue?vue&type=script&setup=true&lang=js");
  17392. /* harmony import */ var _home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17393. ;
  17394. const __exports__ = /*#__PURE__*/(0,_home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppCardStatistic_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppCardStatistic_vue_vue_type_template_id_29d9832c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppCardStatistic.vue"]])
  17395. /* hot reload */
  17396. if (false) {}
  17397. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17398. /***/ }),
  17399. /***/ "./resources/js/components/AppFooter.vue":
  17400. /*!***********************************************!*\
  17401. !*** ./resources/js/components/AppFooter.vue ***!
  17402. \***********************************************/
  17403. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17404. "use strict";
  17405. __webpack_require__.r(__webpack_exports__);
  17406. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17407. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17408. /* harmony export */ });
  17409. /* harmony import */ var _AppFooter_vue_vue_type_template_id_4ab6097e__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=template&id=4ab6097e */ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e");
  17410. /* harmony import */ var _home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17411. const script = {}
  17412. ;
  17413. const __exports__ = /*#__PURE__*/(0,_home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppFooter.vue"]])
  17414. /* hot reload */
  17415. if (false) {}
  17416. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17417. /***/ }),
  17418. /***/ "./resources/js/components/AppMessage.vue":
  17419. /*!************************************************!*\
  17420. !*** ./resources/js/components/AppMessage.vue ***!
  17421. \************************************************/
  17422. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17423. "use strict";
  17424. __webpack_require__.r(__webpack_exports__);
  17425. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17426. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17427. /* harmony export */ });
  17428. /* harmony import */ var _AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppMessage.vue?vue&type=template&id=07159051 */ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051");
  17429. /* harmony import */ var _AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppMessage.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js");
  17430. /* harmony import */ var _home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17431. ;
  17432. const __exports__ = /*#__PURE__*/(0,_home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppMessage.vue"]])
  17433. /* hot reload */
  17434. if (false) {}
  17435. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17436. /***/ }),
  17437. /***/ "./resources/js/components/AppSidebar.vue":
  17438. /*!************************************************!*\
  17439. !*** ./resources/js/components/AppSidebar.vue ***!
  17440. \************************************************/
  17441. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17442. "use strict";
  17443. __webpack_require__.r(__webpack_exports__);
  17444. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17445. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17446. /* harmony export */ });
  17447. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926 */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926");
  17448. /* harmony import */ var _AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17449. /* harmony import */ var _home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17450. ;
  17451. const __exports__ = /*#__PURE__*/(0,_home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppSidebar.vue"]])
  17452. /* hot reload */
  17453. if (false) {}
  17454. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17455. /***/ }),
  17456. /***/ "./resources/js/components/AppSubSidebar.vue":
  17457. /*!***************************************************!*\
  17458. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17459. \***************************************************/
  17460. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17461. "use strict";
  17462. __webpack_require__.r(__webpack_exports__);
  17463. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17464. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17465. /* harmony export */ });
  17466. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc");
  17467. /* harmony import */ var _AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17468. /* harmony import */ var _home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17469. ;
  17470. const __exports__ = /*#__PURE__*/(0,_home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17471. /* hot reload */
  17472. if (false) {}
  17473. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17474. /***/ }),
  17475. /***/ "./resources/js/components/AppTopBar.vue":
  17476. /*!***********************************************!*\
  17477. !*** ./resources/js/components/AppTopBar.vue ***!
  17478. \***********************************************/
  17479. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17480. "use strict";
  17481. __webpack_require__.r(__webpack_exports__);
  17482. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17483. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17484. /* harmony export */ });
  17485. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4 */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4");
  17486. /* harmony import */ var _AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17487. /* harmony import */ var _home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17488. ;
  17489. const __exports__ = /*#__PURE__*/(0,_home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppTopBar.vue"]])
  17490. /* hot reload */
  17491. if (false) {}
  17492. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17493. /***/ }),
  17494. /***/ "./resources/js/layouts/AppLayout.vue":
  17495. /*!********************************************!*\
  17496. !*** ./resources/js/layouts/AppLayout.vue ***!
  17497. \********************************************/
  17498. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17499. "use strict";
  17500. __webpack_require__.r(__webpack_exports__);
  17501. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17502. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17503. /* harmony export */ });
  17504. /* harmony import */ var _AppLayout_vue_vue_type_template_id_2cfb4112__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppLayout.vue?vue&type=template&id=2cfb4112 */ "./resources/js/layouts/AppLayout.vue?vue&type=template&id=2cfb4112");
  17505. /* harmony import */ var _AppLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/AppLayout.vue?vue&type=script&setup=true&lang=js");
  17506. /* harmony import */ var _home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17507. ;
  17508. const __exports__ = /*#__PURE__*/(0,_home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppLayout_vue_vue_type_template_id_2cfb4112__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/layouts/AppLayout.vue"]])
  17509. /* hot reload */
  17510. if (false) {}
  17511. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17512. /***/ }),
  17513. /***/ "./resources/js/pages/home/Index.vue":
  17514. /*!*******************************************!*\
  17515. !*** ./resources/js/pages/home/Index.vue ***!
  17516. \*******************************************/
  17517. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17518. "use strict";
  17519. __webpack_require__.r(__webpack_exports__);
  17520. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17521. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17522. /* harmony export */ });
  17523. /* harmony import */ var _Index_vue_vue_type_template_id_9329f6aa_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=9329f6aa&scoped=true */ "./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa&scoped=true");
  17524. /* harmony import */ var _Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Index.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js");
  17525. /* harmony import */ var _Index_vue_vue_type_style_index_0_id_9329f6aa_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css */ "./resources/js/pages/home/Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css");
  17526. /* harmony import */ var _home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17527. ;
  17528. const __exports__ = /*#__PURE__*/(0,_home_dijitalcode_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_9329f6aa_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-9329f6aa"],['__file',"resources/js/pages/home/Index.vue"]])
  17529. /* hot reload */
  17530. if (false) {}
  17531. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17532. /***/ }),
  17533. /***/ "./resources/js/components/AppCardStatistic.vue?vue&type=script&setup=true&lang=js":
  17534. /*!*****************************************************************************************!*\
  17535. !*** ./resources/js/components/AppCardStatistic.vue?vue&type=script&setup=true&lang=js ***!
  17536. \*****************************************************************************************/
  17537. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17538. "use strict";
  17539. __webpack_require__.r(__webpack_exports__);
  17540. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17541. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppCardStatistic_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17542. /* harmony export */ });
  17543. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppCardStatistic_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppCardStatistic.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppCardStatistic.vue?vue&type=script&setup=true&lang=js");
  17544. /***/ }),
  17545. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17546. /*!***********************************************************************************!*\
  17547. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17548. \***********************************************************************************/
  17549. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17550. "use strict";
  17551. __webpack_require__.r(__webpack_exports__);
  17552. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17553. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17554. /* harmony export */ });
  17555. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppMessage.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js");
  17556. /***/ }),
  17557. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17558. /*!***********************************************************************************!*\
  17559. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17560. \***********************************************************************************/
  17561. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17562. "use strict";
  17563. __webpack_require__.r(__webpack_exports__);
  17564. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17565. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17566. /* harmony export */ });
  17567. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17568. /***/ }),
  17569. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17570. /*!**************************************************************************************!*\
  17571. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17572. \**************************************************************************************/
  17573. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17574. "use strict";
  17575. __webpack_require__.r(__webpack_exports__);
  17576. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17577. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17578. /* harmony export */ });
  17579. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17580. /***/ }),
  17581. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17582. /*!**********************************************************************************!*\
  17583. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17584. \**********************************************************************************/
  17585. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17586. "use strict";
  17587. __webpack_require__.r(__webpack_exports__);
  17588. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17589. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17590. /* harmony export */ });
  17591. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17592. /***/ }),
  17593. /***/ "./resources/js/layouts/AppLayout.vue?vue&type=script&setup=true&lang=js":
  17594. /*!*******************************************************************************!*\
  17595. !*** ./resources/js/layouts/AppLayout.vue?vue&type=script&setup=true&lang=js ***!
  17596. \*******************************************************************************/
  17597. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17598. "use strict";
  17599. __webpack_require__.r(__webpack_exports__);
  17600. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17601. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17602. /* harmony export */ });
  17603. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/AppLayout.vue?vue&type=script&setup=true&lang=js");
  17604. /***/ }),
  17605. /***/ "./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js":
  17606. /*!******************************************************************************!*\
  17607. !*** ./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js ***!
  17608. \******************************************************************************/
  17609. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17610. "use strict";
  17611. __webpack_require__.r(__webpack_exports__);
  17612. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17613. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17614. /* harmony export */ });
  17615. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js");
  17616. /***/ }),
  17617. /***/ "./resources/js/components/AppCardStatistic.vue?vue&type=template&id=29d9832c":
  17618. /*!************************************************************************************!*\
  17619. !*** ./resources/js/components/AppCardStatistic.vue?vue&type=template&id=29d9832c ***!
  17620. \************************************************************************************/
  17621. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17622. "use strict";
  17623. __webpack_require__.r(__webpack_exports__);
  17624. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17625. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppCardStatistic_vue_vue_type_template_id_29d9832c__WEBPACK_IMPORTED_MODULE_0__.render)
  17626. /* harmony export */ });
  17627. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppCardStatistic_vue_vue_type_template_id_29d9832c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppCardStatistic.vue?vue&type=template&id=29d9832c */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppCardStatistic.vue?vue&type=template&id=29d9832c");
  17628. /***/ }),
  17629. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e":
  17630. /*!*****************************************************************************!*\
  17631. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e ***!
  17632. \*****************************************************************************/
  17633. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17634. "use strict";
  17635. __webpack_require__.r(__webpack_exports__);
  17636. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17637. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e__WEBPACK_IMPORTED_MODULE_0__.render)
  17638. /* harmony export */ });
  17639. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=template&id=4ab6097e */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e");
  17640. /***/ }),
  17641. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17642. /*!******************************************************************************!*\
  17643. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17644. \******************************************************************************/
  17645. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17646. "use strict";
  17647. __webpack_require__.r(__webpack_exports__);
  17648. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17649. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render)
  17650. /* harmony export */ });
  17651. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppMessage.vue?vue&type=template&id=07159051 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051");
  17652. /***/ }),
  17653. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926":
  17654. /*!******************************************************************************!*\
  17655. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926 ***!
  17656. \******************************************************************************/
  17657. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17658. "use strict";
  17659. __webpack_require__.r(__webpack_exports__);
  17660. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17661. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926__WEBPACK_IMPORTED_MODULE_0__.render)
  17662. /* harmony export */ });
  17663. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=template&id=22a4e926 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926");
  17664. /***/ }),
  17665. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc":
  17666. /*!*********************************************************************************!*\
  17667. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc ***!
  17668. \*********************************************************************************/
  17669. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17670. "use strict";
  17671. __webpack_require__.r(__webpack_exports__);
  17672. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17673. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc__WEBPACK_IMPORTED_MODULE_0__.render)
  17674. /* harmony export */ });
  17675. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc");
  17676. /***/ }),
  17677. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4":
  17678. /*!*****************************************************************************!*\
  17679. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4 ***!
  17680. \*****************************************************************************/
  17681. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17682. "use strict";
  17683. __webpack_require__.r(__webpack_exports__);
  17684. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17685. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4__WEBPACK_IMPORTED_MODULE_0__.render)
  17686. /* harmony export */ });
  17687. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=template&id=42bf62a4 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4");
  17688. /***/ }),
  17689. /***/ "./resources/js/layouts/AppLayout.vue?vue&type=template&id=2cfb4112":
  17690. /*!**************************************************************************!*\
  17691. !*** ./resources/js/layouts/AppLayout.vue?vue&type=template&id=2cfb4112 ***!
  17692. \**************************************************************************/
  17693. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17694. "use strict";
  17695. __webpack_require__.r(__webpack_exports__);
  17696. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17697. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppLayout_vue_vue_type_template_id_2cfb4112__WEBPACK_IMPORTED_MODULE_0__.render)
  17698. /* harmony export */ });
  17699. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppLayout_vue_vue_type_template_id_2cfb4112__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppLayout.vue?vue&type=template&id=2cfb4112 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/AppLayout.vue?vue&type=template&id=2cfb4112");
  17700. /***/ }),
  17701. /***/ "./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa&scoped=true":
  17702. /*!*************************************************************************************!*\
  17703. !*** ./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa&scoped=true ***!
  17704. \*************************************************************************************/
  17705. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17706. "use strict";
  17707. __webpack_require__.r(__webpack_exports__);
  17708. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17709. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_9329f6aa_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17710. /* harmony export */ });
  17711. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_9329f6aa_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=template&id=9329f6aa&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa&scoped=true");
  17712. /***/ }),
  17713. /***/ "./resources/js/pages/home/Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css":
  17714. /*!***************************************************************************************************!*\
  17715. !*** ./resources/js/pages/home/Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css ***!
  17716. \***************************************************************************************************/
  17717. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17718. "use strict";
  17719. __webpack_require__.r(__webpack_exports__);
  17720. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_8_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_8_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_style_index_0_id_9329f6aa_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader/dist/cjs.js!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-8.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-8.use[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-8.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-8.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=style&index=0&id=9329f6aa&scoped=true&lang=css");
  17721. /***/ })
  17722. }]);