resources_js_pages_expense_Index_vue.js 703KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_expense_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/AppButtonLink.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/AppButtonLink.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 import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./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":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./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 ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./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/AppPagination.vue?vue&type=script&setup=true&lang=js":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./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/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./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":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./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 ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  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 _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./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":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./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 ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./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/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./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/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./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/expense/Index.vue?vue&type=script&setup=true&lang=js":
  259. /*!*************************************************************************************************************************************************************************************************************!*\
  260. !*** ./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/expense/Index.vue?vue&type=script&setup=true&lang=js ***!
  261. \*************************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  269. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/expense/tableHeader.js");
  274. /* harmony import */ var _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useDateRangeFilter */ "./resources/js/components/useDateRangeFilter.js");
  275. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  276. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  277. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  278. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  279. props: {
  280. expenses: Object,
  281. initialDateRange: Array
  282. },
  283. setup: function setup(__props, _ref) {
  284. var expose = _ref.expose;
  285. expose();
  286. var props = __props;
  287. var _useDateRangeFilter = (0,_components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__.useDateRangeFilter)(props),
  288. dates = _useDateRangeFilter.dates,
  289. startDate = _useDateRangeFilter.startDate,
  290. endDate = _useDateRangeFilter.endDate;
  291. (0,vue__WEBPACK_IMPORTED_MODULE_1__.watch)(dates, function () {
  292. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/expenses', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  293. startDate: startDate.value,
  294. endDate: endDate.value
  295. }), {
  296. preserveState: true
  297. });
  298. });
  299. var filterReset = function filterReset() {
  300. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/expenses');
  301. };
  302. var __returned__ = {
  303. props: props,
  304. dates: dates,
  305. startDate: startDate,
  306. endDate: endDate,
  307. filterReset: filterReset,
  308. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  309. watch: vue__WEBPACK_IMPORTED_MODULE_1__.watch,
  310. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  311. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  312. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  313. useDateRangeFilter: _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__.useDateRangeFilter,
  314. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  315. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  316. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  317. };
  318. Object.defineProperty(__returned__, '__isScriptSetup', {
  319. enumerable: false,
  320. value: true
  321. });
  322. return __returned__;
  323. }
  324. });
  325. /***/ }),
  326. /***/ "./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/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  327. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  328. !*** ./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/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  329. \***********************************************************************************************************************************************************************************************************************************************************************************/
  330. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  331. "use strict";
  332. __webpack_require__.r(__webpack_exports__);
  333. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  334. /* harmony export */ "render": () => (/* binding */ render)
  335. /* harmony export */ });
  336. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  337. var _hoisted_1 = {
  338. key: 1,
  339. "class": "p-button-label"
  340. };
  341. var _hoisted_2 = {
  342. key: 1,
  343. "class": "p-button-label"
  344. };
  345. function render(_ctx, _cache, $props, $setup, $data, $options) {
  346. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  347. key: 0,
  348. "class": "p-button p-component",
  349. as: "button",
  350. type: "button"
  351. }, {
  352. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  353. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  354. key: 0,
  355. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  356. }, null, 2
  357. /* CLASS */
  358. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  359. /* TEXT */
  360. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  361. }),
  362. _: 1
  363. /* STABLE */
  364. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  365. key: 1,
  366. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  367. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  368. key: 0,
  369. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  370. }, null, 2
  371. /* CLASS */
  372. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  373. /* TEXT */
  374. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  375. /* CLASS */
  376. ));
  377. }
  378. /***/ }),
  379. /***/ "./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&scoped=true":
  380. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  381. !*** ./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&scoped=true ***!
  382. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  383. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  384. "use strict";
  385. __webpack_require__.r(__webpack_exports__);
  386. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  387. /* harmony export */ "render": () => (/* binding */ render)
  388. /* harmony export */ });
  389. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  390. var _withScopeId = function _withScopeId(n) {
  391. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  392. };
  393. var _hoisted_1 = {
  394. "class": "layout-footer"
  395. };
  396. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  397. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  398. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  399. href: "https://dijitalcode.com",
  400. target: "_blank",
  401. "class": "font-medium ml-2"
  402. }, "DijitalCODE", -1
  403. /* HOISTED */
  404. );
  405. });
  406. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  407. function render(_ctx, _cache) {
  408. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  409. }
  410. /***/ }),
  411. /***/ "./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":
  412. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  413. !*** ./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 ***!
  414. \********************************************************************************************************************************************************************************************************************************************************************************/
  415. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  416. "use strict";
  417. __webpack_require__.r(__webpack_exports__);
  418. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  419. /* harmony export */ "render": () => (/* binding */ render)
  420. /* harmony export */ });
  421. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  422. var _hoisted_1 = {
  423. key: 0
  424. };
  425. var _hoisted_2 = {
  426. key: 1
  427. };
  428. function render(_ctx, _cache, $props, $setup, $data, $options) {
  429. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  430. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  431. key: 0,
  432. severity: "success",
  433. onClose: $setup.onClose
  434. }, {
  435. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  436. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  437. /* TEXT */
  438. )];
  439. }),
  440. _: 1
  441. /* STABLE */
  442. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  443. key: 1,
  444. severity: "error",
  445. onClose: $setup.onClose
  446. }, {
  447. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  448. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  449. /* TEXT */
  450. )];
  451. }),
  452. _: 1
  453. /* STABLE */
  454. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  455. key: 2,
  456. severity: "error",
  457. onClose: $setup.onClose
  458. }, {
  459. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  460. 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_1, " Ditemukan satu error pada form ")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, " Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form ", 1
  461. /* TEXT */
  462. ))];
  463. }),
  464. _: 1
  465. /* STABLE */
  466. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  467. /* STABLE_FRAGMENT */
  468. );
  469. }
  470. /***/ }),
  471. /***/ "./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/AppPagination.vue?vue&type=template&id=4da56ec0":
  472. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  473. !*** ./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/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  474. \***********************************************************************************************************************************************************************************************************************************************************************************/
  475. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  476. "use strict";
  477. __webpack_require__.r(__webpack_exports__);
  478. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  479. /* harmony export */ "render": () => (/* binding */ render)
  480. /* harmony export */ });
  481. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  482. var _hoisted_1 = {
  483. key: 0,
  484. "class": "p-paginator p-component flex justify-content-start"
  485. };
  486. var _hoisted_2 = {
  487. "class": "p-paginator-pages"
  488. };
  489. var _hoisted_3 = ["innerHTML"];
  490. function render(_ctx, _cache, $props, $setup, $data, $options) {
  491. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _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.links, function (link, key) {
  492. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  493. key: "link-".concat(key),
  494. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  495. 'p-disabled': link
  496. }]),
  497. innerHTML: link.label
  498. }, null, 10
  499. /* CLASS, PROPS */
  500. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  501. key: "link-".concat(key),
  502. href: link.url,
  503. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  504. 'p-highlight': link.active
  505. }, "p-paginator-page p-paginator-element p-link"]),
  506. innerHTML: link.label
  507. }, null, 8
  508. /* PROPS */
  509. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  510. /* STABLE_FRAGMENT */
  511. );
  512. }), 256
  513. /* UNKEYED_FRAGMENT */
  514. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  515. }
  516. /***/ }),
  517. /***/ "./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&scoped=true":
  518. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  519. !*** ./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&scoped=true ***!
  520. \********************************************************************************************************************************************************************************************************************************************************************************************/
  521. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  522. "use strict";
  523. __webpack_require__.r(__webpack_exports__);
  524. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  525. /* harmony export */ "render": () => (/* binding */ render)
  526. /* harmony export */ });
  527. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  528. function render(_ctx, _cache, $props, $setup, $data, $options) {
  529. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  530. "class": "layout-menu",
  531. items: $props.menu,
  532. root: true
  533. }, null, 8
  534. /* PROPS */
  535. , ["items"])]);
  536. }
  537. /***/ }),
  538. /***/ "./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&scoped=true":
  539. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  540. !*** ./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&scoped=true ***!
  541. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  542. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  543. "use strict";
  544. __webpack_require__.r(__webpack_exports__);
  545. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  546. /* harmony export */ "render": () => (/* binding */ render)
  547. /* harmony export */ });
  548. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  549. var _withScopeId = function _withScopeId(n) {
  550. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  551. };
  552. var _hoisted_1 = {
  553. key: 0
  554. };
  555. var _hoisted_2 = ["aria-label"];
  556. var _hoisted_3 = ["aria-label"];
  557. function render(_ctx, _cache, $props, $setup, $data, $options) {
  558. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  559. 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) {
  560. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  561. key: i,
  562. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  563. 'layout-menuitem-category': $props.root
  564. }]),
  565. role: "none"
  566. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  567. key: 0
  568. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  569. "class": "layout-menuitem-root-text",
  570. "aria-label": item.label
  571. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  572. /* TEXT, PROPS */
  573. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  574. items: item.items
  575. }, null, 8
  576. /* PROPS */
  577. , ["items"])], 64
  578. /* STABLE_FRAGMENT */
  579. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  580. key: 1
  581. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  582. key: 0,
  583. role: "menuitem",
  584. href: item.to,
  585. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  586. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  587. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  588. }]),
  589. "aria-label": item.label
  590. }, {
  591. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  592. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  593. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  594. }, null, 2
  595. /* CLASS */
  596. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  597. /* TEXT */
  598. )];
  599. }),
  600. _: 2
  601. /* DYNAMIC */
  602. }, 1032
  603. /* PROPS, DYNAMIC_SLOTS */
  604. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  605. key: 1,
  606. href: "#",
  607. role: "menuitem",
  608. "aria-label": item.label
  609. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  610. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  611. }, null, 2
  612. /* CLASS */
  613. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  614. /* TEXT */
  615. )], 8
  616. /* PROPS */
  617. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  618. items: item.items
  619. }, null, 8
  620. /* PROPS */
  621. , ["items"])], 64
  622. /* STABLE_FRAGMENT */
  623. ))], 2
  624. /* CLASS */
  625. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  626. /* STABLE_FRAGMENT */
  627. );
  628. }), 256
  629. /* UNKEYED_FRAGMENT */
  630. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  631. }
  632. /***/ }),
  633. /***/ "./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&scoped=true":
  634. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  635. !*** ./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&scoped=true ***!
  636. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  637. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  638. "use strict";
  639. __webpack_require__.r(__webpack_exports__);
  640. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  641. /* harmony export */ "render": () => (/* binding */ render)
  642. /* harmony export */ });
  643. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  644. var _withScopeId = function _withScopeId(n) {
  645. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  646. };
  647. var _hoisted_1 = {
  648. "class": "layout-topbar"
  649. };
  650. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  651. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  652. alt: "Logo",
  653. src: "/images/logo.svg",
  654. "class": "md:mr-3"
  655. }, null, -1
  656. /* HOISTED */
  657. );
  658. });
  659. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  660. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  661. /* HOISTED */
  662. );
  663. });
  664. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  665. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  666. "class": "pi pi-bars"
  667. }, null, -1
  668. /* HOISTED */
  669. );
  670. });
  671. var _hoisted_5 = [_hoisted_4];
  672. var _hoisted_6 = {
  673. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  674. };
  675. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  676. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  677. "class": "pi pi-ellipsis-v"
  678. }, null, -1
  679. /* HOISTED */
  680. );
  681. });
  682. var _hoisted_8 = [_hoisted_7];
  683. var _hoisted_9 = {
  684. "class": "layout-topbar-menu hidden lg:flex origin-top"
  685. };
  686. var _hoisted_10 = {
  687. "class": "align-self-center"
  688. };
  689. var _hoisted_11 = {
  690. "class": "hidden lg:inline"
  691. };
  692. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  693. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  694. "class": "pi pi-user"
  695. }, null, -1
  696. /* HOISTED */
  697. );
  698. });
  699. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  700. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  701. /* HOISTED */
  702. );
  703. });
  704. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  705. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  706. "class": "pi pi-sign-out"
  707. }, null, -1
  708. /* HOISTED */
  709. );
  710. });
  711. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  712. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  713. /* HOISTED */
  714. );
  715. });
  716. function render(_ctx, _cache, $props, $setup, $data, $options) {
  717. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  718. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  719. 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"], {
  720. href: "/",
  721. "class": "layout-topbar-logo"
  722. }, {
  723. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  724. return [_hoisted_2, _hoisted_3];
  725. }),
  726. _: 1
  727. /* STABLE */
  728. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  729. "class": "p-link layout-menu-button layout-topbar-button",
  730. onClick: _cache[0] || (_cache[0] = function ($event) {
  731. return _ctx.$emit('menu-toggle', $event);
  732. })
  733. }, _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, {
  734. selector: '@next',
  735. enterClass: 'hidden',
  736. enterActiveClass: 'scalein',
  737. leaveToClass: 'hidden',
  738. leaveActiveClass: 'fadeout',
  739. hideOnOutsideClick: true
  740. }]]), (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
  741. /* TEXT */
  742. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  743. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  744. "class": "p-link layout-topbar-button"
  745. }, {
  746. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  747. return [_hoisted_12, _hoisted_13];
  748. }),
  749. _: 1
  750. /* STABLE */
  751. }, 8
  752. /* PROPS */
  753. , ["href"])), [[_directive_tooltip, {
  754. value: 'Ubah Profil',
  755. "class": 'layout-topbar-menu-tooltip'
  756. }, void 0, {
  757. bottom: true
  758. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  759. href: _ctx.route('logout'),
  760. as: "button",
  761. method: "post",
  762. "class": "p-link layout-topbar-button"
  763. }, {
  764. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  765. return [_hoisted_14, _hoisted_15];
  766. }),
  767. _: 1
  768. /* STABLE */
  769. }, 8
  770. /* PROPS */
  771. , ["href"])), [[_directive_tooltip, {
  772. value: 'Keluar',
  773. "class": 'layout-topbar-menu-tooltip'
  774. }, void 0, {
  775. bottom: true
  776. }]])])])]);
  777. }
  778. /***/ }),
  779. /***/ "./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/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  780. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  781. !*** ./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/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  782. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  783. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  784. "use strict";
  785. __webpack_require__.r(__webpack_exports__);
  786. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  787. /* harmony export */ "render": () => (/* binding */ render)
  788. /* harmony export */ });
  789. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  790. var _withScopeId = function _withScopeId(n) {
  791. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  792. };
  793. var _hoisted_1 = {
  794. "class": "layout-sidebar"
  795. };
  796. var _hoisted_2 = {
  797. "class": "layout-main-container"
  798. };
  799. var _hoisted_3 = {
  800. "class": "layout-main"
  801. };
  802. var _hoisted_4 = {
  803. key: 0,
  804. "class": "layout-mask p-component-overlay"
  805. };
  806. function render(_ctx, _cache, $props, $setup, $data, $options) {
  807. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  808. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  809. onClick: $setup.onWrapperClick
  810. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  811. onMenuToggle: $setup.onMenuToggle
  812. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  813. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  814. }, null, 8
  815. /* PROPS */
  816. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  817. name: "layout-mask"
  818. }, {
  819. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  820. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  821. }),
  822. _: 1
  823. /* STABLE */
  824. })], 2
  825. /* CLASS */
  826. );
  827. }
  828. /***/ }),
  829. /***/ "./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/expense/Index.vue?vue&type=template&id=2507f822":
  830. /*!******************************************************************************************************************************************************************************************************************************************************************************!*\
  831. !*** ./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/expense/Index.vue?vue&type=template&id=2507f822 ***!
  832. \******************************************************************************************************************************************************************************************************************************************************************************/
  833. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  834. "use strict";
  835. __webpack_require__.r(__webpack_exports__);
  836. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  837. /* harmony export */ "render": () => (/* binding */ render)
  838. /* harmony export */ });
  839. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  840. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Pengeluaran", -1
  841. /* HOISTED */
  842. );
  843. var _hoisted_2 = {
  844. "class": "grid"
  845. };
  846. var _hoisted_3 = {
  847. "class": "col-12 md:col-8"
  848. };
  849. var _hoisted_4 = {
  850. "class": "grid"
  851. };
  852. var _hoisted_5 = {
  853. "class": "col-12 md:col-4"
  854. };
  855. var _hoisted_6 = {
  856. "class": "col-auto mt-2 ml-2"
  857. };
  858. var _hoisted_7 = {
  859. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  860. };
  861. function render(_ctx, _cache, $props, $setup, $data, $options) {
  862. var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
  863. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  864. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  865. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  866. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  867. title: "Pengeluaran"
  868. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  869. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  870. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  871. "responsive-layout": "scroll",
  872. "column-resize-mode": "expand",
  873. value: $props.expenses.data,
  874. "row-hover": true,
  875. "striped-rows": true
  876. }, {
  877. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  878. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Calendar, {
  879. "touch-u-i": "",
  880. "class": "w-full",
  881. modelValue: $setup.dates,
  882. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  883. return $setup.dates = $event;
  884. }),
  885. "selection-mode": "range",
  886. placeholder: "filter waktu...",
  887. "date-format": "dd/mm/yy",
  888. "manual-input": false
  889. }, null, 8
  890. /* PROPS */
  891. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  892. label: "reset",
  893. "class": "p-button-link",
  894. onClick: $setup.filterReset
  895. })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  896. label: "Tambah Pengeluaran",
  897. "class": "p-button-outlined",
  898. icon: "pi pi-pencil",
  899. href: _ctx.route('expenses.create')
  900. }, null, 8
  901. /* PROPS */
  902. , ["href"])])])];
  903. }),
  904. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  905. return [((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)($setup.tableHeader, function (value) {
  906. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  907. field: value.field,
  908. header: value.header,
  909. key: value.field
  910. }, null, 8
  911. /* PROPS */
  912. , ["field", "header"]);
  913. }), 128
  914. /* KEYED_FRAGMENT */
  915. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  916. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  917. var data = _ref.data;
  918. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  919. icon: "pi pi-eye",
  920. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  921. href: _ctx.route('expenses.show', data.id)
  922. }, null, 8
  923. /* PROPS */
  924. , ["href"])];
  925. }),
  926. _: 1
  927. /* STABLE */
  928. })];
  929. }),
  930. _: 1
  931. /* STABLE */
  932. }, 8
  933. /* PROPS */
  934. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  935. links: $props.expenses.links
  936. }, null, 8
  937. /* PROPS */
  938. , ["links"])];
  939. }),
  940. _: 1
  941. /* STABLE */
  942. })], 64
  943. /* STABLE_FRAGMENT */
  944. );
  945. }
  946. /***/ }),
  947. /***/ "./resources/js/components/useDateRangeFilter.js":
  948. /*!*******************************************************!*\
  949. !*** ./resources/js/components/useDateRangeFilter.js ***!
  950. \*******************************************************/
  951. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  952. "use strict";
  953. __webpack_require__.r(__webpack_exports__);
  954. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  955. /* harmony export */ "useDateRangeFilter": () => (/* binding */ useDateRangeFilter)
  956. /* harmony export */ });
  957. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  958. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
  959. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
  960. function useDateRangeFilter(props) {
  961. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  962. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  963. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  964. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  965. if (!props.initialDateRange) {
  966. return;
  967. }
  968. if (props.initialDateRange[0] || props.initialDateRange[1]) {
  969. if (props.initialDateRange[1]) {
  970. dates.value = [new Date(props.initialDateRange[0]), new Date(props.initialDateRange[1])];
  971. } else {
  972. dates.value = [new Date(props.props.initialDateRange[1]), null];
  973. }
  974. }
  975. });
  976. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  977. if (dates.value[1]) {
  978. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  979. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  980. } else if (dates.value[0]) {
  981. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  982. endDate.value = null;
  983. }
  984. });
  985. return {
  986. dates: dates,
  987. startDate: startDate,
  988. endDate: endDate
  989. };
  990. }
  991. /***/ }),
  992. /***/ "./resources/js/pages/expense/tableHeader.js":
  993. /*!***************************************************!*\
  994. !*** ./resources/js/pages/expense/tableHeader.js ***!
  995. \***************************************************/
  996. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  997. "use strict";
  998. __webpack_require__.r(__webpack_exports__);
  999. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1000. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1001. /* harmony export */ });
  1002. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  1003. field: 'createdAt',
  1004. header: 'Tanggal'
  1005. }, {
  1006. field: 'amount',
  1007. header: 'Pengeluaran'
  1008. }, {
  1009. field: 'user',
  1010. header: 'User'
  1011. }]);
  1012. /***/ }),
  1013. /***/ "./resources/js/utils/menu.js":
  1014. /*!************************************!*\
  1015. !*** ./resources/js/utils/menu.js ***!
  1016. \************************************/
  1017. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1018. "use strict";
  1019. __webpack_require__.r(__webpack_exports__);
  1020. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1021. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1022. /* harmony export */ });
  1023. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1024. // Admin
  1025. 1: [{
  1026. label: 'Home',
  1027. items: [{
  1028. label: 'Dashboard',
  1029. icon: 'pi pi-home',
  1030. to: '/dashboards',
  1031. component: 'home/Index'
  1032. }]
  1033. }, {
  1034. label: 'Master',
  1035. items: [{
  1036. label: 'User',
  1037. icon: 'pi pi-user',
  1038. to: '/users',
  1039. component: 'user/Index'
  1040. }]
  1041. }],
  1042. // Supervisor
  1043. 2: [{
  1044. label: 'Home',
  1045. items: [{
  1046. label: 'Dashboard',
  1047. icon: 'pi pi-home',
  1048. to: '/dashboards',
  1049. component: 'home/Index'
  1050. }]
  1051. }, {
  1052. label: 'Menu',
  1053. items: [{
  1054. label: 'Pengeluaran',
  1055. icon: 'pi pi-wallet',
  1056. to: '/expenses',
  1057. component: 'expense/Index'
  1058. }, {
  1059. label: 'Laporan',
  1060. icon: 'pi pi-book',
  1061. items: [{
  1062. label: 'Mutasi',
  1063. icon: 'pi pi-circle',
  1064. to: '/reports/mutations',
  1065. component: 'mutation/Report'
  1066. }]
  1067. }]
  1068. }, {
  1069. label: 'Master',
  1070. items: [{
  1071. label: 'Jenis Kendaraan',
  1072. icon: 'pi pi-car',
  1073. to: '/type-vehicles',
  1074. component: 'typevehicle/Index'
  1075. }, {
  1076. label: 'Jenis Member',
  1077. icon: 'pi pi-id-card',
  1078. to: '/type-members',
  1079. component: 'typemember/Index'
  1080. }]
  1081. }, {
  1082. label: 'Pengaturan',
  1083. items: [{
  1084. label: 'Tarif Parkir',
  1085. icon: 'pi pi-car',
  1086. to: '/parking-fees/create',
  1087. component: 'parkingfee/Create'
  1088. }]
  1089. }],
  1090. // Operator
  1091. 3: [{
  1092. label: 'Home',
  1093. items: [{
  1094. label: 'Dashboard',
  1095. icon: 'pi pi-home',
  1096. to: '/dashboards',
  1097. component: 'home/Index'
  1098. }]
  1099. }, {
  1100. label: 'Transaksi',
  1101. items: [{
  1102. label: 'Transaksi masuk dan keluar',
  1103. icon: 'pi pi-car',
  1104. to: '/transactions/create',
  1105. component: 'transaction/Create'
  1106. }]
  1107. }, {
  1108. label: 'Menu',
  1109. items: [{
  1110. label: 'Pengeluaran',
  1111. icon: 'pi pi-wallet',
  1112. to: '/expenses',
  1113. component: 'expense/Index'
  1114. }, {
  1115. label: 'Member',
  1116. icon: 'pi pi-id-card',
  1117. to: '/members',
  1118. component: 'member/Index'
  1119. }, {
  1120. label: 'Top Up',
  1121. icon: 'pi pi-car',
  1122. to: '/top-ups',
  1123. component: 'topup/Index'
  1124. }]
  1125. }]
  1126. });
  1127. /***/ }),
  1128. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1129. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1130. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1131. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1132. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1133. "use strict";
  1134. __webpack_require__.r(__webpack_exports__);
  1135. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1136. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1137. /* harmony export */ });
  1138. /* 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");
  1139. /* 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__);
  1140. // Imports
  1141. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1142. // Module
  1143. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-footer[data-v-4ab6097e] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}", ""]);
  1144. // Exports
  1145. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1146. /***/ }),
  1147. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1148. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1149. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1150. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1151. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1152. "use strict";
  1153. __webpack_require__.r(__webpack_exports__);
  1154. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1155. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1156. /* harmony export */ });
  1157. /* 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");
  1158. /* 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__);
  1159. // Imports
  1160. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1161. // Module
  1162. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1163. // Exports
  1164. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1165. /***/ }),
  1166. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1167. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1168. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1169. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1170. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1171. "use strict";
  1172. __webpack_require__.r(__webpack_exports__);
  1173. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1174. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1175. /* harmony export */ });
  1176. /* 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");
  1177. /* 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__);
  1178. // Imports
  1179. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1180. // Module
  1181. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-0addd9bc] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-0addd9bc]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-0addd9bc] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-0addd9bc] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-0addd9bc] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-0addd9bc] {\n margin-left: auto;\n}\nli a[data-v-0addd9bc]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-0addd9bc]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-0addd9bc] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-0addd9bc] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-0addd9bc] {\n padding-left: 1rem;\n}", ""]);
  1182. // Exports
  1183. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1184. /***/ }),
  1185. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1186. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1187. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1188. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1189. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1190. "use strict";
  1191. __webpack_require__.r(__webpack_exports__);
  1192. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1193. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1194. /* harmony export */ });
  1195. /* 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");
  1196. /* 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__);
  1197. // Imports
  1198. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1199. // Module
  1200. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1201. // Exports
  1202. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1203. /***/ }),
  1204. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1205. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1206. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1207. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1208. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1209. "use strict";
  1210. __webpack_require__.r(__webpack_exports__);
  1211. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1212. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1213. /* harmony export */ });
  1214. /* 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");
  1215. /* 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__);
  1216. // Imports
  1217. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1218. // Module
  1219. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 999;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 998;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1220. // Exports
  1221. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1222. /***/ }),
  1223. /***/ "./node_modules/dayjs/dayjs.min.js":
  1224. /*!*****************************************!*\
  1225. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1226. \*****************************************/
  1227. /***/ (function(module) {
  1228. !function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
  1229. /***/ }),
  1230. /***/ "./node_modules/lodash/lodash.js":
  1231. /*!***************************************!*\
  1232. !*** ./node_modules/lodash/lodash.js ***!
  1233. \***************************************/
  1234. /***/ (function(module, exports, __webpack_require__) {
  1235. /* module decorator */ module = __webpack_require__.nmd(module);
  1236. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1237. * @license
  1238. * Lodash <https://lodash.com/>
  1239. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1240. * Released under MIT license <https://lodash.com/license>
  1241. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1242. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1243. */
  1244. ;(function() {
  1245. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1246. var undefined;
  1247. /** Used as the semantic version number. */
  1248. var VERSION = '4.17.21';
  1249. /** Used as the size to enable large array optimizations. */
  1250. var LARGE_ARRAY_SIZE = 200;
  1251. /** Error message constants. */
  1252. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1253. FUNC_ERROR_TEXT = 'Expected a function',
  1254. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1255. /** Used to stand-in for `undefined` hash values. */
  1256. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1257. /** Used as the maximum memoize cache size. */
  1258. var MAX_MEMOIZE_SIZE = 500;
  1259. /** Used as the internal argument placeholder. */
  1260. var PLACEHOLDER = '__lodash_placeholder__';
  1261. /** Used to compose bitmasks for cloning. */
  1262. var CLONE_DEEP_FLAG = 1,
  1263. CLONE_FLAT_FLAG = 2,
  1264. CLONE_SYMBOLS_FLAG = 4;
  1265. /** Used to compose bitmasks for value comparisons. */
  1266. var COMPARE_PARTIAL_FLAG = 1,
  1267. COMPARE_UNORDERED_FLAG = 2;
  1268. /** Used to compose bitmasks for function metadata. */
  1269. var WRAP_BIND_FLAG = 1,
  1270. WRAP_BIND_KEY_FLAG = 2,
  1271. WRAP_CURRY_BOUND_FLAG = 4,
  1272. WRAP_CURRY_FLAG = 8,
  1273. WRAP_CURRY_RIGHT_FLAG = 16,
  1274. WRAP_PARTIAL_FLAG = 32,
  1275. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1276. WRAP_ARY_FLAG = 128,
  1277. WRAP_REARG_FLAG = 256,
  1278. WRAP_FLIP_FLAG = 512;
  1279. /** Used as default options for `_.truncate`. */
  1280. var DEFAULT_TRUNC_LENGTH = 30,
  1281. DEFAULT_TRUNC_OMISSION = '...';
  1282. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1283. var HOT_COUNT = 800,
  1284. HOT_SPAN = 16;
  1285. /** Used to indicate the type of lazy iteratees. */
  1286. var LAZY_FILTER_FLAG = 1,
  1287. LAZY_MAP_FLAG = 2,
  1288. LAZY_WHILE_FLAG = 3;
  1289. /** Used as references for various `Number` constants. */
  1290. var INFINITY = 1 / 0,
  1291. MAX_SAFE_INTEGER = 9007199254740991,
  1292. MAX_INTEGER = 1.7976931348623157e+308,
  1293. NAN = 0 / 0;
  1294. /** Used as references for the maximum length and index of an array. */
  1295. var MAX_ARRAY_LENGTH = 4294967295,
  1296. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1297. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1298. /** Used to associate wrap methods with their bit flags. */
  1299. var wrapFlags = [
  1300. ['ary', WRAP_ARY_FLAG],
  1301. ['bind', WRAP_BIND_FLAG],
  1302. ['bindKey', WRAP_BIND_KEY_FLAG],
  1303. ['curry', WRAP_CURRY_FLAG],
  1304. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1305. ['flip', WRAP_FLIP_FLAG],
  1306. ['partial', WRAP_PARTIAL_FLAG],
  1307. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1308. ['rearg', WRAP_REARG_FLAG]
  1309. ];
  1310. /** `Object#toString` result references. */
  1311. var argsTag = '[object Arguments]',
  1312. arrayTag = '[object Array]',
  1313. asyncTag = '[object AsyncFunction]',
  1314. boolTag = '[object Boolean]',
  1315. dateTag = '[object Date]',
  1316. domExcTag = '[object DOMException]',
  1317. errorTag = '[object Error]',
  1318. funcTag = '[object Function]',
  1319. genTag = '[object GeneratorFunction]',
  1320. mapTag = '[object Map]',
  1321. numberTag = '[object Number]',
  1322. nullTag = '[object Null]',
  1323. objectTag = '[object Object]',
  1324. promiseTag = '[object Promise]',
  1325. proxyTag = '[object Proxy]',
  1326. regexpTag = '[object RegExp]',
  1327. setTag = '[object Set]',
  1328. stringTag = '[object String]',
  1329. symbolTag = '[object Symbol]',
  1330. undefinedTag = '[object Undefined]',
  1331. weakMapTag = '[object WeakMap]',
  1332. weakSetTag = '[object WeakSet]';
  1333. var arrayBufferTag = '[object ArrayBuffer]',
  1334. dataViewTag = '[object DataView]',
  1335. float32Tag = '[object Float32Array]',
  1336. float64Tag = '[object Float64Array]',
  1337. int8Tag = '[object Int8Array]',
  1338. int16Tag = '[object Int16Array]',
  1339. int32Tag = '[object Int32Array]',
  1340. uint8Tag = '[object Uint8Array]',
  1341. uint8ClampedTag = '[object Uint8ClampedArray]',
  1342. uint16Tag = '[object Uint16Array]',
  1343. uint32Tag = '[object Uint32Array]';
  1344. /** Used to match empty string literals in compiled template source. */
  1345. var reEmptyStringLeading = /\b__p \+= '';/g,
  1346. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1347. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1348. /** Used to match HTML entities and HTML characters. */
  1349. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1350. reUnescapedHtml = /[&<>"']/g,
  1351. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1352. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1353. /** Used to match template delimiters. */
  1354. var reEscape = /<%-([\s\S]+?)%>/g,
  1355. reEvaluate = /<%([\s\S]+?)%>/g,
  1356. reInterpolate = /<%=([\s\S]+?)%>/g;
  1357. /** Used to match property names within property paths. */
  1358. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1359. reIsPlainProp = /^\w*$/,
  1360. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1361. /**
  1362. * Used to match `RegExp`
  1363. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1364. */
  1365. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1366. reHasRegExpChar = RegExp(reRegExpChar.source);
  1367. /** Used to match leading whitespace. */
  1368. var reTrimStart = /^\s+/;
  1369. /** Used to match a single whitespace character. */
  1370. var reWhitespace = /\s/;
  1371. /** Used to match wrap detail comments. */
  1372. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1373. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1374. reSplitDetails = /,? & /;
  1375. /** Used to match words composed of alphanumeric characters. */
  1376. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1377. /**
  1378. * Used to validate the `validate` option in `_.template` variable.
  1379. *
  1380. * Forbids characters which could potentially change the meaning of the function argument definition:
  1381. * - "()," (modification of function parameters)
  1382. * - "=" (default value)
  1383. * - "[]{}" (destructuring of function parameters)
  1384. * - "/" (beginning of a comment)
  1385. * - whitespace
  1386. */
  1387. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1388. /** Used to match backslashes in property paths. */
  1389. var reEscapeChar = /\\(\\)?/g;
  1390. /**
  1391. * Used to match
  1392. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1393. */
  1394. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1395. /** Used to match `RegExp` flags from their coerced string values. */
  1396. var reFlags = /\w*$/;
  1397. /** Used to detect bad signed hexadecimal string values. */
  1398. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1399. /** Used to detect binary string values. */
  1400. var reIsBinary = /^0b[01]+$/i;
  1401. /** Used to detect host constructors (Safari). */
  1402. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1403. /** Used to detect octal string values. */
  1404. var reIsOctal = /^0o[0-7]+$/i;
  1405. /** Used to detect unsigned integer values. */
  1406. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1407. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1408. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1409. /** Used to ensure capturing order of template delimiters. */
  1410. var reNoMatch = /($^)/;
  1411. /** Used to match unescaped characters in compiled string literals. */
  1412. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1413. /** Used to compose unicode character classes. */
  1414. var rsAstralRange = '\\ud800-\\udfff',
  1415. rsComboMarksRange = '\\u0300-\\u036f',
  1416. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1417. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1418. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1419. rsDingbatRange = '\\u2700-\\u27bf',
  1420. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1421. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1422. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1423. rsPunctuationRange = '\\u2000-\\u206f',
  1424. 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',
  1425. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1426. rsVarRange = '\\ufe0e\\ufe0f',
  1427. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1428. /** Used to compose unicode capture groups. */
  1429. var rsApos = "['\u2019]",
  1430. rsAstral = '[' + rsAstralRange + ']',
  1431. rsBreak = '[' + rsBreakRange + ']',
  1432. rsCombo = '[' + rsComboRange + ']',
  1433. rsDigits = '\\d+',
  1434. rsDingbat = '[' + rsDingbatRange + ']',
  1435. rsLower = '[' + rsLowerRange + ']',
  1436. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1437. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1438. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1439. rsNonAstral = '[^' + rsAstralRange + ']',
  1440. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1441. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1442. rsUpper = '[' + rsUpperRange + ']',
  1443. rsZWJ = '\\u200d';
  1444. /** Used to compose unicode regexes. */
  1445. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1446. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1447. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1448. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1449. reOptMod = rsModifier + '?',
  1450. rsOptVar = '[' + rsVarRange + ']?',
  1451. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1452. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1453. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1454. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1455. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1456. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1457. /** Used to match apostrophes. */
  1458. var reApos = RegExp(rsApos, 'g');
  1459. /**
  1460. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1461. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1462. */
  1463. var reComboMark = RegExp(rsCombo, 'g');
  1464. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1465. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1466. /** Used to match complex or compound words. */
  1467. var reUnicodeWord = RegExp([
  1468. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1469. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1470. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1471. rsUpper + '+' + rsOptContrUpper,
  1472. rsOrdUpper,
  1473. rsOrdLower,
  1474. rsDigits,
  1475. rsEmoji
  1476. ].join('|'), 'g');
  1477. /** 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/). */
  1478. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1479. /** Used to detect strings that need a more robust regexp to match words. */
  1480. 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 ]/;
  1481. /** Used to assign default `context` object properties. */
  1482. var contextProps = [
  1483. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1484. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1485. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1486. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1487. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1488. ];
  1489. /** Used to make template sourceURLs easier to identify. */
  1490. var templateCounter = -1;
  1491. /** Used to identify `toStringTag` values of typed arrays. */
  1492. var typedArrayTags = {};
  1493. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1494. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1495. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1496. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1497. typedArrayTags[uint32Tag] = true;
  1498. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1499. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1500. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1501. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1502. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1503. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1504. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1505. typedArrayTags[weakMapTag] = false;
  1506. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1507. var cloneableTags = {};
  1508. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1509. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1510. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1511. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1512. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1513. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1514. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1515. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1516. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1517. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1518. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1519. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1520. cloneableTags[weakMapTag] = false;
  1521. /** Used to map Latin Unicode letters to basic Latin letters. */
  1522. var deburredLetters = {
  1523. // Latin-1 Supplement block.
  1524. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1525. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1526. '\xc7': 'C', '\xe7': 'c',
  1527. '\xd0': 'D', '\xf0': 'd',
  1528. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1529. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1530. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1531. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1532. '\xd1': 'N', '\xf1': 'n',
  1533. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1534. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1535. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1536. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1537. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1538. '\xc6': 'Ae', '\xe6': 'ae',
  1539. '\xde': 'Th', '\xfe': 'th',
  1540. '\xdf': 'ss',
  1541. // Latin Extended-A block.
  1542. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1543. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1544. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1545. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1546. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1547. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1548. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1549. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1550. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1551. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1552. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1553. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1554. '\u0134': 'J', '\u0135': 'j',
  1555. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1556. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1557. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1558. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1559. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1560. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1561. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1562. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1563. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1564. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1565. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1566. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1567. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1568. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1569. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1570. '\u0174': 'W', '\u0175': 'w',
  1571. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1572. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1573. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1574. '\u0132': 'IJ', '\u0133': 'ij',
  1575. '\u0152': 'Oe', '\u0153': 'oe',
  1576. '\u0149': "'n", '\u017f': 's'
  1577. };
  1578. /** Used to map characters to HTML entities. */
  1579. var htmlEscapes = {
  1580. '&': '&amp;',
  1581. '<': '&lt;',
  1582. '>': '&gt;',
  1583. '"': '&quot;',
  1584. "'": '&#39;'
  1585. };
  1586. /** Used to map HTML entities to characters. */
  1587. var htmlUnescapes = {
  1588. '&amp;': '&',
  1589. '&lt;': '<',
  1590. '&gt;': '>',
  1591. '&quot;': '"',
  1592. '&#39;': "'"
  1593. };
  1594. /** Used to escape characters for inclusion in compiled string literals. */
  1595. var stringEscapes = {
  1596. '\\': '\\',
  1597. "'": "'",
  1598. '\n': 'n',
  1599. '\r': 'r',
  1600. '\u2028': 'u2028',
  1601. '\u2029': 'u2029'
  1602. };
  1603. /** Built-in method references without a dependency on `root`. */
  1604. var freeParseFloat = parseFloat,
  1605. freeParseInt = parseInt;
  1606. /** Detect free variable `global` from Node.js. */
  1607. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1608. /** Detect free variable `self`. */
  1609. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1610. /** Used as a reference to the global object. */
  1611. var root = freeGlobal || freeSelf || Function('return this')();
  1612. /** Detect free variable `exports`. */
  1613. var freeExports = true && exports && !exports.nodeType && exports;
  1614. /** Detect free variable `module`. */
  1615. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1616. /** Detect the popular CommonJS extension `module.exports`. */
  1617. var moduleExports = freeModule && freeModule.exports === freeExports;
  1618. /** Detect free variable `process` from Node.js. */
  1619. var freeProcess = moduleExports && freeGlobal.process;
  1620. /** Used to access faster Node.js helpers. */
  1621. var nodeUtil = (function() {
  1622. try {
  1623. // Use `util.types` for Node.js 10+.
  1624. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1625. if (types) {
  1626. return types;
  1627. }
  1628. // Legacy `process.binding('util')` for Node.js < 10.
  1629. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1630. } catch (e) {}
  1631. }());
  1632. /* Node.js helper references. */
  1633. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1634. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1635. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1636. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1637. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1638. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1639. /*--------------------------------------------------------------------------*/
  1640. /**
  1641. * A faster alternative to `Function#apply`, this function invokes `func`
  1642. * with the `this` binding of `thisArg` and the arguments of `args`.
  1643. *
  1644. * @private
  1645. * @param {Function} func The function to invoke.
  1646. * @param {*} thisArg The `this` binding of `func`.
  1647. * @param {Array} args The arguments to invoke `func` with.
  1648. * @returns {*} Returns the result of `func`.
  1649. */
  1650. function apply(func, thisArg, args) {
  1651. switch (args.length) {
  1652. case 0: return func.call(thisArg);
  1653. case 1: return func.call(thisArg, args[0]);
  1654. case 2: return func.call(thisArg, args[0], args[1]);
  1655. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1656. }
  1657. return func.apply(thisArg, args);
  1658. }
  1659. /**
  1660. * A specialized version of `baseAggregator` for arrays.
  1661. *
  1662. * @private
  1663. * @param {Array} [array] The array to iterate over.
  1664. * @param {Function} setter The function to set `accumulator` values.
  1665. * @param {Function} iteratee The iteratee to transform keys.
  1666. * @param {Object} accumulator The initial aggregated object.
  1667. * @returns {Function} Returns `accumulator`.
  1668. */
  1669. function arrayAggregator(array, setter, iteratee, accumulator) {
  1670. var index = -1,
  1671. length = array == null ? 0 : array.length;
  1672. while (++index < length) {
  1673. var value = array[index];
  1674. setter(accumulator, value, iteratee(value), array);
  1675. }
  1676. return accumulator;
  1677. }
  1678. /**
  1679. * A specialized version of `_.forEach` for arrays without support for
  1680. * iteratee shorthands.
  1681. *
  1682. * @private
  1683. * @param {Array} [array] The array to iterate over.
  1684. * @param {Function} iteratee The function invoked per iteration.
  1685. * @returns {Array} Returns `array`.
  1686. */
  1687. function arrayEach(array, iteratee) {
  1688. var index = -1,
  1689. length = array == null ? 0 : array.length;
  1690. while (++index < length) {
  1691. if (iteratee(array[index], index, array) === false) {
  1692. break;
  1693. }
  1694. }
  1695. return array;
  1696. }
  1697. /**
  1698. * A specialized version of `_.forEachRight` for arrays without support for
  1699. * iteratee shorthands.
  1700. *
  1701. * @private
  1702. * @param {Array} [array] The array to iterate over.
  1703. * @param {Function} iteratee The function invoked per iteration.
  1704. * @returns {Array} Returns `array`.
  1705. */
  1706. function arrayEachRight(array, iteratee) {
  1707. var length = array == null ? 0 : array.length;
  1708. while (length--) {
  1709. if (iteratee(array[length], length, array) === false) {
  1710. break;
  1711. }
  1712. }
  1713. return array;
  1714. }
  1715. /**
  1716. * A specialized version of `_.every` for arrays without support for
  1717. * iteratee shorthands.
  1718. *
  1719. * @private
  1720. * @param {Array} [array] The array to iterate over.
  1721. * @param {Function} predicate The function invoked per iteration.
  1722. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1723. * else `false`.
  1724. */
  1725. function arrayEvery(array, predicate) {
  1726. var index = -1,
  1727. length = array == null ? 0 : array.length;
  1728. while (++index < length) {
  1729. if (!predicate(array[index], index, array)) {
  1730. return false;
  1731. }
  1732. }
  1733. return true;
  1734. }
  1735. /**
  1736. * A specialized version of `_.filter` for arrays without support for
  1737. * iteratee shorthands.
  1738. *
  1739. * @private
  1740. * @param {Array} [array] The array to iterate over.
  1741. * @param {Function} predicate The function invoked per iteration.
  1742. * @returns {Array} Returns the new filtered array.
  1743. */
  1744. function arrayFilter(array, predicate) {
  1745. var index = -1,
  1746. length = array == null ? 0 : array.length,
  1747. resIndex = 0,
  1748. result = [];
  1749. while (++index < length) {
  1750. var value = array[index];
  1751. if (predicate(value, index, array)) {
  1752. result[resIndex++] = value;
  1753. }
  1754. }
  1755. return result;
  1756. }
  1757. /**
  1758. * A specialized version of `_.includes` for arrays without support for
  1759. * specifying an index to search from.
  1760. *
  1761. * @private
  1762. * @param {Array} [array] The array to inspect.
  1763. * @param {*} target The value to search for.
  1764. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1765. */
  1766. function arrayIncludes(array, value) {
  1767. var length = array == null ? 0 : array.length;
  1768. return !!length && baseIndexOf(array, value, 0) > -1;
  1769. }
  1770. /**
  1771. * This function is like `arrayIncludes` except that it accepts a comparator.
  1772. *
  1773. * @private
  1774. * @param {Array} [array] The array to inspect.
  1775. * @param {*} target The value to search for.
  1776. * @param {Function} comparator The comparator invoked per element.
  1777. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1778. */
  1779. function arrayIncludesWith(array, value, comparator) {
  1780. var index = -1,
  1781. length = array == null ? 0 : array.length;
  1782. while (++index < length) {
  1783. if (comparator(value, array[index])) {
  1784. return true;
  1785. }
  1786. }
  1787. return false;
  1788. }
  1789. /**
  1790. * A specialized version of `_.map` for arrays without support for iteratee
  1791. * shorthands.
  1792. *
  1793. * @private
  1794. * @param {Array} [array] The array to iterate over.
  1795. * @param {Function} iteratee The function invoked per iteration.
  1796. * @returns {Array} Returns the new mapped array.
  1797. */
  1798. function arrayMap(array, iteratee) {
  1799. var index = -1,
  1800. length = array == null ? 0 : array.length,
  1801. result = Array(length);
  1802. while (++index < length) {
  1803. result[index] = iteratee(array[index], index, array);
  1804. }
  1805. return result;
  1806. }
  1807. /**
  1808. * Appends the elements of `values` to `array`.
  1809. *
  1810. * @private
  1811. * @param {Array} array The array to modify.
  1812. * @param {Array} values The values to append.
  1813. * @returns {Array} Returns `array`.
  1814. */
  1815. function arrayPush(array, values) {
  1816. var index = -1,
  1817. length = values.length,
  1818. offset = array.length;
  1819. while (++index < length) {
  1820. array[offset + index] = values[index];
  1821. }
  1822. return array;
  1823. }
  1824. /**
  1825. * A specialized version of `_.reduce` for arrays without support for
  1826. * iteratee shorthands.
  1827. *
  1828. * @private
  1829. * @param {Array} [array] The array to iterate over.
  1830. * @param {Function} iteratee The function invoked per iteration.
  1831. * @param {*} [accumulator] The initial value.
  1832. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1833. * the initial value.
  1834. * @returns {*} Returns the accumulated value.
  1835. */
  1836. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1837. var index = -1,
  1838. length = array == null ? 0 : array.length;
  1839. if (initAccum && length) {
  1840. accumulator = array[++index];
  1841. }
  1842. while (++index < length) {
  1843. accumulator = iteratee(accumulator, array[index], index, array);
  1844. }
  1845. return accumulator;
  1846. }
  1847. /**
  1848. * A specialized version of `_.reduceRight` for arrays without support for
  1849. * iteratee shorthands.
  1850. *
  1851. * @private
  1852. * @param {Array} [array] The array to iterate over.
  1853. * @param {Function} iteratee The function invoked per iteration.
  1854. * @param {*} [accumulator] The initial value.
  1855. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1856. * the initial value.
  1857. * @returns {*} Returns the accumulated value.
  1858. */
  1859. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1860. var length = array == null ? 0 : array.length;
  1861. if (initAccum && length) {
  1862. accumulator = array[--length];
  1863. }
  1864. while (length--) {
  1865. accumulator = iteratee(accumulator, array[length], length, array);
  1866. }
  1867. return accumulator;
  1868. }
  1869. /**
  1870. * A specialized version of `_.some` for arrays without support for iteratee
  1871. * shorthands.
  1872. *
  1873. * @private
  1874. * @param {Array} [array] The array to iterate over.
  1875. * @param {Function} predicate The function invoked per iteration.
  1876. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1877. * else `false`.
  1878. */
  1879. function arraySome(array, predicate) {
  1880. var index = -1,
  1881. length = array == null ? 0 : array.length;
  1882. while (++index < length) {
  1883. if (predicate(array[index], index, array)) {
  1884. return true;
  1885. }
  1886. }
  1887. return false;
  1888. }
  1889. /**
  1890. * Gets the size of an ASCII `string`.
  1891. *
  1892. * @private
  1893. * @param {string} string The string inspect.
  1894. * @returns {number} Returns the string size.
  1895. */
  1896. var asciiSize = baseProperty('length');
  1897. /**
  1898. * Converts an ASCII `string` to an array.
  1899. *
  1900. * @private
  1901. * @param {string} string The string to convert.
  1902. * @returns {Array} Returns the converted array.
  1903. */
  1904. function asciiToArray(string) {
  1905. return string.split('');
  1906. }
  1907. /**
  1908. * Splits an ASCII `string` into an array of its words.
  1909. *
  1910. * @private
  1911. * @param {string} The string to inspect.
  1912. * @returns {Array} Returns the words of `string`.
  1913. */
  1914. function asciiWords(string) {
  1915. return string.match(reAsciiWord) || [];
  1916. }
  1917. /**
  1918. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1919. * without support for iteratee shorthands, which iterates over `collection`
  1920. * using `eachFunc`.
  1921. *
  1922. * @private
  1923. * @param {Array|Object} collection The collection to inspect.
  1924. * @param {Function} predicate The function invoked per iteration.
  1925. * @param {Function} eachFunc The function to iterate over `collection`.
  1926. * @returns {*} Returns the found element or its key, else `undefined`.
  1927. */
  1928. function baseFindKey(collection, predicate, eachFunc) {
  1929. var result;
  1930. eachFunc(collection, function(value, key, collection) {
  1931. if (predicate(value, key, collection)) {
  1932. result = key;
  1933. return false;
  1934. }
  1935. });
  1936. return result;
  1937. }
  1938. /**
  1939. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1940. * support for iteratee shorthands.
  1941. *
  1942. * @private
  1943. * @param {Array} array The array to inspect.
  1944. * @param {Function} predicate The function invoked per iteration.
  1945. * @param {number} fromIndex The index to search from.
  1946. * @param {boolean} [fromRight] Specify iterating from right to left.
  1947. * @returns {number} Returns the index of the matched value, else `-1`.
  1948. */
  1949. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1950. var length = array.length,
  1951. index = fromIndex + (fromRight ? 1 : -1);
  1952. while ((fromRight ? index-- : ++index < length)) {
  1953. if (predicate(array[index], index, array)) {
  1954. return index;
  1955. }
  1956. }
  1957. return -1;
  1958. }
  1959. /**
  1960. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1961. *
  1962. * @private
  1963. * @param {Array} array The array to inspect.
  1964. * @param {*} value The value to search for.
  1965. * @param {number} fromIndex The index to search from.
  1966. * @returns {number} Returns the index of the matched value, else `-1`.
  1967. */
  1968. function baseIndexOf(array, value, fromIndex) {
  1969. return value === value
  1970. ? strictIndexOf(array, value, fromIndex)
  1971. : baseFindIndex(array, baseIsNaN, fromIndex);
  1972. }
  1973. /**
  1974. * This function is like `baseIndexOf` except that it accepts a comparator.
  1975. *
  1976. * @private
  1977. * @param {Array} array The array to inspect.
  1978. * @param {*} value The value to search for.
  1979. * @param {number} fromIndex The index to search from.
  1980. * @param {Function} comparator The comparator invoked per element.
  1981. * @returns {number} Returns the index of the matched value, else `-1`.
  1982. */
  1983. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1984. var index = fromIndex - 1,
  1985. length = array.length;
  1986. while (++index < length) {
  1987. if (comparator(array[index], value)) {
  1988. return index;
  1989. }
  1990. }
  1991. return -1;
  1992. }
  1993. /**
  1994. * The base implementation of `_.isNaN` without support for number objects.
  1995. *
  1996. * @private
  1997. * @param {*} value The value to check.
  1998. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1999. */
  2000. function baseIsNaN(value) {
  2001. return value !== value;
  2002. }
  2003. /**
  2004. * The base implementation of `_.mean` and `_.meanBy` without support for
  2005. * iteratee shorthands.
  2006. *
  2007. * @private
  2008. * @param {Array} array The array to iterate over.
  2009. * @param {Function} iteratee The function invoked per iteration.
  2010. * @returns {number} Returns the mean.
  2011. */
  2012. function baseMean(array, iteratee) {
  2013. var length = array == null ? 0 : array.length;
  2014. return length ? (baseSum(array, iteratee) / length) : NAN;
  2015. }
  2016. /**
  2017. * The base implementation of `_.property` without support for deep paths.
  2018. *
  2019. * @private
  2020. * @param {string} key The key of the property to get.
  2021. * @returns {Function} Returns the new accessor function.
  2022. */
  2023. function baseProperty(key) {
  2024. return function(object) {
  2025. return object == null ? undefined : object[key];
  2026. };
  2027. }
  2028. /**
  2029. * The base implementation of `_.propertyOf` without support for deep paths.
  2030. *
  2031. * @private
  2032. * @param {Object} object The object to query.
  2033. * @returns {Function} Returns the new accessor function.
  2034. */
  2035. function basePropertyOf(object) {
  2036. return function(key) {
  2037. return object == null ? undefined : object[key];
  2038. };
  2039. }
  2040. /**
  2041. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2042. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2043. *
  2044. * @private
  2045. * @param {Array|Object} collection The collection to iterate over.
  2046. * @param {Function} iteratee The function invoked per iteration.
  2047. * @param {*} accumulator The initial value.
  2048. * @param {boolean} initAccum Specify using the first or last element of
  2049. * `collection` as the initial value.
  2050. * @param {Function} eachFunc The function to iterate over `collection`.
  2051. * @returns {*} Returns the accumulated value.
  2052. */
  2053. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2054. eachFunc(collection, function(value, index, collection) {
  2055. accumulator = initAccum
  2056. ? (initAccum = false, value)
  2057. : iteratee(accumulator, value, index, collection);
  2058. });
  2059. return accumulator;
  2060. }
  2061. /**
  2062. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2063. * sort order of `array` and replaces criteria objects with their corresponding
  2064. * values.
  2065. *
  2066. * @private
  2067. * @param {Array} array The array to sort.
  2068. * @param {Function} comparer The function to define sort order.
  2069. * @returns {Array} Returns `array`.
  2070. */
  2071. function baseSortBy(array, comparer) {
  2072. var length = array.length;
  2073. array.sort(comparer);
  2074. while (length--) {
  2075. array[length] = array[length].value;
  2076. }
  2077. return array;
  2078. }
  2079. /**
  2080. * The base implementation of `_.sum` and `_.sumBy` without support for
  2081. * iteratee shorthands.
  2082. *
  2083. * @private
  2084. * @param {Array} array The array to iterate over.
  2085. * @param {Function} iteratee The function invoked per iteration.
  2086. * @returns {number} Returns the sum.
  2087. */
  2088. function baseSum(array, iteratee) {
  2089. var result,
  2090. index = -1,
  2091. length = array.length;
  2092. while (++index < length) {
  2093. var current = iteratee(array[index]);
  2094. if (current !== undefined) {
  2095. result = result === undefined ? current : (result + current);
  2096. }
  2097. }
  2098. return result;
  2099. }
  2100. /**
  2101. * The base implementation of `_.times` without support for iteratee shorthands
  2102. * or max array length checks.
  2103. *
  2104. * @private
  2105. * @param {number} n The number of times to invoke `iteratee`.
  2106. * @param {Function} iteratee The function invoked per iteration.
  2107. * @returns {Array} Returns the array of results.
  2108. */
  2109. function baseTimes(n, iteratee) {
  2110. var index = -1,
  2111. result = Array(n);
  2112. while (++index < n) {
  2113. result[index] = iteratee(index);
  2114. }
  2115. return result;
  2116. }
  2117. /**
  2118. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2119. * of key-value pairs for `object` corresponding to the property names 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 key-value pairs.
  2125. */
  2126. function baseToPairs(object, props) {
  2127. return arrayMap(props, function(key) {
  2128. return [key, object[key]];
  2129. });
  2130. }
  2131. /**
  2132. * The base implementation of `_.trim`.
  2133. *
  2134. * @private
  2135. * @param {string} string The string to trim.
  2136. * @returns {string} Returns the trimmed string.
  2137. */
  2138. function baseTrim(string) {
  2139. return string
  2140. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2141. : string;
  2142. }
  2143. /**
  2144. * The base implementation of `_.unary` without support for storing metadata.
  2145. *
  2146. * @private
  2147. * @param {Function} func The function to cap arguments for.
  2148. * @returns {Function} Returns the new capped function.
  2149. */
  2150. function baseUnary(func) {
  2151. return function(value) {
  2152. return func(value);
  2153. };
  2154. }
  2155. /**
  2156. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2157. * array of `object` property values corresponding to the property names
  2158. * of `props`.
  2159. *
  2160. * @private
  2161. * @param {Object} object The object to query.
  2162. * @param {Array} props The property names to get values for.
  2163. * @returns {Object} Returns the array of property values.
  2164. */
  2165. function baseValues(object, props) {
  2166. return arrayMap(props, function(key) {
  2167. return object[key];
  2168. });
  2169. }
  2170. /**
  2171. * Checks if a `cache` value for `key` exists.
  2172. *
  2173. * @private
  2174. * @param {Object} cache The cache to query.
  2175. * @param {string} key The key of the entry to check.
  2176. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2177. */
  2178. function cacheHas(cache, key) {
  2179. return cache.has(key);
  2180. }
  2181. /**
  2182. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2183. * that is not found in the character symbols.
  2184. *
  2185. * @private
  2186. * @param {Array} strSymbols The string symbols to inspect.
  2187. * @param {Array} chrSymbols The character symbols to find.
  2188. * @returns {number} Returns the index of the first unmatched string symbol.
  2189. */
  2190. function charsStartIndex(strSymbols, chrSymbols) {
  2191. var index = -1,
  2192. length = strSymbols.length;
  2193. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2194. return index;
  2195. }
  2196. /**
  2197. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2198. * that is not found in the character symbols.
  2199. *
  2200. * @private
  2201. * @param {Array} strSymbols The string symbols to inspect.
  2202. * @param {Array} chrSymbols The character symbols to find.
  2203. * @returns {number} Returns the index of the last unmatched string symbol.
  2204. */
  2205. function charsEndIndex(strSymbols, chrSymbols) {
  2206. var index = strSymbols.length;
  2207. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2208. return index;
  2209. }
  2210. /**
  2211. * Gets the number of `placeholder` occurrences in `array`.
  2212. *
  2213. * @private
  2214. * @param {Array} array The array to inspect.
  2215. * @param {*} placeholder The placeholder to search for.
  2216. * @returns {number} Returns the placeholder count.
  2217. */
  2218. function countHolders(array, placeholder) {
  2219. var length = array.length,
  2220. result = 0;
  2221. while (length--) {
  2222. if (array[length] === placeholder) {
  2223. ++result;
  2224. }
  2225. }
  2226. return result;
  2227. }
  2228. /**
  2229. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2230. * letters to basic Latin letters.
  2231. *
  2232. * @private
  2233. * @param {string} letter The matched letter to deburr.
  2234. * @returns {string} Returns the deburred letter.
  2235. */
  2236. var deburrLetter = basePropertyOf(deburredLetters);
  2237. /**
  2238. * Used by `_.escape` to convert characters to HTML entities.
  2239. *
  2240. * @private
  2241. * @param {string} chr The matched character to escape.
  2242. * @returns {string} Returns the escaped character.
  2243. */
  2244. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2245. /**
  2246. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2247. *
  2248. * @private
  2249. * @param {string} chr The matched character to escape.
  2250. * @returns {string} Returns the escaped character.
  2251. */
  2252. function escapeStringChar(chr) {
  2253. return '\\' + stringEscapes[chr];
  2254. }
  2255. /**
  2256. * Gets the value at `key` of `object`.
  2257. *
  2258. * @private
  2259. * @param {Object} [object] The object to query.
  2260. * @param {string} key The key of the property to get.
  2261. * @returns {*} Returns the property value.
  2262. */
  2263. function getValue(object, key) {
  2264. return object == null ? undefined : object[key];
  2265. }
  2266. /**
  2267. * Checks if `string` contains Unicode symbols.
  2268. *
  2269. * @private
  2270. * @param {string} string The string to inspect.
  2271. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2272. */
  2273. function hasUnicode(string) {
  2274. return reHasUnicode.test(string);
  2275. }
  2276. /**
  2277. * Checks if `string` contains a word composed of Unicode symbols.
  2278. *
  2279. * @private
  2280. * @param {string} string The string to inspect.
  2281. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2282. */
  2283. function hasUnicodeWord(string) {
  2284. return reHasUnicodeWord.test(string);
  2285. }
  2286. /**
  2287. * Converts `iterator` to an array.
  2288. *
  2289. * @private
  2290. * @param {Object} iterator The iterator to convert.
  2291. * @returns {Array} Returns the converted array.
  2292. */
  2293. function iteratorToArray(iterator) {
  2294. var data,
  2295. result = [];
  2296. while (!(data = iterator.next()).done) {
  2297. result.push(data.value);
  2298. }
  2299. return result;
  2300. }
  2301. /**
  2302. * Converts `map` to its key-value pairs.
  2303. *
  2304. * @private
  2305. * @param {Object} map The map to convert.
  2306. * @returns {Array} Returns the key-value pairs.
  2307. */
  2308. function mapToArray(map) {
  2309. var index = -1,
  2310. result = Array(map.size);
  2311. map.forEach(function(value, key) {
  2312. result[++index] = [key, value];
  2313. });
  2314. return result;
  2315. }
  2316. /**
  2317. * Creates a unary function that invokes `func` with its argument transformed.
  2318. *
  2319. * @private
  2320. * @param {Function} func The function to wrap.
  2321. * @param {Function} transform The argument transform.
  2322. * @returns {Function} Returns the new function.
  2323. */
  2324. function overArg(func, transform) {
  2325. return function(arg) {
  2326. return func(transform(arg));
  2327. };
  2328. }
  2329. /**
  2330. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2331. * and returns an array of their indexes.
  2332. *
  2333. * @private
  2334. * @param {Array} array The array to modify.
  2335. * @param {*} placeholder The placeholder to replace.
  2336. * @returns {Array} Returns the new array of placeholder indexes.
  2337. */
  2338. function replaceHolders(array, placeholder) {
  2339. var index = -1,
  2340. length = array.length,
  2341. resIndex = 0,
  2342. result = [];
  2343. while (++index < length) {
  2344. var value = array[index];
  2345. if (value === placeholder || value === PLACEHOLDER) {
  2346. array[index] = PLACEHOLDER;
  2347. result[resIndex++] = index;
  2348. }
  2349. }
  2350. return result;
  2351. }
  2352. /**
  2353. * Converts `set` to an array of its values.
  2354. *
  2355. * @private
  2356. * @param {Object} set The set to convert.
  2357. * @returns {Array} Returns the values.
  2358. */
  2359. function setToArray(set) {
  2360. var index = -1,
  2361. result = Array(set.size);
  2362. set.forEach(function(value) {
  2363. result[++index] = value;
  2364. });
  2365. return result;
  2366. }
  2367. /**
  2368. * Converts `set` to its value-value pairs.
  2369. *
  2370. * @private
  2371. * @param {Object} set The set to convert.
  2372. * @returns {Array} Returns the value-value pairs.
  2373. */
  2374. function setToPairs(set) {
  2375. var index = -1,
  2376. result = Array(set.size);
  2377. set.forEach(function(value) {
  2378. result[++index] = [value, value];
  2379. });
  2380. return result;
  2381. }
  2382. /**
  2383. * A specialized version of `_.indexOf` which performs strict equality
  2384. * comparisons of values, i.e. `===`.
  2385. *
  2386. * @private
  2387. * @param {Array} array The array to inspect.
  2388. * @param {*} value The value to search for.
  2389. * @param {number} fromIndex The index to search from.
  2390. * @returns {number} Returns the index of the matched value, else `-1`.
  2391. */
  2392. function strictIndexOf(array, value, fromIndex) {
  2393. var index = fromIndex - 1,
  2394. length = array.length;
  2395. while (++index < length) {
  2396. if (array[index] === value) {
  2397. return index;
  2398. }
  2399. }
  2400. return -1;
  2401. }
  2402. /**
  2403. * A specialized version of `_.lastIndexOf` which performs strict equality
  2404. * comparisons of values, i.e. `===`.
  2405. *
  2406. * @private
  2407. * @param {Array} array The array to inspect.
  2408. * @param {*} value The value to search for.
  2409. * @param {number} fromIndex The index to search from.
  2410. * @returns {number} Returns the index of the matched value, else `-1`.
  2411. */
  2412. function strictLastIndexOf(array, value, fromIndex) {
  2413. var index = fromIndex + 1;
  2414. while (index--) {
  2415. if (array[index] === value) {
  2416. return index;
  2417. }
  2418. }
  2419. return index;
  2420. }
  2421. /**
  2422. * Gets the number of symbols in `string`.
  2423. *
  2424. * @private
  2425. * @param {string} string The string to inspect.
  2426. * @returns {number} Returns the string size.
  2427. */
  2428. function stringSize(string) {
  2429. return hasUnicode(string)
  2430. ? unicodeSize(string)
  2431. : asciiSize(string);
  2432. }
  2433. /**
  2434. * Converts `string` to an array.
  2435. *
  2436. * @private
  2437. * @param {string} string The string to convert.
  2438. * @returns {Array} Returns the converted array.
  2439. */
  2440. function stringToArray(string) {
  2441. return hasUnicode(string)
  2442. ? unicodeToArray(string)
  2443. : asciiToArray(string);
  2444. }
  2445. /**
  2446. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2447. * character of `string`.
  2448. *
  2449. * @private
  2450. * @param {string} string The string to inspect.
  2451. * @returns {number} Returns the index of the last non-whitespace character.
  2452. */
  2453. function trimmedEndIndex(string) {
  2454. var index = string.length;
  2455. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2456. return index;
  2457. }
  2458. /**
  2459. * Used by `_.unescape` to convert HTML entities to characters.
  2460. *
  2461. * @private
  2462. * @param {string} chr The matched character to unescape.
  2463. * @returns {string} Returns the unescaped character.
  2464. */
  2465. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2466. /**
  2467. * Gets the size of a Unicode `string`.
  2468. *
  2469. * @private
  2470. * @param {string} string The string inspect.
  2471. * @returns {number} Returns the string size.
  2472. */
  2473. function unicodeSize(string) {
  2474. var result = reUnicode.lastIndex = 0;
  2475. while (reUnicode.test(string)) {
  2476. ++result;
  2477. }
  2478. return result;
  2479. }
  2480. /**
  2481. * Converts a Unicode `string` to an array.
  2482. *
  2483. * @private
  2484. * @param {string} string The string to convert.
  2485. * @returns {Array} Returns the converted array.
  2486. */
  2487. function unicodeToArray(string) {
  2488. return string.match(reUnicode) || [];
  2489. }
  2490. /**
  2491. * Splits a Unicode `string` into an array of its words.
  2492. *
  2493. * @private
  2494. * @param {string} The string to inspect.
  2495. * @returns {Array} Returns the words of `string`.
  2496. */
  2497. function unicodeWords(string) {
  2498. return string.match(reUnicodeWord) || [];
  2499. }
  2500. /*--------------------------------------------------------------------------*/
  2501. /**
  2502. * Create a new pristine `lodash` function using the `context` object.
  2503. *
  2504. * @static
  2505. * @memberOf _
  2506. * @since 1.1.0
  2507. * @category Util
  2508. * @param {Object} [context=root] The context object.
  2509. * @returns {Function} Returns a new `lodash` function.
  2510. * @example
  2511. *
  2512. * _.mixin({ 'foo': _.constant('foo') });
  2513. *
  2514. * var lodash = _.runInContext();
  2515. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2516. *
  2517. * _.isFunction(_.foo);
  2518. * // => true
  2519. * _.isFunction(_.bar);
  2520. * // => false
  2521. *
  2522. * lodash.isFunction(lodash.foo);
  2523. * // => false
  2524. * lodash.isFunction(lodash.bar);
  2525. * // => true
  2526. *
  2527. * // Create a suped-up `defer` in Node.js.
  2528. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2529. */
  2530. var runInContext = (function runInContext(context) {
  2531. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2532. /** Built-in constructor references. */
  2533. var Array = context.Array,
  2534. Date = context.Date,
  2535. Error = context.Error,
  2536. Function = context.Function,
  2537. Math = context.Math,
  2538. Object = context.Object,
  2539. RegExp = context.RegExp,
  2540. String = context.String,
  2541. TypeError = context.TypeError;
  2542. /** Used for built-in method references. */
  2543. var arrayProto = Array.prototype,
  2544. funcProto = Function.prototype,
  2545. objectProto = Object.prototype;
  2546. /** Used to detect overreaching core-js shims. */
  2547. var coreJsData = context['__core-js_shared__'];
  2548. /** Used to resolve the decompiled source of functions. */
  2549. var funcToString = funcProto.toString;
  2550. /** Used to check objects for own properties. */
  2551. var hasOwnProperty = objectProto.hasOwnProperty;
  2552. /** Used to generate unique IDs. */
  2553. var idCounter = 0;
  2554. /** Used to detect methods masquerading as native. */
  2555. var maskSrcKey = (function() {
  2556. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2557. return uid ? ('Symbol(src)_1.' + uid) : '';
  2558. }());
  2559. /**
  2560. * Used to resolve the
  2561. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2562. * of values.
  2563. */
  2564. var nativeObjectToString = objectProto.toString;
  2565. /** Used to infer the `Object` constructor. */
  2566. var objectCtorString = funcToString.call(Object);
  2567. /** Used to restore the original `_` reference in `_.noConflict`. */
  2568. var oldDash = root._;
  2569. /** Used to detect if a method is native. */
  2570. var reIsNative = RegExp('^' +
  2571. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2572. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2573. );
  2574. /** Built-in value references. */
  2575. var Buffer = moduleExports ? context.Buffer : undefined,
  2576. Symbol = context.Symbol,
  2577. Uint8Array = context.Uint8Array,
  2578. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2579. getPrototype = overArg(Object.getPrototypeOf, Object),
  2580. objectCreate = Object.create,
  2581. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2582. splice = arrayProto.splice,
  2583. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2584. symIterator = Symbol ? Symbol.iterator : undefined,
  2585. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2586. var defineProperty = (function() {
  2587. try {
  2588. var func = getNative(Object, 'defineProperty');
  2589. func({}, '', {});
  2590. return func;
  2591. } catch (e) {}
  2592. }());
  2593. /** Mocked built-ins. */
  2594. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2595. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2596. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2597. /* Built-in method references for those with the same name as other `lodash` methods. */
  2598. var nativeCeil = Math.ceil,
  2599. nativeFloor = Math.floor,
  2600. nativeGetSymbols = Object.getOwnPropertySymbols,
  2601. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2602. nativeIsFinite = context.isFinite,
  2603. nativeJoin = arrayProto.join,
  2604. nativeKeys = overArg(Object.keys, Object),
  2605. nativeMax = Math.max,
  2606. nativeMin = Math.min,
  2607. nativeNow = Date.now,
  2608. nativeParseInt = context.parseInt,
  2609. nativeRandom = Math.random,
  2610. nativeReverse = arrayProto.reverse;
  2611. /* Built-in method references that are verified to be native. */
  2612. var DataView = getNative(context, 'DataView'),
  2613. Map = getNative(context, 'Map'),
  2614. Promise = getNative(context, 'Promise'),
  2615. Set = getNative(context, 'Set'),
  2616. WeakMap = getNative(context, 'WeakMap'),
  2617. nativeCreate = getNative(Object, 'create');
  2618. /** Used to store function metadata. */
  2619. var metaMap = WeakMap && new WeakMap;
  2620. /** Used to lookup unminified function names. */
  2621. var realNames = {};
  2622. /** Used to detect maps, sets, and weakmaps. */
  2623. var dataViewCtorString = toSource(DataView),
  2624. mapCtorString = toSource(Map),
  2625. promiseCtorString = toSource(Promise),
  2626. setCtorString = toSource(Set),
  2627. weakMapCtorString = toSource(WeakMap);
  2628. /** Used to convert symbols to primitives and strings. */
  2629. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2630. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2631. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2632. /*------------------------------------------------------------------------*/
  2633. /**
  2634. * Creates a `lodash` object which wraps `value` to enable implicit method
  2635. * chain sequences. Methods that operate on and return arrays, collections,
  2636. * and functions can be chained together. Methods that retrieve a single value
  2637. * or may return a primitive value will automatically end the chain sequence
  2638. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2639. * with `_#value`.
  2640. *
  2641. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2642. * enabled using `_.chain`.
  2643. *
  2644. * The execution of chained methods is lazy, that is, it's deferred until
  2645. * `_#value` is implicitly or explicitly called.
  2646. *
  2647. * Lazy evaluation allows several methods to support shortcut fusion.
  2648. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2649. * the creation of intermediate arrays and can greatly reduce the number of
  2650. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2651. * fusion if the section is applied to an array and iteratees accept only
  2652. * one argument. The heuristic for whether a section qualifies for shortcut
  2653. * fusion is subject to change.
  2654. *
  2655. * Chaining is supported in custom builds as long as the `_#value` method is
  2656. * directly or indirectly included in the build.
  2657. *
  2658. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2659. *
  2660. * The wrapper `Array` methods are:
  2661. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2662. *
  2663. * The wrapper `String` methods are:
  2664. * `replace` and `split`
  2665. *
  2666. * The wrapper methods that support shortcut fusion are:
  2667. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2668. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2669. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2670. *
  2671. * The chainable wrapper methods are:
  2672. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2673. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2674. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2675. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2676. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2677. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2678. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2679. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2680. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2681. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2682. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2683. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2684. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2685. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2686. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2687. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2688. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2689. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2690. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2691. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2692. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2693. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2694. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2695. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2696. *
  2697. * The wrapper methods that are **not** chainable by default are:
  2698. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2699. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2700. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2701. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2702. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2703. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2704. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2705. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2706. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2707. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2708. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2709. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2710. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2711. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2712. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2713. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2714. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2715. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2716. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2717. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2718. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2719. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2720. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2721. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2722. * `upperFirst`, `value`, and `words`
  2723. *
  2724. * @name _
  2725. * @constructor
  2726. * @category Seq
  2727. * @param {*} value The value to wrap in a `lodash` instance.
  2728. * @returns {Object} Returns the new `lodash` wrapper instance.
  2729. * @example
  2730. *
  2731. * function square(n) {
  2732. * return n * n;
  2733. * }
  2734. *
  2735. * var wrapped = _([1, 2, 3]);
  2736. *
  2737. * // Returns an unwrapped value.
  2738. * wrapped.reduce(_.add);
  2739. * // => 6
  2740. *
  2741. * // Returns a wrapped value.
  2742. * var squares = wrapped.map(square);
  2743. *
  2744. * _.isArray(squares);
  2745. * // => false
  2746. *
  2747. * _.isArray(squares.value());
  2748. * // => true
  2749. */
  2750. function lodash(value) {
  2751. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2752. if (value instanceof LodashWrapper) {
  2753. return value;
  2754. }
  2755. if (hasOwnProperty.call(value, '__wrapped__')) {
  2756. return wrapperClone(value);
  2757. }
  2758. }
  2759. return new LodashWrapper(value);
  2760. }
  2761. /**
  2762. * The base implementation of `_.create` without support for assigning
  2763. * properties to the created object.
  2764. *
  2765. * @private
  2766. * @param {Object} proto The object to inherit from.
  2767. * @returns {Object} Returns the new object.
  2768. */
  2769. var baseCreate = (function() {
  2770. function object() {}
  2771. return function(proto) {
  2772. if (!isObject(proto)) {
  2773. return {};
  2774. }
  2775. if (objectCreate) {
  2776. return objectCreate(proto);
  2777. }
  2778. object.prototype = proto;
  2779. var result = new object;
  2780. object.prototype = undefined;
  2781. return result;
  2782. };
  2783. }());
  2784. /**
  2785. * The function whose prototype chain sequence wrappers inherit from.
  2786. *
  2787. * @private
  2788. */
  2789. function baseLodash() {
  2790. // No operation performed.
  2791. }
  2792. /**
  2793. * The base constructor for creating `lodash` wrapper objects.
  2794. *
  2795. * @private
  2796. * @param {*} value The value to wrap.
  2797. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2798. */
  2799. function LodashWrapper(value, chainAll) {
  2800. this.__wrapped__ = value;
  2801. this.__actions__ = [];
  2802. this.__chain__ = !!chainAll;
  2803. this.__index__ = 0;
  2804. this.__values__ = undefined;
  2805. }
  2806. /**
  2807. * By default, the template delimiters used by lodash are like those in
  2808. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2809. * following template settings to use alternative delimiters.
  2810. *
  2811. * @static
  2812. * @memberOf _
  2813. * @type {Object}
  2814. */
  2815. lodash.templateSettings = {
  2816. /**
  2817. * Used to detect `data` property values to be HTML-escaped.
  2818. *
  2819. * @memberOf _.templateSettings
  2820. * @type {RegExp}
  2821. */
  2822. 'escape': reEscape,
  2823. /**
  2824. * Used to detect code to be evaluated.
  2825. *
  2826. * @memberOf _.templateSettings
  2827. * @type {RegExp}
  2828. */
  2829. 'evaluate': reEvaluate,
  2830. /**
  2831. * Used to detect `data` property values to inject.
  2832. *
  2833. * @memberOf _.templateSettings
  2834. * @type {RegExp}
  2835. */
  2836. 'interpolate': reInterpolate,
  2837. /**
  2838. * Used to reference the data object in the template text.
  2839. *
  2840. * @memberOf _.templateSettings
  2841. * @type {string}
  2842. */
  2843. 'variable': '',
  2844. /**
  2845. * Used to import variables into the compiled template.
  2846. *
  2847. * @memberOf _.templateSettings
  2848. * @type {Object}
  2849. */
  2850. 'imports': {
  2851. /**
  2852. * A reference to the `lodash` function.
  2853. *
  2854. * @memberOf _.templateSettings.imports
  2855. * @type {Function}
  2856. */
  2857. '_': lodash
  2858. }
  2859. };
  2860. // Ensure wrappers are instances of `baseLodash`.
  2861. lodash.prototype = baseLodash.prototype;
  2862. lodash.prototype.constructor = lodash;
  2863. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2864. LodashWrapper.prototype.constructor = LodashWrapper;
  2865. /*------------------------------------------------------------------------*/
  2866. /**
  2867. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2868. *
  2869. * @private
  2870. * @constructor
  2871. * @param {*} value The value to wrap.
  2872. */
  2873. function LazyWrapper(value) {
  2874. this.__wrapped__ = value;
  2875. this.__actions__ = [];
  2876. this.__dir__ = 1;
  2877. this.__filtered__ = false;
  2878. this.__iteratees__ = [];
  2879. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2880. this.__views__ = [];
  2881. }
  2882. /**
  2883. * Creates a clone of the lazy wrapper object.
  2884. *
  2885. * @private
  2886. * @name clone
  2887. * @memberOf LazyWrapper
  2888. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2889. */
  2890. function lazyClone() {
  2891. var result = new LazyWrapper(this.__wrapped__);
  2892. result.__actions__ = copyArray(this.__actions__);
  2893. result.__dir__ = this.__dir__;
  2894. result.__filtered__ = this.__filtered__;
  2895. result.__iteratees__ = copyArray(this.__iteratees__);
  2896. result.__takeCount__ = this.__takeCount__;
  2897. result.__views__ = copyArray(this.__views__);
  2898. return result;
  2899. }
  2900. /**
  2901. * Reverses the direction of lazy iteration.
  2902. *
  2903. * @private
  2904. * @name reverse
  2905. * @memberOf LazyWrapper
  2906. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2907. */
  2908. function lazyReverse() {
  2909. if (this.__filtered__) {
  2910. var result = new LazyWrapper(this);
  2911. result.__dir__ = -1;
  2912. result.__filtered__ = true;
  2913. } else {
  2914. result = this.clone();
  2915. result.__dir__ *= -1;
  2916. }
  2917. return result;
  2918. }
  2919. /**
  2920. * Extracts the unwrapped value from its lazy wrapper.
  2921. *
  2922. * @private
  2923. * @name value
  2924. * @memberOf LazyWrapper
  2925. * @returns {*} Returns the unwrapped value.
  2926. */
  2927. function lazyValue() {
  2928. var array = this.__wrapped__.value(),
  2929. dir = this.__dir__,
  2930. isArr = isArray(array),
  2931. isRight = dir < 0,
  2932. arrLength = isArr ? array.length : 0,
  2933. view = getView(0, arrLength, this.__views__),
  2934. start = view.start,
  2935. end = view.end,
  2936. length = end - start,
  2937. index = isRight ? end : (start - 1),
  2938. iteratees = this.__iteratees__,
  2939. iterLength = iteratees.length,
  2940. resIndex = 0,
  2941. takeCount = nativeMin(length, this.__takeCount__);
  2942. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2943. return baseWrapperValue(array, this.__actions__);
  2944. }
  2945. var result = [];
  2946. outer:
  2947. while (length-- && resIndex < takeCount) {
  2948. index += dir;
  2949. var iterIndex = -1,
  2950. value = array[index];
  2951. while (++iterIndex < iterLength) {
  2952. var data = iteratees[iterIndex],
  2953. iteratee = data.iteratee,
  2954. type = data.type,
  2955. computed = iteratee(value);
  2956. if (type == LAZY_MAP_FLAG) {
  2957. value = computed;
  2958. } else if (!computed) {
  2959. if (type == LAZY_FILTER_FLAG) {
  2960. continue outer;
  2961. } else {
  2962. break outer;
  2963. }
  2964. }
  2965. }
  2966. result[resIndex++] = value;
  2967. }
  2968. return result;
  2969. }
  2970. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2971. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2972. LazyWrapper.prototype.constructor = LazyWrapper;
  2973. /*------------------------------------------------------------------------*/
  2974. /**
  2975. * Creates a hash object.
  2976. *
  2977. * @private
  2978. * @constructor
  2979. * @param {Array} [entries] The key-value pairs to cache.
  2980. */
  2981. function Hash(entries) {
  2982. var index = -1,
  2983. length = entries == null ? 0 : entries.length;
  2984. this.clear();
  2985. while (++index < length) {
  2986. var entry = entries[index];
  2987. this.set(entry[0], entry[1]);
  2988. }
  2989. }
  2990. /**
  2991. * Removes all key-value entries from the hash.
  2992. *
  2993. * @private
  2994. * @name clear
  2995. * @memberOf Hash
  2996. */
  2997. function hashClear() {
  2998. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2999. this.size = 0;
  3000. }
  3001. /**
  3002. * Removes `key` and its value from the hash.
  3003. *
  3004. * @private
  3005. * @name delete
  3006. * @memberOf Hash
  3007. * @param {Object} hash The hash to modify.
  3008. * @param {string} key The key of the value to remove.
  3009. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3010. */
  3011. function hashDelete(key) {
  3012. var result = this.has(key) && delete this.__data__[key];
  3013. this.size -= result ? 1 : 0;
  3014. return result;
  3015. }
  3016. /**
  3017. * Gets the hash value for `key`.
  3018. *
  3019. * @private
  3020. * @name get
  3021. * @memberOf Hash
  3022. * @param {string} key The key of the value to get.
  3023. * @returns {*} Returns the entry value.
  3024. */
  3025. function hashGet(key) {
  3026. var data = this.__data__;
  3027. if (nativeCreate) {
  3028. var result = data[key];
  3029. return result === HASH_UNDEFINED ? undefined : result;
  3030. }
  3031. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3032. }
  3033. /**
  3034. * Checks if a hash value for `key` exists.
  3035. *
  3036. * @private
  3037. * @name has
  3038. * @memberOf Hash
  3039. * @param {string} key The key of the entry to check.
  3040. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3041. */
  3042. function hashHas(key) {
  3043. var data = this.__data__;
  3044. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3045. }
  3046. /**
  3047. * Sets the hash `key` to `value`.
  3048. *
  3049. * @private
  3050. * @name set
  3051. * @memberOf Hash
  3052. * @param {string} key The key of the value to set.
  3053. * @param {*} value The value to set.
  3054. * @returns {Object} Returns the hash instance.
  3055. */
  3056. function hashSet(key, value) {
  3057. var data = this.__data__;
  3058. this.size += this.has(key) ? 0 : 1;
  3059. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3060. return this;
  3061. }
  3062. // Add methods to `Hash`.
  3063. Hash.prototype.clear = hashClear;
  3064. Hash.prototype['delete'] = hashDelete;
  3065. Hash.prototype.get = hashGet;
  3066. Hash.prototype.has = hashHas;
  3067. Hash.prototype.set = hashSet;
  3068. /*------------------------------------------------------------------------*/
  3069. /**
  3070. * Creates an list cache object.
  3071. *
  3072. * @private
  3073. * @constructor
  3074. * @param {Array} [entries] The key-value pairs to cache.
  3075. */
  3076. function ListCache(entries) {
  3077. var index = -1,
  3078. length = entries == null ? 0 : entries.length;
  3079. this.clear();
  3080. while (++index < length) {
  3081. var entry = entries[index];
  3082. this.set(entry[0], entry[1]);
  3083. }
  3084. }
  3085. /**
  3086. * Removes all key-value entries from the list cache.
  3087. *
  3088. * @private
  3089. * @name clear
  3090. * @memberOf ListCache
  3091. */
  3092. function listCacheClear() {
  3093. this.__data__ = [];
  3094. this.size = 0;
  3095. }
  3096. /**
  3097. * Removes `key` and its value from the list cache.
  3098. *
  3099. * @private
  3100. * @name delete
  3101. * @memberOf ListCache
  3102. * @param {string} key The key of the value to remove.
  3103. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3104. */
  3105. function listCacheDelete(key) {
  3106. var data = this.__data__,
  3107. index = assocIndexOf(data, key);
  3108. if (index < 0) {
  3109. return false;
  3110. }
  3111. var lastIndex = data.length - 1;
  3112. if (index == lastIndex) {
  3113. data.pop();
  3114. } else {
  3115. splice.call(data, index, 1);
  3116. }
  3117. --this.size;
  3118. return true;
  3119. }
  3120. /**
  3121. * Gets the list cache value for `key`.
  3122. *
  3123. * @private
  3124. * @name get
  3125. * @memberOf ListCache
  3126. * @param {string} key The key of the value to get.
  3127. * @returns {*} Returns the entry value.
  3128. */
  3129. function listCacheGet(key) {
  3130. var data = this.__data__,
  3131. index = assocIndexOf(data, key);
  3132. return index < 0 ? undefined : data[index][1];
  3133. }
  3134. /**
  3135. * Checks if a list cache value for `key` exists.
  3136. *
  3137. * @private
  3138. * @name has
  3139. * @memberOf ListCache
  3140. * @param {string} key The key of the entry to check.
  3141. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3142. */
  3143. function listCacheHas(key) {
  3144. return assocIndexOf(this.__data__, key) > -1;
  3145. }
  3146. /**
  3147. * Sets the list cache `key` to `value`.
  3148. *
  3149. * @private
  3150. * @name set
  3151. * @memberOf ListCache
  3152. * @param {string} key The key of the value to set.
  3153. * @param {*} value The value to set.
  3154. * @returns {Object} Returns the list cache instance.
  3155. */
  3156. function listCacheSet(key, value) {
  3157. var data = this.__data__,
  3158. index = assocIndexOf(data, key);
  3159. if (index < 0) {
  3160. ++this.size;
  3161. data.push([key, value]);
  3162. } else {
  3163. data[index][1] = value;
  3164. }
  3165. return this;
  3166. }
  3167. // Add methods to `ListCache`.
  3168. ListCache.prototype.clear = listCacheClear;
  3169. ListCache.prototype['delete'] = listCacheDelete;
  3170. ListCache.prototype.get = listCacheGet;
  3171. ListCache.prototype.has = listCacheHas;
  3172. ListCache.prototype.set = listCacheSet;
  3173. /*------------------------------------------------------------------------*/
  3174. /**
  3175. * Creates a map cache object to store key-value pairs.
  3176. *
  3177. * @private
  3178. * @constructor
  3179. * @param {Array} [entries] The key-value pairs to cache.
  3180. */
  3181. function MapCache(entries) {
  3182. var index = -1,
  3183. length = entries == null ? 0 : entries.length;
  3184. this.clear();
  3185. while (++index < length) {
  3186. var entry = entries[index];
  3187. this.set(entry[0], entry[1]);
  3188. }
  3189. }
  3190. /**
  3191. * Removes all key-value entries from the map.
  3192. *
  3193. * @private
  3194. * @name clear
  3195. * @memberOf MapCache
  3196. */
  3197. function mapCacheClear() {
  3198. this.size = 0;
  3199. this.__data__ = {
  3200. 'hash': new Hash,
  3201. 'map': new (Map || ListCache),
  3202. 'string': new Hash
  3203. };
  3204. }
  3205. /**
  3206. * Removes `key` and its value from the map.
  3207. *
  3208. * @private
  3209. * @name delete
  3210. * @memberOf MapCache
  3211. * @param {string} key The key of the value to remove.
  3212. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3213. */
  3214. function mapCacheDelete(key) {
  3215. var result = getMapData(this, key)['delete'](key);
  3216. this.size -= result ? 1 : 0;
  3217. return result;
  3218. }
  3219. /**
  3220. * Gets the map value for `key`.
  3221. *
  3222. * @private
  3223. * @name get
  3224. * @memberOf MapCache
  3225. * @param {string} key The key of the value to get.
  3226. * @returns {*} Returns the entry value.
  3227. */
  3228. function mapCacheGet(key) {
  3229. return getMapData(this, key).get(key);
  3230. }
  3231. /**
  3232. * Checks if a map value for `key` exists.
  3233. *
  3234. * @private
  3235. * @name has
  3236. * @memberOf MapCache
  3237. * @param {string} key The key of the entry to check.
  3238. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3239. */
  3240. function mapCacheHas(key) {
  3241. return getMapData(this, key).has(key);
  3242. }
  3243. /**
  3244. * Sets the map `key` to `value`.
  3245. *
  3246. * @private
  3247. * @name set
  3248. * @memberOf MapCache
  3249. * @param {string} key The key of the value to set.
  3250. * @param {*} value The value to set.
  3251. * @returns {Object} Returns the map cache instance.
  3252. */
  3253. function mapCacheSet(key, value) {
  3254. var data = getMapData(this, key),
  3255. size = data.size;
  3256. data.set(key, value);
  3257. this.size += data.size == size ? 0 : 1;
  3258. return this;
  3259. }
  3260. // Add methods to `MapCache`.
  3261. MapCache.prototype.clear = mapCacheClear;
  3262. MapCache.prototype['delete'] = mapCacheDelete;
  3263. MapCache.prototype.get = mapCacheGet;
  3264. MapCache.prototype.has = mapCacheHas;
  3265. MapCache.prototype.set = mapCacheSet;
  3266. /*------------------------------------------------------------------------*/
  3267. /**
  3268. *
  3269. * Creates an array cache object to store unique values.
  3270. *
  3271. * @private
  3272. * @constructor
  3273. * @param {Array} [values] The values to cache.
  3274. */
  3275. function SetCache(values) {
  3276. var index = -1,
  3277. length = values == null ? 0 : values.length;
  3278. this.__data__ = new MapCache;
  3279. while (++index < length) {
  3280. this.add(values[index]);
  3281. }
  3282. }
  3283. /**
  3284. * Adds `value` to the array cache.
  3285. *
  3286. * @private
  3287. * @name add
  3288. * @memberOf SetCache
  3289. * @alias push
  3290. * @param {*} value The value to cache.
  3291. * @returns {Object} Returns the cache instance.
  3292. */
  3293. function setCacheAdd(value) {
  3294. this.__data__.set(value, HASH_UNDEFINED);
  3295. return this;
  3296. }
  3297. /**
  3298. * Checks if `value` is in the array cache.
  3299. *
  3300. * @private
  3301. * @name has
  3302. * @memberOf SetCache
  3303. * @param {*} value The value to search for.
  3304. * @returns {number} Returns `true` if `value` is found, else `false`.
  3305. */
  3306. function setCacheHas(value) {
  3307. return this.__data__.has(value);
  3308. }
  3309. // Add methods to `SetCache`.
  3310. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3311. SetCache.prototype.has = setCacheHas;
  3312. /*------------------------------------------------------------------------*/
  3313. /**
  3314. * Creates a stack cache object to store key-value pairs.
  3315. *
  3316. * @private
  3317. * @constructor
  3318. * @param {Array} [entries] The key-value pairs to cache.
  3319. */
  3320. function Stack(entries) {
  3321. var data = this.__data__ = new ListCache(entries);
  3322. this.size = data.size;
  3323. }
  3324. /**
  3325. * Removes all key-value entries from the stack.
  3326. *
  3327. * @private
  3328. * @name clear
  3329. * @memberOf Stack
  3330. */
  3331. function stackClear() {
  3332. this.__data__ = new ListCache;
  3333. this.size = 0;
  3334. }
  3335. /**
  3336. * Removes `key` and its value from the stack.
  3337. *
  3338. * @private
  3339. * @name delete
  3340. * @memberOf Stack
  3341. * @param {string} key The key of the value to remove.
  3342. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3343. */
  3344. function stackDelete(key) {
  3345. var data = this.__data__,
  3346. result = data['delete'](key);
  3347. this.size = data.size;
  3348. return result;
  3349. }
  3350. /**
  3351. * Gets the stack value for `key`.
  3352. *
  3353. * @private
  3354. * @name get
  3355. * @memberOf Stack
  3356. * @param {string} key The key of the value to get.
  3357. * @returns {*} Returns the entry value.
  3358. */
  3359. function stackGet(key) {
  3360. return this.__data__.get(key);
  3361. }
  3362. /**
  3363. * Checks if a stack value for `key` exists.
  3364. *
  3365. * @private
  3366. * @name has
  3367. * @memberOf Stack
  3368. * @param {string} key The key of the entry to check.
  3369. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3370. */
  3371. function stackHas(key) {
  3372. return this.__data__.has(key);
  3373. }
  3374. /**
  3375. * Sets the stack `key` to `value`.
  3376. *
  3377. * @private
  3378. * @name set
  3379. * @memberOf Stack
  3380. * @param {string} key The key of the value to set.
  3381. * @param {*} value The value to set.
  3382. * @returns {Object} Returns the stack cache instance.
  3383. */
  3384. function stackSet(key, value) {
  3385. var data = this.__data__;
  3386. if (data instanceof ListCache) {
  3387. var pairs = data.__data__;
  3388. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3389. pairs.push([key, value]);
  3390. this.size = ++data.size;
  3391. return this;
  3392. }
  3393. data = this.__data__ = new MapCache(pairs);
  3394. }
  3395. data.set(key, value);
  3396. this.size = data.size;
  3397. return this;
  3398. }
  3399. // Add methods to `Stack`.
  3400. Stack.prototype.clear = stackClear;
  3401. Stack.prototype['delete'] = stackDelete;
  3402. Stack.prototype.get = stackGet;
  3403. Stack.prototype.has = stackHas;
  3404. Stack.prototype.set = stackSet;
  3405. /*------------------------------------------------------------------------*/
  3406. /**
  3407. * Creates an array of the enumerable property names of the array-like `value`.
  3408. *
  3409. * @private
  3410. * @param {*} value The value to query.
  3411. * @param {boolean} inherited Specify returning inherited property names.
  3412. * @returns {Array} Returns the array of property names.
  3413. */
  3414. function arrayLikeKeys(value, inherited) {
  3415. var isArr = isArray(value),
  3416. isArg = !isArr && isArguments(value),
  3417. isBuff = !isArr && !isArg && isBuffer(value),
  3418. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3419. skipIndexes = isArr || isArg || isBuff || isType,
  3420. result = skipIndexes ? baseTimes(value.length, String) : [],
  3421. length = result.length;
  3422. for (var key in value) {
  3423. if ((inherited || hasOwnProperty.call(value, key)) &&
  3424. !(skipIndexes && (
  3425. // Safari 9 has enumerable `arguments.length` in strict mode.
  3426. key == 'length' ||
  3427. // Node.js 0.10 has enumerable non-index properties on buffers.
  3428. (isBuff && (key == 'offset' || key == 'parent')) ||
  3429. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3430. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3431. // Skip index properties.
  3432. isIndex(key, length)
  3433. ))) {
  3434. result.push(key);
  3435. }
  3436. }
  3437. return result;
  3438. }
  3439. /**
  3440. * A specialized version of `_.sample` for arrays.
  3441. *
  3442. * @private
  3443. * @param {Array} array The array to sample.
  3444. * @returns {*} Returns the random element.
  3445. */
  3446. function arraySample(array) {
  3447. var length = array.length;
  3448. return length ? array[baseRandom(0, length - 1)] : undefined;
  3449. }
  3450. /**
  3451. * A specialized version of `_.sampleSize` for arrays.
  3452. *
  3453. * @private
  3454. * @param {Array} array The array to sample.
  3455. * @param {number} n The number of elements to sample.
  3456. * @returns {Array} Returns the random elements.
  3457. */
  3458. function arraySampleSize(array, n) {
  3459. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3460. }
  3461. /**
  3462. * A specialized version of `_.shuffle` for arrays.
  3463. *
  3464. * @private
  3465. * @param {Array} array The array to shuffle.
  3466. * @returns {Array} Returns the new shuffled array.
  3467. */
  3468. function arrayShuffle(array) {
  3469. return shuffleSelf(copyArray(array));
  3470. }
  3471. /**
  3472. * This function is like `assignValue` except that it doesn't assign
  3473. * `undefined` values.
  3474. *
  3475. * @private
  3476. * @param {Object} object The object to modify.
  3477. * @param {string} key The key of the property to assign.
  3478. * @param {*} value The value to assign.
  3479. */
  3480. function assignMergeValue(object, key, value) {
  3481. if ((value !== undefined && !eq(object[key], value)) ||
  3482. (value === undefined && !(key in object))) {
  3483. baseAssignValue(object, key, value);
  3484. }
  3485. }
  3486. /**
  3487. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3488. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3489. * for equality comparisons.
  3490. *
  3491. * @private
  3492. * @param {Object} object The object to modify.
  3493. * @param {string} key The key of the property to assign.
  3494. * @param {*} value The value to assign.
  3495. */
  3496. function assignValue(object, key, value) {
  3497. var objValue = object[key];
  3498. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3499. (value === undefined && !(key in object))) {
  3500. baseAssignValue(object, key, value);
  3501. }
  3502. }
  3503. /**
  3504. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3505. *
  3506. * @private
  3507. * @param {Array} array The array to inspect.
  3508. * @param {*} key The key to search for.
  3509. * @returns {number} Returns the index of the matched value, else `-1`.
  3510. */
  3511. function assocIndexOf(array, key) {
  3512. var length = array.length;
  3513. while (length--) {
  3514. if (eq(array[length][0], key)) {
  3515. return length;
  3516. }
  3517. }
  3518. return -1;
  3519. }
  3520. /**
  3521. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3522. * by `iteratee` and values set by `setter`.
  3523. *
  3524. * @private
  3525. * @param {Array|Object} collection The collection to iterate over.
  3526. * @param {Function} setter The function to set `accumulator` values.
  3527. * @param {Function} iteratee The iteratee to transform keys.
  3528. * @param {Object} accumulator The initial aggregated object.
  3529. * @returns {Function} Returns `accumulator`.
  3530. */
  3531. function baseAggregator(collection, setter, iteratee, accumulator) {
  3532. baseEach(collection, function(value, key, collection) {
  3533. setter(accumulator, value, iteratee(value), collection);
  3534. });
  3535. return accumulator;
  3536. }
  3537. /**
  3538. * The base implementation of `_.assign` without support for multiple sources
  3539. * or `customizer` functions.
  3540. *
  3541. * @private
  3542. * @param {Object} object The destination object.
  3543. * @param {Object} source The source object.
  3544. * @returns {Object} Returns `object`.
  3545. */
  3546. function baseAssign(object, source) {
  3547. return object && copyObject(source, keys(source), object);
  3548. }
  3549. /**
  3550. * The base implementation of `_.assignIn` without support for multiple sources
  3551. * or `customizer` functions.
  3552. *
  3553. * @private
  3554. * @param {Object} object The destination object.
  3555. * @param {Object} source The source object.
  3556. * @returns {Object} Returns `object`.
  3557. */
  3558. function baseAssignIn(object, source) {
  3559. return object && copyObject(source, keysIn(source), object);
  3560. }
  3561. /**
  3562. * The base implementation of `assignValue` and `assignMergeValue` without
  3563. * value checks.
  3564. *
  3565. * @private
  3566. * @param {Object} object The object to modify.
  3567. * @param {string} key The key of the property to assign.
  3568. * @param {*} value The value to assign.
  3569. */
  3570. function baseAssignValue(object, key, value) {
  3571. if (key == '__proto__' && defineProperty) {
  3572. defineProperty(object, key, {
  3573. 'configurable': true,
  3574. 'enumerable': true,
  3575. 'value': value,
  3576. 'writable': true
  3577. });
  3578. } else {
  3579. object[key] = value;
  3580. }
  3581. }
  3582. /**
  3583. * The base implementation of `_.at` without support for individual paths.
  3584. *
  3585. * @private
  3586. * @param {Object} object The object to iterate over.
  3587. * @param {string[]} paths The property paths to pick.
  3588. * @returns {Array} Returns the picked elements.
  3589. */
  3590. function baseAt(object, paths) {
  3591. var index = -1,
  3592. length = paths.length,
  3593. result = Array(length),
  3594. skip = object == null;
  3595. while (++index < length) {
  3596. result[index] = skip ? undefined : get(object, paths[index]);
  3597. }
  3598. return result;
  3599. }
  3600. /**
  3601. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3602. *
  3603. * @private
  3604. * @param {number} number The number to clamp.
  3605. * @param {number} [lower] The lower bound.
  3606. * @param {number} upper The upper bound.
  3607. * @returns {number} Returns the clamped number.
  3608. */
  3609. function baseClamp(number, lower, upper) {
  3610. if (number === number) {
  3611. if (upper !== undefined) {
  3612. number = number <= upper ? number : upper;
  3613. }
  3614. if (lower !== undefined) {
  3615. number = number >= lower ? number : lower;
  3616. }
  3617. }
  3618. return number;
  3619. }
  3620. /**
  3621. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3622. * traversed objects.
  3623. *
  3624. * @private
  3625. * @param {*} value The value to clone.
  3626. * @param {boolean} bitmask The bitmask flags.
  3627. * 1 - Deep clone
  3628. * 2 - Flatten inherited properties
  3629. * 4 - Clone symbols
  3630. * @param {Function} [customizer] The function to customize cloning.
  3631. * @param {string} [key] The key of `value`.
  3632. * @param {Object} [object] The parent object of `value`.
  3633. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3634. * @returns {*} Returns the cloned value.
  3635. */
  3636. function baseClone(value, bitmask, customizer, key, object, stack) {
  3637. var result,
  3638. isDeep = bitmask & CLONE_DEEP_FLAG,
  3639. isFlat = bitmask & CLONE_FLAT_FLAG,
  3640. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3641. if (customizer) {
  3642. result = object ? customizer(value, key, object, stack) : customizer(value);
  3643. }
  3644. if (result !== undefined) {
  3645. return result;
  3646. }
  3647. if (!isObject(value)) {
  3648. return value;
  3649. }
  3650. var isArr = isArray(value);
  3651. if (isArr) {
  3652. result = initCloneArray(value);
  3653. if (!isDeep) {
  3654. return copyArray(value, result);
  3655. }
  3656. } else {
  3657. var tag = getTag(value),
  3658. isFunc = tag == funcTag || tag == genTag;
  3659. if (isBuffer(value)) {
  3660. return cloneBuffer(value, isDeep);
  3661. }
  3662. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3663. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3664. if (!isDeep) {
  3665. return isFlat
  3666. ? copySymbolsIn(value, baseAssignIn(result, value))
  3667. : copySymbols(value, baseAssign(result, value));
  3668. }
  3669. } else {
  3670. if (!cloneableTags[tag]) {
  3671. return object ? value : {};
  3672. }
  3673. result = initCloneByTag(value, tag, isDeep);
  3674. }
  3675. }
  3676. // Check for circular references and return its corresponding clone.
  3677. stack || (stack = new Stack);
  3678. var stacked = stack.get(value);
  3679. if (stacked) {
  3680. return stacked;
  3681. }
  3682. stack.set(value, result);
  3683. if (isSet(value)) {
  3684. value.forEach(function(subValue) {
  3685. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3686. });
  3687. } else if (isMap(value)) {
  3688. value.forEach(function(subValue, key) {
  3689. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3690. });
  3691. }
  3692. var keysFunc = isFull
  3693. ? (isFlat ? getAllKeysIn : getAllKeys)
  3694. : (isFlat ? keysIn : keys);
  3695. var props = isArr ? undefined : keysFunc(value);
  3696. arrayEach(props || value, function(subValue, key) {
  3697. if (props) {
  3698. key = subValue;
  3699. subValue = value[key];
  3700. }
  3701. // Recursively populate clone (susceptible to call stack limits).
  3702. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3703. });
  3704. return result;
  3705. }
  3706. /**
  3707. * The base implementation of `_.conforms` which doesn't clone `source`.
  3708. *
  3709. * @private
  3710. * @param {Object} source The object of property predicates to conform to.
  3711. * @returns {Function} Returns the new spec function.
  3712. */
  3713. function baseConforms(source) {
  3714. var props = keys(source);
  3715. return function(object) {
  3716. return baseConformsTo(object, source, props);
  3717. };
  3718. }
  3719. /**
  3720. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3721. *
  3722. * @private
  3723. * @param {Object} object The object to inspect.
  3724. * @param {Object} source The object of property predicates to conform to.
  3725. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3726. */
  3727. function baseConformsTo(object, source, props) {
  3728. var length = props.length;
  3729. if (object == null) {
  3730. return !length;
  3731. }
  3732. object = Object(object);
  3733. while (length--) {
  3734. var key = props[length],
  3735. predicate = source[key],
  3736. value = object[key];
  3737. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3738. return false;
  3739. }
  3740. }
  3741. return true;
  3742. }
  3743. /**
  3744. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3745. * to provide to `func`.
  3746. *
  3747. * @private
  3748. * @param {Function} func The function to delay.
  3749. * @param {number} wait The number of milliseconds to delay invocation.
  3750. * @param {Array} args The arguments to provide to `func`.
  3751. * @returns {number|Object} Returns the timer id or timeout object.
  3752. */
  3753. function baseDelay(func, wait, args) {
  3754. if (typeof func != 'function') {
  3755. throw new TypeError(FUNC_ERROR_TEXT);
  3756. }
  3757. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3758. }
  3759. /**
  3760. * The base implementation of methods like `_.difference` without support
  3761. * for excluding multiple arrays or iteratee shorthands.
  3762. *
  3763. * @private
  3764. * @param {Array} array The array to inspect.
  3765. * @param {Array} values The values to exclude.
  3766. * @param {Function} [iteratee] The iteratee invoked per element.
  3767. * @param {Function} [comparator] The comparator invoked per element.
  3768. * @returns {Array} Returns the new array of filtered values.
  3769. */
  3770. function baseDifference(array, values, iteratee, comparator) {
  3771. var index = -1,
  3772. includes = arrayIncludes,
  3773. isCommon = true,
  3774. length = array.length,
  3775. result = [],
  3776. valuesLength = values.length;
  3777. if (!length) {
  3778. return result;
  3779. }
  3780. if (iteratee) {
  3781. values = arrayMap(values, baseUnary(iteratee));
  3782. }
  3783. if (comparator) {
  3784. includes = arrayIncludesWith;
  3785. isCommon = false;
  3786. }
  3787. else if (values.length >= LARGE_ARRAY_SIZE) {
  3788. includes = cacheHas;
  3789. isCommon = false;
  3790. values = new SetCache(values);
  3791. }
  3792. outer:
  3793. while (++index < length) {
  3794. var value = array[index],
  3795. computed = iteratee == null ? value : iteratee(value);
  3796. value = (comparator || value !== 0) ? value : 0;
  3797. if (isCommon && computed === computed) {
  3798. var valuesIndex = valuesLength;
  3799. while (valuesIndex--) {
  3800. if (values[valuesIndex] === computed) {
  3801. continue outer;
  3802. }
  3803. }
  3804. result.push(value);
  3805. }
  3806. else if (!includes(values, computed, comparator)) {
  3807. result.push(value);
  3808. }
  3809. }
  3810. return result;
  3811. }
  3812. /**
  3813. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3814. *
  3815. * @private
  3816. * @param {Array|Object} collection The collection to iterate over.
  3817. * @param {Function} iteratee The function invoked per iteration.
  3818. * @returns {Array|Object} Returns `collection`.
  3819. */
  3820. var baseEach = createBaseEach(baseForOwn);
  3821. /**
  3822. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3823. *
  3824. * @private
  3825. * @param {Array|Object} collection The collection to iterate over.
  3826. * @param {Function} iteratee The function invoked per iteration.
  3827. * @returns {Array|Object} Returns `collection`.
  3828. */
  3829. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3830. /**
  3831. * The base implementation of `_.every` without support for iteratee shorthands.
  3832. *
  3833. * @private
  3834. * @param {Array|Object} collection The collection to iterate over.
  3835. * @param {Function} predicate The function invoked per iteration.
  3836. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3837. * else `false`
  3838. */
  3839. function baseEvery(collection, predicate) {
  3840. var result = true;
  3841. baseEach(collection, function(value, index, collection) {
  3842. result = !!predicate(value, index, collection);
  3843. return result;
  3844. });
  3845. return result;
  3846. }
  3847. /**
  3848. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3849. * `comparator` to determine the extremum value.
  3850. *
  3851. * @private
  3852. * @param {Array} array The array to iterate over.
  3853. * @param {Function} iteratee The iteratee invoked per iteration.
  3854. * @param {Function} comparator The comparator used to compare values.
  3855. * @returns {*} Returns the extremum value.
  3856. */
  3857. function baseExtremum(array, iteratee, comparator) {
  3858. var index = -1,
  3859. length = array.length;
  3860. while (++index < length) {
  3861. var value = array[index],
  3862. current = iteratee(value);
  3863. if (current != null && (computed === undefined
  3864. ? (current === current && !isSymbol(current))
  3865. : comparator(current, computed)
  3866. )) {
  3867. var computed = current,
  3868. result = value;
  3869. }
  3870. }
  3871. return result;
  3872. }
  3873. /**
  3874. * The base implementation of `_.fill` without an iteratee call guard.
  3875. *
  3876. * @private
  3877. * @param {Array} array The array to fill.
  3878. * @param {*} value The value to fill `array` with.
  3879. * @param {number} [start=0] The start position.
  3880. * @param {number} [end=array.length] The end position.
  3881. * @returns {Array} Returns `array`.
  3882. */
  3883. function baseFill(array, value, start, end) {
  3884. var length = array.length;
  3885. start = toInteger(start);
  3886. if (start < 0) {
  3887. start = -start > length ? 0 : (length + start);
  3888. }
  3889. end = (end === undefined || end > length) ? length : toInteger(end);
  3890. if (end < 0) {
  3891. end += length;
  3892. }
  3893. end = start > end ? 0 : toLength(end);
  3894. while (start < end) {
  3895. array[start++] = value;
  3896. }
  3897. return array;
  3898. }
  3899. /**
  3900. * The base implementation of `_.filter` without support for iteratee shorthands.
  3901. *
  3902. * @private
  3903. * @param {Array|Object} collection The collection to iterate over.
  3904. * @param {Function} predicate The function invoked per iteration.
  3905. * @returns {Array} Returns the new filtered array.
  3906. */
  3907. function baseFilter(collection, predicate) {
  3908. var result = [];
  3909. baseEach(collection, function(value, index, collection) {
  3910. if (predicate(value, index, collection)) {
  3911. result.push(value);
  3912. }
  3913. });
  3914. return result;
  3915. }
  3916. /**
  3917. * The base implementation of `_.flatten` with support for restricting flattening.
  3918. *
  3919. * @private
  3920. * @param {Array} array The array to flatten.
  3921. * @param {number} depth The maximum recursion depth.
  3922. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3923. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3924. * @param {Array} [result=[]] The initial result value.
  3925. * @returns {Array} Returns the new flattened array.
  3926. */
  3927. function baseFlatten(array, depth, predicate, isStrict, result) {
  3928. var index = -1,
  3929. length = array.length;
  3930. predicate || (predicate = isFlattenable);
  3931. result || (result = []);
  3932. while (++index < length) {
  3933. var value = array[index];
  3934. if (depth > 0 && predicate(value)) {
  3935. if (depth > 1) {
  3936. // Recursively flatten arrays (susceptible to call stack limits).
  3937. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3938. } else {
  3939. arrayPush(result, value);
  3940. }
  3941. } else if (!isStrict) {
  3942. result[result.length] = value;
  3943. }
  3944. }
  3945. return result;
  3946. }
  3947. /**
  3948. * The base implementation of `baseForOwn` which iterates over `object`
  3949. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3950. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3951. *
  3952. * @private
  3953. * @param {Object} object The object to iterate over.
  3954. * @param {Function} iteratee The function invoked per iteration.
  3955. * @param {Function} keysFunc The function to get the keys of `object`.
  3956. * @returns {Object} Returns `object`.
  3957. */
  3958. var baseFor = createBaseFor();
  3959. /**
  3960. * This function is like `baseFor` except that it iterates over properties
  3961. * in the opposite order.
  3962. *
  3963. * @private
  3964. * @param {Object} object The object to iterate over.
  3965. * @param {Function} iteratee The function invoked per iteration.
  3966. * @param {Function} keysFunc The function to get the keys of `object`.
  3967. * @returns {Object} Returns `object`.
  3968. */
  3969. var baseForRight = createBaseFor(true);
  3970. /**
  3971. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3972. *
  3973. * @private
  3974. * @param {Object} object The object to iterate over.
  3975. * @param {Function} iteratee The function invoked per iteration.
  3976. * @returns {Object} Returns `object`.
  3977. */
  3978. function baseForOwn(object, iteratee) {
  3979. return object && baseFor(object, iteratee, keys);
  3980. }
  3981. /**
  3982. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3983. *
  3984. * @private
  3985. * @param {Object} object The object to iterate over.
  3986. * @param {Function} iteratee The function invoked per iteration.
  3987. * @returns {Object} Returns `object`.
  3988. */
  3989. function baseForOwnRight(object, iteratee) {
  3990. return object && baseForRight(object, iteratee, keys);
  3991. }
  3992. /**
  3993. * The base implementation of `_.functions` which creates an array of
  3994. * `object` function property names filtered from `props`.
  3995. *
  3996. * @private
  3997. * @param {Object} object The object to inspect.
  3998. * @param {Array} props The property names to filter.
  3999. * @returns {Array} Returns the function names.
  4000. */
  4001. function baseFunctions(object, props) {
  4002. return arrayFilter(props, function(key) {
  4003. return isFunction(object[key]);
  4004. });
  4005. }
  4006. /**
  4007. * The base implementation of `_.get` without support for default values.
  4008. *
  4009. * @private
  4010. * @param {Object} object The object to query.
  4011. * @param {Array|string} path The path of the property to get.
  4012. * @returns {*} Returns the resolved value.
  4013. */
  4014. function baseGet(object, path) {
  4015. path = castPath(path, object);
  4016. var index = 0,
  4017. length = path.length;
  4018. while (object != null && index < length) {
  4019. object = object[toKey(path[index++])];
  4020. }
  4021. return (index && index == length) ? object : undefined;
  4022. }
  4023. /**
  4024. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4025. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4026. * symbols of `object`.
  4027. *
  4028. * @private
  4029. * @param {Object} object The object to query.
  4030. * @param {Function} keysFunc The function to get the keys of `object`.
  4031. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4032. * @returns {Array} Returns the array of property names and symbols.
  4033. */
  4034. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4035. var result = keysFunc(object);
  4036. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4037. }
  4038. /**
  4039. * The base implementation of `getTag` without fallbacks for buggy environments.
  4040. *
  4041. * @private
  4042. * @param {*} value The value to query.
  4043. * @returns {string} Returns the `toStringTag`.
  4044. */
  4045. function baseGetTag(value) {
  4046. if (value == null) {
  4047. return value === undefined ? undefinedTag : nullTag;
  4048. }
  4049. return (symToStringTag && symToStringTag in Object(value))
  4050. ? getRawTag(value)
  4051. : objectToString(value);
  4052. }
  4053. /**
  4054. * The base implementation of `_.gt` which doesn't coerce arguments.
  4055. *
  4056. * @private
  4057. * @param {*} value The value to compare.
  4058. * @param {*} other The other value to compare.
  4059. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4060. * else `false`.
  4061. */
  4062. function baseGt(value, other) {
  4063. return value > other;
  4064. }
  4065. /**
  4066. * The base implementation of `_.has` without support for deep paths.
  4067. *
  4068. * @private
  4069. * @param {Object} [object] The object to query.
  4070. * @param {Array|string} key The key to check.
  4071. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4072. */
  4073. function baseHas(object, key) {
  4074. return object != null && hasOwnProperty.call(object, key);
  4075. }
  4076. /**
  4077. * The base implementation of `_.hasIn` without support for deep paths.
  4078. *
  4079. * @private
  4080. * @param {Object} [object] The object to query.
  4081. * @param {Array|string} key The key to check.
  4082. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4083. */
  4084. function baseHasIn(object, key) {
  4085. return object != null && key in Object(object);
  4086. }
  4087. /**
  4088. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4089. *
  4090. * @private
  4091. * @param {number} number The number to check.
  4092. * @param {number} start The start of the range.
  4093. * @param {number} end The end of the range.
  4094. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4095. */
  4096. function baseInRange(number, start, end) {
  4097. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4098. }
  4099. /**
  4100. * The base implementation of methods like `_.intersection`, without support
  4101. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4102. *
  4103. * @private
  4104. * @param {Array} arrays The arrays to inspect.
  4105. * @param {Function} [iteratee] The iteratee invoked per element.
  4106. * @param {Function} [comparator] The comparator invoked per element.
  4107. * @returns {Array} Returns the new array of shared values.
  4108. */
  4109. function baseIntersection(arrays, iteratee, comparator) {
  4110. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4111. length = arrays[0].length,
  4112. othLength = arrays.length,
  4113. othIndex = othLength,
  4114. caches = Array(othLength),
  4115. maxLength = Infinity,
  4116. result = [];
  4117. while (othIndex--) {
  4118. var array = arrays[othIndex];
  4119. if (othIndex && iteratee) {
  4120. array = arrayMap(array, baseUnary(iteratee));
  4121. }
  4122. maxLength = nativeMin(array.length, maxLength);
  4123. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4124. ? new SetCache(othIndex && array)
  4125. : undefined;
  4126. }
  4127. array = arrays[0];
  4128. var index = -1,
  4129. seen = caches[0];
  4130. outer:
  4131. while (++index < length && result.length < maxLength) {
  4132. var value = array[index],
  4133. computed = iteratee ? iteratee(value) : value;
  4134. value = (comparator || value !== 0) ? value : 0;
  4135. if (!(seen
  4136. ? cacheHas(seen, computed)
  4137. : includes(result, computed, comparator)
  4138. )) {
  4139. othIndex = othLength;
  4140. while (--othIndex) {
  4141. var cache = caches[othIndex];
  4142. if (!(cache
  4143. ? cacheHas(cache, computed)
  4144. : includes(arrays[othIndex], computed, comparator))
  4145. ) {
  4146. continue outer;
  4147. }
  4148. }
  4149. if (seen) {
  4150. seen.push(computed);
  4151. }
  4152. result.push(value);
  4153. }
  4154. }
  4155. return result;
  4156. }
  4157. /**
  4158. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4159. * `object` with values transformed by `iteratee` and set by `setter`.
  4160. *
  4161. * @private
  4162. * @param {Object} object The object to iterate over.
  4163. * @param {Function} setter The function to set `accumulator` values.
  4164. * @param {Function} iteratee The iteratee to transform values.
  4165. * @param {Object} accumulator The initial inverted object.
  4166. * @returns {Function} Returns `accumulator`.
  4167. */
  4168. function baseInverter(object, setter, iteratee, accumulator) {
  4169. baseForOwn(object, function(value, key, object) {
  4170. setter(accumulator, iteratee(value), key, object);
  4171. });
  4172. return accumulator;
  4173. }
  4174. /**
  4175. * The base implementation of `_.invoke` without support for individual
  4176. * method arguments.
  4177. *
  4178. * @private
  4179. * @param {Object} object The object to query.
  4180. * @param {Array|string} path The path of the method to invoke.
  4181. * @param {Array} args The arguments to invoke the method with.
  4182. * @returns {*} Returns the result of the invoked method.
  4183. */
  4184. function baseInvoke(object, path, args) {
  4185. path = castPath(path, object);
  4186. object = parent(object, path);
  4187. var func = object == null ? object : object[toKey(last(path))];
  4188. return func == null ? undefined : apply(func, object, args);
  4189. }
  4190. /**
  4191. * The base implementation of `_.isArguments`.
  4192. *
  4193. * @private
  4194. * @param {*} value The value to check.
  4195. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4196. */
  4197. function baseIsArguments(value) {
  4198. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4199. }
  4200. /**
  4201. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4202. *
  4203. * @private
  4204. * @param {*} value The value to check.
  4205. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4206. */
  4207. function baseIsArrayBuffer(value) {
  4208. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4209. }
  4210. /**
  4211. * The base implementation of `_.isDate` without Node.js optimizations.
  4212. *
  4213. * @private
  4214. * @param {*} value The value to check.
  4215. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4216. */
  4217. function baseIsDate(value) {
  4218. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4219. }
  4220. /**
  4221. * The base implementation of `_.isEqual` which supports partial comparisons
  4222. * and tracks traversed objects.
  4223. *
  4224. * @private
  4225. * @param {*} value The value to compare.
  4226. * @param {*} other The other value to compare.
  4227. * @param {boolean} bitmask The bitmask flags.
  4228. * 1 - Unordered comparison
  4229. * 2 - Partial comparison
  4230. * @param {Function} [customizer] The function to customize comparisons.
  4231. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4232. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4233. */
  4234. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4235. if (value === other) {
  4236. return true;
  4237. }
  4238. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4239. return value !== value && other !== other;
  4240. }
  4241. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4242. }
  4243. /**
  4244. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4245. * deep comparisons and tracks traversed objects enabling objects with circular
  4246. * references to be compared.
  4247. *
  4248. * @private
  4249. * @param {Object} object The object to compare.
  4250. * @param {Object} other The other object to compare.
  4251. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4252. * @param {Function} customizer The function to customize comparisons.
  4253. * @param {Function} equalFunc The function to determine equivalents of values.
  4254. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4255. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4256. */
  4257. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4258. var objIsArr = isArray(object),
  4259. othIsArr = isArray(other),
  4260. objTag = objIsArr ? arrayTag : getTag(object),
  4261. othTag = othIsArr ? arrayTag : getTag(other);
  4262. objTag = objTag == argsTag ? objectTag : objTag;
  4263. othTag = othTag == argsTag ? objectTag : othTag;
  4264. var objIsObj = objTag == objectTag,
  4265. othIsObj = othTag == objectTag,
  4266. isSameTag = objTag == othTag;
  4267. if (isSameTag && isBuffer(object)) {
  4268. if (!isBuffer(other)) {
  4269. return false;
  4270. }
  4271. objIsArr = true;
  4272. objIsObj = false;
  4273. }
  4274. if (isSameTag && !objIsObj) {
  4275. stack || (stack = new Stack);
  4276. return (objIsArr || isTypedArray(object))
  4277. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4278. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4279. }
  4280. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4281. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4282. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4283. if (objIsWrapped || othIsWrapped) {
  4284. var objUnwrapped = objIsWrapped ? object.value() : object,
  4285. othUnwrapped = othIsWrapped ? other.value() : other;
  4286. stack || (stack = new Stack);
  4287. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4288. }
  4289. }
  4290. if (!isSameTag) {
  4291. return false;
  4292. }
  4293. stack || (stack = new Stack);
  4294. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4295. }
  4296. /**
  4297. * The base implementation of `_.isMap` without Node.js optimizations.
  4298. *
  4299. * @private
  4300. * @param {*} value The value to check.
  4301. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4302. */
  4303. function baseIsMap(value) {
  4304. return isObjectLike(value) && getTag(value) == mapTag;
  4305. }
  4306. /**
  4307. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4308. *
  4309. * @private
  4310. * @param {Object} object The object to inspect.
  4311. * @param {Object} source The object of property values to match.
  4312. * @param {Array} matchData The property names, values, and compare flags to match.
  4313. * @param {Function} [customizer] The function to customize comparisons.
  4314. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4315. */
  4316. function baseIsMatch(object, source, matchData, customizer) {
  4317. var index = matchData.length,
  4318. length = index,
  4319. noCustomizer = !customizer;
  4320. if (object == null) {
  4321. return !length;
  4322. }
  4323. object = Object(object);
  4324. while (index--) {
  4325. var data = matchData[index];
  4326. if ((noCustomizer && data[2])
  4327. ? data[1] !== object[data[0]]
  4328. : !(data[0] in object)
  4329. ) {
  4330. return false;
  4331. }
  4332. }
  4333. while (++index < length) {
  4334. data = matchData[index];
  4335. var key = data[0],
  4336. objValue = object[key],
  4337. srcValue = data[1];
  4338. if (noCustomizer && data[2]) {
  4339. if (objValue === undefined && !(key in object)) {
  4340. return false;
  4341. }
  4342. } else {
  4343. var stack = new Stack;
  4344. if (customizer) {
  4345. var result = customizer(objValue, srcValue, key, object, source, stack);
  4346. }
  4347. if (!(result === undefined
  4348. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4349. : result
  4350. )) {
  4351. return false;
  4352. }
  4353. }
  4354. }
  4355. return true;
  4356. }
  4357. /**
  4358. * The base implementation of `_.isNative` without bad shim checks.
  4359. *
  4360. * @private
  4361. * @param {*} value The value to check.
  4362. * @returns {boolean} Returns `true` if `value` is a native function,
  4363. * else `false`.
  4364. */
  4365. function baseIsNative(value) {
  4366. if (!isObject(value) || isMasked(value)) {
  4367. return false;
  4368. }
  4369. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4370. return pattern.test(toSource(value));
  4371. }
  4372. /**
  4373. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4374. *
  4375. * @private
  4376. * @param {*} value The value to check.
  4377. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4378. */
  4379. function baseIsRegExp(value) {
  4380. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4381. }
  4382. /**
  4383. * The base implementation of `_.isSet` without Node.js optimizations.
  4384. *
  4385. * @private
  4386. * @param {*} value The value to check.
  4387. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4388. */
  4389. function baseIsSet(value) {
  4390. return isObjectLike(value) && getTag(value) == setTag;
  4391. }
  4392. /**
  4393. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4394. *
  4395. * @private
  4396. * @param {*} value The value to check.
  4397. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4398. */
  4399. function baseIsTypedArray(value) {
  4400. return isObjectLike(value) &&
  4401. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4402. }
  4403. /**
  4404. * The base implementation of `_.iteratee`.
  4405. *
  4406. * @private
  4407. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4408. * @returns {Function} Returns the iteratee.
  4409. */
  4410. function baseIteratee(value) {
  4411. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4412. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4413. if (typeof value == 'function') {
  4414. return value;
  4415. }
  4416. if (value == null) {
  4417. return identity;
  4418. }
  4419. if (typeof value == 'object') {
  4420. return isArray(value)
  4421. ? baseMatchesProperty(value[0], value[1])
  4422. : baseMatches(value);
  4423. }
  4424. return property(value);
  4425. }
  4426. /**
  4427. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4428. *
  4429. * @private
  4430. * @param {Object} object The object to query.
  4431. * @returns {Array} Returns the array of property names.
  4432. */
  4433. function baseKeys(object) {
  4434. if (!isPrototype(object)) {
  4435. return nativeKeys(object);
  4436. }
  4437. var result = [];
  4438. for (var key in Object(object)) {
  4439. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4440. result.push(key);
  4441. }
  4442. }
  4443. return result;
  4444. }
  4445. /**
  4446. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4447. *
  4448. * @private
  4449. * @param {Object} object The object to query.
  4450. * @returns {Array} Returns the array of property names.
  4451. */
  4452. function baseKeysIn(object) {
  4453. if (!isObject(object)) {
  4454. return nativeKeysIn(object);
  4455. }
  4456. var isProto = isPrototype(object),
  4457. result = [];
  4458. for (var key in object) {
  4459. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4460. result.push(key);
  4461. }
  4462. }
  4463. return result;
  4464. }
  4465. /**
  4466. * The base implementation of `_.lt` which doesn't coerce arguments.
  4467. *
  4468. * @private
  4469. * @param {*} value The value to compare.
  4470. * @param {*} other The other value to compare.
  4471. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4472. * else `false`.
  4473. */
  4474. function baseLt(value, other) {
  4475. return value < other;
  4476. }
  4477. /**
  4478. * The base implementation of `_.map` without support for iteratee shorthands.
  4479. *
  4480. * @private
  4481. * @param {Array|Object} collection The collection to iterate over.
  4482. * @param {Function} iteratee The function invoked per iteration.
  4483. * @returns {Array} Returns the new mapped array.
  4484. */
  4485. function baseMap(collection, iteratee) {
  4486. var index = -1,
  4487. result = isArrayLike(collection) ? Array(collection.length) : [];
  4488. baseEach(collection, function(value, key, collection) {
  4489. result[++index] = iteratee(value, key, collection);
  4490. });
  4491. return result;
  4492. }
  4493. /**
  4494. * The base implementation of `_.matches` which doesn't clone `source`.
  4495. *
  4496. * @private
  4497. * @param {Object} source The object of property values to match.
  4498. * @returns {Function} Returns the new spec function.
  4499. */
  4500. function baseMatches(source) {
  4501. var matchData = getMatchData(source);
  4502. if (matchData.length == 1 && matchData[0][2]) {
  4503. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4504. }
  4505. return function(object) {
  4506. return object === source || baseIsMatch(object, source, matchData);
  4507. };
  4508. }
  4509. /**
  4510. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4511. *
  4512. * @private
  4513. * @param {string} path The path of the property to get.
  4514. * @param {*} srcValue The value to match.
  4515. * @returns {Function} Returns the new spec function.
  4516. */
  4517. function baseMatchesProperty(path, srcValue) {
  4518. if (isKey(path) && isStrictComparable(srcValue)) {
  4519. return matchesStrictComparable(toKey(path), srcValue);
  4520. }
  4521. return function(object) {
  4522. var objValue = get(object, path);
  4523. return (objValue === undefined && objValue === srcValue)
  4524. ? hasIn(object, path)
  4525. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4526. };
  4527. }
  4528. /**
  4529. * The base implementation of `_.merge` without support for multiple sources.
  4530. *
  4531. * @private
  4532. * @param {Object} object The destination object.
  4533. * @param {Object} source The source object.
  4534. * @param {number} srcIndex The index of `source`.
  4535. * @param {Function} [customizer] The function to customize merged values.
  4536. * @param {Object} [stack] Tracks traversed source values and their merged
  4537. * counterparts.
  4538. */
  4539. function baseMerge(object, source, srcIndex, customizer, stack) {
  4540. if (object === source) {
  4541. return;
  4542. }
  4543. baseFor(source, function(srcValue, key) {
  4544. stack || (stack = new Stack);
  4545. if (isObject(srcValue)) {
  4546. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4547. }
  4548. else {
  4549. var newValue = customizer
  4550. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4551. : undefined;
  4552. if (newValue === undefined) {
  4553. newValue = srcValue;
  4554. }
  4555. assignMergeValue(object, key, newValue);
  4556. }
  4557. }, keysIn);
  4558. }
  4559. /**
  4560. * A specialized version of `baseMerge` for arrays and objects which performs
  4561. * deep merges and tracks traversed objects enabling objects with circular
  4562. * references to be merged.
  4563. *
  4564. * @private
  4565. * @param {Object} object The destination object.
  4566. * @param {Object} source The source object.
  4567. * @param {string} key The key of the value to merge.
  4568. * @param {number} srcIndex The index of `source`.
  4569. * @param {Function} mergeFunc The function to merge values.
  4570. * @param {Function} [customizer] The function to customize assigned values.
  4571. * @param {Object} [stack] Tracks traversed source values and their merged
  4572. * counterparts.
  4573. */
  4574. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4575. var objValue = safeGet(object, key),
  4576. srcValue = safeGet(source, key),
  4577. stacked = stack.get(srcValue);
  4578. if (stacked) {
  4579. assignMergeValue(object, key, stacked);
  4580. return;
  4581. }
  4582. var newValue = customizer
  4583. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4584. : undefined;
  4585. var isCommon = newValue === undefined;
  4586. if (isCommon) {
  4587. var isArr = isArray(srcValue),
  4588. isBuff = !isArr && isBuffer(srcValue),
  4589. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4590. newValue = srcValue;
  4591. if (isArr || isBuff || isTyped) {
  4592. if (isArray(objValue)) {
  4593. newValue = objValue;
  4594. }
  4595. else if (isArrayLikeObject(objValue)) {
  4596. newValue = copyArray(objValue);
  4597. }
  4598. else if (isBuff) {
  4599. isCommon = false;
  4600. newValue = cloneBuffer(srcValue, true);
  4601. }
  4602. else if (isTyped) {
  4603. isCommon = false;
  4604. newValue = cloneTypedArray(srcValue, true);
  4605. }
  4606. else {
  4607. newValue = [];
  4608. }
  4609. }
  4610. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4611. newValue = objValue;
  4612. if (isArguments(objValue)) {
  4613. newValue = toPlainObject(objValue);
  4614. }
  4615. else if (!isObject(objValue) || isFunction(objValue)) {
  4616. newValue = initCloneObject(srcValue);
  4617. }
  4618. }
  4619. else {
  4620. isCommon = false;
  4621. }
  4622. }
  4623. if (isCommon) {
  4624. // Recursively merge objects and arrays (susceptible to call stack limits).
  4625. stack.set(srcValue, newValue);
  4626. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4627. stack['delete'](srcValue);
  4628. }
  4629. assignMergeValue(object, key, newValue);
  4630. }
  4631. /**
  4632. * The base implementation of `_.nth` which doesn't coerce arguments.
  4633. *
  4634. * @private
  4635. * @param {Array} array The array to query.
  4636. * @param {number} n The index of the element to return.
  4637. * @returns {*} Returns the nth element of `array`.
  4638. */
  4639. function baseNth(array, n) {
  4640. var length = array.length;
  4641. if (!length) {
  4642. return;
  4643. }
  4644. n += n < 0 ? length : 0;
  4645. return isIndex(n, length) ? array[n] : undefined;
  4646. }
  4647. /**
  4648. * The base implementation of `_.orderBy` without param guards.
  4649. *
  4650. * @private
  4651. * @param {Array|Object} collection The collection to iterate over.
  4652. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4653. * @param {string[]} orders The sort orders of `iteratees`.
  4654. * @returns {Array} Returns the new sorted array.
  4655. */
  4656. function baseOrderBy(collection, iteratees, orders) {
  4657. if (iteratees.length) {
  4658. iteratees = arrayMap(iteratees, function(iteratee) {
  4659. if (isArray(iteratee)) {
  4660. return function(value) {
  4661. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4662. }
  4663. }
  4664. return iteratee;
  4665. });
  4666. } else {
  4667. iteratees = [identity];
  4668. }
  4669. var index = -1;
  4670. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4671. var result = baseMap(collection, function(value, key, collection) {
  4672. var criteria = arrayMap(iteratees, function(iteratee) {
  4673. return iteratee(value);
  4674. });
  4675. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4676. });
  4677. return baseSortBy(result, function(object, other) {
  4678. return compareMultiple(object, other, orders);
  4679. });
  4680. }
  4681. /**
  4682. * The base implementation of `_.pick` without support for individual
  4683. * property identifiers.
  4684. *
  4685. * @private
  4686. * @param {Object} object The source object.
  4687. * @param {string[]} paths The property paths to pick.
  4688. * @returns {Object} Returns the new object.
  4689. */
  4690. function basePick(object, paths) {
  4691. return basePickBy(object, paths, function(value, path) {
  4692. return hasIn(object, path);
  4693. });
  4694. }
  4695. /**
  4696. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4697. *
  4698. * @private
  4699. * @param {Object} object The source object.
  4700. * @param {string[]} paths The property paths to pick.
  4701. * @param {Function} predicate The function invoked per property.
  4702. * @returns {Object} Returns the new object.
  4703. */
  4704. function basePickBy(object, paths, predicate) {
  4705. var index = -1,
  4706. length = paths.length,
  4707. result = {};
  4708. while (++index < length) {
  4709. var path = paths[index],
  4710. value = baseGet(object, path);
  4711. if (predicate(value, path)) {
  4712. baseSet(result, castPath(path, object), value);
  4713. }
  4714. }
  4715. return result;
  4716. }
  4717. /**
  4718. * A specialized version of `baseProperty` which supports deep paths.
  4719. *
  4720. * @private
  4721. * @param {Array|string} path The path of the property to get.
  4722. * @returns {Function} Returns the new accessor function.
  4723. */
  4724. function basePropertyDeep(path) {
  4725. return function(object) {
  4726. return baseGet(object, path);
  4727. };
  4728. }
  4729. /**
  4730. * The base implementation of `_.pullAllBy` without support for iteratee
  4731. * shorthands.
  4732. *
  4733. * @private
  4734. * @param {Array} array The array to modify.
  4735. * @param {Array} values The values to remove.
  4736. * @param {Function} [iteratee] The iteratee invoked per element.
  4737. * @param {Function} [comparator] The comparator invoked per element.
  4738. * @returns {Array} Returns `array`.
  4739. */
  4740. function basePullAll(array, values, iteratee, comparator) {
  4741. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4742. index = -1,
  4743. length = values.length,
  4744. seen = array;
  4745. if (array === values) {
  4746. values = copyArray(values);
  4747. }
  4748. if (iteratee) {
  4749. seen = arrayMap(array, baseUnary(iteratee));
  4750. }
  4751. while (++index < length) {
  4752. var fromIndex = 0,
  4753. value = values[index],
  4754. computed = iteratee ? iteratee(value) : value;
  4755. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4756. if (seen !== array) {
  4757. splice.call(seen, fromIndex, 1);
  4758. }
  4759. splice.call(array, fromIndex, 1);
  4760. }
  4761. }
  4762. return array;
  4763. }
  4764. /**
  4765. * The base implementation of `_.pullAt` without support for individual
  4766. * indexes or capturing the removed elements.
  4767. *
  4768. * @private
  4769. * @param {Array} array The array to modify.
  4770. * @param {number[]} indexes The indexes of elements to remove.
  4771. * @returns {Array} Returns `array`.
  4772. */
  4773. function basePullAt(array, indexes) {
  4774. var length = array ? indexes.length : 0,
  4775. lastIndex = length - 1;
  4776. while (length--) {
  4777. var index = indexes[length];
  4778. if (length == lastIndex || index !== previous) {
  4779. var previous = index;
  4780. if (isIndex(index)) {
  4781. splice.call(array, index, 1);
  4782. } else {
  4783. baseUnset(array, index);
  4784. }
  4785. }
  4786. }
  4787. return array;
  4788. }
  4789. /**
  4790. * The base implementation of `_.random` without support for returning
  4791. * floating-point numbers.
  4792. *
  4793. * @private
  4794. * @param {number} lower The lower bound.
  4795. * @param {number} upper The upper bound.
  4796. * @returns {number} Returns the random number.
  4797. */
  4798. function baseRandom(lower, upper) {
  4799. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4800. }
  4801. /**
  4802. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4803. * coerce arguments.
  4804. *
  4805. * @private
  4806. * @param {number} start The start of the range.
  4807. * @param {number} end The end of the range.
  4808. * @param {number} step The value to increment or decrement by.
  4809. * @param {boolean} [fromRight] Specify iterating from right to left.
  4810. * @returns {Array} Returns the range of numbers.
  4811. */
  4812. function baseRange(start, end, step, fromRight) {
  4813. var index = -1,
  4814. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4815. result = Array(length);
  4816. while (length--) {
  4817. result[fromRight ? length : ++index] = start;
  4818. start += step;
  4819. }
  4820. return result;
  4821. }
  4822. /**
  4823. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4824. *
  4825. * @private
  4826. * @param {string} string The string to repeat.
  4827. * @param {number} n The number of times to repeat the string.
  4828. * @returns {string} Returns the repeated string.
  4829. */
  4830. function baseRepeat(string, n) {
  4831. var result = '';
  4832. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4833. return result;
  4834. }
  4835. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4836. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4837. do {
  4838. if (n % 2) {
  4839. result += string;
  4840. }
  4841. n = nativeFloor(n / 2);
  4842. if (n) {
  4843. string += string;
  4844. }
  4845. } while (n);
  4846. return result;
  4847. }
  4848. /**
  4849. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4850. *
  4851. * @private
  4852. * @param {Function} func The function to apply a rest parameter to.
  4853. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4854. * @returns {Function} Returns the new function.
  4855. */
  4856. function baseRest(func, start) {
  4857. return setToString(overRest(func, start, identity), func + '');
  4858. }
  4859. /**
  4860. * The base implementation of `_.sample`.
  4861. *
  4862. * @private
  4863. * @param {Array|Object} collection The collection to sample.
  4864. * @returns {*} Returns the random element.
  4865. */
  4866. function baseSample(collection) {
  4867. return arraySample(values(collection));
  4868. }
  4869. /**
  4870. * The base implementation of `_.sampleSize` without param guards.
  4871. *
  4872. * @private
  4873. * @param {Array|Object} collection The collection to sample.
  4874. * @param {number} n The number of elements to sample.
  4875. * @returns {Array} Returns the random elements.
  4876. */
  4877. function baseSampleSize(collection, n) {
  4878. var array = values(collection);
  4879. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4880. }
  4881. /**
  4882. * The base implementation of `_.set`.
  4883. *
  4884. * @private
  4885. * @param {Object} object The object to modify.
  4886. * @param {Array|string} path The path of the property to set.
  4887. * @param {*} value The value to set.
  4888. * @param {Function} [customizer] The function to customize path creation.
  4889. * @returns {Object} Returns `object`.
  4890. */
  4891. function baseSet(object, path, value, customizer) {
  4892. if (!isObject(object)) {
  4893. return object;
  4894. }
  4895. path = castPath(path, object);
  4896. var index = -1,
  4897. length = path.length,
  4898. lastIndex = length - 1,
  4899. nested = object;
  4900. while (nested != null && ++index < length) {
  4901. var key = toKey(path[index]),
  4902. newValue = value;
  4903. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4904. return object;
  4905. }
  4906. if (index != lastIndex) {
  4907. var objValue = nested[key];
  4908. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4909. if (newValue === undefined) {
  4910. newValue = isObject(objValue)
  4911. ? objValue
  4912. : (isIndex(path[index + 1]) ? [] : {});
  4913. }
  4914. }
  4915. assignValue(nested, key, newValue);
  4916. nested = nested[key];
  4917. }
  4918. return object;
  4919. }
  4920. /**
  4921. * The base implementation of `setData` without support for hot loop shorting.
  4922. *
  4923. * @private
  4924. * @param {Function} func The function to associate metadata with.
  4925. * @param {*} data The metadata.
  4926. * @returns {Function} Returns `func`.
  4927. */
  4928. var baseSetData = !metaMap ? identity : function(func, data) {
  4929. metaMap.set(func, data);
  4930. return func;
  4931. };
  4932. /**
  4933. * The base implementation of `setToString` without support for hot loop shorting.
  4934. *
  4935. * @private
  4936. * @param {Function} func The function to modify.
  4937. * @param {Function} string The `toString` result.
  4938. * @returns {Function} Returns `func`.
  4939. */
  4940. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4941. return defineProperty(func, 'toString', {
  4942. 'configurable': true,
  4943. 'enumerable': false,
  4944. 'value': constant(string),
  4945. 'writable': true
  4946. });
  4947. };
  4948. /**
  4949. * The base implementation of `_.shuffle`.
  4950. *
  4951. * @private
  4952. * @param {Array|Object} collection The collection to shuffle.
  4953. * @returns {Array} Returns the new shuffled array.
  4954. */
  4955. function baseShuffle(collection) {
  4956. return shuffleSelf(values(collection));
  4957. }
  4958. /**
  4959. * The base implementation of `_.slice` without an iteratee call guard.
  4960. *
  4961. * @private
  4962. * @param {Array} array The array to slice.
  4963. * @param {number} [start=0] The start position.
  4964. * @param {number} [end=array.length] The end position.
  4965. * @returns {Array} Returns the slice of `array`.
  4966. */
  4967. function baseSlice(array, start, end) {
  4968. var index = -1,
  4969. length = array.length;
  4970. if (start < 0) {
  4971. start = -start > length ? 0 : (length + start);
  4972. }
  4973. end = end > length ? length : end;
  4974. if (end < 0) {
  4975. end += length;
  4976. }
  4977. length = start > end ? 0 : ((end - start) >>> 0);
  4978. start >>>= 0;
  4979. var result = Array(length);
  4980. while (++index < length) {
  4981. result[index] = array[index + start];
  4982. }
  4983. return result;
  4984. }
  4985. /**
  4986. * The base implementation of `_.some` without support for iteratee shorthands.
  4987. *
  4988. * @private
  4989. * @param {Array|Object} collection The collection to iterate over.
  4990. * @param {Function} predicate The function invoked per iteration.
  4991. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4992. * else `false`.
  4993. */
  4994. function baseSome(collection, predicate) {
  4995. var result;
  4996. baseEach(collection, function(value, index, collection) {
  4997. result = predicate(value, index, collection);
  4998. return !result;
  4999. });
  5000. return !!result;
  5001. }
  5002. /**
  5003. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5004. * performs a binary search of `array` to determine the index at which `value`
  5005. * should be inserted into `array` in order to maintain its sort order.
  5006. *
  5007. * @private
  5008. * @param {Array} array The sorted array to inspect.
  5009. * @param {*} value The value to evaluate.
  5010. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5011. * @returns {number} Returns the index at which `value` should be inserted
  5012. * into `array`.
  5013. */
  5014. function baseSortedIndex(array, value, retHighest) {
  5015. var low = 0,
  5016. high = array == null ? low : array.length;
  5017. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5018. while (low < high) {
  5019. var mid = (low + high) >>> 1,
  5020. computed = array[mid];
  5021. if (computed !== null && !isSymbol(computed) &&
  5022. (retHighest ? (computed <= value) : (computed < value))) {
  5023. low = mid + 1;
  5024. } else {
  5025. high = mid;
  5026. }
  5027. }
  5028. return high;
  5029. }
  5030. return baseSortedIndexBy(array, value, identity, retHighest);
  5031. }
  5032. /**
  5033. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5034. * which invokes `iteratee` for `value` and each element of `array` to compute
  5035. * their sort ranking. The iteratee is invoked with one argument; (value).
  5036. *
  5037. * @private
  5038. * @param {Array} array The sorted array to inspect.
  5039. * @param {*} value The value to evaluate.
  5040. * @param {Function} iteratee The iteratee invoked per element.
  5041. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5042. * @returns {number} Returns the index at which `value` should be inserted
  5043. * into `array`.
  5044. */
  5045. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5046. var low = 0,
  5047. high = array == null ? 0 : array.length;
  5048. if (high === 0) {
  5049. return 0;
  5050. }
  5051. value = iteratee(value);
  5052. var valIsNaN = value !== value,
  5053. valIsNull = value === null,
  5054. valIsSymbol = isSymbol(value),
  5055. valIsUndefined = value === undefined;
  5056. while (low < high) {
  5057. var mid = nativeFloor((low + high) / 2),
  5058. computed = iteratee(array[mid]),
  5059. othIsDefined = computed !== undefined,
  5060. othIsNull = computed === null,
  5061. othIsReflexive = computed === computed,
  5062. othIsSymbol = isSymbol(computed);
  5063. if (valIsNaN) {
  5064. var setLow = retHighest || othIsReflexive;
  5065. } else if (valIsUndefined) {
  5066. setLow = othIsReflexive && (retHighest || othIsDefined);
  5067. } else if (valIsNull) {
  5068. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5069. } else if (valIsSymbol) {
  5070. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5071. } else if (othIsNull || othIsSymbol) {
  5072. setLow = false;
  5073. } else {
  5074. setLow = retHighest ? (computed <= value) : (computed < value);
  5075. }
  5076. if (setLow) {
  5077. low = mid + 1;
  5078. } else {
  5079. high = mid;
  5080. }
  5081. }
  5082. return nativeMin(high, MAX_ARRAY_INDEX);
  5083. }
  5084. /**
  5085. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5086. * support for iteratee shorthands.
  5087. *
  5088. * @private
  5089. * @param {Array} array The array to inspect.
  5090. * @param {Function} [iteratee] The iteratee invoked per element.
  5091. * @returns {Array} Returns the new duplicate free array.
  5092. */
  5093. function baseSortedUniq(array, iteratee) {
  5094. var index = -1,
  5095. length = array.length,
  5096. resIndex = 0,
  5097. result = [];
  5098. while (++index < length) {
  5099. var value = array[index],
  5100. computed = iteratee ? iteratee(value) : value;
  5101. if (!index || !eq(computed, seen)) {
  5102. var seen = computed;
  5103. result[resIndex++] = value === 0 ? 0 : value;
  5104. }
  5105. }
  5106. return result;
  5107. }
  5108. /**
  5109. * The base implementation of `_.toNumber` which doesn't ensure correct
  5110. * conversions of binary, hexadecimal, or octal string values.
  5111. *
  5112. * @private
  5113. * @param {*} value The value to process.
  5114. * @returns {number} Returns the number.
  5115. */
  5116. function baseToNumber(value) {
  5117. if (typeof value == 'number') {
  5118. return value;
  5119. }
  5120. if (isSymbol(value)) {
  5121. return NAN;
  5122. }
  5123. return +value;
  5124. }
  5125. /**
  5126. * The base implementation of `_.toString` which doesn't convert nullish
  5127. * values to empty strings.
  5128. *
  5129. * @private
  5130. * @param {*} value The value to process.
  5131. * @returns {string} Returns the string.
  5132. */
  5133. function baseToString(value) {
  5134. // Exit early for strings to avoid a performance hit in some environments.
  5135. if (typeof value == 'string') {
  5136. return value;
  5137. }
  5138. if (isArray(value)) {
  5139. // Recursively convert values (susceptible to call stack limits).
  5140. return arrayMap(value, baseToString) + '';
  5141. }
  5142. if (isSymbol(value)) {
  5143. return symbolToString ? symbolToString.call(value) : '';
  5144. }
  5145. var result = (value + '');
  5146. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5147. }
  5148. /**
  5149. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5150. *
  5151. * @private
  5152. * @param {Array} array The array to inspect.
  5153. * @param {Function} [iteratee] The iteratee invoked per element.
  5154. * @param {Function} [comparator] The comparator invoked per element.
  5155. * @returns {Array} Returns the new duplicate free array.
  5156. */
  5157. function baseUniq(array, iteratee, comparator) {
  5158. var index = -1,
  5159. includes = arrayIncludes,
  5160. length = array.length,
  5161. isCommon = true,
  5162. result = [],
  5163. seen = result;
  5164. if (comparator) {
  5165. isCommon = false;
  5166. includes = arrayIncludesWith;
  5167. }
  5168. else if (length >= LARGE_ARRAY_SIZE) {
  5169. var set = iteratee ? null : createSet(array);
  5170. if (set) {
  5171. return setToArray(set);
  5172. }
  5173. isCommon = false;
  5174. includes = cacheHas;
  5175. seen = new SetCache;
  5176. }
  5177. else {
  5178. seen = iteratee ? [] : result;
  5179. }
  5180. outer:
  5181. while (++index < length) {
  5182. var value = array[index],
  5183. computed = iteratee ? iteratee(value) : value;
  5184. value = (comparator || value !== 0) ? value : 0;
  5185. if (isCommon && computed === computed) {
  5186. var seenIndex = seen.length;
  5187. while (seenIndex--) {
  5188. if (seen[seenIndex] === computed) {
  5189. continue outer;
  5190. }
  5191. }
  5192. if (iteratee) {
  5193. seen.push(computed);
  5194. }
  5195. result.push(value);
  5196. }
  5197. else if (!includes(seen, computed, comparator)) {
  5198. if (seen !== result) {
  5199. seen.push(computed);
  5200. }
  5201. result.push(value);
  5202. }
  5203. }
  5204. return result;
  5205. }
  5206. /**
  5207. * The base implementation of `_.unset`.
  5208. *
  5209. * @private
  5210. * @param {Object} object The object to modify.
  5211. * @param {Array|string} path The property path to unset.
  5212. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5213. */
  5214. function baseUnset(object, path) {
  5215. path = castPath(path, object);
  5216. object = parent(object, path);
  5217. return object == null || delete object[toKey(last(path))];
  5218. }
  5219. /**
  5220. * The base implementation of `_.update`.
  5221. *
  5222. * @private
  5223. * @param {Object} object The object to modify.
  5224. * @param {Array|string} path The path of the property to update.
  5225. * @param {Function} updater The function to produce the updated value.
  5226. * @param {Function} [customizer] The function to customize path creation.
  5227. * @returns {Object} Returns `object`.
  5228. */
  5229. function baseUpdate(object, path, updater, customizer) {
  5230. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5231. }
  5232. /**
  5233. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5234. * without support for iteratee shorthands.
  5235. *
  5236. * @private
  5237. * @param {Array} array The array to query.
  5238. * @param {Function} predicate The function invoked per iteration.
  5239. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5240. * @param {boolean} [fromRight] Specify iterating from right to left.
  5241. * @returns {Array} Returns the slice of `array`.
  5242. */
  5243. function baseWhile(array, predicate, isDrop, fromRight) {
  5244. var length = array.length,
  5245. index = fromRight ? length : -1;
  5246. while ((fromRight ? index-- : ++index < length) &&
  5247. predicate(array[index], index, array)) {}
  5248. return isDrop
  5249. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5250. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5251. }
  5252. /**
  5253. * The base implementation of `wrapperValue` which returns the result of
  5254. * performing a sequence of actions on the unwrapped `value`, where each
  5255. * successive action is supplied the return value of the previous.
  5256. *
  5257. * @private
  5258. * @param {*} value The unwrapped value.
  5259. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5260. * @returns {*} Returns the resolved value.
  5261. */
  5262. function baseWrapperValue(value, actions) {
  5263. var result = value;
  5264. if (result instanceof LazyWrapper) {
  5265. result = result.value();
  5266. }
  5267. return arrayReduce(actions, function(result, action) {
  5268. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5269. }, result);
  5270. }
  5271. /**
  5272. * The base implementation of methods like `_.xor`, without support for
  5273. * iteratee shorthands, that accepts an array of arrays to inspect.
  5274. *
  5275. * @private
  5276. * @param {Array} arrays The arrays to inspect.
  5277. * @param {Function} [iteratee] The iteratee invoked per element.
  5278. * @param {Function} [comparator] The comparator invoked per element.
  5279. * @returns {Array} Returns the new array of values.
  5280. */
  5281. function baseXor(arrays, iteratee, comparator) {
  5282. var length = arrays.length;
  5283. if (length < 2) {
  5284. return length ? baseUniq(arrays[0]) : [];
  5285. }
  5286. var index = -1,
  5287. result = Array(length);
  5288. while (++index < length) {
  5289. var array = arrays[index],
  5290. othIndex = -1;
  5291. while (++othIndex < length) {
  5292. if (othIndex != index) {
  5293. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5294. }
  5295. }
  5296. }
  5297. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5298. }
  5299. /**
  5300. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5301. *
  5302. * @private
  5303. * @param {Array} props The property identifiers.
  5304. * @param {Array} values The property values.
  5305. * @param {Function} assignFunc The function to assign values.
  5306. * @returns {Object} Returns the new object.
  5307. */
  5308. function baseZipObject(props, values, assignFunc) {
  5309. var index = -1,
  5310. length = props.length,
  5311. valsLength = values.length,
  5312. result = {};
  5313. while (++index < length) {
  5314. var value = index < valsLength ? values[index] : undefined;
  5315. assignFunc(result, props[index], value);
  5316. }
  5317. return result;
  5318. }
  5319. /**
  5320. * Casts `value` to an empty array if it's not an array like object.
  5321. *
  5322. * @private
  5323. * @param {*} value The value to inspect.
  5324. * @returns {Array|Object} Returns the cast array-like object.
  5325. */
  5326. function castArrayLikeObject(value) {
  5327. return isArrayLikeObject(value) ? value : [];
  5328. }
  5329. /**
  5330. * Casts `value` to `identity` if it's not a function.
  5331. *
  5332. * @private
  5333. * @param {*} value The value to inspect.
  5334. * @returns {Function} Returns cast function.
  5335. */
  5336. function castFunction(value) {
  5337. return typeof value == 'function' ? value : identity;
  5338. }
  5339. /**
  5340. * Casts `value` to a path array if it's not one.
  5341. *
  5342. * @private
  5343. * @param {*} value The value to inspect.
  5344. * @param {Object} [object] The object to query keys on.
  5345. * @returns {Array} Returns the cast property path array.
  5346. */
  5347. function castPath(value, object) {
  5348. if (isArray(value)) {
  5349. return value;
  5350. }
  5351. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5352. }
  5353. /**
  5354. * A `baseRest` alias which can be replaced with `identity` by module
  5355. * replacement plugins.
  5356. *
  5357. * @private
  5358. * @type {Function}
  5359. * @param {Function} func The function to apply a rest parameter to.
  5360. * @returns {Function} Returns the new function.
  5361. */
  5362. var castRest = baseRest;
  5363. /**
  5364. * Casts `array` to a slice if it's needed.
  5365. *
  5366. * @private
  5367. * @param {Array} array The array to inspect.
  5368. * @param {number} start The start position.
  5369. * @param {number} [end=array.length] The end position.
  5370. * @returns {Array} Returns the cast slice.
  5371. */
  5372. function castSlice(array, start, end) {
  5373. var length = array.length;
  5374. end = end === undefined ? length : end;
  5375. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5376. }
  5377. /**
  5378. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5379. *
  5380. * @private
  5381. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5382. */
  5383. var clearTimeout = ctxClearTimeout || function(id) {
  5384. return root.clearTimeout(id);
  5385. };
  5386. /**
  5387. * Creates a clone of `buffer`.
  5388. *
  5389. * @private
  5390. * @param {Buffer} buffer The buffer to clone.
  5391. * @param {boolean} [isDeep] Specify a deep clone.
  5392. * @returns {Buffer} Returns the cloned buffer.
  5393. */
  5394. function cloneBuffer(buffer, isDeep) {
  5395. if (isDeep) {
  5396. return buffer.slice();
  5397. }
  5398. var length = buffer.length,
  5399. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5400. buffer.copy(result);
  5401. return result;
  5402. }
  5403. /**
  5404. * Creates a clone of `arrayBuffer`.
  5405. *
  5406. * @private
  5407. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5408. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5409. */
  5410. function cloneArrayBuffer(arrayBuffer) {
  5411. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5412. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5413. return result;
  5414. }
  5415. /**
  5416. * Creates a clone of `dataView`.
  5417. *
  5418. * @private
  5419. * @param {Object} dataView The data view to clone.
  5420. * @param {boolean} [isDeep] Specify a deep clone.
  5421. * @returns {Object} Returns the cloned data view.
  5422. */
  5423. function cloneDataView(dataView, isDeep) {
  5424. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5425. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5426. }
  5427. /**
  5428. * Creates a clone of `regexp`.
  5429. *
  5430. * @private
  5431. * @param {Object} regexp The regexp to clone.
  5432. * @returns {Object} Returns the cloned regexp.
  5433. */
  5434. function cloneRegExp(regexp) {
  5435. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5436. result.lastIndex = regexp.lastIndex;
  5437. return result;
  5438. }
  5439. /**
  5440. * Creates a clone of the `symbol` object.
  5441. *
  5442. * @private
  5443. * @param {Object} symbol The symbol object to clone.
  5444. * @returns {Object} Returns the cloned symbol object.
  5445. */
  5446. function cloneSymbol(symbol) {
  5447. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5448. }
  5449. /**
  5450. * Creates a clone of `typedArray`.
  5451. *
  5452. * @private
  5453. * @param {Object} typedArray The typed array to clone.
  5454. * @param {boolean} [isDeep] Specify a deep clone.
  5455. * @returns {Object} Returns the cloned typed array.
  5456. */
  5457. function cloneTypedArray(typedArray, isDeep) {
  5458. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5459. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5460. }
  5461. /**
  5462. * Compares values to sort them in ascending order.
  5463. *
  5464. * @private
  5465. * @param {*} value The value to compare.
  5466. * @param {*} other The other value to compare.
  5467. * @returns {number} Returns the sort order indicator for `value`.
  5468. */
  5469. function compareAscending(value, other) {
  5470. if (value !== other) {
  5471. var valIsDefined = value !== undefined,
  5472. valIsNull = value === null,
  5473. valIsReflexive = value === value,
  5474. valIsSymbol = isSymbol(value);
  5475. var othIsDefined = other !== undefined,
  5476. othIsNull = other === null,
  5477. othIsReflexive = other === other,
  5478. othIsSymbol = isSymbol(other);
  5479. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5480. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5481. (valIsNull && othIsDefined && othIsReflexive) ||
  5482. (!valIsDefined && othIsReflexive) ||
  5483. !valIsReflexive) {
  5484. return 1;
  5485. }
  5486. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5487. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5488. (othIsNull && valIsDefined && valIsReflexive) ||
  5489. (!othIsDefined && valIsReflexive) ||
  5490. !othIsReflexive) {
  5491. return -1;
  5492. }
  5493. }
  5494. return 0;
  5495. }
  5496. /**
  5497. * Used by `_.orderBy` to compare multiple properties of a value to another
  5498. * and stable sort them.
  5499. *
  5500. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5501. * specify an order of "desc" for descending or "asc" for ascending sort order
  5502. * of corresponding values.
  5503. *
  5504. * @private
  5505. * @param {Object} object The object to compare.
  5506. * @param {Object} other The other object to compare.
  5507. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5508. * @returns {number} Returns the sort order indicator for `object`.
  5509. */
  5510. function compareMultiple(object, other, orders) {
  5511. var index = -1,
  5512. objCriteria = object.criteria,
  5513. othCriteria = other.criteria,
  5514. length = objCriteria.length,
  5515. ordersLength = orders.length;
  5516. while (++index < length) {
  5517. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5518. if (result) {
  5519. if (index >= ordersLength) {
  5520. return result;
  5521. }
  5522. var order = orders[index];
  5523. return result * (order == 'desc' ? -1 : 1);
  5524. }
  5525. }
  5526. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5527. // that causes it, under certain circumstances, to provide the same value for
  5528. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5529. // for more details.
  5530. //
  5531. // This also ensures a stable sort in V8 and other engines.
  5532. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5533. return object.index - other.index;
  5534. }
  5535. /**
  5536. * Creates an array that is the composition of partially applied arguments,
  5537. * placeholders, and provided arguments into a single array of arguments.
  5538. *
  5539. * @private
  5540. * @param {Array} args The provided arguments.
  5541. * @param {Array} partials The arguments to prepend to those provided.
  5542. * @param {Array} holders The `partials` placeholder indexes.
  5543. * @params {boolean} [isCurried] Specify composing for a curried function.
  5544. * @returns {Array} Returns the new array of composed arguments.
  5545. */
  5546. function composeArgs(args, partials, holders, isCurried) {
  5547. var argsIndex = -1,
  5548. argsLength = args.length,
  5549. holdersLength = holders.length,
  5550. leftIndex = -1,
  5551. leftLength = partials.length,
  5552. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5553. result = Array(leftLength + rangeLength),
  5554. isUncurried = !isCurried;
  5555. while (++leftIndex < leftLength) {
  5556. result[leftIndex] = partials[leftIndex];
  5557. }
  5558. while (++argsIndex < holdersLength) {
  5559. if (isUncurried || argsIndex < argsLength) {
  5560. result[holders[argsIndex]] = args[argsIndex];
  5561. }
  5562. }
  5563. while (rangeLength--) {
  5564. result[leftIndex++] = args[argsIndex++];
  5565. }
  5566. return result;
  5567. }
  5568. /**
  5569. * This function is like `composeArgs` except that the arguments composition
  5570. * is tailored for `_.partialRight`.
  5571. *
  5572. * @private
  5573. * @param {Array} args The provided arguments.
  5574. * @param {Array} partials The arguments to append to those provided.
  5575. * @param {Array} holders The `partials` placeholder indexes.
  5576. * @params {boolean} [isCurried] Specify composing for a curried function.
  5577. * @returns {Array} Returns the new array of composed arguments.
  5578. */
  5579. function composeArgsRight(args, partials, holders, isCurried) {
  5580. var argsIndex = -1,
  5581. argsLength = args.length,
  5582. holdersIndex = -1,
  5583. holdersLength = holders.length,
  5584. rightIndex = -1,
  5585. rightLength = partials.length,
  5586. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5587. result = Array(rangeLength + rightLength),
  5588. isUncurried = !isCurried;
  5589. while (++argsIndex < rangeLength) {
  5590. result[argsIndex] = args[argsIndex];
  5591. }
  5592. var offset = argsIndex;
  5593. while (++rightIndex < rightLength) {
  5594. result[offset + rightIndex] = partials[rightIndex];
  5595. }
  5596. while (++holdersIndex < holdersLength) {
  5597. if (isUncurried || argsIndex < argsLength) {
  5598. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5599. }
  5600. }
  5601. return result;
  5602. }
  5603. /**
  5604. * Copies the values of `source` to `array`.
  5605. *
  5606. * @private
  5607. * @param {Array} source The array to copy values from.
  5608. * @param {Array} [array=[]] The array to copy values to.
  5609. * @returns {Array} Returns `array`.
  5610. */
  5611. function copyArray(source, array) {
  5612. var index = -1,
  5613. length = source.length;
  5614. array || (array = Array(length));
  5615. while (++index < length) {
  5616. array[index] = source[index];
  5617. }
  5618. return array;
  5619. }
  5620. /**
  5621. * Copies properties of `source` to `object`.
  5622. *
  5623. * @private
  5624. * @param {Object} source The object to copy properties from.
  5625. * @param {Array} props The property identifiers to copy.
  5626. * @param {Object} [object={}] The object to copy properties to.
  5627. * @param {Function} [customizer] The function to customize copied values.
  5628. * @returns {Object} Returns `object`.
  5629. */
  5630. function copyObject(source, props, object, customizer) {
  5631. var isNew = !object;
  5632. object || (object = {});
  5633. var index = -1,
  5634. length = props.length;
  5635. while (++index < length) {
  5636. var key = props[index];
  5637. var newValue = customizer
  5638. ? customizer(object[key], source[key], key, object, source)
  5639. : undefined;
  5640. if (newValue === undefined) {
  5641. newValue = source[key];
  5642. }
  5643. if (isNew) {
  5644. baseAssignValue(object, key, newValue);
  5645. } else {
  5646. assignValue(object, key, newValue);
  5647. }
  5648. }
  5649. return object;
  5650. }
  5651. /**
  5652. * Copies own symbols of `source` to `object`.
  5653. *
  5654. * @private
  5655. * @param {Object} source The object to copy symbols from.
  5656. * @param {Object} [object={}] The object to copy symbols to.
  5657. * @returns {Object} Returns `object`.
  5658. */
  5659. function copySymbols(source, object) {
  5660. return copyObject(source, getSymbols(source), object);
  5661. }
  5662. /**
  5663. * Copies own and inherited symbols of `source` to `object`.
  5664. *
  5665. * @private
  5666. * @param {Object} source The object to copy symbols from.
  5667. * @param {Object} [object={}] The object to copy symbols to.
  5668. * @returns {Object} Returns `object`.
  5669. */
  5670. function copySymbolsIn(source, object) {
  5671. return copyObject(source, getSymbolsIn(source), object);
  5672. }
  5673. /**
  5674. * Creates a function like `_.groupBy`.
  5675. *
  5676. * @private
  5677. * @param {Function} setter The function to set accumulator values.
  5678. * @param {Function} [initializer] The accumulator object initializer.
  5679. * @returns {Function} Returns the new aggregator function.
  5680. */
  5681. function createAggregator(setter, initializer) {
  5682. return function(collection, iteratee) {
  5683. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5684. accumulator = initializer ? initializer() : {};
  5685. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5686. };
  5687. }
  5688. /**
  5689. * Creates a function like `_.assign`.
  5690. *
  5691. * @private
  5692. * @param {Function} assigner The function to assign values.
  5693. * @returns {Function} Returns the new assigner function.
  5694. */
  5695. function createAssigner(assigner) {
  5696. return baseRest(function(object, sources) {
  5697. var index = -1,
  5698. length = sources.length,
  5699. customizer = length > 1 ? sources[length - 1] : undefined,
  5700. guard = length > 2 ? sources[2] : undefined;
  5701. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5702. ? (length--, customizer)
  5703. : undefined;
  5704. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5705. customizer = length < 3 ? undefined : customizer;
  5706. length = 1;
  5707. }
  5708. object = Object(object);
  5709. while (++index < length) {
  5710. var source = sources[index];
  5711. if (source) {
  5712. assigner(object, source, index, customizer);
  5713. }
  5714. }
  5715. return object;
  5716. });
  5717. }
  5718. /**
  5719. * Creates a `baseEach` or `baseEachRight` function.
  5720. *
  5721. * @private
  5722. * @param {Function} eachFunc The function to iterate over a collection.
  5723. * @param {boolean} [fromRight] Specify iterating from right to left.
  5724. * @returns {Function} Returns the new base function.
  5725. */
  5726. function createBaseEach(eachFunc, fromRight) {
  5727. return function(collection, iteratee) {
  5728. if (collection == null) {
  5729. return collection;
  5730. }
  5731. if (!isArrayLike(collection)) {
  5732. return eachFunc(collection, iteratee);
  5733. }
  5734. var length = collection.length,
  5735. index = fromRight ? length : -1,
  5736. iterable = Object(collection);
  5737. while ((fromRight ? index-- : ++index < length)) {
  5738. if (iteratee(iterable[index], index, iterable) === false) {
  5739. break;
  5740. }
  5741. }
  5742. return collection;
  5743. };
  5744. }
  5745. /**
  5746. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5747. *
  5748. * @private
  5749. * @param {boolean} [fromRight] Specify iterating from right to left.
  5750. * @returns {Function} Returns the new base function.
  5751. */
  5752. function createBaseFor(fromRight) {
  5753. return function(object, iteratee, keysFunc) {
  5754. var index = -1,
  5755. iterable = Object(object),
  5756. props = keysFunc(object),
  5757. length = props.length;
  5758. while (length--) {
  5759. var key = props[fromRight ? length : ++index];
  5760. if (iteratee(iterable[key], key, iterable) === false) {
  5761. break;
  5762. }
  5763. }
  5764. return object;
  5765. };
  5766. }
  5767. /**
  5768. * Creates a function that wraps `func` to invoke it with the optional `this`
  5769. * binding of `thisArg`.
  5770. *
  5771. * @private
  5772. * @param {Function} func The function to wrap.
  5773. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5774. * @param {*} [thisArg] The `this` binding of `func`.
  5775. * @returns {Function} Returns the new wrapped function.
  5776. */
  5777. function createBind(func, bitmask, thisArg) {
  5778. var isBind = bitmask & WRAP_BIND_FLAG,
  5779. Ctor = createCtor(func);
  5780. function wrapper() {
  5781. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5782. return fn.apply(isBind ? thisArg : this, arguments);
  5783. }
  5784. return wrapper;
  5785. }
  5786. /**
  5787. * Creates a function like `_.lowerFirst`.
  5788. *
  5789. * @private
  5790. * @param {string} methodName The name of the `String` case method to use.
  5791. * @returns {Function} Returns the new case function.
  5792. */
  5793. function createCaseFirst(methodName) {
  5794. return function(string) {
  5795. string = toString(string);
  5796. var strSymbols = hasUnicode(string)
  5797. ? stringToArray(string)
  5798. : undefined;
  5799. var chr = strSymbols
  5800. ? strSymbols[0]
  5801. : string.charAt(0);
  5802. var trailing = strSymbols
  5803. ? castSlice(strSymbols, 1).join('')
  5804. : string.slice(1);
  5805. return chr[methodName]() + trailing;
  5806. };
  5807. }
  5808. /**
  5809. * Creates a function like `_.camelCase`.
  5810. *
  5811. * @private
  5812. * @param {Function} callback The function to combine each word.
  5813. * @returns {Function} Returns the new compounder function.
  5814. */
  5815. function createCompounder(callback) {
  5816. return function(string) {
  5817. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5818. };
  5819. }
  5820. /**
  5821. * Creates a function that produces an instance of `Ctor` regardless of
  5822. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5823. *
  5824. * @private
  5825. * @param {Function} Ctor The constructor to wrap.
  5826. * @returns {Function} Returns the new wrapped function.
  5827. */
  5828. function createCtor(Ctor) {
  5829. return function() {
  5830. // Use a `switch` statement to work with class constructors. See
  5831. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5832. // for more details.
  5833. var args = arguments;
  5834. switch (args.length) {
  5835. case 0: return new Ctor;
  5836. case 1: return new Ctor(args[0]);
  5837. case 2: return new Ctor(args[0], args[1]);
  5838. case 3: return new Ctor(args[0], args[1], args[2]);
  5839. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5840. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5841. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5842. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5843. }
  5844. var thisBinding = baseCreate(Ctor.prototype),
  5845. result = Ctor.apply(thisBinding, args);
  5846. // Mimic the constructor's `return` behavior.
  5847. // See https://es5.github.io/#x13.2.2 for more details.
  5848. return isObject(result) ? result : thisBinding;
  5849. };
  5850. }
  5851. /**
  5852. * Creates a function that wraps `func` to enable currying.
  5853. *
  5854. * @private
  5855. * @param {Function} func The function to wrap.
  5856. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5857. * @param {number} arity The arity of `func`.
  5858. * @returns {Function} Returns the new wrapped function.
  5859. */
  5860. function createCurry(func, bitmask, arity) {
  5861. var Ctor = createCtor(func);
  5862. function wrapper() {
  5863. var length = arguments.length,
  5864. args = Array(length),
  5865. index = length,
  5866. placeholder = getHolder(wrapper);
  5867. while (index--) {
  5868. args[index] = arguments[index];
  5869. }
  5870. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5871. ? []
  5872. : replaceHolders(args, placeholder);
  5873. length -= holders.length;
  5874. if (length < arity) {
  5875. return createRecurry(
  5876. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5877. args, holders, undefined, undefined, arity - length);
  5878. }
  5879. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5880. return apply(fn, this, args);
  5881. }
  5882. return wrapper;
  5883. }
  5884. /**
  5885. * Creates a `_.find` or `_.findLast` function.
  5886. *
  5887. * @private
  5888. * @param {Function} findIndexFunc The function to find the collection index.
  5889. * @returns {Function} Returns the new find function.
  5890. */
  5891. function createFind(findIndexFunc) {
  5892. return function(collection, predicate, fromIndex) {
  5893. var iterable = Object(collection);
  5894. if (!isArrayLike(collection)) {
  5895. var iteratee = getIteratee(predicate, 3);
  5896. collection = keys(collection);
  5897. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5898. }
  5899. var index = findIndexFunc(collection, predicate, fromIndex);
  5900. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5901. };
  5902. }
  5903. /**
  5904. * Creates a `_.flow` or `_.flowRight` function.
  5905. *
  5906. * @private
  5907. * @param {boolean} [fromRight] Specify iterating from right to left.
  5908. * @returns {Function} Returns the new flow function.
  5909. */
  5910. function createFlow(fromRight) {
  5911. return flatRest(function(funcs) {
  5912. var length = funcs.length,
  5913. index = length,
  5914. prereq = LodashWrapper.prototype.thru;
  5915. if (fromRight) {
  5916. funcs.reverse();
  5917. }
  5918. while (index--) {
  5919. var func = funcs[index];
  5920. if (typeof func != 'function') {
  5921. throw new TypeError(FUNC_ERROR_TEXT);
  5922. }
  5923. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5924. var wrapper = new LodashWrapper([], true);
  5925. }
  5926. }
  5927. index = wrapper ? index : length;
  5928. while (++index < length) {
  5929. func = funcs[index];
  5930. var funcName = getFuncName(func),
  5931. data = funcName == 'wrapper' ? getData(func) : undefined;
  5932. if (data && isLaziable(data[0]) &&
  5933. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5934. !data[4].length && data[9] == 1
  5935. ) {
  5936. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5937. } else {
  5938. wrapper = (func.length == 1 && isLaziable(func))
  5939. ? wrapper[funcName]()
  5940. : wrapper.thru(func);
  5941. }
  5942. }
  5943. return function() {
  5944. var args = arguments,
  5945. value = args[0];
  5946. if (wrapper && args.length == 1 && isArray(value)) {
  5947. return wrapper.plant(value).value();
  5948. }
  5949. var index = 0,
  5950. result = length ? funcs[index].apply(this, args) : value;
  5951. while (++index < length) {
  5952. result = funcs[index].call(this, result);
  5953. }
  5954. return result;
  5955. };
  5956. });
  5957. }
  5958. /**
  5959. * Creates a function that wraps `func` to invoke it with optional `this`
  5960. * binding of `thisArg`, partial application, and currying.
  5961. *
  5962. * @private
  5963. * @param {Function|string} func The function or method name to wrap.
  5964. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5965. * @param {*} [thisArg] The `this` binding of `func`.
  5966. * @param {Array} [partials] The arguments to prepend to those provided to
  5967. * the new function.
  5968. * @param {Array} [holders] The `partials` placeholder indexes.
  5969. * @param {Array} [partialsRight] The arguments to append to those provided
  5970. * to the new function.
  5971. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5972. * @param {Array} [argPos] The argument positions of the new function.
  5973. * @param {number} [ary] The arity cap of `func`.
  5974. * @param {number} [arity] The arity of `func`.
  5975. * @returns {Function} Returns the new wrapped function.
  5976. */
  5977. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5978. var isAry = bitmask & WRAP_ARY_FLAG,
  5979. isBind = bitmask & WRAP_BIND_FLAG,
  5980. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5981. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5982. isFlip = bitmask & WRAP_FLIP_FLAG,
  5983. Ctor = isBindKey ? undefined : createCtor(func);
  5984. function wrapper() {
  5985. var length = arguments.length,
  5986. args = Array(length),
  5987. index = length;
  5988. while (index--) {
  5989. args[index] = arguments[index];
  5990. }
  5991. if (isCurried) {
  5992. var placeholder = getHolder(wrapper),
  5993. holdersCount = countHolders(args, placeholder);
  5994. }
  5995. if (partials) {
  5996. args = composeArgs(args, partials, holders, isCurried);
  5997. }
  5998. if (partialsRight) {
  5999. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6000. }
  6001. length -= holdersCount;
  6002. if (isCurried && length < arity) {
  6003. var newHolders = replaceHolders(args, placeholder);
  6004. return createRecurry(
  6005. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6006. args, newHolders, argPos, ary, arity - length
  6007. );
  6008. }
  6009. var thisBinding = isBind ? thisArg : this,
  6010. fn = isBindKey ? thisBinding[func] : func;
  6011. length = args.length;
  6012. if (argPos) {
  6013. args = reorder(args, argPos);
  6014. } else if (isFlip && length > 1) {
  6015. args.reverse();
  6016. }
  6017. if (isAry && ary < length) {
  6018. args.length = ary;
  6019. }
  6020. if (this && this !== root && this instanceof wrapper) {
  6021. fn = Ctor || createCtor(fn);
  6022. }
  6023. return fn.apply(thisBinding, args);
  6024. }
  6025. return wrapper;
  6026. }
  6027. /**
  6028. * Creates a function like `_.invertBy`.
  6029. *
  6030. * @private
  6031. * @param {Function} setter The function to set accumulator values.
  6032. * @param {Function} toIteratee The function to resolve iteratees.
  6033. * @returns {Function} Returns the new inverter function.
  6034. */
  6035. function createInverter(setter, toIteratee) {
  6036. return function(object, iteratee) {
  6037. return baseInverter(object, setter, toIteratee(iteratee), {});
  6038. };
  6039. }
  6040. /**
  6041. * Creates a function that performs a mathematical operation on two values.
  6042. *
  6043. * @private
  6044. * @param {Function} operator The function to perform the operation.
  6045. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6046. * @returns {Function} Returns the new mathematical operation function.
  6047. */
  6048. function createMathOperation(operator, defaultValue) {
  6049. return function(value, other) {
  6050. var result;
  6051. if (value === undefined && other === undefined) {
  6052. return defaultValue;
  6053. }
  6054. if (value !== undefined) {
  6055. result = value;
  6056. }
  6057. if (other !== undefined) {
  6058. if (result === undefined) {
  6059. return other;
  6060. }
  6061. if (typeof value == 'string' || typeof other == 'string') {
  6062. value = baseToString(value);
  6063. other = baseToString(other);
  6064. } else {
  6065. value = baseToNumber(value);
  6066. other = baseToNumber(other);
  6067. }
  6068. result = operator(value, other);
  6069. }
  6070. return result;
  6071. };
  6072. }
  6073. /**
  6074. * Creates a function like `_.over`.
  6075. *
  6076. * @private
  6077. * @param {Function} arrayFunc The function to iterate over iteratees.
  6078. * @returns {Function} Returns the new over function.
  6079. */
  6080. function createOver(arrayFunc) {
  6081. return flatRest(function(iteratees) {
  6082. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6083. return baseRest(function(args) {
  6084. var thisArg = this;
  6085. return arrayFunc(iteratees, function(iteratee) {
  6086. return apply(iteratee, thisArg, args);
  6087. });
  6088. });
  6089. });
  6090. }
  6091. /**
  6092. * Creates the padding for `string` based on `length`. The `chars` string
  6093. * is truncated if the number of characters exceeds `length`.
  6094. *
  6095. * @private
  6096. * @param {number} length The padding length.
  6097. * @param {string} [chars=' '] The string used as padding.
  6098. * @returns {string} Returns the padding for `string`.
  6099. */
  6100. function createPadding(length, chars) {
  6101. chars = chars === undefined ? ' ' : baseToString(chars);
  6102. var charsLength = chars.length;
  6103. if (charsLength < 2) {
  6104. return charsLength ? baseRepeat(chars, length) : chars;
  6105. }
  6106. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6107. return hasUnicode(chars)
  6108. ? castSlice(stringToArray(result), 0, length).join('')
  6109. : result.slice(0, length);
  6110. }
  6111. /**
  6112. * Creates a function that wraps `func` to invoke it with the `this` binding
  6113. * of `thisArg` and `partials` prepended to the arguments it receives.
  6114. *
  6115. * @private
  6116. * @param {Function} func The function to wrap.
  6117. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6118. * @param {*} thisArg The `this` binding of `func`.
  6119. * @param {Array} partials The arguments to prepend to those provided to
  6120. * the new function.
  6121. * @returns {Function} Returns the new wrapped function.
  6122. */
  6123. function createPartial(func, bitmask, thisArg, partials) {
  6124. var isBind = bitmask & WRAP_BIND_FLAG,
  6125. Ctor = createCtor(func);
  6126. function wrapper() {
  6127. var argsIndex = -1,
  6128. argsLength = arguments.length,
  6129. leftIndex = -1,
  6130. leftLength = partials.length,
  6131. args = Array(leftLength + argsLength),
  6132. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6133. while (++leftIndex < leftLength) {
  6134. args[leftIndex] = partials[leftIndex];
  6135. }
  6136. while (argsLength--) {
  6137. args[leftIndex++] = arguments[++argsIndex];
  6138. }
  6139. return apply(fn, isBind ? thisArg : this, args);
  6140. }
  6141. return wrapper;
  6142. }
  6143. /**
  6144. * Creates a `_.range` or `_.rangeRight` function.
  6145. *
  6146. * @private
  6147. * @param {boolean} [fromRight] Specify iterating from right to left.
  6148. * @returns {Function} Returns the new range function.
  6149. */
  6150. function createRange(fromRight) {
  6151. return function(start, end, step) {
  6152. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6153. end = step = undefined;
  6154. }
  6155. // Ensure the sign of `-0` is preserved.
  6156. start = toFinite(start);
  6157. if (end === undefined) {
  6158. end = start;
  6159. start = 0;
  6160. } else {
  6161. end = toFinite(end);
  6162. }
  6163. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6164. return baseRange(start, end, step, fromRight);
  6165. };
  6166. }
  6167. /**
  6168. * Creates a function that performs a relational operation on two values.
  6169. *
  6170. * @private
  6171. * @param {Function} operator The function to perform the operation.
  6172. * @returns {Function} Returns the new relational operation function.
  6173. */
  6174. function createRelationalOperation(operator) {
  6175. return function(value, other) {
  6176. if (!(typeof value == 'string' && typeof other == 'string')) {
  6177. value = toNumber(value);
  6178. other = toNumber(other);
  6179. }
  6180. return operator(value, other);
  6181. };
  6182. }
  6183. /**
  6184. * Creates a function that wraps `func` to continue currying.
  6185. *
  6186. * @private
  6187. * @param {Function} func The function to wrap.
  6188. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6189. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6190. * @param {*} placeholder The placeholder value.
  6191. * @param {*} [thisArg] The `this` binding of `func`.
  6192. * @param {Array} [partials] The arguments to prepend to those provided to
  6193. * the new function.
  6194. * @param {Array} [holders] The `partials` placeholder indexes.
  6195. * @param {Array} [argPos] The argument positions of the new function.
  6196. * @param {number} [ary] The arity cap of `func`.
  6197. * @param {number} [arity] The arity of `func`.
  6198. * @returns {Function} Returns the new wrapped function.
  6199. */
  6200. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6201. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6202. newHolders = isCurry ? holders : undefined,
  6203. newHoldersRight = isCurry ? undefined : holders,
  6204. newPartials = isCurry ? partials : undefined,
  6205. newPartialsRight = isCurry ? undefined : partials;
  6206. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6207. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6208. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6209. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6210. }
  6211. var newData = [
  6212. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6213. newHoldersRight, argPos, ary, arity
  6214. ];
  6215. var result = wrapFunc.apply(undefined, newData);
  6216. if (isLaziable(func)) {
  6217. setData(result, newData);
  6218. }
  6219. result.placeholder = placeholder;
  6220. return setWrapToString(result, func, bitmask);
  6221. }
  6222. /**
  6223. * Creates a function like `_.round`.
  6224. *
  6225. * @private
  6226. * @param {string} methodName The name of the `Math` method to use when rounding.
  6227. * @returns {Function} Returns the new round function.
  6228. */
  6229. function createRound(methodName) {
  6230. var func = Math[methodName];
  6231. return function(number, precision) {
  6232. number = toNumber(number);
  6233. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6234. if (precision && nativeIsFinite(number)) {
  6235. // Shift with exponential notation to avoid floating-point issues.
  6236. // See [MDN](https://mdn.io/round#Examples) for more details.
  6237. var pair = (toString(number) + 'e').split('e'),
  6238. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6239. pair = (toString(value) + 'e').split('e');
  6240. return +(pair[0] + 'e' + (+pair[1] - precision));
  6241. }
  6242. return func(number);
  6243. };
  6244. }
  6245. /**
  6246. * Creates a set object of `values`.
  6247. *
  6248. * @private
  6249. * @param {Array} values The values to add to the set.
  6250. * @returns {Object} Returns the new set.
  6251. */
  6252. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6253. return new Set(values);
  6254. };
  6255. /**
  6256. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6257. *
  6258. * @private
  6259. * @param {Function} keysFunc The function to get the keys of a given object.
  6260. * @returns {Function} Returns the new pairs function.
  6261. */
  6262. function createToPairs(keysFunc) {
  6263. return function(object) {
  6264. var tag = getTag(object);
  6265. if (tag == mapTag) {
  6266. return mapToArray(object);
  6267. }
  6268. if (tag == setTag) {
  6269. return setToPairs(object);
  6270. }
  6271. return baseToPairs(object, keysFunc(object));
  6272. };
  6273. }
  6274. /**
  6275. * Creates a function that either curries or invokes `func` with optional
  6276. * `this` binding and partially applied arguments.
  6277. *
  6278. * @private
  6279. * @param {Function|string} func The function or method name to wrap.
  6280. * @param {number} bitmask The bitmask flags.
  6281. * 1 - `_.bind`
  6282. * 2 - `_.bindKey`
  6283. * 4 - `_.curry` or `_.curryRight` of a bound function
  6284. * 8 - `_.curry`
  6285. * 16 - `_.curryRight`
  6286. * 32 - `_.partial`
  6287. * 64 - `_.partialRight`
  6288. * 128 - `_.rearg`
  6289. * 256 - `_.ary`
  6290. * 512 - `_.flip`
  6291. * @param {*} [thisArg] The `this` binding of `func`.
  6292. * @param {Array} [partials] The arguments to be partially applied.
  6293. * @param {Array} [holders] The `partials` placeholder indexes.
  6294. * @param {Array} [argPos] The argument positions of the new function.
  6295. * @param {number} [ary] The arity cap of `func`.
  6296. * @param {number} [arity] The arity of `func`.
  6297. * @returns {Function} Returns the new wrapped function.
  6298. */
  6299. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6300. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6301. if (!isBindKey && typeof func != 'function') {
  6302. throw new TypeError(FUNC_ERROR_TEXT);
  6303. }
  6304. var length = partials ? partials.length : 0;
  6305. if (!length) {
  6306. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6307. partials = holders = undefined;
  6308. }
  6309. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6310. arity = arity === undefined ? arity : toInteger(arity);
  6311. length -= holders ? holders.length : 0;
  6312. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6313. var partialsRight = partials,
  6314. holdersRight = holders;
  6315. partials = holders = undefined;
  6316. }
  6317. var data = isBindKey ? undefined : getData(func);
  6318. var newData = [
  6319. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6320. argPos, ary, arity
  6321. ];
  6322. if (data) {
  6323. mergeData(newData, data);
  6324. }
  6325. func = newData[0];
  6326. bitmask = newData[1];
  6327. thisArg = newData[2];
  6328. partials = newData[3];
  6329. holders = newData[4];
  6330. arity = newData[9] = newData[9] === undefined
  6331. ? (isBindKey ? 0 : func.length)
  6332. : nativeMax(newData[9] - length, 0);
  6333. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6334. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6335. }
  6336. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6337. var result = createBind(func, bitmask, thisArg);
  6338. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6339. result = createCurry(func, bitmask, arity);
  6340. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6341. result = createPartial(func, bitmask, thisArg, partials);
  6342. } else {
  6343. result = createHybrid.apply(undefined, newData);
  6344. }
  6345. var setter = data ? baseSetData : setData;
  6346. return setWrapToString(setter(result, newData), func, bitmask);
  6347. }
  6348. /**
  6349. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6350. * of source objects to the destination object for all destination properties
  6351. * that resolve to `undefined`.
  6352. *
  6353. * @private
  6354. * @param {*} objValue The destination value.
  6355. * @param {*} srcValue The source value.
  6356. * @param {string} key The key of the property to assign.
  6357. * @param {Object} object The parent object of `objValue`.
  6358. * @returns {*} Returns the value to assign.
  6359. */
  6360. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6361. if (objValue === undefined ||
  6362. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6363. return srcValue;
  6364. }
  6365. return objValue;
  6366. }
  6367. /**
  6368. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6369. * objects into destination objects that are passed thru.
  6370. *
  6371. * @private
  6372. * @param {*} objValue The destination value.
  6373. * @param {*} srcValue The source value.
  6374. * @param {string} key The key of the property to merge.
  6375. * @param {Object} object The parent object of `objValue`.
  6376. * @param {Object} source The parent object of `srcValue`.
  6377. * @param {Object} [stack] Tracks traversed source values and their merged
  6378. * counterparts.
  6379. * @returns {*} Returns the value to assign.
  6380. */
  6381. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6382. if (isObject(objValue) && isObject(srcValue)) {
  6383. // Recursively merge objects and arrays (susceptible to call stack limits).
  6384. stack.set(srcValue, objValue);
  6385. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6386. stack['delete'](srcValue);
  6387. }
  6388. return objValue;
  6389. }
  6390. /**
  6391. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6392. * objects.
  6393. *
  6394. * @private
  6395. * @param {*} value The value to inspect.
  6396. * @param {string} key The key of the property to inspect.
  6397. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6398. */
  6399. function customOmitClone(value) {
  6400. return isPlainObject(value) ? undefined : value;
  6401. }
  6402. /**
  6403. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6404. * partial deep comparisons.
  6405. *
  6406. * @private
  6407. * @param {Array} array The array to compare.
  6408. * @param {Array} other The other array to compare.
  6409. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6410. * @param {Function} customizer The function to customize comparisons.
  6411. * @param {Function} equalFunc The function to determine equivalents of values.
  6412. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6413. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6414. */
  6415. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6416. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6417. arrLength = array.length,
  6418. othLength = other.length;
  6419. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6420. return false;
  6421. }
  6422. // Check that cyclic values are equal.
  6423. var arrStacked = stack.get(array);
  6424. var othStacked = stack.get(other);
  6425. if (arrStacked && othStacked) {
  6426. return arrStacked == other && othStacked == array;
  6427. }
  6428. var index = -1,
  6429. result = true,
  6430. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6431. stack.set(array, other);
  6432. stack.set(other, array);
  6433. // Ignore non-index properties.
  6434. while (++index < arrLength) {
  6435. var arrValue = array[index],
  6436. othValue = other[index];
  6437. if (customizer) {
  6438. var compared = isPartial
  6439. ? customizer(othValue, arrValue, index, other, array, stack)
  6440. : customizer(arrValue, othValue, index, array, other, stack);
  6441. }
  6442. if (compared !== undefined) {
  6443. if (compared) {
  6444. continue;
  6445. }
  6446. result = false;
  6447. break;
  6448. }
  6449. // Recursively compare arrays (susceptible to call stack limits).
  6450. if (seen) {
  6451. if (!arraySome(other, function(othValue, othIndex) {
  6452. if (!cacheHas(seen, othIndex) &&
  6453. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6454. return seen.push(othIndex);
  6455. }
  6456. })) {
  6457. result = false;
  6458. break;
  6459. }
  6460. } else if (!(
  6461. arrValue === othValue ||
  6462. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6463. )) {
  6464. result = false;
  6465. break;
  6466. }
  6467. }
  6468. stack['delete'](array);
  6469. stack['delete'](other);
  6470. return result;
  6471. }
  6472. /**
  6473. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6474. * the same `toStringTag`.
  6475. *
  6476. * **Note:** This function only supports comparing values with tags of
  6477. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6478. *
  6479. * @private
  6480. * @param {Object} object The object to compare.
  6481. * @param {Object} other The other object to compare.
  6482. * @param {string} tag The `toStringTag` of the objects to compare.
  6483. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6484. * @param {Function} customizer The function to customize comparisons.
  6485. * @param {Function} equalFunc The function to determine equivalents of values.
  6486. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6487. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6488. */
  6489. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6490. switch (tag) {
  6491. case dataViewTag:
  6492. if ((object.byteLength != other.byteLength) ||
  6493. (object.byteOffset != other.byteOffset)) {
  6494. return false;
  6495. }
  6496. object = object.buffer;
  6497. other = other.buffer;
  6498. case arrayBufferTag:
  6499. if ((object.byteLength != other.byteLength) ||
  6500. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6501. return false;
  6502. }
  6503. return true;
  6504. case boolTag:
  6505. case dateTag:
  6506. case numberTag:
  6507. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6508. // Invalid dates are coerced to `NaN`.
  6509. return eq(+object, +other);
  6510. case errorTag:
  6511. return object.name == other.name && object.message == other.message;
  6512. case regexpTag:
  6513. case stringTag:
  6514. // Coerce regexes to strings and treat strings, primitives and objects,
  6515. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6516. // for more details.
  6517. return object == (other + '');
  6518. case mapTag:
  6519. var convert = mapToArray;
  6520. case setTag:
  6521. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6522. convert || (convert = setToArray);
  6523. if (object.size != other.size && !isPartial) {
  6524. return false;
  6525. }
  6526. // Assume cyclic values are equal.
  6527. var stacked = stack.get(object);
  6528. if (stacked) {
  6529. return stacked == other;
  6530. }
  6531. bitmask |= COMPARE_UNORDERED_FLAG;
  6532. // Recursively compare objects (susceptible to call stack limits).
  6533. stack.set(object, other);
  6534. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6535. stack['delete'](object);
  6536. return result;
  6537. case symbolTag:
  6538. if (symbolValueOf) {
  6539. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6540. }
  6541. }
  6542. return false;
  6543. }
  6544. /**
  6545. * A specialized version of `baseIsEqualDeep` for objects with support for
  6546. * partial deep comparisons.
  6547. *
  6548. * @private
  6549. * @param {Object} object The object to compare.
  6550. * @param {Object} other The other object to compare.
  6551. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6552. * @param {Function} customizer The function to customize comparisons.
  6553. * @param {Function} equalFunc The function to determine equivalents of values.
  6554. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6555. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6556. */
  6557. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6558. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6559. objProps = getAllKeys(object),
  6560. objLength = objProps.length,
  6561. othProps = getAllKeys(other),
  6562. othLength = othProps.length;
  6563. if (objLength != othLength && !isPartial) {
  6564. return false;
  6565. }
  6566. var index = objLength;
  6567. while (index--) {
  6568. var key = objProps[index];
  6569. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6570. return false;
  6571. }
  6572. }
  6573. // Check that cyclic values are equal.
  6574. var objStacked = stack.get(object);
  6575. var othStacked = stack.get(other);
  6576. if (objStacked && othStacked) {
  6577. return objStacked == other && othStacked == object;
  6578. }
  6579. var result = true;
  6580. stack.set(object, other);
  6581. stack.set(other, object);
  6582. var skipCtor = isPartial;
  6583. while (++index < objLength) {
  6584. key = objProps[index];
  6585. var objValue = object[key],
  6586. othValue = other[key];
  6587. if (customizer) {
  6588. var compared = isPartial
  6589. ? customizer(othValue, objValue, key, other, object, stack)
  6590. : customizer(objValue, othValue, key, object, other, stack);
  6591. }
  6592. // Recursively compare objects (susceptible to call stack limits).
  6593. if (!(compared === undefined
  6594. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6595. : compared
  6596. )) {
  6597. result = false;
  6598. break;
  6599. }
  6600. skipCtor || (skipCtor = key == 'constructor');
  6601. }
  6602. if (result && !skipCtor) {
  6603. var objCtor = object.constructor,
  6604. othCtor = other.constructor;
  6605. // Non `Object` object instances with different constructors are not equal.
  6606. if (objCtor != othCtor &&
  6607. ('constructor' in object && 'constructor' in other) &&
  6608. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6609. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6610. result = false;
  6611. }
  6612. }
  6613. stack['delete'](object);
  6614. stack['delete'](other);
  6615. return result;
  6616. }
  6617. /**
  6618. * A specialized version of `baseRest` which flattens the rest array.
  6619. *
  6620. * @private
  6621. * @param {Function} func The function to apply a rest parameter to.
  6622. * @returns {Function} Returns the new function.
  6623. */
  6624. function flatRest(func) {
  6625. return setToString(overRest(func, undefined, flatten), func + '');
  6626. }
  6627. /**
  6628. * Creates an array of own enumerable property names and symbols of `object`.
  6629. *
  6630. * @private
  6631. * @param {Object} object The object to query.
  6632. * @returns {Array} Returns the array of property names and symbols.
  6633. */
  6634. function getAllKeys(object) {
  6635. return baseGetAllKeys(object, keys, getSymbols);
  6636. }
  6637. /**
  6638. * Creates an array of own and inherited enumerable property names and
  6639. * symbols of `object`.
  6640. *
  6641. * @private
  6642. * @param {Object} object The object to query.
  6643. * @returns {Array} Returns the array of property names and symbols.
  6644. */
  6645. function getAllKeysIn(object) {
  6646. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6647. }
  6648. /**
  6649. * Gets metadata for `func`.
  6650. *
  6651. * @private
  6652. * @param {Function} func The function to query.
  6653. * @returns {*} Returns the metadata for `func`.
  6654. */
  6655. var getData = !metaMap ? noop : function(func) {
  6656. return metaMap.get(func);
  6657. };
  6658. /**
  6659. * Gets the name of `func`.
  6660. *
  6661. * @private
  6662. * @param {Function} func The function to query.
  6663. * @returns {string} Returns the function name.
  6664. */
  6665. function getFuncName(func) {
  6666. var result = (func.name + ''),
  6667. array = realNames[result],
  6668. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6669. while (length--) {
  6670. var data = array[length],
  6671. otherFunc = data.func;
  6672. if (otherFunc == null || otherFunc == func) {
  6673. return data.name;
  6674. }
  6675. }
  6676. return result;
  6677. }
  6678. /**
  6679. * Gets the argument placeholder value for `func`.
  6680. *
  6681. * @private
  6682. * @param {Function} func The function to inspect.
  6683. * @returns {*} Returns the placeholder value.
  6684. */
  6685. function getHolder(func) {
  6686. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6687. return object.placeholder;
  6688. }
  6689. /**
  6690. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6691. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6692. * If arguments are provided, the chosen function is invoked with them and
  6693. * its result is returned.
  6694. *
  6695. * @private
  6696. * @param {*} [value] The value to convert to an iteratee.
  6697. * @param {number} [arity] The arity of the created iteratee.
  6698. * @returns {Function} Returns the chosen function or its result.
  6699. */
  6700. function getIteratee() {
  6701. var result = lodash.iteratee || iteratee;
  6702. result = result === iteratee ? baseIteratee : result;
  6703. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6704. }
  6705. /**
  6706. * Gets the data for `map`.
  6707. *
  6708. * @private
  6709. * @param {Object} map The map to query.
  6710. * @param {string} key The reference key.
  6711. * @returns {*} Returns the map data.
  6712. */
  6713. function getMapData(map, key) {
  6714. var data = map.__data__;
  6715. return isKeyable(key)
  6716. ? data[typeof key == 'string' ? 'string' : 'hash']
  6717. : data.map;
  6718. }
  6719. /**
  6720. * Gets the property names, values, and compare flags of `object`.
  6721. *
  6722. * @private
  6723. * @param {Object} object The object to query.
  6724. * @returns {Array} Returns the match data of `object`.
  6725. */
  6726. function getMatchData(object) {
  6727. var result = keys(object),
  6728. length = result.length;
  6729. while (length--) {
  6730. var key = result[length],
  6731. value = object[key];
  6732. result[length] = [key, value, isStrictComparable(value)];
  6733. }
  6734. return result;
  6735. }
  6736. /**
  6737. * Gets the native function at `key` of `object`.
  6738. *
  6739. * @private
  6740. * @param {Object} object The object to query.
  6741. * @param {string} key The key of the method to get.
  6742. * @returns {*} Returns the function if it's native, else `undefined`.
  6743. */
  6744. function getNative(object, key) {
  6745. var value = getValue(object, key);
  6746. return baseIsNative(value) ? value : undefined;
  6747. }
  6748. /**
  6749. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6750. *
  6751. * @private
  6752. * @param {*} value The value to query.
  6753. * @returns {string} Returns the raw `toStringTag`.
  6754. */
  6755. function getRawTag(value) {
  6756. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6757. tag = value[symToStringTag];
  6758. try {
  6759. value[symToStringTag] = undefined;
  6760. var unmasked = true;
  6761. } catch (e) {}
  6762. var result = nativeObjectToString.call(value);
  6763. if (unmasked) {
  6764. if (isOwn) {
  6765. value[symToStringTag] = tag;
  6766. } else {
  6767. delete value[symToStringTag];
  6768. }
  6769. }
  6770. return result;
  6771. }
  6772. /**
  6773. * Creates an array of the own enumerable symbols of `object`.
  6774. *
  6775. * @private
  6776. * @param {Object} object The object to query.
  6777. * @returns {Array} Returns the array of symbols.
  6778. */
  6779. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6780. if (object == null) {
  6781. return [];
  6782. }
  6783. object = Object(object);
  6784. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6785. return propertyIsEnumerable.call(object, symbol);
  6786. });
  6787. };
  6788. /**
  6789. * Creates an array of the own and inherited enumerable symbols of `object`.
  6790. *
  6791. * @private
  6792. * @param {Object} object The object to query.
  6793. * @returns {Array} Returns the array of symbols.
  6794. */
  6795. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6796. var result = [];
  6797. while (object) {
  6798. arrayPush(result, getSymbols(object));
  6799. object = getPrototype(object);
  6800. }
  6801. return result;
  6802. };
  6803. /**
  6804. * Gets the `toStringTag` of `value`.
  6805. *
  6806. * @private
  6807. * @param {*} value The value to query.
  6808. * @returns {string} Returns the `toStringTag`.
  6809. */
  6810. var getTag = baseGetTag;
  6811. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6812. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6813. (Map && getTag(new Map) != mapTag) ||
  6814. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6815. (Set && getTag(new Set) != setTag) ||
  6816. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6817. getTag = function(value) {
  6818. var result = baseGetTag(value),
  6819. Ctor = result == objectTag ? value.constructor : undefined,
  6820. ctorString = Ctor ? toSource(Ctor) : '';
  6821. if (ctorString) {
  6822. switch (ctorString) {
  6823. case dataViewCtorString: return dataViewTag;
  6824. case mapCtorString: return mapTag;
  6825. case promiseCtorString: return promiseTag;
  6826. case setCtorString: return setTag;
  6827. case weakMapCtorString: return weakMapTag;
  6828. }
  6829. }
  6830. return result;
  6831. };
  6832. }
  6833. /**
  6834. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6835. *
  6836. * @private
  6837. * @param {number} start The start of the view.
  6838. * @param {number} end The end of the view.
  6839. * @param {Array} transforms The transformations to apply to the view.
  6840. * @returns {Object} Returns an object containing the `start` and `end`
  6841. * positions of the view.
  6842. */
  6843. function getView(start, end, transforms) {
  6844. var index = -1,
  6845. length = transforms.length;
  6846. while (++index < length) {
  6847. var data = transforms[index],
  6848. size = data.size;
  6849. switch (data.type) {
  6850. case 'drop': start += size; break;
  6851. case 'dropRight': end -= size; break;
  6852. case 'take': end = nativeMin(end, start + size); break;
  6853. case 'takeRight': start = nativeMax(start, end - size); break;
  6854. }
  6855. }
  6856. return { 'start': start, 'end': end };
  6857. }
  6858. /**
  6859. * Extracts wrapper details from the `source` body comment.
  6860. *
  6861. * @private
  6862. * @param {string} source The source to inspect.
  6863. * @returns {Array} Returns the wrapper details.
  6864. */
  6865. function getWrapDetails(source) {
  6866. var match = source.match(reWrapDetails);
  6867. return match ? match[1].split(reSplitDetails) : [];
  6868. }
  6869. /**
  6870. * Checks if `path` exists on `object`.
  6871. *
  6872. * @private
  6873. * @param {Object} object The object to query.
  6874. * @param {Array|string} path The path to check.
  6875. * @param {Function} hasFunc The function to check properties.
  6876. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6877. */
  6878. function hasPath(object, path, hasFunc) {
  6879. path = castPath(path, object);
  6880. var index = -1,
  6881. length = path.length,
  6882. result = false;
  6883. while (++index < length) {
  6884. var key = toKey(path[index]);
  6885. if (!(result = object != null && hasFunc(object, key))) {
  6886. break;
  6887. }
  6888. object = object[key];
  6889. }
  6890. if (result || ++index != length) {
  6891. return result;
  6892. }
  6893. length = object == null ? 0 : object.length;
  6894. return !!length && isLength(length) && isIndex(key, length) &&
  6895. (isArray(object) || isArguments(object));
  6896. }
  6897. /**
  6898. * Initializes an array clone.
  6899. *
  6900. * @private
  6901. * @param {Array} array The array to clone.
  6902. * @returns {Array} Returns the initialized clone.
  6903. */
  6904. function initCloneArray(array) {
  6905. var length = array.length,
  6906. result = new array.constructor(length);
  6907. // Add properties assigned by `RegExp#exec`.
  6908. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6909. result.index = array.index;
  6910. result.input = array.input;
  6911. }
  6912. return result;
  6913. }
  6914. /**
  6915. * Initializes an object clone.
  6916. *
  6917. * @private
  6918. * @param {Object} object The object to clone.
  6919. * @returns {Object} Returns the initialized clone.
  6920. */
  6921. function initCloneObject(object) {
  6922. return (typeof object.constructor == 'function' && !isPrototype(object))
  6923. ? baseCreate(getPrototype(object))
  6924. : {};
  6925. }
  6926. /**
  6927. * Initializes an object clone based on its `toStringTag`.
  6928. *
  6929. * **Note:** This function only supports cloning values with tags of
  6930. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6931. *
  6932. * @private
  6933. * @param {Object} object The object to clone.
  6934. * @param {string} tag The `toStringTag` of the object to clone.
  6935. * @param {boolean} [isDeep] Specify a deep clone.
  6936. * @returns {Object} Returns the initialized clone.
  6937. */
  6938. function initCloneByTag(object, tag, isDeep) {
  6939. var Ctor = object.constructor;
  6940. switch (tag) {
  6941. case arrayBufferTag:
  6942. return cloneArrayBuffer(object);
  6943. case boolTag:
  6944. case dateTag:
  6945. return new Ctor(+object);
  6946. case dataViewTag:
  6947. return cloneDataView(object, isDeep);
  6948. case float32Tag: case float64Tag:
  6949. case int8Tag: case int16Tag: case int32Tag:
  6950. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6951. return cloneTypedArray(object, isDeep);
  6952. case mapTag:
  6953. return new Ctor;
  6954. case numberTag:
  6955. case stringTag:
  6956. return new Ctor(object);
  6957. case regexpTag:
  6958. return cloneRegExp(object);
  6959. case setTag:
  6960. return new Ctor;
  6961. case symbolTag:
  6962. return cloneSymbol(object);
  6963. }
  6964. }
  6965. /**
  6966. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6967. *
  6968. * @private
  6969. * @param {string} source The source to modify.
  6970. * @returns {Array} details The details to insert.
  6971. * @returns {string} Returns the modified source.
  6972. */
  6973. function insertWrapDetails(source, details) {
  6974. var length = details.length;
  6975. if (!length) {
  6976. return source;
  6977. }
  6978. var lastIndex = length - 1;
  6979. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6980. details = details.join(length > 2 ? ', ' : ' ');
  6981. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6982. }
  6983. /**
  6984. * Checks if `value` is a flattenable `arguments` object or array.
  6985. *
  6986. * @private
  6987. * @param {*} value The value to check.
  6988. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6989. */
  6990. function isFlattenable(value) {
  6991. return isArray(value) || isArguments(value) ||
  6992. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6993. }
  6994. /**
  6995. * Checks if `value` is a valid array-like index.
  6996. *
  6997. * @private
  6998. * @param {*} value The value to check.
  6999. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7000. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7001. */
  7002. function isIndex(value, length) {
  7003. var type = typeof value;
  7004. length = length == null ? MAX_SAFE_INTEGER : length;
  7005. return !!length &&
  7006. (type == 'number' ||
  7007. (type != 'symbol' && reIsUint.test(value))) &&
  7008. (value > -1 && value % 1 == 0 && value < length);
  7009. }
  7010. /**
  7011. * Checks if the given arguments are from an iteratee call.
  7012. *
  7013. * @private
  7014. * @param {*} value The potential iteratee value argument.
  7015. * @param {*} index The potential iteratee index or key argument.
  7016. * @param {*} object The potential iteratee object argument.
  7017. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7018. * else `false`.
  7019. */
  7020. function isIterateeCall(value, index, object) {
  7021. if (!isObject(object)) {
  7022. return false;
  7023. }
  7024. var type = typeof index;
  7025. if (type == 'number'
  7026. ? (isArrayLike(object) && isIndex(index, object.length))
  7027. : (type == 'string' && index in object)
  7028. ) {
  7029. return eq(object[index], value);
  7030. }
  7031. return false;
  7032. }
  7033. /**
  7034. * Checks if `value` is a property name and not a property path.
  7035. *
  7036. * @private
  7037. * @param {*} value The value to check.
  7038. * @param {Object} [object] The object to query keys on.
  7039. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7040. */
  7041. function isKey(value, object) {
  7042. if (isArray(value)) {
  7043. return false;
  7044. }
  7045. var type = typeof value;
  7046. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7047. value == null || isSymbol(value)) {
  7048. return true;
  7049. }
  7050. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7051. (object != null && value in Object(object));
  7052. }
  7053. /**
  7054. * Checks if `value` is suitable for use as unique object key.
  7055. *
  7056. * @private
  7057. * @param {*} value The value to check.
  7058. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7059. */
  7060. function isKeyable(value) {
  7061. var type = typeof value;
  7062. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7063. ? (value !== '__proto__')
  7064. : (value === null);
  7065. }
  7066. /**
  7067. * Checks if `func` has a lazy counterpart.
  7068. *
  7069. * @private
  7070. * @param {Function} func The function to check.
  7071. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7072. * else `false`.
  7073. */
  7074. function isLaziable(func) {
  7075. var funcName = getFuncName(func),
  7076. other = lodash[funcName];
  7077. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7078. return false;
  7079. }
  7080. if (func === other) {
  7081. return true;
  7082. }
  7083. var data = getData(other);
  7084. return !!data && func === data[0];
  7085. }
  7086. /**
  7087. * Checks if `func` has its source masked.
  7088. *
  7089. * @private
  7090. * @param {Function} func The function to check.
  7091. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7092. */
  7093. function isMasked(func) {
  7094. return !!maskSrcKey && (maskSrcKey in func);
  7095. }
  7096. /**
  7097. * Checks if `func` is capable of being masked.
  7098. *
  7099. * @private
  7100. * @param {*} value The value to check.
  7101. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7102. */
  7103. var isMaskable = coreJsData ? isFunction : stubFalse;
  7104. /**
  7105. * Checks if `value` is likely a prototype object.
  7106. *
  7107. * @private
  7108. * @param {*} value The value to check.
  7109. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7110. */
  7111. function isPrototype(value) {
  7112. var Ctor = value && value.constructor,
  7113. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7114. return value === proto;
  7115. }
  7116. /**
  7117. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7118. *
  7119. * @private
  7120. * @param {*} value The value to check.
  7121. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7122. * equality comparisons, else `false`.
  7123. */
  7124. function isStrictComparable(value) {
  7125. return value === value && !isObject(value);
  7126. }
  7127. /**
  7128. * A specialized version of `matchesProperty` for source values suitable
  7129. * for strict equality comparisons, i.e. `===`.
  7130. *
  7131. * @private
  7132. * @param {string} key The key of the property to get.
  7133. * @param {*} srcValue The value to match.
  7134. * @returns {Function} Returns the new spec function.
  7135. */
  7136. function matchesStrictComparable(key, srcValue) {
  7137. return function(object) {
  7138. if (object == null) {
  7139. return false;
  7140. }
  7141. return object[key] === srcValue &&
  7142. (srcValue !== undefined || (key in Object(object)));
  7143. };
  7144. }
  7145. /**
  7146. * A specialized version of `_.memoize` which clears the memoized function's
  7147. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7148. *
  7149. * @private
  7150. * @param {Function} func The function to have its output memoized.
  7151. * @returns {Function} Returns the new memoized function.
  7152. */
  7153. function memoizeCapped(func) {
  7154. var result = memoize(func, function(key) {
  7155. if (cache.size === MAX_MEMOIZE_SIZE) {
  7156. cache.clear();
  7157. }
  7158. return key;
  7159. });
  7160. var cache = result.cache;
  7161. return result;
  7162. }
  7163. /**
  7164. * Merges the function metadata of `source` into `data`.
  7165. *
  7166. * Merging metadata reduces the number of wrappers used to invoke a function.
  7167. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7168. * may be applied regardless of execution order. Methods like `_.ary` and
  7169. * `_.rearg` modify function arguments, making the order in which they are
  7170. * executed important, preventing the merging of metadata. However, we make
  7171. * an exception for a safe combined case where curried functions have `_.ary`
  7172. * and or `_.rearg` applied.
  7173. *
  7174. * @private
  7175. * @param {Array} data The destination metadata.
  7176. * @param {Array} source The source metadata.
  7177. * @returns {Array} Returns `data`.
  7178. */
  7179. function mergeData(data, source) {
  7180. var bitmask = data[1],
  7181. srcBitmask = source[1],
  7182. newBitmask = bitmask | srcBitmask,
  7183. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7184. var isCombo =
  7185. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7186. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7187. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7188. // Exit early if metadata can't be merged.
  7189. if (!(isCommon || isCombo)) {
  7190. return data;
  7191. }
  7192. // Use source `thisArg` if available.
  7193. if (srcBitmask & WRAP_BIND_FLAG) {
  7194. data[2] = source[2];
  7195. // Set when currying a bound function.
  7196. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7197. }
  7198. // Compose partial arguments.
  7199. var value = source[3];
  7200. if (value) {
  7201. var partials = data[3];
  7202. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7203. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7204. }
  7205. // Compose partial right arguments.
  7206. value = source[5];
  7207. if (value) {
  7208. partials = data[5];
  7209. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7210. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7211. }
  7212. // Use source `argPos` if available.
  7213. value = source[7];
  7214. if (value) {
  7215. data[7] = value;
  7216. }
  7217. // Use source `ary` if it's smaller.
  7218. if (srcBitmask & WRAP_ARY_FLAG) {
  7219. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7220. }
  7221. // Use source `arity` if one is not provided.
  7222. if (data[9] == null) {
  7223. data[9] = source[9];
  7224. }
  7225. // Use source `func` and merge bitmasks.
  7226. data[0] = source[0];
  7227. data[1] = newBitmask;
  7228. return data;
  7229. }
  7230. /**
  7231. * This function is like
  7232. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7233. * except that it includes inherited enumerable properties.
  7234. *
  7235. * @private
  7236. * @param {Object} object The object to query.
  7237. * @returns {Array} Returns the array of property names.
  7238. */
  7239. function nativeKeysIn(object) {
  7240. var result = [];
  7241. if (object != null) {
  7242. for (var key in Object(object)) {
  7243. result.push(key);
  7244. }
  7245. }
  7246. return result;
  7247. }
  7248. /**
  7249. * Converts `value` to a string using `Object.prototype.toString`.
  7250. *
  7251. * @private
  7252. * @param {*} value The value to convert.
  7253. * @returns {string} Returns the converted string.
  7254. */
  7255. function objectToString(value) {
  7256. return nativeObjectToString.call(value);
  7257. }
  7258. /**
  7259. * A specialized version of `baseRest` which transforms the rest array.
  7260. *
  7261. * @private
  7262. * @param {Function} func The function to apply a rest parameter to.
  7263. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7264. * @param {Function} transform The rest array transform.
  7265. * @returns {Function} Returns the new function.
  7266. */
  7267. function overRest(func, start, transform) {
  7268. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7269. return function() {
  7270. var args = arguments,
  7271. index = -1,
  7272. length = nativeMax(args.length - start, 0),
  7273. array = Array(length);
  7274. while (++index < length) {
  7275. array[index] = args[start + index];
  7276. }
  7277. index = -1;
  7278. var otherArgs = Array(start + 1);
  7279. while (++index < start) {
  7280. otherArgs[index] = args[index];
  7281. }
  7282. otherArgs[start] = transform(array);
  7283. return apply(func, this, otherArgs);
  7284. };
  7285. }
  7286. /**
  7287. * Gets the parent value at `path` of `object`.
  7288. *
  7289. * @private
  7290. * @param {Object} object The object to query.
  7291. * @param {Array} path The path to get the parent value of.
  7292. * @returns {*} Returns the parent value.
  7293. */
  7294. function parent(object, path) {
  7295. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7296. }
  7297. /**
  7298. * Reorder `array` according to the specified indexes where the element at
  7299. * the first index is assigned as the first element, the element at
  7300. * the second index is assigned as the second element, and so on.
  7301. *
  7302. * @private
  7303. * @param {Array} array The array to reorder.
  7304. * @param {Array} indexes The arranged array indexes.
  7305. * @returns {Array} Returns `array`.
  7306. */
  7307. function reorder(array, indexes) {
  7308. var arrLength = array.length,
  7309. length = nativeMin(indexes.length, arrLength),
  7310. oldArray = copyArray(array);
  7311. while (length--) {
  7312. var index = indexes[length];
  7313. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7314. }
  7315. return array;
  7316. }
  7317. /**
  7318. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7319. *
  7320. * @private
  7321. * @param {Object} object The object to query.
  7322. * @param {string} key The key of the property to get.
  7323. * @returns {*} Returns the property value.
  7324. */
  7325. function safeGet(object, key) {
  7326. if (key === 'constructor' && typeof object[key] === 'function') {
  7327. return;
  7328. }
  7329. if (key == '__proto__') {
  7330. return;
  7331. }
  7332. return object[key];
  7333. }
  7334. /**
  7335. * Sets metadata for `func`.
  7336. *
  7337. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7338. * period of time, it will trip its breaker and transition to an identity
  7339. * function to avoid garbage collection pauses in V8. See
  7340. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7341. * for more details.
  7342. *
  7343. * @private
  7344. * @param {Function} func The function to associate metadata with.
  7345. * @param {*} data The metadata.
  7346. * @returns {Function} Returns `func`.
  7347. */
  7348. var setData = shortOut(baseSetData);
  7349. /**
  7350. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7351. *
  7352. * @private
  7353. * @param {Function} func The function to delay.
  7354. * @param {number} wait The number of milliseconds to delay invocation.
  7355. * @returns {number|Object} Returns the timer id or timeout object.
  7356. */
  7357. var setTimeout = ctxSetTimeout || function(func, wait) {
  7358. return root.setTimeout(func, wait);
  7359. };
  7360. /**
  7361. * Sets the `toString` method of `func` to return `string`.
  7362. *
  7363. * @private
  7364. * @param {Function} func The function to modify.
  7365. * @param {Function} string The `toString` result.
  7366. * @returns {Function} Returns `func`.
  7367. */
  7368. var setToString = shortOut(baseSetToString);
  7369. /**
  7370. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7371. * with wrapper details in a comment at the top of the source body.
  7372. *
  7373. * @private
  7374. * @param {Function} wrapper The function to modify.
  7375. * @param {Function} reference The reference function.
  7376. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7377. * @returns {Function} Returns `wrapper`.
  7378. */
  7379. function setWrapToString(wrapper, reference, bitmask) {
  7380. var source = (reference + '');
  7381. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7382. }
  7383. /**
  7384. * Creates a function that'll short out and invoke `identity` instead
  7385. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7386. * milliseconds.
  7387. *
  7388. * @private
  7389. * @param {Function} func The function to restrict.
  7390. * @returns {Function} Returns the new shortable function.
  7391. */
  7392. function shortOut(func) {
  7393. var count = 0,
  7394. lastCalled = 0;
  7395. return function() {
  7396. var stamp = nativeNow(),
  7397. remaining = HOT_SPAN - (stamp - lastCalled);
  7398. lastCalled = stamp;
  7399. if (remaining > 0) {
  7400. if (++count >= HOT_COUNT) {
  7401. return arguments[0];
  7402. }
  7403. } else {
  7404. count = 0;
  7405. }
  7406. return func.apply(undefined, arguments);
  7407. };
  7408. }
  7409. /**
  7410. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7411. *
  7412. * @private
  7413. * @param {Array} array The array to shuffle.
  7414. * @param {number} [size=array.length] The size of `array`.
  7415. * @returns {Array} Returns `array`.
  7416. */
  7417. function shuffleSelf(array, size) {
  7418. var index = -1,
  7419. length = array.length,
  7420. lastIndex = length - 1;
  7421. size = size === undefined ? length : size;
  7422. while (++index < size) {
  7423. var rand = baseRandom(index, lastIndex),
  7424. value = array[rand];
  7425. array[rand] = array[index];
  7426. array[index] = value;
  7427. }
  7428. array.length = size;
  7429. return array;
  7430. }
  7431. /**
  7432. * Converts `string` to a property path array.
  7433. *
  7434. * @private
  7435. * @param {string} string The string to convert.
  7436. * @returns {Array} Returns the property path array.
  7437. */
  7438. var stringToPath = memoizeCapped(function(string) {
  7439. var result = [];
  7440. if (string.charCodeAt(0) === 46 /* . */) {
  7441. result.push('');
  7442. }
  7443. string.replace(rePropName, function(match, number, quote, subString) {
  7444. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7445. });
  7446. return result;
  7447. });
  7448. /**
  7449. * Converts `value` to a string key if it's not a string or symbol.
  7450. *
  7451. * @private
  7452. * @param {*} value The value to inspect.
  7453. * @returns {string|symbol} Returns the key.
  7454. */
  7455. function toKey(value) {
  7456. if (typeof value == 'string' || isSymbol(value)) {
  7457. return value;
  7458. }
  7459. var result = (value + '');
  7460. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7461. }
  7462. /**
  7463. * Converts `func` to its source code.
  7464. *
  7465. * @private
  7466. * @param {Function} func The function to convert.
  7467. * @returns {string} Returns the source code.
  7468. */
  7469. function toSource(func) {
  7470. if (func != null) {
  7471. try {
  7472. return funcToString.call(func);
  7473. } catch (e) {}
  7474. try {
  7475. return (func + '');
  7476. } catch (e) {}
  7477. }
  7478. return '';
  7479. }
  7480. /**
  7481. * Updates wrapper `details` based on `bitmask` flags.
  7482. *
  7483. * @private
  7484. * @returns {Array} details The details to modify.
  7485. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7486. * @returns {Array} Returns `details`.
  7487. */
  7488. function updateWrapDetails(details, bitmask) {
  7489. arrayEach(wrapFlags, function(pair) {
  7490. var value = '_.' + pair[0];
  7491. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7492. details.push(value);
  7493. }
  7494. });
  7495. return details.sort();
  7496. }
  7497. /**
  7498. * Creates a clone of `wrapper`.
  7499. *
  7500. * @private
  7501. * @param {Object} wrapper The wrapper to clone.
  7502. * @returns {Object} Returns the cloned wrapper.
  7503. */
  7504. function wrapperClone(wrapper) {
  7505. if (wrapper instanceof LazyWrapper) {
  7506. return wrapper.clone();
  7507. }
  7508. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7509. result.__actions__ = copyArray(wrapper.__actions__);
  7510. result.__index__ = wrapper.__index__;
  7511. result.__values__ = wrapper.__values__;
  7512. return result;
  7513. }
  7514. /*------------------------------------------------------------------------*/
  7515. /**
  7516. * Creates an array of elements split into groups the length of `size`.
  7517. * If `array` can't be split evenly, the final chunk will be the remaining
  7518. * elements.
  7519. *
  7520. * @static
  7521. * @memberOf _
  7522. * @since 3.0.0
  7523. * @category Array
  7524. * @param {Array} array The array to process.
  7525. * @param {number} [size=1] The length of each chunk
  7526. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7527. * @returns {Array} Returns the new array of chunks.
  7528. * @example
  7529. *
  7530. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7531. * // => [['a', 'b'], ['c', 'd']]
  7532. *
  7533. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7534. * // => [['a', 'b', 'c'], ['d']]
  7535. */
  7536. function chunk(array, size, guard) {
  7537. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7538. size = 1;
  7539. } else {
  7540. size = nativeMax(toInteger(size), 0);
  7541. }
  7542. var length = array == null ? 0 : array.length;
  7543. if (!length || size < 1) {
  7544. return [];
  7545. }
  7546. var index = 0,
  7547. resIndex = 0,
  7548. result = Array(nativeCeil(length / size));
  7549. while (index < length) {
  7550. result[resIndex++] = baseSlice(array, index, (index += size));
  7551. }
  7552. return result;
  7553. }
  7554. /**
  7555. * Creates an array with all falsey values removed. The values `false`, `null`,
  7556. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7557. *
  7558. * @static
  7559. * @memberOf _
  7560. * @since 0.1.0
  7561. * @category Array
  7562. * @param {Array} array The array to compact.
  7563. * @returns {Array} Returns the new array of filtered values.
  7564. * @example
  7565. *
  7566. * _.compact([0, 1, false, 2, '', 3]);
  7567. * // => [1, 2, 3]
  7568. */
  7569. function compact(array) {
  7570. var index = -1,
  7571. length = array == null ? 0 : array.length,
  7572. resIndex = 0,
  7573. result = [];
  7574. while (++index < length) {
  7575. var value = array[index];
  7576. if (value) {
  7577. result[resIndex++] = value;
  7578. }
  7579. }
  7580. return result;
  7581. }
  7582. /**
  7583. * Creates a new array concatenating `array` with any additional arrays
  7584. * and/or values.
  7585. *
  7586. * @static
  7587. * @memberOf _
  7588. * @since 4.0.0
  7589. * @category Array
  7590. * @param {Array} array The array to concatenate.
  7591. * @param {...*} [values] The values to concatenate.
  7592. * @returns {Array} Returns the new concatenated array.
  7593. * @example
  7594. *
  7595. * var array = [1];
  7596. * var other = _.concat(array, 2, [3], [[4]]);
  7597. *
  7598. * console.log(other);
  7599. * // => [1, 2, 3, [4]]
  7600. *
  7601. * console.log(array);
  7602. * // => [1]
  7603. */
  7604. function concat() {
  7605. var length = arguments.length;
  7606. if (!length) {
  7607. return [];
  7608. }
  7609. var args = Array(length - 1),
  7610. array = arguments[0],
  7611. index = length;
  7612. while (index--) {
  7613. args[index - 1] = arguments[index];
  7614. }
  7615. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7616. }
  7617. /**
  7618. * Creates an array of `array` values not included in the other given arrays
  7619. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7620. * for equality comparisons. The order and references of result values are
  7621. * determined by the first array.
  7622. *
  7623. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7624. *
  7625. * @static
  7626. * @memberOf _
  7627. * @since 0.1.0
  7628. * @category Array
  7629. * @param {Array} array The array to inspect.
  7630. * @param {...Array} [values] The values to exclude.
  7631. * @returns {Array} Returns the new array of filtered values.
  7632. * @see _.without, _.xor
  7633. * @example
  7634. *
  7635. * _.difference([2, 1], [2, 3]);
  7636. * // => [1]
  7637. */
  7638. var difference = baseRest(function(array, values) {
  7639. return isArrayLikeObject(array)
  7640. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7641. : [];
  7642. });
  7643. /**
  7644. * This method is like `_.difference` except that it accepts `iteratee` which
  7645. * is invoked for each element of `array` and `values` to generate the criterion
  7646. * by which they're compared. The order and references of result values are
  7647. * determined by the first array. The iteratee is invoked with one argument:
  7648. * (value).
  7649. *
  7650. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7651. *
  7652. * @static
  7653. * @memberOf _
  7654. * @since 4.0.0
  7655. * @category Array
  7656. * @param {Array} array The array to inspect.
  7657. * @param {...Array} [values] The values to exclude.
  7658. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7659. * @returns {Array} Returns the new array of filtered values.
  7660. * @example
  7661. *
  7662. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7663. * // => [1.2]
  7664. *
  7665. * // The `_.property` iteratee shorthand.
  7666. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7667. * // => [{ 'x': 2 }]
  7668. */
  7669. var differenceBy = baseRest(function(array, values) {
  7670. var iteratee = last(values);
  7671. if (isArrayLikeObject(iteratee)) {
  7672. iteratee = undefined;
  7673. }
  7674. return isArrayLikeObject(array)
  7675. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7676. : [];
  7677. });
  7678. /**
  7679. * This method is like `_.difference` except that it accepts `comparator`
  7680. * which is invoked to compare elements of `array` to `values`. The order and
  7681. * references of result values are determined by the first array. The comparator
  7682. * is invoked with two arguments: (arrVal, othVal).
  7683. *
  7684. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7685. *
  7686. * @static
  7687. * @memberOf _
  7688. * @since 4.0.0
  7689. * @category Array
  7690. * @param {Array} array The array to inspect.
  7691. * @param {...Array} [values] The values to exclude.
  7692. * @param {Function} [comparator] The comparator invoked per element.
  7693. * @returns {Array} Returns the new array of filtered values.
  7694. * @example
  7695. *
  7696. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7697. *
  7698. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7699. * // => [{ 'x': 2, 'y': 1 }]
  7700. */
  7701. var differenceWith = baseRest(function(array, values) {
  7702. var comparator = last(values);
  7703. if (isArrayLikeObject(comparator)) {
  7704. comparator = undefined;
  7705. }
  7706. return isArrayLikeObject(array)
  7707. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7708. : [];
  7709. });
  7710. /**
  7711. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7712. *
  7713. * @static
  7714. * @memberOf _
  7715. * @since 0.5.0
  7716. * @category Array
  7717. * @param {Array} array The array to query.
  7718. * @param {number} [n=1] The number of elements to drop.
  7719. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7720. * @returns {Array} Returns the slice of `array`.
  7721. * @example
  7722. *
  7723. * _.drop([1, 2, 3]);
  7724. * // => [2, 3]
  7725. *
  7726. * _.drop([1, 2, 3], 2);
  7727. * // => [3]
  7728. *
  7729. * _.drop([1, 2, 3], 5);
  7730. * // => []
  7731. *
  7732. * _.drop([1, 2, 3], 0);
  7733. * // => [1, 2, 3]
  7734. */
  7735. function drop(array, n, guard) {
  7736. var length = array == null ? 0 : array.length;
  7737. if (!length) {
  7738. return [];
  7739. }
  7740. n = (guard || n === undefined) ? 1 : toInteger(n);
  7741. return baseSlice(array, n < 0 ? 0 : n, length);
  7742. }
  7743. /**
  7744. * Creates a slice of `array` with `n` elements dropped from the end.
  7745. *
  7746. * @static
  7747. * @memberOf _
  7748. * @since 3.0.0
  7749. * @category Array
  7750. * @param {Array} array The array to query.
  7751. * @param {number} [n=1] The number of elements to drop.
  7752. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7753. * @returns {Array} Returns the slice of `array`.
  7754. * @example
  7755. *
  7756. * _.dropRight([1, 2, 3]);
  7757. * // => [1, 2]
  7758. *
  7759. * _.dropRight([1, 2, 3], 2);
  7760. * // => [1]
  7761. *
  7762. * _.dropRight([1, 2, 3], 5);
  7763. * // => []
  7764. *
  7765. * _.dropRight([1, 2, 3], 0);
  7766. * // => [1, 2, 3]
  7767. */
  7768. function dropRight(array, n, guard) {
  7769. var length = array == null ? 0 : array.length;
  7770. if (!length) {
  7771. return [];
  7772. }
  7773. n = (guard || n === undefined) ? 1 : toInteger(n);
  7774. n = length - n;
  7775. return baseSlice(array, 0, n < 0 ? 0 : n);
  7776. }
  7777. /**
  7778. * Creates a slice of `array` excluding elements dropped from the end.
  7779. * Elements are dropped until `predicate` returns falsey. The predicate is
  7780. * invoked with three arguments: (value, index, array).
  7781. *
  7782. * @static
  7783. * @memberOf _
  7784. * @since 3.0.0
  7785. * @category Array
  7786. * @param {Array} array The array to query.
  7787. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7788. * @returns {Array} Returns the slice of `array`.
  7789. * @example
  7790. *
  7791. * var users = [
  7792. * { 'user': 'barney', 'active': true },
  7793. * { 'user': 'fred', 'active': false },
  7794. * { 'user': 'pebbles', 'active': false }
  7795. * ];
  7796. *
  7797. * _.dropRightWhile(users, function(o) { return !o.active; });
  7798. * // => objects for ['barney']
  7799. *
  7800. * // The `_.matches` iteratee shorthand.
  7801. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7802. * // => objects for ['barney', 'fred']
  7803. *
  7804. * // The `_.matchesProperty` iteratee shorthand.
  7805. * _.dropRightWhile(users, ['active', false]);
  7806. * // => objects for ['barney']
  7807. *
  7808. * // The `_.property` iteratee shorthand.
  7809. * _.dropRightWhile(users, 'active');
  7810. * // => objects for ['barney', 'fred', 'pebbles']
  7811. */
  7812. function dropRightWhile(array, predicate) {
  7813. return (array && array.length)
  7814. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7815. : [];
  7816. }
  7817. /**
  7818. * Creates a slice of `array` excluding elements dropped from the beginning.
  7819. * Elements are dropped until `predicate` returns falsey. The predicate is
  7820. * invoked with three arguments: (value, index, array).
  7821. *
  7822. * @static
  7823. * @memberOf _
  7824. * @since 3.0.0
  7825. * @category Array
  7826. * @param {Array} array The array to query.
  7827. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7828. * @returns {Array} Returns the slice of `array`.
  7829. * @example
  7830. *
  7831. * var users = [
  7832. * { 'user': 'barney', 'active': false },
  7833. * { 'user': 'fred', 'active': false },
  7834. * { 'user': 'pebbles', 'active': true }
  7835. * ];
  7836. *
  7837. * _.dropWhile(users, function(o) { return !o.active; });
  7838. * // => objects for ['pebbles']
  7839. *
  7840. * // The `_.matches` iteratee shorthand.
  7841. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7842. * // => objects for ['fred', 'pebbles']
  7843. *
  7844. * // The `_.matchesProperty` iteratee shorthand.
  7845. * _.dropWhile(users, ['active', false]);
  7846. * // => objects for ['pebbles']
  7847. *
  7848. * // The `_.property` iteratee shorthand.
  7849. * _.dropWhile(users, 'active');
  7850. * // => objects for ['barney', 'fred', 'pebbles']
  7851. */
  7852. function dropWhile(array, predicate) {
  7853. return (array && array.length)
  7854. ? baseWhile(array, getIteratee(predicate, 3), true)
  7855. : [];
  7856. }
  7857. /**
  7858. * Fills elements of `array` with `value` from `start` up to, but not
  7859. * including, `end`.
  7860. *
  7861. * **Note:** This method mutates `array`.
  7862. *
  7863. * @static
  7864. * @memberOf _
  7865. * @since 3.2.0
  7866. * @category Array
  7867. * @param {Array} array The array to fill.
  7868. * @param {*} value The value to fill `array` with.
  7869. * @param {number} [start=0] The start position.
  7870. * @param {number} [end=array.length] The end position.
  7871. * @returns {Array} Returns `array`.
  7872. * @example
  7873. *
  7874. * var array = [1, 2, 3];
  7875. *
  7876. * _.fill(array, 'a');
  7877. * console.log(array);
  7878. * // => ['a', 'a', 'a']
  7879. *
  7880. * _.fill(Array(3), 2);
  7881. * // => [2, 2, 2]
  7882. *
  7883. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7884. * // => [4, '*', '*', 10]
  7885. */
  7886. function fill(array, value, start, end) {
  7887. var length = array == null ? 0 : array.length;
  7888. if (!length) {
  7889. return [];
  7890. }
  7891. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7892. start = 0;
  7893. end = length;
  7894. }
  7895. return baseFill(array, value, start, end);
  7896. }
  7897. /**
  7898. * This method is like `_.find` except that it returns the index of the first
  7899. * element `predicate` returns truthy for instead of the element itself.
  7900. *
  7901. * @static
  7902. * @memberOf _
  7903. * @since 1.1.0
  7904. * @category Array
  7905. * @param {Array} array The array to inspect.
  7906. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7907. * @param {number} [fromIndex=0] The index to search from.
  7908. * @returns {number} Returns the index of the found element, else `-1`.
  7909. * @example
  7910. *
  7911. * var users = [
  7912. * { 'user': 'barney', 'active': false },
  7913. * { 'user': 'fred', 'active': false },
  7914. * { 'user': 'pebbles', 'active': true }
  7915. * ];
  7916. *
  7917. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7918. * // => 0
  7919. *
  7920. * // The `_.matches` iteratee shorthand.
  7921. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7922. * // => 1
  7923. *
  7924. * // The `_.matchesProperty` iteratee shorthand.
  7925. * _.findIndex(users, ['active', false]);
  7926. * // => 0
  7927. *
  7928. * // The `_.property` iteratee shorthand.
  7929. * _.findIndex(users, 'active');
  7930. * // => 2
  7931. */
  7932. function findIndex(array, predicate, fromIndex) {
  7933. var length = array == null ? 0 : array.length;
  7934. if (!length) {
  7935. return -1;
  7936. }
  7937. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7938. if (index < 0) {
  7939. index = nativeMax(length + index, 0);
  7940. }
  7941. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7942. }
  7943. /**
  7944. * This method is like `_.findIndex` except that it iterates over elements
  7945. * of `collection` from right to left.
  7946. *
  7947. * @static
  7948. * @memberOf _
  7949. * @since 2.0.0
  7950. * @category Array
  7951. * @param {Array} array The array to inspect.
  7952. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7953. * @param {number} [fromIndex=array.length-1] The index to search from.
  7954. * @returns {number} Returns the index of the found element, else `-1`.
  7955. * @example
  7956. *
  7957. * var users = [
  7958. * { 'user': 'barney', 'active': true },
  7959. * { 'user': 'fred', 'active': false },
  7960. * { 'user': 'pebbles', 'active': false }
  7961. * ];
  7962. *
  7963. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7964. * // => 2
  7965. *
  7966. * // The `_.matches` iteratee shorthand.
  7967. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7968. * // => 0
  7969. *
  7970. * // The `_.matchesProperty` iteratee shorthand.
  7971. * _.findLastIndex(users, ['active', false]);
  7972. * // => 2
  7973. *
  7974. * // The `_.property` iteratee shorthand.
  7975. * _.findLastIndex(users, 'active');
  7976. * // => 0
  7977. */
  7978. function findLastIndex(array, predicate, fromIndex) {
  7979. var length = array == null ? 0 : array.length;
  7980. if (!length) {
  7981. return -1;
  7982. }
  7983. var index = length - 1;
  7984. if (fromIndex !== undefined) {
  7985. index = toInteger(fromIndex);
  7986. index = fromIndex < 0
  7987. ? nativeMax(length + index, 0)
  7988. : nativeMin(index, length - 1);
  7989. }
  7990. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7991. }
  7992. /**
  7993. * Flattens `array` a single level deep.
  7994. *
  7995. * @static
  7996. * @memberOf _
  7997. * @since 0.1.0
  7998. * @category Array
  7999. * @param {Array} array The array to flatten.
  8000. * @returns {Array} Returns the new flattened array.
  8001. * @example
  8002. *
  8003. * _.flatten([1, [2, [3, [4]], 5]]);
  8004. * // => [1, 2, [3, [4]], 5]
  8005. */
  8006. function flatten(array) {
  8007. var length = array == null ? 0 : array.length;
  8008. return length ? baseFlatten(array, 1) : [];
  8009. }
  8010. /**
  8011. * Recursively flattens `array`.
  8012. *
  8013. * @static
  8014. * @memberOf _
  8015. * @since 3.0.0
  8016. * @category Array
  8017. * @param {Array} array The array to flatten.
  8018. * @returns {Array} Returns the new flattened array.
  8019. * @example
  8020. *
  8021. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8022. * // => [1, 2, 3, 4, 5]
  8023. */
  8024. function flattenDeep(array) {
  8025. var length = array == null ? 0 : array.length;
  8026. return length ? baseFlatten(array, INFINITY) : [];
  8027. }
  8028. /**
  8029. * Recursively flatten `array` up to `depth` times.
  8030. *
  8031. * @static
  8032. * @memberOf _
  8033. * @since 4.4.0
  8034. * @category Array
  8035. * @param {Array} array The array to flatten.
  8036. * @param {number} [depth=1] The maximum recursion depth.
  8037. * @returns {Array} Returns the new flattened array.
  8038. * @example
  8039. *
  8040. * var array = [1, [2, [3, [4]], 5]];
  8041. *
  8042. * _.flattenDepth(array, 1);
  8043. * // => [1, 2, [3, [4]], 5]
  8044. *
  8045. * _.flattenDepth(array, 2);
  8046. * // => [1, 2, 3, [4], 5]
  8047. */
  8048. function flattenDepth(array, depth) {
  8049. var length = array == null ? 0 : array.length;
  8050. if (!length) {
  8051. return [];
  8052. }
  8053. depth = depth === undefined ? 1 : toInteger(depth);
  8054. return baseFlatten(array, depth);
  8055. }
  8056. /**
  8057. * The inverse of `_.toPairs`; this method returns an object composed
  8058. * from key-value `pairs`.
  8059. *
  8060. * @static
  8061. * @memberOf _
  8062. * @since 4.0.0
  8063. * @category Array
  8064. * @param {Array} pairs The key-value pairs.
  8065. * @returns {Object} Returns the new object.
  8066. * @example
  8067. *
  8068. * _.fromPairs([['a', 1], ['b', 2]]);
  8069. * // => { 'a': 1, 'b': 2 }
  8070. */
  8071. function fromPairs(pairs) {
  8072. var index = -1,
  8073. length = pairs == null ? 0 : pairs.length,
  8074. result = {};
  8075. while (++index < length) {
  8076. var pair = pairs[index];
  8077. result[pair[0]] = pair[1];
  8078. }
  8079. return result;
  8080. }
  8081. /**
  8082. * Gets the first element of `array`.
  8083. *
  8084. * @static
  8085. * @memberOf _
  8086. * @since 0.1.0
  8087. * @alias first
  8088. * @category Array
  8089. * @param {Array} array The array to query.
  8090. * @returns {*} Returns the first element of `array`.
  8091. * @example
  8092. *
  8093. * _.head([1, 2, 3]);
  8094. * // => 1
  8095. *
  8096. * _.head([]);
  8097. * // => undefined
  8098. */
  8099. function head(array) {
  8100. return (array && array.length) ? array[0] : undefined;
  8101. }
  8102. /**
  8103. * Gets the index at which the first occurrence of `value` is found in `array`
  8104. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8105. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8106. * offset from the end of `array`.
  8107. *
  8108. * @static
  8109. * @memberOf _
  8110. * @since 0.1.0
  8111. * @category Array
  8112. * @param {Array} array The array to inspect.
  8113. * @param {*} value The value to search for.
  8114. * @param {number} [fromIndex=0] The index to search from.
  8115. * @returns {number} Returns the index of the matched value, else `-1`.
  8116. * @example
  8117. *
  8118. * _.indexOf([1, 2, 1, 2], 2);
  8119. * // => 1
  8120. *
  8121. * // Search from the `fromIndex`.
  8122. * _.indexOf([1, 2, 1, 2], 2, 2);
  8123. * // => 3
  8124. */
  8125. function indexOf(array, value, fromIndex) {
  8126. var length = array == null ? 0 : array.length;
  8127. if (!length) {
  8128. return -1;
  8129. }
  8130. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8131. if (index < 0) {
  8132. index = nativeMax(length + index, 0);
  8133. }
  8134. return baseIndexOf(array, value, index);
  8135. }
  8136. /**
  8137. * Gets all but the last element of `array`.
  8138. *
  8139. * @static
  8140. * @memberOf _
  8141. * @since 0.1.0
  8142. * @category Array
  8143. * @param {Array} array The array to query.
  8144. * @returns {Array} Returns the slice of `array`.
  8145. * @example
  8146. *
  8147. * _.initial([1, 2, 3]);
  8148. * // => [1, 2]
  8149. */
  8150. function initial(array) {
  8151. var length = array == null ? 0 : array.length;
  8152. return length ? baseSlice(array, 0, -1) : [];
  8153. }
  8154. /**
  8155. * Creates an array of unique values that are included in all given arrays
  8156. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8157. * for equality comparisons. The order and references of result values are
  8158. * determined by the first array.
  8159. *
  8160. * @static
  8161. * @memberOf _
  8162. * @since 0.1.0
  8163. * @category Array
  8164. * @param {...Array} [arrays] The arrays to inspect.
  8165. * @returns {Array} Returns the new array of intersecting values.
  8166. * @example
  8167. *
  8168. * _.intersection([2, 1], [2, 3]);
  8169. * // => [2]
  8170. */
  8171. var intersection = baseRest(function(arrays) {
  8172. var mapped = arrayMap(arrays, castArrayLikeObject);
  8173. return (mapped.length && mapped[0] === arrays[0])
  8174. ? baseIntersection(mapped)
  8175. : [];
  8176. });
  8177. /**
  8178. * This method is like `_.intersection` except that it accepts `iteratee`
  8179. * which is invoked for each element of each `arrays` to generate the criterion
  8180. * by which they're compared. The order and references of result values are
  8181. * determined by the first array. The iteratee is invoked with one argument:
  8182. * (value).
  8183. *
  8184. * @static
  8185. * @memberOf _
  8186. * @since 4.0.0
  8187. * @category Array
  8188. * @param {...Array} [arrays] The arrays to inspect.
  8189. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8190. * @returns {Array} Returns the new array of intersecting values.
  8191. * @example
  8192. *
  8193. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8194. * // => [2.1]
  8195. *
  8196. * // The `_.property` iteratee shorthand.
  8197. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8198. * // => [{ 'x': 1 }]
  8199. */
  8200. var intersectionBy = baseRest(function(arrays) {
  8201. var iteratee = last(arrays),
  8202. mapped = arrayMap(arrays, castArrayLikeObject);
  8203. if (iteratee === last(mapped)) {
  8204. iteratee = undefined;
  8205. } else {
  8206. mapped.pop();
  8207. }
  8208. return (mapped.length && mapped[0] === arrays[0])
  8209. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8210. : [];
  8211. });
  8212. /**
  8213. * This method is like `_.intersection` except that it accepts `comparator`
  8214. * which is invoked to compare elements of `arrays`. The order and references
  8215. * of result values are determined by the first array. The comparator is
  8216. * invoked with two arguments: (arrVal, othVal).
  8217. *
  8218. * @static
  8219. * @memberOf _
  8220. * @since 4.0.0
  8221. * @category Array
  8222. * @param {...Array} [arrays] The arrays to inspect.
  8223. * @param {Function} [comparator] The comparator invoked per element.
  8224. * @returns {Array} Returns the new array of intersecting values.
  8225. * @example
  8226. *
  8227. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8228. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8229. *
  8230. * _.intersectionWith(objects, others, _.isEqual);
  8231. * // => [{ 'x': 1, 'y': 2 }]
  8232. */
  8233. var intersectionWith = baseRest(function(arrays) {
  8234. var comparator = last(arrays),
  8235. mapped = arrayMap(arrays, castArrayLikeObject);
  8236. comparator = typeof comparator == 'function' ? comparator : undefined;
  8237. if (comparator) {
  8238. mapped.pop();
  8239. }
  8240. return (mapped.length && mapped[0] === arrays[0])
  8241. ? baseIntersection(mapped, undefined, comparator)
  8242. : [];
  8243. });
  8244. /**
  8245. * Converts all elements in `array` into a string separated by `separator`.
  8246. *
  8247. * @static
  8248. * @memberOf _
  8249. * @since 4.0.0
  8250. * @category Array
  8251. * @param {Array} array The array to convert.
  8252. * @param {string} [separator=','] The element separator.
  8253. * @returns {string} Returns the joined string.
  8254. * @example
  8255. *
  8256. * _.join(['a', 'b', 'c'], '~');
  8257. * // => 'a~b~c'
  8258. */
  8259. function join(array, separator) {
  8260. return array == null ? '' : nativeJoin.call(array, separator);
  8261. }
  8262. /**
  8263. * Gets the last element of `array`.
  8264. *
  8265. * @static
  8266. * @memberOf _
  8267. * @since 0.1.0
  8268. * @category Array
  8269. * @param {Array} array The array to query.
  8270. * @returns {*} Returns the last element of `array`.
  8271. * @example
  8272. *
  8273. * _.last([1, 2, 3]);
  8274. * // => 3
  8275. */
  8276. function last(array) {
  8277. var length = array == null ? 0 : array.length;
  8278. return length ? array[length - 1] : undefined;
  8279. }
  8280. /**
  8281. * This method is like `_.indexOf` except that it iterates over elements of
  8282. * `array` from right to left.
  8283. *
  8284. * @static
  8285. * @memberOf _
  8286. * @since 0.1.0
  8287. * @category Array
  8288. * @param {Array} array The array to inspect.
  8289. * @param {*} value The value to search for.
  8290. * @param {number} [fromIndex=array.length-1] The index to search from.
  8291. * @returns {number} Returns the index of the matched value, else `-1`.
  8292. * @example
  8293. *
  8294. * _.lastIndexOf([1, 2, 1, 2], 2);
  8295. * // => 3
  8296. *
  8297. * // Search from the `fromIndex`.
  8298. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8299. * // => 1
  8300. */
  8301. function lastIndexOf(array, value, fromIndex) {
  8302. var length = array == null ? 0 : array.length;
  8303. if (!length) {
  8304. return -1;
  8305. }
  8306. var index = length;
  8307. if (fromIndex !== undefined) {
  8308. index = toInteger(fromIndex);
  8309. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8310. }
  8311. return value === value
  8312. ? strictLastIndexOf(array, value, index)
  8313. : baseFindIndex(array, baseIsNaN, index, true);
  8314. }
  8315. /**
  8316. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8317. * element from the end is returned.
  8318. *
  8319. * @static
  8320. * @memberOf _
  8321. * @since 4.11.0
  8322. * @category Array
  8323. * @param {Array} array The array to query.
  8324. * @param {number} [n=0] The index of the element to return.
  8325. * @returns {*} Returns the nth element of `array`.
  8326. * @example
  8327. *
  8328. * var array = ['a', 'b', 'c', 'd'];
  8329. *
  8330. * _.nth(array, 1);
  8331. * // => 'b'
  8332. *
  8333. * _.nth(array, -2);
  8334. * // => 'c';
  8335. */
  8336. function nth(array, n) {
  8337. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8338. }
  8339. /**
  8340. * Removes all given values from `array` using
  8341. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8342. * for equality comparisons.
  8343. *
  8344. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8345. * to remove elements from an array by predicate.
  8346. *
  8347. * @static
  8348. * @memberOf _
  8349. * @since 2.0.0
  8350. * @category Array
  8351. * @param {Array} array The array to modify.
  8352. * @param {...*} [values] The values to remove.
  8353. * @returns {Array} Returns `array`.
  8354. * @example
  8355. *
  8356. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8357. *
  8358. * _.pull(array, 'a', 'c');
  8359. * console.log(array);
  8360. * // => ['b', 'b']
  8361. */
  8362. var pull = baseRest(pullAll);
  8363. /**
  8364. * This method is like `_.pull` except that it accepts an array of values to remove.
  8365. *
  8366. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8367. *
  8368. * @static
  8369. * @memberOf _
  8370. * @since 4.0.0
  8371. * @category Array
  8372. * @param {Array} array The array to modify.
  8373. * @param {Array} values The values to remove.
  8374. * @returns {Array} Returns `array`.
  8375. * @example
  8376. *
  8377. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8378. *
  8379. * _.pullAll(array, ['a', 'c']);
  8380. * console.log(array);
  8381. * // => ['b', 'b']
  8382. */
  8383. function pullAll(array, values) {
  8384. return (array && array.length && values && values.length)
  8385. ? basePullAll(array, values)
  8386. : array;
  8387. }
  8388. /**
  8389. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8390. * invoked for each element of `array` and `values` to generate the criterion
  8391. * by which they're compared. The iteratee is invoked with one argument: (value).
  8392. *
  8393. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8394. *
  8395. * @static
  8396. * @memberOf _
  8397. * @since 4.0.0
  8398. * @category Array
  8399. * @param {Array} array The array to modify.
  8400. * @param {Array} values The values to remove.
  8401. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8402. * @returns {Array} Returns `array`.
  8403. * @example
  8404. *
  8405. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8406. *
  8407. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8408. * console.log(array);
  8409. * // => [{ 'x': 2 }]
  8410. */
  8411. function pullAllBy(array, values, iteratee) {
  8412. return (array && array.length && values && values.length)
  8413. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8414. : array;
  8415. }
  8416. /**
  8417. * This method is like `_.pullAll` except that it accepts `comparator` which
  8418. * is invoked to compare elements of `array` to `values`. The comparator is
  8419. * invoked with two arguments: (arrVal, othVal).
  8420. *
  8421. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8422. *
  8423. * @static
  8424. * @memberOf _
  8425. * @since 4.6.0
  8426. * @category Array
  8427. * @param {Array} array The array to modify.
  8428. * @param {Array} values The values to remove.
  8429. * @param {Function} [comparator] The comparator invoked per element.
  8430. * @returns {Array} Returns `array`.
  8431. * @example
  8432. *
  8433. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8434. *
  8435. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8436. * console.log(array);
  8437. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8438. */
  8439. function pullAllWith(array, values, comparator) {
  8440. return (array && array.length && values && values.length)
  8441. ? basePullAll(array, values, undefined, comparator)
  8442. : array;
  8443. }
  8444. /**
  8445. * Removes elements from `array` corresponding to `indexes` and returns an
  8446. * array of removed elements.
  8447. *
  8448. * **Note:** Unlike `_.at`, this method mutates `array`.
  8449. *
  8450. * @static
  8451. * @memberOf _
  8452. * @since 3.0.0
  8453. * @category Array
  8454. * @param {Array} array The array to modify.
  8455. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8456. * @returns {Array} Returns the new array of removed elements.
  8457. * @example
  8458. *
  8459. * var array = ['a', 'b', 'c', 'd'];
  8460. * var pulled = _.pullAt(array, [1, 3]);
  8461. *
  8462. * console.log(array);
  8463. * // => ['a', 'c']
  8464. *
  8465. * console.log(pulled);
  8466. * // => ['b', 'd']
  8467. */
  8468. var pullAt = flatRest(function(array, indexes) {
  8469. var length = array == null ? 0 : array.length,
  8470. result = baseAt(array, indexes);
  8471. basePullAt(array, arrayMap(indexes, function(index) {
  8472. return isIndex(index, length) ? +index : index;
  8473. }).sort(compareAscending));
  8474. return result;
  8475. });
  8476. /**
  8477. * Removes all elements from `array` that `predicate` returns truthy for
  8478. * and returns an array of the removed elements. The predicate is invoked
  8479. * with three arguments: (value, index, array).
  8480. *
  8481. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8482. * to pull elements from an array by value.
  8483. *
  8484. * @static
  8485. * @memberOf _
  8486. * @since 2.0.0
  8487. * @category Array
  8488. * @param {Array} array The array to modify.
  8489. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8490. * @returns {Array} Returns the new array of removed elements.
  8491. * @example
  8492. *
  8493. * var array = [1, 2, 3, 4];
  8494. * var evens = _.remove(array, function(n) {
  8495. * return n % 2 == 0;
  8496. * });
  8497. *
  8498. * console.log(array);
  8499. * // => [1, 3]
  8500. *
  8501. * console.log(evens);
  8502. * // => [2, 4]
  8503. */
  8504. function remove(array, predicate) {
  8505. var result = [];
  8506. if (!(array && array.length)) {
  8507. return result;
  8508. }
  8509. var index = -1,
  8510. indexes = [],
  8511. length = array.length;
  8512. predicate = getIteratee(predicate, 3);
  8513. while (++index < length) {
  8514. var value = array[index];
  8515. if (predicate(value, index, array)) {
  8516. result.push(value);
  8517. indexes.push(index);
  8518. }
  8519. }
  8520. basePullAt(array, indexes);
  8521. return result;
  8522. }
  8523. /**
  8524. * Reverses `array` so that the first element becomes the last, the second
  8525. * element becomes the second to last, and so on.
  8526. *
  8527. * **Note:** This method mutates `array` and is based on
  8528. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8529. *
  8530. * @static
  8531. * @memberOf _
  8532. * @since 4.0.0
  8533. * @category Array
  8534. * @param {Array} array The array to modify.
  8535. * @returns {Array} Returns `array`.
  8536. * @example
  8537. *
  8538. * var array = [1, 2, 3];
  8539. *
  8540. * _.reverse(array);
  8541. * // => [3, 2, 1]
  8542. *
  8543. * console.log(array);
  8544. * // => [3, 2, 1]
  8545. */
  8546. function reverse(array) {
  8547. return array == null ? array : nativeReverse.call(array);
  8548. }
  8549. /**
  8550. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8551. *
  8552. * **Note:** This method is used instead of
  8553. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8554. * returned.
  8555. *
  8556. * @static
  8557. * @memberOf _
  8558. * @since 3.0.0
  8559. * @category Array
  8560. * @param {Array} array The array to slice.
  8561. * @param {number} [start=0] The start position.
  8562. * @param {number} [end=array.length] The end position.
  8563. * @returns {Array} Returns the slice of `array`.
  8564. */
  8565. function slice(array, start, end) {
  8566. var length = array == null ? 0 : array.length;
  8567. if (!length) {
  8568. return [];
  8569. }
  8570. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8571. start = 0;
  8572. end = length;
  8573. }
  8574. else {
  8575. start = start == null ? 0 : toInteger(start);
  8576. end = end === undefined ? length : toInteger(end);
  8577. }
  8578. return baseSlice(array, start, end);
  8579. }
  8580. /**
  8581. * Uses a binary search to determine the lowest index at which `value`
  8582. * should be inserted into `array` in order to maintain its sort order.
  8583. *
  8584. * @static
  8585. * @memberOf _
  8586. * @since 0.1.0
  8587. * @category Array
  8588. * @param {Array} array The sorted array to inspect.
  8589. * @param {*} value The value to evaluate.
  8590. * @returns {number} Returns the index at which `value` should be inserted
  8591. * into `array`.
  8592. * @example
  8593. *
  8594. * _.sortedIndex([30, 50], 40);
  8595. * // => 1
  8596. */
  8597. function sortedIndex(array, value) {
  8598. return baseSortedIndex(array, value);
  8599. }
  8600. /**
  8601. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8602. * which is invoked for `value` and each element of `array` to compute their
  8603. * sort ranking. The iteratee is invoked with one argument: (value).
  8604. *
  8605. * @static
  8606. * @memberOf _
  8607. * @since 4.0.0
  8608. * @category Array
  8609. * @param {Array} array The sorted array to inspect.
  8610. * @param {*} value The value to evaluate.
  8611. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8612. * @returns {number} Returns the index at which `value` should be inserted
  8613. * into `array`.
  8614. * @example
  8615. *
  8616. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8617. *
  8618. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8619. * // => 0
  8620. *
  8621. * // The `_.property` iteratee shorthand.
  8622. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8623. * // => 0
  8624. */
  8625. function sortedIndexBy(array, value, iteratee) {
  8626. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8627. }
  8628. /**
  8629. * This method is like `_.indexOf` except that it performs a binary
  8630. * search on a sorted `array`.
  8631. *
  8632. * @static
  8633. * @memberOf _
  8634. * @since 4.0.0
  8635. * @category Array
  8636. * @param {Array} array The array to inspect.
  8637. * @param {*} value The value to search for.
  8638. * @returns {number} Returns the index of the matched value, else `-1`.
  8639. * @example
  8640. *
  8641. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8642. * // => 1
  8643. */
  8644. function sortedIndexOf(array, value) {
  8645. var length = array == null ? 0 : array.length;
  8646. if (length) {
  8647. var index = baseSortedIndex(array, value);
  8648. if (index < length && eq(array[index], value)) {
  8649. return index;
  8650. }
  8651. }
  8652. return -1;
  8653. }
  8654. /**
  8655. * This method is like `_.sortedIndex` except that it returns the highest
  8656. * index at which `value` should be inserted into `array` in order to
  8657. * maintain its sort order.
  8658. *
  8659. * @static
  8660. * @memberOf _
  8661. * @since 3.0.0
  8662. * @category Array
  8663. * @param {Array} array The sorted array to inspect.
  8664. * @param {*} value The value to evaluate.
  8665. * @returns {number} Returns the index at which `value` should be inserted
  8666. * into `array`.
  8667. * @example
  8668. *
  8669. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8670. * // => 4
  8671. */
  8672. function sortedLastIndex(array, value) {
  8673. return baseSortedIndex(array, value, true);
  8674. }
  8675. /**
  8676. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8677. * which is invoked for `value` and each element of `array` to compute their
  8678. * sort ranking. The iteratee is invoked with one argument: (value).
  8679. *
  8680. * @static
  8681. * @memberOf _
  8682. * @since 4.0.0
  8683. * @category Array
  8684. * @param {Array} array The sorted array to inspect.
  8685. * @param {*} value The value to evaluate.
  8686. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8687. * @returns {number} Returns the index at which `value` should be inserted
  8688. * into `array`.
  8689. * @example
  8690. *
  8691. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8692. *
  8693. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8694. * // => 1
  8695. *
  8696. * // The `_.property` iteratee shorthand.
  8697. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8698. * // => 1
  8699. */
  8700. function sortedLastIndexBy(array, value, iteratee) {
  8701. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8702. }
  8703. /**
  8704. * This method is like `_.lastIndexOf` except that it performs a binary
  8705. * search on a sorted `array`.
  8706. *
  8707. * @static
  8708. * @memberOf _
  8709. * @since 4.0.0
  8710. * @category Array
  8711. * @param {Array} array The array to inspect.
  8712. * @param {*} value The value to search for.
  8713. * @returns {number} Returns the index of the matched value, else `-1`.
  8714. * @example
  8715. *
  8716. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8717. * // => 3
  8718. */
  8719. function sortedLastIndexOf(array, value) {
  8720. var length = array == null ? 0 : array.length;
  8721. if (length) {
  8722. var index = baseSortedIndex(array, value, true) - 1;
  8723. if (eq(array[index], value)) {
  8724. return index;
  8725. }
  8726. }
  8727. return -1;
  8728. }
  8729. /**
  8730. * This method is like `_.uniq` except that it's designed and optimized
  8731. * for sorted arrays.
  8732. *
  8733. * @static
  8734. * @memberOf _
  8735. * @since 4.0.0
  8736. * @category Array
  8737. * @param {Array} array The array to inspect.
  8738. * @returns {Array} Returns the new duplicate free array.
  8739. * @example
  8740. *
  8741. * _.sortedUniq([1, 1, 2]);
  8742. * // => [1, 2]
  8743. */
  8744. function sortedUniq(array) {
  8745. return (array && array.length)
  8746. ? baseSortedUniq(array)
  8747. : [];
  8748. }
  8749. /**
  8750. * This method is like `_.uniqBy` except that it's designed and optimized
  8751. * for sorted arrays.
  8752. *
  8753. * @static
  8754. * @memberOf _
  8755. * @since 4.0.0
  8756. * @category Array
  8757. * @param {Array} array The array to inspect.
  8758. * @param {Function} [iteratee] The iteratee invoked per element.
  8759. * @returns {Array} Returns the new duplicate free array.
  8760. * @example
  8761. *
  8762. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8763. * // => [1.1, 2.3]
  8764. */
  8765. function sortedUniqBy(array, iteratee) {
  8766. return (array && array.length)
  8767. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8768. : [];
  8769. }
  8770. /**
  8771. * Gets all but the first element of `array`.
  8772. *
  8773. * @static
  8774. * @memberOf _
  8775. * @since 4.0.0
  8776. * @category Array
  8777. * @param {Array} array The array to query.
  8778. * @returns {Array} Returns the slice of `array`.
  8779. * @example
  8780. *
  8781. * _.tail([1, 2, 3]);
  8782. * // => [2, 3]
  8783. */
  8784. function tail(array) {
  8785. var length = array == null ? 0 : array.length;
  8786. return length ? baseSlice(array, 1, length) : [];
  8787. }
  8788. /**
  8789. * Creates a slice of `array` with `n` elements taken from the beginning.
  8790. *
  8791. * @static
  8792. * @memberOf _
  8793. * @since 0.1.0
  8794. * @category Array
  8795. * @param {Array} array The array to query.
  8796. * @param {number} [n=1] The number of elements to take.
  8797. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8798. * @returns {Array} Returns the slice of `array`.
  8799. * @example
  8800. *
  8801. * _.take([1, 2, 3]);
  8802. * // => [1]
  8803. *
  8804. * _.take([1, 2, 3], 2);
  8805. * // => [1, 2]
  8806. *
  8807. * _.take([1, 2, 3], 5);
  8808. * // => [1, 2, 3]
  8809. *
  8810. * _.take([1, 2, 3], 0);
  8811. * // => []
  8812. */
  8813. function take(array, n, guard) {
  8814. if (!(array && array.length)) {
  8815. return [];
  8816. }
  8817. n = (guard || n === undefined) ? 1 : toInteger(n);
  8818. return baseSlice(array, 0, n < 0 ? 0 : n);
  8819. }
  8820. /**
  8821. * Creates a slice of `array` with `n` elements taken from the end.
  8822. *
  8823. * @static
  8824. * @memberOf _
  8825. * @since 3.0.0
  8826. * @category Array
  8827. * @param {Array} array The array to query.
  8828. * @param {number} [n=1] The number of elements to take.
  8829. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8830. * @returns {Array} Returns the slice of `array`.
  8831. * @example
  8832. *
  8833. * _.takeRight([1, 2, 3]);
  8834. * // => [3]
  8835. *
  8836. * _.takeRight([1, 2, 3], 2);
  8837. * // => [2, 3]
  8838. *
  8839. * _.takeRight([1, 2, 3], 5);
  8840. * // => [1, 2, 3]
  8841. *
  8842. * _.takeRight([1, 2, 3], 0);
  8843. * // => []
  8844. */
  8845. function takeRight(array, n, guard) {
  8846. var length = array == null ? 0 : array.length;
  8847. if (!length) {
  8848. return [];
  8849. }
  8850. n = (guard || n === undefined) ? 1 : toInteger(n);
  8851. n = length - n;
  8852. return baseSlice(array, n < 0 ? 0 : n, length);
  8853. }
  8854. /**
  8855. * Creates a slice of `array` with elements taken from the end. Elements are
  8856. * taken until `predicate` returns falsey. The predicate is invoked with
  8857. * three arguments: (value, index, array).
  8858. *
  8859. * @static
  8860. * @memberOf _
  8861. * @since 3.0.0
  8862. * @category Array
  8863. * @param {Array} array The array to query.
  8864. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8865. * @returns {Array} Returns the slice of `array`.
  8866. * @example
  8867. *
  8868. * var users = [
  8869. * { 'user': 'barney', 'active': true },
  8870. * { 'user': 'fred', 'active': false },
  8871. * { 'user': 'pebbles', 'active': false }
  8872. * ];
  8873. *
  8874. * _.takeRightWhile(users, function(o) { return !o.active; });
  8875. * // => objects for ['fred', 'pebbles']
  8876. *
  8877. * // The `_.matches` iteratee shorthand.
  8878. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8879. * // => objects for ['pebbles']
  8880. *
  8881. * // The `_.matchesProperty` iteratee shorthand.
  8882. * _.takeRightWhile(users, ['active', false]);
  8883. * // => objects for ['fred', 'pebbles']
  8884. *
  8885. * // The `_.property` iteratee shorthand.
  8886. * _.takeRightWhile(users, 'active');
  8887. * // => []
  8888. */
  8889. function takeRightWhile(array, predicate) {
  8890. return (array && array.length)
  8891. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8892. : [];
  8893. }
  8894. /**
  8895. * Creates a slice of `array` with elements taken from the beginning. Elements
  8896. * are taken until `predicate` returns falsey. The predicate is invoked with
  8897. * three arguments: (value, index, array).
  8898. *
  8899. * @static
  8900. * @memberOf _
  8901. * @since 3.0.0
  8902. * @category Array
  8903. * @param {Array} array The array to query.
  8904. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8905. * @returns {Array} Returns the slice of `array`.
  8906. * @example
  8907. *
  8908. * var users = [
  8909. * { 'user': 'barney', 'active': false },
  8910. * { 'user': 'fred', 'active': false },
  8911. * { 'user': 'pebbles', 'active': true }
  8912. * ];
  8913. *
  8914. * _.takeWhile(users, function(o) { return !o.active; });
  8915. * // => objects for ['barney', 'fred']
  8916. *
  8917. * // The `_.matches` iteratee shorthand.
  8918. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8919. * // => objects for ['barney']
  8920. *
  8921. * // The `_.matchesProperty` iteratee shorthand.
  8922. * _.takeWhile(users, ['active', false]);
  8923. * // => objects for ['barney', 'fred']
  8924. *
  8925. * // The `_.property` iteratee shorthand.
  8926. * _.takeWhile(users, 'active');
  8927. * // => []
  8928. */
  8929. function takeWhile(array, predicate) {
  8930. return (array && array.length)
  8931. ? baseWhile(array, getIteratee(predicate, 3))
  8932. : [];
  8933. }
  8934. /**
  8935. * Creates an array of unique values, in order, from all given arrays using
  8936. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8937. * for equality comparisons.
  8938. *
  8939. * @static
  8940. * @memberOf _
  8941. * @since 0.1.0
  8942. * @category Array
  8943. * @param {...Array} [arrays] The arrays to inspect.
  8944. * @returns {Array} Returns the new array of combined values.
  8945. * @example
  8946. *
  8947. * _.union([2], [1, 2]);
  8948. * // => [2, 1]
  8949. */
  8950. var union = baseRest(function(arrays) {
  8951. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8952. });
  8953. /**
  8954. * This method is like `_.union` except that it accepts `iteratee` which is
  8955. * invoked for each element of each `arrays` to generate the criterion by
  8956. * which uniqueness is computed. Result values are chosen from the first
  8957. * array in which the value occurs. The iteratee is invoked with one argument:
  8958. * (value).
  8959. *
  8960. * @static
  8961. * @memberOf _
  8962. * @since 4.0.0
  8963. * @category Array
  8964. * @param {...Array} [arrays] The arrays to inspect.
  8965. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8966. * @returns {Array} Returns the new array of combined values.
  8967. * @example
  8968. *
  8969. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8970. * // => [2.1, 1.2]
  8971. *
  8972. * // The `_.property` iteratee shorthand.
  8973. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8974. * // => [{ 'x': 1 }, { 'x': 2 }]
  8975. */
  8976. var unionBy = baseRest(function(arrays) {
  8977. var iteratee = last(arrays);
  8978. if (isArrayLikeObject(iteratee)) {
  8979. iteratee = undefined;
  8980. }
  8981. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8982. });
  8983. /**
  8984. * This method is like `_.union` except that it accepts `comparator` which
  8985. * is invoked to compare elements of `arrays`. Result values are chosen from
  8986. * the first array in which the value occurs. The comparator is invoked
  8987. * with two arguments: (arrVal, othVal).
  8988. *
  8989. * @static
  8990. * @memberOf _
  8991. * @since 4.0.0
  8992. * @category Array
  8993. * @param {...Array} [arrays] The arrays to inspect.
  8994. * @param {Function} [comparator] The comparator invoked per element.
  8995. * @returns {Array} Returns the new array of combined values.
  8996. * @example
  8997. *
  8998. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8999. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9000. *
  9001. * _.unionWith(objects, others, _.isEqual);
  9002. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9003. */
  9004. var unionWith = baseRest(function(arrays) {
  9005. var comparator = last(arrays);
  9006. comparator = typeof comparator == 'function' ? comparator : undefined;
  9007. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9008. });
  9009. /**
  9010. * Creates a duplicate-free version of an array, using
  9011. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9012. * for equality comparisons, in which only the first occurrence of each element
  9013. * is kept. The order of result values is determined by the order they occur
  9014. * in the array.
  9015. *
  9016. * @static
  9017. * @memberOf _
  9018. * @since 0.1.0
  9019. * @category Array
  9020. * @param {Array} array The array to inspect.
  9021. * @returns {Array} Returns the new duplicate free array.
  9022. * @example
  9023. *
  9024. * _.uniq([2, 1, 2]);
  9025. * // => [2, 1]
  9026. */
  9027. function uniq(array) {
  9028. return (array && array.length) ? baseUniq(array) : [];
  9029. }
  9030. /**
  9031. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9032. * invoked for each element in `array` to generate the criterion by which
  9033. * uniqueness is computed. The order of result values is determined by the
  9034. * order they occur in the array. The iteratee is invoked with one argument:
  9035. * (value).
  9036. *
  9037. * @static
  9038. * @memberOf _
  9039. * @since 4.0.0
  9040. * @category Array
  9041. * @param {Array} array The array to inspect.
  9042. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9043. * @returns {Array} Returns the new duplicate free array.
  9044. * @example
  9045. *
  9046. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9047. * // => [2.1, 1.2]
  9048. *
  9049. * // The `_.property` iteratee shorthand.
  9050. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9051. * // => [{ 'x': 1 }, { 'x': 2 }]
  9052. */
  9053. function uniqBy(array, iteratee) {
  9054. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9055. }
  9056. /**
  9057. * This method is like `_.uniq` except that it accepts `comparator` which
  9058. * is invoked to compare elements of `array`. The order of result values is
  9059. * determined by the order they occur in the array.The comparator is invoked
  9060. * with two arguments: (arrVal, othVal).
  9061. *
  9062. * @static
  9063. * @memberOf _
  9064. * @since 4.0.0
  9065. * @category Array
  9066. * @param {Array} array The array to inspect.
  9067. * @param {Function} [comparator] The comparator invoked per element.
  9068. * @returns {Array} Returns the new duplicate free array.
  9069. * @example
  9070. *
  9071. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9072. *
  9073. * _.uniqWith(objects, _.isEqual);
  9074. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9075. */
  9076. function uniqWith(array, comparator) {
  9077. comparator = typeof comparator == 'function' ? comparator : undefined;
  9078. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9079. }
  9080. /**
  9081. * This method is like `_.zip` except that it accepts an array of grouped
  9082. * elements and creates an array regrouping the elements to their pre-zip
  9083. * configuration.
  9084. *
  9085. * @static
  9086. * @memberOf _
  9087. * @since 1.2.0
  9088. * @category Array
  9089. * @param {Array} array The array of grouped elements to process.
  9090. * @returns {Array} Returns the new array of regrouped elements.
  9091. * @example
  9092. *
  9093. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9094. * // => [['a', 1, true], ['b', 2, false]]
  9095. *
  9096. * _.unzip(zipped);
  9097. * // => [['a', 'b'], [1, 2], [true, false]]
  9098. */
  9099. function unzip(array) {
  9100. if (!(array && array.length)) {
  9101. return [];
  9102. }
  9103. var length = 0;
  9104. array = arrayFilter(array, function(group) {
  9105. if (isArrayLikeObject(group)) {
  9106. length = nativeMax(group.length, length);
  9107. return true;
  9108. }
  9109. });
  9110. return baseTimes(length, function(index) {
  9111. return arrayMap(array, baseProperty(index));
  9112. });
  9113. }
  9114. /**
  9115. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9116. * how regrouped values should be combined. The iteratee is invoked with the
  9117. * elements of each group: (...group).
  9118. *
  9119. * @static
  9120. * @memberOf _
  9121. * @since 3.8.0
  9122. * @category Array
  9123. * @param {Array} array The array of grouped elements to process.
  9124. * @param {Function} [iteratee=_.identity] The function to combine
  9125. * regrouped values.
  9126. * @returns {Array} Returns the new array of regrouped elements.
  9127. * @example
  9128. *
  9129. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9130. * // => [[1, 10, 100], [2, 20, 200]]
  9131. *
  9132. * _.unzipWith(zipped, _.add);
  9133. * // => [3, 30, 300]
  9134. */
  9135. function unzipWith(array, iteratee) {
  9136. if (!(array && array.length)) {
  9137. return [];
  9138. }
  9139. var result = unzip(array);
  9140. if (iteratee == null) {
  9141. return result;
  9142. }
  9143. return arrayMap(result, function(group) {
  9144. return apply(iteratee, undefined, group);
  9145. });
  9146. }
  9147. /**
  9148. * Creates an array excluding all given values using
  9149. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9150. * for equality comparisons.
  9151. *
  9152. * **Note:** Unlike `_.pull`, this method returns a new array.
  9153. *
  9154. * @static
  9155. * @memberOf _
  9156. * @since 0.1.0
  9157. * @category Array
  9158. * @param {Array} array The array to inspect.
  9159. * @param {...*} [values] The values to exclude.
  9160. * @returns {Array} Returns the new array of filtered values.
  9161. * @see _.difference, _.xor
  9162. * @example
  9163. *
  9164. * _.without([2, 1, 2, 3], 1, 2);
  9165. * // => [3]
  9166. */
  9167. var without = baseRest(function(array, values) {
  9168. return isArrayLikeObject(array)
  9169. ? baseDifference(array, values)
  9170. : [];
  9171. });
  9172. /**
  9173. * Creates an array of unique values that is the
  9174. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9175. * of the given arrays. The order of result values is determined by the order
  9176. * they occur in the arrays.
  9177. *
  9178. * @static
  9179. * @memberOf _
  9180. * @since 2.4.0
  9181. * @category Array
  9182. * @param {...Array} [arrays] The arrays to inspect.
  9183. * @returns {Array} Returns the new array of filtered values.
  9184. * @see _.difference, _.without
  9185. * @example
  9186. *
  9187. * _.xor([2, 1], [2, 3]);
  9188. * // => [1, 3]
  9189. */
  9190. var xor = baseRest(function(arrays) {
  9191. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9192. });
  9193. /**
  9194. * This method is like `_.xor` except that it accepts `iteratee` which is
  9195. * invoked for each element of each `arrays` to generate the criterion by
  9196. * which by which they're compared. The order of result values is determined
  9197. * by the order they occur in the arrays. The iteratee is invoked with one
  9198. * argument: (value).
  9199. *
  9200. * @static
  9201. * @memberOf _
  9202. * @since 4.0.0
  9203. * @category Array
  9204. * @param {...Array} [arrays] The arrays to inspect.
  9205. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9206. * @returns {Array} Returns the new array of filtered values.
  9207. * @example
  9208. *
  9209. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9210. * // => [1.2, 3.4]
  9211. *
  9212. * // The `_.property` iteratee shorthand.
  9213. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9214. * // => [{ 'x': 2 }]
  9215. */
  9216. var xorBy = baseRest(function(arrays) {
  9217. var iteratee = last(arrays);
  9218. if (isArrayLikeObject(iteratee)) {
  9219. iteratee = undefined;
  9220. }
  9221. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9222. });
  9223. /**
  9224. * This method is like `_.xor` except that it accepts `comparator` which is
  9225. * invoked to compare elements of `arrays`. The order of result values is
  9226. * determined by the order they occur in the arrays. The comparator is invoked
  9227. * with two arguments: (arrVal, othVal).
  9228. *
  9229. * @static
  9230. * @memberOf _
  9231. * @since 4.0.0
  9232. * @category Array
  9233. * @param {...Array} [arrays] The arrays to inspect.
  9234. * @param {Function} [comparator] The comparator invoked per element.
  9235. * @returns {Array} Returns the new array of filtered values.
  9236. * @example
  9237. *
  9238. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9239. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9240. *
  9241. * _.xorWith(objects, others, _.isEqual);
  9242. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9243. */
  9244. var xorWith = baseRest(function(arrays) {
  9245. var comparator = last(arrays);
  9246. comparator = typeof comparator == 'function' ? comparator : undefined;
  9247. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9248. });
  9249. /**
  9250. * Creates an array of grouped elements, the first of which contains the
  9251. * first elements of the given arrays, the second of which contains the
  9252. * second elements of the given arrays, and so on.
  9253. *
  9254. * @static
  9255. * @memberOf _
  9256. * @since 0.1.0
  9257. * @category Array
  9258. * @param {...Array} [arrays] The arrays to process.
  9259. * @returns {Array} Returns the new array of grouped elements.
  9260. * @example
  9261. *
  9262. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9263. * // => [['a', 1, true], ['b', 2, false]]
  9264. */
  9265. var zip = baseRest(unzip);
  9266. /**
  9267. * This method is like `_.fromPairs` except that it accepts two arrays,
  9268. * one of property identifiers and one of corresponding values.
  9269. *
  9270. * @static
  9271. * @memberOf _
  9272. * @since 0.4.0
  9273. * @category Array
  9274. * @param {Array} [props=[]] The property identifiers.
  9275. * @param {Array} [values=[]] The property values.
  9276. * @returns {Object} Returns the new object.
  9277. * @example
  9278. *
  9279. * _.zipObject(['a', 'b'], [1, 2]);
  9280. * // => { 'a': 1, 'b': 2 }
  9281. */
  9282. function zipObject(props, values) {
  9283. return baseZipObject(props || [], values || [], assignValue);
  9284. }
  9285. /**
  9286. * This method is like `_.zipObject` except that it supports property paths.
  9287. *
  9288. * @static
  9289. * @memberOf _
  9290. * @since 4.1.0
  9291. * @category Array
  9292. * @param {Array} [props=[]] The property identifiers.
  9293. * @param {Array} [values=[]] The property values.
  9294. * @returns {Object} Returns the new object.
  9295. * @example
  9296. *
  9297. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9298. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9299. */
  9300. function zipObjectDeep(props, values) {
  9301. return baseZipObject(props || [], values || [], baseSet);
  9302. }
  9303. /**
  9304. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9305. * how grouped values should be combined. The iteratee is invoked with the
  9306. * elements of each group: (...group).
  9307. *
  9308. * @static
  9309. * @memberOf _
  9310. * @since 3.8.0
  9311. * @category Array
  9312. * @param {...Array} [arrays] The arrays to process.
  9313. * @param {Function} [iteratee=_.identity] The function to combine
  9314. * grouped values.
  9315. * @returns {Array} Returns the new array of grouped elements.
  9316. * @example
  9317. *
  9318. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9319. * return a + b + c;
  9320. * });
  9321. * // => [111, 222]
  9322. */
  9323. var zipWith = baseRest(function(arrays) {
  9324. var length = arrays.length,
  9325. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9326. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9327. return unzipWith(arrays, iteratee);
  9328. });
  9329. /*------------------------------------------------------------------------*/
  9330. /**
  9331. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9332. * chain sequences enabled. The result of such sequences must be unwrapped
  9333. * with `_#value`.
  9334. *
  9335. * @static
  9336. * @memberOf _
  9337. * @since 1.3.0
  9338. * @category Seq
  9339. * @param {*} value The value to wrap.
  9340. * @returns {Object} Returns the new `lodash` wrapper instance.
  9341. * @example
  9342. *
  9343. * var users = [
  9344. * { 'user': 'barney', 'age': 36 },
  9345. * { 'user': 'fred', 'age': 40 },
  9346. * { 'user': 'pebbles', 'age': 1 }
  9347. * ];
  9348. *
  9349. * var youngest = _
  9350. * .chain(users)
  9351. * .sortBy('age')
  9352. * .map(function(o) {
  9353. * return o.user + ' is ' + o.age;
  9354. * })
  9355. * .head()
  9356. * .value();
  9357. * // => 'pebbles is 1'
  9358. */
  9359. function chain(value) {
  9360. var result = lodash(value);
  9361. result.__chain__ = true;
  9362. return result;
  9363. }
  9364. /**
  9365. * This method invokes `interceptor` and returns `value`. The interceptor
  9366. * is invoked with one argument; (value). The purpose of this method is to
  9367. * "tap into" a method chain sequence in order to modify intermediate results.
  9368. *
  9369. * @static
  9370. * @memberOf _
  9371. * @since 0.1.0
  9372. * @category Seq
  9373. * @param {*} value The value to provide to `interceptor`.
  9374. * @param {Function} interceptor The function to invoke.
  9375. * @returns {*} Returns `value`.
  9376. * @example
  9377. *
  9378. * _([1, 2, 3])
  9379. * .tap(function(array) {
  9380. * // Mutate input array.
  9381. * array.pop();
  9382. * })
  9383. * .reverse()
  9384. * .value();
  9385. * // => [2, 1]
  9386. */
  9387. function tap(value, interceptor) {
  9388. interceptor(value);
  9389. return value;
  9390. }
  9391. /**
  9392. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9393. * The purpose of this method is to "pass thru" values replacing intermediate
  9394. * results in a method chain sequence.
  9395. *
  9396. * @static
  9397. * @memberOf _
  9398. * @since 3.0.0
  9399. * @category Seq
  9400. * @param {*} value The value to provide to `interceptor`.
  9401. * @param {Function} interceptor The function to invoke.
  9402. * @returns {*} Returns the result of `interceptor`.
  9403. * @example
  9404. *
  9405. * _(' abc ')
  9406. * .chain()
  9407. * .trim()
  9408. * .thru(function(value) {
  9409. * return [value];
  9410. * })
  9411. * .value();
  9412. * // => ['abc']
  9413. */
  9414. function thru(value, interceptor) {
  9415. return interceptor(value);
  9416. }
  9417. /**
  9418. * This method is the wrapper version of `_.at`.
  9419. *
  9420. * @name at
  9421. * @memberOf _
  9422. * @since 1.0.0
  9423. * @category Seq
  9424. * @param {...(string|string[])} [paths] The property paths to pick.
  9425. * @returns {Object} Returns the new `lodash` wrapper instance.
  9426. * @example
  9427. *
  9428. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9429. *
  9430. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9431. * // => [3, 4]
  9432. */
  9433. var wrapperAt = flatRest(function(paths) {
  9434. var length = paths.length,
  9435. start = length ? paths[0] : 0,
  9436. value = this.__wrapped__,
  9437. interceptor = function(object) { return baseAt(object, paths); };
  9438. if (length > 1 || this.__actions__.length ||
  9439. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9440. return this.thru(interceptor);
  9441. }
  9442. value = value.slice(start, +start + (length ? 1 : 0));
  9443. value.__actions__.push({
  9444. 'func': thru,
  9445. 'args': [interceptor],
  9446. 'thisArg': undefined
  9447. });
  9448. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9449. if (length && !array.length) {
  9450. array.push(undefined);
  9451. }
  9452. return array;
  9453. });
  9454. });
  9455. /**
  9456. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9457. *
  9458. * @name chain
  9459. * @memberOf _
  9460. * @since 0.1.0
  9461. * @category Seq
  9462. * @returns {Object} Returns the new `lodash` wrapper instance.
  9463. * @example
  9464. *
  9465. * var users = [
  9466. * { 'user': 'barney', 'age': 36 },
  9467. * { 'user': 'fred', 'age': 40 }
  9468. * ];
  9469. *
  9470. * // A sequence without explicit chaining.
  9471. * _(users).head();
  9472. * // => { 'user': 'barney', 'age': 36 }
  9473. *
  9474. * // A sequence with explicit chaining.
  9475. * _(users)
  9476. * .chain()
  9477. * .head()
  9478. * .pick('user')
  9479. * .value();
  9480. * // => { 'user': 'barney' }
  9481. */
  9482. function wrapperChain() {
  9483. return chain(this);
  9484. }
  9485. /**
  9486. * Executes the chain sequence and returns the wrapped result.
  9487. *
  9488. * @name commit
  9489. * @memberOf _
  9490. * @since 3.2.0
  9491. * @category Seq
  9492. * @returns {Object} Returns the new `lodash` wrapper instance.
  9493. * @example
  9494. *
  9495. * var array = [1, 2];
  9496. * var wrapped = _(array).push(3);
  9497. *
  9498. * console.log(array);
  9499. * // => [1, 2]
  9500. *
  9501. * wrapped = wrapped.commit();
  9502. * console.log(array);
  9503. * // => [1, 2, 3]
  9504. *
  9505. * wrapped.last();
  9506. * // => 3
  9507. *
  9508. * console.log(array);
  9509. * // => [1, 2, 3]
  9510. */
  9511. function wrapperCommit() {
  9512. return new LodashWrapper(this.value(), this.__chain__);
  9513. }
  9514. /**
  9515. * Gets the next value on a wrapped object following the
  9516. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9517. *
  9518. * @name next
  9519. * @memberOf _
  9520. * @since 4.0.0
  9521. * @category Seq
  9522. * @returns {Object} Returns the next iterator value.
  9523. * @example
  9524. *
  9525. * var wrapped = _([1, 2]);
  9526. *
  9527. * wrapped.next();
  9528. * // => { 'done': false, 'value': 1 }
  9529. *
  9530. * wrapped.next();
  9531. * // => { 'done': false, 'value': 2 }
  9532. *
  9533. * wrapped.next();
  9534. * // => { 'done': true, 'value': undefined }
  9535. */
  9536. function wrapperNext() {
  9537. if (this.__values__ === undefined) {
  9538. this.__values__ = toArray(this.value());
  9539. }
  9540. var done = this.__index__ >= this.__values__.length,
  9541. value = done ? undefined : this.__values__[this.__index__++];
  9542. return { 'done': done, 'value': value };
  9543. }
  9544. /**
  9545. * Enables the wrapper to be iterable.
  9546. *
  9547. * @name Symbol.iterator
  9548. * @memberOf _
  9549. * @since 4.0.0
  9550. * @category Seq
  9551. * @returns {Object} Returns the wrapper object.
  9552. * @example
  9553. *
  9554. * var wrapped = _([1, 2]);
  9555. *
  9556. * wrapped[Symbol.iterator]() === wrapped;
  9557. * // => true
  9558. *
  9559. * Array.from(wrapped);
  9560. * // => [1, 2]
  9561. */
  9562. function wrapperToIterator() {
  9563. return this;
  9564. }
  9565. /**
  9566. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9567. *
  9568. * @name plant
  9569. * @memberOf _
  9570. * @since 3.2.0
  9571. * @category Seq
  9572. * @param {*} value The value to plant.
  9573. * @returns {Object} Returns the new `lodash` wrapper instance.
  9574. * @example
  9575. *
  9576. * function square(n) {
  9577. * return n * n;
  9578. * }
  9579. *
  9580. * var wrapped = _([1, 2]).map(square);
  9581. * var other = wrapped.plant([3, 4]);
  9582. *
  9583. * other.value();
  9584. * // => [9, 16]
  9585. *
  9586. * wrapped.value();
  9587. * // => [1, 4]
  9588. */
  9589. function wrapperPlant(value) {
  9590. var result,
  9591. parent = this;
  9592. while (parent instanceof baseLodash) {
  9593. var clone = wrapperClone(parent);
  9594. clone.__index__ = 0;
  9595. clone.__values__ = undefined;
  9596. if (result) {
  9597. previous.__wrapped__ = clone;
  9598. } else {
  9599. result = clone;
  9600. }
  9601. var previous = clone;
  9602. parent = parent.__wrapped__;
  9603. }
  9604. previous.__wrapped__ = value;
  9605. return result;
  9606. }
  9607. /**
  9608. * This method is the wrapper version of `_.reverse`.
  9609. *
  9610. * **Note:** This method mutates the wrapped array.
  9611. *
  9612. * @name reverse
  9613. * @memberOf _
  9614. * @since 0.1.0
  9615. * @category Seq
  9616. * @returns {Object} Returns the new `lodash` wrapper instance.
  9617. * @example
  9618. *
  9619. * var array = [1, 2, 3];
  9620. *
  9621. * _(array).reverse().value()
  9622. * // => [3, 2, 1]
  9623. *
  9624. * console.log(array);
  9625. * // => [3, 2, 1]
  9626. */
  9627. function wrapperReverse() {
  9628. var value = this.__wrapped__;
  9629. if (value instanceof LazyWrapper) {
  9630. var wrapped = value;
  9631. if (this.__actions__.length) {
  9632. wrapped = new LazyWrapper(this);
  9633. }
  9634. wrapped = wrapped.reverse();
  9635. wrapped.__actions__.push({
  9636. 'func': thru,
  9637. 'args': [reverse],
  9638. 'thisArg': undefined
  9639. });
  9640. return new LodashWrapper(wrapped, this.__chain__);
  9641. }
  9642. return this.thru(reverse);
  9643. }
  9644. /**
  9645. * Executes the chain sequence to resolve the unwrapped value.
  9646. *
  9647. * @name value
  9648. * @memberOf _
  9649. * @since 0.1.0
  9650. * @alias toJSON, valueOf
  9651. * @category Seq
  9652. * @returns {*} Returns the resolved unwrapped value.
  9653. * @example
  9654. *
  9655. * _([1, 2, 3]).value();
  9656. * // => [1, 2, 3]
  9657. */
  9658. function wrapperValue() {
  9659. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9660. }
  9661. /*------------------------------------------------------------------------*/
  9662. /**
  9663. * Creates an object composed of keys generated from the results of running
  9664. * each element of `collection` thru `iteratee`. The corresponding value of
  9665. * each key is the number of times the key was returned by `iteratee`. The
  9666. * iteratee is invoked with one argument: (value).
  9667. *
  9668. * @static
  9669. * @memberOf _
  9670. * @since 0.5.0
  9671. * @category Collection
  9672. * @param {Array|Object} collection The collection to iterate over.
  9673. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9674. * @returns {Object} Returns the composed aggregate object.
  9675. * @example
  9676. *
  9677. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9678. * // => { '4': 1, '6': 2 }
  9679. *
  9680. * // The `_.property` iteratee shorthand.
  9681. * _.countBy(['one', 'two', 'three'], 'length');
  9682. * // => { '3': 2, '5': 1 }
  9683. */
  9684. var countBy = createAggregator(function(result, value, key) {
  9685. if (hasOwnProperty.call(result, key)) {
  9686. ++result[key];
  9687. } else {
  9688. baseAssignValue(result, key, 1);
  9689. }
  9690. });
  9691. /**
  9692. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9693. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9694. * invoked with three arguments: (value, index|key, collection).
  9695. *
  9696. * **Note:** This method returns `true` for
  9697. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9698. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9699. * elements of empty collections.
  9700. *
  9701. * @static
  9702. * @memberOf _
  9703. * @since 0.1.0
  9704. * @category Collection
  9705. * @param {Array|Object} collection The collection to iterate over.
  9706. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9707. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9708. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9709. * else `false`.
  9710. * @example
  9711. *
  9712. * _.every([true, 1, null, 'yes'], Boolean);
  9713. * // => false
  9714. *
  9715. * var users = [
  9716. * { 'user': 'barney', 'age': 36, 'active': false },
  9717. * { 'user': 'fred', 'age': 40, 'active': false }
  9718. * ];
  9719. *
  9720. * // The `_.matches` iteratee shorthand.
  9721. * _.every(users, { 'user': 'barney', 'active': false });
  9722. * // => false
  9723. *
  9724. * // The `_.matchesProperty` iteratee shorthand.
  9725. * _.every(users, ['active', false]);
  9726. * // => true
  9727. *
  9728. * // The `_.property` iteratee shorthand.
  9729. * _.every(users, 'active');
  9730. * // => false
  9731. */
  9732. function every(collection, predicate, guard) {
  9733. var func = isArray(collection) ? arrayEvery : baseEvery;
  9734. if (guard && isIterateeCall(collection, predicate, guard)) {
  9735. predicate = undefined;
  9736. }
  9737. return func(collection, getIteratee(predicate, 3));
  9738. }
  9739. /**
  9740. * Iterates over elements of `collection`, returning an array of all elements
  9741. * `predicate` returns truthy for. The predicate is invoked with three
  9742. * arguments: (value, index|key, collection).
  9743. *
  9744. * **Note:** Unlike `_.remove`, this method returns a new array.
  9745. *
  9746. * @static
  9747. * @memberOf _
  9748. * @since 0.1.0
  9749. * @category Collection
  9750. * @param {Array|Object} collection The collection to iterate over.
  9751. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9752. * @returns {Array} Returns the new filtered array.
  9753. * @see _.reject
  9754. * @example
  9755. *
  9756. * var users = [
  9757. * { 'user': 'barney', 'age': 36, 'active': true },
  9758. * { 'user': 'fred', 'age': 40, 'active': false }
  9759. * ];
  9760. *
  9761. * _.filter(users, function(o) { return !o.active; });
  9762. * // => objects for ['fred']
  9763. *
  9764. * // The `_.matches` iteratee shorthand.
  9765. * _.filter(users, { 'age': 36, 'active': true });
  9766. * // => objects for ['barney']
  9767. *
  9768. * // The `_.matchesProperty` iteratee shorthand.
  9769. * _.filter(users, ['active', false]);
  9770. * // => objects for ['fred']
  9771. *
  9772. * // The `_.property` iteratee shorthand.
  9773. * _.filter(users, 'active');
  9774. * // => objects for ['barney']
  9775. *
  9776. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9777. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9778. * // => objects for ['fred', 'barney']
  9779. */
  9780. function filter(collection, predicate) {
  9781. var func = isArray(collection) ? arrayFilter : baseFilter;
  9782. return func(collection, getIteratee(predicate, 3));
  9783. }
  9784. /**
  9785. * Iterates over elements of `collection`, returning the first element
  9786. * `predicate` returns truthy for. The predicate is invoked with three
  9787. * arguments: (value, index|key, collection).
  9788. *
  9789. * @static
  9790. * @memberOf _
  9791. * @since 0.1.0
  9792. * @category Collection
  9793. * @param {Array|Object} collection The collection to inspect.
  9794. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9795. * @param {number} [fromIndex=0] The index to search from.
  9796. * @returns {*} Returns the matched element, else `undefined`.
  9797. * @example
  9798. *
  9799. * var users = [
  9800. * { 'user': 'barney', 'age': 36, 'active': true },
  9801. * { 'user': 'fred', 'age': 40, 'active': false },
  9802. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9803. * ];
  9804. *
  9805. * _.find(users, function(o) { return o.age < 40; });
  9806. * // => object for 'barney'
  9807. *
  9808. * // The `_.matches` iteratee shorthand.
  9809. * _.find(users, { 'age': 1, 'active': true });
  9810. * // => object for 'pebbles'
  9811. *
  9812. * // The `_.matchesProperty` iteratee shorthand.
  9813. * _.find(users, ['active', false]);
  9814. * // => object for 'fred'
  9815. *
  9816. * // The `_.property` iteratee shorthand.
  9817. * _.find(users, 'active');
  9818. * // => object for 'barney'
  9819. */
  9820. var find = createFind(findIndex);
  9821. /**
  9822. * This method is like `_.find` except that it iterates over elements of
  9823. * `collection` from right to left.
  9824. *
  9825. * @static
  9826. * @memberOf _
  9827. * @since 2.0.0
  9828. * @category Collection
  9829. * @param {Array|Object} collection The collection to inspect.
  9830. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9831. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9832. * @returns {*} Returns the matched element, else `undefined`.
  9833. * @example
  9834. *
  9835. * _.findLast([1, 2, 3, 4], function(n) {
  9836. * return n % 2 == 1;
  9837. * });
  9838. * // => 3
  9839. */
  9840. var findLast = createFind(findLastIndex);
  9841. /**
  9842. * Creates a flattened array of values by running each element in `collection`
  9843. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9844. * with three arguments: (value, index|key, collection).
  9845. *
  9846. * @static
  9847. * @memberOf _
  9848. * @since 4.0.0
  9849. * @category Collection
  9850. * @param {Array|Object} collection The collection to iterate over.
  9851. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9852. * @returns {Array} Returns the new flattened array.
  9853. * @example
  9854. *
  9855. * function duplicate(n) {
  9856. * return [n, n];
  9857. * }
  9858. *
  9859. * _.flatMap([1, 2], duplicate);
  9860. * // => [1, 1, 2, 2]
  9861. */
  9862. function flatMap(collection, iteratee) {
  9863. return baseFlatten(map(collection, iteratee), 1);
  9864. }
  9865. /**
  9866. * This method is like `_.flatMap` except that it recursively flattens the
  9867. * mapped results.
  9868. *
  9869. * @static
  9870. * @memberOf _
  9871. * @since 4.7.0
  9872. * @category Collection
  9873. * @param {Array|Object} collection The collection to iterate over.
  9874. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9875. * @returns {Array} Returns the new flattened array.
  9876. * @example
  9877. *
  9878. * function duplicate(n) {
  9879. * return [[[n, n]]];
  9880. * }
  9881. *
  9882. * _.flatMapDeep([1, 2], duplicate);
  9883. * // => [1, 1, 2, 2]
  9884. */
  9885. function flatMapDeep(collection, iteratee) {
  9886. return baseFlatten(map(collection, iteratee), INFINITY);
  9887. }
  9888. /**
  9889. * This method is like `_.flatMap` except that it recursively flattens the
  9890. * mapped results up to `depth` times.
  9891. *
  9892. * @static
  9893. * @memberOf _
  9894. * @since 4.7.0
  9895. * @category Collection
  9896. * @param {Array|Object} collection The collection to iterate over.
  9897. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9898. * @param {number} [depth=1] The maximum recursion depth.
  9899. * @returns {Array} Returns the new flattened array.
  9900. * @example
  9901. *
  9902. * function duplicate(n) {
  9903. * return [[[n, n]]];
  9904. * }
  9905. *
  9906. * _.flatMapDepth([1, 2], duplicate, 2);
  9907. * // => [[1, 1], [2, 2]]
  9908. */
  9909. function flatMapDepth(collection, iteratee, depth) {
  9910. depth = depth === undefined ? 1 : toInteger(depth);
  9911. return baseFlatten(map(collection, iteratee), depth);
  9912. }
  9913. /**
  9914. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9915. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9916. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9917. *
  9918. * **Note:** As with other "Collections" methods, objects with a "length"
  9919. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9920. * or `_.forOwn` for object iteration.
  9921. *
  9922. * @static
  9923. * @memberOf _
  9924. * @since 0.1.0
  9925. * @alias each
  9926. * @category Collection
  9927. * @param {Array|Object} collection The collection to iterate over.
  9928. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9929. * @returns {Array|Object} Returns `collection`.
  9930. * @see _.forEachRight
  9931. * @example
  9932. *
  9933. * _.forEach([1, 2], function(value) {
  9934. * console.log(value);
  9935. * });
  9936. * // => Logs `1` then `2`.
  9937. *
  9938. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9939. * console.log(key);
  9940. * });
  9941. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9942. */
  9943. function forEach(collection, iteratee) {
  9944. var func = isArray(collection) ? arrayEach : baseEach;
  9945. return func(collection, getIteratee(iteratee, 3));
  9946. }
  9947. /**
  9948. * This method is like `_.forEach` except that it iterates over elements of
  9949. * `collection` from right to left.
  9950. *
  9951. * @static
  9952. * @memberOf _
  9953. * @since 2.0.0
  9954. * @alias eachRight
  9955. * @category Collection
  9956. * @param {Array|Object} collection The collection to iterate over.
  9957. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9958. * @returns {Array|Object} Returns `collection`.
  9959. * @see _.forEach
  9960. * @example
  9961. *
  9962. * _.forEachRight([1, 2], function(value) {
  9963. * console.log(value);
  9964. * });
  9965. * // => Logs `2` then `1`.
  9966. */
  9967. function forEachRight(collection, iteratee) {
  9968. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9969. return func(collection, getIteratee(iteratee, 3));
  9970. }
  9971. /**
  9972. * Creates an object composed of keys generated from the results of running
  9973. * each element of `collection` thru `iteratee`. The order of grouped values
  9974. * is determined by the order they occur in `collection`. The corresponding
  9975. * value of each key is an array of elements responsible for generating the
  9976. * key. The iteratee is invoked with one argument: (value).
  9977. *
  9978. * @static
  9979. * @memberOf _
  9980. * @since 0.1.0
  9981. * @category Collection
  9982. * @param {Array|Object} collection The collection to iterate over.
  9983. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9984. * @returns {Object} Returns the composed aggregate object.
  9985. * @example
  9986. *
  9987. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9988. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9989. *
  9990. * // The `_.property` iteratee shorthand.
  9991. * _.groupBy(['one', 'two', 'three'], 'length');
  9992. * // => { '3': ['one', 'two'], '5': ['three'] }
  9993. */
  9994. var groupBy = createAggregator(function(result, value, key) {
  9995. if (hasOwnProperty.call(result, key)) {
  9996. result[key].push(value);
  9997. } else {
  9998. baseAssignValue(result, key, [value]);
  9999. }
  10000. });
  10001. /**
  10002. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10003. * checked for a substring of `value`, otherwise
  10004. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10005. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10006. * the offset from the end of `collection`.
  10007. *
  10008. * @static
  10009. * @memberOf _
  10010. * @since 0.1.0
  10011. * @category Collection
  10012. * @param {Array|Object|string} collection The collection to inspect.
  10013. * @param {*} value The value to search for.
  10014. * @param {number} [fromIndex=0] The index to search from.
  10015. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10016. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10017. * @example
  10018. *
  10019. * _.includes([1, 2, 3], 1);
  10020. * // => true
  10021. *
  10022. * _.includes([1, 2, 3], 1, 2);
  10023. * // => false
  10024. *
  10025. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10026. * // => true
  10027. *
  10028. * _.includes('abcd', 'bc');
  10029. * // => true
  10030. */
  10031. function includes(collection, value, fromIndex, guard) {
  10032. collection = isArrayLike(collection) ? collection : values(collection);
  10033. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10034. var length = collection.length;
  10035. if (fromIndex < 0) {
  10036. fromIndex = nativeMax(length + fromIndex, 0);
  10037. }
  10038. return isString(collection)
  10039. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10040. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10041. }
  10042. /**
  10043. * Invokes the method at `path` of each element in `collection`, returning
  10044. * an array of the results of each invoked method. Any additional arguments
  10045. * are provided to each invoked method. If `path` is a function, it's invoked
  10046. * for, and `this` bound to, each element in `collection`.
  10047. *
  10048. * @static
  10049. * @memberOf _
  10050. * @since 4.0.0
  10051. * @category Collection
  10052. * @param {Array|Object} collection The collection to iterate over.
  10053. * @param {Array|Function|string} path The path of the method to invoke or
  10054. * the function invoked per iteration.
  10055. * @param {...*} [args] The arguments to invoke each method with.
  10056. * @returns {Array} Returns the array of results.
  10057. * @example
  10058. *
  10059. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10060. * // => [[1, 5, 7], [1, 2, 3]]
  10061. *
  10062. * _.invokeMap([123, 456], String.prototype.split, '');
  10063. * // => [['1', '2', '3'], ['4', '5', '6']]
  10064. */
  10065. var invokeMap = baseRest(function(collection, path, args) {
  10066. var index = -1,
  10067. isFunc = typeof path == 'function',
  10068. result = isArrayLike(collection) ? Array(collection.length) : [];
  10069. baseEach(collection, function(value) {
  10070. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10071. });
  10072. return result;
  10073. });
  10074. /**
  10075. * Creates an object composed of keys generated from the results of running
  10076. * each element of `collection` thru `iteratee`. The corresponding value of
  10077. * each key is the last element responsible for generating the key. The
  10078. * iteratee is invoked with one argument: (value).
  10079. *
  10080. * @static
  10081. * @memberOf _
  10082. * @since 4.0.0
  10083. * @category Collection
  10084. * @param {Array|Object} collection The collection to iterate over.
  10085. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10086. * @returns {Object} Returns the composed aggregate object.
  10087. * @example
  10088. *
  10089. * var array = [
  10090. * { 'dir': 'left', 'code': 97 },
  10091. * { 'dir': 'right', 'code': 100 }
  10092. * ];
  10093. *
  10094. * _.keyBy(array, function(o) {
  10095. * return String.fromCharCode(o.code);
  10096. * });
  10097. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10098. *
  10099. * _.keyBy(array, 'dir');
  10100. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10101. */
  10102. var keyBy = createAggregator(function(result, value, key) {
  10103. baseAssignValue(result, key, value);
  10104. });
  10105. /**
  10106. * Creates an array of values by running each element in `collection` thru
  10107. * `iteratee`. The iteratee is invoked with three arguments:
  10108. * (value, index|key, collection).
  10109. *
  10110. * Many lodash methods are guarded to work as iteratees for methods like
  10111. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10112. *
  10113. * The guarded methods are:
  10114. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10115. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10116. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10117. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10118. *
  10119. * @static
  10120. * @memberOf _
  10121. * @since 0.1.0
  10122. * @category Collection
  10123. * @param {Array|Object} collection The collection to iterate over.
  10124. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10125. * @returns {Array} Returns the new mapped array.
  10126. * @example
  10127. *
  10128. * function square(n) {
  10129. * return n * n;
  10130. * }
  10131. *
  10132. * _.map([4, 8], square);
  10133. * // => [16, 64]
  10134. *
  10135. * _.map({ 'a': 4, 'b': 8 }, square);
  10136. * // => [16, 64] (iteration order is not guaranteed)
  10137. *
  10138. * var users = [
  10139. * { 'user': 'barney' },
  10140. * { 'user': 'fred' }
  10141. * ];
  10142. *
  10143. * // The `_.property` iteratee shorthand.
  10144. * _.map(users, 'user');
  10145. * // => ['barney', 'fred']
  10146. */
  10147. function map(collection, iteratee) {
  10148. var func = isArray(collection) ? arrayMap : baseMap;
  10149. return func(collection, getIteratee(iteratee, 3));
  10150. }
  10151. /**
  10152. * This method is like `_.sortBy` except that it allows specifying the sort
  10153. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10154. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10155. * descending or "asc" for ascending sort order of corresponding values.
  10156. *
  10157. * @static
  10158. * @memberOf _
  10159. * @since 4.0.0
  10160. * @category Collection
  10161. * @param {Array|Object} collection The collection to iterate over.
  10162. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10163. * The iteratees to sort by.
  10164. * @param {string[]} [orders] The sort orders of `iteratees`.
  10165. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10166. * @returns {Array} Returns the new sorted array.
  10167. * @example
  10168. *
  10169. * var users = [
  10170. * { 'user': 'fred', 'age': 48 },
  10171. * { 'user': 'barney', 'age': 34 },
  10172. * { 'user': 'fred', 'age': 40 },
  10173. * { 'user': 'barney', 'age': 36 }
  10174. * ];
  10175. *
  10176. * // Sort by `user` in ascending order and by `age` in descending order.
  10177. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10178. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10179. */
  10180. function orderBy(collection, iteratees, orders, guard) {
  10181. if (collection == null) {
  10182. return [];
  10183. }
  10184. if (!isArray(iteratees)) {
  10185. iteratees = iteratees == null ? [] : [iteratees];
  10186. }
  10187. orders = guard ? undefined : orders;
  10188. if (!isArray(orders)) {
  10189. orders = orders == null ? [] : [orders];
  10190. }
  10191. return baseOrderBy(collection, iteratees, orders);
  10192. }
  10193. /**
  10194. * Creates an array of elements split into two groups, the first of which
  10195. * contains elements `predicate` returns truthy for, the second of which
  10196. * contains elements `predicate` returns falsey for. The predicate is
  10197. * invoked with one argument: (value).
  10198. *
  10199. * @static
  10200. * @memberOf _
  10201. * @since 3.0.0
  10202. * @category Collection
  10203. * @param {Array|Object} collection The collection to iterate over.
  10204. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10205. * @returns {Array} Returns the array of grouped elements.
  10206. * @example
  10207. *
  10208. * var users = [
  10209. * { 'user': 'barney', 'age': 36, 'active': false },
  10210. * { 'user': 'fred', 'age': 40, 'active': true },
  10211. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10212. * ];
  10213. *
  10214. * _.partition(users, function(o) { return o.active; });
  10215. * // => objects for [['fred'], ['barney', 'pebbles']]
  10216. *
  10217. * // The `_.matches` iteratee shorthand.
  10218. * _.partition(users, { 'age': 1, 'active': false });
  10219. * // => objects for [['pebbles'], ['barney', 'fred']]
  10220. *
  10221. * // The `_.matchesProperty` iteratee shorthand.
  10222. * _.partition(users, ['active', false]);
  10223. * // => objects for [['barney', 'pebbles'], ['fred']]
  10224. *
  10225. * // The `_.property` iteratee shorthand.
  10226. * _.partition(users, 'active');
  10227. * // => objects for [['fred'], ['barney', 'pebbles']]
  10228. */
  10229. var partition = createAggregator(function(result, value, key) {
  10230. result[key ? 0 : 1].push(value);
  10231. }, function() { return [[], []]; });
  10232. /**
  10233. * Reduces `collection` to a value which is the accumulated result of running
  10234. * each element in `collection` thru `iteratee`, where each successive
  10235. * invocation is supplied the return value of the previous. If `accumulator`
  10236. * is not given, the first element of `collection` is used as the initial
  10237. * value. The iteratee is invoked with four arguments:
  10238. * (accumulator, value, index|key, collection).
  10239. *
  10240. * Many lodash methods are guarded to work as iteratees for methods like
  10241. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10242. *
  10243. * The guarded methods are:
  10244. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10245. * and `sortBy`
  10246. *
  10247. * @static
  10248. * @memberOf _
  10249. * @since 0.1.0
  10250. * @category Collection
  10251. * @param {Array|Object} collection The collection to iterate over.
  10252. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10253. * @param {*} [accumulator] The initial value.
  10254. * @returns {*} Returns the accumulated value.
  10255. * @see _.reduceRight
  10256. * @example
  10257. *
  10258. * _.reduce([1, 2], function(sum, n) {
  10259. * return sum + n;
  10260. * }, 0);
  10261. * // => 3
  10262. *
  10263. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10264. * (result[value] || (result[value] = [])).push(key);
  10265. * return result;
  10266. * }, {});
  10267. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10268. */
  10269. function reduce(collection, iteratee, accumulator) {
  10270. var func = isArray(collection) ? arrayReduce : baseReduce,
  10271. initAccum = arguments.length < 3;
  10272. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10273. }
  10274. /**
  10275. * This method is like `_.reduce` except that it iterates over elements of
  10276. * `collection` from right to left.
  10277. *
  10278. * @static
  10279. * @memberOf _
  10280. * @since 0.1.0
  10281. * @category Collection
  10282. * @param {Array|Object} collection The collection to iterate over.
  10283. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10284. * @param {*} [accumulator] The initial value.
  10285. * @returns {*} Returns the accumulated value.
  10286. * @see _.reduce
  10287. * @example
  10288. *
  10289. * var array = [[0, 1], [2, 3], [4, 5]];
  10290. *
  10291. * _.reduceRight(array, function(flattened, other) {
  10292. * return flattened.concat(other);
  10293. * }, []);
  10294. * // => [4, 5, 2, 3, 0, 1]
  10295. */
  10296. function reduceRight(collection, iteratee, accumulator) {
  10297. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10298. initAccum = arguments.length < 3;
  10299. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10300. }
  10301. /**
  10302. * The opposite of `_.filter`; this method returns the elements of `collection`
  10303. * that `predicate` does **not** return truthy for.
  10304. *
  10305. * @static
  10306. * @memberOf _
  10307. * @since 0.1.0
  10308. * @category Collection
  10309. * @param {Array|Object} collection The collection to iterate over.
  10310. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10311. * @returns {Array} Returns the new filtered array.
  10312. * @see _.filter
  10313. * @example
  10314. *
  10315. * var users = [
  10316. * { 'user': 'barney', 'age': 36, 'active': false },
  10317. * { 'user': 'fred', 'age': 40, 'active': true }
  10318. * ];
  10319. *
  10320. * _.reject(users, function(o) { return !o.active; });
  10321. * // => objects for ['fred']
  10322. *
  10323. * // The `_.matches` iteratee shorthand.
  10324. * _.reject(users, { 'age': 40, 'active': true });
  10325. * // => objects for ['barney']
  10326. *
  10327. * // The `_.matchesProperty` iteratee shorthand.
  10328. * _.reject(users, ['active', false]);
  10329. * // => objects for ['fred']
  10330. *
  10331. * // The `_.property` iteratee shorthand.
  10332. * _.reject(users, 'active');
  10333. * // => objects for ['barney']
  10334. */
  10335. function reject(collection, predicate) {
  10336. var func = isArray(collection) ? arrayFilter : baseFilter;
  10337. return func(collection, negate(getIteratee(predicate, 3)));
  10338. }
  10339. /**
  10340. * Gets a random element from `collection`.
  10341. *
  10342. * @static
  10343. * @memberOf _
  10344. * @since 2.0.0
  10345. * @category Collection
  10346. * @param {Array|Object} collection The collection to sample.
  10347. * @returns {*} Returns the random element.
  10348. * @example
  10349. *
  10350. * _.sample([1, 2, 3, 4]);
  10351. * // => 2
  10352. */
  10353. function sample(collection) {
  10354. var func = isArray(collection) ? arraySample : baseSample;
  10355. return func(collection);
  10356. }
  10357. /**
  10358. * Gets `n` random elements at unique keys from `collection` up to the
  10359. * size of `collection`.
  10360. *
  10361. * @static
  10362. * @memberOf _
  10363. * @since 4.0.0
  10364. * @category Collection
  10365. * @param {Array|Object} collection The collection to sample.
  10366. * @param {number} [n=1] The number of elements to sample.
  10367. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10368. * @returns {Array} Returns the random elements.
  10369. * @example
  10370. *
  10371. * _.sampleSize([1, 2, 3], 2);
  10372. * // => [3, 1]
  10373. *
  10374. * _.sampleSize([1, 2, 3], 4);
  10375. * // => [2, 3, 1]
  10376. */
  10377. function sampleSize(collection, n, guard) {
  10378. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10379. n = 1;
  10380. } else {
  10381. n = toInteger(n);
  10382. }
  10383. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10384. return func(collection, n);
  10385. }
  10386. /**
  10387. * Creates an array of shuffled values, using a version of the
  10388. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10389. *
  10390. * @static
  10391. * @memberOf _
  10392. * @since 0.1.0
  10393. * @category Collection
  10394. * @param {Array|Object} collection The collection to shuffle.
  10395. * @returns {Array} Returns the new shuffled array.
  10396. * @example
  10397. *
  10398. * _.shuffle([1, 2, 3, 4]);
  10399. * // => [4, 1, 3, 2]
  10400. */
  10401. function shuffle(collection) {
  10402. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10403. return func(collection);
  10404. }
  10405. /**
  10406. * Gets the size of `collection` by returning its length for array-like
  10407. * values or the number of own enumerable string keyed properties for objects.
  10408. *
  10409. * @static
  10410. * @memberOf _
  10411. * @since 0.1.0
  10412. * @category Collection
  10413. * @param {Array|Object|string} collection The collection to inspect.
  10414. * @returns {number} Returns the collection size.
  10415. * @example
  10416. *
  10417. * _.size([1, 2, 3]);
  10418. * // => 3
  10419. *
  10420. * _.size({ 'a': 1, 'b': 2 });
  10421. * // => 2
  10422. *
  10423. * _.size('pebbles');
  10424. * // => 7
  10425. */
  10426. function size(collection) {
  10427. if (collection == null) {
  10428. return 0;
  10429. }
  10430. if (isArrayLike(collection)) {
  10431. return isString(collection) ? stringSize(collection) : collection.length;
  10432. }
  10433. var tag = getTag(collection);
  10434. if (tag == mapTag || tag == setTag) {
  10435. return collection.size;
  10436. }
  10437. return baseKeys(collection).length;
  10438. }
  10439. /**
  10440. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10441. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10442. * invoked with three arguments: (value, index|key, collection).
  10443. *
  10444. * @static
  10445. * @memberOf _
  10446. * @since 0.1.0
  10447. * @category Collection
  10448. * @param {Array|Object} collection The collection to iterate over.
  10449. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10450. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10451. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10452. * else `false`.
  10453. * @example
  10454. *
  10455. * _.some([null, 0, 'yes', false], Boolean);
  10456. * // => true
  10457. *
  10458. * var users = [
  10459. * { 'user': 'barney', 'active': true },
  10460. * { 'user': 'fred', 'active': false }
  10461. * ];
  10462. *
  10463. * // The `_.matches` iteratee shorthand.
  10464. * _.some(users, { 'user': 'barney', 'active': false });
  10465. * // => false
  10466. *
  10467. * // The `_.matchesProperty` iteratee shorthand.
  10468. * _.some(users, ['active', false]);
  10469. * // => true
  10470. *
  10471. * // The `_.property` iteratee shorthand.
  10472. * _.some(users, 'active');
  10473. * // => true
  10474. */
  10475. function some(collection, predicate, guard) {
  10476. var func = isArray(collection) ? arraySome : baseSome;
  10477. if (guard && isIterateeCall(collection, predicate, guard)) {
  10478. predicate = undefined;
  10479. }
  10480. return func(collection, getIteratee(predicate, 3));
  10481. }
  10482. /**
  10483. * Creates an array of elements, sorted in ascending order by the results of
  10484. * running each element in a collection thru each iteratee. This method
  10485. * performs a stable sort, that is, it preserves the original sort order of
  10486. * equal elements. The iteratees are invoked with one argument: (value).
  10487. *
  10488. * @static
  10489. * @memberOf _
  10490. * @since 0.1.0
  10491. * @category Collection
  10492. * @param {Array|Object} collection The collection to iterate over.
  10493. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10494. * The iteratees to sort by.
  10495. * @returns {Array} Returns the new sorted array.
  10496. * @example
  10497. *
  10498. * var users = [
  10499. * { 'user': 'fred', 'age': 48 },
  10500. * { 'user': 'barney', 'age': 36 },
  10501. * { 'user': 'fred', 'age': 30 },
  10502. * { 'user': 'barney', 'age': 34 }
  10503. * ];
  10504. *
  10505. * _.sortBy(users, [function(o) { return o.user; }]);
  10506. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10507. *
  10508. * _.sortBy(users, ['user', 'age']);
  10509. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10510. */
  10511. var sortBy = baseRest(function(collection, iteratees) {
  10512. if (collection == null) {
  10513. return [];
  10514. }
  10515. var length = iteratees.length;
  10516. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10517. iteratees = [];
  10518. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10519. iteratees = [iteratees[0]];
  10520. }
  10521. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10522. });
  10523. /*------------------------------------------------------------------------*/
  10524. /**
  10525. * Gets the timestamp of the number of milliseconds that have elapsed since
  10526. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10527. *
  10528. * @static
  10529. * @memberOf _
  10530. * @since 2.4.0
  10531. * @category Date
  10532. * @returns {number} Returns the timestamp.
  10533. * @example
  10534. *
  10535. * _.defer(function(stamp) {
  10536. * console.log(_.now() - stamp);
  10537. * }, _.now());
  10538. * // => Logs the number of milliseconds it took for the deferred invocation.
  10539. */
  10540. var now = ctxNow || function() {
  10541. return root.Date.now();
  10542. };
  10543. /*------------------------------------------------------------------------*/
  10544. /**
  10545. * The opposite of `_.before`; this method creates a function that invokes
  10546. * `func` once it's called `n` or more times.
  10547. *
  10548. * @static
  10549. * @memberOf _
  10550. * @since 0.1.0
  10551. * @category Function
  10552. * @param {number} n The number of calls before `func` is invoked.
  10553. * @param {Function} func The function to restrict.
  10554. * @returns {Function} Returns the new restricted function.
  10555. * @example
  10556. *
  10557. * var saves = ['profile', 'settings'];
  10558. *
  10559. * var done = _.after(saves.length, function() {
  10560. * console.log('done saving!');
  10561. * });
  10562. *
  10563. * _.forEach(saves, function(type) {
  10564. * asyncSave({ 'type': type, 'complete': done });
  10565. * });
  10566. * // => Logs 'done saving!' after the two async saves have completed.
  10567. */
  10568. function after(n, func) {
  10569. if (typeof func != 'function') {
  10570. throw new TypeError(FUNC_ERROR_TEXT);
  10571. }
  10572. n = toInteger(n);
  10573. return function() {
  10574. if (--n < 1) {
  10575. return func.apply(this, arguments);
  10576. }
  10577. };
  10578. }
  10579. /**
  10580. * Creates a function that invokes `func`, with up to `n` arguments,
  10581. * ignoring any additional arguments.
  10582. *
  10583. * @static
  10584. * @memberOf _
  10585. * @since 3.0.0
  10586. * @category Function
  10587. * @param {Function} func The function to cap arguments for.
  10588. * @param {number} [n=func.length] The arity cap.
  10589. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10590. * @returns {Function} Returns the new capped function.
  10591. * @example
  10592. *
  10593. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10594. * // => [6, 8, 10]
  10595. */
  10596. function ary(func, n, guard) {
  10597. n = guard ? undefined : n;
  10598. n = (func && n == null) ? func.length : n;
  10599. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10600. }
  10601. /**
  10602. * Creates a function that invokes `func`, with the `this` binding and arguments
  10603. * of the created function, while it's called less than `n` times. Subsequent
  10604. * calls to the created function return the result of the last `func` invocation.
  10605. *
  10606. * @static
  10607. * @memberOf _
  10608. * @since 3.0.0
  10609. * @category Function
  10610. * @param {number} n The number of calls at which `func` is no longer invoked.
  10611. * @param {Function} func The function to restrict.
  10612. * @returns {Function} Returns the new restricted function.
  10613. * @example
  10614. *
  10615. * jQuery(element).on('click', _.before(5, addContactToList));
  10616. * // => Allows adding up to 4 contacts to the list.
  10617. */
  10618. function before(n, func) {
  10619. var result;
  10620. if (typeof func != 'function') {
  10621. throw new TypeError(FUNC_ERROR_TEXT);
  10622. }
  10623. n = toInteger(n);
  10624. return function() {
  10625. if (--n > 0) {
  10626. result = func.apply(this, arguments);
  10627. }
  10628. if (n <= 1) {
  10629. func = undefined;
  10630. }
  10631. return result;
  10632. };
  10633. }
  10634. /**
  10635. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10636. * and `partials` prepended to the arguments it receives.
  10637. *
  10638. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10639. * may be used as a placeholder for partially applied arguments.
  10640. *
  10641. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10642. * property of bound functions.
  10643. *
  10644. * @static
  10645. * @memberOf _
  10646. * @since 0.1.0
  10647. * @category Function
  10648. * @param {Function} func The function to bind.
  10649. * @param {*} thisArg The `this` binding of `func`.
  10650. * @param {...*} [partials] The arguments to be partially applied.
  10651. * @returns {Function} Returns the new bound function.
  10652. * @example
  10653. *
  10654. * function greet(greeting, punctuation) {
  10655. * return greeting + ' ' + this.user + punctuation;
  10656. * }
  10657. *
  10658. * var object = { 'user': 'fred' };
  10659. *
  10660. * var bound = _.bind(greet, object, 'hi');
  10661. * bound('!');
  10662. * // => 'hi fred!'
  10663. *
  10664. * // Bound with placeholders.
  10665. * var bound = _.bind(greet, object, _, '!');
  10666. * bound('hi');
  10667. * // => 'hi fred!'
  10668. */
  10669. var bind = baseRest(function(func, thisArg, partials) {
  10670. var bitmask = WRAP_BIND_FLAG;
  10671. if (partials.length) {
  10672. var holders = replaceHolders(partials, getHolder(bind));
  10673. bitmask |= WRAP_PARTIAL_FLAG;
  10674. }
  10675. return createWrap(func, bitmask, thisArg, partials, holders);
  10676. });
  10677. /**
  10678. * Creates a function that invokes the method at `object[key]` with `partials`
  10679. * prepended to the arguments it receives.
  10680. *
  10681. * This method differs from `_.bind` by allowing bound functions to reference
  10682. * methods that may be redefined or don't yet exist. See
  10683. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10684. * for more details.
  10685. *
  10686. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10687. * builds, may be used as a placeholder for partially applied arguments.
  10688. *
  10689. * @static
  10690. * @memberOf _
  10691. * @since 0.10.0
  10692. * @category Function
  10693. * @param {Object} object The object to invoke the method on.
  10694. * @param {string} key The key of the method.
  10695. * @param {...*} [partials] The arguments to be partially applied.
  10696. * @returns {Function} Returns the new bound function.
  10697. * @example
  10698. *
  10699. * var object = {
  10700. * 'user': 'fred',
  10701. * 'greet': function(greeting, punctuation) {
  10702. * return greeting + ' ' + this.user + punctuation;
  10703. * }
  10704. * };
  10705. *
  10706. * var bound = _.bindKey(object, 'greet', 'hi');
  10707. * bound('!');
  10708. * // => 'hi fred!'
  10709. *
  10710. * object.greet = function(greeting, punctuation) {
  10711. * return greeting + 'ya ' + this.user + punctuation;
  10712. * };
  10713. *
  10714. * bound('!');
  10715. * // => 'hiya fred!'
  10716. *
  10717. * // Bound with placeholders.
  10718. * var bound = _.bindKey(object, 'greet', _, '!');
  10719. * bound('hi');
  10720. * // => 'hiya fred!'
  10721. */
  10722. var bindKey = baseRest(function(object, key, partials) {
  10723. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10724. if (partials.length) {
  10725. var holders = replaceHolders(partials, getHolder(bindKey));
  10726. bitmask |= WRAP_PARTIAL_FLAG;
  10727. }
  10728. return createWrap(key, bitmask, object, partials, holders);
  10729. });
  10730. /**
  10731. * Creates a function that accepts arguments of `func` and either invokes
  10732. * `func` returning its result, if at least `arity` number of arguments have
  10733. * been provided, or returns a function that accepts the remaining `func`
  10734. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10735. * is not sufficient.
  10736. *
  10737. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10738. * may be used as a placeholder for provided arguments.
  10739. *
  10740. * **Note:** This method doesn't set the "length" property of curried functions.
  10741. *
  10742. * @static
  10743. * @memberOf _
  10744. * @since 2.0.0
  10745. * @category Function
  10746. * @param {Function} func The function to curry.
  10747. * @param {number} [arity=func.length] The arity of `func`.
  10748. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10749. * @returns {Function} Returns the new curried function.
  10750. * @example
  10751. *
  10752. * var abc = function(a, b, c) {
  10753. * return [a, b, c];
  10754. * };
  10755. *
  10756. * var curried = _.curry(abc);
  10757. *
  10758. * curried(1)(2)(3);
  10759. * // => [1, 2, 3]
  10760. *
  10761. * curried(1, 2)(3);
  10762. * // => [1, 2, 3]
  10763. *
  10764. * curried(1, 2, 3);
  10765. * // => [1, 2, 3]
  10766. *
  10767. * // Curried with placeholders.
  10768. * curried(1)(_, 3)(2);
  10769. * // => [1, 2, 3]
  10770. */
  10771. function curry(func, arity, guard) {
  10772. arity = guard ? undefined : arity;
  10773. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10774. result.placeholder = curry.placeholder;
  10775. return result;
  10776. }
  10777. /**
  10778. * This method is like `_.curry` except that arguments are applied to `func`
  10779. * in the manner of `_.partialRight` instead of `_.partial`.
  10780. *
  10781. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10782. * builds, may be used as a placeholder for provided arguments.
  10783. *
  10784. * **Note:** This method doesn't set the "length" property of curried functions.
  10785. *
  10786. * @static
  10787. * @memberOf _
  10788. * @since 3.0.0
  10789. * @category Function
  10790. * @param {Function} func The function to curry.
  10791. * @param {number} [arity=func.length] The arity of `func`.
  10792. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10793. * @returns {Function} Returns the new curried function.
  10794. * @example
  10795. *
  10796. * var abc = function(a, b, c) {
  10797. * return [a, b, c];
  10798. * };
  10799. *
  10800. * var curried = _.curryRight(abc);
  10801. *
  10802. * curried(3)(2)(1);
  10803. * // => [1, 2, 3]
  10804. *
  10805. * curried(2, 3)(1);
  10806. * // => [1, 2, 3]
  10807. *
  10808. * curried(1, 2, 3);
  10809. * // => [1, 2, 3]
  10810. *
  10811. * // Curried with placeholders.
  10812. * curried(3)(1, _)(2);
  10813. * // => [1, 2, 3]
  10814. */
  10815. function curryRight(func, arity, guard) {
  10816. arity = guard ? undefined : arity;
  10817. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10818. result.placeholder = curryRight.placeholder;
  10819. return result;
  10820. }
  10821. /**
  10822. * Creates a debounced function that delays invoking `func` until after `wait`
  10823. * milliseconds have elapsed since the last time the debounced function was
  10824. * invoked. The debounced function comes with a `cancel` method to cancel
  10825. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10826. * Provide `options` to indicate whether `func` should be invoked on the
  10827. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10828. * with the last arguments provided to the debounced function. Subsequent
  10829. * calls to the debounced function return the result of the last `func`
  10830. * invocation.
  10831. *
  10832. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10833. * invoked on the trailing edge of the timeout only if the debounced function
  10834. * is invoked more than once during the `wait` timeout.
  10835. *
  10836. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10837. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10838. *
  10839. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10840. * for details over the differences between `_.debounce` and `_.throttle`.
  10841. *
  10842. * @static
  10843. * @memberOf _
  10844. * @since 0.1.0
  10845. * @category Function
  10846. * @param {Function} func The function to debounce.
  10847. * @param {number} [wait=0] The number of milliseconds to delay.
  10848. * @param {Object} [options={}] The options object.
  10849. * @param {boolean} [options.leading=false]
  10850. * Specify invoking on the leading edge of the timeout.
  10851. * @param {number} [options.maxWait]
  10852. * The maximum time `func` is allowed to be delayed before it's invoked.
  10853. * @param {boolean} [options.trailing=true]
  10854. * Specify invoking on the trailing edge of the timeout.
  10855. * @returns {Function} Returns the new debounced function.
  10856. * @example
  10857. *
  10858. * // Avoid costly calculations while the window size is in flux.
  10859. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10860. *
  10861. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10862. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10863. * 'leading': true,
  10864. * 'trailing': false
  10865. * }));
  10866. *
  10867. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10868. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10869. * var source = new EventSource('/stream');
  10870. * jQuery(source).on('message', debounced);
  10871. *
  10872. * // Cancel the trailing debounced invocation.
  10873. * jQuery(window).on('popstate', debounced.cancel);
  10874. */
  10875. function debounce(func, wait, options) {
  10876. var lastArgs,
  10877. lastThis,
  10878. maxWait,
  10879. result,
  10880. timerId,
  10881. lastCallTime,
  10882. lastInvokeTime = 0,
  10883. leading = false,
  10884. maxing = false,
  10885. trailing = true;
  10886. if (typeof func != 'function') {
  10887. throw new TypeError(FUNC_ERROR_TEXT);
  10888. }
  10889. wait = toNumber(wait) || 0;
  10890. if (isObject(options)) {
  10891. leading = !!options.leading;
  10892. maxing = 'maxWait' in options;
  10893. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10894. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10895. }
  10896. function invokeFunc(time) {
  10897. var args = lastArgs,
  10898. thisArg = lastThis;
  10899. lastArgs = lastThis = undefined;
  10900. lastInvokeTime = time;
  10901. result = func.apply(thisArg, args);
  10902. return result;
  10903. }
  10904. function leadingEdge(time) {
  10905. // Reset any `maxWait` timer.
  10906. lastInvokeTime = time;
  10907. // Start the timer for the trailing edge.
  10908. timerId = setTimeout(timerExpired, wait);
  10909. // Invoke the leading edge.
  10910. return leading ? invokeFunc(time) : result;
  10911. }
  10912. function remainingWait(time) {
  10913. var timeSinceLastCall = time - lastCallTime,
  10914. timeSinceLastInvoke = time - lastInvokeTime,
  10915. timeWaiting = wait - timeSinceLastCall;
  10916. return maxing
  10917. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10918. : timeWaiting;
  10919. }
  10920. function shouldInvoke(time) {
  10921. var timeSinceLastCall = time - lastCallTime,
  10922. timeSinceLastInvoke = time - lastInvokeTime;
  10923. // Either this is the first call, activity has stopped and we're at the
  10924. // trailing edge, the system time has gone backwards and we're treating
  10925. // it as the trailing edge, or we've hit the `maxWait` limit.
  10926. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10927. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10928. }
  10929. function timerExpired() {
  10930. var time = now();
  10931. if (shouldInvoke(time)) {
  10932. return trailingEdge(time);
  10933. }
  10934. // Restart the timer.
  10935. timerId = setTimeout(timerExpired, remainingWait(time));
  10936. }
  10937. function trailingEdge(time) {
  10938. timerId = undefined;
  10939. // Only invoke if we have `lastArgs` which means `func` has been
  10940. // debounced at least once.
  10941. if (trailing && lastArgs) {
  10942. return invokeFunc(time);
  10943. }
  10944. lastArgs = lastThis = undefined;
  10945. return result;
  10946. }
  10947. function cancel() {
  10948. if (timerId !== undefined) {
  10949. clearTimeout(timerId);
  10950. }
  10951. lastInvokeTime = 0;
  10952. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10953. }
  10954. function flush() {
  10955. return timerId === undefined ? result : trailingEdge(now());
  10956. }
  10957. function debounced() {
  10958. var time = now(),
  10959. isInvoking = shouldInvoke(time);
  10960. lastArgs = arguments;
  10961. lastThis = this;
  10962. lastCallTime = time;
  10963. if (isInvoking) {
  10964. if (timerId === undefined) {
  10965. return leadingEdge(lastCallTime);
  10966. }
  10967. if (maxing) {
  10968. // Handle invocations in a tight loop.
  10969. clearTimeout(timerId);
  10970. timerId = setTimeout(timerExpired, wait);
  10971. return invokeFunc(lastCallTime);
  10972. }
  10973. }
  10974. if (timerId === undefined) {
  10975. timerId = setTimeout(timerExpired, wait);
  10976. }
  10977. return result;
  10978. }
  10979. debounced.cancel = cancel;
  10980. debounced.flush = flush;
  10981. return debounced;
  10982. }
  10983. /**
  10984. * Defers invoking the `func` until the current call stack has cleared. Any
  10985. * additional arguments are provided to `func` when it's invoked.
  10986. *
  10987. * @static
  10988. * @memberOf _
  10989. * @since 0.1.0
  10990. * @category Function
  10991. * @param {Function} func The function to defer.
  10992. * @param {...*} [args] The arguments to invoke `func` with.
  10993. * @returns {number} Returns the timer id.
  10994. * @example
  10995. *
  10996. * _.defer(function(text) {
  10997. * console.log(text);
  10998. * }, 'deferred');
  10999. * // => Logs 'deferred' after one millisecond.
  11000. */
  11001. var defer = baseRest(function(func, args) {
  11002. return baseDelay(func, 1, args);
  11003. });
  11004. /**
  11005. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11006. * provided to `func` when it's invoked.
  11007. *
  11008. * @static
  11009. * @memberOf _
  11010. * @since 0.1.0
  11011. * @category Function
  11012. * @param {Function} func The function to delay.
  11013. * @param {number} wait The number of milliseconds to delay invocation.
  11014. * @param {...*} [args] The arguments to invoke `func` with.
  11015. * @returns {number} Returns the timer id.
  11016. * @example
  11017. *
  11018. * _.delay(function(text) {
  11019. * console.log(text);
  11020. * }, 1000, 'later');
  11021. * // => Logs 'later' after one second.
  11022. */
  11023. var delay = baseRest(function(func, wait, args) {
  11024. return baseDelay(func, toNumber(wait) || 0, args);
  11025. });
  11026. /**
  11027. * Creates a function that invokes `func` with arguments reversed.
  11028. *
  11029. * @static
  11030. * @memberOf _
  11031. * @since 4.0.0
  11032. * @category Function
  11033. * @param {Function} func The function to flip arguments for.
  11034. * @returns {Function} Returns the new flipped function.
  11035. * @example
  11036. *
  11037. * var flipped = _.flip(function() {
  11038. * return _.toArray(arguments);
  11039. * });
  11040. *
  11041. * flipped('a', 'b', 'c', 'd');
  11042. * // => ['d', 'c', 'b', 'a']
  11043. */
  11044. function flip(func) {
  11045. return createWrap(func, WRAP_FLIP_FLAG);
  11046. }
  11047. /**
  11048. * Creates a function that memoizes the result of `func`. If `resolver` is
  11049. * provided, it determines the cache key for storing the result based on the
  11050. * arguments provided to the memoized function. By default, the first argument
  11051. * provided to the memoized function is used as the map cache key. The `func`
  11052. * is invoked with the `this` binding of the memoized function.
  11053. *
  11054. * **Note:** The cache is exposed as the `cache` property on the memoized
  11055. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11056. * constructor with one whose instances implement the
  11057. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11058. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11059. *
  11060. * @static
  11061. * @memberOf _
  11062. * @since 0.1.0
  11063. * @category Function
  11064. * @param {Function} func The function to have its output memoized.
  11065. * @param {Function} [resolver] The function to resolve the cache key.
  11066. * @returns {Function} Returns the new memoized function.
  11067. * @example
  11068. *
  11069. * var object = { 'a': 1, 'b': 2 };
  11070. * var other = { 'c': 3, 'd': 4 };
  11071. *
  11072. * var values = _.memoize(_.values);
  11073. * values(object);
  11074. * // => [1, 2]
  11075. *
  11076. * values(other);
  11077. * // => [3, 4]
  11078. *
  11079. * object.a = 2;
  11080. * values(object);
  11081. * // => [1, 2]
  11082. *
  11083. * // Modify the result cache.
  11084. * values.cache.set(object, ['a', 'b']);
  11085. * values(object);
  11086. * // => ['a', 'b']
  11087. *
  11088. * // Replace `_.memoize.Cache`.
  11089. * _.memoize.Cache = WeakMap;
  11090. */
  11091. function memoize(func, resolver) {
  11092. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11093. throw new TypeError(FUNC_ERROR_TEXT);
  11094. }
  11095. var memoized = function() {
  11096. var args = arguments,
  11097. key = resolver ? resolver.apply(this, args) : args[0],
  11098. cache = memoized.cache;
  11099. if (cache.has(key)) {
  11100. return cache.get(key);
  11101. }
  11102. var result = func.apply(this, args);
  11103. memoized.cache = cache.set(key, result) || cache;
  11104. return result;
  11105. };
  11106. memoized.cache = new (memoize.Cache || MapCache);
  11107. return memoized;
  11108. }
  11109. // Expose `MapCache`.
  11110. memoize.Cache = MapCache;
  11111. /**
  11112. * Creates a function that negates the result of the predicate `func`. The
  11113. * `func` predicate is invoked with the `this` binding and arguments of the
  11114. * created function.
  11115. *
  11116. * @static
  11117. * @memberOf _
  11118. * @since 3.0.0
  11119. * @category Function
  11120. * @param {Function} predicate The predicate to negate.
  11121. * @returns {Function} Returns the new negated function.
  11122. * @example
  11123. *
  11124. * function isEven(n) {
  11125. * return n % 2 == 0;
  11126. * }
  11127. *
  11128. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11129. * // => [1, 3, 5]
  11130. */
  11131. function negate(predicate) {
  11132. if (typeof predicate != 'function') {
  11133. throw new TypeError(FUNC_ERROR_TEXT);
  11134. }
  11135. return function() {
  11136. var args = arguments;
  11137. switch (args.length) {
  11138. case 0: return !predicate.call(this);
  11139. case 1: return !predicate.call(this, args[0]);
  11140. case 2: return !predicate.call(this, args[0], args[1]);
  11141. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11142. }
  11143. return !predicate.apply(this, args);
  11144. };
  11145. }
  11146. /**
  11147. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11148. * to the function return the value of the first invocation. The `func` is
  11149. * invoked with the `this` binding and arguments of the created function.
  11150. *
  11151. * @static
  11152. * @memberOf _
  11153. * @since 0.1.0
  11154. * @category Function
  11155. * @param {Function} func The function to restrict.
  11156. * @returns {Function} Returns the new restricted function.
  11157. * @example
  11158. *
  11159. * var initialize = _.once(createApplication);
  11160. * initialize();
  11161. * initialize();
  11162. * // => `createApplication` is invoked once
  11163. */
  11164. function once(func) {
  11165. return before(2, func);
  11166. }
  11167. /**
  11168. * Creates a function that invokes `func` with its arguments transformed.
  11169. *
  11170. * @static
  11171. * @since 4.0.0
  11172. * @memberOf _
  11173. * @category Function
  11174. * @param {Function} func The function to wrap.
  11175. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11176. * The argument transforms.
  11177. * @returns {Function} Returns the new function.
  11178. * @example
  11179. *
  11180. * function doubled(n) {
  11181. * return n * 2;
  11182. * }
  11183. *
  11184. * function square(n) {
  11185. * return n * n;
  11186. * }
  11187. *
  11188. * var func = _.overArgs(function(x, y) {
  11189. * return [x, y];
  11190. * }, [square, doubled]);
  11191. *
  11192. * func(9, 3);
  11193. * // => [81, 6]
  11194. *
  11195. * func(10, 5);
  11196. * // => [100, 10]
  11197. */
  11198. var overArgs = castRest(function(func, transforms) {
  11199. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11200. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11201. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11202. var funcsLength = transforms.length;
  11203. return baseRest(function(args) {
  11204. var index = -1,
  11205. length = nativeMin(args.length, funcsLength);
  11206. while (++index < length) {
  11207. args[index] = transforms[index].call(this, args[index]);
  11208. }
  11209. return apply(func, this, args);
  11210. });
  11211. });
  11212. /**
  11213. * Creates a function that invokes `func` with `partials` prepended to the
  11214. * arguments it receives. This method is like `_.bind` except it does **not**
  11215. * alter the `this` binding.
  11216. *
  11217. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11218. * builds, may be used as a placeholder for partially applied arguments.
  11219. *
  11220. * **Note:** This method doesn't set the "length" property of partially
  11221. * applied functions.
  11222. *
  11223. * @static
  11224. * @memberOf _
  11225. * @since 0.2.0
  11226. * @category Function
  11227. * @param {Function} func The function to partially apply arguments to.
  11228. * @param {...*} [partials] The arguments to be partially applied.
  11229. * @returns {Function} Returns the new partially applied function.
  11230. * @example
  11231. *
  11232. * function greet(greeting, name) {
  11233. * return greeting + ' ' + name;
  11234. * }
  11235. *
  11236. * var sayHelloTo = _.partial(greet, 'hello');
  11237. * sayHelloTo('fred');
  11238. * // => 'hello fred'
  11239. *
  11240. * // Partially applied with placeholders.
  11241. * var greetFred = _.partial(greet, _, 'fred');
  11242. * greetFred('hi');
  11243. * // => 'hi fred'
  11244. */
  11245. var partial = baseRest(function(func, partials) {
  11246. var holders = replaceHolders(partials, getHolder(partial));
  11247. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11248. });
  11249. /**
  11250. * This method is like `_.partial` except that partially applied arguments
  11251. * are appended to the arguments it receives.
  11252. *
  11253. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11254. * builds, may be used as a placeholder for partially applied arguments.
  11255. *
  11256. * **Note:** This method doesn't set the "length" property of partially
  11257. * applied functions.
  11258. *
  11259. * @static
  11260. * @memberOf _
  11261. * @since 1.0.0
  11262. * @category Function
  11263. * @param {Function} func The function to partially apply arguments to.
  11264. * @param {...*} [partials] The arguments to be partially applied.
  11265. * @returns {Function} Returns the new partially applied function.
  11266. * @example
  11267. *
  11268. * function greet(greeting, name) {
  11269. * return greeting + ' ' + name;
  11270. * }
  11271. *
  11272. * var greetFred = _.partialRight(greet, 'fred');
  11273. * greetFred('hi');
  11274. * // => 'hi fred'
  11275. *
  11276. * // Partially applied with placeholders.
  11277. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11278. * sayHelloTo('fred');
  11279. * // => 'hello fred'
  11280. */
  11281. var partialRight = baseRest(function(func, partials) {
  11282. var holders = replaceHolders(partials, getHolder(partialRight));
  11283. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11284. });
  11285. /**
  11286. * Creates a function that invokes `func` with arguments arranged according
  11287. * to the specified `indexes` where the argument value at the first index is
  11288. * provided as the first argument, the argument value at the second index is
  11289. * provided as the second argument, and so on.
  11290. *
  11291. * @static
  11292. * @memberOf _
  11293. * @since 3.0.0
  11294. * @category Function
  11295. * @param {Function} func The function to rearrange arguments for.
  11296. * @param {...(number|number[])} indexes The arranged argument indexes.
  11297. * @returns {Function} Returns the new function.
  11298. * @example
  11299. *
  11300. * var rearged = _.rearg(function(a, b, c) {
  11301. * return [a, b, c];
  11302. * }, [2, 0, 1]);
  11303. *
  11304. * rearged('b', 'c', 'a')
  11305. * // => ['a', 'b', 'c']
  11306. */
  11307. var rearg = flatRest(function(func, indexes) {
  11308. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11309. });
  11310. /**
  11311. * Creates a function that invokes `func` with the `this` binding of the
  11312. * created function and arguments from `start` and beyond provided as
  11313. * an array.
  11314. *
  11315. * **Note:** This method is based on the
  11316. * [rest parameter](https://mdn.io/rest_parameters).
  11317. *
  11318. * @static
  11319. * @memberOf _
  11320. * @since 4.0.0
  11321. * @category Function
  11322. * @param {Function} func The function to apply a rest parameter to.
  11323. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11324. * @returns {Function} Returns the new function.
  11325. * @example
  11326. *
  11327. * var say = _.rest(function(what, names) {
  11328. * return what + ' ' + _.initial(names).join(', ') +
  11329. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11330. * });
  11331. *
  11332. * say('hello', 'fred', 'barney', 'pebbles');
  11333. * // => 'hello fred, barney, & pebbles'
  11334. */
  11335. function rest(func, start) {
  11336. if (typeof func != 'function') {
  11337. throw new TypeError(FUNC_ERROR_TEXT);
  11338. }
  11339. start = start === undefined ? start : toInteger(start);
  11340. return baseRest(func, start);
  11341. }
  11342. /**
  11343. * Creates a function that invokes `func` with the `this` binding of the
  11344. * create function and an array of arguments much like
  11345. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11346. *
  11347. * **Note:** This method is based on the
  11348. * [spread operator](https://mdn.io/spread_operator).
  11349. *
  11350. * @static
  11351. * @memberOf _
  11352. * @since 3.2.0
  11353. * @category Function
  11354. * @param {Function} func The function to spread arguments over.
  11355. * @param {number} [start=0] The start position of the spread.
  11356. * @returns {Function} Returns the new function.
  11357. * @example
  11358. *
  11359. * var say = _.spread(function(who, what) {
  11360. * return who + ' says ' + what;
  11361. * });
  11362. *
  11363. * say(['fred', 'hello']);
  11364. * // => 'fred says hello'
  11365. *
  11366. * var numbers = Promise.all([
  11367. * Promise.resolve(40),
  11368. * Promise.resolve(36)
  11369. * ]);
  11370. *
  11371. * numbers.then(_.spread(function(x, y) {
  11372. * return x + y;
  11373. * }));
  11374. * // => a Promise of 76
  11375. */
  11376. function spread(func, start) {
  11377. if (typeof func != 'function') {
  11378. throw new TypeError(FUNC_ERROR_TEXT);
  11379. }
  11380. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11381. return baseRest(function(args) {
  11382. var array = args[start],
  11383. otherArgs = castSlice(args, 0, start);
  11384. if (array) {
  11385. arrayPush(otherArgs, array);
  11386. }
  11387. return apply(func, this, otherArgs);
  11388. });
  11389. }
  11390. /**
  11391. * Creates a throttled function that only invokes `func` at most once per
  11392. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11393. * method to cancel delayed `func` invocations and a `flush` method to
  11394. * immediately invoke them. Provide `options` to indicate whether `func`
  11395. * should be invoked on the leading and/or trailing edge of the `wait`
  11396. * timeout. The `func` is invoked with the last arguments provided to the
  11397. * throttled function. Subsequent calls to the throttled function return the
  11398. * result of the last `func` invocation.
  11399. *
  11400. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11401. * invoked on the trailing edge of the timeout only if the throttled function
  11402. * is invoked more than once during the `wait` timeout.
  11403. *
  11404. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11405. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11406. *
  11407. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11408. * for details over the differences between `_.throttle` and `_.debounce`.
  11409. *
  11410. * @static
  11411. * @memberOf _
  11412. * @since 0.1.0
  11413. * @category Function
  11414. * @param {Function} func The function to throttle.
  11415. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11416. * @param {Object} [options={}] The options object.
  11417. * @param {boolean} [options.leading=true]
  11418. * Specify invoking on the leading edge of the timeout.
  11419. * @param {boolean} [options.trailing=true]
  11420. * Specify invoking on the trailing edge of the timeout.
  11421. * @returns {Function} Returns the new throttled function.
  11422. * @example
  11423. *
  11424. * // Avoid excessively updating the position while scrolling.
  11425. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11426. *
  11427. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11428. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11429. * jQuery(element).on('click', throttled);
  11430. *
  11431. * // Cancel the trailing throttled invocation.
  11432. * jQuery(window).on('popstate', throttled.cancel);
  11433. */
  11434. function throttle(func, wait, options) {
  11435. var leading = true,
  11436. trailing = true;
  11437. if (typeof func != 'function') {
  11438. throw new TypeError(FUNC_ERROR_TEXT);
  11439. }
  11440. if (isObject(options)) {
  11441. leading = 'leading' in options ? !!options.leading : leading;
  11442. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11443. }
  11444. return debounce(func, wait, {
  11445. 'leading': leading,
  11446. 'maxWait': wait,
  11447. 'trailing': trailing
  11448. });
  11449. }
  11450. /**
  11451. * Creates a function that accepts up to one argument, ignoring any
  11452. * additional arguments.
  11453. *
  11454. * @static
  11455. * @memberOf _
  11456. * @since 4.0.0
  11457. * @category Function
  11458. * @param {Function} func The function to cap arguments for.
  11459. * @returns {Function} Returns the new capped function.
  11460. * @example
  11461. *
  11462. * _.map(['6', '8', '10'], _.unary(parseInt));
  11463. * // => [6, 8, 10]
  11464. */
  11465. function unary(func) {
  11466. return ary(func, 1);
  11467. }
  11468. /**
  11469. * Creates a function that provides `value` to `wrapper` as its first
  11470. * argument. Any additional arguments provided to the function are appended
  11471. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11472. * binding of the created function.
  11473. *
  11474. * @static
  11475. * @memberOf _
  11476. * @since 0.1.0
  11477. * @category Function
  11478. * @param {*} value The value to wrap.
  11479. * @param {Function} [wrapper=identity] The wrapper function.
  11480. * @returns {Function} Returns the new function.
  11481. * @example
  11482. *
  11483. * var p = _.wrap(_.escape, function(func, text) {
  11484. * return '<p>' + func(text) + '</p>';
  11485. * });
  11486. *
  11487. * p('fred, barney, & pebbles');
  11488. * // => '<p>fred, barney, &amp; pebbles</p>'
  11489. */
  11490. function wrap(value, wrapper) {
  11491. return partial(castFunction(wrapper), value);
  11492. }
  11493. /*------------------------------------------------------------------------*/
  11494. /**
  11495. * Casts `value` as an array if it's not one.
  11496. *
  11497. * @static
  11498. * @memberOf _
  11499. * @since 4.4.0
  11500. * @category Lang
  11501. * @param {*} value The value to inspect.
  11502. * @returns {Array} Returns the cast array.
  11503. * @example
  11504. *
  11505. * _.castArray(1);
  11506. * // => [1]
  11507. *
  11508. * _.castArray({ 'a': 1 });
  11509. * // => [{ 'a': 1 }]
  11510. *
  11511. * _.castArray('abc');
  11512. * // => ['abc']
  11513. *
  11514. * _.castArray(null);
  11515. * // => [null]
  11516. *
  11517. * _.castArray(undefined);
  11518. * // => [undefined]
  11519. *
  11520. * _.castArray();
  11521. * // => []
  11522. *
  11523. * var array = [1, 2, 3];
  11524. * console.log(_.castArray(array) === array);
  11525. * // => true
  11526. */
  11527. function castArray() {
  11528. if (!arguments.length) {
  11529. return [];
  11530. }
  11531. var value = arguments[0];
  11532. return isArray(value) ? value : [value];
  11533. }
  11534. /**
  11535. * Creates a shallow clone of `value`.
  11536. *
  11537. * **Note:** This method is loosely based on the
  11538. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11539. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11540. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11541. * arrays. The own enumerable properties of `arguments` objects are cloned
  11542. * as plain objects. An empty object is returned for uncloneable values such
  11543. * as error objects, functions, DOM nodes, and WeakMaps.
  11544. *
  11545. * @static
  11546. * @memberOf _
  11547. * @since 0.1.0
  11548. * @category Lang
  11549. * @param {*} value The value to clone.
  11550. * @returns {*} Returns the cloned value.
  11551. * @see _.cloneDeep
  11552. * @example
  11553. *
  11554. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11555. *
  11556. * var shallow = _.clone(objects);
  11557. * console.log(shallow[0] === objects[0]);
  11558. * // => true
  11559. */
  11560. function clone(value) {
  11561. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11562. }
  11563. /**
  11564. * This method is like `_.clone` except that it accepts `customizer` which
  11565. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11566. * cloning is handled by the method instead. The `customizer` is invoked with
  11567. * up to four arguments; (value [, index|key, object, stack]).
  11568. *
  11569. * @static
  11570. * @memberOf _
  11571. * @since 4.0.0
  11572. * @category Lang
  11573. * @param {*} value The value to clone.
  11574. * @param {Function} [customizer] The function to customize cloning.
  11575. * @returns {*} Returns the cloned value.
  11576. * @see _.cloneDeepWith
  11577. * @example
  11578. *
  11579. * function customizer(value) {
  11580. * if (_.isElement(value)) {
  11581. * return value.cloneNode(false);
  11582. * }
  11583. * }
  11584. *
  11585. * var el = _.cloneWith(document.body, customizer);
  11586. *
  11587. * console.log(el === document.body);
  11588. * // => false
  11589. * console.log(el.nodeName);
  11590. * // => 'BODY'
  11591. * console.log(el.childNodes.length);
  11592. * // => 0
  11593. */
  11594. function cloneWith(value, customizer) {
  11595. customizer = typeof customizer == 'function' ? customizer : undefined;
  11596. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11597. }
  11598. /**
  11599. * This method is like `_.clone` except that it recursively clones `value`.
  11600. *
  11601. * @static
  11602. * @memberOf _
  11603. * @since 1.0.0
  11604. * @category Lang
  11605. * @param {*} value The value to recursively clone.
  11606. * @returns {*} Returns the deep cloned value.
  11607. * @see _.clone
  11608. * @example
  11609. *
  11610. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11611. *
  11612. * var deep = _.cloneDeep(objects);
  11613. * console.log(deep[0] === objects[0]);
  11614. * // => false
  11615. */
  11616. function cloneDeep(value) {
  11617. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11618. }
  11619. /**
  11620. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11621. *
  11622. * @static
  11623. * @memberOf _
  11624. * @since 4.0.0
  11625. * @category Lang
  11626. * @param {*} value The value to recursively clone.
  11627. * @param {Function} [customizer] The function to customize cloning.
  11628. * @returns {*} Returns the deep cloned value.
  11629. * @see _.cloneWith
  11630. * @example
  11631. *
  11632. * function customizer(value) {
  11633. * if (_.isElement(value)) {
  11634. * return value.cloneNode(true);
  11635. * }
  11636. * }
  11637. *
  11638. * var el = _.cloneDeepWith(document.body, customizer);
  11639. *
  11640. * console.log(el === document.body);
  11641. * // => false
  11642. * console.log(el.nodeName);
  11643. * // => 'BODY'
  11644. * console.log(el.childNodes.length);
  11645. * // => 20
  11646. */
  11647. function cloneDeepWith(value, customizer) {
  11648. customizer = typeof customizer == 'function' ? customizer : undefined;
  11649. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11650. }
  11651. /**
  11652. * Checks if `object` conforms to `source` by invoking the predicate
  11653. * properties of `source` with the corresponding property values of `object`.
  11654. *
  11655. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11656. * partially applied.
  11657. *
  11658. * @static
  11659. * @memberOf _
  11660. * @since 4.14.0
  11661. * @category Lang
  11662. * @param {Object} object The object to inspect.
  11663. * @param {Object} source The object of property predicates to conform to.
  11664. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11665. * @example
  11666. *
  11667. * var object = { 'a': 1, 'b': 2 };
  11668. *
  11669. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11670. * // => true
  11671. *
  11672. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11673. * // => false
  11674. */
  11675. function conformsTo(object, source) {
  11676. return source == null || baseConformsTo(object, source, keys(source));
  11677. }
  11678. /**
  11679. * Performs a
  11680. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11681. * comparison between two values to determine if they are equivalent.
  11682. *
  11683. * @static
  11684. * @memberOf _
  11685. * @since 4.0.0
  11686. * @category Lang
  11687. * @param {*} value The value to compare.
  11688. * @param {*} other The other value to compare.
  11689. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11690. * @example
  11691. *
  11692. * var object = { 'a': 1 };
  11693. * var other = { 'a': 1 };
  11694. *
  11695. * _.eq(object, object);
  11696. * // => true
  11697. *
  11698. * _.eq(object, other);
  11699. * // => false
  11700. *
  11701. * _.eq('a', 'a');
  11702. * // => true
  11703. *
  11704. * _.eq('a', Object('a'));
  11705. * // => false
  11706. *
  11707. * _.eq(NaN, NaN);
  11708. * // => true
  11709. */
  11710. function eq(value, other) {
  11711. return value === other || (value !== value && other !== other);
  11712. }
  11713. /**
  11714. * Checks if `value` is greater than `other`.
  11715. *
  11716. * @static
  11717. * @memberOf _
  11718. * @since 3.9.0
  11719. * @category Lang
  11720. * @param {*} value The value to compare.
  11721. * @param {*} other The other value to compare.
  11722. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11723. * else `false`.
  11724. * @see _.lt
  11725. * @example
  11726. *
  11727. * _.gt(3, 1);
  11728. * // => true
  11729. *
  11730. * _.gt(3, 3);
  11731. * // => false
  11732. *
  11733. * _.gt(1, 3);
  11734. * // => false
  11735. */
  11736. var gt = createRelationalOperation(baseGt);
  11737. /**
  11738. * Checks if `value` is greater than or equal to `other`.
  11739. *
  11740. * @static
  11741. * @memberOf _
  11742. * @since 3.9.0
  11743. * @category Lang
  11744. * @param {*} value The value to compare.
  11745. * @param {*} other The other value to compare.
  11746. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11747. * `other`, else `false`.
  11748. * @see _.lte
  11749. * @example
  11750. *
  11751. * _.gte(3, 1);
  11752. * // => true
  11753. *
  11754. * _.gte(3, 3);
  11755. * // => true
  11756. *
  11757. * _.gte(1, 3);
  11758. * // => false
  11759. */
  11760. var gte = createRelationalOperation(function(value, other) {
  11761. return value >= other;
  11762. });
  11763. /**
  11764. * Checks if `value` is likely an `arguments` object.
  11765. *
  11766. * @static
  11767. * @memberOf _
  11768. * @since 0.1.0
  11769. * @category Lang
  11770. * @param {*} value The value to check.
  11771. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11772. * else `false`.
  11773. * @example
  11774. *
  11775. * _.isArguments(function() { return arguments; }());
  11776. * // => true
  11777. *
  11778. * _.isArguments([1, 2, 3]);
  11779. * // => false
  11780. */
  11781. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11782. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11783. !propertyIsEnumerable.call(value, 'callee');
  11784. };
  11785. /**
  11786. * Checks if `value` is classified as an `Array` object.
  11787. *
  11788. * @static
  11789. * @memberOf _
  11790. * @since 0.1.0
  11791. * @category Lang
  11792. * @param {*} value The value to check.
  11793. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11794. * @example
  11795. *
  11796. * _.isArray([1, 2, 3]);
  11797. * // => true
  11798. *
  11799. * _.isArray(document.body.children);
  11800. * // => false
  11801. *
  11802. * _.isArray('abc');
  11803. * // => false
  11804. *
  11805. * _.isArray(_.noop);
  11806. * // => false
  11807. */
  11808. var isArray = Array.isArray;
  11809. /**
  11810. * Checks if `value` is classified as an `ArrayBuffer` object.
  11811. *
  11812. * @static
  11813. * @memberOf _
  11814. * @since 4.3.0
  11815. * @category Lang
  11816. * @param {*} value The value to check.
  11817. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11818. * @example
  11819. *
  11820. * _.isArrayBuffer(new ArrayBuffer(2));
  11821. * // => true
  11822. *
  11823. * _.isArrayBuffer(new Array(2));
  11824. * // => false
  11825. */
  11826. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11827. /**
  11828. * Checks if `value` is array-like. A value is considered array-like if it's
  11829. * not a function and has a `value.length` that's an integer greater than or
  11830. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11831. *
  11832. * @static
  11833. * @memberOf _
  11834. * @since 4.0.0
  11835. * @category Lang
  11836. * @param {*} value The value to check.
  11837. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11838. * @example
  11839. *
  11840. * _.isArrayLike([1, 2, 3]);
  11841. * // => true
  11842. *
  11843. * _.isArrayLike(document.body.children);
  11844. * // => true
  11845. *
  11846. * _.isArrayLike('abc');
  11847. * // => true
  11848. *
  11849. * _.isArrayLike(_.noop);
  11850. * // => false
  11851. */
  11852. function isArrayLike(value) {
  11853. return value != null && isLength(value.length) && !isFunction(value);
  11854. }
  11855. /**
  11856. * This method is like `_.isArrayLike` except that it also checks if `value`
  11857. * is an object.
  11858. *
  11859. * @static
  11860. * @memberOf _
  11861. * @since 4.0.0
  11862. * @category Lang
  11863. * @param {*} value The value to check.
  11864. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11865. * else `false`.
  11866. * @example
  11867. *
  11868. * _.isArrayLikeObject([1, 2, 3]);
  11869. * // => true
  11870. *
  11871. * _.isArrayLikeObject(document.body.children);
  11872. * // => true
  11873. *
  11874. * _.isArrayLikeObject('abc');
  11875. * // => false
  11876. *
  11877. * _.isArrayLikeObject(_.noop);
  11878. * // => false
  11879. */
  11880. function isArrayLikeObject(value) {
  11881. return isObjectLike(value) && isArrayLike(value);
  11882. }
  11883. /**
  11884. * Checks if `value` is classified as a boolean primitive or 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 boolean, else `false`.
  11892. * @example
  11893. *
  11894. * _.isBoolean(false);
  11895. * // => true
  11896. *
  11897. * _.isBoolean(null);
  11898. * // => false
  11899. */
  11900. function isBoolean(value) {
  11901. return value === true || value === false ||
  11902. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11903. }
  11904. /**
  11905. * Checks if `value` is a buffer.
  11906. *
  11907. * @static
  11908. * @memberOf _
  11909. * @since 4.3.0
  11910. * @category Lang
  11911. * @param {*} value The value to check.
  11912. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11913. * @example
  11914. *
  11915. * _.isBuffer(new Buffer(2));
  11916. * // => true
  11917. *
  11918. * _.isBuffer(new Uint8Array(2));
  11919. * // => false
  11920. */
  11921. var isBuffer = nativeIsBuffer || stubFalse;
  11922. /**
  11923. * Checks if `value` is classified as a `Date` object.
  11924. *
  11925. * @static
  11926. * @memberOf _
  11927. * @since 0.1.0
  11928. * @category Lang
  11929. * @param {*} value The value to check.
  11930. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11931. * @example
  11932. *
  11933. * _.isDate(new Date);
  11934. * // => true
  11935. *
  11936. * _.isDate('Mon April 23 2012');
  11937. * // => false
  11938. */
  11939. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11940. /**
  11941. * Checks if `value` is likely a DOM element.
  11942. *
  11943. * @static
  11944. * @memberOf _
  11945. * @since 0.1.0
  11946. * @category Lang
  11947. * @param {*} value The value to check.
  11948. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11949. * @example
  11950. *
  11951. * _.isElement(document.body);
  11952. * // => true
  11953. *
  11954. * _.isElement('<body>');
  11955. * // => false
  11956. */
  11957. function isElement(value) {
  11958. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11959. }
  11960. /**
  11961. * Checks if `value` is an empty object, collection, map, or set.
  11962. *
  11963. * Objects are considered empty if they have no own enumerable string keyed
  11964. * properties.
  11965. *
  11966. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11967. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11968. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11969. *
  11970. * @static
  11971. * @memberOf _
  11972. * @since 0.1.0
  11973. * @category Lang
  11974. * @param {*} value The value to check.
  11975. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11976. * @example
  11977. *
  11978. * _.isEmpty(null);
  11979. * // => true
  11980. *
  11981. * _.isEmpty(true);
  11982. * // => true
  11983. *
  11984. * _.isEmpty(1);
  11985. * // => true
  11986. *
  11987. * _.isEmpty([1, 2, 3]);
  11988. * // => false
  11989. *
  11990. * _.isEmpty({ 'a': 1 });
  11991. * // => false
  11992. */
  11993. function isEmpty(value) {
  11994. if (value == null) {
  11995. return true;
  11996. }
  11997. if (isArrayLike(value) &&
  11998. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11999. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12000. return !value.length;
  12001. }
  12002. var tag = getTag(value);
  12003. if (tag == mapTag || tag == setTag) {
  12004. return !value.size;
  12005. }
  12006. if (isPrototype(value)) {
  12007. return !baseKeys(value).length;
  12008. }
  12009. for (var key in value) {
  12010. if (hasOwnProperty.call(value, key)) {
  12011. return false;
  12012. }
  12013. }
  12014. return true;
  12015. }
  12016. /**
  12017. * Performs a deep comparison between two values to determine if they are
  12018. * equivalent.
  12019. *
  12020. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12021. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12022. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12023. * by their own, not inherited, enumerable properties. Functions and DOM
  12024. * nodes are compared by strict equality, i.e. `===`.
  12025. *
  12026. * @static
  12027. * @memberOf _
  12028. * @since 0.1.0
  12029. * @category Lang
  12030. * @param {*} value The value to compare.
  12031. * @param {*} other The other value to compare.
  12032. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12033. * @example
  12034. *
  12035. * var object = { 'a': 1 };
  12036. * var other = { 'a': 1 };
  12037. *
  12038. * _.isEqual(object, other);
  12039. * // => true
  12040. *
  12041. * object === other;
  12042. * // => false
  12043. */
  12044. function isEqual(value, other) {
  12045. return baseIsEqual(value, other);
  12046. }
  12047. /**
  12048. * This method is like `_.isEqual` except that it accepts `customizer` which
  12049. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12050. * are handled by the method instead. The `customizer` is invoked with up to
  12051. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12052. *
  12053. * @static
  12054. * @memberOf _
  12055. * @since 4.0.0
  12056. * @category Lang
  12057. * @param {*} value The value to compare.
  12058. * @param {*} other The other value to compare.
  12059. * @param {Function} [customizer] The function to customize comparisons.
  12060. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12061. * @example
  12062. *
  12063. * function isGreeting(value) {
  12064. * return /^h(?:i|ello)$/.test(value);
  12065. * }
  12066. *
  12067. * function customizer(objValue, othValue) {
  12068. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12069. * return true;
  12070. * }
  12071. * }
  12072. *
  12073. * var array = ['hello', 'goodbye'];
  12074. * var other = ['hi', 'goodbye'];
  12075. *
  12076. * _.isEqualWith(array, other, customizer);
  12077. * // => true
  12078. */
  12079. function isEqualWith(value, other, customizer) {
  12080. customizer = typeof customizer == 'function' ? customizer : undefined;
  12081. var result = customizer ? customizer(value, other) : undefined;
  12082. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12083. }
  12084. /**
  12085. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12086. * `SyntaxError`, `TypeError`, or `URIError` object.
  12087. *
  12088. * @static
  12089. * @memberOf _
  12090. * @since 3.0.0
  12091. * @category Lang
  12092. * @param {*} value The value to check.
  12093. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12094. * @example
  12095. *
  12096. * _.isError(new Error);
  12097. * // => true
  12098. *
  12099. * _.isError(Error);
  12100. * // => false
  12101. */
  12102. function isError(value) {
  12103. if (!isObjectLike(value)) {
  12104. return false;
  12105. }
  12106. var tag = baseGetTag(value);
  12107. return tag == errorTag || tag == domExcTag ||
  12108. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12109. }
  12110. /**
  12111. * Checks if `value` is a finite primitive number.
  12112. *
  12113. * **Note:** This method is based on
  12114. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12115. *
  12116. * @static
  12117. * @memberOf _
  12118. * @since 0.1.0
  12119. * @category Lang
  12120. * @param {*} value The value to check.
  12121. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12122. * @example
  12123. *
  12124. * _.isFinite(3);
  12125. * // => true
  12126. *
  12127. * _.isFinite(Number.MIN_VALUE);
  12128. * // => true
  12129. *
  12130. * _.isFinite(Infinity);
  12131. * // => false
  12132. *
  12133. * _.isFinite('3');
  12134. * // => false
  12135. */
  12136. function isFinite(value) {
  12137. return typeof value == 'number' && nativeIsFinite(value);
  12138. }
  12139. /**
  12140. * Checks if `value` is classified as a `Function` object.
  12141. *
  12142. * @static
  12143. * @memberOf _
  12144. * @since 0.1.0
  12145. * @category Lang
  12146. * @param {*} value The value to check.
  12147. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12148. * @example
  12149. *
  12150. * _.isFunction(_);
  12151. * // => true
  12152. *
  12153. * _.isFunction(/abc/);
  12154. * // => false
  12155. */
  12156. function isFunction(value) {
  12157. if (!isObject(value)) {
  12158. return false;
  12159. }
  12160. // The use of `Object#toString` avoids issues with the `typeof` operator
  12161. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12162. var tag = baseGetTag(value);
  12163. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12164. }
  12165. /**
  12166. * Checks if `value` is an integer.
  12167. *
  12168. * **Note:** This method is based on
  12169. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12170. *
  12171. * @static
  12172. * @memberOf _
  12173. * @since 4.0.0
  12174. * @category Lang
  12175. * @param {*} value The value to check.
  12176. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12177. * @example
  12178. *
  12179. * _.isInteger(3);
  12180. * // => true
  12181. *
  12182. * _.isInteger(Number.MIN_VALUE);
  12183. * // => false
  12184. *
  12185. * _.isInteger(Infinity);
  12186. * // => false
  12187. *
  12188. * _.isInteger('3');
  12189. * // => false
  12190. */
  12191. function isInteger(value) {
  12192. return typeof value == 'number' && value == toInteger(value);
  12193. }
  12194. /**
  12195. * Checks if `value` is a valid array-like length.
  12196. *
  12197. * **Note:** This method is loosely based on
  12198. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12199. *
  12200. * @static
  12201. * @memberOf _
  12202. * @since 4.0.0
  12203. * @category Lang
  12204. * @param {*} value The value to check.
  12205. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12206. * @example
  12207. *
  12208. * _.isLength(3);
  12209. * // => true
  12210. *
  12211. * _.isLength(Number.MIN_VALUE);
  12212. * // => false
  12213. *
  12214. * _.isLength(Infinity);
  12215. * // => false
  12216. *
  12217. * _.isLength('3');
  12218. * // => false
  12219. */
  12220. function isLength(value) {
  12221. return typeof value == 'number' &&
  12222. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12223. }
  12224. /**
  12225. * Checks if `value` is the
  12226. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12227. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12228. *
  12229. * @static
  12230. * @memberOf _
  12231. * @since 0.1.0
  12232. * @category Lang
  12233. * @param {*} value The value to check.
  12234. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12235. * @example
  12236. *
  12237. * _.isObject({});
  12238. * // => true
  12239. *
  12240. * _.isObject([1, 2, 3]);
  12241. * // => true
  12242. *
  12243. * _.isObject(_.noop);
  12244. * // => true
  12245. *
  12246. * _.isObject(null);
  12247. * // => false
  12248. */
  12249. function isObject(value) {
  12250. var type = typeof value;
  12251. return value != null && (type == 'object' || type == 'function');
  12252. }
  12253. /**
  12254. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12255. * and has a `typeof` result of "object".
  12256. *
  12257. * @static
  12258. * @memberOf _
  12259. * @since 4.0.0
  12260. * @category Lang
  12261. * @param {*} value The value to check.
  12262. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12263. * @example
  12264. *
  12265. * _.isObjectLike({});
  12266. * // => true
  12267. *
  12268. * _.isObjectLike([1, 2, 3]);
  12269. * // => true
  12270. *
  12271. * _.isObjectLike(_.noop);
  12272. * // => false
  12273. *
  12274. * _.isObjectLike(null);
  12275. * // => false
  12276. */
  12277. function isObjectLike(value) {
  12278. return value != null && typeof value == 'object';
  12279. }
  12280. /**
  12281. * Checks if `value` is classified as a `Map` object.
  12282. *
  12283. * @static
  12284. * @memberOf _
  12285. * @since 4.3.0
  12286. * @category Lang
  12287. * @param {*} value The value to check.
  12288. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12289. * @example
  12290. *
  12291. * _.isMap(new Map);
  12292. * // => true
  12293. *
  12294. * _.isMap(new WeakMap);
  12295. * // => false
  12296. */
  12297. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12298. /**
  12299. * Performs a partial deep comparison between `object` and `source` to
  12300. * determine if `object` contains equivalent property values.
  12301. *
  12302. * **Note:** This method is equivalent to `_.matches` when `source` is
  12303. * partially applied.
  12304. *
  12305. * Partial comparisons will match empty array and empty object `source`
  12306. * values against any array or object value, respectively. See `_.isEqual`
  12307. * for a list of supported value comparisons.
  12308. *
  12309. * @static
  12310. * @memberOf _
  12311. * @since 3.0.0
  12312. * @category Lang
  12313. * @param {Object} object The object to inspect.
  12314. * @param {Object} source The object of property values to match.
  12315. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12316. * @example
  12317. *
  12318. * var object = { 'a': 1, 'b': 2 };
  12319. *
  12320. * _.isMatch(object, { 'b': 2 });
  12321. * // => true
  12322. *
  12323. * _.isMatch(object, { 'b': 1 });
  12324. * // => false
  12325. */
  12326. function isMatch(object, source) {
  12327. return object === source || baseIsMatch(object, source, getMatchData(source));
  12328. }
  12329. /**
  12330. * This method is like `_.isMatch` except that it accepts `customizer` which
  12331. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12332. * are handled by the method instead. The `customizer` is invoked with five
  12333. * arguments: (objValue, srcValue, index|key, object, source).
  12334. *
  12335. * @static
  12336. * @memberOf _
  12337. * @since 4.0.0
  12338. * @category Lang
  12339. * @param {Object} object The object to inspect.
  12340. * @param {Object} source The object of property values to match.
  12341. * @param {Function} [customizer] The function to customize comparisons.
  12342. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12343. * @example
  12344. *
  12345. * function isGreeting(value) {
  12346. * return /^h(?:i|ello)$/.test(value);
  12347. * }
  12348. *
  12349. * function customizer(objValue, srcValue) {
  12350. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12351. * return true;
  12352. * }
  12353. * }
  12354. *
  12355. * var object = { 'greeting': 'hello' };
  12356. * var source = { 'greeting': 'hi' };
  12357. *
  12358. * _.isMatchWith(object, source, customizer);
  12359. * // => true
  12360. */
  12361. function isMatchWith(object, source, customizer) {
  12362. customizer = typeof customizer == 'function' ? customizer : undefined;
  12363. return baseIsMatch(object, source, getMatchData(source), customizer);
  12364. }
  12365. /**
  12366. * Checks if `value` is `NaN`.
  12367. *
  12368. * **Note:** This method is based on
  12369. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12370. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12371. * `undefined` and other non-number values.
  12372. *
  12373. * @static
  12374. * @memberOf _
  12375. * @since 0.1.0
  12376. * @category Lang
  12377. * @param {*} value The value to check.
  12378. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12379. * @example
  12380. *
  12381. * _.isNaN(NaN);
  12382. * // => true
  12383. *
  12384. * _.isNaN(new Number(NaN));
  12385. * // => true
  12386. *
  12387. * isNaN(undefined);
  12388. * // => true
  12389. *
  12390. * _.isNaN(undefined);
  12391. * // => false
  12392. */
  12393. function isNaN(value) {
  12394. // An `NaN` primitive is the only value that is not equal to itself.
  12395. // Perform the `toStringTag` check first to avoid errors with some
  12396. // ActiveX objects in IE.
  12397. return isNumber(value) && value != +value;
  12398. }
  12399. /**
  12400. * Checks if `value` is a pristine native function.
  12401. *
  12402. * **Note:** This method can't reliably detect native functions in the presence
  12403. * of the core-js package because core-js circumvents this kind of detection.
  12404. * Despite multiple requests, the core-js maintainer has made it clear: any
  12405. * attempt to fix the detection will be obstructed. As a result, we're left
  12406. * with little choice but to throw an error. Unfortunately, this also affects
  12407. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12408. * which rely on core-js.
  12409. *
  12410. * @static
  12411. * @memberOf _
  12412. * @since 3.0.0
  12413. * @category Lang
  12414. * @param {*} value The value to check.
  12415. * @returns {boolean} Returns `true` if `value` is a native function,
  12416. * else `false`.
  12417. * @example
  12418. *
  12419. * _.isNative(Array.prototype.push);
  12420. * // => true
  12421. *
  12422. * _.isNative(_);
  12423. * // => false
  12424. */
  12425. function isNative(value) {
  12426. if (isMaskable(value)) {
  12427. throw new Error(CORE_ERROR_TEXT);
  12428. }
  12429. return baseIsNative(value);
  12430. }
  12431. /**
  12432. * Checks if `value` is `null`.
  12433. *
  12434. * @static
  12435. * @memberOf _
  12436. * @since 0.1.0
  12437. * @category Lang
  12438. * @param {*} value The value to check.
  12439. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12440. * @example
  12441. *
  12442. * _.isNull(null);
  12443. * // => true
  12444. *
  12445. * _.isNull(void 0);
  12446. * // => false
  12447. */
  12448. function isNull(value) {
  12449. return value === null;
  12450. }
  12451. /**
  12452. * Checks if `value` is `null` or `undefined`.
  12453. *
  12454. * @static
  12455. * @memberOf _
  12456. * @since 4.0.0
  12457. * @category Lang
  12458. * @param {*} value The value to check.
  12459. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12460. * @example
  12461. *
  12462. * _.isNil(null);
  12463. * // => true
  12464. *
  12465. * _.isNil(void 0);
  12466. * // => true
  12467. *
  12468. * _.isNil(NaN);
  12469. * // => false
  12470. */
  12471. function isNil(value) {
  12472. return value == null;
  12473. }
  12474. /**
  12475. * Checks if `value` is classified as a `Number` primitive or object.
  12476. *
  12477. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12478. * classified as numbers, use the `_.isFinite` method.
  12479. *
  12480. * @static
  12481. * @memberOf _
  12482. * @since 0.1.0
  12483. * @category Lang
  12484. * @param {*} value The value to check.
  12485. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12486. * @example
  12487. *
  12488. * _.isNumber(3);
  12489. * // => true
  12490. *
  12491. * _.isNumber(Number.MIN_VALUE);
  12492. * // => true
  12493. *
  12494. * _.isNumber(Infinity);
  12495. * // => true
  12496. *
  12497. * _.isNumber('3');
  12498. * // => false
  12499. */
  12500. function isNumber(value) {
  12501. return typeof value == 'number' ||
  12502. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12503. }
  12504. /**
  12505. * Checks if `value` is a plain object, that is, an object created by the
  12506. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12507. *
  12508. * @static
  12509. * @memberOf _
  12510. * @since 0.8.0
  12511. * @category Lang
  12512. * @param {*} value The value to check.
  12513. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12514. * @example
  12515. *
  12516. * function Foo() {
  12517. * this.a = 1;
  12518. * }
  12519. *
  12520. * _.isPlainObject(new Foo);
  12521. * // => false
  12522. *
  12523. * _.isPlainObject([1, 2, 3]);
  12524. * // => false
  12525. *
  12526. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12527. * // => true
  12528. *
  12529. * _.isPlainObject(Object.create(null));
  12530. * // => true
  12531. */
  12532. function isPlainObject(value) {
  12533. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12534. return false;
  12535. }
  12536. var proto = getPrototype(value);
  12537. if (proto === null) {
  12538. return true;
  12539. }
  12540. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12541. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12542. funcToString.call(Ctor) == objectCtorString;
  12543. }
  12544. /**
  12545. * Checks if `value` is classified as a `RegExp` object.
  12546. *
  12547. * @static
  12548. * @memberOf _
  12549. * @since 0.1.0
  12550. * @category Lang
  12551. * @param {*} value The value to check.
  12552. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12553. * @example
  12554. *
  12555. * _.isRegExp(/abc/);
  12556. * // => true
  12557. *
  12558. * _.isRegExp('/abc/');
  12559. * // => false
  12560. */
  12561. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12562. /**
  12563. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12564. * double precision number which isn't the result of a rounded unsafe integer.
  12565. *
  12566. * **Note:** This method is based on
  12567. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12568. *
  12569. * @static
  12570. * @memberOf _
  12571. * @since 4.0.0
  12572. * @category Lang
  12573. * @param {*} value The value to check.
  12574. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12575. * @example
  12576. *
  12577. * _.isSafeInteger(3);
  12578. * // => true
  12579. *
  12580. * _.isSafeInteger(Number.MIN_VALUE);
  12581. * // => false
  12582. *
  12583. * _.isSafeInteger(Infinity);
  12584. * // => false
  12585. *
  12586. * _.isSafeInteger('3');
  12587. * // => false
  12588. */
  12589. function isSafeInteger(value) {
  12590. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12591. }
  12592. /**
  12593. * Checks if `value` is classified as a `Set` object.
  12594. *
  12595. * @static
  12596. * @memberOf _
  12597. * @since 4.3.0
  12598. * @category Lang
  12599. * @param {*} value The value to check.
  12600. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12601. * @example
  12602. *
  12603. * _.isSet(new Set);
  12604. * // => true
  12605. *
  12606. * _.isSet(new WeakSet);
  12607. * // => false
  12608. */
  12609. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12610. /**
  12611. * Checks if `value` is classified as a `String` primitive or object.
  12612. *
  12613. * @static
  12614. * @since 0.1.0
  12615. * @memberOf _
  12616. * @category Lang
  12617. * @param {*} value The value to check.
  12618. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12619. * @example
  12620. *
  12621. * _.isString('abc');
  12622. * // => true
  12623. *
  12624. * _.isString(1);
  12625. * // => false
  12626. */
  12627. function isString(value) {
  12628. return typeof value == 'string' ||
  12629. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12630. }
  12631. /**
  12632. * Checks if `value` is classified as a `Symbol` primitive or object.
  12633. *
  12634. * @static
  12635. * @memberOf _
  12636. * @since 4.0.0
  12637. * @category Lang
  12638. * @param {*} value The value to check.
  12639. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12640. * @example
  12641. *
  12642. * _.isSymbol(Symbol.iterator);
  12643. * // => true
  12644. *
  12645. * _.isSymbol('abc');
  12646. * // => false
  12647. */
  12648. function isSymbol(value) {
  12649. return typeof value == 'symbol' ||
  12650. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12651. }
  12652. /**
  12653. * Checks if `value` is classified as a typed array.
  12654. *
  12655. * @static
  12656. * @memberOf _
  12657. * @since 3.0.0
  12658. * @category Lang
  12659. * @param {*} value The value to check.
  12660. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12661. * @example
  12662. *
  12663. * _.isTypedArray(new Uint8Array);
  12664. * // => true
  12665. *
  12666. * _.isTypedArray([]);
  12667. * // => false
  12668. */
  12669. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12670. /**
  12671. * Checks if `value` is `undefined`.
  12672. *
  12673. * @static
  12674. * @since 0.1.0
  12675. * @memberOf _
  12676. * @category Lang
  12677. * @param {*} value The value to check.
  12678. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12679. * @example
  12680. *
  12681. * _.isUndefined(void 0);
  12682. * // => true
  12683. *
  12684. * _.isUndefined(null);
  12685. * // => false
  12686. */
  12687. function isUndefined(value) {
  12688. return value === undefined;
  12689. }
  12690. /**
  12691. * Checks if `value` is classified as a `WeakMap` object.
  12692. *
  12693. * @static
  12694. * @memberOf _
  12695. * @since 4.3.0
  12696. * @category Lang
  12697. * @param {*} value The value to check.
  12698. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12699. * @example
  12700. *
  12701. * _.isWeakMap(new WeakMap);
  12702. * // => true
  12703. *
  12704. * _.isWeakMap(new Map);
  12705. * // => false
  12706. */
  12707. function isWeakMap(value) {
  12708. return isObjectLike(value) && getTag(value) == weakMapTag;
  12709. }
  12710. /**
  12711. * Checks if `value` is classified as a `WeakSet` object.
  12712. *
  12713. * @static
  12714. * @memberOf _
  12715. * @since 4.3.0
  12716. * @category Lang
  12717. * @param {*} value The value to check.
  12718. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12719. * @example
  12720. *
  12721. * _.isWeakSet(new WeakSet);
  12722. * // => true
  12723. *
  12724. * _.isWeakSet(new Set);
  12725. * // => false
  12726. */
  12727. function isWeakSet(value) {
  12728. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12729. }
  12730. /**
  12731. * Checks if `value` is less than `other`.
  12732. *
  12733. * @static
  12734. * @memberOf _
  12735. * @since 3.9.0
  12736. * @category Lang
  12737. * @param {*} value The value to compare.
  12738. * @param {*} other The other value to compare.
  12739. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12740. * else `false`.
  12741. * @see _.gt
  12742. * @example
  12743. *
  12744. * _.lt(1, 3);
  12745. * // => true
  12746. *
  12747. * _.lt(3, 3);
  12748. * // => false
  12749. *
  12750. * _.lt(3, 1);
  12751. * // => false
  12752. */
  12753. var lt = createRelationalOperation(baseLt);
  12754. /**
  12755. * Checks if `value` is less than or equal to `other`.
  12756. *
  12757. * @static
  12758. * @memberOf _
  12759. * @since 3.9.0
  12760. * @category Lang
  12761. * @param {*} value The value to compare.
  12762. * @param {*} other The other value to compare.
  12763. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12764. * `other`, else `false`.
  12765. * @see _.gte
  12766. * @example
  12767. *
  12768. * _.lte(1, 3);
  12769. * // => true
  12770. *
  12771. * _.lte(3, 3);
  12772. * // => true
  12773. *
  12774. * _.lte(3, 1);
  12775. * // => false
  12776. */
  12777. var lte = createRelationalOperation(function(value, other) {
  12778. return value <= other;
  12779. });
  12780. /**
  12781. * Converts `value` to an array.
  12782. *
  12783. * @static
  12784. * @since 0.1.0
  12785. * @memberOf _
  12786. * @category Lang
  12787. * @param {*} value The value to convert.
  12788. * @returns {Array} Returns the converted array.
  12789. * @example
  12790. *
  12791. * _.toArray({ 'a': 1, 'b': 2 });
  12792. * // => [1, 2]
  12793. *
  12794. * _.toArray('abc');
  12795. * // => ['a', 'b', 'c']
  12796. *
  12797. * _.toArray(1);
  12798. * // => []
  12799. *
  12800. * _.toArray(null);
  12801. * // => []
  12802. */
  12803. function toArray(value) {
  12804. if (!value) {
  12805. return [];
  12806. }
  12807. if (isArrayLike(value)) {
  12808. return isString(value) ? stringToArray(value) : copyArray(value);
  12809. }
  12810. if (symIterator && value[symIterator]) {
  12811. return iteratorToArray(value[symIterator]());
  12812. }
  12813. var tag = getTag(value),
  12814. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12815. return func(value);
  12816. }
  12817. /**
  12818. * Converts `value` to a finite number.
  12819. *
  12820. * @static
  12821. * @memberOf _
  12822. * @since 4.12.0
  12823. * @category Lang
  12824. * @param {*} value The value to convert.
  12825. * @returns {number} Returns the converted number.
  12826. * @example
  12827. *
  12828. * _.toFinite(3.2);
  12829. * // => 3.2
  12830. *
  12831. * _.toFinite(Number.MIN_VALUE);
  12832. * // => 5e-324
  12833. *
  12834. * _.toFinite(Infinity);
  12835. * // => 1.7976931348623157e+308
  12836. *
  12837. * _.toFinite('3.2');
  12838. * // => 3.2
  12839. */
  12840. function toFinite(value) {
  12841. if (!value) {
  12842. return value === 0 ? value : 0;
  12843. }
  12844. value = toNumber(value);
  12845. if (value === INFINITY || value === -INFINITY) {
  12846. var sign = (value < 0 ? -1 : 1);
  12847. return sign * MAX_INTEGER;
  12848. }
  12849. return value === value ? value : 0;
  12850. }
  12851. /**
  12852. * Converts `value` to an integer.
  12853. *
  12854. * **Note:** This method is loosely based on
  12855. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12856. *
  12857. * @static
  12858. * @memberOf _
  12859. * @since 4.0.0
  12860. * @category Lang
  12861. * @param {*} value The value to convert.
  12862. * @returns {number} Returns the converted integer.
  12863. * @example
  12864. *
  12865. * _.toInteger(3.2);
  12866. * // => 3
  12867. *
  12868. * _.toInteger(Number.MIN_VALUE);
  12869. * // => 0
  12870. *
  12871. * _.toInteger(Infinity);
  12872. * // => 1.7976931348623157e+308
  12873. *
  12874. * _.toInteger('3.2');
  12875. * // => 3
  12876. */
  12877. function toInteger(value) {
  12878. var result = toFinite(value),
  12879. remainder = result % 1;
  12880. return result === result ? (remainder ? result - remainder : result) : 0;
  12881. }
  12882. /**
  12883. * Converts `value` to an integer suitable for use as the length of an
  12884. * array-like object.
  12885. *
  12886. * **Note:** This method is based on
  12887. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12888. *
  12889. * @static
  12890. * @memberOf _
  12891. * @since 4.0.0
  12892. * @category Lang
  12893. * @param {*} value The value to convert.
  12894. * @returns {number} Returns the converted integer.
  12895. * @example
  12896. *
  12897. * _.toLength(3.2);
  12898. * // => 3
  12899. *
  12900. * _.toLength(Number.MIN_VALUE);
  12901. * // => 0
  12902. *
  12903. * _.toLength(Infinity);
  12904. * // => 4294967295
  12905. *
  12906. * _.toLength('3.2');
  12907. * // => 3
  12908. */
  12909. function toLength(value) {
  12910. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12911. }
  12912. /**
  12913. * Converts `value` to a number.
  12914. *
  12915. * @static
  12916. * @memberOf _
  12917. * @since 4.0.0
  12918. * @category Lang
  12919. * @param {*} value The value to process.
  12920. * @returns {number} Returns the number.
  12921. * @example
  12922. *
  12923. * _.toNumber(3.2);
  12924. * // => 3.2
  12925. *
  12926. * _.toNumber(Number.MIN_VALUE);
  12927. * // => 5e-324
  12928. *
  12929. * _.toNumber(Infinity);
  12930. * // => Infinity
  12931. *
  12932. * _.toNumber('3.2');
  12933. * // => 3.2
  12934. */
  12935. function toNumber(value) {
  12936. if (typeof value == 'number') {
  12937. return value;
  12938. }
  12939. if (isSymbol(value)) {
  12940. return NAN;
  12941. }
  12942. if (isObject(value)) {
  12943. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12944. value = isObject(other) ? (other + '') : other;
  12945. }
  12946. if (typeof value != 'string') {
  12947. return value === 0 ? value : +value;
  12948. }
  12949. value = baseTrim(value);
  12950. var isBinary = reIsBinary.test(value);
  12951. return (isBinary || reIsOctal.test(value))
  12952. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12953. : (reIsBadHex.test(value) ? NAN : +value);
  12954. }
  12955. /**
  12956. * Converts `value` to a plain object flattening inherited enumerable string
  12957. * keyed properties of `value` to own properties of the plain object.
  12958. *
  12959. * @static
  12960. * @memberOf _
  12961. * @since 3.0.0
  12962. * @category Lang
  12963. * @param {*} value The value to convert.
  12964. * @returns {Object} Returns the converted plain object.
  12965. * @example
  12966. *
  12967. * function Foo() {
  12968. * this.b = 2;
  12969. * }
  12970. *
  12971. * Foo.prototype.c = 3;
  12972. *
  12973. * _.assign({ 'a': 1 }, new Foo);
  12974. * // => { 'a': 1, 'b': 2 }
  12975. *
  12976. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12977. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12978. */
  12979. function toPlainObject(value) {
  12980. return copyObject(value, keysIn(value));
  12981. }
  12982. /**
  12983. * Converts `value` to a safe integer. A safe integer can be compared and
  12984. * represented correctly.
  12985. *
  12986. * @static
  12987. * @memberOf _
  12988. * @since 4.0.0
  12989. * @category Lang
  12990. * @param {*} value The value to convert.
  12991. * @returns {number} Returns the converted integer.
  12992. * @example
  12993. *
  12994. * _.toSafeInteger(3.2);
  12995. * // => 3
  12996. *
  12997. * _.toSafeInteger(Number.MIN_VALUE);
  12998. * // => 0
  12999. *
  13000. * _.toSafeInteger(Infinity);
  13001. * // => 9007199254740991
  13002. *
  13003. * _.toSafeInteger('3.2');
  13004. * // => 3
  13005. */
  13006. function toSafeInteger(value) {
  13007. return value
  13008. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13009. : (value === 0 ? value : 0);
  13010. }
  13011. /**
  13012. * Converts `value` to a string. An empty string is returned for `null`
  13013. * and `undefined` values. The sign of `-0` is preserved.
  13014. *
  13015. * @static
  13016. * @memberOf _
  13017. * @since 4.0.0
  13018. * @category Lang
  13019. * @param {*} value The value to convert.
  13020. * @returns {string} Returns the converted string.
  13021. * @example
  13022. *
  13023. * _.toString(null);
  13024. * // => ''
  13025. *
  13026. * _.toString(-0);
  13027. * // => '-0'
  13028. *
  13029. * _.toString([1, 2, 3]);
  13030. * // => '1,2,3'
  13031. */
  13032. function toString(value) {
  13033. return value == null ? '' : baseToString(value);
  13034. }
  13035. /*------------------------------------------------------------------------*/
  13036. /**
  13037. * Assigns own enumerable string keyed properties of source objects to the
  13038. * destination object. Source objects are applied from left to right.
  13039. * Subsequent sources overwrite property assignments of previous sources.
  13040. *
  13041. * **Note:** This method mutates `object` and is loosely based on
  13042. * [`Object.assign`](https://mdn.io/Object/assign).
  13043. *
  13044. * @static
  13045. * @memberOf _
  13046. * @since 0.10.0
  13047. * @category Object
  13048. * @param {Object} object The destination object.
  13049. * @param {...Object} [sources] The source objects.
  13050. * @returns {Object} Returns `object`.
  13051. * @see _.assignIn
  13052. * @example
  13053. *
  13054. * function Foo() {
  13055. * this.a = 1;
  13056. * }
  13057. *
  13058. * function Bar() {
  13059. * this.c = 3;
  13060. * }
  13061. *
  13062. * Foo.prototype.b = 2;
  13063. * Bar.prototype.d = 4;
  13064. *
  13065. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13066. * // => { 'a': 1, 'c': 3 }
  13067. */
  13068. var assign = createAssigner(function(object, source) {
  13069. if (isPrototype(source) || isArrayLike(source)) {
  13070. copyObject(source, keys(source), object);
  13071. return;
  13072. }
  13073. for (var key in source) {
  13074. if (hasOwnProperty.call(source, key)) {
  13075. assignValue(object, key, source[key]);
  13076. }
  13077. }
  13078. });
  13079. /**
  13080. * This method is like `_.assign` except that it iterates over own and
  13081. * inherited source properties.
  13082. *
  13083. * **Note:** This method mutates `object`.
  13084. *
  13085. * @static
  13086. * @memberOf _
  13087. * @since 4.0.0
  13088. * @alias extend
  13089. * @category Object
  13090. * @param {Object} object The destination object.
  13091. * @param {...Object} [sources] The source objects.
  13092. * @returns {Object} Returns `object`.
  13093. * @see _.assign
  13094. * @example
  13095. *
  13096. * function Foo() {
  13097. * this.a = 1;
  13098. * }
  13099. *
  13100. * function Bar() {
  13101. * this.c = 3;
  13102. * }
  13103. *
  13104. * Foo.prototype.b = 2;
  13105. * Bar.prototype.d = 4;
  13106. *
  13107. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13108. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13109. */
  13110. var assignIn = createAssigner(function(object, source) {
  13111. copyObject(source, keysIn(source), object);
  13112. });
  13113. /**
  13114. * This method is like `_.assignIn` except that it accepts `customizer`
  13115. * which is invoked to produce the assigned values. If `customizer` returns
  13116. * `undefined`, assignment is handled by the method instead. The `customizer`
  13117. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13118. *
  13119. * **Note:** This method mutates `object`.
  13120. *
  13121. * @static
  13122. * @memberOf _
  13123. * @since 4.0.0
  13124. * @alias extendWith
  13125. * @category Object
  13126. * @param {Object} object The destination object.
  13127. * @param {...Object} sources The source objects.
  13128. * @param {Function} [customizer] The function to customize assigned values.
  13129. * @returns {Object} Returns `object`.
  13130. * @see _.assignWith
  13131. * @example
  13132. *
  13133. * function customizer(objValue, srcValue) {
  13134. * return _.isUndefined(objValue) ? srcValue : objValue;
  13135. * }
  13136. *
  13137. * var defaults = _.partialRight(_.assignInWith, customizer);
  13138. *
  13139. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13140. * // => { 'a': 1, 'b': 2 }
  13141. */
  13142. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13143. copyObject(source, keysIn(source), object, customizer);
  13144. });
  13145. /**
  13146. * This method is like `_.assign` except that it accepts `customizer`
  13147. * which is invoked to produce the assigned values. If `customizer` returns
  13148. * `undefined`, assignment is handled by the method instead. The `customizer`
  13149. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13150. *
  13151. * **Note:** This method mutates `object`.
  13152. *
  13153. * @static
  13154. * @memberOf _
  13155. * @since 4.0.0
  13156. * @category Object
  13157. * @param {Object} object The destination object.
  13158. * @param {...Object} sources The source objects.
  13159. * @param {Function} [customizer] The function to customize assigned values.
  13160. * @returns {Object} Returns `object`.
  13161. * @see _.assignInWith
  13162. * @example
  13163. *
  13164. * function customizer(objValue, srcValue) {
  13165. * return _.isUndefined(objValue) ? srcValue : objValue;
  13166. * }
  13167. *
  13168. * var defaults = _.partialRight(_.assignWith, customizer);
  13169. *
  13170. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13171. * // => { 'a': 1, 'b': 2 }
  13172. */
  13173. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13174. copyObject(source, keys(source), object, customizer);
  13175. });
  13176. /**
  13177. * Creates an array of values corresponding to `paths` of `object`.
  13178. *
  13179. * @static
  13180. * @memberOf _
  13181. * @since 1.0.0
  13182. * @category Object
  13183. * @param {Object} object The object to iterate over.
  13184. * @param {...(string|string[])} [paths] The property paths to pick.
  13185. * @returns {Array} Returns the picked values.
  13186. * @example
  13187. *
  13188. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13189. *
  13190. * _.at(object, ['a[0].b.c', 'a[1]']);
  13191. * // => [3, 4]
  13192. */
  13193. var at = flatRest(baseAt);
  13194. /**
  13195. * Creates an object that inherits from the `prototype` object. If a
  13196. * `properties` object is given, its own enumerable string keyed properties
  13197. * are assigned to the created object.
  13198. *
  13199. * @static
  13200. * @memberOf _
  13201. * @since 2.3.0
  13202. * @category Object
  13203. * @param {Object} prototype The object to inherit from.
  13204. * @param {Object} [properties] The properties to assign to the object.
  13205. * @returns {Object} Returns the new object.
  13206. * @example
  13207. *
  13208. * function Shape() {
  13209. * this.x = 0;
  13210. * this.y = 0;
  13211. * }
  13212. *
  13213. * function Circle() {
  13214. * Shape.call(this);
  13215. * }
  13216. *
  13217. * Circle.prototype = _.create(Shape.prototype, {
  13218. * 'constructor': Circle
  13219. * });
  13220. *
  13221. * var circle = new Circle;
  13222. * circle instanceof Circle;
  13223. * // => true
  13224. *
  13225. * circle instanceof Shape;
  13226. * // => true
  13227. */
  13228. function create(prototype, properties) {
  13229. var result = baseCreate(prototype);
  13230. return properties == null ? result : baseAssign(result, properties);
  13231. }
  13232. /**
  13233. * Assigns own and inherited enumerable string keyed properties of source
  13234. * objects to the destination object for all destination properties that
  13235. * resolve to `undefined`. Source objects are applied from left to right.
  13236. * Once a property is set, additional values of the same property are ignored.
  13237. *
  13238. * **Note:** This method mutates `object`.
  13239. *
  13240. * @static
  13241. * @since 0.1.0
  13242. * @memberOf _
  13243. * @category Object
  13244. * @param {Object} object The destination object.
  13245. * @param {...Object} [sources] The source objects.
  13246. * @returns {Object} Returns `object`.
  13247. * @see _.defaultsDeep
  13248. * @example
  13249. *
  13250. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13251. * // => { 'a': 1, 'b': 2 }
  13252. */
  13253. var defaults = baseRest(function(object, sources) {
  13254. object = Object(object);
  13255. var index = -1;
  13256. var length = sources.length;
  13257. var guard = length > 2 ? sources[2] : undefined;
  13258. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13259. length = 1;
  13260. }
  13261. while (++index < length) {
  13262. var source = sources[index];
  13263. var props = keysIn(source);
  13264. var propsIndex = -1;
  13265. var propsLength = props.length;
  13266. while (++propsIndex < propsLength) {
  13267. var key = props[propsIndex];
  13268. var value = object[key];
  13269. if (value === undefined ||
  13270. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13271. object[key] = source[key];
  13272. }
  13273. }
  13274. }
  13275. return object;
  13276. });
  13277. /**
  13278. * This method is like `_.defaults` except that it recursively assigns
  13279. * default properties.
  13280. *
  13281. * **Note:** This method mutates `object`.
  13282. *
  13283. * @static
  13284. * @memberOf _
  13285. * @since 3.10.0
  13286. * @category Object
  13287. * @param {Object} object The destination object.
  13288. * @param {...Object} [sources] The source objects.
  13289. * @returns {Object} Returns `object`.
  13290. * @see _.defaults
  13291. * @example
  13292. *
  13293. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13294. * // => { 'a': { 'b': 2, 'c': 3 } }
  13295. */
  13296. var defaultsDeep = baseRest(function(args) {
  13297. args.push(undefined, customDefaultsMerge);
  13298. return apply(mergeWith, undefined, args);
  13299. });
  13300. /**
  13301. * This method is like `_.find` except that it returns the key of the first
  13302. * element `predicate` returns truthy for instead of the element itself.
  13303. *
  13304. * @static
  13305. * @memberOf _
  13306. * @since 1.1.0
  13307. * @category Object
  13308. * @param {Object} object The object to inspect.
  13309. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13310. * @returns {string|undefined} Returns the key of the matched element,
  13311. * else `undefined`.
  13312. * @example
  13313. *
  13314. * var users = {
  13315. * 'barney': { 'age': 36, 'active': true },
  13316. * 'fred': { 'age': 40, 'active': false },
  13317. * 'pebbles': { 'age': 1, 'active': true }
  13318. * };
  13319. *
  13320. * _.findKey(users, function(o) { return o.age < 40; });
  13321. * // => 'barney' (iteration order is not guaranteed)
  13322. *
  13323. * // The `_.matches` iteratee shorthand.
  13324. * _.findKey(users, { 'age': 1, 'active': true });
  13325. * // => 'pebbles'
  13326. *
  13327. * // The `_.matchesProperty` iteratee shorthand.
  13328. * _.findKey(users, ['active', false]);
  13329. * // => 'fred'
  13330. *
  13331. * // The `_.property` iteratee shorthand.
  13332. * _.findKey(users, 'active');
  13333. * // => 'barney'
  13334. */
  13335. function findKey(object, predicate) {
  13336. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13337. }
  13338. /**
  13339. * This method is like `_.findKey` except that it iterates over elements of
  13340. * a collection in the opposite order.
  13341. *
  13342. * @static
  13343. * @memberOf _
  13344. * @since 2.0.0
  13345. * @category Object
  13346. * @param {Object} object The object to inspect.
  13347. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13348. * @returns {string|undefined} Returns the key of the matched element,
  13349. * else `undefined`.
  13350. * @example
  13351. *
  13352. * var users = {
  13353. * 'barney': { 'age': 36, 'active': true },
  13354. * 'fred': { 'age': 40, 'active': false },
  13355. * 'pebbles': { 'age': 1, 'active': true }
  13356. * };
  13357. *
  13358. * _.findLastKey(users, function(o) { return o.age < 40; });
  13359. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13360. *
  13361. * // The `_.matches` iteratee shorthand.
  13362. * _.findLastKey(users, { 'age': 36, 'active': true });
  13363. * // => 'barney'
  13364. *
  13365. * // The `_.matchesProperty` iteratee shorthand.
  13366. * _.findLastKey(users, ['active', false]);
  13367. * // => 'fred'
  13368. *
  13369. * // The `_.property` iteratee shorthand.
  13370. * _.findLastKey(users, 'active');
  13371. * // => 'pebbles'
  13372. */
  13373. function findLastKey(object, predicate) {
  13374. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13375. }
  13376. /**
  13377. * Iterates over own and inherited enumerable string keyed properties of an
  13378. * object and invokes `iteratee` for each property. The iteratee is invoked
  13379. * with three arguments: (value, key, object). Iteratee functions may exit
  13380. * iteration early by explicitly returning `false`.
  13381. *
  13382. * @static
  13383. * @memberOf _
  13384. * @since 0.3.0
  13385. * @category Object
  13386. * @param {Object} object The object to iterate over.
  13387. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13388. * @returns {Object} Returns `object`.
  13389. * @see _.forInRight
  13390. * @example
  13391. *
  13392. * function Foo() {
  13393. * this.a = 1;
  13394. * this.b = 2;
  13395. * }
  13396. *
  13397. * Foo.prototype.c = 3;
  13398. *
  13399. * _.forIn(new Foo, function(value, key) {
  13400. * console.log(key);
  13401. * });
  13402. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13403. */
  13404. function forIn(object, iteratee) {
  13405. return object == null
  13406. ? object
  13407. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13408. }
  13409. /**
  13410. * This method is like `_.forIn` except that it iterates over properties of
  13411. * `object` in the opposite order.
  13412. *
  13413. * @static
  13414. * @memberOf _
  13415. * @since 2.0.0
  13416. * @category Object
  13417. * @param {Object} object The object to iterate over.
  13418. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13419. * @returns {Object} Returns `object`.
  13420. * @see _.forIn
  13421. * @example
  13422. *
  13423. * function Foo() {
  13424. * this.a = 1;
  13425. * this.b = 2;
  13426. * }
  13427. *
  13428. * Foo.prototype.c = 3;
  13429. *
  13430. * _.forInRight(new Foo, function(value, key) {
  13431. * console.log(key);
  13432. * });
  13433. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13434. */
  13435. function forInRight(object, iteratee) {
  13436. return object == null
  13437. ? object
  13438. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13439. }
  13440. /**
  13441. * Iterates over own enumerable string keyed properties of an object and
  13442. * invokes `iteratee` for each property. The iteratee is invoked with three
  13443. * arguments: (value, key, object). Iteratee functions may exit iteration
  13444. * early by explicitly returning `false`.
  13445. *
  13446. * @static
  13447. * @memberOf _
  13448. * @since 0.3.0
  13449. * @category Object
  13450. * @param {Object} object The object to iterate over.
  13451. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13452. * @returns {Object} Returns `object`.
  13453. * @see _.forOwnRight
  13454. * @example
  13455. *
  13456. * function Foo() {
  13457. * this.a = 1;
  13458. * this.b = 2;
  13459. * }
  13460. *
  13461. * Foo.prototype.c = 3;
  13462. *
  13463. * _.forOwn(new Foo, function(value, key) {
  13464. * console.log(key);
  13465. * });
  13466. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13467. */
  13468. function forOwn(object, iteratee) {
  13469. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13470. }
  13471. /**
  13472. * This method is like `_.forOwn` except that it iterates over properties of
  13473. * `object` in the opposite order.
  13474. *
  13475. * @static
  13476. * @memberOf _
  13477. * @since 2.0.0
  13478. * @category Object
  13479. * @param {Object} object The object to iterate over.
  13480. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13481. * @returns {Object} Returns `object`.
  13482. * @see _.forOwn
  13483. * @example
  13484. *
  13485. * function Foo() {
  13486. * this.a = 1;
  13487. * this.b = 2;
  13488. * }
  13489. *
  13490. * Foo.prototype.c = 3;
  13491. *
  13492. * _.forOwnRight(new Foo, function(value, key) {
  13493. * console.log(key);
  13494. * });
  13495. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13496. */
  13497. function forOwnRight(object, iteratee) {
  13498. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13499. }
  13500. /**
  13501. * Creates an array of function property names from own enumerable properties
  13502. * of `object`.
  13503. *
  13504. * @static
  13505. * @since 0.1.0
  13506. * @memberOf _
  13507. * @category Object
  13508. * @param {Object} object The object to inspect.
  13509. * @returns {Array} Returns the function names.
  13510. * @see _.functionsIn
  13511. * @example
  13512. *
  13513. * function Foo() {
  13514. * this.a = _.constant('a');
  13515. * this.b = _.constant('b');
  13516. * }
  13517. *
  13518. * Foo.prototype.c = _.constant('c');
  13519. *
  13520. * _.functions(new Foo);
  13521. * // => ['a', 'b']
  13522. */
  13523. function functions(object) {
  13524. return object == null ? [] : baseFunctions(object, keys(object));
  13525. }
  13526. /**
  13527. * Creates an array of function property names from own and inherited
  13528. * enumerable properties of `object`.
  13529. *
  13530. * @static
  13531. * @memberOf _
  13532. * @since 4.0.0
  13533. * @category Object
  13534. * @param {Object} object The object to inspect.
  13535. * @returns {Array} Returns the function names.
  13536. * @see _.functions
  13537. * @example
  13538. *
  13539. * function Foo() {
  13540. * this.a = _.constant('a');
  13541. * this.b = _.constant('b');
  13542. * }
  13543. *
  13544. * Foo.prototype.c = _.constant('c');
  13545. *
  13546. * _.functionsIn(new Foo);
  13547. * // => ['a', 'b', 'c']
  13548. */
  13549. function functionsIn(object) {
  13550. return object == null ? [] : baseFunctions(object, keysIn(object));
  13551. }
  13552. /**
  13553. * Gets the value at `path` of `object`. If the resolved value is
  13554. * `undefined`, the `defaultValue` is returned in its place.
  13555. *
  13556. * @static
  13557. * @memberOf _
  13558. * @since 3.7.0
  13559. * @category Object
  13560. * @param {Object} object The object to query.
  13561. * @param {Array|string} path The path of the property to get.
  13562. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13563. * @returns {*} Returns the resolved value.
  13564. * @example
  13565. *
  13566. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13567. *
  13568. * _.get(object, 'a[0].b.c');
  13569. * // => 3
  13570. *
  13571. * _.get(object, ['a', '0', 'b', 'c']);
  13572. * // => 3
  13573. *
  13574. * _.get(object, 'a.b.c', 'default');
  13575. * // => 'default'
  13576. */
  13577. function get(object, path, defaultValue) {
  13578. var result = object == null ? undefined : baseGet(object, path);
  13579. return result === undefined ? defaultValue : result;
  13580. }
  13581. /**
  13582. * Checks if `path` is a direct property of `object`.
  13583. *
  13584. * @static
  13585. * @since 0.1.0
  13586. * @memberOf _
  13587. * @category Object
  13588. * @param {Object} object The object to query.
  13589. * @param {Array|string} path The path to check.
  13590. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13591. * @example
  13592. *
  13593. * var object = { 'a': { 'b': 2 } };
  13594. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13595. *
  13596. * _.has(object, 'a');
  13597. * // => true
  13598. *
  13599. * _.has(object, 'a.b');
  13600. * // => true
  13601. *
  13602. * _.has(object, ['a', 'b']);
  13603. * // => true
  13604. *
  13605. * _.has(other, 'a');
  13606. * // => false
  13607. */
  13608. function has(object, path) {
  13609. return object != null && hasPath(object, path, baseHas);
  13610. }
  13611. /**
  13612. * Checks if `path` is a direct or inherited property of `object`.
  13613. *
  13614. * @static
  13615. * @memberOf _
  13616. * @since 4.0.0
  13617. * @category Object
  13618. * @param {Object} object The object to query.
  13619. * @param {Array|string} path The path to check.
  13620. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13621. * @example
  13622. *
  13623. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13624. *
  13625. * _.hasIn(object, 'a');
  13626. * // => true
  13627. *
  13628. * _.hasIn(object, 'a.b');
  13629. * // => true
  13630. *
  13631. * _.hasIn(object, ['a', 'b']);
  13632. * // => true
  13633. *
  13634. * _.hasIn(object, 'b');
  13635. * // => false
  13636. */
  13637. function hasIn(object, path) {
  13638. return object != null && hasPath(object, path, baseHasIn);
  13639. }
  13640. /**
  13641. * Creates an object composed of the inverted keys and values of `object`.
  13642. * If `object` contains duplicate values, subsequent values overwrite
  13643. * property assignments of previous values.
  13644. *
  13645. * @static
  13646. * @memberOf _
  13647. * @since 0.7.0
  13648. * @category Object
  13649. * @param {Object} object The object to invert.
  13650. * @returns {Object} Returns the new inverted object.
  13651. * @example
  13652. *
  13653. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13654. *
  13655. * _.invert(object);
  13656. * // => { '1': 'c', '2': 'b' }
  13657. */
  13658. var invert = createInverter(function(result, value, key) {
  13659. if (value != null &&
  13660. typeof value.toString != 'function') {
  13661. value = nativeObjectToString.call(value);
  13662. }
  13663. result[value] = key;
  13664. }, constant(identity));
  13665. /**
  13666. * This method is like `_.invert` except that the inverted object is generated
  13667. * from the results of running each element of `object` thru `iteratee`. The
  13668. * corresponding inverted value of each inverted key is an array of keys
  13669. * responsible for generating the inverted value. The iteratee is invoked
  13670. * with one argument: (value).
  13671. *
  13672. * @static
  13673. * @memberOf _
  13674. * @since 4.1.0
  13675. * @category Object
  13676. * @param {Object} object The object to invert.
  13677. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13678. * @returns {Object} Returns the new inverted object.
  13679. * @example
  13680. *
  13681. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13682. *
  13683. * _.invertBy(object);
  13684. * // => { '1': ['a', 'c'], '2': ['b'] }
  13685. *
  13686. * _.invertBy(object, function(value) {
  13687. * return 'group' + value;
  13688. * });
  13689. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13690. */
  13691. var invertBy = createInverter(function(result, value, key) {
  13692. if (value != null &&
  13693. typeof value.toString != 'function') {
  13694. value = nativeObjectToString.call(value);
  13695. }
  13696. if (hasOwnProperty.call(result, value)) {
  13697. result[value].push(key);
  13698. } else {
  13699. result[value] = [key];
  13700. }
  13701. }, getIteratee);
  13702. /**
  13703. * Invokes the method at `path` of `object`.
  13704. *
  13705. * @static
  13706. * @memberOf _
  13707. * @since 4.0.0
  13708. * @category Object
  13709. * @param {Object} object The object to query.
  13710. * @param {Array|string} path The path of the method to invoke.
  13711. * @param {...*} [args] The arguments to invoke the method with.
  13712. * @returns {*} Returns the result of the invoked method.
  13713. * @example
  13714. *
  13715. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13716. *
  13717. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13718. * // => [2, 3]
  13719. */
  13720. var invoke = baseRest(baseInvoke);
  13721. /**
  13722. * Creates an array of the own enumerable property names of `object`.
  13723. *
  13724. * **Note:** Non-object values are coerced to objects. See the
  13725. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13726. * for more details.
  13727. *
  13728. * @static
  13729. * @since 0.1.0
  13730. * @memberOf _
  13731. * @category Object
  13732. * @param {Object} object The object to query.
  13733. * @returns {Array} Returns the array of property names.
  13734. * @example
  13735. *
  13736. * function Foo() {
  13737. * this.a = 1;
  13738. * this.b = 2;
  13739. * }
  13740. *
  13741. * Foo.prototype.c = 3;
  13742. *
  13743. * _.keys(new Foo);
  13744. * // => ['a', 'b'] (iteration order is not guaranteed)
  13745. *
  13746. * _.keys('hi');
  13747. * // => ['0', '1']
  13748. */
  13749. function keys(object) {
  13750. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13751. }
  13752. /**
  13753. * Creates an array of the own and inherited enumerable property names of `object`.
  13754. *
  13755. * **Note:** Non-object values are coerced to objects.
  13756. *
  13757. * @static
  13758. * @memberOf _
  13759. * @since 3.0.0
  13760. * @category Object
  13761. * @param {Object} object The object to query.
  13762. * @returns {Array} Returns the array of property names.
  13763. * @example
  13764. *
  13765. * function Foo() {
  13766. * this.a = 1;
  13767. * this.b = 2;
  13768. * }
  13769. *
  13770. * Foo.prototype.c = 3;
  13771. *
  13772. * _.keysIn(new Foo);
  13773. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13774. */
  13775. function keysIn(object) {
  13776. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13777. }
  13778. /**
  13779. * The opposite of `_.mapValues`; this method creates an object with the
  13780. * same values as `object` and keys generated by running each own enumerable
  13781. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13782. * with three arguments: (value, key, object).
  13783. *
  13784. * @static
  13785. * @memberOf _
  13786. * @since 3.8.0
  13787. * @category Object
  13788. * @param {Object} object The object to iterate over.
  13789. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13790. * @returns {Object} Returns the new mapped object.
  13791. * @see _.mapValues
  13792. * @example
  13793. *
  13794. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13795. * return key + value;
  13796. * });
  13797. * // => { 'a1': 1, 'b2': 2 }
  13798. */
  13799. function mapKeys(object, iteratee) {
  13800. var result = {};
  13801. iteratee = getIteratee(iteratee, 3);
  13802. baseForOwn(object, function(value, key, object) {
  13803. baseAssignValue(result, iteratee(value, key, object), value);
  13804. });
  13805. return result;
  13806. }
  13807. /**
  13808. * Creates an object with the same keys as `object` and values generated
  13809. * by running each own enumerable string keyed property of `object` thru
  13810. * `iteratee`. The iteratee is invoked with three arguments:
  13811. * (value, key, object).
  13812. *
  13813. * @static
  13814. * @memberOf _
  13815. * @since 2.4.0
  13816. * @category Object
  13817. * @param {Object} object The object to iterate over.
  13818. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13819. * @returns {Object} Returns the new mapped object.
  13820. * @see _.mapKeys
  13821. * @example
  13822. *
  13823. * var users = {
  13824. * 'fred': { 'user': 'fred', 'age': 40 },
  13825. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13826. * };
  13827. *
  13828. * _.mapValues(users, function(o) { return o.age; });
  13829. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13830. *
  13831. * // The `_.property` iteratee shorthand.
  13832. * _.mapValues(users, 'age');
  13833. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13834. */
  13835. function mapValues(object, iteratee) {
  13836. var result = {};
  13837. iteratee = getIteratee(iteratee, 3);
  13838. baseForOwn(object, function(value, key, object) {
  13839. baseAssignValue(result, key, iteratee(value, key, object));
  13840. });
  13841. return result;
  13842. }
  13843. /**
  13844. * This method is like `_.assign` except that it recursively merges own and
  13845. * inherited enumerable string keyed properties of source objects into the
  13846. * destination object. Source properties that resolve to `undefined` are
  13847. * skipped if a destination value exists. Array and plain object properties
  13848. * are merged recursively. Other objects and value types are overridden by
  13849. * assignment. Source objects are applied from left to right. Subsequent
  13850. * sources overwrite property assignments of previous sources.
  13851. *
  13852. * **Note:** This method mutates `object`.
  13853. *
  13854. * @static
  13855. * @memberOf _
  13856. * @since 0.5.0
  13857. * @category Object
  13858. * @param {Object} object The destination object.
  13859. * @param {...Object} [sources] The source objects.
  13860. * @returns {Object} Returns `object`.
  13861. * @example
  13862. *
  13863. * var object = {
  13864. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13865. * };
  13866. *
  13867. * var other = {
  13868. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13869. * };
  13870. *
  13871. * _.merge(object, other);
  13872. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13873. */
  13874. var merge = createAssigner(function(object, source, srcIndex) {
  13875. baseMerge(object, source, srcIndex);
  13876. });
  13877. /**
  13878. * This method is like `_.merge` except that it accepts `customizer` which
  13879. * is invoked to produce the merged values of the destination and source
  13880. * properties. If `customizer` returns `undefined`, merging is handled by the
  13881. * method instead. The `customizer` is invoked with six arguments:
  13882. * (objValue, srcValue, key, object, source, stack).
  13883. *
  13884. * **Note:** This method mutates `object`.
  13885. *
  13886. * @static
  13887. * @memberOf _
  13888. * @since 4.0.0
  13889. * @category Object
  13890. * @param {Object} object The destination object.
  13891. * @param {...Object} sources The source objects.
  13892. * @param {Function} customizer The function to customize assigned values.
  13893. * @returns {Object} Returns `object`.
  13894. * @example
  13895. *
  13896. * function customizer(objValue, srcValue) {
  13897. * if (_.isArray(objValue)) {
  13898. * return objValue.concat(srcValue);
  13899. * }
  13900. * }
  13901. *
  13902. * var object = { 'a': [1], 'b': [2] };
  13903. * var other = { 'a': [3], 'b': [4] };
  13904. *
  13905. * _.mergeWith(object, other, customizer);
  13906. * // => { 'a': [1, 3], 'b': [2, 4] }
  13907. */
  13908. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13909. baseMerge(object, source, srcIndex, customizer);
  13910. });
  13911. /**
  13912. * The opposite of `_.pick`; this method creates an object composed of the
  13913. * own and inherited enumerable property paths of `object` that are not omitted.
  13914. *
  13915. * **Note:** This method is considerably slower than `_.pick`.
  13916. *
  13917. * @static
  13918. * @since 0.1.0
  13919. * @memberOf _
  13920. * @category Object
  13921. * @param {Object} object The source object.
  13922. * @param {...(string|string[])} [paths] The property paths to omit.
  13923. * @returns {Object} Returns the new object.
  13924. * @example
  13925. *
  13926. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13927. *
  13928. * _.omit(object, ['a', 'c']);
  13929. * // => { 'b': '2' }
  13930. */
  13931. var omit = flatRest(function(object, paths) {
  13932. var result = {};
  13933. if (object == null) {
  13934. return result;
  13935. }
  13936. var isDeep = false;
  13937. paths = arrayMap(paths, function(path) {
  13938. path = castPath(path, object);
  13939. isDeep || (isDeep = path.length > 1);
  13940. return path;
  13941. });
  13942. copyObject(object, getAllKeysIn(object), result);
  13943. if (isDeep) {
  13944. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13945. }
  13946. var length = paths.length;
  13947. while (length--) {
  13948. baseUnset(result, paths[length]);
  13949. }
  13950. return result;
  13951. });
  13952. /**
  13953. * The opposite of `_.pickBy`; this method creates an object composed of
  13954. * the own and inherited enumerable string keyed properties of `object` that
  13955. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13956. * arguments: (value, key).
  13957. *
  13958. * @static
  13959. * @memberOf _
  13960. * @since 4.0.0
  13961. * @category Object
  13962. * @param {Object} object The source object.
  13963. * @param {Function} [predicate=_.identity] The function invoked per property.
  13964. * @returns {Object} Returns the new object.
  13965. * @example
  13966. *
  13967. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13968. *
  13969. * _.omitBy(object, _.isNumber);
  13970. * // => { 'b': '2' }
  13971. */
  13972. function omitBy(object, predicate) {
  13973. return pickBy(object, negate(getIteratee(predicate)));
  13974. }
  13975. /**
  13976. * Creates an object composed of the picked `object` properties.
  13977. *
  13978. * @static
  13979. * @since 0.1.0
  13980. * @memberOf _
  13981. * @category Object
  13982. * @param {Object} object The source object.
  13983. * @param {...(string|string[])} [paths] The property paths to pick.
  13984. * @returns {Object} Returns the new object.
  13985. * @example
  13986. *
  13987. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13988. *
  13989. * _.pick(object, ['a', 'c']);
  13990. * // => { 'a': 1, 'c': 3 }
  13991. */
  13992. var pick = flatRest(function(object, paths) {
  13993. return object == null ? {} : basePick(object, paths);
  13994. });
  13995. /**
  13996. * Creates an object composed of the `object` properties `predicate` returns
  13997. * truthy for. The predicate is invoked with two arguments: (value, key).
  13998. *
  13999. * @static
  14000. * @memberOf _
  14001. * @since 4.0.0
  14002. * @category Object
  14003. * @param {Object} object The source object.
  14004. * @param {Function} [predicate=_.identity] The function invoked per property.
  14005. * @returns {Object} Returns the new object.
  14006. * @example
  14007. *
  14008. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14009. *
  14010. * _.pickBy(object, _.isNumber);
  14011. * // => { 'a': 1, 'c': 3 }
  14012. */
  14013. function pickBy(object, predicate) {
  14014. if (object == null) {
  14015. return {};
  14016. }
  14017. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14018. return [prop];
  14019. });
  14020. predicate = getIteratee(predicate);
  14021. return basePickBy(object, props, function(value, path) {
  14022. return predicate(value, path[0]);
  14023. });
  14024. }
  14025. /**
  14026. * This method is like `_.get` except that if the resolved value is a
  14027. * function it's invoked with the `this` binding of its parent object and
  14028. * its result is returned.
  14029. *
  14030. * @static
  14031. * @since 0.1.0
  14032. * @memberOf _
  14033. * @category Object
  14034. * @param {Object} object The object to query.
  14035. * @param {Array|string} path The path of the property to resolve.
  14036. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14037. * @returns {*} Returns the resolved value.
  14038. * @example
  14039. *
  14040. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14041. *
  14042. * _.result(object, 'a[0].b.c1');
  14043. * // => 3
  14044. *
  14045. * _.result(object, 'a[0].b.c2');
  14046. * // => 4
  14047. *
  14048. * _.result(object, 'a[0].b.c3', 'default');
  14049. * // => 'default'
  14050. *
  14051. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14052. * // => 'default'
  14053. */
  14054. function result(object, path, defaultValue) {
  14055. path = castPath(path, object);
  14056. var index = -1,
  14057. length = path.length;
  14058. // Ensure the loop is entered when path is empty.
  14059. if (!length) {
  14060. length = 1;
  14061. object = undefined;
  14062. }
  14063. while (++index < length) {
  14064. var value = object == null ? undefined : object[toKey(path[index])];
  14065. if (value === undefined) {
  14066. index = length;
  14067. value = defaultValue;
  14068. }
  14069. object = isFunction(value) ? value.call(object) : value;
  14070. }
  14071. return object;
  14072. }
  14073. /**
  14074. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14075. * it's created. Arrays are created for missing index properties while objects
  14076. * are created for all other missing properties. Use `_.setWith` to customize
  14077. * `path` creation.
  14078. *
  14079. * **Note:** This method mutates `object`.
  14080. *
  14081. * @static
  14082. * @memberOf _
  14083. * @since 3.7.0
  14084. * @category Object
  14085. * @param {Object} object The object to modify.
  14086. * @param {Array|string} path The path of the property to set.
  14087. * @param {*} value The value to set.
  14088. * @returns {Object} Returns `object`.
  14089. * @example
  14090. *
  14091. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14092. *
  14093. * _.set(object, 'a[0].b.c', 4);
  14094. * console.log(object.a[0].b.c);
  14095. * // => 4
  14096. *
  14097. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14098. * console.log(object.x[0].y.z);
  14099. * // => 5
  14100. */
  14101. function set(object, path, value) {
  14102. return object == null ? object : baseSet(object, path, value);
  14103. }
  14104. /**
  14105. * This method is like `_.set` except that it accepts `customizer` which is
  14106. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14107. * path creation is handled by the method instead. The `customizer` is invoked
  14108. * with three arguments: (nsValue, key, nsObject).
  14109. *
  14110. * **Note:** This method mutates `object`.
  14111. *
  14112. * @static
  14113. * @memberOf _
  14114. * @since 4.0.0
  14115. * @category Object
  14116. * @param {Object} object The object to modify.
  14117. * @param {Array|string} path The path of the property to set.
  14118. * @param {*} value The value to set.
  14119. * @param {Function} [customizer] The function to customize assigned values.
  14120. * @returns {Object} Returns `object`.
  14121. * @example
  14122. *
  14123. * var object = {};
  14124. *
  14125. * _.setWith(object, '[0][1]', 'a', Object);
  14126. * // => { '0': { '1': 'a' } }
  14127. */
  14128. function setWith(object, path, value, customizer) {
  14129. customizer = typeof customizer == 'function' ? customizer : undefined;
  14130. return object == null ? object : baseSet(object, path, value, customizer);
  14131. }
  14132. /**
  14133. * Creates an array of own enumerable string keyed-value pairs for `object`
  14134. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14135. * entries are returned.
  14136. *
  14137. * @static
  14138. * @memberOf _
  14139. * @since 4.0.0
  14140. * @alias entries
  14141. * @category Object
  14142. * @param {Object} object The object to query.
  14143. * @returns {Array} Returns the key-value pairs.
  14144. * @example
  14145. *
  14146. * function Foo() {
  14147. * this.a = 1;
  14148. * this.b = 2;
  14149. * }
  14150. *
  14151. * Foo.prototype.c = 3;
  14152. *
  14153. * _.toPairs(new Foo);
  14154. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14155. */
  14156. var toPairs = createToPairs(keys);
  14157. /**
  14158. * Creates an array of own and inherited enumerable string keyed-value pairs
  14159. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14160. * or set, its entries are returned.
  14161. *
  14162. * @static
  14163. * @memberOf _
  14164. * @since 4.0.0
  14165. * @alias entriesIn
  14166. * @category Object
  14167. * @param {Object} object The object to query.
  14168. * @returns {Array} Returns the key-value pairs.
  14169. * @example
  14170. *
  14171. * function Foo() {
  14172. * this.a = 1;
  14173. * this.b = 2;
  14174. * }
  14175. *
  14176. * Foo.prototype.c = 3;
  14177. *
  14178. * _.toPairsIn(new Foo);
  14179. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14180. */
  14181. var toPairsIn = createToPairs(keysIn);
  14182. /**
  14183. * An alternative to `_.reduce`; this method transforms `object` to a new
  14184. * `accumulator` object which is the result of running each of its own
  14185. * enumerable string keyed properties thru `iteratee`, with each invocation
  14186. * potentially mutating the `accumulator` object. If `accumulator` is not
  14187. * provided, a new object with the same `[[Prototype]]` will be used. The
  14188. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14189. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14190. *
  14191. * @static
  14192. * @memberOf _
  14193. * @since 1.3.0
  14194. * @category Object
  14195. * @param {Object} object The object to iterate over.
  14196. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14197. * @param {*} [accumulator] The custom accumulator value.
  14198. * @returns {*} Returns the accumulated value.
  14199. * @example
  14200. *
  14201. * _.transform([2, 3, 4], function(result, n) {
  14202. * result.push(n *= n);
  14203. * return n % 2 == 0;
  14204. * }, []);
  14205. * // => [4, 9]
  14206. *
  14207. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14208. * (result[value] || (result[value] = [])).push(key);
  14209. * }, {});
  14210. * // => { '1': ['a', 'c'], '2': ['b'] }
  14211. */
  14212. function transform(object, iteratee, accumulator) {
  14213. var isArr = isArray(object),
  14214. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14215. iteratee = getIteratee(iteratee, 4);
  14216. if (accumulator == null) {
  14217. var Ctor = object && object.constructor;
  14218. if (isArrLike) {
  14219. accumulator = isArr ? new Ctor : [];
  14220. }
  14221. else if (isObject(object)) {
  14222. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14223. }
  14224. else {
  14225. accumulator = {};
  14226. }
  14227. }
  14228. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14229. return iteratee(accumulator, value, index, object);
  14230. });
  14231. return accumulator;
  14232. }
  14233. /**
  14234. * Removes the property at `path` of `object`.
  14235. *
  14236. * **Note:** This method mutates `object`.
  14237. *
  14238. * @static
  14239. * @memberOf _
  14240. * @since 4.0.0
  14241. * @category Object
  14242. * @param {Object} object The object to modify.
  14243. * @param {Array|string} path The path of the property to unset.
  14244. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14245. * @example
  14246. *
  14247. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14248. * _.unset(object, 'a[0].b.c');
  14249. * // => true
  14250. *
  14251. * console.log(object);
  14252. * // => { 'a': [{ 'b': {} }] };
  14253. *
  14254. * _.unset(object, ['a', '0', 'b', 'c']);
  14255. * // => true
  14256. *
  14257. * console.log(object);
  14258. * // => { 'a': [{ 'b': {} }] };
  14259. */
  14260. function unset(object, path) {
  14261. return object == null ? true : baseUnset(object, path);
  14262. }
  14263. /**
  14264. * This method is like `_.set` except that accepts `updater` to produce the
  14265. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14266. * is invoked with one argument: (value).
  14267. *
  14268. * **Note:** This method mutates `object`.
  14269. *
  14270. * @static
  14271. * @memberOf _
  14272. * @since 4.6.0
  14273. * @category Object
  14274. * @param {Object} object The object to modify.
  14275. * @param {Array|string} path The path of the property to set.
  14276. * @param {Function} updater The function to produce the updated value.
  14277. * @returns {Object} Returns `object`.
  14278. * @example
  14279. *
  14280. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14281. *
  14282. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14283. * console.log(object.a[0].b.c);
  14284. * // => 9
  14285. *
  14286. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14287. * console.log(object.x[0].y.z);
  14288. * // => 0
  14289. */
  14290. function update(object, path, updater) {
  14291. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14292. }
  14293. /**
  14294. * This method is like `_.update` except that it accepts `customizer` which is
  14295. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14296. * path creation is handled by the method instead. The `customizer` is invoked
  14297. * with three arguments: (nsValue, key, nsObject).
  14298. *
  14299. * **Note:** This method mutates `object`.
  14300. *
  14301. * @static
  14302. * @memberOf _
  14303. * @since 4.6.0
  14304. * @category Object
  14305. * @param {Object} object The object to modify.
  14306. * @param {Array|string} path The path of the property to set.
  14307. * @param {Function} updater The function to produce the updated value.
  14308. * @param {Function} [customizer] The function to customize assigned values.
  14309. * @returns {Object} Returns `object`.
  14310. * @example
  14311. *
  14312. * var object = {};
  14313. *
  14314. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14315. * // => { '0': { '1': 'a' } }
  14316. */
  14317. function updateWith(object, path, updater, customizer) {
  14318. customizer = typeof customizer == 'function' ? customizer : undefined;
  14319. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14320. }
  14321. /**
  14322. * Creates an array of the own enumerable string keyed property values of `object`.
  14323. *
  14324. * **Note:** Non-object values are coerced to objects.
  14325. *
  14326. * @static
  14327. * @since 0.1.0
  14328. * @memberOf _
  14329. * @category Object
  14330. * @param {Object} object The object to query.
  14331. * @returns {Array} Returns the array of property values.
  14332. * @example
  14333. *
  14334. * function Foo() {
  14335. * this.a = 1;
  14336. * this.b = 2;
  14337. * }
  14338. *
  14339. * Foo.prototype.c = 3;
  14340. *
  14341. * _.values(new Foo);
  14342. * // => [1, 2] (iteration order is not guaranteed)
  14343. *
  14344. * _.values('hi');
  14345. * // => ['h', 'i']
  14346. */
  14347. function values(object) {
  14348. return object == null ? [] : baseValues(object, keys(object));
  14349. }
  14350. /**
  14351. * Creates an array of the own and inherited enumerable string keyed property
  14352. * values of `object`.
  14353. *
  14354. * **Note:** Non-object values are coerced to objects.
  14355. *
  14356. * @static
  14357. * @memberOf _
  14358. * @since 3.0.0
  14359. * @category Object
  14360. * @param {Object} object The object to query.
  14361. * @returns {Array} Returns the array of property values.
  14362. * @example
  14363. *
  14364. * function Foo() {
  14365. * this.a = 1;
  14366. * this.b = 2;
  14367. * }
  14368. *
  14369. * Foo.prototype.c = 3;
  14370. *
  14371. * _.valuesIn(new Foo);
  14372. * // => [1, 2, 3] (iteration order is not guaranteed)
  14373. */
  14374. function valuesIn(object) {
  14375. return object == null ? [] : baseValues(object, keysIn(object));
  14376. }
  14377. /*------------------------------------------------------------------------*/
  14378. /**
  14379. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14380. *
  14381. * @static
  14382. * @memberOf _
  14383. * @since 4.0.0
  14384. * @category Number
  14385. * @param {number} number The number to clamp.
  14386. * @param {number} [lower] The lower bound.
  14387. * @param {number} upper The upper bound.
  14388. * @returns {number} Returns the clamped number.
  14389. * @example
  14390. *
  14391. * _.clamp(-10, -5, 5);
  14392. * // => -5
  14393. *
  14394. * _.clamp(10, -5, 5);
  14395. * // => 5
  14396. */
  14397. function clamp(number, lower, upper) {
  14398. if (upper === undefined) {
  14399. upper = lower;
  14400. lower = undefined;
  14401. }
  14402. if (upper !== undefined) {
  14403. upper = toNumber(upper);
  14404. upper = upper === upper ? upper : 0;
  14405. }
  14406. if (lower !== undefined) {
  14407. lower = toNumber(lower);
  14408. lower = lower === lower ? lower : 0;
  14409. }
  14410. return baseClamp(toNumber(number), lower, upper);
  14411. }
  14412. /**
  14413. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14414. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14415. * If `start` is greater than `end` the params are swapped to support
  14416. * negative ranges.
  14417. *
  14418. * @static
  14419. * @memberOf _
  14420. * @since 3.3.0
  14421. * @category Number
  14422. * @param {number} number The number to check.
  14423. * @param {number} [start=0] The start of the range.
  14424. * @param {number} end The end of the range.
  14425. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14426. * @see _.range, _.rangeRight
  14427. * @example
  14428. *
  14429. * _.inRange(3, 2, 4);
  14430. * // => true
  14431. *
  14432. * _.inRange(4, 8);
  14433. * // => true
  14434. *
  14435. * _.inRange(4, 2);
  14436. * // => false
  14437. *
  14438. * _.inRange(2, 2);
  14439. * // => false
  14440. *
  14441. * _.inRange(1.2, 2);
  14442. * // => true
  14443. *
  14444. * _.inRange(5.2, 4);
  14445. * // => false
  14446. *
  14447. * _.inRange(-3, -2, -6);
  14448. * // => true
  14449. */
  14450. function inRange(number, start, end) {
  14451. start = toFinite(start);
  14452. if (end === undefined) {
  14453. end = start;
  14454. start = 0;
  14455. } else {
  14456. end = toFinite(end);
  14457. }
  14458. number = toNumber(number);
  14459. return baseInRange(number, start, end);
  14460. }
  14461. /**
  14462. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14463. * If only one argument is provided a number between `0` and the given number
  14464. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14465. * floats, a floating-point number is returned instead of an integer.
  14466. *
  14467. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14468. * floating-point values which can produce unexpected results.
  14469. *
  14470. * @static
  14471. * @memberOf _
  14472. * @since 0.7.0
  14473. * @category Number
  14474. * @param {number} [lower=0] The lower bound.
  14475. * @param {number} [upper=1] The upper bound.
  14476. * @param {boolean} [floating] Specify returning a floating-point number.
  14477. * @returns {number} Returns the random number.
  14478. * @example
  14479. *
  14480. * _.random(0, 5);
  14481. * // => an integer between 0 and 5
  14482. *
  14483. * _.random(5);
  14484. * // => also an integer between 0 and 5
  14485. *
  14486. * _.random(5, true);
  14487. * // => a floating-point number between 0 and 5
  14488. *
  14489. * _.random(1.2, 5.2);
  14490. * // => a floating-point number between 1.2 and 5.2
  14491. */
  14492. function random(lower, upper, floating) {
  14493. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14494. upper = floating = undefined;
  14495. }
  14496. if (floating === undefined) {
  14497. if (typeof upper == 'boolean') {
  14498. floating = upper;
  14499. upper = undefined;
  14500. }
  14501. else if (typeof lower == 'boolean') {
  14502. floating = lower;
  14503. lower = undefined;
  14504. }
  14505. }
  14506. if (lower === undefined && upper === undefined) {
  14507. lower = 0;
  14508. upper = 1;
  14509. }
  14510. else {
  14511. lower = toFinite(lower);
  14512. if (upper === undefined) {
  14513. upper = lower;
  14514. lower = 0;
  14515. } else {
  14516. upper = toFinite(upper);
  14517. }
  14518. }
  14519. if (lower > upper) {
  14520. var temp = lower;
  14521. lower = upper;
  14522. upper = temp;
  14523. }
  14524. if (floating || lower % 1 || upper % 1) {
  14525. var rand = nativeRandom();
  14526. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14527. }
  14528. return baseRandom(lower, upper);
  14529. }
  14530. /*------------------------------------------------------------------------*/
  14531. /**
  14532. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14533. *
  14534. * @static
  14535. * @memberOf _
  14536. * @since 3.0.0
  14537. * @category String
  14538. * @param {string} [string=''] The string to convert.
  14539. * @returns {string} Returns the camel cased string.
  14540. * @example
  14541. *
  14542. * _.camelCase('Foo Bar');
  14543. * // => 'fooBar'
  14544. *
  14545. * _.camelCase('--foo-bar--');
  14546. * // => 'fooBar'
  14547. *
  14548. * _.camelCase('__FOO_BAR__');
  14549. * // => 'fooBar'
  14550. */
  14551. var camelCase = createCompounder(function(result, word, index) {
  14552. word = word.toLowerCase();
  14553. return result + (index ? capitalize(word) : word);
  14554. });
  14555. /**
  14556. * Converts the first character of `string` to upper case and the remaining
  14557. * to lower case.
  14558. *
  14559. * @static
  14560. * @memberOf _
  14561. * @since 3.0.0
  14562. * @category String
  14563. * @param {string} [string=''] The string to capitalize.
  14564. * @returns {string} Returns the capitalized string.
  14565. * @example
  14566. *
  14567. * _.capitalize('FRED');
  14568. * // => 'Fred'
  14569. */
  14570. function capitalize(string) {
  14571. return upperFirst(toString(string).toLowerCase());
  14572. }
  14573. /**
  14574. * Deburrs `string` by converting
  14575. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14576. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14577. * letters to basic Latin letters and removing
  14578. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14579. *
  14580. * @static
  14581. * @memberOf _
  14582. * @since 3.0.0
  14583. * @category String
  14584. * @param {string} [string=''] The string to deburr.
  14585. * @returns {string} Returns the deburred string.
  14586. * @example
  14587. *
  14588. * _.deburr('déjà vu');
  14589. * // => 'deja vu'
  14590. */
  14591. function deburr(string) {
  14592. string = toString(string);
  14593. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14594. }
  14595. /**
  14596. * Checks if `string` ends with the given target string.
  14597. *
  14598. * @static
  14599. * @memberOf _
  14600. * @since 3.0.0
  14601. * @category String
  14602. * @param {string} [string=''] The string to inspect.
  14603. * @param {string} [target] The string to search for.
  14604. * @param {number} [position=string.length] The position to search up to.
  14605. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14606. * else `false`.
  14607. * @example
  14608. *
  14609. * _.endsWith('abc', 'c');
  14610. * // => true
  14611. *
  14612. * _.endsWith('abc', 'b');
  14613. * // => false
  14614. *
  14615. * _.endsWith('abc', 'b', 2);
  14616. * // => true
  14617. */
  14618. function endsWith(string, target, position) {
  14619. string = toString(string);
  14620. target = baseToString(target);
  14621. var length = string.length;
  14622. position = position === undefined
  14623. ? length
  14624. : baseClamp(toInteger(position), 0, length);
  14625. var end = position;
  14626. position -= target.length;
  14627. return position >= 0 && string.slice(position, end) == target;
  14628. }
  14629. /**
  14630. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14631. * corresponding HTML entities.
  14632. *
  14633. * **Note:** No other characters are escaped. To escape additional
  14634. * characters use a third-party library like [_he_](https://mths.be/he).
  14635. *
  14636. * Though the ">" character is escaped for symmetry, characters like
  14637. * ">" and "/" don't need escaping in HTML and have no special meaning
  14638. * unless they're part of a tag or unquoted attribute value. See
  14639. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14640. * (under "semi-related fun fact") for more details.
  14641. *
  14642. * When working with HTML you should always
  14643. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14644. * XSS vectors.
  14645. *
  14646. * @static
  14647. * @since 0.1.0
  14648. * @memberOf _
  14649. * @category String
  14650. * @param {string} [string=''] The string to escape.
  14651. * @returns {string} Returns the escaped string.
  14652. * @example
  14653. *
  14654. * _.escape('fred, barney, & pebbles');
  14655. * // => 'fred, barney, &amp; pebbles'
  14656. */
  14657. function escape(string) {
  14658. string = toString(string);
  14659. return (string && reHasUnescapedHtml.test(string))
  14660. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14661. : string;
  14662. }
  14663. /**
  14664. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14665. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14666. *
  14667. * @static
  14668. * @memberOf _
  14669. * @since 3.0.0
  14670. * @category String
  14671. * @param {string} [string=''] The string to escape.
  14672. * @returns {string} Returns the escaped string.
  14673. * @example
  14674. *
  14675. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14676. * // => '\[lodash\]\(https://lodash\.com/\)'
  14677. */
  14678. function escapeRegExp(string) {
  14679. string = toString(string);
  14680. return (string && reHasRegExpChar.test(string))
  14681. ? string.replace(reRegExpChar, '\\$&')
  14682. : string;
  14683. }
  14684. /**
  14685. * Converts `string` to
  14686. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14687. *
  14688. * @static
  14689. * @memberOf _
  14690. * @since 3.0.0
  14691. * @category String
  14692. * @param {string} [string=''] The string to convert.
  14693. * @returns {string} Returns the kebab cased string.
  14694. * @example
  14695. *
  14696. * _.kebabCase('Foo Bar');
  14697. * // => 'foo-bar'
  14698. *
  14699. * _.kebabCase('fooBar');
  14700. * // => 'foo-bar'
  14701. *
  14702. * _.kebabCase('__FOO_BAR__');
  14703. * // => 'foo-bar'
  14704. */
  14705. var kebabCase = createCompounder(function(result, word, index) {
  14706. return result + (index ? '-' : '') + word.toLowerCase();
  14707. });
  14708. /**
  14709. * Converts `string`, as space separated words, to lower case.
  14710. *
  14711. * @static
  14712. * @memberOf _
  14713. * @since 4.0.0
  14714. * @category String
  14715. * @param {string} [string=''] The string to convert.
  14716. * @returns {string} Returns the lower cased string.
  14717. * @example
  14718. *
  14719. * _.lowerCase('--Foo-Bar--');
  14720. * // => 'foo bar'
  14721. *
  14722. * _.lowerCase('fooBar');
  14723. * // => 'foo bar'
  14724. *
  14725. * _.lowerCase('__FOO_BAR__');
  14726. * // => 'foo bar'
  14727. */
  14728. var lowerCase = createCompounder(function(result, word, index) {
  14729. return result + (index ? ' ' : '') + word.toLowerCase();
  14730. });
  14731. /**
  14732. * Converts the first character of `string` to lower case.
  14733. *
  14734. * @static
  14735. * @memberOf _
  14736. * @since 4.0.0
  14737. * @category String
  14738. * @param {string} [string=''] The string to convert.
  14739. * @returns {string} Returns the converted string.
  14740. * @example
  14741. *
  14742. * _.lowerFirst('Fred');
  14743. * // => 'fred'
  14744. *
  14745. * _.lowerFirst('FRED');
  14746. * // => 'fRED'
  14747. */
  14748. var lowerFirst = createCaseFirst('toLowerCase');
  14749. /**
  14750. * Pads `string` on the left and right sides if it's shorter than `length`.
  14751. * Padding characters are truncated if they can't be evenly divided by `length`.
  14752. *
  14753. * @static
  14754. * @memberOf _
  14755. * @since 3.0.0
  14756. * @category String
  14757. * @param {string} [string=''] The string to pad.
  14758. * @param {number} [length=0] The padding length.
  14759. * @param {string} [chars=' '] The string used as padding.
  14760. * @returns {string} Returns the padded string.
  14761. * @example
  14762. *
  14763. * _.pad('abc', 8);
  14764. * // => ' abc '
  14765. *
  14766. * _.pad('abc', 8, '_-');
  14767. * // => '_-abc_-_'
  14768. *
  14769. * _.pad('abc', 3);
  14770. * // => 'abc'
  14771. */
  14772. function pad(string, length, chars) {
  14773. string = toString(string);
  14774. length = toInteger(length);
  14775. var strLength = length ? stringSize(string) : 0;
  14776. if (!length || strLength >= length) {
  14777. return string;
  14778. }
  14779. var mid = (length - strLength) / 2;
  14780. return (
  14781. createPadding(nativeFloor(mid), chars) +
  14782. string +
  14783. createPadding(nativeCeil(mid), chars)
  14784. );
  14785. }
  14786. /**
  14787. * Pads `string` on the right side if it's shorter than `length`. Padding
  14788. * characters are truncated if they exceed `length`.
  14789. *
  14790. * @static
  14791. * @memberOf _
  14792. * @since 4.0.0
  14793. * @category String
  14794. * @param {string} [string=''] The string to pad.
  14795. * @param {number} [length=0] The padding length.
  14796. * @param {string} [chars=' '] The string used as padding.
  14797. * @returns {string} Returns the padded string.
  14798. * @example
  14799. *
  14800. * _.padEnd('abc', 6);
  14801. * // => 'abc '
  14802. *
  14803. * _.padEnd('abc', 6, '_-');
  14804. * // => 'abc_-_'
  14805. *
  14806. * _.padEnd('abc', 3);
  14807. * // => 'abc'
  14808. */
  14809. function padEnd(string, length, chars) {
  14810. string = toString(string);
  14811. length = toInteger(length);
  14812. var strLength = length ? stringSize(string) : 0;
  14813. return (length && strLength < length)
  14814. ? (string + createPadding(length - strLength, chars))
  14815. : string;
  14816. }
  14817. /**
  14818. * Pads `string` on the left side if it's shorter than `length`. Padding
  14819. * characters are truncated if they exceed `length`.
  14820. *
  14821. * @static
  14822. * @memberOf _
  14823. * @since 4.0.0
  14824. * @category String
  14825. * @param {string} [string=''] The string to pad.
  14826. * @param {number} [length=0] The padding length.
  14827. * @param {string} [chars=' '] The string used as padding.
  14828. * @returns {string} Returns the padded string.
  14829. * @example
  14830. *
  14831. * _.padStart('abc', 6);
  14832. * // => ' abc'
  14833. *
  14834. * _.padStart('abc', 6, '_-');
  14835. * // => '_-_abc'
  14836. *
  14837. * _.padStart('abc', 3);
  14838. * // => 'abc'
  14839. */
  14840. function padStart(string, length, chars) {
  14841. string = toString(string);
  14842. length = toInteger(length);
  14843. var strLength = length ? stringSize(string) : 0;
  14844. return (length && strLength < length)
  14845. ? (createPadding(length - strLength, chars) + string)
  14846. : string;
  14847. }
  14848. /**
  14849. * Converts `string` to an integer of the specified radix. If `radix` is
  14850. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14851. * hexadecimal, in which case a `radix` of `16` is used.
  14852. *
  14853. * **Note:** This method aligns with the
  14854. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14855. *
  14856. * @static
  14857. * @memberOf _
  14858. * @since 1.1.0
  14859. * @category String
  14860. * @param {string} string The string to convert.
  14861. * @param {number} [radix=10] The radix to interpret `value` by.
  14862. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14863. * @returns {number} Returns the converted integer.
  14864. * @example
  14865. *
  14866. * _.parseInt('08');
  14867. * // => 8
  14868. *
  14869. * _.map(['6', '08', '10'], _.parseInt);
  14870. * // => [6, 8, 10]
  14871. */
  14872. function parseInt(string, radix, guard) {
  14873. if (guard || radix == null) {
  14874. radix = 0;
  14875. } else if (radix) {
  14876. radix = +radix;
  14877. }
  14878. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14879. }
  14880. /**
  14881. * Repeats the given string `n` times.
  14882. *
  14883. * @static
  14884. * @memberOf _
  14885. * @since 3.0.0
  14886. * @category String
  14887. * @param {string} [string=''] The string to repeat.
  14888. * @param {number} [n=1] The number of times to repeat the string.
  14889. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14890. * @returns {string} Returns the repeated string.
  14891. * @example
  14892. *
  14893. * _.repeat('*', 3);
  14894. * // => '***'
  14895. *
  14896. * _.repeat('abc', 2);
  14897. * // => 'abcabc'
  14898. *
  14899. * _.repeat('abc', 0);
  14900. * // => ''
  14901. */
  14902. function repeat(string, n, guard) {
  14903. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14904. n = 1;
  14905. } else {
  14906. n = toInteger(n);
  14907. }
  14908. return baseRepeat(toString(string), n);
  14909. }
  14910. /**
  14911. * Replaces matches for `pattern` in `string` with `replacement`.
  14912. *
  14913. * **Note:** This method is based on
  14914. * [`String#replace`](https://mdn.io/String/replace).
  14915. *
  14916. * @static
  14917. * @memberOf _
  14918. * @since 4.0.0
  14919. * @category String
  14920. * @param {string} [string=''] The string to modify.
  14921. * @param {RegExp|string} pattern The pattern to replace.
  14922. * @param {Function|string} replacement The match replacement.
  14923. * @returns {string} Returns the modified string.
  14924. * @example
  14925. *
  14926. * _.replace('Hi Fred', 'Fred', 'Barney');
  14927. * // => 'Hi Barney'
  14928. */
  14929. function replace() {
  14930. var args = arguments,
  14931. string = toString(args[0]);
  14932. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14933. }
  14934. /**
  14935. * Converts `string` to
  14936. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14937. *
  14938. * @static
  14939. * @memberOf _
  14940. * @since 3.0.0
  14941. * @category String
  14942. * @param {string} [string=''] The string to convert.
  14943. * @returns {string} Returns the snake cased string.
  14944. * @example
  14945. *
  14946. * _.snakeCase('Foo Bar');
  14947. * // => 'foo_bar'
  14948. *
  14949. * _.snakeCase('fooBar');
  14950. * // => 'foo_bar'
  14951. *
  14952. * _.snakeCase('--FOO-BAR--');
  14953. * // => 'foo_bar'
  14954. */
  14955. var snakeCase = createCompounder(function(result, word, index) {
  14956. return result + (index ? '_' : '') + word.toLowerCase();
  14957. });
  14958. /**
  14959. * Splits `string` by `separator`.
  14960. *
  14961. * **Note:** This method is based on
  14962. * [`String#split`](https://mdn.io/String/split).
  14963. *
  14964. * @static
  14965. * @memberOf _
  14966. * @since 4.0.0
  14967. * @category String
  14968. * @param {string} [string=''] The string to split.
  14969. * @param {RegExp|string} separator The separator pattern to split by.
  14970. * @param {number} [limit] The length to truncate results to.
  14971. * @returns {Array} Returns the string segments.
  14972. * @example
  14973. *
  14974. * _.split('a-b-c', '-', 2);
  14975. * // => ['a', 'b']
  14976. */
  14977. function split(string, separator, limit) {
  14978. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14979. separator = limit = undefined;
  14980. }
  14981. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14982. if (!limit) {
  14983. return [];
  14984. }
  14985. string = toString(string);
  14986. if (string && (
  14987. typeof separator == 'string' ||
  14988. (separator != null && !isRegExp(separator))
  14989. )) {
  14990. separator = baseToString(separator);
  14991. if (!separator && hasUnicode(string)) {
  14992. return castSlice(stringToArray(string), 0, limit);
  14993. }
  14994. }
  14995. return string.split(separator, limit);
  14996. }
  14997. /**
  14998. * Converts `string` to
  14999. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15000. *
  15001. * @static
  15002. * @memberOf _
  15003. * @since 3.1.0
  15004. * @category String
  15005. * @param {string} [string=''] The string to convert.
  15006. * @returns {string} Returns the start cased string.
  15007. * @example
  15008. *
  15009. * _.startCase('--foo-bar--');
  15010. * // => 'Foo Bar'
  15011. *
  15012. * _.startCase('fooBar');
  15013. * // => 'Foo Bar'
  15014. *
  15015. * _.startCase('__FOO_BAR__');
  15016. * // => 'FOO BAR'
  15017. */
  15018. var startCase = createCompounder(function(result, word, index) {
  15019. return result + (index ? ' ' : '') + upperFirst(word);
  15020. });
  15021. /**
  15022. * Checks if `string` starts with the given target string.
  15023. *
  15024. * @static
  15025. * @memberOf _
  15026. * @since 3.0.0
  15027. * @category String
  15028. * @param {string} [string=''] The string to inspect.
  15029. * @param {string} [target] The string to search for.
  15030. * @param {number} [position=0] The position to search from.
  15031. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15032. * else `false`.
  15033. * @example
  15034. *
  15035. * _.startsWith('abc', 'a');
  15036. * // => true
  15037. *
  15038. * _.startsWith('abc', 'b');
  15039. * // => false
  15040. *
  15041. * _.startsWith('abc', 'b', 1);
  15042. * // => true
  15043. */
  15044. function startsWith(string, target, position) {
  15045. string = toString(string);
  15046. position = position == null
  15047. ? 0
  15048. : baseClamp(toInteger(position), 0, string.length);
  15049. target = baseToString(target);
  15050. return string.slice(position, position + target.length) == target;
  15051. }
  15052. /**
  15053. * Creates a compiled template function that can interpolate data properties
  15054. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15055. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15056. * properties may be accessed as free variables in the template. If a setting
  15057. * object is given, it takes precedence over `_.templateSettings` values.
  15058. *
  15059. * **Note:** In the development build `_.template` utilizes
  15060. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15061. * for easier debugging.
  15062. *
  15063. * For more information on precompiling templates see
  15064. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15065. *
  15066. * For more information on Chrome extension sandboxes see
  15067. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15068. *
  15069. * @static
  15070. * @since 0.1.0
  15071. * @memberOf _
  15072. * @category String
  15073. * @param {string} [string=''] The template string.
  15074. * @param {Object} [options={}] The options object.
  15075. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15076. * The HTML "escape" delimiter.
  15077. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15078. * The "evaluate" delimiter.
  15079. * @param {Object} [options.imports=_.templateSettings.imports]
  15080. * An object to import into the template as free variables.
  15081. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15082. * The "interpolate" delimiter.
  15083. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15084. * The sourceURL of the compiled template.
  15085. * @param {string} [options.variable='obj']
  15086. * The data object variable name.
  15087. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15088. * @returns {Function} Returns the compiled template function.
  15089. * @example
  15090. *
  15091. * // Use the "interpolate" delimiter to create a compiled template.
  15092. * var compiled = _.template('hello <%= user %>!');
  15093. * compiled({ 'user': 'fred' });
  15094. * // => 'hello fred!'
  15095. *
  15096. * // Use the HTML "escape" delimiter to escape data property values.
  15097. * var compiled = _.template('<b><%- value %></b>');
  15098. * compiled({ 'value': '<script>' });
  15099. * // => '<b>&lt;script&gt;</b>'
  15100. *
  15101. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15102. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15103. * compiled({ 'users': ['fred', 'barney'] });
  15104. * // => '<li>fred</li><li>barney</li>'
  15105. *
  15106. * // Use the internal `print` function in "evaluate" delimiters.
  15107. * var compiled = _.template('<% print("hello " + user); %>!');
  15108. * compiled({ 'user': 'barney' });
  15109. * // => 'hello barney!'
  15110. *
  15111. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15112. * // Disable support by replacing the "interpolate" delimiter.
  15113. * var compiled = _.template('hello ${ user }!');
  15114. * compiled({ 'user': 'pebbles' });
  15115. * // => 'hello pebbles!'
  15116. *
  15117. * // Use backslashes to treat delimiters as plain text.
  15118. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15119. * compiled({ 'value': 'ignored' });
  15120. * // => '<%- value %>'
  15121. *
  15122. * // Use the `imports` option to import `jQuery` as `jq`.
  15123. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15124. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15125. * compiled({ 'users': ['fred', 'barney'] });
  15126. * // => '<li>fred</li><li>barney</li>'
  15127. *
  15128. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15129. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15130. * compiled(data);
  15131. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15132. *
  15133. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15134. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15135. * compiled.source;
  15136. * // => function(data) {
  15137. * // var __t, __p = '';
  15138. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15139. * // return __p;
  15140. * // }
  15141. *
  15142. * // Use custom template delimiters.
  15143. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15144. * var compiled = _.template('hello {{ user }}!');
  15145. * compiled({ 'user': 'mustache' });
  15146. * // => 'hello mustache!'
  15147. *
  15148. * // Use the `source` property to inline compiled templates for meaningful
  15149. * // line numbers in error messages and stack traces.
  15150. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15151. * var JST = {\
  15152. * "main": ' + _.template(mainText).source + '\
  15153. * };\
  15154. * ');
  15155. */
  15156. function template(string, options, guard) {
  15157. // Based on John Resig's `tmpl` implementation
  15158. // (http://ejohn.org/blog/javascript-micro-templating/)
  15159. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15160. var settings = lodash.templateSettings;
  15161. if (guard && isIterateeCall(string, options, guard)) {
  15162. options = undefined;
  15163. }
  15164. string = toString(string);
  15165. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15166. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15167. importsKeys = keys(imports),
  15168. importsValues = baseValues(imports, importsKeys);
  15169. var isEscaping,
  15170. isEvaluating,
  15171. index = 0,
  15172. interpolate = options.interpolate || reNoMatch,
  15173. source = "__p += '";
  15174. // Compile the regexp to match each delimiter.
  15175. var reDelimiters = RegExp(
  15176. (options.escape || reNoMatch).source + '|' +
  15177. interpolate.source + '|' +
  15178. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15179. (options.evaluate || reNoMatch).source + '|$'
  15180. , 'g');
  15181. // Use a sourceURL for easier debugging.
  15182. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15183. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15184. // and escape the comment, thus injecting code that gets evaled.
  15185. var sourceURL = '//# sourceURL=' +
  15186. (hasOwnProperty.call(options, 'sourceURL')
  15187. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15188. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15189. ) + '\n';
  15190. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15191. interpolateValue || (interpolateValue = esTemplateValue);
  15192. // Escape characters that can't be included in string literals.
  15193. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15194. // Replace delimiters with snippets.
  15195. if (escapeValue) {
  15196. isEscaping = true;
  15197. source += "' +\n__e(" + escapeValue + ") +\n'";
  15198. }
  15199. if (evaluateValue) {
  15200. isEvaluating = true;
  15201. source += "';\n" + evaluateValue + ";\n__p += '";
  15202. }
  15203. if (interpolateValue) {
  15204. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15205. }
  15206. index = offset + match.length;
  15207. // The JS engine embedded in Adobe products needs `match` returned in
  15208. // order to produce the correct `offset` value.
  15209. return match;
  15210. });
  15211. source += "';\n";
  15212. // If `variable` is not specified wrap a with-statement around the generated
  15213. // code to add the data object to the top of the scope chain.
  15214. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15215. if (!variable) {
  15216. source = 'with (obj) {\n' + source + '\n}\n';
  15217. }
  15218. // Throw an error if a forbidden character was found in `variable`, to prevent
  15219. // potential command injection attacks.
  15220. else if (reForbiddenIdentifierChars.test(variable)) {
  15221. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15222. }
  15223. // Cleanup code by stripping empty strings.
  15224. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15225. .replace(reEmptyStringMiddle, '$1')
  15226. .replace(reEmptyStringTrailing, '$1;');
  15227. // Frame code as the function body.
  15228. source = 'function(' + (variable || 'obj') + ') {\n' +
  15229. (variable
  15230. ? ''
  15231. : 'obj || (obj = {});\n'
  15232. ) +
  15233. "var __t, __p = ''" +
  15234. (isEscaping
  15235. ? ', __e = _.escape'
  15236. : ''
  15237. ) +
  15238. (isEvaluating
  15239. ? ', __j = Array.prototype.join;\n' +
  15240. "function print() { __p += __j.call(arguments, '') }\n"
  15241. : ';\n'
  15242. ) +
  15243. source +
  15244. 'return __p\n}';
  15245. var result = attempt(function() {
  15246. return Function(importsKeys, sourceURL + 'return ' + source)
  15247. .apply(undefined, importsValues);
  15248. });
  15249. // Provide the compiled function's source by its `toString` method or
  15250. // the `source` property as a convenience for inlining compiled templates.
  15251. result.source = source;
  15252. if (isError(result)) {
  15253. throw result;
  15254. }
  15255. return result;
  15256. }
  15257. /**
  15258. * Converts `string`, as a whole, to lower case just like
  15259. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15260. *
  15261. * @static
  15262. * @memberOf _
  15263. * @since 4.0.0
  15264. * @category String
  15265. * @param {string} [string=''] The string to convert.
  15266. * @returns {string} Returns the lower cased string.
  15267. * @example
  15268. *
  15269. * _.toLower('--Foo-Bar--');
  15270. * // => '--foo-bar--'
  15271. *
  15272. * _.toLower('fooBar');
  15273. * // => 'foobar'
  15274. *
  15275. * _.toLower('__FOO_BAR__');
  15276. * // => '__foo_bar__'
  15277. */
  15278. function toLower(value) {
  15279. return toString(value).toLowerCase();
  15280. }
  15281. /**
  15282. * Converts `string`, as a whole, to upper case just like
  15283. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15284. *
  15285. * @static
  15286. * @memberOf _
  15287. * @since 4.0.0
  15288. * @category String
  15289. * @param {string} [string=''] The string to convert.
  15290. * @returns {string} Returns the upper cased string.
  15291. * @example
  15292. *
  15293. * _.toUpper('--foo-bar--');
  15294. * // => '--FOO-BAR--'
  15295. *
  15296. * _.toUpper('fooBar');
  15297. * // => 'FOOBAR'
  15298. *
  15299. * _.toUpper('__foo_bar__');
  15300. * // => '__FOO_BAR__'
  15301. */
  15302. function toUpper(value) {
  15303. return toString(value).toUpperCase();
  15304. }
  15305. /**
  15306. * Removes leading and trailing whitespace or specified characters from `string`.
  15307. *
  15308. * @static
  15309. * @memberOf _
  15310. * @since 3.0.0
  15311. * @category String
  15312. * @param {string} [string=''] The string to trim.
  15313. * @param {string} [chars=whitespace] The characters to trim.
  15314. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15315. * @returns {string} Returns the trimmed string.
  15316. * @example
  15317. *
  15318. * _.trim(' abc ');
  15319. * // => 'abc'
  15320. *
  15321. * _.trim('-_-abc-_-', '_-');
  15322. * // => 'abc'
  15323. *
  15324. * _.map([' foo ', ' bar '], _.trim);
  15325. * // => ['foo', 'bar']
  15326. */
  15327. function trim(string, chars, guard) {
  15328. string = toString(string);
  15329. if (string && (guard || chars === undefined)) {
  15330. return baseTrim(string);
  15331. }
  15332. if (!string || !(chars = baseToString(chars))) {
  15333. return string;
  15334. }
  15335. var strSymbols = stringToArray(string),
  15336. chrSymbols = stringToArray(chars),
  15337. start = charsStartIndex(strSymbols, chrSymbols),
  15338. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15339. return castSlice(strSymbols, start, end).join('');
  15340. }
  15341. /**
  15342. * Removes trailing whitespace or specified characters from `string`.
  15343. *
  15344. * @static
  15345. * @memberOf _
  15346. * @since 4.0.0
  15347. * @category String
  15348. * @param {string} [string=''] The string to trim.
  15349. * @param {string} [chars=whitespace] The characters to trim.
  15350. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15351. * @returns {string} Returns the trimmed string.
  15352. * @example
  15353. *
  15354. * _.trimEnd(' abc ');
  15355. * // => ' abc'
  15356. *
  15357. * _.trimEnd('-_-abc-_-', '_-');
  15358. * // => '-_-abc'
  15359. */
  15360. function trimEnd(string, chars, guard) {
  15361. string = toString(string);
  15362. if (string && (guard || chars === undefined)) {
  15363. return string.slice(0, trimmedEndIndex(string) + 1);
  15364. }
  15365. if (!string || !(chars = baseToString(chars))) {
  15366. return string;
  15367. }
  15368. var strSymbols = stringToArray(string),
  15369. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15370. return castSlice(strSymbols, 0, end).join('');
  15371. }
  15372. /**
  15373. * Removes leading whitespace or specified characters from `string`.
  15374. *
  15375. * @static
  15376. * @memberOf _
  15377. * @since 4.0.0
  15378. * @category String
  15379. * @param {string} [string=''] The string to trim.
  15380. * @param {string} [chars=whitespace] The characters to trim.
  15381. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15382. * @returns {string} Returns the trimmed string.
  15383. * @example
  15384. *
  15385. * _.trimStart(' abc ');
  15386. * // => 'abc '
  15387. *
  15388. * _.trimStart('-_-abc-_-', '_-');
  15389. * // => 'abc-_-'
  15390. */
  15391. function trimStart(string, chars, guard) {
  15392. string = toString(string);
  15393. if (string && (guard || chars === undefined)) {
  15394. return string.replace(reTrimStart, '');
  15395. }
  15396. if (!string || !(chars = baseToString(chars))) {
  15397. return string;
  15398. }
  15399. var strSymbols = stringToArray(string),
  15400. start = charsStartIndex(strSymbols, stringToArray(chars));
  15401. return castSlice(strSymbols, start).join('');
  15402. }
  15403. /**
  15404. * Truncates `string` if it's longer than the given maximum string length.
  15405. * The last characters of the truncated string are replaced with the omission
  15406. * string which defaults to "...".
  15407. *
  15408. * @static
  15409. * @memberOf _
  15410. * @since 4.0.0
  15411. * @category String
  15412. * @param {string} [string=''] The string to truncate.
  15413. * @param {Object} [options={}] The options object.
  15414. * @param {number} [options.length=30] The maximum string length.
  15415. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15416. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15417. * @returns {string} Returns the truncated string.
  15418. * @example
  15419. *
  15420. * _.truncate('hi-diddly-ho there, neighborino');
  15421. * // => 'hi-diddly-ho there, neighbo...'
  15422. *
  15423. * _.truncate('hi-diddly-ho there, neighborino', {
  15424. * 'length': 24,
  15425. * 'separator': ' '
  15426. * });
  15427. * // => 'hi-diddly-ho there,...'
  15428. *
  15429. * _.truncate('hi-diddly-ho there, neighborino', {
  15430. * 'length': 24,
  15431. * 'separator': /,? +/
  15432. * });
  15433. * // => 'hi-diddly-ho there...'
  15434. *
  15435. * _.truncate('hi-diddly-ho there, neighborino', {
  15436. * 'omission': ' [...]'
  15437. * });
  15438. * // => 'hi-diddly-ho there, neig [...]'
  15439. */
  15440. function truncate(string, options) {
  15441. var length = DEFAULT_TRUNC_LENGTH,
  15442. omission = DEFAULT_TRUNC_OMISSION;
  15443. if (isObject(options)) {
  15444. var separator = 'separator' in options ? options.separator : separator;
  15445. length = 'length' in options ? toInteger(options.length) : length;
  15446. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15447. }
  15448. string = toString(string);
  15449. var strLength = string.length;
  15450. if (hasUnicode(string)) {
  15451. var strSymbols = stringToArray(string);
  15452. strLength = strSymbols.length;
  15453. }
  15454. if (length >= strLength) {
  15455. return string;
  15456. }
  15457. var end = length - stringSize(omission);
  15458. if (end < 1) {
  15459. return omission;
  15460. }
  15461. var result = strSymbols
  15462. ? castSlice(strSymbols, 0, end).join('')
  15463. : string.slice(0, end);
  15464. if (separator === undefined) {
  15465. return result + omission;
  15466. }
  15467. if (strSymbols) {
  15468. end += (result.length - end);
  15469. }
  15470. if (isRegExp(separator)) {
  15471. if (string.slice(end).search(separator)) {
  15472. var match,
  15473. substring = result;
  15474. if (!separator.global) {
  15475. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15476. }
  15477. separator.lastIndex = 0;
  15478. while ((match = separator.exec(substring))) {
  15479. var newEnd = match.index;
  15480. }
  15481. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15482. }
  15483. } else if (string.indexOf(baseToString(separator), end) != end) {
  15484. var index = result.lastIndexOf(separator);
  15485. if (index > -1) {
  15486. result = result.slice(0, index);
  15487. }
  15488. }
  15489. return result + omission;
  15490. }
  15491. /**
  15492. * The inverse of `_.escape`; this method converts the HTML entities
  15493. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15494. * their corresponding characters.
  15495. *
  15496. * **Note:** No other HTML entities are unescaped. To unescape additional
  15497. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15498. *
  15499. * @static
  15500. * @memberOf _
  15501. * @since 0.6.0
  15502. * @category String
  15503. * @param {string} [string=''] The string to unescape.
  15504. * @returns {string} Returns the unescaped string.
  15505. * @example
  15506. *
  15507. * _.unescape('fred, barney, &amp; pebbles');
  15508. * // => 'fred, barney, & pebbles'
  15509. */
  15510. function unescape(string) {
  15511. string = toString(string);
  15512. return (string && reHasEscapedHtml.test(string))
  15513. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15514. : string;
  15515. }
  15516. /**
  15517. * Converts `string`, as space separated words, to upper case.
  15518. *
  15519. * @static
  15520. * @memberOf _
  15521. * @since 4.0.0
  15522. * @category String
  15523. * @param {string} [string=''] The string to convert.
  15524. * @returns {string} Returns the upper cased string.
  15525. * @example
  15526. *
  15527. * _.upperCase('--foo-bar');
  15528. * // => 'FOO BAR'
  15529. *
  15530. * _.upperCase('fooBar');
  15531. * // => 'FOO BAR'
  15532. *
  15533. * _.upperCase('__foo_bar__');
  15534. * // => 'FOO BAR'
  15535. */
  15536. var upperCase = createCompounder(function(result, word, index) {
  15537. return result + (index ? ' ' : '') + word.toUpperCase();
  15538. });
  15539. /**
  15540. * Converts the first character of `string` to upper case.
  15541. *
  15542. * @static
  15543. * @memberOf _
  15544. * @since 4.0.0
  15545. * @category String
  15546. * @param {string} [string=''] The string to convert.
  15547. * @returns {string} Returns the converted string.
  15548. * @example
  15549. *
  15550. * _.upperFirst('fred');
  15551. * // => 'Fred'
  15552. *
  15553. * _.upperFirst('FRED');
  15554. * // => 'FRED'
  15555. */
  15556. var upperFirst = createCaseFirst('toUpperCase');
  15557. /**
  15558. * Splits `string` into an array of its words.
  15559. *
  15560. * @static
  15561. * @memberOf _
  15562. * @since 3.0.0
  15563. * @category String
  15564. * @param {string} [string=''] The string to inspect.
  15565. * @param {RegExp|string} [pattern] The pattern to match words.
  15566. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15567. * @returns {Array} Returns the words of `string`.
  15568. * @example
  15569. *
  15570. * _.words('fred, barney, & pebbles');
  15571. * // => ['fred', 'barney', 'pebbles']
  15572. *
  15573. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15574. * // => ['fred', 'barney', '&', 'pebbles']
  15575. */
  15576. function words(string, pattern, guard) {
  15577. string = toString(string);
  15578. pattern = guard ? undefined : pattern;
  15579. if (pattern === undefined) {
  15580. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15581. }
  15582. return string.match(pattern) || [];
  15583. }
  15584. /*------------------------------------------------------------------------*/
  15585. /**
  15586. * Attempts to invoke `func`, returning either the result or the caught error
  15587. * object. Any additional arguments are provided to `func` when it's invoked.
  15588. *
  15589. * @static
  15590. * @memberOf _
  15591. * @since 3.0.0
  15592. * @category Util
  15593. * @param {Function} func The function to attempt.
  15594. * @param {...*} [args] The arguments to invoke `func` with.
  15595. * @returns {*} Returns the `func` result or error object.
  15596. * @example
  15597. *
  15598. * // Avoid throwing errors for invalid selectors.
  15599. * var elements = _.attempt(function(selector) {
  15600. * return document.querySelectorAll(selector);
  15601. * }, '>_>');
  15602. *
  15603. * if (_.isError(elements)) {
  15604. * elements = [];
  15605. * }
  15606. */
  15607. var attempt = baseRest(function(func, args) {
  15608. try {
  15609. return apply(func, undefined, args);
  15610. } catch (e) {
  15611. return isError(e) ? e : new Error(e);
  15612. }
  15613. });
  15614. /**
  15615. * Binds methods of an object to the object itself, overwriting the existing
  15616. * method.
  15617. *
  15618. * **Note:** This method doesn't set the "length" property of bound functions.
  15619. *
  15620. * @static
  15621. * @since 0.1.0
  15622. * @memberOf _
  15623. * @category Util
  15624. * @param {Object} object The object to bind and assign the bound methods to.
  15625. * @param {...(string|string[])} methodNames The object method names to bind.
  15626. * @returns {Object} Returns `object`.
  15627. * @example
  15628. *
  15629. * var view = {
  15630. * 'label': 'docs',
  15631. * 'click': function() {
  15632. * console.log('clicked ' + this.label);
  15633. * }
  15634. * };
  15635. *
  15636. * _.bindAll(view, ['click']);
  15637. * jQuery(element).on('click', view.click);
  15638. * // => Logs 'clicked docs' when clicked.
  15639. */
  15640. var bindAll = flatRest(function(object, methodNames) {
  15641. arrayEach(methodNames, function(key) {
  15642. key = toKey(key);
  15643. baseAssignValue(object, key, bind(object[key], object));
  15644. });
  15645. return object;
  15646. });
  15647. /**
  15648. * Creates a function that iterates over `pairs` and invokes the corresponding
  15649. * function of the first predicate to return truthy. The predicate-function
  15650. * pairs are invoked with the `this` binding and arguments of the created
  15651. * function.
  15652. *
  15653. * @static
  15654. * @memberOf _
  15655. * @since 4.0.0
  15656. * @category Util
  15657. * @param {Array} pairs The predicate-function pairs.
  15658. * @returns {Function} Returns the new composite function.
  15659. * @example
  15660. *
  15661. * var func = _.cond([
  15662. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15663. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15664. * [_.stubTrue, _.constant('no match')]
  15665. * ]);
  15666. *
  15667. * func({ 'a': 1, 'b': 2 });
  15668. * // => 'matches A'
  15669. *
  15670. * func({ 'a': 0, 'b': 1 });
  15671. * // => 'matches B'
  15672. *
  15673. * func({ 'a': '1', 'b': '2' });
  15674. * // => 'no match'
  15675. */
  15676. function cond(pairs) {
  15677. var length = pairs == null ? 0 : pairs.length,
  15678. toIteratee = getIteratee();
  15679. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15680. if (typeof pair[1] != 'function') {
  15681. throw new TypeError(FUNC_ERROR_TEXT);
  15682. }
  15683. return [toIteratee(pair[0]), pair[1]];
  15684. });
  15685. return baseRest(function(args) {
  15686. var index = -1;
  15687. while (++index < length) {
  15688. var pair = pairs[index];
  15689. if (apply(pair[0], this, args)) {
  15690. return apply(pair[1], this, args);
  15691. }
  15692. }
  15693. });
  15694. }
  15695. /**
  15696. * Creates a function that invokes the predicate properties of `source` with
  15697. * the corresponding property values of a given object, returning `true` if
  15698. * all predicates return truthy, else `false`.
  15699. *
  15700. * **Note:** The created function is equivalent to `_.conformsTo` with
  15701. * `source` partially applied.
  15702. *
  15703. * @static
  15704. * @memberOf _
  15705. * @since 4.0.0
  15706. * @category Util
  15707. * @param {Object} source The object of property predicates to conform to.
  15708. * @returns {Function} Returns the new spec function.
  15709. * @example
  15710. *
  15711. * var objects = [
  15712. * { 'a': 2, 'b': 1 },
  15713. * { 'a': 1, 'b': 2 }
  15714. * ];
  15715. *
  15716. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15717. * // => [{ 'a': 1, 'b': 2 }]
  15718. */
  15719. function conforms(source) {
  15720. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15721. }
  15722. /**
  15723. * Creates a function that returns `value`.
  15724. *
  15725. * @static
  15726. * @memberOf _
  15727. * @since 2.4.0
  15728. * @category Util
  15729. * @param {*} value The value to return from the new function.
  15730. * @returns {Function} Returns the new constant function.
  15731. * @example
  15732. *
  15733. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15734. *
  15735. * console.log(objects);
  15736. * // => [{ 'a': 1 }, { 'a': 1 }]
  15737. *
  15738. * console.log(objects[0] === objects[1]);
  15739. * // => true
  15740. */
  15741. function constant(value) {
  15742. return function() {
  15743. return value;
  15744. };
  15745. }
  15746. /**
  15747. * Checks `value` to determine whether a default value should be returned in
  15748. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15749. * or `undefined`.
  15750. *
  15751. * @static
  15752. * @memberOf _
  15753. * @since 4.14.0
  15754. * @category Util
  15755. * @param {*} value The value to check.
  15756. * @param {*} defaultValue The default value.
  15757. * @returns {*} Returns the resolved value.
  15758. * @example
  15759. *
  15760. * _.defaultTo(1, 10);
  15761. * // => 1
  15762. *
  15763. * _.defaultTo(undefined, 10);
  15764. * // => 10
  15765. */
  15766. function defaultTo(value, defaultValue) {
  15767. return (value == null || value !== value) ? defaultValue : value;
  15768. }
  15769. /**
  15770. * Creates a function that returns the result of invoking the given functions
  15771. * with the `this` binding of the created function, where each successive
  15772. * invocation is supplied the return value of the previous.
  15773. *
  15774. * @static
  15775. * @memberOf _
  15776. * @since 3.0.0
  15777. * @category Util
  15778. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15779. * @returns {Function} Returns the new composite function.
  15780. * @see _.flowRight
  15781. * @example
  15782. *
  15783. * function square(n) {
  15784. * return n * n;
  15785. * }
  15786. *
  15787. * var addSquare = _.flow([_.add, square]);
  15788. * addSquare(1, 2);
  15789. * // => 9
  15790. */
  15791. var flow = createFlow();
  15792. /**
  15793. * This method is like `_.flow` except that it creates a function that
  15794. * invokes the given functions from right to left.
  15795. *
  15796. * @static
  15797. * @since 3.0.0
  15798. * @memberOf _
  15799. * @category Util
  15800. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15801. * @returns {Function} Returns the new composite function.
  15802. * @see _.flow
  15803. * @example
  15804. *
  15805. * function square(n) {
  15806. * return n * n;
  15807. * }
  15808. *
  15809. * var addSquare = _.flowRight([square, _.add]);
  15810. * addSquare(1, 2);
  15811. * // => 9
  15812. */
  15813. var flowRight = createFlow(true);
  15814. /**
  15815. * This method returns the first argument it receives.
  15816. *
  15817. * @static
  15818. * @since 0.1.0
  15819. * @memberOf _
  15820. * @category Util
  15821. * @param {*} value Any value.
  15822. * @returns {*} Returns `value`.
  15823. * @example
  15824. *
  15825. * var object = { 'a': 1 };
  15826. *
  15827. * console.log(_.identity(object) === object);
  15828. * // => true
  15829. */
  15830. function identity(value) {
  15831. return value;
  15832. }
  15833. /**
  15834. * Creates a function that invokes `func` with the arguments of the created
  15835. * function. If `func` is a property name, the created function returns the
  15836. * property value for a given element. If `func` is an array or object, the
  15837. * created function returns `true` for elements that contain the equivalent
  15838. * source properties, otherwise it returns `false`.
  15839. *
  15840. * @static
  15841. * @since 4.0.0
  15842. * @memberOf _
  15843. * @category Util
  15844. * @param {*} [func=_.identity] The value to convert to a callback.
  15845. * @returns {Function} Returns the callback.
  15846. * @example
  15847. *
  15848. * var users = [
  15849. * { 'user': 'barney', 'age': 36, 'active': true },
  15850. * { 'user': 'fred', 'age': 40, 'active': false }
  15851. * ];
  15852. *
  15853. * // The `_.matches` iteratee shorthand.
  15854. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15855. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15856. *
  15857. * // The `_.matchesProperty` iteratee shorthand.
  15858. * _.filter(users, _.iteratee(['user', 'fred']));
  15859. * // => [{ 'user': 'fred', 'age': 40 }]
  15860. *
  15861. * // The `_.property` iteratee shorthand.
  15862. * _.map(users, _.iteratee('user'));
  15863. * // => ['barney', 'fred']
  15864. *
  15865. * // Create custom iteratee shorthands.
  15866. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15867. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15868. * return func.test(string);
  15869. * };
  15870. * });
  15871. *
  15872. * _.filter(['abc', 'def'], /ef/);
  15873. * // => ['def']
  15874. */
  15875. function iteratee(func) {
  15876. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15877. }
  15878. /**
  15879. * Creates a function that performs a partial deep comparison between a given
  15880. * object and `source`, returning `true` if the given object has equivalent
  15881. * property values, else `false`.
  15882. *
  15883. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15884. * partially applied.
  15885. *
  15886. * Partial comparisons will match empty array and empty object `source`
  15887. * values against any array or object value, respectively. See `_.isEqual`
  15888. * for a list of supported value comparisons.
  15889. *
  15890. * **Note:** Multiple values can be checked by combining several matchers
  15891. * using `_.overSome`
  15892. *
  15893. * @static
  15894. * @memberOf _
  15895. * @since 3.0.0
  15896. * @category Util
  15897. * @param {Object} source The object of property values to match.
  15898. * @returns {Function} Returns the new spec function.
  15899. * @example
  15900. *
  15901. * var objects = [
  15902. * { 'a': 1, 'b': 2, 'c': 3 },
  15903. * { 'a': 4, 'b': 5, 'c': 6 }
  15904. * ];
  15905. *
  15906. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15907. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15908. *
  15909. * // Checking for several possible values
  15910. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15911. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15912. */
  15913. function matches(source) {
  15914. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15915. }
  15916. /**
  15917. * Creates a function that performs a partial deep comparison between the
  15918. * value at `path` of a given object to `srcValue`, returning `true` if the
  15919. * object value is equivalent, else `false`.
  15920. *
  15921. * **Note:** Partial comparisons will match empty array and empty object
  15922. * `srcValue` values against any array or object value, respectively. See
  15923. * `_.isEqual` for a list of supported value comparisons.
  15924. *
  15925. * **Note:** Multiple values can be checked by combining several matchers
  15926. * using `_.overSome`
  15927. *
  15928. * @static
  15929. * @memberOf _
  15930. * @since 3.2.0
  15931. * @category Util
  15932. * @param {Array|string} path The path of the property to get.
  15933. * @param {*} srcValue The value to match.
  15934. * @returns {Function} Returns the new spec function.
  15935. * @example
  15936. *
  15937. * var objects = [
  15938. * { 'a': 1, 'b': 2, 'c': 3 },
  15939. * { 'a': 4, 'b': 5, 'c': 6 }
  15940. * ];
  15941. *
  15942. * _.find(objects, _.matchesProperty('a', 4));
  15943. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15944. *
  15945. * // Checking for several possible values
  15946. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15947. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15948. */
  15949. function matchesProperty(path, srcValue) {
  15950. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15951. }
  15952. /**
  15953. * Creates a function that invokes the method at `path` of a given object.
  15954. * Any additional arguments are provided to the invoked method.
  15955. *
  15956. * @static
  15957. * @memberOf _
  15958. * @since 3.7.0
  15959. * @category Util
  15960. * @param {Array|string} path The path of the method to invoke.
  15961. * @param {...*} [args] The arguments to invoke the method with.
  15962. * @returns {Function} Returns the new invoker function.
  15963. * @example
  15964. *
  15965. * var objects = [
  15966. * { 'a': { 'b': _.constant(2) } },
  15967. * { 'a': { 'b': _.constant(1) } }
  15968. * ];
  15969. *
  15970. * _.map(objects, _.method('a.b'));
  15971. * // => [2, 1]
  15972. *
  15973. * _.map(objects, _.method(['a', 'b']));
  15974. * // => [2, 1]
  15975. */
  15976. var method = baseRest(function(path, args) {
  15977. return function(object) {
  15978. return baseInvoke(object, path, args);
  15979. };
  15980. });
  15981. /**
  15982. * The opposite of `_.method`; this method creates a function that invokes
  15983. * the method at a given path of `object`. Any additional arguments are
  15984. * provided to the invoked method.
  15985. *
  15986. * @static
  15987. * @memberOf _
  15988. * @since 3.7.0
  15989. * @category Util
  15990. * @param {Object} object The object to query.
  15991. * @param {...*} [args] The arguments to invoke the method with.
  15992. * @returns {Function} Returns the new invoker function.
  15993. * @example
  15994. *
  15995. * var array = _.times(3, _.constant),
  15996. * object = { 'a': array, 'b': array, 'c': array };
  15997. *
  15998. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15999. * // => [2, 0]
  16000. *
  16001. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16002. * // => [2, 0]
  16003. */
  16004. var methodOf = baseRest(function(object, args) {
  16005. return function(path) {
  16006. return baseInvoke(object, path, args);
  16007. };
  16008. });
  16009. /**
  16010. * Adds all own enumerable string keyed function properties of a source
  16011. * object to the destination object. If `object` is a function, then methods
  16012. * are added to its prototype as well.
  16013. *
  16014. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16015. * avoid conflicts caused by modifying the original.
  16016. *
  16017. * @static
  16018. * @since 0.1.0
  16019. * @memberOf _
  16020. * @category Util
  16021. * @param {Function|Object} [object=lodash] The destination object.
  16022. * @param {Object} source The object of functions to add.
  16023. * @param {Object} [options={}] The options object.
  16024. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16025. * @returns {Function|Object} Returns `object`.
  16026. * @example
  16027. *
  16028. * function vowels(string) {
  16029. * return _.filter(string, function(v) {
  16030. * return /[aeiou]/i.test(v);
  16031. * });
  16032. * }
  16033. *
  16034. * _.mixin({ 'vowels': vowels });
  16035. * _.vowels('fred');
  16036. * // => ['e']
  16037. *
  16038. * _('fred').vowels().value();
  16039. * // => ['e']
  16040. *
  16041. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16042. * _('fred').vowels();
  16043. * // => ['e']
  16044. */
  16045. function mixin(object, source, options) {
  16046. var props = keys(source),
  16047. methodNames = baseFunctions(source, props);
  16048. if (options == null &&
  16049. !(isObject(source) && (methodNames.length || !props.length))) {
  16050. options = source;
  16051. source = object;
  16052. object = this;
  16053. methodNames = baseFunctions(source, keys(source));
  16054. }
  16055. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16056. isFunc = isFunction(object);
  16057. arrayEach(methodNames, function(methodName) {
  16058. var func = source[methodName];
  16059. object[methodName] = func;
  16060. if (isFunc) {
  16061. object.prototype[methodName] = function() {
  16062. var chainAll = this.__chain__;
  16063. if (chain || chainAll) {
  16064. var result = object(this.__wrapped__),
  16065. actions = result.__actions__ = copyArray(this.__actions__);
  16066. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16067. result.__chain__ = chainAll;
  16068. return result;
  16069. }
  16070. return func.apply(object, arrayPush([this.value()], arguments));
  16071. };
  16072. }
  16073. });
  16074. return object;
  16075. }
  16076. /**
  16077. * Reverts the `_` variable to its previous value and returns a reference to
  16078. * the `lodash` function.
  16079. *
  16080. * @static
  16081. * @since 0.1.0
  16082. * @memberOf _
  16083. * @category Util
  16084. * @returns {Function} Returns the `lodash` function.
  16085. * @example
  16086. *
  16087. * var lodash = _.noConflict();
  16088. */
  16089. function noConflict() {
  16090. if (root._ === this) {
  16091. root._ = oldDash;
  16092. }
  16093. return this;
  16094. }
  16095. /**
  16096. * This method returns `undefined`.
  16097. *
  16098. * @static
  16099. * @memberOf _
  16100. * @since 2.3.0
  16101. * @category Util
  16102. * @example
  16103. *
  16104. * _.times(2, _.noop);
  16105. * // => [undefined, undefined]
  16106. */
  16107. function noop() {
  16108. // No operation performed.
  16109. }
  16110. /**
  16111. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16112. * the nth argument from the end is returned.
  16113. *
  16114. * @static
  16115. * @memberOf _
  16116. * @since 4.0.0
  16117. * @category Util
  16118. * @param {number} [n=0] The index of the argument to return.
  16119. * @returns {Function} Returns the new pass-thru function.
  16120. * @example
  16121. *
  16122. * var func = _.nthArg(1);
  16123. * func('a', 'b', 'c', 'd');
  16124. * // => 'b'
  16125. *
  16126. * var func = _.nthArg(-2);
  16127. * func('a', 'b', 'c', 'd');
  16128. * // => 'c'
  16129. */
  16130. function nthArg(n) {
  16131. n = toInteger(n);
  16132. return baseRest(function(args) {
  16133. return baseNth(args, n);
  16134. });
  16135. }
  16136. /**
  16137. * Creates a function that invokes `iteratees` with the arguments it receives
  16138. * and returns their results.
  16139. *
  16140. * @static
  16141. * @memberOf _
  16142. * @since 4.0.0
  16143. * @category Util
  16144. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16145. * The iteratees to invoke.
  16146. * @returns {Function} Returns the new function.
  16147. * @example
  16148. *
  16149. * var func = _.over([Math.max, Math.min]);
  16150. *
  16151. * func(1, 2, 3, 4);
  16152. * // => [4, 1]
  16153. */
  16154. var over = createOver(arrayMap);
  16155. /**
  16156. * Creates a function that checks if **all** of the `predicates` return
  16157. * truthy when invoked with the arguments it receives.
  16158. *
  16159. * Following shorthands are possible for providing predicates.
  16160. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16161. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16162. *
  16163. * @static
  16164. * @memberOf _
  16165. * @since 4.0.0
  16166. * @category Util
  16167. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16168. * The predicates to check.
  16169. * @returns {Function} Returns the new function.
  16170. * @example
  16171. *
  16172. * var func = _.overEvery([Boolean, isFinite]);
  16173. *
  16174. * func('1');
  16175. * // => true
  16176. *
  16177. * func(null);
  16178. * // => false
  16179. *
  16180. * func(NaN);
  16181. * // => false
  16182. */
  16183. var overEvery = createOver(arrayEvery);
  16184. /**
  16185. * Creates a function that checks if **any** of the `predicates` return
  16186. * truthy when invoked with the arguments it receives.
  16187. *
  16188. * Following shorthands are possible for providing predicates.
  16189. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16190. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16191. *
  16192. * @static
  16193. * @memberOf _
  16194. * @since 4.0.0
  16195. * @category Util
  16196. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16197. * The predicates to check.
  16198. * @returns {Function} Returns the new function.
  16199. * @example
  16200. *
  16201. * var func = _.overSome([Boolean, isFinite]);
  16202. *
  16203. * func('1');
  16204. * // => true
  16205. *
  16206. * func(null);
  16207. * // => true
  16208. *
  16209. * func(NaN);
  16210. * // => false
  16211. *
  16212. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16213. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16214. */
  16215. var overSome = createOver(arraySome);
  16216. /**
  16217. * Creates a function that returns the value at `path` of a given object.
  16218. *
  16219. * @static
  16220. * @memberOf _
  16221. * @since 2.4.0
  16222. * @category Util
  16223. * @param {Array|string} path The path of the property to get.
  16224. * @returns {Function} Returns the new accessor function.
  16225. * @example
  16226. *
  16227. * var objects = [
  16228. * { 'a': { 'b': 2 } },
  16229. * { 'a': { 'b': 1 } }
  16230. * ];
  16231. *
  16232. * _.map(objects, _.property('a.b'));
  16233. * // => [2, 1]
  16234. *
  16235. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16236. * // => [1, 2]
  16237. */
  16238. function property(path) {
  16239. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16240. }
  16241. /**
  16242. * The opposite of `_.property`; this method creates a function that returns
  16243. * the value at a given path of `object`.
  16244. *
  16245. * @static
  16246. * @memberOf _
  16247. * @since 3.0.0
  16248. * @category Util
  16249. * @param {Object} object The object to query.
  16250. * @returns {Function} Returns the new accessor function.
  16251. * @example
  16252. *
  16253. * var array = [0, 1, 2],
  16254. * object = { 'a': array, 'b': array, 'c': array };
  16255. *
  16256. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16257. * // => [2, 0]
  16258. *
  16259. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16260. * // => [2, 0]
  16261. */
  16262. function propertyOf(object) {
  16263. return function(path) {
  16264. return object == null ? undefined : baseGet(object, path);
  16265. };
  16266. }
  16267. /**
  16268. * Creates an array of numbers (positive and/or negative) progressing from
  16269. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16270. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16271. * it's set to `start` with `start` then set to `0`.
  16272. *
  16273. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16274. * floating-point values which can produce unexpected results.
  16275. *
  16276. * @static
  16277. * @since 0.1.0
  16278. * @memberOf _
  16279. * @category Util
  16280. * @param {number} [start=0] The start of the range.
  16281. * @param {number} end The end of the range.
  16282. * @param {number} [step=1] The value to increment or decrement by.
  16283. * @returns {Array} Returns the range of numbers.
  16284. * @see _.inRange, _.rangeRight
  16285. * @example
  16286. *
  16287. * _.range(4);
  16288. * // => [0, 1, 2, 3]
  16289. *
  16290. * _.range(-4);
  16291. * // => [0, -1, -2, -3]
  16292. *
  16293. * _.range(1, 5);
  16294. * // => [1, 2, 3, 4]
  16295. *
  16296. * _.range(0, 20, 5);
  16297. * // => [0, 5, 10, 15]
  16298. *
  16299. * _.range(0, -4, -1);
  16300. * // => [0, -1, -2, -3]
  16301. *
  16302. * _.range(1, 4, 0);
  16303. * // => [1, 1, 1]
  16304. *
  16305. * _.range(0);
  16306. * // => []
  16307. */
  16308. var range = createRange();
  16309. /**
  16310. * This method is like `_.range` except that it populates values in
  16311. * descending order.
  16312. *
  16313. * @static
  16314. * @memberOf _
  16315. * @since 4.0.0
  16316. * @category Util
  16317. * @param {number} [start=0] The start of the range.
  16318. * @param {number} end The end of the range.
  16319. * @param {number} [step=1] The value to increment or decrement by.
  16320. * @returns {Array} Returns the range of numbers.
  16321. * @see _.inRange, _.range
  16322. * @example
  16323. *
  16324. * _.rangeRight(4);
  16325. * // => [3, 2, 1, 0]
  16326. *
  16327. * _.rangeRight(-4);
  16328. * // => [-3, -2, -1, 0]
  16329. *
  16330. * _.rangeRight(1, 5);
  16331. * // => [4, 3, 2, 1]
  16332. *
  16333. * _.rangeRight(0, 20, 5);
  16334. * // => [15, 10, 5, 0]
  16335. *
  16336. * _.rangeRight(0, -4, -1);
  16337. * // => [-3, -2, -1, 0]
  16338. *
  16339. * _.rangeRight(1, 4, 0);
  16340. * // => [1, 1, 1]
  16341. *
  16342. * _.rangeRight(0);
  16343. * // => []
  16344. */
  16345. var rangeRight = createRange(true);
  16346. /**
  16347. * This method returns a new empty array.
  16348. *
  16349. * @static
  16350. * @memberOf _
  16351. * @since 4.13.0
  16352. * @category Util
  16353. * @returns {Array} Returns the new empty array.
  16354. * @example
  16355. *
  16356. * var arrays = _.times(2, _.stubArray);
  16357. *
  16358. * console.log(arrays);
  16359. * // => [[], []]
  16360. *
  16361. * console.log(arrays[0] === arrays[1]);
  16362. * // => false
  16363. */
  16364. function stubArray() {
  16365. return [];
  16366. }
  16367. /**
  16368. * This method returns `false`.
  16369. *
  16370. * @static
  16371. * @memberOf _
  16372. * @since 4.13.0
  16373. * @category Util
  16374. * @returns {boolean} Returns `false`.
  16375. * @example
  16376. *
  16377. * _.times(2, _.stubFalse);
  16378. * // => [false, false]
  16379. */
  16380. function stubFalse() {
  16381. return false;
  16382. }
  16383. /**
  16384. * This method returns a new empty object.
  16385. *
  16386. * @static
  16387. * @memberOf _
  16388. * @since 4.13.0
  16389. * @category Util
  16390. * @returns {Object} Returns the new empty object.
  16391. * @example
  16392. *
  16393. * var objects = _.times(2, _.stubObject);
  16394. *
  16395. * console.log(objects);
  16396. * // => [{}, {}]
  16397. *
  16398. * console.log(objects[0] === objects[1]);
  16399. * // => false
  16400. */
  16401. function stubObject() {
  16402. return {};
  16403. }
  16404. /**
  16405. * This method returns an empty string.
  16406. *
  16407. * @static
  16408. * @memberOf _
  16409. * @since 4.13.0
  16410. * @category Util
  16411. * @returns {string} Returns the empty string.
  16412. * @example
  16413. *
  16414. * _.times(2, _.stubString);
  16415. * // => ['', '']
  16416. */
  16417. function stubString() {
  16418. return '';
  16419. }
  16420. /**
  16421. * This method returns `true`.
  16422. *
  16423. * @static
  16424. * @memberOf _
  16425. * @since 4.13.0
  16426. * @category Util
  16427. * @returns {boolean} Returns `true`.
  16428. * @example
  16429. *
  16430. * _.times(2, _.stubTrue);
  16431. * // => [true, true]
  16432. */
  16433. function stubTrue() {
  16434. return true;
  16435. }
  16436. /**
  16437. * Invokes the iteratee `n` times, returning an array of the results of
  16438. * each invocation. The iteratee is invoked with one argument; (index).
  16439. *
  16440. * @static
  16441. * @since 0.1.0
  16442. * @memberOf _
  16443. * @category Util
  16444. * @param {number} n The number of times to invoke `iteratee`.
  16445. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16446. * @returns {Array} Returns the array of results.
  16447. * @example
  16448. *
  16449. * _.times(3, String);
  16450. * // => ['0', '1', '2']
  16451. *
  16452. * _.times(4, _.constant(0));
  16453. * // => [0, 0, 0, 0]
  16454. */
  16455. function times(n, iteratee) {
  16456. n = toInteger(n);
  16457. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16458. return [];
  16459. }
  16460. var index = MAX_ARRAY_LENGTH,
  16461. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16462. iteratee = getIteratee(iteratee);
  16463. n -= MAX_ARRAY_LENGTH;
  16464. var result = baseTimes(length, iteratee);
  16465. while (++index < n) {
  16466. iteratee(index);
  16467. }
  16468. return result;
  16469. }
  16470. /**
  16471. * Converts `value` to a property path array.
  16472. *
  16473. * @static
  16474. * @memberOf _
  16475. * @since 4.0.0
  16476. * @category Util
  16477. * @param {*} value The value to convert.
  16478. * @returns {Array} Returns the new property path array.
  16479. * @example
  16480. *
  16481. * _.toPath('a.b.c');
  16482. * // => ['a', 'b', 'c']
  16483. *
  16484. * _.toPath('a[0].b.c');
  16485. * // => ['a', '0', 'b', 'c']
  16486. */
  16487. function toPath(value) {
  16488. if (isArray(value)) {
  16489. return arrayMap(value, toKey);
  16490. }
  16491. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16492. }
  16493. /**
  16494. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16495. *
  16496. * @static
  16497. * @since 0.1.0
  16498. * @memberOf _
  16499. * @category Util
  16500. * @param {string} [prefix=''] The value to prefix the ID with.
  16501. * @returns {string} Returns the unique ID.
  16502. * @example
  16503. *
  16504. * _.uniqueId('contact_');
  16505. * // => 'contact_104'
  16506. *
  16507. * _.uniqueId();
  16508. * // => '105'
  16509. */
  16510. function uniqueId(prefix) {
  16511. var id = ++idCounter;
  16512. return toString(prefix) + id;
  16513. }
  16514. /*------------------------------------------------------------------------*/
  16515. /**
  16516. * Adds two numbers.
  16517. *
  16518. * @static
  16519. * @memberOf _
  16520. * @since 3.4.0
  16521. * @category Math
  16522. * @param {number} augend The first number in an addition.
  16523. * @param {number} addend The second number in an addition.
  16524. * @returns {number} Returns the total.
  16525. * @example
  16526. *
  16527. * _.add(6, 4);
  16528. * // => 10
  16529. */
  16530. var add = createMathOperation(function(augend, addend) {
  16531. return augend + addend;
  16532. }, 0);
  16533. /**
  16534. * Computes `number` rounded up to `precision`.
  16535. *
  16536. * @static
  16537. * @memberOf _
  16538. * @since 3.10.0
  16539. * @category Math
  16540. * @param {number} number The number to round up.
  16541. * @param {number} [precision=0] The precision to round up to.
  16542. * @returns {number} Returns the rounded up number.
  16543. * @example
  16544. *
  16545. * _.ceil(4.006);
  16546. * // => 5
  16547. *
  16548. * _.ceil(6.004, 2);
  16549. * // => 6.01
  16550. *
  16551. * _.ceil(6040, -2);
  16552. * // => 6100
  16553. */
  16554. var ceil = createRound('ceil');
  16555. /**
  16556. * Divide two numbers.
  16557. *
  16558. * @static
  16559. * @memberOf _
  16560. * @since 4.7.0
  16561. * @category Math
  16562. * @param {number} dividend The first number in a division.
  16563. * @param {number} divisor The second number in a division.
  16564. * @returns {number} Returns the quotient.
  16565. * @example
  16566. *
  16567. * _.divide(6, 4);
  16568. * // => 1.5
  16569. */
  16570. var divide = createMathOperation(function(dividend, divisor) {
  16571. return dividend / divisor;
  16572. }, 1);
  16573. /**
  16574. * Computes `number` rounded down to `precision`.
  16575. *
  16576. * @static
  16577. * @memberOf _
  16578. * @since 3.10.0
  16579. * @category Math
  16580. * @param {number} number The number to round down.
  16581. * @param {number} [precision=0] The precision to round down to.
  16582. * @returns {number} Returns the rounded down number.
  16583. * @example
  16584. *
  16585. * _.floor(4.006);
  16586. * // => 4
  16587. *
  16588. * _.floor(0.046, 2);
  16589. * // => 0.04
  16590. *
  16591. * _.floor(4060, -2);
  16592. * // => 4000
  16593. */
  16594. var floor = createRound('floor');
  16595. /**
  16596. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16597. * `undefined` is returned.
  16598. *
  16599. * @static
  16600. * @since 0.1.0
  16601. * @memberOf _
  16602. * @category Math
  16603. * @param {Array} array The array to iterate over.
  16604. * @returns {*} Returns the maximum value.
  16605. * @example
  16606. *
  16607. * _.max([4, 2, 8, 6]);
  16608. * // => 8
  16609. *
  16610. * _.max([]);
  16611. * // => undefined
  16612. */
  16613. function max(array) {
  16614. return (array && array.length)
  16615. ? baseExtremum(array, identity, baseGt)
  16616. : undefined;
  16617. }
  16618. /**
  16619. * This method is like `_.max` except that it accepts `iteratee` which is
  16620. * invoked for each element in `array` to generate the criterion by which
  16621. * the value is ranked. The iteratee is invoked with one argument: (value).
  16622. *
  16623. * @static
  16624. * @memberOf _
  16625. * @since 4.0.0
  16626. * @category Math
  16627. * @param {Array} array The array to iterate over.
  16628. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16629. * @returns {*} Returns the maximum value.
  16630. * @example
  16631. *
  16632. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16633. *
  16634. * _.maxBy(objects, function(o) { return o.n; });
  16635. * // => { 'n': 2 }
  16636. *
  16637. * // The `_.property` iteratee shorthand.
  16638. * _.maxBy(objects, 'n');
  16639. * // => { 'n': 2 }
  16640. */
  16641. function maxBy(array, iteratee) {
  16642. return (array && array.length)
  16643. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16644. : undefined;
  16645. }
  16646. /**
  16647. * Computes the mean of the values in `array`.
  16648. *
  16649. * @static
  16650. * @memberOf _
  16651. * @since 4.0.0
  16652. * @category Math
  16653. * @param {Array} array The array to iterate over.
  16654. * @returns {number} Returns the mean.
  16655. * @example
  16656. *
  16657. * _.mean([4, 2, 8, 6]);
  16658. * // => 5
  16659. */
  16660. function mean(array) {
  16661. return baseMean(array, identity);
  16662. }
  16663. /**
  16664. * This method is like `_.mean` except that it accepts `iteratee` which is
  16665. * invoked for each element in `array` to generate the value to be averaged.
  16666. * The iteratee is invoked with one argument: (value).
  16667. *
  16668. * @static
  16669. * @memberOf _
  16670. * @since 4.7.0
  16671. * @category Math
  16672. * @param {Array} array The array to iterate over.
  16673. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16674. * @returns {number} Returns the mean.
  16675. * @example
  16676. *
  16677. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16678. *
  16679. * _.meanBy(objects, function(o) { return o.n; });
  16680. * // => 5
  16681. *
  16682. * // The `_.property` iteratee shorthand.
  16683. * _.meanBy(objects, 'n');
  16684. * // => 5
  16685. */
  16686. function meanBy(array, iteratee) {
  16687. return baseMean(array, getIteratee(iteratee, 2));
  16688. }
  16689. /**
  16690. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16691. * `undefined` is returned.
  16692. *
  16693. * @static
  16694. * @since 0.1.0
  16695. * @memberOf _
  16696. * @category Math
  16697. * @param {Array} array The array to iterate over.
  16698. * @returns {*} Returns the minimum value.
  16699. * @example
  16700. *
  16701. * _.min([4, 2, 8, 6]);
  16702. * // => 2
  16703. *
  16704. * _.min([]);
  16705. * // => undefined
  16706. */
  16707. function min(array) {
  16708. return (array && array.length)
  16709. ? baseExtremum(array, identity, baseLt)
  16710. : undefined;
  16711. }
  16712. /**
  16713. * This method is like `_.min` except that it accepts `iteratee` which is
  16714. * invoked for each element in `array` to generate the criterion by which
  16715. * the value is ranked. The iteratee is invoked with one argument: (value).
  16716. *
  16717. * @static
  16718. * @memberOf _
  16719. * @since 4.0.0
  16720. * @category Math
  16721. * @param {Array} array The array to iterate over.
  16722. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16723. * @returns {*} Returns the minimum value.
  16724. * @example
  16725. *
  16726. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16727. *
  16728. * _.minBy(objects, function(o) { return o.n; });
  16729. * // => { 'n': 1 }
  16730. *
  16731. * // The `_.property` iteratee shorthand.
  16732. * _.minBy(objects, 'n');
  16733. * // => { 'n': 1 }
  16734. */
  16735. function minBy(array, iteratee) {
  16736. return (array && array.length)
  16737. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16738. : undefined;
  16739. }
  16740. /**
  16741. * Multiply two numbers.
  16742. *
  16743. * @static
  16744. * @memberOf _
  16745. * @since 4.7.0
  16746. * @category Math
  16747. * @param {number} multiplier The first number in a multiplication.
  16748. * @param {number} multiplicand The second number in a multiplication.
  16749. * @returns {number} Returns the product.
  16750. * @example
  16751. *
  16752. * _.multiply(6, 4);
  16753. * // => 24
  16754. */
  16755. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16756. return multiplier * multiplicand;
  16757. }, 1);
  16758. /**
  16759. * Computes `number` rounded to `precision`.
  16760. *
  16761. * @static
  16762. * @memberOf _
  16763. * @since 3.10.0
  16764. * @category Math
  16765. * @param {number} number The number to round.
  16766. * @param {number} [precision=0] The precision to round to.
  16767. * @returns {number} Returns the rounded number.
  16768. * @example
  16769. *
  16770. * _.round(4.006);
  16771. * // => 4
  16772. *
  16773. * _.round(4.006, 2);
  16774. * // => 4.01
  16775. *
  16776. * _.round(4060, -2);
  16777. * // => 4100
  16778. */
  16779. var round = createRound('round');
  16780. /**
  16781. * Subtract two numbers.
  16782. *
  16783. * @static
  16784. * @memberOf _
  16785. * @since 4.0.0
  16786. * @category Math
  16787. * @param {number} minuend The first number in a subtraction.
  16788. * @param {number} subtrahend The second number in a subtraction.
  16789. * @returns {number} Returns the difference.
  16790. * @example
  16791. *
  16792. * _.subtract(6, 4);
  16793. * // => 2
  16794. */
  16795. var subtract = createMathOperation(function(minuend, subtrahend) {
  16796. return minuend - subtrahend;
  16797. }, 0);
  16798. /**
  16799. * Computes the sum of the values in `array`.
  16800. *
  16801. * @static
  16802. * @memberOf _
  16803. * @since 3.4.0
  16804. * @category Math
  16805. * @param {Array} array The array to iterate over.
  16806. * @returns {number} Returns the sum.
  16807. * @example
  16808. *
  16809. * _.sum([4, 2, 8, 6]);
  16810. * // => 20
  16811. */
  16812. function sum(array) {
  16813. return (array && array.length)
  16814. ? baseSum(array, identity)
  16815. : 0;
  16816. }
  16817. /**
  16818. * This method is like `_.sum` except that it accepts `iteratee` which is
  16819. * invoked for each element in `array` to generate the value to be summed.
  16820. * The iteratee is invoked with one argument: (value).
  16821. *
  16822. * @static
  16823. * @memberOf _
  16824. * @since 4.0.0
  16825. * @category Math
  16826. * @param {Array} array The array to iterate over.
  16827. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16828. * @returns {number} Returns the sum.
  16829. * @example
  16830. *
  16831. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16832. *
  16833. * _.sumBy(objects, function(o) { return o.n; });
  16834. * // => 20
  16835. *
  16836. * // The `_.property` iteratee shorthand.
  16837. * _.sumBy(objects, 'n');
  16838. * // => 20
  16839. */
  16840. function sumBy(array, iteratee) {
  16841. return (array && array.length)
  16842. ? baseSum(array, getIteratee(iteratee, 2))
  16843. : 0;
  16844. }
  16845. /*------------------------------------------------------------------------*/
  16846. // Add methods that return wrapped values in chain sequences.
  16847. lodash.after = after;
  16848. lodash.ary = ary;
  16849. lodash.assign = assign;
  16850. lodash.assignIn = assignIn;
  16851. lodash.assignInWith = assignInWith;
  16852. lodash.assignWith = assignWith;
  16853. lodash.at = at;
  16854. lodash.before = before;
  16855. lodash.bind = bind;
  16856. lodash.bindAll = bindAll;
  16857. lodash.bindKey = bindKey;
  16858. lodash.castArray = castArray;
  16859. lodash.chain = chain;
  16860. lodash.chunk = chunk;
  16861. lodash.compact = compact;
  16862. lodash.concat = concat;
  16863. lodash.cond = cond;
  16864. lodash.conforms = conforms;
  16865. lodash.constant = constant;
  16866. lodash.countBy = countBy;
  16867. lodash.create = create;
  16868. lodash.curry = curry;
  16869. lodash.curryRight = curryRight;
  16870. lodash.debounce = debounce;
  16871. lodash.defaults = defaults;
  16872. lodash.defaultsDeep = defaultsDeep;
  16873. lodash.defer = defer;
  16874. lodash.delay = delay;
  16875. lodash.difference = difference;
  16876. lodash.differenceBy = differenceBy;
  16877. lodash.differenceWith = differenceWith;
  16878. lodash.drop = drop;
  16879. lodash.dropRight = dropRight;
  16880. lodash.dropRightWhile = dropRightWhile;
  16881. lodash.dropWhile = dropWhile;
  16882. lodash.fill = fill;
  16883. lodash.filter = filter;
  16884. lodash.flatMap = flatMap;
  16885. lodash.flatMapDeep = flatMapDeep;
  16886. lodash.flatMapDepth = flatMapDepth;
  16887. lodash.flatten = flatten;
  16888. lodash.flattenDeep = flattenDeep;
  16889. lodash.flattenDepth = flattenDepth;
  16890. lodash.flip = flip;
  16891. lodash.flow = flow;
  16892. lodash.flowRight = flowRight;
  16893. lodash.fromPairs = fromPairs;
  16894. lodash.functions = functions;
  16895. lodash.functionsIn = functionsIn;
  16896. lodash.groupBy = groupBy;
  16897. lodash.initial = initial;
  16898. lodash.intersection = intersection;
  16899. lodash.intersectionBy = intersectionBy;
  16900. lodash.intersectionWith = intersectionWith;
  16901. lodash.invert = invert;
  16902. lodash.invertBy = invertBy;
  16903. lodash.invokeMap = invokeMap;
  16904. lodash.iteratee = iteratee;
  16905. lodash.keyBy = keyBy;
  16906. lodash.keys = keys;
  16907. lodash.keysIn = keysIn;
  16908. lodash.map = map;
  16909. lodash.mapKeys = mapKeys;
  16910. lodash.mapValues = mapValues;
  16911. lodash.matches = matches;
  16912. lodash.matchesProperty = matchesProperty;
  16913. lodash.memoize = memoize;
  16914. lodash.merge = merge;
  16915. lodash.mergeWith = mergeWith;
  16916. lodash.method = method;
  16917. lodash.methodOf = methodOf;
  16918. lodash.mixin = mixin;
  16919. lodash.negate = negate;
  16920. lodash.nthArg = nthArg;
  16921. lodash.omit = omit;
  16922. lodash.omitBy = omitBy;
  16923. lodash.once = once;
  16924. lodash.orderBy = orderBy;
  16925. lodash.over = over;
  16926. lodash.overArgs = overArgs;
  16927. lodash.overEvery = overEvery;
  16928. lodash.overSome = overSome;
  16929. lodash.partial = partial;
  16930. lodash.partialRight = partialRight;
  16931. lodash.partition = partition;
  16932. lodash.pick = pick;
  16933. lodash.pickBy = pickBy;
  16934. lodash.property = property;
  16935. lodash.propertyOf = propertyOf;
  16936. lodash.pull = pull;
  16937. lodash.pullAll = pullAll;
  16938. lodash.pullAllBy = pullAllBy;
  16939. lodash.pullAllWith = pullAllWith;
  16940. lodash.pullAt = pullAt;
  16941. lodash.range = range;
  16942. lodash.rangeRight = rangeRight;
  16943. lodash.rearg = rearg;
  16944. lodash.reject = reject;
  16945. lodash.remove = remove;
  16946. lodash.rest = rest;
  16947. lodash.reverse = reverse;
  16948. lodash.sampleSize = sampleSize;
  16949. lodash.set = set;
  16950. lodash.setWith = setWith;
  16951. lodash.shuffle = shuffle;
  16952. lodash.slice = slice;
  16953. lodash.sortBy = sortBy;
  16954. lodash.sortedUniq = sortedUniq;
  16955. lodash.sortedUniqBy = sortedUniqBy;
  16956. lodash.split = split;
  16957. lodash.spread = spread;
  16958. lodash.tail = tail;
  16959. lodash.take = take;
  16960. lodash.takeRight = takeRight;
  16961. lodash.takeRightWhile = takeRightWhile;
  16962. lodash.takeWhile = takeWhile;
  16963. lodash.tap = tap;
  16964. lodash.throttle = throttle;
  16965. lodash.thru = thru;
  16966. lodash.toArray = toArray;
  16967. lodash.toPairs = toPairs;
  16968. lodash.toPairsIn = toPairsIn;
  16969. lodash.toPath = toPath;
  16970. lodash.toPlainObject = toPlainObject;
  16971. lodash.transform = transform;
  16972. lodash.unary = unary;
  16973. lodash.union = union;
  16974. lodash.unionBy = unionBy;
  16975. lodash.unionWith = unionWith;
  16976. lodash.uniq = uniq;
  16977. lodash.uniqBy = uniqBy;
  16978. lodash.uniqWith = uniqWith;
  16979. lodash.unset = unset;
  16980. lodash.unzip = unzip;
  16981. lodash.unzipWith = unzipWith;
  16982. lodash.update = update;
  16983. lodash.updateWith = updateWith;
  16984. lodash.values = values;
  16985. lodash.valuesIn = valuesIn;
  16986. lodash.without = without;
  16987. lodash.words = words;
  16988. lodash.wrap = wrap;
  16989. lodash.xor = xor;
  16990. lodash.xorBy = xorBy;
  16991. lodash.xorWith = xorWith;
  16992. lodash.zip = zip;
  16993. lodash.zipObject = zipObject;
  16994. lodash.zipObjectDeep = zipObjectDeep;
  16995. lodash.zipWith = zipWith;
  16996. // Add aliases.
  16997. lodash.entries = toPairs;
  16998. lodash.entriesIn = toPairsIn;
  16999. lodash.extend = assignIn;
  17000. lodash.extendWith = assignInWith;
  17001. // Add methods to `lodash.prototype`.
  17002. mixin(lodash, lodash);
  17003. /*------------------------------------------------------------------------*/
  17004. // Add methods that return unwrapped values in chain sequences.
  17005. lodash.add = add;
  17006. lodash.attempt = attempt;
  17007. lodash.camelCase = camelCase;
  17008. lodash.capitalize = capitalize;
  17009. lodash.ceil = ceil;
  17010. lodash.clamp = clamp;
  17011. lodash.clone = clone;
  17012. lodash.cloneDeep = cloneDeep;
  17013. lodash.cloneDeepWith = cloneDeepWith;
  17014. lodash.cloneWith = cloneWith;
  17015. lodash.conformsTo = conformsTo;
  17016. lodash.deburr = deburr;
  17017. lodash.defaultTo = defaultTo;
  17018. lodash.divide = divide;
  17019. lodash.endsWith = endsWith;
  17020. lodash.eq = eq;
  17021. lodash.escape = escape;
  17022. lodash.escapeRegExp = escapeRegExp;
  17023. lodash.every = every;
  17024. lodash.find = find;
  17025. lodash.findIndex = findIndex;
  17026. lodash.findKey = findKey;
  17027. lodash.findLast = findLast;
  17028. lodash.findLastIndex = findLastIndex;
  17029. lodash.findLastKey = findLastKey;
  17030. lodash.floor = floor;
  17031. lodash.forEach = forEach;
  17032. lodash.forEachRight = forEachRight;
  17033. lodash.forIn = forIn;
  17034. lodash.forInRight = forInRight;
  17035. lodash.forOwn = forOwn;
  17036. lodash.forOwnRight = forOwnRight;
  17037. lodash.get = get;
  17038. lodash.gt = gt;
  17039. lodash.gte = gte;
  17040. lodash.has = has;
  17041. lodash.hasIn = hasIn;
  17042. lodash.head = head;
  17043. lodash.identity = identity;
  17044. lodash.includes = includes;
  17045. lodash.indexOf = indexOf;
  17046. lodash.inRange = inRange;
  17047. lodash.invoke = invoke;
  17048. lodash.isArguments = isArguments;
  17049. lodash.isArray = isArray;
  17050. lodash.isArrayBuffer = isArrayBuffer;
  17051. lodash.isArrayLike = isArrayLike;
  17052. lodash.isArrayLikeObject = isArrayLikeObject;
  17053. lodash.isBoolean = isBoolean;
  17054. lodash.isBuffer = isBuffer;
  17055. lodash.isDate = isDate;
  17056. lodash.isElement = isElement;
  17057. lodash.isEmpty = isEmpty;
  17058. lodash.isEqual = isEqual;
  17059. lodash.isEqualWith = isEqualWith;
  17060. lodash.isError = isError;
  17061. lodash.isFinite = isFinite;
  17062. lodash.isFunction = isFunction;
  17063. lodash.isInteger = isInteger;
  17064. lodash.isLength = isLength;
  17065. lodash.isMap = isMap;
  17066. lodash.isMatch = isMatch;
  17067. lodash.isMatchWith = isMatchWith;
  17068. lodash.isNaN = isNaN;
  17069. lodash.isNative = isNative;
  17070. lodash.isNil = isNil;
  17071. lodash.isNull = isNull;
  17072. lodash.isNumber = isNumber;
  17073. lodash.isObject = isObject;
  17074. lodash.isObjectLike = isObjectLike;
  17075. lodash.isPlainObject = isPlainObject;
  17076. lodash.isRegExp = isRegExp;
  17077. lodash.isSafeInteger = isSafeInteger;
  17078. lodash.isSet = isSet;
  17079. lodash.isString = isString;
  17080. lodash.isSymbol = isSymbol;
  17081. lodash.isTypedArray = isTypedArray;
  17082. lodash.isUndefined = isUndefined;
  17083. lodash.isWeakMap = isWeakMap;
  17084. lodash.isWeakSet = isWeakSet;
  17085. lodash.join = join;
  17086. lodash.kebabCase = kebabCase;
  17087. lodash.last = last;
  17088. lodash.lastIndexOf = lastIndexOf;
  17089. lodash.lowerCase = lowerCase;
  17090. lodash.lowerFirst = lowerFirst;
  17091. lodash.lt = lt;
  17092. lodash.lte = lte;
  17093. lodash.max = max;
  17094. lodash.maxBy = maxBy;
  17095. lodash.mean = mean;
  17096. lodash.meanBy = meanBy;
  17097. lodash.min = min;
  17098. lodash.minBy = minBy;
  17099. lodash.stubArray = stubArray;
  17100. lodash.stubFalse = stubFalse;
  17101. lodash.stubObject = stubObject;
  17102. lodash.stubString = stubString;
  17103. lodash.stubTrue = stubTrue;
  17104. lodash.multiply = multiply;
  17105. lodash.nth = nth;
  17106. lodash.noConflict = noConflict;
  17107. lodash.noop = noop;
  17108. lodash.now = now;
  17109. lodash.pad = pad;
  17110. lodash.padEnd = padEnd;
  17111. lodash.padStart = padStart;
  17112. lodash.parseInt = parseInt;
  17113. lodash.random = random;
  17114. lodash.reduce = reduce;
  17115. lodash.reduceRight = reduceRight;
  17116. lodash.repeat = repeat;
  17117. lodash.replace = replace;
  17118. lodash.result = result;
  17119. lodash.round = round;
  17120. lodash.runInContext = runInContext;
  17121. lodash.sample = sample;
  17122. lodash.size = size;
  17123. lodash.snakeCase = snakeCase;
  17124. lodash.some = some;
  17125. lodash.sortedIndex = sortedIndex;
  17126. lodash.sortedIndexBy = sortedIndexBy;
  17127. lodash.sortedIndexOf = sortedIndexOf;
  17128. lodash.sortedLastIndex = sortedLastIndex;
  17129. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17130. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17131. lodash.startCase = startCase;
  17132. lodash.startsWith = startsWith;
  17133. lodash.subtract = subtract;
  17134. lodash.sum = sum;
  17135. lodash.sumBy = sumBy;
  17136. lodash.template = template;
  17137. lodash.times = times;
  17138. lodash.toFinite = toFinite;
  17139. lodash.toInteger = toInteger;
  17140. lodash.toLength = toLength;
  17141. lodash.toLower = toLower;
  17142. lodash.toNumber = toNumber;
  17143. lodash.toSafeInteger = toSafeInteger;
  17144. lodash.toString = toString;
  17145. lodash.toUpper = toUpper;
  17146. lodash.trim = trim;
  17147. lodash.trimEnd = trimEnd;
  17148. lodash.trimStart = trimStart;
  17149. lodash.truncate = truncate;
  17150. lodash.unescape = unescape;
  17151. lodash.uniqueId = uniqueId;
  17152. lodash.upperCase = upperCase;
  17153. lodash.upperFirst = upperFirst;
  17154. // Add aliases.
  17155. lodash.each = forEach;
  17156. lodash.eachRight = forEachRight;
  17157. lodash.first = head;
  17158. mixin(lodash, (function() {
  17159. var source = {};
  17160. baseForOwn(lodash, function(func, methodName) {
  17161. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17162. source[methodName] = func;
  17163. }
  17164. });
  17165. return source;
  17166. }()), { 'chain': false });
  17167. /*------------------------------------------------------------------------*/
  17168. /**
  17169. * The semantic version number.
  17170. *
  17171. * @static
  17172. * @memberOf _
  17173. * @type {string}
  17174. */
  17175. lodash.VERSION = VERSION;
  17176. // Assign default placeholders.
  17177. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17178. lodash[methodName].placeholder = lodash;
  17179. });
  17180. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17181. arrayEach(['drop', 'take'], function(methodName, index) {
  17182. LazyWrapper.prototype[methodName] = function(n) {
  17183. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17184. var result = (this.__filtered__ && !index)
  17185. ? new LazyWrapper(this)
  17186. : this.clone();
  17187. if (result.__filtered__) {
  17188. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17189. } else {
  17190. result.__views__.push({
  17191. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17192. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17193. });
  17194. }
  17195. return result;
  17196. };
  17197. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17198. return this.reverse()[methodName](n).reverse();
  17199. };
  17200. });
  17201. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17202. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17203. var type = index + 1,
  17204. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17205. LazyWrapper.prototype[methodName] = function(iteratee) {
  17206. var result = this.clone();
  17207. result.__iteratees__.push({
  17208. 'iteratee': getIteratee(iteratee, 3),
  17209. 'type': type
  17210. });
  17211. result.__filtered__ = result.__filtered__ || isFilter;
  17212. return result;
  17213. };
  17214. });
  17215. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17216. arrayEach(['head', 'last'], function(methodName, index) {
  17217. var takeName = 'take' + (index ? 'Right' : '');
  17218. LazyWrapper.prototype[methodName] = function() {
  17219. return this[takeName](1).value()[0];
  17220. };
  17221. });
  17222. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17223. arrayEach(['initial', 'tail'], function(methodName, index) {
  17224. var dropName = 'drop' + (index ? '' : 'Right');
  17225. LazyWrapper.prototype[methodName] = function() {
  17226. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17227. };
  17228. });
  17229. LazyWrapper.prototype.compact = function() {
  17230. return this.filter(identity);
  17231. };
  17232. LazyWrapper.prototype.find = function(predicate) {
  17233. return this.filter(predicate).head();
  17234. };
  17235. LazyWrapper.prototype.findLast = function(predicate) {
  17236. return this.reverse().find(predicate);
  17237. };
  17238. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17239. if (typeof path == 'function') {
  17240. return new LazyWrapper(this);
  17241. }
  17242. return this.map(function(value) {
  17243. return baseInvoke(value, path, args);
  17244. });
  17245. });
  17246. LazyWrapper.prototype.reject = function(predicate) {
  17247. return this.filter(negate(getIteratee(predicate)));
  17248. };
  17249. LazyWrapper.prototype.slice = function(start, end) {
  17250. start = toInteger(start);
  17251. var result = this;
  17252. if (result.__filtered__ && (start > 0 || end < 0)) {
  17253. return new LazyWrapper(result);
  17254. }
  17255. if (start < 0) {
  17256. result = result.takeRight(-start);
  17257. } else if (start) {
  17258. result = result.drop(start);
  17259. }
  17260. if (end !== undefined) {
  17261. end = toInteger(end);
  17262. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17263. }
  17264. return result;
  17265. };
  17266. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17267. return this.reverse().takeWhile(predicate).reverse();
  17268. };
  17269. LazyWrapper.prototype.toArray = function() {
  17270. return this.take(MAX_ARRAY_LENGTH);
  17271. };
  17272. // Add `LazyWrapper` methods to `lodash.prototype`.
  17273. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17274. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17275. isTaker = /^(?:head|last)$/.test(methodName),
  17276. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17277. retUnwrapped = isTaker || /^find/.test(methodName);
  17278. if (!lodashFunc) {
  17279. return;
  17280. }
  17281. lodash.prototype[methodName] = function() {
  17282. var value = this.__wrapped__,
  17283. args = isTaker ? [1] : arguments,
  17284. isLazy = value instanceof LazyWrapper,
  17285. iteratee = args[0],
  17286. useLazy = isLazy || isArray(value);
  17287. var interceptor = function(value) {
  17288. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17289. return (isTaker && chainAll) ? result[0] : result;
  17290. };
  17291. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17292. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17293. isLazy = useLazy = false;
  17294. }
  17295. var chainAll = this.__chain__,
  17296. isHybrid = !!this.__actions__.length,
  17297. isUnwrapped = retUnwrapped && !chainAll,
  17298. onlyLazy = isLazy && !isHybrid;
  17299. if (!retUnwrapped && useLazy) {
  17300. value = onlyLazy ? value : new LazyWrapper(this);
  17301. var result = func.apply(value, args);
  17302. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17303. return new LodashWrapper(result, chainAll);
  17304. }
  17305. if (isUnwrapped && onlyLazy) {
  17306. return func.apply(this, args);
  17307. }
  17308. result = this.thru(interceptor);
  17309. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17310. };
  17311. });
  17312. // Add `Array` methods to `lodash.prototype`.
  17313. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17314. var func = arrayProto[methodName],
  17315. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17316. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17317. lodash.prototype[methodName] = function() {
  17318. var args = arguments;
  17319. if (retUnwrapped && !this.__chain__) {
  17320. var value = this.value();
  17321. return func.apply(isArray(value) ? value : [], args);
  17322. }
  17323. return this[chainName](function(value) {
  17324. return func.apply(isArray(value) ? value : [], args);
  17325. });
  17326. };
  17327. });
  17328. // Map minified method names to their real names.
  17329. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17330. var lodashFunc = lodash[methodName];
  17331. if (lodashFunc) {
  17332. var key = lodashFunc.name + '';
  17333. if (!hasOwnProperty.call(realNames, key)) {
  17334. realNames[key] = [];
  17335. }
  17336. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17337. }
  17338. });
  17339. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17340. 'name': 'wrapper',
  17341. 'func': undefined
  17342. }];
  17343. // Add methods to `LazyWrapper`.
  17344. LazyWrapper.prototype.clone = lazyClone;
  17345. LazyWrapper.prototype.reverse = lazyReverse;
  17346. LazyWrapper.prototype.value = lazyValue;
  17347. // Add chain sequence methods to the `lodash` wrapper.
  17348. lodash.prototype.at = wrapperAt;
  17349. lodash.prototype.chain = wrapperChain;
  17350. lodash.prototype.commit = wrapperCommit;
  17351. lodash.prototype.next = wrapperNext;
  17352. lodash.prototype.plant = wrapperPlant;
  17353. lodash.prototype.reverse = wrapperReverse;
  17354. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17355. // Add lazy aliases.
  17356. lodash.prototype.first = lodash.prototype.head;
  17357. if (symIterator) {
  17358. lodash.prototype[symIterator] = wrapperToIterator;
  17359. }
  17360. return lodash;
  17361. });
  17362. /*--------------------------------------------------------------------------*/
  17363. // Export lodash.
  17364. var _ = runInContext();
  17365. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17366. if (true) {
  17367. // Expose Lodash on the global object to prevent errors when Lodash is
  17368. // loaded by a script tag in the presence of an AMD loader.
  17369. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17370. // Use `_.noConflict` to remove Lodash from the global object.
  17371. root._ = _;
  17372. // Define as an anonymous module so, through path mapping, it can be
  17373. // referenced as the "underscore" module.
  17374. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17375. return _;
  17376. }).call(exports, __webpack_require__, exports, module),
  17377. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17378. }
  17379. // Check for `exports` after `define` in case a build optimizer adds it.
  17380. else {}
  17381. }.call(this));
  17382. /***/ }),
  17383. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17384. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17385. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17386. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17387. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17388. "use strict";
  17389. __webpack_require__.r(__webpack_exports__);
  17390. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17391. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17392. /* harmony export */ });
  17393. /* 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");
  17394. /* 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__);
  17395. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17396. var options = {};
  17397. options.insert = "head";
  17398. options.singleton = false;
  17399. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17400. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17401. /***/ }),
  17402. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17403. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17404. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17405. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17406. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17407. "use strict";
  17408. __webpack_require__.r(__webpack_exports__);
  17409. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17410. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17411. /* harmony export */ });
  17412. /* 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");
  17413. /* 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__);
  17414. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17415. var options = {};
  17416. options.insert = "head";
  17417. options.singleton = false;
  17418. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17419. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17420. /***/ }),
  17421. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17422. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17423. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17424. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17425. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17426. "use strict";
  17427. __webpack_require__.r(__webpack_exports__);
  17428. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17429. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17430. /* harmony export */ });
  17431. /* 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");
  17432. /* 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__);
  17433. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17434. var options = {};
  17435. options.insert = "head";
  17436. options.singleton = false;
  17437. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17438. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17439. /***/ }),
  17440. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17441. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17442. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17443. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17444. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17445. "use strict";
  17446. __webpack_require__.r(__webpack_exports__);
  17447. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17448. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17449. /* harmony export */ });
  17450. /* 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");
  17451. /* 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__);
  17452. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17453. var options = {};
  17454. options.insert = "head";
  17455. options.singleton = false;
  17456. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17457. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17458. /***/ }),
  17459. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17460. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17461. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17462. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17463. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17464. "use strict";
  17465. __webpack_require__.r(__webpack_exports__);
  17466. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17467. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17468. /* harmony export */ });
  17469. /* 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");
  17470. /* 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__);
  17471. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17472. var options = {};
  17473. options.insert = "head";
  17474. options.singleton = false;
  17475. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17476. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17477. /***/ }),
  17478. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17479. /*!******************************************************!*\
  17480. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17481. \******************************************************/
  17482. /***/ ((__unused_webpack_module, exports) => {
  17483. "use strict";
  17484. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17485. // runtime helper for setting properties on components
  17486. // in a tree-shakable way
  17487. exports["default"] = (sfc, props) => {
  17488. const target = sfc.__vccOpts || sfc;
  17489. for (const [key, val] of props) {
  17490. target[key] = val;
  17491. }
  17492. return target;
  17493. };
  17494. /***/ }),
  17495. /***/ "./resources/js/components/AppButtonLink.vue":
  17496. /*!***************************************************!*\
  17497. !*** ./resources/js/components/AppButtonLink.vue ***!
  17498. \***************************************************/
  17499. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17500. "use strict";
  17501. __webpack_require__.r(__webpack_exports__);
  17502. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17503. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17504. /* harmony export */ });
  17505. /* harmony import */ var _AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17506. /* harmony import */ var _AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17507. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_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");
  17508. ;
  17509. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButtonLink.vue"]])
  17510. /* hot reload */
  17511. if (false) {}
  17512. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17513. /***/ }),
  17514. /***/ "./resources/js/components/AppFooter.vue":
  17515. /*!***********************************************!*\
  17516. !*** ./resources/js/components/AppFooter.vue ***!
  17517. \***********************************************/
  17518. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17519. "use strict";
  17520. __webpack_require__.r(__webpack_exports__);
  17521. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17522. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17523. /* harmony export */ });
  17524. /* harmony import */ var _AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17525. /* harmony import */ var _AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17526. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_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");
  17527. const script = {}
  17528. ;
  17529. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17530. /* hot reload */
  17531. if (false) {}
  17532. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17533. /***/ }),
  17534. /***/ "./resources/js/components/AppMessage.vue":
  17535. /*!************************************************!*\
  17536. !*** ./resources/js/components/AppMessage.vue ***!
  17537. \************************************************/
  17538. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17539. "use strict";
  17540. __webpack_require__.r(__webpack_exports__);
  17541. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17542. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17543. /* harmony export */ });
  17544. /* 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");
  17545. /* 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");
  17546. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_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");
  17547. ;
  17548. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_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"]])
  17549. /* hot reload */
  17550. if (false) {}
  17551. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17552. /***/ }),
  17553. /***/ "./resources/js/components/AppPagination.vue":
  17554. /*!***************************************************!*\
  17555. !*** ./resources/js/components/AppPagination.vue ***!
  17556. \***************************************************/
  17557. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17558. "use strict";
  17559. __webpack_require__.r(__webpack_exports__);
  17560. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17561. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17562. /* harmony export */ });
  17563. /* harmony import */ var _AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0");
  17564. /* harmony import */ var _AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17565. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_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");
  17566. ;
  17567. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17568. /* hot reload */
  17569. if (false) {}
  17570. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17571. /***/ }),
  17572. /***/ "./resources/js/components/AppSidebar.vue":
  17573. /*!************************************************!*\
  17574. !*** ./resources/js/components/AppSidebar.vue ***!
  17575. \************************************************/
  17576. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17577. "use strict";
  17578. __webpack_require__.r(__webpack_exports__);
  17579. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17580. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17581. /* harmony export */ });
  17582. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17583. /* 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");
  17584. /* harmony import */ var _AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17585. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_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");
  17586. ;
  17587. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17588. /* hot reload */
  17589. if (false) {}
  17590. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17591. /***/ }),
  17592. /***/ "./resources/js/components/AppSubSidebar.vue":
  17593. /*!***************************************************!*\
  17594. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17595. \***************************************************/
  17596. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17597. "use strict";
  17598. __webpack_require__.r(__webpack_exports__);
  17599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17600. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17601. /* harmony export */ });
  17602. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17603. /* 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");
  17604. /* harmony import */ var _AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17605. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_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");
  17606. ;
  17607. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17608. /* hot reload */
  17609. if (false) {}
  17610. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17611. /***/ }),
  17612. /***/ "./resources/js/components/AppTopBar.vue":
  17613. /*!***********************************************!*\
  17614. !*** ./resources/js/components/AppTopBar.vue ***!
  17615. \***********************************************/
  17616. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17617. "use strict";
  17618. __webpack_require__.r(__webpack_exports__);
  17619. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17620. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17621. /* harmony export */ });
  17622. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17623. /* 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");
  17624. /* harmony import */ var _AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17625. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_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");
  17626. ;
  17627. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17628. /* hot reload */
  17629. if (false) {}
  17630. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17631. /***/ }),
  17632. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17633. /*!**************************************************!*\
  17634. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17635. \**************************************************/
  17636. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17637. "use strict";
  17638. __webpack_require__.r(__webpack_exports__);
  17639. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17640. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17641. /* harmony export */ });
  17642. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17643. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17644. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17645. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_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");
  17646. ;
  17647. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17648. /* hot reload */
  17649. if (false) {}
  17650. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17651. /***/ }),
  17652. /***/ "./resources/js/pages/expense/Index.vue":
  17653. /*!**********************************************!*\
  17654. !*** ./resources/js/pages/expense/Index.vue ***!
  17655. \**********************************************/
  17656. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17657. "use strict";
  17658. __webpack_require__.r(__webpack_exports__);
  17659. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17660. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17661. /* harmony export */ });
  17662. /* harmony import */ var _Index_vue_vue_type_template_id_2507f822__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=2507f822 */ "./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822");
  17663. /* 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/expense/Index.vue?vue&type=script&setup=true&lang=js");
  17664. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_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");
  17665. ;
  17666. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_2507f822__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/expense/Index.vue"]])
  17667. /* hot reload */
  17668. if (false) {}
  17669. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17670. /***/ }),
  17671. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17672. /*!**************************************************************************************!*\
  17673. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17674. \**************************************************************************************/
  17675. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17676. "use strict";
  17677. __webpack_require__.r(__webpack_exports__);
  17678. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17679. /* 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_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17680. /* harmony export */ });
  17681. /* 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_AppButtonLink_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]!./AppButtonLink.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/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17682. /***/ }),
  17683. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17684. /*!***********************************************************************************!*\
  17685. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17686. \***********************************************************************************/
  17687. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17688. "use strict";
  17689. __webpack_require__.r(__webpack_exports__);
  17690. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17691. /* 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"])
  17692. /* harmony export */ });
  17693. /* 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");
  17694. /***/ }),
  17695. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17696. /*!**************************************************************************************!*\
  17697. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17698. \**************************************************************************************/
  17699. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17700. "use strict";
  17701. __webpack_require__.r(__webpack_exports__);
  17702. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17703. /* 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_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17704. /* harmony export */ });
  17705. /* 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_AppPagination_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]!./AppPagination.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/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17706. /***/ }),
  17707. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17708. /*!***********************************************************************************!*\
  17709. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17710. \***********************************************************************************/
  17711. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17712. "use strict";
  17713. __webpack_require__.r(__webpack_exports__);
  17714. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17715. /* 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"])
  17716. /* harmony export */ });
  17717. /* 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");
  17718. /***/ }),
  17719. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17720. /*!**************************************************************************************!*\
  17721. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17722. \**************************************************************************************/
  17723. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17724. "use strict";
  17725. __webpack_require__.r(__webpack_exports__);
  17726. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17727. /* 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"])
  17728. /* harmony export */ });
  17729. /* 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");
  17730. /***/ }),
  17731. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17732. /*!**********************************************************************************!*\
  17733. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17734. \**********************************************************************************/
  17735. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17736. "use strict";
  17737. __webpack_require__.r(__webpack_exports__);
  17738. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17739. /* 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"])
  17740. /* harmony export */ });
  17741. /* 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");
  17742. /***/ }),
  17743. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17744. /*!*************************************************************************************!*\
  17745. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17746. \*************************************************************************************/
  17747. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17748. "use strict";
  17749. __webpack_require__.r(__webpack_exports__);
  17750. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17751. /* 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_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17752. /* harmony export */ });
  17753. /* 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_DashboardLayout_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]!./DashboardLayout.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/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17754. /***/ }),
  17755. /***/ "./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js":
  17756. /*!*********************************************************************************!*\
  17757. !*** ./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js ***!
  17758. \*********************************************************************************/
  17759. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17760. "use strict";
  17761. __webpack_require__.r(__webpack_exports__);
  17762. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17763. /* 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"])
  17764. /* harmony export */ });
  17765. /* 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/expense/Index.vue?vue&type=script&setup=true&lang=js");
  17766. /***/ }),
  17767. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17768. /*!*********************************************************************************!*\
  17769. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17770. \*********************************************************************************/
  17771. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17772. "use strict";
  17773. __webpack_require__.r(__webpack_exports__);
  17774. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17775. /* 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_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render)
  17776. /* harmony export */ });
  17777. /* 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_AppButtonLink_vue_vue_type_template_id_c3621f1c__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]!./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./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/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17778. /***/ }),
  17779. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17780. /*!*****************************************************************************************!*\
  17781. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17782. \*****************************************************************************************/
  17783. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17784. "use strict";
  17785. __webpack_require__.r(__webpack_exports__);
  17786. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17787. /* 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_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17788. /* harmony export */ });
  17789. /* 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_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]!./AppFooter.vue?vue&type=template&id=4ab6097e&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/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17790. /***/ }),
  17791. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17792. /*!******************************************************************************!*\
  17793. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17794. \******************************************************************************/
  17795. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17796. "use strict";
  17797. __webpack_require__.r(__webpack_exports__);
  17798. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17799. /* 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)
  17800. /* harmony export */ });
  17801. /* 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");
  17802. /***/ }),
  17803. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17804. /*!*********************************************************************************!*\
  17805. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17806. \*********************************************************************************/
  17807. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17808. "use strict";
  17809. __webpack_require__.r(__webpack_exports__);
  17810. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17811. /* 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_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17812. /* harmony export */ });
  17813. /* 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_AppPagination_vue_vue_type_template_id_4da56ec0__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]!./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./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/AppPagination.vue?vue&type=template&id=4da56ec0");
  17814. /***/ }),
  17815. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17816. /*!******************************************************************************************!*\
  17817. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17818. \******************************************************************************************/
  17819. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17820. "use strict";
  17821. __webpack_require__.r(__webpack_exports__);
  17822. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17823. /* 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_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17824. /* harmony export */ });
  17825. /* 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_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]!./AppSidebar.vue?vue&type=template&id=22a4e926&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/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17826. /***/ }),
  17827. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17828. /*!*********************************************************************************************!*\
  17829. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17830. \*********************************************************************************************/
  17831. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17832. "use strict";
  17833. __webpack_require__.r(__webpack_exports__);
  17834. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17835. /* 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_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17836. /* harmony export */ });
  17837. /* 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_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]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc&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/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17838. /***/ }),
  17839. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17840. /*!*****************************************************************************************!*\
  17841. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17842. \*****************************************************************************************/
  17843. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17844. "use strict";
  17845. __webpack_require__.r(__webpack_exports__);
  17846. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17847. /* 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_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17848. /* harmony export */ });
  17849. /* 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_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]!./AppTopBar.vue?vue&type=template&id=42bf62a4&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/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17850. /***/ }),
  17851. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17852. /*!********************************************************************************************!*\
  17853. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17854. \********************************************************************************************/
  17855. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17856. "use strict";
  17857. __webpack_require__.r(__webpack_exports__);
  17858. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17859. /* 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_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17860. /* harmony export */ });
  17861. /* 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_DashboardLayout_vue_vue_type_template_id_549bf5ac_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]!./DashboardLayout.vue?vue&type=template&id=549bf5ac&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/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17862. /***/ }),
  17863. /***/ "./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822":
  17864. /*!****************************************************************************!*\
  17865. !*** ./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822 ***!
  17866. \****************************************************************************/
  17867. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17868. "use strict";
  17869. __webpack_require__.r(__webpack_exports__);
  17870. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17871. /* 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_2507f822__WEBPACK_IMPORTED_MODULE_0__.render)
  17872. /* harmony export */ });
  17873. /* 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_2507f822__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=2507f822 */ "./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/expense/Index.vue?vue&type=template&id=2507f822");
  17874. /***/ }),
  17875. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17876. /*!********************************************************************************************************!*\
  17877. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17878. \********************************************************************************************************/
  17879. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17880. "use strict";
  17881. __webpack_require__.r(__webpack_exports__);
  17882. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17883. /***/ }),
  17884. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17885. /*!*********************************************************************************************************!*\
  17886. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17887. \*********************************************************************************************************/
  17888. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17889. "use strict";
  17890. __webpack_require__.r(__webpack_exports__);
  17891. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17892. /***/ }),
  17893. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17894. /*!************************************************************************************************************!*\
  17895. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17896. \************************************************************************************************************/
  17897. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17898. "use strict";
  17899. __webpack_require__.r(__webpack_exports__);
  17900. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17901. /***/ }),
  17902. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17903. /*!********************************************************************************************************!*\
  17904. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17905. \********************************************************************************************************/
  17906. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17907. "use strict";
  17908. __webpack_require__.r(__webpack_exports__);
  17909. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17910. /***/ }),
  17911. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17912. /*!***********************************************************************************************************!*\
  17913. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17914. \***********************************************************************************************************/
  17915. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17916. "use strict";
  17917. __webpack_require__.r(__webpack_exports__);
  17918. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17919. /***/ })
  17920. }]);