resources_js_pages_expense_Index_vue.js 702KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376
  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, "Profil Saya", -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, "Sign Out", -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. 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"], {
  719. href: "/",
  720. "class": "layout-topbar-logo"
  721. }, {
  722. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  723. return [_hoisted_2, _hoisted_3];
  724. }),
  725. _: 1
  726. /* STABLE */
  727. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  728. "class": "p-link layout-menu-button layout-topbar-button",
  729. onClick: _cache[0] || (_cache[0] = function ($event) {
  730. return _ctx.$emit('menu-toggle', $event);
  731. })
  732. }, _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, {
  733. selector: '@next',
  734. enterClass: 'hidden',
  735. enterActiveClass: 'scalein',
  736. leaveToClass: 'hidden',
  737. leaveActiveClass: 'fadeout',
  738. hideOnOutsideClick: true
  739. }]]), (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
  740. /* TEXT */
  741. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  742. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  743. "class": "p-link layout-topbar-button"
  744. }, {
  745. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  746. return [_hoisted_12, _hoisted_13];
  747. }),
  748. _: 1
  749. /* STABLE */
  750. }, 8
  751. /* PROPS */
  752. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  753. href: _ctx.route('logout'),
  754. as: "button",
  755. method: "post",
  756. "class": "p-link layout-topbar-button"
  757. }, {
  758. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  759. return [_hoisted_14, _hoisted_15];
  760. }),
  761. _: 1
  762. /* STABLE */
  763. }, 8
  764. /* PROPS */
  765. , ["href"])])])]);
  766. }
  767. /***/ }),
  768. /***/ "./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":
  769. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  770. !*** ./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 ***!
  771. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  772. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  773. "use strict";
  774. __webpack_require__.r(__webpack_exports__);
  775. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  776. /* harmony export */ "render": () => (/* binding */ render)
  777. /* harmony export */ });
  778. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  779. var _withScopeId = function _withScopeId(n) {
  780. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  781. };
  782. var _hoisted_1 = {
  783. "class": "layout-sidebar"
  784. };
  785. var _hoisted_2 = {
  786. "class": "layout-main-container"
  787. };
  788. var _hoisted_3 = {
  789. "class": "layout-main"
  790. };
  791. var _hoisted_4 = {
  792. key: 0,
  793. "class": "layout-mask p-component-overlay"
  794. };
  795. function render(_ctx, _cache, $props, $setup, $data, $options) {
  796. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  797. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  798. onClick: $setup.onWrapperClick
  799. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  800. onMenuToggle: $setup.onMenuToggle
  801. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  802. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  803. }, null, 8
  804. /* PROPS */
  805. , ["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, {
  806. name: "layout-mask"
  807. }, {
  808. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  809. 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)];
  810. }),
  811. _: 1
  812. /* STABLE */
  813. })], 2
  814. /* CLASS */
  815. );
  816. }
  817. /***/ }),
  818. /***/ "./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":
  819. /*!******************************************************************************************************************************************************************************************************************************************************************************!*\
  820. !*** ./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 ***!
  821. \******************************************************************************************************************************************************************************************************************************************************************************/
  822. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  823. "use strict";
  824. __webpack_require__.r(__webpack_exports__);
  825. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  826. /* harmony export */ "render": () => (/* binding */ render)
  827. /* harmony export */ });
  828. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  829. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Pengeluaran", -1
  830. /* HOISTED */
  831. );
  832. var _hoisted_2 = {
  833. "class": "grid"
  834. };
  835. var _hoisted_3 = {
  836. "class": "col-12 md:col-8"
  837. };
  838. var _hoisted_4 = {
  839. "class": "grid"
  840. };
  841. var _hoisted_5 = {
  842. "class": "col-12 md:col-4"
  843. };
  844. var _hoisted_6 = {
  845. "class": "col-auto mt-2 ml-2"
  846. };
  847. var _hoisted_7 = {
  848. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  849. };
  850. function render(_ctx, _cache, $props, $setup, $data, $options) {
  851. var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
  852. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  853. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  854. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  855. 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"], {
  856. title: "Pengeluaran"
  857. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  858. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  859. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  860. "responsive-layout": "scroll",
  861. "column-resize-mode": "expand",
  862. value: $props.expenses.data,
  863. "row-hover": true,
  864. "striped-rows": true
  865. }, {
  866. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  867. 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, {
  868. "touch-u-i": "",
  869. "class": "w-full",
  870. modelValue: $setup.dates,
  871. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  872. return $setup.dates = $event;
  873. }),
  874. "selection-mode": "range",
  875. placeholder: "filter waktu...",
  876. "date-format": "dd/mm/yy",
  877. "manual-input": false
  878. }, null, 8
  879. /* PROPS */
  880. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  881. label: "reset",
  882. "class": "p-button-link",
  883. onClick: $setup.filterReset
  884. })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  885. label: "Tambah Pengeluaran",
  886. "class": "p-button-outlined",
  887. icon: "pi pi-pencil",
  888. href: _ctx.route('expenses.create')
  889. }, null, 8
  890. /* PROPS */
  891. , ["href"])])])];
  892. }),
  893. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  894. 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) {
  895. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  896. field: value.field,
  897. header: value.header,
  898. key: value.field
  899. }, null, 8
  900. /* PROPS */
  901. , ["field", "header"]);
  902. }), 128
  903. /* KEYED_FRAGMENT */
  904. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  905. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  906. var data = _ref.data;
  907. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  908. icon: "pi pi-eye",
  909. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  910. href: _ctx.route('expenses.show', data.id)
  911. }, null, 8
  912. /* PROPS */
  913. , ["href"])];
  914. }),
  915. _: 1
  916. /* STABLE */
  917. })];
  918. }),
  919. _: 1
  920. /* STABLE */
  921. }, 8
  922. /* PROPS */
  923. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  924. links: $props.expenses.links
  925. }, null, 8
  926. /* PROPS */
  927. , ["links"])];
  928. }),
  929. _: 1
  930. /* STABLE */
  931. })], 64
  932. /* STABLE_FRAGMENT */
  933. );
  934. }
  935. /***/ }),
  936. /***/ "./resources/js/components/useDateRangeFilter.js":
  937. /*!*******************************************************!*\
  938. !*** ./resources/js/components/useDateRangeFilter.js ***!
  939. \*******************************************************/
  940. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  941. "use strict";
  942. __webpack_require__.r(__webpack_exports__);
  943. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  944. /* harmony export */ "useDateRangeFilter": () => (/* binding */ useDateRangeFilter)
  945. /* harmony export */ });
  946. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  947. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
  948. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
  949. function useDateRangeFilter(props) {
  950. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  951. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  952. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  953. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  954. if (!props.initialDateRange) {
  955. return;
  956. }
  957. if (props.initialDateRange[0] || props.initialDateRange[1]) {
  958. if (props.initialDateRange[1]) {
  959. dates.value = [new Date(props.initialDateRange[0]), new Date(props.initialDateRange[1])];
  960. } else {
  961. dates.value = [new Date(props.props.initialDateRange[1]), null];
  962. }
  963. }
  964. });
  965. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  966. if (dates.value[1]) {
  967. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  968. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  969. } else if (dates.value[0]) {
  970. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  971. endDate.value = null;
  972. }
  973. });
  974. return {
  975. dates: dates,
  976. startDate: startDate,
  977. endDate: endDate
  978. };
  979. }
  980. /***/ }),
  981. /***/ "./resources/js/pages/expense/tableHeader.js":
  982. /*!***************************************************!*\
  983. !*** ./resources/js/pages/expense/tableHeader.js ***!
  984. \***************************************************/
  985. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  986. "use strict";
  987. __webpack_require__.r(__webpack_exports__);
  988. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  989. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  990. /* harmony export */ });
  991. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  992. field: 'createdAt',
  993. header: 'Tanggal'
  994. }, {
  995. field: 'amount',
  996. header: 'Pengeluaran'
  997. }, {
  998. field: 'user',
  999. header: 'User'
  1000. }]);
  1001. /***/ }),
  1002. /***/ "./resources/js/utils/menu.js":
  1003. /*!************************************!*\
  1004. !*** ./resources/js/utils/menu.js ***!
  1005. \************************************/
  1006. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1007. "use strict";
  1008. __webpack_require__.r(__webpack_exports__);
  1009. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1010. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1011. /* harmony export */ });
  1012. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1013. // Admin
  1014. 1: [{
  1015. label: 'Home',
  1016. items: [{
  1017. label: 'Dashboard',
  1018. icon: 'pi pi-home',
  1019. to: '/dashboards',
  1020. component: 'home/Index'
  1021. }]
  1022. }, {
  1023. label: 'Master',
  1024. items: [{
  1025. label: 'User',
  1026. icon: 'pi pi-user',
  1027. to: '/users',
  1028. component: 'user/Index'
  1029. }]
  1030. }],
  1031. // Supervisor
  1032. 2: [{
  1033. label: 'Home',
  1034. items: [{
  1035. label: 'Dashboard',
  1036. icon: 'pi pi-home',
  1037. to: '/dashboards',
  1038. component: 'home/Index'
  1039. }]
  1040. }, {
  1041. label: 'Menu',
  1042. items: [{
  1043. label: 'Pengeluaran',
  1044. icon: 'pi pi-wallet',
  1045. to: '/expenses',
  1046. component: 'expense/Index'
  1047. }, {
  1048. label: 'Laporan',
  1049. icon: 'pi pi-book',
  1050. items: [{
  1051. label: 'Mutasi',
  1052. icon: 'pi pi-circle',
  1053. to: '/reports/mutations',
  1054. component: 'mutation/Report'
  1055. }]
  1056. }]
  1057. }, {
  1058. label: 'Master',
  1059. items: [{
  1060. label: 'Jenis Kendaraan',
  1061. icon: 'pi pi-car',
  1062. to: '/type-vehicles',
  1063. component: 'typevehicle/Index'
  1064. }, {
  1065. label: 'Jenis Member',
  1066. icon: 'pi pi-id-card',
  1067. to: '/type-members',
  1068. component: 'typemember/Index'
  1069. }]
  1070. }, {
  1071. label: 'Pengaturan',
  1072. items: [{
  1073. label: 'Tarif Parkir',
  1074. icon: 'pi pi-car',
  1075. to: '/parking-fees/create',
  1076. component: 'parkingfee/Create'
  1077. }]
  1078. }],
  1079. // Operator
  1080. 3: [{
  1081. label: 'Home',
  1082. items: [{
  1083. label: 'Dashboard',
  1084. icon: 'pi pi-home',
  1085. to: '/dashboards',
  1086. component: 'home/Index'
  1087. }]
  1088. }, {
  1089. label: 'Menu',
  1090. items: [{
  1091. label: 'Pengeluaran',
  1092. icon: 'pi pi-wallet',
  1093. to: '/expenses',
  1094. component: 'expense/Index'
  1095. }, {
  1096. label: 'Member',
  1097. icon: 'pi pi-id-card',
  1098. to: '/members',
  1099. component: 'member/Index'
  1100. }, {
  1101. label: 'Top Up',
  1102. icon: 'pi pi-car',
  1103. to: '/top-ups',
  1104. component: 'topup/Index'
  1105. }]
  1106. }]
  1107. });
  1108. /***/ }),
  1109. /***/ "./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":
  1110. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1111. !*** ./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 ***!
  1112. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1113. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1114. "use strict";
  1115. __webpack_require__.r(__webpack_exports__);
  1116. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1117. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1118. /* harmony export */ });
  1119. /* 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");
  1120. /* 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__);
  1121. // Imports
  1122. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1123. // Module
  1124. ___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}", ""]);
  1125. // Exports
  1126. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  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/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&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/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&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-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\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/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&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/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&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, "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}", ""]);
  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/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&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/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&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, ".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: 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}", ""]);
  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/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&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/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&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-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}", ""]);
  1201. // Exports
  1202. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1203. /***/ }),
  1204. /***/ "./node_modules/dayjs/dayjs.min.js":
  1205. /*!*****************************************!*\
  1206. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1207. \*****************************************/
  1208. /***/ (function(module) {
  1209. !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}));
  1210. /***/ }),
  1211. /***/ "./node_modules/lodash/lodash.js":
  1212. /*!***************************************!*\
  1213. !*** ./node_modules/lodash/lodash.js ***!
  1214. \***************************************/
  1215. /***/ (function(module, exports, __webpack_require__) {
  1216. /* module decorator */ module = __webpack_require__.nmd(module);
  1217. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1218. * @license
  1219. * Lodash <https://lodash.com/>
  1220. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1221. * Released under MIT license <https://lodash.com/license>
  1222. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1223. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1224. */
  1225. ;(function() {
  1226. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1227. var undefined;
  1228. /** Used as the semantic version number. */
  1229. var VERSION = '4.17.21';
  1230. /** Used as the size to enable large array optimizations. */
  1231. var LARGE_ARRAY_SIZE = 200;
  1232. /** Error message constants. */
  1233. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1234. FUNC_ERROR_TEXT = 'Expected a function',
  1235. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1236. /** Used to stand-in for `undefined` hash values. */
  1237. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1238. /** Used as the maximum memoize cache size. */
  1239. var MAX_MEMOIZE_SIZE = 500;
  1240. /** Used as the internal argument placeholder. */
  1241. var PLACEHOLDER = '__lodash_placeholder__';
  1242. /** Used to compose bitmasks for cloning. */
  1243. var CLONE_DEEP_FLAG = 1,
  1244. CLONE_FLAT_FLAG = 2,
  1245. CLONE_SYMBOLS_FLAG = 4;
  1246. /** Used to compose bitmasks for value comparisons. */
  1247. var COMPARE_PARTIAL_FLAG = 1,
  1248. COMPARE_UNORDERED_FLAG = 2;
  1249. /** Used to compose bitmasks for function metadata. */
  1250. var WRAP_BIND_FLAG = 1,
  1251. WRAP_BIND_KEY_FLAG = 2,
  1252. WRAP_CURRY_BOUND_FLAG = 4,
  1253. WRAP_CURRY_FLAG = 8,
  1254. WRAP_CURRY_RIGHT_FLAG = 16,
  1255. WRAP_PARTIAL_FLAG = 32,
  1256. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1257. WRAP_ARY_FLAG = 128,
  1258. WRAP_REARG_FLAG = 256,
  1259. WRAP_FLIP_FLAG = 512;
  1260. /** Used as default options for `_.truncate`. */
  1261. var DEFAULT_TRUNC_LENGTH = 30,
  1262. DEFAULT_TRUNC_OMISSION = '...';
  1263. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1264. var HOT_COUNT = 800,
  1265. HOT_SPAN = 16;
  1266. /** Used to indicate the type of lazy iteratees. */
  1267. var LAZY_FILTER_FLAG = 1,
  1268. LAZY_MAP_FLAG = 2,
  1269. LAZY_WHILE_FLAG = 3;
  1270. /** Used as references for various `Number` constants. */
  1271. var INFINITY = 1 / 0,
  1272. MAX_SAFE_INTEGER = 9007199254740991,
  1273. MAX_INTEGER = 1.7976931348623157e+308,
  1274. NAN = 0 / 0;
  1275. /** Used as references for the maximum length and index of an array. */
  1276. var MAX_ARRAY_LENGTH = 4294967295,
  1277. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1278. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1279. /** Used to associate wrap methods with their bit flags. */
  1280. var wrapFlags = [
  1281. ['ary', WRAP_ARY_FLAG],
  1282. ['bind', WRAP_BIND_FLAG],
  1283. ['bindKey', WRAP_BIND_KEY_FLAG],
  1284. ['curry', WRAP_CURRY_FLAG],
  1285. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1286. ['flip', WRAP_FLIP_FLAG],
  1287. ['partial', WRAP_PARTIAL_FLAG],
  1288. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1289. ['rearg', WRAP_REARG_FLAG]
  1290. ];
  1291. /** `Object#toString` result references. */
  1292. var argsTag = '[object Arguments]',
  1293. arrayTag = '[object Array]',
  1294. asyncTag = '[object AsyncFunction]',
  1295. boolTag = '[object Boolean]',
  1296. dateTag = '[object Date]',
  1297. domExcTag = '[object DOMException]',
  1298. errorTag = '[object Error]',
  1299. funcTag = '[object Function]',
  1300. genTag = '[object GeneratorFunction]',
  1301. mapTag = '[object Map]',
  1302. numberTag = '[object Number]',
  1303. nullTag = '[object Null]',
  1304. objectTag = '[object Object]',
  1305. promiseTag = '[object Promise]',
  1306. proxyTag = '[object Proxy]',
  1307. regexpTag = '[object RegExp]',
  1308. setTag = '[object Set]',
  1309. stringTag = '[object String]',
  1310. symbolTag = '[object Symbol]',
  1311. undefinedTag = '[object Undefined]',
  1312. weakMapTag = '[object WeakMap]',
  1313. weakSetTag = '[object WeakSet]';
  1314. var arrayBufferTag = '[object ArrayBuffer]',
  1315. dataViewTag = '[object DataView]',
  1316. float32Tag = '[object Float32Array]',
  1317. float64Tag = '[object Float64Array]',
  1318. int8Tag = '[object Int8Array]',
  1319. int16Tag = '[object Int16Array]',
  1320. int32Tag = '[object Int32Array]',
  1321. uint8Tag = '[object Uint8Array]',
  1322. uint8ClampedTag = '[object Uint8ClampedArray]',
  1323. uint16Tag = '[object Uint16Array]',
  1324. uint32Tag = '[object Uint32Array]';
  1325. /** Used to match empty string literals in compiled template source. */
  1326. var reEmptyStringLeading = /\b__p \+= '';/g,
  1327. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1328. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1329. /** Used to match HTML entities and HTML characters. */
  1330. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1331. reUnescapedHtml = /[&<>"']/g,
  1332. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1333. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1334. /** Used to match template delimiters. */
  1335. var reEscape = /<%-([\s\S]+?)%>/g,
  1336. reEvaluate = /<%([\s\S]+?)%>/g,
  1337. reInterpolate = /<%=([\s\S]+?)%>/g;
  1338. /** Used to match property names within property paths. */
  1339. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1340. reIsPlainProp = /^\w*$/,
  1341. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1342. /**
  1343. * Used to match `RegExp`
  1344. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1345. */
  1346. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1347. reHasRegExpChar = RegExp(reRegExpChar.source);
  1348. /** Used to match leading whitespace. */
  1349. var reTrimStart = /^\s+/;
  1350. /** Used to match a single whitespace character. */
  1351. var reWhitespace = /\s/;
  1352. /** Used to match wrap detail comments. */
  1353. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1354. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1355. reSplitDetails = /,? & /;
  1356. /** Used to match words composed of alphanumeric characters. */
  1357. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1358. /**
  1359. * Used to validate the `validate` option in `_.template` variable.
  1360. *
  1361. * Forbids characters which could potentially change the meaning of the function argument definition:
  1362. * - "()," (modification of function parameters)
  1363. * - "=" (default value)
  1364. * - "[]{}" (destructuring of function parameters)
  1365. * - "/" (beginning of a comment)
  1366. * - whitespace
  1367. */
  1368. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1369. /** Used to match backslashes in property paths. */
  1370. var reEscapeChar = /\\(\\)?/g;
  1371. /**
  1372. * Used to match
  1373. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1374. */
  1375. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1376. /** Used to match `RegExp` flags from their coerced string values. */
  1377. var reFlags = /\w*$/;
  1378. /** Used to detect bad signed hexadecimal string values. */
  1379. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1380. /** Used to detect binary string values. */
  1381. var reIsBinary = /^0b[01]+$/i;
  1382. /** Used to detect host constructors (Safari). */
  1383. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1384. /** Used to detect octal string values. */
  1385. var reIsOctal = /^0o[0-7]+$/i;
  1386. /** Used to detect unsigned integer values. */
  1387. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1388. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1389. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1390. /** Used to ensure capturing order of template delimiters. */
  1391. var reNoMatch = /($^)/;
  1392. /** Used to match unescaped characters in compiled string literals. */
  1393. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1394. /** Used to compose unicode character classes. */
  1395. var rsAstralRange = '\\ud800-\\udfff',
  1396. rsComboMarksRange = '\\u0300-\\u036f',
  1397. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1398. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1399. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1400. rsDingbatRange = '\\u2700-\\u27bf',
  1401. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1402. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1403. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1404. rsPunctuationRange = '\\u2000-\\u206f',
  1405. 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',
  1406. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1407. rsVarRange = '\\ufe0e\\ufe0f',
  1408. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1409. /** Used to compose unicode capture groups. */
  1410. var rsApos = "['\u2019]",
  1411. rsAstral = '[' + rsAstralRange + ']',
  1412. rsBreak = '[' + rsBreakRange + ']',
  1413. rsCombo = '[' + rsComboRange + ']',
  1414. rsDigits = '\\d+',
  1415. rsDingbat = '[' + rsDingbatRange + ']',
  1416. rsLower = '[' + rsLowerRange + ']',
  1417. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1418. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1419. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1420. rsNonAstral = '[^' + rsAstralRange + ']',
  1421. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1422. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1423. rsUpper = '[' + rsUpperRange + ']',
  1424. rsZWJ = '\\u200d';
  1425. /** Used to compose unicode regexes. */
  1426. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1427. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1428. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1429. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1430. reOptMod = rsModifier + '?',
  1431. rsOptVar = '[' + rsVarRange + ']?',
  1432. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1433. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1434. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1435. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1436. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1437. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1438. /** Used to match apostrophes. */
  1439. var reApos = RegExp(rsApos, 'g');
  1440. /**
  1441. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1442. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1443. */
  1444. var reComboMark = RegExp(rsCombo, 'g');
  1445. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1446. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1447. /** Used to match complex or compound words. */
  1448. var reUnicodeWord = RegExp([
  1449. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1450. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1451. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1452. rsUpper + '+' + rsOptContrUpper,
  1453. rsOrdUpper,
  1454. rsOrdLower,
  1455. rsDigits,
  1456. rsEmoji
  1457. ].join('|'), 'g');
  1458. /** 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/). */
  1459. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1460. /** Used to detect strings that need a more robust regexp to match words. */
  1461. 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 ]/;
  1462. /** Used to assign default `context` object properties. */
  1463. var contextProps = [
  1464. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1465. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1466. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1467. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1468. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1469. ];
  1470. /** Used to make template sourceURLs easier to identify. */
  1471. var templateCounter = -1;
  1472. /** Used to identify `toStringTag` values of typed arrays. */
  1473. var typedArrayTags = {};
  1474. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1475. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1476. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1477. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1478. typedArrayTags[uint32Tag] = true;
  1479. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1480. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1481. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1482. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1483. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1484. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1485. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1486. typedArrayTags[weakMapTag] = false;
  1487. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1488. var cloneableTags = {};
  1489. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1490. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1491. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1492. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1493. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1494. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1495. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1496. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1497. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1498. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1499. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1500. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1501. cloneableTags[weakMapTag] = false;
  1502. /** Used to map Latin Unicode letters to basic Latin letters. */
  1503. var deburredLetters = {
  1504. // Latin-1 Supplement block.
  1505. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1506. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1507. '\xc7': 'C', '\xe7': 'c',
  1508. '\xd0': 'D', '\xf0': 'd',
  1509. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1510. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1511. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1512. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1513. '\xd1': 'N', '\xf1': 'n',
  1514. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1515. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1516. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1517. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1518. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1519. '\xc6': 'Ae', '\xe6': 'ae',
  1520. '\xde': 'Th', '\xfe': 'th',
  1521. '\xdf': 'ss',
  1522. // Latin Extended-A block.
  1523. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1524. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1525. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1526. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1527. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1528. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1529. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1530. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1531. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1532. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1533. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1534. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1535. '\u0134': 'J', '\u0135': 'j',
  1536. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1537. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1538. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1539. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1540. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1541. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1542. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1543. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1544. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1545. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1546. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1547. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1548. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1549. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1550. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1551. '\u0174': 'W', '\u0175': 'w',
  1552. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1553. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1554. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1555. '\u0132': 'IJ', '\u0133': 'ij',
  1556. '\u0152': 'Oe', '\u0153': 'oe',
  1557. '\u0149': "'n", '\u017f': 's'
  1558. };
  1559. /** Used to map characters to HTML entities. */
  1560. var htmlEscapes = {
  1561. '&': '&amp;',
  1562. '<': '&lt;',
  1563. '>': '&gt;',
  1564. '"': '&quot;',
  1565. "'": '&#39;'
  1566. };
  1567. /** Used to map HTML entities to characters. */
  1568. var htmlUnescapes = {
  1569. '&amp;': '&',
  1570. '&lt;': '<',
  1571. '&gt;': '>',
  1572. '&quot;': '"',
  1573. '&#39;': "'"
  1574. };
  1575. /** Used to escape characters for inclusion in compiled string literals. */
  1576. var stringEscapes = {
  1577. '\\': '\\',
  1578. "'": "'",
  1579. '\n': 'n',
  1580. '\r': 'r',
  1581. '\u2028': 'u2028',
  1582. '\u2029': 'u2029'
  1583. };
  1584. /** Built-in method references without a dependency on `root`. */
  1585. var freeParseFloat = parseFloat,
  1586. freeParseInt = parseInt;
  1587. /** Detect free variable `global` from Node.js. */
  1588. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1589. /** Detect free variable `self`. */
  1590. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1591. /** Used as a reference to the global object. */
  1592. var root = freeGlobal || freeSelf || Function('return this')();
  1593. /** Detect free variable `exports`. */
  1594. var freeExports = true && exports && !exports.nodeType && exports;
  1595. /** Detect free variable `module`. */
  1596. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1597. /** Detect the popular CommonJS extension `module.exports`. */
  1598. var moduleExports = freeModule && freeModule.exports === freeExports;
  1599. /** Detect free variable `process` from Node.js. */
  1600. var freeProcess = moduleExports && freeGlobal.process;
  1601. /** Used to access faster Node.js helpers. */
  1602. var nodeUtil = (function() {
  1603. try {
  1604. // Use `util.types` for Node.js 10+.
  1605. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1606. if (types) {
  1607. return types;
  1608. }
  1609. // Legacy `process.binding('util')` for Node.js < 10.
  1610. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1611. } catch (e) {}
  1612. }());
  1613. /* Node.js helper references. */
  1614. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1615. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1616. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1617. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1618. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1619. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1620. /*--------------------------------------------------------------------------*/
  1621. /**
  1622. * A faster alternative to `Function#apply`, this function invokes `func`
  1623. * with the `this` binding of `thisArg` and the arguments of `args`.
  1624. *
  1625. * @private
  1626. * @param {Function} func The function to invoke.
  1627. * @param {*} thisArg The `this` binding of `func`.
  1628. * @param {Array} args The arguments to invoke `func` with.
  1629. * @returns {*} Returns the result of `func`.
  1630. */
  1631. function apply(func, thisArg, args) {
  1632. switch (args.length) {
  1633. case 0: return func.call(thisArg);
  1634. case 1: return func.call(thisArg, args[0]);
  1635. case 2: return func.call(thisArg, args[0], args[1]);
  1636. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1637. }
  1638. return func.apply(thisArg, args);
  1639. }
  1640. /**
  1641. * A specialized version of `baseAggregator` for arrays.
  1642. *
  1643. * @private
  1644. * @param {Array} [array] The array to iterate over.
  1645. * @param {Function} setter The function to set `accumulator` values.
  1646. * @param {Function} iteratee The iteratee to transform keys.
  1647. * @param {Object} accumulator The initial aggregated object.
  1648. * @returns {Function} Returns `accumulator`.
  1649. */
  1650. function arrayAggregator(array, setter, iteratee, accumulator) {
  1651. var index = -1,
  1652. length = array == null ? 0 : array.length;
  1653. while (++index < length) {
  1654. var value = array[index];
  1655. setter(accumulator, value, iteratee(value), array);
  1656. }
  1657. return accumulator;
  1658. }
  1659. /**
  1660. * A specialized version of `_.forEach` for arrays without support for
  1661. * iteratee shorthands.
  1662. *
  1663. * @private
  1664. * @param {Array} [array] The array to iterate over.
  1665. * @param {Function} iteratee The function invoked per iteration.
  1666. * @returns {Array} Returns `array`.
  1667. */
  1668. function arrayEach(array, iteratee) {
  1669. var index = -1,
  1670. length = array == null ? 0 : array.length;
  1671. while (++index < length) {
  1672. if (iteratee(array[index], index, array) === false) {
  1673. break;
  1674. }
  1675. }
  1676. return array;
  1677. }
  1678. /**
  1679. * A specialized version of `_.forEachRight` 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 arrayEachRight(array, iteratee) {
  1688. var length = array == null ? 0 : array.length;
  1689. while (length--) {
  1690. if (iteratee(array[length], length, array) === false) {
  1691. break;
  1692. }
  1693. }
  1694. return array;
  1695. }
  1696. /**
  1697. * A specialized version of `_.every` for arrays without support for
  1698. * iteratee shorthands.
  1699. *
  1700. * @private
  1701. * @param {Array} [array] The array to iterate over.
  1702. * @param {Function} predicate The function invoked per iteration.
  1703. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1704. * else `false`.
  1705. */
  1706. function arrayEvery(array, predicate) {
  1707. var index = -1,
  1708. length = array == null ? 0 : array.length;
  1709. while (++index < length) {
  1710. if (!predicate(array[index], index, array)) {
  1711. return false;
  1712. }
  1713. }
  1714. return true;
  1715. }
  1716. /**
  1717. * A specialized version of `_.filter` for arrays without support for
  1718. * iteratee shorthands.
  1719. *
  1720. * @private
  1721. * @param {Array} [array] The array to iterate over.
  1722. * @param {Function} predicate The function invoked per iteration.
  1723. * @returns {Array} Returns the new filtered array.
  1724. */
  1725. function arrayFilter(array, predicate) {
  1726. var index = -1,
  1727. length = array == null ? 0 : array.length,
  1728. resIndex = 0,
  1729. result = [];
  1730. while (++index < length) {
  1731. var value = array[index];
  1732. if (predicate(value, index, array)) {
  1733. result[resIndex++] = value;
  1734. }
  1735. }
  1736. return result;
  1737. }
  1738. /**
  1739. * A specialized version of `_.includes` for arrays without support for
  1740. * specifying an index to search from.
  1741. *
  1742. * @private
  1743. * @param {Array} [array] The array to inspect.
  1744. * @param {*} target The value to search for.
  1745. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1746. */
  1747. function arrayIncludes(array, value) {
  1748. var length = array == null ? 0 : array.length;
  1749. return !!length && baseIndexOf(array, value, 0) > -1;
  1750. }
  1751. /**
  1752. * This function is like `arrayIncludes` except that it accepts a comparator.
  1753. *
  1754. * @private
  1755. * @param {Array} [array] The array to inspect.
  1756. * @param {*} target The value to search for.
  1757. * @param {Function} comparator The comparator invoked per element.
  1758. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1759. */
  1760. function arrayIncludesWith(array, value, comparator) {
  1761. var index = -1,
  1762. length = array == null ? 0 : array.length;
  1763. while (++index < length) {
  1764. if (comparator(value, array[index])) {
  1765. return true;
  1766. }
  1767. }
  1768. return false;
  1769. }
  1770. /**
  1771. * A specialized version of `_.map` for arrays without support for iteratee
  1772. * shorthands.
  1773. *
  1774. * @private
  1775. * @param {Array} [array] The array to iterate over.
  1776. * @param {Function} iteratee The function invoked per iteration.
  1777. * @returns {Array} Returns the new mapped array.
  1778. */
  1779. function arrayMap(array, iteratee) {
  1780. var index = -1,
  1781. length = array == null ? 0 : array.length,
  1782. result = Array(length);
  1783. while (++index < length) {
  1784. result[index] = iteratee(array[index], index, array);
  1785. }
  1786. return result;
  1787. }
  1788. /**
  1789. * Appends the elements of `values` to `array`.
  1790. *
  1791. * @private
  1792. * @param {Array} array The array to modify.
  1793. * @param {Array} values The values to append.
  1794. * @returns {Array} Returns `array`.
  1795. */
  1796. function arrayPush(array, values) {
  1797. var index = -1,
  1798. length = values.length,
  1799. offset = array.length;
  1800. while (++index < length) {
  1801. array[offset + index] = values[index];
  1802. }
  1803. return array;
  1804. }
  1805. /**
  1806. * A specialized version of `_.reduce` for arrays without support for
  1807. * iteratee shorthands.
  1808. *
  1809. * @private
  1810. * @param {Array} [array] The array to iterate over.
  1811. * @param {Function} iteratee The function invoked per iteration.
  1812. * @param {*} [accumulator] The initial value.
  1813. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1814. * the initial value.
  1815. * @returns {*} Returns the accumulated value.
  1816. */
  1817. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1818. var index = -1,
  1819. length = array == null ? 0 : array.length;
  1820. if (initAccum && length) {
  1821. accumulator = array[++index];
  1822. }
  1823. while (++index < length) {
  1824. accumulator = iteratee(accumulator, array[index], index, array);
  1825. }
  1826. return accumulator;
  1827. }
  1828. /**
  1829. * A specialized version of `_.reduceRight` for arrays without support for
  1830. * iteratee shorthands.
  1831. *
  1832. * @private
  1833. * @param {Array} [array] The array to iterate over.
  1834. * @param {Function} iteratee The function invoked per iteration.
  1835. * @param {*} [accumulator] The initial value.
  1836. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1837. * the initial value.
  1838. * @returns {*} Returns the accumulated value.
  1839. */
  1840. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1841. var length = array == null ? 0 : array.length;
  1842. if (initAccum && length) {
  1843. accumulator = array[--length];
  1844. }
  1845. while (length--) {
  1846. accumulator = iteratee(accumulator, array[length], length, array);
  1847. }
  1848. return accumulator;
  1849. }
  1850. /**
  1851. * A specialized version of `_.some` for arrays without support for iteratee
  1852. * shorthands.
  1853. *
  1854. * @private
  1855. * @param {Array} [array] The array to iterate over.
  1856. * @param {Function} predicate The function invoked per iteration.
  1857. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1858. * else `false`.
  1859. */
  1860. function arraySome(array, predicate) {
  1861. var index = -1,
  1862. length = array == null ? 0 : array.length;
  1863. while (++index < length) {
  1864. if (predicate(array[index], index, array)) {
  1865. return true;
  1866. }
  1867. }
  1868. return false;
  1869. }
  1870. /**
  1871. * Gets the size of an ASCII `string`.
  1872. *
  1873. * @private
  1874. * @param {string} string The string inspect.
  1875. * @returns {number} Returns the string size.
  1876. */
  1877. var asciiSize = baseProperty('length');
  1878. /**
  1879. * Converts an ASCII `string` to an array.
  1880. *
  1881. * @private
  1882. * @param {string} string The string to convert.
  1883. * @returns {Array} Returns the converted array.
  1884. */
  1885. function asciiToArray(string) {
  1886. return string.split('');
  1887. }
  1888. /**
  1889. * Splits an ASCII `string` into an array of its words.
  1890. *
  1891. * @private
  1892. * @param {string} The string to inspect.
  1893. * @returns {Array} Returns the words of `string`.
  1894. */
  1895. function asciiWords(string) {
  1896. return string.match(reAsciiWord) || [];
  1897. }
  1898. /**
  1899. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1900. * without support for iteratee shorthands, which iterates over `collection`
  1901. * using `eachFunc`.
  1902. *
  1903. * @private
  1904. * @param {Array|Object} collection The collection to inspect.
  1905. * @param {Function} predicate The function invoked per iteration.
  1906. * @param {Function} eachFunc The function to iterate over `collection`.
  1907. * @returns {*} Returns the found element or its key, else `undefined`.
  1908. */
  1909. function baseFindKey(collection, predicate, eachFunc) {
  1910. var result;
  1911. eachFunc(collection, function(value, key, collection) {
  1912. if (predicate(value, key, collection)) {
  1913. result = key;
  1914. return false;
  1915. }
  1916. });
  1917. return result;
  1918. }
  1919. /**
  1920. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1921. * support for iteratee shorthands.
  1922. *
  1923. * @private
  1924. * @param {Array} array The array to inspect.
  1925. * @param {Function} predicate The function invoked per iteration.
  1926. * @param {number} fromIndex The index to search from.
  1927. * @param {boolean} [fromRight] Specify iterating from right to left.
  1928. * @returns {number} Returns the index of the matched value, else `-1`.
  1929. */
  1930. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1931. var length = array.length,
  1932. index = fromIndex + (fromRight ? 1 : -1);
  1933. while ((fromRight ? index-- : ++index < length)) {
  1934. if (predicate(array[index], index, array)) {
  1935. return index;
  1936. }
  1937. }
  1938. return -1;
  1939. }
  1940. /**
  1941. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1942. *
  1943. * @private
  1944. * @param {Array} array The array to inspect.
  1945. * @param {*} value The value to search for.
  1946. * @param {number} fromIndex The index to search from.
  1947. * @returns {number} Returns the index of the matched value, else `-1`.
  1948. */
  1949. function baseIndexOf(array, value, fromIndex) {
  1950. return value === value
  1951. ? strictIndexOf(array, value, fromIndex)
  1952. : baseFindIndex(array, baseIsNaN, fromIndex);
  1953. }
  1954. /**
  1955. * This function is like `baseIndexOf` except that it accepts a comparator.
  1956. *
  1957. * @private
  1958. * @param {Array} array The array to inspect.
  1959. * @param {*} value The value to search for.
  1960. * @param {number} fromIndex The index to search from.
  1961. * @param {Function} comparator The comparator invoked per element.
  1962. * @returns {number} Returns the index of the matched value, else `-1`.
  1963. */
  1964. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1965. var index = fromIndex - 1,
  1966. length = array.length;
  1967. while (++index < length) {
  1968. if (comparator(array[index], value)) {
  1969. return index;
  1970. }
  1971. }
  1972. return -1;
  1973. }
  1974. /**
  1975. * The base implementation of `_.isNaN` without support for number objects.
  1976. *
  1977. * @private
  1978. * @param {*} value The value to check.
  1979. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1980. */
  1981. function baseIsNaN(value) {
  1982. return value !== value;
  1983. }
  1984. /**
  1985. * The base implementation of `_.mean` and `_.meanBy` without support for
  1986. * iteratee shorthands.
  1987. *
  1988. * @private
  1989. * @param {Array} array The array to iterate over.
  1990. * @param {Function} iteratee The function invoked per iteration.
  1991. * @returns {number} Returns the mean.
  1992. */
  1993. function baseMean(array, iteratee) {
  1994. var length = array == null ? 0 : array.length;
  1995. return length ? (baseSum(array, iteratee) / length) : NAN;
  1996. }
  1997. /**
  1998. * The base implementation of `_.property` without support for deep paths.
  1999. *
  2000. * @private
  2001. * @param {string} key The key of the property to get.
  2002. * @returns {Function} Returns the new accessor function.
  2003. */
  2004. function baseProperty(key) {
  2005. return function(object) {
  2006. return object == null ? undefined : object[key];
  2007. };
  2008. }
  2009. /**
  2010. * The base implementation of `_.propertyOf` without support for deep paths.
  2011. *
  2012. * @private
  2013. * @param {Object} object The object to query.
  2014. * @returns {Function} Returns the new accessor function.
  2015. */
  2016. function basePropertyOf(object) {
  2017. return function(key) {
  2018. return object == null ? undefined : object[key];
  2019. };
  2020. }
  2021. /**
  2022. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2023. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2024. *
  2025. * @private
  2026. * @param {Array|Object} collection The collection to iterate over.
  2027. * @param {Function} iteratee The function invoked per iteration.
  2028. * @param {*} accumulator The initial value.
  2029. * @param {boolean} initAccum Specify using the first or last element of
  2030. * `collection` as the initial value.
  2031. * @param {Function} eachFunc The function to iterate over `collection`.
  2032. * @returns {*} Returns the accumulated value.
  2033. */
  2034. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2035. eachFunc(collection, function(value, index, collection) {
  2036. accumulator = initAccum
  2037. ? (initAccum = false, value)
  2038. : iteratee(accumulator, value, index, collection);
  2039. });
  2040. return accumulator;
  2041. }
  2042. /**
  2043. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2044. * sort order of `array` and replaces criteria objects with their corresponding
  2045. * values.
  2046. *
  2047. * @private
  2048. * @param {Array} array The array to sort.
  2049. * @param {Function} comparer The function to define sort order.
  2050. * @returns {Array} Returns `array`.
  2051. */
  2052. function baseSortBy(array, comparer) {
  2053. var length = array.length;
  2054. array.sort(comparer);
  2055. while (length--) {
  2056. array[length] = array[length].value;
  2057. }
  2058. return array;
  2059. }
  2060. /**
  2061. * The base implementation of `_.sum` and `_.sumBy` without support for
  2062. * iteratee shorthands.
  2063. *
  2064. * @private
  2065. * @param {Array} array The array to iterate over.
  2066. * @param {Function} iteratee The function invoked per iteration.
  2067. * @returns {number} Returns the sum.
  2068. */
  2069. function baseSum(array, iteratee) {
  2070. var result,
  2071. index = -1,
  2072. length = array.length;
  2073. while (++index < length) {
  2074. var current = iteratee(array[index]);
  2075. if (current !== undefined) {
  2076. result = result === undefined ? current : (result + current);
  2077. }
  2078. }
  2079. return result;
  2080. }
  2081. /**
  2082. * The base implementation of `_.times` without support for iteratee shorthands
  2083. * or max array length checks.
  2084. *
  2085. * @private
  2086. * @param {number} n The number of times to invoke `iteratee`.
  2087. * @param {Function} iteratee The function invoked per iteration.
  2088. * @returns {Array} Returns the array of results.
  2089. */
  2090. function baseTimes(n, iteratee) {
  2091. var index = -1,
  2092. result = Array(n);
  2093. while (++index < n) {
  2094. result[index] = iteratee(index);
  2095. }
  2096. return result;
  2097. }
  2098. /**
  2099. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2100. * of key-value pairs for `object` corresponding to the property names of `props`.
  2101. *
  2102. * @private
  2103. * @param {Object} object The object to query.
  2104. * @param {Array} props The property names to get values for.
  2105. * @returns {Object} Returns the key-value pairs.
  2106. */
  2107. function baseToPairs(object, props) {
  2108. return arrayMap(props, function(key) {
  2109. return [key, object[key]];
  2110. });
  2111. }
  2112. /**
  2113. * The base implementation of `_.trim`.
  2114. *
  2115. * @private
  2116. * @param {string} string The string to trim.
  2117. * @returns {string} Returns the trimmed string.
  2118. */
  2119. function baseTrim(string) {
  2120. return string
  2121. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2122. : string;
  2123. }
  2124. /**
  2125. * The base implementation of `_.unary` without support for storing metadata.
  2126. *
  2127. * @private
  2128. * @param {Function} func The function to cap arguments for.
  2129. * @returns {Function} Returns the new capped function.
  2130. */
  2131. function baseUnary(func) {
  2132. return function(value) {
  2133. return func(value);
  2134. };
  2135. }
  2136. /**
  2137. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2138. * array of `object` property values corresponding to the property names
  2139. * of `props`.
  2140. *
  2141. * @private
  2142. * @param {Object} object The object to query.
  2143. * @param {Array} props The property names to get values for.
  2144. * @returns {Object} Returns the array of property values.
  2145. */
  2146. function baseValues(object, props) {
  2147. return arrayMap(props, function(key) {
  2148. return object[key];
  2149. });
  2150. }
  2151. /**
  2152. * Checks if a `cache` value for `key` exists.
  2153. *
  2154. * @private
  2155. * @param {Object} cache The cache to query.
  2156. * @param {string} key The key of the entry to check.
  2157. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2158. */
  2159. function cacheHas(cache, key) {
  2160. return cache.has(key);
  2161. }
  2162. /**
  2163. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2164. * that is not found in the character symbols.
  2165. *
  2166. * @private
  2167. * @param {Array} strSymbols The string symbols to inspect.
  2168. * @param {Array} chrSymbols The character symbols to find.
  2169. * @returns {number} Returns the index of the first unmatched string symbol.
  2170. */
  2171. function charsStartIndex(strSymbols, chrSymbols) {
  2172. var index = -1,
  2173. length = strSymbols.length;
  2174. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2175. return index;
  2176. }
  2177. /**
  2178. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2179. * that is not found in the character symbols.
  2180. *
  2181. * @private
  2182. * @param {Array} strSymbols The string symbols to inspect.
  2183. * @param {Array} chrSymbols The character symbols to find.
  2184. * @returns {number} Returns the index of the last unmatched string symbol.
  2185. */
  2186. function charsEndIndex(strSymbols, chrSymbols) {
  2187. var index = strSymbols.length;
  2188. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2189. return index;
  2190. }
  2191. /**
  2192. * Gets the number of `placeholder` occurrences in `array`.
  2193. *
  2194. * @private
  2195. * @param {Array} array The array to inspect.
  2196. * @param {*} placeholder The placeholder to search for.
  2197. * @returns {number} Returns the placeholder count.
  2198. */
  2199. function countHolders(array, placeholder) {
  2200. var length = array.length,
  2201. result = 0;
  2202. while (length--) {
  2203. if (array[length] === placeholder) {
  2204. ++result;
  2205. }
  2206. }
  2207. return result;
  2208. }
  2209. /**
  2210. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2211. * letters to basic Latin letters.
  2212. *
  2213. * @private
  2214. * @param {string} letter The matched letter to deburr.
  2215. * @returns {string} Returns the deburred letter.
  2216. */
  2217. var deburrLetter = basePropertyOf(deburredLetters);
  2218. /**
  2219. * Used by `_.escape` to convert characters to HTML entities.
  2220. *
  2221. * @private
  2222. * @param {string} chr The matched character to escape.
  2223. * @returns {string} Returns the escaped character.
  2224. */
  2225. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2226. /**
  2227. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2228. *
  2229. * @private
  2230. * @param {string} chr The matched character to escape.
  2231. * @returns {string} Returns the escaped character.
  2232. */
  2233. function escapeStringChar(chr) {
  2234. return '\\' + stringEscapes[chr];
  2235. }
  2236. /**
  2237. * Gets the value at `key` of `object`.
  2238. *
  2239. * @private
  2240. * @param {Object} [object] The object to query.
  2241. * @param {string} key The key of the property to get.
  2242. * @returns {*} Returns the property value.
  2243. */
  2244. function getValue(object, key) {
  2245. return object == null ? undefined : object[key];
  2246. }
  2247. /**
  2248. * Checks if `string` contains Unicode symbols.
  2249. *
  2250. * @private
  2251. * @param {string} string The string to inspect.
  2252. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2253. */
  2254. function hasUnicode(string) {
  2255. return reHasUnicode.test(string);
  2256. }
  2257. /**
  2258. * Checks if `string` contains a word composed of Unicode symbols.
  2259. *
  2260. * @private
  2261. * @param {string} string The string to inspect.
  2262. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2263. */
  2264. function hasUnicodeWord(string) {
  2265. return reHasUnicodeWord.test(string);
  2266. }
  2267. /**
  2268. * Converts `iterator` to an array.
  2269. *
  2270. * @private
  2271. * @param {Object} iterator The iterator to convert.
  2272. * @returns {Array} Returns the converted array.
  2273. */
  2274. function iteratorToArray(iterator) {
  2275. var data,
  2276. result = [];
  2277. while (!(data = iterator.next()).done) {
  2278. result.push(data.value);
  2279. }
  2280. return result;
  2281. }
  2282. /**
  2283. * Converts `map` to its key-value pairs.
  2284. *
  2285. * @private
  2286. * @param {Object} map The map to convert.
  2287. * @returns {Array} Returns the key-value pairs.
  2288. */
  2289. function mapToArray(map) {
  2290. var index = -1,
  2291. result = Array(map.size);
  2292. map.forEach(function(value, key) {
  2293. result[++index] = [key, value];
  2294. });
  2295. return result;
  2296. }
  2297. /**
  2298. * Creates a unary function that invokes `func` with its argument transformed.
  2299. *
  2300. * @private
  2301. * @param {Function} func The function to wrap.
  2302. * @param {Function} transform The argument transform.
  2303. * @returns {Function} Returns the new function.
  2304. */
  2305. function overArg(func, transform) {
  2306. return function(arg) {
  2307. return func(transform(arg));
  2308. };
  2309. }
  2310. /**
  2311. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2312. * and returns an array of their indexes.
  2313. *
  2314. * @private
  2315. * @param {Array} array The array to modify.
  2316. * @param {*} placeholder The placeholder to replace.
  2317. * @returns {Array} Returns the new array of placeholder indexes.
  2318. */
  2319. function replaceHolders(array, placeholder) {
  2320. var index = -1,
  2321. length = array.length,
  2322. resIndex = 0,
  2323. result = [];
  2324. while (++index < length) {
  2325. var value = array[index];
  2326. if (value === placeholder || value === PLACEHOLDER) {
  2327. array[index] = PLACEHOLDER;
  2328. result[resIndex++] = index;
  2329. }
  2330. }
  2331. return result;
  2332. }
  2333. /**
  2334. * Converts `set` to an array of its values.
  2335. *
  2336. * @private
  2337. * @param {Object} set The set to convert.
  2338. * @returns {Array} Returns the values.
  2339. */
  2340. function setToArray(set) {
  2341. var index = -1,
  2342. result = Array(set.size);
  2343. set.forEach(function(value) {
  2344. result[++index] = value;
  2345. });
  2346. return result;
  2347. }
  2348. /**
  2349. * Converts `set` to its value-value pairs.
  2350. *
  2351. * @private
  2352. * @param {Object} set The set to convert.
  2353. * @returns {Array} Returns the value-value pairs.
  2354. */
  2355. function setToPairs(set) {
  2356. var index = -1,
  2357. result = Array(set.size);
  2358. set.forEach(function(value) {
  2359. result[++index] = [value, value];
  2360. });
  2361. return result;
  2362. }
  2363. /**
  2364. * A specialized version of `_.indexOf` which performs strict equality
  2365. * comparisons of values, i.e. `===`.
  2366. *
  2367. * @private
  2368. * @param {Array} array The array to inspect.
  2369. * @param {*} value The value to search for.
  2370. * @param {number} fromIndex The index to search from.
  2371. * @returns {number} Returns the index of the matched value, else `-1`.
  2372. */
  2373. function strictIndexOf(array, value, fromIndex) {
  2374. var index = fromIndex - 1,
  2375. length = array.length;
  2376. while (++index < length) {
  2377. if (array[index] === value) {
  2378. return index;
  2379. }
  2380. }
  2381. return -1;
  2382. }
  2383. /**
  2384. * A specialized version of `_.lastIndexOf` which performs strict equality
  2385. * comparisons of values, i.e. `===`.
  2386. *
  2387. * @private
  2388. * @param {Array} array The array to inspect.
  2389. * @param {*} value The value to search for.
  2390. * @param {number} fromIndex The index to search from.
  2391. * @returns {number} Returns the index of the matched value, else `-1`.
  2392. */
  2393. function strictLastIndexOf(array, value, fromIndex) {
  2394. var index = fromIndex + 1;
  2395. while (index--) {
  2396. if (array[index] === value) {
  2397. return index;
  2398. }
  2399. }
  2400. return index;
  2401. }
  2402. /**
  2403. * Gets the number of symbols in `string`.
  2404. *
  2405. * @private
  2406. * @param {string} string The string to inspect.
  2407. * @returns {number} Returns the string size.
  2408. */
  2409. function stringSize(string) {
  2410. return hasUnicode(string)
  2411. ? unicodeSize(string)
  2412. : asciiSize(string);
  2413. }
  2414. /**
  2415. * Converts `string` to an array.
  2416. *
  2417. * @private
  2418. * @param {string} string The string to convert.
  2419. * @returns {Array} Returns the converted array.
  2420. */
  2421. function stringToArray(string) {
  2422. return hasUnicode(string)
  2423. ? unicodeToArray(string)
  2424. : asciiToArray(string);
  2425. }
  2426. /**
  2427. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2428. * character of `string`.
  2429. *
  2430. * @private
  2431. * @param {string} string The string to inspect.
  2432. * @returns {number} Returns the index of the last non-whitespace character.
  2433. */
  2434. function trimmedEndIndex(string) {
  2435. var index = string.length;
  2436. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2437. return index;
  2438. }
  2439. /**
  2440. * Used by `_.unescape` to convert HTML entities to characters.
  2441. *
  2442. * @private
  2443. * @param {string} chr The matched character to unescape.
  2444. * @returns {string} Returns the unescaped character.
  2445. */
  2446. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2447. /**
  2448. * Gets the size of a Unicode `string`.
  2449. *
  2450. * @private
  2451. * @param {string} string The string inspect.
  2452. * @returns {number} Returns the string size.
  2453. */
  2454. function unicodeSize(string) {
  2455. var result = reUnicode.lastIndex = 0;
  2456. while (reUnicode.test(string)) {
  2457. ++result;
  2458. }
  2459. return result;
  2460. }
  2461. /**
  2462. * Converts a Unicode `string` to an array.
  2463. *
  2464. * @private
  2465. * @param {string} string The string to convert.
  2466. * @returns {Array} Returns the converted array.
  2467. */
  2468. function unicodeToArray(string) {
  2469. return string.match(reUnicode) || [];
  2470. }
  2471. /**
  2472. * Splits a Unicode `string` into an array of its words.
  2473. *
  2474. * @private
  2475. * @param {string} The string to inspect.
  2476. * @returns {Array} Returns the words of `string`.
  2477. */
  2478. function unicodeWords(string) {
  2479. return string.match(reUnicodeWord) || [];
  2480. }
  2481. /*--------------------------------------------------------------------------*/
  2482. /**
  2483. * Create a new pristine `lodash` function using the `context` object.
  2484. *
  2485. * @static
  2486. * @memberOf _
  2487. * @since 1.1.0
  2488. * @category Util
  2489. * @param {Object} [context=root] The context object.
  2490. * @returns {Function} Returns a new `lodash` function.
  2491. * @example
  2492. *
  2493. * _.mixin({ 'foo': _.constant('foo') });
  2494. *
  2495. * var lodash = _.runInContext();
  2496. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2497. *
  2498. * _.isFunction(_.foo);
  2499. * // => true
  2500. * _.isFunction(_.bar);
  2501. * // => false
  2502. *
  2503. * lodash.isFunction(lodash.foo);
  2504. * // => false
  2505. * lodash.isFunction(lodash.bar);
  2506. * // => true
  2507. *
  2508. * // Create a suped-up `defer` in Node.js.
  2509. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2510. */
  2511. var runInContext = (function runInContext(context) {
  2512. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2513. /** Built-in constructor references. */
  2514. var Array = context.Array,
  2515. Date = context.Date,
  2516. Error = context.Error,
  2517. Function = context.Function,
  2518. Math = context.Math,
  2519. Object = context.Object,
  2520. RegExp = context.RegExp,
  2521. String = context.String,
  2522. TypeError = context.TypeError;
  2523. /** Used for built-in method references. */
  2524. var arrayProto = Array.prototype,
  2525. funcProto = Function.prototype,
  2526. objectProto = Object.prototype;
  2527. /** Used to detect overreaching core-js shims. */
  2528. var coreJsData = context['__core-js_shared__'];
  2529. /** Used to resolve the decompiled source of functions. */
  2530. var funcToString = funcProto.toString;
  2531. /** Used to check objects for own properties. */
  2532. var hasOwnProperty = objectProto.hasOwnProperty;
  2533. /** Used to generate unique IDs. */
  2534. var idCounter = 0;
  2535. /** Used to detect methods masquerading as native. */
  2536. var maskSrcKey = (function() {
  2537. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2538. return uid ? ('Symbol(src)_1.' + uid) : '';
  2539. }());
  2540. /**
  2541. * Used to resolve the
  2542. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2543. * of values.
  2544. */
  2545. var nativeObjectToString = objectProto.toString;
  2546. /** Used to infer the `Object` constructor. */
  2547. var objectCtorString = funcToString.call(Object);
  2548. /** Used to restore the original `_` reference in `_.noConflict`. */
  2549. var oldDash = root._;
  2550. /** Used to detect if a method is native. */
  2551. var reIsNative = RegExp('^' +
  2552. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2553. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2554. );
  2555. /** Built-in value references. */
  2556. var Buffer = moduleExports ? context.Buffer : undefined,
  2557. Symbol = context.Symbol,
  2558. Uint8Array = context.Uint8Array,
  2559. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2560. getPrototype = overArg(Object.getPrototypeOf, Object),
  2561. objectCreate = Object.create,
  2562. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2563. splice = arrayProto.splice,
  2564. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2565. symIterator = Symbol ? Symbol.iterator : undefined,
  2566. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2567. var defineProperty = (function() {
  2568. try {
  2569. var func = getNative(Object, 'defineProperty');
  2570. func({}, '', {});
  2571. return func;
  2572. } catch (e) {}
  2573. }());
  2574. /** Mocked built-ins. */
  2575. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2576. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2577. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2578. /* Built-in method references for those with the same name as other `lodash` methods. */
  2579. var nativeCeil = Math.ceil,
  2580. nativeFloor = Math.floor,
  2581. nativeGetSymbols = Object.getOwnPropertySymbols,
  2582. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2583. nativeIsFinite = context.isFinite,
  2584. nativeJoin = arrayProto.join,
  2585. nativeKeys = overArg(Object.keys, Object),
  2586. nativeMax = Math.max,
  2587. nativeMin = Math.min,
  2588. nativeNow = Date.now,
  2589. nativeParseInt = context.parseInt,
  2590. nativeRandom = Math.random,
  2591. nativeReverse = arrayProto.reverse;
  2592. /* Built-in method references that are verified to be native. */
  2593. var DataView = getNative(context, 'DataView'),
  2594. Map = getNative(context, 'Map'),
  2595. Promise = getNative(context, 'Promise'),
  2596. Set = getNative(context, 'Set'),
  2597. WeakMap = getNative(context, 'WeakMap'),
  2598. nativeCreate = getNative(Object, 'create');
  2599. /** Used to store function metadata. */
  2600. var metaMap = WeakMap && new WeakMap;
  2601. /** Used to lookup unminified function names. */
  2602. var realNames = {};
  2603. /** Used to detect maps, sets, and weakmaps. */
  2604. var dataViewCtorString = toSource(DataView),
  2605. mapCtorString = toSource(Map),
  2606. promiseCtorString = toSource(Promise),
  2607. setCtorString = toSource(Set),
  2608. weakMapCtorString = toSource(WeakMap);
  2609. /** Used to convert symbols to primitives and strings. */
  2610. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2611. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2612. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2613. /*------------------------------------------------------------------------*/
  2614. /**
  2615. * Creates a `lodash` object which wraps `value` to enable implicit method
  2616. * chain sequences. Methods that operate on and return arrays, collections,
  2617. * and functions can be chained together. Methods that retrieve a single value
  2618. * or may return a primitive value will automatically end the chain sequence
  2619. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2620. * with `_#value`.
  2621. *
  2622. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2623. * enabled using `_.chain`.
  2624. *
  2625. * The execution of chained methods is lazy, that is, it's deferred until
  2626. * `_#value` is implicitly or explicitly called.
  2627. *
  2628. * Lazy evaluation allows several methods to support shortcut fusion.
  2629. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2630. * the creation of intermediate arrays and can greatly reduce the number of
  2631. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2632. * fusion if the section is applied to an array and iteratees accept only
  2633. * one argument. The heuristic for whether a section qualifies for shortcut
  2634. * fusion is subject to change.
  2635. *
  2636. * Chaining is supported in custom builds as long as the `_#value` method is
  2637. * directly or indirectly included in the build.
  2638. *
  2639. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2640. *
  2641. * The wrapper `Array` methods are:
  2642. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2643. *
  2644. * The wrapper `String` methods are:
  2645. * `replace` and `split`
  2646. *
  2647. * The wrapper methods that support shortcut fusion are:
  2648. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2649. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2650. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2651. *
  2652. * The chainable wrapper methods are:
  2653. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2654. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2655. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2656. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2657. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2658. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2659. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2660. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2661. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2662. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2663. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2664. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2665. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2666. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2667. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2668. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2669. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2670. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2671. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2672. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2673. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2674. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2675. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2676. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2677. *
  2678. * The wrapper methods that are **not** chainable by default are:
  2679. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2680. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2681. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2682. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2683. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2684. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2685. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2686. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2687. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2688. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2689. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2690. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2691. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2692. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2693. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2694. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2695. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2696. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2697. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2698. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2699. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2700. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2701. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2702. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2703. * `upperFirst`, `value`, and `words`
  2704. *
  2705. * @name _
  2706. * @constructor
  2707. * @category Seq
  2708. * @param {*} value The value to wrap in a `lodash` instance.
  2709. * @returns {Object} Returns the new `lodash` wrapper instance.
  2710. * @example
  2711. *
  2712. * function square(n) {
  2713. * return n * n;
  2714. * }
  2715. *
  2716. * var wrapped = _([1, 2, 3]);
  2717. *
  2718. * // Returns an unwrapped value.
  2719. * wrapped.reduce(_.add);
  2720. * // => 6
  2721. *
  2722. * // Returns a wrapped value.
  2723. * var squares = wrapped.map(square);
  2724. *
  2725. * _.isArray(squares);
  2726. * // => false
  2727. *
  2728. * _.isArray(squares.value());
  2729. * // => true
  2730. */
  2731. function lodash(value) {
  2732. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2733. if (value instanceof LodashWrapper) {
  2734. return value;
  2735. }
  2736. if (hasOwnProperty.call(value, '__wrapped__')) {
  2737. return wrapperClone(value);
  2738. }
  2739. }
  2740. return new LodashWrapper(value);
  2741. }
  2742. /**
  2743. * The base implementation of `_.create` without support for assigning
  2744. * properties to the created object.
  2745. *
  2746. * @private
  2747. * @param {Object} proto The object to inherit from.
  2748. * @returns {Object} Returns the new object.
  2749. */
  2750. var baseCreate = (function() {
  2751. function object() {}
  2752. return function(proto) {
  2753. if (!isObject(proto)) {
  2754. return {};
  2755. }
  2756. if (objectCreate) {
  2757. return objectCreate(proto);
  2758. }
  2759. object.prototype = proto;
  2760. var result = new object;
  2761. object.prototype = undefined;
  2762. return result;
  2763. };
  2764. }());
  2765. /**
  2766. * The function whose prototype chain sequence wrappers inherit from.
  2767. *
  2768. * @private
  2769. */
  2770. function baseLodash() {
  2771. // No operation performed.
  2772. }
  2773. /**
  2774. * The base constructor for creating `lodash` wrapper objects.
  2775. *
  2776. * @private
  2777. * @param {*} value The value to wrap.
  2778. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2779. */
  2780. function LodashWrapper(value, chainAll) {
  2781. this.__wrapped__ = value;
  2782. this.__actions__ = [];
  2783. this.__chain__ = !!chainAll;
  2784. this.__index__ = 0;
  2785. this.__values__ = undefined;
  2786. }
  2787. /**
  2788. * By default, the template delimiters used by lodash are like those in
  2789. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2790. * following template settings to use alternative delimiters.
  2791. *
  2792. * @static
  2793. * @memberOf _
  2794. * @type {Object}
  2795. */
  2796. lodash.templateSettings = {
  2797. /**
  2798. * Used to detect `data` property values to be HTML-escaped.
  2799. *
  2800. * @memberOf _.templateSettings
  2801. * @type {RegExp}
  2802. */
  2803. 'escape': reEscape,
  2804. /**
  2805. * Used to detect code to be evaluated.
  2806. *
  2807. * @memberOf _.templateSettings
  2808. * @type {RegExp}
  2809. */
  2810. 'evaluate': reEvaluate,
  2811. /**
  2812. * Used to detect `data` property values to inject.
  2813. *
  2814. * @memberOf _.templateSettings
  2815. * @type {RegExp}
  2816. */
  2817. 'interpolate': reInterpolate,
  2818. /**
  2819. * Used to reference the data object in the template text.
  2820. *
  2821. * @memberOf _.templateSettings
  2822. * @type {string}
  2823. */
  2824. 'variable': '',
  2825. /**
  2826. * Used to import variables into the compiled template.
  2827. *
  2828. * @memberOf _.templateSettings
  2829. * @type {Object}
  2830. */
  2831. 'imports': {
  2832. /**
  2833. * A reference to the `lodash` function.
  2834. *
  2835. * @memberOf _.templateSettings.imports
  2836. * @type {Function}
  2837. */
  2838. '_': lodash
  2839. }
  2840. };
  2841. // Ensure wrappers are instances of `baseLodash`.
  2842. lodash.prototype = baseLodash.prototype;
  2843. lodash.prototype.constructor = lodash;
  2844. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2845. LodashWrapper.prototype.constructor = LodashWrapper;
  2846. /*------------------------------------------------------------------------*/
  2847. /**
  2848. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2849. *
  2850. * @private
  2851. * @constructor
  2852. * @param {*} value The value to wrap.
  2853. */
  2854. function LazyWrapper(value) {
  2855. this.__wrapped__ = value;
  2856. this.__actions__ = [];
  2857. this.__dir__ = 1;
  2858. this.__filtered__ = false;
  2859. this.__iteratees__ = [];
  2860. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2861. this.__views__ = [];
  2862. }
  2863. /**
  2864. * Creates a clone of the lazy wrapper object.
  2865. *
  2866. * @private
  2867. * @name clone
  2868. * @memberOf LazyWrapper
  2869. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2870. */
  2871. function lazyClone() {
  2872. var result = new LazyWrapper(this.__wrapped__);
  2873. result.__actions__ = copyArray(this.__actions__);
  2874. result.__dir__ = this.__dir__;
  2875. result.__filtered__ = this.__filtered__;
  2876. result.__iteratees__ = copyArray(this.__iteratees__);
  2877. result.__takeCount__ = this.__takeCount__;
  2878. result.__views__ = copyArray(this.__views__);
  2879. return result;
  2880. }
  2881. /**
  2882. * Reverses the direction of lazy iteration.
  2883. *
  2884. * @private
  2885. * @name reverse
  2886. * @memberOf LazyWrapper
  2887. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2888. */
  2889. function lazyReverse() {
  2890. if (this.__filtered__) {
  2891. var result = new LazyWrapper(this);
  2892. result.__dir__ = -1;
  2893. result.__filtered__ = true;
  2894. } else {
  2895. result = this.clone();
  2896. result.__dir__ *= -1;
  2897. }
  2898. return result;
  2899. }
  2900. /**
  2901. * Extracts the unwrapped value from its lazy wrapper.
  2902. *
  2903. * @private
  2904. * @name value
  2905. * @memberOf LazyWrapper
  2906. * @returns {*} Returns the unwrapped value.
  2907. */
  2908. function lazyValue() {
  2909. var array = this.__wrapped__.value(),
  2910. dir = this.__dir__,
  2911. isArr = isArray(array),
  2912. isRight = dir < 0,
  2913. arrLength = isArr ? array.length : 0,
  2914. view = getView(0, arrLength, this.__views__),
  2915. start = view.start,
  2916. end = view.end,
  2917. length = end - start,
  2918. index = isRight ? end : (start - 1),
  2919. iteratees = this.__iteratees__,
  2920. iterLength = iteratees.length,
  2921. resIndex = 0,
  2922. takeCount = nativeMin(length, this.__takeCount__);
  2923. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2924. return baseWrapperValue(array, this.__actions__);
  2925. }
  2926. var result = [];
  2927. outer:
  2928. while (length-- && resIndex < takeCount) {
  2929. index += dir;
  2930. var iterIndex = -1,
  2931. value = array[index];
  2932. while (++iterIndex < iterLength) {
  2933. var data = iteratees[iterIndex],
  2934. iteratee = data.iteratee,
  2935. type = data.type,
  2936. computed = iteratee(value);
  2937. if (type == LAZY_MAP_FLAG) {
  2938. value = computed;
  2939. } else if (!computed) {
  2940. if (type == LAZY_FILTER_FLAG) {
  2941. continue outer;
  2942. } else {
  2943. break outer;
  2944. }
  2945. }
  2946. }
  2947. result[resIndex++] = value;
  2948. }
  2949. return result;
  2950. }
  2951. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2952. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2953. LazyWrapper.prototype.constructor = LazyWrapper;
  2954. /*------------------------------------------------------------------------*/
  2955. /**
  2956. * Creates a hash object.
  2957. *
  2958. * @private
  2959. * @constructor
  2960. * @param {Array} [entries] The key-value pairs to cache.
  2961. */
  2962. function Hash(entries) {
  2963. var index = -1,
  2964. length = entries == null ? 0 : entries.length;
  2965. this.clear();
  2966. while (++index < length) {
  2967. var entry = entries[index];
  2968. this.set(entry[0], entry[1]);
  2969. }
  2970. }
  2971. /**
  2972. * Removes all key-value entries from the hash.
  2973. *
  2974. * @private
  2975. * @name clear
  2976. * @memberOf Hash
  2977. */
  2978. function hashClear() {
  2979. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2980. this.size = 0;
  2981. }
  2982. /**
  2983. * Removes `key` and its value from the hash.
  2984. *
  2985. * @private
  2986. * @name delete
  2987. * @memberOf Hash
  2988. * @param {Object} hash The hash to modify.
  2989. * @param {string} key The key of the value to remove.
  2990. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2991. */
  2992. function hashDelete(key) {
  2993. var result = this.has(key) && delete this.__data__[key];
  2994. this.size -= result ? 1 : 0;
  2995. return result;
  2996. }
  2997. /**
  2998. * Gets the hash value for `key`.
  2999. *
  3000. * @private
  3001. * @name get
  3002. * @memberOf Hash
  3003. * @param {string} key The key of the value to get.
  3004. * @returns {*} Returns the entry value.
  3005. */
  3006. function hashGet(key) {
  3007. var data = this.__data__;
  3008. if (nativeCreate) {
  3009. var result = data[key];
  3010. return result === HASH_UNDEFINED ? undefined : result;
  3011. }
  3012. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3013. }
  3014. /**
  3015. * Checks if a hash value for `key` exists.
  3016. *
  3017. * @private
  3018. * @name has
  3019. * @memberOf Hash
  3020. * @param {string} key The key of the entry to check.
  3021. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3022. */
  3023. function hashHas(key) {
  3024. var data = this.__data__;
  3025. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3026. }
  3027. /**
  3028. * Sets the hash `key` to `value`.
  3029. *
  3030. * @private
  3031. * @name set
  3032. * @memberOf Hash
  3033. * @param {string} key The key of the value to set.
  3034. * @param {*} value The value to set.
  3035. * @returns {Object} Returns the hash instance.
  3036. */
  3037. function hashSet(key, value) {
  3038. var data = this.__data__;
  3039. this.size += this.has(key) ? 0 : 1;
  3040. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3041. return this;
  3042. }
  3043. // Add methods to `Hash`.
  3044. Hash.prototype.clear = hashClear;
  3045. Hash.prototype['delete'] = hashDelete;
  3046. Hash.prototype.get = hashGet;
  3047. Hash.prototype.has = hashHas;
  3048. Hash.prototype.set = hashSet;
  3049. /*------------------------------------------------------------------------*/
  3050. /**
  3051. * Creates an list cache object.
  3052. *
  3053. * @private
  3054. * @constructor
  3055. * @param {Array} [entries] The key-value pairs to cache.
  3056. */
  3057. function ListCache(entries) {
  3058. var index = -1,
  3059. length = entries == null ? 0 : entries.length;
  3060. this.clear();
  3061. while (++index < length) {
  3062. var entry = entries[index];
  3063. this.set(entry[0], entry[1]);
  3064. }
  3065. }
  3066. /**
  3067. * Removes all key-value entries from the list cache.
  3068. *
  3069. * @private
  3070. * @name clear
  3071. * @memberOf ListCache
  3072. */
  3073. function listCacheClear() {
  3074. this.__data__ = [];
  3075. this.size = 0;
  3076. }
  3077. /**
  3078. * Removes `key` and its value from the list cache.
  3079. *
  3080. * @private
  3081. * @name delete
  3082. * @memberOf ListCache
  3083. * @param {string} key The key of the value to remove.
  3084. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3085. */
  3086. function listCacheDelete(key) {
  3087. var data = this.__data__,
  3088. index = assocIndexOf(data, key);
  3089. if (index < 0) {
  3090. return false;
  3091. }
  3092. var lastIndex = data.length - 1;
  3093. if (index == lastIndex) {
  3094. data.pop();
  3095. } else {
  3096. splice.call(data, index, 1);
  3097. }
  3098. --this.size;
  3099. return true;
  3100. }
  3101. /**
  3102. * Gets the list cache value for `key`.
  3103. *
  3104. * @private
  3105. * @name get
  3106. * @memberOf ListCache
  3107. * @param {string} key The key of the value to get.
  3108. * @returns {*} Returns the entry value.
  3109. */
  3110. function listCacheGet(key) {
  3111. var data = this.__data__,
  3112. index = assocIndexOf(data, key);
  3113. return index < 0 ? undefined : data[index][1];
  3114. }
  3115. /**
  3116. * Checks if a list cache value for `key` exists.
  3117. *
  3118. * @private
  3119. * @name has
  3120. * @memberOf ListCache
  3121. * @param {string} key The key of the entry to check.
  3122. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3123. */
  3124. function listCacheHas(key) {
  3125. return assocIndexOf(this.__data__, key) > -1;
  3126. }
  3127. /**
  3128. * Sets the list cache `key` to `value`.
  3129. *
  3130. * @private
  3131. * @name set
  3132. * @memberOf ListCache
  3133. * @param {string} key The key of the value to set.
  3134. * @param {*} value The value to set.
  3135. * @returns {Object} Returns the list cache instance.
  3136. */
  3137. function listCacheSet(key, value) {
  3138. var data = this.__data__,
  3139. index = assocIndexOf(data, key);
  3140. if (index < 0) {
  3141. ++this.size;
  3142. data.push([key, value]);
  3143. } else {
  3144. data[index][1] = value;
  3145. }
  3146. return this;
  3147. }
  3148. // Add methods to `ListCache`.
  3149. ListCache.prototype.clear = listCacheClear;
  3150. ListCache.prototype['delete'] = listCacheDelete;
  3151. ListCache.prototype.get = listCacheGet;
  3152. ListCache.prototype.has = listCacheHas;
  3153. ListCache.prototype.set = listCacheSet;
  3154. /*------------------------------------------------------------------------*/
  3155. /**
  3156. * Creates a map cache object to store key-value pairs.
  3157. *
  3158. * @private
  3159. * @constructor
  3160. * @param {Array} [entries] The key-value pairs to cache.
  3161. */
  3162. function MapCache(entries) {
  3163. var index = -1,
  3164. length = entries == null ? 0 : entries.length;
  3165. this.clear();
  3166. while (++index < length) {
  3167. var entry = entries[index];
  3168. this.set(entry[0], entry[1]);
  3169. }
  3170. }
  3171. /**
  3172. * Removes all key-value entries from the map.
  3173. *
  3174. * @private
  3175. * @name clear
  3176. * @memberOf MapCache
  3177. */
  3178. function mapCacheClear() {
  3179. this.size = 0;
  3180. this.__data__ = {
  3181. 'hash': new Hash,
  3182. 'map': new (Map || ListCache),
  3183. 'string': new Hash
  3184. };
  3185. }
  3186. /**
  3187. * Removes `key` and its value from the map.
  3188. *
  3189. * @private
  3190. * @name delete
  3191. * @memberOf MapCache
  3192. * @param {string} key The key of the value to remove.
  3193. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3194. */
  3195. function mapCacheDelete(key) {
  3196. var result = getMapData(this, key)['delete'](key);
  3197. this.size -= result ? 1 : 0;
  3198. return result;
  3199. }
  3200. /**
  3201. * Gets the map value for `key`.
  3202. *
  3203. * @private
  3204. * @name get
  3205. * @memberOf MapCache
  3206. * @param {string} key The key of the value to get.
  3207. * @returns {*} Returns the entry value.
  3208. */
  3209. function mapCacheGet(key) {
  3210. return getMapData(this, key).get(key);
  3211. }
  3212. /**
  3213. * Checks if a map value for `key` exists.
  3214. *
  3215. * @private
  3216. * @name has
  3217. * @memberOf MapCache
  3218. * @param {string} key The key of the entry to check.
  3219. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3220. */
  3221. function mapCacheHas(key) {
  3222. return getMapData(this, key).has(key);
  3223. }
  3224. /**
  3225. * Sets the map `key` to `value`.
  3226. *
  3227. * @private
  3228. * @name set
  3229. * @memberOf MapCache
  3230. * @param {string} key The key of the value to set.
  3231. * @param {*} value The value to set.
  3232. * @returns {Object} Returns the map cache instance.
  3233. */
  3234. function mapCacheSet(key, value) {
  3235. var data = getMapData(this, key),
  3236. size = data.size;
  3237. data.set(key, value);
  3238. this.size += data.size == size ? 0 : 1;
  3239. return this;
  3240. }
  3241. // Add methods to `MapCache`.
  3242. MapCache.prototype.clear = mapCacheClear;
  3243. MapCache.prototype['delete'] = mapCacheDelete;
  3244. MapCache.prototype.get = mapCacheGet;
  3245. MapCache.prototype.has = mapCacheHas;
  3246. MapCache.prototype.set = mapCacheSet;
  3247. /*------------------------------------------------------------------------*/
  3248. /**
  3249. *
  3250. * Creates an array cache object to store unique values.
  3251. *
  3252. * @private
  3253. * @constructor
  3254. * @param {Array} [values] The values to cache.
  3255. */
  3256. function SetCache(values) {
  3257. var index = -1,
  3258. length = values == null ? 0 : values.length;
  3259. this.__data__ = new MapCache;
  3260. while (++index < length) {
  3261. this.add(values[index]);
  3262. }
  3263. }
  3264. /**
  3265. * Adds `value` to the array cache.
  3266. *
  3267. * @private
  3268. * @name add
  3269. * @memberOf SetCache
  3270. * @alias push
  3271. * @param {*} value The value to cache.
  3272. * @returns {Object} Returns the cache instance.
  3273. */
  3274. function setCacheAdd(value) {
  3275. this.__data__.set(value, HASH_UNDEFINED);
  3276. return this;
  3277. }
  3278. /**
  3279. * Checks if `value` is in the array cache.
  3280. *
  3281. * @private
  3282. * @name has
  3283. * @memberOf SetCache
  3284. * @param {*} value The value to search for.
  3285. * @returns {number} Returns `true` if `value` is found, else `false`.
  3286. */
  3287. function setCacheHas(value) {
  3288. return this.__data__.has(value);
  3289. }
  3290. // Add methods to `SetCache`.
  3291. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3292. SetCache.prototype.has = setCacheHas;
  3293. /*------------------------------------------------------------------------*/
  3294. /**
  3295. * Creates a stack cache object to store key-value pairs.
  3296. *
  3297. * @private
  3298. * @constructor
  3299. * @param {Array} [entries] The key-value pairs to cache.
  3300. */
  3301. function Stack(entries) {
  3302. var data = this.__data__ = new ListCache(entries);
  3303. this.size = data.size;
  3304. }
  3305. /**
  3306. * Removes all key-value entries from the stack.
  3307. *
  3308. * @private
  3309. * @name clear
  3310. * @memberOf Stack
  3311. */
  3312. function stackClear() {
  3313. this.__data__ = new ListCache;
  3314. this.size = 0;
  3315. }
  3316. /**
  3317. * Removes `key` and its value from the stack.
  3318. *
  3319. * @private
  3320. * @name delete
  3321. * @memberOf Stack
  3322. * @param {string} key The key of the value to remove.
  3323. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3324. */
  3325. function stackDelete(key) {
  3326. var data = this.__data__,
  3327. result = data['delete'](key);
  3328. this.size = data.size;
  3329. return result;
  3330. }
  3331. /**
  3332. * Gets the stack value for `key`.
  3333. *
  3334. * @private
  3335. * @name get
  3336. * @memberOf Stack
  3337. * @param {string} key The key of the value to get.
  3338. * @returns {*} Returns the entry value.
  3339. */
  3340. function stackGet(key) {
  3341. return this.__data__.get(key);
  3342. }
  3343. /**
  3344. * Checks if a stack value for `key` exists.
  3345. *
  3346. * @private
  3347. * @name has
  3348. * @memberOf Stack
  3349. * @param {string} key The key of the entry to check.
  3350. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3351. */
  3352. function stackHas(key) {
  3353. return this.__data__.has(key);
  3354. }
  3355. /**
  3356. * Sets the stack `key` to `value`.
  3357. *
  3358. * @private
  3359. * @name set
  3360. * @memberOf Stack
  3361. * @param {string} key The key of the value to set.
  3362. * @param {*} value The value to set.
  3363. * @returns {Object} Returns the stack cache instance.
  3364. */
  3365. function stackSet(key, value) {
  3366. var data = this.__data__;
  3367. if (data instanceof ListCache) {
  3368. var pairs = data.__data__;
  3369. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3370. pairs.push([key, value]);
  3371. this.size = ++data.size;
  3372. return this;
  3373. }
  3374. data = this.__data__ = new MapCache(pairs);
  3375. }
  3376. data.set(key, value);
  3377. this.size = data.size;
  3378. return this;
  3379. }
  3380. // Add methods to `Stack`.
  3381. Stack.prototype.clear = stackClear;
  3382. Stack.prototype['delete'] = stackDelete;
  3383. Stack.prototype.get = stackGet;
  3384. Stack.prototype.has = stackHas;
  3385. Stack.prototype.set = stackSet;
  3386. /*------------------------------------------------------------------------*/
  3387. /**
  3388. * Creates an array of the enumerable property names of the array-like `value`.
  3389. *
  3390. * @private
  3391. * @param {*} value The value to query.
  3392. * @param {boolean} inherited Specify returning inherited property names.
  3393. * @returns {Array} Returns the array of property names.
  3394. */
  3395. function arrayLikeKeys(value, inherited) {
  3396. var isArr = isArray(value),
  3397. isArg = !isArr && isArguments(value),
  3398. isBuff = !isArr && !isArg && isBuffer(value),
  3399. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3400. skipIndexes = isArr || isArg || isBuff || isType,
  3401. result = skipIndexes ? baseTimes(value.length, String) : [],
  3402. length = result.length;
  3403. for (var key in value) {
  3404. if ((inherited || hasOwnProperty.call(value, key)) &&
  3405. !(skipIndexes && (
  3406. // Safari 9 has enumerable `arguments.length` in strict mode.
  3407. key == 'length' ||
  3408. // Node.js 0.10 has enumerable non-index properties on buffers.
  3409. (isBuff && (key == 'offset' || key == 'parent')) ||
  3410. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3411. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3412. // Skip index properties.
  3413. isIndex(key, length)
  3414. ))) {
  3415. result.push(key);
  3416. }
  3417. }
  3418. return result;
  3419. }
  3420. /**
  3421. * A specialized version of `_.sample` for arrays.
  3422. *
  3423. * @private
  3424. * @param {Array} array The array to sample.
  3425. * @returns {*} Returns the random element.
  3426. */
  3427. function arraySample(array) {
  3428. var length = array.length;
  3429. return length ? array[baseRandom(0, length - 1)] : undefined;
  3430. }
  3431. /**
  3432. * A specialized version of `_.sampleSize` for arrays.
  3433. *
  3434. * @private
  3435. * @param {Array} array The array to sample.
  3436. * @param {number} n The number of elements to sample.
  3437. * @returns {Array} Returns the random elements.
  3438. */
  3439. function arraySampleSize(array, n) {
  3440. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3441. }
  3442. /**
  3443. * A specialized version of `_.shuffle` for arrays.
  3444. *
  3445. * @private
  3446. * @param {Array} array The array to shuffle.
  3447. * @returns {Array} Returns the new shuffled array.
  3448. */
  3449. function arrayShuffle(array) {
  3450. return shuffleSelf(copyArray(array));
  3451. }
  3452. /**
  3453. * This function is like `assignValue` except that it doesn't assign
  3454. * `undefined` values.
  3455. *
  3456. * @private
  3457. * @param {Object} object The object to modify.
  3458. * @param {string} key The key of the property to assign.
  3459. * @param {*} value The value to assign.
  3460. */
  3461. function assignMergeValue(object, key, value) {
  3462. if ((value !== undefined && !eq(object[key], value)) ||
  3463. (value === undefined && !(key in object))) {
  3464. baseAssignValue(object, key, value);
  3465. }
  3466. }
  3467. /**
  3468. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3469. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3470. * for equality comparisons.
  3471. *
  3472. * @private
  3473. * @param {Object} object The object to modify.
  3474. * @param {string} key The key of the property to assign.
  3475. * @param {*} value The value to assign.
  3476. */
  3477. function assignValue(object, key, value) {
  3478. var objValue = object[key];
  3479. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3480. (value === undefined && !(key in object))) {
  3481. baseAssignValue(object, key, value);
  3482. }
  3483. }
  3484. /**
  3485. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3486. *
  3487. * @private
  3488. * @param {Array} array The array to inspect.
  3489. * @param {*} key The key to search for.
  3490. * @returns {number} Returns the index of the matched value, else `-1`.
  3491. */
  3492. function assocIndexOf(array, key) {
  3493. var length = array.length;
  3494. while (length--) {
  3495. if (eq(array[length][0], key)) {
  3496. return length;
  3497. }
  3498. }
  3499. return -1;
  3500. }
  3501. /**
  3502. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3503. * by `iteratee` and values set by `setter`.
  3504. *
  3505. * @private
  3506. * @param {Array|Object} collection The collection to iterate over.
  3507. * @param {Function} setter The function to set `accumulator` values.
  3508. * @param {Function} iteratee The iteratee to transform keys.
  3509. * @param {Object} accumulator The initial aggregated object.
  3510. * @returns {Function} Returns `accumulator`.
  3511. */
  3512. function baseAggregator(collection, setter, iteratee, accumulator) {
  3513. baseEach(collection, function(value, key, collection) {
  3514. setter(accumulator, value, iteratee(value), collection);
  3515. });
  3516. return accumulator;
  3517. }
  3518. /**
  3519. * The base implementation of `_.assign` without support for multiple sources
  3520. * or `customizer` functions.
  3521. *
  3522. * @private
  3523. * @param {Object} object The destination object.
  3524. * @param {Object} source The source object.
  3525. * @returns {Object} Returns `object`.
  3526. */
  3527. function baseAssign(object, source) {
  3528. return object && copyObject(source, keys(source), object);
  3529. }
  3530. /**
  3531. * The base implementation of `_.assignIn` without support for multiple sources
  3532. * or `customizer` functions.
  3533. *
  3534. * @private
  3535. * @param {Object} object The destination object.
  3536. * @param {Object} source The source object.
  3537. * @returns {Object} Returns `object`.
  3538. */
  3539. function baseAssignIn(object, source) {
  3540. return object && copyObject(source, keysIn(source), object);
  3541. }
  3542. /**
  3543. * The base implementation of `assignValue` and `assignMergeValue` without
  3544. * value checks.
  3545. *
  3546. * @private
  3547. * @param {Object} object The object to modify.
  3548. * @param {string} key The key of the property to assign.
  3549. * @param {*} value The value to assign.
  3550. */
  3551. function baseAssignValue(object, key, value) {
  3552. if (key == '__proto__' && defineProperty) {
  3553. defineProperty(object, key, {
  3554. 'configurable': true,
  3555. 'enumerable': true,
  3556. 'value': value,
  3557. 'writable': true
  3558. });
  3559. } else {
  3560. object[key] = value;
  3561. }
  3562. }
  3563. /**
  3564. * The base implementation of `_.at` without support for individual paths.
  3565. *
  3566. * @private
  3567. * @param {Object} object The object to iterate over.
  3568. * @param {string[]} paths The property paths to pick.
  3569. * @returns {Array} Returns the picked elements.
  3570. */
  3571. function baseAt(object, paths) {
  3572. var index = -1,
  3573. length = paths.length,
  3574. result = Array(length),
  3575. skip = object == null;
  3576. while (++index < length) {
  3577. result[index] = skip ? undefined : get(object, paths[index]);
  3578. }
  3579. return result;
  3580. }
  3581. /**
  3582. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3583. *
  3584. * @private
  3585. * @param {number} number The number to clamp.
  3586. * @param {number} [lower] The lower bound.
  3587. * @param {number} upper The upper bound.
  3588. * @returns {number} Returns the clamped number.
  3589. */
  3590. function baseClamp(number, lower, upper) {
  3591. if (number === number) {
  3592. if (upper !== undefined) {
  3593. number = number <= upper ? number : upper;
  3594. }
  3595. if (lower !== undefined) {
  3596. number = number >= lower ? number : lower;
  3597. }
  3598. }
  3599. return number;
  3600. }
  3601. /**
  3602. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3603. * traversed objects.
  3604. *
  3605. * @private
  3606. * @param {*} value The value to clone.
  3607. * @param {boolean} bitmask The bitmask flags.
  3608. * 1 - Deep clone
  3609. * 2 - Flatten inherited properties
  3610. * 4 - Clone symbols
  3611. * @param {Function} [customizer] The function to customize cloning.
  3612. * @param {string} [key] The key of `value`.
  3613. * @param {Object} [object] The parent object of `value`.
  3614. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3615. * @returns {*} Returns the cloned value.
  3616. */
  3617. function baseClone(value, bitmask, customizer, key, object, stack) {
  3618. var result,
  3619. isDeep = bitmask & CLONE_DEEP_FLAG,
  3620. isFlat = bitmask & CLONE_FLAT_FLAG,
  3621. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3622. if (customizer) {
  3623. result = object ? customizer(value, key, object, stack) : customizer(value);
  3624. }
  3625. if (result !== undefined) {
  3626. return result;
  3627. }
  3628. if (!isObject(value)) {
  3629. return value;
  3630. }
  3631. var isArr = isArray(value);
  3632. if (isArr) {
  3633. result = initCloneArray(value);
  3634. if (!isDeep) {
  3635. return copyArray(value, result);
  3636. }
  3637. } else {
  3638. var tag = getTag(value),
  3639. isFunc = tag == funcTag || tag == genTag;
  3640. if (isBuffer(value)) {
  3641. return cloneBuffer(value, isDeep);
  3642. }
  3643. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3644. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3645. if (!isDeep) {
  3646. return isFlat
  3647. ? copySymbolsIn(value, baseAssignIn(result, value))
  3648. : copySymbols(value, baseAssign(result, value));
  3649. }
  3650. } else {
  3651. if (!cloneableTags[tag]) {
  3652. return object ? value : {};
  3653. }
  3654. result = initCloneByTag(value, tag, isDeep);
  3655. }
  3656. }
  3657. // Check for circular references and return its corresponding clone.
  3658. stack || (stack = new Stack);
  3659. var stacked = stack.get(value);
  3660. if (stacked) {
  3661. return stacked;
  3662. }
  3663. stack.set(value, result);
  3664. if (isSet(value)) {
  3665. value.forEach(function(subValue) {
  3666. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3667. });
  3668. } else if (isMap(value)) {
  3669. value.forEach(function(subValue, key) {
  3670. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3671. });
  3672. }
  3673. var keysFunc = isFull
  3674. ? (isFlat ? getAllKeysIn : getAllKeys)
  3675. : (isFlat ? keysIn : keys);
  3676. var props = isArr ? undefined : keysFunc(value);
  3677. arrayEach(props || value, function(subValue, key) {
  3678. if (props) {
  3679. key = subValue;
  3680. subValue = value[key];
  3681. }
  3682. // Recursively populate clone (susceptible to call stack limits).
  3683. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3684. });
  3685. return result;
  3686. }
  3687. /**
  3688. * The base implementation of `_.conforms` which doesn't clone `source`.
  3689. *
  3690. * @private
  3691. * @param {Object} source The object of property predicates to conform to.
  3692. * @returns {Function} Returns the new spec function.
  3693. */
  3694. function baseConforms(source) {
  3695. var props = keys(source);
  3696. return function(object) {
  3697. return baseConformsTo(object, source, props);
  3698. };
  3699. }
  3700. /**
  3701. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3702. *
  3703. * @private
  3704. * @param {Object} object The object to inspect.
  3705. * @param {Object} source The object of property predicates to conform to.
  3706. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3707. */
  3708. function baseConformsTo(object, source, props) {
  3709. var length = props.length;
  3710. if (object == null) {
  3711. return !length;
  3712. }
  3713. object = Object(object);
  3714. while (length--) {
  3715. var key = props[length],
  3716. predicate = source[key],
  3717. value = object[key];
  3718. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3719. return false;
  3720. }
  3721. }
  3722. return true;
  3723. }
  3724. /**
  3725. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3726. * to provide to `func`.
  3727. *
  3728. * @private
  3729. * @param {Function} func The function to delay.
  3730. * @param {number} wait The number of milliseconds to delay invocation.
  3731. * @param {Array} args The arguments to provide to `func`.
  3732. * @returns {number|Object} Returns the timer id or timeout object.
  3733. */
  3734. function baseDelay(func, wait, args) {
  3735. if (typeof func != 'function') {
  3736. throw new TypeError(FUNC_ERROR_TEXT);
  3737. }
  3738. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3739. }
  3740. /**
  3741. * The base implementation of methods like `_.difference` without support
  3742. * for excluding multiple arrays or iteratee shorthands.
  3743. *
  3744. * @private
  3745. * @param {Array} array The array to inspect.
  3746. * @param {Array} values The values to exclude.
  3747. * @param {Function} [iteratee] The iteratee invoked per element.
  3748. * @param {Function} [comparator] The comparator invoked per element.
  3749. * @returns {Array} Returns the new array of filtered values.
  3750. */
  3751. function baseDifference(array, values, iteratee, comparator) {
  3752. var index = -1,
  3753. includes = arrayIncludes,
  3754. isCommon = true,
  3755. length = array.length,
  3756. result = [],
  3757. valuesLength = values.length;
  3758. if (!length) {
  3759. return result;
  3760. }
  3761. if (iteratee) {
  3762. values = arrayMap(values, baseUnary(iteratee));
  3763. }
  3764. if (comparator) {
  3765. includes = arrayIncludesWith;
  3766. isCommon = false;
  3767. }
  3768. else if (values.length >= LARGE_ARRAY_SIZE) {
  3769. includes = cacheHas;
  3770. isCommon = false;
  3771. values = new SetCache(values);
  3772. }
  3773. outer:
  3774. while (++index < length) {
  3775. var value = array[index],
  3776. computed = iteratee == null ? value : iteratee(value);
  3777. value = (comparator || value !== 0) ? value : 0;
  3778. if (isCommon && computed === computed) {
  3779. var valuesIndex = valuesLength;
  3780. while (valuesIndex--) {
  3781. if (values[valuesIndex] === computed) {
  3782. continue outer;
  3783. }
  3784. }
  3785. result.push(value);
  3786. }
  3787. else if (!includes(values, computed, comparator)) {
  3788. result.push(value);
  3789. }
  3790. }
  3791. return result;
  3792. }
  3793. /**
  3794. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3795. *
  3796. * @private
  3797. * @param {Array|Object} collection The collection to iterate over.
  3798. * @param {Function} iteratee The function invoked per iteration.
  3799. * @returns {Array|Object} Returns `collection`.
  3800. */
  3801. var baseEach = createBaseEach(baseForOwn);
  3802. /**
  3803. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3804. *
  3805. * @private
  3806. * @param {Array|Object} collection The collection to iterate over.
  3807. * @param {Function} iteratee The function invoked per iteration.
  3808. * @returns {Array|Object} Returns `collection`.
  3809. */
  3810. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3811. /**
  3812. * The base implementation of `_.every` without support for iteratee shorthands.
  3813. *
  3814. * @private
  3815. * @param {Array|Object} collection The collection to iterate over.
  3816. * @param {Function} predicate The function invoked per iteration.
  3817. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3818. * else `false`
  3819. */
  3820. function baseEvery(collection, predicate) {
  3821. var result = true;
  3822. baseEach(collection, function(value, index, collection) {
  3823. result = !!predicate(value, index, collection);
  3824. return result;
  3825. });
  3826. return result;
  3827. }
  3828. /**
  3829. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3830. * `comparator` to determine the extremum value.
  3831. *
  3832. * @private
  3833. * @param {Array} array The array to iterate over.
  3834. * @param {Function} iteratee The iteratee invoked per iteration.
  3835. * @param {Function} comparator The comparator used to compare values.
  3836. * @returns {*} Returns the extremum value.
  3837. */
  3838. function baseExtremum(array, iteratee, comparator) {
  3839. var index = -1,
  3840. length = array.length;
  3841. while (++index < length) {
  3842. var value = array[index],
  3843. current = iteratee(value);
  3844. if (current != null && (computed === undefined
  3845. ? (current === current && !isSymbol(current))
  3846. : comparator(current, computed)
  3847. )) {
  3848. var computed = current,
  3849. result = value;
  3850. }
  3851. }
  3852. return result;
  3853. }
  3854. /**
  3855. * The base implementation of `_.fill` without an iteratee call guard.
  3856. *
  3857. * @private
  3858. * @param {Array} array The array to fill.
  3859. * @param {*} value The value to fill `array` with.
  3860. * @param {number} [start=0] The start position.
  3861. * @param {number} [end=array.length] The end position.
  3862. * @returns {Array} Returns `array`.
  3863. */
  3864. function baseFill(array, value, start, end) {
  3865. var length = array.length;
  3866. start = toInteger(start);
  3867. if (start < 0) {
  3868. start = -start > length ? 0 : (length + start);
  3869. }
  3870. end = (end === undefined || end > length) ? length : toInteger(end);
  3871. if (end < 0) {
  3872. end += length;
  3873. }
  3874. end = start > end ? 0 : toLength(end);
  3875. while (start < end) {
  3876. array[start++] = value;
  3877. }
  3878. return array;
  3879. }
  3880. /**
  3881. * The base implementation of `_.filter` without support for iteratee shorthands.
  3882. *
  3883. * @private
  3884. * @param {Array|Object} collection The collection to iterate over.
  3885. * @param {Function} predicate The function invoked per iteration.
  3886. * @returns {Array} Returns the new filtered array.
  3887. */
  3888. function baseFilter(collection, predicate) {
  3889. var result = [];
  3890. baseEach(collection, function(value, index, collection) {
  3891. if (predicate(value, index, collection)) {
  3892. result.push(value);
  3893. }
  3894. });
  3895. return result;
  3896. }
  3897. /**
  3898. * The base implementation of `_.flatten` with support for restricting flattening.
  3899. *
  3900. * @private
  3901. * @param {Array} array The array to flatten.
  3902. * @param {number} depth The maximum recursion depth.
  3903. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3904. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3905. * @param {Array} [result=[]] The initial result value.
  3906. * @returns {Array} Returns the new flattened array.
  3907. */
  3908. function baseFlatten(array, depth, predicate, isStrict, result) {
  3909. var index = -1,
  3910. length = array.length;
  3911. predicate || (predicate = isFlattenable);
  3912. result || (result = []);
  3913. while (++index < length) {
  3914. var value = array[index];
  3915. if (depth > 0 && predicate(value)) {
  3916. if (depth > 1) {
  3917. // Recursively flatten arrays (susceptible to call stack limits).
  3918. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3919. } else {
  3920. arrayPush(result, value);
  3921. }
  3922. } else if (!isStrict) {
  3923. result[result.length] = value;
  3924. }
  3925. }
  3926. return result;
  3927. }
  3928. /**
  3929. * The base implementation of `baseForOwn` which iterates over `object`
  3930. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3931. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3932. *
  3933. * @private
  3934. * @param {Object} object The object to iterate over.
  3935. * @param {Function} iteratee The function invoked per iteration.
  3936. * @param {Function} keysFunc The function to get the keys of `object`.
  3937. * @returns {Object} Returns `object`.
  3938. */
  3939. var baseFor = createBaseFor();
  3940. /**
  3941. * This function is like `baseFor` except that it iterates over properties
  3942. * in the opposite order.
  3943. *
  3944. * @private
  3945. * @param {Object} object The object to iterate over.
  3946. * @param {Function} iteratee The function invoked per iteration.
  3947. * @param {Function} keysFunc The function to get the keys of `object`.
  3948. * @returns {Object} Returns `object`.
  3949. */
  3950. var baseForRight = createBaseFor(true);
  3951. /**
  3952. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3953. *
  3954. * @private
  3955. * @param {Object} object The object to iterate over.
  3956. * @param {Function} iteratee The function invoked per iteration.
  3957. * @returns {Object} Returns `object`.
  3958. */
  3959. function baseForOwn(object, iteratee) {
  3960. return object && baseFor(object, iteratee, keys);
  3961. }
  3962. /**
  3963. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3964. *
  3965. * @private
  3966. * @param {Object} object The object to iterate over.
  3967. * @param {Function} iteratee The function invoked per iteration.
  3968. * @returns {Object} Returns `object`.
  3969. */
  3970. function baseForOwnRight(object, iteratee) {
  3971. return object && baseForRight(object, iteratee, keys);
  3972. }
  3973. /**
  3974. * The base implementation of `_.functions` which creates an array of
  3975. * `object` function property names filtered from `props`.
  3976. *
  3977. * @private
  3978. * @param {Object} object The object to inspect.
  3979. * @param {Array} props The property names to filter.
  3980. * @returns {Array} Returns the function names.
  3981. */
  3982. function baseFunctions(object, props) {
  3983. return arrayFilter(props, function(key) {
  3984. return isFunction(object[key]);
  3985. });
  3986. }
  3987. /**
  3988. * The base implementation of `_.get` without support for default values.
  3989. *
  3990. * @private
  3991. * @param {Object} object The object to query.
  3992. * @param {Array|string} path The path of the property to get.
  3993. * @returns {*} Returns the resolved value.
  3994. */
  3995. function baseGet(object, path) {
  3996. path = castPath(path, object);
  3997. var index = 0,
  3998. length = path.length;
  3999. while (object != null && index < length) {
  4000. object = object[toKey(path[index++])];
  4001. }
  4002. return (index && index == length) ? object : undefined;
  4003. }
  4004. /**
  4005. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4006. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4007. * symbols of `object`.
  4008. *
  4009. * @private
  4010. * @param {Object} object The object to query.
  4011. * @param {Function} keysFunc The function to get the keys of `object`.
  4012. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4013. * @returns {Array} Returns the array of property names and symbols.
  4014. */
  4015. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4016. var result = keysFunc(object);
  4017. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4018. }
  4019. /**
  4020. * The base implementation of `getTag` without fallbacks for buggy environments.
  4021. *
  4022. * @private
  4023. * @param {*} value The value to query.
  4024. * @returns {string} Returns the `toStringTag`.
  4025. */
  4026. function baseGetTag(value) {
  4027. if (value == null) {
  4028. return value === undefined ? undefinedTag : nullTag;
  4029. }
  4030. return (symToStringTag && symToStringTag in Object(value))
  4031. ? getRawTag(value)
  4032. : objectToString(value);
  4033. }
  4034. /**
  4035. * The base implementation of `_.gt` which doesn't coerce arguments.
  4036. *
  4037. * @private
  4038. * @param {*} value The value to compare.
  4039. * @param {*} other The other value to compare.
  4040. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4041. * else `false`.
  4042. */
  4043. function baseGt(value, other) {
  4044. return value > other;
  4045. }
  4046. /**
  4047. * The base implementation of `_.has` without support for deep paths.
  4048. *
  4049. * @private
  4050. * @param {Object} [object] The object to query.
  4051. * @param {Array|string} key The key to check.
  4052. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4053. */
  4054. function baseHas(object, key) {
  4055. return object != null && hasOwnProperty.call(object, key);
  4056. }
  4057. /**
  4058. * The base implementation of `_.hasIn` without support for deep paths.
  4059. *
  4060. * @private
  4061. * @param {Object} [object] The object to query.
  4062. * @param {Array|string} key The key to check.
  4063. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4064. */
  4065. function baseHasIn(object, key) {
  4066. return object != null && key in Object(object);
  4067. }
  4068. /**
  4069. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4070. *
  4071. * @private
  4072. * @param {number} number The number to check.
  4073. * @param {number} start The start of the range.
  4074. * @param {number} end The end of the range.
  4075. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4076. */
  4077. function baseInRange(number, start, end) {
  4078. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4079. }
  4080. /**
  4081. * The base implementation of methods like `_.intersection`, without support
  4082. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4083. *
  4084. * @private
  4085. * @param {Array} arrays The arrays to inspect.
  4086. * @param {Function} [iteratee] The iteratee invoked per element.
  4087. * @param {Function} [comparator] The comparator invoked per element.
  4088. * @returns {Array} Returns the new array of shared values.
  4089. */
  4090. function baseIntersection(arrays, iteratee, comparator) {
  4091. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4092. length = arrays[0].length,
  4093. othLength = arrays.length,
  4094. othIndex = othLength,
  4095. caches = Array(othLength),
  4096. maxLength = Infinity,
  4097. result = [];
  4098. while (othIndex--) {
  4099. var array = arrays[othIndex];
  4100. if (othIndex && iteratee) {
  4101. array = arrayMap(array, baseUnary(iteratee));
  4102. }
  4103. maxLength = nativeMin(array.length, maxLength);
  4104. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4105. ? new SetCache(othIndex && array)
  4106. : undefined;
  4107. }
  4108. array = arrays[0];
  4109. var index = -1,
  4110. seen = caches[0];
  4111. outer:
  4112. while (++index < length && result.length < maxLength) {
  4113. var value = array[index],
  4114. computed = iteratee ? iteratee(value) : value;
  4115. value = (comparator || value !== 0) ? value : 0;
  4116. if (!(seen
  4117. ? cacheHas(seen, computed)
  4118. : includes(result, computed, comparator)
  4119. )) {
  4120. othIndex = othLength;
  4121. while (--othIndex) {
  4122. var cache = caches[othIndex];
  4123. if (!(cache
  4124. ? cacheHas(cache, computed)
  4125. : includes(arrays[othIndex], computed, comparator))
  4126. ) {
  4127. continue outer;
  4128. }
  4129. }
  4130. if (seen) {
  4131. seen.push(computed);
  4132. }
  4133. result.push(value);
  4134. }
  4135. }
  4136. return result;
  4137. }
  4138. /**
  4139. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4140. * `object` with values transformed by `iteratee` and set by `setter`.
  4141. *
  4142. * @private
  4143. * @param {Object} object The object to iterate over.
  4144. * @param {Function} setter The function to set `accumulator` values.
  4145. * @param {Function} iteratee The iteratee to transform values.
  4146. * @param {Object} accumulator The initial inverted object.
  4147. * @returns {Function} Returns `accumulator`.
  4148. */
  4149. function baseInverter(object, setter, iteratee, accumulator) {
  4150. baseForOwn(object, function(value, key, object) {
  4151. setter(accumulator, iteratee(value), key, object);
  4152. });
  4153. return accumulator;
  4154. }
  4155. /**
  4156. * The base implementation of `_.invoke` without support for individual
  4157. * method arguments.
  4158. *
  4159. * @private
  4160. * @param {Object} object The object to query.
  4161. * @param {Array|string} path The path of the method to invoke.
  4162. * @param {Array} args The arguments to invoke the method with.
  4163. * @returns {*} Returns the result of the invoked method.
  4164. */
  4165. function baseInvoke(object, path, args) {
  4166. path = castPath(path, object);
  4167. object = parent(object, path);
  4168. var func = object == null ? object : object[toKey(last(path))];
  4169. return func == null ? undefined : apply(func, object, args);
  4170. }
  4171. /**
  4172. * The base implementation of `_.isArguments`.
  4173. *
  4174. * @private
  4175. * @param {*} value The value to check.
  4176. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4177. */
  4178. function baseIsArguments(value) {
  4179. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4180. }
  4181. /**
  4182. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4183. *
  4184. * @private
  4185. * @param {*} value The value to check.
  4186. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4187. */
  4188. function baseIsArrayBuffer(value) {
  4189. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4190. }
  4191. /**
  4192. * The base implementation of `_.isDate` without Node.js optimizations.
  4193. *
  4194. * @private
  4195. * @param {*} value The value to check.
  4196. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4197. */
  4198. function baseIsDate(value) {
  4199. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4200. }
  4201. /**
  4202. * The base implementation of `_.isEqual` which supports partial comparisons
  4203. * and tracks traversed objects.
  4204. *
  4205. * @private
  4206. * @param {*} value The value to compare.
  4207. * @param {*} other The other value to compare.
  4208. * @param {boolean} bitmask The bitmask flags.
  4209. * 1 - Unordered comparison
  4210. * 2 - Partial comparison
  4211. * @param {Function} [customizer] The function to customize comparisons.
  4212. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4213. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4214. */
  4215. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4216. if (value === other) {
  4217. return true;
  4218. }
  4219. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4220. return value !== value && other !== other;
  4221. }
  4222. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4223. }
  4224. /**
  4225. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4226. * deep comparisons and tracks traversed objects enabling objects with circular
  4227. * references to be compared.
  4228. *
  4229. * @private
  4230. * @param {Object} object The object to compare.
  4231. * @param {Object} other The other object to compare.
  4232. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4233. * @param {Function} customizer The function to customize comparisons.
  4234. * @param {Function} equalFunc The function to determine equivalents of values.
  4235. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4236. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4237. */
  4238. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4239. var objIsArr = isArray(object),
  4240. othIsArr = isArray(other),
  4241. objTag = objIsArr ? arrayTag : getTag(object),
  4242. othTag = othIsArr ? arrayTag : getTag(other);
  4243. objTag = objTag == argsTag ? objectTag : objTag;
  4244. othTag = othTag == argsTag ? objectTag : othTag;
  4245. var objIsObj = objTag == objectTag,
  4246. othIsObj = othTag == objectTag,
  4247. isSameTag = objTag == othTag;
  4248. if (isSameTag && isBuffer(object)) {
  4249. if (!isBuffer(other)) {
  4250. return false;
  4251. }
  4252. objIsArr = true;
  4253. objIsObj = false;
  4254. }
  4255. if (isSameTag && !objIsObj) {
  4256. stack || (stack = new Stack);
  4257. return (objIsArr || isTypedArray(object))
  4258. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4259. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4260. }
  4261. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4262. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4263. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4264. if (objIsWrapped || othIsWrapped) {
  4265. var objUnwrapped = objIsWrapped ? object.value() : object,
  4266. othUnwrapped = othIsWrapped ? other.value() : other;
  4267. stack || (stack = new Stack);
  4268. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4269. }
  4270. }
  4271. if (!isSameTag) {
  4272. return false;
  4273. }
  4274. stack || (stack = new Stack);
  4275. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4276. }
  4277. /**
  4278. * The base implementation of `_.isMap` without Node.js optimizations.
  4279. *
  4280. * @private
  4281. * @param {*} value The value to check.
  4282. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4283. */
  4284. function baseIsMap(value) {
  4285. return isObjectLike(value) && getTag(value) == mapTag;
  4286. }
  4287. /**
  4288. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4289. *
  4290. * @private
  4291. * @param {Object} object The object to inspect.
  4292. * @param {Object} source The object of property values to match.
  4293. * @param {Array} matchData The property names, values, and compare flags to match.
  4294. * @param {Function} [customizer] The function to customize comparisons.
  4295. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4296. */
  4297. function baseIsMatch(object, source, matchData, customizer) {
  4298. var index = matchData.length,
  4299. length = index,
  4300. noCustomizer = !customizer;
  4301. if (object == null) {
  4302. return !length;
  4303. }
  4304. object = Object(object);
  4305. while (index--) {
  4306. var data = matchData[index];
  4307. if ((noCustomizer && data[2])
  4308. ? data[1] !== object[data[0]]
  4309. : !(data[0] in object)
  4310. ) {
  4311. return false;
  4312. }
  4313. }
  4314. while (++index < length) {
  4315. data = matchData[index];
  4316. var key = data[0],
  4317. objValue = object[key],
  4318. srcValue = data[1];
  4319. if (noCustomizer && data[2]) {
  4320. if (objValue === undefined && !(key in object)) {
  4321. return false;
  4322. }
  4323. } else {
  4324. var stack = new Stack;
  4325. if (customizer) {
  4326. var result = customizer(objValue, srcValue, key, object, source, stack);
  4327. }
  4328. if (!(result === undefined
  4329. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4330. : result
  4331. )) {
  4332. return false;
  4333. }
  4334. }
  4335. }
  4336. return true;
  4337. }
  4338. /**
  4339. * The base implementation of `_.isNative` without bad shim checks.
  4340. *
  4341. * @private
  4342. * @param {*} value The value to check.
  4343. * @returns {boolean} Returns `true` if `value` is a native function,
  4344. * else `false`.
  4345. */
  4346. function baseIsNative(value) {
  4347. if (!isObject(value) || isMasked(value)) {
  4348. return false;
  4349. }
  4350. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4351. return pattern.test(toSource(value));
  4352. }
  4353. /**
  4354. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4355. *
  4356. * @private
  4357. * @param {*} value The value to check.
  4358. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4359. */
  4360. function baseIsRegExp(value) {
  4361. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4362. }
  4363. /**
  4364. * The base implementation of `_.isSet` without Node.js optimizations.
  4365. *
  4366. * @private
  4367. * @param {*} value The value to check.
  4368. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4369. */
  4370. function baseIsSet(value) {
  4371. return isObjectLike(value) && getTag(value) == setTag;
  4372. }
  4373. /**
  4374. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4375. *
  4376. * @private
  4377. * @param {*} value The value to check.
  4378. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4379. */
  4380. function baseIsTypedArray(value) {
  4381. return isObjectLike(value) &&
  4382. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4383. }
  4384. /**
  4385. * The base implementation of `_.iteratee`.
  4386. *
  4387. * @private
  4388. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4389. * @returns {Function} Returns the iteratee.
  4390. */
  4391. function baseIteratee(value) {
  4392. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4393. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4394. if (typeof value == 'function') {
  4395. return value;
  4396. }
  4397. if (value == null) {
  4398. return identity;
  4399. }
  4400. if (typeof value == 'object') {
  4401. return isArray(value)
  4402. ? baseMatchesProperty(value[0], value[1])
  4403. : baseMatches(value);
  4404. }
  4405. return property(value);
  4406. }
  4407. /**
  4408. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4409. *
  4410. * @private
  4411. * @param {Object} object The object to query.
  4412. * @returns {Array} Returns the array of property names.
  4413. */
  4414. function baseKeys(object) {
  4415. if (!isPrototype(object)) {
  4416. return nativeKeys(object);
  4417. }
  4418. var result = [];
  4419. for (var key in Object(object)) {
  4420. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4421. result.push(key);
  4422. }
  4423. }
  4424. return result;
  4425. }
  4426. /**
  4427. * The base implementation of `_.keysIn` 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 baseKeysIn(object) {
  4434. if (!isObject(object)) {
  4435. return nativeKeysIn(object);
  4436. }
  4437. var isProto = isPrototype(object),
  4438. result = [];
  4439. for (var key in object) {
  4440. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4441. result.push(key);
  4442. }
  4443. }
  4444. return result;
  4445. }
  4446. /**
  4447. * The base implementation of `_.lt` which doesn't coerce arguments.
  4448. *
  4449. * @private
  4450. * @param {*} value The value to compare.
  4451. * @param {*} other The other value to compare.
  4452. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4453. * else `false`.
  4454. */
  4455. function baseLt(value, other) {
  4456. return value < other;
  4457. }
  4458. /**
  4459. * The base implementation of `_.map` without support for iteratee shorthands.
  4460. *
  4461. * @private
  4462. * @param {Array|Object} collection The collection to iterate over.
  4463. * @param {Function} iteratee The function invoked per iteration.
  4464. * @returns {Array} Returns the new mapped array.
  4465. */
  4466. function baseMap(collection, iteratee) {
  4467. var index = -1,
  4468. result = isArrayLike(collection) ? Array(collection.length) : [];
  4469. baseEach(collection, function(value, key, collection) {
  4470. result[++index] = iteratee(value, key, collection);
  4471. });
  4472. return result;
  4473. }
  4474. /**
  4475. * The base implementation of `_.matches` which doesn't clone `source`.
  4476. *
  4477. * @private
  4478. * @param {Object} source The object of property values to match.
  4479. * @returns {Function} Returns the new spec function.
  4480. */
  4481. function baseMatches(source) {
  4482. var matchData = getMatchData(source);
  4483. if (matchData.length == 1 && matchData[0][2]) {
  4484. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4485. }
  4486. return function(object) {
  4487. return object === source || baseIsMatch(object, source, matchData);
  4488. };
  4489. }
  4490. /**
  4491. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4492. *
  4493. * @private
  4494. * @param {string} path The path of the property to get.
  4495. * @param {*} srcValue The value to match.
  4496. * @returns {Function} Returns the new spec function.
  4497. */
  4498. function baseMatchesProperty(path, srcValue) {
  4499. if (isKey(path) && isStrictComparable(srcValue)) {
  4500. return matchesStrictComparable(toKey(path), srcValue);
  4501. }
  4502. return function(object) {
  4503. var objValue = get(object, path);
  4504. return (objValue === undefined && objValue === srcValue)
  4505. ? hasIn(object, path)
  4506. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4507. };
  4508. }
  4509. /**
  4510. * The base implementation of `_.merge` without support for multiple sources.
  4511. *
  4512. * @private
  4513. * @param {Object} object The destination object.
  4514. * @param {Object} source The source object.
  4515. * @param {number} srcIndex The index of `source`.
  4516. * @param {Function} [customizer] The function to customize merged values.
  4517. * @param {Object} [stack] Tracks traversed source values and their merged
  4518. * counterparts.
  4519. */
  4520. function baseMerge(object, source, srcIndex, customizer, stack) {
  4521. if (object === source) {
  4522. return;
  4523. }
  4524. baseFor(source, function(srcValue, key) {
  4525. stack || (stack = new Stack);
  4526. if (isObject(srcValue)) {
  4527. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4528. }
  4529. else {
  4530. var newValue = customizer
  4531. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4532. : undefined;
  4533. if (newValue === undefined) {
  4534. newValue = srcValue;
  4535. }
  4536. assignMergeValue(object, key, newValue);
  4537. }
  4538. }, keysIn);
  4539. }
  4540. /**
  4541. * A specialized version of `baseMerge` for arrays and objects which performs
  4542. * deep merges and tracks traversed objects enabling objects with circular
  4543. * references to be merged.
  4544. *
  4545. * @private
  4546. * @param {Object} object The destination object.
  4547. * @param {Object} source The source object.
  4548. * @param {string} key The key of the value to merge.
  4549. * @param {number} srcIndex The index of `source`.
  4550. * @param {Function} mergeFunc The function to merge values.
  4551. * @param {Function} [customizer] The function to customize assigned values.
  4552. * @param {Object} [stack] Tracks traversed source values and their merged
  4553. * counterparts.
  4554. */
  4555. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4556. var objValue = safeGet(object, key),
  4557. srcValue = safeGet(source, key),
  4558. stacked = stack.get(srcValue);
  4559. if (stacked) {
  4560. assignMergeValue(object, key, stacked);
  4561. return;
  4562. }
  4563. var newValue = customizer
  4564. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4565. : undefined;
  4566. var isCommon = newValue === undefined;
  4567. if (isCommon) {
  4568. var isArr = isArray(srcValue),
  4569. isBuff = !isArr && isBuffer(srcValue),
  4570. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4571. newValue = srcValue;
  4572. if (isArr || isBuff || isTyped) {
  4573. if (isArray(objValue)) {
  4574. newValue = objValue;
  4575. }
  4576. else if (isArrayLikeObject(objValue)) {
  4577. newValue = copyArray(objValue);
  4578. }
  4579. else if (isBuff) {
  4580. isCommon = false;
  4581. newValue = cloneBuffer(srcValue, true);
  4582. }
  4583. else if (isTyped) {
  4584. isCommon = false;
  4585. newValue = cloneTypedArray(srcValue, true);
  4586. }
  4587. else {
  4588. newValue = [];
  4589. }
  4590. }
  4591. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4592. newValue = objValue;
  4593. if (isArguments(objValue)) {
  4594. newValue = toPlainObject(objValue);
  4595. }
  4596. else if (!isObject(objValue) || isFunction(objValue)) {
  4597. newValue = initCloneObject(srcValue);
  4598. }
  4599. }
  4600. else {
  4601. isCommon = false;
  4602. }
  4603. }
  4604. if (isCommon) {
  4605. // Recursively merge objects and arrays (susceptible to call stack limits).
  4606. stack.set(srcValue, newValue);
  4607. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4608. stack['delete'](srcValue);
  4609. }
  4610. assignMergeValue(object, key, newValue);
  4611. }
  4612. /**
  4613. * The base implementation of `_.nth` which doesn't coerce arguments.
  4614. *
  4615. * @private
  4616. * @param {Array} array The array to query.
  4617. * @param {number} n The index of the element to return.
  4618. * @returns {*} Returns the nth element of `array`.
  4619. */
  4620. function baseNth(array, n) {
  4621. var length = array.length;
  4622. if (!length) {
  4623. return;
  4624. }
  4625. n += n < 0 ? length : 0;
  4626. return isIndex(n, length) ? array[n] : undefined;
  4627. }
  4628. /**
  4629. * The base implementation of `_.orderBy` without param guards.
  4630. *
  4631. * @private
  4632. * @param {Array|Object} collection The collection to iterate over.
  4633. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4634. * @param {string[]} orders The sort orders of `iteratees`.
  4635. * @returns {Array} Returns the new sorted array.
  4636. */
  4637. function baseOrderBy(collection, iteratees, orders) {
  4638. if (iteratees.length) {
  4639. iteratees = arrayMap(iteratees, function(iteratee) {
  4640. if (isArray(iteratee)) {
  4641. return function(value) {
  4642. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4643. }
  4644. }
  4645. return iteratee;
  4646. });
  4647. } else {
  4648. iteratees = [identity];
  4649. }
  4650. var index = -1;
  4651. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4652. var result = baseMap(collection, function(value, key, collection) {
  4653. var criteria = arrayMap(iteratees, function(iteratee) {
  4654. return iteratee(value);
  4655. });
  4656. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4657. });
  4658. return baseSortBy(result, function(object, other) {
  4659. return compareMultiple(object, other, orders);
  4660. });
  4661. }
  4662. /**
  4663. * The base implementation of `_.pick` without support for individual
  4664. * property identifiers.
  4665. *
  4666. * @private
  4667. * @param {Object} object The source object.
  4668. * @param {string[]} paths The property paths to pick.
  4669. * @returns {Object} Returns the new object.
  4670. */
  4671. function basePick(object, paths) {
  4672. return basePickBy(object, paths, function(value, path) {
  4673. return hasIn(object, path);
  4674. });
  4675. }
  4676. /**
  4677. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4678. *
  4679. * @private
  4680. * @param {Object} object The source object.
  4681. * @param {string[]} paths The property paths to pick.
  4682. * @param {Function} predicate The function invoked per property.
  4683. * @returns {Object} Returns the new object.
  4684. */
  4685. function basePickBy(object, paths, predicate) {
  4686. var index = -1,
  4687. length = paths.length,
  4688. result = {};
  4689. while (++index < length) {
  4690. var path = paths[index],
  4691. value = baseGet(object, path);
  4692. if (predicate(value, path)) {
  4693. baseSet(result, castPath(path, object), value);
  4694. }
  4695. }
  4696. return result;
  4697. }
  4698. /**
  4699. * A specialized version of `baseProperty` which supports deep paths.
  4700. *
  4701. * @private
  4702. * @param {Array|string} path The path of the property to get.
  4703. * @returns {Function} Returns the new accessor function.
  4704. */
  4705. function basePropertyDeep(path) {
  4706. return function(object) {
  4707. return baseGet(object, path);
  4708. };
  4709. }
  4710. /**
  4711. * The base implementation of `_.pullAllBy` without support for iteratee
  4712. * shorthands.
  4713. *
  4714. * @private
  4715. * @param {Array} array The array to modify.
  4716. * @param {Array} values The values to remove.
  4717. * @param {Function} [iteratee] The iteratee invoked per element.
  4718. * @param {Function} [comparator] The comparator invoked per element.
  4719. * @returns {Array} Returns `array`.
  4720. */
  4721. function basePullAll(array, values, iteratee, comparator) {
  4722. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4723. index = -1,
  4724. length = values.length,
  4725. seen = array;
  4726. if (array === values) {
  4727. values = copyArray(values);
  4728. }
  4729. if (iteratee) {
  4730. seen = arrayMap(array, baseUnary(iteratee));
  4731. }
  4732. while (++index < length) {
  4733. var fromIndex = 0,
  4734. value = values[index],
  4735. computed = iteratee ? iteratee(value) : value;
  4736. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4737. if (seen !== array) {
  4738. splice.call(seen, fromIndex, 1);
  4739. }
  4740. splice.call(array, fromIndex, 1);
  4741. }
  4742. }
  4743. return array;
  4744. }
  4745. /**
  4746. * The base implementation of `_.pullAt` without support for individual
  4747. * indexes or capturing the removed elements.
  4748. *
  4749. * @private
  4750. * @param {Array} array The array to modify.
  4751. * @param {number[]} indexes The indexes of elements to remove.
  4752. * @returns {Array} Returns `array`.
  4753. */
  4754. function basePullAt(array, indexes) {
  4755. var length = array ? indexes.length : 0,
  4756. lastIndex = length - 1;
  4757. while (length--) {
  4758. var index = indexes[length];
  4759. if (length == lastIndex || index !== previous) {
  4760. var previous = index;
  4761. if (isIndex(index)) {
  4762. splice.call(array, index, 1);
  4763. } else {
  4764. baseUnset(array, index);
  4765. }
  4766. }
  4767. }
  4768. return array;
  4769. }
  4770. /**
  4771. * The base implementation of `_.random` without support for returning
  4772. * floating-point numbers.
  4773. *
  4774. * @private
  4775. * @param {number} lower The lower bound.
  4776. * @param {number} upper The upper bound.
  4777. * @returns {number} Returns the random number.
  4778. */
  4779. function baseRandom(lower, upper) {
  4780. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4781. }
  4782. /**
  4783. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4784. * coerce arguments.
  4785. *
  4786. * @private
  4787. * @param {number} start The start of the range.
  4788. * @param {number} end The end of the range.
  4789. * @param {number} step The value to increment or decrement by.
  4790. * @param {boolean} [fromRight] Specify iterating from right to left.
  4791. * @returns {Array} Returns the range of numbers.
  4792. */
  4793. function baseRange(start, end, step, fromRight) {
  4794. var index = -1,
  4795. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4796. result = Array(length);
  4797. while (length--) {
  4798. result[fromRight ? length : ++index] = start;
  4799. start += step;
  4800. }
  4801. return result;
  4802. }
  4803. /**
  4804. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4805. *
  4806. * @private
  4807. * @param {string} string The string to repeat.
  4808. * @param {number} n The number of times to repeat the string.
  4809. * @returns {string} Returns the repeated string.
  4810. */
  4811. function baseRepeat(string, n) {
  4812. var result = '';
  4813. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4814. return result;
  4815. }
  4816. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4817. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4818. do {
  4819. if (n % 2) {
  4820. result += string;
  4821. }
  4822. n = nativeFloor(n / 2);
  4823. if (n) {
  4824. string += string;
  4825. }
  4826. } while (n);
  4827. return result;
  4828. }
  4829. /**
  4830. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4831. *
  4832. * @private
  4833. * @param {Function} func The function to apply a rest parameter to.
  4834. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4835. * @returns {Function} Returns the new function.
  4836. */
  4837. function baseRest(func, start) {
  4838. return setToString(overRest(func, start, identity), func + '');
  4839. }
  4840. /**
  4841. * The base implementation of `_.sample`.
  4842. *
  4843. * @private
  4844. * @param {Array|Object} collection The collection to sample.
  4845. * @returns {*} Returns the random element.
  4846. */
  4847. function baseSample(collection) {
  4848. return arraySample(values(collection));
  4849. }
  4850. /**
  4851. * The base implementation of `_.sampleSize` without param guards.
  4852. *
  4853. * @private
  4854. * @param {Array|Object} collection The collection to sample.
  4855. * @param {number} n The number of elements to sample.
  4856. * @returns {Array} Returns the random elements.
  4857. */
  4858. function baseSampleSize(collection, n) {
  4859. var array = values(collection);
  4860. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4861. }
  4862. /**
  4863. * The base implementation of `_.set`.
  4864. *
  4865. * @private
  4866. * @param {Object} object The object to modify.
  4867. * @param {Array|string} path The path of the property to set.
  4868. * @param {*} value The value to set.
  4869. * @param {Function} [customizer] The function to customize path creation.
  4870. * @returns {Object} Returns `object`.
  4871. */
  4872. function baseSet(object, path, value, customizer) {
  4873. if (!isObject(object)) {
  4874. return object;
  4875. }
  4876. path = castPath(path, object);
  4877. var index = -1,
  4878. length = path.length,
  4879. lastIndex = length - 1,
  4880. nested = object;
  4881. while (nested != null && ++index < length) {
  4882. var key = toKey(path[index]),
  4883. newValue = value;
  4884. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4885. return object;
  4886. }
  4887. if (index != lastIndex) {
  4888. var objValue = nested[key];
  4889. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4890. if (newValue === undefined) {
  4891. newValue = isObject(objValue)
  4892. ? objValue
  4893. : (isIndex(path[index + 1]) ? [] : {});
  4894. }
  4895. }
  4896. assignValue(nested, key, newValue);
  4897. nested = nested[key];
  4898. }
  4899. return object;
  4900. }
  4901. /**
  4902. * The base implementation of `setData` without support for hot loop shorting.
  4903. *
  4904. * @private
  4905. * @param {Function} func The function to associate metadata with.
  4906. * @param {*} data The metadata.
  4907. * @returns {Function} Returns `func`.
  4908. */
  4909. var baseSetData = !metaMap ? identity : function(func, data) {
  4910. metaMap.set(func, data);
  4911. return func;
  4912. };
  4913. /**
  4914. * The base implementation of `setToString` without support for hot loop shorting.
  4915. *
  4916. * @private
  4917. * @param {Function} func The function to modify.
  4918. * @param {Function} string The `toString` result.
  4919. * @returns {Function} Returns `func`.
  4920. */
  4921. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4922. return defineProperty(func, 'toString', {
  4923. 'configurable': true,
  4924. 'enumerable': false,
  4925. 'value': constant(string),
  4926. 'writable': true
  4927. });
  4928. };
  4929. /**
  4930. * The base implementation of `_.shuffle`.
  4931. *
  4932. * @private
  4933. * @param {Array|Object} collection The collection to shuffle.
  4934. * @returns {Array} Returns the new shuffled array.
  4935. */
  4936. function baseShuffle(collection) {
  4937. return shuffleSelf(values(collection));
  4938. }
  4939. /**
  4940. * The base implementation of `_.slice` without an iteratee call guard.
  4941. *
  4942. * @private
  4943. * @param {Array} array The array to slice.
  4944. * @param {number} [start=0] The start position.
  4945. * @param {number} [end=array.length] The end position.
  4946. * @returns {Array} Returns the slice of `array`.
  4947. */
  4948. function baseSlice(array, start, end) {
  4949. var index = -1,
  4950. length = array.length;
  4951. if (start < 0) {
  4952. start = -start > length ? 0 : (length + start);
  4953. }
  4954. end = end > length ? length : end;
  4955. if (end < 0) {
  4956. end += length;
  4957. }
  4958. length = start > end ? 0 : ((end - start) >>> 0);
  4959. start >>>= 0;
  4960. var result = Array(length);
  4961. while (++index < length) {
  4962. result[index] = array[index + start];
  4963. }
  4964. return result;
  4965. }
  4966. /**
  4967. * The base implementation of `_.some` without support for iteratee shorthands.
  4968. *
  4969. * @private
  4970. * @param {Array|Object} collection The collection to iterate over.
  4971. * @param {Function} predicate The function invoked per iteration.
  4972. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4973. * else `false`.
  4974. */
  4975. function baseSome(collection, predicate) {
  4976. var result;
  4977. baseEach(collection, function(value, index, collection) {
  4978. result = predicate(value, index, collection);
  4979. return !result;
  4980. });
  4981. return !!result;
  4982. }
  4983. /**
  4984. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4985. * performs a binary search of `array` to determine the index at which `value`
  4986. * should be inserted into `array` in order to maintain its sort order.
  4987. *
  4988. * @private
  4989. * @param {Array} array The sorted array to inspect.
  4990. * @param {*} value The value to evaluate.
  4991. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4992. * @returns {number} Returns the index at which `value` should be inserted
  4993. * into `array`.
  4994. */
  4995. function baseSortedIndex(array, value, retHighest) {
  4996. var low = 0,
  4997. high = array == null ? low : array.length;
  4998. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4999. while (low < high) {
  5000. var mid = (low + high) >>> 1,
  5001. computed = array[mid];
  5002. if (computed !== null && !isSymbol(computed) &&
  5003. (retHighest ? (computed <= value) : (computed < value))) {
  5004. low = mid + 1;
  5005. } else {
  5006. high = mid;
  5007. }
  5008. }
  5009. return high;
  5010. }
  5011. return baseSortedIndexBy(array, value, identity, retHighest);
  5012. }
  5013. /**
  5014. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5015. * which invokes `iteratee` for `value` and each element of `array` to compute
  5016. * their sort ranking. The iteratee is invoked with one argument; (value).
  5017. *
  5018. * @private
  5019. * @param {Array} array The sorted array to inspect.
  5020. * @param {*} value The value to evaluate.
  5021. * @param {Function} iteratee The iteratee invoked per element.
  5022. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5023. * @returns {number} Returns the index at which `value` should be inserted
  5024. * into `array`.
  5025. */
  5026. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5027. var low = 0,
  5028. high = array == null ? 0 : array.length;
  5029. if (high === 0) {
  5030. return 0;
  5031. }
  5032. value = iteratee(value);
  5033. var valIsNaN = value !== value,
  5034. valIsNull = value === null,
  5035. valIsSymbol = isSymbol(value),
  5036. valIsUndefined = value === undefined;
  5037. while (low < high) {
  5038. var mid = nativeFloor((low + high) / 2),
  5039. computed = iteratee(array[mid]),
  5040. othIsDefined = computed !== undefined,
  5041. othIsNull = computed === null,
  5042. othIsReflexive = computed === computed,
  5043. othIsSymbol = isSymbol(computed);
  5044. if (valIsNaN) {
  5045. var setLow = retHighest || othIsReflexive;
  5046. } else if (valIsUndefined) {
  5047. setLow = othIsReflexive && (retHighest || othIsDefined);
  5048. } else if (valIsNull) {
  5049. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5050. } else if (valIsSymbol) {
  5051. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5052. } else if (othIsNull || othIsSymbol) {
  5053. setLow = false;
  5054. } else {
  5055. setLow = retHighest ? (computed <= value) : (computed < value);
  5056. }
  5057. if (setLow) {
  5058. low = mid + 1;
  5059. } else {
  5060. high = mid;
  5061. }
  5062. }
  5063. return nativeMin(high, MAX_ARRAY_INDEX);
  5064. }
  5065. /**
  5066. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5067. * support for iteratee shorthands.
  5068. *
  5069. * @private
  5070. * @param {Array} array The array to inspect.
  5071. * @param {Function} [iteratee] The iteratee invoked per element.
  5072. * @returns {Array} Returns the new duplicate free array.
  5073. */
  5074. function baseSortedUniq(array, iteratee) {
  5075. var index = -1,
  5076. length = array.length,
  5077. resIndex = 0,
  5078. result = [];
  5079. while (++index < length) {
  5080. var value = array[index],
  5081. computed = iteratee ? iteratee(value) : value;
  5082. if (!index || !eq(computed, seen)) {
  5083. var seen = computed;
  5084. result[resIndex++] = value === 0 ? 0 : value;
  5085. }
  5086. }
  5087. return result;
  5088. }
  5089. /**
  5090. * The base implementation of `_.toNumber` which doesn't ensure correct
  5091. * conversions of binary, hexadecimal, or octal string values.
  5092. *
  5093. * @private
  5094. * @param {*} value The value to process.
  5095. * @returns {number} Returns the number.
  5096. */
  5097. function baseToNumber(value) {
  5098. if (typeof value == 'number') {
  5099. return value;
  5100. }
  5101. if (isSymbol(value)) {
  5102. return NAN;
  5103. }
  5104. return +value;
  5105. }
  5106. /**
  5107. * The base implementation of `_.toString` which doesn't convert nullish
  5108. * values to empty strings.
  5109. *
  5110. * @private
  5111. * @param {*} value The value to process.
  5112. * @returns {string} Returns the string.
  5113. */
  5114. function baseToString(value) {
  5115. // Exit early for strings to avoid a performance hit in some environments.
  5116. if (typeof value == 'string') {
  5117. return value;
  5118. }
  5119. if (isArray(value)) {
  5120. // Recursively convert values (susceptible to call stack limits).
  5121. return arrayMap(value, baseToString) + '';
  5122. }
  5123. if (isSymbol(value)) {
  5124. return symbolToString ? symbolToString.call(value) : '';
  5125. }
  5126. var result = (value + '');
  5127. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5128. }
  5129. /**
  5130. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5131. *
  5132. * @private
  5133. * @param {Array} array The array to inspect.
  5134. * @param {Function} [iteratee] The iteratee invoked per element.
  5135. * @param {Function} [comparator] The comparator invoked per element.
  5136. * @returns {Array} Returns the new duplicate free array.
  5137. */
  5138. function baseUniq(array, iteratee, comparator) {
  5139. var index = -1,
  5140. includes = arrayIncludes,
  5141. length = array.length,
  5142. isCommon = true,
  5143. result = [],
  5144. seen = result;
  5145. if (comparator) {
  5146. isCommon = false;
  5147. includes = arrayIncludesWith;
  5148. }
  5149. else if (length >= LARGE_ARRAY_SIZE) {
  5150. var set = iteratee ? null : createSet(array);
  5151. if (set) {
  5152. return setToArray(set);
  5153. }
  5154. isCommon = false;
  5155. includes = cacheHas;
  5156. seen = new SetCache;
  5157. }
  5158. else {
  5159. seen = iteratee ? [] : result;
  5160. }
  5161. outer:
  5162. while (++index < length) {
  5163. var value = array[index],
  5164. computed = iteratee ? iteratee(value) : value;
  5165. value = (comparator || value !== 0) ? value : 0;
  5166. if (isCommon && computed === computed) {
  5167. var seenIndex = seen.length;
  5168. while (seenIndex--) {
  5169. if (seen[seenIndex] === computed) {
  5170. continue outer;
  5171. }
  5172. }
  5173. if (iteratee) {
  5174. seen.push(computed);
  5175. }
  5176. result.push(value);
  5177. }
  5178. else if (!includes(seen, computed, comparator)) {
  5179. if (seen !== result) {
  5180. seen.push(computed);
  5181. }
  5182. result.push(value);
  5183. }
  5184. }
  5185. return result;
  5186. }
  5187. /**
  5188. * The base implementation of `_.unset`.
  5189. *
  5190. * @private
  5191. * @param {Object} object The object to modify.
  5192. * @param {Array|string} path The property path to unset.
  5193. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5194. */
  5195. function baseUnset(object, path) {
  5196. path = castPath(path, object);
  5197. object = parent(object, path);
  5198. return object == null || delete object[toKey(last(path))];
  5199. }
  5200. /**
  5201. * The base implementation of `_.update`.
  5202. *
  5203. * @private
  5204. * @param {Object} object The object to modify.
  5205. * @param {Array|string} path The path of the property to update.
  5206. * @param {Function} updater The function to produce the updated value.
  5207. * @param {Function} [customizer] The function to customize path creation.
  5208. * @returns {Object} Returns `object`.
  5209. */
  5210. function baseUpdate(object, path, updater, customizer) {
  5211. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5212. }
  5213. /**
  5214. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5215. * without support for iteratee shorthands.
  5216. *
  5217. * @private
  5218. * @param {Array} array The array to query.
  5219. * @param {Function} predicate The function invoked per iteration.
  5220. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5221. * @param {boolean} [fromRight] Specify iterating from right to left.
  5222. * @returns {Array} Returns the slice of `array`.
  5223. */
  5224. function baseWhile(array, predicate, isDrop, fromRight) {
  5225. var length = array.length,
  5226. index = fromRight ? length : -1;
  5227. while ((fromRight ? index-- : ++index < length) &&
  5228. predicate(array[index], index, array)) {}
  5229. return isDrop
  5230. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5231. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5232. }
  5233. /**
  5234. * The base implementation of `wrapperValue` which returns the result of
  5235. * performing a sequence of actions on the unwrapped `value`, where each
  5236. * successive action is supplied the return value of the previous.
  5237. *
  5238. * @private
  5239. * @param {*} value The unwrapped value.
  5240. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5241. * @returns {*} Returns the resolved value.
  5242. */
  5243. function baseWrapperValue(value, actions) {
  5244. var result = value;
  5245. if (result instanceof LazyWrapper) {
  5246. result = result.value();
  5247. }
  5248. return arrayReduce(actions, function(result, action) {
  5249. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5250. }, result);
  5251. }
  5252. /**
  5253. * The base implementation of methods like `_.xor`, without support for
  5254. * iteratee shorthands, that accepts an array of arrays to inspect.
  5255. *
  5256. * @private
  5257. * @param {Array} arrays The arrays to inspect.
  5258. * @param {Function} [iteratee] The iteratee invoked per element.
  5259. * @param {Function} [comparator] The comparator invoked per element.
  5260. * @returns {Array} Returns the new array of values.
  5261. */
  5262. function baseXor(arrays, iteratee, comparator) {
  5263. var length = arrays.length;
  5264. if (length < 2) {
  5265. return length ? baseUniq(arrays[0]) : [];
  5266. }
  5267. var index = -1,
  5268. result = Array(length);
  5269. while (++index < length) {
  5270. var array = arrays[index],
  5271. othIndex = -1;
  5272. while (++othIndex < length) {
  5273. if (othIndex != index) {
  5274. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5275. }
  5276. }
  5277. }
  5278. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5279. }
  5280. /**
  5281. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5282. *
  5283. * @private
  5284. * @param {Array} props The property identifiers.
  5285. * @param {Array} values The property values.
  5286. * @param {Function} assignFunc The function to assign values.
  5287. * @returns {Object} Returns the new object.
  5288. */
  5289. function baseZipObject(props, values, assignFunc) {
  5290. var index = -1,
  5291. length = props.length,
  5292. valsLength = values.length,
  5293. result = {};
  5294. while (++index < length) {
  5295. var value = index < valsLength ? values[index] : undefined;
  5296. assignFunc(result, props[index], value);
  5297. }
  5298. return result;
  5299. }
  5300. /**
  5301. * Casts `value` to an empty array if it's not an array like object.
  5302. *
  5303. * @private
  5304. * @param {*} value The value to inspect.
  5305. * @returns {Array|Object} Returns the cast array-like object.
  5306. */
  5307. function castArrayLikeObject(value) {
  5308. return isArrayLikeObject(value) ? value : [];
  5309. }
  5310. /**
  5311. * Casts `value` to `identity` if it's not a function.
  5312. *
  5313. * @private
  5314. * @param {*} value The value to inspect.
  5315. * @returns {Function} Returns cast function.
  5316. */
  5317. function castFunction(value) {
  5318. return typeof value == 'function' ? value : identity;
  5319. }
  5320. /**
  5321. * Casts `value` to a path array if it's not one.
  5322. *
  5323. * @private
  5324. * @param {*} value The value to inspect.
  5325. * @param {Object} [object] The object to query keys on.
  5326. * @returns {Array} Returns the cast property path array.
  5327. */
  5328. function castPath(value, object) {
  5329. if (isArray(value)) {
  5330. return value;
  5331. }
  5332. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5333. }
  5334. /**
  5335. * A `baseRest` alias which can be replaced with `identity` by module
  5336. * replacement plugins.
  5337. *
  5338. * @private
  5339. * @type {Function}
  5340. * @param {Function} func The function to apply a rest parameter to.
  5341. * @returns {Function} Returns the new function.
  5342. */
  5343. var castRest = baseRest;
  5344. /**
  5345. * Casts `array` to a slice if it's needed.
  5346. *
  5347. * @private
  5348. * @param {Array} array The array to inspect.
  5349. * @param {number} start The start position.
  5350. * @param {number} [end=array.length] The end position.
  5351. * @returns {Array} Returns the cast slice.
  5352. */
  5353. function castSlice(array, start, end) {
  5354. var length = array.length;
  5355. end = end === undefined ? length : end;
  5356. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5357. }
  5358. /**
  5359. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5360. *
  5361. * @private
  5362. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5363. */
  5364. var clearTimeout = ctxClearTimeout || function(id) {
  5365. return root.clearTimeout(id);
  5366. };
  5367. /**
  5368. * Creates a clone of `buffer`.
  5369. *
  5370. * @private
  5371. * @param {Buffer} buffer The buffer to clone.
  5372. * @param {boolean} [isDeep] Specify a deep clone.
  5373. * @returns {Buffer} Returns the cloned buffer.
  5374. */
  5375. function cloneBuffer(buffer, isDeep) {
  5376. if (isDeep) {
  5377. return buffer.slice();
  5378. }
  5379. var length = buffer.length,
  5380. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5381. buffer.copy(result);
  5382. return result;
  5383. }
  5384. /**
  5385. * Creates a clone of `arrayBuffer`.
  5386. *
  5387. * @private
  5388. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5389. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5390. */
  5391. function cloneArrayBuffer(arrayBuffer) {
  5392. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5393. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5394. return result;
  5395. }
  5396. /**
  5397. * Creates a clone of `dataView`.
  5398. *
  5399. * @private
  5400. * @param {Object} dataView The data view to clone.
  5401. * @param {boolean} [isDeep] Specify a deep clone.
  5402. * @returns {Object} Returns the cloned data view.
  5403. */
  5404. function cloneDataView(dataView, isDeep) {
  5405. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5406. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5407. }
  5408. /**
  5409. * Creates a clone of `regexp`.
  5410. *
  5411. * @private
  5412. * @param {Object} regexp The regexp to clone.
  5413. * @returns {Object} Returns the cloned regexp.
  5414. */
  5415. function cloneRegExp(regexp) {
  5416. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5417. result.lastIndex = regexp.lastIndex;
  5418. return result;
  5419. }
  5420. /**
  5421. * Creates a clone of the `symbol` object.
  5422. *
  5423. * @private
  5424. * @param {Object} symbol The symbol object to clone.
  5425. * @returns {Object} Returns the cloned symbol object.
  5426. */
  5427. function cloneSymbol(symbol) {
  5428. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5429. }
  5430. /**
  5431. * Creates a clone of `typedArray`.
  5432. *
  5433. * @private
  5434. * @param {Object} typedArray The typed array to clone.
  5435. * @param {boolean} [isDeep] Specify a deep clone.
  5436. * @returns {Object} Returns the cloned typed array.
  5437. */
  5438. function cloneTypedArray(typedArray, isDeep) {
  5439. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5440. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5441. }
  5442. /**
  5443. * Compares values to sort them in ascending order.
  5444. *
  5445. * @private
  5446. * @param {*} value The value to compare.
  5447. * @param {*} other The other value to compare.
  5448. * @returns {number} Returns the sort order indicator for `value`.
  5449. */
  5450. function compareAscending(value, other) {
  5451. if (value !== other) {
  5452. var valIsDefined = value !== undefined,
  5453. valIsNull = value === null,
  5454. valIsReflexive = value === value,
  5455. valIsSymbol = isSymbol(value);
  5456. var othIsDefined = other !== undefined,
  5457. othIsNull = other === null,
  5458. othIsReflexive = other === other,
  5459. othIsSymbol = isSymbol(other);
  5460. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5461. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5462. (valIsNull && othIsDefined && othIsReflexive) ||
  5463. (!valIsDefined && othIsReflexive) ||
  5464. !valIsReflexive) {
  5465. return 1;
  5466. }
  5467. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5468. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5469. (othIsNull && valIsDefined && valIsReflexive) ||
  5470. (!othIsDefined && valIsReflexive) ||
  5471. !othIsReflexive) {
  5472. return -1;
  5473. }
  5474. }
  5475. return 0;
  5476. }
  5477. /**
  5478. * Used by `_.orderBy` to compare multiple properties of a value to another
  5479. * and stable sort them.
  5480. *
  5481. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5482. * specify an order of "desc" for descending or "asc" for ascending sort order
  5483. * of corresponding values.
  5484. *
  5485. * @private
  5486. * @param {Object} object The object to compare.
  5487. * @param {Object} other The other object to compare.
  5488. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5489. * @returns {number} Returns the sort order indicator for `object`.
  5490. */
  5491. function compareMultiple(object, other, orders) {
  5492. var index = -1,
  5493. objCriteria = object.criteria,
  5494. othCriteria = other.criteria,
  5495. length = objCriteria.length,
  5496. ordersLength = orders.length;
  5497. while (++index < length) {
  5498. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5499. if (result) {
  5500. if (index >= ordersLength) {
  5501. return result;
  5502. }
  5503. var order = orders[index];
  5504. return result * (order == 'desc' ? -1 : 1);
  5505. }
  5506. }
  5507. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5508. // that causes it, under certain circumstances, to provide the same value for
  5509. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5510. // for more details.
  5511. //
  5512. // This also ensures a stable sort in V8 and other engines.
  5513. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5514. return object.index - other.index;
  5515. }
  5516. /**
  5517. * Creates an array that is the composition of partially applied arguments,
  5518. * placeholders, and provided arguments into a single array of arguments.
  5519. *
  5520. * @private
  5521. * @param {Array} args The provided arguments.
  5522. * @param {Array} partials The arguments to prepend to those provided.
  5523. * @param {Array} holders The `partials` placeholder indexes.
  5524. * @params {boolean} [isCurried] Specify composing for a curried function.
  5525. * @returns {Array} Returns the new array of composed arguments.
  5526. */
  5527. function composeArgs(args, partials, holders, isCurried) {
  5528. var argsIndex = -1,
  5529. argsLength = args.length,
  5530. holdersLength = holders.length,
  5531. leftIndex = -1,
  5532. leftLength = partials.length,
  5533. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5534. result = Array(leftLength + rangeLength),
  5535. isUncurried = !isCurried;
  5536. while (++leftIndex < leftLength) {
  5537. result[leftIndex] = partials[leftIndex];
  5538. }
  5539. while (++argsIndex < holdersLength) {
  5540. if (isUncurried || argsIndex < argsLength) {
  5541. result[holders[argsIndex]] = args[argsIndex];
  5542. }
  5543. }
  5544. while (rangeLength--) {
  5545. result[leftIndex++] = args[argsIndex++];
  5546. }
  5547. return result;
  5548. }
  5549. /**
  5550. * This function is like `composeArgs` except that the arguments composition
  5551. * is tailored for `_.partialRight`.
  5552. *
  5553. * @private
  5554. * @param {Array} args The provided arguments.
  5555. * @param {Array} partials The arguments to append to those provided.
  5556. * @param {Array} holders The `partials` placeholder indexes.
  5557. * @params {boolean} [isCurried] Specify composing for a curried function.
  5558. * @returns {Array} Returns the new array of composed arguments.
  5559. */
  5560. function composeArgsRight(args, partials, holders, isCurried) {
  5561. var argsIndex = -1,
  5562. argsLength = args.length,
  5563. holdersIndex = -1,
  5564. holdersLength = holders.length,
  5565. rightIndex = -1,
  5566. rightLength = partials.length,
  5567. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5568. result = Array(rangeLength + rightLength),
  5569. isUncurried = !isCurried;
  5570. while (++argsIndex < rangeLength) {
  5571. result[argsIndex] = args[argsIndex];
  5572. }
  5573. var offset = argsIndex;
  5574. while (++rightIndex < rightLength) {
  5575. result[offset + rightIndex] = partials[rightIndex];
  5576. }
  5577. while (++holdersIndex < holdersLength) {
  5578. if (isUncurried || argsIndex < argsLength) {
  5579. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5580. }
  5581. }
  5582. return result;
  5583. }
  5584. /**
  5585. * Copies the values of `source` to `array`.
  5586. *
  5587. * @private
  5588. * @param {Array} source The array to copy values from.
  5589. * @param {Array} [array=[]] The array to copy values to.
  5590. * @returns {Array} Returns `array`.
  5591. */
  5592. function copyArray(source, array) {
  5593. var index = -1,
  5594. length = source.length;
  5595. array || (array = Array(length));
  5596. while (++index < length) {
  5597. array[index] = source[index];
  5598. }
  5599. return array;
  5600. }
  5601. /**
  5602. * Copies properties of `source` to `object`.
  5603. *
  5604. * @private
  5605. * @param {Object} source The object to copy properties from.
  5606. * @param {Array} props The property identifiers to copy.
  5607. * @param {Object} [object={}] The object to copy properties to.
  5608. * @param {Function} [customizer] The function to customize copied values.
  5609. * @returns {Object} Returns `object`.
  5610. */
  5611. function copyObject(source, props, object, customizer) {
  5612. var isNew = !object;
  5613. object || (object = {});
  5614. var index = -1,
  5615. length = props.length;
  5616. while (++index < length) {
  5617. var key = props[index];
  5618. var newValue = customizer
  5619. ? customizer(object[key], source[key], key, object, source)
  5620. : undefined;
  5621. if (newValue === undefined) {
  5622. newValue = source[key];
  5623. }
  5624. if (isNew) {
  5625. baseAssignValue(object, key, newValue);
  5626. } else {
  5627. assignValue(object, key, newValue);
  5628. }
  5629. }
  5630. return object;
  5631. }
  5632. /**
  5633. * Copies own symbols of `source` to `object`.
  5634. *
  5635. * @private
  5636. * @param {Object} source The object to copy symbols from.
  5637. * @param {Object} [object={}] The object to copy symbols to.
  5638. * @returns {Object} Returns `object`.
  5639. */
  5640. function copySymbols(source, object) {
  5641. return copyObject(source, getSymbols(source), object);
  5642. }
  5643. /**
  5644. * Copies own and inherited symbols of `source` to `object`.
  5645. *
  5646. * @private
  5647. * @param {Object} source The object to copy symbols from.
  5648. * @param {Object} [object={}] The object to copy symbols to.
  5649. * @returns {Object} Returns `object`.
  5650. */
  5651. function copySymbolsIn(source, object) {
  5652. return copyObject(source, getSymbolsIn(source), object);
  5653. }
  5654. /**
  5655. * Creates a function like `_.groupBy`.
  5656. *
  5657. * @private
  5658. * @param {Function} setter The function to set accumulator values.
  5659. * @param {Function} [initializer] The accumulator object initializer.
  5660. * @returns {Function} Returns the new aggregator function.
  5661. */
  5662. function createAggregator(setter, initializer) {
  5663. return function(collection, iteratee) {
  5664. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5665. accumulator = initializer ? initializer() : {};
  5666. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5667. };
  5668. }
  5669. /**
  5670. * Creates a function like `_.assign`.
  5671. *
  5672. * @private
  5673. * @param {Function} assigner The function to assign values.
  5674. * @returns {Function} Returns the new assigner function.
  5675. */
  5676. function createAssigner(assigner) {
  5677. return baseRest(function(object, sources) {
  5678. var index = -1,
  5679. length = sources.length,
  5680. customizer = length > 1 ? sources[length - 1] : undefined,
  5681. guard = length > 2 ? sources[2] : undefined;
  5682. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5683. ? (length--, customizer)
  5684. : undefined;
  5685. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5686. customizer = length < 3 ? undefined : customizer;
  5687. length = 1;
  5688. }
  5689. object = Object(object);
  5690. while (++index < length) {
  5691. var source = sources[index];
  5692. if (source) {
  5693. assigner(object, source, index, customizer);
  5694. }
  5695. }
  5696. return object;
  5697. });
  5698. }
  5699. /**
  5700. * Creates a `baseEach` or `baseEachRight` function.
  5701. *
  5702. * @private
  5703. * @param {Function} eachFunc The function to iterate over a collection.
  5704. * @param {boolean} [fromRight] Specify iterating from right to left.
  5705. * @returns {Function} Returns the new base function.
  5706. */
  5707. function createBaseEach(eachFunc, fromRight) {
  5708. return function(collection, iteratee) {
  5709. if (collection == null) {
  5710. return collection;
  5711. }
  5712. if (!isArrayLike(collection)) {
  5713. return eachFunc(collection, iteratee);
  5714. }
  5715. var length = collection.length,
  5716. index = fromRight ? length : -1,
  5717. iterable = Object(collection);
  5718. while ((fromRight ? index-- : ++index < length)) {
  5719. if (iteratee(iterable[index], index, iterable) === false) {
  5720. break;
  5721. }
  5722. }
  5723. return collection;
  5724. };
  5725. }
  5726. /**
  5727. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5728. *
  5729. * @private
  5730. * @param {boolean} [fromRight] Specify iterating from right to left.
  5731. * @returns {Function} Returns the new base function.
  5732. */
  5733. function createBaseFor(fromRight) {
  5734. return function(object, iteratee, keysFunc) {
  5735. var index = -1,
  5736. iterable = Object(object),
  5737. props = keysFunc(object),
  5738. length = props.length;
  5739. while (length--) {
  5740. var key = props[fromRight ? length : ++index];
  5741. if (iteratee(iterable[key], key, iterable) === false) {
  5742. break;
  5743. }
  5744. }
  5745. return object;
  5746. };
  5747. }
  5748. /**
  5749. * Creates a function that wraps `func` to invoke it with the optional `this`
  5750. * binding of `thisArg`.
  5751. *
  5752. * @private
  5753. * @param {Function} func The function to wrap.
  5754. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5755. * @param {*} [thisArg] The `this` binding of `func`.
  5756. * @returns {Function} Returns the new wrapped function.
  5757. */
  5758. function createBind(func, bitmask, thisArg) {
  5759. var isBind = bitmask & WRAP_BIND_FLAG,
  5760. Ctor = createCtor(func);
  5761. function wrapper() {
  5762. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5763. return fn.apply(isBind ? thisArg : this, arguments);
  5764. }
  5765. return wrapper;
  5766. }
  5767. /**
  5768. * Creates a function like `_.lowerFirst`.
  5769. *
  5770. * @private
  5771. * @param {string} methodName The name of the `String` case method to use.
  5772. * @returns {Function} Returns the new case function.
  5773. */
  5774. function createCaseFirst(methodName) {
  5775. return function(string) {
  5776. string = toString(string);
  5777. var strSymbols = hasUnicode(string)
  5778. ? stringToArray(string)
  5779. : undefined;
  5780. var chr = strSymbols
  5781. ? strSymbols[0]
  5782. : string.charAt(0);
  5783. var trailing = strSymbols
  5784. ? castSlice(strSymbols, 1).join('')
  5785. : string.slice(1);
  5786. return chr[methodName]() + trailing;
  5787. };
  5788. }
  5789. /**
  5790. * Creates a function like `_.camelCase`.
  5791. *
  5792. * @private
  5793. * @param {Function} callback The function to combine each word.
  5794. * @returns {Function} Returns the new compounder function.
  5795. */
  5796. function createCompounder(callback) {
  5797. return function(string) {
  5798. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5799. };
  5800. }
  5801. /**
  5802. * Creates a function that produces an instance of `Ctor` regardless of
  5803. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5804. *
  5805. * @private
  5806. * @param {Function} Ctor The constructor to wrap.
  5807. * @returns {Function} Returns the new wrapped function.
  5808. */
  5809. function createCtor(Ctor) {
  5810. return function() {
  5811. // Use a `switch` statement to work with class constructors. See
  5812. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5813. // for more details.
  5814. var args = arguments;
  5815. switch (args.length) {
  5816. case 0: return new Ctor;
  5817. case 1: return new Ctor(args[0]);
  5818. case 2: return new Ctor(args[0], args[1]);
  5819. case 3: return new Ctor(args[0], args[1], args[2]);
  5820. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5821. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5822. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5823. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5824. }
  5825. var thisBinding = baseCreate(Ctor.prototype),
  5826. result = Ctor.apply(thisBinding, args);
  5827. // Mimic the constructor's `return` behavior.
  5828. // See https://es5.github.io/#x13.2.2 for more details.
  5829. return isObject(result) ? result : thisBinding;
  5830. };
  5831. }
  5832. /**
  5833. * Creates a function that wraps `func` to enable currying.
  5834. *
  5835. * @private
  5836. * @param {Function} func The function to wrap.
  5837. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5838. * @param {number} arity The arity of `func`.
  5839. * @returns {Function} Returns the new wrapped function.
  5840. */
  5841. function createCurry(func, bitmask, arity) {
  5842. var Ctor = createCtor(func);
  5843. function wrapper() {
  5844. var length = arguments.length,
  5845. args = Array(length),
  5846. index = length,
  5847. placeholder = getHolder(wrapper);
  5848. while (index--) {
  5849. args[index] = arguments[index];
  5850. }
  5851. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5852. ? []
  5853. : replaceHolders(args, placeholder);
  5854. length -= holders.length;
  5855. if (length < arity) {
  5856. return createRecurry(
  5857. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5858. args, holders, undefined, undefined, arity - length);
  5859. }
  5860. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5861. return apply(fn, this, args);
  5862. }
  5863. return wrapper;
  5864. }
  5865. /**
  5866. * Creates a `_.find` or `_.findLast` function.
  5867. *
  5868. * @private
  5869. * @param {Function} findIndexFunc The function to find the collection index.
  5870. * @returns {Function} Returns the new find function.
  5871. */
  5872. function createFind(findIndexFunc) {
  5873. return function(collection, predicate, fromIndex) {
  5874. var iterable = Object(collection);
  5875. if (!isArrayLike(collection)) {
  5876. var iteratee = getIteratee(predicate, 3);
  5877. collection = keys(collection);
  5878. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5879. }
  5880. var index = findIndexFunc(collection, predicate, fromIndex);
  5881. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5882. };
  5883. }
  5884. /**
  5885. * Creates a `_.flow` or `_.flowRight` function.
  5886. *
  5887. * @private
  5888. * @param {boolean} [fromRight] Specify iterating from right to left.
  5889. * @returns {Function} Returns the new flow function.
  5890. */
  5891. function createFlow(fromRight) {
  5892. return flatRest(function(funcs) {
  5893. var length = funcs.length,
  5894. index = length,
  5895. prereq = LodashWrapper.prototype.thru;
  5896. if (fromRight) {
  5897. funcs.reverse();
  5898. }
  5899. while (index--) {
  5900. var func = funcs[index];
  5901. if (typeof func != 'function') {
  5902. throw new TypeError(FUNC_ERROR_TEXT);
  5903. }
  5904. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5905. var wrapper = new LodashWrapper([], true);
  5906. }
  5907. }
  5908. index = wrapper ? index : length;
  5909. while (++index < length) {
  5910. func = funcs[index];
  5911. var funcName = getFuncName(func),
  5912. data = funcName == 'wrapper' ? getData(func) : undefined;
  5913. if (data && isLaziable(data[0]) &&
  5914. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5915. !data[4].length && data[9] == 1
  5916. ) {
  5917. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5918. } else {
  5919. wrapper = (func.length == 1 && isLaziable(func))
  5920. ? wrapper[funcName]()
  5921. : wrapper.thru(func);
  5922. }
  5923. }
  5924. return function() {
  5925. var args = arguments,
  5926. value = args[0];
  5927. if (wrapper && args.length == 1 && isArray(value)) {
  5928. return wrapper.plant(value).value();
  5929. }
  5930. var index = 0,
  5931. result = length ? funcs[index].apply(this, args) : value;
  5932. while (++index < length) {
  5933. result = funcs[index].call(this, result);
  5934. }
  5935. return result;
  5936. };
  5937. });
  5938. }
  5939. /**
  5940. * Creates a function that wraps `func` to invoke it with optional `this`
  5941. * binding of `thisArg`, partial application, and currying.
  5942. *
  5943. * @private
  5944. * @param {Function|string} func The function or method name to wrap.
  5945. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5946. * @param {*} [thisArg] The `this` binding of `func`.
  5947. * @param {Array} [partials] The arguments to prepend to those provided to
  5948. * the new function.
  5949. * @param {Array} [holders] The `partials` placeholder indexes.
  5950. * @param {Array} [partialsRight] The arguments to append to those provided
  5951. * to the new function.
  5952. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5953. * @param {Array} [argPos] The argument positions of the new function.
  5954. * @param {number} [ary] The arity cap of `func`.
  5955. * @param {number} [arity] The arity of `func`.
  5956. * @returns {Function} Returns the new wrapped function.
  5957. */
  5958. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5959. var isAry = bitmask & WRAP_ARY_FLAG,
  5960. isBind = bitmask & WRAP_BIND_FLAG,
  5961. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5962. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5963. isFlip = bitmask & WRAP_FLIP_FLAG,
  5964. Ctor = isBindKey ? undefined : createCtor(func);
  5965. function wrapper() {
  5966. var length = arguments.length,
  5967. args = Array(length),
  5968. index = length;
  5969. while (index--) {
  5970. args[index] = arguments[index];
  5971. }
  5972. if (isCurried) {
  5973. var placeholder = getHolder(wrapper),
  5974. holdersCount = countHolders(args, placeholder);
  5975. }
  5976. if (partials) {
  5977. args = composeArgs(args, partials, holders, isCurried);
  5978. }
  5979. if (partialsRight) {
  5980. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5981. }
  5982. length -= holdersCount;
  5983. if (isCurried && length < arity) {
  5984. var newHolders = replaceHolders(args, placeholder);
  5985. return createRecurry(
  5986. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5987. args, newHolders, argPos, ary, arity - length
  5988. );
  5989. }
  5990. var thisBinding = isBind ? thisArg : this,
  5991. fn = isBindKey ? thisBinding[func] : func;
  5992. length = args.length;
  5993. if (argPos) {
  5994. args = reorder(args, argPos);
  5995. } else if (isFlip && length > 1) {
  5996. args.reverse();
  5997. }
  5998. if (isAry && ary < length) {
  5999. args.length = ary;
  6000. }
  6001. if (this && this !== root && this instanceof wrapper) {
  6002. fn = Ctor || createCtor(fn);
  6003. }
  6004. return fn.apply(thisBinding, args);
  6005. }
  6006. return wrapper;
  6007. }
  6008. /**
  6009. * Creates a function like `_.invertBy`.
  6010. *
  6011. * @private
  6012. * @param {Function} setter The function to set accumulator values.
  6013. * @param {Function} toIteratee The function to resolve iteratees.
  6014. * @returns {Function} Returns the new inverter function.
  6015. */
  6016. function createInverter(setter, toIteratee) {
  6017. return function(object, iteratee) {
  6018. return baseInverter(object, setter, toIteratee(iteratee), {});
  6019. };
  6020. }
  6021. /**
  6022. * Creates a function that performs a mathematical operation on two values.
  6023. *
  6024. * @private
  6025. * @param {Function} operator The function to perform the operation.
  6026. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6027. * @returns {Function} Returns the new mathematical operation function.
  6028. */
  6029. function createMathOperation(operator, defaultValue) {
  6030. return function(value, other) {
  6031. var result;
  6032. if (value === undefined && other === undefined) {
  6033. return defaultValue;
  6034. }
  6035. if (value !== undefined) {
  6036. result = value;
  6037. }
  6038. if (other !== undefined) {
  6039. if (result === undefined) {
  6040. return other;
  6041. }
  6042. if (typeof value == 'string' || typeof other == 'string') {
  6043. value = baseToString(value);
  6044. other = baseToString(other);
  6045. } else {
  6046. value = baseToNumber(value);
  6047. other = baseToNumber(other);
  6048. }
  6049. result = operator(value, other);
  6050. }
  6051. return result;
  6052. };
  6053. }
  6054. /**
  6055. * Creates a function like `_.over`.
  6056. *
  6057. * @private
  6058. * @param {Function} arrayFunc The function to iterate over iteratees.
  6059. * @returns {Function} Returns the new over function.
  6060. */
  6061. function createOver(arrayFunc) {
  6062. return flatRest(function(iteratees) {
  6063. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6064. return baseRest(function(args) {
  6065. var thisArg = this;
  6066. return arrayFunc(iteratees, function(iteratee) {
  6067. return apply(iteratee, thisArg, args);
  6068. });
  6069. });
  6070. });
  6071. }
  6072. /**
  6073. * Creates the padding for `string` based on `length`. The `chars` string
  6074. * is truncated if the number of characters exceeds `length`.
  6075. *
  6076. * @private
  6077. * @param {number} length The padding length.
  6078. * @param {string} [chars=' '] The string used as padding.
  6079. * @returns {string} Returns the padding for `string`.
  6080. */
  6081. function createPadding(length, chars) {
  6082. chars = chars === undefined ? ' ' : baseToString(chars);
  6083. var charsLength = chars.length;
  6084. if (charsLength < 2) {
  6085. return charsLength ? baseRepeat(chars, length) : chars;
  6086. }
  6087. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6088. return hasUnicode(chars)
  6089. ? castSlice(stringToArray(result), 0, length).join('')
  6090. : result.slice(0, length);
  6091. }
  6092. /**
  6093. * Creates a function that wraps `func` to invoke it with the `this` binding
  6094. * of `thisArg` and `partials` prepended to the arguments it receives.
  6095. *
  6096. * @private
  6097. * @param {Function} func The function to wrap.
  6098. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6099. * @param {*} thisArg The `this` binding of `func`.
  6100. * @param {Array} partials The arguments to prepend to those provided to
  6101. * the new function.
  6102. * @returns {Function} Returns the new wrapped function.
  6103. */
  6104. function createPartial(func, bitmask, thisArg, partials) {
  6105. var isBind = bitmask & WRAP_BIND_FLAG,
  6106. Ctor = createCtor(func);
  6107. function wrapper() {
  6108. var argsIndex = -1,
  6109. argsLength = arguments.length,
  6110. leftIndex = -1,
  6111. leftLength = partials.length,
  6112. args = Array(leftLength + argsLength),
  6113. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6114. while (++leftIndex < leftLength) {
  6115. args[leftIndex] = partials[leftIndex];
  6116. }
  6117. while (argsLength--) {
  6118. args[leftIndex++] = arguments[++argsIndex];
  6119. }
  6120. return apply(fn, isBind ? thisArg : this, args);
  6121. }
  6122. return wrapper;
  6123. }
  6124. /**
  6125. * Creates a `_.range` or `_.rangeRight` function.
  6126. *
  6127. * @private
  6128. * @param {boolean} [fromRight] Specify iterating from right to left.
  6129. * @returns {Function} Returns the new range function.
  6130. */
  6131. function createRange(fromRight) {
  6132. return function(start, end, step) {
  6133. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6134. end = step = undefined;
  6135. }
  6136. // Ensure the sign of `-0` is preserved.
  6137. start = toFinite(start);
  6138. if (end === undefined) {
  6139. end = start;
  6140. start = 0;
  6141. } else {
  6142. end = toFinite(end);
  6143. }
  6144. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6145. return baseRange(start, end, step, fromRight);
  6146. };
  6147. }
  6148. /**
  6149. * Creates a function that performs a relational operation on two values.
  6150. *
  6151. * @private
  6152. * @param {Function} operator The function to perform the operation.
  6153. * @returns {Function} Returns the new relational operation function.
  6154. */
  6155. function createRelationalOperation(operator) {
  6156. return function(value, other) {
  6157. if (!(typeof value == 'string' && typeof other == 'string')) {
  6158. value = toNumber(value);
  6159. other = toNumber(other);
  6160. }
  6161. return operator(value, other);
  6162. };
  6163. }
  6164. /**
  6165. * Creates a function that wraps `func` to continue currying.
  6166. *
  6167. * @private
  6168. * @param {Function} func The function to wrap.
  6169. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6170. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6171. * @param {*} placeholder The placeholder value.
  6172. * @param {*} [thisArg] The `this` binding of `func`.
  6173. * @param {Array} [partials] The arguments to prepend to those provided to
  6174. * the new function.
  6175. * @param {Array} [holders] The `partials` placeholder indexes.
  6176. * @param {Array} [argPos] The argument positions of the new function.
  6177. * @param {number} [ary] The arity cap of `func`.
  6178. * @param {number} [arity] The arity of `func`.
  6179. * @returns {Function} Returns the new wrapped function.
  6180. */
  6181. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6182. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6183. newHolders = isCurry ? holders : undefined,
  6184. newHoldersRight = isCurry ? undefined : holders,
  6185. newPartials = isCurry ? partials : undefined,
  6186. newPartialsRight = isCurry ? undefined : partials;
  6187. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6188. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6189. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6190. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6191. }
  6192. var newData = [
  6193. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6194. newHoldersRight, argPos, ary, arity
  6195. ];
  6196. var result = wrapFunc.apply(undefined, newData);
  6197. if (isLaziable(func)) {
  6198. setData(result, newData);
  6199. }
  6200. result.placeholder = placeholder;
  6201. return setWrapToString(result, func, bitmask);
  6202. }
  6203. /**
  6204. * Creates a function like `_.round`.
  6205. *
  6206. * @private
  6207. * @param {string} methodName The name of the `Math` method to use when rounding.
  6208. * @returns {Function} Returns the new round function.
  6209. */
  6210. function createRound(methodName) {
  6211. var func = Math[methodName];
  6212. return function(number, precision) {
  6213. number = toNumber(number);
  6214. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6215. if (precision && nativeIsFinite(number)) {
  6216. // Shift with exponential notation to avoid floating-point issues.
  6217. // See [MDN](https://mdn.io/round#Examples) for more details.
  6218. var pair = (toString(number) + 'e').split('e'),
  6219. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6220. pair = (toString(value) + 'e').split('e');
  6221. return +(pair[0] + 'e' + (+pair[1] - precision));
  6222. }
  6223. return func(number);
  6224. };
  6225. }
  6226. /**
  6227. * Creates a set object of `values`.
  6228. *
  6229. * @private
  6230. * @param {Array} values The values to add to the set.
  6231. * @returns {Object} Returns the new set.
  6232. */
  6233. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6234. return new Set(values);
  6235. };
  6236. /**
  6237. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6238. *
  6239. * @private
  6240. * @param {Function} keysFunc The function to get the keys of a given object.
  6241. * @returns {Function} Returns the new pairs function.
  6242. */
  6243. function createToPairs(keysFunc) {
  6244. return function(object) {
  6245. var tag = getTag(object);
  6246. if (tag == mapTag) {
  6247. return mapToArray(object);
  6248. }
  6249. if (tag == setTag) {
  6250. return setToPairs(object);
  6251. }
  6252. return baseToPairs(object, keysFunc(object));
  6253. };
  6254. }
  6255. /**
  6256. * Creates a function that either curries or invokes `func` with optional
  6257. * `this` binding and partially applied arguments.
  6258. *
  6259. * @private
  6260. * @param {Function|string} func The function or method name to wrap.
  6261. * @param {number} bitmask The bitmask flags.
  6262. * 1 - `_.bind`
  6263. * 2 - `_.bindKey`
  6264. * 4 - `_.curry` or `_.curryRight` of a bound function
  6265. * 8 - `_.curry`
  6266. * 16 - `_.curryRight`
  6267. * 32 - `_.partial`
  6268. * 64 - `_.partialRight`
  6269. * 128 - `_.rearg`
  6270. * 256 - `_.ary`
  6271. * 512 - `_.flip`
  6272. * @param {*} [thisArg] The `this` binding of `func`.
  6273. * @param {Array} [partials] The arguments to be partially applied.
  6274. * @param {Array} [holders] The `partials` placeholder indexes.
  6275. * @param {Array} [argPos] The argument positions of the new function.
  6276. * @param {number} [ary] The arity cap of `func`.
  6277. * @param {number} [arity] The arity of `func`.
  6278. * @returns {Function} Returns the new wrapped function.
  6279. */
  6280. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6281. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6282. if (!isBindKey && typeof func != 'function') {
  6283. throw new TypeError(FUNC_ERROR_TEXT);
  6284. }
  6285. var length = partials ? partials.length : 0;
  6286. if (!length) {
  6287. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6288. partials = holders = undefined;
  6289. }
  6290. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6291. arity = arity === undefined ? arity : toInteger(arity);
  6292. length -= holders ? holders.length : 0;
  6293. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6294. var partialsRight = partials,
  6295. holdersRight = holders;
  6296. partials = holders = undefined;
  6297. }
  6298. var data = isBindKey ? undefined : getData(func);
  6299. var newData = [
  6300. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6301. argPos, ary, arity
  6302. ];
  6303. if (data) {
  6304. mergeData(newData, data);
  6305. }
  6306. func = newData[0];
  6307. bitmask = newData[1];
  6308. thisArg = newData[2];
  6309. partials = newData[3];
  6310. holders = newData[4];
  6311. arity = newData[9] = newData[9] === undefined
  6312. ? (isBindKey ? 0 : func.length)
  6313. : nativeMax(newData[9] - length, 0);
  6314. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6315. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6316. }
  6317. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6318. var result = createBind(func, bitmask, thisArg);
  6319. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6320. result = createCurry(func, bitmask, arity);
  6321. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6322. result = createPartial(func, bitmask, thisArg, partials);
  6323. } else {
  6324. result = createHybrid.apply(undefined, newData);
  6325. }
  6326. var setter = data ? baseSetData : setData;
  6327. return setWrapToString(setter(result, newData), func, bitmask);
  6328. }
  6329. /**
  6330. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6331. * of source objects to the destination object for all destination properties
  6332. * that resolve to `undefined`.
  6333. *
  6334. * @private
  6335. * @param {*} objValue The destination value.
  6336. * @param {*} srcValue The source value.
  6337. * @param {string} key The key of the property to assign.
  6338. * @param {Object} object The parent object of `objValue`.
  6339. * @returns {*} Returns the value to assign.
  6340. */
  6341. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6342. if (objValue === undefined ||
  6343. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6344. return srcValue;
  6345. }
  6346. return objValue;
  6347. }
  6348. /**
  6349. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6350. * objects into destination objects that are passed thru.
  6351. *
  6352. * @private
  6353. * @param {*} objValue The destination value.
  6354. * @param {*} srcValue The source value.
  6355. * @param {string} key The key of the property to merge.
  6356. * @param {Object} object The parent object of `objValue`.
  6357. * @param {Object} source The parent object of `srcValue`.
  6358. * @param {Object} [stack] Tracks traversed source values and their merged
  6359. * counterparts.
  6360. * @returns {*} Returns the value to assign.
  6361. */
  6362. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6363. if (isObject(objValue) && isObject(srcValue)) {
  6364. // Recursively merge objects and arrays (susceptible to call stack limits).
  6365. stack.set(srcValue, objValue);
  6366. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6367. stack['delete'](srcValue);
  6368. }
  6369. return objValue;
  6370. }
  6371. /**
  6372. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6373. * objects.
  6374. *
  6375. * @private
  6376. * @param {*} value The value to inspect.
  6377. * @param {string} key The key of the property to inspect.
  6378. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6379. */
  6380. function customOmitClone(value) {
  6381. return isPlainObject(value) ? undefined : value;
  6382. }
  6383. /**
  6384. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6385. * partial deep comparisons.
  6386. *
  6387. * @private
  6388. * @param {Array} array The array to compare.
  6389. * @param {Array} other The other array to compare.
  6390. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6391. * @param {Function} customizer The function to customize comparisons.
  6392. * @param {Function} equalFunc The function to determine equivalents of values.
  6393. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6394. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6395. */
  6396. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6397. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6398. arrLength = array.length,
  6399. othLength = other.length;
  6400. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6401. return false;
  6402. }
  6403. // Check that cyclic values are equal.
  6404. var arrStacked = stack.get(array);
  6405. var othStacked = stack.get(other);
  6406. if (arrStacked && othStacked) {
  6407. return arrStacked == other && othStacked == array;
  6408. }
  6409. var index = -1,
  6410. result = true,
  6411. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6412. stack.set(array, other);
  6413. stack.set(other, array);
  6414. // Ignore non-index properties.
  6415. while (++index < arrLength) {
  6416. var arrValue = array[index],
  6417. othValue = other[index];
  6418. if (customizer) {
  6419. var compared = isPartial
  6420. ? customizer(othValue, arrValue, index, other, array, stack)
  6421. : customizer(arrValue, othValue, index, array, other, stack);
  6422. }
  6423. if (compared !== undefined) {
  6424. if (compared) {
  6425. continue;
  6426. }
  6427. result = false;
  6428. break;
  6429. }
  6430. // Recursively compare arrays (susceptible to call stack limits).
  6431. if (seen) {
  6432. if (!arraySome(other, function(othValue, othIndex) {
  6433. if (!cacheHas(seen, othIndex) &&
  6434. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6435. return seen.push(othIndex);
  6436. }
  6437. })) {
  6438. result = false;
  6439. break;
  6440. }
  6441. } else if (!(
  6442. arrValue === othValue ||
  6443. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6444. )) {
  6445. result = false;
  6446. break;
  6447. }
  6448. }
  6449. stack['delete'](array);
  6450. stack['delete'](other);
  6451. return result;
  6452. }
  6453. /**
  6454. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6455. * the same `toStringTag`.
  6456. *
  6457. * **Note:** This function only supports comparing values with tags of
  6458. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6459. *
  6460. * @private
  6461. * @param {Object} object The object to compare.
  6462. * @param {Object} other The other object to compare.
  6463. * @param {string} tag The `toStringTag` of the objects to compare.
  6464. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6465. * @param {Function} customizer The function to customize comparisons.
  6466. * @param {Function} equalFunc The function to determine equivalents of values.
  6467. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6468. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6469. */
  6470. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6471. switch (tag) {
  6472. case dataViewTag:
  6473. if ((object.byteLength != other.byteLength) ||
  6474. (object.byteOffset != other.byteOffset)) {
  6475. return false;
  6476. }
  6477. object = object.buffer;
  6478. other = other.buffer;
  6479. case arrayBufferTag:
  6480. if ((object.byteLength != other.byteLength) ||
  6481. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6482. return false;
  6483. }
  6484. return true;
  6485. case boolTag:
  6486. case dateTag:
  6487. case numberTag:
  6488. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6489. // Invalid dates are coerced to `NaN`.
  6490. return eq(+object, +other);
  6491. case errorTag:
  6492. return object.name == other.name && object.message == other.message;
  6493. case regexpTag:
  6494. case stringTag:
  6495. // Coerce regexes to strings and treat strings, primitives and objects,
  6496. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6497. // for more details.
  6498. return object == (other + '');
  6499. case mapTag:
  6500. var convert = mapToArray;
  6501. case setTag:
  6502. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6503. convert || (convert = setToArray);
  6504. if (object.size != other.size && !isPartial) {
  6505. return false;
  6506. }
  6507. // Assume cyclic values are equal.
  6508. var stacked = stack.get(object);
  6509. if (stacked) {
  6510. return stacked == other;
  6511. }
  6512. bitmask |= COMPARE_UNORDERED_FLAG;
  6513. // Recursively compare objects (susceptible to call stack limits).
  6514. stack.set(object, other);
  6515. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6516. stack['delete'](object);
  6517. return result;
  6518. case symbolTag:
  6519. if (symbolValueOf) {
  6520. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6521. }
  6522. }
  6523. return false;
  6524. }
  6525. /**
  6526. * A specialized version of `baseIsEqualDeep` for objects with support for
  6527. * partial deep comparisons.
  6528. *
  6529. * @private
  6530. * @param {Object} object The object to compare.
  6531. * @param {Object} other The other object to compare.
  6532. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6533. * @param {Function} customizer The function to customize comparisons.
  6534. * @param {Function} equalFunc The function to determine equivalents of values.
  6535. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6536. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6537. */
  6538. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6539. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6540. objProps = getAllKeys(object),
  6541. objLength = objProps.length,
  6542. othProps = getAllKeys(other),
  6543. othLength = othProps.length;
  6544. if (objLength != othLength && !isPartial) {
  6545. return false;
  6546. }
  6547. var index = objLength;
  6548. while (index--) {
  6549. var key = objProps[index];
  6550. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6551. return false;
  6552. }
  6553. }
  6554. // Check that cyclic values are equal.
  6555. var objStacked = stack.get(object);
  6556. var othStacked = stack.get(other);
  6557. if (objStacked && othStacked) {
  6558. return objStacked == other && othStacked == object;
  6559. }
  6560. var result = true;
  6561. stack.set(object, other);
  6562. stack.set(other, object);
  6563. var skipCtor = isPartial;
  6564. while (++index < objLength) {
  6565. key = objProps[index];
  6566. var objValue = object[key],
  6567. othValue = other[key];
  6568. if (customizer) {
  6569. var compared = isPartial
  6570. ? customizer(othValue, objValue, key, other, object, stack)
  6571. : customizer(objValue, othValue, key, object, other, stack);
  6572. }
  6573. // Recursively compare objects (susceptible to call stack limits).
  6574. if (!(compared === undefined
  6575. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6576. : compared
  6577. )) {
  6578. result = false;
  6579. break;
  6580. }
  6581. skipCtor || (skipCtor = key == 'constructor');
  6582. }
  6583. if (result && !skipCtor) {
  6584. var objCtor = object.constructor,
  6585. othCtor = other.constructor;
  6586. // Non `Object` object instances with different constructors are not equal.
  6587. if (objCtor != othCtor &&
  6588. ('constructor' in object && 'constructor' in other) &&
  6589. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6590. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6591. result = false;
  6592. }
  6593. }
  6594. stack['delete'](object);
  6595. stack['delete'](other);
  6596. return result;
  6597. }
  6598. /**
  6599. * A specialized version of `baseRest` which flattens the rest array.
  6600. *
  6601. * @private
  6602. * @param {Function} func The function to apply a rest parameter to.
  6603. * @returns {Function} Returns the new function.
  6604. */
  6605. function flatRest(func) {
  6606. return setToString(overRest(func, undefined, flatten), func + '');
  6607. }
  6608. /**
  6609. * Creates an array of own enumerable property names and symbols of `object`.
  6610. *
  6611. * @private
  6612. * @param {Object} object The object to query.
  6613. * @returns {Array} Returns the array of property names and symbols.
  6614. */
  6615. function getAllKeys(object) {
  6616. return baseGetAllKeys(object, keys, getSymbols);
  6617. }
  6618. /**
  6619. * Creates an array of own and inherited enumerable property names and
  6620. * symbols of `object`.
  6621. *
  6622. * @private
  6623. * @param {Object} object The object to query.
  6624. * @returns {Array} Returns the array of property names and symbols.
  6625. */
  6626. function getAllKeysIn(object) {
  6627. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6628. }
  6629. /**
  6630. * Gets metadata for `func`.
  6631. *
  6632. * @private
  6633. * @param {Function} func The function to query.
  6634. * @returns {*} Returns the metadata for `func`.
  6635. */
  6636. var getData = !metaMap ? noop : function(func) {
  6637. return metaMap.get(func);
  6638. };
  6639. /**
  6640. * Gets the name of `func`.
  6641. *
  6642. * @private
  6643. * @param {Function} func The function to query.
  6644. * @returns {string} Returns the function name.
  6645. */
  6646. function getFuncName(func) {
  6647. var result = (func.name + ''),
  6648. array = realNames[result],
  6649. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6650. while (length--) {
  6651. var data = array[length],
  6652. otherFunc = data.func;
  6653. if (otherFunc == null || otherFunc == func) {
  6654. return data.name;
  6655. }
  6656. }
  6657. return result;
  6658. }
  6659. /**
  6660. * Gets the argument placeholder value for `func`.
  6661. *
  6662. * @private
  6663. * @param {Function} func The function to inspect.
  6664. * @returns {*} Returns the placeholder value.
  6665. */
  6666. function getHolder(func) {
  6667. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6668. return object.placeholder;
  6669. }
  6670. /**
  6671. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6672. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6673. * If arguments are provided, the chosen function is invoked with them and
  6674. * its result is returned.
  6675. *
  6676. * @private
  6677. * @param {*} [value] The value to convert to an iteratee.
  6678. * @param {number} [arity] The arity of the created iteratee.
  6679. * @returns {Function} Returns the chosen function or its result.
  6680. */
  6681. function getIteratee() {
  6682. var result = lodash.iteratee || iteratee;
  6683. result = result === iteratee ? baseIteratee : result;
  6684. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6685. }
  6686. /**
  6687. * Gets the data for `map`.
  6688. *
  6689. * @private
  6690. * @param {Object} map The map to query.
  6691. * @param {string} key The reference key.
  6692. * @returns {*} Returns the map data.
  6693. */
  6694. function getMapData(map, key) {
  6695. var data = map.__data__;
  6696. return isKeyable(key)
  6697. ? data[typeof key == 'string' ? 'string' : 'hash']
  6698. : data.map;
  6699. }
  6700. /**
  6701. * Gets the property names, values, and compare flags of `object`.
  6702. *
  6703. * @private
  6704. * @param {Object} object The object to query.
  6705. * @returns {Array} Returns the match data of `object`.
  6706. */
  6707. function getMatchData(object) {
  6708. var result = keys(object),
  6709. length = result.length;
  6710. while (length--) {
  6711. var key = result[length],
  6712. value = object[key];
  6713. result[length] = [key, value, isStrictComparable(value)];
  6714. }
  6715. return result;
  6716. }
  6717. /**
  6718. * Gets the native function at `key` of `object`.
  6719. *
  6720. * @private
  6721. * @param {Object} object The object to query.
  6722. * @param {string} key The key of the method to get.
  6723. * @returns {*} Returns the function if it's native, else `undefined`.
  6724. */
  6725. function getNative(object, key) {
  6726. var value = getValue(object, key);
  6727. return baseIsNative(value) ? value : undefined;
  6728. }
  6729. /**
  6730. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6731. *
  6732. * @private
  6733. * @param {*} value The value to query.
  6734. * @returns {string} Returns the raw `toStringTag`.
  6735. */
  6736. function getRawTag(value) {
  6737. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6738. tag = value[symToStringTag];
  6739. try {
  6740. value[symToStringTag] = undefined;
  6741. var unmasked = true;
  6742. } catch (e) {}
  6743. var result = nativeObjectToString.call(value);
  6744. if (unmasked) {
  6745. if (isOwn) {
  6746. value[symToStringTag] = tag;
  6747. } else {
  6748. delete value[symToStringTag];
  6749. }
  6750. }
  6751. return result;
  6752. }
  6753. /**
  6754. * Creates an array of the own enumerable symbols of `object`.
  6755. *
  6756. * @private
  6757. * @param {Object} object The object to query.
  6758. * @returns {Array} Returns the array of symbols.
  6759. */
  6760. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6761. if (object == null) {
  6762. return [];
  6763. }
  6764. object = Object(object);
  6765. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6766. return propertyIsEnumerable.call(object, symbol);
  6767. });
  6768. };
  6769. /**
  6770. * Creates an array of the own and inherited enumerable symbols of `object`.
  6771. *
  6772. * @private
  6773. * @param {Object} object The object to query.
  6774. * @returns {Array} Returns the array of symbols.
  6775. */
  6776. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6777. var result = [];
  6778. while (object) {
  6779. arrayPush(result, getSymbols(object));
  6780. object = getPrototype(object);
  6781. }
  6782. return result;
  6783. };
  6784. /**
  6785. * Gets the `toStringTag` of `value`.
  6786. *
  6787. * @private
  6788. * @param {*} value The value to query.
  6789. * @returns {string} Returns the `toStringTag`.
  6790. */
  6791. var getTag = baseGetTag;
  6792. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6793. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6794. (Map && getTag(new Map) != mapTag) ||
  6795. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6796. (Set && getTag(new Set) != setTag) ||
  6797. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6798. getTag = function(value) {
  6799. var result = baseGetTag(value),
  6800. Ctor = result == objectTag ? value.constructor : undefined,
  6801. ctorString = Ctor ? toSource(Ctor) : '';
  6802. if (ctorString) {
  6803. switch (ctorString) {
  6804. case dataViewCtorString: return dataViewTag;
  6805. case mapCtorString: return mapTag;
  6806. case promiseCtorString: return promiseTag;
  6807. case setCtorString: return setTag;
  6808. case weakMapCtorString: return weakMapTag;
  6809. }
  6810. }
  6811. return result;
  6812. };
  6813. }
  6814. /**
  6815. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6816. *
  6817. * @private
  6818. * @param {number} start The start of the view.
  6819. * @param {number} end The end of the view.
  6820. * @param {Array} transforms The transformations to apply to the view.
  6821. * @returns {Object} Returns an object containing the `start` and `end`
  6822. * positions of the view.
  6823. */
  6824. function getView(start, end, transforms) {
  6825. var index = -1,
  6826. length = transforms.length;
  6827. while (++index < length) {
  6828. var data = transforms[index],
  6829. size = data.size;
  6830. switch (data.type) {
  6831. case 'drop': start += size; break;
  6832. case 'dropRight': end -= size; break;
  6833. case 'take': end = nativeMin(end, start + size); break;
  6834. case 'takeRight': start = nativeMax(start, end - size); break;
  6835. }
  6836. }
  6837. return { 'start': start, 'end': end };
  6838. }
  6839. /**
  6840. * Extracts wrapper details from the `source` body comment.
  6841. *
  6842. * @private
  6843. * @param {string} source The source to inspect.
  6844. * @returns {Array} Returns the wrapper details.
  6845. */
  6846. function getWrapDetails(source) {
  6847. var match = source.match(reWrapDetails);
  6848. return match ? match[1].split(reSplitDetails) : [];
  6849. }
  6850. /**
  6851. * Checks if `path` exists on `object`.
  6852. *
  6853. * @private
  6854. * @param {Object} object The object to query.
  6855. * @param {Array|string} path The path to check.
  6856. * @param {Function} hasFunc The function to check properties.
  6857. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6858. */
  6859. function hasPath(object, path, hasFunc) {
  6860. path = castPath(path, object);
  6861. var index = -1,
  6862. length = path.length,
  6863. result = false;
  6864. while (++index < length) {
  6865. var key = toKey(path[index]);
  6866. if (!(result = object != null && hasFunc(object, key))) {
  6867. break;
  6868. }
  6869. object = object[key];
  6870. }
  6871. if (result || ++index != length) {
  6872. return result;
  6873. }
  6874. length = object == null ? 0 : object.length;
  6875. return !!length && isLength(length) && isIndex(key, length) &&
  6876. (isArray(object) || isArguments(object));
  6877. }
  6878. /**
  6879. * Initializes an array clone.
  6880. *
  6881. * @private
  6882. * @param {Array} array The array to clone.
  6883. * @returns {Array} Returns the initialized clone.
  6884. */
  6885. function initCloneArray(array) {
  6886. var length = array.length,
  6887. result = new array.constructor(length);
  6888. // Add properties assigned by `RegExp#exec`.
  6889. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6890. result.index = array.index;
  6891. result.input = array.input;
  6892. }
  6893. return result;
  6894. }
  6895. /**
  6896. * Initializes an object clone.
  6897. *
  6898. * @private
  6899. * @param {Object} object The object to clone.
  6900. * @returns {Object} Returns the initialized clone.
  6901. */
  6902. function initCloneObject(object) {
  6903. return (typeof object.constructor == 'function' && !isPrototype(object))
  6904. ? baseCreate(getPrototype(object))
  6905. : {};
  6906. }
  6907. /**
  6908. * Initializes an object clone based on its `toStringTag`.
  6909. *
  6910. * **Note:** This function only supports cloning values with tags of
  6911. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6912. *
  6913. * @private
  6914. * @param {Object} object The object to clone.
  6915. * @param {string} tag The `toStringTag` of the object to clone.
  6916. * @param {boolean} [isDeep] Specify a deep clone.
  6917. * @returns {Object} Returns the initialized clone.
  6918. */
  6919. function initCloneByTag(object, tag, isDeep) {
  6920. var Ctor = object.constructor;
  6921. switch (tag) {
  6922. case arrayBufferTag:
  6923. return cloneArrayBuffer(object);
  6924. case boolTag:
  6925. case dateTag:
  6926. return new Ctor(+object);
  6927. case dataViewTag:
  6928. return cloneDataView(object, isDeep);
  6929. case float32Tag: case float64Tag:
  6930. case int8Tag: case int16Tag: case int32Tag:
  6931. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6932. return cloneTypedArray(object, isDeep);
  6933. case mapTag:
  6934. return new Ctor;
  6935. case numberTag:
  6936. case stringTag:
  6937. return new Ctor(object);
  6938. case regexpTag:
  6939. return cloneRegExp(object);
  6940. case setTag:
  6941. return new Ctor;
  6942. case symbolTag:
  6943. return cloneSymbol(object);
  6944. }
  6945. }
  6946. /**
  6947. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6948. *
  6949. * @private
  6950. * @param {string} source The source to modify.
  6951. * @returns {Array} details The details to insert.
  6952. * @returns {string} Returns the modified source.
  6953. */
  6954. function insertWrapDetails(source, details) {
  6955. var length = details.length;
  6956. if (!length) {
  6957. return source;
  6958. }
  6959. var lastIndex = length - 1;
  6960. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6961. details = details.join(length > 2 ? ', ' : ' ');
  6962. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6963. }
  6964. /**
  6965. * Checks if `value` is a flattenable `arguments` object or array.
  6966. *
  6967. * @private
  6968. * @param {*} value The value to check.
  6969. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6970. */
  6971. function isFlattenable(value) {
  6972. return isArray(value) || isArguments(value) ||
  6973. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6974. }
  6975. /**
  6976. * Checks if `value` is a valid array-like index.
  6977. *
  6978. * @private
  6979. * @param {*} value The value to check.
  6980. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6981. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6982. */
  6983. function isIndex(value, length) {
  6984. var type = typeof value;
  6985. length = length == null ? MAX_SAFE_INTEGER : length;
  6986. return !!length &&
  6987. (type == 'number' ||
  6988. (type != 'symbol' && reIsUint.test(value))) &&
  6989. (value > -1 && value % 1 == 0 && value < length);
  6990. }
  6991. /**
  6992. * Checks if the given arguments are from an iteratee call.
  6993. *
  6994. * @private
  6995. * @param {*} value The potential iteratee value argument.
  6996. * @param {*} index The potential iteratee index or key argument.
  6997. * @param {*} object The potential iteratee object argument.
  6998. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6999. * else `false`.
  7000. */
  7001. function isIterateeCall(value, index, object) {
  7002. if (!isObject(object)) {
  7003. return false;
  7004. }
  7005. var type = typeof index;
  7006. if (type == 'number'
  7007. ? (isArrayLike(object) && isIndex(index, object.length))
  7008. : (type == 'string' && index in object)
  7009. ) {
  7010. return eq(object[index], value);
  7011. }
  7012. return false;
  7013. }
  7014. /**
  7015. * Checks if `value` is a property name and not a property path.
  7016. *
  7017. * @private
  7018. * @param {*} value The value to check.
  7019. * @param {Object} [object] The object to query keys on.
  7020. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7021. */
  7022. function isKey(value, object) {
  7023. if (isArray(value)) {
  7024. return false;
  7025. }
  7026. var type = typeof value;
  7027. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7028. value == null || isSymbol(value)) {
  7029. return true;
  7030. }
  7031. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7032. (object != null && value in Object(object));
  7033. }
  7034. /**
  7035. * Checks if `value` is suitable for use as unique object key.
  7036. *
  7037. * @private
  7038. * @param {*} value The value to check.
  7039. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7040. */
  7041. function isKeyable(value) {
  7042. var type = typeof value;
  7043. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7044. ? (value !== '__proto__')
  7045. : (value === null);
  7046. }
  7047. /**
  7048. * Checks if `func` has a lazy counterpart.
  7049. *
  7050. * @private
  7051. * @param {Function} func The function to check.
  7052. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7053. * else `false`.
  7054. */
  7055. function isLaziable(func) {
  7056. var funcName = getFuncName(func),
  7057. other = lodash[funcName];
  7058. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7059. return false;
  7060. }
  7061. if (func === other) {
  7062. return true;
  7063. }
  7064. var data = getData(other);
  7065. return !!data && func === data[0];
  7066. }
  7067. /**
  7068. * Checks if `func` has its source masked.
  7069. *
  7070. * @private
  7071. * @param {Function} func The function to check.
  7072. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7073. */
  7074. function isMasked(func) {
  7075. return !!maskSrcKey && (maskSrcKey in func);
  7076. }
  7077. /**
  7078. * Checks if `func` is capable of being masked.
  7079. *
  7080. * @private
  7081. * @param {*} value The value to check.
  7082. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7083. */
  7084. var isMaskable = coreJsData ? isFunction : stubFalse;
  7085. /**
  7086. * Checks if `value` is likely a prototype object.
  7087. *
  7088. * @private
  7089. * @param {*} value The value to check.
  7090. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7091. */
  7092. function isPrototype(value) {
  7093. var Ctor = value && value.constructor,
  7094. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7095. return value === proto;
  7096. }
  7097. /**
  7098. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7099. *
  7100. * @private
  7101. * @param {*} value The value to check.
  7102. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7103. * equality comparisons, else `false`.
  7104. */
  7105. function isStrictComparable(value) {
  7106. return value === value && !isObject(value);
  7107. }
  7108. /**
  7109. * A specialized version of `matchesProperty` for source values suitable
  7110. * for strict equality comparisons, i.e. `===`.
  7111. *
  7112. * @private
  7113. * @param {string} key The key of the property to get.
  7114. * @param {*} srcValue The value to match.
  7115. * @returns {Function} Returns the new spec function.
  7116. */
  7117. function matchesStrictComparable(key, srcValue) {
  7118. return function(object) {
  7119. if (object == null) {
  7120. return false;
  7121. }
  7122. return object[key] === srcValue &&
  7123. (srcValue !== undefined || (key in Object(object)));
  7124. };
  7125. }
  7126. /**
  7127. * A specialized version of `_.memoize` which clears the memoized function's
  7128. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7129. *
  7130. * @private
  7131. * @param {Function} func The function to have its output memoized.
  7132. * @returns {Function} Returns the new memoized function.
  7133. */
  7134. function memoizeCapped(func) {
  7135. var result = memoize(func, function(key) {
  7136. if (cache.size === MAX_MEMOIZE_SIZE) {
  7137. cache.clear();
  7138. }
  7139. return key;
  7140. });
  7141. var cache = result.cache;
  7142. return result;
  7143. }
  7144. /**
  7145. * Merges the function metadata of `source` into `data`.
  7146. *
  7147. * Merging metadata reduces the number of wrappers used to invoke a function.
  7148. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7149. * may be applied regardless of execution order. Methods like `_.ary` and
  7150. * `_.rearg` modify function arguments, making the order in which they are
  7151. * executed important, preventing the merging of metadata. However, we make
  7152. * an exception for a safe combined case where curried functions have `_.ary`
  7153. * and or `_.rearg` applied.
  7154. *
  7155. * @private
  7156. * @param {Array} data The destination metadata.
  7157. * @param {Array} source The source metadata.
  7158. * @returns {Array} Returns `data`.
  7159. */
  7160. function mergeData(data, source) {
  7161. var bitmask = data[1],
  7162. srcBitmask = source[1],
  7163. newBitmask = bitmask | srcBitmask,
  7164. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7165. var isCombo =
  7166. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7167. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7168. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7169. // Exit early if metadata can't be merged.
  7170. if (!(isCommon || isCombo)) {
  7171. return data;
  7172. }
  7173. // Use source `thisArg` if available.
  7174. if (srcBitmask & WRAP_BIND_FLAG) {
  7175. data[2] = source[2];
  7176. // Set when currying a bound function.
  7177. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7178. }
  7179. // Compose partial arguments.
  7180. var value = source[3];
  7181. if (value) {
  7182. var partials = data[3];
  7183. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7184. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7185. }
  7186. // Compose partial right arguments.
  7187. value = source[5];
  7188. if (value) {
  7189. partials = data[5];
  7190. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7191. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7192. }
  7193. // Use source `argPos` if available.
  7194. value = source[7];
  7195. if (value) {
  7196. data[7] = value;
  7197. }
  7198. // Use source `ary` if it's smaller.
  7199. if (srcBitmask & WRAP_ARY_FLAG) {
  7200. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7201. }
  7202. // Use source `arity` if one is not provided.
  7203. if (data[9] == null) {
  7204. data[9] = source[9];
  7205. }
  7206. // Use source `func` and merge bitmasks.
  7207. data[0] = source[0];
  7208. data[1] = newBitmask;
  7209. return data;
  7210. }
  7211. /**
  7212. * This function is like
  7213. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7214. * except that it includes inherited enumerable properties.
  7215. *
  7216. * @private
  7217. * @param {Object} object The object to query.
  7218. * @returns {Array} Returns the array of property names.
  7219. */
  7220. function nativeKeysIn(object) {
  7221. var result = [];
  7222. if (object != null) {
  7223. for (var key in Object(object)) {
  7224. result.push(key);
  7225. }
  7226. }
  7227. return result;
  7228. }
  7229. /**
  7230. * Converts `value` to a string using `Object.prototype.toString`.
  7231. *
  7232. * @private
  7233. * @param {*} value The value to convert.
  7234. * @returns {string} Returns the converted string.
  7235. */
  7236. function objectToString(value) {
  7237. return nativeObjectToString.call(value);
  7238. }
  7239. /**
  7240. * A specialized version of `baseRest` which transforms the rest array.
  7241. *
  7242. * @private
  7243. * @param {Function} func The function to apply a rest parameter to.
  7244. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7245. * @param {Function} transform The rest array transform.
  7246. * @returns {Function} Returns the new function.
  7247. */
  7248. function overRest(func, start, transform) {
  7249. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7250. return function() {
  7251. var args = arguments,
  7252. index = -1,
  7253. length = nativeMax(args.length - start, 0),
  7254. array = Array(length);
  7255. while (++index < length) {
  7256. array[index] = args[start + index];
  7257. }
  7258. index = -1;
  7259. var otherArgs = Array(start + 1);
  7260. while (++index < start) {
  7261. otherArgs[index] = args[index];
  7262. }
  7263. otherArgs[start] = transform(array);
  7264. return apply(func, this, otherArgs);
  7265. };
  7266. }
  7267. /**
  7268. * Gets the parent value at `path` of `object`.
  7269. *
  7270. * @private
  7271. * @param {Object} object The object to query.
  7272. * @param {Array} path The path to get the parent value of.
  7273. * @returns {*} Returns the parent value.
  7274. */
  7275. function parent(object, path) {
  7276. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7277. }
  7278. /**
  7279. * Reorder `array` according to the specified indexes where the element at
  7280. * the first index is assigned as the first element, the element at
  7281. * the second index is assigned as the second element, and so on.
  7282. *
  7283. * @private
  7284. * @param {Array} array The array to reorder.
  7285. * @param {Array} indexes The arranged array indexes.
  7286. * @returns {Array} Returns `array`.
  7287. */
  7288. function reorder(array, indexes) {
  7289. var arrLength = array.length,
  7290. length = nativeMin(indexes.length, arrLength),
  7291. oldArray = copyArray(array);
  7292. while (length--) {
  7293. var index = indexes[length];
  7294. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7295. }
  7296. return array;
  7297. }
  7298. /**
  7299. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7300. *
  7301. * @private
  7302. * @param {Object} object The object to query.
  7303. * @param {string} key The key of the property to get.
  7304. * @returns {*} Returns the property value.
  7305. */
  7306. function safeGet(object, key) {
  7307. if (key === 'constructor' && typeof object[key] === 'function') {
  7308. return;
  7309. }
  7310. if (key == '__proto__') {
  7311. return;
  7312. }
  7313. return object[key];
  7314. }
  7315. /**
  7316. * Sets metadata for `func`.
  7317. *
  7318. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7319. * period of time, it will trip its breaker and transition to an identity
  7320. * function to avoid garbage collection pauses in V8. See
  7321. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7322. * for more details.
  7323. *
  7324. * @private
  7325. * @param {Function} func The function to associate metadata with.
  7326. * @param {*} data The metadata.
  7327. * @returns {Function} Returns `func`.
  7328. */
  7329. var setData = shortOut(baseSetData);
  7330. /**
  7331. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7332. *
  7333. * @private
  7334. * @param {Function} func The function to delay.
  7335. * @param {number} wait The number of milliseconds to delay invocation.
  7336. * @returns {number|Object} Returns the timer id or timeout object.
  7337. */
  7338. var setTimeout = ctxSetTimeout || function(func, wait) {
  7339. return root.setTimeout(func, wait);
  7340. };
  7341. /**
  7342. * Sets the `toString` method of `func` to return `string`.
  7343. *
  7344. * @private
  7345. * @param {Function} func The function to modify.
  7346. * @param {Function} string The `toString` result.
  7347. * @returns {Function} Returns `func`.
  7348. */
  7349. var setToString = shortOut(baseSetToString);
  7350. /**
  7351. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7352. * with wrapper details in a comment at the top of the source body.
  7353. *
  7354. * @private
  7355. * @param {Function} wrapper The function to modify.
  7356. * @param {Function} reference The reference function.
  7357. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7358. * @returns {Function} Returns `wrapper`.
  7359. */
  7360. function setWrapToString(wrapper, reference, bitmask) {
  7361. var source = (reference + '');
  7362. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7363. }
  7364. /**
  7365. * Creates a function that'll short out and invoke `identity` instead
  7366. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7367. * milliseconds.
  7368. *
  7369. * @private
  7370. * @param {Function} func The function to restrict.
  7371. * @returns {Function} Returns the new shortable function.
  7372. */
  7373. function shortOut(func) {
  7374. var count = 0,
  7375. lastCalled = 0;
  7376. return function() {
  7377. var stamp = nativeNow(),
  7378. remaining = HOT_SPAN - (stamp - lastCalled);
  7379. lastCalled = stamp;
  7380. if (remaining > 0) {
  7381. if (++count >= HOT_COUNT) {
  7382. return arguments[0];
  7383. }
  7384. } else {
  7385. count = 0;
  7386. }
  7387. return func.apply(undefined, arguments);
  7388. };
  7389. }
  7390. /**
  7391. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7392. *
  7393. * @private
  7394. * @param {Array} array The array to shuffle.
  7395. * @param {number} [size=array.length] The size of `array`.
  7396. * @returns {Array} Returns `array`.
  7397. */
  7398. function shuffleSelf(array, size) {
  7399. var index = -1,
  7400. length = array.length,
  7401. lastIndex = length - 1;
  7402. size = size === undefined ? length : size;
  7403. while (++index < size) {
  7404. var rand = baseRandom(index, lastIndex),
  7405. value = array[rand];
  7406. array[rand] = array[index];
  7407. array[index] = value;
  7408. }
  7409. array.length = size;
  7410. return array;
  7411. }
  7412. /**
  7413. * Converts `string` to a property path array.
  7414. *
  7415. * @private
  7416. * @param {string} string The string to convert.
  7417. * @returns {Array} Returns the property path array.
  7418. */
  7419. var stringToPath = memoizeCapped(function(string) {
  7420. var result = [];
  7421. if (string.charCodeAt(0) === 46 /* . */) {
  7422. result.push('');
  7423. }
  7424. string.replace(rePropName, function(match, number, quote, subString) {
  7425. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7426. });
  7427. return result;
  7428. });
  7429. /**
  7430. * Converts `value` to a string key if it's not a string or symbol.
  7431. *
  7432. * @private
  7433. * @param {*} value The value to inspect.
  7434. * @returns {string|symbol} Returns the key.
  7435. */
  7436. function toKey(value) {
  7437. if (typeof value == 'string' || isSymbol(value)) {
  7438. return value;
  7439. }
  7440. var result = (value + '');
  7441. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7442. }
  7443. /**
  7444. * Converts `func` to its source code.
  7445. *
  7446. * @private
  7447. * @param {Function} func The function to convert.
  7448. * @returns {string} Returns the source code.
  7449. */
  7450. function toSource(func) {
  7451. if (func != null) {
  7452. try {
  7453. return funcToString.call(func);
  7454. } catch (e) {}
  7455. try {
  7456. return (func + '');
  7457. } catch (e) {}
  7458. }
  7459. return '';
  7460. }
  7461. /**
  7462. * Updates wrapper `details` based on `bitmask` flags.
  7463. *
  7464. * @private
  7465. * @returns {Array} details The details to modify.
  7466. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7467. * @returns {Array} Returns `details`.
  7468. */
  7469. function updateWrapDetails(details, bitmask) {
  7470. arrayEach(wrapFlags, function(pair) {
  7471. var value = '_.' + pair[0];
  7472. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7473. details.push(value);
  7474. }
  7475. });
  7476. return details.sort();
  7477. }
  7478. /**
  7479. * Creates a clone of `wrapper`.
  7480. *
  7481. * @private
  7482. * @param {Object} wrapper The wrapper to clone.
  7483. * @returns {Object} Returns the cloned wrapper.
  7484. */
  7485. function wrapperClone(wrapper) {
  7486. if (wrapper instanceof LazyWrapper) {
  7487. return wrapper.clone();
  7488. }
  7489. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7490. result.__actions__ = copyArray(wrapper.__actions__);
  7491. result.__index__ = wrapper.__index__;
  7492. result.__values__ = wrapper.__values__;
  7493. return result;
  7494. }
  7495. /*------------------------------------------------------------------------*/
  7496. /**
  7497. * Creates an array of elements split into groups the length of `size`.
  7498. * If `array` can't be split evenly, the final chunk will be the remaining
  7499. * elements.
  7500. *
  7501. * @static
  7502. * @memberOf _
  7503. * @since 3.0.0
  7504. * @category Array
  7505. * @param {Array} array The array to process.
  7506. * @param {number} [size=1] The length of each chunk
  7507. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7508. * @returns {Array} Returns the new array of chunks.
  7509. * @example
  7510. *
  7511. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7512. * // => [['a', 'b'], ['c', 'd']]
  7513. *
  7514. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7515. * // => [['a', 'b', 'c'], ['d']]
  7516. */
  7517. function chunk(array, size, guard) {
  7518. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7519. size = 1;
  7520. } else {
  7521. size = nativeMax(toInteger(size), 0);
  7522. }
  7523. var length = array == null ? 0 : array.length;
  7524. if (!length || size < 1) {
  7525. return [];
  7526. }
  7527. var index = 0,
  7528. resIndex = 0,
  7529. result = Array(nativeCeil(length / size));
  7530. while (index < length) {
  7531. result[resIndex++] = baseSlice(array, index, (index += size));
  7532. }
  7533. return result;
  7534. }
  7535. /**
  7536. * Creates an array with all falsey values removed. The values `false`, `null`,
  7537. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7538. *
  7539. * @static
  7540. * @memberOf _
  7541. * @since 0.1.0
  7542. * @category Array
  7543. * @param {Array} array The array to compact.
  7544. * @returns {Array} Returns the new array of filtered values.
  7545. * @example
  7546. *
  7547. * _.compact([0, 1, false, 2, '', 3]);
  7548. * // => [1, 2, 3]
  7549. */
  7550. function compact(array) {
  7551. var index = -1,
  7552. length = array == null ? 0 : array.length,
  7553. resIndex = 0,
  7554. result = [];
  7555. while (++index < length) {
  7556. var value = array[index];
  7557. if (value) {
  7558. result[resIndex++] = value;
  7559. }
  7560. }
  7561. return result;
  7562. }
  7563. /**
  7564. * Creates a new array concatenating `array` with any additional arrays
  7565. * and/or values.
  7566. *
  7567. * @static
  7568. * @memberOf _
  7569. * @since 4.0.0
  7570. * @category Array
  7571. * @param {Array} array The array to concatenate.
  7572. * @param {...*} [values] The values to concatenate.
  7573. * @returns {Array} Returns the new concatenated array.
  7574. * @example
  7575. *
  7576. * var array = [1];
  7577. * var other = _.concat(array, 2, [3], [[4]]);
  7578. *
  7579. * console.log(other);
  7580. * // => [1, 2, 3, [4]]
  7581. *
  7582. * console.log(array);
  7583. * // => [1]
  7584. */
  7585. function concat() {
  7586. var length = arguments.length;
  7587. if (!length) {
  7588. return [];
  7589. }
  7590. var args = Array(length - 1),
  7591. array = arguments[0],
  7592. index = length;
  7593. while (index--) {
  7594. args[index - 1] = arguments[index];
  7595. }
  7596. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7597. }
  7598. /**
  7599. * Creates an array of `array` values not included in the other given arrays
  7600. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7601. * for equality comparisons. The order and references of result values are
  7602. * determined by the first array.
  7603. *
  7604. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7605. *
  7606. * @static
  7607. * @memberOf _
  7608. * @since 0.1.0
  7609. * @category Array
  7610. * @param {Array} array The array to inspect.
  7611. * @param {...Array} [values] The values to exclude.
  7612. * @returns {Array} Returns the new array of filtered values.
  7613. * @see _.without, _.xor
  7614. * @example
  7615. *
  7616. * _.difference([2, 1], [2, 3]);
  7617. * // => [1]
  7618. */
  7619. var difference = baseRest(function(array, values) {
  7620. return isArrayLikeObject(array)
  7621. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7622. : [];
  7623. });
  7624. /**
  7625. * This method is like `_.difference` except that it accepts `iteratee` which
  7626. * is invoked for each element of `array` and `values` to generate the criterion
  7627. * by which they're compared. The order and references of result values are
  7628. * determined by the first array. The iteratee is invoked with one argument:
  7629. * (value).
  7630. *
  7631. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7632. *
  7633. * @static
  7634. * @memberOf _
  7635. * @since 4.0.0
  7636. * @category Array
  7637. * @param {Array} array The array to inspect.
  7638. * @param {...Array} [values] The values to exclude.
  7639. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7640. * @returns {Array} Returns the new array of filtered values.
  7641. * @example
  7642. *
  7643. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7644. * // => [1.2]
  7645. *
  7646. * // The `_.property` iteratee shorthand.
  7647. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7648. * // => [{ 'x': 2 }]
  7649. */
  7650. var differenceBy = baseRest(function(array, values) {
  7651. var iteratee = last(values);
  7652. if (isArrayLikeObject(iteratee)) {
  7653. iteratee = undefined;
  7654. }
  7655. return isArrayLikeObject(array)
  7656. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7657. : [];
  7658. });
  7659. /**
  7660. * This method is like `_.difference` except that it accepts `comparator`
  7661. * which is invoked to compare elements of `array` to `values`. The order and
  7662. * references of result values are determined by the first array. The comparator
  7663. * is invoked with two arguments: (arrVal, othVal).
  7664. *
  7665. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7666. *
  7667. * @static
  7668. * @memberOf _
  7669. * @since 4.0.0
  7670. * @category Array
  7671. * @param {Array} array The array to inspect.
  7672. * @param {...Array} [values] The values to exclude.
  7673. * @param {Function} [comparator] The comparator invoked per element.
  7674. * @returns {Array} Returns the new array of filtered values.
  7675. * @example
  7676. *
  7677. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7678. *
  7679. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7680. * // => [{ 'x': 2, 'y': 1 }]
  7681. */
  7682. var differenceWith = baseRest(function(array, values) {
  7683. var comparator = last(values);
  7684. if (isArrayLikeObject(comparator)) {
  7685. comparator = undefined;
  7686. }
  7687. return isArrayLikeObject(array)
  7688. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7689. : [];
  7690. });
  7691. /**
  7692. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7693. *
  7694. * @static
  7695. * @memberOf _
  7696. * @since 0.5.0
  7697. * @category Array
  7698. * @param {Array} array The array to query.
  7699. * @param {number} [n=1] The number of elements to drop.
  7700. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7701. * @returns {Array} Returns the slice of `array`.
  7702. * @example
  7703. *
  7704. * _.drop([1, 2, 3]);
  7705. * // => [2, 3]
  7706. *
  7707. * _.drop([1, 2, 3], 2);
  7708. * // => [3]
  7709. *
  7710. * _.drop([1, 2, 3], 5);
  7711. * // => []
  7712. *
  7713. * _.drop([1, 2, 3], 0);
  7714. * // => [1, 2, 3]
  7715. */
  7716. function drop(array, n, guard) {
  7717. var length = array == null ? 0 : array.length;
  7718. if (!length) {
  7719. return [];
  7720. }
  7721. n = (guard || n === undefined) ? 1 : toInteger(n);
  7722. return baseSlice(array, n < 0 ? 0 : n, length);
  7723. }
  7724. /**
  7725. * Creates a slice of `array` with `n` elements dropped from the end.
  7726. *
  7727. * @static
  7728. * @memberOf _
  7729. * @since 3.0.0
  7730. * @category Array
  7731. * @param {Array} array The array to query.
  7732. * @param {number} [n=1] The number of elements to drop.
  7733. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7734. * @returns {Array} Returns the slice of `array`.
  7735. * @example
  7736. *
  7737. * _.dropRight([1, 2, 3]);
  7738. * // => [1, 2]
  7739. *
  7740. * _.dropRight([1, 2, 3], 2);
  7741. * // => [1]
  7742. *
  7743. * _.dropRight([1, 2, 3], 5);
  7744. * // => []
  7745. *
  7746. * _.dropRight([1, 2, 3], 0);
  7747. * // => [1, 2, 3]
  7748. */
  7749. function dropRight(array, n, guard) {
  7750. var length = array == null ? 0 : array.length;
  7751. if (!length) {
  7752. return [];
  7753. }
  7754. n = (guard || n === undefined) ? 1 : toInteger(n);
  7755. n = length - n;
  7756. return baseSlice(array, 0, n < 0 ? 0 : n);
  7757. }
  7758. /**
  7759. * Creates a slice of `array` excluding elements dropped from the end.
  7760. * Elements are dropped until `predicate` returns falsey. The predicate is
  7761. * invoked with three arguments: (value, index, array).
  7762. *
  7763. * @static
  7764. * @memberOf _
  7765. * @since 3.0.0
  7766. * @category Array
  7767. * @param {Array} array The array to query.
  7768. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7769. * @returns {Array} Returns the slice of `array`.
  7770. * @example
  7771. *
  7772. * var users = [
  7773. * { 'user': 'barney', 'active': true },
  7774. * { 'user': 'fred', 'active': false },
  7775. * { 'user': 'pebbles', 'active': false }
  7776. * ];
  7777. *
  7778. * _.dropRightWhile(users, function(o) { return !o.active; });
  7779. * // => objects for ['barney']
  7780. *
  7781. * // The `_.matches` iteratee shorthand.
  7782. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7783. * // => objects for ['barney', 'fred']
  7784. *
  7785. * // The `_.matchesProperty` iteratee shorthand.
  7786. * _.dropRightWhile(users, ['active', false]);
  7787. * // => objects for ['barney']
  7788. *
  7789. * // The `_.property` iteratee shorthand.
  7790. * _.dropRightWhile(users, 'active');
  7791. * // => objects for ['barney', 'fred', 'pebbles']
  7792. */
  7793. function dropRightWhile(array, predicate) {
  7794. return (array && array.length)
  7795. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7796. : [];
  7797. }
  7798. /**
  7799. * Creates a slice of `array` excluding elements dropped from the beginning.
  7800. * Elements are dropped until `predicate` returns falsey. The predicate is
  7801. * invoked with three arguments: (value, index, array).
  7802. *
  7803. * @static
  7804. * @memberOf _
  7805. * @since 3.0.0
  7806. * @category Array
  7807. * @param {Array} array The array to query.
  7808. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7809. * @returns {Array} Returns the slice of `array`.
  7810. * @example
  7811. *
  7812. * var users = [
  7813. * { 'user': 'barney', 'active': false },
  7814. * { 'user': 'fred', 'active': false },
  7815. * { 'user': 'pebbles', 'active': true }
  7816. * ];
  7817. *
  7818. * _.dropWhile(users, function(o) { return !o.active; });
  7819. * // => objects for ['pebbles']
  7820. *
  7821. * // The `_.matches` iteratee shorthand.
  7822. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7823. * // => objects for ['fred', 'pebbles']
  7824. *
  7825. * // The `_.matchesProperty` iteratee shorthand.
  7826. * _.dropWhile(users, ['active', false]);
  7827. * // => objects for ['pebbles']
  7828. *
  7829. * // The `_.property` iteratee shorthand.
  7830. * _.dropWhile(users, 'active');
  7831. * // => objects for ['barney', 'fred', 'pebbles']
  7832. */
  7833. function dropWhile(array, predicate) {
  7834. return (array && array.length)
  7835. ? baseWhile(array, getIteratee(predicate, 3), true)
  7836. : [];
  7837. }
  7838. /**
  7839. * Fills elements of `array` with `value` from `start` up to, but not
  7840. * including, `end`.
  7841. *
  7842. * **Note:** This method mutates `array`.
  7843. *
  7844. * @static
  7845. * @memberOf _
  7846. * @since 3.2.0
  7847. * @category Array
  7848. * @param {Array} array The array to fill.
  7849. * @param {*} value The value to fill `array` with.
  7850. * @param {number} [start=0] The start position.
  7851. * @param {number} [end=array.length] The end position.
  7852. * @returns {Array} Returns `array`.
  7853. * @example
  7854. *
  7855. * var array = [1, 2, 3];
  7856. *
  7857. * _.fill(array, 'a');
  7858. * console.log(array);
  7859. * // => ['a', 'a', 'a']
  7860. *
  7861. * _.fill(Array(3), 2);
  7862. * // => [2, 2, 2]
  7863. *
  7864. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7865. * // => [4, '*', '*', 10]
  7866. */
  7867. function fill(array, value, start, end) {
  7868. var length = array == null ? 0 : array.length;
  7869. if (!length) {
  7870. return [];
  7871. }
  7872. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7873. start = 0;
  7874. end = length;
  7875. }
  7876. return baseFill(array, value, start, end);
  7877. }
  7878. /**
  7879. * This method is like `_.find` except that it returns the index of the first
  7880. * element `predicate` returns truthy for instead of the element itself.
  7881. *
  7882. * @static
  7883. * @memberOf _
  7884. * @since 1.1.0
  7885. * @category Array
  7886. * @param {Array} array The array to inspect.
  7887. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7888. * @param {number} [fromIndex=0] The index to search from.
  7889. * @returns {number} Returns the index of the found element, else `-1`.
  7890. * @example
  7891. *
  7892. * var users = [
  7893. * { 'user': 'barney', 'active': false },
  7894. * { 'user': 'fred', 'active': false },
  7895. * { 'user': 'pebbles', 'active': true }
  7896. * ];
  7897. *
  7898. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7899. * // => 0
  7900. *
  7901. * // The `_.matches` iteratee shorthand.
  7902. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7903. * // => 1
  7904. *
  7905. * // The `_.matchesProperty` iteratee shorthand.
  7906. * _.findIndex(users, ['active', false]);
  7907. * // => 0
  7908. *
  7909. * // The `_.property` iteratee shorthand.
  7910. * _.findIndex(users, 'active');
  7911. * // => 2
  7912. */
  7913. function findIndex(array, predicate, fromIndex) {
  7914. var length = array == null ? 0 : array.length;
  7915. if (!length) {
  7916. return -1;
  7917. }
  7918. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7919. if (index < 0) {
  7920. index = nativeMax(length + index, 0);
  7921. }
  7922. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7923. }
  7924. /**
  7925. * This method is like `_.findIndex` except that it iterates over elements
  7926. * of `collection` from right to left.
  7927. *
  7928. * @static
  7929. * @memberOf _
  7930. * @since 2.0.0
  7931. * @category Array
  7932. * @param {Array} array The array to inspect.
  7933. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7934. * @param {number} [fromIndex=array.length-1] The index to search from.
  7935. * @returns {number} Returns the index of the found element, else `-1`.
  7936. * @example
  7937. *
  7938. * var users = [
  7939. * { 'user': 'barney', 'active': true },
  7940. * { 'user': 'fred', 'active': false },
  7941. * { 'user': 'pebbles', 'active': false }
  7942. * ];
  7943. *
  7944. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7945. * // => 2
  7946. *
  7947. * // The `_.matches` iteratee shorthand.
  7948. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7949. * // => 0
  7950. *
  7951. * // The `_.matchesProperty` iteratee shorthand.
  7952. * _.findLastIndex(users, ['active', false]);
  7953. * // => 2
  7954. *
  7955. * // The `_.property` iteratee shorthand.
  7956. * _.findLastIndex(users, 'active');
  7957. * // => 0
  7958. */
  7959. function findLastIndex(array, predicate, fromIndex) {
  7960. var length = array == null ? 0 : array.length;
  7961. if (!length) {
  7962. return -1;
  7963. }
  7964. var index = length - 1;
  7965. if (fromIndex !== undefined) {
  7966. index = toInteger(fromIndex);
  7967. index = fromIndex < 0
  7968. ? nativeMax(length + index, 0)
  7969. : nativeMin(index, length - 1);
  7970. }
  7971. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7972. }
  7973. /**
  7974. * Flattens `array` a single level deep.
  7975. *
  7976. * @static
  7977. * @memberOf _
  7978. * @since 0.1.0
  7979. * @category Array
  7980. * @param {Array} array The array to flatten.
  7981. * @returns {Array} Returns the new flattened array.
  7982. * @example
  7983. *
  7984. * _.flatten([1, [2, [3, [4]], 5]]);
  7985. * // => [1, 2, [3, [4]], 5]
  7986. */
  7987. function flatten(array) {
  7988. var length = array == null ? 0 : array.length;
  7989. return length ? baseFlatten(array, 1) : [];
  7990. }
  7991. /**
  7992. * Recursively flattens `array`.
  7993. *
  7994. * @static
  7995. * @memberOf _
  7996. * @since 3.0.0
  7997. * @category Array
  7998. * @param {Array} array The array to flatten.
  7999. * @returns {Array} Returns the new flattened array.
  8000. * @example
  8001. *
  8002. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8003. * // => [1, 2, 3, 4, 5]
  8004. */
  8005. function flattenDeep(array) {
  8006. var length = array == null ? 0 : array.length;
  8007. return length ? baseFlatten(array, INFINITY) : [];
  8008. }
  8009. /**
  8010. * Recursively flatten `array` up to `depth` times.
  8011. *
  8012. * @static
  8013. * @memberOf _
  8014. * @since 4.4.0
  8015. * @category Array
  8016. * @param {Array} array The array to flatten.
  8017. * @param {number} [depth=1] The maximum recursion depth.
  8018. * @returns {Array} Returns the new flattened array.
  8019. * @example
  8020. *
  8021. * var array = [1, [2, [3, [4]], 5]];
  8022. *
  8023. * _.flattenDepth(array, 1);
  8024. * // => [1, 2, [3, [4]], 5]
  8025. *
  8026. * _.flattenDepth(array, 2);
  8027. * // => [1, 2, 3, [4], 5]
  8028. */
  8029. function flattenDepth(array, depth) {
  8030. var length = array == null ? 0 : array.length;
  8031. if (!length) {
  8032. return [];
  8033. }
  8034. depth = depth === undefined ? 1 : toInteger(depth);
  8035. return baseFlatten(array, depth);
  8036. }
  8037. /**
  8038. * The inverse of `_.toPairs`; this method returns an object composed
  8039. * from key-value `pairs`.
  8040. *
  8041. * @static
  8042. * @memberOf _
  8043. * @since 4.0.0
  8044. * @category Array
  8045. * @param {Array} pairs The key-value pairs.
  8046. * @returns {Object} Returns the new object.
  8047. * @example
  8048. *
  8049. * _.fromPairs([['a', 1], ['b', 2]]);
  8050. * // => { 'a': 1, 'b': 2 }
  8051. */
  8052. function fromPairs(pairs) {
  8053. var index = -1,
  8054. length = pairs == null ? 0 : pairs.length,
  8055. result = {};
  8056. while (++index < length) {
  8057. var pair = pairs[index];
  8058. result[pair[0]] = pair[1];
  8059. }
  8060. return result;
  8061. }
  8062. /**
  8063. * Gets the first element of `array`.
  8064. *
  8065. * @static
  8066. * @memberOf _
  8067. * @since 0.1.0
  8068. * @alias first
  8069. * @category Array
  8070. * @param {Array} array The array to query.
  8071. * @returns {*} Returns the first element of `array`.
  8072. * @example
  8073. *
  8074. * _.head([1, 2, 3]);
  8075. * // => 1
  8076. *
  8077. * _.head([]);
  8078. * // => undefined
  8079. */
  8080. function head(array) {
  8081. return (array && array.length) ? array[0] : undefined;
  8082. }
  8083. /**
  8084. * Gets the index at which the first occurrence of `value` is found in `array`
  8085. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8086. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8087. * offset from the end of `array`.
  8088. *
  8089. * @static
  8090. * @memberOf _
  8091. * @since 0.1.0
  8092. * @category Array
  8093. * @param {Array} array The array to inspect.
  8094. * @param {*} value The value to search for.
  8095. * @param {number} [fromIndex=0] The index to search from.
  8096. * @returns {number} Returns the index of the matched value, else `-1`.
  8097. * @example
  8098. *
  8099. * _.indexOf([1, 2, 1, 2], 2);
  8100. * // => 1
  8101. *
  8102. * // Search from the `fromIndex`.
  8103. * _.indexOf([1, 2, 1, 2], 2, 2);
  8104. * // => 3
  8105. */
  8106. function indexOf(array, value, fromIndex) {
  8107. var length = array == null ? 0 : array.length;
  8108. if (!length) {
  8109. return -1;
  8110. }
  8111. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8112. if (index < 0) {
  8113. index = nativeMax(length + index, 0);
  8114. }
  8115. return baseIndexOf(array, value, index);
  8116. }
  8117. /**
  8118. * Gets all but the last element of `array`.
  8119. *
  8120. * @static
  8121. * @memberOf _
  8122. * @since 0.1.0
  8123. * @category Array
  8124. * @param {Array} array The array to query.
  8125. * @returns {Array} Returns the slice of `array`.
  8126. * @example
  8127. *
  8128. * _.initial([1, 2, 3]);
  8129. * // => [1, 2]
  8130. */
  8131. function initial(array) {
  8132. var length = array == null ? 0 : array.length;
  8133. return length ? baseSlice(array, 0, -1) : [];
  8134. }
  8135. /**
  8136. * Creates an array of unique values that are included in all given arrays
  8137. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8138. * for equality comparisons. The order and references of result values are
  8139. * determined by the first array.
  8140. *
  8141. * @static
  8142. * @memberOf _
  8143. * @since 0.1.0
  8144. * @category Array
  8145. * @param {...Array} [arrays] The arrays to inspect.
  8146. * @returns {Array} Returns the new array of intersecting values.
  8147. * @example
  8148. *
  8149. * _.intersection([2, 1], [2, 3]);
  8150. * // => [2]
  8151. */
  8152. var intersection = baseRest(function(arrays) {
  8153. var mapped = arrayMap(arrays, castArrayLikeObject);
  8154. return (mapped.length && mapped[0] === arrays[0])
  8155. ? baseIntersection(mapped)
  8156. : [];
  8157. });
  8158. /**
  8159. * This method is like `_.intersection` except that it accepts `iteratee`
  8160. * which is invoked for each element of each `arrays` to generate the criterion
  8161. * by which they're compared. The order and references of result values are
  8162. * determined by the first array. The iteratee is invoked with one argument:
  8163. * (value).
  8164. *
  8165. * @static
  8166. * @memberOf _
  8167. * @since 4.0.0
  8168. * @category Array
  8169. * @param {...Array} [arrays] The arrays to inspect.
  8170. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8171. * @returns {Array} Returns the new array of intersecting values.
  8172. * @example
  8173. *
  8174. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8175. * // => [2.1]
  8176. *
  8177. * // The `_.property` iteratee shorthand.
  8178. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8179. * // => [{ 'x': 1 }]
  8180. */
  8181. var intersectionBy = baseRest(function(arrays) {
  8182. var iteratee = last(arrays),
  8183. mapped = arrayMap(arrays, castArrayLikeObject);
  8184. if (iteratee === last(mapped)) {
  8185. iteratee = undefined;
  8186. } else {
  8187. mapped.pop();
  8188. }
  8189. return (mapped.length && mapped[0] === arrays[0])
  8190. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8191. : [];
  8192. });
  8193. /**
  8194. * This method is like `_.intersection` except that it accepts `comparator`
  8195. * which is invoked to compare elements of `arrays`. The order and references
  8196. * of result values are determined by the first array. The comparator is
  8197. * invoked with two arguments: (arrVal, othVal).
  8198. *
  8199. * @static
  8200. * @memberOf _
  8201. * @since 4.0.0
  8202. * @category Array
  8203. * @param {...Array} [arrays] The arrays to inspect.
  8204. * @param {Function} [comparator] The comparator invoked per element.
  8205. * @returns {Array} Returns the new array of intersecting values.
  8206. * @example
  8207. *
  8208. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8209. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8210. *
  8211. * _.intersectionWith(objects, others, _.isEqual);
  8212. * // => [{ 'x': 1, 'y': 2 }]
  8213. */
  8214. var intersectionWith = baseRest(function(arrays) {
  8215. var comparator = last(arrays),
  8216. mapped = arrayMap(arrays, castArrayLikeObject);
  8217. comparator = typeof comparator == 'function' ? comparator : undefined;
  8218. if (comparator) {
  8219. mapped.pop();
  8220. }
  8221. return (mapped.length && mapped[0] === arrays[0])
  8222. ? baseIntersection(mapped, undefined, comparator)
  8223. : [];
  8224. });
  8225. /**
  8226. * Converts all elements in `array` into a string separated by `separator`.
  8227. *
  8228. * @static
  8229. * @memberOf _
  8230. * @since 4.0.0
  8231. * @category Array
  8232. * @param {Array} array The array to convert.
  8233. * @param {string} [separator=','] The element separator.
  8234. * @returns {string} Returns the joined string.
  8235. * @example
  8236. *
  8237. * _.join(['a', 'b', 'c'], '~');
  8238. * // => 'a~b~c'
  8239. */
  8240. function join(array, separator) {
  8241. return array == null ? '' : nativeJoin.call(array, separator);
  8242. }
  8243. /**
  8244. * Gets the last element of `array`.
  8245. *
  8246. * @static
  8247. * @memberOf _
  8248. * @since 0.1.0
  8249. * @category Array
  8250. * @param {Array} array The array to query.
  8251. * @returns {*} Returns the last element of `array`.
  8252. * @example
  8253. *
  8254. * _.last([1, 2, 3]);
  8255. * // => 3
  8256. */
  8257. function last(array) {
  8258. var length = array == null ? 0 : array.length;
  8259. return length ? array[length - 1] : undefined;
  8260. }
  8261. /**
  8262. * This method is like `_.indexOf` except that it iterates over elements of
  8263. * `array` from right to left.
  8264. *
  8265. * @static
  8266. * @memberOf _
  8267. * @since 0.1.0
  8268. * @category Array
  8269. * @param {Array} array The array to inspect.
  8270. * @param {*} value The value to search for.
  8271. * @param {number} [fromIndex=array.length-1] The index to search from.
  8272. * @returns {number} Returns the index of the matched value, else `-1`.
  8273. * @example
  8274. *
  8275. * _.lastIndexOf([1, 2, 1, 2], 2);
  8276. * // => 3
  8277. *
  8278. * // Search from the `fromIndex`.
  8279. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8280. * // => 1
  8281. */
  8282. function lastIndexOf(array, value, fromIndex) {
  8283. var length = array == null ? 0 : array.length;
  8284. if (!length) {
  8285. return -1;
  8286. }
  8287. var index = length;
  8288. if (fromIndex !== undefined) {
  8289. index = toInteger(fromIndex);
  8290. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8291. }
  8292. return value === value
  8293. ? strictLastIndexOf(array, value, index)
  8294. : baseFindIndex(array, baseIsNaN, index, true);
  8295. }
  8296. /**
  8297. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8298. * element from the end is returned.
  8299. *
  8300. * @static
  8301. * @memberOf _
  8302. * @since 4.11.0
  8303. * @category Array
  8304. * @param {Array} array The array to query.
  8305. * @param {number} [n=0] The index of the element to return.
  8306. * @returns {*} Returns the nth element of `array`.
  8307. * @example
  8308. *
  8309. * var array = ['a', 'b', 'c', 'd'];
  8310. *
  8311. * _.nth(array, 1);
  8312. * // => 'b'
  8313. *
  8314. * _.nth(array, -2);
  8315. * // => 'c';
  8316. */
  8317. function nth(array, n) {
  8318. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8319. }
  8320. /**
  8321. * Removes all given values from `array` using
  8322. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8323. * for equality comparisons.
  8324. *
  8325. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8326. * to remove elements from an array by predicate.
  8327. *
  8328. * @static
  8329. * @memberOf _
  8330. * @since 2.0.0
  8331. * @category Array
  8332. * @param {Array} array The array to modify.
  8333. * @param {...*} [values] The values to remove.
  8334. * @returns {Array} Returns `array`.
  8335. * @example
  8336. *
  8337. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8338. *
  8339. * _.pull(array, 'a', 'c');
  8340. * console.log(array);
  8341. * // => ['b', 'b']
  8342. */
  8343. var pull = baseRest(pullAll);
  8344. /**
  8345. * This method is like `_.pull` except that it accepts an array of values to remove.
  8346. *
  8347. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8348. *
  8349. * @static
  8350. * @memberOf _
  8351. * @since 4.0.0
  8352. * @category Array
  8353. * @param {Array} array The array to modify.
  8354. * @param {Array} values The values to remove.
  8355. * @returns {Array} Returns `array`.
  8356. * @example
  8357. *
  8358. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8359. *
  8360. * _.pullAll(array, ['a', 'c']);
  8361. * console.log(array);
  8362. * // => ['b', 'b']
  8363. */
  8364. function pullAll(array, values) {
  8365. return (array && array.length && values && values.length)
  8366. ? basePullAll(array, values)
  8367. : array;
  8368. }
  8369. /**
  8370. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8371. * invoked for each element of `array` and `values` to generate the criterion
  8372. * by which they're compared. The iteratee is invoked with one argument: (value).
  8373. *
  8374. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8375. *
  8376. * @static
  8377. * @memberOf _
  8378. * @since 4.0.0
  8379. * @category Array
  8380. * @param {Array} array The array to modify.
  8381. * @param {Array} values The values to remove.
  8382. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8383. * @returns {Array} Returns `array`.
  8384. * @example
  8385. *
  8386. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8387. *
  8388. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8389. * console.log(array);
  8390. * // => [{ 'x': 2 }]
  8391. */
  8392. function pullAllBy(array, values, iteratee) {
  8393. return (array && array.length && values && values.length)
  8394. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8395. : array;
  8396. }
  8397. /**
  8398. * This method is like `_.pullAll` except that it accepts `comparator` which
  8399. * is invoked to compare elements of `array` to `values`. The comparator is
  8400. * invoked with two arguments: (arrVal, othVal).
  8401. *
  8402. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8403. *
  8404. * @static
  8405. * @memberOf _
  8406. * @since 4.6.0
  8407. * @category Array
  8408. * @param {Array} array The array to modify.
  8409. * @param {Array} values The values to remove.
  8410. * @param {Function} [comparator] The comparator invoked per element.
  8411. * @returns {Array} Returns `array`.
  8412. * @example
  8413. *
  8414. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8415. *
  8416. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8417. * console.log(array);
  8418. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8419. */
  8420. function pullAllWith(array, values, comparator) {
  8421. return (array && array.length && values && values.length)
  8422. ? basePullAll(array, values, undefined, comparator)
  8423. : array;
  8424. }
  8425. /**
  8426. * Removes elements from `array` corresponding to `indexes` and returns an
  8427. * array of removed elements.
  8428. *
  8429. * **Note:** Unlike `_.at`, this method mutates `array`.
  8430. *
  8431. * @static
  8432. * @memberOf _
  8433. * @since 3.0.0
  8434. * @category Array
  8435. * @param {Array} array The array to modify.
  8436. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8437. * @returns {Array} Returns the new array of removed elements.
  8438. * @example
  8439. *
  8440. * var array = ['a', 'b', 'c', 'd'];
  8441. * var pulled = _.pullAt(array, [1, 3]);
  8442. *
  8443. * console.log(array);
  8444. * // => ['a', 'c']
  8445. *
  8446. * console.log(pulled);
  8447. * // => ['b', 'd']
  8448. */
  8449. var pullAt = flatRest(function(array, indexes) {
  8450. var length = array == null ? 0 : array.length,
  8451. result = baseAt(array, indexes);
  8452. basePullAt(array, arrayMap(indexes, function(index) {
  8453. return isIndex(index, length) ? +index : index;
  8454. }).sort(compareAscending));
  8455. return result;
  8456. });
  8457. /**
  8458. * Removes all elements from `array` that `predicate` returns truthy for
  8459. * and returns an array of the removed elements. The predicate is invoked
  8460. * with three arguments: (value, index, array).
  8461. *
  8462. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8463. * to pull elements from an array by value.
  8464. *
  8465. * @static
  8466. * @memberOf _
  8467. * @since 2.0.0
  8468. * @category Array
  8469. * @param {Array} array The array to modify.
  8470. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8471. * @returns {Array} Returns the new array of removed elements.
  8472. * @example
  8473. *
  8474. * var array = [1, 2, 3, 4];
  8475. * var evens = _.remove(array, function(n) {
  8476. * return n % 2 == 0;
  8477. * });
  8478. *
  8479. * console.log(array);
  8480. * // => [1, 3]
  8481. *
  8482. * console.log(evens);
  8483. * // => [2, 4]
  8484. */
  8485. function remove(array, predicate) {
  8486. var result = [];
  8487. if (!(array && array.length)) {
  8488. return result;
  8489. }
  8490. var index = -1,
  8491. indexes = [],
  8492. length = array.length;
  8493. predicate = getIteratee(predicate, 3);
  8494. while (++index < length) {
  8495. var value = array[index];
  8496. if (predicate(value, index, array)) {
  8497. result.push(value);
  8498. indexes.push(index);
  8499. }
  8500. }
  8501. basePullAt(array, indexes);
  8502. return result;
  8503. }
  8504. /**
  8505. * Reverses `array` so that the first element becomes the last, the second
  8506. * element becomes the second to last, and so on.
  8507. *
  8508. * **Note:** This method mutates `array` and is based on
  8509. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8510. *
  8511. * @static
  8512. * @memberOf _
  8513. * @since 4.0.0
  8514. * @category Array
  8515. * @param {Array} array The array to modify.
  8516. * @returns {Array} Returns `array`.
  8517. * @example
  8518. *
  8519. * var array = [1, 2, 3];
  8520. *
  8521. * _.reverse(array);
  8522. * // => [3, 2, 1]
  8523. *
  8524. * console.log(array);
  8525. * // => [3, 2, 1]
  8526. */
  8527. function reverse(array) {
  8528. return array == null ? array : nativeReverse.call(array);
  8529. }
  8530. /**
  8531. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8532. *
  8533. * **Note:** This method is used instead of
  8534. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8535. * returned.
  8536. *
  8537. * @static
  8538. * @memberOf _
  8539. * @since 3.0.0
  8540. * @category Array
  8541. * @param {Array} array The array to slice.
  8542. * @param {number} [start=0] The start position.
  8543. * @param {number} [end=array.length] The end position.
  8544. * @returns {Array} Returns the slice of `array`.
  8545. */
  8546. function slice(array, start, end) {
  8547. var length = array == null ? 0 : array.length;
  8548. if (!length) {
  8549. return [];
  8550. }
  8551. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8552. start = 0;
  8553. end = length;
  8554. }
  8555. else {
  8556. start = start == null ? 0 : toInteger(start);
  8557. end = end === undefined ? length : toInteger(end);
  8558. }
  8559. return baseSlice(array, start, end);
  8560. }
  8561. /**
  8562. * Uses a binary search to determine the lowest index at which `value`
  8563. * should be inserted into `array` in order to maintain its sort order.
  8564. *
  8565. * @static
  8566. * @memberOf _
  8567. * @since 0.1.0
  8568. * @category Array
  8569. * @param {Array} array The sorted array to inspect.
  8570. * @param {*} value The value to evaluate.
  8571. * @returns {number} Returns the index at which `value` should be inserted
  8572. * into `array`.
  8573. * @example
  8574. *
  8575. * _.sortedIndex([30, 50], 40);
  8576. * // => 1
  8577. */
  8578. function sortedIndex(array, value) {
  8579. return baseSortedIndex(array, value);
  8580. }
  8581. /**
  8582. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8583. * which is invoked for `value` and each element of `array` to compute their
  8584. * sort ranking. The iteratee is invoked with one argument: (value).
  8585. *
  8586. * @static
  8587. * @memberOf _
  8588. * @since 4.0.0
  8589. * @category Array
  8590. * @param {Array} array The sorted array to inspect.
  8591. * @param {*} value The value to evaluate.
  8592. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8593. * @returns {number} Returns the index at which `value` should be inserted
  8594. * into `array`.
  8595. * @example
  8596. *
  8597. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8598. *
  8599. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8600. * // => 0
  8601. *
  8602. * // The `_.property` iteratee shorthand.
  8603. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8604. * // => 0
  8605. */
  8606. function sortedIndexBy(array, value, iteratee) {
  8607. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8608. }
  8609. /**
  8610. * This method is like `_.indexOf` except that it performs a binary
  8611. * search on a sorted `array`.
  8612. *
  8613. * @static
  8614. * @memberOf _
  8615. * @since 4.0.0
  8616. * @category Array
  8617. * @param {Array} array The array to inspect.
  8618. * @param {*} value The value to search for.
  8619. * @returns {number} Returns the index of the matched value, else `-1`.
  8620. * @example
  8621. *
  8622. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8623. * // => 1
  8624. */
  8625. function sortedIndexOf(array, value) {
  8626. var length = array == null ? 0 : array.length;
  8627. if (length) {
  8628. var index = baseSortedIndex(array, value);
  8629. if (index < length && eq(array[index], value)) {
  8630. return index;
  8631. }
  8632. }
  8633. return -1;
  8634. }
  8635. /**
  8636. * This method is like `_.sortedIndex` except that it returns the highest
  8637. * index at which `value` should be inserted into `array` in order to
  8638. * maintain its sort order.
  8639. *
  8640. * @static
  8641. * @memberOf _
  8642. * @since 3.0.0
  8643. * @category Array
  8644. * @param {Array} array The sorted array to inspect.
  8645. * @param {*} value The value to evaluate.
  8646. * @returns {number} Returns the index at which `value` should be inserted
  8647. * into `array`.
  8648. * @example
  8649. *
  8650. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8651. * // => 4
  8652. */
  8653. function sortedLastIndex(array, value) {
  8654. return baseSortedIndex(array, value, true);
  8655. }
  8656. /**
  8657. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8658. * which is invoked for `value` and each element of `array` to compute their
  8659. * sort ranking. The iteratee is invoked with one argument: (value).
  8660. *
  8661. * @static
  8662. * @memberOf _
  8663. * @since 4.0.0
  8664. * @category Array
  8665. * @param {Array} array The sorted array to inspect.
  8666. * @param {*} value The value to evaluate.
  8667. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8668. * @returns {number} Returns the index at which `value` should be inserted
  8669. * into `array`.
  8670. * @example
  8671. *
  8672. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8673. *
  8674. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8675. * // => 1
  8676. *
  8677. * // The `_.property` iteratee shorthand.
  8678. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8679. * // => 1
  8680. */
  8681. function sortedLastIndexBy(array, value, iteratee) {
  8682. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8683. }
  8684. /**
  8685. * This method is like `_.lastIndexOf` except that it performs a binary
  8686. * search on a sorted `array`.
  8687. *
  8688. * @static
  8689. * @memberOf _
  8690. * @since 4.0.0
  8691. * @category Array
  8692. * @param {Array} array The array to inspect.
  8693. * @param {*} value The value to search for.
  8694. * @returns {number} Returns the index of the matched value, else `-1`.
  8695. * @example
  8696. *
  8697. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8698. * // => 3
  8699. */
  8700. function sortedLastIndexOf(array, value) {
  8701. var length = array == null ? 0 : array.length;
  8702. if (length) {
  8703. var index = baseSortedIndex(array, value, true) - 1;
  8704. if (eq(array[index], value)) {
  8705. return index;
  8706. }
  8707. }
  8708. return -1;
  8709. }
  8710. /**
  8711. * This method is like `_.uniq` except that it's designed and optimized
  8712. * for sorted arrays.
  8713. *
  8714. * @static
  8715. * @memberOf _
  8716. * @since 4.0.0
  8717. * @category Array
  8718. * @param {Array} array The array to inspect.
  8719. * @returns {Array} Returns the new duplicate free array.
  8720. * @example
  8721. *
  8722. * _.sortedUniq([1, 1, 2]);
  8723. * // => [1, 2]
  8724. */
  8725. function sortedUniq(array) {
  8726. return (array && array.length)
  8727. ? baseSortedUniq(array)
  8728. : [];
  8729. }
  8730. /**
  8731. * This method is like `_.uniqBy` except that it's designed and optimized
  8732. * for sorted arrays.
  8733. *
  8734. * @static
  8735. * @memberOf _
  8736. * @since 4.0.0
  8737. * @category Array
  8738. * @param {Array} array The array to inspect.
  8739. * @param {Function} [iteratee] The iteratee invoked per element.
  8740. * @returns {Array} Returns the new duplicate free array.
  8741. * @example
  8742. *
  8743. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8744. * // => [1.1, 2.3]
  8745. */
  8746. function sortedUniqBy(array, iteratee) {
  8747. return (array && array.length)
  8748. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8749. : [];
  8750. }
  8751. /**
  8752. * Gets all but the first element of `array`.
  8753. *
  8754. * @static
  8755. * @memberOf _
  8756. * @since 4.0.0
  8757. * @category Array
  8758. * @param {Array} array The array to query.
  8759. * @returns {Array} Returns the slice of `array`.
  8760. * @example
  8761. *
  8762. * _.tail([1, 2, 3]);
  8763. * // => [2, 3]
  8764. */
  8765. function tail(array) {
  8766. var length = array == null ? 0 : array.length;
  8767. return length ? baseSlice(array, 1, length) : [];
  8768. }
  8769. /**
  8770. * Creates a slice of `array` with `n` elements taken from the beginning.
  8771. *
  8772. * @static
  8773. * @memberOf _
  8774. * @since 0.1.0
  8775. * @category Array
  8776. * @param {Array} array The array to query.
  8777. * @param {number} [n=1] The number of elements to take.
  8778. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8779. * @returns {Array} Returns the slice of `array`.
  8780. * @example
  8781. *
  8782. * _.take([1, 2, 3]);
  8783. * // => [1]
  8784. *
  8785. * _.take([1, 2, 3], 2);
  8786. * // => [1, 2]
  8787. *
  8788. * _.take([1, 2, 3], 5);
  8789. * // => [1, 2, 3]
  8790. *
  8791. * _.take([1, 2, 3], 0);
  8792. * // => []
  8793. */
  8794. function take(array, n, guard) {
  8795. if (!(array && array.length)) {
  8796. return [];
  8797. }
  8798. n = (guard || n === undefined) ? 1 : toInteger(n);
  8799. return baseSlice(array, 0, n < 0 ? 0 : n);
  8800. }
  8801. /**
  8802. * Creates a slice of `array` with `n` elements taken from the end.
  8803. *
  8804. * @static
  8805. * @memberOf _
  8806. * @since 3.0.0
  8807. * @category Array
  8808. * @param {Array} array The array to query.
  8809. * @param {number} [n=1] The number of elements to take.
  8810. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8811. * @returns {Array} Returns the slice of `array`.
  8812. * @example
  8813. *
  8814. * _.takeRight([1, 2, 3]);
  8815. * // => [3]
  8816. *
  8817. * _.takeRight([1, 2, 3], 2);
  8818. * // => [2, 3]
  8819. *
  8820. * _.takeRight([1, 2, 3], 5);
  8821. * // => [1, 2, 3]
  8822. *
  8823. * _.takeRight([1, 2, 3], 0);
  8824. * // => []
  8825. */
  8826. function takeRight(array, n, guard) {
  8827. var length = array == null ? 0 : array.length;
  8828. if (!length) {
  8829. return [];
  8830. }
  8831. n = (guard || n === undefined) ? 1 : toInteger(n);
  8832. n = length - n;
  8833. return baseSlice(array, n < 0 ? 0 : n, length);
  8834. }
  8835. /**
  8836. * Creates a slice of `array` with elements taken from the end. Elements are
  8837. * taken until `predicate` returns falsey. The predicate is invoked with
  8838. * three arguments: (value, index, array).
  8839. *
  8840. * @static
  8841. * @memberOf _
  8842. * @since 3.0.0
  8843. * @category Array
  8844. * @param {Array} array The array to query.
  8845. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8846. * @returns {Array} Returns the slice of `array`.
  8847. * @example
  8848. *
  8849. * var users = [
  8850. * { 'user': 'barney', 'active': true },
  8851. * { 'user': 'fred', 'active': false },
  8852. * { 'user': 'pebbles', 'active': false }
  8853. * ];
  8854. *
  8855. * _.takeRightWhile(users, function(o) { return !o.active; });
  8856. * // => objects for ['fred', 'pebbles']
  8857. *
  8858. * // The `_.matches` iteratee shorthand.
  8859. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8860. * // => objects for ['pebbles']
  8861. *
  8862. * // The `_.matchesProperty` iteratee shorthand.
  8863. * _.takeRightWhile(users, ['active', false]);
  8864. * // => objects for ['fred', 'pebbles']
  8865. *
  8866. * // The `_.property` iteratee shorthand.
  8867. * _.takeRightWhile(users, 'active');
  8868. * // => []
  8869. */
  8870. function takeRightWhile(array, predicate) {
  8871. return (array && array.length)
  8872. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8873. : [];
  8874. }
  8875. /**
  8876. * Creates a slice of `array` with elements taken from the beginning. Elements
  8877. * are taken until `predicate` returns falsey. The predicate is invoked with
  8878. * three arguments: (value, index, array).
  8879. *
  8880. * @static
  8881. * @memberOf _
  8882. * @since 3.0.0
  8883. * @category Array
  8884. * @param {Array} array The array to query.
  8885. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8886. * @returns {Array} Returns the slice of `array`.
  8887. * @example
  8888. *
  8889. * var users = [
  8890. * { 'user': 'barney', 'active': false },
  8891. * { 'user': 'fred', 'active': false },
  8892. * { 'user': 'pebbles', 'active': true }
  8893. * ];
  8894. *
  8895. * _.takeWhile(users, function(o) { return !o.active; });
  8896. * // => objects for ['barney', 'fred']
  8897. *
  8898. * // The `_.matches` iteratee shorthand.
  8899. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8900. * // => objects for ['barney']
  8901. *
  8902. * // The `_.matchesProperty` iteratee shorthand.
  8903. * _.takeWhile(users, ['active', false]);
  8904. * // => objects for ['barney', 'fred']
  8905. *
  8906. * // The `_.property` iteratee shorthand.
  8907. * _.takeWhile(users, 'active');
  8908. * // => []
  8909. */
  8910. function takeWhile(array, predicate) {
  8911. return (array && array.length)
  8912. ? baseWhile(array, getIteratee(predicate, 3))
  8913. : [];
  8914. }
  8915. /**
  8916. * Creates an array of unique values, in order, from all given arrays using
  8917. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8918. * for equality comparisons.
  8919. *
  8920. * @static
  8921. * @memberOf _
  8922. * @since 0.1.0
  8923. * @category Array
  8924. * @param {...Array} [arrays] The arrays to inspect.
  8925. * @returns {Array} Returns the new array of combined values.
  8926. * @example
  8927. *
  8928. * _.union([2], [1, 2]);
  8929. * // => [2, 1]
  8930. */
  8931. var union = baseRest(function(arrays) {
  8932. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8933. });
  8934. /**
  8935. * This method is like `_.union` except that it accepts `iteratee` which is
  8936. * invoked for each element of each `arrays` to generate the criterion by
  8937. * which uniqueness is computed. Result values are chosen from the first
  8938. * array in which the value occurs. The iteratee is invoked with one argument:
  8939. * (value).
  8940. *
  8941. * @static
  8942. * @memberOf _
  8943. * @since 4.0.0
  8944. * @category Array
  8945. * @param {...Array} [arrays] The arrays to inspect.
  8946. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8947. * @returns {Array} Returns the new array of combined values.
  8948. * @example
  8949. *
  8950. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8951. * // => [2.1, 1.2]
  8952. *
  8953. * // The `_.property` iteratee shorthand.
  8954. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8955. * // => [{ 'x': 1 }, { 'x': 2 }]
  8956. */
  8957. var unionBy = baseRest(function(arrays) {
  8958. var iteratee = last(arrays);
  8959. if (isArrayLikeObject(iteratee)) {
  8960. iteratee = undefined;
  8961. }
  8962. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8963. });
  8964. /**
  8965. * This method is like `_.union` except that it accepts `comparator` which
  8966. * is invoked to compare elements of `arrays`. Result values are chosen from
  8967. * the first array in which the value occurs. The comparator is invoked
  8968. * with two arguments: (arrVal, othVal).
  8969. *
  8970. * @static
  8971. * @memberOf _
  8972. * @since 4.0.0
  8973. * @category Array
  8974. * @param {...Array} [arrays] The arrays to inspect.
  8975. * @param {Function} [comparator] The comparator invoked per element.
  8976. * @returns {Array} Returns the new array of combined values.
  8977. * @example
  8978. *
  8979. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8980. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8981. *
  8982. * _.unionWith(objects, others, _.isEqual);
  8983. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8984. */
  8985. var unionWith = baseRest(function(arrays) {
  8986. var comparator = last(arrays);
  8987. comparator = typeof comparator == 'function' ? comparator : undefined;
  8988. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8989. });
  8990. /**
  8991. * Creates a duplicate-free version of an array, using
  8992. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8993. * for equality comparisons, in which only the first occurrence of each element
  8994. * is kept. The order of result values is determined by the order they occur
  8995. * in the array.
  8996. *
  8997. * @static
  8998. * @memberOf _
  8999. * @since 0.1.0
  9000. * @category Array
  9001. * @param {Array} array The array to inspect.
  9002. * @returns {Array} Returns the new duplicate free array.
  9003. * @example
  9004. *
  9005. * _.uniq([2, 1, 2]);
  9006. * // => [2, 1]
  9007. */
  9008. function uniq(array) {
  9009. return (array && array.length) ? baseUniq(array) : [];
  9010. }
  9011. /**
  9012. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9013. * invoked for each element in `array` to generate the criterion by which
  9014. * uniqueness is computed. The order of result values is determined by the
  9015. * order they occur in the array. The iteratee is invoked with one argument:
  9016. * (value).
  9017. *
  9018. * @static
  9019. * @memberOf _
  9020. * @since 4.0.0
  9021. * @category Array
  9022. * @param {Array} array The array to inspect.
  9023. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9024. * @returns {Array} Returns the new duplicate free array.
  9025. * @example
  9026. *
  9027. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9028. * // => [2.1, 1.2]
  9029. *
  9030. * // The `_.property` iteratee shorthand.
  9031. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9032. * // => [{ 'x': 1 }, { 'x': 2 }]
  9033. */
  9034. function uniqBy(array, iteratee) {
  9035. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9036. }
  9037. /**
  9038. * This method is like `_.uniq` except that it accepts `comparator` which
  9039. * is invoked to compare elements of `array`. The order of result values is
  9040. * determined by the order they occur in the array.The comparator is invoked
  9041. * with two arguments: (arrVal, othVal).
  9042. *
  9043. * @static
  9044. * @memberOf _
  9045. * @since 4.0.0
  9046. * @category Array
  9047. * @param {Array} array The array to inspect.
  9048. * @param {Function} [comparator] The comparator invoked per element.
  9049. * @returns {Array} Returns the new duplicate free array.
  9050. * @example
  9051. *
  9052. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9053. *
  9054. * _.uniqWith(objects, _.isEqual);
  9055. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9056. */
  9057. function uniqWith(array, comparator) {
  9058. comparator = typeof comparator == 'function' ? comparator : undefined;
  9059. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9060. }
  9061. /**
  9062. * This method is like `_.zip` except that it accepts an array of grouped
  9063. * elements and creates an array regrouping the elements to their pre-zip
  9064. * configuration.
  9065. *
  9066. * @static
  9067. * @memberOf _
  9068. * @since 1.2.0
  9069. * @category Array
  9070. * @param {Array} array The array of grouped elements to process.
  9071. * @returns {Array} Returns the new array of regrouped elements.
  9072. * @example
  9073. *
  9074. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9075. * // => [['a', 1, true], ['b', 2, false]]
  9076. *
  9077. * _.unzip(zipped);
  9078. * // => [['a', 'b'], [1, 2], [true, false]]
  9079. */
  9080. function unzip(array) {
  9081. if (!(array && array.length)) {
  9082. return [];
  9083. }
  9084. var length = 0;
  9085. array = arrayFilter(array, function(group) {
  9086. if (isArrayLikeObject(group)) {
  9087. length = nativeMax(group.length, length);
  9088. return true;
  9089. }
  9090. });
  9091. return baseTimes(length, function(index) {
  9092. return arrayMap(array, baseProperty(index));
  9093. });
  9094. }
  9095. /**
  9096. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9097. * how regrouped values should be combined. The iteratee is invoked with the
  9098. * elements of each group: (...group).
  9099. *
  9100. * @static
  9101. * @memberOf _
  9102. * @since 3.8.0
  9103. * @category Array
  9104. * @param {Array} array The array of grouped elements to process.
  9105. * @param {Function} [iteratee=_.identity] The function to combine
  9106. * regrouped values.
  9107. * @returns {Array} Returns the new array of regrouped elements.
  9108. * @example
  9109. *
  9110. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9111. * // => [[1, 10, 100], [2, 20, 200]]
  9112. *
  9113. * _.unzipWith(zipped, _.add);
  9114. * // => [3, 30, 300]
  9115. */
  9116. function unzipWith(array, iteratee) {
  9117. if (!(array && array.length)) {
  9118. return [];
  9119. }
  9120. var result = unzip(array);
  9121. if (iteratee == null) {
  9122. return result;
  9123. }
  9124. return arrayMap(result, function(group) {
  9125. return apply(iteratee, undefined, group);
  9126. });
  9127. }
  9128. /**
  9129. * Creates an array excluding all given values using
  9130. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9131. * for equality comparisons.
  9132. *
  9133. * **Note:** Unlike `_.pull`, this method returns a new array.
  9134. *
  9135. * @static
  9136. * @memberOf _
  9137. * @since 0.1.0
  9138. * @category Array
  9139. * @param {Array} array The array to inspect.
  9140. * @param {...*} [values] The values to exclude.
  9141. * @returns {Array} Returns the new array of filtered values.
  9142. * @see _.difference, _.xor
  9143. * @example
  9144. *
  9145. * _.without([2, 1, 2, 3], 1, 2);
  9146. * // => [3]
  9147. */
  9148. var without = baseRest(function(array, values) {
  9149. return isArrayLikeObject(array)
  9150. ? baseDifference(array, values)
  9151. : [];
  9152. });
  9153. /**
  9154. * Creates an array of unique values that is the
  9155. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9156. * of the given arrays. The order of result values is determined by the order
  9157. * they occur in the arrays.
  9158. *
  9159. * @static
  9160. * @memberOf _
  9161. * @since 2.4.0
  9162. * @category Array
  9163. * @param {...Array} [arrays] The arrays to inspect.
  9164. * @returns {Array} Returns the new array of filtered values.
  9165. * @see _.difference, _.without
  9166. * @example
  9167. *
  9168. * _.xor([2, 1], [2, 3]);
  9169. * // => [1, 3]
  9170. */
  9171. var xor = baseRest(function(arrays) {
  9172. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9173. });
  9174. /**
  9175. * This method is like `_.xor` except that it accepts `iteratee` which is
  9176. * invoked for each element of each `arrays` to generate the criterion by
  9177. * which by which they're compared. The order of result values is determined
  9178. * by the order they occur in the arrays. The iteratee is invoked with one
  9179. * argument: (value).
  9180. *
  9181. * @static
  9182. * @memberOf _
  9183. * @since 4.0.0
  9184. * @category Array
  9185. * @param {...Array} [arrays] The arrays to inspect.
  9186. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9187. * @returns {Array} Returns the new array of filtered values.
  9188. * @example
  9189. *
  9190. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9191. * // => [1.2, 3.4]
  9192. *
  9193. * // The `_.property` iteratee shorthand.
  9194. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9195. * // => [{ 'x': 2 }]
  9196. */
  9197. var xorBy = baseRest(function(arrays) {
  9198. var iteratee = last(arrays);
  9199. if (isArrayLikeObject(iteratee)) {
  9200. iteratee = undefined;
  9201. }
  9202. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9203. });
  9204. /**
  9205. * This method is like `_.xor` except that it accepts `comparator` which is
  9206. * invoked to compare elements of `arrays`. The order of result values is
  9207. * determined by the order they occur in the arrays. The comparator is invoked
  9208. * with two arguments: (arrVal, othVal).
  9209. *
  9210. * @static
  9211. * @memberOf _
  9212. * @since 4.0.0
  9213. * @category Array
  9214. * @param {...Array} [arrays] The arrays to inspect.
  9215. * @param {Function} [comparator] The comparator invoked per element.
  9216. * @returns {Array} Returns the new array of filtered values.
  9217. * @example
  9218. *
  9219. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9220. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9221. *
  9222. * _.xorWith(objects, others, _.isEqual);
  9223. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9224. */
  9225. var xorWith = baseRest(function(arrays) {
  9226. var comparator = last(arrays);
  9227. comparator = typeof comparator == 'function' ? comparator : undefined;
  9228. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9229. });
  9230. /**
  9231. * Creates an array of grouped elements, the first of which contains the
  9232. * first elements of the given arrays, the second of which contains the
  9233. * second elements of the given arrays, and so on.
  9234. *
  9235. * @static
  9236. * @memberOf _
  9237. * @since 0.1.0
  9238. * @category Array
  9239. * @param {...Array} [arrays] The arrays to process.
  9240. * @returns {Array} Returns the new array of grouped elements.
  9241. * @example
  9242. *
  9243. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9244. * // => [['a', 1, true], ['b', 2, false]]
  9245. */
  9246. var zip = baseRest(unzip);
  9247. /**
  9248. * This method is like `_.fromPairs` except that it accepts two arrays,
  9249. * one of property identifiers and one of corresponding values.
  9250. *
  9251. * @static
  9252. * @memberOf _
  9253. * @since 0.4.0
  9254. * @category Array
  9255. * @param {Array} [props=[]] The property identifiers.
  9256. * @param {Array} [values=[]] The property values.
  9257. * @returns {Object} Returns the new object.
  9258. * @example
  9259. *
  9260. * _.zipObject(['a', 'b'], [1, 2]);
  9261. * // => { 'a': 1, 'b': 2 }
  9262. */
  9263. function zipObject(props, values) {
  9264. return baseZipObject(props || [], values || [], assignValue);
  9265. }
  9266. /**
  9267. * This method is like `_.zipObject` except that it supports property paths.
  9268. *
  9269. * @static
  9270. * @memberOf _
  9271. * @since 4.1.0
  9272. * @category Array
  9273. * @param {Array} [props=[]] The property identifiers.
  9274. * @param {Array} [values=[]] The property values.
  9275. * @returns {Object} Returns the new object.
  9276. * @example
  9277. *
  9278. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9279. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9280. */
  9281. function zipObjectDeep(props, values) {
  9282. return baseZipObject(props || [], values || [], baseSet);
  9283. }
  9284. /**
  9285. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9286. * how grouped values should be combined. The iteratee is invoked with the
  9287. * elements of each group: (...group).
  9288. *
  9289. * @static
  9290. * @memberOf _
  9291. * @since 3.8.0
  9292. * @category Array
  9293. * @param {...Array} [arrays] The arrays to process.
  9294. * @param {Function} [iteratee=_.identity] The function to combine
  9295. * grouped values.
  9296. * @returns {Array} Returns the new array of grouped elements.
  9297. * @example
  9298. *
  9299. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9300. * return a + b + c;
  9301. * });
  9302. * // => [111, 222]
  9303. */
  9304. var zipWith = baseRest(function(arrays) {
  9305. var length = arrays.length,
  9306. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9307. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9308. return unzipWith(arrays, iteratee);
  9309. });
  9310. /*------------------------------------------------------------------------*/
  9311. /**
  9312. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9313. * chain sequences enabled. The result of such sequences must be unwrapped
  9314. * with `_#value`.
  9315. *
  9316. * @static
  9317. * @memberOf _
  9318. * @since 1.3.0
  9319. * @category Seq
  9320. * @param {*} value The value to wrap.
  9321. * @returns {Object} Returns the new `lodash` wrapper instance.
  9322. * @example
  9323. *
  9324. * var users = [
  9325. * { 'user': 'barney', 'age': 36 },
  9326. * { 'user': 'fred', 'age': 40 },
  9327. * { 'user': 'pebbles', 'age': 1 }
  9328. * ];
  9329. *
  9330. * var youngest = _
  9331. * .chain(users)
  9332. * .sortBy('age')
  9333. * .map(function(o) {
  9334. * return o.user + ' is ' + o.age;
  9335. * })
  9336. * .head()
  9337. * .value();
  9338. * // => 'pebbles is 1'
  9339. */
  9340. function chain(value) {
  9341. var result = lodash(value);
  9342. result.__chain__ = true;
  9343. return result;
  9344. }
  9345. /**
  9346. * This method invokes `interceptor` and returns `value`. The interceptor
  9347. * is invoked with one argument; (value). The purpose of this method is to
  9348. * "tap into" a method chain sequence in order to modify intermediate results.
  9349. *
  9350. * @static
  9351. * @memberOf _
  9352. * @since 0.1.0
  9353. * @category Seq
  9354. * @param {*} value The value to provide to `interceptor`.
  9355. * @param {Function} interceptor The function to invoke.
  9356. * @returns {*} Returns `value`.
  9357. * @example
  9358. *
  9359. * _([1, 2, 3])
  9360. * .tap(function(array) {
  9361. * // Mutate input array.
  9362. * array.pop();
  9363. * })
  9364. * .reverse()
  9365. * .value();
  9366. * // => [2, 1]
  9367. */
  9368. function tap(value, interceptor) {
  9369. interceptor(value);
  9370. return value;
  9371. }
  9372. /**
  9373. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9374. * The purpose of this method is to "pass thru" values replacing intermediate
  9375. * results in a method chain sequence.
  9376. *
  9377. * @static
  9378. * @memberOf _
  9379. * @since 3.0.0
  9380. * @category Seq
  9381. * @param {*} value The value to provide to `interceptor`.
  9382. * @param {Function} interceptor The function to invoke.
  9383. * @returns {*} Returns the result of `interceptor`.
  9384. * @example
  9385. *
  9386. * _(' abc ')
  9387. * .chain()
  9388. * .trim()
  9389. * .thru(function(value) {
  9390. * return [value];
  9391. * })
  9392. * .value();
  9393. * // => ['abc']
  9394. */
  9395. function thru(value, interceptor) {
  9396. return interceptor(value);
  9397. }
  9398. /**
  9399. * This method is the wrapper version of `_.at`.
  9400. *
  9401. * @name at
  9402. * @memberOf _
  9403. * @since 1.0.0
  9404. * @category Seq
  9405. * @param {...(string|string[])} [paths] The property paths to pick.
  9406. * @returns {Object} Returns the new `lodash` wrapper instance.
  9407. * @example
  9408. *
  9409. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9410. *
  9411. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9412. * // => [3, 4]
  9413. */
  9414. var wrapperAt = flatRest(function(paths) {
  9415. var length = paths.length,
  9416. start = length ? paths[0] : 0,
  9417. value = this.__wrapped__,
  9418. interceptor = function(object) { return baseAt(object, paths); };
  9419. if (length > 1 || this.__actions__.length ||
  9420. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9421. return this.thru(interceptor);
  9422. }
  9423. value = value.slice(start, +start + (length ? 1 : 0));
  9424. value.__actions__.push({
  9425. 'func': thru,
  9426. 'args': [interceptor],
  9427. 'thisArg': undefined
  9428. });
  9429. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9430. if (length && !array.length) {
  9431. array.push(undefined);
  9432. }
  9433. return array;
  9434. });
  9435. });
  9436. /**
  9437. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9438. *
  9439. * @name chain
  9440. * @memberOf _
  9441. * @since 0.1.0
  9442. * @category Seq
  9443. * @returns {Object} Returns the new `lodash` wrapper instance.
  9444. * @example
  9445. *
  9446. * var users = [
  9447. * { 'user': 'barney', 'age': 36 },
  9448. * { 'user': 'fred', 'age': 40 }
  9449. * ];
  9450. *
  9451. * // A sequence without explicit chaining.
  9452. * _(users).head();
  9453. * // => { 'user': 'barney', 'age': 36 }
  9454. *
  9455. * // A sequence with explicit chaining.
  9456. * _(users)
  9457. * .chain()
  9458. * .head()
  9459. * .pick('user')
  9460. * .value();
  9461. * // => { 'user': 'barney' }
  9462. */
  9463. function wrapperChain() {
  9464. return chain(this);
  9465. }
  9466. /**
  9467. * Executes the chain sequence and returns the wrapped result.
  9468. *
  9469. * @name commit
  9470. * @memberOf _
  9471. * @since 3.2.0
  9472. * @category Seq
  9473. * @returns {Object} Returns the new `lodash` wrapper instance.
  9474. * @example
  9475. *
  9476. * var array = [1, 2];
  9477. * var wrapped = _(array).push(3);
  9478. *
  9479. * console.log(array);
  9480. * // => [1, 2]
  9481. *
  9482. * wrapped = wrapped.commit();
  9483. * console.log(array);
  9484. * // => [1, 2, 3]
  9485. *
  9486. * wrapped.last();
  9487. * // => 3
  9488. *
  9489. * console.log(array);
  9490. * // => [1, 2, 3]
  9491. */
  9492. function wrapperCommit() {
  9493. return new LodashWrapper(this.value(), this.__chain__);
  9494. }
  9495. /**
  9496. * Gets the next value on a wrapped object following the
  9497. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9498. *
  9499. * @name next
  9500. * @memberOf _
  9501. * @since 4.0.0
  9502. * @category Seq
  9503. * @returns {Object} Returns the next iterator value.
  9504. * @example
  9505. *
  9506. * var wrapped = _([1, 2]);
  9507. *
  9508. * wrapped.next();
  9509. * // => { 'done': false, 'value': 1 }
  9510. *
  9511. * wrapped.next();
  9512. * // => { 'done': false, 'value': 2 }
  9513. *
  9514. * wrapped.next();
  9515. * // => { 'done': true, 'value': undefined }
  9516. */
  9517. function wrapperNext() {
  9518. if (this.__values__ === undefined) {
  9519. this.__values__ = toArray(this.value());
  9520. }
  9521. var done = this.__index__ >= this.__values__.length,
  9522. value = done ? undefined : this.__values__[this.__index__++];
  9523. return { 'done': done, 'value': value };
  9524. }
  9525. /**
  9526. * Enables the wrapper to be iterable.
  9527. *
  9528. * @name Symbol.iterator
  9529. * @memberOf _
  9530. * @since 4.0.0
  9531. * @category Seq
  9532. * @returns {Object} Returns the wrapper object.
  9533. * @example
  9534. *
  9535. * var wrapped = _([1, 2]);
  9536. *
  9537. * wrapped[Symbol.iterator]() === wrapped;
  9538. * // => true
  9539. *
  9540. * Array.from(wrapped);
  9541. * // => [1, 2]
  9542. */
  9543. function wrapperToIterator() {
  9544. return this;
  9545. }
  9546. /**
  9547. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9548. *
  9549. * @name plant
  9550. * @memberOf _
  9551. * @since 3.2.0
  9552. * @category Seq
  9553. * @param {*} value The value to plant.
  9554. * @returns {Object} Returns the new `lodash` wrapper instance.
  9555. * @example
  9556. *
  9557. * function square(n) {
  9558. * return n * n;
  9559. * }
  9560. *
  9561. * var wrapped = _([1, 2]).map(square);
  9562. * var other = wrapped.plant([3, 4]);
  9563. *
  9564. * other.value();
  9565. * // => [9, 16]
  9566. *
  9567. * wrapped.value();
  9568. * // => [1, 4]
  9569. */
  9570. function wrapperPlant(value) {
  9571. var result,
  9572. parent = this;
  9573. while (parent instanceof baseLodash) {
  9574. var clone = wrapperClone(parent);
  9575. clone.__index__ = 0;
  9576. clone.__values__ = undefined;
  9577. if (result) {
  9578. previous.__wrapped__ = clone;
  9579. } else {
  9580. result = clone;
  9581. }
  9582. var previous = clone;
  9583. parent = parent.__wrapped__;
  9584. }
  9585. previous.__wrapped__ = value;
  9586. return result;
  9587. }
  9588. /**
  9589. * This method is the wrapper version of `_.reverse`.
  9590. *
  9591. * **Note:** This method mutates the wrapped array.
  9592. *
  9593. * @name reverse
  9594. * @memberOf _
  9595. * @since 0.1.0
  9596. * @category Seq
  9597. * @returns {Object} Returns the new `lodash` wrapper instance.
  9598. * @example
  9599. *
  9600. * var array = [1, 2, 3];
  9601. *
  9602. * _(array).reverse().value()
  9603. * // => [3, 2, 1]
  9604. *
  9605. * console.log(array);
  9606. * // => [3, 2, 1]
  9607. */
  9608. function wrapperReverse() {
  9609. var value = this.__wrapped__;
  9610. if (value instanceof LazyWrapper) {
  9611. var wrapped = value;
  9612. if (this.__actions__.length) {
  9613. wrapped = new LazyWrapper(this);
  9614. }
  9615. wrapped = wrapped.reverse();
  9616. wrapped.__actions__.push({
  9617. 'func': thru,
  9618. 'args': [reverse],
  9619. 'thisArg': undefined
  9620. });
  9621. return new LodashWrapper(wrapped, this.__chain__);
  9622. }
  9623. return this.thru(reverse);
  9624. }
  9625. /**
  9626. * Executes the chain sequence to resolve the unwrapped value.
  9627. *
  9628. * @name value
  9629. * @memberOf _
  9630. * @since 0.1.0
  9631. * @alias toJSON, valueOf
  9632. * @category Seq
  9633. * @returns {*} Returns the resolved unwrapped value.
  9634. * @example
  9635. *
  9636. * _([1, 2, 3]).value();
  9637. * // => [1, 2, 3]
  9638. */
  9639. function wrapperValue() {
  9640. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9641. }
  9642. /*------------------------------------------------------------------------*/
  9643. /**
  9644. * Creates an object composed of keys generated from the results of running
  9645. * each element of `collection` thru `iteratee`. The corresponding value of
  9646. * each key is the number of times the key was returned by `iteratee`. The
  9647. * iteratee is invoked with one argument: (value).
  9648. *
  9649. * @static
  9650. * @memberOf _
  9651. * @since 0.5.0
  9652. * @category Collection
  9653. * @param {Array|Object} collection The collection to iterate over.
  9654. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9655. * @returns {Object} Returns the composed aggregate object.
  9656. * @example
  9657. *
  9658. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9659. * // => { '4': 1, '6': 2 }
  9660. *
  9661. * // The `_.property` iteratee shorthand.
  9662. * _.countBy(['one', 'two', 'three'], 'length');
  9663. * // => { '3': 2, '5': 1 }
  9664. */
  9665. var countBy = createAggregator(function(result, value, key) {
  9666. if (hasOwnProperty.call(result, key)) {
  9667. ++result[key];
  9668. } else {
  9669. baseAssignValue(result, key, 1);
  9670. }
  9671. });
  9672. /**
  9673. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9674. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9675. * invoked with three arguments: (value, index|key, collection).
  9676. *
  9677. * **Note:** This method returns `true` for
  9678. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9679. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9680. * elements of empty collections.
  9681. *
  9682. * @static
  9683. * @memberOf _
  9684. * @since 0.1.0
  9685. * @category Collection
  9686. * @param {Array|Object} collection The collection to iterate over.
  9687. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9688. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9689. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9690. * else `false`.
  9691. * @example
  9692. *
  9693. * _.every([true, 1, null, 'yes'], Boolean);
  9694. * // => false
  9695. *
  9696. * var users = [
  9697. * { 'user': 'barney', 'age': 36, 'active': false },
  9698. * { 'user': 'fred', 'age': 40, 'active': false }
  9699. * ];
  9700. *
  9701. * // The `_.matches` iteratee shorthand.
  9702. * _.every(users, { 'user': 'barney', 'active': false });
  9703. * // => false
  9704. *
  9705. * // The `_.matchesProperty` iteratee shorthand.
  9706. * _.every(users, ['active', false]);
  9707. * // => true
  9708. *
  9709. * // The `_.property` iteratee shorthand.
  9710. * _.every(users, 'active');
  9711. * // => false
  9712. */
  9713. function every(collection, predicate, guard) {
  9714. var func = isArray(collection) ? arrayEvery : baseEvery;
  9715. if (guard && isIterateeCall(collection, predicate, guard)) {
  9716. predicate = undefined;
  9717. }
  9718. return func(collection, getIteratee(predicate, 3));
  9719. }
  9720. /**
  9721. * Iterates over elements of `collection`, returning an array of all elements
  9722. * `predicate` returns truthy for. The predicate is invoked with three
  9723. * arguments: (value, index|key, collection).
  9724. *
  9725. * **Note:** Unlike `_.remove`, this method returns a new array.
  9726. *
  9727. * @static
  9728. * @memberOf _
  9729. * @since 0.1.0
  9730. * @category Collection
  9731. * @param {Array|Object} collection The collection to iterate over.
  9732. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9733. * @returns {Array} Returns the new filtered array.
  9734. * @see _.reject
  9735. * @example
  9736. *
  9737. * var users = [
  9738. * { 'user': 'barney', 'age': 36, 'active': true },
  9739. * { 'user': 'fred', 'age': 40, 'active': false }
  9740. * ];
  9741. *
  9742. * _.filter(users, function(o) { return !o.active; });
  9743. * // => objects for ['fred']
  9744. *
  9745. * // The `_.matches` iteratee shorthand.
  9746. * _.filter(users, { 'age': 36, 'active': true });
  9747. * // => objects for ['barney']
  9748. *
  9749. * // The `_.matchesProperty` iteratee shorthand.
  9750. * _.filter(users, ['active', false]);
  9751. * // => objects for ['fred']
  9752. *
  9753. * // The `_.property` iteratee shorthand.
  9754. * _.filter(users, 'active');
  9755. * // => objects for ['barney']
  9756. *
  9757. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9758. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9759. * // => objects for ['fred', 'barney']
  9760. */
  9761. function filter(collection, predicate) {
  9762. var func = isArray(collection) ? arrayFilter : baseFilter;
  9763. return func(collection, getIteratee(predicate, 3));
  9764. }
  9765. /**
  9766. * Iterates over elements of `collection`, returning the first element
  9767. * `predicate` returns truthy for. The predicate is invoked with three
  9768. * arguments: (value, index|key, collection).
  9769. *
  9770. * @static
  9771. * @memberOf _
  9772. * @since 0.1.0
  9773. * @category Collection
  9774. * @param {Array|Object} collection The collection to inspect.
  9775. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9776. * @param {number} [fromIndex=0] The index to search from.
  9777. * @returns {*} Returns the matched element, else `undefined`.
  9778. * @example
  9779. *
  9780. * var users = [
  9781. * { 'user': 'barney', 'age': 36, 'active': true },
  9782. * { 'user': 'fred', 'age': 40, 'active': false },
  9783. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9784. * ];
  9785. *
  9786. * _.find(users, function(o) { return o.age < 40; });
  9787. * // => object for 'barney'
  9788. *
  9789. * // The `_.matches` iteratee shorthand.
  9790. * _.find(users, { 'age': 1, 'active': true });
  9791. * // => object for 'pebbles'
  9792. *
  9793. * // The `_.matchesProperty` iteratee shorthand.
  9794. * _.find(users, ['active', false]);
  9795. * // => object for 'fred'
  9796. *
  9797. * // The `_.property` iteratee shorthand.
  9798. * _.find(users, 'active');
  9799. * // => object for 'barney'
  9800. */
  9801. var find = createFind(findIndex);
  9802. /**
  9803. * This method is like `_.find` except that it iterates over elements of
  9804. * `collection` from right to left.
  9805. *
  9806. * @static
  9807. * @memberOf _
  9808. * @since 2.0.0
  9809. * @category Collection
  9810. * @param {Array|Object} collection The collection to inspect.
  9811. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9812. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9813. * @returns {*} Returns the matched element, else `undefined`.
  9814. * @example
  9815. *
  9816. * _.findLast([1, 2, 3, 4], function(n) {
  9817. * return n % 2 == 1;
  9818. * });
  9819. * // => 3
  9820. */
  9821. var findLast = createFind(findLastIndex);
  9822. /**
  9823. * Creates a flattened array of values by running each element in `collection`
  9824. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9825. * with three arguments: (value, index|key, collection).
  9826. *
  9827. * @static
  9828. * @memberOf _
  9829. * @since 4.0.0
  9830. * @category Collection
  9831. * @param {Array|Object} collection The collection to iterate over.
  9832. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9833. * @returns {Array} Returns the new flattened array.
  9834. * @example
  9835. *
  9836. * function duplicate(n) {
  9837. * return [n, n];
  9838. * }
  9839. *
  9840. * _.flatMap([1, 2], duplicate);
  9841. * // => [1, 1, 2, 2]
  9842. */
  9843. function flatMap(collection, iteratee) {
  9844. return baseFlatten(map(collection, iteratee), 1);
  9845. }
  9846. /**
  9847. * This method is like `_.flatMap` except that it recursively flattens the
  9848. * mapped results.
  9849. *
  9850. * @static
  9851. * @memberOf _
  9852. * @since 4.7.0
  9853. * @category Collection
  9854. * @param {Array|Object} collection The collection to iterate over.
  9855. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9856. * @returns {Array} Returns the new flattened array.
  9857. * @example
  9858. *
  9859. * function duplicate(n) {
  9860. * return [[[n, n]]];
  9861. * }
  9862. *
  9863. * _.flatMapDeep([1, 2], duplicate);
  9864. * // => [1, 1, 2, 2]
  9865. */
  9866. function flatMapDeep(collection, iteratee) {
  9867. return baseFlatten(map(collection, iteratee), INFINITY);
  9868. }
  9869. /**
  9870. * This method is like `_.flatMap` except that it recursively flattens the
  9871. * mapped results up to `depth` times.
  9872. *
  9873. * @static
  9874. * @memberOf _
  9875. * @since 4.7.0
  9876. * @category Collection
  9877. * @param {Array|Object} collection The collection to iterate over.
  9878. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9879. * @param {number} [depth=1] The maximum recursion depth.
  9880. * @returns {Array} Returns the new flattened array.
  9881. * @example
  9882. *
  9883. * function duplicate(n) {
  9884. * return [[[n, n]]];
  9885. * }
  9886. *
  9887. * _.flatMapDepth([1, 2], duplicate, 2);
  9888. * // => [[1, 1], [2, 2]]
  9889. */
  9890. function flatMapDepth(collection, iteratee, depth) {
  9891. depth = depth === undefined ? 1 : toInteger(depth);
  9892. return baseFlatten(map(collection, iteratee), depth);
  9893. }
  9894. /**
  9895. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9896. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9897. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9898. *
  9899. * **Note:** As with other "Collections" methods, objects with a "length"
  9900. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9901. * or `_.forOwn` for object iteration.
  9902. *
  9903. * @static
  9904. * @memberOf _
  9905. * @since 0.1.0
  9906. * @alias each
  9907. * @category Collection
  9908. * @param {Array|Object} collection The collection to iterate over.
  9909. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9910. * @returns {Array|Object} Returns `collection`.
  9911. * @see _.forEachRight
  9912. * @example
  9913. *
  9914. * _.forEach([1, 2], function(value) {
  9915. * console.log(value);
  9916. * });
  9917. * // => Logs `1` then `2`.
  9918. *
  9919. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9920. * console.log(key);
  9921. * });
  9922. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9923. */
  9924. function forEach(collection, iteratee) {
  9925. var func = isArray(collection) ? arrayEach : baseEach;
  9926. return func(collection, getIteratee(iteratee, 3));
  9927. }
  9928. /**
  9929. * This method is like `_.forEach` except that it iterates over elements of
  9930. * `collection` from right to left.
  9931. *
  9932. * @static
  9933. * @memberOf _
  9934. * @since 2.0.0
  9935. * @alias eachRight
  9936. * @category Collection
  9937. * @param {Array|Object} collection The collection to iterate over.
  9938. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9939. * @returns {Array|Object} Returns `collection`.
  9940. * @see _.forEach
  9941. * @example
  9942. *
  9943. * _.forEachRight([1, 2], function(value) {
  9944. * console.log(value);
  9945. * });
  9946. * // => Logs `2` then `1`.
  9947. */
  9948. function forEachRight(collection, iteratee) {
  9949. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9950. return func(collection, getIteratee(iteratee, 3));
  9951. }
  9952. /**
  9953. * Creates an object composed of keys generated from the results of running
  9954. * each element of `collection` thru `iteratee`. The order of grouped values
  9955. * is determined by the order they occur in `collection`. The corresponding
  9956. * value of each key is an array of elements responsible for generating the
  9957. * key. The iteratee is invoked with one argument: (value).
  9958. *
  9959. * @static
  9960. * @memberOf _
  9961. * @since 0.1.0
  9962. * @category Collection
  9963. * @param {Array|Object} collection The collection to iterate over.
  9964. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9965. * @returns {Object} Returns the composed aggregate object.
  9966. * @example
  9967. *
  9968. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9969. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9970. *
  9971. * // The `_.property` iteratee shorthand.
  9972. * _.groupBy(['one', 'two', 'three'], 'length');
  9973. * // => { '3': ['one', 'two'], '5': ['three'] }
  9974. */
  9975. var groupBy = createAggregator(function(result, value, key) {
  9976. if (hasOwnProperty.call(result, key)) {
  9977. result[key].push(value);
  9978. } else {
  9979. baseAssignValue(result, key, [value]);
  9980. }
  9981. });
  9982. /**
  9983. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9984. * checked for a substring of `value`, otherwise
  9985. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9986. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9987. * the offset from the end of `collection`.
  9988. *
  9989. * @static
  9990. * @memberOf _
  9991. * @since 0.1.0
  9992. * @category Collection
  9993. * @param {Array|Object|string} collection The collection to inspect.
  9994. * @param {*} value The value to search for.
  9995. * @param {number} [fromIndex=0] The index to search from.
  9996. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9997. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9998. * @example
  9999. *
  10000. * _.includes([1, 2, 3], 1);
  10001. * // => true
  10002. *
  10003. * _.includes([1, 2, 3], 1, 2);
  10004. * // => false
  10005. *
  10006. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10007. * // => true
  10008. *
  10009. * _.includes('abcd', 'bc');
  10010. * // => true
  10011. */
  10012. function includes(collection, value, fromIndex, guard) {
  10013. collection = isArrayLike(collection) ? collection : values(collection);
  10014. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10015. var length = collection.length;
  10016. if (fromIndex < 0) {
  10017. fromIndex = nativeMax(length + fromIndex, 0);
  10018. }
  10019. return isString(collection)
  10020. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10021. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10022. }
  10023. /**
  10024. * Invokes the method at `path` of each element in `collection`, returning
  10025. * an array of the results of each invoked method. Any additional arguments
  10026. * are provided to each invoked method. If `path` is a function, it's invoked
  10027. * for, and `this` bound to, each element in `collection`.
  10028. *
  10029. * @static
  10030. * @memberOf _
  10031. * @since 4.0.0
  10032. * @category Collection
  10033. * @param {Array|Object} collection The collection to iterate over.
  10034. * @param {Array|Function|string} path The path of the method to invoke or
  10035. * the function invoked per iteration.
  10036. * @param {...*} [args] The arguments to invoke each method with.
  10037. * @returns {Array} Returns the array of results.
  10038. * @example
  10039. *
  10040. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10041. * // => [[1, 5, 7], [1, 2, 3]]
  10042. *
  10043. * _.invokeMap([123, 456], String.prototype.split, '');
  10044. * // => [['1', '2', '3'], ['4', '5', '6']]
  10045. */
  10046. var invokeMap = baseRest(function(collection, path, args) {
  10047. var index = -1,
  10048. isFunc = typeof path == 'function',
  10049. result = isArrayLike(collection) ? Array(collection.length) : [];
  10050. baseEach(collection, function(value) {
  10051. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10052. });
  10053. return result;
  10054. });
  10055. /**
  10056. * Creates an object composed of keys generated from the results of running
  10057. * each element of `collection` thru `iteratee`. The corresponding value of
  10058. * each key is the last element responsible for generating the key. The
  10059. * iteratee is invoked with one argument: (value).
  10060. *
  10061. * @static
  10062. * @memberOf _
  10063. * @since 4.0.0
  10064. * @category Collection
  10065. * @param {Array|Object} collection The collection to iterate over.
  10066. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10067. * @returns {Object} Returns the composed aggregate object.
  10068. * @example
  10069. *
  10070. * var array = [
  10071. * { 'dir': 'left', 'code': 97 },
  10072. * { 'dir': 'right', 'code': 100 }
  10073. * ];
  10074. *
  10075. * _.keyBy(array, function(o) {
  10076. * return String.fromCharCode(o.code);
  10077. * });
  10078. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10079. *
  10080. * _.keyBy(array, 'dir');
  10081. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10082. */
  10083. var keyBy = createAggregator(function(result, value, key) {
  10084. baseAssignValue(result, key, value);
  10085. });
  10086. /**
  10087. * Creates an array of values by running each element in `collection` thru
  10088. * `iteratee`. The iteratee is invoked with three arguments:
  10089. * (value, index|key, collection).
  10090. *
  10091. * Many lodash methods are guarded to work as iteratees for methods like
  10092. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10093. *
  10094. * The guarded methods are:
  10095. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10096. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10097. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10098. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10099. *
  10100. * @static
  10101. * @memberOf _
  10102. * @since 0.1.0
  10103. * @category Collection
  10104. * @param {Array|Object} collection The collection to iterate over.
  10105. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10106. * @returns {Array} Returns the new mapped array.
  10107. * @example
  10108. *
  10109. * function square(n) {
  10110. * return n * n;
  10111. * }
  10112. *
  10113. * _.map([4, 8], square);
  10114. * // => [16, 64]
  10115. *
  10116. * _.map({ 'a': 4, 'b': 8 }, square);
  10117. * // => [16, 64] (iteration order is not guaranteed)
  10118. *
  10119. * var users = [
  10120. * { 'user': 'barney' },
  10121. * { 'user': 'fred' }
  10122. * ];
  10123. *
  10124. * // The `_.property` iteratee shorthand.
  10125. * _.map(users, 'user');
  10126. * // => ['barney', 'fred']
  10127. */
  10128. function map(collection, iteratee) {
  10129. var func = isArray(collection) ? arrayMap : baseMap;
  10130. return func(collection, getIteratee(iteratee, 3));
  10131. }
  10132. /**
  10133. * This method is like `_.sortBy` except that it allows specifying the sort
  10134. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10135. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10136. * descending or "asc" for ascending sort order of corresponding values.
  10137. *
  10138. * @static
  10139. * @memberOf _
  10140. * @since 4.0.0
  10141. * @category Collection
  10142. * @param {Array|Object} collection The collection to iterate over.
  10143. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10144. * The iteratees to sort by.
  10145. * @param {string[]} [orders] The sort orders of `iteratees`.
  10146. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10147. * @returns {Array} Returns the new sorted array.
  10148. * @example
  10149. *
  10150. * var users = [
  10151. * { 'user': 'fred', 'age': 48 },
  10152. * { 'user': 'barney', 'age': 34 },
  10153. * { 'user': 'fred', 'age': 40 },
  10154. * { 'user': 'barney', 'age': 36 }
  10155. * ];
  10156. *
  10157. * // Sort by `user` in ascending order and by `age` in descending order.
  10158. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10159. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10160. */
  10161. function orderBy(collection, iteratees, orders, guard) {
  10162. if (collection == null) {
  10163. return [];
  10164. }
  10165. if (!isArray(iteratees)) {
  10166. iteratees = iteratees == null ? [] : [iteratees];
  10167. }
  10168. orders = guard ? undefined : orders;
  10169. if (!isArray(orders)) {
  10170. orders = orders == null ? [] : [orders];
  10171. }
  10172. return baseOrderBy(collection, iteratees, orders);
  10173. }
  10174. /**
  10175. * Creates an array of elements split into two groups, the first of which
  10176. * contains elements `predicate` returns truthy for, the second of which
  10177. * contains elements `predicate` returns falsey for. The predicate is
  10178. * invoked with one argument: (value).
  10179. *
  10180. * @static
  10181. * @memberOf _
  10182. * @since 3.0.0
  10183. * @category Collection
  10184. * @param {Array|Object} collection The collection to iterate over.
  10185. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10186. * @returns {Array} Returns the array of grouped elements.
  10187. * @example
  10188. *
  10189. * var users = [
  10190. * { 'user': 'barney', 'age': 36, 'active': false },
  10191. * { 'user': 'fred', 'age': 40, 'active': true },
  10192. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10193. * ];
  10194. *
  10195. * _.partition(users, function(o) { return o.active; });
  10196. * // => objects for [['fred'], ['barney', 'pebbles']]
  10197. *
  10198. * // The `_.matches` iteratee shorthand.
  10199. * _.partition(users, { 'age': 1, 'active': false });
  10200. * // => objects for [['pebbles'], ['barney', 'fred']]
  10201. *
  10202. * // The `_.matchesProperty` iteratee shorthand.
  10203. * _.partition(users, ['active', false]);
  10204. * // => objects for [['barney', 'pebbles'], ['fred']]
  10205. *
  10206. * // The `_.property` iteratee shorthand.
  10207. * _.partition(users, 'active');
  10208. * // => objects for [['fred'], ['barney', 'pebbles']]
  10209. */
  10210. var partition = createAggregator(function(result, value, key) {
  10211. result[key ? 0 : 1].push(value);
  10212. }, function() { return [[], []]; });
  10213. /**
  10214. * Reduces `collection` to a value which is the accumulated result of running
  10215. * each element in `collection` thru `iteratee`, where each successive
  10216. * invocation is supplied the return value of the previous. If `accumulator`
  10217. * is not given, the first element of `collection` is used as the initial
  10218. * value. The iteratee is invoked with four arguments:
  10219. * (accumulator, value, index|key, collection).
  10220. *
  10221. * Many lodash methods are guarded to work as iteratees for methods like
  10222. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10223. *
  10224. * The guarded methods are:
  10225. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10226. * and `sortBy`
  10227. *
  10228. * @static
  10229. * @memberOf _
  10230. * @since 0.1.0
  10231. * @category Collection
  10232. * @param {Array|Object} collection The collection to iterate over.
  10233. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10234. * @param {*} [accumulator] The initial value.
  10235. * @returns {*} Returns the accumulated value.
  10236. * @see _.reduceRight
  10237. * @example
  10238. *
  10239. * _.reduce([1, 2], function(sum, n) {
  10240. * return sum + n;
  10241. * }, 0);
  10242. * // => 3
  10243. *
  10244. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10245. * (result[value] || (result[value] = [])).push(key);
  10246. * return result;
  10247. * }, {});
  10248. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10249. */
  10250. function reduce(collection, iteratee, accumulator) {
  10251. var func = isArray(collection) ? arrayReduce : baseReduce,
  10252. initAccum = arguments.length < 3;
  10253. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10254. }
  10255. /**
  10256. * This method is like `_.reduce` except that it iterates over elements of
  10257. * `collection` from right to left.
  10258. *
  10259. * @static
  10260. * @memberOf _
  10261. * @since 0.1.0
  10262. * @category Collection
  10263. * @param {Array|Object} collection The collection to iterate over.
  10264. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10265. * @param {*} [accumulator] The initial value.
  10266. * @returns {*} Returns the accumulated value.
  10267. * @see _.reduce
  10268. * @example
  10269. *
  10270. * var array = [[0, 1], [2, 3], [4, 5]];
  10271. *
  10272. * _.reduceRight(array, function(flattened, other) {
  10273. * return flattened.concat(other);
  10274. * }, []);
  10275. * // => [4, 5, 2, 3, 0, 1]
  10276. */
  10277. function reduceRight(collection, iteratee, accumulator) {
  10278. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10279. initAccum = arguments.length < 3;
  10280. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10281. }
  10282. /**
  10283. * The opposite of `_.filter`; this method returns the elements of `collection`
  10284. * that `predicate` does **not** return truthy for.
  10285. *
  10286. * @static
  10287. * @memberOf _
  10288. * @since 0.1.0
  10289. * @category Collection
  10290. * @param {Array|Object} collection The collection to iterate over.
  10291. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10292. * @returns {Array} Returns the new filtered array.
  10293. * @see _.filter
  10294. * @example
  10295. *
  10296. * var users = [
  10297. * { 'user': 'barney', 'age': 36, 'active': false },
  10298. * { 'user': 'fred', 'age': 40, 'active': true }
  10299. * ];
  10300. *
  10301. * _.reject(users, function(o) { return !o.active; });
  10302. * // => objects for ['fred']
  10303. *
  10304. * // The `_.matches` iteratee shorthand.
  10305. * _.reject(users, { 'age': 40, 'active': true });
  10306. * // => objects for ['barney']
  10307. *
  10308. * // The `_.matchesProperty` iteratee shorthand.
  10309. * _.reject(users, ['active', false]);
  10310. * // => objects for ['fred']
  10311. *
  10312. * // The `_.property` iteratee shorthand.
  10313. * _.reject(users, 'active');
  10314. * // => objects for ['barney']
  10315. */
  10316. function reject(collection, predicate) {
  10317. var func = isArray(collection) ? arrayFilter : baseFilter;
  10318. return func(collection, negate(getIteratee(predicate, 3)));
  10319. }
  10320. /**
  10321. * Gets a random element from `collection`.
  10322. *
  10323. * @static
  10324. * @memberOf _
  10325. * @since 2.0.0
  10326. * @category Collection
  10327. * @param {Array|Object} collection The collection to sample.
  10328. * @returns {*} Returns the random element.
  10329. * @example
  10330. *
  10331. * _.sample([1, 2, 3, 4]);
  10332. * // => 2
  10333. */
  10334. function sample(collection) {
  10335. var func = isArray(collection) ? arraySample : baseSample;
  10336. return func(collection);
  10337. }
  10338. /**
  10339. * Gets `n` random elements at unique keys from `collection` up to the
  10340. * size of `collection`.
  10341. *
  10342. * @static
  10343. * @memberOf _
  10344. * @since 4.0.0
  10345. * @category Collection
  10346. * @param {Array|Object} collection The collection to sample.
  10347. * @param {number} [n=1] The number of elements to sample.
  10348. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10349. * @returns {Array} Returns the random elements.
  10350. * @example
  10351. *
  10352. * _.sampleSize([1, 2, 3], 2);
  10353. * // => [3, 1]
  10354. *
  10355. * _.sampleSize([1, 2, 3], 4);
  10356. * // => [2, 3, 1]
  10357. */
  10358. function sampleSize(collection, n, guard) {
  10359. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10360. n = 1;
  10361. } else {
  10362. n = toInteger(n);
  10363. }
  10364. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10365. return func(collection, n);
  10366. }
  10367. /**
  10368. * Creates an array of shuffled values, using a version of the
  10369. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10370. *
  10371. * @static
  10372. * @memberOf _
  10373. * @since 0.1.0
  10374. * @category Collection
  10375. * @param {Array|Object} collection The collection to shuffle.
  10376. * @returns {Array} Returns the new shuffled array.
  10377. * @example
  10378. *
  10379. * _.shuffle([1, 2, 3, 4]);
  10380. * // => [4, 1, 3, 2]
  10381. */
  10382. function shuffle(collection) {
  10383. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10384. return func(collection);
  10385. }
  10386. /**
  10387. * Gets the size of `collection` by returning its length for array-like
  10388. * values or the number of own enumerable string keyed properties for objects.
  10389. *
  10390. * @static
  10391. * @memberOf _
  10392. * @since 0.1.0
  10393. * @category Collection
  10394. * @param {Array|Object|string} collection The collection to inspect.
  10395. * @returns {number} Returns the collection size.
  10396. * @example
  10397. *
  10398. * _.size([1, 2, 3]);
  10399. * // => 3
  10400. *
  10401. * _.size({ 'a': 1, 'b': 2 });
  10402. * // => 2
  10403. *
  10404. * _.size('pebbles');
  10405. * // => 7
  10406. */
  10407. function size(collection) {
  10408. if (collection == null) {
  10409. return 0;
  10410. }
  10411. if (isArrayLike(collection)) {
  10412. return isString(collection) ? stringSize(collection) : collection.length;
  10413. }
  10414. var tag = getTag(collection);
  10415. if (tag == mapTag || tag == setTag) {
  10416. return collection.size;
  10417. }
  10418. return baseKeys(collection).length;
  10419. }
  10420. /**
  10421. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10422. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10423. * invoked with three arguments: (value, index|key, collection).
  10424. *
  10425. * @static
  10426. * @memberOf _
  10427. * @since 0.1.0
  10428. * @category Collection
  10429. * @param {Array|Object} collection The collection to iterate over.
  10430. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10431. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10432. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10433. * else `false`.
  10434. * @example
  10435. *
  10436. * _.some([null, 0, 'yes', false], Boolean);
  10437. * // => true
  10438. *
  10439. * var users = [
  10440. * { 'user': 'barney', 'active': true },
  10441. * { 'user': 'fred', 'active': false }
  10442. * ];
  10443. *
  10444. * // The `_.matches` iteratee shorthand.
  10445. * _.some(users, { 'user': 'barney', 'active': false });
  10446. * // => false
  10447. *
  10448. * // The `_.matchesProperty` iteratee shorthand.
  10449. * _.some(users, ['active', false]);
  10450. * // => true
  10451. *
  10452. * // The `_.property` iteratee shorthand.
  10453. * _.some(users, 'active');
  10454. * // => true
  10455. */
  10456. function some(collection, predicate, guard) {
  10457. var func = isArray(collection) ? arraySome : baseSome;
  10458. if (guard && isIterateeCall(collection, predicate, guard)) {
  10459. predicate = undefined;
  10460. }
  10461. return func(collection, getIteratee(predicate, 3));
  10462. }
  10463. /**
  10464. * Creates an array of elements, sorted in ascending order by the results of
  10465. * running each element in a collection thru each iteratee. This method
  10466. * performs a stable sort, that is, it preserves the original sort order of
  10467. * equal elements. The iteratees are invoked with one argument: (value).
  10468. *
  10469. * @static
  10470. * @memberOf _
  10471. * @since 0.1.0
  10472. * @category Collection
  10473. * @param {Array|Object} collection The collection to iterate over.
  10474. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10475. * The iteratees to sort by.
  10476. * @returns {Array} Returns the new sorted array.
  10477. * @example
  10478. *
  10479. * var users = [
  10480. * { 'user': 'fred', 'age': 48 },
  10481. * { 'user': 'barney', 'age': 36 },
  10482. * { 'user': 'fred', 'age': 30 },
  10483. * { 'user': 'barney', 'age': 34 }
  10484. * ];
  10485. *
  10486. * _.sortBy(users, [function(o) { return o.user; }]);
  10487. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10488. *
  10489. * _.sortBy(users, ['user', 'age']);
  10490. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10491. */
  10492. var sortBy = baseRest(function(collection, iteratees) {
  10493. if (collection == null) {
  10494. return [];
  10495. }
  10496. var length = iteratees.length;
  10497. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10498. iteratees = [];
  10499. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10500. iteratees = [iteratees[0]];
  10501. }
  10502. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10503. });
  10504. /*------------------------------------------------------------------------*/
  10505. /**
  10506. * Gets the timestamp of the number of milliseconds that have elapsed since
  10507. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10508. *
  10509. * @static
  10510. * @memberOf _
  10511. * @since 2.4.0
  10512. * @category Date
  10513. * @returns {number} Returns the timestamp.
  10514. * @example
  10515. *
  10516. * _.defer(function(stamp) {
  10517. * console.log(_.now() - stamp);
  10518. * }, _.now());
  10519. * // => Logs the number of milliseconds it took for the deferred invocation.
  10520. */
  10521. var now = ctxNow || function() {
  10522. return root.Date.now();
  10523. };
  10524. /*------------------------------------------------------------------------*/
  10525. /**
  10526. * The opposite of `_.before`; this method creates a function that invokes
  10527. * `func` once it's called `n` or more times.
  10528. *
  10529. * @static
  10530. * @memberOf _
  10531. * @since 0.1.0
  10532. * @category Function
  10533. * @param {number} n The number of calls before `func` is invoked.
  10534. * @param {Function} func The function to restrict.
  10535. * @returns {Function} Returns the new restricted function.
  10536. * @example
  10537. *
  10538. * var saves = ['profile', 'settings'];
  10539. *
  10540. * var done = _.after(saves.length, function() {
  10541. * console.log('done saving!');
  10542. * });
  10543. *
  10544. * _.forEach(saves, function(type) {
  10545. * asyncSave({ 'type': type, 'complete': done });
  10546. * });
  10547. * // => Logs 'done saving!' after the two async saves have completed.
  10548. */
  10549. function after(n, func) {
  10550. if (typeof func != 'function') {
  10551. throw new TypeError(FUNC_ERROR_TEXT);
  10552. }
  10553. n = toInteger(n);
  10554. return function() {
  10555. if (--n < 1) {
  10556. return func.apply(this, arguments);
  10557. }
  10558. };
  10559. }
  10560. /**
  10561. * Creates a function that invokes `func`, with up to `n` arguments,
  10562. * ignoring any additional arguments.
  10563. *
  10564. * @static
  10565. * @memberOf _
  10566. * @since 3.0.0
  10567. * @category Function
  10568. * @param {Function} func The function to cap arguments for.
  10569. * @param {number} [n=func.length] The arity cap.
  10570. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10571. * @returns {Function} Returns the new capped function.
  10572. * @example
  10573. *
  10574. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10575. * // => [6, 8, 10]
  10576. */
  10577. function ary(func, n, guard) {
  10578. n = guard ? undefined : n;
  10579. n = (func && n == null) ? func.length : n;
  10580. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10581. }
  10582. /**
  10583. * Creates a function that invokes `func`, with the `this` binding and arguments
  10584. * of the created function, while it's called less than `n` times. Subsequent
  10585. * calls to the created function return the result of the last `func` invocation.
  10586. *
  10587. * @static
  10588. * @memberOf _
  10589. * @since 3.0.0
  10590. * @category Function
  10591. * @param {number} n The number of calls at which `func` is no longer invoked.
  10592. * @param {Function} func The function to restrict.
  10593. * @returns {Function} Returns the new restricted function.
  10594. * @example
  10595. *
  10596. * jQuery(element).on('click', _.before(5, addContactToList));
  10597. * // => Allows adding up to 4 contacts to the list.
  10598. */
  10599. function before(n, func) {
  10600. var result;
  10601. if (typeof func != 'function') {
  10602. throw new TypeError(FUNC_ERROR_TEXT);
  10603. }
  10604. n = toInteger(n);
  10605. return function() {
  10606. if (--n > 0) {
  10607. result = func.apply(this, arguments);
  10608. }
  10609. if (n <= 1) {
  10610. func = undefined;
  10611. }
  10612. return result;
  10613. };
  10614. }
  10615. /**
  10616. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10617. * and `partials` prepended to the arguments it receives.
  10618. *
  10619. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10620. * may be used as a placeholder for partially applied arguments.
  10621. *
  10622. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10623. * property of bound functions.
  10624. *
  10625. * @static
  10626. * @memberOf _
  10627. * @since 0.1.0
  10628. * @category Function
  10629. * @param {Function} func The function to bind.
  10630. * @param {*} thisArg The `this` binding of `func`.
  10631. * @param {...*} [partials] The arguments to be partially applied.
  10632. * @returns {Function} Returns the new bound function.
  10633. * @example
  10634. *
  10635. * function greet(greeting, punctuation) {
  10636. * return greeting + ' ' + this.user + punctuation;
  10637. * }
  10638. *
  10639. * var object = { 'user': 'fred' };
  10640. *
  10641. * var bound = _.bind(greet, object, 'hi');
  10642. * bound('!');
  10643. * // => 'hi fred!'
  10644. *
  10645. * // Bound with placeholders.
  10646. * var bound = _.bind(greet, object, _, '!');
  10647. * bound('hi');
  10648. * // => 'hi fred!'
  10649. */
  10650. var bind = baseRest(function(func, thisArg, partials) {
  10651. var bitmask = WRAP_BIND_FLAG;
  10652. if (partials.length) {
  10653. var holders = replaceHolders(partials, getHolder(bind));
  10654. bitmask |= WRAP_PARTIAL_FLAG;
  10655. }
  10656. return createWrap(func, bitmask, thisArg, partials, holders);
  10657. });
  10658. /**
  10659. * Creates a function that invokes the method at `object[key]` with `partials`
  10660. * prepended to the arguments it receives.
  10661. *
  10662. * This method differs from `_.bind` by allowing bound functions to reference
  10663. * methods that may be redefined or don't yet exist. See
  10664. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10665. * for more details.
  10666. *
  10667. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10668. * builds, may be used as a placeholder for partially applied arguments.
  10669. *
  10670. * @static
  10671. * @memberOf _
  10672. * @since 0.10.0
  10673. * @category Function
  10674. * @param {Object} object The object to invoke the method on.
  10675. * @param {string} key The key of the method.
  10676. * @param {...*} [partials] The arguments to be partially applied.
  10677. * @returns {Function} Returns the new bound function.
  10678. * @example
  10679. *
  10680. * var object = {
  10681. * 'user': 'fred',
  10682. * 'greet': function(greeting, punctuation) {
  10683. * return greeting + ' ' + this.user + punctuation;
  10684. * }
  10685. * };
  10686. *
  10687. * var bound = _.bindKey(object, 'greet', 'hi');
  10688. * bound('!');
  10689. * // => 'hi fred!'
  10690. *
  10691. * object.greet = function(greeting, punctuation) {
  10692. * return greeting + 'ya ' + this.user + punctuation;
  10693. * };
  10694. *
  10695. * bound('!');
  10696. * // => 'hiya fred!'
  10697. *
  10698. * // Bound with placeholders.
  10699. * var bound = _.bindKey(object, 'greet', _, '!');
  10700. * bound('hi');
  10701. * // => 'hiya fred!'
  10702. */
  10703. var bindKey = baseRest(function(object, key, partials) {
  10704. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10705. if (partials.length) {
  10706. var holders = replaceHolders(partials, getHolder(bindKey));
  10707. bitmask |= WRAP_PARTIAL_FLAG;
  10708. }
  10709. return createWrap(key, bitmask, object, partials, holders);
  10710. });
  10711. /**
  10712. * Creates a function that accepts arguments of `func` and either invokes
  10713. * `func` returning its result, if at least `arity` number of arguments have
  10714. * been provided, or returns a function that accepts the remaining `func`
  10715. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10716. * is not sufficient.
  10717. *
  10718. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10719. * may be used as a placeholder for provided arguments.
  10720. *
  10721. * **Note:** This method doesn't set the "length" property of curried functions.
  10722. *
  10723. * @static
  10724. * @memberOf _
  10725. * @since 2.0.0
  10726. * @category Function
  10727. * @param {Function} func The function to curry.
  10728. * @param {number} [arity=func.length] The arity of `func`.
  10729. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10730. * @returns {Function} Returns the new curried function.
  10731. * @example
  10732. *
  10733. * var abc = function(a, b, c) {
  10734. * return [a, b, c];
  10735. * };
  10736. *
  10737. * var curried = _.curry(abc);
  10738. *
  10739. * curried(1)(2)(3);
  10740. * // => [1, 2, 3]
  10741. *
  10742. * curried(1, 2)(3);
  10743. * // => [1, 2, 3]
  10744. *
  10745. * curried(1, 2, 3);
  10746. * // => [1, 2, 3]
  10747. *
  10748. * // Curried with placeholders.
  10749. * curried(1)(_, 3)(2);
  10750. * // => [1, 2, 3]
  10751. */
  10752. function curry(func, arity, guard) {
  10753. arity = guard ? undefined : arity;
  10754. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10755. result.placeholder = curry.placeholder;
  10756. return result;
  10757. }
  10758. /**
  10759. * This method is like `_.curry` except that arguments are applied to `func`
  10760. * in the manner of `_.partialRight` instead of `_.partial`.
  10761. *
  10762. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10763. * builds, may be used as a placeholder for provided arguments.
  10764. *
  10765. * **Note:** This method doesn't set the "length" property of curried functions.
  10766. *
  10767. * @static
  10768. * @memberOf _
  10769. * @since 3.0.0
  10770. * @category Function
  10771. * @param {Function} func The function to curry.
  10772. * @param {number} [arity=func.length] The arity of `func`.
  10773. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10774. * @returns {Function} Returns the new curried function.
  10775. * @example
  10776. *
  10777. * var abc = function(a, b, c) {
  10778. * return [a, b, c];
  10779. * };
  10780. *
  10781. * var curried = _.curryRight(abc);
  10782. *
  10783. * curried(3)(2)(1);
  10784. * // => [1, 2, 3]
  10785. *
  10786. * curried(2, 3)(1);
  10787. * // => [1, 2, 3]
  10788. *
  10789. * curried(1, 2, 3);
  10790. * // => [1, 2, 3]
  10791. *
  10792. * // Curried with placeholders.
  10793. * curried(3)(1, _)(2);
  10794. * // => [1, 2, 3]
  10795. */
  10796. function curryRight(func, arity, guard) {
  10797. arity = guard ? undefined : arity;
  10798. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10799. result.placeholder = curryRight.placeholder;
  10800. return result;
  10801. }
  10802. /**
  10803. * Creates a debounced function that delays invoking `func` until after `wait`
  10804. * milliseconds have elapsed since the last time the debounced function was
  10805. * invoked. The debounced function comes with a `cancel` method to cancel
  10806. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10807. * Provide `options` to indicate whether `func` should be invoked on the
  10808. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10809. * with the last arguments provided to the debounced function. Subsequent
  10810. * calls to the debounced function return the result of the last `func`
  10811. * invocation.
  10812. *
  10813. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10814. * invoked on the trailing edge of the timeout only if the debounced function
  10815. * is invoked more than once during the `wait` timeout.
  10816. *
  10817. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10818. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10819. *
  10820. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10821. * for details over the differences between `_.debounce` and `_.throttle`.
  10822. *
  10823. * @static
  10824. * @memberOf _
  10825. * @since 0.1.0
  10826. * @category Function
  10827. * @param {Function} func The function to debounce.
  10828. * @param {number} [wait=0] The number of milliseconds to delay.
  10829. * @param {Object} [options={}] The options object.
  10830. * @param {boolean} [options.leading=false]
  10831. * Specify invoking on the leading edge of the timeout.
  10832. * @param {number} [options.maxWait]
  10833. * The maximum time `func` is allowed to be delayed before it's invoked.
  10834. * @param {boolean} [options.trailing=true]
  10835. * Specify invoking on the trailing edge of the timeout.
  10836. * @returns {Function} Returns the new debounced function.
  10837. * @example
  10838. *
  10839. * // Avoid costly calculations while the window size is in flux.
  10840. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10841. *
  10842. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10843. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10844. * 'leading': true,
  10845. * 'trailing': false
  10846. * }));
  10847. *
  10848. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10849. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10850. * var source = new EventSource('/stream');
  10851. * jQuery(source).on('message', debounced);
  10852. *
  10853. * // Cancel the trailing debounced invocation.
  10854. * jQuery(window).on('popstate', debounced.cancel);
  10855. */
  10856. function debounce(func, wait, options) {
  10857. var lastArgs,
  10858. lastThis,
  10859. maxWait,
  10860. result,
  10861. timerId,
  10862. lastCallTime,
  10863. lastInvokeTime = 0,
  10864. leading = false,
  10865. maxing = false,
  10866. trailing = true;
  10867. if (typeof func != 'function') {
  10868. throw new TypeError(FUNC_ERROR_TEXT);
  10869. }
  10870. wait = toNumber(wait) || 0;
  10871. if (isObject(options)) {
  10872. leading = !!options.leading;
  10873. maxing = 'maxWait' in options;
  10874. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10875. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10876. }
  10877. function invokeFunc(time) {
  10878. var args = lastArgs,
  10879. thisArg = lastThis;
  10880. lastArgs = lastThis = undefined;
  10881. lastInvokeTime = time;
  10882. result = func.apply(thisArg, args);
  10883. return result;
  10884. }
  10885. function leadingEdge(time) {
  10886. // Reset any `maxWait` timer.
  10887. lastInvokeTime = time;
  10888. // Start the timer for the trailing edge.
  10889. timerId = setTimeout(timerExpired, wait);
  10890. // Invoke the leading edge.
  10891. return leading ? invokeFunc(time) : result;
  10892. }
  10893. function remainingWait(time) {
  10894. var timeSinceLastCall = time - lastCallTime,
  10895. timeSinceLastInvoke = time - lastInvokeTime,
  10896. timeWaiting = wait - timeSinceLastCall;
  10897. return maxing
  10898. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10899. : timeWaiting;
  10900. }
  10901. function shouldInvoke(time) {
  10902. var timeSinceLastCall = time - lastCallTime,
  10903. timeSinceLastInvoke = time - lastInvokeTime;
  10904. // Either this is the first call, activity has stopped and we're at the
  10905. // trailing edge, the system time has gone backwards and we're treating
  10906. // it as the trailing edge, or we've hit the `maxWait` limit.
  10907. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10908. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10909. }
  10910. function timerExpired() {
  10911. var time = now();
  10912. if (shouldInvoke(time)) {
  10913. return trailingEdge(time);
  10914. }
  10915. // Restart the timer.
  10916. timerId = setTimeout(timerExpired, remainingWait(time));
  10917. }
  10918. function trailingEdge(time) {
  10919. timerId = undefined;
  10920. // Only invoke if we have `lastArgs` which means `func` has been
  10921. // debounced at least once.
  10922. if (trailing && lastArgs) {
  10923. return invokeFunc(time);
  10924. }
  10925. lastArgs = lastThis = undefined;
  10926. return result;
  10927. }
  10928. function cancel() {
  10929. if (timerId !== undefined) {
  10930. clearTimeout(timerId);
  10931. }
  10932. lastInvokeTime = 0;
  10933. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10934. }
  10935. function flush() {
  10936. return timerId === undefined ? result : trailingEdge(now());
  10937. }
  10938. function debounced() {
  10939. var time = now(),
  10940. isInvoking = shouldInvoke(time);
  10941. lastArgs = arguments;
  10942. lastThis = this;
  10943. lastCallTime = time;
  10944. if (isInvoking) {
  10945. if (timerId === undefined) {
  10946. return leadingEdge(lastCallTime);
  10947. }
  10948. if (maxing) {
  10949. // Handle invocations in a tight loop.
  10950. clearTimeout(timerId);
  10951. timerId = setTimeout(timerExpired, wait);
  10952. return invokeFunc(lastCallTime);
  10953. }
  10954. }
  10955. if (timerId === undefined) {
  10956. timerId = setTimeout(timerExpired, wait);
  10957. }
  10958. return result;
  10959. }
  10960. debounced.cancel = cancel;
  10961. debounced.flush = flush;
  10962. return debounced;
  10963. }
  10964. /**
  10965. * Defers invoking the `func` until the current call stack has cleared. Any
  10966. * additional arguments are provided to `func` when it's invoked.
  10967. *
  10968. * @static
  10969. * @memberOf _
  10970. * @since 0.1.0
  10971. * @category Function
  10972. * @param {Function} func The function to defer.
  10973. * @param {...*} [args] The arguments to invoke `func` with.
  10974. * @returns {number} Returns the timer id.
  10975. * @example
  10976. *
  10977. * _.defer(function(text) {
  10978. * console.log(text);
  10979. * }, 'deferred');
  10980. * // => Logs 'deferred' after one millisecond.
  10981. */
  10982. var defer = baseRest(function(func, args) {
  10983. return baseDelay(func, 1, args);
  10984. });
  10985. /**
  10986. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10987. * provided to `func` when it's invoked.
  10988. *
  10989. * @static
  10990. * @memberOf _
  10991. * @since 0.1.0
  10992. * @category Function
  10993. * @param {Function} func The function to delay.
  10994. * @param {number} wait The number of milliseconds to delay invocation.
  10995. * @param {...*} [args] The arguments to invoke `func` with.
  10996. * @returns {number} Returns the timer id.
  10997. * @example
  10998. *
  10999. * _.delay(function(text) {
  11000. * console.log(text);
  11001. * }, 1000, 'later');
  11002. * // => Logs 'later' after one second.
  11003. */
  11004. var delay = baseRest(function(func, wait, args) {
  11005. return baseDelay(func, toNumber(wait) || 0, args);
  11006. });
  11007. /**
  11008. * Creates a function that invokes `func` with arguments reversed.
  11009. *
  11010. * @static
  11011. * @memberOf _
  11012. * @since 4.0.0
  11013. * @category Function
  11014. * @param {Function} func The function to flip arguments for.
  11015. * @returns {Function} Returns the new flipped function.
  11016. * @example
  11017. *
  11018. * var flipped = _.flip(function() {
  11019. * return _.toArray(arguments);
  11020. * });
  11021. *
  11022. * flipped('a', 'b', 'c', 'd');
  11023. * // => ['d', 'c', 'b', 'a']
  11024. */
  11025. function flip(func) {
  11026. return createWrap(func, WRAP_FLIP_FLAG);
  11027. }
  11028. /**
  11029. * Creates a function that memoizes the result of `func`. If `resolver` is
  11030. * provided, it determines the cache key for storing the result based on the
  11031. * arguments provided to the memoized function. By default, the first argument
  11032. * provided to the memoized function is used as the map cache key. The `func`
  11033. * is invoked with the `this` binding of the memoized function.
  11034. *
  11035. * **Note:** The cache is exposed as the `cache` property on the memoized
  11036. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11037. * constructor with one whose instances implement the
  11038. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11039. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11040. *
  11041. * @static
  11042. * @memberOf _
  11043. * @since 0.1.0
  11044. * @category Function
  11045. * @param {Function} func The function to have its output memoized.
  11046. * @param {Function} [resolver] The function to resolve the cache key.
  11047. * @returns {Function} Returns the new memoized function.
  11048. * @example
  11049. *
  11050. * var object = { 'a': 1, 'b': 2 };
  11051. * var other = { 'c': 3, 'd': 4 };
  11052. *
  11053. * var values = _.memoize(_.values);
  11054. * values(object);
  11055. * // => [1, 2]
  11056. *
  11057. * values(other);
  11058. * // => [3, 4]
  11059. *
  11060. * object.a = 2;
  11061. * values(object);
  11062. * // => [1, 2]
  11063. *
  11064. * // Modify the result cache.
  11065. * values.cache.set(object, ['a', 'b']);
  11066. * values(object);
  11067. * // => ['a', 'b']
  11068. *
  11069. * // Replace `_.memoize.Cache`.
  11070. * _.memoize.Cache = WeakMap;
  11071. */
  11072. function memoize(func, resolver) {
  11073. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11074. throw new TypeError(FUNC_ERROR_TEXT);
  11075. }
  11076. var memoized = function() {
  11077. var args = arguments,
  11078. key = resolver ? resolver.apply(this, args) : args[0],
  11079. cache = memoized.cache;
  11080. if (cache.has(key)) {
  11081. return cache.get(key);
  11082. }
  11083. var result = func.apply(this, args);
  11084. memoized.cache = cache.set(key, result) || cache;
  11085. return result;
  11086. };
  11087. memoized.cache = new (memoize.Cache || MapCache);
  11088. return memoized;
  11089. }
  11090. // Expose `MapCache`.
  11091. memoize.Cache = MapCache;
  11092. /**
  11093. * Creates a function that negates the result of the predicate `func`. The
  11094. * `func` predicate is invoked with the `this` binding and arguments of the
  11095. * created function.
  11096. *
  11097. * @static
  11098. * @memberOf _
  11099. * @since 3.0.0
  11100. * @category Function
  11101. * @param {Function} predicate The predicate to negate.
  11102. * @returns {Function} Returns the new negated function.
  11103. * @example
  11104. *
  11105. * function isEven(n) {
  11106. * return n % 2 == 0;
  11107. * }
  11108. *
  11109. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11110. * // => [1, 3, 5]
  11111. */
  11112. function negate(predicate) {
  11113. if (typeof predicate != 'function') {
  11114. throw new TypeError(FUNC_ERROR_TEXT);
  11115. }
  11116. return function() {
  11117. var args = arguments;
  11118. switch (args.length) {
  11119. case 0: return !predicate.call(this);
  11120. case 1: return !predicate.call(this, args[0]);
  11121. case 2: return !predicate.call(this, args[0], args[1]);
  11122. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11123. }
  11124. return !predicate.apply(this, args);
  11125. };
  11126. }
  11127. /**
  11128. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11129. * to the function return the value of the first invocation. The `func` is
  11130. * invoked with the `this` binding and arguments of the created function.
  11131. *
  11132. * @static
  11133. * @memberOf _
  11134. * @since 0.1.0
  11135. * @category Function
  11136. * @param {Function} func The function to restrict.
  11137. * @returns {Function} Returns the new restricted function.
  11138. * @example
  11139. *
  11140. * var initialize = _.once(createApplication);
  11141. * initialize();
  11142. * initialize();
  11143. * // => `createApplication` is invoked once
  11144. */
  11145. function once(func) {
  11146. return before(2, func);
  11147. }
  11148. /**
  11149. * Creates a function that invokes `func` with its arguments transformed.
  11150. *
  11151. * @static
  11152. * @since 4.0.0
  11153. * @memberOf _
  11154. * @category Function
  11155. * @param {Function} func The function to wrap.
  11156. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11157. * The argument transforms.
  11158. * @returns {Function} Returns the new function.
  11159. * @example
  11160. *
  11161. * function doubled(n) {
  11162. * return n * 2;
  11163. * }
  11164. *
  11165. * function square(n) {
  11166. * return n * n;
  11167. * }
  11168. *
  11169. * var func = _.overArgs(function(x, y) {
  11170. * return [x, y];
  11171. * }, [square, doubled]);
  11172. *
  11173. * func(9, 3);
  11174. * // => [81, 6]
  11175. *
  11176. * func(10, 5);
  11177. * // => [100, 10]
  11178. */
  11179. var overArgs = castRest(function(func, transforms) {
  11180. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11181. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11182. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11183. var funcsLength = transforms.length;
  11184. return baseRest(function(args) {
  11185. var index = -1,
  11186. length = nativeMin(args.length, funcsLength);
  11187. while (++index < length) {
  11188. args[index] = transforms[index].call(this, args[index]);
  11189. }
  11190. return apply(func, this, args);
  11191. });
  11192. });
  11193. /**
  11194. * Creates a function that invokes `func` with `partials` prepended to the
  11195. * arguments it receives. This method is like `_.bind` except it does **not**
  11196. * alter the `this` binding.
  11197. *
  11198. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11199. * builds, may be used as a placeholder for partially applied arguments.
  11200. *
  11201. * **Note:** This method doesn't set the "length" property of partially
  11202. * applied functions.
  11203. *
  11204. * @static
  11205. * @memberOf _
  11206. * @since 0.2.0
  11207. * @category Function
  11208. * @param {Function} func The function to partially apply arguments to.
  11209. * @param {...*} [partials] The arguments to be partially applied.
  11210. * @returns {Function} Returns the new partially applied function.
  11211. * @example
  11212. *
  11213. * function greet(greeting, name) {
  11214. * return greeting + ' ' + name;
  11215. * }
  11216. *
  11217. * var sayHelloTo = _.partial(greet, 'hello');
  11218. * sayHelloTo('fred');
  11219. * // => 'hello fred'
  11220. *
  11221. * // Partially applied with placeholders.
  11222. * var greetFred = _.partial(greet, _, 'fred');
  11223. * greetFred('hi');
  11224. * // => 'hi fred'
  11225. */
  11226. var partial = baseRest(function(func, partials) {
  11227. var holders = replaceHolders(partials, getHolder(partial));
  11228. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11229. });
  11230. /**
  11231. * This method is like `_.partial` except that partially applied arguments
  11232. * are appended to the arguments it receives.
  11233. *
  11234. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11235. * builds, may be used as a placeholder for partially applied arguments.
  11236. *
  11237. * **Note:** This method doesn't set the "length" property of partially
  11238. * applied functions.
  11239. *
  11240. * @static
  11241. * @memberOf _
  11242. * @since 1.0.0
  11243. * @category Function
  11244. * @param {Function} func The function to partially apply arguments to.
  11245. * @param {...*} [partials] The arguments to be partially applied.
  11246. * @returns {Function} Returns the new partially applied function.
  11247. * @example
  11248. *
  11249. * function greet(greeting, name) {
  11250. * return greeting + ' ' + name;
  11251. * }
  11252. *
  11253. * var greetFred = _.partialRight(greet, 'fred');
  11254. * greetFred('hi');
  11255. * // => 'hi fred'
  11256. *
  11257. * // Partially applied with placeholders.
  11258. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11259. * sayHelloTo('fred');
  11260. * // => 'hello fred'
  11261. */
  11262. var partialRight = baseRest(function(func, partials) {
  11263. var holders = replaceHolders(partials, getHolder(partialRight));
  11264. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11265. });
  11266. /**
  11267. * Creates a function that invokes `func` with arguments arranged according
  11268. * to the specified `indexes` where the argument value at the first index is
  11269. * provided as the first argument, the argument value at the second index is
  11270. * provided as the second argument, and so on.
  11271. *
  11272. * @static
  11273. * @memberOf _
  11274. * @since 3.0.0
  11275. * @category Function
  11276. * @param {Function} func The function to rearrange arguments for.
  11277. * @param {...(number|number[])} indexes The arranged argument indexes.
  11278. * @returns {Function} Returns the new function.
  11279. * @example
  11280. *
  11281. * var rearged = _.rearg(function(a, b, c) {
  11282. * return [a, b, c];
  11283. * }, [2, 0, 1]);
  11284. *
  11285. * rearged('b', 'c', 'a')
  11286. * // => ['a', 'b', 'c']
  11287. */
  11288. var rearg = flatRest(function(func, indexes) {
  11289. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11290. });
  11291. /**
  11292. * Creates a function that invokes `func` with the `this` binding of the
  11293. * created function and arguments from `start` and beyond provided as
  11294. * an array.
  11295. *
  11296. * **Note:** This method is based on the
  11297. * [rest parameter](https://mdn.io/rest_parameters).
  11298. *
  11299. * @static
  11300. * @memberOf _
  11301. * @since 4.0.0
  11302. * @category Function
  11303. * @param {Function} func The function to apply a rest parameter to.
  11304. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11305. * @returns {Function} Returns the new function.
  11306. * @example
  11307. *
  11308. * var say = _.rest(function(what, names) {
  11309. * return what + ' ' + _.initial(names).join(', ') +
  11310. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11311. * });
  11312. *
  11313. * say('hello', 'fred', 'barney', 'pebbles');
  11314. * // => 'hello fred, barney, & pebbles'
  11315. */
  11316. function rest(func, start) {
  11317. if (typeof func != 'function') {
  11318. throw new TypeError(FUNC_ERROR_TEXT);
  11319. }
  11320. start = start === undefined ? start : toInteger(start);
  11321. return baseRest(func, start);
  11322. }
  11323. /**
  11324. * Creates a function that invokes `func` with the `this` binding of the
  11325. * create function and an array of arguments much like
  11326. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11327. *
  11328. * **Note:** This method is based on the
  11329. * [spread operator](https://mdn.io/spread_operator).
  11330. *
  11331. * @static
  11332. * @memberOf _
  11333. * @since 3.2.0
  11334. * @category Function
  11335. * @param {Function} func The function to spread arguments over.
  11336. * @param {number} [start=0] The start position of the spread.
  11337. * @returns {Function} Returns the new function.
  11338. * @example
  11339. *
  11340. * var say = _.spread(function(who, what) {
  11341. * return who + ' says ' + what;
  11342. * });
  11343. *
  11344. * say(['fred', 'hello']);
  11345. * // => 'fred says hello'
  11346. *
  11347. * var numbers = Promise.all([
  11348. * Promise.resolve(40),
  11349. * Promise.resolve(36)
  11350. * ]);
  11351. *
  11352. * numbers.then(_.spread(function(x, y) {
  11353. * return x + y;
  11354. * }));
  11355. * // => a Promise of 76
  11356. */
  11357. function spread(func, start) {
  11358. if (typeof func != 'function') {
  11359. throw new TypeError(FUNC_ERROR_TEXT);
  11360. }
  11361. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11362. return baseRest(function(args) {
  11363. var array = args[start],
  11364. otherArgs = castSlice(args, 0, start);
  11365. if (array) {
  11366. arrayPush(otherArgs, array);
  11367. }
  11368. return apply(func, this, otherArgs);
  11369. });
  11370. }
  11371. /**
  11372. * Creates a throttled function that only invokes `func` at most once per
  11373. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11374. * method to cancel delayed `func` invocations and a `flush` method to
  11375. * immediately invoke them. Provide `options` to indicate whether `func`
  11376. * should be invoked on the leading and/or trailing edge of the `wait`
  11377. * timeout. The `func` is invoked with the last arguments provided to the
  11378. * throttled function. Subsequent calls to the throttled function return the
  11379. * result of the last `func` invocation.
  11380. *
  11381. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11382. * invoked on the trailing edge of the timeout only if the throttled function
  11383. * is invoked more than once during the `wait` timeout.
  11384. *
  11385. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11386. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11387. *
  11388. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11389. * for details over the differences between `_.throttle` and `_.debounce`.
  11390. *
  11391. * @static
  11392. * @memberOf _
  11393. * @since 0.1.0
  11394. * @category Function
  11395. * @param {Function} func The function to throttle.
  11396. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11397. * @param {Object} [options={}] The options object.
  11398. * @param {boolean} [options.leading=true]
  11399. * Specify invoking on the leading edge of the timeout.
  11400. * @param {boolean} [options.trailing=true]
  11401. * Specify invoking on the trailing edge of the timeout.
  11402. * @returns {Function} Returns the new throttled function.
  11403. * @example
  11404. *
  11405. * // Avoid excessively updating the position while scrolling.
  11406. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11407. *
  11408. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11409. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11410. * jQuery(element).on('click', throttled);
  11411. *
  11412. * // Cancel the trailing throttled invocation.
  11413. * jQuery(window).on('popstate', throttled.cancel);
  11414. */
  11415. function throttle(func, wait, options) {
  11416. var leading = true,
  11417. trailing = true;
  11418. if (typeof func != 'function') {
  11419. throw new TypeError(FUNC_ERROR_TEXT);
  11420. }
  11421. if (isObject(options)) {
  11422. leading = 'leading' in options ? !!options.leading : leading;
  11423. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11424. }
  11425. return debounce(func, wait, {
  11426. 'leading': leading,
  11427. 'maxWait': wait,
  11428. 'trailing': trailing
  11429. });
  11430. }
  11431. /**
  11432. * Creates a function that accepts up to one argument, ignoring any
  11433. * additional arguments.
  11434. *
  11435. * @static
  11436. * @memberOf _
  11437. * @since 4.0.0
  11438. * @category Function
  11439. * @param {Function} func The function to cap arguments for.
  11440. * @returns {Function} Returns the new capped function.
  11441. * @example
  11442. *
  11443. * _.map(['6', '8', '10'], _.unary(parseInt));
  11444. * // => [6, 8, 10]
  11445. */
  11446. function unary(func) {
  11447. return ary(func, 1);
  11448. }
  11449. /**
  11450. * Creates a function that provides `value` to `wrapper` as its first
  11451. * argument. Any additional arguments provided to the function are appended
  11452. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11453. * binding of the created function.
  11454. *
  11455. * @static
  11456. * @memberOf _
  11457. * @since 0.1.0
  11458. * @category Function
  11459. * @param {*} value The value to wrap.
  11460. * @param {Function} [wrapper=identity] The wrapper function.
  11461. * @returns {Function} Returns the new function.
  11462. * @example
  11463. *
  11464. * var p = _.wrap(_.escape, function(func, text) {
  11465. * return '<p>' + func(text) + '</p>';
  11466. * });
  11467. *
  11468. * p('fred, barney, & pebbles');
  11469. * // => '<p>fred, barney, &amp; pebbles</p>'
  11470. */
  11471. function wrap(value, wrapper) {
  11472. return partial(castFunction(wrapper), value);
  11473. }
  11474. /*------------------------------------------------------------------------*/
  11475. /**
  11476. * Casts `value` as an array if it's not one.
  11477. *
  11478. * @static
  11479. * @memberOf _
  11480. * @since 4.4.0
  11481. * @category Lang
  11482. * @param {*} value The value to inspect.
  11483. * @returns {Array} Returns the cast array.
  11484. * @example
  11485. *
  11486. * _.castArray(1);
  11487. * // => [1]
  11488. *
  11489. * _.castArray({ 'a': 1 });
  11490. * // => [{ 'a': 1 }]
  11491. *
  11492. * _.castArray('abc');
  11493. * // => ['abc']
  11494. *
  11495. * _.castArray(null);
  11496. * // => [null]
  11497. *
  11498. * _.castArray(undefined);
  11499. * // => [undefined]
  11500. *
  11501. * _.castArray();
  11502. * // => []
  11503. *
  11504. * var array = [1, 2, 3];
  11505. * console.log(_.castArray(array) === array);
  11506. * // => true
  11507. */
  11508. function castArray() {
  11509. if (!arguments.length) {
  11510. return [];
  11511. }
  11512. var value = arguments[0];
  11513. return isArray(value) ? value : [value];
  11514. }
  11515. /**
  11516. * Creates a shallow clone of `value`.
  11517. *
  11518. * **Note:** This method is loosely based on the
  11519. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11520. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11521. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11522. * arrays. The own enumerable properties of `arguments` objects are cloned
  11523. * as plain objects. An empty object is returned for uncloneable values such
  11524. * as error objects, functions, DOM nodes, and WeakMaps.
  11525. *
  11526. * @static
  11527. * @memberOf _
  11528. * @since 0.1.0
  11529. * @category Lang
  11530. * @param {*} value The value to clone.
  11531. * @returns {*} Returns the cloned value.
  11532. * @see _.cloneDeep
  11533. * @example
  11534. *
  11535. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11536. *
  11537. * var shallow = _.clone(objects);
  11538. * console.log(shallow[0] === objects[0]);
  11539. * // => true
  11540. */
  11541. function clone(value) {
  11542. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11543. }
  11544. /**
  11545. * This method is like `_.clone` except that it accepts `customizer` which
  11546. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11547. * cloning is handled by the method instead. The `customizer` is invoked with
  11548. * up to four arguments; (value [, index|key, object, stack]).
  11549. *
  11550. * @static
  11551. * @memberOf _
  11552. * @since 4.0.0
  11553. * @category Lang
  11554. * @param {*} value The value to clone.
  11555. * @param {Function} [customizer] The function to customize cloning.
  11556. * @returns {*} Returns the cloned value.
  11557. * @see _.cloneDeepWith
  11558. * @example
  11559. *
  11560. * function customizer(value) {
  11561. * if (_.isElement(value)) {
  11562. * return value.cloneNode(false);
  11563. * }
  11564. * }
  11565. *
  11566. * var el = _.cloneWith(document.body, customizer);
  11567. *
  11568. * console.log(el === document.body);
  11569. * // => false
  11570. * console.log(el.nodeName);
  11571. * // => 'BODY'
  11572. * console.log(el.childNodes.length);
  11573. * // => 0
  11574. */
  11575. function cloneWith(value, customizer) {
  11576. customizer = typeof customizer == 'function' ? customizer : undefined;
  11577. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11578. }
  11579. /**
  11580. * This method is like `_.clone` except that it recursively clones `value`.
  11581. *
  11582. * @static
  11583. * @memberOf _
  11584. * @since 1.0.0
  11585. * @category Lang
  11586. * @param {*} value The value to recursively clone.
  11587. * @returns {*} Returns the deep cloned value.
  11588. * @see _.clone
  11589. * @example
  11590. *
  11591. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11592. *
  11593. * var deep = _.cloneDeep(objects);
  11594. * console.log(deep[0] === objects[0]);
  11595. * // => false
  11596. */
  11597. function cloneDeep(value) {
  11598. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11599. }
  11600. /**
  11601. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11602. *
  11603. * @static
  11604. * @memberOf _
  11605. * @since 4.0.0
  11606. * @category Lang
  11607. * @param {*} value The value to recursively clone.
  11608. * @param {Function} [customizer] The function to customize cloning.
  11609. * @returns {*} Returns the deep cloned value.
  11610. * @see _.cloneWith
  11611. * @example
  11612. *
  11613. * function customizer(value) {
  11614. * if (_.isElement(value)) {
  11615. * return value.cloneNode(true);
  11616. * }
  11617. * }
  11618. *
  11619. * var el = _.cloneDeepWith(document.body, customizer);
  11620. *
  11621. * console.log(el === document.body);
  11622. * // => false
  11623. * console.log(el.nodeName);
  11624. * // => 'BODY'
  11625. * console.log(el.childNodes.length);
  11626. * // => 20
  11627. */
  11628. function cloneDeepWith(value, customizer) {
  11629. customizer = typeof customizer == 'function' ? customizer : undefined;
  11630. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11631. }
  11632. /**
  11633. * Checks if `object` conforms to `source` by invoking the predicate
  11634. * properties of `source` with the corresponding property values of `object`.
  11635. *
  11636. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11637. * partially applied.
  11638. *
  11639. * @static
  11640. * @memberOf _
  11641. * @since 4.14.0
  11642. * @category Lang
  11643. * @param {Object} object The object to inspect.
  11644. * @param {Object} source The object of property predicates to conform to.
  11645. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11646. * @example
  11647. *
  11648. * var object = { 'a': 1, 'b': 2 };
  11649. *
  11650. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11651. * // => true
  11652. *
  11653. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11654. * // => false
  11655. */
  11656. function conformsTo(object, source) {
  11657. return source == null || baseConformsTo(object, source, keys(source));
  11658. }
  11659. /**
  11660. * Performs a
  11661. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11662. * comparison between two values to determine if they are equivalent.
  11663. *
  11664. * @static
  11665. * @memberOf _
  11666. * @since 4.0.0
  11667. * @category Lang
  11668. * @param {*} value The value to compare.
  11669. * @param {*} other The other value to compare.
  11670. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11671. * @example
  11672. *
  11673. * var object = { 'a': 1 };
  11674. * var other = { 'a': 1 };
  11675. *
  11676. * _.eq(object, object);
  11677. * // => true
  11678. *
  11679. * _.eq(object, other);
  11680. * // => false
  11681. *
  11682. * _.eq('a', 'a');
  11683. * // => true
  11684. *
  11685. * _.eq('a', Object('a'));
  11686. * // => false
  11687. *
  11688. * _.eq(NaN, NaN);
  11689. * // => true
  11690. */
  11691. function eq(value, other) {
  11692. return value === other || (value !== value && other !== other);
  11693. }
  11694. /**
  11695. * Checks if `value` is greater than `other`.
  11696. *
  11697. * @static
  11698. * @memberOf _
  11699. * @since 3.9.0
  11700. * @category Lang
  11701. * @param {*} value The value to compare.
  11702. * @param {*} other The other value to compare.
  11703. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11704. * else `false`.
  11705. * @see _.lt
  11706. * @example
  11707. *
  11708. * _.gt(3, 1);
  11709. * // => true
  11710. *
  11711. * _.gt(3, 3);
  11712. * // => false
  11713. *
  11714. * _.gt(1, 3);
  11715. * // => false
  11716. */
  11717. var gt = createRelationalOperation(baseGt);
  11718. /**
  11719. * Checks if `value` is greater than or equal to `other`.
  11720. *
  11721. * @static
  11722. * @memberOf _
  11723. * @since 3.9.0
  11724. * @category Lang
  11725. * @param {*} value The value to compare.
  11726. * @param {*} other The other value to compare.
  11727. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11728. * `other`, else `false`.
  11729. * @see _.lte
  11730. * @example
  11731. *
  11732. * _.gte(3, 1);
  11733. * // => true
  11734. *
  11735. * _.gte(3, 3);
  11736. * // => true
  11737. *
  11738. * _.gte(1, 3);
  11739. * // => false
  11740. */
  11741. var gte = createRelationalOperation(function(value, other) {
  11742. return value >= other;
  11743. });
  11744. /**
  11745. * Checks if `value` is likely an `arguments` object.
  11746. *
  11747. * @static
  11748. * @memberOf _
  11749. * @since 0.1.0
  11750. * @category Lang
  11751. * @param {*} value The value to check.
  11752. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11753. * else `false`.
  11754. * @example
  11755. *
  11756. * _.isArguments(function() { return arguments; }());
  11757. * // => true
  11758. *
  11759. * _.isArguments([1, 2, 3]);
  11760. * // => false
  11761. */
  11762. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11763. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11764. !propertyIsEnumerable.call(value, 'callee');
  11765. };
  11766. /**
  11767. * Checks if `value` is classified as an `Array` object.
  11768. *
  11769. * @static
  11770. * @memberOf _
  11771. * @since 0.1.0
  11772. * @category Lang
  11773. * @param {*} value The value to check.
  11774. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11775. * @example
  11776. *
  11777. * _.isArray([1, 2, 3]);
  11778. * // => true
  11779. *
  11780. * _.isArray(document.body.children);
  11781. * // => false
  11782. *
  11783. * _.isArray('abc');
  11784. * // => false
  11785. *
  11786. * _.isArray(_.noop);
  11787. * // => false
  11788. */
  11789. var isArray = Array.isArray;
  11790. /**
  11791. * Checks if `value` is classified as an `ArrayBuffer` object.
  11792. *
  11793. * @static
  11794. * @memberOf _
  11795. * @since 4.3.0
  11796. * @category Lang
  11797. * @param {*} value The value to check.
  11798. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11799. * @example
  11800. *
  11801. * _.isArrayBuffer(new ArrayBuffer(2));
  11802. * // => true
  11803. *
  11804. * _.isArrayBuffer(new Array(2));
  11805. * // => false
  11806. */
  11807. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11808. /**
  11809. * Checks if `value` is array-like. A value is considered array-like if it's
  11810. * not a function and has a `value.length` that's an integer greater than or
  11811. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11812. *
  11813. * @static
  11814. * @memberOf _
  11815. * @since 4.0.0
  11816. * @category Lang
  11817. * @param {*} value The value to check.
  11818. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11819. * @example
  11820. *
  11821. * _.isArrayLike([1, 2, 3]);
  11822. * // => true
  11823. *
  11824. * _.isArrayLike(document.body.children);
  11825. * // => true
  11826. *
  11827. * _.isArrayLike('abc');
  11828. * // => true
  11829. *
  11830. * _.isArrayLike(_.noop);
  11831. * // => false
  11832. */
  11833. function isArrayLike(value) {
  11834. return value != null && isLength(value.length) && !isFunction(value);
  11835. }
  11836. /**
  11837. * This method is like `_.isArrayLike` except that it also checks if `value`
  11838. * is an object.
  11839. *
  11840. * @static
  11841. * @memberOf _
  11842. * @since 4.0.0
  11843. * @category Lang
  11844. * @param {*} value The value to check.
  11845. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11846. * else `false`.
  11847. * @example
  11848. *
  11849. * _.isArrayLikeObject([1, 2, 3]);
  11850. * // => true
  11851. *
  11852. * _.isArrayLikeObject(document.body.children);
  11853. * // => true
  11854. *
  11855. * _.isArrayLikeObject('abc');
  11856. * // => false
  11857. *
  11858. * _.isArrayLikeObject(_.noop);
  11859. * // => false
  11860. */
  11861. function isArrayLikeObject(value) {
  11862. return isObjectLike(value) && isArrayLike(value);
  11863. }
  11864. /**
  11865. * Checks if `value` is classified as a boolean primitive or object.
  11866. *
  11867. * @static
  11868. * @memberOf _
  11869. * @since 0.1.0
  11870. * @category Lang
  11871. * @param {*} value The value to check.
  11872. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11873. * @example
  11874. *
  11875. * _.isBoolean(false);
  11876. * // => true
  11877. *
  11878. * _.isBoolean(null);
  11879. * // => false
  11880. */
  11881. function isBoolean(value) {
  11882. return value === true || value === false ||
  11883. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11884. }
  11885. /**
  11886. * Checks if `value` is a buffer.
  11887. *
  11888. * @static
  11889. * @memberOf _
  11890. * @since 4.3.0
  11891. * @category Lang
  11892. * @param {*} value The value to check.
  11893. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11894. * @example
  11895. *
  11896. * _.isBuffer(new Buffer(2));
  11897. * // => true
  11898. *
  11899. * _.isBuffer(new Uint8Array(2));
  11900. * // => false
  11901. */
  11902. var isBuffer = nativeIsBuffer || stubFalse;
  11903. /**
  11904. * Checks if `value` is classified as a `Date` object.
  11905. *
  11906. * @static
  11907. * @memberOf _
  11908. * @since 0.1.0
  11909. * @category Lang
  11910. * @param {*} value The value to check.
  11911. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11912. * @example
  11913. *
  11914. * _.isDate(new Date);
  11915. * // => true
  11916. *
  11917. * _.isDate('Mon April 23 2012');
  11918. * // => false
  11919. */
  11920. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11921. /**
  11922. * Checks if `value` is likely a DOM element.
  11923. *
  11924. * @static
  11925. * @memberOf _
  11926. * @since 0.1.0
  11927. * @category Lang
  11928. * @param {*} value The value to check.
  11929. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11930. * @example
  11931. *
  11932. * _.isElement(document.body);
  11933. * // => true
  11934. *
  11935. * _.isElement('<body>');
  11936. * // => false
  11937. */
  11938. function isElement(value) {
  11939. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11940. }
  11941. /**
  11942. * Checks if `value` is an empty object, collection, map, or set.
  11943. *
  11944. * Objects are considered empty if they have no own enumerable string keyed
  11945. * properties.
  11946. *
  11947. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11948. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11949. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11950. *
  11951. * @static
  11952. * @memberOf _
  11953. * @since 0.1.0
  11954. * @category Lang
  11955. * @param {*} value The value to check.
  11956. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11957. * @example
  11958. *
  11959. * _.isEmpty(null);
  11960. * // => true
  11961. *
  11962. * _.isEmpty(true);
  11963. * // => true
  11964. *
  11965. * _.isEmpty(1);
  11966. * // => true
  11967. *
  11968. * _.isEmpty([1, 2, 3]);
  11969. * // => false
  11970. *
  11971. * _.isEmpty({ 'a': 1 });
  11972. * // => false
  11973. */
  11974. function isEmpty(value) {
  11975. if (value == null) {
  11976. return true;
  11977. }
  11978. if (isArrayLike(value) &&
  11979. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11980. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11981. return !value.length;
  11982. }
  11983. var tag = getTag(value);
  11984. if (tag == mapTag || tag == setTag) {
  11985. return !value.size;
  11986. }
  11987. if (isPrototype(value)) {
  11988. return !baseKeys(value).length;
  11989. }
  11990. for (var key in value) {
  11991. if (hasOwnProperty.call(value, key)) {
  11992. return false;
  11993. }
  11994. }
  11995. return true;
  11996. }
  11997. /**
  11998. * Performs a deep comparison between two values to determine if they are
  11999. * equivalent.
  12000. *
  12001. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12002. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12003. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12004. * by their own, not inherited, enumerable properties. Functions and DOM
  12005. * nodes are compared by strict equality, i.e. `===`.
  12006. *
  12007. * @static
  12008. * @memberOf _
  12009. * @since 0.1.0
  12010. * @category Lang
  12011. * @param {*} value The value to compare.
  12012. * @param {*} other The other value to compare.
  12013. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12014. * @example
  12015. *
  12016. * var object = { 'a': 1 };
  12017. * var other = { 'a': 1 };
  12018. *
  12019. * _.isEqual(object, other);
  12020. * // => true
  12021. *
  12022. * object === other;
  12023. * // => false
  12024. */
  12025. function isEqual(value, other) {
  12026. return baseIsEqual(value, other);
  12027. }
  12028. /**
  12029. * This method is like `_.isEqual` except that it accepts `customizer` which
  12030. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12031. * are handled by the method instead. The `customizer` is invoked with up to
  12032. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12033. *
  12034. * @static
  12035. * @memberOf _
  12036. * @since 4.0.0
  12037. * @category Lang
  12038. * @param {*} value The value to compare.
  12039. * @param {*} other The other value to compare.
  12040. * @param {Function} [customizer] The function to customize comparisons.
  12041. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12042. * @example
  12043. *
  12044. * function isGreeting(value) {
  12045. * return /^h(?:i|ello)$/.test(value);
  12046. * }
  12047. *
  12048. * function customizer(objValue, othValue) {
  12049. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12050. * return true;
  12051. * }
  12052. * }
  12053. *
  12054. * var array = ['hello', 'goodbye'];
  12055. * var other = ['hi', 'goodbye'];
  12056. *
  12057. * _.isEqualWith(array, other, customizer);
  12058. * // => true
  12059. */
  12060. function isEqualWith(value, other, customizer) {
  12061. customizer = typeof customizer == 'function' ? customizer : undefined;
  12062. var result = customizer ? customizer(value, other) : undefined;
  12063. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12064. }
  12065. /**
  12066. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12067. * `SyntaxError`, `TypeError`, or `URIError` object.
  12068. *
  12069. * @static
  12070. * @memberOf _
  12071. * @since 3.0.0
  12072. * @category Lang
  12073. * @param {*} value The value to check.
  12074. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12075. * @example
  12076. *
  12077. * _.isError(new Error);
  12078. * // => true
  12079. *
  12080. * _.isError(Error);
  12081. * // => false
  12082. */
  12083. function isError(value) {
  12084. if (!isObjectLike(value)) {
  12085. return false;
  12086. }
  12087. var tag = baseGetTag(value);
  12088. return tag == errorTag || tag == domExcTag ||
  12089. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12090. }
  12091. /**
  12092. * Checks if `value` is a finite primitive number.
  12093. *
  12094. * **Note:** This method is based on
  12095. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12096. *
  12097. * @static
  12098. * @memberOf _
  12099. * @since 0.1.0
  12100. * @category Lang
  12101. * @param {*} value The value to check.
  12102. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12103. * @example
  12104. *
  12105. * _.isFinite(3);
  12106. * // => true
  12107. *
  12108. * _.isFinite(Number.MIN_VALUE);
  12109. * // => true
  12110. *
  12111. * _.isFinite(Infinity);
  12112. * // => false
  12113. *
  12114. * _.isFinite('3');
  12115. * // => false
  12116. */
  12117. function isFinite(value) {
  12118. return typeof value == 'number' && nativeIsFinite(value);
  12119. }
  12120. /**
  12121. * Checks if `value` is classified as a `Function` object.
  12122. *
  12123. * @static
  12124. * @memberOf _
  12125. * @since 0.1.0
  12126. * @category Lang
  12127. * @param {*} value The value to check.
  12128. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12129. * @example
  12130. *
  12131. * _.isFunction(_);
  12132. * // => true
  12133. *
  12134. * _.isFunction(/abc/);
  12135. * // => false
  12136. */
  12137. function isFunction(value) {
  12138. if (!isObject(value)) {
  12139. return false;
  12140. }
  12141. // The use of `Object#toString` avoids issues with the `typeof` operator
  12142. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12143. var tag = baseGetTag(value);
  12144. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12145. }
  12146. /**
  12147. * Checks if `value` is an integer.
  12148. *
  12149. * **Note:** This method is based on
  12150. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12151. *
  12152. * @static
  12153. * @memberOf _
  12154. * @since 4.0.0
  12155. * @category Lang
  12156. * @param {*} value The value to check.
  12157. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12158. * @example
  12159. *
  12160. * _.isInteger(3);
  12161. * // => true
  12162. *
  12163. * _.isInteger(Number.MIN_VALUE);
  12164. * // => false
  12165. *
  12166. * _.isInteger(Infinity);
  12167. * // => false
  12168. *
  12169. * _.isInteger('3');
  12170. * // => false
  12171. */
  12172. function isInteger(value) {
  12173. return typeof value == 'number' && value == toInteger(value);
  12174. }
  12175. /**
  12176. * Checks if `value` is a valid array-like length.
  12177. *
  12178. * **Note:** This method is loosely based on
  12179. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12180. *
  12181. * @static
  12182. * @memberOf _
  12183. * @since 4.0.0
  12184. * @category Lang
  12185. * @param {*} value The value to check.
  12186. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12187. * @example
  12188. *
  12189. * _.isLength(3);
  12190. * // => true
  12191. *
  12192. * _.isLength(Number.MIN_VALUE);
  12193. * // => false
  12194. *
  12195. * _.isLength(Infinity);
  12196. * // => false
  12197. *
  12198. * _.isLength('3');
  12199. * // => false
  12200. */
  12201. function isLength(value) {
  12202. return typeof value == 'number' &&
  12203. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12204. }
  12205. /**
  12206. * Checks if `value` is the
  12207. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12208. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12209. *
  12210. * @static
  12211. * @memberOf _
  12212. * @since 0.1.0
  12213. * @category Lang
  12214. * @param {*} value The value to check.
  12215. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12216. * @example
  12217. *
  12218. * _.isObject({});
  12219. * // => true
  12220. *
  12221. * _.isObject([1, 2, 3]);
  12222. * // => true
  12223. *
  12224. * _.isObject(_.noop);
  12225. * // => true
  12226. *
  12227. * _.isObject(null);
  12228. * // => false
  12229. */
  12230. function isObject(value) {
  12231. var type = typeof value;
  12232. return value != null && (type == 'object' || type == 'function');
  12233. }
  12234. /**
  12235. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12236. * and has a `typeof` result of "object".
  12237. *
  12238. * @static
  12239. * @memberOf _
  12240. * @since 4.0.0
  12241. * @category Lang
  12242. * @param {*} value The value to check.
  12243. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12244. * @example
  12245. *
  12246. * _.isObjectLike({});
  12247. * // => true
  12248. *
  12249. * _.isObjectLike([1, 2, 3]);
  12250. * // => true
  12251. *
  12252. * _.isObjectLike(_.noop);
  12253. * // => false
  12254. *
  12255. * _.isObjectLike(null);
  12256. * // => false
  12257. */
  12258. function isObjectLike(value) {
  12259. return value != null && typeof value == 'object';
  12260. }
  12261. /**
  12262. * Checks if `value` is classified as a `Map` object.
  12263. *
  12264. * @static
  12265. * @memberOf _
  12266. * @since 4.3.0
  12267. * @category Lang
  12268. * @param {*} value The value to check.
  12269. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12270. * @example
  12271. *
  12272. * _.isMap(new Map);
  12273. * // => true
  12274. *
  12275. * _.isMap(new WeakMap);
  12276. * // => false
  12277. */
  12278. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12279. /**
  12280. * Performs a partial deep comparison between `object` and `source` to
  12281. * determine if `object` contains equivalent property values.
  12282. *
  12283. * **Note:** This method is equivalent to `_.matches` when `source` is
  12284. * partially applied.
  12285. *
  12286. * Partial comparisons will match empty array and empty object `source`
  12287. * values against any array or object value, respectively. See `_.isEqual`
  12288. * for a list of supported value comparisons.
  12289. *
  12290. * @static
  12291. * @memberOf _
  12292. * @since 3.0.0
  12293. * @category Lang
  12294. * @param {Object} object The object to inspect.
  12295. * @param {Object} source The object of property values to match.
  12296. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12297. * @example
  12298. *
  12299. * var object = { 'a': 1, 'b': 2 };
  12300. *
  12301. * _.isMatch(object, { 'b': 2 });
  12302. * // => true
  12303. *
  12304. * _.isMatch(object, { 'b': 1 });
  12305. * // => false
  12306. */
  12307. function isMatch(object, source) {
  12308. return object === source || baseIsMatch(object, source, getMatchData(source));
  12309. }
  12310. /**
  12311. * This method is like `_.isMatch` except that it accepts `customizer` which
  12312. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12313. * are handled by the method instead. The `customizer` is invoked with five
  12314. * arguments: (objValue, srcValue, index|key, object, source).
  12315. *
  12316. * @static
  12317. * @memberOf _
  12318. * @since 4.0.0
  12319. * @category Lang
  12320. * @param {Object} object The object to inspect.
  12321. * @param {Object} source The object of property values to match.
  12322. * @param {Function} [customizer] The function to customize comparisons.
  12323. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12324. * @example
  12325. *
  12326. * function isGreeting(value) {
  12327. * return /^h(?:i|ello)$/.test(value);
  12328. * }
  12329. *
  12330. * function customizer(objValue, srcValue) {
  12331. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12332. * return true;
  12333. * }
  12334. * }
  12335. *
  12336. * var object = { 'greeting': 'hello' };
  12337. * var source = { 'greeting': 'hi' };
  12338. *
  12339. * _.isMatchWith(object, source, customizer);
  12340. * // => true
  12341. */
  12342. function isMatchWith(object, source, customizer) {
  12343. customizer = typeof customizer == 'function' ? customizer : undefined;
  12344. return baseIsMatch(object, source, getMatchData(source), customizer);
  12345. }
  12346. /**
  12347. * Checks if `value` is `NaN`.
  12348. *
  12349. * **Note:** This method is based on
  12350. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12351. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12352. * `undefined` and other non-number values.
  12353. *
  12354. * @static
  12355. * @memberOf _
  12356. * @since 0.1.0
  12357. * @category Lang
  12358. * @param {*} value The value to check.
  12359. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12360. * @example
  12361. *
  12362. * _.isNaN(NaN);
  12363. * // => true
  12364. *
  12365. * _.isNaN(new Number(NaN));
  12366. * // => true
  12367. *
  12368. * isNaN(undefined);
  12369. * // => true
  12370. *
  12371. * _.isNaN(undefined);
  12372. * // => false
  12373. */
  12374. function isNaN(value) {
  12375. // An `NaN` primitive is the only value that is not equal to itself.
  12376. // Perform the `toStringTag` check first to avoid errors with some
  12377. // ActiveX objects in IE.
  12378. return isNumber(value) && value != +value;
  12379. }
  12380. /**
  12381. * Checks if `value` is a pristine native function.
  12382. *
  12383. * **Note:** This method can't reliably detect native functions in the presence
  12384. * of the core-js package because core-js circumvents this kind of detection.
  12385. * Despite multiple requests, the core-js maintainer has made it clear: any
  12386. * attempt to fix the detection will be obstructed. As a result, we're left
  12387. * with little choice but to throw an error. Unfortunately, this also affects
  12388. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12389. * which rely on core-js.
  12390. *
  12391. * @static
  12392. * @memberOf _
  12393. * @since 3.0.0
  12394. * @category Lang
  12395. * @param {*} value The value to check.
  12396. * @returns {boolean} Returns `true` if `value` is a native function,
  12397. * else `false`.
  12398. * @example
  12399. *
  12400. * _.isNative(Array.prototype.push);
  12401. * // => true
  12402. *
  12403. * _.isNative(_);
  12404. * // => false
  12405. */
  12406. function isNative(value) {
  12407. if (isMaskable(value)) {
  12408. throw new Error(CORE_ERROR_TEXT);
  12409. }
  12410. return baseIsNative(value);
  12411. }
  12412. /**
  12413. * Checks if `value` is `null`.
  12414. *
  12415. * @static
  12416. * @memberOf _
  12417. * @since 0.1.0
  12418. * @category Lang
  12419. * @param {*} value The value to check.
  12420. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12421. * @example
  12422. *
  12423. * _.isNull(null);
  12424. * // => true
  12425. *
  12426. * _.isNull(void 0);
  12427. * // => false
  12428. */
  12429. function isNull(value) {
  12430. return value === null;
  12431. }
  12432. /**
  12433. * Checks if `value` is `null` or `undefined`.
  12434. *
  12435. * @static
  12436. * @memberOf _
  12437. * @since 4.0.0
  12438. * @category Lang
  12439. * @param {*} value The value to check.
  12440. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12441. * @example
  12442. *
  12443. * _.isNil(null);
  12444. * // => true
  12445. *
  12446. * _.isNil(void 0);
  12447. * // => true
  12448. *
  12449. * _.isNil(NaN);
  12450. * // => false
  12451. */
  12452. function isNil(value) {
  12453. return value == null;
  12454. }
  12455. /**
  12456. * Checks if `value` is classified as a `Number` primitive or object.
  12457. *
  12458. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12459. * classified as numbers, use the `_.isFinite` method.
  12460. *
  12461. * @static
  12462. * @memberOf _
  12463. * @since 0.1.0
  12464. * @category Lang
  12465. * @param {*} value The value to check.
  12466. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12467. * @example
  12468. *
  12469. * _.isNumber(3);
  12470. * // => true
  12471. *
  12472. * _.isNumber(Number.MIN_VALUE);
  12473. * // => true
  12474. *
  12475. * _.isNumber(Infinity);
  12476. * // => true
  12477. *
  12478. * _.isNumber('3');
  12479. * // => false
  12480. */
  12481. function isNumber(value) {
  12482. return typeof value == 'number' ||
  12483. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12484. }
  12485. /**
  12486. * Checks if `value` is a plain object, that is, an object created by the
  12487. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12488. *
  12489. * @static
  12490. * @memberOf _
  12491. * @since 0.8.0
  12492. * @category Lang
  12493. * @param {*} value The value to check.
  12494. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12495. * @example
  12496. *
  12497. * function Foo() {
  12498. * this.a = 1;
  12499. * }
  12500. *
  12501. * _.isPlainObject(new Foo);
  12502. * // => false
  12503. *
  12504. * _.isPlainObject([1, 2, 3]);
  12505. * // => false
  12506. *
  12507. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12508. * // => true
  12509. *
  12510. * _.isPlainObject(Object.create(null));
  12511. * // => true
  12512. */
  12513. function isPlainObject(value) {
  12514. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12515. return false;
  12516. }
  12517. var proto = getPrototype(value);
  12518. if (proto === null) {
  12519. return true;
  12520. }
  12521. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12522. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12523. funcToString.call(Ctor) == objectCtorString;
  12524. }
  12525. /**
  12526. * Checks if `value` is classified as a `RegExp` object.
  12527. *
  12528. * @static
  12529. * @memberOf _
  12530. * @since 0.1.0
  12531. * @category Lang
  12532. * @param {*} value The value to check.
  12533. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12534. * @example
  12535. *
  12536. * _.isRegExp(/abc/);
  12537. * // => true
  12538. *
  12539. * _.isRegExp('/abc/');
  12540. * // => false
  12541. */
  12542. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12543. /**
  12544. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12545. * double precision number which isn't the result of a rounded unsafe integer.
  12546. *
  12547. * **Note:** This method is based on
  12548. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12549. *
  12550. * @static
  12551. * @memberOf _
  12552. * @since 4.0.0
  12553. * @category Lang
  12554. * @param {*} value The value to check.
  12555. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12556. * @example
  12557. *
  12558. * _.isSafeInteger(3);
  12559. * // => true
  12560. *
  12561. * _.isSafeInteger(Number.MIN_VALUE);
  12562. * // => false
  12563. *
  12564. * _.isSafeInteger(Infinity);
  12565. * // => false
  12566. *
  12567. * _.isSafeInteger('3');
  12568. * // => false
  12569. */
  12570. function isSafeInteger(value) {
  12571. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12572. }
  12573. /**
  12574. * Checks if `value` is classified as a `Set` object.
  12575. *
  12576. * @static
  12577. * @memberOf _
  12578. * @since 4.3.0
  12579. * @category Lang
  12580. * @param {*} value The value to check.
  12581. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12582. * @example
  12583. *
  12584. * _.isSet(new Set);
  12585. * // => true
  12586. *
  12587. * _.isSet(new WeakSet);
  12588. * // => false
  12589. */
  12590. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12591. /**
  12592. * Checks if `value` is classified as a `String` primitive or object.
  12593. *
  12594. * @static
  12595. * @since 0.1.0
  12596. * @memberOf _
  12597. * @category Lang
  12598. * @param {*} value The value to check.
  12599. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12600. * @example
  12601. *
  12602. * _.isString('abc');
  12603. * // => true
  12604. *
  12605. * _.isString(1);
  12606. * // => false
  12607. */
  12608. function isString(value) {
  12609. return typeof value == 'string' ||
  12610. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12611. }
  12612. /**
  12613. * Checks if `value` is classified as a `Symbol` primitive or object.
  12614. *
  12615. * @static
  12616. * @memberOf _
  12617. * @since 4.0.0
  12618. * @category Lang
  12619. * @param {*} value The value to check.
  12620. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12621. * @example
  12622. *
  12623. * _.isSymbol(Symbol.iterator);
  12624. * // => true
  12625. *
  12626. * _.isSymbol('abc');
  12627. * // => false
  12628. */
  12629. function isSymbol(value) {
  12630. return typeof value == 'symbol' ||
  12631. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12632. }
  12633. /**
  12634. * Checks if `value` is classified as a typed array.
  12635. *
  12636. * @static
  12637. * @memberOf _
  12638. * @since 3.0.0
  12639. * @category Lang
  12640. * @param {*} value The value to check.
  12641. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12642. * @example
  12643. *
  12644. * _.isTypedArray(new Uint8Array);
  12645. * // => true
  12646. *
  12647. * _.isTypedArray([]);
  12648. * // => false
  12649. */
  12650. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12651. /**
  12652. * Checks if `value` is `undefined`.
  12653. *
  12654. * @static
  12655. * @since 0.1.0
  12656. * @memberOf _
  12657. * @category Lang
  12658. * @param {*} value The value to check.
  12659. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12660. * @example
  12661. *
  12662. * _.isUndefined(void 0);
  12663. * // => true
  12664. *
  12665. * _.isUndefined(null);
  12666. * // => false
  12667. */
  12668. function isUndefined(value) {
  12669. return value === undefined;
  12670. }
  12671. /**
  12672. * Checks if `value` is classified as a `WeakMap` object.
  12673. *
  12674. * @static
  12675. * @memberOf _
  12676. * @since 4.3.0
  12677. * @category Lang
  12678. * @param {*} value The value to check.
  12679. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12680. * @example
  12681. *
  12682. * _.isWeakMap(new WeakMap);
  12683. * // => true
  12684. *
  12685. * _.isWeakMap(new Map);
  12686. * // => false
  12687. */
  12688. function isWeakMap(value) {
  12689. return isObjectLike(value) && getTag(value) == weakMapTag;
  12690. }
  12691. /**
  12692. * Checks if `value` is classified as a `WeakSet` object.
  12693. *
  12694. * @static
  12695. * @memberOf _
  12696. * @since 4.3.0
  12697. * @category Lang
  12698. * @param {*} value The value to check.
  12699. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12700. * @example
  12701. *
  12702. * _.isWeakSet(new WeakSet);
  12703. * // => true
  12704. *
  12705. * _.isWeakSet(new Set);
  12706. * // => false
  12707. */
  12708. function isWeakSet(value) {
  12709. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12710. }
  12711. /**
  12712. * Checks if `value` is less than `other`.
  12713. *
  12714. * @static
  12715. * @memberOf _
  12716. * @since 3.9.0
  12717. * @category Lang
  12718. * @param {*} value The value to compare.
  12719. * @param {*} other The other value to compare.
  12720. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12721. * else `false`.
  12722. * @see _.gt
  12723. * @example
  12724. *
  12725. * _.lt(1, 3);
  12726. * // => true
  12727. *
  12728. * _.lt(3, 3);
  12729. * // => false
  12730. *
  12731. * _.lt(3, 1);
  12732. * // => false
  12733. */
  12734. var lt = createRelationalOperation(baseLt);
  12735. /**
  12736. * Checks if `value` is less than or equal to `other`.
  12737. *
  12738. * @static
  12739. * @memberOf _
  12740. * @since 3.9.0
  12741. * @category Lang
  12742. * @param {*} value The value to compare.
  12743. * @param {*} other The other value to compare.
  12744. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12745. * `other`, else `false`.
  12746. * @see _.gte
  12747. * @example
  12748. *
  12749. * _.lte(1, 3);
  12750. * // => true
  12751. *
  12752. * _.lte(3, 3);
  12753. * // => true
  12754. *
  12755. * _.lte(3, 1);
  12756. * // => false
  12757. */
  12758. var lte = createRelationalOperation(function(value, other) {
  12759. return value <= other;
  12760. });
  12761. /**
  12762. * Converts `value` to an array.
  12763. *
  12764. * @static
  12765. * @since 0.1.0
  12766. * @memberOf _
  12767. * @category Lang
  12768. * @param {*} value The value to convert.
  12769. * @returns {Array} Returns the converted array.
  12770. * @example
  12771. *
  12772. * _.toArray({ 'a': 1, 'b': 2 });
  12773. * // => [1, 2]
  12774. *
  12775. * _.toArray('abc');
  12776. * // => ['a', 'b', 'c']
  12777. *
  12778. * _.toArray(1);
  12779. * // => []
  12780. *
  12781. * _.toArray(null);
  12782. * // => []
  12783. */
  12784. function toArray(value) {
  12785. if (!value) {
  12786. return [];
  12787. }
  12788. if (isArrayLike(value)) {
  12789. return isString(value) ? stringToArray(value) : copyArray(value);
  12790. }
  12791. if (symIterator && value[symIterator]) {
  12792. return iteratorToArray(value[symIterator]());
  12793. }
  12794. var tag = getTag(value),
  12795. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12796. return func(value);
  12797. }
  12798. /**
  12799. * Converts `value` to a finite number.
  12800. *
  12801. * @static
  12802. * @memberOf _
  12803. * @since 4.12.0
  12804. * @category Lang
  12805. * @param {*} value The value to convert.
  12806. * @returns {number} Returns the converted number.
  12807. * @example
  12808. *
  12809. * _.toFinite(3.2);
  12810. * // => 3.2
  12811. *
  12812. * _.toFinite(Number.MIN_VALUE);
  12813. * // => 5e-324
  12814. *
  12815. * _.toFinite(Infinity);
  12816. * // => 1.7976931348623157e+308
  12817. *
  12818. * _.toFinite('3.2');
  12819. * // => 3.2
  12820. */
  12821. function toFinite(value) {
  12822. if (!value) {
  12823. return value === 0 ? value : 0;
  12824. }
  12825. value = toNumber(value);
  12826. if (value === INFINITY || value === -INFINITY) {
  12827. var sign = (value < 0 ? -1 : 1);
  12828. return sign * MAX_INTEGER;
  12829. }
  12830. return value === value ? value : 0;
  12831. }
  12832. /**
  12833. * Converts `value` to an integer.
  12834. *
  12835. * **Note:** This method is loosely based on
  12836. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12837. *
  12838. * @static
  12839. * @memberOf _
  12840. * @since 4.0.0
  12841. * @category Lang
  12842. * @param {*} value The value to convert.
  12843. * @returns {number} Returns the converted integer.
  12844. * @example
  12845. *
  12846. * _.toInteger(3.2);
  12847. * // => 3
  12848. *
  12849. * _.toInteger(Number.MIN_VALUE);
  12850. * // => 0
  12851. *
  12852. * _.toInteger(Infinity);
  12853. * // => 1.7976931348623157e+308
  12854. *
  12855. * _.toInteger('3.2');
  12856. * // => 3
  12857. */
  12858. function toInteger(value) {
  12859. var result = toFinite(value),
  12860. remainder = result % 1;
  12861. return result === result ? (remainder ? result - remainder : result) : 0;
  12862. }
  12863. /**
  12864. * Converts `value` to an integer suitable for use as the length of an
  12865. * array-like object.
  12866. *
  12867. * **Note:** This method is based on
  12868. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12869. *
  12870. * @static
  12871. * @memberOf _
  12872. * @since 4.0.0
  12873. * @category Lang
  12874. * @param {*} value The value to convert.
  12875. * @returns {number} Returns the converted integer.
  12876. * @example
  12877. *
  12878. * _.toLength(3.2);
  12879. * // => 3
  12880. *
  12881. * _.toLength(Number.MIN_VALUE);
  12882. * // => 0
  12883. *
  12884. * _.toLength(Infinity);
  12885. * // => 4294967295
  12886. *
  12887. * _.toLength('3.2');
  12888. * // => 3
  12889. */
  12890. function toLength(value) {
  12891. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12892. }
  12893. /**
  12894. * Converts `value` to a number.
  12895. *
  12896. * @static
  12897. * @memberOf _
  12898. * @since 4.0.0
  12899. * @category Lang
  12900. * @param {*} value The value to process.
  12901. * @returns {number} Returns the number.
  12902. * @example
  12903. *
  12904. * _.toNumber(3.2);
  12905. * // => 3.2
  12906. *
  12907. * _.toNumber(Number.MIN_VALUE);
  12908. * // => 5e-324
  12909. *
  12910. * _.toNumber(Infinity);
  12911. * // => Infinity
  12912. *
  12913. * _.toNumber('3.2');
  12914. * // => 3.2
  12915. */
  12916. function toNumber(value) {
  12917. if (typeof value == 'number') {
  12918. return value;
  12919. }
  12920. if (isSymbol(value)) {
  12921. return NAN;
  12922. }
  12923. if (isObject(value)) {
  12924. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12925. value = isObject(other) ? (other + '') : other;
  12926. }
  12927. if (typeof value != 'string') {
  12928. return value === 0 ? value : +value;
  12929. }
  12930. value = baseTrim(value);
  12931. var isBinary = reIsBinary.test(value);
  12932. return (isBinary || reIsOctal.test(value))
  12933. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12934. : (reIsBadHex.test(value) ? NAN : +value);
  12935. }
  12936. /**
  12937. * Converts `value` to a plain object flattening inherited enumerable string
  12938. * keyed properties of `value` to own properties of the plain object.
  12939. *
  12940. * @static
  12941. * @memberOf _
  12942. * @since 3.0.0
  12943. * @category Lang
  12944. * @param {*} value The value to convert.
  12945. * @returns {Object} Returns the converted plain object.
  12946. * @example
  12947. *
  12948. * function Foo() {
  12949. * this.b = 2;
  12950. * }
  12951. *
  12952. * Foo.prototype.c = 3;
  12953. *
  12954. * _.assign({ 'a': 1 }, new Foo);
  12955. * // => { 'a': 1, 'b': 2 }
  12956. *
  12957. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12958. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12959. */
  12960. function toPlainObject(value) {
  12961. return copyObject(value, keysIn(value));
  12962. }
  12963. /**
  12964. * Converts `value` to a safe integer. A safe integer can be compared and
  12965. * represented correctly.
  12966. *
  12967. * @static
  12968. * @memberOf _
  12969. * @since 4.0.0
  12970. * @category Lang
  12971. * @param {*} value The value to convert.
  12972. * @returns {number} Returns the converted integer.
  12973. * @example
  12974. *
  12975. * _.toSafeInteger(3.2);
  12976. * // => 3
  12977. *
  12978. * _.toSafeInteger(Number.MIN_VALUE);
  12979. * // => 0
  12980. *
  12981. * _.toSafeInteger(Infinity);
  12982. * // => 9007199254740991
  12983. *
  12984. * _.toSafeInteger('3.2');
  12985. * // => 3
  12986. */
  12987. function toSafeInteger(value) {
  12988. return value
  12989. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12990. : (value === 0 ? value : 0);
  12991. }
  12992. /**
  12993. * Converts `value` to a string. An empty string is returned for `null`
  12994. * and `undefined` values. The sign of `-0` is preserved.
  12995. *
  12996. * @static
  12997. * @memberOf _
  12998. * @since 4.0.0
  12999. * @category Lang
  13000. * @param {*} value The value to convert.
  13001. * @returns {string} Returns the converted string.
  13002. * @example
  13003. *
  13004. * _.toString(null);
  13005. * // => ''
  13006. *
  13007. * _.toString(-0);
  13008. * // => '-0'
  13009. *
  13010. * _.toString([1, 2, 3]);
  13011. * // => '1,2,3'
  13012. */
  13013. function toString(value) {
  13014. return value == null ? '' : baseToString(value);
  13015. }
  13016. /*------------------------------------------------------------------------*/
  13017. /**
  13018. * Assigns own enumerable string keyed properties of source objects to the
  13019. * destination object. Source objects are applied from left to right.
  13020. * Subsequent sources overwrite property assignments of previous sources.
  13021. *
  13022. * **Note:** This method mutates `object` and is loosely based on
  13023. * [`Object.assign`](https://mdn.io/Object/assign).
  13024. *
  13025. * @static
  13026. * @memberOf _
  13027. * @since 0.10.0
  13028. * @category Object
  13029. * @param {Object} object The destination object.
  13030. * @param {...Object} [sources] The source objects.
  13031. * @returns {Object} Returns `object`.
  13032. * @see _.assignIn
  13033. * @example
  13034. *
  13035. * function Foo() {
  13036. * this.a = 1;
  13037. * }
  13038. *
  13039. * function Bar() {
  13040. * this.c = 3;
  13041. * }
  13042. *
  13043. * Foo.prototype.b = 2;
  13044. * Bar.prototype.d = 4;
  13045. *
  13046. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13047. * // => { 'a': 1, 'c': 3 }
  13048. */
  13049. var assign = createAssigner(function(object, source) {
  13050. if (isPrototype(source) || isArrayLike(source)) {
  13051. copyObject(source, keys(source), object);
  13052. return;
  13053. }
  13054. for (var key in source) {
  13055. if (hasOwnProperty.call(source, key)) {
  13056. assignValue(object, key, source[key]);
  13057. }
  13058. }
  13059. });
  13060. /**
  13061. * This method is like `_.assign` except that it iterates over own and
  13062. * inherited source properties.
  13063. *
  13064. * **Note:** This method mutates `object`.
  13065. *
  13066. * @static
  13067. * @memberOf _
  13068. * @since 4.0.0
  13069. * @alias extend
  13070. * @category Object
  13071. * @param {Object} object The destination object.
  13072. * @param {...Object} [sources] The source objects.
  13073. * @returns {Object} Returns `object`.
  13074. * @see _.assign
  13075. * @example
  13076. *
  13077. * function Foo() {
  13078. * this.a = 1;
  13079. * }
  13080. *
  13081. * function Bar() {
  13082. * this.c = 3;
  13083. * }
  13084. *
  13085. * Foo.prototype.b = 2;
  13086. * Bar.prototype.d = 4;
  13087. *
  13088. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13089. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13090. */
  13091. var assignIn = createAssigner(function(object, source) {
  13092. copyObject(source, keysIn(source), object);
  13093. });
  13094. /**
  13095. * This method is like `_.assignIn` except that it accepts `customizer`
  13096. * which is invoked to produce the assigned values. If `customizer` returns
  13097. * `undefined`, assignment is handled by the method instead. The `customizer`
  13098. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13099. *
  13100. * **Note:** This method mutates `object`.
  13101. *
  13102. * @static
  13103. * @memberOf _
  13104. * @since 4.0.0
  13105. * @alias extendWith
  13106. * @category Object
  13107. * @param {Object} object The destination object.
  13108. * @param {...Object} sources The source objects.
  13109. * @param {Function} [customizer] The function to customize assigned values.
  13110. * @returns {Object} Returns `object`.
  13111. * @see _.assignWith
  13112. * @example
  13113. *
  13114. * function customizer(objValue, srcValue) {
  13115. * return _.isUndefined(objValue) ? srcValue : objValue;
  13116. * }
  13117. *
  13118. * var defaults = _.partialRight(_.assignInWith, customizer);
  13119. *
  13120. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13121. * // => { 'a': 1, 'b': 2 }
  13122. */
  13123. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13124. copyObject(source, keysIn(source), object, customizer);
  13125. });
  13126. /**
  13127. * This method is like `_.assign` except that it accepts `customizer`
  13128. * which is invoked to produce the assigned values. If `customizer` returns
  13129. * `undefined`, assignment is handled by the method instead. The `customizer`
  13130. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13131. *
  13132. * **Note:** This method mutates `object`.
  13133. *
  13134. * @static
  13135. * @memberOf _
  13136. * @since 4.0.0
  13137. * @category Object
  13138. * @param {Object} object The destination object.
  13139. * @param {...Object} sources The source objects.
  13140. * @param {Function} [customizer] The function to customize assigned values.
  13141. * @returns {Object} Returns `object`.
  13142. * @see _.assignInWith
  13143. * @example
  13144. *
  13145. * function customizer(objValue, srcValue) {
  13146. * return _.isUndefined(objValue) ? srcValue : objValue;
  13147. * }
  13148. *
  13149. * var defaults = _.partialRight(_.assignWith, customizer);
  13150. *
  13151. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13152. * // => { 'a': 1, 'b': 2 }
  13153. */
  13154. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13155. copyObject(source, keys(source), object, customizer);
  13156. });
  13157. /**
  13158. * Creates an array of values corresponding to `paths` of `object`.
  13159. *
  13160. * @static
  13161. * @memberOf _
  13162. * @since 1.0.0
  13163. * @category Object
  13164. * @param {Object} object The object to iterate over.
  13165. * @param {...(string|string[])} [paths] The property paths to pick.
  13166. * @returns {Array} Returns the picked values.
  13167. * @example
  13168. *
  13169. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13170. *
  13171. * _.at(object, ['a[0].b.c', 'a[1]']);
  13172. * // => [3, 4]
  13173. */
  13174. var at = flatRest(baseAt);
  13175. /**
  13176. * Creates an object that inherits from the `prototype` object. If a
  13177. * `properties` object is given, its own enumerable string keyed properties
  13178. * are assigned to the created object.
  13179. *
  13180. * @static
  13181. * @memberOf _
  13182. * @since 2.3.0
  13183. * @category Object
  13184. * @param {Object} prototype The object to inherit from.
  13185. * @param {Object} [properties] The properties to assign to the object.
  13186. * @returns {Object} Returns the new object.
  13187. * @example
  13188. *
  13189. * function Shape() {
  13190. * this.x = 0;
  13191. * this.y = 0;
  13192. * }
  13193. *
  13194. * function Circle() {
  13195. * Shape.call(this);
  13196. * }
  13197. *
  13198. * Circle.prototype = _.create(Shape.prototype, {
  13199. * 'constructor': Circle
  13200. * });
  13201. *
  13202. * var circle = new Circle;
  13203. * circle instanceof Circle;
  13204. * // => true
  13205. *
  13206. * circle instanceof Shape;
  13207. * // => true
  13208. */
  13209. function create(prototype, properties) {
  13210. var result = baseCreate(prototype);
  13211. return properties == null ? result : baseAssign(result, properties);
  13212. }
  13213. /**
  13214. * Assigns own and inherited enumerable string keyed properties of source
  13215. * objects to the destination object for all destination properties that
  13216. * resolve to `undefined`. Source objects are applied from left to right.
  13217. * Once a property is set, additional values of the same property are ignored.
  13218. *
  13219. * **Note:** This method mutates `object`.
  13220. *
  13221. * @static
  13222. * @since 0.1.0
  13223. * @memberOf _
  13224. * @category Object
  13225. * @param {Object} object The destination object.
  13226. * @param {...Object} [sources] The source objects.
  13227. * @returns {Object} Returns `object`.
  13228. * @see _.defaultsDeep
  13229. * @example
  13230. *
  13231. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13232. * // => { 'a': 1, 'b': 2 }
  13233. */
  13234. var defaults = baseRest(function(object, sources) {
  13235. object = Object(object);
  13236. var index = -1;
  13237. var length = sources.length;
  13238. var guard = length > 2 ? sources[2] : undefined;
  13239. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13240. length = 1;
  13241. }
  13242. while (++index < length) {
  13243. var source = sources[index];
  13244. var props = keysIn(source);
  13245. var propsIndex = -1;
  13246. var propsLength = props.length;
  13247. while (++propsIndex < propsLength) {
  13248. var key = props[propsIndex];
  13249. var value = object[key];
  13250. if (value === undefined ||
  13251. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13252. object[key] = source[key];
  13253. }
  13254. }
  13255. }
  13256. return object;
  13257. });
  13258. /**
  13259. * This method is like `_.defaults` except that it recursively assigns
  13260. * default properties.
  13261. *
  13262. * **Note:** This method mutates `object`.
  13263. *
  13264. * @static
  13265. * @memberOf _
  13266. * @since 3.10.0
  13267. * @category Object
  13268. * @param {Object} object The destination object.
  13269. * @param {...Object} [sources] The source objects.
  13270. * @returns {Object} Returns `object`.
  13271. * @see _.defaults
  13272. * @example
  13273. *
  13274. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13275. * // => { 'a': { 'b': 2, 'c': 3 } }
  13276. */
  13277. var defaultsDeep = baseRest(function(args) {
  13278. args.push(undefined, customDefaultsMerge);
  13279. return apply(mergeWith, undefined, args);
  13280. });
  13281. /**
  13282. * This method is like `_.find` except that it returns the key of the first
  13283. * element `predicate` returns truthy for instead of the element itself.
  13284. *
  13285. * @static
  13286. * @memberOf _
  13287. * @since 1.1.0
  13288. * @category Object
  13289. * @param {Object} object The object to inspect.
  13290. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13291. * @returns {string|undefined} Returns the key of the matched element,
  13292. * else `undefined`.
  13293. * @example
  13294. *
  13295. * var users = {
  13296. * 'barney': { 'age': 36, 'active': true },
  13297. * 'fred': { 'age': 40, 'active': false },
  13298. * 'pebbles': { 'age': 1, 'active': true }
  13299. * };
  13300. *
  13301. * _.findKey(users, function(o) { return o.age < 40; });
  13302. * // => 'barney' (iteration order is not guaranteed)
  13303. *
  13304. * // The `_.matches` iteratee shorthand.
  13305. * _.findKey(users, { 'age': 1, 'active': true });
  13306. * // => 'pebbles'
  13307. *
  13308. * // The `_.matchesProperty` iteratee shorthand.
  13309. * _.findKey(users, ['active', false]);
  13310. * // => 'fred'
  13311. *
  13312. * // The `_.property` iteratee shorthand.
  13313. * _.findKey(users, 'active');
  13314. * // => 'barney'
  13315. */
  13316. function findKey(object, predicate) {
  13317. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13318. }
  13319. /**
  13320. * This method is like `_.findKey` except that it iterates over elements of
  13321. * a collection in the opposite order.
  13322. *
  13323. * @static
  13324. * @memberOf _
  13325. * @since 2.0.0
  13326. * @category Object
  13327. * @param {Object} object The object to inspect.
  13328. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13329. * @returns {string|undefined} Returns the key of the matched element,
  13330. * else `undefined`.
  13331. * @example
  13332. *
  13333. * var users = {
  13334. * 'barney': { 'age': 36, 'active': true },
  13335. * 'fred': { 'age': 40, 'active': false },
  13336. * 'pebbles': { 'age': 1, 'active': true }
  13337. * };
  13338. *
  13339. * _.findLastKey(users, function(o) { return o.age < 40; });
  13340. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13341. *
  13342. * // The `_.matches` iteratee shorthand.
  13343. * _.findLastKey(users, { 'age': 36, 'active': true });
  13344. * // => 'barney'
  13345. *
  13346. * // The `_.matchesProperty` iteratee shorthand.
  13347. * _.findLastKey(users, ['active', false]);
  13348. * // => 'fred'
  13349. *
  13350. * // The `_.property` iteratee shorthand.
  13351. * _.findLastKey(users, 'active');
  13352. * // => 'pebbles'
  13353. */
  13354. function findLastKey(object, predicate) {
  13355. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13356. }
  13357. /**
  13358. * Iterates over own and inherited enumerable string keyed properties of an
  13359. * object and invokes `iteratee` for each property. The iteratee is invoked
  13360. * with three arguments: (value, key, object). Iteratee functions may exit
  13361. * iteration early by explicitly returning `false`.
  13362. *
  13363. * @static
  13364. * @memberOf _
  13365. * @since 0.3.0
  13366. * @category Object
  13367. * @param {Object} object The object to iterate over.
  13368. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13369. * @returns {Object} Returns `object`.
  13370. * @see _.forInRight
  13371. * @example
  13372. *
  13373. * function Foo() {
  13374. * this.a = 1;
  13375. * this.b = 2;
  13376. * }
  13377. *
  13378. * Foo.prototype.c = 3;
  13379. *
  13380. * _.forIn(new Foo, function(value, key) {
  13381. * console.log(key);
  13382. * });
  13383. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13384. */
  13385. function forIn(object, iteratee) {
  13386. return object == null
  13387. ? object
  13388. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13389. }
  13390. /**
  13391. * This method is like `_.forIn` except that it iterates over properties of
  13392. * `object` in the opposite order.
  13393. *
  13394. * @static
  13395. * @memberOf _
  13396. * @since 2.0.0
  13397. * @category Object
  13398. * @param {Object} object The object to iterate over.
  13399. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13400. * @returns {Object} Returns `object`.
  13401. * @see _.forIn
  13402. * @example
  13403. *
  13404. * function Foo() {
  13405. * this.a = 1;
  13406. * this.b = 2;
  13407. * }
  13408. *
  13409. * Foo.prototype.c = 3;
  13410. *
  13411. * _.forInRight(new Foo, function(value, key) {
  13412. * console.log(key);
  13413. * });
  13414. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13415. */
  13416. function forInRight(object, iteratee) {
  13417. return object == null
  13418. ? object
  13419. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13420. }
  13421. /**
  13422. * Iterates over own enumerable string keyed properties of an object and
  13423. * invokes `iteratee` for each property. The iteratee is invoked with three
  13424. * arguments: (value, key, object). Iteratee functions may exit iteration
  13425. * early by explicitly returning `false`.
  13426. *
  13427. * @static
  13428. * @memberOf _
  13429. * @since 0.3.0
  13430. * @category Object
  13431. * @param {Object} object The object to iterate over.
  13432. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13433. * @returns {Object} Returns `object`.
  13434. * @see _.forOwnRight
  13435. * @example
  13436. *
  13437. * function Foo() {
  13438. * this.a = 1;
  13439. * this.b = 2;
  13440. * }
  13441. *
  13442. * Foo.prototype.c = 3;
  13443. *
  13444. * _.forOwn(new Foo, function(value, key) {
  13445. * console.log(key);
  13446. * });
  13447. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13448. */
  13449. function forOwn(object, iteratee) {
  13450. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13451. }
  13452. /**
  13453. * This method is like `_.forOwn` except that it iterates over properties of
  13454. * `object` in the opposite order.
  13455. *
  13456. * @static
  13457. * @memberOf _
  13458. * @since 2.0.0
  13459. * @category Object
  13460. * @param {Object} object The object to iterate over.
  13461. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13462. * @returns {Object} Returns `object`.
  13463. * @see _.forOwn
  13464. * @example
  13465. *
  13466. * function Foo() {
  13467. * this.a = 1;
  13468. * this.b = 2;
  13469. * }
  13470. *
  13471. * Foo.prototype.c = 3;
  13472. *
  13473. * _.forOwnRight(new Foo, function(value, key) {
  13474. * console.log(key);
  13475. * });
  13476. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13477. */
  13478. function forOwnRight(object, iteratee) {
  13479. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13480. }
  13481. /**
  13482. * Creates an array of function property names from own enumerable properties
  13483. * of `object`.
  13484. *
  13485. * @static
  13486. * @since 0.1.0
  13487. * @memberOf _
  13488. * @category Object
  13489. * @param {Object} object The object to inspect.
  13490. * @returns {Array} Returns the function names.
  13491. * @see _.functionsIn
  13492. * @example
  13493. *
  13494. * function Foo() {
  13495. * this.a = _.constant('a');
  13496. * this.b = _.constant('b');
  13497. * }
  13498. *
  13499. * Foo.prototype.c = _.constant('c');
  13500. *
  13501. * _.functions(new Foo);
  13502. * // => ['a', 'b']
  13503. */
  13504. function functions(object) {
  13505. return object == null ? [] : baseFunctions(object, keys(object));
  13506. }
  13507. /**
  13508. * Creates an array of function property names from own and inherited
  13509. * enumerable properties of `object`.
  13510. *
  13511. * @static
  13512. * @memberOf _
  13513. * @since 4.0.0
  13514. * @category Object
  13515. * @param {Object} object The object to inspect.
  13516. * @returns {Array} Returns the function names.
  13517. * @see _.functions
  13518. * @example
  13519. *
  13520. * function Foo() {
  13521. * this.a = _.constant('a');
  13522. * this.b = _.constant('b');
  13523. * }
  13524. *
  13525. * Foo.prototype.c = _.constant('c');
  13526. *
  13527. * _.functionsIn(new Foo);
  13528. * // => ['a', 'b', 'c']
  13529. */
  13530. function functionsIn(object) {
  13531. return object == null ? [] : baseFunctions(object, keysIn(object));
  13532. }
  13533. /**
  13534. * Gets the value at `path` of `object`. If the resolved value is
  13535. * `undefined`, the `defaultValue` is returned in its place.
  13536. *
  13537. * @static
  13538. * @memberOf _
  13539. * @since 3.7.0
  13540. * @category Object
  13541. * @param {Object} object The object to query.
  13542. * @param {Array|string} path The path of the property to get.
  13543. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13544. * @returns {*} Returns the resolved value.
  13545. * @example
  13546. *
  13547. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13548. *
  13549. * _.get(object, 'a[0].b.c');
  13550. * // => 3
  13551. *
  13552. * _.get(object, ['a', '0', 'b', 'c']);
  13553. * // => 3
  13554. *
  13555. * _.get(object, 'a.b.c', 'default');
  13556. * // => 'default'
  13557. */
  13558. function get(object, path, defaultValue) {
  13559. var result = object == null ? undefined : baseGet(object, path);
  13560. return result === undefined ? defaultValue : result;
  13561. }
  13562. /**
  13563. * Checks if `path` is a direct property of `object`.
  13564. *
  13565. * @static
  13566. * @since 0.1.0
  13567. * @memberOf _
  13568. * @category Object
  13569. * @param {Object} object The object to query.
  13570. * @param {Array|string} path The path to check.
  13571. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13572. * @example
  13573. *
  13574. * var object = { 'a': { 'b': 2 } };
  13575. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13576. *
  13577. * _.has(object, 'a');
  13578. * // => true
  13579. *
  13580. * _.has(object, 'a.b');
  13581. * // => true
  13582. *
  13583. * _.has(object, ['a', 'b']);
  13584. * // => true
  13585. *
  13586. * _.has(other, 'a');
  13587. * // => false
  13588. */
  13589. function has(object, path) {
  13590. return object != null && hasPath(object, path, baseHas);
  13591. }
  13592. /**
  13593. * Checks if `path` is a direct or inherited property of `object`.
  13594. *
  13595. * @static
  13596. * @memberOf _
  13597. * @since 4.0.0
  13598. * @category Object
  13599. * @param {Object} object The object to query.
  13600. * @param {Array|string} path The path to check.
  13601. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13602. * @example
  13603. *
  13604. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13605. *
  13606. * _.hasIn(object, 'a');
  13607. * // => true
  13608. *
  13609. * _.hasIn(object, 'a.b');
  13610. * // => true
  13611. *
  13612. * _.hasIn(object, ['a', 'b']);
  13613. * // => true
  13614. *
  13615. * _.hasIn(object, 'b');
  13616. * // => false
  13617. */
  13618. function hasIn(object, path) {
  13619. return object != null && hasPath(object, path, baseHasIn);
  13620. }
  13621. /**
  13622. * Creates an object composed of the inverted keys and values of `object`.
  13623. * If `object` contains duplicate values, subsequent values overwrite
  13624. * property assignments of previous values.
  13625. *
  13626. * @static
  13627. * @memberOf _
  13628. * @since 0.7.0
  13629. * @category Object
  13630. * @param {Object} object The object to invert.
  13631. * @returns {Object} Returns the new inverted object.
  13632. * @example
  13633. *
  13634. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13635. *
  13636. * _.invert(object);
  13637. * // => { '1': 'c', '2': 'b' }
  13638. */
  13639. var invert = createInverter(function(result, value, key) {
  13640. if (value != null &&
  13641. typeof value.toString != 'function') {
  13642. value = nativeObjectToString.call(value);
  13643. }
  13644. result[value] = key;
  13645. }, constant(identity));
  13646. /**
  13647. * This method is like `_.invert` except that the inverted object is generated
  13648. * from the results of running each element of `object` thru `iteratee`. The
  13649. * corresponding inverted value of each inverted key is an array of keys
  13650. * responsible for generating the inverted value. The iteratee is invoked
  13651. * with one argument: (value).
  13652. *
  13653. * @static
  13654. * @memberOf _
  13655. * @since 4.1.0
  13656. * @category Object
  13657. * @param {Object} object The object to invert.
  13658. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13659. * @returns {Object} Returns the new inverted object.
  13660. * @example
  13661. *
  13662. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13663. *
  13664. * _.invertBy(object);
  13665. * // => { '1': ['a', 'c'], '2': ['b'] }
  13666. *
  13667. * _.invertBy(object, function(value) {
  13668. * return 'group' + value;
  13669. * });
  13670. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13671. */
  13672. var invertBy = createInverter(function(result, value, key) {
  13673. if (value != null &&
  13674. typeof value.toString != 'function') {
  13675. value = nativeObjectToString.call(value);
  13676. }
  13677. if (hasOwnProperty.call(result, value)) {
  13678. result[value].push(key);
  13679. } else {
  13680. result[value] = [key];
  13681. }
  13682. }, getIteratee);
  13683. /**
  13684. * Invokes the method at `path` of `object`.
  13685. *
  13686. * @static
  13687. * @memberOf _
  13688. * @since 4.0.0
  13689. * @category Object
  13690. * @param {Object} object The object to query.
  13691. * @param {Array|string} path The path of the method to invoke.
  13692. * @param {...*} [args] The arguments to invoke the method with.
  13693. * @returns {*} Returns the result of the invoked method.
  13694. * @example
  13695. *
  13696. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13697. *
  13698. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13699. * // => [2, 3]
  13700. */
  13701. var invoke = baseRest(baseInvoke);
  13702. /**
  13703. * Creates an array of the own enumerable property names of `object`.
  13704. *
  13705. * **Note:** Non-object values are coerced to objects. See the
  13706. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13707. * for more details.
  13708. *
  13709. * @static
  13710. * @since 0.1.0
  13711. * @memberOf _
  13712. * @category Object
  13713. * @param {Object} object The object to query.
  13714. * @returns {Array} Returns the array of property names.
  13715. * @example
  13716. *
  13717. * function Foo() {
  13718. * this.a = 1;
  13719. * this.b = 2;
  13720. * }
  13721. *
  13722. * Foo.prototype.c = 3;
  13723. *
  13724. * _.keys(new Foo);
  13725. * // => ['a', 'b'] (iteration order is not guaranteed)
  13726. *
  13727. * _.keys('hi');
  13728. * // => ['0', '1']
  13729. */
  13730. function keys(object) {
  13731. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13732. }
  13733. /**
  13734. * Creates an array of the own and inherited enumerable property names of `object`.
  13735. *
  13736. * **Note:** Non-object values are coerced to objects.
  13737. *
  13738. * @static
  13739. * @memberOf _
  13740. * @since 3.0.0
  13741. * @category Object
  13742. * @param {Object} object The object to query.
  13743. * @returns {Array} Returns the array of property names.
  13744. * @example
  13745. *
  13746. * function Foo() {
  13747. * this.a = 1;
  13748. * this.b = 2;
  13749. * }
  13750. *
  13751. * Foo.prototype.c = 3;
  13752. *
  13753. * _.keysIn(new Foo);
  13754. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13755. */
  13756. function keysIn(object) {
  13757. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13758. }
  13759. /**
  13760. * The opposite of `_.mapValues`; this method creates an object with the
  13761. * same values as `object` and keys generated by running each own enumerable
  13762. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13763. * with three arguments: (value, key, object).
  13764. *
  13765. * @static
  13766. * @memberOf _
  13767. * @since 3.8.0
  13768. * @category Object
  13769. * @param {Object} object The object to iterate over.
  13770. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13771. * @returns {Object} Returns the new mapped object.
  13772. * @see _.mapValues
  13773. * @example
  13774. *
  13775. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13776. * return key + value;
  13777. * });
  13778. * // => { 'a1': 1, 'b2': 2 }
  13779. */
  13780. function mapKeys(object, iteratee) {
  13781. var result = {};
  13782. iteratee = getIteratee(iteratee, 3);
  13783. baseForOwn(object, function(value, key, object) {
  13784. baseAssignValue(result, iteratee(value, key, object), value);
  13785. });
  13786. return result;
  13787. }
  13788. /**
  13789. * Creates an object with the same keys as `object` and values generated
  13790. * by running each own enumerable string keyed property of `object` thru
  13791. * `iteratee`. The iteratee is invoked with three arguments:
  13792. * (value, key, object).
  13793. *
  13794. * @static
  13795. * @memberOf _
  13796. * @since 2.4.0
  13797. * @category Object
  13798. * @param {Object} object The object to iterate over.
  13799. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13800. * @returns {Object} Returns the new mapped object.
  13801. * @see _.mapKeys
  13802. * @example
  13803. *
  13804. * var users = {
  13805. * 'fred': { 'user': 'fred', 'age': 40 },
  13806. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13807. * };
  13808. *
  13809. * _.mapValues(users, function(o) { return o.age; });
  13810. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13811. *
  13812. * // The `_.property` iteratee shorthand.
  13813. * _.mapValues(users, 'age');
  13814. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13815. */
  13816. function mapValues(object, iteratee) {
  13817. var result = {};
  13818. iteratee = getIteratee(iteratee, 3);
  13819. baseForOwn(object, function(value, key, object) {
  13820. baseAssignValue(result, key, iteratee(value, key, object));
  13821. });
  13822. return result;
  13823. }
  13824. /**
  13825. * This method is like `_.assign` except that it recursively merges own and
  13826. * inherited enumerable string keyed properties of source objects into the
  13827. * destination object. Source properties that resolve to `undefined` are
  13828. * skipped if a destination value exists. Array and plain object properties
  13829. * are merged recursively. Other objects and value types are overridden by
  13830. * assignment. Source objects are applied from left to right. Subsequent
  13831. * sources overwrite property assignments of previous sources.
  13832. *
  13833. * **Note:** This method mutates `object`.
  13834. *
  13835. * @static
  13836. * @memberOf _
  13837. * @since 0.5.0
  13838. * @category Object
  13839. * @param {Object} object The destination object.
  13840. * @param {...Object} [sources] The source objects.
  13841. * @returns {Object} Returns `object`.
  13842. * @example
  13843. *
  13844. * var object = {
  13845. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13846. * };
  13847. *
  13848. * var other = {
  13849. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13850. * };
  13851. *
  13852. * _.merge(object, other);
  13853. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13854. */
  13855. var merge = createAssigner(function(object, source, srcIndex) {
  13856. baseMerge(object, source, srcIndex);
  13857. });
  13858. /**
  13859. * This method is like `_.merge` except that it accepts `customizer` which
  13860. * is invoked to produce the merged values of the destination and source
  13861. * properties. If `customizer` returns `undefined`, merging is handled by the
  13862. * method instead. The `customizer` is invoked with six arguments:
  13863. * (objValue, srcValue, key, object, source, stack).
  13864. *
  13865. * **Note:** This method mutates `object`.
  13866. *
  13867. * @static
  13868. * @memberOf _
  13869. * @since 4.0.0
  13870. * @category Object
  13871. * @param {Object} object The destination object.
  13872. * @param {...Object} sources The source objects.
  13873. * @param {Function} customizer The function to customize assigned values.
  13874. * @returns {Object} Returns `object`.
  13875. * @example
  13876. *
  13877. * function customizer(objValue, srcValue) {
  13878. * if (_.isArray(objValue)) {
  13879. * return objValue.concat(srcValue);
  13880. * }
  13881. * }
  13882. *
  13883. * var object = { 'a': [1], 'b': [2] };
  13884. * var other = { 'a': [3], 'b': [4] };
  13885. *
  13886. * _.mergeWith(object, other, customizer);
  13887. * // => { 'a': [1, 3], 'b': [2, 4] }
  13888. */
  13889. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13890. baseMerge(object, source, srcIndex, customizer);
  13891. });
  13892. /**
  13893. * The opposite of `_.pick`; this method creates an object composed of the
  13894. * own and inherited enumerable property paths of `object` that are not omitted.
  13895. *
  13896. * **Note:** This method is considerably slower than `_.pick`.
  13897. *
  13898. * @static
  13899. * @since 0.1.0
  13900. * @memberOf _
  13901. * @category Object
  13902. * @param {Object} object The source object.
  13903. * @param {...(string|string[])} [paths] The property paths to omit.
  13904. * @returns {Object} Returns the new object.
  13905. * @example
  13906. *
  13907. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13908. *
  13909. * _.omit(object, ['a', 'c']);
  13910. * // => { 'b': '2' }
  13911. */
  13912. var omit = flatRest(function(object, paths) {
  13913. var result = {};
  13914. if (object == null) {
  13915. return result;
  13916. }
  13917. var isDeep = false;
  13918. paths = arrayMap(paths, function(path) {
  13919. path = castPath(path, object);
  13920. isDeep || (isDeep = path.length > 1);
  13921. return path;
  13922. });
  13923. copyObject(object, getAllKeysIn(object), result);
  13924. if (isDeep) {
  13925. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13926. }
  13927. var length = paths.length;
  13928. while (length--) {
  13929. baseUnset(result, paths[length]);
  13930. }
  13931. return result;
  13932. });
  13933. /**
  13934. * The opposite of `_.pickBy`; this method creates an object composed of
  13935. * the own and inherited enumerable string keyed properties of `object` that
  13936. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13937. * arguments: (value, key).
  13938. *
  13939. * @static
  13940. * @memberOf _
  13941. * @since 4.0.0
  13942. * @category Object
  13943. * @param {Object} object The source object.
  13944. * @param {Function} [predicate=_.identity] The function invoked per property.
  13945. * @returns {Object} Returns the new object.
  13946. * @example
  13947. *
  13948. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13949. *
  13950. * _.omitBy(object, _.isNumber);
  13951. * // => { 'b': '2' }
  13952. */
  13953. function omitBy(object, predicate) {
  13954. return pickBy(object, negate(getIteratee(predicate)));
  13955. }
  13956. /**
  13957. * Creates an object composed of the picked `object` properties.
  13958. *
  13959. * @static
  13960. * @since 0.1.0
  13961. * @memberOf _
  13962. * @category Object
  13963. * @param {Object} object The source object.
  13964. * @param {...(string|string[])} [paths] The property paths to pick.
  13965. * @returns {Object} Returns the new object.
  13966. * @example
  13967. *
  13968. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13969. *
  13970. * _.pick(object, ['a', 'c']);
  13971. * // => { 'a': 1, 'c': 3 }
  13972. */
  13973. var pick = flatRest(function(object, paths) {
  13974. return object == null ? {} : basePick(object, paths);
  13975. });
  13976. /**
  13977. * Creates an object composed of the `object` properties `predicate` returns
  13978. * truthy for. The predicate is invoked with two arguments: (value, key).
  13979. *
  13980. * @static
  13981. * @memberOf _
  13982. * @since 4.0.0
  13983. * @category Object
  13984. * @param {Object} object The source object.
  13985. * @param {Function} [predicate=_.identity] The function invoked per property.
  13986. * @returns {Object} Returns the new object.
  13987. * @example
  13988. *
  13989. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13990. *
  13991. * _.pickBy(object, _.isNumber);
  13992. * // => { 'a': 1, 'c': 3 }
  13993. */
  13994. function pickBy(object, predicate) {
  13995. if (object == null) {
  13996. return {};
  13997. }
  13998. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13999. return [prop];
  14000. });
  14001. predicate = getIteratee(predicate);
  14002. return basePickBy(object, props, function(value, path) {
  14003. return predicate(value, path[0]);
  14004. });
  14005. }
  14006. /**
  14007. * This method is like `_.get` except that if the resolved value is a
  14008. * function it's invoked with the `this` binding of its parent object and
  14009. * its result is returned.
  14010. *
  14011. * @static
  14012. * @since 0.1.0
  14013. * @memberOf _
  14014. * @category Object
  14015. * @param {Object} object The object to query.
  14016. * @param {Array|string} path The path of the property to resolve.
  14017. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14018. * @returns {*} Returns the resolved value.
  14019. * @example
  14020. *
  14021. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14022. *
  14023. * _.result(object, 'a[0].b.c1');
  14024. * // => 3
  14025. *
  14026. * _.result(object, 'a[0].b.c2');
  14027. * // => 4
  14028. *
  14029. * _.result(object, 'a[0].b.c3', 'default');
  14030. * // => 'default'
  14031. *
  14032. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14033. * // => 'default'
  14034. */
  14035. function result(object, path, defaultValue) {
  14036. path = castPath(path, object);
  14037. var index = -1,
  14038. length = path.length;
  14039. // Ensure the loop is entered when path is empty.
  14040. if (!length) {
  14041. length = 1;
  14042. object = undefined;
  14043. }
  14044. while (++index < length) {
  14045. var value = object == null ? undefined : object[toKey(path[index])];
  14046. if (value === undefined) {
  14047. index = length;
  14048. value = defaultValue;
  14049. }
  14050. object = isFunction(value) ? value.call(object) : value;
  14051. }
  14052. return object;
  14053. }
  14054. /**
  14055. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14056. * it's created. Arrays are created for missing index properties while objects
  14057. * are created for all other missing properties. Use `_.setWith` to customize
  14058. * `path` creation.
  14059. *
  14060. * **Note:** This method mutates `object`.
  14061. *
  14062. * @static
  14063. * @memberOf _
  14064. * @since 3.7.0
  14065. * @category Object
  14066. * @param {Object} object The object to modify.
  14067. * @param {Array|string} path The path of the property to set.
  14068. * @param {*} value The value to set.
  14069. * @returns {Object} Returns `object`.
  14070. * @example
  14071. *
  14072. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14073. *
  14074. * _.set(object, 'a[0].b.c', 4);
  14075. * console.log(object.a[0].b.c);
  14076. * // => 4
  14077. *
  14078. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14079. * console.log(object.x[0].y.z);
  14080. * // => 5
  14081. */
  14082. function set(object, path, value) {
  14083. return object == null ? object : baseSet(object, path, value);
  14084. }
  14085. /**
  14086. * This method is like `_.set` except that it accepts `customizer` which is
  14087. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14088. * path creation is handled by the method instead. The `customizer` is invoked
  14089. * with three arguments: (nsValue, key, nsObject).
  14090. *
  14091. * **Note:** This method mutates `object`.
  14092. *
  14093. * @static
  14094. * @memberOf _
  14095. * @since 4.0.0
  14096. * @category Object
  14097. * @param {Object} object The object to modify.
  14098. * @param {Array|string} path The path of the property to set.
  14099. * @param {*} value The value to set.
  14100. * @param {Function} [customizer] The function to customize assigned values.
  14101. * @returns {Object} Returns `object`.
  14102. * @example
  14103. *
  14104. * var object = {};
  14105. *
  14106. * _.setWith(object, '[0][1]', 'a', Object);
  14107. * // => { '0': { '1': 'a' } }
  14108. */
  14109. function setWith(object, path, value, customizer) {
  14110. customizer = typeof customizer == 'function' ? customizer : undefined;
  14111. return object == null ? object : baseSet(object, path, value, customizer);
  14112. }
  14113. /**
  14114. * Creates an array of own enumerable string keyed-value pairs for `object`
  14115. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14116. * entries are returned.
  14117. *
  14118. * @static
  14119. * @memberOf _
  14120. * @since 4.0.0
  14121. * @alias entries
  14122. * @category Object
  14123. * @param {Object} object The object to query.
  14124. * @returns {Array} Returns the key-value pairs.
  14125. * @example
  14126. *
  14127. * function Foo() {
  14128. * this.a = 1;
  14129. * this.b = 2;
  14130. * }
  14131. *
  14132. * Foo.prototype.c = 3;
  14133. *
  14134. * _.toPairs(new Foo);
  14135. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14136. */
  14137. var toPairs = createToPairs(keys);
  14138. /**
  14139. * Creates an array of own and inherited enumerable string keyed-value pairs
  14140. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14141. * or set, its entries are returned.
  14142. *
  14143. * @static
  14144. * @memberOf _
  14145. * @since 4.0.0
  14146. * @alias entriesIn
  14147. * @category Object
  14148. * @param {Object} object The object to query.
  14149. * @returns {Array} Returns the key-value pairs.
  14150. * @example
  14151. *
  14152. * function Foo() {
  14153. * this.a = 1;
  14154. * this.b = 2;
  14155. * }
  14156. *
  14157. * Foo.prototype.c = 3;
  14158. *
  14159. * _.toPairsIn(new Foo);
  14160. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14161. */
  14162. var toPairsIn = createToPairs(keysIn);
  14163. /**
  14164. * An alternative to `_.reduce`; this method transforms `object` to a new
  14165. * `accumulator` object which is the result of running each of its own
  14166. * enumerable string keyed properties thru `iteratee`, with each invocation
  14167. * potentially mutating the `accumulator` object. If `accumulator` is not
  14168. * provided, a new object with the same `[[Prototype]]` will be used. The
  14169. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14170. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14171. *
  14172. * @static
  14173. * @memberOf _
  14174. * @since 1.3.0
  14175. * @category Object
  14176. * @param {Object} object The object to iterate over.
  14177. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14178. * @param {*} [accumulator] The custom accumulator value.
  14179. * @returns {*} Returns the accumulated value.
  14180. * @example
  14181. *
  14182. * _.transform([2, 3, 4], function(result, n) {
  14183. * result.push(n *= n);
  14184. * return n % 2 == 0;
  14185. * }, []);
  14186. * // => [4, 9]
  14187. *
  14188. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14189. * (result[value] || (result[value] = [])).push(key);
  14190. * }, {});
  14191. * // => { '1': ['a', 'c'], '2': ['b'] }
  14192. */
  14193. function transform(object, iteratee, accumulator) {
  14194. var isArr = isArray(object),
  14195. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14196. iteratee = getIteratee(iteratee, 4);
  14197. if (accumulator == null) {
  14198. var Ctor = object && object.constructor;
  14199. if (isArrLike) {
  14200. accumulator = isArr ? new Ctor : [];
  14201. }
  14202. else if (isObject(object)) {
  14203. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14204. }
  14205. else {
  14206. accumulator = {};
  14207. }
  14208. }
  14209. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14210. return iteratee(accumulator, value, index, object);
  14211. });
  14212. return accumulator;
  14213. }
  14214. /**
  14215. * Removes the property at `path` of `object`.
  14216. *
  14217. * **Note:** This method mutates `object`.
  14218. *
  14219. * @static
  14220. * @memberOf _
  14221. * @since 4.0.0
  14222. * @category Object
  14223. * @param {Object} object The object to modify.
  14224. * @param {Array|string} path The path of the property to unset.
  14225. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14226. * @example
  14227. *
  14228. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14229. * _.unset(object, 'a[0].b.c');
  14230. * // => true
  14231. *
  14232. * console.log(object);
  14233. * // => { 'a': [{ 'b': {} }] };
  14234. *
  14235. * _.unset(object, ['a', '0', 'b', 'c']);
  14236. * // => true
  14237. *
  14238. * console.log(object);
  14239. * // => { 'a': [{ 'b': {} }] };
  14240. */
  14241. function unset(object, path) {
  14242. return object == null ? true : baseUnset(object, path);
  14243. }
  14244. /**
  14245. * This method is like `_.set` except that accepts `updater` to produce the
  14246. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14247. * is invoked with one argument: (value).
  14248. *
  14249. * **Note:** This method mutates `object`.
  14250. *
  14251. * @static
  14252. * @memberOf _
  14253. * @since 4.6.0
  14254. * @category Object
  14255. * @param {Object} object The object to modify.
  14256. * @param {Array|string} path The path of the property to set.
  14257. * @param {Function} updater The function to produce the updated value.
  14258. * @returns {Object} Returns `object`.
  14259. * @example
  14260. *
  14261. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14262. *
  14263. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14264. * console.log(object.a[0].b.c);
  14265. * // => 9
  14266. *
  14267. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14268. * console.log(object.x[0].y.z);
  14269. * // => 0
  14270. */
  14271. function update(object, path, updater) {
  14272. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14273. }
  14274. /**
  14275. * This method is like `_.update` except that it accepts `customizer` which is
  14276. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14277. * path creation is handled by the method instead. The `customizer` is invoked
  14278. * with three arguments: (nsValue, key, nsObject).
  14279. *
  14280. * **Note:** This method mutates `object`.
  14281. *
  14282. * @static
  14283. * @memberOf _
  14284. * @since 4.6.0
  14285. * @category Object
  14286. * @param {Object} object The object to modify.
  14287. * @param {Array|string} path The path of the property to set.
  14288. * @param {Function} updater The function to produce the updated value.
  14289. * @param {Function} [customizer] The function to customize assigned values.
  14290. * @returns {Object} Returns `object`.
  14291. * @example
  14292. *
  14293. * var object = {};
  14294. *
  14295. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14296. * // => { '0': { '1': 'a' } }
  14297. */
  14298. function updateWith(object, path, updater, customizer) {
  14299. customizer = typeof customizer == 'function' ? customizer : undefined;
  14300. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14301. }
  14302. /**
  14303. * Creates an array of the own enumerable string keyed property values of `object`.
  14304. *
  14305. * **Note:** Non-object values are coerced to objects.
  14306. *
  14307. * @static
  14308. * @since 0.1.0
  14309. * @memberOf _
  14310. * @category Object
  14311. * @param {Object} object The object to query.
  14312. * @returns {Array} Returns the array of property values.
  14313. * @example
  14314. *
  14315. * function Foo() {
  14316. * this.a = 1;
  14317. * this.b = 2;
  14318. * }
  14319. *
  14320. * Foo.prototype.c = 3;
  14321. *
  14322. * _.values(new Foo);
  14323. * // => [1, 2] (iteration order is not guaranteed)
  14324. *
  14325. * _.values('hi');
  14326. * // => ['h', 'i']
  14327. */
  14328. function values(object) {
  14329. return object == null ? [] : baseValues(object, keys(object));
  14330. }
  14331. /**
  14332. * Creates an array of the own and inherited enumerable string keyed property
  14333. * values of `object`.
  14334. *
  14335. * **Note:** Non-object values are coerced to objects.
  14336. *
  14337. * @static
  14338. * @memberOf _
  14339. * @since 3.0.0
  14340. * @category Object
  14341. * @param {Object} object The object to query.
  14342. * @returns {Array} Returns the array of property values.
  14343. * @example
  14344. *
  14345. * function Foo() {
  14346. * this.a = 1;
  14347. * this.b = 2;
  14348. * }
  14349. *
  14350. * Foo.prototype.c = 3;
  14351. *
  14352. * _.valuesIn(new Foo);
  14353. * // => [1, 2, 3] (iteration order is not guaranteed)
  14354. */
  14355. function valuesIn(object) {
  14356. return object == null ? [] : baseValues(object, keysIn(object));
  14357. }
  14358. /*------------------------------------------------------------------------*/
  14359. /**
  14360. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14361. *
  14362. * @static
  14363. * @memberOf _
  14364. * @since 4.0.0
  14365. * @category Number
  14366. * @param {number} number The number to clamp.
  14367. * @param {number} [lower] The lower bound.
  14368. * @param {number} upper The upper bound.
  14369. * @returns {number} Returns the clamped number.
  14370. * @example
  14371. *
  14372. * _.clamp(-10, -5, 5);
  14373. * // => -5
  14374. *
  14375. * _.clamp(10, -5, 5);
  14376. * // => 5
  14377. */
  14378. function clamp(number, lower, upper) {
  14379. if (upper === undefined) {
  14380. upper = lower;
  14381. lower = undefined;
  14382. }
  14383. if (upper !== undefined) {
  14384. upper = toNumber(upper);
  14385. upper = upper === upper ? upper : 0;
  14386. }
  14387. if (lower !== undefined) {
  14388. lower = toNumber(lower);
  14389. lower = lower === lower ? lower : 0;
  14390. }
  14391. return baseClamp(toNumber(number), lower, upper);
  14392. }
  14393. /**
  14394. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14395. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14396. * If `start` is greater than `end` the params are swapped to support
  14397. * negative ranges.
  14398. *
  14399. * @static
  14400. * @memberOf _
  14401. * @since 3.3.0
  14402. * @category Number
  14403. * @param {number} number The number to check.
  14404. * @param {number} [start=0] The start of the range.
  14405. * @param {number} end The end of the range.
  14406. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14407. * @see _.range, _.rangeRight
  14408. * @example
  14409. *
  14410. * _.inRange(3, 2, 4);
  14411. * // => true
  14412. *
  14413. * _.inRange(4, 8);
  14414. * // => true
  14415. *
  14416. * _.inRange(4, 2);
  14417. * // => false
  14418. *
  14419. * _.inRange(2, 2);
  14420. * // => false
  14421. *
  14422. * _.inRange(1.2, 2);
  14423. * // => true
  14424. *
  14425. * _.inRange(5.2, 4);
  14426. * // => false
  14427. *
  14428. * _.inRange(-3, -2, -6);
  14429. * // => true
  14430. */
  14431. function inRange(number, start, end) {
  14432. start = toFinite(start);
  14433. if (end === undefined) {
  14434. end = start;
  14435. start = 0;
  14436. } else {
  14437. end = toFinite(end);
  14438. }
  14439. number = toNumber(number);
  14440. return baseInRange(number, start, end);
  14441. }
  14442. /**
  14443. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14444. * If only one argument is provided a number between `0` and the given number
  14445. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14446. * floats, a floating-point number is returned instead of an integer.
  14447. *
  14448. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14449. * floating-point values which can produce unexpected results.
  14450. *
  14451. * @static
  14452. * @memberOf _
  14453. * @since 0.7.0
  14454. * @category Number
  14455. * @param {number} [lower=0] The lower bound.
  14456. * @param {number} [upper=1] The upper bound.
  14457. * @param {boolean} [floating] Specify returning a floating-point number.
  14458. * @returns {number} Returns the random number.
  14459. * @example
  14460. *
  14461. * _.random(0, 5);
  14462. * // => an integer between 0 and 5
  14463. *
  14464. * _.random(5);
  14465. * // => also an integer between 0 and 5
  14466. *
  14467. * _.random(5, true);
  14468. * // => a floating-point number between 0 and 5
  14469. *
  14470. * _.random(1.2, 5.2);
  14471. * // => a floating-point number between 1.2 and 5.2
  14472. */
  14473. function random(lower, upper, floating) {
  14474. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14475. upper = floating = undefined;
  14476. }
  14477. if (floating === undefined) {
  14478. if (typeof upper == 'boolean') {
  14479. floating = upper;
  14480. upper = undefined;
  14481. }
  14482. else if (typeof lower == 'boolean') {
  14483. floating = lower;
  14484. lower = undefined;
  14485. }
  14486. }
  14487. if (lower === undefined && upper === undefined) {
  14488. lower = 0;
  14489. upper = 1;
  14490. }
  14491. else {
  14492. lower = toFinite(lower);
  14493. if (upper === undefined) {
  14494. upper = lower;
  14495. lower = 0;
  14496. } else {
  14497. upper = toFinite(upper);
  14498. }
  14499. }
  14500. if (lower > upper) {
  14501. var temp = lower;
  14502. lower = upper;
  14503. upper = temp;
  14504. }
  14505. if (floating || lower % 1 || upper % 1) {
  14506. var rand = nativeRandom();
  14507. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14508. }
  14509. return baseRandom(lower, upper);
  14510. }
  14511. /*------------------------------------------------------------------------*/
  14512. /**
  14513. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14514. *
  14515. * @static
  14516. * @memberOf _
  14517. * @since 3.0.0
  14518. * @category String
  14519. * @param {string} [string=''] The string to convert.
  14520. * @returns {string} Returns the camel cased string.
  14521. * @example
  14522. *
  14523. * _.camelCase('Foo Bar');
  14524. * // => 'fooBar'
  14525. *
  14526. * _.camelCase('--foo-bar--');
  14527. * // => 'fooBar'
  14528. *
  14529. * _.camelCase('__FOO_BAR__');
  14530. * // => 'fooBar'
  14531. */
  14532. var camelCase = createCompounder(function(result, word, index) {
  14533. word = word.toLowerCase();
  14534. return result + (index ? capitalize(word) : word);
  14535. });
  14536. /**
  14537. * Converts the first character of `string` to upper case and the remaining
  14538. * to lower case.
  14539. *
  14540. * @static
  14541. * @memberOf _
  14542. * @since 3.0.0
  14543. * @category String
  14544. * @param {string} [string=''] The string to capitalize.
  14545. * @returns {string} Returns the capitalized string.
  14546. * @example
  14547. *
  14548. * _.capitalize('FRED');
  14549. * // => 'Fred'
  14550. */
  14551. function capitalize(string) {
  14552. return upperFirst(toString(string).toLowerCase());
  14553. }
  14554. /**
  14555. * Deburrs `string` by converting
  14556. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14557. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14558. * letters to basic Latin letters and removing
  14559. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14560. *
  14561. * @static
  14562. * @memberOf _
  14563. * @since 3.0.0
  14564. * @category String
  14565. * @param {string} [string=''] The string to deburr.
  14566. * @returns {string} Returns the deburred string.
  14567. * @example
  14568. *
  14569. * _.deburr('déjà vu');
  14570. * // => 'deja vu'
  14571. */
  14572. function deburr(string) {
  14573. string = toString(string);
  14574. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14575. }
  14576. /**
  14577. * Checks if `string` ends with the given target string.
  14578. *
  14579. * @static
  14580. * @memberOf _
  14581. * @since 3.0.0
  14582. * @category String
  14583. * @param {string} [string=''] The string to inspect.
  14584. * @param {string} [target] The string to search for.
  14585. * @param {number} [position=string.length] The position to search up to.
  14586. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14587. * else `false`.
  14588. * @example
  14589. *
  14590. * _.endsWith('abc', 'c');
  14591. * // => true
  14592. *
  14593. * _.endsWith('abc', 'b');
  14594. * // => false
  14595. *
  14596. * _.endsWith('abc', 'b', 2);
  14597. * // => true
  14598. */
  14599. function endsWith(string, target, position) {
  14600. string = toString(string);
  14601. target = baseToString(target);
  14602. var length = string.length;
  14603. position = position === undefined
  14604. ? length
  14605. : baseClamp(toInteger(position), 0, length);
  14606. var end = position;
  14607. position -= target.length;
  14608. return position >= 0 && string.slice(position, end) == target;
  14609. }
  14610. /**
  14611. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14612. * corresponding HTML entities.
  14613. *
  14614. * **Note:** No other characters are escaped. To escape additional
  14615. * characters use a third-party library like [_he_](https://mths.be/he).
  14616. *
  14617. * Though the ">" character is escaped for symmetry, characters like
  14618. * ">" and "/" don't need escaping in HTML and have no special meaning
  14619. * unless they're part of a tag or unquoted attribute value. See
  14620. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14621. * (under "semi-related fun fact") for more details.
  14622. *
  14623. * When working with HTML you should always
  14624. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14625. * XSS vectors.
  14626. *
  14627. * @static
  14628. * @since 0.1.0
  14629. * @memberOf _
  14630. * @category String
  14631. * @param {string} [string=''] The string to escape.
  14632. * @returns {string} Returns the escaped string.
  14633. * @example
  14634. *
  14635. * _.escape('fred, barney, & pebbles');
  14636. * // => 'fred, barney, &amp; pebbles'
  14637. */
  14638. function escape(string) {
  14639. string = toString(string);
  14640. return (string && reHasUnescapedHtml.test(string))
  14641. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14642. : string;
  14643. }
  14644. /**
  14645. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14646. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14647. *
  14648. * @static
  14649. * @memberOf _
  14650. * @since 3.0.0
  14651. * @category String
  14652. * @param {string} [string=''] The string to escape.
  14653. * @returns {string} Returns the escaped string.
  14654. * @example
  14655. *
  14656. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14657. * // => '\[lodash\]\(https://lodash\.com/\)'
  14658. */
  14659. function escapeRegExp(string) {
  14660. string = toString(string);
  14661. return (string && reHasRegExpChar.test(string))
  14662. ? string.replace(reRegExpChar, '\\$&')
  14663. : string;
  14664. }
  14665. /**
  14666. * Converts `string` to
  14667. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14668. *
  14669. * @static
  14670. * @memberOf _
  14671. * @since 3.0.0
  14672. * @category String
  14673. * @param {string} [string=''] The string to convert.
  14674. * @returns {string} Returns the kebab cased string.
  14675. * @example
  14676. *
  14677. * _.kebabCase('Foo Bar');
  14678. * // => 'foo-bar'
  14679. *
  14680. * _.kebabCase('fooBar');
  14681. * // => 'foo-bar'
  14682. *
  14683. * _.kebabCase('__FOO_BAR__');
  14684. * // => 'foo-bar'
  14685. */
  14686. var kebabCase = createCompounder(function(result, word, index) {
  14687. return result + (index ? '-' : '') + word.toLowerCase();
  14688. });
  14689. /**
  14690. * Converts `string`, as space separated words, to lower case.
  14691. *
  14692. * @static
  14693. * @memberOf _
  14694. * @since 4.0.0
  14695. * @category String
  14696. * @param {string} [string=''] The string to convert.
  14697. * @returns {string} Returns the lower cased string.
  14698. * @example
  14699. *
  14700. * _.lowerCase('--Foo-Bar--');
  14701. * // => 'foo bar'
  14702. *
  14703. * _.lowerCase('fooBar');
  14704. * // => 'foo bar'
  14705. *
  14706. * _.lowerCase('__FOO_BAR__');
  14707. * // => 'foo bar'
  14708. */
  14709. var lowerCase = createCompounder(function(result, word, index) {
  14710. return result + (index ? ' ' : '') + word.toLowerCase();
  14711. });
  14712. /**
  14713. * Converts the first character of `string` to lower case.
  14714. *
  14715. * @static
  14716. * @memberOf _
  14717. * @since 4.0.0
  14718. * @category String
  14719. * @param {string} [string=''] The string to convert.
  14720. * @returns {string} Returns the converted string.
  14721. * @example
  14722. *
  14723. * _.lowerFirst('Fred');
  14724. * // => 'fred'
  14725. *
  14726. * _.lowerFirst('FRED');
  14727. * // => 'fRED'
  14728. */
  14729. var lowerFirst = createCaseFirst('toLowerCase');
  14730. /**
  14731. * Pads `string` on the left and right sides if it's shorter than `length`.
  14732. * Padding characters are truncated if they can't be evenly divided by `length`.
  14733. *
  14734. * @static
  14735. * @memberOf _
  14736. * @since 3.0.0
  14737. * @category String
  14738. * @param {string} [string=''] The string to pad.
  14739. * @param {number} [length=0] The padding length.
  14740. * @param {string} [chars=' '] The string used as padding.
  14741. * @returns {string} Returns the padded string.
  14742. * @example
  14743. *
  14744. * _.pad('abc', 8);
  14745. * // => ' abc '
  14746. *
  14747. * _.pad('abc', 8, '_-');
  14748. * // => '_-abc_-_'
  14749. *
  14750. * _.pad('abc', 3);
  14751. * // => 'abc'
  14752. */
  14753. function pad(string, length, chars) {
  14754. string = toString(string);
  14755. length = toInteger(length);
  14756. var strLength = length ? stringSize(string) : 0;
  14757. if (!length || strLength >= length) {
  14758. return string;
  14759. }
  14760. var mid = (length - strLength) / 2;
  14761. return (
  14762. createPadding(nativeFloor(mid), chars) +
  14763. string +
  14764. createPadding(nativeCeil(mid), chars)
  14765. );
  14766. }
  14767. /**
  14768. * Pads `string` on the right side if it's shorter than `length`. Padding
  14769. * characters are truncated if they exceed `length`.
  14770. *
  14771. * @static
  14772. * @memberOf _
  14773. * @since 4.0.0
  14774. * @category String
  14775. * @param {string} [string=''] The string to pad.
  14776. * @param {number} [length=0] The padding length.
  14777. * @param {string} [chars=' '] The string used as padding.
  14778. * @returns {string} Returns the padded string.
  14779. * @example
  14780. *
  14781. * _.padEnd('abc', 6);
  14782. * // => 'abc '
  14783. *
  14784. * _.padEnd('abc', 6, '_-');
  14785. * // => 'abc_-_'
  14786. *
  14787. * _.padEnd('abc', 3);
  14788. * // => 'abc'
  14789. */
  14790. function padEnd(string, length, chars) {
  14791. string = toString(string);
  14792. length = toInteger(length);
  14793. var strLength = length ? stringSize(string) : 0;
  14794. return (length && strLength < length)
  14795. ? (string + createPadding(length - strLength, chars))
  14796. : string;
  14797. }
  14798. /**
  14799. * Pads `string` on the left side if it's shorter than `length`. Padding
  14800. * characters are truncated if they exceed `length`.
  14801. *
  14802. * @static
  14803. * @memberOf _
  14804. * @since 4.0.0
  14805. * @category String
  14806. * @param {string} [string=''] The string to pad.
  14807. * @param {number} [length=0] The padding length.
  14808. * @param {string} [chars=' '] The string used as padding.
  14809. * @returns {string} Returns the padded string.
  14810. * @example
  14811. *
  14812. * _.padStart('abc', 6);
  14813. * // => ' abc'
  14814. *
  14815. * _.padStart('abc', 6, '_-');
  14816. * // => '_-_abc'
  14817. *
  14818. * _.padStart('abc', 3);
  14819. * // => 'abc'
  14820. */
  14821. function padStart(string, length, chars) {
  14822. string = toString(string);
  14823. length = toInteger(length);
  14824. var strLength = length ? stringSize(string) : 0;
  14825. return (length && strLength < length)
  14826. ? (createPadding(length - strLength, chars) + string)
  14827. : string;
  14828. }
  14829. /**
  14830. * Converts `string` to an integer of the specified radix. If `radix` is
  14831. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14832. * hexadecimal, in which case a `radix` of `16` is used.
  14833. *
  14834. * **Note:** This method aligns with the
  14835. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14836. *
  14837. * @static
  14838. * @memberOf _
  14839. * @since 1.1.0
  14840. * @category String
  14841. * @param {string} string The string to convert.
  14842. * @param {number} [radix=10] The radix to interpret `value` by.
  14843. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14844. * @returns {number} Returns the converted integer.
  14845. * @example
  14846. *
  14847. * _.parseInt('08');
  14848. * // => 8
  14849. *
  14850. * _.map(['6', '08', '10'], _.parseInt);
  14851. * // => [6, 8, 10]
  14852. */
  14853. function parseInt(string, radix, guard) {
  14854. if (guard || radix == null) {
  14855. radix = 0;
  14856. } else if (radix) {
  14857. radix = +radix;
  14858. }
  14859. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14860. }
  14861. /**
  14862. * Repeats the given string `n` times.
  14863. *
  14864. * @static
  14865. * @memberOf _
  14866. * @since 3.0.0
  14867. * @category String
  14868. * @param {string} [string=''] The string to repeat.
  14869. * @param {number} [n=1] The number of times to repeat the string.
  14870. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14871. * @returns {string} Returns the repeated string.
  14872. * @example
  14873. *
  14874. * _.repeat('*', 3);
  14875. * // => '***'
  14876. *
  14877. * _.repeat('abc', 2);
  14878. * // => 'abcabc'
  14879. *
  14880. * _.repeat('abc', 0);
  14881. * // => ''
  14882. */
  14883. function repeat(string, n, guard) {
  14884. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14885. n = 1;
  14886. } else {
  14887. n = toInteger(n);
  14888. }
  14889. return baseRepeat(toString(string), n);
  14890. }
  14891. /**
  14892. * Replaces matches for `pattern` in `string` with `replacement`.
  14893. *
  14894. * **Note:** This method is based on
  14895. * [`String#replace`](https://mdn.io/String/replace).
  14896. *
  14897. * @static
  14898. * @memberOf _
  14899. * @since 4.0.0
  14900. * @category String
  14901. * @param {string} [string=''] The string to modify.
  14902. * @param {RegExp|string} pattern The pattern to replace.
  14903. * @param {Function|string} replacement The match replacement.
  14904. * @returns {string} Returns the modified string.
  14905. * @example
  14906. *
  14907. * _.replace('Hi Fred', 'Fred', 'Barney');
  14908. * // => 'Hi Barney'
  14909. */
  14910. function replace() {
  14911. var args = arguments,
  14912. string = toString(args[0]);
  14913. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14914. }
  14915. /**
  14916. * Converts `string` to
  14917. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14918. *
  14919. * @static
  14920. * @memberOf _
  14921. * @since 3.0.0
  14922. * @category String
  14923. * @param {string} [string=''] The string to convert.
  14924. * @returns {string} Returns the snake cased string.
  14925. * @example
  14926. *
  14927. * _.snakeCase('Foo Bar');
  14928. * // => 'foo_bar'
  14929. *
  14930. * _.snakeCase('fooBar');
  14931. * // => 'foo_bar'
  14932. *
  14933. * _.snakeCase('--FOO-BAR--');
  14934. * // => 'foo_bar'
  14935. */
  14936. var snakeCase = createCompounder(function(result, word, index) {
  14937. return result + (index ? '_' : '') + word.toLowerCase();
  14938. });
  14939. /**
  14940. * Splits `string` by `separator`.
  14941. *
  14942. * **Note:** This method is based on
  14943. * [`String#split`](https://mdn.io/String/split).
  14944. *
  14945. * @static
  14946. * @memberOf _
  14947. * @since 4.0.0
  14948. * @category String
  14949. * @param {string} [string=''] The string to split.
  14950. * @param {RegExp|string} separator The separator pattern to split by.
  14951. * @param {number} [limit] The length to truncate results to.
  14952. * @returns {Array} Returns the string segments.
  14953. * @example
  14954. *
  14955. * _.split('a-b-c', '-', 2);
  14956. * // => ['a', 'b']
  14957. */
  14958. function split(string, separator, limit) {
  14959. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14960. separator = limit = undefined;
  14961. }
  14962. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14963. if (!limit) {
  14964. return [];
  14965. }
  14966. string = toString(string);
  14967. if (string && (
  14968. typeof separator == 'string' ||
  14969. (separator != null && !isRegExp(separator))
  14970. )) {
  14971. separator = baseToString(separator);
  14972. if (!separator && hasUnicode(string)) {
  14973. return castSlice(stringToArray(string), 0, limit);
  14974. }
  14975. }
  14976. return string.split(separator, limit);
  14977. }
  14978. /**
  14979. * Converts `string` to
  14980. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14981. *
  14982. * @static
  14983. * @memberOf _
  14984. * @since 3.1.0
  14985. * @category String
  14986. * @param {string} [string=''] The string to convert.
  14987. * @returns {string} Returns the start cased string.
  14988. * @example
  14989. *
  14990. * _.startCase('--foo-bar--');
  14991. * // => 'Foo Bar'
  14992. *
  14993. * _.startCase('fooBar');
  14994. * // => 'Foo Bar'
  14995. *
  14996. * _.startCase('__FOO_BAR__');
  14997. * // => 'FOO BAR'
  14998. */
  14999. var startCase = createCompounder(function(result, word, index) {
  15000. return result + (index ? ' ' : '') + upperFirst(word);
  15001. });
  15002. /**
  15003. * Checks if `string` starts with the given target string.
  15004. *
  15005. * @static
  15006. * @memberOf _
  15007. * @since 3.0.0
  15008. * @category String
  15009. * @param {string} [string=''] The string to inspect.
  15010. * @param {string} [target] The string to search for.
  15011. * @param {number} [position=0] The position to search from.
  15012. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15013. * else `false`.
  15014. * @example
  15015. *
  15016. * _.startsWith('abc', 'a');
  15017. * // => true
  15018. *
  15019. * _.startsWith('abc', 'b');
  15020. * // => false
  15021. *
  15022. * _.startsWith('abc', 'b', 1);
  15023. * // => true
  15024. */
  15025. function startsWith(string, target, position) {
  15026. string = toString(string);
  15027. position = position == null
  15028. ? 0
  15029. : baseClamp(toInteger(position), 0, string.length);
  15030. target = baseToString(target);
  15031. return string.slice(position, position + target.length) == target;
  15032. }
  15033. /**
  15034. * Creates a compiled template function that can interpolate data properties
  15035. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15036. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15037. * properties may be accessed as free variables in the template. If a setting
  15038. * object is given, it takes precedence over `_.templateSettings` values.
  15039. *
  15040. * **Note:** In the development build `_.template` utilizes
  15041. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15042. * for easier debugging.
  15043. *
  15044. * For more information on precompiling templates see
  15045. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15046. *
  15047. * For more information on Chrome extension sandboxes see
  15048. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15049. *
  15050. * @static
  15051. * @since 0.1.0
  15052. * @memberOf _
  15053. * @category String
  15054. * @param {string} [string=''] The template string.
  15055. * @param {Object} [options={}] The options object.
  15056. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15057. * The HTML "escape" delimiter.
  15058. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15059. * The "evaluate" delimiter.
  15060. * @param {Object} [options.imports=_.templateSettings.imports]
  15061. * An object to import into the template as free variables.
  15062. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15063. * The "interpolate" delimiter.
  15064. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15065. * The sourceURL of the compiled template.
  15066. * @param {string} [options.variable='obj']
  15067. * The data object variable name.
  15068. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15069. * @returns {Function} Returns the compiled template function.
  15070. * @example
  15071. *
  15072. * // Use the "interpolate" delimiter to create a compiled template.
  15073. * var compiled = _.template('hello <%= user %>!');
  15074. * compiled({ 'user': 'fred' });
  15075. * // => 'hello fred!'
  15076. *
  15077. * // Use the HTML "escape" delimiter to escape data property values.
  15078. * var compiled = _.template('<b><%- value %></b>');
  15079. * compiled({ 'value': '<script>' });
  15080. * // => '<b>&lt;script&gt;</b>'
  15081. *
  15082. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15083. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15084. * compiled({ 'users': ['fred', 'barney'] });
  15085. * // => '<li>fred</li><li>barney</li>'
  15086. *
  15087. * // Use the internal `print` function in "evaluate" delimiters.
  15088. * var compiled = _.template('<% print("hello " + user); %>!');
  15089. * compiled({ 'user': 'barney' });
  15090. * // => 'hello barney!'
  15091. *
  15092. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15093. * // Disable support by replacing the "interpolate" delimiter.
  15094. * var compiled = _.template('hello ${ user }!');
  15095. * compiled({ 'user': 'pebbles' });
  15096. * // => 'hello pebbles!'
  15097. *
  15098. * // Use backslashes to treat delimiters as plain text.
  15099. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15100. * compiled({ 'value': 'ignored' });
  15101. * // => '<%- value %>'
  15102. *
  15103. * // Use the `imports` option to import `jQuery` as `jq`.
  15104. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15105. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15106. * compiled({ 'users': ['fred', 'barney'] });
  15107. * // => '<li>fred</li><li>barney</li>'
  15108. *
  15109. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15110. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15111. * compiled(data);
  15112. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15113. *
  15114. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15115. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15116. * compiled.source;
  15117. * // => function(data) {
  15118. * // var __t, __p = '';
  15119. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15120. * // return __p;
  15121. * // }
  15122. *
  15123. * // Use custom template delimiters.
  15124. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15125. * var compiled = _.template('hello {{ user }}!');
  15126. * compiled({ 'user': 'mustache' });
  15127. * // => 'hello mustache!'
  15128. *
  15129. * // Use the `source` property to inline compiled templates for meaningful
  15130. * // line numbers in error messages and stack traces.
  15131. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15132. * var JST = {\
  15133. * "main": ' + _.template(mainText).source + '\
  15134. * };\
  15135. * ');
  15136. */
  15137. function template(string, options, guard) {
  15138. // Based on John Resig's `tmpl` implementation
  15139. // (http://ejohn.org/blog/javascript-micro-templating/)
  15140. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15141. var settings = lodash.templateSettings;
  15142. if (guard && isIterateeCall(string, options, guard)) {
  15143. options = undefined;
  15144. }
  15145. string = toString(string);
  15146. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15147. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15148. importsKeys = keys(imports),
  15149. importsValues = baseValues(imports, importsKeys);
  15150. var isEscaping,
  15151. isEvaluating,
  15152. index = 0,
  15153. interpolate = options.interpolate || reNoMatch,
  15154. source = "__p += '";
  15155. // Compile the regexp to match each delimiter.
  15156. var reDelimiters = RegExp(
  15157. (options.escape || reNoMatch).source + '|' +
  15158. interpolate.source + '|' +
  15159. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15160. (options.evaluate || reNoMatch).source + '|$'
  15161. , 'g');
  15162. // Use a sourceURL for easier debugging.
  15163. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15164. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15165. // and escape the comment, thus injecting code that gets evaled.
  15166. var sourceURL = '//# sourceURL=' +
  15167. (hasOwnProperty.call(options, 'sourceURL')
  15168. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15169. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15170. ) + '\n';
  15171. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15172. interpolateValue || (interpolateValue = esTemplateValue);
  15173. // Escape characters that can't be included in string literals.
  15174. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15175. // Replace delimiters with snippets.
  15176. if (escapeValue) {
  15177. isEscaping = true;
  15178. source += "' +\n__e(" + escapeValue + ") +\n'";
  15179. }
  15180. if (evaluateValue) {
  15181. isEvaluating = true;
  15182. source += "';\n" + evaluateValue + ";\n__p += '";
  15183. }
  15184. if (interpolateValue) {
  15185. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15186. }
  15187. index = offset + match.length;
  15188. // The JS engine embedded in Adobe products needs `match` returned in
  15189. // order to produce the correct `offset` value.
  15190. return match;
  15191. });
  15192. source += "';\n";
  15193. // If `variable` is not specified wrap a with-statement around the generated
  15194. // code to add the data object to the top of the scope chain.
  15195. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15196. if (!variable) {
  15197. source = 'with (obj) {\n' + source + '\n}\n';
  15198. }
  15199. // Throw an error if a forbidden character was found in `variable`, to prevent
  15200. // potential command injection attacks.
  15201. else if (reForbiddenIdentifierChars.test(variable)) {
  15202. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15203. }
  15204. // Cleanup code by stripping empty strings.
  15205. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15206. .replace(reEmptyStringMiddle, '$1')
  15207. .replace(reEmptyStringTrailing, '$1;');
  15208. // Frame code as the function body.
  15209. source = 'function(' + (variable || 'obj') + ') {\n' +
  15210. (variable
  15211. ? ''
  15212. : 'obj || (obj = {});\n'
  15213. ) +
  15214. "var __t, __p = ''" +
  15215. (isEscaping
  15216. ? ', __e = _.escape'
  15217. : ''
  15218. ) +
  15219. (isEvaluating
  15220. ? ', __j = Array.prototype.join;\n' +
  15221. "function print() { __p += __j.call(arguments, '') }\n"
  15222. : ';\n'
  15223. ) +
  15224. source +
  15225. 'return __p\n}';
  15226. var result = attempt(function() {
  15227. return Function(importsKeys, sourceURL + 'return ' + source)
  15228. .apply(undefined, importsValues);
  15229. });
  15230. // Provide the compiled function's source by its `toString` method or
  15231. // the `source` property as a convenience for inlining compiled templates.
  15232. result.source = source;
  15233. if (isError(result)) {
  15234. throw result;
  15235. }
  15236. return result;
  15237. }
  15238. /**
  15239. * Converts `string`, as a whole, to lower case just like
  15240. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15241. *
  15242. * @static
  15243. * @memberOf _
  15244. * @since 4.0.0
  15245. * @category String
  15246. * @param {string} [string=''] The string to convert.
  15247. * @returns {string} Returns the lower cased string.
  15248. * @example
  15249. *
  15250. * _.toLower('--Foo-Bar--');
  15251. * // => '--foo-bar--'
  15252. *
  15253. * _.toLower('fooBar');
  15254. * // => 'foobar'
  15255. *
  15256. * _.toLower('__FOO_BAR__');
  15257. * // => '__foo_bar__'
  15258. */
  15259. function toLower(value) {
  15260. return toString(value).toLowerCase();
  15261. }
  15262. /**
  15263. * Converts `string`, as a whole, to upper case just like
  15264. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15265. *
  15266. * @static
  15267. * @memberOf _
  15268. * @since 4.0.0
  15269. * @category String
  15270. * @param {string} [string=''] The string to convert.
  15271. * @returns {string} Returns the upper cased string.
  15272. * @example
  15273. *
  15274. * _.toUpper('--foo-bar--');
  15275. * // => '--FOO-BAR--'
  15276. *
  15277. * _.toUpper('fooBar');
  15278. * // => 'FOOBAR'
  15279. *
  15280. * _.toUpper('__foo_bar__');
  15281. * // => '__FOO_BAR__'
  15282. */
  15283. function toUpper(value) {
  15284. return toString(value).toUpperCase();
  15285. }
  15286. /**
  15287. * Removes leading and trailing whitespace or specified characters from `string`.
  15288. *
  15289. * @static
  15290. * @memberOf _
  15291. * @since 3.0.0
  15292. * @category String
  15293. * @param {string} [string=''] The string to trim.
  15294. * @param {string} [chars=whitespace] The characters to trim.
  15295. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15296. * @returns {string} Returns the trimmed string.
  15297. * @example
  15298. *
  15299. * _.trim(' abc ');
  15300. * // => 'abc'
  15301. *
  15302. * _.trim('-_-abc-_-', '_-');
  15303. * // => 'abc'
  15304. *
  15305. * _.map([' foo ', ' bar '], _.trim);
  15306. * // => ['foo', 'bar']
  15307. */
  15308. function trim(string, chars, guard) {
  15309. string = toString(string);
  15310. if (string && (guard || chars === undefined)) {
  15311. return baseTrim(string);
  15312. }
  15313. if (!string || !(chars = baseToString(chars))) {
  15314. return string;
  15315. }
  15316. var strSymbols = stringToArray(string),
  15317. chrSymbols = stringToArray(chars),
  15318. start = charsStartIndex(strSymbols, chrSymbols),
  15319. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15320. return castSlice(strSymbols, start, end).join('');
  15321. }
  15322. /**
  15323. * Removes trailing whitespace or specified characters from `string`.
  15324. *
  15325. * @static
  15326. * @memberOf _
  15327. * @since 4.0.0
  15328. * @category String
  15329. * @param {string} [string=''] The string to trim.
  15330. * @param {string} [chars=whitespace] The characters to trim.
  15331. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15332. * @returns {string} Returns the trimmed string.
  15333. * @example
  15334. *
  15335. * _.trimEnd(' abc ');
  15336. * // => ' abc'
  15337. *
  15338. * _.trimEnd('-_-abc-_-', '_-');
  15339. * // => '-_-abc'
  15340. */
  15341. function trimEnd(string, chars, guard) {
  15342. string = toString(string);
  15343. if (string && (guard || chars === undefined)) {
  15344. return string.slice(0, trimmedEndIndex(string) + 1);
  15345. }
  15346. if (!string || !(chars = baseToString(chars))) {
  15347. return string;
  15348. }
  15349. var strSymbols = stringToArray(string),
  15350. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15351. return castSlice(strSymbols, 0, end).join('');
  15352. }
  15353. /**
  15354. * Removes leading whitespace or specified characters from `string`.
  15355. *
  15356. * @static
  15357. * @memberOf _
  15358. * @since 4.0.0
  15359. * @category String
  15360. * @param {string} [string=''] The string to trim.
  15361. * @param {string} [chars=whitespace] The characters to trim.
  15362. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15363. * @returns {string} Returns the trimmed string.
  15364. * @example
  15365. *
  15366. * _.trimStart(' abc ');
  15367. * // => 'abc '
  15368. *
  15369. * _.trimStart('-_-abc-_-', '_-');
  15370. * // => 'abc-_-'
  15371. */
  15372. function trimStart(string, chars, guard) {
  15373. string = toString(string);
  15374. if (string && (guard || chars === undefined)) {
  15375. return string.replace(reTrimStart, '');
  15376. }
  15377. if (!string || !(chars = baseToString(chars))) {
  15378. return string;
  15379. }
  15380. var strSymbols = stringToArray(string),
  15381. start = charsStartIndex(strSymbols, stringToArray(chars));
  15382. return castSlice(strSymbols, start).join('');
  15383. }
  15384. /**
  15385. * Truncates `string` if it's longer than the given maximum string length.
  15386. * The last characters of the truncated string are replaced with the omission
  15387. * string which defaults to "...".
  15388. *
  15389. * @static
  15390. * @memberOf _
  15391. * @since 4.0.0
  15392. * @category String
  15393. * @param {string} [string=''] The string to truncate.
  15394. * @param {Object} [options={}] The options object.
  15395. * @param {number} [options.length=30] The maximum string length.
  15396. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15397. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15398. * @returns {string} Returns the truncated string.
  15399. * @example
  15400. *
  15401. * _.truncate('hi-diddly-ho there, neighborino');
  15402. * // => 'hi-diddly-ho there, neighbo...'
  15403. *
  15404. * _.truncate('hi-diddly-ho there, neighborino', {
  15405. * 'length': 24,
  15406. * 'separator': ' '
  15407. * });
  15408. * // => 'hi-diddly-ho there,...'
  15409. *
  15410. * _.truncate('hi-diddly-ho there, neighborino', {
  15411. * 'length': 24,
  15412. * 'separator': /,? +/
  15413. * });
  15414. * // => 'hi-diddly-ho there...'
  15415. *
  15416. * _.truncate('hi-diddly-ho there, neighborino', {
  15417. * 'omission': ' [...]'
  15418. * });
  15419. * // => 'hi-diddly-ho there, neig [...]'
  15420. */
  15421. function truncate(string, options) {
  15422. var length = DEFAULT_TRUNC_LENGTH,
  15423. omission = DEFAULT_TRUNC_OMISSION;
  15424. if (isObject(options)) {
  15425. var separator = 'separator' in options ? options.separator : separator;
  15426. length = 'length' in options ? toInteger(options.length) : length;
  15427. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15428. }
  15429. string = toString(string);
  15430. var strLength = string.length;
  15431. if (hasUnicode(string)) {
  15432. var strSymbols = stringToArray(string);
  15433. strLength = strSymbols.length;
  15434. }
  15435. if (length >= strLength) {
  15436. return string;
  15437. }
  15438. var end = length - stringSize(omission);
  15439. if (end < 1) {
  15440. return omission;
  15441. }
  15442. var result = strSymbols
  15443. ? castSlice(strSymbols, 0, end).join('')
  15444. : string.slice(0, end);
  15445. if (separator === undefined) {
  15446. return result + omission;
  15447. }
  15448. if (strSymbols) {
  15449. end += (result.length - end);
  15450. }
  15451. if (isRegExp(separator)) {
  15452. if (string.slice(end).search(separator)) {
  15453. var match,
  15454. substring = result;
  15455. if (!separator.global) {
  15456. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15457. }
  15458. separator.lastIndex = 0;
  15459. while ((match = separator.exec(substring))) {
  15460. var newEnd = match.index;
  15461. }
  15462. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15463. }
  15464. } else if (string.indexOf(baseToString(separator), end) != end) {
  15465. var index = result.lastIndexOf(separator);
  15466. if (index > -1) {
  15467. result = result.slice(0, index);
  15468. }
  15469. }
  15470. return result + omission;
  15471. }
  15472. /**
  15473. * The inverse of `_.escape`; this method converts the HTML entities
  15474. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15475. * their corresponding characters.
  15476. *
  15477. * **Note:** No other HTML entities are unescaped. To unescape additional
  15478. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15479. *
  15480. * @static
  15481. * @memberOf _
  15482. * @since 0.6.0
  15483. * @category String
  15484. * @param {string} [string=''] The string to unescape.
  15485. * @returns {string} Returns the unescaped string.
  15486. * @example
  15487. *
  15488. * _.unescape('fred, barney, &amp; pebbles');
  15489. * // => 'fred, barney, & pebbles'
  15490. */
  15491. function unescape(string) {
  15492. string = toString(string);
  15493. return (string && reHasEscapedHtml.test(string))
  15494. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15495. : string;
  15496. }
  15497. /**
  15498. * Converts `string`, as space separated words, to upper case.
  15499. *
  15500. * @static
  15501. * @memberOf _
  15502. * @since 4.0.0
  15503. * @category String
  15504. * @param {string} [string=''] The string to convert.
  15505. * @returns {string} Returns the upper cased string.
  15506. * @example
  15507. *
  15508. * _.upperCase('--foo-bar');
  15509. * // => 'FOO BAR'
  15510. *
  15511. * _.upperCase('fooBar');
  15512. * // => 'FOO BAR'
  15513. *
  15514. * _.upperCase('__foo_bar__');
  15515. * // => 'FOO BAR'
  15516. */
  15517. var upperCase = createCompounder(function(result, word, index) {
  15518. return result + (index ? ' ' : '') + word.toUpperCase();
  15519. });
  15520. /**
  15521. * Converts the first character of `string` to upper case.
  15522. *
  15523. * @static
  15524. * @memberOf _
  15525. * @since 4.0.0
  15526. * @category String
  15527. * @param {string} [string=''] The string to convert.
  15528. * @returns {string} Returns the converted string.
  15529. * @example
  15530. *
  15531. * _.upperFirst('fred');
  15532. * // => 'Fred'
  15533. *
  15534. * _.upperFirst('FRED');
  15535. * // => 'FRED'
  15536. */
  15537. var upperFirst = createCaseFirst('toUpperCase');
  15538. /**
  15539. * Splits `string` into an array of its words.
  15540. *
  15541. * @static
  15542. * @memberOf _
  15543. * @since 3.0.0
  15544. * @category String
  15545. * @param {string} [string=''] The string to inspect.
  15546. * @param {RegExp|string} [pattern] The pattern to match words.
  15547. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15548. * @returns {Array} Returns the words of `string`.
  15549. * @example
  15550. *
  15551. * _.words('fred, barney, & pebbles');
  15552. * // => ['fred', 'barney', 'pebbles']
  15553. *
  15554. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15555. * // => ['fred', 'barney', '&', 'pebbles']
  15556. */
  15557. function words(string, pattern, guard) {
  15558. string = toString(string);
  15559. pattern = guard ? undefined : pattern;
  15560. if (pattern === undefined) {
  15561. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15562. }
  15563. return string.match(pattern) || [];
  15564. }
  15565. /*------------------------------------------------------------------------*/
  15566. /**
  15567. * Attempts to invoke `func`, returning either the result or the caught error
  15568. * object. Any additional arguments are provided to `func` when it's invoked.
  15569. *
  15570. * @static
  15571. * @memberOf _
  15572. * @since 3.0.0
  15573. * @category Util
  15574. * @param {Function} func The function to attempt.
  15575. * @param {...*} [args] The arguments to invoke `func` with.
  15576. * @returns {*} Returns the `func` result or error object.
  15577. * @example
  15578. *
  15579. * // Avoid throwing errors for invalid selectors.
  15580. * var elements = _.attempt(function(selector) {
  15581. * return document.querySelectorAll(selector);
  15582. * }, '>_>');
  15583. *
  15584. * if (_.isError(elements)) {
  15585. * elements = [];
  15586. * }
  15587. */
  15588. var attempt = baseRest(function(func, args) {
  15589. try {
  15590. return apply(func, undefined, args);
  15591. } catch (e) {
  15592. return isError(e) ? e : new Error(e);
  15593. }
  15594. });
  15595. /**
  15596. * Binds methods of an object to the object itself, overwriting the existing
  15597. * method.
  15598. *
  15599. * **Note:** This method doesn't set the "length" property of bound functions.
  15600. *
  15601. * @static
  15602. * @since 0.1.0
  15603. * @memberOf _
  15604. * @category Util
  15605. * @param {Object} object The object to bind and assign the bound methods to.
  15606. * @param {...(string|string[])} methodNames The object method names to bind.
  15607. * @returns {Object} Returns `object`.
  15608. * @example
  15609. *
  15610. * var view = {
  15611. * 'label': 'docs',
  15612. * 'click': function() {
  15613. * console.log('clicked ' + this.label);
  15614. * }
  15615. * };
  15616. *
  15617. * _.bindAll(view, ['click']);
  15618. * jQuery(element).on('click', view.click);
  15619. * // => Logs 'clicked docs' when clicked.
  15620. */
  15621. var bindAll = flatRest(function(object, methodNames) {
  15622. arrayEach(methodNames, function(key) {
  15623. key = toKey(key);
  15624. baseAssignValue(object, key, bind(object[key], object));
  15625. });
  15626. return object;
  15627. });
  15628. /**
  15629. * Creates a function that iterates over `pairs` and invokes the corresponding
  15630. * function of the first predicate to return truthy. The predicate-function
  15631. * pairs are invoked with the `this` binding and arguments of the created
  15632. * function.
  15633. *
  15634. * @static
  15635. * @memberOf _
  15636. * @since 4.0.0
  15637. * @category Util
  15638. * @param {Array} pairs The predicate-function pairs.
  15639. * @returns {Function} Returns the new composite function.
  15640. * @example
  15641. *
  15642. * var func = _.cond([
  15643. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15644. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15645. * [_.stubTrue, _.constant('no match')]
  15646. * ]);
  15647. *
  15648. * func({ 'a': 1, 'b': 2 });
  15649. * // => 'matches A'
  15650. *
  15651. * func({ 'a': 0, 'b': 1 });
  15652. * // => 'matches B'
  15653. *
  15654. * func({ 'a': '1', 'b': '2' });
  15655. * // => 'no match'
  15656. */
  15657. function cond(pairs) {
  15658. var length = pairs == null ? 0 : pairs.length,
  15659. toIteratee = getIteratee();
  15660. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15661. if (typeof pair[1] != 'function') {
  15662. throw new TypeError(FUNC_ERROR_TEXT);
  15663. }
  15664. return [toIteratee(pair[0]), pair[1]];
  15665. });
  15666. return baseRest(function(args) {
  15667. var index = -1;
  15668. while (++index < length) {
  15669. var pair = pairs[index];
  15670. if (apply(pair[0], this, args)) {
  15671. return apply(pair[1], this, args);
  15672. }
  15673. }
  15674. });
  15675. }
  15676. /**
  15677. * Creates a function that invokes the predicate properties of `source` with
  15678. * the corresponding property values of a given object, returning `true` if
  15679. * all predicates return truthy, else `false`.
  15680. *
  15681. * **Note:** The created function is equivalent to `_.conformsTo` with
  15682. * `source` partially applied.
  15683. *
  15684. * @static
  15685. * @memberOf _
  15686. * @since 4.0.0
  15687. * @category Util
  15688. * @param {Object} source The object of property predicates to conform to.
  15689. * @returns {Function} Returns the new spec function.
  15690. * @example
  15691. *
  15692. * var objects = [
  15693. * { 'a': 2, 'b': 1 },
  15694. * { 'a': 1, 'b': 2 }
  15695. * ];
  15696. *
  15697. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15698. * // => [{ 'a': 1, 'b': 2 }]
  15699. */
  15700. function conforms(source) {
  15701. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15702. }
  15703. /**
  15704. * Creates a function that returns `value`.
  15705. *
  15706. * @static
  15707. * @memberOf _
  15708. * @since 2.4.0
  15709. * @category Util
  15710. * @param {*} value The value to return from the new function.
  15711. * @returns {Function} Returns the new constant function.
  15712. * @example
  15713. *
  15714. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15715. *
  15716. * console.log(objects);
  15717. * // => [{ 'a': 1 }, { 'a': 1 }]
  15718. *
  15719. * console.log(objects[0] === objects[1]);
  15720. * // => true
  15721. */
  15722. function constant(value) {
  15723. return function() {
  15724. return value;
  15725. };
  15726. }
  15727. /**
  15728. * Checks `value` to determine whether a default value should be returned in
  15729. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15730. * or `undefined`.
  15731. *
  15732. * @static
  15733. * @memberOf _
  15734. * @since 4.14.0
  15735. * @category Util
  15736. * @param {*} value The value to check.
  15737. * @param {*} defaultValue The default value.
  15738. * @returns {*} Returns the resolved value.
  15739. * @example
  15740. *
  15741. * _.defaultTo(1, 10);
  15742. * // => 1
  15743. *
  15744. * _.defaultTo(undefined, 10);
  15745. * // => 10
  15746. */
  15747. function defaultTo(value, defaultValue) {
  15748. return (value == null || value !== value) ? defaultValue : value;
  15749. }
  15750. /**
  15751. * Creates a function that returns the result of invoking the given functions
  15752. * with the `this` binding of the created function, where each successive
  15753. * invocation is supplied the return value of the previous.
  15754. *
  15755. * @static
  15756. * @memberOf _
  15757. * @since 3.0.0
  15758. * @category Util
  15759. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15760. * @returns {Function} Returns the new composite function.
  15761. * @see _.flowRight
  15762. * @example
  15763. *
  15764. * function square(n) {
  15765. * return n * n;
  15766. * }
  15767. *
  15768. * var addSquare = _.flow([_.add, square]);
  15769. * addSquare(1, 2);
  15770. * // => 9
  15771. */
  15772. var flow = createFlow();
  15773. /**
  15774. * This method is like `_.flow` except that it creates a function that
  15775. * invokes the given functions from right to left.
  15776. *
  15777. * @static
  15778. * @since 3.0.0
  15779. * @memberOf _
  15780. * @category Util
  15781. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15782. * @returns {Function} Returns the new composite function.
  15783. * @see _.flow
  15784. * @example
  15785. *
  15786. * function square(n) {
  15787. * return n * n;
  15788. * }
  15789. *
  15790. * var addSquare = _.flowRight([square, _.add]);
  15791. * addSquare(1, 2);
  15792. * // => 9
  15793. */
  15794. var flowRight = createFlow(true);
  15795. /**
  15796. * This method returns the first argument it receives.
  15797. *
  15798. * @static
  15799. * @since 0.1.0
  15800. * @memberOf _
  15801. * @category Util
  15802. * @param {*} value Any value.
  15803. * @returns {*} Returns `value`.
  15804. * @example
  15805. *
  15806. * var object = { 'a': 1 };
  15807. *
  15808. * console.log(_.identity(object) === object);
  15809. * // => true
  15810. */
  15811. function identity(value) {
  15812. return value;
  15813. }
  15814. /**
  15815. * Creates a function that invokes `func` with the arguments of the created
  15816. * function. If `func` is a property name, the created function returns the
  15817. * property value for a given element. If `func` is an array or object, the
  15818. * created function returns `true` for elements that contain the equivalent
  15819. * source properties, otherwise it returns `false`.
  15820. *
  15821. * @static
  15822. * @since 4.0.0
  15823. * @memberOf _
  15824. * @category Util
  15825. * @param {*} [func=_.identity] The value to convert to a callback.
  15826. * @returns {Function} Returns the callback.
  15827. * @example
  15828. *
  15829. * var users = [
  15830. * { 'user': 'barney', 'age': 36, 'active': true },
  15831. * { 'user': 'fred', 'age': 40, 'active': false }
  15832. * ];
  15833. *
  15834. * // The `_.matches` iteratee shorthand.
  15835. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15836. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15837. *
  15838. * // The `_.matchesProperty` iteratee shorthand.
  15839. * _.filter(users, _.iteratee(['user', 'fred']));
  15840. * // => [{ 'user': 'fred', 'age': 40 }]
  15841. *
  15842. * // The `_.property` iteratee shorthand.
  15843. * _.map(users, _.iteratee('user'));
  15844. * // => ['barney', 'fred']
  15845. *
  15846. * // Create custom iteratee shorthands.
  15847. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15848. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15849. * return func.test(string);
  15850. * };
  15851. * });
  15852. *
  15853. * _.filter(['abc', 'def'], /ef/);
  15854. * // => ['def']
  15855. */
  15856. function iteratee(func) {
  15857. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15858. }
  15859. /**
  15860. * Creates a function that performs a partial deep comparison between a given
  15861. * object and `source`, returning `true` if the given object has equivalent
  15862. * property values, else `false`.
  15863. *
  15864. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15865. * partially applied.
  15866. *
  15867. * Partial comparisons will match empty array and empty object `source`
  15868. * values against any array or object value, respectively. See `_.isEqual`
  15869. * for a list of supported value comparisons.
  15870. *
  15871. * **Note:** Multiple values can be checked by combining several matchers
  15872. * using `_.overSome`
  15873. *
  15874. * @static
  15875. * @memberOf _
  15876. * @since 3.0.0
  15877. * @category Util
  15878. * @param {Object} source The object of property values to match.
  15879. * @returns {Function} Returns the new spec function.
  15880. * @example
  15881. *
  15882. * var objects = [
  15883. * { 'a': 1, 'b': 2, 'c': 3 },
  15884. * { 'a': 4, 'b': 5, 'c': 6 }
  15885. * ];
  15886. *
  15887. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15888. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15889. *
  15890. * // Checking for several possible values
  15891. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15892. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15893. */
  15894. function matches(source) {
  15895. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15896. }
  15897. /**
  15898. * Creates a function that performs a partial deep comparison between the
  15899. * value at `path` of a given object to `srcValue`, returning `true` if the
  15900. * object value is equivalent, else `false`.
  15901. *
  15902. * **Note:** Partial comparisons will match empty array and empty object
  15903. * `srcValue` values against any array or object value, respectively. See
  15904. * `_.isEqual` for a list of supported value comparisons.
  15905. *
  15906. * **Note:** Multiple values can be checked by combining several matchers
  15907. * using `_.overSome`
  15908. *
  15909. * @static
  15910. * @memberOf _
  15911. * @since 3.2.0
  15912. * @category Util
  15913. * @param {Array|string} path The path of the property to get.
  15914. * @param {*} srcValue The value to match.
  15915. * @returns {Function} Returns the new spec function.
  15916. * @example
  15917. *
  15918. * var objects = [
  15919. * { 'a': 1, 'b': 2, 'c': 3 },
  15920. * { 'a': 4, 'b': 5, 'c': 6 }
  15921. * ];
  15922. *
  15923. * _.find(objects, _.matchesProperty('a', 4));
  15924. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15925. *
  15926. * // Checking for several possible values
  15927. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15928. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15929. */
  15930. function matchesProperty(path, srcValue) {
  15931. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15932. }
  15933. /**
  15934. * Creates a function that invokes the method at `path` of a given object.
  15935. * Any additional arguments are provided to the invoked method.
  15936. *
  15937. * @static
  15938. * @memberOf _
  15939. * @since 3.7.0
  15940. * @category Util
  15941. * @param {Array|string} path The path of the method to invoke.
  15942. * @param {...*} [args] The arguments to invoke the method with.
  15943. * @returns {Function} Returns the new invoker function.
  15944. * @example
  15945. *
  15946. * var objects = [
  15947. * { 'a': { 'b': _.constant(2) } },
  15948. * { 'a': { 'b': _.constant(1) } }
  15949. * ];
  15950. *
  15951. * _.map(objects, _.method('a.b'));
  15952. * // => [2, 1]
  15953. *
  15954. * _.map(objects, _.method(['a', 'b']));
  15955. * // => [2, 1]
  15956. */
  15957. var method = baseRest(function(path, args) {
  15958. return function(object) {
  15959. return baseInvoke(object, path, args);
  15960. };
  15961. });
  15962. /**
  15963. * The opposite of `_.method`; this method creates a function that invokes
  15964. * the method at a given path of `object`. Any additional arguments are
  15965. * provided to the invoked method.
  15966. *
  15967. * @static
  15968. * @memberOf _
  15969. * @since 3.7.0
  15970. * @category Util
  15971. * @param {Object} object The object to query.
  15972. * @param {...*} [args] The arguments to invoke the method with.
  15973. * @returns {Function} Returns the new invoker function.
  15974. * @example
  15975. *
  15976. * var array = _.times(3, _.constant),
  15977. * object = { 'a': array, 'b': array, 'c': array };
  15978. *
  15979. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15980. * // => [2, 0]
  15981. *
  15982. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15983. * // => [2, 0]
  15984. */
  15985. var methodOf = baseRest(function(object, args) {
  15986. return function(path) {
  15987. return baseInvoke(object, path, args);
  15988. };
  15989. });
  15990. /**
  15991. * Adds all own enumerable string keyed function properties of a source
  15992. * object to the destination object. If `object` is a function, then methods
  15993. * are added to its prototype as well.
  15994. *
  15995. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15996. * avoid conflicts caused by modifying the original.
  15997. *
  15998. * @static
  15999. * @since 0.1.0
  16000. * @memberOf _
  16001. * @category Util
  16002. * @param {Function|Object} [object=lodash] The destination object.
  16003. * @param {Object} source The object of functions to add.
  16004. * @param {Object} [options={}] The options object.
  16005. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16006. * @returns {Function|Object} Returns `object`.
  16007. * @example
  16008. *
  16009. * function vowels(string) {
  16010. * return _.filter(string, function(v) {
  16011. * return /[aeiou]/i.test(v);
  16012. * });
  16013. * }
  16014. *
  16015. * _.mixin({ 'vowels': vowels });
  16016. * _.vowels('fred');
  16017. * // => ['e']
  16018. *
  16019. * _('fred').vowels().value();
  16020. * // => ['e']
  16021. *
  16022. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16023. * _('fred').vowels();
  16024. * // => ['e']
  16025. */
  16026. function mixin(object, source, options) {
  16027. var props = keys(source),
  16028. methodNames = baseFunctions(source, props);
  16029. if (options == null &&
  16030. !(isObject(source) && (methodNames.length || !props.length))) {
  16031. options = source;
  16032. source = object;
  16033. object = this;
  16034. methodNames = baseFunctions(source, keys(source));
  16035. }
  16036. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16037. isFunc = isFunction(object);
  16038. arrayEach(methodNames, function(methodName) {
  16039. var func = source[methodName];
  16040. object[methodName] = func;
  16041. if (isFunc) {
  16042. object.prototype[methodName] = function() {
  16043. var chainAll = this.__chain__;
  16044. if (chain || chainAll) {
  16045. var result = object(this.__wrapped__),
  16046. actions = result.__actions__ = copyArray(this.__actions__);
  16047. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16048. result.__chain__ = chainAll;
  16049. return result;
  16050. }
  16051. return func.apply(object, arrayPush([this.value()], arguments));
  16052. };
  16053. }
  16054. });
  16055. return object;
  16056. }
  16057. /**
  16058. * Reverts the `_` variable to its previous value and returns a reference to
  16059. * the `lodash` function.
  16060. *
  16061. * @static
  16062. * @since 0.1.0
  16063. * @memberOf _
  16064. * @category Util
  16065. * @returns {Function} Returns the `lodash` function.
  16066. * @example
  16067. *
  16068. * var lodash = _.noConflict();
  16069. */
  16070. function noConflict() {
  16071. if (root._ === this) {
  16072. root._ = oldDash;
  16073. }
  16074. return this;
  16075. }
  16076. /**
  16077. * This method returns `undefined`.
  16078. *
  16079. * @static
  16080. * @memberOf _
  16081. * @since 2.3.0
  16082. * @category Util
  16083. * @example
  16084. *
  16085. * _.times(2, _.noop);
  16086. * // => [undefined, undefined]
  16087. */
  16088. function noop() {
  16089. // No operation performed.
  16090. }
  16091. /**
  16092. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16093. * the nth argument from the end is returned.
  16094. *
  16095. * @static
  16096. * @memberOf _
  16097. * @since 4.0.0
  16098. * @category Util
  16099. * @param {number} [n=0] The index of the argument to return.
  16100. * @returns {Function} Returns the new pass-thru function.
  16101. * @example
  16102. *
  16103. * var func = _.nthArg(1);
  16104. * func('a', 'b', 'c', 'd');
  16105. * // => 'b'
  16106. *
  16107. * var func = _.nthArg(-2);
  16108. * func('a', 'b', 'c', 'd');
  16109. * // => 'c'
  16110. */
  16111. function nthArg(n) {
  16112. n = toInteger(n);
  16113. return baseRest(function(args) {
  16114. return baseNth(args, n);
  16115. });
  16116. }
  16117. /**
  16118. * Creates a function that invokes `iteratees` with the arguments it receives
  16119. * and returns their results.
  16120. *
  16121. * @static
  16122. * @memberOf _
  16123. * @since 4.0.0
  16124. * @category Util
  16125. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16126. * The iteratees to invoke.
  16127. * @returns {Function} Returns the new function.
  16128. * @example
  16129. *
  16130. * var func = _.over([Math.max, Math.min]);
  16131. *
  16132. * func(1, 2, 3, 4);
  16133. * // => [4, 1]
  16134. */
  16135. var over = createOver(arrayMap);
  16136. /**
  16137. * Creates a function that checks if **all** of the `predicates` return
  16138. * truthy when invoked with the arguments it receives.
  16139. *
  16140. * Following shorthands are possible for providing predicates.
  16141. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16142. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16143. *
  16144. * @static
  16145. * @memberOf _
  16146. * @since 4.0.0
  16147. * @category Util
  16148. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16149. * The predicates to check.
  16150. * @returns {Function} Returns the new function.
  16151. * @example
  16152. *
  16153. * var func = _.overEvery([Boolean, isFinite]);
  16154. *
  16155. * func('1');
  16156. * // => true
  16157. *
  16158. * func(null);
  16159. * // => false
  16160. *
  16161. * func(NaN);
  16162. * // => false
  16163. */
  16164. var overEvery = createOver(arrayEvery);
  16165. /**
  16166. * Creates a function that checks if **any** of the `predicates` return
  16167. * truthy when invoked with the arguments it receives.
  16168. *
  16169. * Following shorthands are possible for providing predicates.
  16170. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16171. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16172. *
  16173. * @static
  16174. * @memberOf _
  16175. * @since 4.0.0
  16176. * @category Util
  16177. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16178. * The predicates to check.
  16179. * @returns {Function} Returns the new function.
  16180. * @example
  16181. *
  16182. * var func = _.overSome([Boolean, isFinite]);
  16183. *
  16184. * func('1');
  16185. * // => true
  16186. *
  16187. * func(null);
  16188. * // => true
  16189. *
  16190. * func(NaN);
  16191. * // => false
  16192. *
  16193. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16194. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16195. */
  16196. var overSome = createOver(arraySome);
  16197. /**
  16198. * Creates a function that returns the value at `path` of a given object.
  16199. *
  16200. * @static
  16201. * @memberOf _
  16202. * @since 2.4.0
  16203. * @category Util
  16204. * @param {Array|string} path The path of the property to get.
  16205. * @returns {Function} Returns the new accessor function.
  16206. * @example
  16207. *
  16208. * var objects = [
  16209. * { 'a': { 'b': 2 } },
  16210. * { 'a': { 'b': 1 } }
  16211. * ];
  16212. *
  16213. * _.map(objects, _.property('a.b'));
  16214. * // => [2, 1]
  16215. *
  16216. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16217. * // => [1, 2]
  16218. */
  16219. function property(path) {
  16220. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16221. }
  16222. /**
  16223. * The opposite of `_.property`; this method creates a function that returns
  16224. * the value at a given path of `object`.
  16225. *
  16226. * @static
  16227. * @memberOf _
  16228. * @since 3.0.0
  16229. * @category Util
  16230. * @param {Object} object The object to query.
  16231. * @returns {Function} Returns the new accessor function.
  16232. * @example
  16233. *
  16234. * var array = [0, 1, 2],
  16235. * object = { 'a': array, 'b': array, 'c': array };
  16236. *
  16237. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16238. * // => [2, 0]
  16239. *
  16240. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16241. * // => [2, 0]
  16242. */
  16243. function propertyOf(object) {
  16244. return function(path) {
  16245. return object == null ? undefined : baseGet(object, path);
  16246. };
  16247. }
  16248. /**
  16249. * Creates an array of numbers (positive and/or negative) progressing from
  16250. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16251. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16252. * it's set to `start` with `start` then set to `0`.
  16253. *
  16254. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16255. * floating-point values which can produce unexpected results.
  16256. *
  16257. * @static
  16258. * @since 0.1.0
  16259. * @memberOf _
  16260. * @category Util
  16261. * @param {number} [start=0] The start of the range.
  16262. * @param {number} end The end of the range.
  16263. * @param {number} [step=1] The value to increment or decrement by.
  16264. * @returns {Array} Returns the range of numbers.
  16265. * @see _.inRange, _.rangeRight
  16266. * @example
  16267. *
  16268. * _.range(4);
  16269. * // => [0, 1, 2, 3]
  16270. *
  16271. * _.range(-4);
  16272. * // => [0, -1, -2, -3]
  16273. *
  16274. * _.range(1, 5);
  16275. * // => [1, 2, 3, 4]
  16276. *
  16277. * _.range(0, 20, 5);
  16278. * // => [0, 5, 10, 15]
  16279. *
  16280. * _.range(0, -4, -1);
  16281. * // => [0, -1, -2, -3]
  16282. *
  16283. * _.range(1, 4, 0);
  16284. * // => [1, 1, 1]
  16285. *
  16286. * _.range(0);
  16287. * // => []
  16288. */
  16289. var range = createRange();
  16290. /**
  16291. * This method is like `_.range` except that it populates values in
  16292. * descending order.
  16293. *
  16294. * @static
  16295. * @memberOf _
  16296. * @since 4.0.0
  16297. * @category Util
  16298. * @param {number} [start=0] The start of the range.
  16299. * @param {number} end The end of the range.
  16300. * @param {number} [step=1] The value to increment or decrement by.
  16301. * @returns {Array} Returns the range of numbers.
  16302. * @see _.inRange, _.range
  16303. * @example
  16304. *
  16305. * _.rangeRight(4);
  16306. * // => [3, 2, 1, 0]
  16307. *
  16308. * _.rangeRight(-4);
  16309. * // => [-3, -2, -1, 0]
  16310. *
  16311. * _.rangeRight(1, 5);
  16312. * // => [4, 3, 2, 1]
  16313. *
  16314. * _.rangeRight(0, 20, 5);
  16315. * // => [15, 10, 5, 0]
  16316. *
  16317. * _.rangeRight(0, -4, -1);
  16318. * // => [-3, -2, -1, 0]
  16319. *
  16320. * _.rangeRight(1, 4, 0);
  16321. * // => [1, 1, 1]
  16322. *
  16323. * _.rangeRight(0);
  16324. * // => []
  16325. */
  16326. var rangeRight = createRange(true);
  16327. /**
  16328. * This method returns a new empty array.
  16329. *
  16330. * @static
  16331. * @memberOf _
  16332. * @since 4.13.0
  16333. * @category Util
  16334. * @returns {Array} Returns the new empty array.
  16335. * @example
  16336. *
  16337. * var arrays = _.times(2, _.stubArray);
  16338. *
  16339. * console.log(arrays);
  16340. * // => [[], []]
  16341. *
  16342. * console.log(arrays[0] === arrays[1]);
  16343. * // => false
  16344. */
  16345. function stubArray() {
  16346. return [];
  16347. }
  16348. /**
  16349. * This method returns `false`.
  16350. *
  16351. * @static
  16352. * @memberOf _
  16353. * @since 4.13.0
  16354. * @category Util
  16355. * @returns {boolean} Returns `false`.
  16356. * @example
  16357. *
  16358. * _.times(2, _.stubFalse);
  16359. * // => [false, false]
  16360. */
  16361. function stubFalse() {
  16362. return false;
  16363. }
  16364. /**
  16365. * This method returns a new empty object.
  16366. *
  16367. * @static
  16368. * @memberOf _
  16369. * @since 4.13.0
  16370. * @category Util
  16371. * @returns {Object} Returns the new empty object.
  16372. * @example
  16373. *
  16374. * var objects = _.times(2, _.stubObject);
  16375. *
  16376. * console.log(objects);
  16377. * // => [{}, {}]
  16378. *
  16379. * console.log(objects[0] === objects[1]);
  16380. * // => false
  16381. */
  16382. function stubObject() {
  16383. return {};
  16384. }
  16385. /**
  16386. * This method returns an empty string.
  16387. *
  16388. * @static
  16389. * @memberOf _
  16390. * @since 4.13.0
  16391. * @category Util
  16392. * @returns {string} Returns the empty string.
  16393. * @example
  16394. *
  16395. * _.times(2, _.stubString);
  16396. * // => ['', '']
  16397. */
  16398. function stubString() {
  16399. return '';
  16400. }
  16401. /**
  16402. * This method returns `true`.
  16403. *
  16404. * @static
  16405. * @memberOf _
  16406. * @since 4.13.0
  16407. * @category Util
  16408. * @returns {boolean} Returns `true`.
  16409. * @example
  16410. *
  16411. * _.times(2, _.stubTrue);
  16412. * // => [true, true]
  16413. */
  16414. function stubTrue() {
  16415. return true;
  16416. }
  16417. /**
  16418. * Invokes the iteratee `n` times, returning an array of the results of
  16419. * each invocation. The iteratee is invoked with one argument; (index).
  16420. *
  16421. * @static
  16422. * @since 0.1.0
  16423. * @memberOf _
  16424. * @category Util
  16425. * @param {number} n The number of times to invoke `iteratee`.
  16426. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16427. * @returns {Array} Returns the array of results.
  16428. * @example
  16429. *
  16430. * _.times(3, String);
  16431. * // => ['0', '1', '2']
  16432. *
  16433. * _.times(4, _.constant(0));
  16434. * // => [0, 0, 0, 0]
  16435. */
  16436. function times(n, iteratee) {
  16437. n = toInteger(n);
  16438. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16439. return [];
  16440. }
  16441. var index = MAX_ARRAY_LENGTH,
  16442. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16443. iteratee = getIteratee(iteratee);
  16444. n -= MAX_ARRAY_LENGTH;
  16445. var result = baseTimes(length, iteratee);
  16446. while (++index < n) {
  16447. iteratee(index);
  16448. }
  16449. return result;
  16450. }
  16451. /**
  16452. * Converts `value` to a property path array.
  16453. *
  16454. * @static
  16455. * @memberOf _
  16456. * @since 4.0.0
  16457. * @category Util
  16458. * @param {*} value The value to convert.
  16459. * @returns {Array} Returns the new property path array.
  16460. * @example
  16461. *
  16462. * _.toPath('a.b.c');
  16463. * // => ['a', 'b', 'c']
  16464. *
  16465. * _.toPath('a[0].b.c');
  16466. * // => ['a', '0', 'b', 'c']
  16467. */
  16468. function toPath(value) {
  16469. if (isArray(value)) {
  16470. return arrayMap(value, toKey);
  16471. }
  16472. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16473. }
  16474. /**
  16475. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16476. *
  16477. * @static
  16478. * @since 0.1.0
  16479. * @memberOf _
  16480. * @category Util
  16481. * @param {string} [prefix=''] The value to prefix the ID with.
  16482. * @returns {string} Returns the unique ID.
  16483. * @example
  16484. *
  16485. * _.uniqueId('contact_');
  16486. * // => 'contact_104'
  16487. *
  16488. * _.uniqueId();
  16489. * // => '105'
  16490. */
  16491. function uniqueId(prefix) {
  16492. var id = ++idCounter;
  16493. return toString(prefix) + id;
  16494. }
  16495. /*------------------------------------------------------------------------*/
  16496. /**
  16497. * Adds two numbers.
  16498. *
  16499. * @static
  16500. * @memberOf _
  16501. * @since 3.4.0
  16502. * @category Math
  16503. * @param {number} augend The first number in an addition.
  16504. * @param {number} addend The second number in an addition.
  16505. * @returns {number} Returns the total.
  16506. * @example
  16507. *
  16508. * _.add(6, 4);
  16509. * // => 10
  16510. */
  16511. var add = createMathOperation(function(augend, addend) {
  16512. return augend + addend;
  16513. }, 0);
  16514. /**
  16515. * Computes `number` rounded up to `precision`.
  16516. *
  16517. * @static
  16518. * @memberOf _
  16519. * @since 3.10.0
  16520. * @category Math
  16521. * @param {number} number The number to round up.
  16522. * @param {number} [precision=0] The precision to round up to.
  16523. * @returns {number} Returns the rounded up number.
  16524. * @example
  16525. *
  16526. * _.ceil(4.006);
  16527. * // => 5
  16528. *
  16529. * _.ceil(6.004, 2);
  16530. * // => 6.01
  16531. *
  16532. * _.ceil(6040, -2);
  16533. * // => 6100
  16534. */
  16535. var ceil = createRound('ceil');
  16536. /**
  16537. * Divide two numbers.
  16538. *
  16539. * @static
  16540. * @memberOf _
  16541. * @since 4.7.0
  16542. * @category Math
  16543. * @param {number} dividend The first number in a division.
  16544. * @param {number} divisor The second number in a division.
  16545. * @returns {number} Returns the quotient.
  16546. * @example
  16547. *
  16548. * _.divide(6, 4);
  16549. * // => 1.5
  16550. */
  16551. var divide = createMathOperation(function(dividend, divisor) {
  16552. return dividend / divisor;
  16553. }, 1);
  16554. /**
  16555. * Computes `number` rounded down to `precision`.
  16556. *
  16557. * @static
  16558. * @memberOf _
  16559. * @since 3.10.0
  16560. * @category Math
  16561. * @param {number} number The number to round down.
  16562. * @param {number} [precision=0] The precision to round down to.
  16563. * @returns {number} Returns the rounded down number.
  16564. * @example
  16565. *
  16566. * _.floor(4.006);
  16567. * // => 4
  16568. *
  16569. * _.floor(0.046, 2);
  16570. * // => 0.04
  16571. *
  16572. * _.floor(4060, -2);
  16573. * // => 4000
  16574. */
  16575. var floor = createRound('floor');
  16576. /**
  16577. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16578. * `undefined` is returned.
  16579. *
  16580. * @static
  16581. * @since 0.1.0
  16582. * @memberOf _
  16583. * @category Math
  16584. * @param {Array} array The array to iterate over.
  16585. * @returns {*} Returns the maximum value.
  16586. * @example
  16587. *
  16588. * _.max([4, 2, 8, 6]);
  16589. * // => 8
  16590. *
  16591. * _.max([]);
  16592. * // => undefined
  16593. */
  16594. function max(array) {
  16595. return (array && array.length)
  16596. ? baseExtremum(array, identity, baseGt)
  16597. : undefined;
  16598. }
  16599. /**
  16600. * This method is like `_.max` except that it accepts `iteratee` which is
  16601. * invoked for each element in `array` to generate the criterion by which
  16602. * the value is ranked. The iteratee is invoked with one argument: (value).
  16603. *
  16604. * @static
  16605. * @memberOf _
  16606. * @since 4.0.0
  16607. * @category Math
  16608. * @param {Array} array The array to iterate over.
  16609. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16610. * @returns {*} Returns the maximum value.
  16611. * @example
  16612. *
  16613. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16614. *
  16615. * _.maxBy(objects, function(o) { return o.n; });
  16616. * // => { 'n': 2 }
  16617. *
  16618. * // The `_.property` iteratee shorthand.
  16619. * _.maxBy(objects, 'n');
  16620. * // => { 'n': 2 }
  16621. */
  16622. function maxBy(array, iteratee) {
  16623. return (array && array.length)
  16624. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16625. : undefined;
  16626. }
  16627. /**
  16628. * Computes the mean of the values in `array`.
  16629. *
  16630. * @static
  16631. * @memberOf _
  16632. * @since 4.0.0
  16633. * @category Math
  16634. * @param {Array} array The array to iterate over.
  16635. * @returns {number} Returns the mean.
  16636. * @example
  16637. *
  16638. * _.mean([4, 2, 8, 6]);
  16639. * // => 5
  16640. */
  16641. function mean(array) {
  16642. return baseMean(array, identity);
  16643. }
  16644. /**
  16645. * This method is like `_.mean` except that it accepts `iteratee` which is
  16646. * invoked for each element in `array` to generate the value to be averaged.
  16647. * The iteratee is invoked with one argument: (value).
  16648. *
  16649. * @static
  16650. * @memberOf _
  16651. * @since 4.7.0
  16652. * @category Math
  16653. * @param {Array} array The array to iterate over.
  16654. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16655. * @returns {number} Returns the mean.
  16656. * @example
  16657. *
  16658. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16659. *
  16660. * _.meanBy(objects, function(o) { return o.n; });
  16661. * // => 5
  16662. *
  16663. * // The `_.property` iteratee shorthand.
  16664. * _.meanBy(objects, 'n');
  16665. * // => 5
  16666. */
  16667. function meanBy(array, iteratee) {
  16668. return baseMean(array, getIteratee(iteratee, 2));
  16669. }
  16670. /**
  16671. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16672. * `undefined` is returned.
  16673. *
  16674. * @static
  16675. * @since 0.1.0
  16676. * @memberOf _
  16677. * @category Math
  16678. * @param {Array} array The array to iterate over.
  16679. * @returns {*} Returns the minimum value.
  16680. * @example
  16681. *
  16682. * _.min([4, 2, 8, 6]);
  16683. * // => 2
  16684. *
  16685. * _.min([]);
  16686. * // => undefined
  16687. */
  16688. function min(array) {
  16689. return (array && array.length)
  16690. ? baseExtremum(array, identity, baseLt)
  16691. : undefined;
  16692. }
  16693. /**
  16694. * This method is like `_.min` except that it accepts `iteratee` which is
  16695. * invoked for each element in `array` to generate the criterion by which
  16696. * the value is ranked. The iteratee is invoked with one argument: (value).
  16697. *
  16698. * @static
  16699. * @memberOf _
  16700. * @since 4.0.0
  16701. * @category Math
  16702. * @param {Array} array The array to iterate over.
  16703. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16704. * @returns {*} Returns the minimum value.
  16705. * @example
  16706. *
  16707. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16708. *
  16709. * _.minBy(objects, function(o) { return o.n; });
  16710. * // => { 'n': 1 }
  16711. *
  16712. * // The `_.property` iteratee shorthand.
  16713. * _.minBy(objects, 'n');
  16714. * // => { 'n': 1 }
  16715. */
  16716. function minBy(array, iteratee) {
  16717. return (array && array.length)
  16718. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16719. : undefined;
  16720. }
  16721. /**
  16722. * Multiply two numbers.
  16723. *
  16724. * @static
  16725. * @memberOf _
  16726. * @since 4.7.0
  16727. * @category Math
  16728. * @param {number} multiplier The first number in a multiplication.
  16729. * @param {number} multiplicand The second number in a multiplication.
  16730. * @returns {number} Returns the product.
  16731. * @example
  16732. *
  16733. * _.multiply(6, 4);
  16734. * // => 24
  16735. */
  16736. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16737. return multiplier * multiplicand;
  16738. }, 1);
  16739. /**
  16740. * Computes `number` rounded to `precision`.
  16741. *
  16742. * @static
  16743. * @memberOf _
  16744. * @since 3.10.0
  16745. * @category Math
  16746. * @param {number} number The number to round.
  16747. * @param {number} [precision=0] The precision to round to.
  16748. * @returns {number} Returns the rounded number.
  16749. * @example
  16750. *
  16751. * _.round(4.006);
  16752. * // => 4
  16753. *
  16754. * _.round(4.006, 2);
  16755. * // => 4.01
  16756. *
  16757. * _.round(4060, -2);
  16758. * // => 4100
  16759. */
  16760. var round = createRound('round');
  16761. /**
  16762. * Subtract two numbers.
  16763. *
  16764. * @static
  16765. * @memberOf _
  16766. * @since 4.0.0
  16767. * @category Math
  16768. * @param {number} minuend The first number in a subtraction.
  16769. * @param {number} subtrahend The second number in a subtraction.
  16770. * @returns {number} Returns the difference.
  16771. * @example
  16772. *
  16773. * _.subtract(6, 4);
  16774. * // => 2
  16775. */
  16776. var subtract = createMathOperation(function(minuend, subtrahend) {
  16777. return minuend - subtrahend;
  16778. }, 0);
  16779. /**
  16780. * Computes the sum of the values in `array`.
  16781. *
  16782. * @static
  16783. * @memberOf _
  16784. * @since 3.4.0
  16785. * @category Math
  16786. * @param {Array} array The array to iterate over.
  16787. * @returns {number} Returns the sum.
  16788. * @example
  16789. *
  16790. * _.sum([4, 2, 8, 6]);
  16791. * // => 20
  16792. */
  16793. function sum(array) {
  16794. return (array && array.length)
  16795. ? baseSum(array, identity)
  16796. : 0;
  16797. }
  16798. /**
  16799. * This method is like `_.sum` except that it accepts `iteratee` which is
  16800. * invoked for each element in `array` to generate the value to be summed.
  16801. * The iteratee is invoked with one argument: (value).
  16802. *
  16803. * @static
  16804. * @memberOf _
  16805. * @since 4.0.0
  16806. * @category Math
  16807. * @param {Array} array The array to iterate over.
  16808. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16809. * @returns {number} Returns the sum.
  16810. * @example
  16811. *
  16812. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16813. *
  16814. * _.sumBy(objects, function(o) { return o.n; });
  16815. * // => 20
  16816. *
  16817. * // The `_.property` iteratee shorthand.
  16818. * _.sumBy(objects, 'n');
  16819. * // => 20
  16820. */
  16821. function sumBy(array, iteratee) {
  16822. return (array && array.length)
  16823. ? baseSum(array, getIteratee(iteratee, 2))
  16824. : 0;
  16825. }
  16826. /*------------------------------------------------------------------------*/
  16827. // Add methods that return wrapped values in chain sequences.
  16828. lodash.after = after;
  16829. lodash.ary = ary;
  16830. lodash.assign = assign;
  16831. lodash.assignIn = assignIn;
  16832. lodash.assignInWith = assignInWith;
  16833. lodash.assignWith = assignWith;
  16834. lodash.at = at;
  16835. lodash.before = before;
  16836. lodash.bind = bind;
  16837. lodash.bindAll = bindAll;
  16838. lodash.bindKey = bindKey;
  16839. lodash.castArray = castArray;
  16840. lodash.chain = chain;
  16841. lodash.chunk = chunk;
  16842. lodash.compact = compact;
  16843. lodash.concat = concat;
  16844. lodash.cond = cond;
  16845. lodash.conforms = conforms;
  16846. lodash.constant = constant;
  16847. lodash.countBy = countBy;
  16848. lodash.create = create;
  16849. lodash.curry = curry;
  16850. lodash.curryRight = curryRight;
  16851. lodash.debounce = debounce;
  16852. lodash.defaults = defaults;
  16853. lodash.defaultsDeep = defaultsDeep;
  16854. lodash.defer = defer;
  16855. lodash.delay = delay;
  16856. lodash.difference = difference;
  16857. lodash.differenceBy = differenceBy;
  16858. lodash.differenceWith = differenceWith;
  16859. lodash.drop = drop;
  16860. lodash.dropRight = dropRight;
  16861. lodash.dropRightWhile = dropRightWhile;
  16862. lodash.dropWhile = dropWhile;
  16863. lodash.fill = fill;
  16864. lodash.filter = filter;
  16865. lodash.flatMap = flatMap;
  16866. lodash.flatMapDeep = flatMapDeep;
  16867. lodash.flatMapDepth = flatMapDepth;
  16868. lodash.flatten = flatten;
  16869. lodash.flattenDeep = flattenDeep;
  16870. lodash.flattenDepth = flattenDepth;
  16871. lodash.flip = flip;
  16872. lodash.flow = flow;
  16873. lodash.flowRight = flowRight;
  16874. lodash.fromPairs = fromPairs;
  16875. lodash.functions = functions;
  16876. lodash.functionsIn = functionsIn;
  16877. lodash.groupBy = groupBy;
  16878. lodash.initial = initial;
  16879. lodash.intersection = intersection;
  16880. lodash.intersectionBy = intersectionBy;
  16881. lodash.intersectionWith = intersectionWith;
  16882. lodash.invert = invert;
  16883. lodash.invertBy = invertBy;
  16884. lodash.invokeMap = invokeMap;
  16885. lodash.iteratee = iteratee;
  16886. lodash.keyBy = keyBy;
  16887. lodash.keys = keys;
  16888. lodash.keysIn = keysIn;
  16889. lodash.map = map;
  16890. lodash.mapKeys = mapKeys;
  16891. lodash.mapValues = mapValues;
  16892. lodash.matches = matches;
  16893. lodash.matchesProperty = matchesProperty;
  16894. lodash.memoize = memoize;
  16895. lodash.merge = merge;
  16896. lodash.mergeWith = mergeWith;
  16897. lodash.method = method;
  16898. lodash.methodOf = methodOf;
  16899. lodash.mixin = mixin;
  16900. lodash.negate = negate;
  16901. lodash.nthArg = nthArg;
  16902. lodash.omit = omit;
  16903. lodash.omitBy = omitBy;
  16904. lodash.once = once;
  16905. lodash.orderBy = orderBy;
  16906. lodash.over = over;
  16907. lodash.overArgs = overArgs;
  16908. lodash.overEvery = overEvery;
  16909. lodash.overSome = overSome;
  16910. lodash.partial = partial;
  16911. lodash.partialRight = partialRight;
  16912. lodash.partition = partition;
  16913. lodash.pick = pick;
  16914. lodash.pickBy = pickBy;
  16915. lodash.property = property;
  16916. lodash.propertyOf = propertyOf;
  16917. lodash.pull = pull;
  16918. lodash.pullAll = pullAll;
  16919. lodash.pullAllBy = pullAllBy;
  16920. lodash.pullAllWith = pullAllWith;
  16921. lodash.pullAt = pullAt;
  16922. lodash.range = range;
  16923. lodash.rangeRight = rangeRight;
  16924. lodash.rearg = rearg;
  16925. lodash.reject = reject;
  16926. lodash.remove = remove;
  16927. lodash.rest = rest;
  16928. lodash.reverse = reverse;
  16929. lodash.sampleSize = sampleSize;
  16930. lodash.set = set;
  16931. lodash.setWith = setWith;
  16932. lodash.shuffle = shuffle;
  16933. lodash.slice = slice;
  16934. lodash.sortBy = sortBy;
  16935. lodash.sortedUniq = sortedUniq;
  16936. lodash.sortedUniqBy = sortedUniqBy;
  16937. lodash.split = split;
  16938. lodash.spread = spread;
  16939. lodash.tail = tail;
  16940. lodash.take = take;
  16941. lodash.takeRight = takeRight;
  16942. lodash.takeRightWhile = takeRightWhile;
  16943. lodash.takeWhile = takeWhile;
  16944. lodash.tap = tap;
  16945. lodash.throttle = throttle;
  16946. lodash.thru = thru;
  16947. lodash.toArray = toArray;
  16948. lodash.toPairs = toPairs;
  16949. lodash.toPairsIn = toPairsIn;
  16950. lodash.toPath = toPath;
  16951. lodash.toPlainObject = toPlainObject;
  16952. lodash.transform = transform;
  16953. lodash.unary = unary;
  16954. lodash.union = union;
  16955. lodash.unionBy = unionBy;
  16956. lodash.unionWith = unionWith;
  16957. lodash.uniq = uniq;
  16958. lodash.uniqBy = uniqBy;
  16959. lodash.uniqWith = uniqWith;
  16960. lodash.unset = unset;
  16961. lodash.unzip = unzip;
  16962. lodash.unzipWith = unzipWith;
  16963. lodash.update = update;
  16964. lodash.updateWith = updateWith;
  16965. lodash.values = values;
  16966. lodash.valuesIn = valuesIn;
  16967. lodash.without = without;
  16968. lodash.words = words;
  16969. lodash.wrap = wrap;
  16970. lodash.xor = xor;
  16971. lodash.xorBy = xorBy;
  16972. lodash.xorWith = xorWith;
  16973. lodash.zip = zip;
  16974. lodash.zipObject = zipObject;
  16975. lodash.zipObjectDeep = zipObjectDeep;
  16976. lodash.zipWith = zipWith;
  16977. // Add aliases.
  16978. lodash.entries = toPairs;
  16979. lodash.entriesIn = toPairsIn;
  16980. lodash.extend = assignIn;
  16981. lodash.extendWith = assignInWith;
  16982. // Add methods to `lodash.prototype`.
  16983. mixin(lodash, lodash);
  16984. /*------------------------------------------------------------------------*/
  16985. // Add methods that return unwrapped values in chain sequences.
  16986. lodash.add = add;
  16987. lodash.attempt = attempt;
  16988. lodash.camelCase = camelCase;
  16989. lodash.capitalize = capitalize;
  16990. lodash.ceil = ceil;
  16991. lodash.clamp = clamp;
  16992. lodash.clone = clone;
  16993. lodash.cloneDeep = cloneDeep;
  16994. lodash.cloneDeepWith = cloneDeepWith;
  16995. lodash.cloneWith = cloneWith;
  16996. lodash.conformsTo = conformsTo;
  16997. lodash.deburr = deburr;
  16998. lodash.defaultTo = defaultTo;
  16999. lodash.divide = divide;
  17000. lodash.endsWith = endsWith;
  17001. lodash.eq = eq;
  17002. lodash.escape = escape;
  17003. lodash.escapeRegExp = escapeRegExp;
  17004. lodash.every = every;
  17005. lodash.find = find;
  17006. lodash.findIndex = findIndex;
  17007. lodash.findKey = findKey;
  17008. lodash.findLast = findLast;
  17009. lodash.findLastIndex = findLastIndex;
  17010. lodash.findLastKey = findLastKey;
  17011. lodash.floor = floor;
  17012. lodash.forEach = forEach;
  17013. lodash.forEachRight = forEachRight;
  17014. lodash.forIn = forIn;
  17015. lodash.forInRight = forInRight;
  17016. lodash.forOwn = forOwn;
  17017. lodash.forOwnRight = forOwnRight;
  17018. lodash.get = get;
  17019. lodash.gt = gt;
  17020. lodash.gte = gte;
  17021. lodash.has = has;
  17022. lodash.hasIn = hasIn;
  17023. lodash.head = head;
  17024. lodash.identity = identity;
  17025. lodash.includes = includes;
  17026. lodash.indexOf = indexOf;
  17027. lodash.inRange = inRange;
  17028. lodash.invoke = invoke;
  17029. lodash.isArguments = isArguments;
  17030. lodash.isArray = isArray;
  17031. lodash.isArrayBuffer = isArrayBuffer;
  17032. lodash.isArrayLike = isArrayLike;
  17033. lodash.isArrayLikeObject = isArrayLikeObject;
  17034. lodash.isBoolean = isBoolean;
  17035. lodash.isBuffer = isBuffer;
  17036. lodash.isDate = isDate;
  17037. lodash.isElement = isElement;
  17038. lodash.isEmpty = isEmpty;
  17039. lodash.isEqual = isEqual;
  17040. lodash.isEqualWith = isEqualWith;
  17041. lodash.isError = isError;
  17042. lodash.isFinite = isFinite;
  17043. lodash.isFunction = isFunction;
  17044. lodash.isInteger = isInteger;
  17045. lodash.isLength = isLength;
  17046. lodash.isMap = isMap;
  17047. lodash.isMatch = isMatch;
  17048. lodash.isMatchWith = isMatchWith;
  17049. lodash.isNaN = isNaN;
  17050. lodash.isNative = isNative;
  17051. lodash.isNil = isNil;
  17052. lodash.isNull = isNull;
  17053. lodash.isNumber = isNumber;
  17054. lodash.isObject = isObject;
  17055. lodash.isObjectLike = isObjectLike;
  17056. lodash.isPlainObject = isPlainObject;
  17057. lodash.isRegExp = isRegExp;
  17058. lodash.isSafeInteger = isSafeInteger;
  17059. lodash.isSet = isSet;
  17060. lodash.isString = isString;
  17061. lodash.isSymbol = isSymbol;
  17062. lodash.isTypedArray = isTypedArray;
  17063. lodash.isUndefined = isUndefined;
  17064. lodash.isWeakMap = isWeakMap;
  17065. lodash.isWeakSet = isWeakSet;
  17066. lodash.join = join;
  17067. lodash.kebabCase = kebabCase;
  17068. lodash.last = last;
  17069. lodash.lastIndexOf = lastIndexOf;
  17070. lodash.lowerCase = lowerCase;
  17071. lodash.lowerFirst = lowerFirst;
  17072. lodash.lt = lt;
  17073. lodash.lte = lte;
  17074. lodash.max = max;
  17075. lodash.maxBy = maxBy;
  17076. lodash.mean = mean;
  17077. lodash.meanBy = meanBy;
  17078. lodash.min = min;
  17079. lodash.minBy = minBy;
  17080. lodash.stubArray = stubArray;
  17081. lodash.stubFalse = stubFalse;
  17082. lodash.stubObject = stubObject;
  17083. lodash.stubString = stubString;
  17084. lodash.stubTrue = stubTrue;
  17085. lodash.multiply = multiply;
  17086. lodash.nth = nth;
  17087. lodash.noConflict = noConflict;
  17088. lodash.noop = noop;
  17089. lodash.now = now;
  17090. lodash.pad = pad;
  17091. lodash.padEnd = padEnd;
  17092. lodash.padStart = padStart;
  17093. lodash.parseInt = parseInt;
  17094. lodash.random = random;
  17095. lodash.reduce = reduce;
  17096. lodash.reduceRight = reduceRight;
  17097. lodash.repeat = repeat;
  17098. lodash.replace = replace;
  17099. lodash.result = result;
  17100. lodash.round = round;
  17101. lodash.runInContext = runInContext;
  17102. lodash.sample = sample;
  17103. lodash.size = size;
  17104. lodash.snakeCase = snakeCase;
  17105. lodash.some = some;
  17106. lodash.sortedIndex = sortedIndex;
  17107. lodash.sortedIndexBy = sortedIndexBy;
  17108. lodash.sortedIndexOf = sortedIndexOf;
  17109. lodash.sortedLastIndex = sortedLastIndex;
  17110. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17111. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17112. lodash.startCase = startCase;
  17113. lodash.startsWith = startsWith;
  17114. lodash.subtract = subtract;
  17115. lodash.sum = sum;
  17116. lodash.sumBy = sumBy;
  17117. lodash.template = template;
  17118. lodash.times = times;
  17119. lodash.toFinite = toFinite;
  17120. lodash.toInteger = toInteger;
  17121. lodash.toLength = toLength;
  17122. lodash.toLower = toLower;
  17123. lodash.toNumber = toNumber;
  17124. lodash.toSafeInteger = toSafeInteger;
  17125. lodash.toString = toString;
  17126. lodash.toUpper = toUpper;
  17127. lodash.trim = trim;
  17128. lodash.trimEnd = trimEnd;
  17129. lodash.trimStart = trimStart;
  17130. lodash.truncate = truncate;
  17131. lodash.unescape = unescape;
  17132. lodash.uniqueId = uniqueId;
  17133. lodash.upperCase = upperCase;
  17134. lodash.upperFirst = upperFirst;
  17135. // Add aliases.
  17136. lodash.each = forEach;
  17137. lodash.eachRight = forEachRight;
  17138. lodash.first = head;
  17139. mixin(lodash, (function() {
  17140. var source = {};
  17141. baseForOwn(lodash, function(func, methodName) {
  17142. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17143. source[methodName] = func;
  17144. }
  17145. });
  17146. return source;
  17147. }()), { 'chain': false });
  17148. /*------------------------------------------------------------------------*/
  17149. /**
  17150. * The semantic version number.
  17151. *
  17152. * @static
  17153. * @memberOf _
  17154. * @type {string}
  17155. */
  17156. lodash.VERSION = VERSION;
  17157. // Assign default placeholders.
  17158. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17159. lodash[methodName].placeholder = lodash;
  17160. });
  17161. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17162. arrayEach(['drop', 'take'], function(methodName, index) {
  17163. LazyWrapper.prototype[methodName] = function(n) {
  17164. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17165. var result = (this.__filtered__ && !index)
  17166. ? new LazyWrapper(this)
  17167. : this.clone();
  17168. if (result.__filtered__) {
  17169. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17170. } else {
  17171. result.__views__.push({
  17172. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17173. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17174. });
  17175. }
  17176. return result;
  17177. };
  17178. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17179. return this.reverse()[methodName](n).reverse();
  17180. };
  17181. });
  17182. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17183. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17184. var type = index + 1,
  17185. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17186. LazyWrapper.prototype[methodName] = function(iteratee) {
  17187. var result = this.clone();
  17188. result.__iteratees__.push({
  17189. 'iteratee': getIteratee(iteratee, 3),
  17190. 'type': type
  17191. });
  17192. result.__filtered__ = result.__filtered__ || isFilter;
  17193. return result;
  17194. };
  17195. });
  17196. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17197. arrayEach(['head', 'last'], function(methodName, index) {
  17198. var takeName = 'take' + (index ? 'Right' : '');
  17199. LazyWrapper.prototype[methodName] = function() {
  17200. return this[takeName](1).value()[0];
  17201. };
  17202. });
  17203. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17204. arrayEach(['initial', 'tail'], function(methodName, index) {
  17205. var dropName = 'drop' + (index ? '' : 'Right');
  17206. LazyWrapper.prototype[methodName] = function() {
  17207. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17208. };
  17209. });
  17210. LazyWrapper.prototype.compact = function() {
  17211. return this.filter(identity);
  17212. };
  17213. LazyWrapper.prototype.find = function(predicate) {
  17214. return this.filter(predicate).head();
  17215. };
  17216. LazyWrapper.prototype.findLast = function(predicate) {
  17217. return this.reverse().find(predicate);
  17218. };
  17219. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17220. if (typeof path == 'function') {
  17221. return new LazyWrapper(this);
  17222. }
  17223. return this.map(function(value) {
  17224. return baseInvoke(value, path, args);
  17225. });
  17226. });
  17227. LazyWrapper.prototype.reject = function(predicate) {
  17228. return this.filter(negate(getIteratee(predicate)));
  17229. };
  17230. LazyWrapper.prototype.slice = function(start, end) {
  17231. start = toInteger(start);
  17232. var result = this;
  17233. if (result.__filtered__ && (start > 0 || end < 0)) {
  17234. return new LazyWrapper(result);
  17235. }
  17236. if (start < 0) {
  17237. result = result.takeRight(-start);
  17238. } else if (start) {
  17239. result = result.drop(start);
  17240. }
  17241. if (end !== undefined) {
  17242. end = toInteger(end);
  17243. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17244. }
  17245. return result;
  17246. };
  17247. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17248. return this.reverse().takeWhile(predicate).reverse();
  17249. };
  17250. LazyWrapper.prototype.toArray = function() {
  17251. return this.take(MAX_ARRAY_LENGTH);
  17252. };
  17253. // Add `LazyWrapper` methods to `lodash.prototype`.
  17254. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17255. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17256. isTaker = /^(?:head|last)$/.test(methodName),
  17257. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17258. retUnwrapped = isTaker || /^find/.test(methodName);
  17259. if (!lodashFunc) {
  17260. return;
  17261. }
  17262. lodash.prototype[methodName] = function() {
  17263. var value = this.__wrapped__,
  17264. args = isTaker ? [1] : arguments,
  17265. isLazy = value instanceof LazyWrapper,
  17266. iteratee = args[0],
  17267. useLazy = isLazy || isArray(value);
  17268. var interceptor = function(value) {
  17269. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17270. return (isTaker && chainAll) ? result[0] : result;
  17271. };
  17272. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17273. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17274. isLazy = useLazy = false;
  17275. }
  17276. var chainAll = this.__chain__,
  17277. isHybrid = !!this.__actions__.length,
  17278. isUnwrapped = retUnwrapped && !chainAll,
  17279. onlyLazy = isLazy && !isHybrid;
  17280. if (!retUnwrapped && useLazy) {
  17281. value = onlyLazy ? value : new LazyWrapper(this);
  17282. var result = func.apply(value, args);
  17283. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17284. return new LodashWrapper(result, chainAll);
  17285. }
  17286. if (isUnwrapped && onlyLazy) {
  17287. return func.apply(this, args);
  17288. }
  17289. result = this.thru(interceptor);
  17290. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17291. };
  17292. });
  17293. // Add `Array` methods to `lodash.prototype`.
  17294. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17295. var func = arrayProto[methodName],
  17296. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17297. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17298. lodash.prototype[methodName] = function() {
  17299. var args = arguments;
  17300. if (retUnwrapped && !this.__chain__) {
  17301. var value = this.value();
  17302. return func.apply(isArray(value) ? value : [], args);
  17303. }
  17304. return this[chainName](function(value) {
  17305. return func.apply(isArray(value) ? value : [], args);
  17306. });
  17307. };
  17308. });
  17309. // Map minified method names to their real names.
  17310. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17311. var lodashFunc = lodash[methodName];
  17312. if (lodashFunc) {
  17313. var key = lodashFunc.name + '';
  17314. if (!hasOwnProperty.call(realNames, key)) {
  17315. realNames[key] = [];
  17316. }
  17317. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17318. }
  17319. });
  17320. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17321. 'name': 'wrapper',
  17322. 'func': undefined
  17323. }];
  17324. // Add methods to `LazyWrapper`.
  17325. LazyWrapper.prototype.clone = lazyClone;
  17326. LazyWrapper.prototype.reverse = lazyReverse;
  17327. LazyWrapper.prototype.value = lazyValue;
  17328. // Add chain sequence methods to the `lodash` wrapper.
  17329. lodash.prototype.at = wrapperAt;
  17330. lodash.prototype.chain = wrapperChain;
  17331. lodash.prototype.commit = wrapperCommit;
  17332. lodash.prototype.next = wrapperNext;
  17333. lodash.prototype.plant = wrapperPlant;
  17334. lodash.prototype.reverse = wrapperReverse;
  17335. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17336. // Add lazy aliases.
  17337. lodash.prototype.first = lodash.prototype.head;
  17338. if (symIterator) {
  17339. lodash.prototype[symIterator] = wrapperToIterator;
  17340. }
  17341. return lodash;
  17342. });
  17343. /*--------------------------------------------------------------------------*/
  17344. // Export lodash.
  17345. var _ = runInContext();
  17346. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17347. if (true) {
  17348. // Expose Lodash on the global object to prevent errors when Lodash is
  17349. // loaded by a script tag in the presence of an AMD loader.
  17350. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17351. // Use `_.noConflict` to remove Lodash from the global object.
  17352. root._ = _;
  17353. // Define as an anonymous module so, through path mapping, it can be
  17354. // referenced as the "underscore" module.
  17355. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17356. return _;
  17357. }).call(exports, __webpack_require__, exports, module),
  17358. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17359. }
  17360. // Check for `exports` after `define` in case a build optimizer adds it.
  17361. else {}
  17362. }.call(this));
  17363. /***/ }),
  17364. /***/ "./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":
  17365. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17366. !*** ./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 ***!
  17367. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17368. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17369. "use strict";
  17370. __webpack_require__.r(__webpack_exports__);
  17371. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17372. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17373. /* harmony export */ });
  17374. /* 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");
  17375. /* 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__);
  17376. /* 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");
  17377. var options = {};
  17378. options.insert = "head";
  17379. options.singleton = false;
  17380. 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);
  17381. /* 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 || {});
  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/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&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/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&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_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");
  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_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_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_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_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/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&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/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&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_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");
  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_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_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_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_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/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&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/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&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_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");
  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_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_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_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_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/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&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/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&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_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");
  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_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_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_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17458. /***/ }),
  17459. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17460. /*!******************************************************!*\
  17461. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17462. \******************************************************/
  17463. /***/ ((__unused_webpack_module, exports) => {
  17464. "use strict";
  17465. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17466. // runtime helper for setting properties on components
  17467. // in a tree-shakable way
  17468. exports["default"] = (sfc, props) => {
  17469. const target = sfc.__vccOpts || sfc;
  17470. for (const [key, val] of props) {
  17471. target[key] = val;
  17472. }
  17473. return target;
  17474. };
  17475. /***/ }),
  17476. /***/ "./resources/js/components/AppButtonLink.vue":
  17477. /*!***************************************************!*\
  17478. !*** ./resources/js/components/AppButtonLink.vue ***!
  17479. \***************************************************/
  17480. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17481. "use strict";
  17482. __webpack_require__.r(__webpack_exports__);
  17483. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17484. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17485. /* harmony export */ });
  17486. /* 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");
  17487. /* 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");
  17488. /* 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");
  17489. ;
  17490. 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"]])
  17491. /* hot reload */
  17492. if (false) {}
  17493. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17494. /***/ }),
  17495. /***/ "./resources/js/components/AppFooter.vue":
  17496. /*!***********************************************!*\
  17497. !*** ./resources/js/components/AppFooter.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 _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");
  17506. /* 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");
  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. const script = {}
  17509. ;
  17510. 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"]])
  17511. /* hot reload */
  17512. if (false) {}
  17513. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17514. /***/ }),
  17515. /***/ "./resources/js/components/AppMessage.vue":
  17516. /*!************************************************!*\
  17517. !*** ./resources/js/components/AppMessage.vue ***!
  17518. \************************************************/
  17519. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17520. "use strict";
  17521. __webpack_require__.r(__webpack_exports__);
  17522. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17523. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17524. /* harmony export */ });
  17525. /* 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");
  17526. /* 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");
  17527. /* 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");
  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"])(_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"]])
  17530. /* hot reload */
  17531. if (false) {}
  17532. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17533. /***/ }),
  17534. /***/ "./resources/js/components/AppPagination.vue":
  17535. /*!***************************************************!*\
  17536. !*** ./resources/js/components/AppPagination.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 _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");
  17545. /* 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");
  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"])(_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"]])
  17549. /* hot reload */
  17550. if (false) {}
  17551. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17552. /***/ }),
  17553. /***/ "./resources/js/components/AppSidebar.vue":
  17554. /*!************************************************!*\
  17555. !*** ./resources/js/components/AppSidebar.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 _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");
  17564. /* 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");
  17565. /* 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");
  17566. /* 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");
  17567. ;
  17568. 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"]])
  17569. /* hot reload */
  17570. if (false) {}
  17571. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17572. /***/ }),
  17573. /***/ "./resources/js/components/AppSubSidebar.vue":
  17574. /*!***************************************************!*\
  17575. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17576. \***************************************************/
  17577. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17578. "use strict";
  17579. __webpack_require__.r(__webpack_exports__);
  17580. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17581. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17582. /* harmony export */ });
  17583. /* 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");
  17584. /* 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");
  17585. /* 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");
  17586. /* 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");
  17587. ;
  17588. 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"]])
  17589. /* hot reload */
  17590. if (false) {}
  17591. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17592. /***/ }),
  17593. /***/ "./resources/js/components/AppTopBar.vue":
  17594. /*!***********************************************!*\
  17595. !*** ./resources/js/components/AppTopBar.vue ***!
  17596. \***********************************************/
  17597. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17598. "use strict";
  17599. __webpack_require__.r(__webpack_exports__);
  17600. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17601. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17602. /* harmony export */ });
  17603. /* 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");
  17604. /* 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");
  17605. /* 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");
  17606. /* 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");
  17607. ;
  17608. 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"]])
  17609. /* hot reload */
  17610. if (false) {}
  17611. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17612. /***/ }),
  17613. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17614. /*!**************************************************!*\
  17615. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17616. \**************************************************/
  17617. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17618. "use strict";
  17619. __webpack_require__.r(__webpack_exports__);
  17620. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17621. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17622. /* harmony export */ });
  17623. /* 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");
  17624. /* 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");
  17625. /* 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");
  17626. /* 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");
  17627. ;
  17628. 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"]])
  17629. /* hot reload */
  17630. if (false) {}
  17631. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17632. /***/ }),
  17633. /***/ "./resources/js/pages/expense/Index.vue":
  17634. /*!**********************************************!*\
  17635. !*** ./resources/js/pages/expense/Index.vue ***!
  17636. \**********************************************/
  17637. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17638. "use strict";
  17639. __webpack_require__.r(__webpack_exports__);
  17640. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17641. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17642. /* harmony export */ });
  17643. /* 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");
  17644. /* 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");
  17645. /* 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");
  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_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"]])
  17648. /* hot reload */
  17649. if (false) {}
  17650. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17651. /***/ }),
  17652. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17653. /*!**************************************************************************************!*\
  17654. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  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": () => (/* 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"])
  17661. /* harmony export */ });
  17662. /* 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");
  17663. /***/ }),
  17664. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17665. /*!***********************************************************************************!*\
  17666. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17667. \***********************************************************************************/
  17668. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17669. "use strict";
  17670. __webpack_require__.r(__webpack_exports__);
  17671. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17672. /* 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"])
  17673. /* harmony export */ });
  17674. /* 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");
  17675. /***/ }),
  17676. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17677. /*!**************************************************************************************!*\
  17678. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17679. \**************************************************************************************/
  17680. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17681. "use strict";
  17682. __webpack_require__.r(__webpack_exports__);
  17683. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17684. /* 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"])
  17685. /* harmony export */ });
  17686. /* 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");
  17687. /***/ }),
  17688. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17689. /*!***********************************************************************************!*\
  17690. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17691. \***********************************************************************************/
  17692. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17693. "use strict";
  17694. __webpack_require__.r(__webpack_exports__);
  17695. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17696. /* 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"])
  17697. /* harmony export */ });
  17698. /* 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");
  17699. /***/ }),
  17700. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17701. /*!**************************************************************************************!*\
  17702. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17703. \**************************************************************************************/
  17704. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17705. "use strict";
  17706. __webpack_require__.r(__webpack_exports__);
  17707. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17708. /* 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"])
  17709. /* harmony export */ });
  17710. /* 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");
  17711. /***/ }),
  17712. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17713. /*!**********************************************************************************!*\
  17714. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17715. \**********************************************************************************/
  17716. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17717. "use strict";
  17718. __webpack_require__.r(__webpack_exports__);
  17719. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17720. /* 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"])
  17721. /* harmony export */ });
  17722. /* 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");
  17723. /***/ }),
  17724. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17725. /*!*************************************************************************************!*\
  17726. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17727. \*************************************************************************************/
  17728. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17729. "use strict";
  17730. __webpack_require__.r(__webpack_exports__);
  17731. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17732. /* 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"])
  17733. /* harmony export */ });
  17734. /* 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");
  17735. /***/ }),
  17736. /***/ "./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js":
  17737. /*!*********************************************************************************!*\
  17738. !*** ./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js ***!
  17739. \*********************************************************************************/
  17740. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17741. "use strict";
  17742. __webpack_require__.r(__webpack_exports__);
  17743. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17744. /* 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"])
  17745. /* harmony export */ });
  17746. /* 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");
  17747. /***/ }),
  17748. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17749. /*!*********************************************************************************!*\
  17750. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17751. \*********************************************************************************/
  17752. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17753. "use strict";
  17754. __webpack_require__.r(__webpack_exports__);
  17755. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17756. /* 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)
  17757. /* harmony export */ });
  17758. /* 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");
  17759. /***/ }),
  17760. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17761. /*!*****************************************************************************************!*\
  17762. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17763. \*****************************************************************************************/
  17764. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17765. "use strict";
  17766. __webpack_require__.r(__webpack_exports__);
  17767. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17768. /* 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)
  17769. /* harmony export */ });
  17770. /* 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");
  17771. /***/ }),
  17772. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17773. /*!******************************************************************************!*\
  17774. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17775. \******************************************************************************/
  17776. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17777. "use strict";
  17778. __webpack_require__.r(__webpack_exports__);
  17779. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17780. /* 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)
  17781. /* harmony export */ });
  17782. /* 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");
  17783. /***/ }),
  17784. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17785. /*!*********************************************************************************!*\
  17786. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17787. \*********************************************************************************/
  17788. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17789. "use strict";
  17790. __webpack_require__.r(__webpack_exports__);
  17791. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17792. /* 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)
  17793. /* harmony export */ });
  17794. /* 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");
  17795. /***/ }),
  17796. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17797. /*!******************************************************************************************!*\
  17798. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17799. \******************************************************************************************/
  17800. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17801. "use strict";
  17802. __webpack_require__.r(__webpack_exports__);
  17803. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17804. /* 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)
  17805. /* harmony export */ });
  17806. /* 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");
  17807. /***/ }),
  17808. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17809. /*!*********************************************************************************************!*\
  17810. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17811. \*********************************************************************************************/
  17812. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17813. "use strict";
  17814. __webpack_require__.r(__webpack_exports__);
  17815. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17816. /* 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)
  17817. /* harmony export */ });
  17818. /* 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");
  17819. /***/ }),
  17820. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17821. /*!*****************************************************************************************!*\
  17822. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17823. \*****************************************************************************************/
  17824. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17825. "use strict";
  17826. __webpack_require__.r(__webpack_exports__);
  17827. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17828. /* 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)
  17829. /* harmony export */ });
  17830. /* 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");
  17831. /***/ }),
  17832. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17833. /*!********************************************************************************************!*\
  17834. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17835. \********************************************************************************************/
  17836. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17837. "use strict";
  17838. __webpack_require__.r(__webpack_exports__);
  17839. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17840. /* 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)
  17841. /* harmony export */ });
  17842. /* 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");
  17843. /***/ }),
  17844. /***/ "./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822":
  17845. /*!****************************************************************************!*\
  17846. !*** ./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822 ***!
  17847. \****************************************************************************/
  17848. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17849. "use strict";
  17850. __webpack_require__.r(__webpack_exports__);
  17851. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17852. /* 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)
  17853. /* harmony export */ });
  17854. /* 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");
  17855. /***/ }),
  17856. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17857. /*!********************************************************************************************************!*\
  17858. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17859. \********************************************************************************************************/
  17860. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17861. "use strict";
  17862. __webpack_require__.r(__webpack_exports__);
  17863. /* 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");
  17864. /***/ }),
  17865. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17866. /*!*********************************************************************************************************!*\
  17867. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17868. \*********************************************************************************************************/
  17869. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17870. "use strict";
  17871. __webpack_require__.r(__webpack_exports__);
  17872. /* 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");
  17873. /***/ }),
  17874. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17875. /*!************************************************************************************************************!*\
  17876. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17877. \************************************************************************************************************/
  17878. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17879. "use strict";
  17880. __webpack_require__.r(__webpack_exports__);
  17881. /* 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");
  17882. /***/ }),
  17883. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17884. /*!********************************************************************************************************!*\
  17885. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17886. \********************************************************************************************************/
  17887. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17888. "use strict";
  17889. __webpack_require__.r(__webpack_exports__);
  17890. /* 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");
  17891. /***/ }),
  17892. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17893. /*!***********************************************************************************************************!*\
  17894. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17895. \***********************************************************************************************************/
  17896. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17897. "use strict";
  17898. __webpack_require__.r(__webpack_exports__);
  17899. /* 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");
  17900. /***/ })
  17901. }]);