resources_js_pages_expense_Index_vue.js 702KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373
  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. initialDateRage: 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.initialDateRage),
  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() {
  950. var initialDateRage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  951. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  952. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  953. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  954. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  955. if (initialDateRage[0] || initialDateRage[1]) {
  956. if (initialDateRage[1]) {
  957. dates.push([new Date(initialDateRage[0]), new Date(initialDateRage[1])]);
  958. } else {
  959. dates.push([new Date(props.initialDateRage[1]), null]);
  960. }
  961. }
  962. });
  963. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  964. if (dates.value[1]) {
  965. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  966. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  967. } else if (dates.value[0]) {
  968. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  969. endDate.value = null;
  970. }
  971. });
  972. return {
  973. dates: dates,
  974. startDate: startDate,
  975. endDate: endDate
  976. };
  977. }
  978. /***/ }),
  979. /***/ "./resources/js/pages/expense/tableHeader.js":
  980. /*!***************************************************!*\
  981. !*** ./resources/js/pages/expense/tableHeader.js ***!
  982. \***************************************************/
  983. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  984. "use strict";
  985. __webpack_require__.r(__webpack_exports__);
  986. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  987. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  988. /* harmony export */ });
  989. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  990. field: 'createdAt',
  991. header: 'Tanggal'
  992. }, {
  993. field: 'amount',
  994. header: 'Pengeluaran'
  995. }, {
  996. field: 'user',
  997. header: 'User'
  998. }]);
  999. /***/ }),
  1000. /***/ "./resources/js/utils/menu.js":
  1001. /*!************************************!*\
  1002. !*** ./resources/js/utils/menu.js ***!
  1003. \************************************/
  1004. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1005. "use strict";
  1006. __webpack_require__.r(__webpack_exports__);
  1007. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1008. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1009. /* harmony export */ });
  1010. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1011. // Admin
  1012. 1: [{
  1013. label: 'Home',
  1014. items: [{
  1015. label: 'Dashboard',
  1016. icon: 'pi pi-home',
  1017. to: '/dashboards',
  1018. component: 'home/Index'
  1019. }]
  1020. }, {
  1021. label: 'Master',
  1022. items: [{
  1023. label: 'User',
  1024. icon: 'pi pi-user',
  1025. to: '/users',
  1026. component: 'user/Index'
  1027. }]
  1028. }],
  1029. // Supervisor
  1030. 2: [{
  1031. label: 'Home',
  1032. items: [{
  1033. label: 'Dashboard',
  1034. icon: 'pi pi-home',
  1035. to: '/dashboards',
  1036. component: 'home/Index'
  1037. }]
  1038. }, {
  1039. label: 'Menu',
  1040. items: [{
  1041. label: 'Pengeluaran',
  1042. icon: 'pi pi-wallet',
  1043. to: '/expenses',
  1044. component: 'expense/Index'
  1045. }, {
  1046. label: 'Laporan',
  1047. icon: 'pi pi-book',
  1048. items: [{
  1049. label: 'Mutasi',
  1050. icon: 'pi pi-circle',
  1051. to: '/reports/mutations',
  1052. component: 'mutation/Report'
  1053. }]
  1054. }]
  1055. }, {
  1056. label: 'Master',
  1057. items: [{
  1058. label: 'Jenis Kendaraan',
  1059. icon: 'pi pi-car',
  1060. to: '/type-vehicles',
  1061. component: 'typevehicle/Index'
  1062. }, {
  1063. label: 'Jenis Member',
  1064. icon: 'pi pi-id-card',
  1065. to: '/type-members',
  1066. component: 'typemember/Index'
  1067. }]
  1068. }, {
  1069. label: 'Pengaturan',
  1070. items: [{
  1071. label: 'Tarif Parkir',
  1072. icon: 'pi pi-car',
  1073. to: '/parking-fees/create',
  1074. component: 'parkingfee/Create'
  1075. }]
  1076. }],
  1077. // Operator
  1078. 3: [{
  1079. label: 'Home',
  1080. items: [{
  1081. label: 'Dashboard',
  1082. icon: 'pi pi-home',
  1083. to: '/dashboards',
  1084. component: 'home/Index'
  1085. }]
  1086. }, {
  1087. label: 'Menu',
  1088. items: [{
  1089. label: 'Pengeluaran',
  1090. icon: 'pi pi-wallet',
  1091. to: '/expenses',
  1092. component: 'expense/Index'
  1093. }, {
  1094. label: 'Member',
  1095. icon: 'pi pi-id-card',
  1096. to: '/members',
  1097. component: 'member/Index'
  1098. }, {
  1099. label: 'Top Up',
  1100. icon: 'pi pi-car',
  1101. to: '/top-ups',
  1102. component: 'topup/Index'
  1103. }]
  1104. }]
  1105. });
  1106. /***/ }),
  1107. /***/ "./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":
  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. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1112. "use strict";
  1113. __webpack_require__.r(__webpack_exports__);
  1114. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1115. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1116. /* harmony export */ });
  1117. /* 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");
  1118. /* 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__);
  1119. // Imports
  1120. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1121. // Module
  1122. ___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}", ""]);
  1123. // Exports
  1124. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1125. /***/ }),
  1126. /***/ "./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":
  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. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1131. "use strict";
  1132. __webpack_require__.r(__webpack_exports__);
  1133. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1134. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1135. /* harmony export */ });
  1136. /* 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");
  1137. /* 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__);
  1138. // Imports
  1139. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1140. // Module
  1141. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1142. // Exports
  1143. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1144. /***/ }),
  1145. /***/ "./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":
  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. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1150. "use strict";
  1151. __webpack_require__.r(__webpack_exports__);
  1152. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1153. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1154. /* harmony export */ });
  1155. /* 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");
  1156. /* 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__);
  1157. // Imports
  1158. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1159. // Module
  1160. ___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}", ""]);
  1161. // Exports
  1162. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1163. /***/ }),
  1164. /***/ "./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":
  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. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1169. "use strict";
  1170. __webpack_require__.r(__webpack_exports__);
  1171. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1172. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1173. /* harmony export */ });
  1174. /* 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");
  1175. /* 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__);
  1176. // Imports
  1177. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1178. // Module
  1179. ___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}", ""]);
  1180. // Exports
  1181. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1182. /***/ }),
  1183. /***/ "./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":
  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. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1188. "use strict";
  1189. __webpack_require__.r(__webpack_exports__);
  1190. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1191. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1192. /* harmony export */ });
  1193. /* 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");
  1194. /* 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__);
  1195. // Imports
  1196. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1197. // Module
  1198. ___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}", ""]);
  1199. // Exports
  1200. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1201. /***/ }),
  1202. /***/ "./node_modules/dayjs/dayjs.min.js":
  1203. /*!*****************************************!*\
  1204. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1205. \*****************************************/
  1206. /***/ (function(module) {
  1207. !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}));
  1208. /***/ }),
  1209. /***/ "./node_modules/lodash/lodash.js":
  1210. /*!***************************************!*\
  1211. !*** ./node_modules/lodash/lodash.js ***!
  1212. \***************************************/
  1213. /***/ (function(module, exports, __webpack_require__) {
  1214. /* module decorator */ module = __webpack_require__.nmd(module);
  1215. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1216. * @license
  1217. * Lodash <https://lodash.com/>
  1218. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1219. * Released under MIT license <https://lodash.com/license>
  1220. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1221. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1222. */
  1223. ;(function() {
  1224. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1225. var undefined;
  1226. /** Used as the semantic version number. */
  1227. var VERSION = '4.17.21';
  1228. /** Used as the size to enable large array optimizations. */
  1229. var LARGE_ARRAY_SIZE = 200;
  1230. /** Error message constants. */
  1231. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1232. FUNC_ERROR_TEXT = 'Expected a function',
  1233. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1234. /** Used to stand-in for `undefined` hash values. */
  1235. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1236. /** Used as the maximum memoize cache size. */
  1237. var MAX_MEMOIZE_SIZE = 500;
  1238. /** Used as the internal argument placeholder. */
  1239. var PLACEHOLDER = '__lodash_placeholder__';
  1240. /** Used to compose bitmasks for cloning. */
  1241. var CLONE_DEEP_FLAG = 1,
  1242. CLONE_FLAT_FLAG = 2,
  1243. CLONE_SYMBOLS_FLAG = 4;
  1244. /** Used to compose bitmasks for value comparisons. */
  1245. var COMPARE_PARTIAL_FLAG = 1,
  1246. COMPARE_UNORDERED_FLAG = 2;
  1247. /** Used to compose bitmasks for function metadata. */
  1248. var WRAP_BIND_FLAG = 1,
  1249. WRAP_BIND_KEY_FLAG = 2,
  1250. WRAP_CURRY_BOUND_FLAG = 4,
  1251. WRAP_CURRY_FLAG = 8,
  1252. WRAP_CURRY_RIGHT_FLAG = 16,
  1253. WRAP_PARTIAL_FLAG = 32,
  1254. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1255. WRAP_ARY_FLAG = 128,
  1256. WRAP_REARG_FLAG = 256,
  1257. WRAP_FLIP_FLAG = 512;
  1258. /** Used as default options for `_.truncate`. */
  1259. var DEFAULT_TRUNC_LENGTH = 30,
  1260. DEFAULT_TRUNC_OMISSION = '...';
  1261. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1262. var HOT_COUNT = 800,
  1263. HOT_SPAN = 16;
  1264. /** Used to indicate the type of lazy iteratees. */
  1265. var LAZY_FILTER_FLAG = 1,
  1266. LAZY_MAP_FLAG = 2,
  1267. LAZY_WHILE_FLAG = 3;
  1268. /** Used as references for various `Number` constants. */
  1269. var INFINITY = 1 / 0,
  1270. MAX_SAFE_INTEGER = 9007199254740991,
  1271. MAX_INTEGER = 1.7976931348623157e+308,
  1272. NAN = 0 / 0;
  1273. /** Used as references for the maximum length and index of an array. */
  1274. var MAX_ARRAY_LENGTH = 4294967295,
  1275. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1276. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1277. /** Used to associate wrap methods with their bit flags. */
  1278. var wrapFlags = [
  1279. ['ary', WRAP_ARY_FLAG],
  1280. ['bind', WRAP_BIND_FLAG],
  1281. ['bindKey', WRAP_BIND_KEY_FLAG],
  1282. ['curry', WRAP_CURRY_FLAG],
  1283. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1284. ['flip', WRAP_FLIP_FLAG],
  1285. ['partial', WRAP_PARTIAL_FLAG],
  1286. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1287. ['rearg', WRAP_REARG_FLAG]
  1288. ];
  1289. /** `Object#toString` result references. */
  1290. var argsTag = '[object Arguments]',
  1291. arrayTag = '[object Array]',
  1292. asyncTag = '[object AsyncFunction]',
  1293. boolTag = '[object Boolean]',
  1294. dateTag = '[object Date]',
  1295. domExcTag = '[object DOMException]',
  1296. errorTag = '[object Error]',
  1297. funcTag = '[object Function]',
  1298. genTag = '[object GeneratorFunction]',
  1299. mapTag = '[object Map]',
  1300. numberTag = '[object Number]',
  1301. nullTag = '[object Null]',
  1302. objectTag = '[object Object]',
  1303. promiseTag = '[object Promise]',
  1304. proxyTag = '[object Proxy]',
  1305. regexpTag = '[object RegExp]',
  1306. setTag = '[object Set]',
  1307. stringTag = '[object String]',
  1308. symbolTag = '[object Symbol]',
  1309. undefinedTag = '[object Undefined]',
  1310. weakMapTag = '[object WeakMap]',
  1311. weakSetTag = '[object WeakSet]';
  1312. var arrayBufferTag = '[object ArrayBuffer]',
  1313. dataViewTag = '[object DataView]',
  1314. float32Tag = '[object Float32Array]',
  1315. float64Tag = '[object Float64Array]',
  1316. int8Tag = '[object Int8Array]',
  1317. int16Tag = '[object Int16Array]',
  1318. int32Tag = '[object Int32Array]',
  1319. uint8Tag = '[object Uint8Array]',
  1320. uint8ClampedTag = '[object Uint8ClampedArray]',
  1321. uint16Tag = '[object Uint16Array]',
  1322. uint32Tag = '[object Uint32Array]';
  1323. /** Used to match empty string literals in compiled template source. */
  1324. var reEmptyStringLeading = /\b__p \+= '';/g,
  1325. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1326. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1327. /** Used to match HTML entities and HTML characters. */
  1328. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1329. reUnescapedHtml = /[&<>"']/g,
  1330. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1331. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1332. /** Used to match template delimiters. */
  1333. var reEscape = /<%-([\s\S]+?)%>/g,
  1334. reEvaluate = /<%([\s\S]+?)%>/g,
  1335. reInterpolate = /<%=([\s\S]+?)%>/g;
  1336. /** Used to match property names within property paths. */
  1337. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1338. reIsPlainProp = /^\w*$/,
  1339. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1340. /**
  1341. * Used to match `RegExp`
  1342. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1343. */
  1344. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1345. reHasRegExpChar = RegExp(reRegExpChar.source);
  1346. /** Used to match leading whitespace. */
  1347. var reTrimStart = /^\s+/;
  1348. /** Used to match a single whitespace character. */
  1349. var reWhitespace = /\s/;
  1350. /** Used to match wrap detail comments. */
  1351. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1352. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1353. reSplitDetails = /,? & /;
  1354. /** Used to match words composed of alphanumeric characters. */
  1355. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1356. /**
  1357. * Used to validate the `validate` option in `_.template` variable.
  1358. *
  1359. * Forbids characters which could potentially change the meaning of the function argument definition:
  1360. * - "()," (modification of function parameters)
  1361. * - "=" (default value)
  1362. * - "[]{}" (destructuring of function parameters)
  1363. * - "/" (beginning of a comment)
  1364. * - whitespace
  1365. */
  1366. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1367. /** Used to match backslashes in property paths. */
  1368. var reEscapeChar = /\\(\\)?/g;
  1369. /**
  1370. * Used to match
  1371. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1372. */
  1373. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1374. /** Used to match `RegExp` flags from their coerced string values. */
  1375. var reFlags = /\w*$/;
  1376. /** Used to detect bad signed hexadecimal string values. */
  1377. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1378. /** Used to detect binary string values. */
  1379. var reIsBinary = /^0b[01]+$/i;
  1380. /** Used to detect host constructors (Safari). */
  1381. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1382. /** Used to detect octal string values. */
  1383. var reIsOctal = /^0o[0-7]+$/i;
  1384. /** Used to detect unsigned integer values. */
  1385. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1386. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1387. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1388. /** Used to ensure capturing order of template delimiters. */
  1389. var reNoMatch = /($^)/;
  1390. /** Used to match unescaped characters in compiled string literals. */
  1391. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1392. /** Used to compose unicode character classes. */
  1393. var rsAstralRange = '\\ud800-\\udfff',
  1394. rsComboMarksRange = '\\u0300-\\u036f',
  1395. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1396. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1397. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1398. rsDingbatRange = '\\u2700-\\u27bf',
  1399. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1400. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1401. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1402. rsPunctuationRange = '\\u2000-\\u206f',
  1403. 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',
  1404. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1405. rsVarRange = '\\ufe0e\\ufe0f',
  1406. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1407. /** Used to compose unicode capture groups. */
  1408. var rsApos = "['\u2019]",
  1409. rsAstral = '[' + rsAstralRange + ']',
  1410. rsBreak = '[' + rsBreakRange + ']',
  1411. rsCombo = '[' + rsComboRange + ']',
  1412. rsDigits = '\\d+',
  1413. rsDingbat = '[' + rsDingbatRange + ']',
  1414. rsLower = '[' + rsLowerRange + ']',
  1415. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1416. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1417. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1418. rsNonAstral = '[^' + rsAstralRange + ']',
  1419. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1420. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1421. rsUpper = '[' + rsUpperRange + ']',
  1422. rsZWJ = '\\u200d';
  1423. /** Used to compose unicode regexes. */
  1424. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1425. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1426. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1427. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1428. reOptMod = rsModifier + '?',
  1429. rsOptVar = '[' + rsVarRange + ']?',
  1430. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1431. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1432. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1433. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1434. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1435. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1436. /** Used to match apostrophes. */
  1437. var reApos = RegExp(rsApos, 'g');
  1438. /**
  1439. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1440. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1441. */
  1442. var reComboMark = RegExp(rsCombo, 'g');
  1443. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1444. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1445. /** Used to match complex or compound words. */
  1446. var reUnicodeWord = RegExp([
  1447. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1448. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1449. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1450. rsUpper + '+' + rsOptContrUpper,
  1451. rsOrdUpper,
  1452. rsOrdLower,
  1453. rsDigits,
  1454. rsEmoji
  1455. ].join('|'), 'g');
  1456. /** 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/). */
  1457. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1458. /** Used to detect strings that need a more robust regexp to match words. */
  1459. 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 ]/;
  1460. /** Used to assign default `context` object properties. */
  1461. var contextProps = [
  1462. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1463. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1464. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1465. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1466. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1467. ];
  1468. /** Used to make template sourceURLs easier to identify. */
  1469. var templateCounter = -1;
  1470. /** Used to identify `toStringTag` values of typed arrays. */
  1471. var typedArrayTags = {};
  1472. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1473. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1474. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1475. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1476. typedArrayTags[uint32Tag] = true;
  1477. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1478. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1479. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1480. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1481. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1482. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1483. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1484. typedArrayTags[weakMapTag] = false;
  1485. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1486. var cloneableTags = {};
  1487. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1488. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1489. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1490. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1491. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1492. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1493. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1494. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1495. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1496. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1497. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1498. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1499. cloneableTags[weakMapTag] = false;
  1500. /** Used to map Latin Unicode letters to basic Latin letters. */
  1501. var deburredLetters = {
  1502. // Latin-1 Supplement block.
  1503. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1504. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1505. '\xc7': 'C', '\xe7': 'c',
  1506. '\xd0': 'D', '\xf0': 'd',
  1507. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1508. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1509. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1510. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1511. '\xd1': 'N', '\xf1': 'n',
  1512. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1513. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1514. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1515. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1516. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1517. '\xc6': 'Ae', '\xe6': 'ae',
  1518. '\xde': 'Th', '\xfe': 'th',
  1519. '\xdf': 'ss',
  1520. // Latin Extended-A block.
  1521. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1522. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1523. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1524. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1525. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1526. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1527. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1528. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1529. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1530. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1531. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1532. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1533. '\u0134': 'J', '\u0135': 'j',
  1534. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1535. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1536. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1537. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1538. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1539. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1540. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1541. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1542. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1543. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1544. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1545. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1546. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1547. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1548. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1549. '\u0174': 'W', '\u0175': 'w',
  1550. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1551. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1552. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1553. '\u0132': 'IJ', '\u0133': 'ij',
  1554. '\u0152': 'Oe', '\u0153': 'oe',
  1555. '\u0149': "'n", '\u017f': 's'
  1556. };
  1557. /** Used to map characters to HTML entities. */
  1558. var htmlEscapes = {
  1559. '&': '&amp;',
  1560. '<': '&lt;',
  1561. '>': '&gt;',
  1562. '"': '&quot;',
  1563. "'": '&#39;'
  1564. };
  1565. /** Used to map HTML entities to characters. */
  1566. var htmlUnescapes = {
  1567. '&amp;': '&',
  1568. '&lt;': '<',
  1569. '&gt;': '>',
  1570. '&quot;': '"',
  1571. '&#39;': "'"
  1572. };
  1573. /** Used to escape characters for inclusion in compiled string literals. */
  1574. var stringEscapes = {
  1575. '\\': '\\',
  1576. "'": "'",
  1577. '\n': 'n',
  1578. '\r': 'r',
  1579. '\u2028': 'u2028',
  1580. '\u2029': 'u2029'
  1581. };
  1582. /** Built-in method references without a dependency on `root`. */
  1583. var freeParseFloat = parseFloat,
  1584. freeParseInt = parseInt;
  1585. /** Detect free variable `global` from Node.js. */
  1586. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1587. /** Detect free variable `self`. */
  1588. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1589. /** Used as a reference to the global object. */
  1590. var root = freeGlobal || freeSelf || Function('return this')();
  1591. /** Detect free variable `exports`. */
  1592. var freeExports = true && exports && !exports.nodeType && exports;
  1593. /** Detect free variable `module`. */
  1594. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1595. /** Detect the popular CommonJS extension `module.exports`. */
  1596. var moduleExports = freeModule && freeModule.exports === freeExports;
  1597. /** Detect free variable `process` from Node.js. */
  1598. var freeProcess = moduleExports && freeGlobal.process;
  1599. /** Used to access faster Node.js helpers. */
  1600. var nodeUtil = (function() {
  1601. try {
  1602. // Use `util.types` for Node.js 10+.
  1603. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1604. if (types) {
  1605. return types;
  1606. }
  1607. // Legacy `process.binding('util')` for Node.js < 10.
  1608. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1609. } catch (e) {}
  1610. }());
  1611. /* Node.js helper references. */
  1612. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1613. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1614. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1615. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1616. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1617. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1618. /*--------------------------------------------------------------------------*/
  1619. /**
  1620. * A faster alternative to `Function#apply`, this function invokes `func`
  1621. * with the `this` binding of `thisArg` and the arguments of `args`.
  1622. *
  1623. * @private
  1624. * @param {Function} func The function to invoke.
  1625. * @param {*} thisArg The `this` binding of `func`.
  1626. * @param {Array} args The arguments to invoke `func` with.
  1627. * @returns {*} Returns the result of `func`.
  1628. */
  1629. function apply(func, thisArg, args) {
  1630. switch (args.length) {
  1631. case 0: return func.call(thisArg);
  1632. case 1: return func.call(thisArg, args[0]);
  1633. case 2: return func.call(thisArg, args[0], args[1]);
  1634. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1635. }
  1636. return func.apply(thisArg, args);
  1637. }
  1638. /**
  1639. * A specialized version of `baseAggregator` for arrays.
  1640. *
  1641. * @private
  1642. * @param {Array} [array] The array to iterate over.
  1643. * @param {Function} setter The function to set `accumulator` values.
  1644. * @param {Function} iteratee The iteratee to transform keys.
  1645. * @param {Object} accumulator The initial aggregated object.
  1646. * @returns {Function} Returns `accumulator`.
  1647. */
  1648. function arrayAggregator(array, setter, iteratee, accumulator) {
  1649. var index = -1,
  1650. length = array == null ? 0 : array.length;
  1651. while (++index < length) {
  1652. var value = array[index];
  1653. setter(accumulator, value, iteratee(value), array);
  1654. }
  1655. return accumulator;
  1656. }
  1657. /**
  1658. * A specialized version of `_.forEach` for arrays without support for
  1659. * iteratee shorthands.
  1660. *
  1661. * @private
  1662. * @param {Array} [array] The array to iterate over.
  1663. * @param {Function} iteratee The function invoked per iteration.
  1664. * @returns {Array} Returns `array`.
  1665. */
  1666. function arrayEach(array, iteratee) {
  1667. var index = -1,
  1668. length = array == null ? 0 : array.length;
  1669. while (++index < length) {
  1670. if (iteratee(array[index], index, array) === false) {
  1671. break;
  1672. }
  1673. }
  1674. return array;
  1675. }
  1676. /**
  1677. * A specialized version of `_.forEachRight` for arrays without support for
  1678. * iteratee shorthands.
  1679. *
  1680. * @private
  1681. * @param {Array} [array] The array to iterate over.
  1682. * @param {Function} iteratee The function invoked per iteration.
  1683. * @returns {Array} Returns `array`.
  1684. */
  1685. function arrayEachRight(array, iteratee) {
  1686. var length = array == null ? 0 : array.length;
  1687. while (length--) {
  1688. if (iteratee(array[length], length, array) === false) {
  1689. break;
  1690. }
  1691. }
  1692. return array;
  1693. }
  1694. /**
  1695. * A specialized version of `_.every` for arrays without support for
  1696. * iteratee shorthands.
  1697. *
  1698. * @private
  1699. * @param {Array} [array] The array to iterate over.
  1700. * @param {Function} predicate The function invoked per iteration.
  1701. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1702. * else `false`.
  1703. */
  1704. function arrayEvery(array, predicate) {
  1705. var index = -1,
  1706. length = array == null ? 0 : array.length;
  1707. while (++index < length) {
  1708. if (!predicate(array[index], index, array)) {
  1709. return false;
  1710. }
  1711. }
  1712. return true;
  1713. }
  1714. /**
  1715. * A specialized version of `_.filter` for arrays without support for
  1716. * iteratee shorthands.
  1717. *
  1718. * @private
  1719. * @param {Array} [array] The array to iterate over.
  1720. * @param {Function} predicate The function invoked per iteration.
  1721. * @returns {Array} Returns the new filtered array.
  1722. */
  1723. function arrayFilter(array, predicate) {
  1724. var index = -1,
  1725. length = array == null ? 0 : array.length,
  1726. resIndex = 0,
  1727. result = [];
  1728. while (++index < length) {
  1729. var value = array[index];
  1730. if (predicate(value, index, array)) {
  1731. result[resIndex++] = value;
  1732. }
  1733. }
  1734. return result;
  1735. }
  1736. /**
  1737. * A specialized version of `_.includes` for arrays without support for
  1738. * specifying an index to search from.
  1739. *
  1740. * @private
  1741. * @param {Array} [array] The array to inspect.
  1742. * @param {*} target The value to search for.
  1743. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1744. */
  1745. function arrayIncludes(array, value) {
  1746. var length = array == null ? 0 : array.length;
  1747. return !!length && baseIndexOf(array, value, 0) > -1;
  1748. }
  1749. /**
  1750. * This function is like `arrayIncludes` except that it accepts a comparator.
  1751. *
  1752. * @private
  1753. * @param {Array} [array] The array to inspect.
  1754. * @param {*} target The value to search for.
  1755. * @param {Function} comparator The comparator invoked per element.
  1756. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1757. */
  1758. function arrayIncludesWith(array, value, comparator) {
  1759. var index = -1,
  1760. length = array == null ? 0 : array.length;
  1761. while (++index < length) {
  1762. if (comparator(value, array[index])) {
  1763. return true;
  1764. }
  1765. }
  1766. return false;
  1767. }
  1768. /**
  1769. * A specialized version of `_.map` for arrays without support for iteratee
  1770. * shorthands.
  1771. *
  1772. * @private
  1773. * @param {Array} [array] The array to iterate over.
  1774. * @param {Function} iteratee The function invoked per iteration.
  1775. * @returns {Array} Returns the new mapped array.
  1776. */
  1777. function arrayMap(array, iteratee) {
  1778. var index = -1,
  1779. length = array == null ? 0 : array.length,
  1780. result = Array(length);
  1781. while (++index < length) {
  1782. result[index] = iteratee(array[index], index, array);
  1783. }
  1784. return result;
  1785. }
  1786. /**
  1787. * Appends the elements of `values` to `array`.
  1788. *
  1789. * @private
  1790. * @param {Array} array The array to modify.
  1791. * @param {Array} values The values to append.
  1792. * @returns {Array} Returns `array`.
  1793. */
  1794. function arrayPush(array, values) {
  1795. var index = -1,
  1796. length = values.length,
  1797. offset = array.length;
  1798. while (++index < length) {
  1799. array[offset + index] = values[index];
  1800. }
  1801. return array;
  1802. }
  1803. /**
  1804. * A specialized version of `_.reduce` for arrays without support for
  1805. * iteratee shorthands.
  1806. *
  1807. * @private
  1808. * @param {Array} [array] The array to iterate over.
  1809. * @param {Function} iteratee The function invoked per iteration.
  1810. * @param {*} [accumulator] The initial value.
  1811. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1812. * the initial value.
  1813. * @returns {*} Returns the accumulated value.
  1814. */
  1815. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1816. var index = -1,
  1817. length = array == null ? 0 : array.length;
  1818. if (initAccum && length) {
  1819. accumulator = array[++index];
  1820. }
  1821. while (++index < length) {
  1822. accumulator = iteratee(accumulator, array[index], index, array);
  1823. }
  1824. return accumulator;
  1825. }
  1826. /**
  1827. * A specialized version of `_.reduceRight` for arrays without support for
  1828. * iteratee shorthands.
  1829. *
  1830. * @private
  1831. * @param {Array} [array] The array to iterate over.
  1832. * @param {Function} iteratee The function invoked per iteration.
  1833. * @param {*} [accumulator] The initial value.
  1834. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1835. * the initial value.
  1836. * @returns {*} Returns the accumulated value.
  1837. */
  1838. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1839. var length = array == null ? 0 : array.length;
  1840. if (initAccum && length) {
  1841. accumulator = array[--length];
  1842. }
  1843. while (length--) {
  1844. accumulator = iteratee(accumulator, array[length], length, array);
  1845. }
  1846. return accumulator;
  1847. }
  1848. /**
  1849. * A specialized version of `_.some` for arrays without support for iteratee
  1850. * shorthands.
  1851. *
  1852. * @private
  1853. * @param {Array} [array] The array to iterate over.
  1854. * @param {Function} predicate The function invoked per iteration.
  1855. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1856. * else `false`.
  1857. */
  1858. function arraySome(array, predicate) {
  1859. var index = -1,
  1860. length = array == null ? 0 : array.length;
  1861. while (++index < length) {
  1862. if (predicate(array[index], index, array)) {
  1863. return true;
  1864. }
  1865. }
  1866. return false;
  1867. }
  1868. /**
  1869. * Gets the size of an ASCII `string`.
  1870. *
  1871. * @private
  1872. * @param {string} string The string inspect.
  1873. * @returns {number} Returns the string size.
  1874. */
  1875. var asciiSize = baseProperty('length');
  1876. /**
  1877. * Converts an ASCII `string` to an array.
  1878. *
  1879. * @private
  1880. * @param {string} string The string to convert.
  1881. * @returns {Array} Returns the converted array.
  1882. */
  1883. function asciiToArray(string) {
  1884. return string.split('');
  1885. }
  1886. /**
  1887. * Splits an ASCII `string` into an array of its words.
  1888. *
  1889. * @private
  1890. * @param {string} The string to inspect.
  1891. * @returns {Array} Returns the words of `string`.
  1892. */
  1893. function asciiWords(string) {
  1894. return string.match(reAsciiWord) || [];
  1895. }
  1896. /**
  1897. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1898. * without support for iteratee shorthands, which iterates over `collection`
  1899. * using `eachFunc`.
  1900. *
  1901. * @private
  1902. * @param {Array|Object} collection The collection to inspect.
  1903. * @param {Function} predicate The function invoked per iteration.
  1904. * @param {Function} eachFunc The function to iterate over `collection`.
  1905. * @returns {*} Returns the found element or its key, else `undefined`.
  1906. */
  1907. function baseFindKey(collection, predicate, eachFunc) {
  1908. var result;
  1909. eachFunc(collection, function(value, key, collection) {
  1910. if (predicate(value, key, collection)) {
  1911. result = key;
  1912. return false;
  1913. }
  1914. });
  1915. return result;
  1916. }
  1917. /**
  1918. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1919. * support for iteratee shorthands.
  1920. *
  1921. * @private
  1922. * @param {Array} array The array to inspect.
  1923. * @param {Function} predicate The function invoked per iteration.
  1924. * @param {number} fromIndex The index to search from.
  1925. * @param {boolean} [fromRight] Specify iterating from right to left.
  1926. * @returns {number} Returns the index of the matched value, else `-1`.
  1927. */
  1928. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1929. var length = array.length,
  1930. index = fromIndex + (fromRight ? 1 : -1);
  1931. while ((fromRight ? index-- : ++index < length)) {
  1932. if (predicate(array[index], index, array)) {
  1933. return index;
  1934. }
  1935. }
  1936. return -1;
  1937. }
  1938. /**
  1939. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1940. *
  1941. * @private
  1942. * @param {Array} array The array to inspect.
  1943. * @param {*} value The value to search for.
  1944. * @param {number} fromIndex The index to search from.
  1945. * @returns {number} Returns the index of the matched value, else `-1`.
  1946. */
  1947. function baseIndexOf(array, value, fromIndex) {
  1948. return value === value
  1949. ? strictIndexOf(array, value, fromIndex)
  1950. : baseFindIndex(array, baseIsNaN, fromIndex);
  1951. }
  1952. /**
  1953. * This function is like `baseIndexOf` except that it accepts a comparator.
  1954. *
  1955. * @private
  1956. * @param {Array} array The array to inspect.
  1957. * @param {*} value The value to search for.
  1958. * @param {number} fromIndex The index to search from.
  1959. * @param {Function} comparator The comparator invoked per element.
  1960. * @returns {number} Returns the index of the matched value, else `-1`.
  1961. */
  1962. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1963. var index = fromIndex - 1,
  1964. length = array.length;
  1965. while (++index < length) {
  1966. if (comparator(array[index], value)) {
  1967. return index;
  1968. }
  1969. }
  1970. return -1;
  1971. }
  1972. /**
  1973. * The base implementation of `_.isNaN` without support for number objects.
  1974. *
  1975. * @private
  1976. * @param {*} value The value to check.
  1977. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1978. */
  1979. function baseIsNaN(value) {
  1980. return value !== value;
  1981. }
  1982. /**
  1983. * The base implementation of `_.mean` and `_.meanBy` without support for
  1984. * iteratee shorthands.
  1985. *
  1986. * @private
  1987. * @param {Array} array The array to iterate over.
  1988. * @param {Function} iteratee The function invoked per iteration.
  1989. * @returns {number} Returns the mean.
  1990. */
  1991. function baseMean(array, iteratee) {
  1992. var length = array == null ? 0 : array.length;
  1993. return length ? (baseSum(array, iteratee) / length) : NAN;
  1994. }
  1995. /**
  1996. * The base implementation of `_.property` without support for deep paths.
  1997. *
  1998. * @private
  1999. * @param {string} key The key of the property to get.
  2000. * @returns {Function} Returns the new accessor function.
  2001. */
  2002. function baseProperty(key) {
  2003. return function(object) {
  2004. return object == null ? undefined : object[key];
  2005. };
  2006. }
  2007. /**
  2008. * The base implementation of `_.propertyOf` without support for deep paths.
  2009. *
  2010. * @private
  2011. * @param {Object} object The object to query.
  2012. * @returns {Function} Returns the new accessor function.
  2013. */
  2014. function basePropertyOf(object) {
  2015. return function(key) {
  2016. return object == null ? undefined : object[key];
  2017. };
  2018. }
  2019. /**
  2020. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2021. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2022. *
  2023. * @private
  2024. * @param {Array|Object} collection The collection to iterate over.
  2025. * @param {Function} iteratee The function invoked per iteration.
  2026. * @param {*} accumulator The initial value.
  2027. * @param {boolean} initAccum Specify using the first or last element of
  2028. * `collection` as the initial value.
  2029. * @param {Function} eachFunc The function to iterate over `collection`.
  2030. * @returns {*} Returns the accumulated value.
  2031. */
  2032. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2033. eachFunc(collection, function(value, index, collection) {
  2034. accumulator = initAccum
  2035. ? (initAccum = false, value)
  2036. : iteratee(accumulator, value, index, collection);
  2037. });
  2038. return accumulator;
  2039. }
  2040. /**
  2041. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2042. * sort order of `array` and replaces criteria objects with their corresponding
  2043. * values.
  2044. *
  2045. * @private
  2046. * @param {Array} array The array to sort.
  2047. * @param {Function} comparer The function to define sort order.
  2048. * @returns {Array} Returns `array`.
  2049. */
  2050. function baseSortBy(array, comparer) {
  2051. var length = array.length;
  2052. array.sort(comparer);
  2053. while (length--) {
  2054. array[length] = array[length].value;
  2055. }
  2056. return array;
  2057. }
  2058. /**
  2059. * The base implementation of `_.sum` and `_.sumBy` without support for
  2060. * iteratee shorthands.
  2061. *
  2062. * @private
  2063. * @param {Array} array The array to iterate over.
  2064. * @param {Function} iteratee The function invoked per iteration.
  2065. * @returns {number} Returns the sum.
  2066. */
  2067. function baseSum(array, iteratee) {
  2068. var result,
  2069. index = -1,
  2070. length = array.length;
  2071. while (++index < length) {
  2072. var current = iteratee(array[index]);
  2073. if (current !== undefined) {
  2074. result = result === undefined ? current : (result + current);
  2075. }
  2076. }
  2077. return result;
  2078. }
  2079. /**
  2080. * The base implementation of `_.times` without support for iteratee shorthands
  2081. * or max array length checks.
  2082. *
  2083. * @private
  2084. * @param {number} n The number of times to invoke `iteratee`.
  2085. * @param {Function} iteratee The function invoked per iteration.
  2086. * @returns {Array} Returns the array of results.
  2087. */
  2088. function baseTimes(n, iteratee) {
  2089. var index = -1,
  2090. result = Array(n);
  2091. while (++index < n) {
  2092. result[index] = iteratee(index);
  2093. }
  2094. return result;
  2095. }
  2096. /**
  2097. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2098. * of key-value pairs for `object` corresponding to the property names of `props`.
  2099. *
  2100. * @private
  2101. * @param {Object} object The object to query.
  2102. * @param {Array} props The property names to get values for.
  2103. * @returns {Object} Returns the key-value pairs.
  2104. */
  2105. function baseToPairs(object, props) {
  2106. return arrayMap(props, function(key) {
  2107. return [key, object[key]];
  2108. });
  2109. }
  2110. /**
  2111. * The base implementation of `_.trim`.
  2112. *
  2113. * @private
  2114. * @param {string} string The string to trim.
  2115. * @returns {string} Returns the trimmed string.
  2116. */
  2117. function baseTrim(string) {
  2118. return string
  2119. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2120. : string;
  2121. }
  2122. /**
  2123. * The base implementation of `_.unary` without support for storing metadata.
  2124. *
  2125. * @private
  2126. * @param {Function} func The function to cap arguments for.
  2127. * @returns {Function} Returns the new capped function.
  2128. */
  2129. function baseUnary(func) {
  2130. return function(value) {
  2131. return func(value);
  2132. };
  2133. }
  2134. /**
  2135. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2136. * array of `object` property values corresponding to the property names
  2137. * of `props`.
  2138. *
  2139. * @private
  2140. * @param {Object} object The object to query.
  2141. * @param {Array} props The property names to get values for.
  2142. * @returns {Object} Returns the array of property values.
  2143. */
  2144. function baseValues(object, props) {
  2145. return arrayMap(props, function(key) {
  2146. return object[key];
  2147. });
  2148. }
  2149. /**
  2150. * Checks if a `cache` value for `key` exists.
  2151. *
  2152. * @private
  2153. * @param {Object} cache The cache to query.
  2154. * @param {string} key The key of the entry to check.
  2155. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2156. */
  2157. function cacheHas(cache, key) {
  2158. return cache.has(key);
  2159. }
  2160. /**
  2161. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2162. * that is not found in the character symbols.
  2163. *
  2164. * @private
  2165. * @param {Array} strSymbols The string symbols to inspect.
  2166. * @param {Array} chrSymbols The character symbols to find.
  2167. * @returns {number} Returns the index of the first unmatched string symbol.
  2168. */
  2169. function charsStartIndex(strSymbols, chrSymbols) {
  2170. var index = -1,
  2171. length = strSymbols.length;
  2172. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2173. return index;
  2174. }
  2175. /**
  2176. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2177. * that is not found in the character symbols.
  2178. *
  2179. * @private
  2180. * @param {Array} strSymbols The string symbols to inspect.
  2181. * @param {Array} chrSymbols The character symbols to find.
  2182. * @returns {number} Returns the index of the last unmatched string symbol.
  2183. */
  2184. function charsEndIndex(strSymbols, chrSymbols) {
  2185. var index = strSymbols.length;
  2186. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2187. return index;
  2188. }
  2189. /**
  2190. * Gets the number of `placeholder` occurrences in `array`.
  2191. *
  2192. * @private
  2193. * @param {Array} array The array to inspect.
  2194. * @param {*} placeholder The placeholder to search for.
  2195. * @returns {number} Returns the placeholder count.
  2196. */
  2197. function countHolders(array, placeholder) {
  2198. var length = array.length,
  2199. result = 0;
  2200. while (length--) {
  2201. if (array[length] === placeholder) {
  2202. ++result;
  2203. }
  2204. }
  2205. return result;
  2206. }
  2207. /**
  2208. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2209. * letters to basic Latin letters.
  2210. *
  2211. * @private
  2212. * @param {string} letter The matched letter to deburr.
  2213. * @returns {string} Returns the deburred letter.
  2214. */
  2215. var deburrLetter = basePropertyOf(deburredLetters);
  2216. /**
  2217. * Used by `_.escape` to convert characters to HTML entities.
  2218. *
  2219. * @private
  2220. * @param {string} chr The matched character to escape.
  2221. * @returns {string} Returns the escaped character.
  2222. */
  2223. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2224. /**
  2225. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2226. *
  2227. * @private
  2228. * @param {string} chr The matched character to escape.
  2229. * @returns {string} Returns the escaped character.
  2230. */
  2231. function escapeStringChar(chr) {
  2232. return '\\' + stringEscapes[chr];
  2233. }
  2234. /**
  2235. * Gets the value at `key` of `object`.
  2236. *
  2237. * @private
  2238. * @param {Object} [object] The object to query.
  2239. * @param {string} key The key of the property to get.
  2240. * @returns {*} Returns the property value.
  2241. */
  2242. function getValue(object, key) {
  2243. return object == null ? undefined : object[key];
  2244. }
  2245. /**
  2246. * Checks if `string` contains Unicode symbols.
  2247. *
  2248. * @private
  2249. * @param {string} string The string to inspect.
  2250. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2251. */
  2252. function hasUnicode(string) {
  2253. return reHasUnicode.test(string);
  2254. }
  2255. /**
  2256. * Checks if `string` contains a word composed of Unicode symbols.
  2257. *
  2258. * @private
  2259. * @param {string} string The string to inspect.
  2260. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2261. */
  2262. function hasUnicodeWord(string) {
  2263. return reHasUnicodeWord.test(string);
  2264. }
  2265. /**
  2266. * Converts `iterator` to an array.
  2267. *
  2268. * @private
  2269. * @param {Object} iterator The iterator to convert.
  2270. * @returns {Array} Returns the converted array.
  2271. */
  2272. function iteratorToArray(iterator) {
  2273. var data,
  2274. result = [];
  2275. while (!(data = iterator.next()).done) {
  2276. result.push(data.value);
  2277. }
  2278. return result;
  2279. }
  2280. /**
  2281. * Converts `map` to its key-value pairs.
  2282. *
  2283. * @private
  2284. * @param {Object} map The map to convert.
  2285. * @returns {Array} Returns the key-value pairs.
  2286. */
  2287. function mapToArray(map) {
  2288. var index = -1,
  2289. result = Array(map.size);
  2290. map.forEach(function(value, key) {
  2291. result[++index] = [key, value];
  2292. });
  2293. return result;
  2294. }
  2295. /**
  2296. * Creates a unary function that invokes `func` with its argument transformed.
  2297. *
  2298. * @private
  2299. * @param {Function} func The function to wrap.
  2300. * @param {Function} transform The argument transform.
  2301. * @returns {Function} Returns the new function.
  2302. */
  2303. function overArg(func, transform) {
  2304. return function(arg) {
  2305. return func(transform(arg));
  2306. };
  2307. }
  2308. /**
  2309. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2310. * and returns an array of their indexes.
  2311. *
  2312. * @private
  2313. * @param {Array} array The array to modify.
  2314. * @param {*} placeholder The placeholder to replace.
  2315. * @returns {Array} Returns the new array of placeholder indexes.
  2316. */
  2317. function replaceHolders(array, placeholder) {
  2318. var index = -1,
  2319. length = array.length,
  2320. resIndex = 0,
  2321. result = [];
  2322. while (++index < length) {
  2323. var value = array[index];
  2324. if (value === placeholder || value === PLACEHOLDER) {
  2325. array[index] = PLACEHOLDER;
  2326. result[resIndex++] = index;
  2327. }
  2328. }
  2329. return result;
  2330. }
  2331. /**
  2332. * Converts `set` to an array of its values.
  2333. *
  2334. * @private
  2335. * @param {Object} set The set to convert.
  2336. * @returns {Array} Returns the values.
  2337. */
  2338. function setToArray(set) {
  2339. var index = -1,
  2340. result = Array(set.size);
  2341. set.forEach(function(value) {
  2342. result[++index] = value;
  2343. });
  2344. return result;
  2345. }
  2346. /**
  2347. * Converts `set` to its value-value pairs.
  2348. *
  2349. * @private
  2350. * @param {Object} set The set to convert.
  2351. * @returns {Array} Returns the value-value pairs.
  2352. */
  2353. function setToPairs(set) {
  2354. var index = -1,
  2355. result = Array(set.size);
  2356. set.forEach(function(value) {
  2357. result[++index] = [value, value];
  2358. });
  2359. return result;
  2360. }
  2361. /**
  2362. * A specialized version of `_.indexOf` which performs strict equality
  2363. * comparisons of values, i.e. `===`.
  2364. *
  2365. * @private
  2366. * @param {Array} array The array to inspect.
  2367. * @param {*} value The value to search for.
  2368. * @param {number} fromIndex The index to search from.
  2369. * @returns {number} Returns the index of the matched value, else `-1`.
  2370. */
  2371. function strictIndexOf(array, value, fromIndex) {
  2372. var index = fromIndex - 1,
  2373. length = array.length;
  2374. while (++index < length) {
  2375. if (array[index] === value) {
  2376. return index;
  2377. }
  2378. }
  2379. return -1;
  2380. }
  2381. /**
  2382. * A specialized version of `_.lastIndexOf` which performs strict equality
  2383. * comparisons of values, i.e. `===`.
  2384. *
  2385. * @private
  2386. * @param {Array} array The array to inspect.
  2387. * @param {*} value The value to search for.
  2388. * @param {number} fromIndex The index to search from.
  2389. * @returns {number} Returns the index of the matched value, else `-1`.
  2390. */
  2391. function strictLastIndexOf(array, value, fromIndex) {
  2392. var index = fromIndex + 1;
  2393. while (index--) {
  2394. if (array[index] === value) {
  2395. return index;
  2396. }
  2397. }
  2398. return index;
  2399. }
  2400. /**
  2401. * Gets the number of symbols in `string`.
  2402. *
  2403. * @private
  2404. * @param {string} string The string to inspect.
  2405. * @returns {number} Returns the string size.
  2406. */
  2407. function stringSize(string) {
  2408. return hasUnicode(string)
  2409. ? unicodeSize(string)
  2410. : asciiSize(string);
  2411. }
  2412. /**
  2413. * Converts `string` to an array.
  2414. *
  2415. * @private
  2416. * @param {string} string The string to convert.
  2417. * @returns {Array} Returns the converted array.
  2418. */
  2419. function stringToArray(string) {
  2420. return hasUnicode(string)
  2421. ? unicodeToArray(string)
  2422. : asciiToArray(string);
  2423. }
  2424. /**
  2425. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2426. * character of `string`.
  2427. *
  2428. * @private
  2429. * @param {string} string The string to inspect.
  2430. * @returns {number} Returns the index of the last non-whitespace character.
  2431. */
  2432. function trimmedEndIndex(string) {
  2433. var index = string.length;
  2434. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2435. return index;
  2436. }
  2437. /**
  2438. * Used by `_.unescape` to convert HTML entities to characters.
  2439. *
  2440. * @private
  2441. * @param {string} chr The matched character to unescape.
  2442. * @returns {string} Returns the unescaped character.
  2443. */
  2444. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2445. /**
  2446. * Gets the size of a Unicode `string`.
  2447. *
  2448. * @private
  2449. * @param {string} string The string inspect.
  2450. * @returns {number} Returns the string size.
  2451. */
  2452. function unicodeSize(string) {
  2453. var result = reUnicode.lastIndex = 0;
  2454. while (reUnicode.test(string)) {
  2455. ++result;
  2456. }
  2457. return result;
  2458. }
  2459. /**
  2460. * Converts a Unicode `string` to an array.
  2461. *
  2462. * @private
  2463. * @param {string} string The string to convert.
  2464. * @returns {Array} Returns the converted array.
  2465. */
  2466. function unicodeToArray(string) {
  2467. return string.match(reUnicode) || [];
  2468. }
  2469. /**
  2470. * Splits a Unicode `string` into an array of its words.
  2471. *
  2472. * @private
  2473. * @param {string} The string to inspect.
  2474. * @returns {Array} Returns the words of `string`.
  2475. */
  2476. function unicodeWords(string) {
  2477. return string.match(reUnicodeWord) || [];
  2478. }
  2479. /*--------------------------------------------------------------------------*/
  2480. /**
  2481. * Create a new pristine `lodash` function using the `context` object.
  2482. *
  2483. * @static
  2484. * @memberOf _
  2485. * @since 1.1.0
  2486. * @category Util
  2487. * @param {Object} [context=root] The context object.
  2488. * @returns {Function} Returns a new `lodash` function.
  2489. * @example
  2490. *
  2491. * _.mixin({ 'foo': _.constant('foo') });
  2492. *
  2493. * var lodash = _.runInContext();
  2494. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2495. *
  2496. * _.isFunction(_.foo);
  2497. * // => true
  2498. * _.isFunction(_.bar);
  2499. * // => false
  2500. *
  2501. * lodash.isFunction(lodash.foo);
  2502. * // => false
  2503. * lodash.isFunction(lodash.bar);
  2504. * // => true
  2505. *
  2506. * // Create a suped-up `defer` in Node.js.
  2507. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2508. */
  2509. var runInContext = (function runInContext(context) {
  2510. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2511. /** Built-in constructor references. */
  2512. var Array = context.Array,
  2513. Date = context.Date,
  2514. Error = context.Error,
  2515. Function = context.Function,
  2516. Math = context.Math,
  2517. Object = context.Object,
  2518. RegExp = context.RegExp,
  2519. String = context.String,
  2520. TypeError = context.TypeError;
  2521. /** Used for built-in method references. */
  2522. var arrayProto = Array.prototype,
  2523. funcProto = Function.prototype,
  2524. objectProto = Object.prototype;
  2525. /** Used to detect overreaching core-js shims. */
  2526. var coreJsData = context['__core-js_shared__'];
  2527. /** Used to resolve the decompiled source of functions. */
  2528. var funcToString = funcProto.toString;
  2529. /** Used to check objects for own properties. */
  2530. var hasOwnProperty = objectProto.hasOwnProperty;
  2531. /** Used to generate unique IDs. */
  2532. var idCounter = 0;
  2533. /** Used to detect methods masquerading as native. */
  2534. var maskSrcKey = (function() {
  2535. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2536. return uid ? ('Symbol(src)_1.' + uid) : '';
  2537. }());
  2538. /**
  2539. * Used to resolve the
  2540. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2541. * of values.
  2542. */
  2543. var nativeObjectToString = objectProto.toString;
  2544. /** Used to infer the `Object` constructor. */
  2545. var objectCtorString = funcToString.call(Object);
  2546. /** Used to restore the original `_` reference in `_.noConflict`. */
  2547. var oldDash = root._;
  2548. /** Used to detect if a method is native. */
  2549. var reIsNative = RegExp('^' +
  2550. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2551. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2552. );
  2553. /** Built-in value references. */
  2554. var Buffer = moduleExports ? context.Buffer : undefined,
  2555. Symbol = context.Symbol,
  2556. Uint8Array = context.Uint8Array,
  2557. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2558. getPrototype = overArg(Object.getPrototypeOf, Object),
  2559. objectCreate = Object.create,
  2560. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2561. splice = arrayProto.splice,
  2562. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2563. symIterator = Symbol ? Symbol.iterator : undefined,
  2564. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2565. var defineProperty = (function() {
  2566. try {
  2567. var func = getNative(Object, 'defineProperty');
  2568. func({}, '', {});
  2569. return func;
  2570. } catch (e) {}
  2571. }());
  2572. /** Mocked built-ins. */
  2573. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2574. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2575. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2576. /* Built-in method references for those with the same name as other `lodash` methods. */
  2577. var nativeCeil = Math.ceil,
  2578. nativeFloor = Math.floor,
  2579. nativeGetSymbols = Object.getOwnPropertySymbols,
  2580. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2581. nativeIsFinite = context.isFinite,
  2582. nativeJoin = arrayProto.join,
  2583. nativeKeys = overArg(Object.keys, Object),
  2584. nativeMax = Math.max,
  2585. nativeMin = Math.min,
  2586. nativeNow = Date.now,
  2587. nativeParseInt = context.parseInt,
  2588. nativeRandom = Math.random,
  2589. nativeReverse = arrayProto.reverse;
  2590. /* Built-in method references that are verified to be native. */
  2591. var DataView = getNative(context, 'DataView'),
  2592. Map = getNative(context, 'Map'),
  2593. Promise = getNative(context, 'Promise'),
  2594. Set = getNative(context, 'Set'),
  2595. WeakMap = getNative(context, 'WeakMap'),
  2596. nativeCreate = getNative(Object, 'create');
  2597. /** Used to store function metadata. */
  2598. var metaMap = WeakMap && new WeakMap;
  2599. /** Used to lookup unminified function names. */
  2600. var realNames = {};
  2601. /** Used to detect maps, sets, and weakmaps. */
  2602. var dataViewCtorString = toSource(DataView),
  2603. mapCtorString = toSource(Map),
  2604. promiseCtorString = toSource(Promise),
  2605. setCtorString = toSource(Set),
  2606. weakMapCtorString = toSource(WeakMap);
  2607. /** Used to convert symbols to primitives and strings. */
  2608. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2609. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2610. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2611. /*------------------------------------------------------------------------*/
  2612. /**
  2613. * Creates a `lodash` object which wraps `value` to enable implicit method
  2614. * chain sequences. Methods that operate on and return arrays, collections,
  2615. * and functions can be chained together. Methods that retrieve a single value
  2616. * or may return a primitive value will automatically end the chain sequence
  2617. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2618. * with `_#value`.
  2619. *
  2620. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2621. * enabled using `_.chain`.
  2622. *
  2623. * The execution of chained methods is lazy, that is, it's deferred until
  2624. * `_#value` is implicitly or explicitly called.
  2625. *
  2626. * Lazy evaluation allows several methods to support shortcut fusion.
  2627. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2628. * the creation of intermediate arrays and can greatly reduce the number of
  2629. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2630. * fusion if the section is applied to an array and iteratees accept only
  2631. * one argument. The heuristic for whether a section qualifies for shortcut
  2632. * fusion is subject to change.
  2633. *
  2634. * Chaining is supported in custom builds as long as the `_#value` method is
  2635. * directly or indirectly included in the build.
  2636. *
  2637. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2638. *
  2639. * The wrapper `Array` methods are:
  2640. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2641. *
  2642. * The wrapper `String` methods are:
  2643. * `replace` and `split`
  2644. *
  2645. * The wrapper methods that support shortcut fusion are:
  2646. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2647. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2648. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2649. *
  2650. * The chainable wrapper methods are:
  2651. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2652. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2653. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2654. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2655. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2656. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2657. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2658. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2659. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2660. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2661. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2662. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2663. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2664. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2665. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2666. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2667. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2668. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2669. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2670. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2671. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2672. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2673. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2674. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2675. *
  2676. * The wrapper methods that are **not** chainable by default are:
  2677. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2678. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2679. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2680. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2681. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2682. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2683. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2684. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2685. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2686. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2687. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2688. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2689. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2690. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2691. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2692. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2693. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2694. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2695. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2696. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2697. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2698. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2699. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2700. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2701. * `upperFirst`, `value`, and `words`
  2702. *
  2703. * @name _
  2704. * @constructor
  2705. * @category Seq
  2706. * @param {*} value The value to wrap in a `lodash` instance.
  2707. * @returns {Object} Returns the new `lodash` wrapper instance.
  2708. * @example
  2709. *
  2710. * function square(n) {
  2711. * return n * n;
  2712. * }
  2713. *
  2714. * var wrapped = _([1, 2, 3]);
  2715. *
  2716. * // Returns an unwrapped value.
  2717. * wrapped.reduce(_.add);
  2718. * // => 6
  2719. *
  2720. * // Returns a wrapped value.
  2721. * var squares = wrapped.map(square);
  2722. *
  2723. * _.isArray(squares);
  2724. * // => false
  2725. *
  2726. * _.isArray(squares.value());
  2727. * // => true
  2728. */
  2729. function lodash(value) {
  2730. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2731. if (value instanceof LodashWrapper) {
  2732. return value;
  2733. }
  2734. if (hasOwnProperty.call(value, '__wrapped__')) {
  2735. return wrapperClone(value);
  2736. }
  2737. }
  2738. return new LodashWrapper(value);
  2739. }
  2740. /**
  2741. * The base implementation of `_.create` without support for assigning
  2742. * properties to the created object.
  2743. *
  2744. * @private
  2745. * @param {Object} proto The object to inherit from.
  2746. * @returns {Object} Returns the new object.
  2747. */
  2748. var baseCreate = (function() {
  2749. function object() {}
  2750. return function(proto) {
  2751. if (!isObject(proto)) {
  2752. return {};
  2753. }
  2754. if (objectCreate) {
  2755. return objectCreate(proto);
  2756. }
  2757. object.prototype = proto;
  2758. var result = new object;
  2759. object.prototype = undefined;
  2760. return result;
  2761. };
  2762. }());
  2763. /**
  2764. * The function whose prototype chain sequence wrappers inherit from.
  2765. *
  2766. * @private
  2767. */
  2768. function baseLodash() {
  2769. // No operation performed.
  2770. }
  2771. /**
  2772. * The base constructor for creating `lodash` wrapper objects.
  2773. *
  2774. * @private
  2775. * @param {*} value The value to wrap.
  2776. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2777. */
  2778. function LodashWrapper(value, chainAll) {
  2779. this.__wrapped__ = value;
  2780. this.__actions__ = [];
  2781. this.__chain__ = !!chainAll;
  2782. this.__index__ = 0;
  2783. this.__values__ = undefined;
  2784. }
  2785. /**
  2786. * By default, the template delimiters used by lodash are like those in
  2787. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2788. * following template settings to use alternative delimiters.
  2789. *
  2790. * @static
  2791. * @memberOf _
  2792. * @type {Object}
  2793. */
  2794. lodash.templateSettings = {
  2795. /**
  2796. * Used to detect `data` property values to be HTML-escaped.
  2797. *
  2798. * @memberOf _.templateSettings
  2799. * @type {RegExp}
  2800. */
  2801. 'escape': reEscape,
  2802. /**
  2803. * Used to detect code to be evaluated.
  2804. *
  2805. * @memberOf _.templateSettings
  2806. * @type {RegExp}
  2807. */
  2808. 'evaluate': reEvaluate,
  2809. /**
  2810. * Used to detect `data` property values to inject.
  2811. *
  2812. * @memberOf _.templateSettings
  2813. * @type {RegExp}
  2814. */
  2815. 'interpolate': reInterpolate,
  2816. /**
  2817. * Used to reference the data object in the template text.
  2818. *
  2819. * @memberOf _.templateSettings
  2820. * @type {string}
  2821. */
  2822. 'variable': '',
  2823. /**
  2824. * Used to import variables into the compiled template.
  2825. *
  2826. * @memberOf _.templateSettings
  2827. * @type {Object}
  2828. */
  2829. 'imports': {
  2830. /**
  2831. * A reference to the `lodash` function.
  2832. *
  2833. * @memberOf _.templateSettings.imports
  2834. * @type {Function}
  2835. */
  2836. '_': lodash
  2837. }
  2838. };
  2839. // Ensure wrappers are instances of `baseLodash`.
  2840. lodash.prototype = baseLodash.prototype;
  2841. lodash.prototype.constructor = lodash;
  2842. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2843. LodashWrapper.prototype.constructor = LodashWrapper;
  2844. /*------------------------------------------------------------------------*/
  2845. /**
  2846. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2847. *
  2848. * @private
  2849. * @constructor
  2850. * @param {*} value The value to wrap.
  2851. */
  2852. function LazyWrapper(value) {
  2853. this.__wrapped__ = value;
  2854. this.__actions__ = [];
  2855. this.__dir__ = 1;
  2856. this.__filtered__ = false;
  2857. this.__iteratees__ = [];
  2858. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2859. this.__views__ = [];
  2860. }
  2861. /**
  2862. * Creates a clone of the lazy wrapper object.
  2863. *
  2864. * @private
  2865. * @name clone
  2866. * @memberOf LazyWrapper
  2867. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2868. */
  2869. function lazyClone() {
  2870. var result = new LazyWrapper(this.__wrapped__);
  2871. result.__actions__ = copyArray(this.__actions__);
  2872. result.__dir__ = this.__dir__;
  2873. result.__filtered__ = this.__filtered__;
  2874. result.__iteratees__ = copyArray(this.__iteratees__);
  2875. result.__takeCount__ = this.__takeCount__;
  2876. result.__views__ = copyArray(this.__views__);
  2877. return result;
  2878. }
  2879. /**
  2880. * Reverses the direction of lazy iteration.
  2881. *
  2882. * @private
  2883. * @name reverse
  2884. * @memberOf LazyWrapper
  2885. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2886. */
  2887. function lazyReverse() {
  2888. if (this.__filtered__) {
  2889. var result = new LazyWrapper(this);
  2890. result.__dir__ = -1;
  2891. result.__filtered__ = true;
  2892. } else {
  2893. result = this.clone();
  2894. result.__dir__ *= -1;
  2895. }
  2896. return result;
  2897. }
  2898. /**
  2899. * Extracts the unwrapped value from its lazy wrapper.
  2900. *
  2901. * @private
  2902. * @name value
  2903. * @memberOf LazyWrapper
  2904. * @returns {*} Returns the unwrapped value.
  2905. */
  2906. function lazyValue() {
  2907. var array = this.__wrapped__.value(),
  2908. dir = this.__dir__,
  2909. isArr = isArray(array),
  2910. isRight = dir < 0,
  2911. arrLength = isArr ? array.length : 0,
  2912. view = getView(0, arrLength, this.__views__),
  2913. start = view.start,
  2914. end = view.end,
  2915. length = end - start,
  2916. index = isRight ? end : (start - 1),
  2917. iteratees = this.__iteratees__,
  2918. iterLength = iteratees.length,
  2919. resIndex = 0,
  2920. takeCount = nativeMin(length, this.__takeCount__);
  2921. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2922. return baseWrapperValue(array, this.__actions__);
  2923. }
  2924. var result = [];
  2925. outer:
  2926. while (length-- && resIndex < takeCount) {
  2927. index += dir;
  2928. var iterIndex = -1,
  2929. value = array[index];
  2930. while (++iterIndex < iterLength) {
  2931. var data = iteratees[iterIndex],
  2932. iteratee = data.iteratee,
  2933. type = data.type,
  2934. computed = iteratee(value);
  2935. if (type == LAZY_MAP_FLAG) {
  2936. value = computed;
  2937. } else if (!computed) {
  2938. if (type == LAZY_FILTER_FLAG) {
  2939. continue outer;
  2940. } else {
  2941. break outer;
  2942. }
  2943. }
  2944. }
  2945. result[resIndex++] = value;
  2946. }
  2947. return result;
  2948. }
  2949. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2950. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2951. LazyWrapper.prototype.constructor = LazyWrapper;
  2952. /*------------------------------------------------------------------------*/
  2953. /**
  2954. * Creates a hash object.
  2955. *
  2956. * @private
  2957. * @constructor
  2958. * @param {Array} [entries] The key-value pairs to cache.
  2959. */
  2960. function Hash(entries) {
  2961. var index = -1,
  2962. length = entries == null ? 0 : entries.length;
  2963. this.clear();
  2964. while (++index < length) {
  2965. var entry = entries[index];
  2966. this.set(entry[0], entry[1]);
  2967. }
  2968. }
  2969. /**
  2970. * Removes all key-value entries from the hash.
  2971. *
  2972. * @private
  2973. * @name clear
  2974. * @memberOf Hash
  2975. */
  2976. function hashClear() {
  2977. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2978. this.size = 0;
  2979. }
  2980. /**
  2981. * Removes `key` and its value from the hash.
  2982. *
  2983. * @private
  2984. * @name delete
  2985. * @memberOf Hash
  2986. * @param {Object} hash The hash to modify.
  2987. * @param {string} key The key of the value to remove.
  2988. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2989. */
  2990. function hashDelete(key) {
  2991. var result = this.has(key) && delete this.__data__[key];
  2992. this.size -= result ? 1 : 0;
  2993. return result;
  2994. }
  2995. /**
  2996. * Gets the hash value for `key`.
  2997. *
  2998. * @private
  2999. * @name get
  3000. * @memberOf Hash
  3001. * @param {string} key The key of the value to get.
  3002. * @returns {*} Returns the entry value.
  3003. */
  3004. function hashGet(key) {
  3005. var data = this.__data__;
  3006. if (nativeCreate) {
  3007. var result = data[key];
  3008. return result === HASH_UNDEFINED ? undefined : result;
  3009. }
  3010. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3011. }
  3012. /**
  3013. * Checks if a hash value for `key` exists.
  3014. *
  3015. * @private
  3016. * @name has
  3017. * @memberOf Hash
  3018. * @param {string} key The key of the entry to check.
  3019. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3020. */
  3021. function hashHas(key) {
  3022. var data = this.__data__;
  3023. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3024. }
  3025. /**
  3026. * Sets the hash `key` to `value`.
  3027. *
  3028. * @private
  3029. * @name set
  3030. * @memberOf Hash
  3031. * @param {string} key The key of the value to set.
  3032. * @param {*} value The value to set.
  3033. * @returns {Object} Returns the hash instance.
  3034. */
  3035. function hashSet(key, value) {
  3036. var data = this.__data__;
  3037. this.size += this.has(key) ? 0 : 1;
  3038. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3039. return this;
  3040. }
  3041. // Add methods to `Hash`.
  3042. Hash.prototype.clear = hashClear;
  3043. Hash.prototype['delete'] = hashDelete;
  3044. Hash.prototype.get = hashGet;
  3045. Hash.prototype.has = hashHas;
  3046. Hash.prototype.set = hashSet;
  3047. /*------------------------------------------------------------------------*/
  3048. /**
  3049. * Creates an list cache object.
  3050. *
  3051. * @private
  3052. * @constructor
  3053. * @param {Array} [entries] The key-value pairs to cache.
  3054. */
  3055. function ListCache(entries) {
  3056. var index = -1,
  3057. length = entries == null ? 0 : entries.length;
  3058. this.clear();
  3059. while (++index < length) {
  3060. var entry = entries[index];
  3061. this.set(entry[0], entry[1]);
  3062. }
  3063. }
  3064. /**
  3065. * Removes all key-value entries from the list cache.
  3066. *
  3067. * @private
  3068. * @name clear
  3069. * @memberOf ListCache
  3070. */
  3071. function listCacheClear() {
  3072. this.__data__ = [];
  3073. this.size = 0;
  3074. }
  3075. /**
  3076. * Removes `key` and its value from the list cache.
  3077. *
  3078. * @private
  3079. * @name delete
  3080. * @memberOf ListCache
  3081. * @param {string} key The key of the value to remove.
  3082. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3083. */
  3084. function listCacheDelete(key) {
  3085. var data = this.__data__,
  3086. index = assocIndexOf(data, key);
  3087. if (index < 0) {
  3088. return false;
  3089. }
  3090. var lastIndex = data.length - 1;
  3091. if (index == lastIndex) {
  3092. data.pop();
  3093. } else {
  3094. splice.call(data, index, 1);
  3095. }
  3096. --this.size;
  3097. return true;
  3098. }
  3099. /**
  3100. * Gets the list cache value for `key`.
  3101. *
  3102. * @private
  3103. * @name get
  3104. * @memberOf ListCache
  3105. * @param {string} key The key of the value to get.
  3106. * @returns {*} Returns the entry value.
  3107. */
  3108. function listCacheGet(key) {
  3109. var data = this.__data__,
  3110. index = assocIndexOf(data, key);
  3111. return index < 0 ? undefined : data[index][1];
  3112. }
  3113. /**
  3114. * Checks if a list cache value for `key` exists.
  3115. *
  3116. * @private
  3117. * @name has
  3118. * @memberOf ListCache
  3119. * @param {string} key The key of the entry to check.
  3120. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3121. */
  3122. function listCacheHas(key) {
  3123. return assocIndexOf(this.__data__, key) > -1;
  3124. }
  3125. /**
  3126. * Sets the list cache `key` to `value`.
  3127. *
  3128. * @private
  3129. * @name set
  3130. * @memberOf ListCache
  3131. * @param {string} key The key of the value to set.
  3132. * @param {*} value The value to set.
  3133. * @returns {Object} Returns the list cache instance.
  3134. */
  3135. function listCacheSet(key, value) {
  3136. var data = this.__data__,
  3137. index = assocIndexOf(data, key);
  3138. if (index < 0) {
  3139. ++this.size;
  3140. data.push([key, value]);
  3141. } else {
  3142. data[index][1] = value;
  3143. }
  3144. return this;
  3145. }
  3146. // Add methods to `ListCache`.
  3147. ListCache.prototype.clear = listCacheClear;
  3148. ListCache.prototype['delete'] = listCacheDelete;
  3149. ListCache.prototype.get = listCacheGet;
  3150. ListCache.prototype.has = listCacheHas;
  3151. ListCache.prototype.set = listCacheSet;
  3152. /*------------------------------------------------------------------------*/
  3153. /**
  3154. * Creates a map cache object to store key-value pairs.
  3155. *
  3156. * @private
  3157. * @constructor
  3158. * @param {Array} [entries] The key-value pairs to cache.
  3159. */
  3160. function MapCache(entries) {
  3161. var index = -1,
  3162. length = entries == null ? 0 : entries.length;
  3163. this.clear();
  3164. while (++index < length) {
  3165. var entry = entries[index];
  3166. this.set(entry[0], entry[1]);
  3167. }
  3168. }
  3169. /**
  3170. * Removes all key-value entries from the map.
  3171. *
  3172. * @private
  3173. * @name clear
  3174. * @memberOf MapCache
  3175. */
  3176. function mapCacheClear() {
  3177. this.size = 0;
  3178. this.__data__ = {
  3179. 'hash': new Hash,
  3180. 'map': new (Map || ListCache),
  3181. 'string': new Hash
  3182. };
  3183. }
  3184. /**
  3185. * Removes `key` and its value from the map.
  3186. *
  3187. * @private
  3188. * @name delete
  3189. * @memberOf MapCache
  3190. * @param {string} key The key of the value to remove.
  3191. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3192. */
  3193. function mapCacheDelete(key) {
  3194. var result = getMapData(this, key)['delete'](key);
  3195. this.size -= result ? 1 : 0;
  3196. return result;
  3197. }
  3198. /**
  3199. * Gets the map value for `key`.
  3200. *
  3201. * @private
  3202. * @name get
  3203. * @memberOf MapCache
  3204. * @param {string} key The key of the value to get.
  3205. * @returns {*} Returns the entry value.
  3206. */
  3207. function mapCacheGet(key) {
  3208. return getMapData(this, key).get(key);
  3209. }
  3210. /**
  3211. * Checks if a map value for `key` exists.
  3212. *
  3213. * @private
  3214. * @name has
  3215. * @memberOf MapCache
  3216. * @param {string} key The key of the entry to check.
  3217. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3218. */
  3219. function mapCacheHas(key) {
  3220. return getMapData(this, key).has(key);
  3221. }
  3222. /**
  3223. * Sets the map `key` to `value`.
  3224. *
  3225. * @private
  3226. * @name set
  3227. * @memberOf MapCache
  3228. * @param {string} key The key of the value to set.
  3229. * @param {*} value The value to set.
  3230. * @returns {Object} Returns the map cache instance.
  3231. */
  3232. function mapCacheSet(key, value) {
  3233. var data = getMapData(this, key),
  3234. size = data.size;
  3235. data.set(key, value);
  3236. this.size += data.size == size ? 0 : 1;
  3237. return this;
  3238. }
  3239. // Add methods to `MapCache`.
  3240. MapCache.prototype.clear = mapCacheClear;
  3241. MapCache.prototype['delete'] = mapCacheDelete;
  3242. MapCache.prototype.get = mapCacheGet;
  3243. MapCache.prototype.has = mapCacheHas;
  3244. MapCache.prototype.set = mapCacheSet;
  3245. /*------------------------------------------------------------------------*/
  3246. /**
  3247. *
  3248. * Creates an array cache object to store unique values.
  3249. *
  3250. * @private
  3251. * @constructor
  3252. * @param {Array} [values] The values to cache.
  3253. */
  3254. function SetCache(values) {
  3255. var index = -1,
  3256. length = values == null ? 0 : values.length;
  3257. this.__data__ = new MapCache;
  3258. while (++index < length) {
  3259. this.add(values[index]);
  3260. }
  3261. }
  3262. /**
  3263. * Adds `value` to the array cache.
  3264. *
  3265. * @private
  3266. * @name add
  3267. * @memberOf SetCache
  3268. * @alias push
  3269. * @param {*} value The value to cache.
  3270. * @returns {Object} Returns the cache instance.
  3271. */
  3272. function setCacheAdd(value) {
  3273. this.__data__.set(value, HASH_UNDEFINED);
  3274. return this;
  3275. }
  3276. /**
  3277. * Checks if `value` is in the array cache.
  3278. *
  3279. * @private
  3280. * @name has
  3281. * @memberOf SetCache
  3282. * @param {*} value The value to search for.
  3283. * @returns {number} Returns `true` if `value` is found, else `false`.
  3284. */
  3285. function setCacheHas(value) {
  3286. return this.__data__.has(value);
  3287. }
  3288. // Add methods to `SetCache`.
  3289. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3290. SetCache.prototype.has = setCacheHas;
  3291. /*------------------------------------------------------------------------*/
  3292. /**
  3293. * Creates a stack cache object to store key-value pairs.
  3294. *
  3295. * @private
  3296. * @constructor
  3297. * @param {Array} [entries] The key-value pairs to cache.
  3298. */
  3299. function Stack(entries) {
  3300. var data = this.__data__ = new ListCache(entries);
  3301. this.size = data.size;
  3302. }
  3303. /**
  3304. * Removes all key-value entries from the stack.
  3305. *
  3306. * @private
  3307. * @name clear
  3308. * @memberOf Stack
  3309. */
  3310. function stackClear() {
  3311. this.__data__ = new ListCache;
  3312. this.size = 0;
  3313. }
  3314. /**
  3315. * Removes `key` and its value from the stack.
  3316. *
  3317. * @private
  3318. * @name delete
  3319. * @memberOf Stack
  3320. * @param {string} key The key of the value to remove.
  3321. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3322. */
  3323. function stackDelete(key) {
  3324. var data = this.__data__,
  3325. result = data['delete'](key);
  3326. this.size = data.size;
  3327. return result;
  3328. }
  3329. /**
  3330. * Gets the stack value for `key`.
  3331. *
  3332. * @private
  3333. * @name get
  3334. * @memberOf Stack
  3335. * @param {string} key The key of the value to get.
  3336. * @returns {*} Returns the entry value.
  3337. */
  3338. function stackGet(key) {
  3339. return this.__data__.get(key);
  3340. }
  3341. /**
  3342. * Checks if a stack value for `key` exists.
  3343. *
  3344. * @private
  3345. * @name has
  3346. * @memberOf Stack
  3347. * @param {string} key The key of the entry to check.
  3348. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3349. */
  3350. function stackHas(key) {
  3351. return this.__data__.has(key);
  3352. }
  3353. /**
  3354. * Sets the stack `key` to `value`.
  3355. *
  3356. * @private
  3357. * @name set
  3358. * @memberOf Stack
  3359. * @param {string} key The key of the value to set.
  3360. * @param {*} value The value to set.
  3361. * @returns {Object} Returns the stack cache instance.
  3362. */
  3363. function stackSet(key, value) {
  3364. var data = this.__data__;
  3365. if (data instanceof ListCache) {
  3366. var pairs = data.__data__;
  3367. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3368. pairs.push([key, value]);
  3369. this.size = ++data.size;
  3370. return this;
  3371. }
  3372. data = this.__data__ = new MapCache(pairs);
  3373. }
  3374. data.set(key, value);
  3375. this.size = data.size;
  3376. return this;
  3377. }
  3378. // Add methods to `Stack`.
  3379. Stack.prototype.clear = stackClear;
  3380. Stack.prototype['delete'] = stackDelete;
  3381. Stack.prototype.get = stackGet;
  3382. Stack.prototype.has = stackHas;
  3383. Stack.prototype.set = stackSet;
  3384. /*------------------------------------------------------------------------*/
  3385. /**
  3386. * Creates an array of the enumerable property names of the array-like `value`.
  3387. *
  3388. * @private
  3389. * @param {*} value The value to query.
  3390. * @param {boolean} inherited Specify returning inherited property names.
  3391. * @returns {Array} Returns the array of property names.
  3392. */
  3393. function arrayLikeKeys(value, inherited) {
  3394. var isArr = isArray(value),
  3395. isArg = !isArr && isArguments(value),
  3396. isBuff = !isArr && !isArg && isBuffer(value),
  3397. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3398. skipIndexes = isArr || isArg || isBuff || isType,
  3399. result = skipIndexes ? baseTimes(value.length, String) : [],
  3400. length = result.length;
  3401. for (var key in value) {
  3402. if ((inherited || hasOwnProperty.call(value, key)) &&
  3403. !(skipIndexes && (
  3404. // Safari 9 has enumerable `arguments.length` in strict mode.
  3405. key == 'length' ||
  3406. // Node.js 0.10 has enumerable non-index properties on buffers.
  3407. (isBuff && (key == 'offset' || key == 'parent')) ||
  3408. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3409. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3410. // Skip index properties.
  3411. isIndex(key, length)
  3412. ))) {
  3413. result.push(key);
  3414. }
  3415. }
  3416. return result;
  3417. }
  3418. /**
  3419. * A specialized version of `_.sample` for arrays.
  3420. *
  3421. * @private
  3422. * @param {Array} array The array to sample.
  3423. * @returns {*} Returns the random element.
  3424. */
  3425. function arraySample(array) {
  3426. var length = array.length;
  3427. return length ? array[baseRandom(0, length - 1)] : undefined;
  3428. }
  3429. /**
  3430. * A specialized version of `_.sampleSize` for arrays.
  3431. *
  3432. * @private
  3433. * @param {Array} array The array to sample.
  3434. * @param {number} n The number of elements to sample.
  3435. * @returns {Array} Returns the random elements.
  3436. */
  3437. function arraySampleSize(array, n) {
  3438. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3439. }
  3440. /**
  3441. * A specialized version of `_.shuffle` for arrays.
  3442. *
  3443. * @private
  3444. * @param {Array} array The array to shuffle.
  3445. * @returns {Array} Returns the new shuffled array.
  3446. */
  3447. function arrayShuffle(array) {
  3448. return shuffleSelf(copyArray(array));
  3449. }
  3450. /**
  3451. * This function is like `assignValue` except that it doesn't assign
  3452. * `undefined` values.
  3453. *
  3454. * @private
  3455. * @param {Object} object The object to modify.
  3456. * @param {string} key The key of the property to assign.
  3457. * @param {*} value The value to assign.
  3458. */
  3459. function assignMergeValue(object, key, value) {
  3460. if ((value !== undefined && !eq(object[key], value)) ||
  3461. (value === undefined && !(key in object))) {
  3462. baseAssignValue(object, key, value);
  3463. }
  3464. }
  3465. /**
  3466. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3467. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3468. * for equality comparisons.
  3469. *
  3470. * @private
  3471. * @param {Object} object The object to modify.
  3472. * @param {string} key The key of the property to assign.
  3473. * @param {*} value The value to assign.
  3474. */
  3475. function assignValue(object, key, value) {
  3476. var objValue = object[key];
  3477. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3478. (value === undefined && !(key in object))) {
  3479. baseAssignValue(object, key, value);
  3480. }
  3481. }
  3482. /**
  3483. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3484. *
  3485. * @private
  3486. * @param {Array} array The array to inspect.
  3487. * @param {*} key The key to search for.
  3488. * @returns {number} Returns the index of the matched value, else `-1`.
  3489. */
  3490. function assocIndexOf(array, key) {
  3491. var length = array.length;
  3492. while (length--) {
  3493. if (eq(array[length][0], key)) {
  3494. return length;
  3495. }
  3496. }
  3497. return -1;
  3498. }
  3499. /**
  3500. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3501. * by `iteratee` and values set by `setter`.
  3502. *
  3503. * @private
  3504. * @param {Array|Object} collection The collection to iterate over.
  3505. * @param {Function} setter The function to set `accumulator` values.
  3506. * @param {Function} iteratee The iteratee to transform keys.
  3507. * @param {Object} accumulator The initial aggregated object.
  3508. * @returns {Function} Returns `accumulator`.
  3509. */
  3510. function baseAggregator(collection, setter, iteratee, accumulator) {
  3511. baseEach(collection, function(value, key, collection) {
  3512. setter(accumulator, value, iteratee(value), collection);
  3513. });
  3514. return accumulator;
  3515. }
  3516. /**
  3517. * The base implementation of `_.assign` without support for multiple sources
  3518. * or `customizer` functions.
  3519. *
  3520. * @private
  3521. * @param {Object} object The destination object.
  3522. * @param {Object} source The source object.
  3523. * @returns {Object} Returns `object`.
  3524. */
  3525. function baseAssign(object, source) {
  3526. return object && copyObject(source, keys(source), object);
  3527. }
  3528. /**
  3529. * The base implementation of `_.assignIn` without support for multiple sources
  3530. * or `customizer` functions.
  3531. *
  3532. * @private
  3533. * @param {Object} object The destination object.
  3534. * @param {Object} source The source object.
  3535. * @returns {Object} Returns `object`.
  3536. */
  3537. function baseAssignIn(object, source) {
  3538. return object && copyObject(source, keysIn(source), object);
  3539. }
  3540. /**
  3541. * The base implementation of `assignValue` and `assignMergeValue` without
  3542. * value checks.
  3543. *
  3544. * @private
  3545. * @param {Object} object The object to modify.
  3546. * @param {string} key The key of the property to assign.
  3547. * @param {*} value The value to assign.
  3548. */
  3549. function baseAssignValue(object, key, value) {
  3550. if (key == '__proto__' && defineProperty) {
  3551. defineProperty(object, key, {
  3552. 'configurable': true,
  3553. 'enumerable': true,
  3554. 'value': value,
  3555. 'writable': true
  3556. });
  3557. } else {
  3558. object[key] = value;
  3559. }
  3560. }
  3561. /**
  3562. * The base implementation of `_.at` without support for individual paths.
  3563. *
  3564. * @private
  3565. * @param {Object} object The object to iterate over.
  3566. * @param {string[]} paths The property paths to pick.
  3567. * @returns {Array} Returns the picked elements.
  3568. */
  3569. function baseAt(object, paths) {
  3570. var index = -1,
  3571. length = paths.length,
  3572. result = Array(length),
  3573. skip = object == null;
  3574. while (++index < length) {
  3575. result[index] = skip ? undefined : get(object, paths[index]);
  3576. }
  3577. return result;
  3578. }
  3579. /**
  3580. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3581. *
  3582. * @private
  3583. * @param {number} number The number to clamp.
  3584. * @param {number} [lower] The lower bound.
  3585. * @param {number} upper The upper bound.
  3586. * @returns {number} Returns the clamped number.
  3587. */
  3588. function baseClamp(number, lower, upper) {
  3589. if (number === number) {
  3590. if (upper !== undefined) {
  3591. number = number <= upper ? number : upper;
  3592. }
  3593. if (lower !== undefined) {
  3594. number = number >= lower ? number : lower;
  3595. }
  3596. }
  3597. return number;
  3598. }
  3599. /**
  3600. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3601. * traversed objects.
  3602. *
  3603. * @private
  3604. * @param {*} value The value to clone.
  3605. * @param {boolean} bitmask The bitmask flags.
  3606. * 1 - Deep clone
  3607. * 2 - Flatten inherited properties
  3608. * 4 - Clone symbols
  3609. * @param {Function} [customizer] The function to customize cloning.
  3610. * @param {string} [key] The key of `value`.
  3611. * @param {Object} [object] The parent object of `value`.
  3612. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3613. * @returns {*} Returns the cloned value.
  3614. */
  3615. function baseClone(value, bitmask, customizer, key, object, stack) {
  3616. var result,
  3617. isDeep = bitmask & CLONE_DEEP_FLAG,
  3618. isFlat = bitmask & CLONE_FLAT_FLAG,
  3619. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3620. if (customizer) {
  3621. result = object ? customizer(value, key, object, stack) : customizer(value);
  3622. }
  3623. if (result !== undefined) {
  3624. return result;
  3625. }
  3626. if (!isObject(value)) {
  3627. return value;
  3628. }
  3629. var isArr = isArray(value);
  3630. if (isArr) {
  3631. result = initCloneArray(value);
  3632. if (!isDeep) {
  3633. return copyArray(value, result);
  3634. }
  3635. } else {
  3636. var tag = getTag(value),
  3637. isFunc = tag == funcTag || tag == genTag;
  3638. if (isBuffer(value)) {
  3639. return cloneBuffer(value, isDeep);
  3640. }
  3641. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3642. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3643. if (!isDeep) {
  3644. return isFlat
  3645. ? copySymbolsIn(value, baseAssignIn(result, value))
  3646. : copySymbols(value, baseAssign(result, value));
  3647. }
  3648. } else {
  3649. if (!cloneableTags[tag]) {
  3650. return object ? value : {};
  3651. }
  3652. result = initCloneByTag(value, tag, isDeep);
  3653. }
  3654. }
  3655. // Check for circular references and return its corresponding clone.
  3656. stack || (stack = new Stack);
  3657. var stacked = stack.get(value);
  3658. if (stacked) {
  3659. return stacked;
  3660. }
  3661. stack.set(value, result);
  3662. if (isSet(value)) {
  3663. value.forEach(function(subValue) {
  3664. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3665. });
  3666. } else if (isMap(value)) {
  3667. value.forEach(function(subValue, key) {
  3668. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3669. });
  3670. }
  3671. var keysFunc = isFull
  3672. ? (isFlat ? getAllKeysIn : getAllKeys)
  3673. : (isFlat ? keysIn : keys);
  3674. var props = isArr ? undefined : keysFunc(value);
  3675. arrayEach(props || value, function(subValue, key) {
  3676. if (props) {
  3677. key = subValue;
  3678. subValue = value[key];
  3679. }
  3680. // Recursively populate clone (susceptible to call stack limits).
  3681. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3682. });
  3683. return result;
  3684. }
  3685. /**
  3686. * The base implementation of `_.conforms` which doesn't clone `source`.
  3687. *
  3688. * @private
  3689. * @param {Object} source The object of property predicates to conform to.
  3690. * @returns {Function} Returns the new spec function.
  3691. */
  3692. function baseConforms(source) {
  3693. var props = keys(source);
  3694. return function(object) {
  3695. return baseConformsTo(object, source, props);
  3696. };
  3697. }
  3698. /**
  3699. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3700. *
  3701. * @private
  3702. * @param {Object} object The object to inspect.
  3703. * @param {Object} source The object of property predicates to conform to.
  3704. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3705. */
  3706. function baseConformsTo(object, source, props) {
  3707. var length = props.length;
  3708. if (object == null) {
  3709. return !length;
  3710. }
  3711. object = Object(object);
  3712. while (length--) {
  3713. var key = props[length],
  3714. predicate = source[key],
  3715. value = object[key];
  3716. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3717. return false;
  3718. }
  3719. }
  3720. return true;
  3721. }
  3722. /**
  3723. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3724. * to provide to `func`.
  3725. *
  3726. * @private
  3727. * @param {Function} func The function to delay.
  3728. * @param {number} wait The number of milliseconds to delay invocation.
  3729. * @param {Array} args The arguments to provide to `func`.
  3730. * @returns {number|Object} Returns the timer id or timeout object.
  3731. */
  3732. function baseDelay(func, wait, args) {
  3733. if (typeof func != 'function') {
  3734. throw new TypeError(FUNC_ERROR_TEXT);
  3735. }
  3736. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3737. }
  3738. /**
  3739. * The base implementation of methods like `_.difference` without support
  3740. * for excluding multiple arrays or iteratee shorthands.
  3741. *
  3742. * @private
  3743. * @param {Array} array The array to inspect.
  3744. * @param {Array} values The values to exclude.
  3745. * @param {Function} [iteratee] The iteratee invoked per element.
  3746. * @param {Function} [comparator] The comparator invoked per element.
  3747. * @returns {Array} Returns the new array of filtered values.
  3748. */
  3749. function baseDifference(array, values, iteratee, comparator) {
  3750. var index = -1,
  3751. includes = arrayIncludes,
  3752. isCommon = true,
  3753. length = array.length,
  3754. result = [],
  3755. valuesLength = values.length;
  3756. if (!length) {
  3757. return result;
  3758. }
  3759. if (iteratee) {
  3760. values = arrayMap(values, baseUnary(iteratee));
  3761. }
  3762. if (comparator) {
  3763. includes = arrayIncludesWith;
  3764. isCommon = false;
  3765. }
  3766. else if (values.length >= LARGE_ARRAY_SIZE) {
  3767. includes = cacheHas;
  3768. isCommon = false;
  3769. values = new SetCache(values);
  3770. }
  3771. outer:
  3772. while (++index < length) {
  3773. var value = array[index],
  3774. computed = iteratee == null ? value : iteratee(value);
  3775. value = (comparator || value !== 0) ? value : 0;
  3776. if (isCommon && computed === computed) {
  3777. var valuesIndex = valuesLength;
  3778. while (valuesIndex--) {
  3779. if (values[valuesIndex] === computed) {
  3780. continue outer;
  3781. }
  3782. }
  3783. result.push(value);
  3784. }
  3785. else if (!includes(values, computed, comparator)) {
  3786. result.push(value);
  3787. }
  3788. }
  3789. return result;
  3790. }
  3791. /**
  3792. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3793. *
  3794. * @private
  3795. * @param {Array|Object} collection The collection to iterate over.
  3796. * @param {Function} iteratee The function invoked per iteration.
  3797. * @returns {Array|Object} Returns `collection`.
  3798. */
  3799. var baseEach = createBaseEach(baseForOwn);
  3800. /**
  3801. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3802. *
  3803. * @private
  3804. * @param {Array|Object} collection The collection to iterate over.
  3805. * @param {Function} iteratee The function invoked per iteration.
  3806. * @returns {Array|Object} Returns `collection`.
  3807. */
  3808. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3809. /**
  3810. * The base implementation of `_.every` without support for iteratee shorthands.
  3811. *
  3812. * @private
  3813. * @param {Array|Object} collection The collection to iterate over.
  3814. * @param {Function} predicate The function invoked per iteration.
  3815. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3816. * else `false`
  3817. */
  3818. function baseEvery(collection, predicate) {
  3819. var result = true;
  3820. baseEach(collection, function(value, index, collection) {
  3821. result = !!predicate(value, index, collection);
  3822. return result;
  3823. });
  3824. return result;
  3825. }
  3826. /**
  3827. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3828. * `comparator` to determine the extremum value.
  3829. *
  3830. * @private
  3831. * @param {Array} array The array to iterate over.
  3832. * @param {Function} iteratee The iteratee invoked per iteration.
  3833. * @param {Function} comparator The comparator used to compare values.
  3834. * @returns {*} Returns the extremum value.
  3835. */
  3836. function baseExtremum(array, iteratee, comparator) {
  3837. var index = -1,
  3838. length = array.length;
  3839. while (++index < length) {
  3840. var value = array[index],
  3841. current = iteratee(value);
  3842. if (current != null && (computed === undefined
  3843. ? (current === current && !isSymbol(current))
  3844. : comparator(current, computed)
  3845. )) {
  3846. var computed = current,
  3847. result = value;
  3848. }
  3849. }
  3850. return result;
  3851. }
  3852. /**
  3853. * The base implementation of `_.fill` without an iteratee call guard.
  3854. *
  3855. * @private
  3856. * @param {Array} array The array to fill.
  3857. * @param {*} value The value to fill `array` with.
  3858. * @param {number} [start=0] The start position.
  3859. * @param {number} [end=array.length] The end position.
  3860. * @returns {Array} Returns `array`.
  3861. */
  3862. function baseFill(array, value, start, end) {
  3863. var length = array.length;
  3864. start = toInteger(start);
  3865. if (start < 0) {
  3866. start = -start > length ? 0 : (length + start);
  3867. }
  3868. end = (end === undefined || end > length) ? length : toInteger(end);
  3869. if (end < 0) {
  3870. end += length;
  3871. }
  3872. end = start > end ? 0 : toLength(end);
  3873. while (start < end) {
  3874. array[start++] = value;
  3875. }
  3876. return array;
  3877. }
  3878. /**
  3879. * The base implementation of `_.filter` without support for iteratee shorthands.
  3880. *
  3881. * @private
  3882. * @param {Array|Object} collection The collection to iterate over.
  3883. * @param {Function} predicate The function invoked per iteration.
  3884. * @returns {Array} Returns the new filtered array.
  3885. */
  3886. function baseFilter(collection, predicate) {
  3887. var result = [];
  3888. baseEach(collection, function(value, index, collection) {
  3889. if (predicate(value, index, collection)) {
  3890. result.push(value);
  3891. }
  3892. });
  3893. return result;
  3894. }
  3895. /**
  3896. * The base implementation of `_.flatten` with support for restricting flattening.
  3897. *
  3898. * @private
  3899. * @param {Array} array The array to flatten.
  3900. * @param {number} depth The maximum recursion depth.
  3901. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3902. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3903. * @param {Array} [result=[]] The initial result value.
  3904. * @returns {Array} Returns the new flattened array.
  3905. */
  3906. function baseFlatten(array, depth, predicate, isStrict, result) {
  3907. var index = -1,
  3908. length = array.length;
  3909. predicate || (predicate = isFlattenable);
  3910. result || (result = []);
  3911. while (++index < length) {
  3912. var value = array[index];
  3913. if (depth > 0 && predicate(value)) {
  3914. if (depth > 1) {
  3915. // Recursively flatten arrays (susceptible to call stack limits).
  3916. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3917. } else {
  3918. arrayPush(result, value);
  3919. }
  3920. } else if (!isStrict) {
  3921. result[result.length] = value;
  3922. }
  3923. }
  3924. return result;
  3925. }
  3926. /**
  3927. * The base implementation of `baseForOwn` which iterates over `object`
  3928. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3929. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3930. *
  3931. * @private
  3932. * @param {Object} object The object to iterate over.
  3933. * @param {Function} iteratee The function invoked per iteration.
  3934. * @param {Function} keysFunc The function to get the keys of `object`.
  3935. * @returns {Object} Returns `object`.
  3936. */
  3937. var baseFor = createBaseFor();
  3938. /**
  3939. * This function is like `baseFor` except that it iterates over properties
  3940. * in the opposite order.
  3941. *
  3942. * @private
  3943. * @param {Object} object The object to iterate over.
  3944. * @param {Function} iteratee The function invoked per iteration.
  3945. * @param {Function} keysFunc The function to get the keys of `object`.
  3946. * @returns {Object} Returns `object`.
  3947. */
  3948. var baseForRight = createBaseFor(true);
  3949. /**
  3950. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3951. *
  3952. * @private
  3953. * @param {Object} object The object to iterate over.
  3954. * @param {Function} iteratee The function invoked per iteration.
  3955. * @returns {Object} Returns `object`.
  3956. */
  3957. function baseForOwn(object, iteratee) {
  3958. return object && baseFor(object, iteratee, keys);
  3959. }
  3960. /**
  3961. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3962. *
  3963. * @private
  3964. * @param {Object} object The object to iterate over.
  3965. * @param {Function} iteratee The function invoked per iteration.
  3966. * @returns {Object} Returns `object`.
  3967. */
  3968. function baseForOwnRight(object, iteratee) {
  3969. return object && baseForRight(object, iteratee, keys);
  3970. }
  3971. /**
  3972. * The base implementation of `_.functions` which creates an array of
  3973. * `object` function property names filtered from `props`.
  3974. *
  3975. * @private
  3976. * @param {Object} object The object to inspect.
  3977. * @param {Array} props The property names to filter.
  3978. * @returns {Array} Returns the function names.
  3979. */
  3980. function baseFunctions(object, props) {
  3981. return arrayFilter(props, function(key) {
  3982. return isFunction(object[key]);
  3983. });
  3984. }
  3985. /**
  3986. * The base implementation of `_.get` without support for default values.
  3987. *
  3988. * @private
  3989. * @param {Object} object The object to query.
  3990. * @param {Array|string} path The path of the property to get.
  3991. * @returns {*} Returns the resolved value.
  3992. */
  3993. function baseGet(object, path) {
  3994. path = castPath(path, object);
  3995. var index = 0,
  3996. length = path.length;
  3997. while (object != null && index < length) {
  3998. object = object[toKey(path[index++])];
  3999. }
  4000. return (index && index == length) ? object : undefined;
  4001. }
  4002. /**
  4003. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4004. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4005. * symbols of `object`.
  4006. *
  4007. * @private
  4008. * @param {Object} object The object to query.
  4009. * @param {Function} keysFunc The function to get the keys of `object`.
  4010. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4011. * @returns {Array} Returns the array of property names and symbols.
  4012. */
  4013. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4014. var result = keysFunc(object);
  4015. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4016. }
  4017. /**
  4018. * The base implementation of `getTag` without fallbacks for buggy environments.
  4019. *
  4020. * @private
  4021. * @param {*} value The value to query.
  4022. * @returns {string} Returns the `toStringTag`.
  4023. */
  4024. function baseGetTag(value) {
  4025. if (value == null) {
  4026. return value === undefined ? undefinedTag : nullTag;
  4027. }
  4028. return (symToStringTag && symToStringTag in Object(value))
  4029. ? getRawTag(value)
  4030. : objectToString(value);
  4031. }
  4032. /**
  4033. * The base implementation of `_.gt` which doesn't coerce arguments.
  4034. *
  4035. * @private
  4036. * @param {*} value The value to compare.
  4037. * @param {*} other The other value to compare.
  4038. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4039. * else `false`.
  4040. */
  4041. function baseGt(value, other) {
  4042. return value > other;
  4043. }
  4044. /**
  4045. * The base implementation of `_.has` without support for deep paths.
  4046. *
  4047. * @private
  4048. * @param {Object} [object] The object to query.
  4049. * @param {Array|string} key The key to check.
  4050. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4051. */
  4052. function baseHas(object, key) {
  4053. return object != null && hasOwnProperty.call(object, key);
  4054. }
  4055. /**
  4056. * The base implementation of `_.hasIn` without support for deep paths.
  4057. *
  4058. * @private
  4059. * @param {Object} [object] The object to query.
  4060. * @param {Array|string} key The key to check.
  4061. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4062. */
  4063. function baseHasIn(object, key) {
  4064. return object != null && key in Object(object);
  4065. }
  4066. /**
  4067. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4068. *
  4069. * @private
  4070. * @param {number} number The number to check.
  4071. * @param {number} start The start of the range.
  4072. * @param {number} end The end of the range.
  4073. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4074. */
  4075. function baseInRange(number, start, end) {
  4076. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4077. }
  4078. /**
  4079. * The base implementation of methods like `_.intersection`, without support
  4080. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4081. *
  4082. * @private
  4083. * @param {Array} arrays The arrays to inspect.
  4084. * @param {Function} [iteratee] The iteratee invoked per element.
  4085. * @param {Function} [comparator] The comparator invoked per element.
  4086. * @returns {Array} Returns the new array of shared values.
  4087. */
  4088. function baseIntersection(arrays, iteratee, comparator) {
  4089. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4090. length = arrays[0].length,
  4091. othLength = arrays.length,
  4092. othIndex = othLength,
  4093. caches = Array(othLength),
  4094. maxLength = Infinity,
  4095. result = [];
  4096. while (othIndex--) {
  4097. var array = arrays[othIndex];
  4098. if (othIndex && iteratee) {
  4099. array = arrayMap(array, baseUnary(iteratee));
  4100. }
  4101. maxLength = nativeMin(array.length, maxLength);
  4102. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4103. ? new SetCache(othIndex && array)
  4104. : undefined;
  4105. }
  4106. array = arrays[0];
  4107. var index = -1,
  4108. seen = caches[0];
  4109. outer:
  4110. while (++index < length && result.length < maxLength) {
  4111. var value = array[index],
  4112. computed = iteratee ? iteratee(value) : value;
  4113. value = (comparator || value !== 0) ? value : 0;
  4114. if (!(seen
  4115. ? cacheHas(seen, computed)
  4116. : includes(result, computed, comparator)
  4117. )) {
  4118. othIndex = othLength;
  4119. while (--othIndex) {
  4120. var cache = caches[othIndex];
  4121. if (!(cache
  4122. ? cacheHas(cache, computed)
  4123. : includes(arrays[othIndex], computed, comparator))
  4124. ) {
  4125. continue outer;
  4126. }
  4127. }
  4128. if (seen) {
  4129. seen.push(computed);
  4130. }
  4131. result.push(value);
  4132. }
  4133. }
  4134. return result;
  4135. }
  4136. /**
  4137. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4138. * `object` with values transformed by `iteratee` and set by `setter`.
  4139. *
  4140. * @private
  4141. * @param {Object} object The object to iterate over.
  4142. * @param {Function} setter The function to set `accumulator` values.
  4143. * @param {Function} iteratee The iteratee to transform values.
  4144. * @param {Object} accumulator The initial inverted object.
  4145. * @returns {Function} Returns `accumulator`.
  4146. */
  4147. function baseInverter(object, setter, iteratee, accumulator) {
  4148. baseForOwn(object, function(value, key, object) {
  4149. setter(accumulator, iteratee(value), key, object);
  4150. });
  4151. return accumulator;
  4152. }
  4153. /**
  4154. * The base implementation of `_.invoke` without support for individual
  4155. * method arguments.
  4156. *
  4157. * @private
  4158. * @param {Object} object The object to query.
  4159. * @param {Array|string} path The path of the method to invoke.
  4160. * @param {Array} args The arguments to invoke the method with.
  4161. * @returns {*} Returns the result of the invoked method.
  4162. */
  4163. function baseInvoke(object, path, args) {
  4164. path = castPath(path, object);
  4165. object = parent(object, path);
  4166. var func = object == null ? object : object[toKey(last(path))];
  4167. return func == null ? undefined : apply(func, object, args);
  4168. }
  4169. /**
  4170. * The base implementation of `_.isArguments`.
  4171. *
  4172. * @private
  4173. * @param {*} value The value to check.
  4174. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4175. */
  4176. function baseIsArguments(value) {
  4177. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4178. }
  4179. /**
  4180. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4181. *
  4182. * @private
  4183. * @param {*} value The value to check.
  4184. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4185. */
  4186. function baseIsArrayBuffer(value) {
  4187. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4188. }
  4189. /**
  4190. * The base implementation of `_.isDate` without Node.js optimizations.
  4191. *
  4192. * @private
  4193. * @param {*} value The value to check.
  4194. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4195. */
  4196. function baseIsDate(value) {
  4197. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4198. }
  4199. /**
  4200. * The base implementation of `_.isEqual` which supports partial comparisons
  4201. * and tracks traversed objects.
  4202. *
  4203. * @private
  4204. * @param {*} value The value to compare.
  4205. * @param {*} other The other value to compare.
  4206. * @param {boolean} bitmask The bitmask flags.
  4207. * 1 - Unordered comparison
  4208. * 2 - Partial comparison
  4209. * @param {Function} [customizer] The function to customize comparisons.
  4210. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4211. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4212. */
  4213. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4214. if (value === other) {
  4215. return true;
  4216. }
  4217. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4218. return value !== value && other !== other;
  4219. }
  4220. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4221. }
  4222. /**
  4223. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4224. * deep comparisons and tracks traversed objects enabling objects with circular
  4225. * references to be compared.
  4226. *
  4227. * @private
  4228. * @param {Object} object The object to compare.
  4229. * @param {Object} other The other object to compare.
  4230. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4231. * @param {Function} customizer The function to customize comparisons.
  4232. * @param {Function} equalFunc The function to determine equivalents of values.
  4233. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4234. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4235. */
  4236. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4237. var objIsArr = isArray(object),
  4238. othIsArr = isArray(other),
  4239. objTag = objIsArr ? arrayTag : getTag(object),
  4240. othTag = othIsArr ? arrayTag : getTag(other);
  4241. objTag = objTag == argsTag ? objectTag : objTag;
  4242. othTag = othTag == argsTag ? objectTag : othTag;
  4243. var objIsObj = objTag == objectTag,
  4244. othIsObj = othTag == objectTag,
  4245. isSameTag = objTag == othTag;
  4246. if (isSameTag && isBuffer(object)) {
  4247. if (!isBuffer(other)) {
  4248. return false;
  4249. }
  4250. objIsArr = true;
  4251. objIsObj = false;
  4252. }
  4253. if (isSameTag && !objIsObj) {
  4254. stack || (stack = new Stack);
  4255. return (objIsArr || isTypedArray(object))
  4256. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4257. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4258. }
  4259. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4260. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4261. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4262. if (objIsWrapped || othIsWrapped) {
  4263. var objUnwrapped = objIsWrapped ? object.value() : object,
  4264. othUnwrapped = othIsWrapped ? other.value() : other;
  4265. stack || (stack = new Stack);
  4266. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4267. }
  4268. }
  4269. if (!isSameTag) {
  4270. return false;
  4271. }
  4272. stack || (stack = new Stack);
  4273. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4274. }
  4275. /**
  4276. * The base implementation of `_.isMap` without Node.js optimizations.
  4277. *
  4278. * @private
  4279. * @param {*} value The value to check.
  4280. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4281. */
  4282. function baseIsMap(value) {
  4283. return isObjectLike(value) && getTag(value) == mapTag;
  4284. }
  4285. /**
  4286. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4287. *
  4288. * @private
  4289. * @param {Object} object The object to inspect.
  4290. * @param {Object} source The object of property values to match.
  4291. * @param {Array} matchData The property names, values, and compare flags to match.
  4292. * @param {Function} [customizer] The function to customize comparisons.
  4293. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4294. */
  4295. function baseIsMatch(object, source, matchData, customizer) {
  4296. var index = matchData.length,
  4297. length = index,
  4298. noCustomizer = !customizer;
  4299. if (object == null) {
  4300. return !length;
  4301. }
  4302. object = Object(object);
  4303. while (index--) {
  4304. var data = matchData[index];
  4305. if ((noCustomizer && data[2])
  4306. ? data[1] !== object[data[0]]
  4307. : !(data[0] in object)
  4308. ) {
  4309. return false;
  4310. }
  4311. }
  4312. while (++index < length) {
  4313. data = matchData[index];
  4314. var key = data[0],
  4315. objValue = object[key],
  4316. srcValue = data[1];
  4317. if (noCustomizer && data[2]) {
  4318. if (objValue === undefined && !(key in object)) {
  4319. return false;
  4320. }
  4321. } else {
  4322. var stack = new Stack;
  4323. if (customizer) {
  4324. var result = customizer(objValue, srcValue, key, object, source, stack);
  4325. }
  4326. if (!(result === undefined
  4327. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4328. : result
  4329. )) {
  4330. return false;
  4331. }
  4332. }
  4333. }
  4334. return true;
  4335. }
  4336. /**
  4337. * The base implementation of `_.isNative` without bad shim checks.
  4338. *
  4339. * @private
  4340. * @param {*} value The value to check.
  4341. * @returns {boolean} Returns `true` if `value` is a native function,
  4342. * else `false`.
  4343. */
  4344. function baseIsNative(value) {
  4345. if (!isObject(value) || isMasked(value)) {
  4346. return false;
  4347. }
  4348. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4349. return pattern.test(toSource(value));
  4350. }
  4351. /**
  4352. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4353. *
  4354. * @private
  4355. * @param {*} value The value to check.
  4356. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4357. */
  4358. function baseIsRegExp(value) {
  4359. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4360. }
  4361. /**
  4362. * The base implementation of `_.isSet` without Node.js optimizations.
  4363. *
  4364. * @private
  4365. * @param {*} value The value to check.
  4366. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4367. */
  4368. function baseIsSet(value) {
  4369. return isObjectLike(value) && getTag(value) == setTag;
  4370. }
  4371. /**
  4372. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4373. *
  4374. * @private
  4375. * @param {*} value The value to check.
  4376. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4377. */
  4378. function baseIsTypedArray(value) {
  4379. return isObjectLike(value) &&
  4380. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4381. }
  4382. /**
  4383. * The base implementation of `_.iteratee`.
  4384. *
  4385. * @private
  4386. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4387. * @returns {Function} Returns the iteratee.
  4388. */
  4389. function baseIteratee(value) {
  4390. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4391. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4392. if (typeof value == 'function') {
  4393. return value;
  4394. }
  4395. if (value == null) {
  4396. return identity;
  4397. }
  4398. if (typeof value == 'object') {
  4399. return isArray(value)
  4400. ? baseMatchesProperty(value[0], value[1])
  4401. : baseMatches(value);
  4402. }
  4403. return property(value);
  4404. }
  4405. /**
  4406. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4407. *
  4408. * @private
  4409. * @param {Object} object The object to query.
  4410. * @returns {Array} Returns the array of property names.
  4411. */
  4412. function baseKeys(object) {
  4413. if (!isPrototype(object)) {
  4414. return nativeKeys(object);
  4415. }
  4416. var result = [];
  4417. for (var key in Object(object)) {
  4418. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4419. result.push(key);
  4420. }
  4421. }
  4422. return result;
  4423. }
  4424. /**
  4425. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4426. *
  4427. * @private
  4428. * @param {Object} object The object to query.
  4429. * @returns {Array} Returns the array of property names.
  4430. */
  4431. function baseKeysIn(object) {
  4432. if (!isObject(object)) {
  4433. return nativeKeysIn(object);
  4434. }
  4435. var isProto = isPrototype(object),
  4436. result = [];
  4437. for (var key in object) {
  4438. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4439. result.push(key);
  4440. }
  4441. }
  4442. return result;
  4443. }
  4444. /**
  4445. * The base implementation of `_.lt` which doesn't coerce arguments.
  4446. *
  4447. * @private
  4448. * @param {*} value The value to compare.
  4449. * @param {*} other The other value to compare.
  4450. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4451. * else `false`.
  4452. */
  4453. function baseLt(value, other) {
  4454. return value < other;
  4455. }
  4456. /**
  4457. * The base implementation of `_.map` without support for iteratee shorthands.
  4458. *
  4459. * @private
  4460. * @param {Array|Object} collection The collection to iterate over.
  4461. * @param {Function} iteratee The function invoked per iteration.
  4462. * @returns {Array} Returns the new mapped array.
  4463. */
  4464. function baseMap(collection, iteratee) {
  4465. var index = -1,
  4466. result = isArrayLike(collection) ? Array(collection.length) : [];
  4467. baseEach(collection, function(value, key, collection) {
  4468. result[++index] = iteratee(value, key, collection);
  4469. });
  4470. return result;
  4471. }
  4472. /**
  4473. * The base implementation of `_.matches` which doesn't clone `source`.
  4474. *
  4475. * @private
  4476. * @param {Object} source The object of property values to match.
  4477. * @returns {Function} Returns the new spec function.
  4478. */
  4479. function baseMatches(source) {
  4480. var matchData = getMatchData(source);
  4481. if (matchData.length == 1 && matchData[0][2]) {
  4482. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4483. }
  4484. return function(object) {
  4485. return object === source || baseIsMatch(object, source, matchData);
  4486. };
  4487. }
  4488. /**
  4489. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4490. *
  4491. * @private
  4492. * @param {string} path The path of the property to get.
  4493. * @param {*} srcValue The value to match.
  4494. * @returns {Function} Returns the new spec function.
  4495. */
  4496. function baseMatchesProperty(path, srcValue) {
  4497. if (isKey(path) && isStrictComparable(srcValue)) {
  4498. return matchesStrictComparable(toKey(path), srcValue);
  4499. }
  4500. return function(object) {
  4501. var objValue = get(object, path);
  4502. return (objValue === undefined && objValue === srcValue)
  4503. ? hasIn(object, path)
  4504. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4505. };
  4506. }
  4507. /**
  4508. * The base implementation of `_.merge` without support for multiple sources.
  4509. *
  4510. * @private
  4511. * @param {Object} object The destination object.
  4512. * @param {Object} source The source object.
  4513. * @param {number} srcIndex The index of `source`.
  4514. * @param {Function} [customizer] The function to customize merged values.
  4515. * @param {Object} [stack] Tracks traversed source values and their merged
  4516. * counterparts.
  4517. */
  4518. function baseMerge(object, source, srcIndex, customizer, stack) {
  4519. if (object === source) {
  4520. return;
  4521. }
  4522. baseFor(source, function(srcValue, key) {
  4523. stack || (stack = new Stack);
  4524. if (isObject(srcValue)) {
  4525. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4526. }
  4527. else {
  4528. var newValue = customizer
  4529. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4530. : undefined;
  4531. if (newValue === undefined) {
  4532. newValue = srcValue;
  4533. }
  4534. assignMergeValue(object, key, newValue);
  4535. }
  4536. }, keysIn);
  4537. }
  4538. /**
  4539. * A specialized version of `baseMerge` for arrays and objects which performs
  4540. * deep merges and tracks traversed objects enabling objects with circular
  4541. * references to be merged.
  4542. *
  4543. * @private
  4544. * @param {Object} object The destination object.
  4545. * @param {Object} source The source object.
  4546. * @param {string} key The key of the value to merge.
  4547. * @param {number} srcIndex The index of `source`.
  4548. * @param {Function} mergeFunc The function to merge values.
  4549. * @param {Function} [customizer] The function to customize assigned values.
  4550. * @param {Object} [stack] Tracks traversed source values and their merged
  4551. * counterparts.
  4552. */
  4553. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4554. var objValue = safeGet(object, key),
  4555. srcValue = safeGet(source, key),
  4556. stacked = stack.get(srcValue);
  4557. if (stacked) {
  4558. assignMergeValue(object, key, stacked);
  4559. return;
  4560. }
  4561. var newValue = customizer
  4562. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4563. : undefined;
  4564. var isCommon = newValue === undefined;
  4565. if (isCommon) {
  4566. var isArr = isArray(srcValue),
  4567. isBuff = !isArr && isBuffer(srcValue),
  4568. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4569. newValue = srcValue;
  4570. if (isArr || isBuff || isTyped) {
  4571. if (isArray(objValue)) {
  4572. newValue = objValue;
  4573. }
  4574. else if (isArrayLikeObject(objValue)) {
  4575. newValue = copyArray(objValue);
  4576. }
  4577. else if (isBuff) {
  4578. isCommon = false;
  4579. newValue = cloneBuffer(srcValue, true);
  4580. }
  4581. else if (isTyped) {
  4582. isCommon = false;
  4583. newValue = cloneTypedArray(srcValue, true);
  4584. }
  4585. else {
  4586. newValue = [];
  4587. }
  4588. }
  4589. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4590. newValue = objValue;
  4591. if (isArguments(objValue)) {
  4592. newValue = toPlainObject(objValue);
  4593. }
  4594. else if (!isObject(objValue) || isFunction(objValue)) {
  4595. newValue = initCloneObject(srcValue);
  4596. }
  4597. }
  4598. else {
  4599. isCommon = false;
  4600. }
  4601. }
  4602. if (isCommon) {
  4603. // Recursively merge objects and arrays (susceptible to call stack limits).
  4604. stack.set(srcValue, newValue);
  4605. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4606. stack['delete'](srcValue);
  4607. }
  4608. assignMergeValue(object, key, newValue);
  4609. }
  4610. /**
  4611. * The base implementation of `_.nth` which doesn't coerce arguments.
  4612. *
  4613. * @private
  4614. * @param {Array} array The array to query.
  4615. * @param {number} n The index of the element to return.
  4616. * @returns {*} Returns the nth element of `array`.
  4617. */
  4618. function baseNth(array, n) {
  4619. var length = array.length;
  4620. if (!length) {
  4621. return;
  4622. }
  4623. n += n < 0 ? length : 0;
  4624. return isIndex(n, length) ? array[n] : undefined;
  4625. }
  4626. /**
  4627. * The base implementation of `_.orderBy` without param guards.
  4628. *
  4629. * @private
  4630. * @param {Array|Object} collection The collection to iterate over.
  4631. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4632. * @param {string[]} orders The sort orders of `iteratees`.
  4633. * @returns {Array} Returns the new sorted array.
  4634. */
  4635. function baseOrderBy(collection, iteratees, orders) {
  4636. if (iteratees.length) {
  4637. iteratees = arrayMap(iteratees, function(iteratee) {
  4638. if (isArray(iteratee)) {
  4639. return function(value) {
  4640. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4641. }
  4642. }
  4643. return iteratee;
  4644. });
  4645. } else {
  4646. iteratees = [identity];
  4647. }
  4648. var index = -1;
  4649. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4650. var result = baseMap(collection, function(value, key, collection) {
  4651. var criteria = arrayMap(iteratees, function(iteratee) {
  4652. return iteratee(value);
  4653. });
  4654. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4655. });
  4656. return baseSortBy(result, function(object, other) {
  4657. return compareMultiple(object, other, orders);
  4658. });
  4659. }
  4660. /**
  4661. * The base implementation of `_.pick` without support for individual
  4662. * property identifiers.
  4663. *
  4664. * @private
  4665. * @param {Object} object The source object.
  4666. * @param {string[]} paths The property paths to pick.
  4667. * @returns {Object} Returns the new object.
  4668. */
  4669. function basePick(object, paths) {
  4670. return basePickBy(object, paths, function(value, path) {
  4671. return hasIn(object, path);
  4672. });
  4673. }
  4674. /**
  4675. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4676. *
  4677. * @private
  4678. * @param {Object} object The source object.
  4679. * @param {string[]} paths The property paths to pick.
  4680. * @param {Function} predicate The function invoked per property.
  4681. * @returns {Object} Returns the new object.
  4682. */
  4683. function basePickBy(object, paths, predicate) {
  4684. var index = -1,
  4685. length = paths.length,
  4686. result = {};
  4687. while (++index < length) {
  4688. var path = paths[index],
  4689. value = baseGet(object, path);
  4690. if (predicate(value, path)) {
  4691. baseSet(result, castPath(path, object), value);
  4692. }
  4693. }
  4694. return result;
  4695. }
  4696. /**
  4697. * A specialized version of `baseProperty` which supports deep paths.
  4698. *
  4699. * @private
  4700. * @param {Array|string} path The path of the property to get.
  4701. * @returns {Function} Returns the new accessor function.
  4702. */
  4703. function basePropertyDeep(path) {
  4704. return function(object) {
  4705. return baseGet(object, path);
  4706. };
  4707. }
  4708. /**
  4709. * The base implementation of `_.pullAllBy` without support for iteratee
  4710. * shorthands.
  4711. *
  4712. * @private
  4713. * @param {Array} array The array to modify.
  4714. * @param {Array} values The values to remove.
  4715. * @param {Function} [iteratee] The iteratee invoked per element.
  4716. * @param {Function} [comparator] The comparator invoked per element.
  4717. * @returns {Array} Returns `array`.
  4718. */
  4719. function basePullAll(array, values, iteratee, comparator) {
  4720. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4721. index = -1,
  4722. length = values.length,
  4723. seen = array;
  4724. if (array === values) {
  4725. values = copyArray(values);
  4726. }
  4727. if (iteratee) {
  4728. seen = arrayMap(array, baseUnary(iteratee));
  4729. }
  4730. while (++index < length) {
  4731. var fromIndex = 0,
  4732. value = values[index],
  4733. computed = iteratee ? iteratee(value) : value;
  4734. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4735. if (seen !== array) {
  4736. splice.call(seen, fromIndex, 1);
  4737. }
  4738. splice.call(array, fromIndex, 1);
  4739. }
  4740. }
  4741. return array;
  4742. }
  4743. /**
  4744. * The base implementation of `_.pullAt` without support for individual
  4745. * indexes or capturing the removed elements.
  4746. *
  4747. * @private
  4748. * @param {Array} array The array to modify.
  4749. * @param {number[]} indexes The indexes of elements to remove.
  4750. * @returns {Array} Returns `array`.
  4751. */
  4752. function basePullAt(array, indexes) {
  4753. var length = array ? indexes.length : 0,
  4754. lastIndex = length - 1;
  4755. while (length--) {
  4756. var index = indexes[length];
  4757. if (length == lastIndex || index !== previous) {
  4758. var previous = index;
  4759. if (isIndex(index)) {
  4760. splice.call(array, index, 1);
  4761. } else {
  4762. baseUnset(array, index);
  4763. }
  4764. }
  4765. }
  4766. return array;
  4767. }
  4768. /**
  4769. * The base implementation of `_.random` without support for returning
  4770. * floating-point numbers.
  4771. *
  4772. * @private
  4773. * @param {number} lower The lower bound.
  4774. * @param {number} upper The upper bound.
  4775. * @returns {number} Returns the random number.
  4776. */
  4777. function baseRandom(lower, upper) {
  4778. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4779. }
  4780. /**
  4781. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4782. * coerce arguments.
  4783. *
  4784. * @private
  4785. * @param {number} start The start of the range.
  4786. * @param {number} end The end of the range.
  4787. * @param {number} step The value to increment or decrement by.
  4788. * @param {boolean} [fromRight] Specify iterating from right to left.
  4789. * @returns {Array} Returns the range of numbers.
  4790. */
  4791. function baseRange(start, end, step, fromRight) {
  4792. var index = -1,
  4793. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4794. result = Array(length);
  4795. while (length--) {
  4796. result[fromRight ? length : ++index] = start;
  4797. start += step;
  4798. }
  4799. return result;
  4800. }
  4801. /**
  4802. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4803. *
  4804. * @private
  4805. * @param {string} string The string to repeat.
  4806. * @param {number} n The number of times to repeat the string.
  4807. * @returns {string} Returns the repeated string.
  4808. */
  4809. function baseRepeat(string, n) {
  4810. var result = '';
  4811. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4812. return result;
  4813. }
  4814. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4815. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4816. do {
  4817. if (n % 2) {
  4818. result += string;
  4819. }
  4820. n = nativeFloor(n / 2);
  4821. if (n) {
  4822. string += string;
  4823. }
  4824. } while (n);
  4825. return result;
  4826. }
  4827. /**
  4828. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4829. *
  4830. * @private
  4831. * @param {Function} func The function to apply a rest parameter to.
  4832. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4833. * @returns {Function} Returns the new function.
  4834. */
  4835. function baseRest(func, start) {
  4836. return setToString(overRest(func, start, identity), func + '');
  4837. }
  4838. /**
  4839. * The base implementation of `_.sample`.
  4840. *
  4841. * @private
  4842. * @param {Array|Object} collection The collection to sample.
  4843. * @returns {*} Returns the random element.
  4844. */
  4845. function baseSample(collection) {
  4846. return arraySample(values(collection));
  4847. }
  4848. /**
  4849. * The base implementation of `_.sampleSize` without param guards.
  4850. *
  4851. * @private
  4852. * @param {Array|Object} collection The collection to sample.
  4853. * @param {number} n The number of elements to sample.
  4854. * @returns {Array} Returns the random elements.
  4855. */
  4856. function baseSampleSize(collection, n) {
  4857. var array = values(collection);
  4858. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4859. }
  4860. /**
  4861. * The base implementation of `_.set`.
  4862. *
  4863. * @private
  4864. * @param {Object} object The object to modify.
  4865. * @param {Array|string} path The path of the property to set.
  4866. * @param {*} value The value to set.
  4867. * @param {Function} [customizer] The function to customize path creation.
  4868. * @returns {Object} Returns `object`.
  4869. */
  4870. function baseSet(object, path, value, customizer) {
  4871. if (!isObject(object)) {
  4872. return object;
  4873. }
  4874. path = castPath(path, object);
  4875. var index = -1,
  4876. length = path.length,
  4877. lastIndex = length - 1,
  4878. nested = object;
  4879. while (nested != null && ++index < length) {
  4880. var key = toKey(path[index]),
  4881. newValue = value;
  4882. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4883. return object;
  4884. }
  4885. if (index != lastIndex) {
  4886. var objValue = nested[key];
  4887. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4888. if (newValue === undefined) {
  4889. newValue = isObject(objValue)
  4890. ? objValue
  4891. : (isIndex(path[index + 1]) ? [] : {});
  4892. }
  4893. }
  4894. assignValue(nested, key, newValue);
  4895. nested = nested[key];
  4896. }
  4897. return object;
  4898. }
  4899. /**
  4900. * The base implementation of `setData` without support for hot loop shorting.
  4901. *
  4902. * @private
  4903. * @param {Function} func The function to associate metadata with.
  4904. * @param {*} data The metadata.
  4905. * @returns {Function} Returns `func`.
  4906. */
  4907. var baseSetData = !metaMap ? identity : function(func, data) {
  4908. metaMap.set(func, data);
  4909. return func;
  4910. };
  4911. /**
  4912. * The base implementation of `setToString` without support for hot loop shorting.
  4913. *
  4914. * @private
  4915. * @param {Function} func The function to modify.
  4916. * @param {Function} string The `toString` result.
  4917. * @returns {Function} Returns `func`.
  4918. */
  4919. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4920. return defineProperty(func, 'toString', {
  4921. 'configurable': true,
  4922. 'enumerable': false,
  4923. 'value': constant(string),
  4924. 'writable': true
  4925. });
  4926. };
  4927. /**
  4928. * The base implementation of `_.shuffle`.
  4929. *
  4930. * @private
  4931. * @param {Array|Object} collection The collection to shuffle.
  4932. * @returns {Array} Returns the new shuffled array.
  4933. */
  4934. function baseShuffle(collection) {
  4935. return shuffleSelf(values(collection));
  4936. }
  4937. /**
  4938. * The base implementation of `_.slice` without an iteratee call guard.
  4939. *
  4940. * @private
  4941. * @param {Array} array The array to slice.
  4942. * @param {number} [start=0] The start position.
  4943. * @param {number} [end=array.length] The end position.
  4944. * @returns {Array} Returns the slice of `array`.
  4945. */
  4946. function baseSlice(array, start, end) {
  4947. var index = -1,
  4948. length = array.length;
  4949. if (start < 0) {
  4950. start = -start > length ? 0 : (length + start);
  4951. }
  4952. end = end > length ? length : end;
  4953. if (end < 0) {
  4954. end += length;
  4955. }
  4956. length = start > end ? 0 : ((end - start) >>> 0);
  4957. start >>>= 0;
  4958. var result = Array(length);
  4959. while (++index < length) {
  4960. result[index] = array[index + start];
  4961. }
  4962. return result;
  4963. }
  4964. /**
  4965. * The base implementation of `_.some` without support for iteratee shorthands.
  4966. *
  4967. * @private
  4968. * @param {Array|Object} collection The collection to iterate over.
  4969. * @param {Function} predicate The function invoked per iteration.
  4970. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4971. * else `false`.
  4972. */
  4973. function baseSome(collection, predicate) {
  4974. var result;
  4975. baseEach(collection, function(value, index, collection) {
  4976. result = predicate(value, index, collection);
  4977. return !result;
  4978. });
  4979. return !!result;
  4980. }
  4981. /**
  4982. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4983. * performs a binary search of `array` to determine the index at which `value`
  4984. * should be inserted into `array` in order to maintain its sort order.
  4985. *
  4986. * @private
  4987. * @param {Array} array The sorted array to inspect.
  4988. * @param {*} value The value to evaluate.
  4989. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4990. * @returns {number} Returns the index at which `value` should be inserted
  4991. * into `array`.
  4992. */
  4993. function baseSortedIndex(array, value, retHighest) {
  4994. var low = 0,
  4995. high = array == null ? low : array.length;
  4996. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4997. while (low < high) {
  4998. var mid = (low + high) >>> 1,
  4999. computed = array[mid];
  5000. if (computed !== null && !isSymbol(computed) &&
  5001. (retHighest ? (computed <= value) : (computed < value))) {
  5002. low = mid + 1;
  5003. } else {
  5004. high = mid;
  5005. }
  5006. }
  5007. return high;
  5008. }
  5009. return baseSortedIndexBy(array, value, identity, retHighest);
  5010. }
  5011. /**
  5012. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5013. * which invokes `iteratee` for `value` and each element of `array` to compute
  5014. * their sort ranking. The iteratee is invoked with one argument; (value).
  5015. *
  5016. * @private
  5017. * @param {Array} array The sorted array to inspect.
  5018. * @param {*} value The value to evaluate.
  5019. * @param {Function} iteratee The iteratee invoked per element.
  5020. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5021. * @returns {number} Returns the index at which `value` should be inserted
  5022. * into `array`.
  5023. */
  5024. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5025. var low = 0,
  5026. high = array == null ? 0 : array.length;
  5027. if (high === 0) {
  5028. return 0;
  5029. }
  5030. value = iteratee(value);
  5031. var valIsNaN = value !== value,
  5032. valIsNull = value === null,
  5033. valIsSymbol = isSymbol(value),
  5034. valIsUndefined = value === undefined;
  5035. while (low < high) {
  5036. var mid = nativeFloor((low + high) / 2),
  5037. computed = iteratee(array[mid]),
  5038. othIsDefined = computed !== undefined,
  5039. othIsNull = computed === null,
  5040. othIsReflexive = computed === computed,
  5041. othIsSymbol = isSymbol(computed);
  5042. if (valIsNaN) {
  5043. var setLow = retHighest || othIsReflexive;
  5044. } else if (valIsUndefined) {
  5045. setLow = othIsReflexive && (retHighest || othIsDefined);
  5046. } else if (valIsNull) {
  5047. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5048. } else if (valIsSymbol) {
  5049. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5050. } else if (othIsNull || othIsSymbol) {
  5051. setLow = false;
  5052. } else {
  5053. setLow = retHighest ? (computed <= value) : (computed < value);
  5054. }
  5055. if (setLow) {
  5056. low = mid + 1;
  5057. } else {
  5058. high = mid;
  5059. }
  5060. }
  5061. return nativeMin(high, MAX_ARRAY_INDEX);
  5062. }
  5063. /**
  5064. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5065. * support for iteratee shorthands.
  5066. *
  5067. * @private
  5068. * @param {Array} array The array to inspect.
  5069. * @param {Function} [iteratee] The iteratee invoked per element.
  5070. * @returns {Array} Returns the new duplicate free array.
  5071. */
  5072. function baseSortedUniq(array, iteratee) {
  5073. var index = -1,
  5074. length = array.length,
  5075. resIndex = 0,
  5076. result = [];
  5077. while (++index < length) {
  5078. var value = array[index],
  5079. computed = iteratee ? iteratee(value) : value;
  5080. if (!index || !eq(computed, seen)) {
  5081. var seen = computed;
  5082. result[resIndex++] = value === 0 ? 0 : value;
  5083. }
  5084. }
  5085. return result;
  5086. }
  5087. /**
  5088. * The base implementation of `_.toNumber` which doesn't ensure correct
  5089. * conversions of binary, hexadecimal, or octal string values.
  5090. *
  5091. * @private
  5092. * @param {*} value The value to process.
  5093. * @returns {number} Returns the number.
  5094. */
  5095. function baseToNumber(value) {
  5096. if (typeof value == 'number') {
  5097. return value;
  5098. }
  5099. if (isSymbol(value)) {
  5100. return NAN;
  5101. }
  5102. return +value;
  5103. }
  5104. /**
  5105. * The base implementation of `_.toString` which doesn't convert nullish
  5106. * values to empty strings.
  5107. *
  5108. * @private
  5109. * @param {*} value The value to process.
  5110. * @returns {string} Returns the string.
  5111. */
  5112. function baseToString(value) {
  5113. // Exit early for strings to avoid a performance hit in some environments.
  5114. if (typeof value == 'string') {
  5115. return value;
  5116. }
  5117. if (isArray(value)) {
  5118. // Recursively convert values (susceptible to call stack limits).
  5119. return arrayMap(value, baseToString) + '';
  5120. }
  5121. if (isSymbol(value)) {
  5122. return symbolToString ? symbolToString.call(value) : '';
  5123. }
  5124. var result = (value + '');
  5125. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5126. }
  5127. /**
  5128. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5129. *
  5130. * @private
  5131. * @param {Array} array The array to inspect.
  5132. * @param {Function} [iteratee] The iteratee invoked per element.
  5133. * @param {Function} [comparator] The comparator invoked per element.
  5134. * @returns {Array} Returns the new duplicate free array.
  5135. */
  5136. function baseUniq(array, iteratee, comparator) {
  5137. var index = -1,
  5138. includes = arrayIncludes,
  5139. length = array.length,
  5140. isCommon = true,
  5141. result = [],
  5142. seen = result;
  5143. if (comparator) {
  5144. isCommon = false;
  5145. includes = arrayIncludesWith;
  5146. }
  5147. else if (length >= LARGE_ARRAY_SIZE) {
  5148. var set = iteratee ? null : createSet(array);
  5149. if (set) {
  5150. return setToArray(set);
  5151. }
  5152. isCommon = false;
  5153. includes = cacheHas;
  5154. seen = new SetCache;
  5155. }
  5156. else {
  5157. seen = iteratee ? [] : result;
  5158. }
  5159. outer:
  5160. while (++index < length) {
  5161. var value = array[index],
  5162. computed = iteratee ? iteratee(value) : value;
  5163. value = (comparator || value !== 0) ? value : 0;
  5164. if (isCommon && computed === computed) {
  5165. var seenIndex = seen.length;
  5166. while (seenIndex--) {
  5167. if (seen[seenIndex] === computed) {
  5168. continue outer;
  5169. }
  5170. }
  5171. if (iteratee) {
  5172. seen.push(computed);
  5173. }
  5174. result.push(value);
  5175. }
  5176. else if (!includes(seen, computed, comparator)) {
  5177. if (seen !== result) {
  5178. seen.push(computed);
  5179. }
  5180. result.push(value);
  5181. }
  5182. }
  5183. return result;
  5184. }
  5185. /**
  5186. * The base implementation of `_.unset`.
  5187. *
  5188. * @private
  5189. * @param {Object} object The object to modify.
  5190. * @param {Array|string} path The property path to unset.
  5191. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5192. */
  5193. function baseUnset(object, path) {
  5194. path = castPath(path, object);
  5195. object = parent(object, path);
  5196. return object == null || delete object[toKey(last(path))];
  5197. }
  5198. /**
  5199. * The base implementation of `_.update`.
  5200. *
  5201. * @private
  5202. * @param {Object} object The object to modify.
  5203. * @param {Array|string} path The path of the property to update.
  5204. * @param {Function} updater The function to produce the updated value.
  5205. * @param {Function} [customizer] The function to customize path creation.
  5206. * @returns {Object} Returns `object`.
  5207. */
  5208. function baseUpdate(object, path, updater, customizer) {
  5209. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5210. }
  5211. /**
  5212. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5213. * without support for iteratee shorthands.
  5214. *
  5215. * @private
  5216. * @param {Array} array The array to query.
  5217. * @param {Function} predicate The function invoked per iteration.
  5218. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5219. * @param {boolean} [fromRight] Specify iterating from right to left.
  5220. * @returns {Array} Returns the slice of `array`.
  5221. */
  5222. function baseWhile(array, predicate, isDrop, fromRight) {
  5223. var length = array.length,
  5224. index = fromRight ? length : -1;
  5225. while ((fromRight ? index-- : ++index < length) &&
  5226. predicate(array[index], index, array)) {}
  5227. return isDrop
  5228. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5229. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5230. }
  5231. /**
  5232. * The base implementation of `wrapperValue` which returns the result of
  5233. * performing a sequence of actions on the unwrapped `value`, where each
  5234. * successive action is supplied the return value of the previous.
  5235. *
  5236. * @private
  5237. * @param {*} value The unwrapped value.
  5238. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5239. * @returns {*} Returns the resolved value.
  5240. */
  5241. function baseWrapperValue(value, actions) {
  5242. var result = value;
  5243. if (result instanceof LazyWrapper) {
  5244. result = result.value();
  5245. }
  5246. return arrayReduce(actions, function(result, action) {
  5247. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5248. }, result);
  5249. }
  5250. /**
  5251. * The base implementation of methods like `_.xor`, without support for
  5252. * iteratee shorthands, that accepts an array of arrays to inspect.
  5253. *
  5254. * @private
  5255. * @param {Array} arrays The arrays to inspect.
  5256. * @param {Function} [iteratee] The iteratee invoked per element.
  5257. * @param {Function} [comparator] The comparator invoked per element.
  5258. * @returns {Array} Returns the new array of values.
  5259. */
  5260. function baseXor(arrays, iteratee, comparator) {
  5261. var length = arrays.length;
  5262. if (length < 2) {
  5263. return length ? baseUniq(arrays[0]) : [];
  5264. }
  5265. var index = -1,
  5266. result = Array(length);
  5267. while (++index < length) {
  5268. var array = arrays[index],
  5269. othIndex = -1;
  5270. while (++othIndex < length) {
  5271. if (othIndex != index) {
  5272. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5273. }
  5274. }
  5275. }
  5276. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5277. }
  5278. /**
  5279. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5280. *
  5281. * @private
  5282. * @param {Array} props The property identifiers.
  5283. * @param {Array} values The property values.
  5284. * @param {Function} assignFunc The function to assign values.
  5285. * @returns {Object} Returns the new object.
  5286. */
  5287. function baseZipObject(props, values, assignFunc) {
  5288. var index = -1,
  5289. length = props.length,
  5290. valsLength = values.length,
  5291. result = {};
  5292. while (++index < length) {
  5293. var value = index < valsLength ? values[index] : undefined;
  5294. assignFunc(result, props[index], value);
  5295. }
  5296. return result;
  5297. }
  5298. /**
  5299. * Casts `value` to an empty array if it's not an array like object.
  5300. *
  5301. * @private
  5302. * @param {*} value The value to inspect.
  5303. * @returns {Array|Object} Returns the cast array-like object.
  5304. */
  5305. function castArrayLikeObject(value) {
  5306. return isArrayLikeObject(value) ? value : [];
  5307. }
  5308. /**
  5309. * Casts `value` to `identity` if it's not a function.
  5310. *
  5311. * @private
  5312. * @param {*} value The value to inspect.
  5313. * @returns {Function} Returns cast function.
  5314. */
  5315. function castFunction(value) {
  5316. return typeof value == 'function' ? value : identity;
  5317. }
  5318. /**
  5319. * Casts `value` to a path array if it's not one.
  5320. *
  5321. * @private
  5322. * @param {*} value The value to inspect.
  5323. * @param {Object} [object] The object to query keys on.
  5324. * @returns {Array} Returns the cast property path array.
  5325. */
  5326. function castPath(value, object) {
  5327. if (isArray(value)) {
  5328. return value;
  5329. }
  5330. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5331. }
  5332. /**
  5333. * A `baseRest` alias which can be replaced with `identity` by module
  5334. * replacement plugins.
  5335. *
  5336. * @private
  5337. * @type {Function}
  5338. * @param {Function} func The function to apply a rest parameter to.
  5339. * @returns {Function} Returns the new function.
  5340. */
  5341. var castRest = baseRest;
  5342. /**
  5343. * Casts `array` to a slice if it's needed.
  5344. *
  5345. * @private
  5346. * @param {Array} array The array to inspect.
  5347. * @param {number} start The start position.
  5348. * @param {number} [end=array.length] The end position.
  5349. * @returns {Array} Returns the cast slice.
  5350. */
  5351. function castSlice(array, start, end) {
  5352. var length = array.length;
  5353. end = end === undefined ? length : end;
  5354. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5355. }
  5356. /**
  5357. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5358. *
  5359. * @private
  5360. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5361. */
  5362. var clearTimeout = ctxClearTimeout || function(id) {
  5363. return root.clearTimeout(id);
  5364. };
  5365. /**
  5366. * Creates a clone of `buffer`.
  5367. *
  5368. * @private
  5369. * @param {Buffer} buffer The buffer to clone.
  5370. * @param {boolean} [isDeep] Specify a deep clone.
  5371. * @returns {Buffer} Returns the cloned buffer.
  5372. */
  5373. function cloneBuffer(buffer, isDeep) {
  5374. if (isDeep) {
  5375. return buffer.slice();
  5376. }
  5377. var length = buffer.length,
  5378. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5379. buffer.copy(result);
  5380. return result;
  5381. }
  5382. /**
  5383. * Creates a clone of `arrayBuffer`.
  5384. *
  5385. * @private
  5386. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5387. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5388. */
  5389. function cloneArrayBuffer(arrayBuffer) {
  5390. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5391. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5392. return result;
  5393. }
  5394. /**
  5395. * Creates a clone of `dataView`.
  5396. *
  5397. * @private
  5398. * @param {Object} dataView The data view to clone.
  5399. * @param {boolean} [isDeep] Specify a deep clone.
  5400. * @returns {Object} Returns the cloned data view.
  5401. */
  5402. function cloneDataView(dataView, isDeep) {
  5403. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5404. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5405. }
  5406. /**
  5407. * Creates a clone of `regexp`.
  5408. *
  5409. * @private
  5410. * @param {Object} regexp The regexp to clone.
  5411. * @returns {Object} Returns the cloned regexp.
  5412. */
  5413. function cloneRegExp(regexp) {
  5414. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5415. result.lastIndex = regexp.lastIndex;
  5416. return result;
  5417. }
  5418. /**
  5419. * Creates a clone of the `symbol` object.
  5420. *
  5421. * @private
  5422. * @param {Object} symbol The symbol object to clone.
  5423. * @returns {Object} Returns the cloned symbol object.
  5424. */
  5425. function cloneSymbol(symbol) {
  5426. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5427. }
  5428. /**
  5429. * Creates a clone of `typedArray`.
  5430. *
  5431. * @private
  5432. * @param {Object} typedArray The typed array to clone.
  5433. * @param {boolean} [isDeep] Specify a deep clone.
  5434. * @returns {Object} Returns the cloned typed array.
  5435. */
  5436. function cloneTypedArray(typedArray, isDeep) {
  5437. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5438. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5439. }
  5440. /**
  5441. * Compares values to sort them in ascending order.
  5442. *
  5443. * @private
  5444. * @param {*} value The value to compare.
  5445. * @param {*} other The other value to compare.
  5446. * @returns {number} Returns the sort order indicator for `value`.
  5447. */
  5448. function compareAscending(value, other) {
  5449. if (value !== other) {
  5450. var valIsDefined = value !== undefined,
  5451. valIsNull = value === null,
  5452. valIsReflexive = value === value,
  5453. valIsSymbol = isSymbol(value);
  5454. var othIsDefined = other !== undefined,
  5455. othIsNull = other === null,
  5456. othIsReflexive = other === other,
  5457. othIsSymbol = isSymbol(other);
  5458. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5459. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5460. (valIsNull && othIsDefined && othIsReflexive) ||
  5461. (!valIsDefined && othIsReflexive) ||
  5462. !valIsReflexive) {
  5463. return 1;
  5464. }
  5465. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5466. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5467. (othIsNull && valIsDefined && valIsReflexive) ||
  5468. (!othIsDefined && valIsReflexive) ||
  5469. !othIsReflexive) {
  5470. return -1;
  5471. }
  5472. }
  5473. return 0;
  5474. }
  5475. /**
  5476. * Used by `_.orderBy` to compare multiple properties of a value to another
  5477. * and stable sort them.
  5478. *
  5479. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5480. * specify an order of "desc" for descending or "asc" for ascending sort order
  5481. * of corresponding values.
  5482. *
  5483. * @private
  5484. * @param {Object} object The object to compare.
  5485. * @param {Object} other The other object to compare.
  5486. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5487. * @returns {number} Returns the sort order indicator for `object`.
  5488. */
  5489. function compareMultiple(object, other, orders) {
  5490. var index = -1,
  5491. objCriteria = object.criteria,
  5492. othCriteria = other.criteria,
  5493. length = objCriteria.length,
  5494. ordersLength = orders.length;
  5495. while (++index < length) {
  5496. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5497. if (result) {
  5498. if (index >= ordersLength) {
  5499. return result;
  5500. }
  5501. var order = orders[index];
  5502. return result * (order == 'desc' ? -1 : 1);
  5503. }
  5504. }
  5505. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5506. // that causes it, under certain circumstances, to provide the same value for
  5507. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5508. // for more details.
  5509. //
  5510. // This also ensures a stable sort in V8 and other engines.
  5511. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5512. return object.index - other.index;
  5513. }
  5514. /**
  5515. * Creates an array that is the composition of partially applied arguments,
  5516. * placeholders, and provided arguments into a single array of arguments.
  5517. *
  5518. * @private
  5519. * @param {Array} args The provided arguments.
  5520. * @param {Array} partials The arguments to prepend to those provided.
  5521. * @param {Array} holders The `partials` placeholder indexes.
  5522. * @params {boolean} [isCurried] Specify composing for a curried function.
  5523. * @returns {Array} Returns the new array of composed arguments.
  5524. */
  5525. function composeArgs(args, partials, holders, isCurried) {
  5526. var argsIndex = -1,
  5527. argsLength = args.length,
  5528. holdersLength = holders.length,
  5529. leftIndex = -1,
  5530. leftLength = partials.length,
  5531. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5532. result = Array(leftLength + rangeLength),
  5533. isUncurried = !isCurried;
  5534. while (++leftIndex < leftLength) {
  5535. result[leftIndex] = partials[leftIndex];
  5536. }
  5537. while (++argsIndex < holdersLength) {
  5538. if (isUncurried || argsIndex < argsLength) {
  5539. result[holders[argsIndex]] = args[argsIndex];
  5540. }
  5541. }
  5542. while (rangeLength--) {
  5543. result[leftIndex++] = args[argsIndex++];
  5544. }
  5545. return result;
  5546. }
  5547. /**
  5548. * This function is like `composeArgs` except that the arguments composition
  5549. * is tailored for `_.partialRight`.
  5550. *
  5551. * @private
  5552. * @param {Array} args The provided arguments.
  5553. * @param {Array} partials The arguments to append to those provided.
  5554. * @param {Array} holders The `partials` placeholder indexes.
  5555. * @params {boolean} [isCurried] Specify composing for a curried function.
  5556. * @returns {Array} Returns the new array of composed arguments.
  5557. */
  5558. function composeArgsRight(args, partials, holders, isCurried) {
  5559. var argsIndex = -1,
  5560. argsLength = args.length,
  5561. holdersIndex = -1,
  5562. holdersLength = holders.length,
  5563. rightIndex = -1,
  5564. rightLength = partials.length,
  5565. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5566. result = Array(rangeLength + rightLength),
  5567. isUncurried = !isCurried;
  5568. while (++argsIndex < rangeLength) {
  5569. result[argsIndex] = args[argsIndex];
  5570. }
  5571. var offset = argsIndex;
  5572. while (++rightIndex < rightLength) {
  5573. result[offset + rightIndex] = partials[rightIndex];
  5574. }
  5575. while (++holdersIndex < holdersLength) {
  5576. if (isUncurried || argsIndex < argsLength) {
  5577. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5578. }
  5579. }
  5580. return result;
  5581. }
  5582. /**
  5583. * Copies the values of `source` to `array`.
  5584. *
  5585. * @private
  5586. * @param {Array} source The array to copy values from.
  5587. * @param {Array} [array=[]] The array to copy values to.
  5588. * @returns {Array} Returns `array`.
  5589. */
  5590. function copyArray(source, array) {
  5591. var index = -1,
  5592. length = source.length;
  5593. array || (array = Array(length));
  5594. while (++index < length) {
  5595. array[index] = source[index];
  5596. }
  5597. return array;
  5598. }
  5599. /**
  5600. * Copies properties of `source` to `object`.
  5601. *
  5602. * @private
  5603. * @param {Object} source The object to copy properties from.
  5604. * @param {Array} props The property identifiers to copy.
  5605. * @param {Object} [object={}] The object to copy properties to.
  5606. * @param {Function} [customizer] The function to customize copied values.
  5607. * @returns {Object} Returns `object`.
  5608. */
  5609. function copyObject(source, props, object, customizer) {
  5610. var isNew = !object;
  5611. object || (object = {});
  5612. var index = -1,
  5613. length = props.length;
  5614. while (++index < length) {
  5615. var key = props[index];
  5616. var newValue = customizer
  5617. ? customizer(object[key], source[key], key, object, source)
  5618. : undefined;
  5619. if (newValue === undefined) {
  5620. newValue = source[key];
  5621. }
  5622. if (isNew) {
  5623. baseAssignValue(object, key, newValue);
  5624. } else {
  5625. assignValue(object, key, newValue);
  5626. }
  5627. }
  5628. return object;
  5629. }
  5630. /**
  5631. * Copies own symbols of `source` to `object`.
  5632. *
  5633. * @private
  5634. * @param {Object} source The object to copy symbols from.
  5635. * @param {Object} [object={}] The object to copy symbols to.
  5636. * @returns {Object} Returns `object`.
  5637. */
  5638. function copySymbols(source, object) {
  5639. return copyObject(source, getSymbols(source), object);
  5640. }
  5641. /**
  5642. * Copies own and inherited symbols of `source` to `object`.
  5643. *
  5644. * @private
  5645. * @param {Object} source The object to copy symbols from.
  5646. * @param {Object} [object={}] The object to copy symbols to.
  5647. * @returns {Object} Returns `object`.
  5648. */
  5649. function copySymbolsIn(source, object) {
  5650. return copyObject(source, getSymbolsIn(source), object);
  5651. }
  5652. /**
  5653. * Creates a function like `_.groupBy`.
  5654. *
  5655. * @private
  5656. * @param {Function} setter The function to set accumulator values.
  5657. * @param {Function} [initializer] The accumulator object initializer.
  5658. * @returns {Function} Returns the new aggregator function.
  5659. */
  5660. function createAggregator(setter, initializer) {
  5661. return function(collection, iteratee) {
  5662. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5663. accumulator = initializer ? initializer() : {};
  5664. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5665. };
  5666. }
  5667. /**
  5668. * Creates a function like `_.assign`.
  5669. *
  5670. * @private
  5671. * @param {Function} assigner The function to assign values.
  5672. * @returns {Function} Returns the new assigner function.
  5673. */
  5674. function createAssigner(assigner) {
  5675. return baseRest(function(object, sources) {
  5676. var index = -1,
  5677. length = sources.length,
  5678. customizer = length > 1 ? sources[length - 1] : undefined,
  5679. guard = length > 2 ? sources[2] : undefined;
  5680. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5681. ? (length--, customizer)
  5682. : undefined;
  5683. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5684. customizer = length < 3 ? undefined : customizer;
  5685. length = 1;
  5686. }
  5687. object = Object(object);
  5688. while (++index < length) {
  5689. var source = sources[index];
  5690. if (source) {
  5691. assigner(object, source, index, customizer);
  5692. }
  5693. }
  5694. return object;
  5695. });
  5696. }
  5697. /**
  5698. * Creates a `baseEach` or `baseEachRight` function.
  5699. *
  5700. * @private
  5701. * @param {Function} eachFunc The function to iterate over a collection.
  5702. * @param {boolean} [fromRight] Specify iterating from right to left.
  5703. * @returns {Function} Returns the new base function.
  5704. */
  5705. function createBaseEach(eachFunc, fromRight) {
  5706. return function(collection, iteratee) {
  5707. if (collection == null) {
  5708. return collection;
  5709. }
  5710. if (!isArrayLike(collection)) {
  5711. return eachFunc(collection, iteratee);
  5712. }
  5713. var length = collection.length,
  5714. index = fromRight ? length : -1,
  5715. iterable = Object(collection);
  5716. while ((fromRight ? index-- : ++index < length)) {
  5717. if (iteratee(iterable[index], index, iterable) === false) {
  5718. break;
  5719. }
  5720. }
  5721. return collection;
  5722. };
  5723. }
  5724. /**
  5725. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5726. *
  5727. * @private
  5728. * @param {boolean} [fromRight] Specify iterating from right to left.
  5729. * @returns {Function} Returns the new base function.
  5730. */
  5731. function createBaseFor(fromRight) {
  5732. return function(object, iteratee, keysFunc) {
  5733. var index = -1,
  5734. iterable = Object(object),
  5735. props = keysFunc(object),
  5736. length = props.length;
  5737. while (length--) {
  5738. var key = props[fromRight ? length : ++index];
  5739. if (iteratee(iterable[key], key, iterable) === false) {
  5740. break;
  5741. }
  5742. }
  5743. return object;
  5744. };
  5745. }
  5746. /**
  5747. * Creates a function that wraps `func` to invoke it with the optional `this`
  5748. * binding of `thisArg`.
  5749. *
  5750. * @private
  5751. * @param {Function} func The function to wrap.
  5752. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5753. * @param {*} [thisArg] The `this` binding of `func`.
  5754. * @returns {Function} Returns the new wrapped function.
  5755. */
  5756. function createBind(func, bitmask, thisArg) {
  5757. var isBind = bitmask & WRAP_BIND_FLAG,
  5758. Ctor = createCtor(func);
  5759. function wrapper() {
  5760. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5761. return fn.apply(isBind ? thisArg : this, arguments);
  5762. }
  5763. return wrapper;
  5764. }
  5765. /**
  5766. * Creates a function like `_.lowerFirst`.
  5767. *
  5768. * @private
  5769. * @param {string} methodName The name of the `String` case method to use.
  5770. * @returns {Function} Returns the new case function.
  5771. */
  5772. function createCaseFirst(methodName) {
  5773. return function(string) {
  5774. string = toString(string);
  5775. var strSymbols = hasUnicode(string)
  5776. ? stringToArray(string)
  5777. : undefined;
  5778. var chr = strSymbols
  5779. ? strSymbols[0]
  5780. : string.charAt(0);
  5781. var trailing = strSymbols
  5782. ? castSlice(strSymbols, 1).join('')
  5783. : string.slice(1);
  5784. return chr[methodName]() + trailing;
  5785. };
  5786. }
  5787. /**
  5788. * Creates a function like `_.camelCase`.
  5789. *
  5790. * @private
  5791. * @param {Function} callback The function to combine each word.
  5792. * @returns {Function} Returns the new compounder function.
  5793. */
  5794. function createCompounder(callback) {
  5795. return function(string) {
  5796. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5797. };
  5798. }
  5799. /**
  5800. * Creates a function that produces an instance of `Ctor` regardless of
  5801. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5802. *
  5803. * @private
  5804. * @param {Function} Ctor The constructor to wrap.
  5805. * @returns {Function} Returns the new wrapped function.
  5806. */
  5807. function createCtor(Ctor) {
  5808. return function() {
  5809. // Use a `switch` statement to work with class constructors. See
  5810. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5811. // for more details.
  5812. var args = arguments;
  5813. switch (args.length) {
  5814. case 0: return new Ctor;
  5815. case 1: return new Ctor(args[0]);
  5816. case 2: return new Ctor(args[0], args[1]);
  5817. case 3: return new Ctor(args[0], args[1], args[2]);
  5818. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5819. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5820. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5821. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5822. }
  5823. var thisBinding = baseCreate(Ctor.prototype),
  5824. result = Ctor.apply(thisBinding, args);
  5825. // Mimic the constructor's `return` behavior.
  5826. // See https://es5.github.io/#x13.2.2 for more details.
  5827. return isObject(result) ? result : thisBinding;
  5828. };
  5829. }
  5830. /**
  5831. * Creates a function that wraps `func` to enable currying.
  5832. *
  5833. * @private
  5834. * @param {Function} func The function to wrap.
  5835. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5836. * @param {number} arity The arity of `func`.
  5837. * @returns {Function} Returns the new wrapped function.
  5838. */
  5839. function createCurry(func, bitmask, arity) {
  5840. var Ctor = createCtor(func);
  5841. function wrapper() {
  5842. var length = arguments.length,
  5843. args = Array(length),
  5844. index = length,
  5845. placeholder = getHolder(wrapper);
  5846. while (index--) {
  5847. args[index] = arguments[index];
  5848. }
  5849. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5850. ? []
  5851. : replaceHolders(args, placeholder);
  5852. length -= holders.length;
  5853. if (length < arity) {
  5854. return createRecurry(
  5855. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5856. args, holders, undefined, undefined, arity - length);
  5857. }
  5858. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5859. return apply(fn, this, args);
  5860. }
  5861. return wrapper;
  5862. }
  5863. /**
  5864. * Creates a `_.find` or `_.findLast` function.
  5865. *
  5866. * @private
  5867. * @param {Function} findIndexFunc The function to find the collection index.
  5868. * @returns {Function} Returns the new find function.
  5869. */
  5870. function createFind(findIndexFunc) {
  5871. return function(collection, predicate, fromIndex) {
  5872. var iterable = Object(collection);
  5873. if (!isArrayLike(collection)) {
  5874. var iteratee = getIteratee(predicate, 3);
  5875. collection = keys(collection);
  5876. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5877. }
  5878. var index = findIndexFunc(collection, predicate, fromIndex);
  5879. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5880. };
  5881. }
  5882. /**
  5883. * Creates a `_.flow` or `_.flowRight` function.
  5884. *
  5885. * @private
  5886. * @param {boolean} [fromRight] Specify iterating from right to left.
  5887. * @returns {Function} Returns the new flow function.
  5888. */
  5889. function createFlow(fromRight) {
  5890. return flatRest(function(funcs) {
  5891. var length = funcs.length,
  5892. index = length,
  5893. prereq = LodashWrapper.prototype.thru;
  5894. if (fromRight) {
  5895. funcs.reverse();
  5896. }
  5897. while (index--) {
  5898. var func = funcs[index];
  5899. if (typeof func != 'function') {
  5900. throw new TypeError(FUNC_ERROR_TEXT);
  5901. }
  5902. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5903. var wrapper = new LodashWrapper([], true);
  5904. }
  5905. }
  5906. index = wrapper ? index : length;
  5907. while (++index < length) {
  5908. func = funcs[index];
  5909. var funcName = getFuncName(func),
  5910. data = funcName == 'wrapper' ? getData(func) : undefined;
  5911. if (data && isLaziable(data[0]) &&
  5912. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5913. !data[4].length && data[9] == 1
  5914. ) {
  5915. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5916. } else {
  5917. wrapper = (func.length == 1 && isLaziable(func))
  5918. ? wrapper[funcName]()
  5919. : wrapper.thru(func);
  5920. }
  5921. }
  5922. return function() {
  5923. var args = arguments,
  5924. value = args[0];
  5925. if (wrapper && args.length == 1 && isArray(value)) {
  5926. return wrapper.plant(value).value();
  5927. }
  5928. var index = 0,
  5929. result = length ? funcs[index].apply(this, args) : value;
  5930. while (++index < length) {
  5931. result = funcs[index].call(this, result);
  5932. }
  5933. return result;
  5934. };
  5935. });
  5936. }
  5937. /**
  5938. * Creates a function that wraps `func` to invoke it with optional `this`
  5939. * binding of `thisArg`, partial application, and currying.
  5940. *
  5941. * @private
  5942. * @param {Function|string} func The function or method name to wrap.
  5943. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5944. * @param {*} [thisArg] The `this` binding of `func`.
  5945. * @param {Array} [partials] The arguments to prepend to those provided to
  5946. * the new function.
  5947. * @param {Array} [holders] The `partials` placeholder indexes.
  5948. * @param {Array} [partialsRight] The arguments to append to those provided
  5949. * to the new function.
  5950. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5951. * @param {Array} [argPos] The argument positions of the new function.
  5952. * @param {number} [ary] The arity cap of `func`.
  5953. * @param {number} [arity] The arity of `func`.
  5954. * @returns {Function} Returns the new wrapped function.
  5955. */
  5956. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5957. var isAry = bitmask & WRAP_ARY_FLAG,
  5958. isBind = bitmask & WRAP_BIND_FLAG,
  5959. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5960. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5961. isFlip = bitmask & WRAP_FLIP_FLAG,
  5962. Ctor = isBindKey ? undefined : createCtor(func);
  5963. function wrapper() {
  5964. var length = arguments.length,
  5965. args = Array(length),
  5966. index = length;
  5967. while (index--) {
  5968. args[index] = arguments[index];
  5969. }
  5970. if (isCurried) {
  5971. var placeholder = getHolder(wrapper),
  5972. holdersCount = countHolders(args, placeholder);
  5973. }
  5974. if (partials) {
  5975. args = composeArgs(args, partials, holders, isCurried);
  5976. }
  5977. if (partialsRight) {
  5978. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5979. }
  5980. length -= holdersCount;
  5981. if (isCurried && length < arity) {
  5982. var newHolders = replaceHolders(args, placeholder);
  5983. return createRecurry(
  5984. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5985. args, newHolders, argPos, ary, arity - length
  5986. );
  5987. }
  5988. var thisBinding = isBind ? thisArg : this,
  5989. fn = isBindKey ? thisBinding[func] : func;
  5990. length = args.length;
  5991. if (argPos) {
  5992. args = reorder(args, argPos);
  5993. } else if (isFlip && length > 1) {
  5994. args.reverse();
  5995. }
  5996. if (isAry && ary < length) {
  5997. args.length = ary;
  5998. }
  5999. if (this && this !== root && this instanceof wrapper) {
  6000. fn = Ctor || createCtor(fn);
  6001. }
  6002. return fn.apply(thisBinding, args);
  6003. }
  6004. return wrapper;
  6005. }
  6006. /**
  6007. * Creates a function like `_.invertBy`.
  6008. *
  6009. * @private
  6010. * @param {Function} setter The function to set accumulator values.
  6011. * @param {Function} toIteratee The function to resolve iteratees.
  6012. * @returns {Function} Returns the new inverter function.
  6013. */
  6014. function createInverter(setter, toIteratee) {
  6015. return function(object, iteratee) {
  6016. return baseInverter(object, setter, toIteratee(iteratee), {});
  6017. };
  6018. }
  6019. /**
  6020. * Creates a function that performs a mathematical operation on two values.
  6021. *
  6022. * @private
  6023. * @param {Function} operator The function to perform the operation.
  6024. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6025. * @returns {Function} Returns the new mathematical operation function.
  6026. */
  6027. function createMathOperation(operator, defaultValue) {
  6028. return function(value, other) {
  6029. var result;
  6030. if (value === undefined && other === undefined) {
  6031. return defaultValue;
  6032. }
  6033. if (value !== undefined) {
  6034. result = value;
  6035. }
  6036. if (other !== undefined) {
  6037. if (result === undefined) {
  6038. return other;
  6039. }
  6040. if (typeof value == 'string' || typeof other == 'string') {
  6041. value = baseToString(value);
  6042. other = baseToString(other);
  6043. } else {
  6044. value = baseToNumber(value);
  6045. other = baseToNumber(other);
  6046. }
  6047. result = operator(value, other);
  6048. }
  6049. return result;
  6050. };
  6051. }
  6052. /**
  6053. * Creates a function like `_.over`.
  6054. *
  6055. * @private
  6056. * @param {Function} arrayFunc The function to iterate over iteratees.
  6057. * @returns {Function} Returns the new over function.
  6058. */
  6059. function createOver(arrayFunc) {
  6060. return flatRest(function(iteratees) {
  6061. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6062. return baseRest(function(args) {
  6063. var thisArg = this;
  6064. return arrayFunc(iteratees, function(iteratee) {
  6065. return apply(iteratee, thisArg, args);
  6066. });
  6067. });
  6068. });
  6069. }
  6070. /**
  6071. * Creates the padding for `string` based on `length`. The `chars` string
  6072. * is truncated if the number of characters exceeds `length`.
  6073. *
  6074. * @private
  6075. * @param {number} length The padding length.
  6076. * @param {string} [chars=' '] The string used as padding.
  6077. * @returns {string} Returns the padding for `string`.
  6078. */
  6079. function createPadding(length, chars) {
  6080. chars = chars === undefined ? ' ' : baseToString(chars);
  6081. var charsLength = chars.length;
  6082. if (charsLength < 2) {
  6083. return charsLength ? baseRepeat(chars, length) : chars;
  6084. }
  6085. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6086. return hasUnicode(chars)
  6087. ? castSlice(stringToArray(result), 0, length).join('')
  6088. : result.slice(0, length);
  6089. }
  6090. /**
  6091. * Creates a function that wraps `func` to invoke it with the `this` binding
  6092. * of `thisArg` and `partials` prepended to the arguments it receives.
  6093. *
  6094. * @private
  6095. * @param {Function} func The function to wrap.
  6096. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6097. * @param {*} thisArg The `this` binding of `func`.
  6098. * @param {Array} partials The arguments to prepend to those provided to
  6099. * the new function.
  6100. * @returns {Function} Returns the new wrapped function.
  6101. */
  6102. function createPartial(func, bitmask, thisArg, partials) {
  6103. var isBind = bitmask & WRAP_BIND_FLAG,
  6104. Ctor = createCtor(func);
  6105. function wrapper() {
  6106. var argsIndex = -1,
  6107. argsLength = arguments.length,
  6108. leftIndex = -1,
  6109. leftLength = partials.length,
  6110. args = Array(leftLength + argsLength),
  6111. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6112. while (++leftIndex < leftLength) {
  6113. args[leftIndex] = partials[leftIndex];
  6114. }
  6115. while (argsLength--) {
  6116. args[leftIndex++] = arguments[++argsIndex];
  6117. }
  6118. return apply(fn, isBind ? thisArg : this, args);
  6119. }
  6120. return wrapper;
  6121. }
  6122. /**
  6123. * Creates a `_.range` or `_.rangeRight` function.
  6124. *
  6125. * @private
  6126. * @param {boolean} [fromRight] Specify iterating from right to left.
  6127. * @returns {Function} Returns the new range function.
  6128. */
  6129. function createRange(fromRight) {
  6130. return function(start, end, step) {
  6131. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6132. end = step = undefined;
  6133. }
  6134. // Ensure the sign of `-0` is preserved.
  6135. start = toFinite(start);
  6136. if (end === undefined) {
  6137. end = start;
  6138. start = 0;
  6139. } else {
  6140. end = toFinite(end);
  6141. }
  6142. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6143. return baseRange(start, end, step, fromRight);
  6144. };
  6145. }
  6146. /**
  6147. * Creates a function that performs a relational operation on two values.
  6148. *
  6149. * @private
  6150. * @param {Function} operator The function to perform the operation.
  6151. * @returns {Function} Returns the new relational operation function.
  6152. */
  6153. function createRelationalOperation(operator) {
  6154. return function(value, other) {
  6155. if (!(typeof value == 'string' && typeof other == 'string')) {
  6156. value = toNumber(value);
  6157. other = toNumber(other);
  6158. }
  6159. return operator(value, other);
  6160. };
  6161. }
  6162. /**
  6163. * Creates a function that wraps `func` to continue currying.
  6164. *
  6165. * @private
  6166. * @param {Function} func The function to wrap.
  6167. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6168. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6169. * @param {*} placeholder The placeholder value.
  6170. * @param {*} [thisArg] The `this` binding of `func`.
  6171. * @param {Array} [partials] The arguments to prepend to those provided to
  6172. * the new function.
  6173. * @param {Array} [holders] The `partials` placeholder indexes.
  6174. * @param {Array} [argPos] The argument positions of the new function.
  6175. * @param {number} [ary] The arity cap of `func`.
  6176. * @param {number} [arity] The arity of `func`.
  6177. * @returns {Function} Returns the new wrapped function.
  6178. */
  6179. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6180. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6181. newHolders = isCurry ? holders : undefined,
  6182. newHoldersRight = isCurry ? undefined : holders,
  6183. newPartials = isCurry ? partials : undefined,
  6184. newPartialsRight = isCurry ? undefined : partials;
  6185. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6186. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6187. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6188. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6189. }
  6190. var newData = [
  6191. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6192. newHoldersRight, argPos, ary, arity
  6193. ];
  6194. var result = wrapFunc.apply(undefined, newData);
  6195. if (isLaziable(func)) {
  6196. setData(result, newData);
  6197. }
  6198. result.placeholder = placeholder;
  6199. return setWrapToString(result, func, bitmask);
  6200. }
  6201. /**
  6202. * Creates a function like `_.round`.
  6203. *
  6204. * @private
  6205. * @param {string} methodName The name of the `Math` method to use when rounding.
  6206. * @returns {Function} Returns the new round function.
  6207. */
  6208. function createRound(methodName) {
  6209. var func = Math[methodName];
  6210. return function(number, precision) {
  6211. number = toNumber(number);
  6212. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6213. if (precision && nativeIsFinite(number)) {
  6214. // Shift with exponential notation to avoid floating-point issues.
  6215. // See [MDN](https://mdn.io/round#Examples) for more details.
  6216. var pair = (toString(number) + 'e').split('e'),
  6217. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6218. pair = (toString(value) + 'e').split('e');
  6219. return +(pair[0] + 'e' + (+pair[1] - precision));
  6220. }
  6221. return func(number);
  6222. };
  6223. }
  6224. /**
  6225. * Creates a set object of `values`.
  6226. *
  6227. * @private
  6228. * @param {Array} values The values to add to the set.
  6229. * @returns {Object} Returns the new set.
  6230. */
  6231. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6232. return new Set(values);
  6233. };
  6234. /**
  6235. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6236. *
  6237. * @private
  6238. * @param {Function} keysFunc The function to get the keys of a given object.
  6239. * @returns {Function} Returns the new pairs function.
  6240. */
  6241. function createToPairs(keysFunc) {
  6242. return function(object) {
  6243. var tag = getTag(object);
  6244. if (tag == mapTag) {
  6245. return mapToArray(object);
  6246. }
  6247. if (tag == setTag) {
  6248. return setToPairs(object);
  6249. }
  6250. return baseToPairs(object, keysFunc(object));
  6251. };
  6252. }
  6253. /**
  6254. * Creates a function that either curries or invokes `func` with optional
  6255. * `this` binding and partially applied arguments.
  6256. *
  6257. * @private
  6258. * @param {Function|string} func The function or method name to wrap.
  6259. * @param {number} bitmask The bitmask flags.
  6260. * 1 - `_.bind`
  6261. * 2 - `_.bindKey`
  6262. * 4 - `_.curry` or `_.curryRight` of a bound function
  6263. * 8 - `_.curry`
  6264. * 16 - `_.curryRight`
  6265. * 32 - `_.partial`
  6266. * 64 - `_.partialRight`
  6267. * 128 - `_.rearg`
  6268. * 256 - `_.ary`
  6269. * 512 - `_.flip`
  6270. * @param {*} [thisArg] The `this` binding of `func`.
  6271. * @param {Array} [partials] The arguments to be partially applied.
  6272. * @param {Array} [holders] The `partials` placeholder indexes.
  6273. * @param {Array} [argPos] The argument positions of the new function.
  6274. * @param {number} [ary] The arity cap of `func`.
  6275. * @param {number} [arity] The arity of `func`.
  6276. * @returns {Function} Returns the new wrapped function.
  6277. */
  6278. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6279. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6280. if (!isBindKey && typeof func != 'function') {
  6281. throw new TypeError(FUNC_ERROR_TEXT);
  6282. }
  6283. var length = partials ? partials.length : 0;
  6284. if (!length) {
  6285. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6286. partials = holders = undefined;
  6287. }
  6288. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6289. arity = arity === undefined ? arity : toInteger(arity);
  6290. length -= holders ? holders.length : 0;
  6291. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6292. var partialsRight = partials,
  6293. holdersRight = holders;
  6294. partials = holders = undefined;
  6295. }
  6296. var data = isBindKey ? undefined : getData(func);
  6297. var newData = [
  6298. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6299. argPos, ary, arity
  6300. ];
  6301. if (data) {
  6302. mergeData(newData, data);
  6303. }
  6304. func = newData[0];
  6305. bitmask = newData[1];
  6306. thisArg = newData[2];
  6307. partials = newData[3];
  6308. holders = newData[4];
  6309. arity = newData[9] = newData[9] === undefined
  6310. ? (isBindKey ? 0 : func.length)
  6311. : nativeMax(newData[9] - length, 0);
  6312. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6313. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6314. }
  6315. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6316. var result = createBind(func, bitmask, thisArg);
  6317. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6318. result = createCurry(func, bitmask, arity);
  6319. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6320. result = createPartial(func, bitmask, thisArg, partials);
  6321. } else {
  6322. result = createHybrid.apply(undefined, newData);
  6323. }
  6324. var setter = data ? baseSetData : setData;
  6325. return setWrapToString(setter(result, newData), func, bitmask);
  6326. }
  6327. /**
  6328. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6329. * of source objects to the destination object for all destination properties
  6330. * that resolve to `undefined`.
  6331. *
  6332. * @private
  6333. * @param {*} objValue The destination value.
  6334. * @param {*} srcValue The source value.
  6335. * @param {string} key The key of the property to assign.
  6336. * @param {Object} object The parent object of `objValue`.
  6337. * @returns {*} Returns the value to assign.
  6338. */
  6339. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6340. if (objValue === undefined ||
  6341. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6342. return srcValue;
  6343. }
  6344. return objValue;
  6345. }
  6346. /**
  6347. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6348. * objects into destination objects that are passed thru.
  6349. *
  6350. * @private
  6351. * @param {*} objValue The destination value.
  6352. * @param {*} srcValue The source value.
  6353. * @param {string} key The key of the property to merge.
  6354. * @param {Object} object The parent object of `objValue`.
  6355. * @param {Object} source The parent object of `srcValue`.
  6356. * @param {Object} [stack] Tracks traversed source values and their merged
  6357. * counterparts.
  6358. * @returns {*} Returns the value to assign.
  6359. */
  6360. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6361. if (isObject(objValue) && isObject(srcValue)) {
  6362. // Recursively merge objects and arrays (susceptible to call stack limits).
  6363. stack.set(srcValue, objValue);
  6364. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6365. stack['delete'](srcValue);
  6366. }
  6367. return objValue;
  6368. }
  6369. /**
  6370. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6371. * objects.
  6372. *
  6373. * @private
  6374. * @param {*} value The value to inspect.
  6375. * @param {string} key The key of the property to inspect.
  6376. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6377. */
  6378. function customOmitClone(value) {
  6379. return isPlainObject(value) ? undefined : value;
  6380. }
  6381. /**
  6382. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6383. * partial deep comparisons.
  6384. *
  6385. * @private
  6386. * @param {Array} array The array to compare.
  6387. * @param {Array} other The other array to compare.
  6388. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6389. * @param {Function} customizer The function to customize comparisons.
  6390. * @param {Function} equalFunc The function to determine equivalents of values.
  6391. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6392. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6393. */
  6394. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6395. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6396. arrLength = array.length,
  6397. othLength = other.length;
  6398. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6399. return false;
  6400. }
  6401. // Check that cyclic values are equal.
  6402. var arrStacked = stack.get(array);
  6403. var othStacked = stack.get(other);
  6404. if (arrStacked && othStacked) {
  6405. return arrStacked == other && othStacked == array;
  6406. }
  6407. var index = -1,
  6408. result = true,
  6409. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6410. stack.set(array, other);
  6411. stack.set(other, array);
  6412. // Ignore non-index properties.
  6413. while (++index < arrLength) {
  6414. var arrValue = array[index],
  6415. othValue = other[index];
  6416. if (customizer) {
  6417. var compared = isPartial
  6418. ? customizer(othValue, arrValue, index, other, array, stack)
  6419. : customizer(arrValue, othValue, index, array, other, stack);
  6420. }
  6421. if (compared !== undefined) {
  6422. if (compared) {
  6423. continue;
  6424. }
  6425. result = false;
  6426. break;
  6427. }
  6428. // Recursively compare arrays (susceptible to call stack limits).
  6429. if (seen) {
  6430. if (!arraySome(other, function(othValue, othIndex) {
  6431. if (!cacheHas(seen, othIndex) &&
  6432. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6433. return seen.push(othIndex);
  6434. }
  6435. })) {
  6436. result = false;
  6437. break;
  6438. }
  6439. } else if (!(
  6440. arrValue === othValue ||
  6441. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6442. )) {
  6443. result = false;
  6444. break;
  6445. }
  6446. }
  6447. stack['delete'](array);
  6448. stack['delete'](other);
  6449. return result;
  6450. }
  6451. /**
  6452. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6453. * the same `toStringTag`.
  6454. *
  6455. * **Note:** This function only supports comparing values with tags of
  6456. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6457. *
  6458. * @private
  6459. * @param {Object} object The object to compare.
  6460. * @param {Object} other The other object to compare.
  6461. * @param {string} tag The `toStringTag` of the objects to compare.
  6462. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6463. * @param {Function} customizer The function to customize comparisons.
  6464. * @param {Function} equalFunc The function to determine equivalents of values.
  6465. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6466. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6467. */
  6468. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6469. switch (tag) {
  6470. case dataViewTag:
  6471. if ((object.byteLength != other.byteLength) ||
  6472. (object.byteOffset != other.byteOffset)) {
  6473. return false;
  6474. }
  6475. object = object.buffer;
  6476. other = other.buffer;
  6477. case arrayBufferTag:
  6478. if ((object.byteLength != other.byteLength) ||
  6479. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6480. return false;
  6481. }
  6482. return true;
  6483. case boolTag:
  6484. case dateTag:
  6485. case numberTag:
  6486. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6487. // Invalid dates are coerced to `NaN`.
  6488. return eq(+object, +other);
  6489. case errorTag:
  6490. return object.name == other.name && object.message == other.message;
  6491. case regexpTag:
  6492. case stringTag:
  6493. // Coerce regexes to strings and treat strings, primitives and objects,
  6494. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6495. // for more details.
  6496. return object == (other + '');
  6497. case mapTag:
  6498. var convert = mapToArray;
  6499. case setTag:
  6500. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6501. convert || (convert = setToArray);
  6502. if (object.size != other.size && !isPartial) {
  6503. return false;
  6504. }
  6505. // Assume cyclic values are equal.
  6506. var stacked = stack.get(object);
  6507. if (stacked) {
  6508. return stacked == other;
  6509. }
  6510. bitmask |= COMPARE_UNORDERED_FLAG;
  6511. // Recursively compare objects (susceptible to call stack limits).
  6512. stack.set(object, other);
  6513. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6514. stack['delete'](object);
  6515. return result;
  6516. case symbolTag:
  6517. if (symbolValueOf) {
  6518. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6519. }
  6520. }
  6521. return false;
  6522. }
  6523. /**
  6524. * A specialized version of `baseIsEqualDeep` for objects with support for
  6525. * partial deep comparisons.
  6526. *
  6527. * @private
  6528. * @param {Object} object The object to compare.
  6529. * @param {Object} other The other object to compare.
  6530. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6531. * @param {Function} customizer The function to customize comparisons.
  6532. * @param {Function} equalFunc The function to determine equivalents of values.
  6533. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6534. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6535. */
  6536. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6537. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6538. objProps = getAllKeys(object),
  6539. objLength = objProps.length,
  6540. othProps = getAllKeys(other),
  6541. othLength = othProps.length;
  6542. if (objLength != othLength && !isPartial) {
  6543. return false;
  6544. }
  6545. var index = objLength;
  6546. while (index--) {
  6547. var key = objProps[index];
  6548. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6549. return false;
  6550. }
  6551. }
  6552. // Check that cyclic values are equal.
  6553. var objStacked = stack.get(object);
  6554. var othStacked = stack.get(other);
  6555. if (objStacked && othStacked) {
  6556. return objStacked == other && othStacked == object;
  6557. }
  6558. var result = true;
  6559. stack.set(object, other);
  6560. stack.set(other, object);
  6561. var skipCtor = isPartial;
  6562. while (++index < objLength) {
  6563. key = objProps[index];
  6564. var objValue = object[key],
  6565. othValue = other[key];
  6566. if (customizer) {
  6567. var compared = isPartial
  6568. ? customizer(othValue, objValue, key, other, object, stack)
  6569. : customizer(objValue, othValue, key, object, other, stack);
  6570. }
  6571. // Recursively compare objects (susceptible to call stack limits).
  6572. if (!(compared === undefined
  6573. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6574. : compared
  6575. )) {
  6576. result = false;
  6577. break;
  6578. }
  6579. skipCtor || (skipCtor = key == 'constructor');
  6580. }
  6581. if (result && !skipCtor) {
  6582. var objCtor = object.constructor,
  6583. othCtor = other.constructor;
  6584. // Non `Object` object instances with different constructors are not equal.
  6585. if (objCtor != othCtor &&
  6586. ('constructor' in object && 'constructor' in other) &&
  6587. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6588. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6589. result = false;
  6590. }
  6591. }
  6592. stack['delete'](object);
  6593. stack['delete'](other);
  6594. return result;
  6595. }
  6596. /**
  6597. * A specialized version of `baseRest` which flattens the rest array.
  6598. *
  6599. * @private
  6600. * @param {Function} func The function to apply a rest parameter to.
  6601. * @returns {Function} Returns the new function.
  6602. */
  6603. function flatRest(func) {
  6604. return setToString(overRest(func, undefined, flatten), func + '');
  6605. }
  6606. /**
  6607. * Creates an array of own enumerable property names and symbols of `object`.
  6608. *
  6609. * @private
  6610. * @param {Object} object The object to query.
  6611. * @returns {Array} Returns the array of property names and symbols.
  6612. */
  6613. function getAllKeys(object) {
  6614. return baseGetAllKeys(object, keys, getSymbols);
  6615. }
  6616. /**
  6617. * Creates an array of own and inherited enumerable property names and
  6618. * symbols of `object`.
  6619. *
  6620. * @private
  6621. * @param {Object} object The object to query.
  6622. * @returns {Array} Returns the array of property names and symbols.
  6623. */
  6624. function getAllKeysIn(object) {
  6625. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6626. }
  6627. /**
  6628. * Gets metadata for `func`.
  6629. *
  6630. * @private
  6631. * @param {Function} func The function to query.
  6632. * @returns {*} Returns the metadata for `func`.
  6633. */
  6634. var getData = !metaMap ? noop : function(func) {
  6635. return metaMap.get(func);
  6636. };
  6637. /**
  6638. * Gets the name of `func`.
  6639. *
  6640. * @private
  6641. * @param {Function} func The function to query.
  6642. * @returns {string} Returns the function name.
  6643. */
  6644. function getFuncName(func) {
  6645. var result = (func.name + ''),
  6646. array = realNames[result],
  6647. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6648. while (length--) {
  6649. var data = array[length],
  6650. otherFunc = data.func;
  6651. if (otherFunc == null || otherFunc == func) {
  6652. return data.name;
  6653. }
  6654. }
  6655. return result;
  6656. }
  6657. /**
  6658. * Gets the argument placeholder value for `func`.
  6659. *
  6660. * @private
  6661. * @param {Function} func The function to inspect.
  6662. * @returns {*} Returns the placeholder value.
  6663. */
  6664. function getHolder(func) {
  6665. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6666. return object.placeholder;
  6667. }
  6668. /**
  6669. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6670. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6671. * If arguments are provided, the chosen function is invoked with them and
  6672. * its result is returned.
  6673. *
  6674. * @private
  6675. * @param {*} [value] The value to convert to an iteratee.
  6676. * @param {number} [arity] The arity of the created iteratee.
  6677. * @returns {Function} Returns the chosen function or its result.
  6678. */
  6679. function getIteratee() {
  6680. var result = lodash.iteratee || iteratee;
  6681. result = result === iteratee ? baseIteratee : result;
  6682. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6683. }
  6684. /**
  6685. * Gets the data for `map`.
  6686. *
  6687. * @private
  6688. * @param {Object} map The map to query.
  6689. * @param {string} key The reference key.
  6690. * @returns {*} Returns the map data.
  6691. */
  6692. function getMapData(map, key) {
  6693. var data = map.__data__;
  6694. return isKeyable(key)
  6695. ? data[typeof key == 'string' ? 'string' : 'hash']
  6696. : data.map;
  6697. }
  6698. /**
  6699. * Gets the property names, values, and compare flags of `object`.
  6700. *
  6701. * @private
  6702. * @param {Object} object The object to query.
  6703. * @returns {Array} Returns the match data of `object`.
  6704. */
  6705. function getMatchData(object) {
  6706. var result = keys(object),
  6707. length = result.length;
  6708. while (length--) {
  6709. var key = result[length],
  6710. value = object[key];
  6711. result[length] = [key, value, isStrictComparable(value)];
  6712. }
  6713. return result;
  6714. }
  6715. /**
  6716. * Gets the native function at `key` of `object`.
  6717. *
  6718. * @private
  6719. * @param {Object} object The object to query.
  6720. * @param {string} key The key of the method to get.
  6721. * @returns {*} Returns the function if it's native, else `undefined`.
  6722. */
  6723. function getNative(object, key) {
  6724. var value = getValue(object, key);
  6725. return baseIsNative(value) ? value : undefined;
  6726. }
  6727. /**
  6728. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6729. *
  6730. * @private
  6731. * @param {*} value The value to query.
  6732. * @returns {string} Returns the raw `toStringTag`.
  6733. */
  6734. function getRawTag(value) {
  6735. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6736. tag = value[symToStringTag];
  6737. try {
  6738. value[symToStringTag] = undefined;
  6739. var unmasked = true;
  6740. } catch (e) {}
  6741. var result = nativeObjectToString.call(value);
  6742. if (unmasked) {
  6743. if (isOwn) {
  6744. value[symToStringTag] = tag;
  6745. } else {
  6746. delete value[symToStringTag];
  6747. }
  6748. }
  6749. return result;
  6750. }
  6751. /**
  6752. * Creates an array of the own enumerable symbols of `object`.
  6753. *
  6754. * @private
  6755. * @param {Object} object The object to query.
  6756. * @returns {Array} Returns the array of symbols.
  6757. */
  6758. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6759. if (object == null) {
  6760. return [];
  6761. }
  6762. object = Object(object);
  6763. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6764. return propertyIsEnumerable.call(object, symbol);
  6765. });
  6766. };
  6767. /**
  6768. * Creates an array of the own and inherited enumerable symbols of `object`.
  6769. *
  6770. * @private
  6771. * @param {Object} object The object to query.
  6772. * @returns {Array} Returns the array of symbols.
  6773. */
  6774. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6775. var result = [];
  6776. while (object) {
  6777. arrayPush(result, getSymbols(object));
  6778. object = getPrototype(object);
  6779. }
  6780. return result;
  6781. };
  6782. /**
  6783. * Gets the `toStringTag` of `value`.
  6784. *
  6785. * @private
  6786. * @param {*} value The value to query.
  6787. * @returns {string} Returns the `toStringTag`.
  6788. */
  6789. var getTag = baseGetTag;
  6790. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6791. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6792. (Map && getTag(new Map) != mapTag) ||
  6793. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6794. (Set && getTag(new Set) != setTag) ||
  6795. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6796. getTag = function(value) {
  6797. var result = baseGetTag(value),
  6798. Ctor = result == objectTag ? value.constructor : undefined,
  6799. ctorString = Ctor ? toSource(Ctor) : '';
  6800. if (ctorString) {
  6801. switch (ctorString) {
  6802. case dataViewCtorString: return dataViewTag;
  6803. case mapCtorString: return mapTag;
  6804. case promiseCtorString: return promiseTag;
  6805. case setCtorString: return setTag;
  6806. case weakMapCtorString: return weakMapTag;
  6807. }
  6808. }
  6809. return result;
  6810. };
  6811. }
  6812. /**
  6813. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6814. *
  6815. * @private
  6816. * @param {number} start The start of the view.
  6817. * @param {number} end The end of the view.
  6818. * @param {Array} transforms The transformations to apply to the view.
  6819. * @returns {Object} Returns an object containing the `start` and `end`
  6820. * positions of the view.
  6821. */
  6822. function getView(start, end, transforms) {
  6823. var index = -1,
  6824. length = transforms.length;
  6825. while (++index < length) {
  6826. var data = transforms[index],
  6827. size = data.size;
  6828. switch (data.type) {
  6829. case 'drop': start += size; break;
  6830. case 'dropRight': end -= size; break;
  6831. case 'take': end = nativeMin(end, start + size); break;
  6832. case 'takeRight': start = nativeMax(start, end - size); break;
  6833. }
  6834. }
  6835. return { 'start': start, 'end': end };
  6836. }
  6837. /**
  6838. * Extracts wrapper details from the `source` body comment.
  6839. *
  6840. * @private
  6841. * @param {string} source The source to inspect.
  6842. * @returns {Array} Returns the wrapper details.
  6843. */
  6844. function getWrapDetails(source) {
  6845. var match = source.match(reWrapDetails);
  6846. return match ? match[1].split(reSplitDetails) : [];
  6847. }
  6848. /**
  6849. * Checks if `path` exists on `object`.
  6850. *
  6851. * @private
  6852. * @param {Object} object The object to query.
  6853. * @param {Array|string} path The path to check.
  6854. * @param {Function} hasFunc The function to check properties.
  6855. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6856. */
  6857. function hasPath(object, path, hasFunc) {
  6858. path = castPath(path, object);
  6859. var index = -1,
  6860. length = path.length,
  6861. result = false;
  6862. while (++index < length) {
  6863. var key = toKey(path[index]);
  6864. if (!(result = object != null && hasFunc(object, key))) {
  6865. break;
  6866. }
  6867. object = object[key];
  6868. }
  6869. if (result || ++index != length) {
  6870. return result;
  6871. }
  6872. length = object == null ? 0 : object.length;
  6873. return !!length && isLength(length) && isIndex(key, length) &&
  6874. (isArray(object) || isArguments(object));
  6875. }
  6876. /**
  6877. * Initializes an array clone.
  6878. *
  6879. * @private
  6880. * @param {Array} array The array to clone.
  6881. * @returns {Array} Returns the initialized clone.
  6882. */
  6883. function initCloneArray(array) {
  6884. var length = array.length,
  6885. result = new array.constructor(length);
  6886. // Add properties assigned by `RegExp#exec`.
  6887. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6888. result.index = array.index;
  6889. result.input = array.input;
  6890. }
  6891. return result;
  6892. }
  6893. /**
  6894. * Initializes an object clone.
  6895. *
  6896. * @private
  6897. * @param {Object} object The object to clone.
  6898. * @returns {Object} Returns the initialized clone.
  6899. */
  6900. function initCloneObject(object) {
  6901. return (typeof object.constructor == 'function' && !isPrototype(object))
  6902. ? baseCreate(getPrototype(object))
  6903. : {};
  6904. }
  6905. /**
  6906. * Initializes an object clone based on its `toStringTag`.
  6907. *
  6908. * **Note:** This function only supports cloning values with tags of
  6909. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6910. *
  6911. * @private
  6912. * @param {Object} object The object to clone.
  6913. * @param {string} tag The `toStringTag` of the object to clone.
  6914. * @param {boolean} [isDeep] Specify a deep clone.
  6915. * @returns {Object} Returns the initialized clone.
  6916. */
  6917. function initCloneByTag(object, tag, isDeep) {
  6918. var Ctor = object.constructor;
  6919. switch (tag) {
  6920. case arrayBufferTag:
  6921. return cloneArrayBuffer(object);
  6922. case boolTag:
  6923. case dateTag:
  6924. return new Ctor(+object);
  6925. case dataViewTag:
  6926. return cloneDataView(object, isDeep);
  6927. case float32Tag: case float64Tag:
  6928. case int8Tag: case int16Tag: case int32Tag:
  6929. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6930. return cloneTypedArray(object, isDeep);
  6931. case mapTag:
  6932. return new Ctor;
  6933. case numberTag:
  6934. case stringTag:
  6935. return new Ctor(object);
  6936. case regexpTag:
  6937. return cloneRegExp(object);
  6938. case setTag:
  6939. return new Ctor;
  6940. case symbolTag:
  6941. return cloneSymbol(object);
  6942. }
  6943. }
  6944. /**
  6945. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6946. *
  6947. * @private
  6948. * @param {string} source The source to modify.
  6949. * @returns {Array} details The details to insert.
  6950. * @returns {string} Returns the modified source.
  6951. */
  6952. function insertWrapDetails(source, details) {
  6953. var length = details.length;
  6954. if (!length) {
  6955. return source;
  6956. }
  6957. var lastIndex = length - 1;
  6958. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6959. details = details.join(length > 2 ? ', ' : ' ');
  6960. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6961. }
  6962. /**
  6963. * Checks if `value` is a flattenable `arguments` object or array.
  6964. *
  6965. * @private
  6966. * @param {*} value The value to check.
  6967. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6968. */
  6969. function isFlattenable(value) {
  6970. return isArray(value) || isArguments(value) ||
  6971. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6972. }
  6973. /**
  6974. * Checks if `value` is a valid array-like index.
  6975. *
  6976. * @private
  6977. * @param {*} value The value to check.
  6978. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6979. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6980. */
  6981. function isIndex(value, length) {
  6982. var type = typeof value;
  6983. length = length == null ? MAX_SAFE_INTEGER : length;
  6984. return !!length &&
  6985. (type == 'number' ||
  6986. (type != 'symbol' && reIsUint.test(value))) &&
  6987. (value > -1 && value % 1 == 0 && value < length);
  6988. }
  6989. /**
  6990. * Checks if the given arguments are from an iteratee call.
  6991. *
  6992. * @private
  6993. * @param {*} value The potential iteratee value argument.
  6994. * @param {*} index The potential iteratee index or key argument.
  6995. * @param {*} object The potential iteratee object argument.
  6996. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6997. * else `false`.
  6998. */
  6999. function isIterateeCall(value, index, object) {
  7000. if (!isObject(object)) {
  7001. return false;
  7002. }
  7003. var type = typeof index;
  7004. if (type == 'number'
  7005. ? (isArrayLike(object) && isIndex(index, object.length))
  7006. : (type == 'string' && index in object)
  7007. ) {
  7008. return eq(object[index], value);
  7009. }
  7010. return false;
  7011. }
  7012. /**
  7013. * Checks if `value` is a property name and not a property path.
  7014. *
  7015. * @private
  7016. * @param {*} value The value to check.
  7017. * @param {Object} [object] The object to query keys on.
  7018. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7019. */
  7020. function isKey(value, object) {
  7021. if (isArray(value)) {
  7022. return false;
  7023. }
  7024. var type = typeof value;
  7025. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7026. value == null || isSymbol(value)) {
  7027. return true;
  7028. }
  7029. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7030. (object != null && value in Object(object));
  7031. }
  7032. /**
  7033. * Checks if `value` is suitable for use as unique object key.
  7034. *
  7035. * @private
  7036. * @param {*} value The value to check.
  7037. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7038. */
  7039. function isKeyable(value) {
  7040. var type = typeof value;
  7041. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7042. ? (value !== '__proto__')
  7043. : (value === null);
  7044. }
  7045. /**
  7046. * Checks if `func` has a lazy counterpart.
  7047. *
  7048. * @private
  7049. * @param {Function} func The function to check.
  7050. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7051. * else `false`.
  7052. */
  7053. function isLaziable(func) {
  7054. var funcName = getFuncName(func),
  7055. other = lodash[funcName];
  7056. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7057. return false;
  7058. }
  7059. if (func === other) {
  7060. return true;
  7061. }
  7062. var data = getData(other);
  7063. return !!data && func === data[0];
  7064. }
  7065. /**
  7066. * Checks if `func` has its source masked.
  7067. *
  7068. * @private
  7069. * @param {Function} func The function to check.
  7070. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7071. */
  7072. function isMasked(func) {
  7073. return !!maskSrcKey && (maskSrcKey in func);
  7074. }
  7075. /**
  7076. * Checks if `func` is capable of being masked.
  7077. *
  7078. * @private
  7079. * @param {*} value The value to check.
  7080. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7081. */
  7082. var isMaskable = coreJsData ? isFunction : stubFalse;
  7083. /**
  7084. * Checks if `value` is likely a prototype object.
  7085. *
  7086. * @private
  7087. * @param {*} value The value to check.
  7088. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7089. */
  7090. function isPrototype(value) {
  7091. var Ctor = value && value.constructor,
  7092. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7093. return value === proto;
  7094. }
  7095. /**
  7096. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7097. *
  7098. * @private
  7099. * @param {*} value The value to check.
  7100. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7101. * equality comparisons, else `false`.
  7102. */
  7103. function isStrictComparable(value) {
  7104. return value === value && !isObject(value);
  7105. }
  7106. /**
  7107. * A specialized version of `matchesProperty` for source values suitable
  7108. * for strict equality comparisons, i.e. `===`.
  7109. *
  7110. * @private
  7111. * @param {string} key The key of the property to get.
  7112. * @param {*} srcValue The value to match.
  7113. * @returns {Function} Returns the new spec function.
  7114. */
  7115. function matchesStrictComparable(key, srcValue) {
  7116. return function(object) {
  7117. if (object == null) {
  7118. return false;
  7119. }
  7120. return object[key] === srcValue &&
  7121. (srcValue !== undefined || (key in Object(object)));
  7122. };
  7123. }
  7124. /**
  7125. * A specialized version of `_.memoize` which clears the memoized function's
  7126. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7127. *
  7128. * @private
  7129. * @param {Function} func The function to have its output memoized.
  7130. * @returns {Function} Returns the new memoized function.
  7131. */
  7132. function memoizeCapped(func) {
  7133. var result = memoize(func, function(key) {
  7134. if (cache.size === MAX_MEMOIZE_SIZE) {
  7135. cache.clear();
  7136. }
  7137. return key;
  7138. });
  7139. var cache = result.cache;
  7140. return result;
  7141. }
  7142. /**
  7143. * Merges the function metadata of `source` into `data`.
  7144. *
  7145. * Merging metadata reduces the number of wrappers used to invoke a function.
  7146. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7147. * may be applied regardless of execution order. Methods like `_.ary` and
  7148. * `_.rearg` modify function arguments, making the order in which they are
  7149. * executed important, preventing the merging of metadata. However, we make
  7150. * an exception for a safe combined case where curried functions have `_.ary`
  7151. * and or `_.rearg` applied.
  7152. *
  7153. * @private
  7154. * @param {Array} data The destination metadata.
  7155. * @param {Array} source The source metadata.
  7156. * @returns {Array} Returns `data`.
  7157. */
  7158. function mergeData(data, source) {
  7159. var bitmask = data[1],
  7160. srcBitmask = source[1],
  7161. newBitmask = bitmask | srcBitmask,
  7162. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7163. var isCombo =
  7164. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7165. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7166. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7167. // Exit early if metadata can't be merged.
  7168. if (!(isCommon || isCombo)) {
  7169. return data;
  7170. }
  7171. // Use source `thisArg` if available.
  7172. if (srcBitmask & WRAP_BIND_FLAG) {
  7173. data[2] = source[2];
  7174. // Set when currying a bound function.
  7175. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7176. }
  7177. // Compose partial arguments.
  7178. var value = source[3];
  7179. if (value) {
  7180. var partials = data[3];
  7181. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7182. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7183. }
  7184. // Compose partial right arguments.
  7185. value = source[5];
  7186. if (value) {
  7187. partials = data[5];
  7188. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7189. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7190. }
  7191. // Use source `argPos` if available.
  7192. value = source[7];
  7193. if (value) {
  7194. data[7] = value;
  7195. }
  7196. // Use source `ary` if it's smaller.
  7197. if (srcBitmask & WRAP_ARY_FLAG) {
  7198. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7199. }
  7200. // Use source `arity` if one is not provided.
  7201. if (data[9] == null) {
  7202. data[9] = source[9];
  7203. }
  7204. // Use source `func` and merge bitmasks.
  7205. data[0] = source[0];
  7206. data[1] = newBitmask;
  7207. return data;
  7208. }
  7209. /**
  7210. * This function is like
  7211. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7212. * except that it includes inherited enumerable properties.
  7213. *
  7214. * @private
  7215. * @param {Object} object The object to query.
  7216. * @returns {Array} Returns the array of property names.
  7217. */
  7218. function nativeKeysIn(object) {
  7219. var result = [];
  7220. if (object != null) {
  7221. for (var key in Object(object)) {
  7222. result.push(key);
  7223. }
  7224. }
  7225. return result;
  7226. }
  7227. /**
  7228. * Converts `value` to a string using `Object.prototype.toString`.
  7229. *
  7230. * @private
  7231. * @param {*} value The value to convert.
  7232. * @returns {string} Returns the converted string.
  7233. */
  7234. function objectToString(value) {
  7235. return nativeObjectToString.call(value);
  7236. }
  7237. /**
  7238. * A specialized version of `baseRest` which transforms the rest array.
  7239. *
  7240. * @private
  7241. * @param {Function} func The function to apply a rest parameter to.
  7242. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7243. * @param {Function} transform The rest array transform.
  7244. * @returns {Function} Returns the new function.
  7245. */
  7246. function overRest(func, start, transform) {
  7247. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7248. return function() {
  7249. var args = arguments,
  7250. index = -1,
  7251. length = nativeMax(args.length - start, 0),
  7252. array = Array(length);
  7253. while (++index < length) {
  7254. array[index] = args[start + index];
  7255. }
  7256. index = -1;
  7257. var otherArgs = Array(start + 1);
  7258. while (++index < start) {
  7259. otherArgs[index] = args[index];
  7260. }
  7261. otherArgs[start] = transform(array);
  7262. return apply(func, this, otherArgs);
  7263. };
  7264. }
  7265. /**
  7266. * Gets the parent value at `path` of `object`.
  7267. *
  7268. * @private
  7269. * @param {Object} object The object to query.
  7270. * @param {Array} path The path to get the parent value of.
  7271. * @returns {*} Returns the parent value.
  7272. */
  7273. function parent(object, path) {
  7274. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7275. }
  7276. /**
  7277. * Reorder `array` according to the specified indexes where the element at
  7278. * the first index is assigned as the first element, the element at
  7279. * the second index is assigned as the second element, and so on.
  7280. *
  7281. * @private
  7282. * @param {Array} array The array to reorder.
  7283. * @param {Array} indexes The arranged array indexes.
  7284. * @returns {Array} Returns `array`.
  7285. */
  7286. function reorder(array, indexes) {
  7287. var arrLength = array.length,
  7288. length = nativeMin(indexes.length, arrLength),
  7289. oldArray = copyArray(array);
  7290. while (length--) {
  7291. var index = indexes[length];
  7292. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7293. }
  7294. return array;
  7295. }
  7296. /**
  7297. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7298. *
  7299. * @private
  7300. * @param {Object} object The object to query.
  7301. * @param {string} key The key of the property to get.
  7302. * @returns {*} Returns the property value.
  7303. */
  7304. function safeGet(object, key) {
  7305. if (key === 'constructor' && typeof object[key] === 'function') {
  7306. return;
  7307. }
  7308. if (key == '__proto__') {
  7309. return;
  7310. }
  7311. return object[key];
  7312. }
  7313. /**
  7314. * Sets metadata for `func`.
  7315. *
  7316. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7317. * period of time, it will trip its breaker and transition to an identity
  7318. * function to avoid garbage collection pauses in V8. See
  7319. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7320. * for more details.
  7321. *
  7322. * @private
  7323. * @param {Function} func The function to associate metadata with.
  7324. * @param {*} data The metadata.
  7325. * @returns {Function} Returns `func`.
  7326. */
  7327. var setData = shortOut(baseSetData);
  7328. /**
  7329. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7330. *
  7331. * @private
  7332. * @param {Function} func The function to delay.
  7333. * @param {number} wait The number of milliseconds to delay invocation.
  7334. * @returns {number|Object} Returns the timer id or timeout object.
  7335. */
  7336. var setTimeout = ctxSetTimeout || function(func, wait) {
  7337. return root.setTimeout(func, wait);
  7338. };
  7339. /**
  7340. * Sets the `toString` method of `func` to return `string`.
  7341. *
  7342. * @private
  7343. * @param {Function} func The function to modify.
  7344. * @param {Function} string The `toString` result.
  7345. * @returns {Function} Returns `func`.
  7346. */
  7347. var setToString = shortOut(baseSetToString);
  7348. /**
  7349. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7350. * with wrapper details in a comment at the top of the source body.
  7351. *
  7352. * @private
  7353. * @param {Function} wrapper The function to modify.
  7354. * @param {Function} reference The reference function.
  7355. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7356. * @returns {Function} Returns `wrapper`.
  7357. */
  7358. function setWrapToString(wrapper, reference, bitmask) {
  7359. var source = (reference + '');
  7360. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7361. }
  7362. /**
  7363. * Creates a function that'll short out and invoke `identity` instead
  7364. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7365. * milliseconds.
  7366. *
  7367. * @private
  7368. * @param {Function} func The function to restrict.
  7369. * @returns {Function} Returns the new shortable function.
  7370. */
  7371. function shortOut(func) {
  7372. var count = 0,
  7373. lastCalled = 0;
  7374. return function() {
  7375. var stamp = nativeNow(),
  7376. remaining = HOT_SPAN - (stamp - lastCalled);
  7377. lastCalled = stamp;
  7378. if (remaining > 0) {
  7379. if (++count >= HOT_COUNT) {
  7380. return arguments[0];
  7381. }
  7382. } else {
  7383. count = 0;
  7384. }
  7385. return func.apply(undefined, arguments);
  7386. };
  7387. }
  7388. /**
  7389. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7390. *
  7391. * @private
  7392. * @param {Array} array The array to shuffle.
  7393. * @param {number} [size=array.length] The size of `array`.
  7394. * @returns {Array} Returns `array`.
  7395. */
  7396. function shuffleSelf(array, size) {
  7397. var index = -1,
  7398. length = array.length,
  7399. lastIndex = length - 1;
  7400. size = size === undefined ? length : size;
  7401. while (++index < size) {
  7402. var rand = baseRandom(index, lastIndex),
  7403. value = array[rand];
  7404. array[rand] = array[index];
  7405. array[index] = value;
  7406. }
  7407. array.length = size;
  7408. return array;
  7409. }
  7410. /**
  7411. * Converts `string` to a property path array.
  7412. *
  7413. * @private
  7414. * @param {string} string The string to convert.
  7415. * @returns {Array} Returns the property path array.
  7416. */
  7417. var stringToPath = memoizeCapped(function(string) {
  7418. var result = [];
  7419. if (string.charCodeAt(0) === 46 /* . */) {
  7420. result.push('');
  7421. }
  7422. string.replace(rePropName, function(match, number, quote, subString) {
  7423. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7424. });
  7425. return result;
  7426. });
  7427. /**
  7428. * Converts `value` to a string key if it's not a string or symbol.
  7429. *
  7430. * @private
  7431. * @param {*} value The value to inspect.
  7432. * @returns {string|symbol} Returns the key.
  7433. */
  7434. function toKey(value) {
  7435. if (typeof value == 'string' || isSymbol(value)) {
  7436. return value;
  7437. }
  7438. var result = (value + '');
  7439. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7440. }
  7441. /**
  7442. * Converts `func` to its source code.
  7443. *
  7444. * @private
  7445. * @param {Function} func The function to convert.
  7446. * @returns {string} Returns the source code.
  7447. */
  7448. function toSource(func) {
  7449. if (func != null) {
  7450. try {
  7451. return funcToString.call(func);
  7452. } catch (e) {}
  7453. try {
  7454. return (func + '');
  7455. } catch (e) {}
  7456. }
  7457. return '';
  7458. }
  7459. /**
  7460. * Updates wrapper `details` based on `bitmask` flags.
  7461. *
  7462. * @private
  7463. * @returns {Array} details The details to modify.
  7464. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7465. * @returns {Array} Returns `details`.
  7466. */
  7467. function updateWrapDetails(details, bitmask) {
  7468. arrayEach(wrapFlags, function(pair) {
  7469. var value = '_.' + pair[0];
  7470. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7471. details.push(value);
  7472. }
  7473. });
  7474. return details.sort();
  7475. }
  7476. /**
  7477. * Creates a clone of `wrapper`.
  7478. *
  7479. * @private
  7480. * @param {Object} wrapper The wrapper to clone.
  7481. * @returns {Object} Returns the cloned wrapper.
  7482. */
  7483. function wrapperClone(wrapper) {
  7484. if (wrapper instanceof LazyWrapper) {
  7485. return wrapper.clone();
  7486. }
  7487. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7488. result.__actions__ = copyArray(wrapper.__actions__);
  7489. result.__index__ = wrapper.__index__;
  7490. result.__values__ = wrapper.__values__;
  7491. return result;
  7492. }
  7493. /*------------------------------------------------------------------------*/
  7494. /**
  7495. * Creates an array of elements split into groups the length of `size`.
  7496. * If `array` can't be split evenly, the final chunk will be the remaining
  7497. * elements.
  7498. *
  7499. * @static
  7500. * @memberOf _
  7501. * @since 3.0.0
  7502. * @category Array
  7503. * @param {Array} array The array to process.
  7504. * @param {number} [size=1] The length of each chunk
  7505. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7506. * @returns {Array} Returns the new array of chunks.
  7507. * @example
  7508. *
  7509. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7510. * // => [['a', 'b'], ['c', 'd']]
  7511. *
  7512. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7513. * // => [['a', 'b', 'c'], ['d']]
  7514. */
  7515. function chunk(array, size, guard) {
  7516. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7517. size = 1;
  7518. } else {
  7519. size = nativeMax(toInteger(size), 0);
  7520. }
  7521. var length = array == null ? 0 : array.length;
  7522. if (!length || size < 1) {
  7523. return [];
  7524. }
  7525. var index = 0,
  7526. resIndex = 0,
  7527. result = Array(nativeCeil(length / size));
  7528. while (index < length) {
  7529. result[resIndex++] = baseSlice(array, index, (index += size));
  7530. }
  7531. return result;
  7532. }
  7533. /**
  7534. * Creates an array with all falsey values removed. The values `false`, `null`,
  7535. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7536. *
  7537. * @static
  7538. * @memberOf _
  7539. * @since 0.1.0
  7540. * @category Array
  7541. * @param {Array} array The array to compact.
  7542. * @returns {Array} Returns the new array of filtered values.
  7543. * @example
  7544. *
  7545. * _.compact([0, 1, false, 2, '', 3]);
  7546. * // => [1, 2, 3]
  7547. */
  7548. function compact(array) {
  7549. var index = -1,
  7550. length = array == null ? 0 : array.length,
  7551. resIndex = 0,
  7552. result = [];
  7553. while (++index < length) {
  7554. var value = array[index];
  7555. if (value) {
  7556. result[resIndex++] = value;
  7557. }
  7558. }
  7559. return result;
  7560. }
  7561. /**
  7562. * Creates a new array concatenating `array` with any additional arrays
  7563. * and/or values.
  7564. *
  7565. * @static
  7566. * @memberOf _
  7567. * @since 4.0.0
  7568. * @category Array
  7569. * @param {Array} array The array to concatenate.
  7570. * @param {...*} [values] The values to concatenate.
  7571. * @returns {Array} Returns the new concatenated array.
  7572. * @example
  7573. *
  7574. * var array = [1];
  7575. * var other = _.concat(array, 2, [3], [[4]]);
  7576. *
  7577. * console.log(other);
  7578. * // => [1, 2, 3, [4]]
  7579. *
  7580. * console.log(array);
  7581. * // => [1]
  7582. */
  7583. function concat() {
  7584. var length = arguments.length;
  7585. if (!length) {
  7586. return [];
  7587. }
  7588. var args = Array(length - 1),
  7589. array = arguments[0],
  7590. index = length;
  7591. while (index--) {
  7592. args[index - 1] = arguments[index];
  7593. }
  7594. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7595. }
  7596. /**
  7597. * Creates an array of `array` values not included in the other given arrays
  7598. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7599. * for equality comparisons. The order and references of result values are
  7600. * determined by the first array.
  7601. *
  7602. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7603. *
  7604. * @static
  7605. * @memberOf _
  7606. * @since 0.1.0
  7607. * @category Array
  7608. * @param {Array} array The array to inspect.
  7609. * @param {...Array} [values] The values to exclude.
  7610. * @returns {Array} Returns the new array of filtered values.
  7611. * @see _.without, _.xor
  7612. * @example
  7613. *
  7614. * _.difference([2, 1], [2, 3]);
  7615. * // => [1]
  7616. */
  7617. var difference = baseRest(function(array, values) {
  7618. return isArrayLikeObject(array)
  7619. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7620. : [];
  7621. });
  7622. /**
  7623. * This method is like `_.difference` except that it accepts `iteratee` which
  7624. * is invoked for each element of `array` and `values` to generate the criterion
  7625. * by which they're compared. The order and references of result values are
  7626. * determined by the first array. The iteratee is invoked with one argument:
  7627. * (value).
  7628. *
  7629. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7630. *
  7631. * @static
  7632. * @memberOf _
  7633. * @since 4.0.0
  7634. * @category Array
  7635. * @param {Array} array The array to inspect.
  7636. * @param {...Array} [values] The values to exclude.
  7637. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7638. * @returns {Array} Returns the new array of filtered values.
  7639. * @example
  7640. *
  7641. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7642. * // => [1.2]
  7643. *
  7644. * // The `_.property` iteratee shorthand.
  7645. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7646. * // => [{ 'x': 2 }]
  7647. */
  7648. var differenceBy = baseRest(function(array, values) {
  7649. var iteratee = last(values);
  7650. if (isArrayLikeObject(iteratee)) {
  7651. iteratee = undefined;
  7652. }
  7653. return isArrayLikeObject(array)
  7654. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7655. : [];
  7656. });
  7657. /**
  7658. * This method is like `_.difference` except that it accepts `comparator`
  7659. * which is invoked to compare elements of `array` to `values`. The order and
  7660. * references of result values are determined by the first array. The comparator
  7661. * is invoked with two arguments: (arrVal, othVal).
  7662. *
  7663. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7664. *
  7665. * @static
  7666. * @memberOf _
  7667. * @since 4.0.0
  7668. * @category Array
  7669. * @param {Array} array The array to inspect.
  7670. * @param {...Array} [values] The values to exclude.
  7671. * @param {Function} [comparator] The comparator invoked per element.
  7672. * @returns {Array} Returns the new array of filtered values.
  7673. * @example
  7674. *
  7675. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7676. *
  7677. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7678. * // => [{ 'x': 2, 'y': 1 }]
  7679. */
  7680. var differenceWith = baseRest(function(array, values) {
  7681. var comparator = last(values);
  7682. if (isArrayLikeObject(comparator)) {
  7683. comparator = undefined;
  7684. }
  7685. return isArrayLikeObject(array)
  7686. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7687. : [];
  7688. });
  7689. /**
  7690. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7691. *
  7692. * @static
  7693. * @memberOf _
  7694. * @since 0.5.0
  7695. * @category Array
  7696. * @param {Array} array The array to query.
  7697. * @param {number} [n=1] The number of elements to drop.
  7698. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7699. * @returns {Array} Returns the slice of `array`.
  7700. * @example
  7701. *
  7702. * _.drop([1, 2, 3]);
  7703. * // => [2, 3]
  7704. *
  7705. * _.drop([1, 2, 3], 2);
  7706. * // => [3]
  7707. *
  7708. * _.drop([1, 2, 3], 5);
  7709. * // => []
  7710. *
  7711. * _.drop([1, 2, 3], 0);
  7712. * // => [1, 2, 3]
  7713. */
  7714. function drop(array, n, guard) {
  7715. var length = array == null ? 0 : array.length;
  7716. if (!length) {
  7717. return [];
  7718. }
  7719. n = (guard || n === undefined) ? 1 : toInteger(n);
  7720. return baseSlice(array, n < 0 ? 0 : n, length);
  7721. }
  7722. /**
  7723. * Creates a slice of `array` with `n` elements dropped from the end.
  7724. *
  7725. * @static
  7726. * @memberOf _
  7727. * @since 3.0.0
  7728. * @category Array
  7729. * @param {Array} array The array to query.
  7730. * @param {number} [n=1] The number of elements to drop.
  7731. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7732. * @returns {Array} Returns the slice of `array`.
  7733. * @example
  7734. *
  7735. * _.dropRight([1, 2, 3]);
  7736. * // => [1, 2]
  7737. *
  7738. * _.dropRight([1, 2, 3], 2);
  7739. * // => [1]
  7740. *
  7741. * _.dropRight([1, 2, 3], 5);
  7742. * // => []
  7743. *
  7744. * _.dropRight([1, 2, 3], 0);
  7745. * // => [1, 2, 3]
  7746. */
  7747. function dropRight(array, n, guard) {
  7748. var length = array == null ? 0 : array.length;
  7749. if (!length) {
  7750. return [];
  7751. }
  7752. n = (guard || n === undefined) ? 1 : toInteger(n);
  7753. n = length - n;
  7754. return baseSlice(array, 0, n < 0 ? 0 : n);
  7755. }
  7756. /**
  7757. * Creates a slice of `array` excluding elements dropped from the end.
  7758. * Elements are dropped until `predicate` returns falsey. The predicate is
  7759. * invoked with three arguments: (value, index, array).
  7760. *
  7761. * @static
  7762. * @memberOf _
  7763. * @since 3.0.0
  7764. * @category Array
  7765. * @param {Array} array The array to query.
  7766. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7767. * @returns {Array} Returns the slice of `array`.
  7768. * @example
  7769. *
  7770. * var users = [
  7771. * { 'user': 'barney', 'active': true },
  7772. * { 'user': 'fred', 'active': false },
  7773. * { 'user': 'pebbles', 'active': false }
  7774. * ];
  7775. *
  7776. * _.dropRightWhile(users, function(o) { return !o.active; });
  7777. * // => objects for ['barney']
  7778. *
  7779. * // The `_.matches` iteratee shorthand.
  7780. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7781. * // => objects for ['barney', 'fred']
  7782. *
  7783. * // The `_.matchesProperty` iteratee shorthand.
  7784. * _.dropRightWhile(users, ['active', false]);
  7785. * // => objects for ['barney']
  7786. *
  7787. * // The `_.property` iteratee shorthand.
  7788. * _.dropRightWhile(users, 'active');
  7789. * // => objects for ['barney', 'fred', 'pebbles']
  7790. */
  7791. function dropRightWhile(array, predicate) {
  7792. return (array && array.length)
  7793. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7794. : [];
  7795. }
  7796. /**
  7797. * Creates a slice of `array` excluding elements dropped from the beginning.
  7798. * Elements are dropped until `predicate` returns falsey. The predicate is
  7799. * invoked with three arguments: (value, index, array).
  7800. *
  7801. * @static
  7802. * @memberOf _
  7803. * @since 3.0.0
  7804. * @category Array
  7805. * @param {Array} array The array to query.
  7806. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7807. * @returns {Array} Returns the slice of `array`.
  7808. * @example
  7809. *
  7810. * var users = [
  7811. * { 'user': 'barney', 'active': false },
  7812. * { 'user': 'fred', 'active': false },
  7813. * { 'user': 'pebbles', 'active': true }
  7814. * ];
  7815. *
  7816. * _.dropWhile(users, function(o) { return !o.active; });
  7817. * // => objects for ['pebbles']
  7818. *
  7819. * // The `_.matches` iteratee shorthand.
  7820. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7821. * // => objects for ['fred', 'pebbles']
  7822. *
  7823. * // The `_.matchesProperty` iteratee shorthand.
  7824. * _.dropWhile(users, ['active', false]);
  7825. * // => objects for ['pebbles']
  7826. *
  7827. * // The `_.property` iteratee shorthand.
  7828. * _.dropWhile(users, 'active');
  7829. * // => objects for ['barney', 'fred', 'pebbles']
  7830. */
  7831. function dropWhile(array, predicate) {
  7832. return (array && array.length)
  7833. ? baseWhile(array, getIteratee(predicate, 3), true)
  7834. : [];
  7835. }
  7836. /**
  7837. * Fills elements of `array` with `value` from `start` up to, but not
  7838. * including, `end`.
  7839. *
  7840. * **Note:** This method mutates `array`.
  7841. *
  7842. * @static
  7843. * @memberOf _
  7844. * @since 3.2.0
  7845. * @category Array
  7846. * @param {Array} array The array to fill.
  7847. * @param {*} value The value to fill `array` with.
  7848. * @param {number} [start=0] The start position.
  7849. * @param {number} [end=array.length] The end position.
  7850. * @returns {Array} Returns `array`.
  7851. * @example
  7852. *
  7853. * var array = [1, 2, 3];
  7854. *
  7855. * _.fill(array, 'a');
  7856. * console.log(array);
  7857. * // => ['a', 'a', 'a']
  7858. *
  7859. * _.fill(Array(3), 2);
  7860. * // => [2, 2, 2]
  7861. *
  7862. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7863. * // => [4, '*', '*', 10]
  7864. */
  7865. function fill(array, value, start, end) {
  7866. var length = array == null ? 0 : array.length;
  7867. if (!length) {
  7868. return [];
  7869. }
  7870. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7871. start = 0;
  7872. end = length;
  7873. }
  7874. return baseFill(array, value, start, end);
  7875. }
  7876. /**
  7877. * This method is like `_.find` except that it returns the index of the first
  7878. * element `predicate` returns truthy for instead of the element itself.
  7879. *
  7880. * @static
  7881. * @memberOf _
  7882. * @since 1.1.0
  7883. * @category Array
  7884. * @param {Array} array The array to inspect.
  7885. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7886. * @param {number} [fromIndex=0] The index to search from.
  7887. * @returns {number} Returns the index of the found element, else `-1`.
  7888. * @example
  7889. *
  7890. * var users = [
  7891. * { 'user': 'barney', 'active': false },
  7892. * { 'user': 'fred', 'active': false },
  7893. * { 'user': 'pebbles', 'active': true }
  7894. * ];
  7895. *
  7896. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7897. * // => 0
  7898. *
  7899. * // The `_.matches` iteratee shorthand.
  7900. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7901. * // => 1
  7902. *
  7903. * // The `_.matchesProperty` iteratee shorthand.
  7904. * _.findIndex(users, ['active', false]);
  7905. * // => 0
  7906. *
  7907. * // The `_.property` iteratee shorthand.
  7908. * _.findIndex(users, 'active');
  7909. * // => 2
  7910. */
  7911. function findIndex(array, predicate, fromIndex) {
  7912. var length = array == null ? 0 : array.length;
  7913. if (!length) {
  7914. return -1;
  7915. }
  7916. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7917. if (index < 0) {
  7918. index = nativeMax(length + index, 0);
  7919. }
  7920. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7921. }
  7922. /**
  7923. * This method is like `_.findIndex` except that it iterates over elements
  7924. * of `collection` from right to left.
  7925. *
  7926. * @static
  7927. * @memberOf _
  7928. * @since 2.0.0
  7929. * @category Array
  7930. * @param {Array} array The array to inspect.
  7931. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7932. * @param {number} [fromIndex=array.length-1] The index to search from.
  7933. * @returns {number} Returns the index of the found element, else `-1`.
  7934. * @example
  7935. *
  7936. * var users = [
  7937. * { 'user': 'barney', 'active': true },
  7938. * { 'user': 'fred', 'active': false },
  7939. * { 'user': 'pebbles', 'active': false }
  7940. * ];
  7941. *
  7942. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7943. * // => 2
  7944. *
  7945. * // The `_.matches` iteratee shorthand.
  7946. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7947. * // => 0
  7948. *
  7949. * // The `_.matchesProperty` iteratee shorthand.
  7950. * _.findLastIndex(users, ['active', false]);
  7951. * // => 2
  7952. *
  7953. * // The `_.property` iteratee shorthand.
  7954. * _.findLastIndex(users, 'active');
  7955. * // => 0
  7956. */
  7957. function findLastIndex(array, predicate, fromIndex) {
  7958. var length = array == null ? 0 : array.length;
  7959. if (!length) {
  7960. return -1;
  7961. }
  7962. var index = length - 1;
  7963. if (fromIndex !== undefined) {
  7964. index = toInteger(fromIndex);
  7965. index = fromIndex < 0
  7966. ? nativeMax(length + index, 0)
  7967. : nativeMin(index, length - 1);
  7968. }
  7969. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7970. }
  7971. /**
  7972. * Flattens `array` a single level deep.
  7973. *
  7974. * @static
  7975. * @memberOf _
  7976. * @since 0.1.0
  7977. * @category Array
  7978. * @param {Array} array The array to flatten.
  7979. * @returns {Array} Returns the new flattened array.
  7980. * @example
  7981. *
  7982. * _.flatten([1, [2, [3, [4]], 5]]);
  7983. * // => [1, 2, [3, [4]], 5]
  7984. */
  7985. function flatten(array) {
  7986. var length = array == null ? 0 : array.length;
  7987. return length ? baseFlatten(array, 1) : [];
  7988. }
  7989. /**
  7990. * Recursively flattens `array`.
  7991. *
  7992. * @static
  7993. * @memberOf _
  7994. * @since 3.0.0
  7995. * @category Array
  7996. * @param {Array} array The array to flatten.
  7997. * @returns {Array} Returns the new flattened array.
  7998. * @example
  7999. *
  8000. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8001. * // => [1, 2, 3, 4, 5]
  8002. */
  8003. function flattenDeep(array) {
  8004. var length = array == null ? 0 : array.length;
  8005. return length ? baseFlatten(array, INFINITY) : [];
  8006. }
  8007. /**
  8008. * Recursively flatten `array` up to `depth` times.
  8009. *
  8010. * @static
  8011. * @memberOf _
  8012. * @since 4.4.0
  8013. * @category Array
  8014. * @param {Array} array The array to flatten.
  8015. * @param {number} [depth=1] The maximum recursion depth.
  8016. * @returns {Array} Returns the new flattened array.
  8017. * @example
  8018. *
  8019. * var array = [1, [2, [3, [4]], 5]];
  8020. *
  8021. * _.flattenDepth(array, 1);
  8022. * // => [1, 2, [3, [4]], 5]
  8023. *
  8024. * _.flattenDepth(array, 2);
  8025. * // => [1, 2, 3, [4], 5]
  8026. */
  8027. function flattenDepth(array, depth) {
  8028. var length = array == null ? 0 : array.length;
  8029. if (!length) {
  8030. return [];
  8031. }
  8032. depth = depth === undefined ? 1 : toInteger(depth);
  8033. return baseFlatten(array, depth);
  8034. }
  8035. /**
  8036. * The inverse of `_.toPairs`; this method returns an object composed
  8037. * from key-value `pairs`.
  8038. *
  8039. * @static
  8040. * @memberOf _
  8041. * @since 4.0.0
  8042. * @category Array
  8043. * @param {Array} pairs The key-value pairs.
  8044. * @returns {Object} Returns the new object.
  8045. * @example
  8046. *
  8047. * _.fromPairs([['a', 1], ['b', 2]]);
  8048. * // => { 'a': 1, 'b': 2 }
  8049. */
  8050. function fromPairs(pairs) {
  8051. var index = -1,
  8052. length = pairs == null ? 0 : pairs.length,
  8053. result = {};
  8054. while (++index < length) {
  8055. var pair = pairs[index];
  8056. result[pair[0]] = pair[1];
  8057. }
  8058. return result;
  8059. }
  8060. /**
  8061. * Gets the first element of `array`.
  8062. *
  8063. * @static
  8064. * @memberOf _
  8065. * @since 0.1.0
  8066. * @alias first
  8067. * @category Array
  8068. * @param {Array} array The array to query.
  8069. * @returns {*} Returns the first element of `array`.
  8070. * @example
  8071. *
  8072. * _.head([1, 2, 3]);
  8073. * // => 1
  8074. *
  8075. * _.head([]);
  8076. * // => undefined
  8077. */
  8078. function head(array) {
  8079. return (array && array.length) ? array[0] : undefined;
  8080. }
  8081. /**
  8082. * Gets the index at which the first occurrence of `value` is found in `array`
  8083. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8084. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8085. * offset from the end of `array`.
  8086. *
  8087. * @static
  8088. * @memberOf _
  8089. * @since 0.1.0
  8090. * @category Array
  8091. * @param {Array} array The array to inspect.
  8092. * @param {*} value The value to search for.
  8093. * @param {number} [fromIndex=0] The index to search from.
  8094. * @returns {number} Returns the index of the matched value, else `-1`.
  8095. * @example
  8096. *
  8097. * _.indexOf([1, 2, 1, 2], 2);
  8098. * // => 1
  8099. *
  8100. * // Search from the `fromIndex`.
  8101. * _.indexOf([1, 2, 1, 2], 2, 2);
  8102. * // => 3
  8103. */
  8104. function indexOf(array, value, fromIndex) {
  8105. var length = array == null ? 0 : array.length;
  8106. if (!length) {
  8107. return -1;
  8108. }
  8109. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8110. if (index < 0) {
  8111. index = nativeMax(length + index, 0);
  8112. }
  8113. return baseIndexOf(array, value, index);
  8114. }
  8115. /**
  8116. * Gets all but the last element of `array`.
  8117. *
  8118. * @static
  8119. * @memberOf _
  8120. * @since 0.1.0
  8121. * @category Array
  8122. * @param {Array} array The array to query.
  8123. * @returns {Array} Returns the slice of `array`.
  8124. * @example
  8125. *
  8126. * _.initial([1, 2, 3]);
  8127. * // => [1, 2]
  8128. */
  8129. function initial(array) {
  8130. var length = array == null ? 0 : array.length;
  8131. return length ? baseSlice(array, 0, -1) : [];
  8132. }
  8133. /**
  8134. * Creates an array of unique values that are included in all given arrays
  8135. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8136. * for equality comparisons. The order and references of result values are
  8137. * determined by the first array.
  8138. *
  8139. * @static
  8140. * @memberOf _
  8141. * @since 0.1.0
  8142. * @category Array
  8143. * @param {...Array} [arrays] The arrays to inspect.
  8144. * @returns {Array} Returns the new array of intersecting values.
  8145. * @example
  8146. *
  8147. * _.intersection([2, 1], [2, 3]);
  8148. * // => [2]
  8149. */
  8150. var intersection = baseRest(function(arrays) {
  8151. var mapped = arrayMap(arrays, castArrayLikeObject);
  8152. return (mapped.length && mapped[0] === arrays[0])
  8153. ? baseIntersection(mapped)
  8154. : [];
  8155. });
  8156. /**
  8157. * This method is like `_.intersection` except that it accepts `iteratee`
  8158. * which is invoked for each element of each `arrays` to generate the criterion
  8159. * by which they're compared. The order and references of result values are
  8160. * determined by the first array. The iteratee is invoked with one argument:
  8161. * (value).
  8162. *
  8163. * @static
  8164. * @memberOf _
  8165. * @since 4.0.0
  8166. * @category Array
  8167. * @param {...Array} [arrays] The arrays to inspect.
  8168. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8169. * @returns {Array} Returns the new array of intersecting values.
  8170. * @example
  8171. *
  8172. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8173. * // => [2.1]
  8174. *
  8175. * // The `_.property` iteratee shorthand.
  8176. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8177. * // => [{ 'x': 1 }]
  8178. */
  8179. var intersectionBy = baseRest(function(arrays) {
  8180. var iteratee = last(arrays),
  8181. mapped = arrayMap(arrays, castArrayLikeObject);
  8182. if (iteratee === last(mapped)) {
  8183. iteratee = undefined;
  8184. } else {
  8185. mapped.pop();
  8186. }
  8187. return (mapped.length && mapped[0] === arrays[0])
  8188. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8189. : [];
  8190. });
  8191. /**
  8192. * This method is like `_.intersection` except that it accepts `comparator`
  8193. * which is invoked to compare elements of `arrays`. The order and references
  8194. * of result values are determined by the first array. The comparator is
  8195. * invoked with two arguments: (arrVal, othVal).
  8196. *
  8197. * @static
  8198. * @memberOf _
  8199. * @since 4.0.0
  8200. * @category Array
  8201. * @param {...Array} [arrays] The arrays to inspect.
  8202. * @param {Function} [comparator] The comparator invoked per element.
  8203. * @returns {Array} Returns the new array of intersecting values.
  8204. * @example
  8205. *
  8206. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8207. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8208. *
  8209. * _.intersectionWith(objects, others, _.isEqual);
  8210. * // => [{ 'x': 1, 'y': 2 }]
  8211. */
  8212. var intersectionWith = baseRest(function(arrays) {
  8213. var comparator = last(arrays),
  8214. mapped = arrayMap(arrays, castArrayLikeObject);
  8215. comparator = typeof comparator == 'function' ? comparator : undefined;
  8216. if (comparator) {
  8217. mapped.pop();
  8218. }
  8219. return (mapped.length && mapped[0] === arrays[0])
  8220. ? baseIntersection(mapped, undefined, comparator)
  8221. : [];
  8222. });
  8223. /**
  8224. * Converts all elements in `array` into a string separated by `separator`.
  8225. *
  8226. * @static
  8227. * @memberOf _
  8228. * @since 4.0.0
  8229. * @category Array
  8230. * @param {Array} array The array to convert.
  8231. * @param {string} [separator=','] The element separator.
  8232. * @returns {string} Returns the joined string.
  8233. * @example
  8234. *
  8235. * _.join(['a', 'b', 'c'], '~');
  8236. * // => 'a~b~c'
  8237. */
  8238. function join(array, separator) {
  8239. return array == null ? '' : nativeJoin.call(array, separator);
  8240. }
  8241. /**
  8242. * Gets the last element of `array`.
  8243. *
  8244. * @static
  8245. * @memberOf _
  8246. * @since 0.1.0
  8247. * @category Array
  8248. * @param {Array} array The array to query.
  8249. * @returns {*} Returns the last element of `array`.
  8250. * @example
  8251. *
  8252. * _.last([1, 2, 3]);
  8253. * // => 3
  8254. */
  8255. function last(array) {
  8256. var length = array == null ? 0 : array.length;
  8257. return length ? array[length - 1] : undefined;
  8258. }
  8259. /**
  8260. * This method is like `_.indexOf` except that it iterates over elements of
  8261. * `array` from right to left.
  8262. *
  8263. * @static
  8264. * @memberOf _
  8265. * @since 0.1.0
  8266. * @category Array
  8267. * @param {Array} array The array to inspect.
  8268. * @param {*} value The value to search for.
  8269. * @param {number} [fromIndex=array.length-1] The index to search from.
  8270. * @returns {number} Returns the index of the matched value, else `-1`.
  8271. * @example
  8272. *
  8273. * _.lastIndexOf([1, 2, 1, 2], 2);
  8274. * // => 3
  8275. *
  8276. * // Search from the `fromIndex`.
  8277. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8278. * // => 1
  8279. */
  8280. function lastIndexOf(array, value, fromIndex) {
  8281. var length = array == null ? 0 : array.length;
  8282. if (!length) {
  8283. return -1;
  8284. }
  8285. var index = length;
  8286. if (fromIndex !== undefined) {
  8287. index = toInteger(fromIndex);
  8288. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8289. }
  8290. return value === value
  8291. ? strictLastIndexOf(array, value, index)
  8292. : baseFindIndex(array, baseIsNaN, index, true);
  8293. }
  8294. /**
  8295. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8296. * element from the end is returned.
  8297. *
  8298. * @static
  8299. * @memberOf _
  8300. * @since 4.11.0
  8301. * @category Array
  8302. * @param {Array} array The array to query.
  8303. * @param {number} [n=0] The index of the element to return.
  8304. * @returns {*} Returns the nth element of `array`.
  8305. * @example
  8306. *
  8307. * var array = ['a', 'b', 'c', 'd'];
  8308. *
  8309. * _.nth(array, 1);
  8310. * // => 'b'
  8311. *
  8312. * _.nth(array, -2);
  8313. * // => 'c';
  8314. */
  8315. function nth(array, n) {
  8316. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8317. }
  8318. /**
  8319. * Removes all given values from `array` using
  8320. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8321. * for equality comparisons.
  8322. *
  8323. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8324. * to remove elements from an array by predicate.
  8325. *
  8326. * @static
  8327. * @memberOf _
  8328. * @since 2.0.0
  8329. * @category Array
  8330. * @param {Array} array The array to modify.
  8331. * @param {...*} [values] The values to remove.
  8332. * @returns {Array} Returns `array`.
  8333. * @example
  8334. *
  8335. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8336. *
  8337. * _.pull(array, 'a', 'c');
  8338. * console.log(array);
  8339. * // => ['b', 'b']
  8340. */
  8341. var pull = baseRest(pullAll);
  8342. /**
  8343. * This method is like `_.pull` except that it accepts an array of values to remove.
  8344. *
  8345. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8346. *
  8347. * @static
  8348. * @memberOf _
  8349. * @since 4.0.0
  8350. * @category Array
  8351. * @param {Array} array The array to modify.
  8352. * @param {Array} values The values to remove.
  8353. * @returns {Array} Returns `array`.
  8354. * @example
  8355. *
  8356. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8357. *
  8358. * _.pullAll(array, ['a', 'c']);
  8359. * console.log(array);
  8360. * // => ['b', 'b']
  8361. */
  8362. function pullAll(array, values) {
  8363. return (array && array.length && values && values.length)
  8364. ? basePullAll(array, values)
  8365. : array;
  8366. }
  8367. /**
  8368. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8369. * invoked for each element of `array` and `values` to generate the criterion
  8370. * by which they're compared. The iteratee is invoked with one argument: (value).
  8371. *
  8372. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8373. *
  8374. * @static
  8375. * @memberOf _
  8376. * @since 4.0.0
  8377. * @category Array
  8378. * @param {Array} array The array to modify.
  8379. * @param {Array} values The values to remove.
  8380. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8381. * @returns {Array} Returns `array`.
  8382. * @example
  8383. *
  8384. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8385. *
  8386. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8387. * console.log(array);
  8388. * // => [{ 'x': 2 }]
  8389. */
  8390. function pullAllBy(array, values, iteratee) {
  8391. return (array && array.length && values && values.length)
  8392. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8393. : array;
  8394. }
  8395. /**
  8396. * This method is like `_.pullAll` except that it accepts `comparator` which
  8397. * is invoked to compare elements of `array` to `values`. The comparator is
  8398. * invoked with two arguments: (arrVal, othVal).
  8399. *
  8400. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8401. *
  8402. * @static
  8403. * @memberOf _
  8404. * @since 4.6.0
  8405. * @category Array
  8406. * @param {Array} array The array to modify.
  8407. * @param {Array} values The values to remove.
  8408. * @param {Function} [comparator] The comparator invoked per element.
  8409. * @returns {Array} Returns `array`.
  8410. * @example
  8411. *
  8412. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8413. *
  8414. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8415. * console.log(array);
  8416. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8417. */
  8418. function pullAllWith(array, values, comparator) {
  8419. return (array && array.length && values && values.length)
  8420. ? basePullAll(array, values, undefined, comparator)
  8421. : array;
  8422. }
  8423. /**
  8424. * Removes elements from `array` corresponding to `indexes` and returns an
  8425. * array of removed elements.
  8426. *
  8427. * **Note:** Unlike `_.at`, this method mutates `array`.
  8428. *
  8429. * @static
  8430. * @memberOf _
  8431. * @since 3.0.0
  8432. * @category Array
  8433. * @param {Array} array The array to modify.
  8434. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8435. * @returns {Array} Returns the new array of removed elements.
  8436. * @example
  8437. *
  8438. * var array = ['a', 'b', 'c', 'd'];
  8439. * var pulled = _.pullAt(array, [1, 3]);
  8440. *
  8441. * console.log(array);
  8442. * // => ['a', 'c']
  8443. *
  8444. * console.log(pulled);
  8445. * // => ['b', 'd']
  8446. */
  8447. var pullAt = flatRest(function(array, indexes) {
  8448. var length = array == null ? 0 : array.length,
  8449. result = baseAt(array, indexes);
  8450. basePullAt(array, arrayMap(indexes, function(index) {
  8451. return isIndex(index, length) ? +index : index;
  8452. }).sort(compareAscending));
  8453. return result;
  8454. });
  8455. /**
  8456. * Removes all elements from `array` that `predicate` returns truthy for
  8457. * and returns an array of the removed elements. The predicate is invoked
  8458. * with three arguments: (value, index, array).
  8459. *
  8460. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8461. * to pull elements from an array by value.
  8462. *
  8463. * @static
  8464. * @memberOf _
  8465. * @since 2.0.0
  8466. * @category Array
  8467. * @param {Array} array The array to modify.
  8468. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8469. * @returns {Array} Returns the new array of removed elements.
  8470. * @example
  8471. *
  8472. * var array = [1, 2, 3, 4];
  8473. * var evens = _.remove(array, function(n) {
  8474. * return n % 2 == 0;
  8475. * });
  8476. *
  8477. * console.log(array);
  8478. * // => [1, 3]
  8479. *
  8480. * console.log(evens);
  8481. * // => [2, 4]
  8482. */
  8483. function remove(array, predicate) {
  8484. var result = [];
  8485. if (!(array && array.length)) {
  8486. return result;
  8487. }
  8488. var index = -1,
  8489. indexes = [],
  8490. length = array.length;
  8491. predicate = getIteratee(predicate, 3);
  8492. while (++index < length) {
  8493. var value = array[index];
  8494. if (predicate(value, index, array)) {
  8495. result.push(value);
  8496. indexes.push(index);
  8497. }
  8498. }
  8499. basePullAt(array, indexes);
  8500. return result;
  8501. }
  8502. /**
  8503. * Reverses `array` so that the first element becomes the last, the second
  8504. * element becomes the second to last, and so on.
  8505. *
  8506. * **Note:** This method mutates `array` and is based on
  8507. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8508. *
  8509. * @static
  8510. * @memberOf _
  8511. * @since 4.0.0
  8512. * @category Array
  8513. * @param {Array} array The array to modify.
  8514. * @returns {Array} Returns `array`.
  8515. * @example
  8516. *
  8517. * var array = [1, 2, 3];
  8518. *
  8519. * _.reverse(array);
  8520. * // => [3, 2, 1]
  8521. *
  8522. * console.log(array);
  8523. * // => [3, 2, 1]
  8524. */
  8525. function reverse(array) {
  8526. return array == null ? array : nativeReverse.call(array);
  8527. }
  8528. /**
  8529. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8530. *
  8531. * **Note:** This method is used instead of
  8532. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8533. * returned.
  8534. *
  8535. * @static
  8536. * @memberOf _
  8537. * @since 3.0.0
  8538. * @category Array
  8539. * @param {Array} array The array to slice.
  8540. * @param {number} [start=0] The start position.
  8541. * @param {number} [end=array.length] The end position.
  8542. * @returns {Array} Returns the slice of `array`.
  8543. */
  8544. function slice(array, start, end) {
  8545. var length = array == null ? 0 : array.length;
  8546. if (!length) {
  8547. return [];
  8548. }
  8549. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8550. start = 0;
  8551. end = length;
  8552. }
  8553. else {
  8554. start = start == null ? 0 : toInteger(start);
  8555. end = end === undefined ? length : toInteger(end);
  8556. }
  8557. return baseSlice(array, start, end);
  8558. }
  8559. /**
  8560. * Uses a binary search to determine the lowest index at which `value`
  8561. * should be inserted into `array` in order to maintain its sort order.
  8562. *
  8563. * @static
  8564. * @memberOf _
  8565. * @since 0.1.0
  8566. * @category Array
  8567. * @param {Array} array The sorted array to inspect.
  8568. * @param {*} value The value to evaluate.
  8569. * @returns {number} Returns the index at which `value` should be inserted
  8570. * into `array`.
  8571. * @example
  8572. *
  8573. * _.sortedIndex([30, 50], 40);
  8574. * // => 1
  8575. */
  8576. function sortedIndex(array, value) {
  8577. return baseSortedIndex(array, value);
  8578. }
  8579. /**
  8580. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8581. * which is invoked for `value` and each element of `array` to compute their
  8582. * sort ranking. The iteratee is invoked with one argument: (value).
  8583. *
  8584. * @static
  8585. * @memberOf _
  8586. * @since 4.0.0
  8587. * @category Array
  8588. * @param {Array} array The sorted array to inspect.
  8589. * @param {*} value The value to evaluate.
  8590. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8591. * @returns {number} Returns the index at which `value` should be inserted
  8592. * into `array`.
  8593. * @example
  8594. *
  8595. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8596. *
  8597. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8598. * // => 0
  8599. *
  8600. * // The `_.property` iteratee shorthand.
  8601. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8602. * // => 0
  8603. */
  8604. function sortedIndexBy(array, value, iteratee) {
  8605. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8606. }
  8607. /**
  8608. * This method is like `_.indexOf` except that it performs a binary
  8609. * search on a sorted `array`.
  8610. *
  8611. * @static
  8612. * @memberOf _
  8613. * @since 4.0.0
  8614. * @category Array
  8615. * @param {Array} array The array to inspect.
  8616. * @param {*} value The value to search for.
  8617. * @returns {number} Returns the index of the matched value, else `-1`.
  8618. * @example
  8619. *
  8620. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8621. * // => 1
  8622. */
  8623. function sortedIndexOf(array, value) {
  8624. var length = array == null ? 0 : array.length;
  8625. if (length) {
  8626. var index = baseSortedIndex(array, value);
  8627. if (index < length && eq(array[index], value)) {
  8628. return index;
  8629. }
  8630. }
  8631. return -1;
  8632. }
  8633. /**
  8634. * This method is like `_.sortedIndex` except that it returns the highest
  8635. * index at which `value` should be inserted into `array` in order to
  8636. * maintain its sort order.
  8637. *
  8638. * @static
  8639. * @memberOf _
  8640. * @since 3.0.0
  8641. * @category Array
  8642. * @param {Array} array The sorted array to inspect.
  8643. * @param {*} value The value to evaluate.
  8644. * @returns {number} Returns the index at which `value` should be inserted
  8645. * into `array`.
  8646. * @example
  8647. *
  8648. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8649. * // => 4
  8650. */
  8651. function sortedLastIndex(array, value) {
  8652. return baseSortedIndex(array, value, true);
  8653. }
  8654. /**
  8655. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8656. * which is invoked for `value` and each element of `array` to compute their
  8657. * sort ranking. The iteratee is invoked with one argument: (value).
  8658. *
  8659. * @static
  8660. * @memberOf _
  8661. * @since 4.0.0
  8662. * @category Array
  8663. * @param {Array} array The sorted array to inspect.
  8664. * @param {*} value The value to evaluate.
  8665. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8666. * @returns {number} Returns the index at which `value` should be inserted
  8667. * into `array`.
  8668. * @example
  8669. *
  8670. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8671. *
  8672. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8673. * // => 1
  8674. *
  8675. * // The `_.property` iteratee shorthand.
  8676. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8677. * // => 1
  8678. */
  8679. function sortedLastIndexBy(array, value, iteratee) {
  8680. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8681. }
  8682. /**
  8683. * This method is like `_.lastIndexOf` except that it performs a binary
  8684. * search on a sorted `array`.
  8685. *
  8686. * @static
  8687. * @memberOf _
  8688. * @since 4.0.0
  8689. * @category Array
  8690. * @param {Array} array The array to inspect.
  8691. * @param {*} value The value to search for.
  8692. * @returns {number} Returns the index of the matched value, else `-1`.
  8693. * @example
  8694. *
  8695. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8696. * // => 3
  8697. */
  8698. function sortedLastIndexOf(array, value) {
  8699. var length = array == null ? 0 : array.length;
  8700. if (length) {
  8701. var index = baseSortedIndex(array, value, true) - 1;
  8702. if (eq(array[index], value)) {
  8703. return index;
  8704. }
  8705. }
  8706. return -1;
  8707. }
  8708. /**
  8709. * This method is like `_.uniq` except that it's designed and optimized
  8710. * for sorted arrays.
  8711. *
  8712. * @static
  8713. * @memberOf _
  8714. * @since 4.0.0
  8715. * @category Array
  8716. * @param {Array} array The array to inspect.
  8717. * @returns {Array} Returns the new duplicate free array.
  8718. * @example
  8719. *
  8720. * _.sortedUniq([1, 1, 2]);
  8721. * // => [1, 2]
  8722. */
  8723. function sortedUniq(array) {
  8724. return (array && array.length)
  8725. ? baseSortedUniq(array)
  8726. : [];
  8727. }
  8728. /**
  8729. * This method is like `_.uniqBy` except that it's designed and optimized
  8730. * for sorted arrays.
  8731. *
  8732. * @static
  8733. * @memberOf _
  8734. * @since 4.0.0
  8735. * @category Array
  8736. * @param {Array} array The array to inspect.
  8737. * @param {Function} [iteratee] The iteratee invoked per element.
  8738. * @returns {Array} Returns the new duplicate free array.
  8739. * @example
  8740. *
  8741. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8742. * // => [1.1, 2.3]
  8743. */
  8744. function sortedUniqBy(array, iteratee) {
  8745. return (array && array.length)
  8746. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8747. : [];
  8748. }
  8749. /**
  8750. * Gets all but the first element of `array`.
  8751. *
  8752. * @static
  8753. * @memberOf _
  8754. * @since 4.0.0
  8755. * @category Array
  8756. * @param {Array} array The array to query.
  8757. * @returns {Array} Returns the slice of `array`.
  8758. * @example
  8759. *
  8760. * _.tail([1, 2, 3]);
  8761. * // => [2, 3]
  8762. */
  8763. function tail(array) {
  8764. var length = array == null ? 0 : array.length;
  8765. return length ? baseSlice(array, 1, length) : [];
  8766. }
  8767. /**
  8768. * Creates a slice of `array` with `n` elements taken from the beginning.
  8769. *
  8770. * @static
  8771. * @memberOf _
  8772. * @since 0.1.0
  8773. * @category Array
  8774. * @param {Array} array The array to query.
  8775. * @param {number} [n=1] The number of elements to take.
  8776. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8777. * @returns {Array} Returns the slice of `array`.
  8778. * @example
  8779. *
  8780. * _.take([1, 2, 3]);
  8781. * // => [1]
  8782. *
  8783. * _.take([1, 2, 3], 2);
  8784. * // => [1, 2]
  8785. *
  8786. * _.take([1, 2, 3], 5);
  8787. * // => [1, 2, 3]
  8788. *
  8789. * _.take([1, 2, 3], 0);
  8790. * // => []
  8791. */
  8792. function take(array, n, guard) {
  8793. if (!(array && array.length)) {
  8794. return [];
  8795. }
  8796. n = (guard || n === undefined) ? 1 : toInteger(n);
  8797. return baseSlice(array, 0, n < 0 ? 0 : n);
  8798. }
  8799. /**
  8800. * Creates a slice of `array` with `n` elements taken from the end.
  8801. *
  8802. * @static
  8803. * @memberOf _
  8804. * @since 3.0.0
  8805. * @category Array
  8806. * @param {Array} array The array to query.
  8807. * @param {number} [n=1] The number of elements to take.
  8808. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8809. * @returns {Array} Returns the slice of `array`.
  8810. * @example
  8811. *
  8812. * _.takeRight([1, 2, 3]);
  8813. * // => [3]
  8814. *
  8815. * _.takeRight([1, 2, 3], 2);
  8816. * // => [2, 3]
  8817. *
  8818. * _.takeRight([1, 2, 3], 5);
  8819. * // => [1, 2, 3]
  8820. *
  8821. * _.takeRight([1, 2, 3], 0);
  8822. * // => []
  8823. */
  8824. function takeRight(array, n, guard) {
  8825. var length = array == null ? 0 : array.length;
  8826. if (!length) {
  8827. return [];
  8828. }
  8829. n = (guard || n === undefined) ? 1 : toInteger(n);
  8830. n = length - n;
  8831. return baseSlice(array, n < 0 ? 0 : n, length);
  8832. }
  8833. /**
  8834. * Creates a slice of `array` with elements taken from the end. Elements are
  8835. * taken until `predicate` returns falsey. The predicate is invoked with
  8836. * three arguments: (value, index, array).
  8837. *
  8838. * @static
  8839. * @memberOf _
  8840. * @since 3.0.0
  8841. * @category Array
  8842. * @param {Array} array The array to query.
  8843. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8844. * @returns {Array} Returns the slice of `array`.
  8845. * @example
  8846. *
  8847. * var users = [
  8848. * { 'user': 'barney', 'active': true },
  8849. * { 'user': 'fred', 'active': false },
  8850. * { 'user': 'pebbles', 'active': false }
  8851. * ];
  8852. *
  8853. * _.takeRightWhile(users, function(o) { return !o.active; });
  8854. * // => objects for ['fred', 'pebbles']
  8855. *
  8856. * // The `_.matches` iteratee shorthand.
  8857. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8858. * // => objects for ['pebbles']
  8859. *
  8860. * // The `_.matchesProperty` iteratee shorthand.
  8861. * _.takeRightWhile(users, ['active', false]);
  8862. * // => objects for ['fred', 'pebbles']
  8863. *
  8864. * // The `_.property` iteratee shorthand.
  8865. * _.takeRightWhile(users, 'active');
  8866. * // => []
  8867. */
  8868. function takeRightWhile(array, predicate) {
  8869. return (array && array.length)
  8870. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8871. : [];
  8872. }
  8873. /**
  8874. * Creates a slice of `array` with elements taken from the beginning. Elements
  8875. * are taken until `predicate` returns falsey. The predicate is invoked with
  8876. * three arguments: (value, index, array).
  8877. *
  8878. * @static
  8879. * @memberOf _
  8880. * @since 3.0.0
  8881. * @category Array
  8882. * @param {Array} array The array to query.
  8883. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8884. * @returns {Array} Returns the slice of `array`.
  8885. * @example
  8886. *
  8887. * var users = [
  8888. * { 'user': 'barney', 'active': false },
  8889. * { 'user': 'fred', 'active': false },
  8890. * { 'user': 'pebbles', 'active': true }
  8891. * ];
  8892. *
  8893. * _.takeWhile(users, function(o) { return !o.active; });
  8894. * // => objects for ['barney', 'fred']
  8895. *
  8896. * // The `_.matches` iteratee shorthand.
  8897. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8898. * // => objects for ['barney']
  8899. *
  8900. * // The `_.matchesProperty` iteratee shorthand.
  8901. * _.takeWhile(users, ['active', false]);
  8902. * // => objects for ['barney', 'fred']
  8903. *
  8904. * // The `_.property` iteratee shorthand.
  8905. * _.takeWhile(users, 'active');
  8906. * // => []
  8907. */
  8908. function takeWhile(array, predicate) {
  8909. return (array && array.length)
  8910. ? baseWhile(array, getIteratee(predicate, 3))
  8911. : [];
  8912. }
  8913. /**
  8914. * Creates an array of unique values, in order, from all given arrays using
  8915. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8916. * for equality comparisons.
  8917. *
  8918. * @static
  8919. * @memberOf _
  8920. * @since 0.1.0
  8921. * @category Array
  8922. * @param {...Array} [arrays] The arrays to inspect.
  8923. * @returns {Array} Returns the new array of combined values.
  8924. * @example
  8925. *
  8926. * _.union([2], [1, 2]);
  8927. * // => [2, 1]
  8928. */
  8929. var union = baseRest(function(arrays) {
  8930. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8931. });
  8932. /**
  8933. * This method is like `_.union` except that it accepts `iteratee` which is
  8934. * invoked for each element of each `arrays` to generate the criterion by
  8935. * which uniqueness is computed. Result values are chosen from the first
  8936. * array in which the value occurs. The iteratee is invoked with one argument:
  8937. * (value).
  8938. *
  8939. * @static
  8940. * @memberOf _
  8941. * @since 4.0.0
  8942. * @category Array
  8943. * @param {...Array} [arrays] The arrays to inspect.
  8944. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8945. * @returns {Array} Returns the new array of combined values.
  8946. * @example
  8947. *
  8948. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8949. * // => [2.1, 1.2]
  8950. *
  8951. * // The `_.property` iteratee shorthand.
  8952. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8953. * // => [{ 'x': 1 }, { 'x': 2 }]
  8954. */
  8955. var unionBy = baseRest(function(arrays) {
  8956. var iteratee = last(arrays);
  8957. if (isArrayLikeObject(iteratee)) {
  8958. iteratee = undefined;
  8959. }
  8960. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8961. });
  8962. /**
  8963. * This method is like `_.union` except that it accepts `comparator` which
  8964. * is invoked to compare elements of `arrays`. Result values are chosen from
  8965. * the first array in which the value occurs. The comparator is invoked
  8966. * with two arguments: (arrVal, othVal).
  8967. *
  8968. * @static
  8969. * @memberOf _
  8970. * @since 4.0.0
  8971. * @category Array
  8972. * @param {...Array} [arrays] The arrays to inspect.
  8973. * @param {Function} [comparator] The comparator invoked per element.
  8974. * @returns {Array} Returns the new array of combined values.
  8975. * @example
  8976. *
  8977. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8978. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8979. *
  8980. * _.unionWith(objects, others, _.isEqual);
  8981. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8982. */
  8983. var unionWith = baseRest(function(arrays) {
  8984. var comparator = last(arrays);
  8985. comparator = typeof comparator == 'function' ? comparator : undefined;
  8986. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8987. });
  8988. /**
  8989. * Creates a duplicate-free version of an array, using
  8990. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8991. * for equality comparisons, in which only the first occurrence of each element
  8992. * is kept. The order of result values is determined by the order they occur
  8993. * in the array.
  8994. *
  8995. * @static
  8996. * @memberOf _
  8997. * @since 0.1.0
  8998. * @category Array
  8999. * @param {Array} array The array to inspect.
  9000. * @returns {Array} Returns the new duplicate free array.
  9001. * @example
  9002. *
  9003. * _.uniq([2, 1, 2]);
  9004. * // => [2, 1]
  9005. */
  9006. function uniq(array) {
  9007. return (array && array.length) ? baseUniq(array) : [];
  9008. }
  9009. /**
  9010. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9011. * invoked for each element in `array` to generate the criterion by which
  9012. * uniqueness is computed. The order of result values is determined by the
  9013. * order they occur in the array. The iteratee is invoked with one argument:
  9014. * (value).
  9015. *
  9016. * @static
  9017. * @memberOf _
  9018. * @since 4.0.0
  9019. * @category Array
  9020. * @param {Array} array The array to inspect.
  9021. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9022. * @returns {Array} Returns the new duplicate free array.
  9023. * @example
  9024. *
  9025. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9026. * // => [2.1, 1.2]
  9027. *
  9028. * // The `_.property` iteratee shorthand.
  9029. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9030. * // => [{ 'x': 1 }, { 'x': 2 }]
  9031. */
  9032. function uniqBy(array, iteratee) {
  9033. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9034. }
  9035. /**
  9036. * This method is like `_.uniq` except that it accepts `comparator` which
  9037. * is invoked to compare elements of `array`. The order of result values is
  9038. * determined by the order they occur in the array.The comparator is invoked
  9039. * with two arguments: (arrVal, othVal).
  9040. *
  9041. * @static
  9042. * @memberOf _
  9043. * @since 4.0.0
  9044. * @category Array
  9045. * @param {Array} array The array to inspect.
  9046. * @param {Function} [comparator] The comparator invoked per element.
  9047. * @returns {Array} Returns the new duplicate free array.
  9048. * @example
  9049. *
  9050. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9051. *
  9052. * _.uniqWith(objects, _.isEqual);
  9053. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9054. */
  9055. function uniqWith(array, comparator) {
  9056. comparator = typeof comparator == 'function' ? comparator : undefined;
  9057. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9058. }
  9059. /**
  9060. * This method is like `_.zip` except that it accepts an array of grouped
  9061. * elements and creates an array regrouping the elements to their pre-zip
  9062. * configuration.
  9063. *
  9064. * @static
  9065. * @memberOf _
  9066. * @since 1.2.0
  9067. * @category Array
  9068. * @param {Array} array The array of grouped elements to process.
  9069. * @returns {Array} Returns the new array of regrouped elements.
  9070. * @example
  9071. *
  9072. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9073. * // => [['a', 1, true], ['b', 2, false]]
  9074. *
  9075. * _.unzip(zipped);
  9076. * // => [['a', 'b'], [1, 2], [true, false]]
  9077. */
  9078. function unzip(array) {
  9079. if (!(array && array.length)) {
  9080. return [];
  9081. }
  9082. var length = 0;
  9083. array = arrayFilter(array, function(group) {
  9084. if (isArrayLikeObject(group)) {
  9085. length = nativeMax(group.length, length);
  9086. return true;
  9087. }
  9088. });
  9089. return baseTimes(length, function(index) {
  9090. return arrayMap(array, baseProperty(index));
  9091. });
  9092. }
  9093. /**
  9094. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9095. * how regrouped values should be combined. The iteratee is invoked with the
  9096. * elements of each group: (...group).
  9097. *
  9098. * @static
  9099. * @memberOf _
  9100. * @since 3.8.0
  9101. * @category Array
  9102. * @param {Array} array The array of grouped elements to process.
  9103. * @param {Function} [iteratee=_.identity] The function to combine
  9104. * regrouped values.
  9105. * @returns {Array} Returns the new array of regrouped elements.
  9106. * @example
  9107. *
  9108. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9109. * // => [[1, 10, 100], [2, 20, 200]]
  9110. *
  9111. * _.unzipWith(zipped, _.add);
  9112. * // => [3, 30, 300]
  9113. */
  9114. function unzipWith(array, iteratee) {
  9115. if (!(array && array.length)) {
  9116. return [];
  9117. }
  9118. var result = unzip(array);
  9119. if (iteratee == null) {
  9120. return result;
  9121. }
  9122. return arrayMap(result, function(group) {
  9123. return apply(iteratee, undefined, group);
  9124. });
  9125. }
  9126. /**
  9127. * Creates an array excluding all given values using
  9128. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9129. * for equality comparisons.
  9130. *
  9131. * **Note:** Unlike `_.pull`, this method returns a new array.
  9132. *
  9133. * @static
  9134. * @memberOf _
  9135. * @since 0.1.0
  9136. * @category Array
  9137. * @param {Array} array The array to inspect.
  9138. * @param {...*} [values] The values to exclude.
  9139. * @returns {Array} Returns the new array of filtered values.
  9140. * @see _.difference, _.xor
  9141. * @example
  9142. *
  9143. * _.without([2, 1, 2, 3], 1, 2);
  9144. * // => [3]
  9145. */
  9146. var without = baseRest(function(array, values) {
  9147. return isArrayLikeObject(array)
  9148. ? baseDifference(array, values)
  9149. : [];
  9150. });
  9151. /**
  9152. * Creates an array of unique values that is the
  9153. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9154. * of the given arrays. The order of result values is determined by the order
  9155. * they occur in the arrays.
  9156. *
  9157. * @static
  9158. * @memberOf _
  9159. * @since 2.4.0
  9160. * @category Array
  9161. * @param {...Array} [arrays] The arrays to inspect.
  9162. * @returns {Array} Returns the new array of filtered values.
  9163. * @see _.difference, _.without
  9164. * @example
  9165. *
  9166. * _.xor([2, 1], [2, 3]);
  9167. * // => [1, 3]
  9168. */
  9169. var xor = baseRest(function(arrays) {
  9170. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9171. });
  9172. /**
  9173. * This method is like `_.xor` except that it accepts `iteratee` which is
  9174. * invoked for each element of each `arrays` to generate the criterion by
  9175. * which by which they're compared. The order of result values is determined
  9176. * by the order they occur in the arrays. The iteratee is invoked with one
  9177. * argument: (value).
  9178. *
  9179. * @static
  9180. * @memberOf _
  9181. * @since 4.0.0
  9182. * @category Array
  9183. * @param {...Array} [arrays] The arrays to inspect.
  9184. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9185. * @returns {Array} Returns the new array of filtered values.
  9186. * @example
  9187. *
  9188. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9189. * // => [1.2, 3.4]
  9190. *
  9191. * // The `_.property` iteratee shorthand.
  9192. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9193. * // => [{ 'x': 2 }]
  9194. */
  9195. var xorBy = baseRest(function(arrays) {
  9196. var iteratee = last(arrays);
  9197. if (isArrayLikeObject(iteratee)) {
  9198. iteratee = undefined;
  9199. }
  9200. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9201. });
  9202. /**
  9203. * This method is like `_.xor` except that it accepts `comparator` which is
  9204. * invoked to compare elements of `arrays`. The order of result values is
  9205. * determined by the order they occur in the arrays. The comparator is invoked
  9206. * with two arguments: (arrVal, othVal).
  9207. *
  9208. * @static
  9209. * @memberOf _
  9210. * @since 4.0.0
  9211. * @category Array
  9212. * @param {...Array} [arrays] The arrays to inspect.
  9213. * @param {Function} [comparator] The comparator invoked per element.
  9214. * @returns {Array} Returns the new array of filtered values.
  9215. * @example
  9216. *
  9217. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9218. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9219. *
  9220. * _.xorWith(objects, others, _.isEqual);
  9221. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9222. */
  9223. var xorWith = baseRest(function(arrays) {
  9224. var comparator = last(arrays);
  9225. comparator = typeof comparator == 'function' ? comparator : undefined;
  9226. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9227. });
  9228. /**
  9229. * Creates an array of grouped elements, the first of which contains the
  9230. * first elements of the given arrays, the second of which contains the
  9231. * second elements of the given arrays, and so on.
  9232. *
  9233. * @static
  9234. * @memberOf _
  9235. * @since 0.1.0
  9236. * @category Array
  9237. * @param {...Array} [arrays] The arrays to process.
  9238. * @returns {Array} Returns the new array of grouped elements.
  9239. * @example
  9240. *
  9241. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9242. * // => [['a', 1, true], ['b', 2, false]]
  9243. */
  9244. var zip = baseRest(unzip);
  9245. /**
  9246. * This method is like `_.fromPairs` except that it accepts two arrays,
  9247. * one of property identifiers and one of corresponding values.
  9248. *
  9249. * @static
  9250. * @memberOf _
  9251. * @since 0.4.0
  9252. * @category Array
  9253. * @param {Array} [props=[]] The property identifiers.
  9254. * @param {Array} [values=[]] The property values.
  9255. * @returns {Object} Returns the new object.
  9256. * @example
  9257. *
  9258. * _.zipObject(['a', 'b'], [1, 2]);
  9259. * // => { 'a': 1, 'b': 2 }
  9260. */
  9261. function zipObject(props, values) {
  9262. return baseZipObject(props || [], values || [], assignValue);
  9263. }
  9264. /**
  9265. * This method is like `_.zipObject` except that it supports property paths.
  9266. *
  9267. * @static
  9268. * @memberOf _
  9269. * @since 4.1.0
  9270. * @category Array
  9271. * @param {Array} [props=[]] The property identifiers.
  9272. * @param {Array} [values=[]] The property values.
  9273. * @returns {Object} Returns the new object.
  9274. * @example
  9275. *
  9276. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9277. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9278. */
  9279. function zipObjectDeep(props, values) {
  9280. return baseZipObject(props || [], values || [], baseSet);
  9281. }
  9282. /**
  9283. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9284. * how grouped values should be combined. The iteratee is invoked with the
  9285. * elements of each group: (...group).
  9286. *
  9287. * @static
  9288. * @memberOf _
  9289. * @since 3.8.0
  9290. * @category Array
  9291. * @param {...Array} [arrays] The arrays to process.
  9292. * @param {Function} [iteratee=_.identity] The function to combine
  9293. * grouped values.
  9294. * @returns {Array} Returns the new array of grouped elements.
  9295. * @example
  9296. *
  9297. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9298. * return a + b + c;
  9299. * });
  9300. * // => [111, 222]
  9301. */
  9302. var zipWith = baseRest(function(arrays) {
  9303. var length = arrays.length,
  9304. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9305. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9306. return unzipWith(arrays, iteratee);
  9307. });
  9308. /*------------------------------------------------------------------------*/
  9309. /**
  9310. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9311. * chain sequences enabled. The result of such sequences must be unwrapped
  9312. * with `_#value`.
  9313. *
  9314. * @static
  9315. * @memberOf _
  9316. * @since 1.3.0
  9317. * @category Seq
  9318. * @param {*} value The value to wrap.
  9319. * @returns {Object} Returns the new `lodash` wrapper instance.
  9320. * @example
  9321. *
  9322. * var users = [
  9323. * { 'user': 'barney', 'age': 36 },
  9324. * { 'user': 'fred', 'age': 40 },
  9325. * { 'user': 'pebbles', 'age': 1 }
  9326. * ];
  9327. *
  9328. * var youngest = _
  9329. * .chain(users)
  9330. * .sortBy('age')
  9331. * .map(function(o) {
  9332. * return o.user + ' is ' + o.age;
  9333. * })
  9334. * .head()
  9335. * .value();
  9336. * // => 'pebbles is 1'
  9337. */
  9338. function chain(value) {
  9339. var result = lodash(value);
  9340. result.__chain__ = true;
  9341. return result;
  9342. }
  9343. /**
  9344. * This method invokes `interceptor` and returns `value`. The interceptor
  9345. * is invoked with one argument; (value). The purpose of this method is to
  9346. * "tap into" a method chain sequence in order to modify intermediate results.
  9347. *
  9348. * @static
  9349. * @memberOf _
  9350. * @since 0.1.0
  9351. * @category Seq
  9352. * @param {*} value The value to provide to `interceptor`.
  9353. * @param {Function} interceptor The function to invoke.
  9354. * @returns {*} Returns `value`.
  9355. * @example
  9356. *
  9357. * _([1, 2, 3])
  9358. * .tap(function(array) {
  9359. * // Mutate input array.
  9360. * array.pop();
  9361. * })
  9362. * .reverse()
  9363. * .value();
  9364. * // => [2, 1]
  9365. */
  9366. function tap(value, interceptor) {
  9367. interceptor(value);
  9368. return value;
  9369. }
  9370. /**
  9371. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9372. * The purpose of this method is to "pass thru" values replacing intermediate
  9373. * results in a method chain sequence.
  9374. *
  9375. * @static
  9376. * @memberOf _
  9377. * @since 3.0.0
  9378. * @category Seq
  9379. * @param {*} value The value to provide to `interceptor`.
  9380. * @param {Function} interceptor The function to invoke.
  9381. * @returns {*} Returns the result of `interceptor`.
  9382. * @example
  9383. *
  9384. * _(' abc ')
  9385. * .chain()
  9386. * .trim()
  9387. * .thru(function(value) {
  9388. * return [value];
  9389. * })
  9390. * .value();
  9391. * // => ['abc']
  9392. */
  9393. function thru(value, interceptor) {
  9394. return interceptor(value);
  9395. }
  9396. /**
  9397. * This method is the wrapper version of `_.at`.
  9398. *
  9399. * @name at
  9400. * @memberOf _
  9401. * @since 1.0.0
  9402. * @category Seq
  9403. * @param {...(string|string[])} [paths] The property paths to pick.
  9404. * @returns {Object} Returns the new `lodash` wrapper instance.
  9405. * @example
  9406. *
  9407. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9408. *
  9409. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9410. * // => [3, 4]
  9411. */
  9412. var wrapperAt = flatRest(function(paths) {
  9413. var length = paths.length,
  9414. start = length ? paths[0] : 0,
  9415. value = this.__wrapped__,
  9416. interceptor = function(object) { return baseAt(object, paths); };
  9417. if (length > 1 || this.__actions__.length ||
  9418. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9419. return this.thru(interceptor);
  9420. }
  9421. value = value.slice(start, +start + (length ? 1 : 0));
  9422. value.__actions__.push({
  9423. 'func': thru,
  9424. 'args': [interceptor],
  9425. 'thisArg': undefined
  9426. });
  9427. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9428. if (length && !array.length) {
  9429. array.push(undefined);
  9430. }
  9431. return array;
  9432. });
  9433. });
  9434. /**
  9435. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9436. *
  9437. * @name chain
  9438. * @memberOf _
  9439. * @since 0.1.0
  9440. * @category Seq
  9441. * @returns {Object} Returns the new `lodash` wrapper instance.
  9442. * @example
  9443. *
  9444. * var users = [
  9445. * { 'user': 'barney', 'age': 36 },
  9446. * { 'user': 'fred', 'age': 40 }
  9447. * ];
  9448. *
  9449. * // A sequence without explicit chaining.
  9450. * _(users).head();
  9451. * // => { 'user': 'barney', 'age': 36 }
  9452. *
  9453. * // A sequence with explicit chaining.
  9454. * _(users)
  9455. * .chain()
  9456. * .head()
  9457. * .pick('user')
  9458. * .value();
  9459. * // => { 'user': 'barney' }
  9460. */
  9461. function wrapperChain() {
  9462. return chain(this);
  9463. }
  9464. /**
  9465. * Executes the chain sequence and returns the wrapped result.
  9466. *
  9467. * @name commit
  9468. * @memberOf _
  9469. * @since 3.2.0
  9470. * @category Seq
  9471. * @returns {Object} Returns the new `lodash` wrapper instance.
  9472. * @example
  9473. *
  9474. * var array = [1, 2];
  9475. * var wrapped = _(array).push(3);
  9476. *
  9477. * console.log(array);
  9478. * // => [1, 2]
  9479. *
  9480. * wrapped = wrapped.commit();
  9481. * console.log(array);
  9482. * // => [1, 2, 3]
  9483. *
  9484. * wrapped.last();
  9485. * // => 3
  9486. *
  9487. * console.log(array);
  9488. * // => [1, 2, 3]
  9489. */
  9490. function wrapperCommit() {
  9491. return new LodashWrapper(this.value(), this.__chain__);
  9492. }
  9493. /**
  9494. * Gets the next value on a wrapped object following the
  9495. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9496. *
  9497. * @name next
  9498. * @memberOf _
  9499. * @since 4.0.0
  9500. * @category Seq
  9501. * @returns {Object} Returns the next iterator value.
  9502. * @example
  9503. *
  9504. * var wrapped = _([1, 2]);
  9505. *
  9506. * wrapped.next();
  9507. * // => { 'done': false, 'value': 1 }
  9508. *
  9509. * wrapped.next();
  9510. * // => { 'done': false, 'value': 2 }
  9511. *
  9512. * wrapped.next();
  9513. * // => { 'done': true, 'value': undefined }
  9514. */
  9515. function wrapperNext() {
  9516. if (this.__values__ === undefined) {
  9517. this.__values__ = toArray(this.value());
  9518. }
  9519. var done = this.__index__ >= this.__values__.length,
  9520. value = done ? undefined : this.__values__[this.__index__++];
  9521. return { 'done': done, 'value': value };
  9522. }
  9523. /**
  9524. * Enables the wrapper to be iterable.
  9525. *
  9526. * @name Symbol.iterator
  9527. * @memberOf _
  9528. * @since 4.0.0
  9529. * @category Seq
  9530. * @returns {Object} Returns the wrapper object.
  9531. * @example
  9532. *
  9533. * var wrapped = _([1, 2]);
  9534. *
  9535. * wrapped[Symbol.iterator]() === wrapped;
  9536. * // => true
  9537. *
  9538. * Array.from(wrapped);
  9539. * // => [1, 2]
  9540. */
  9541. function wrapperToIterator() {
  9542. return this;
  9543. }
  9544. /**
  9545. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9546. *
  9547. * @name plant
  9548. * @memberOf _
  9549. * @since 3.2.0
  9550. * @category Seq
  9551. * @param {*} value The value to plant.
  9552. * @returns {Object} Returns the new `lodash` wrapper instance.
  9553. * @example
  9554. *
  9555. * function square(n) {
  9556. * return n * n;
  9557. * }
  9558. *
  9559. * var wrapped = _([1, 2]).map(square);
  9560. * var other = wrapped.plant([3, 4]);
  9561. *
  9562. * other.value();
  9563. * // => [9, 16]
  9564. *
  9565. * wrapped.value();
  9566. * // => [1, 4]
  9567. */
  9568. function wrapperPlant(value) {
  9569. var result,
  9570. parent = this;
  9571. while (parent instanceof baseLodash) {
  9572. var clone = wrapperClone(parent);
  9573. clone.__index__ = 0;
  9574. clone.__values__ = undefined;
  9575. if (result) {
  9576. previous.__wrapped__ = clone;
  9577. } else {
  9578. result = clone;
  9579. }
  9580. var previous = clone;
  9581. parent = parent.__wrapped__;
  9582. }
  9583. previous.__wrapped__ = value;
  9584. return result;
  9585. }
  9586. /**
  9587. * This method is the wrapper version of `_.reverse`.
  9588. *
  9589. * **Note:** This method mutates the wrapped array.
  9590. *
  9591. * @name reverse
  9592. * @memberOf _
  9593. * @since 0.1.0
  9594. * @category Seq
  9595. * @returns {Object} Returns the new `lodash` wrapper instance.
  9596. * @example
  9597. *
  9598. * var array = [1, 2, 3];
  9599. *
  9600. * _(array).reverse().value()
  9601. * // => [3, 2, 1]
  9602. *
  9603. * console.log(array);
  9604. * // => [3, 2, 1]
  9605. */
  9606. function wrapperReverse() {
  9607. var value = this.__wrapped__;
  9608. if (value instanceof LazyWrapper) {
  9609. var wrapped = value;
  9610. if (this.__actions__.length) {
  9611. wrapped = new LazyWrapper(this);
  9612. }
  9613. wrapped = wrapped.reverse();
  9614. wrapped.__actions__.push({
  9615. 'func': thru,
  9616. 'args': [reverse],
  9617. 'thisArg': undefined
  9618. });
  9619. return new LodashWrapper(wrapped, this.__chain__);
  9620. }
  9621. return this.thru(reverse);
  9622. }
  9623. /**
  9624. * Executes the chain sequence to resolve the unwrapped value.
  9625. *
  9626. * @name value
  9627. * @memberOf _
  9628. * @since 0.1.0
  9629. * @alias toJSON, valueOf
  9630. * @category Seq
  9631. * @returns {*} Returns the resolved unwrapped value.
  9632. * @example
  9633. *
  9634. * _([1, 2, 3]).value();
  9635. * // => [1, 2, 3]
  9636. */
  9637. function wrapperValue() {
  9638. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9639. }
  9640. /*------------------------------------------------------------------------*/
  9641. /**
  9642. * Creates an object composed of keys generated from the results of running
  9643. * each element of `collection` thru `iteratee`. The corresponding value of
  9644. * each key is the number of times the key was returned by `iteratee`. The
  9645. * iteratee is invoked with one argument: (value).
  9646. *
  9647. * @static
  9648. * @memberOf _
  9649. * @since 0.5.0
  9650. * @category Collection
  9651. * @param {Array|Object} collection The collection to iterate over.
  9652. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9653. * @returns {Object} Returns the composed aggregate object.
  9654. * @example
  9655. *
  9656. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9657. * // => { '4': 1, '6': 2 }
  9658. *
  9659. * // The `_.property` iteratee shorthand.
  9660. * _.countBy(['one', 'two', 'three'], 'length');
  9661. * // => { '3': 2, '5': 1 }
  9662. */
  9663. var countBy = createAggregator(function(result, value, key) {
  9664. if (hasOwnProperty.call(result, key)) {
  9665. ++result[key];
  9666. } else {
  9667. baseAssignValue(result, key, 1);
  9668. }
  9669. });
  9670. /**
  9671. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9672. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9673. * invoked with three arguments: (value, index|key, collection).
  9674. *
  9675. * **Note:** This method returns `true` for
  9676. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9677. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9678. * elements of empty collections.
  9679. *
  9680. * @static
  9681. * @memberOf _
  9682. * @since 0.1.0
  9683. * @category Collection
  9684. * @param {Array|Object} collection The collection to iterate over.
  9685. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9686. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9687. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9688. * else `false`.
  9689. * @example
  9690. *
  9691. * _.every([true, 1, null, 'yes'], Boolean);
  9692. * // => false
  9693. *
  9694. * var users = [
  9695. * { 'user': 'barney', 'age': 36, 'active': false },
  9696. * { 'user': 'fred', 'age': 40, 'active': false }
  9697. * ];
  9698. *
  9699. * // The `_.matches` iteratee shorthand.
  9700. * _.every(users, { 'user': 'barney', 'active': false });
  9701. * // => false
  9702. *
  9703. * // The `_.matchesProperty` iteratee shorthand.
  9704. * _.every(users, ['active', false]);
  9705. * // => true
  9706. *
  9707. * // The `_.property` iteratee shorthand.
  9708. * _.every(users, 'active');
  9709. * // => false
  9710. */
  9711. function every(collection, predicate, guard) {
  9712. var func = isArray(collection) ? arrayEvery : baseEvery;
  9713. if (guard && isIterateeCall(collection, predicate, guard)) {
  9714. predicate = undefined;
  9715. }
  9716. return func(collection, getIteratee(predicate, 3));
  9717. }
  9718. /**
  9719. * Iterates over elements of `collection`, returning an array of all elements
  9720. * `predicate` returns truthy for. The predicate is invoked with three
  9721. * arguments: (value, index|key, collection).
  9722. *
  9723. * **Note:** Unlike `_.remove`, this method returns a new array.
  9724. *
  9725. * @static
  9726. * @memberOf _
  9727. * @since 0.1.0
  9728. * @category Collection
  9729. * @param {Array|Object} collection The collection to iterate over.
  9730. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9731. * @returns {Array} Returns the new filtered array.
  9732. * @see _.reject
  9733. * @example
  9734. *
  9735. * var users = [
  9736. * { 'user': 'barney', 'age': 36, 'active': true },
  9737. * { 'user': 'fred', 'age': 40, 'active': false }
  9738. * ];
  9739. *
  9740. * _.filter(users, function(o) { return !o.active; });
  9741. * // => objects for ['fred']
  9742. *
  9743. * // The `_.matches` iteratee shorthand.
  9744. * _.filter(users, { 'age': 36, 'active': true });
  9745. * // => objects for ['barney']
  9746. *
  9747. * // The `_.matchesProperty` iteratee shorthand.
  9748. * _.filter(users, ['active', false]);
  9749. * // => objects for ['fred']
  9750. *
  9751. * // The `_.property` iteratee shorthand.
  9752. * _.filter(users, 'active');
  9753. * // => objects for ['barney']
  9754. *
  9755. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9756. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9757. * // => objects for ['fred', 'barney']
  9758. */
  9759. function filter(collection, predicate) {
  9760. var func = isArray(collection) ? arrayFilter : baseFilter;
  9761. return func(collection, getIteratee(predicate, 3));
  9762. }
  9763. /**
  9764. * Iterates over elements of `collection`, returning the first element
  9765. * `predicate` returns truthy for. The predicate is invoked with three
  9766. * arguments: (value, index|key, collection).
  9767. *
  9768. * @static
  9769. * @memberOf _
  9770. * @since 0.1.0
  9771. * @category Collection
  9772. * @param {Array|Object} collection The collection to inspect.
  9773. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9774. * @param {number} [fromIndex=0] The index to search from.
  9775. * @returns {*} Returns the matched element, else `undefined`.
  9776. * @example
  9777. *
  9778. * var users = [
  9779. * { 'user': 'barney', 'age': 36, 'active': true },
  9780. * { 'user': 'fred', 'age': 40, 'active': false },
  9781. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9782. * ];
  9783. *
  9784. * _.find(users, function(o) { return o.age < 40; });
  9785. * // => object for 'barney'
  9786. *
  9787. * // The `_.matches` iteratee shorthand.
  9788. * _.find(users, { 'age': 1, 'active': true });
  9789. * // => object for 'pebbles'
  9790. *
  9791. * // The `_.matchesProperty` iteratee shorthand.
  9792. * _.find(users, ['active', false]);
  9793. * // => object for 'fred'
  9794. *
  9795. * // The `_.property` iteratee shorthand.
  9796. * _.find(users, 'active');
  9797. * // => object for 'barney'
  9798. */
  9799. var find = createFind(findIndex);
  9800. /**
  9801. * This method is like `_.find` except that it iterates over elements of
  9802. * `collection` from right to left.
  9803. *
  9804. * @static
  9805. * @memberOf _
  9806. * @since 2.0.0
  9807. * @category Collection
  9808. * @param {Array|Object} collection The collection to inspect.
  9809. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9810. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9811. * @returns {*} Returns the matched element, else `undefined`.
  9812. * @example
  9813. *
  9814. * _.findLast([1, 2, 3, 4], function(n) {
  9815. * return n % 2 == 1;
  9816. * });
  9817. * // => 3
  9818. */
  9819. var findLast = createFind(findLastIndex);
  9820. /**
  9821. * Creates a flattened array of values by running each element in `collection`
  9822. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9823. * with three arguments: (value, index|key, collection).
  9824. *
  9825. * @static
  9826. * @memberOf _
  9827. * @since 4.0.0
  9828. * @category Collection
  9829. * @param {Array|Object} collection The collection to iterate over.
  9830. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9831. * @returns {Array} Returns the new flattened array.
  9832. * @example
  9833. *
  9834. * function duplicate(n) {
  9835. * return [n, n];
  9836. * }
  9837. *
  9838. * _.flatMap([1, 2], duplicate);
  9839. * // => [1, 1, 2, 2]
  9840. */
  9841. function flatMap(collection, iteratee) {
  9842. return baseFlatten(map(collection, iteratee), 1);
  9843. }
  9844. /**
  9845. * This method is like `_.flatMap` except that it recursively flattens the
  9846. * mapped results.
  9847. *
  9848. * @static
  9849. * @memberOf _
  9850. * @since 4.7.0
  9851. * @category Collection
  9852. * @param {Array|Object} collection The collection to iterate over.
  9853. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9854. * @returns {Array} Returns the new flattened array.
  9855. * @example
  9856. *
  9857. * function duplicate(n) {
  9858. * return [[[n, n]]];
  9859. * }
  9860. *
  9861. * _.flatMapDeep([1, 2], duplicate);
  9862. * // => [1, 1, 2, 2]
  9863. */
  9864. function flatMapDeep(collection, iteratee) {
  9865. return baseFlatten(map(collection, iteratee), INFINITY);
  9866. }
  9867. /**
  9868. * This method is like `_.flatMap` except that it recursively flattens the
  9869. * mapped results up to `depth` times.
  9870. *
  9871. * @static
  9872. * @memberOf _
  9873. * @since 4.7.0
  9874. * @category Collection
  9875. * @param {Array|Object} collection The collection to iterate over.
  9876. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9877. * @param {number} [depth=1] The maximum recursion depth.
  9878. * @returns {Array} Returns the new flattened array.
  9879. * @example
  9880. *
  9881. * function duplicate(n) {
  9882. * return [[[n, n]]];
  9883. * }
  9884. *
  9885. * _.flatMapDepth([1, 2], duplicate, 2);
  9886. * // => [[1, 1], [2, 2]]
  9887. */
  9888. function flatMapDepth(collection, iteratee, depth) {
  9889. depth = depth === undefined ? 1 : toInteger(depth);
  9890. return baseFlatten(map(collection, iteratee), depth);
  9891. }
  9892. /**
  9893. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9894. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9895. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9896. *
  9897. * **Note:** As with other "Collections" methods, objects with a "length"
  9898. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9899. * or `_.forOwn` for object iteration.
  9900. *
  9901. * @static
  9902. * @memberOf _
  9903. * @since 0.1.0
  9904. * @alias each
  9905. * @category Collection
  9906. * @param {Array|Object} collection The collection to iterate over.
  9907. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9908. * @returns {Array|Object} Returns `collection`.
  9909. * @see _.forEachRight
  9910. * @example
  9911. *
  9912. * _.forEach([1, 2], function(value) {
  9913. * console.log(value);
  9914. * });
  9915. * // => Logs `1` then `2`.
  9916. *
  9917. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9918. * console.log(key);
  9919. * });
  9920. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9921. */
  9922. function forEach(collection, iteratee) {
  9923. var func = isArray(collection) ? arrayEach : baseEach;
  9924. return func(collection, getIteratee(iteratee, 3));
  9925. }
  9926. /**
  9927. * This method is like `_.forEach` except that it iterates over elements of
  9928. * `collection` from right to left.
  9929. *
  9930. * @static
  9931. * @memberOf _
  9932. * @since 2.0.0
  9933. * @alias eachRight
  9934. * @category Collection
  9935. * @param {Array|Object} collection The collection to iterate over.
  9936. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9937. * @returns {Array|Object} Returns `collection`.
  9938. * @see _.forEach
  9939. * @example
  9940. *
  9941. * _.forEachRight([1, 2], function(value) {
  9942. * console.log(value);
  9943. * });
  9944. * // => Logs `2` then `1`.
  9945. */
  9946. function forEachRight(collection, iteratee) {
  9947. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9948. return func(collection, getIteratee(iteratee, 3));
  9949. }
  9950. /**
  9951. * Creates an object composed of keys generated from the results of running
  9952. * each element of `collection` thru `iteratee`. The order of grouped values
  9953. * is determined by the order they occur in `collection`. The corresponding
  9954. * value of each key is an array of elements responsible for generating the
  9955. * key. The iteratee is invoked with one argument: (value).
  9956. *
  9957. * @static
  9958. * @memberOf _
  9959. * @since 0.1.0
  9960. * @category Collection
  9961. * @param {Array|Object} collection The collection to iterate over.
  9962. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9963. * @returns {Object} Returns the composed aggregate object.
  9964. * @example
  9965. *
  9966. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9967. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9968. *
  9969. * // The `_.property` iteratee shorthand.
  9970. * _.groupBy(['one', 'two', 'three'], 'length');
  9971. * // => { '3': ['one', 'two'], '5': ['three'] }
  9972. */
  9973. var groupBy = createAggregator(function(result, value, key) {
  9974. if (hasOwnProperty.call(result, key)) {
  9975. result[key].push(value);
  9976. } else {
  9977. baseAssignValue(result, key, [value]);
  9978. }
  9979. });
  9980. /**
  9981. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9982. * checked for a substring of `value`, otherwise
  9983. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9984. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9985. * the offset from the end of `collection`.
  9986. *
  9987. * @static
  9988. * @memberOf _
  9989. * @since 0.1.0
  9990. * @category Collection
  9991. * @param {Array|Object|string} collection The collection to inspect.
  9992. * @param {*} value The value to search for.
  9993. * @param {number} [fromIndex=0] The index to search from.
  9994. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9995. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9996. * @example
  9997. *
  9998. * _.includes([1, 2, 3], 1);
  9999. * // => true
  10000. *
  10001. * _.includes([1, 2, 3], 1, 2);
  10002. * // => false
  10003. *
  10004. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10005. * // => true
  10006. *
  10007. * _.includes('abcd', 'bc');
  10008. * // => true
  10009. */
  10010. function includes(collection, value, fromIndex, guard) {
  10011. collection = isArrayLike(collection) ? collection : values(collection);
  10012. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10013. var length = collection.length;
  10014. if (fromIndex < 0) {
  10015. fromIndex = nativeMax(length + fromIndex, 0);
  10016. }
  10017. return isString(collection)
  10018. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10019. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10020. }
  10021. /**
  10022. * Invokes the method at `path` of each element in `collection`, returning
  10023. * an array of the results of each invoked method. Any additional arguments
  10024. * are provided to each invoked method. If `path` is a function, it's invoked
  10025. * for, and `this` bound to, each element in `collection`.
  10026. *
  10027. * @static
  10028. * @memberOf _
  10029. * @since 4.0.0
  10030. * @category Collection
  10031. * @param {Array|Object} collection The collection to iterate over.
  10032. * @param {Array|Function|string} path The path of the method to invoke or
  10033. * the function invoked per iteration.
  10034. * @param {...*} [args] The arguments to invoke each method with.
  10035. * @returns {Array} Returns the array of results.
  10036. * @example
  10037. *
  10038. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10039. * // => [[1, 5, 7], [1, 2, 3]]
  10040. *
  10041. * _.invokeMap([123, 456], String.prototype.split, '');
  10042. * // => [['1', '2', '3'], ['4', '5', '6']]
  10043. */
  10044. var invokeMap = baseRest(function(collection, path, args) {
  10045. var index = -1,
  10046. isFunc = typeof path == 'function',
  10047. result = isArrayLike(collection) ? Array(collection.length) : [];
  10048. baseEach(collection, function(value) {
  10049. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10050. });
  10051. return result;
  10052. });
  10053. /**
  10054. * Creates an object composed of keys generated from the results of running
  10055. * each element of `collection` thru `iteratee`. The corresponding value of
  10056. * each key is the last element responsible for generating the key. The
  10057. * iteratee is invoked with one argument: (value).
  10058. *
  10059. * @static
  10060. * @memberOf _
  10061. * @since 4.0.0
  10062. * @category Collection
  10063. * @param {Array|Object} collection The collection to iterate over.
  10064. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10065. * @returns {Object} Returns the composed aggregate object.
  10066. * @example
  10067. *
  10068. * var array = [
  10069. * { 'dir': 'left', 'code': 97 },
  10070. * { 'dir': 'right', 'code': 100 }
  10071. * ];
  10072. *
  10073. * _.keyBy(array, function(o) {
  10074. * return String.fromCharCode(o.code);
  10075. * });
  10076. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10077. *
  10078. * _.keyBy(array, 'dir');
  10079. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10080. */
  10081. var keyBy = createAggregator(function(result, value, key) {
  10082. baseAssignValue(result, key, value);
  10083. });
  10084. /**
  10085. * Creates an array of values by running each element in `collection` thru
  10086. * `iteratee`. The iteratee is invoked with three arguments:
  10087. * (value, index|key, collection).
  10088. *
  10089. * Many lodash methods are guarded to work as iteratees for methods like
  10090. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10091. *
  10092. * The guarded methods are:
  10093. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10094. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10095. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10096. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10097. *
  10098. * @static
  10099. * @memberOf _
  10100. * @since 0.1.0
  10101. * @category Collection
  10102. * @param {Array|Object} collection The collection to iterate over.
  10103. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10104. * @returns {Array} Returns the new mapped array.
  10105. * @example
  10106. *
  10107. * function square(n) {
  10108. * return n * n;
  10109. * }
  10110. *
  10111. * _.map([4, 8], square);
  10112. * // => [16, 64]
  10113. *
  10114. * _.map({ 'a': 4, 'b': 8 }, square);
  10115. * // => [16, 64] (iteration order is not guaranteed)
  10116. *
  10117. * var users = [
  10118. * { 'user': 'barney' },
  10119. * { 'user': 'fred' }
  10120. * ];
  10121. *
  10122. * // The `_.property` iteratee shorthand.
  10123. * _.map(users, 'user');
  10124. * // => ['barney', 'fred']
  10125. */
  10126. function map(collection, iteratee) {
  10127. var func = isArray(collection) ? arrayMap : baseMap;
  10128. return func(collection, getIteratee(iteratee, 3));
  10129. }
  10130. /**
  10131. * This method is like `_.sortBy` except that it allows specifying the sort
  10132. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10133. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10134. * descending or "asc" for ascending sort order of corresponding values.
  10135. *
  10136. * @static
  10137. * @memberOf _
  10138. * @since 4.0.0
  10139. * @category Collection
  10140. * @param {Array|Object} collection The collection to iterate over.
  10141. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10142. * The iteratees to sort by.
  10143. * @param {string[]} [orders] The sort orders of `iteratees`.
  10144. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10145. * @returns {Array} Returns the new sorted array.
  10146. * @example
  10147. *
  10148. * var users = [
  10149. * { 'user': 'fred', 'age': 48 },
  10150. * { 'user': 'barney', 'age': 34 },
  10151. * { 'user': 'fred', 'age': 40 },
  10152. * { 'user': 'barney', 'age': 36 }
  10153. * ];
  10154. *
  10155. * // Sort by `user` in ascending order and by `age` in descending order.
  10156. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10157. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10158. */
  10159. function orderBy(collection, iteratees, orders, guard) {
  10160. if (collection == null) {
  10161. return [];
  10162. }
  10163. if (!isArray(iteratees)) {
  10164. iteratees = iteratees == null ? [] : [iteratees];
  10165. }
  10166. orders = guard ? undefined : orders;
  10167. if (!isArray(orders)) {
  10168. orders = orders == null ? [] : [orders];
  10169. }
  10170. return baseOrderBy(collection, iteratees, orders);
  10171. }
  10172. /**
  10173. * Creates an array of elements split into two groups, the first of which
  10174. * contains elements `predicate` returns truthy for, the second of which
  10175. * contains elements `predicate` returns falsey for. The predicate is
  10176. * invoked with one argument: (value).
  10177. *
  10178. * @static
  10179. * @memberOf _
  10180. * @since 3.0.0
  10181. * @category Collection
  10182. * @param {Array|Object} collection The collection to iterate over.
  10183. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10184. * @returns {Array} Returns the array of grouped elements.
  10185. * @example
  10186. *
  10187. * var users = [
  10188. * { 'user': 'barney', 'age': 36, 'active': false },
  10189. * { 'user': 'fred', 'age': 40, 'active': true },
  10190. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10191. * ];
  10192. *
  10193. * _.partition(users, function(o) { return o.active; });
  10194. * // => objects for [['fred'], ['barney', 'pebbles']]
  10195. *
  10196. * // The `_.matches` iteratee shorthand.
  10197. * _.partition(users, { 'age': 1, 'active': false });
  10198. * // => objects for [['pebbles'], ['barney', 'fred']]
  10199. *
  10200. * // The `_.matchesProperty` iteratee shorthand.
  10201. * _.partition(users, ['active', false]);
  10202. * // => objects for [['barney', 'pebbles'], ['fred']]
  10203. *
  10204. * // The `_.property` iteratee shorthand.
  10205. * _.partition(users, 'active');
  10206. * // => objects for [['fred'], ['barney', 'pebbles']]
  10207. */
  10208. var partition = createAggregator(function(result, value, key) {
  10209. result[key ? 0 : 1].push(value);
  10210. }, function() { return [[], []]; });
  10211. /**
  10212. * Reduces `collection` to a value which is the accumulated result of running
  10213. * each element in `collection` thru `iteratee`, where each successive
  10214. * invocation is supplied the return value of the previous. If `accumulator`
  10215. * is not given, the first element of `collection` is used as the initial
  10216. * value. The iteratee is invoked with four arguments:
  10217. * (accumulator, value, index|key, collection).
  10218. *
  10219. * Many lodash methods are guarded to work as iteratees for methods like
  10220. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10221. *
  10222. * The guarded methods are:
  10223. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10224. * and `sortBy`
  10225. *
  10226. * @static
  10227. * @memberOf _
  10228. * @since 0.1.0
  10229. * @category Collection
  10230. * @param {Array|Object} collection The collection to iterate over.
  10231. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10232. * @param {*} [accumulator] The initial value.
  10233. * @returns {*} Returns the accumulated value.
  10234. * @see _.reduceRight
  10235. * @example
  10236. *
  10237. * _.reduce([1, 2], function(sum, n) {
  10238. * return sum + n;
  10239. * }, 0);
  10240. * // => 3
  10241. *
  10242. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10243. * (result[value] || (result[value] = [])).push(key);
  10244. * return result;
  10245. * }, {});
  10246. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10247. */
  10248. function reduce(collection, iteratee, accumulator) {
  10249. var func = isArray(collection) ? arrayReduce : baseReduce,
  10250. initAccum = arguments.length < 3;
  10251. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10252. }
  10253. /**
  10254. * This method is like `_.reduce` except that it iterates over elements of
  10255. * `collection` from right to left.
  10256. *
  10257. * @static
  10258. * @memberOf _
  10259. * @since 0.1.0
  10260. * @category Collection
  10261. * @param {Array|Object} collection The collection to iterate over.
  10262. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10263. * @param {*} [accumulator] The initial value.
  10264. * @returns {*} Returns the accumulated value.
  10265. * @see _.reduce
  10266. * @example
  10267. *
  10268. * var array = [[0, 1], [2, 3], [4, 5]];
  10269. *
  10270. * _.reduceRight(array, function(flattened, other) {
  10271. * return flattened.concat(other);
  10272. * }, []);
  10273. * // => [4, 5, 2, 3, 0, 1]
  10274. */
  10275. function reduceRight(collection, iteratee, accumulator) {
  10276. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10277. initAccum = arguments.length < 3;
  10278. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10279. }
  10280. /**
  10281. * The opposite of `_.filter`; this method returns the elements of `collection`
  10282. * that `predicate` does **not** return truthy for.
  10283. *
  10284. * @static
  10285. * @memberOf _
  10286. * @since 0.1.0
  10287. * @category Collection
  10288. * @param {Array|Object} collection The collection to iterate over.
  10289. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10290. * @returns {Array} Returns the new filtered array.
  10291. * @see _.filter
  10292. * @example
  10293. *
  10294. * var users = [
  10295. * { 'user': 'barney', 'age': 36, 'active': false },
  10296. * { 'user': 'fred', 'age': 40, 'active': true }
  10297. * ];
  10298. *
  10299. * _.reject(users, function(o) { return !o.active; });
  10300. * // => objects for ['fred']
  10301. *
  10302. * // The `_.matches` iteratee shorthand.
  10303. * _.reject(users, { 'age': 40, 'active': true });
  10304. * // => objects for ['barney']
  10305. *
  10306. * // The `_.matchesProperty` iteratee shorthand.
  10307. * _.reject(users, ['active', false]);
  10308. * // => objects for ['fred']
  10309. *
  10310. * // The `_.property` iteratee shorthand.
  10311. * _.reject(users, 'active');
  10312. * // => objects for ['barney']
  10313. */
  10314. function reject(collection, predicate) {
  10315. var func = isArray(collection) ? arrayFilter : baseFilter;
  10316. return func(collection, negate(getIteratee(predicate, 3)));
  10317. }
  10318. /**
  10319. * Gets a random element from `collection`.
  10320. *
  10321. * @static
  10322. * @memberOf _
  10323. * @since 2.0.0
  10324. * @category Collection
  10325. * @param {Array|Object} collection The collection to sample.
  10326. * @returns {*} Returns the random element.
  10327. * @example
  10328. *
  10329. * _.sample([1, 2, 3, 4]);
  10330. * // => 2
  10331. */
  10332. function sample(collection) {
  10333. var func = isArray(collection) ? arraySample : baseSample;
  10334. return func(collection);
  10335. }
  10336. /**
  10337. * Gets `n` random elements at unique keys from `collection` up to the
  10338. * size of `collection`.
  10339. *
  10340. * @static
  10341. * @memberOf _
  10342. * @since 4.0.0
  10343. * @category Collection
  10344. * @param {Array|Object} collection The collection to sample.
  10345. * @param {number} [n=1] The number of elements to sample.
  10346. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10347. * @returns {Array} Returns the random elements.
  10348. * @example
  10349. *
  10350. * _.sampleSize([1, 2, 3], 2);
  10351. * // => [3, 1]
  10352. *
  10353. * _.sampleSize([1, 2, 3], 4);
  10354. * // => [2, 3, 1]
  10355. */
  10356. function sampleSize(collection, n, guard) {
  10357. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10358. n = 1;
  10359. } else {
  10360. n = toInteger(n);
  10361. }
  10362. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10363. return func(collection, n);
  10364. }
  10365. /**
  10366. * Creates an array of shuffled values, using a version of the
  10367. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10368. *
  10369. * @static
  10370. * @memberOf _
  10371. * @since 0.1.0
  10372. * @category Collection
  10373. * @param {Array|Object} collection The collection to shuffle.
  10374. * @returns {Array} Returns the new shuffled array.
  10375. * @example
  10376. *
  10377. * _.shuffle([1, 2, 3, 4]);
  10378. * // => [4, 1, 3, 2]
  10379. */
  10380. function shuffle(collection) {
  10381. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10382. return func(collection);
  10383. }
  10384. /**
  10385. * Gets the size of `collection` by returning its length for array-like
  10386. * values or the number of own enumerable string keyed properties for objects.
  10387. *
  10388. * @static
  10389. * @memberOf _
  10390. * @since 0.1.0
  10391. * @category Collection
  10392. * @param {Array|Object|string} collection The collection to inspect.
  10393. * @returns {number} Returns the collection size.
  10394. * @example
  10395. *
  10396. * _.size([1, 2, 3]);
  10397. * // => 3
  10398. *
  10399. * _.size({ 'a': 1, 'b': 2 });
  10400. * // => 2
  10401. *
  10402. * _.size('pebbles');
  10403. * // => 7
  10404. */
  10405. function size(collection) {
  10406. if (collection == null) {
  10407. return 0;
  10408. }
  10409. if (isArrayLike(collection)) {
  10410. return isString(collection) ? stringSize(collection) : collection.length;
  10411. }
  10412. var tag = getTag(collection);
  10413. if (tag == mapTag || tag == setTag) {
  10414. return collection.size;
  10415. }
  10416. return baseKeys(collection).length;
  10417. }
  10418. /**
  10419. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10420. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10421. * invoked with three arguments: (value, index|key, collection).
  10422. *
  10423. * @static
  10424. * @memberOf _
  10425. * @since 0.1.0
  10426. * @category Collection
  10427. * @param {Array|Object} collection The collection to iterate over.
  10428. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10429. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10430. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10431. * else `false`.
  10432. * @example
  10433. *
  10434. * _.some([null, 0, 'yes', false], Boolean);
  10435. * // => true
  10436. *
  10437. * var users = [
  10438. * { 'user': 'barney', 'active': true },
  10439. * { 'user': 'fred', 'active': false }
  10440. * ];
  10441. *
  10442. * // The `_.matches` iteratee shorthand.
  10443. * _.some(users, { 'user': 'barney', 'active': false });
  10444. * // => false
  10445. *
  10446. * // The `_.matchesProperty` iteratee shorthand.
  10447. * _.some(users, ['active', false]);
  10448. * // => true
  10449. *
  10450. * // The `_.property` iteratee shorthand.
  10451. * _.some(users, 'active');
  10452. * // => true
  10453. */
  10454. function some(collection, predicate, guard) {
  10455. var func = isArray(collection) ? arraySome : baseSome;
  10456. if (guard && isIterateeCall(collection, predicate, guard)) {
  10457. predicate = undefined;
  10458. }
  10459. return func(collection, getIteratee(predicate, 3));
  10460. }
  10461. /**
  10462. * Creates an array of elements, sorted in ascending order by the results of
  10463. * running each element in a collection thru each iteratee. This method
  10464. * performs a stable sort, that is, it preserves the original sort order of
  10465. * equal elements. The iteratees are invoked with one argument: (value).
  10466. *
  10467. * @static
  10468. * @memberOf _
  10469. * @since 0.1.0
  10470. * @category Collection
  10471. * @param {Array|Object} collection The collection to iterate over.
  10472. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10473. * The iteratees to sort by.
  10474. * @returns {Array} Returns the new sorted array.
  10475. * @example
  10476. *
  10477. * var users = [
  10478. * { 'user': 'fred', 'age': 48 },
  10479. * { 'user': 'barney', 'age': 36 },
  10480. * { 'user': 'fred', 'age': 30 },
  10481. * { 'user': 'barney', 'age': 34 }
  10482. * ];
  10483. *
  10484. * _.sortBy(users, [function(o) { return o.user; }]);
  10485. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10486. *
  10487. * _.sortBy(users, ['user', 'age']);
  10488. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10489. */
  10490. var sortBy = baseRest(function(collection, iteratees) {
  10491. if (collection == null) {
  10492. return [];
  10493. }
  10494. var length = iteratees.length;
  10495. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10496. iteratees = [];
  10497. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10498. iteratees = [iteratees[0]];
  10499. }
  10500. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10501. });
  10502. /*------------------------------------------------------------------------*/
  10503. /**
  10504. * Gets the timestamp of the number of milliseconds that have elapsed since
  10505. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10506. *
  10507. * @static
  10508. * @memberOf _
  10509. * @since 2.4.0
  10510. * @category Date
  10511. * @returns {number} Returns the timestamp.
  10512. * @example
  10513. *
  10514. * _.defer(function(stamp) {
  10515. * console.log(_.now() - stamp);
  10516. * }, _.now());
  10517. * // => Logs the number of milliseconds it took for the deferred invocation.
  10518. */
  10519. var now = ctxNow || function() {
  10520. return root.Date.now();
  10521. };
  10522. /*------------------------------------------------------------------------*/
  10523. /**
  10524. * The opposite of `_.before`; this method creates a function that invokes
  10525. * `func` once it's called `n` or more times.
  10526. *
  10527. * @static
  10528. * @memberOf _
  10529. * @since 0.1.0
  10530. * @category Function
  10531. * @param {number} n The number of calls before `func` is invoked.
  10532. * @param {Function} func The function to restrict.
  10533. * @returns {Function} Returns the new restricted function.
  10534. * @example
  10535. *
  10536. * var saves = ['profile', 'settings'];
  10537. *
  10538. * var done = _.after(saves.length, function() {
  10539. * console.log('done saving!');
  10540. * });
  10541. *
  10542. * _.forEach(saves, function(type) {
  10543. * asyncSave({ 'type': type, 'complete': done });
  10544. * });
  10545. * // => Logs 'done saving!' after the two async saves have completed.
  10546. */
  10547. function after(n, func) {
  10548. if (typeof func != 'function') {
  10549. throw new TypeError(FUNC_ERROR_TEXT);
  10550. }
  10551. n = toInteger(n);
  10552. return function() {
  10553. if (--n < 1) {
  10554. return func.apply(this, arguments);
  10555. }
  10556. };
  10557. }
  10558. /**
  10559. * Creates a function that invokes `func`, with up to `n` arguments,
  10560. * ignoring any additional arguments.
  10561. *
  10562. * @static
  10563. * @memberOf _
  10564. * @since 3.0.0
  10565. * @category Function
  10566. * @param {Function} func The function to cap arguments for.
  10567. * @param {number} [n=func.length] The arity cap.
  10568. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10569. * @returns {Function} Returns the new capped function.
  10570. * @example
  10571. *
  10572. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10573. * // => [6, 8, 10]
  10574. */
  10575. function ary(func, n, guard) {
  10576. n = guard ? undefined : n;
  10577. n = (func && n == null) ? func.length : n;
  10578. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10579. }
  10580. /**
  10581. * Creates a function that invokes `func`, with the `this` binding and arguments
  10582. * of the created function, while it's called less than `n` times. Subsequent
  10583. * calls to the created function return the result of the last `func` invocation.
  10584. *
  10585. * @static
  10586. * @memberOf _
  10587. * @since 3.0.0
  10588. * @category Function
  10589. * @param {number} n The number of calls at which `func` is no longer invoked.
  10590. * @param {Function} func The function to restrict.
  10591. * @returns {Function} Returns the new restricted function.
  10592. * @example
  10593. *
  10594. * jQuery(element).on('click', _.before(5, addContactToList));
  10595. * // => Allows adding up to 4 contacts to the list.
  10596. */
  10597. function before(n, func) {
  10598. var result;
  10599. if (typeof func != 'function') {
  10600. throw new TypeError(FUNC_ERROR_TEXT);
  10601. }
  10602. n = toInteger(n);
  10603. return function() {
  10604. if (--n > 0) {
  10605. result = func.apply(this, arguments);
  10606. }
  10607. if (n <= 1) {
  10608. func = undefined;
  10609. }
  10610. return result;
  10611. };
  10612. }
  10613. /**
  10614. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10615. * and `partials` prepended to the arguments it receives.
  10616. *
  10617. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10618. * may be used as a placeholder for partially applied arguments.
  10619. *
  10620. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10621. * property of bound functions.
  10622. *
  10623. * @static
  10624. * @memberOf _
  10625. * @since 0.1.0
  10626. * @category Function
  10627. * @param {Function} func The function to bind.
  10628. * @param {*} thisArg The `this` binding of `func`.
  10629. * @param {...*} [partials] The arguments to be partially applied.
  10630. * @returns {Function} Returns the new bound function.
  10631. * @example
  10632. *
  10633. * function greet(greeting, punctuation) {
  10634. * return greeting + ' ' + this.user + punctuation;
  10635. * }
  10636. *
  10637. * var object = { 'user': 'fred' };
  10638. *
  10639. * var bound = _.bind(greet, object, 'hi');
  10640. * bound('!');
  10641. * // => 'hi fred!'
  10642. *
  10643. * // Bound with placeholders.
  10644. * var bound = _.bind(greet, object, _, '!');
  10645. * bound('hi');
  10646. * // => 'hi fred!'
  10647. */
  10648. var bind = baseRest(function(func, thisArg, partials) {
  10649. var bitmask = WRAP_BIND_FLAG;
  10650. if (partials.length) {
  10651. var holders = replaceHolders(partials, getHolder(bind));
  10652. bitmask |= WRAP_PARTIAL_FLAG;
  10653. }
  10654. return createWrap(func, bitmask, thisArg, partials, holders);
  10655. });
  10656. /**
  10657. * Creates a function that invokes the method at `object[key]` with `partials`
  10658. * prepended to the arguments it receives.
  10659. *
  10660. * This method differs from `_.bind` by allowing bound functions to reference
  10661. * methods that may be redefined or don't yet exist. See
  10662. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10663. * for more details.
  10664. *
  10665. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10666. * builds, may be used as a placeholder for partially applied arguments.
  10667. *
  10668. * @static
  10669. * @memberOf _
  10670. * @since 0.10.0
  10671. * @category Function
  10672. * @param {Object} object The object to invoke the method on.
  10673. * @param {string} key The key of the method.
  10674. * @param {...*} [partials] The arguments to be partially applied.
  10675. * @returns {Function} Returns the new bound function.
  10676. * @example
  10677. *
  10678. * var object = {
  10679. * 'user': 'fred',
  10680. * 'greet': function(greeting, punctuation) {
  10681. * return greeting + ' ' + this.user + punctuation;
  10682. * }
  10683. * };
  10684. *
  10685. * var bound = _.bindKey(object, 'greet', 'hi');
  10686. * bound('!');
  10687. * // => 'hi fred!'
  10688. *
  10689. * object.greet = function(greeting, punctuation) {
  10690. * return greeting + 'ya ' + this.user + punctuation;
  10691. * };
  10692. *
  10693. * bound('!');
  10694. * // => 'hiya fred!'
  10695. *
  10696. * // Bound with placeholders.
  10697. * var bound = _.bindKey(object, 'greet', _, '!');
  10698. * bound('hi');
  10699. * // => 'hiya fred!'
  10700. */
  10701. var bindKey = baseRest(function(object, key, partials) {
  10702. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10703. if (partials.length) {
  10704. var holders = replaceHolders(partials, getHolder(bindKey));
  10705. bitmask |= WRAP_PARTIAL_FLAG;
  10706. }
  10707. return createWrap(key, bitmask, object, partials, holders);
  10708. });
  10709. /**
  10710. * Creates a function that accepts arguments of `func` and either invokes
  10711. * `func` returning its result, if at least `arity` number of arguments have
  10712. * been provided, or returns a function that accepts the remaining `func`
  10713. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10714. * is not sufficient.
  10715. *
  10716. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10717. * may be used as a placeholder for provided arguments.
  10718. *
  10719. * **Note:** This method doesn't set the "length" property of curried functions.
  10720. *
  10721. * @static
  10722. * @memberOf _
  10723. * @since 2.0.0
  10724. * @category Function
  10725. * @param {Function} func The function to curry.
  10726. * @param {number} [arity=func.length] The arity of `func`.
  10727. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10728. * @returns {Function} Returns the new curried function.
  10729. * @example
  10730. *
  10731. * var abc = function(a, b, c) {
  10732. * return [a, b, c];
  10733. * };
  10734. *
  10735. * var curried = _.curry(abc);
  10736. *
  10737. * curried(1)(2)(3);
  10738. * // => [1, 2, 3]
  10739. *
  10740. * curried(1, 2)(3);
  10741. * // => [1, 2, 3]
  10742. *
  10743. * curried(1, 2, 3);
  10744. * // => [1, 2, 3]
  10745. *
  10746. * // Curried with placeholders.
  10747. * curried(1)(_, 3)(2);
  10748. * // => [1, 2, 3]
  10749. */
  10750. function curry(func, arity, guard) {
  10751. arity = guard ? undefined : arity;
  10752. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10753. result.placeholder = curry.placeholder;
  10754. return result;
  10755. }
  10756. /**
  10757. * This method is like `_.curry` except that arguments are applied to `func`
  10758. * in the manner of `_.partialRight` instead of `_.partial`.
  10759. *
  10760. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10761. * builds, may be used as a placeholder for provided arguments.
  10762. *
  10763. * **Note:** This method doesn't set the "length" property of curried functions.
  10764. *
  10765. * @static
  10766. * @memberOf _
  10767. * @since 3.0.0
  10768. * @category Function
  10769. * @param {Function} func The function to curry.
  10770. * @param {number} [arity=func.length] The arity of `func`.
  10771. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10772. * @returns {Function} Returns the new curried function.
  10773. * @example
  10774. *
  10775. * var abc = function(a, b, c) {
  10776. * return [a, b, c];
  10777. * };
  10778. *
  10779. * var curried = _.curryRight(abc);
  10780. *
  10781. * curried(3)(2)(1);
  10782. * // => [1, 2, 3]
  10783. *
  10784. * curried(2, 3)(1);
  10785. * // => [1, 2, 3]
  10786. *
  10787. * curried(1, 2, 3);
  10788. * // => [1, 2, 3]
  10789. *
  10790. * // Curried with placeholders.
  10791. * curried(3)(1, _)(2);
  10792. * // => [1, 2, 3]
  10793. */
  10794. function curryRight(func, arity, guard) {
  10795. arity = guard ? undefined : arity;
  10796. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10797. result.placeholder = curryRight.placeholder;
  10798. return result;
  10799. }
  10800. /**
  10801. * Creates a debounced function that delays invoking `func` until after `wait`
  10802. * milliseconds have elapsed since the last time the debounced function was
  10803. * invoked. The debounced function comes with a `cancel` method to cancel
  10804. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10805. * Provide `options` to indicate whether `func` should be invoked on the
  10806. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10807. * with the last arguments provided to the debounced function. Subsequent
  10808. * calls to the debounced function return the result of the last `func`
  10809. * invocation.
  10810. *
  10811. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10812. * invoked on the trailing edge of the timeout only if the debounced function
  10813. * is invoked more than once during the `wait` timeout.
  10814. *
  10815. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10816. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10817. *
  10818. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10819. * for details over the differences between `_.debounce` and `_.throttle`.
  10820. *
  10821. * @static
  10822. * @memberOf _
  10823. * @since 0.1.0
  10824. * @category Function
  10825. * @param {Function} func The function to debounce.
  10826. * @param {number} [wait=0] The number of milliseconds to delay.
  10827. * @param {Object} [options={}] The options object.
  10828. * @param {boolean} [options.leading=false]
  10829. * Specify invoking on the leading edge of the timeout.
  10830. * @param {number} [options.maxWait]
  10831. * The maximum time `func` is allowed to be delayed before it's invoked.
  10832. * @param {boolean} [options.trailing=true]
  10833. * Specify invoking on the trailing edge of the timeout.
  10834. * @returns {Function} Returns the new debounced function.
  10835. * @example
  10836. *
  10837. * // Avoid costly calculations while the window size is in flux.
  10838. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10839. *
  10840. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10841. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10842. * 'leading': true,
  10843. * 'trailing': false
  10844. * }));
  10845. *
  10846. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10847. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10848. * var source = new EventSource('/stream');
  10849. * jQuery(source).on('message', debounced);
  10850. *
  10851. * // Cancel the trailing debounced invocation.
  10852. * jQuery(window).on('popstate', debounced.cancel);
  10853. */
  10854. function debounce(func, wait, options) {
  10855. var lastArgs,
  10856. lastThis,
  10857. maxWait,
  10858. result,
  10859. timerId,
  10860. lastCallTime,
  10861. lastInvokeTime = 0,
  10862. leading = false,
  10863. maxing = false,
  10864. trailing = true;
  10865. if (typeof func != 'function') {
  10866. throw new TypeError(FUNC_ERROR_TEXT);
  10867. }
  10868. wait = toNumber(wait) || 0;
  10869. if (isObject(options)) {
  10870. leading = !!options.leading;
  10871. maxing = 'maxWait' in options;
  10872. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10873. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10874. }
  10875. function invokeFunc(time) {
  10876. var args = lastArgs,
  10877. thisArg = lastThis;
  10878. lastArgs = lastThis = undefined;
  10879. lastInvokeTime = time;
  10880. result = func.apply(thisArg, args);
  10881. return result;
  10882. }
  10883. function leadingEdge(time) {
  10884. // Reset any `maxWait` timer.
  10885. lastInvokeTime = time;
  10886. // Start the timer for the trailing edge.
  10887. timerId = setTimeout(timerExpired, wait);
  10888. // Invoke the leading edge.
  10889. return leading ? invokeFunc(time) : result;
  10890. }
  10891. function remainingWait(time) {
  10892. var timeSinceLastCall = time - lastCallTime,
  10893. timeSinceLastInvoke = time - lastInvokeTime,
  10894. timeWaiting = wait - timeSinceLastCall;
  10895. return maxing
  10896. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10897. : timeWaiting;
  10898. }
  10899. function shouldInvoke(time) {
  10900. var timeSinceLastCall = time - lastCallTime,
  10901. timeSinceLastInvoke = time - lastInvokeTime;
  10902. // Either this is the first call, activity has stopped and we're at the
  10903. // trailing edge, the system time has gone backwards and we're treating
  10904. // it as the trailing edge, or we've hit the `maxWait` limit.
  10905. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10906. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10907. }
  10908. function timerExpired() {
  10909. var time = now();
  10910. if (shouldInvoke(time)) {
  10911. return trailingEdge(time);
  10912. }
  10913. // Restart the timer.
  10914. timerId = setTimeout(timerExpired, remainingWait(time));
  10915. }
  10916. function trailingEdge(time) {
  10917. timerId = undefined;
  10918. // Only invoke if we have `lastArgs` which means `func` has been
  10919. // debounced at least once.
  10920. if (trailing && lastArgs) {
  10921. return invokeFunc(time);
  10922. }
  10923. lastArgs = lastThis = undefined;
  10924. return result;
  10925. }
  10926. function cancel() {
  10927. if (timerId !== undefined) {
  10928. clearTimeout(timerId);
  10929. }
  10930. lastInvokeTime = 0;
  10931. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10932. }
  10933. function flush() {
  10934. return timerId === undefined ? result : trailingEdge(now());
  10935. }
  10936. function debounced() {
  10937. var time = now(),
  10938. isInvoking = shouldInvoke(time);
  10939. lastArgs = arguments;
  10940. lastThis = this;
  10941. lastCallTime = time;
  10942. if (isInvoking) {
  10943. if (timerId === undefined) {
  10944. return leadingEdge(lastCallTime);
  10945. }
  10946. if (maxing) {
  10947. // Handle invocations in a tight loop.
  10948. clearTimeout(timerId);
  10949. timerId = setTimeout(timerExpired, wait);
  10950. return invokeFunc(lastCallTime);
  10951. }
  10952. }
  10953. if (timerId === undefined) {
  10954. timerId = setTimeout(timerExpired, wait);
  10955. }
  10956. return result;
  10957. }
  10958. debounced.cancel = cancel;
  10959. debounced.flush = flush;
  10960. return debounced;
  10961. }
  10962. /**
  10963. * Defers invoking the `func` until the current call stack has cleared. Any
  10964. * additional arguments are provided to `func` when it's invoked.
  10965. *
  10966. * @static
  10967. * @memberOf _
  10968. * @since 0.1.0
  10969. * @category Function
  10970. * @param {Function} func The function to defer.
  10971. * @param {...*} [args] The arguments to invoke `func` with.
  10972. * @returns {number} Returns the timer id.
  10973. * @example
  10974. *
  10975. * _.defer(function(text) {
  10976. * console.log(text);
  10977. * }, 'deferred');
  10978. * // => Logs 'deferred' after one millisecond.
  10979. */
  10980. var defer = baseRest(function(func, args) {
  10981. return baseDelay(func, 1, args);
  10982. });
  10983. /**
  10984. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10985. * provided to `func` when it's invoked.
  10986. *
  10987. * @static
  10988. * @memberOf _
  10989. * @since 0.1.0
  10990. * @category Function
  10991. * @param {Function} func The function to delay.
  10992. * @param {number} wait The number of milliseconds to delay invocation.
  10993. * @param {...*} [args] The arguments to invoke `func` with.
  10994. * @returns {number} Returns the timer id.
  10995. * @example
  10996. *
  10997. * _.delay(function(text) {
  10998. * console.log(text);
  10999. * }, 1000, 'later');
  11000. * // => Logs 'later' after one second.
  11001. */
  11002. var delay = baseRest(function(func, wait, args) {
  11003. return baseDelay(func, toNumber(wait) || 0, args);
  11004. });
  11005. /**
  11006. * Creates a function that invokes `func` with arguments reversed.
  11007. *
  11008. * @static
  11009. * @memberOf _
  11010. * @since 4.0.0
  11011. * @category Function
  11012. * @param {Function} func The function to flip arguments for.
  11013. * @returns {Function} Returns the new flipped function.
  11014. * @example
  11015. *
  11016. * var flipped = _.flip(function() {
  11017. * return _.toArray(arguments);
  11018. * });
  11019. *
  11020. * flipped('a', 'b', 'c', 'd');
  11021. * // => ['d', 'c', 'b', 'a']
  11022. */
  11023. function flip(func) {
  11024. return createWrap(func, WRAP_FLIP_FLAG);
  11025. }
  11026. /**
  11027. * Creates a function that memoizes the result of `func`. If `resolver` is
  11028. * provided, it determines the cache key for storing the result based on the
  11029. * arguments provided to the memoized function. By default, the first argument
  11030. * provided to the memoized function is used as the map cache key. The `func`
  11031. * is invoked with the `this` binding of the memoized function.
  11032. *
  11033. * **Note:** The cache is exposed as the `cache` property on the memoized
  11034. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11035. * constructor with one whose instances implement the
  11036. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11037. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11038. *
  11039. * @static
  11040. * @memberOf _
  11041. * @since 0.1.0
  11042. * @category Function
  11043. * @param {Function} func The function to have its output memoized.
  11044. * @param {Function} [resolver] The function to resolve the cache key.
  11045. * @returns {Function} Returns the new memoized function.
  11046. * @example
  11047. *
  11048. * var object = { 'a': 1, 'b': 2 };
  11049. * var other = { 'c': 3, 'd': 4 };
  11050. *
  11051. * var values = _.memoize(_.values);
  11052. * values(object);
  11053. * // => [1, 2]
  11054. *
  11055. * values(other);
  11056. * // => [3, 4]
  11057. *
  11058. * object.a = 2;
  11059. * values(object);
  11060. * // => [1, 2]
  11061. *
  11062. * // Modify the result cache.
  11063. * values.cache.set(object, ['a', 'b']);
  11064. * values(object);
  11065. * // => ['a', 'b']
  11066. *
  11067. * // Replace `_.memoize.Cache`.
  11068. * _.memoize.Cache = WeakMap;
  11069. */
  11070. function memoize(func, resolver) {
  11071. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11072. throw new TypeError(FUNC_ERROR_TEXT);
  11073. }
  11074. var memoized = function() {
  11075. var args = arguments,
  11076. key = resolver ? resolver.apply(this, args) : args[0],
  11077. cache = memoized.cache;
  11078. if (cache.has(key)) {
  11079. return cache.get(key);
  11080. }
  11081. var result = func.apply(this, args);
  11082. memoized.cache = cache.set(key, result) || cache;
  11083. return result;
  11084. };
  11085. memoized.cache = new (memoize.Cache || MapCache);
  11086. return memoized;
  11087. }
  11088. // Expose `MapCache`.
  11089. memoize.Cache = MapCache;
  11090. /**
  11091. * Creates a function that negates the result of the predicate `func`. The
  11092. * `func` predicate is invoked with the `this` binding and arguments of the
  11093. * created function.
  11094. *
  11095. * @static
  11096. * @memberOf _
  11097. * @since 3.0.0
  11098. * @category Function
  11099. * @param {Function} predicate The predicate to negate.
  11100. * @returns {Function} Returns the new negated function.
  11101. * @example
  11102. *
  11103. * function isEven(n) {
  11104. * return n % 2 == 0;
  11105. * }
  11106. *
  11107. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11108. * // => [1, 3, 5]
  11109. */
  11110. function negate(predicate) {
  11111. if (typeof predicate != 'function') {
  11112. throw new TypeError(FUNC_ERROR_TEXT);
  11113. }
  11114. return function() {
  11115. var args = arguments;
  11116. switch (args.length) {
  11117. case 0: return !predicate.call(this);
  11118. case 1: return !predicate.call(this, args[0]);
  11119. case 2: return !predicate.call(this, args[0], args[1]);
  11120. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11121. }
  11122. return !predicate.apply(this, args);
  11123. };
  11124. }
  11125. /**
  11126. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11127. * to the function return the value of the first invocation. The `func` is
  11128. * invoked with the `this` binding and arguments of the created function.
  11129. *
  11130. * @static
  11131. * @memberOf _
  11132. * @since 0.1.0
  11133. * @category Function
  11134. * @param {Function} func The function to restrict.
  11135. * @returns {Function} Returns the new restricted function.
  11136. * @example
  11137. *
  11138. * var initialize = _.once(createApplication);
  11139. * initialize();
  11140. * initialize();
  11141. * // => `createApplication` is invoked once
  11142. */
  11143. function once(func) {
  11144. return before(2, func);
  11145. }
  11146. /**
  11147. * Creates a function that invokes `func` with its arguments transformed.
  11148. *
  11149. * @static
  11150. * @since 4.0.0
  11151. * @memberOf _
  11152. * @category Function
  11153. * @param {Function} func The function to wrap.
  11154. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11155. * The argument transforms.
  11156. * @returns {Function} Returns the new function.
  11157. * @example
  11158. *
  11159. * function doubled(n) {
  11160. * return n * 2;
  11161. * }
  11162. *
  11163. * function square(n) {
  11164. * return n * n;
  11165. * }
  11166. *
  11167. * var func = _.overArgs(function(x, y) {
  11168. * return [x, y];
  11169. * }, [square, doubled]);
  11170. *
  11171. * func(9, 3);
  11172. * // => [81, 6]
  11173. *
  11174. * func(10, 5);
  11175. * // => [100, 10]
  11176. */
  11177. var overArgs = castRest(function(func, transforms) {
  11178. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11179. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11180. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11181. var funcsLength = transforms.length;
  11182. return baseRest(function(args) {
  11183. var index = -1,
  11184. length = nativeMin(args.length, funcsLength);
  11185. while (++index < length) {
  11186. args[index] = transforms[index].call(this, args[index]);
  11187. }
  11188. return apply(func, this, args);
  11189. });
  11190. });
  11191. /**
  11192. * Creates a function that invokes `func` with `partials` prepended to the
  11193. * arguments it receives. This method is like `_.bind` except it does **not**
  11194. * alter the `this` binding.
  11195. *
  11196. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11197. * builds, may be used as a placeholder for partially applied arguments.
  11198. *
  11199. * **Note:** This method doesn't set the "length" property of partially
  11200. * applied functions.
  11201. *
  11202. * @static
  11203. * @memberOf _
  11204. * @since 0.2.0
  11205. * @category Function
  11206. * @param {Function} func The function to partially apply arguments to.
  11207. * @param {...*} [partials] The arguments to be partially applied.
  11208. * @returns {Function} Returns the new partially applied function.
  11209. * @example
  11210. *
  11211. * function greet(greeting, name) {
  11212. * return greeting + ' ' + name;
  11213. * }
  11214. *
  11215. * var sayHelloTo = _.partial(greet, 'hello');
  11216. * sayHelloTo('fred');
  11217. * // => 'hello fred'
  11218. *
  11219. * // Partially applied with placeholders.
  11220. * var greetFred = _.partial(greet, _, 'fred');
  11221. * greetFred('hi');
  11222. * // => 'hi fred'
  11223. */
  11224. var partial = baseRest(function(func, partials) {
  11225. var holders = replaceHolders(partials, getHolder(partial));
  11226. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11227. });
  11228. /**
  11229. * This method is like `_.partial` except that partially applied arguments
  11230. * are appended to the arguments it receives.
  11231. *
  11232. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11233. * builds, may be used as a placeholder for partially applied arguments.
  11234. *
  11235. * **Note:** This method doesn't set the "length" property of partially
  11236. * applied functions.
  11237. *
  11238. * @static
  11239. * @memberOf _
  11240. * @since 1.0.0
  11241. * @category Function
  11242. * @param {Function} func The function to partially apply arguments to.
  11243. * @param {...*} [partials] The arguments to be partially applied.
  11244. * @returns {Function} Returns the new partially applied function.
  11245. * @example
  11246. *
  11247. * function greet(greeting, name) {
  11248. * return greeting + ' ' + name;
  11249. * }
  11250. *
  11251. * var greetFred = _.partialRight(greet, 'fred');
  11252. * greetFred('hi');
  11253. * // => 'hi fred'
  11254. *
  11255. * // Partially applied with placeholders.
  11256. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11257. * sayHelloTo('fred');
  11258. * // => 'hello fred'
  11259. */
  11260. var partialRight = baseRest(function(func, partials) {
  11261. var holders = replaceHolders(partials, getHolder(partialRight));
  11262. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11263. });
  11264. /**
  11265. * Creates a function that invokes `func` with arguments arranged according
  11266. * to the specified `indexes` where the argument value at the first index is
  11267. * provided as the first argument, the argument value at the second index is
  11268. * provided as the second argument, and so on.
  11269. *
  11270. * @static
  11271. * @memberOf _
  11272. * @since 3.0.0
  11273. * @category Function
  11274. * @param {Function} func The function to rearrange arguments for.
  11275. * @param {...(number|number[])} indexes The arranged argument indexes.
  11276. * @returns {Function} Returns the new function.
  11277. * @example
  11278. *
  11279. * var rearged = _.rearg(function(a, b, c) {
  11280. * return [a, b, c];
  11281. * }, [2, 0, 1]);
  11282. *
  11283. * rearged('b', 'c', 'a')
  11284. * // => ['a', 'b', 'c']
  11285. */
  11286. var rearg = flatRest(function(func, indexes) {
  11287. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11288. });
  11289. /**
  11290. * Creates a function that invokes `func` with the `this` binding of the
  11291. * created function and arguments from `start` and beyond provided as
  11292. * an array.
  11293. *
  11294. * **Note:** This method is based on the
  11295. * [rest parameter](https://mdn.io/rest_parameters).
  11296. *
  11297. * @static
  11298. * @memberOf _
  11299. * @since 4.0.0
  11300. * @category Function
  11301. * @param {Function} func The function to apply a rest parameter to.
  11302. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11303. * @returns {Function} Returns the new function.
  11304. * @example
  11305. *
  11306. * var say = _.rest(function(what, names) {
  11307. * return what + ' ' + _.initial(names).join(', ') +
  11308. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11309. * });
  11310. *
  11311. * say('hello', 'fred', 'barney', 'pebbles');
  11312. * // => 'hello fred, barney, & pebbles'
  11313. */
  11314. function rest(func, start) {
  11315. if (typeof func != 'function') {
  11316. throw new TypeError(FUNC_ERROR_TEXT);
  11317. }
  11318. start = start === undefined ? start : toInteger(start);
  11319. return baseRest(func, start);
  11320. }
  11321. /**
  11322. * Creates a function that invokes `func` with the `this` binding of the
  11323. * create function and an array of arguments much like
  11324. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11325. *
  11326. * **Note:** This method is based on the
  11327. * [spread operator](https://mdn.io/spread_operator).
  11328. *
  11329. * @static
  11330. * @memberOf _
  11331. * @since 3.2.0
  11332. * @category Function
  11333. * @param {Function} func The function to spread arguments over.
  11334. * @param {number} [start=0] The start position of the spread.
  11335. * @returns {Function} Returns the new function.
  11336. * @example
  11337. *
  11338. * var say = _.spread(function(who, what) {
  11339. * return who + ' says ' + what;
  11340. * });
  11341. *
  11342. * say(['fred', 'hello']);
  11343. * // => 'fred says hello'
  11344. *
  11345. * var numbers = Promise.all([
  11346. * Promise.resolve(40),
  11347. * Promise.resolve(36)
  11348. * ]);
  11349. *
  11350. * numbers.then(_.spread(function(x, y) {
  11351. * return x + y;
  11352. * }));
  11353. * // => a Promise of 76
  11354. */
  11355. function spread(func, start) {
  11356. if (typeof func != 'function') {
  11357. throw new TypeError(FUNC_ERROR_TEXT);
  11358. }
  11359. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11360. return baseRest(function(args) {
  11361. var array = args[start],
  11362. otherArgs = castSlice(args, 0, start);
  11363. if (array) {
  11364. arrayPush(otherArgs, array);
  11365. }
  11366. return apply(func, this, otherArgs);
  11367. });
  11368. }
  11369. /**
  11370. * Creates a throttled function that only invokes `func` at most once per
  11371. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11372. * method to cancel delayed `func` invocations and a `flush` method to
  11373. * immediately invoke them. Provide `options` to indicate whether `func`
  11374. * should be invoked on the leading and/or trailing edge of the `wait`
  11375. * timeout. The `func` is invoked with the last arguments provided to the
  11376. * throttled function. Subsequent calls to the throttled function return the
  11377. * result of the last `func` invocation.
  11378. *
  11379. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11380. * invoked on the trailing edge of the timeout only if the throttled function
  11381. * is invoked more than once during the `wait` timeout.
  11382. *
  11383. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11384. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11385. *
  11386. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11387. * for details over the differences between `_.throttle` and `_.debounce`.
  11388. *
  11389. * @static
  11390. * @memberOf _
  11391. * @since 0.1.0
  11392. * @category Function
  11393. * @param {Function} func The function to throttle.
  11394. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11395. * @param {Object} [options={}] The options object.
  11396. * @param {boolean} [options.leading=true]
  11397. * Specify invoking on the leading edge of the timeout.
  11398. * @param {boolean} [options.trailing=true]
  11399. * Specify invoking on the trailing edge of the timeout.
  11400. * @returns {Function} Returns the new throttled function.
  11401. * @example
  11402. *
  11403. * // Avoid excessively updating the position while scrolling.
  11404. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11405. *
  11406. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11407. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11408. * jQuery(element).on('click', throttled);
  11409. *
  11410. * // Cancel the trailing throttled invocation.
  11411. * jQuery(window).on('popstate', throttled.cancel);
  11412. */
  11413. function throttle(func, wait, options) {
  11414. var leading = true,
  11415. trailing = true;
  11416. if (typeof func != 'function') {
  11417. throw new TypeError(FUNC_ERROR_TEXT);
  11418. }
  11419. if (isObject(options)) {
  11420. leading = 'leading' in options ? !!options.leading : leading;
  11421. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11422. }
  11423. return debounce(func, wait, {
  11424. 'leading': leading,
  11425. 'maxWait': wait,
  11426. 'trailing': trailing
  11427. });
  11428. }
  11429. /**
  11430. * Creates a function that accepts up to one argument, ignoring any
  11431. * additional arguments.
  11432. *
  11433. * @static
  11434. * @memberOf _
  11435. * @since 4.0.0
  11436. * @category Function
  11437. * @param {Function} func The function to cap arguments for.
  11438. * @returns {Function} Returns the new capped function.
  11439. * @example
  11440. *
  11441. * _.map(['6', '8', '10'], _.unary(parseInt));
  11442. * // => [6, 8, 10]
  11443. */
  11444. function unary(func) {
  11445. return ary(func, 1);
  11446. }
  11447. /**
  11448. * Creates a function that provides `value` to `wrapper` as its first
  11449. * argument. Any additional arguments provided to the function are appended
  11450. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11451. * binding of the created function.
  11452. *
  11453. * @static
  11454. * @memberOf _
  11455. * @since 0.1.0
  11456. * @category Function
  11457. * @param {*} value The value to wrap.
  11458. * @param {Function} [wrapper=identity] The wrapper function.
  11459. * @returns {Function} Returns the new function.
  11460. * @example
  11461. *
  11462. * var p = _.wrap(_.escape, function(func, text) {
  11463. * return '<p>' + func(text) + '</p>';
  11464. * });
  11465. *
  11466. * p('fred, barney, & pebbles');
  11467. * // => '<p>fred, barney, &amp; pebbles</p>'
  11468. */
  11469. function wrap(value, wrapper) {
  11470. return partial(castFunction(wrapper), value);
  11471. }
  11472. /*------------------------------------------------------------------------*/
  11473. /**
  11474. * Casts `value` as an array if it's not one.
  11475. *
  11476. * @static
  11477. * @memberOf _
  11478. * @since 4.4.0
  11479. * @category Lang
  11480. * @param {*} value The value to inspect.
  11481. * @returns {Array} Returns the cast array.
  11482. * @example
  11483. *
  11484. * _.castArray(1);
  11485. * // => [1]
  11486. *
  11487. * _.castArray({ 'a': 1 });
  11488. * // => [{ 'a': 1 }]
  11489. *
  11490. * _.castArray('abc');
  11491. * // => ['abc']
  11492. *
  11493. * _.castArray(null);
  11494. * // => [null]
  11495. *
  11496. * _.castArray(undefined);
  11497. * // => [undefined]
  11498. *
  11499. * _.castArray();
  11500. * // => []
  11501. *
  11502. * var array = [1, 2, 3];
  11503. * console.log(_.castArray(array) === array);
  11504. * // => true
  11505. */
  11506. function castArray() {
  11507. if (!arguments.length) {
  11508. return [];
  11509. }
  11510. var value = arguments[0];
  11511. return isArray(value) ? value : [value];
  11512. }
  11513. /**
  11514. * Creates a shallow clone of `value`.
  11515. *
  11516. * **Note:** This method is loosely based on the
  11517. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11518. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11519. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11520. * arrays. The own enumerable properties of `arguments` objects are cloned
  11521. * as plain objects. An empty object is returned for uncloneable values such
  11522. * as error objects, functions, DOM nodes, and WeakMaps.
  11523. *
  11524. * @static
  11525. * @memberOf _
  11526. * @since 0.1.0
  11527. * @category Lang
  11528. * @param {*} value The value to clone.
  11529. * @returns {*} Returns the cloned value.
  11530. * @see _.cloneDeep
  11531. * @example
  11532. *
  11533. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11534. *
  11535. * var shallow = _.clone(objects);
  11536. * console.log(shallow[0] === objects[0]);
  11537. * // => true
  11538. */
  11539. function clone(value) {
  11540. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11541. }
  11542. /**
  11543. * This method is like `_.clone` except that it accepts `customizer` which
  11544. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11545. * cloning is handled by the method instead. The `customizer` is invoked with
  11546. * up to four arguments; (value [, index|key, object, stack]).
  11547. *
  11548. * @static
  11549. * @memberOf _
  11550. * @since 4.0.0
  11551. * @category Lang
  11552. * @param {*} value The value to clone.
  11553. * @param {Function} [customizer] The function to customize cloning.
  11554. * @returns {*} Returns the cloned value.
  11555. * @see _.cloneDeepWith
  11556. * @example
  11557. *
  11558. * function customizer(value) {
  11559. * if (_.isElement(value)) {
  11560. * return value.cloneNode(false);
  11561. * }
  11562. * }
  11563. *
  11564. * var el = _.cloneWith(document.body, customizer);
  11565. *
  11566. * console.log(el === document.body);
  11567. * // => false
  11568. * console.log(el.nodeName);
  11569. * // => 'BODY'
  11570. * console.log(el.childNodes.length);
  11571. * // => 0
  11572. */
  11573. function cloneWith(value, customizer) {
  11574. customizer = typeof customizer == 'function' ? customizer : undefined;
  11575. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11576. }
  11577. /**
  11578. * This method is like `_.clone` except that it recursively clones `value`.
  11579. *
  11580. * @static
  11581. * @memberOf _
  11582. * @since 1.0.0
  11583. * @category Lang
  11584. * @param {*} value The value to recursively clone.
  11585. * @returns {*} Returns the deep cloned value.
  11586. * @see _.clone
  11587. * @example
  11588. *
  11589. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11590. *
  11591. * var deep = _.cloneDeep(objects);
  11592. * console.log(deep[0] === objects[0]);
  11593. * // => false
  11594. */
  11595. function cloneDeep(value) {
  11596. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11597. }
  11598. /**
  11599. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11600. *
  11601. * @static
  11602. * @memberOf _
  11603. * @since 4.0.0
  11604. * @category Lang
  11605. * @param {*} value The value to recursively clone.
  11606. * @param {Function} [customizer] The function to customize cloning.
  11607. * @returns {*} Returns the deep cloned value.
  11608. * @see _.cloneWith
  11609. * @example
  11610. *
  11611. * function customizer(value) {
  11612. * if (_.isElement(value)) {
  11613. * return value.cloneNode(true);
  11614. * }
  11615. * }
  11616. *
  11617. * var el = _.cloneDeepWith(document.body, customizer);
  11618. *
  11619. * console.log(el === document.body);
  11620. * // => false
  11621. * console.log(el.nodeName);
  11622. * // => 'BODY'
  11623. * console.log(el.childNodes.length);
  11624. * // => 20
  11625. */
  11626. function cloneDeepWith(value, customizer) {
  11627. customizer = typeof customizer == 'function' ? customizer : undefined;
  11628. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11629. }
  11630. /**
  11631. * Checks if `object` conforms to `source` by invoking the predicate
  11632. * properties of `source` with the corresponding property values of `object`.
  11633. *
  11634. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11635. * partially applied.
  11636. *
  11637. * @static
  11638. * @memberOf _
  11639. * @since 4.14.0
  11640. * @category Lang
  11641. * @param {Object} object The object to inspect.
  11642. * @param {Object} source The object of property predicates to conform to.
  11643. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11644. * @example
  11645. *
  11646. * var object = { 'a': 1, 'b': 2 };
  11647. *
  11648. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11649. * // => true
  11650. *
  11651. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11652. * // => false
  11653. */
  11654. function conformsTo(object, source) {
  11655. return source == null || baseConformsTo(object, source, keys(source));
  11656. }
  11657. /**
  11658. * Performs a
  11659. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11660. * comparison between two values to determine if they are equivalent.
  11661. *
  11662. * @static
  11663. * @memberOf _
  11664. * @since 4.0.0
  11665. * @category Lang
  11666. * @param {*} value The value to compare.
  11667. * @param {*} other The other value to compare.
  11668. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11669. * @example
  11670. *
  11671. * var object = { 'a': 1 };
  11672. * var other = { 'a': 1 };
  11673. *
  11674. * _.eq(object, object);
  11675. * // => true
  11676. *
  11677. * _.eq(object, other);
  11678. * // => false
  11679. *
  11680. * _.eq('a', 'a');
  11681. * // => true
  11682. *
  11683. * _.eq('a', Object('a'));
  11684. * // => false
  11685. *
  11686. * _.eq(NaN, NaN);
  11687. * // => true
  11688. */
  11689. function eq(value, other) {
  11690. return value === other || (value !== value && other !== other);
  11691. }
  11692. /**
  11693. * Checks if `value` is greater than `other`.
  11694. *
  11695. * @static
  11696. * @memberOf _
  11697. * @since 3.9.0
  11698. * @category Lang
  11699. * @param {*} value The value to compare.
  11700. * @param {*} other The other value to compare.
  11701. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11702. * else `false`.
  11703. * @see _.lt
  11704. * @example
  11705. *
  11706. * _.gt(3, 1);
  11707. * // => true
  11708. *
  11709. * _.gt(3, 3);
  11710. * // => false
  11711. *
  11712. * _.gt(1, 3);
  11713. * // => false
  11714. */
  11715. var gt = createRelationalOperation(baseGt);
  11716. /**
  11717. * Checks if `value` is greater than or equal to `other`.
  11718. *
  11719. * @static
  11720. * @memberOf _
  11721. * @since 3.9.0
  11722. * @category Lang
  11723. * @param {*} value The value to compare.
  11724. * @param {*} other The other value to compare.
  11725. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11726. * `other`, else `false`.
  11727. * @see _.lte
  11728. * @example
  11729. *
  11730. * _.gte(3, 1);
  11731. * // => true
  11732. *
  11733. * _.gte(3, 3);
  11734. * // => true
  11735. *
  11736. * _.gte(1, 3);
  11737. * // => false
  11738. */
  11739. var gte = createRelationalOperation(function(value, other) {
  11740. return value >= other;
  11741. });
  11742. /**
  11743. * Checks if `value` is likely an `arguments` object.
  11744. *
  11745. * @static
  11746. * @memberOf _
  11747. * @since 0.1.0
  11748. * @category Lang
  11749. * @param {*} value The value to check.
  11750. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11751. * else `false`.
  11752. * @example
  11753. *
  11754. * _.isArguments(function() { return arguments; }());
  11755. * // => true
  11756. *
  11757. * _.isArguments([1, 2, 3]);
  11758. * // => false
  11759. */
  11760. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11761. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11762. !propertyIsEnumerable.call(value, 'callee');
  11763. };
  11764. /**
  11765. * Checks if `value` is classified as an `Array` object.
  11766. *
  11767. * @static
  11768. * @memberOf _
  11769. * @since 0.1.0
  11770. * @category Lang
  11771. * @param {*} value The value to check.
  11772. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11773. * @example
  11774. *
  11775. * _.isArray([1, 2, 3]);
  11776. * // => true
  11777. *
  11778. * _.isArray(document.body.children);
  11779. * // => false
  11780. *
  11781. * _.isArray('abc');
  11782. * // => false
  11783. *
  11784. * _.isArray(_.noop);
  11785. * // => false
  11786. */
  11787. var isArray = Array.isArray;
  11788. /**
  11789. * Checks if `value` is classified as an `ArrayBuffer` object.
  11790. *
  11791. * @static
  11792. * @memberOf _
  11793. * @since 4.3.0
  11794. * @category Lang
  11795. * @param {*} value The value to check.
  11796. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11797. * @example
  11798. *
  11799. * _.isArrayBuffer(new ArrayBuffer(2));
  11800. * // => true
  11801. *
  11802. * _.isArrayBuffer(new Array(2));
  11803. * // => false
  11804. */
  11805. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11806. /**
  11807. * Checks if `value` is array-like. A value is considered array-like if it's
  11808. * not a function and has a `value.length` that's an integer greater than or
  11809. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11810. *
  11811. * @static
  11812. * @memberOf _
  11813. * @since 4.0.0
  11814. * @category Lang
  11815. * @param {*} value The value to check.
  11816. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11817. * @example
  11818. *
  11819. * _.isArrayLike([1, 2, 3]);
  11820. * // => true
  11821. *
  11822. * _.isArrayLike(document.body.children);
  11823. * // => true
  11824. *
  11825. * _.isArrayLike('abc');
  11826. * // => true
  11827. *
  11828. * _.isArrayLike(_.noop);
  11829. * // => false
  11830. */
  11831. function isArrayLike(value) {
  11832. return value != null && isLength(value.length) && !isFunction(value);
  11833. }
  11834. /**
  11835. * This method is like `_.isArrayLike` except that it also checks if `value`
  11836. * is an object.
  11837. *
  11838. * @static
  11839. * @memberOf _
  11840. * @since 4.0.0
  11841. * @category Lang
  11842. * @param {*} value The value to check.
  11843. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11844. * else `false`.
  11845. * @example
  11846. *
  11847. * _.isArrayLikeObject([1, 2, 3]);
  11848. * // => true
  11849. *
  11850. * _.isArrayLikeObject(document.body.children);
  11851. * // => true
  11852. *
  11853. * _.isArrayLikeObject('abc');
  11854. * // => false
  11855. *
  11856. * _.isArrayLikeObject(_.noop);
  11857. * // => false
  11858. */
  11859. function isArrayLikeObject(value) {
  11860. return isObjectLike(value) && isArrayLike(value);
  11861. }
  11862. /**
  11863. * Checks if `value` is classified as a boolean primitive or object.
  11864. *
  11865. * @static
  11866. * @memberOf _
  11867. * @since 0.1.0
  11868. * @category Lang
  11869. * @param {*} value The value to check.
  11870. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11871. * @example
  11872. *
  11873. * _.isBoolean(false);
  11874. * // => true
  11875. *
  11876. * _.isBoolean(null);
  11877. * // => false
  11878. */
  11879. function isBoolean(value) {
  11880. return value === true || value === false ||
  11881. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11882. }
  11883. /**
  11884. * Checks if `value` is a buffer.
  11885. *
  11886. * @static
  11887. * @memberOf _
  11888. * @since 4.3.0
  11889. * @category Lang
  11890. * @param {*} value The value to check.
  11891. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11892. * @example
  11893. *
  11894. * _.isBuffer(new Buffer(2));
  11895. * // => true
  11896. *
  11897. * _.isBuffer(new Uint8Array(2));
  11898. * // => false
  11899. */
  11900. var isBuffer = nativeIsBuffer || stubFalse;
  11901. /**
  11902. * Checks if `value` is classified as a `Date` object.
  11903. *
  11904. * @static
  11905. * @memberOf _
  11906. * @since 0.1.0
  11907. * @category Lang
  11908. * @param {*} value The value to check.
  11909. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11910. * @example
  11911. *
  11912. * _.isDate(new Date);
  11913. * // => true
  11914. *
  11915. * _.isDate('Mon April 23 2012');
  11916. * // => false
  11917. */
  11918. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11919. /**
  11920. * Checks if `value` is likely a DOM element.
  11921. *
  11922. * @static
  11923. * @memberOf _
  11924. * @since 0.1.0
  11925. * @category Lang
  11926. * @param {*} value The value to check.
  11927. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11928. * @example
  11929. *
  11930. * _.isElement(document.body);
  11931. * // => true
  11932. *
  11933. * _.isElement('<body>');
  11934. * // => false
  11935. */
  11936. function isElement(value) {
  11937. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11938. }
  11939. /**
  11940. * Checks if `value` is an empty object, collection, map, or set.
  11941. *
  11942. * Objects are considered empty if they have no own enumerable string keyed
  11943. * properties.
  11944. *
  11945. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11946. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11947. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11948. *
  11949. * @static
  11950. * @memberOf _
  11951. * @since 0.1.0
  11952. * @category Lang
  11953. * @param {*} value The value to check.
  11954. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11955. * @example
  11956. *
  11957. * _.isEmpty(null);
  11958. * // => true
  11959. *
  11960. * _.isEmpty(true);
  11961. * // => true
  11962. *
  11963. * _.isEmpty(1);
  11964. * // => true
  11965. *
  11966. * _.isEmpty([1, 2, 3]);
  11967. * // => false
  11968. *
  11969. * _.isEmpty({ 'a': 1 });
  11970. * // => false
  11971. */
  11972. function isEmpty(value) {
  11973. if (value == null) {
  11974. return true;
  11975. }
  11976. if (isArrayLike(value) &&
  11977. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11978. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11979. return !value.length;
  11980. }
  11981. var tag = getTag(value);
  11982. if (tag == mapTag || tag == setTag) {
  11983. return !value.size;
  11984. }
  11985. if (isPrototype(value)) {
  11986. return !baseKeys(value).length;
  11987. }
  11988. for (var key in value) {
  11989. if (hasOwnProperty.call(value, key)) {
  11990. return false;
  11991. }
  11992. }
  11993. return true;
  11994. }
  11995. /**
  11996. * Performs a deep comparison between two values to determine if they are
  11997. * equivalent.
  11998. *
  11999. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12000. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12001. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12002. * by their own, not inherited, enumerable properties. Functions and DOM
  12003. * nodes are compared by strict equality, i.e. `===`.
  12004. *
  12005. * @static
  12006. * @memberOf _
  12007. * @since 0.1.0
  12008. * @category Lang
  12009. * @param {*} value The value to compare.
  12010. * @param {*} other The other value to compare.
  12011. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12012. * @example
  12013. *
  12014. * var object = { 'a': 1 };
  12015. * var other = { 'a': 1 };
  12016. *
  12017. * _.isEqual(object, other);
  12018. * // => true
  12019. *
  12020. * object === other;
  12021. * // => false
  12022. */
  12023. function isEqual(value, other) {
  12024. return baseIsEqual(value, other);
  12025. }
  12026. /**
  12027. * This method is like `_.isEqual` except that it accepts `customizer` which
  12028. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12029. * are handled by the method instead. The `customizer` is invoked with up to
  12030. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12031. *
  12032. * @static
  12033. * @memberOf _
  12034. * @since 4.0.0
  12035. * @category Lang
  12036. * @param {*} value The value to compare.
  12037. * @param {*} other The other value to compare.
  12038. * @param {Function} [customizer] The function to customize comparisons.
  12039. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12040. * @example
  12041. *
  12042. * function isGreeting(value) {
  12043. * return /^h(?:i|ello)$/.test(value);
  12044. * }
  12045. *
  12046. * function customizer(objValue, othValue) {
  12047. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12048. * return true;
  12049. * }
  12050. * }
  12051. *
  12052. * var array = ['hello', 'goodbye'];
  12053. * var other = ['hi', 'goodbye'];
  12054. *
  12055. * _.isEqualWith(array, other, customizer);
  12056. * // => true
  12057. */
  12058. function isEqualWith(value, other, customizer) {
  12059. customizer = typeof customizer == 'function' ? customizer : undefined;
  12060. var result = customizer ? customizer(value, other) : undefined;
  12061. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12062. }
  12063. /**
  12064. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12065. * `SyntaxError`, `TypeError`, or `URIError` object.
  12066. *
  12067. * @static
  12068. * @memberOf _
  12069. * @since 3.0.0
  12070. * @category Lang
  12071. * @param {*} value The value to check.
  12072. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12073. * @example
  12074. *
  12075. * _.isError(new Error);
  12076. * // => true
  12077. *
  12078. * _.isError(Error);
  12079. * // => false
  12080. */
  12081. function isError(value) {
  12082. if (!isObjectLike(value)) {
  12083. return false;
  12084. }
  12085. var tag = baseGetTag(value);
  12086. return tag == errorTag || tag == domExcTag ||
  12087. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12088. }
  12089. /**
  12090. * Checks if `value` is a finite primitive number.
  12091. *
  12092. * **Note:** This method is based on
  12093. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12094. *
  12095. * @static
  12096. * @memberOf _
  12097. * @since 0.1.0
  12098. * @category Lang
  12099. * @param {*} value The value to check.
  12100. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12101. * @example
  12102. *
  12103. * _.isFinite(3);
  12104. * // => true
  12105. *
  12106. * _.isFinite(Number.MIN_VALUE);
  12107. * // => true
  12108. *
  12109. * _.isFinite(Infinity);
  12110. * // => false
  12111. *
  12112. * _.isFinite('3');
  12113. * // => false
  12114. */
  12115. function isFinite(value) {
  12116. return typeof value == 'number' && nativeIsFinite(value);
  12117. }
  12118. /**
  12119. * Checks if `value` is classified as a `Function` object.
  12120. *
  12121. * @static
  12122. * @memberOf _
  12123. * @since 0.1.0
  12124. * @category Lang
  12125. * @param {*} value The value to check.
  12126. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12127. * @example
  12128. *
  12129. * _.isFunction(_);
  12130. * // => true
  12131. *
  12132. * _.isFunction(/abc/);
  12133. * // => false
  12134. */
  12135. function isFunction(value) {
  12136. if (!isObject(value)) {
  12137. return false;
  12138. }
  12139. // The use of `Object#toString` avoids issues with the `typeof` operator
  12140. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12141. var tag = baseGetTag(value);
  12142. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12143. }
  12144. /**
  12145. * Checks if `value` is an integer.
  12146. *
  12147. * **Note:** This method is based on
  12148. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12149. *
  12150. * @static
  12151. * @memberOf _
  12152. * @since 4.0.0
  12153. * @category Lang
  12154. * @param {*} value The value to check.
  12155. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12156. * @example
  12157. *
  12158. * _.isInteger(3);
  12159. * // => true
  12160. *
  12161. * _.isInteger(Number.MIN_VALUE);
  12162. * // => false
  12163. *
  12164. * _.isInteger(Infinity);
  12165. * // => false
  12166. *
  12167. * _.isInteger('3');
  12168. * // => false
  12169. */
  12170. function isInteger(value) {
  12171. return typeof value == 'number' && value == toInteger(value);
  12172. }
  12173. /**
  12174. * Checks if `value` is a valid array-like length.
  12175. *
  12176. * **Note:** This method is loosely based on
  12177. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12178. *
  12179. * @static
  12180. * @memberOf _
  12181. * @since 4.0.0
  12182. * @category Lang
  12183. * @param {*} value The value to check.
  12184. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12185. * @example
  12186. *
  12187. * _.isLength(3);
  12188. * // => true
  12189. *
  12190. * _.isLength(Number.MIN_VALUE);
  12191. * // => false
  12192. *
  12193. * _.isLength(Infinity);
  12194. * // => false
  12195. *
  12196. * _.isLength('3');
  12197. * // => false
  12198. */
  12199. function isLength(value) {
  12200. return typeof value == 'number' &&
  12201. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12202. }
  12203. /**
  12204. * Checks if `value` is the
  12205. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12206. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12207. *
  12208. * @static
  12209. * @memberOf _
  12210. * @since 0.1.0
  12211. * @category Lang
  12212. * @param {*} value The value to check.
  12213. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12214. * @example
  12215. *
  12216. * _.isObject({});
  12217. * // => true
  12218. *
  12219. * _.isObject([1, 2, 3]);
  12220. * // => true
  12221. *
  12222. * _.isObject(_.noop);
  12223. * // => true
  12224. *
  12225. * _.isObject(null);
  12226. * // => false
  12227. */
  12228. function isObject(value) {
  12229. var type = typeof value;
  12230. return value != null && (type == 'object' || type == 'function');
  12231. }
  12232. /**
  12233. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12234. * and has a `typeof` result of "object".
  12235. *
  12236. * @static
  12237. * @memberOf _
  12238. * @since 4.0.0
  12239. * @category Lang
  12240. * @param {*} value The value to check.
  12241. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12242. * @example
  12243. *
  12244. * _.isObjectLike({});
  12245. * // => true
  12246. *
  12247. * _.isObjectLike([1, 2, 3]);
  12248. * // => true
  12249. *
  12250. * _.isObjectLike(_.noop);
  12251. * // => false
  12252. *
  12253. * _.isObjectLike(null);
  12254. * // => false
  12255. */
  12256. function isObjectLike(value) {
  12257. return value != null && typeof value == 'object';
  12258. }
  12259. /**
  12260. * Checks if `value` is classified as a `Map` object.
  12261. *
  12262. * @static
  12263. * @memberOf _
  12264. * @since 4.3.0
  12265. * @category Lang
  12266. * @param {*} value The value to check.
  12267. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12268. * @example
  12269. *
  12270. * _.isMap(new Map);
  12271. * // => true
  12272. *
  12273. * _.isMap(new WeakMap);
  12274. * // => false
  12275. */
  12276. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12277. /**
  12278. * Performs a partial deep comparison between `object` and `source` to
  12279. * determine if `object` contains equivalent property values.
  12280. *
  12281. * **Note:** This method is equivalent to `_.matches` when `source` is
  12282. * partially applied.
  12283. *
  12284. * Partial comparisons will match empty array and empty object `source`
  12285. * values against any array or object value, respectively. See `_.isEqual`
  12286. * for a list of supported value comparisons.
  12287. *
  12288. * @static
  12289. * @memberOf _
  12290. * @since 3.0.0
  12291. * @category Lang
  12292. * @param {Object} object The object to inspect.
  12293. * @param {Object} source The object of property values to match.
  12294. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12295. * @example
  12296. *
  12297. * var object = { 'a': 1, 'b': 2 };
  12298. *
  12299. * _.isMatch(object, { 'b': 2 });
  12300. * // => true
  12301. *
  12302. * _.isMatch(object, { 'b': 1 });
  12303. * // => false
  12304. */
  12305. function isMatch(object, source) {
  12306. return object === source || baseIsMatch(object, source, getMatchData(source));
  12307. }
  12308. /**
  12309. * This method is like `_.isMatch` except that it accepts `customizer` which
  12310. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12311. * are handled by the method instead. The `customizer` is invoked with five
  12312. * arguments: (objValue, srcValue, index|key, object, source).
  12313. *
  12314. * @static
  12315. * @memberOf _
  12316. * @since 4.0.0
  12317. * @category Lang
  12318. * @param {Object} object The object to inspect.
  12319. * @param {Object} source The object of property values to match.
  12320. * @param {Function} [customizer] The function to customize comparisons.
  12321. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12322. * @example
  12323. *
  12324. * function isGreeting(value) {
  12325. * return /^h(?:i|ello)$/.test(value);
  12326. * }
  12327. *
  12328. * function customizer(objValue, srcValue) {
  12329. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12330. * return true;
  12331. * }
  12332. * }
  12333. *
  12334. * var object = { 'greeting': 'hello' };
  12335. * var source = { 'greeting': 'hi' };
  12336. *
  12337. * _.isMatchWith(object, source, customizer);
  12338. * // => true
  12339. */
  12340. function isMatchWith(object, source, customizer) {
  12341. customizer = typeof customizer == 'function' ? customizer : undefined;
  12342. return baseIsMatch(object, source, getMatchData(source), customizer);
  12343. }
  12344. /**
  12345. * Checks if `value` is `NaN`.
  12346. *
  12347. * **Note:** This method is based on
  12348. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12349. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12350. * `undefined` and other non-number values.
  12351. *
  12352. * @static
  12353. * @memberOf _
  12354. * @since 0.1.0
  12355. * @category Lang
  12356. * @param {*} value The value to check.
  12357. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12358. * @example
  12359. *
  12360. * _.isNaN(NaN);
  12361. * // => true
  12362. *
  12363. * _.isNaN(new Number(NaN));
  12364. * // => true
  12365. *
  12366. * isNaN(undefined);
  12367. * // => true
  12368. *
  12369. * _.isNaN(undefined);
  12370. * // => false
  12371. */
  12372. function isNaN(value) {
  12373. // An `NaN` primitive is the only value that is not equal to itself.
  12374. // Perform the `toStringTag` check first to avoid errors with some
  12375. // ActiveX objects in IE.
  12376. return isNumber(value) && value != +value;
  12377. }
  12378. /**
  12379. * Checks if `value` is a pristine native function.
  12380. *
  12381. * **Note:** This method can't reliably detect native functions in the presence
  12382. * of the core-js package because core-js circumvents this kind of detection.
  12383. * Despite multiple requests, the core-js maintainer has made it clear: any
  12384. * attempt to fix the detection will be obstructed. As a result, we're left
  12385. * with little choice but to throw an error. Unfortunately, this also affects
  12386. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12387. * which rely on core-js.
  12388. *
  12389. * @static
  12390. * @memberOf _
  12391. * @since 3.0.0
  12392. * @category Lang
  12393. * @param {*} value The value to check.
  12394. * @returns {boolean} Returns `true` if `value` is a native function,
  12395. * else `false`.
  12396. * @example
  12397. *
  12398. * _.isNative(Array.prototype.push);
  12399. * // => true
  12400. *
  12401. * _.isNative(_);
  12402. * // => false
  12403. */
  12404. function isNative(value) {
  12405. if (isMaskable(value)) {
  12406. throw new Error(CORE_ERROR_TEXT);
  12407. }
  12408. return baseIsNative(value);
  12409. }
  12410. /**
  12411. * Checks if `value` is `null`.
  12412. *
  12413. * @static
  12414. * @memberOf _
  12415. * @since 0.1.0
  12416. * @category Lang
  12417. * @param {*} value The value to check.
  12418. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12419. * @example
  12420. *
  12421. * _.isNull(null);
  12422. * // => true
  12423. *
  12424. * _.isNull(void 0);
  12425. * // => false
  12426. */
  12427. function isNull(value) {
  12428. return value === null;
  12429. }
  12430. /**
  12431. * Checks if `value` is `null` or `undefined`.
  12432. *
  12433. * @static
  12434. * @memberOf _
  12435. * @since 4.0.0
  12436. * @category Lang
  12437. * @param {*} value The value to check.
  12438. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12439. * @example
  12440. *
  12441. * _.isNil(null);
  12442. * // => true
  12443. *
  12444. * _.isNil(void 0);
  12445. * // => true
  12446. *
  12447. * _.isNil(NaN);
  12448. * // => false
  12449. */
  12450. function isNil(value) {
  12451. return value == null;
  12452. }
  12453. /**
  12454. * Checks if `value` is classified as a `Number` primitive or object.
  12455. *
  12456. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12457. * classified as numbers, use the `_.isFinite` method.
  12458. *
  12459. * @static
  12460. * @memberOf _
  12461. * @since 0.1.0
  12462. * @category Lang
  12463. * @param {*} value The value to check.
  12464. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12465. * @example
  12466. *
  12467. * _.isNumber(3);
  12468. * // => true
  12469. *
  12470. * _.isNumber(Number.MIN_VALUE);
  12471. * // => true
  12472. *
  12473. * _.isNumber(Infinity);
  12474. * // => true
  12475. *
  12476. * _.isNumber('3');
  12477. * // => false
  12478. */
  12479. function isNumber(value) {
  12480. return typeof value == 'number' ||
  12481. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12482. }
  12483. /**
  12484. * Checks if `value` is a plain object, that is, an object created by the
  12485. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12486. *
  12487. * @static
  12488. * @memberOf _
  12489. * @since 0.8.0
  12490. * @category Lang
  12491. * @param {*} value The value to check.
  12492. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12493. * @example
  12494. *
  12495. * function Foo() {
  12496. * this.a = 1;
  12497. * }
  12498. *
  12499. * _.isPlainObject(new Foo);
  12500. * // => false
  12501. *
  12502. * _.isPlainObject([1, 2, 3]);
  12503. * // => false
  12504. *
  12505. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12506. * // => true
  12507. *
  12508. * _.isPlainObject(Object.create(null));
  12509. * // => true
  12510. */
  12511. function isPlainObject(value) {
  12512. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12513. return false;
  12514. }
  12515. var proto = getPrototype(value);
  12516. if (proto === null) {
  12517. return true;
  12518. }
  12519. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12520. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12521. funcToString.call(Ctor) == objectCtorString;
  12522. }
  12523. /**
  12524. * Checks if `value` is classified as a `RegExp` object.
  12525. *
  12526. * @static
  12527. * @memberOf _
  12528. * @since 0.1.0
  12529. * @category Lang
  12530. * @param {*} value The value to check.
  12531. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12532. * @example
  12533. *
  12534. * _.isRegExp(/abc/);
  12535. * // => true
  12536. *
  12537. * _.isRegExp('/abc/');
  12538. * // => false
  12539. */
  12540. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12541. /**
  12542. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12543. * double precision number which isn't the result of a rounded unsafe integer.
  12544. *
  12545. * **Note:** This method is based on
  12546. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12547. *
  12548. * @static
  12549. * @memberOf _
  12550. * @since 4.0.0
  12551. * @category Lang
  12552. * @param {*} value The value to check.
  12553. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12554. * @example
  12555. *
  12556. * _.isSafeInteger(3);
  12557. * // => true
  12558. *
  12559. * _.isSafeInteger(Number.MIN_VALUE);
  12560. * // => false
  12561. *
  12562. * _.isSafeInteger(Infinity);
  12563. * // => false
  12564. *
  12565. * _.isSafeInteger('3');
  12566. * // => false
  12567. */
  12568. function isSafeInteger(value) {
  12569. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12570. }
  12571. /**
  12572. * Checks if `value` is classified as a `Set` object.
  12573. *
  12574. * @static
  12575. * @memberOf _
  12576. * @since 4.3.0
  12577. * @category Lang
  12578. * @param {*} value The value to check.
  12579. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12580. * @example
  12581. *
  12582. * _.isSet(new Set);
  12583. * // => true
  12584. *
  12585. * _.isSet(new WeakSet);
  12586. * // => false
  12587. */
  12588. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12589. /**
  12590. * Checks if `value` is classified as a `String` primitive or object.
  12591. *
  12592. * @static
  12593. * @since 0.1.0
  12594. * @memberOf _
  12595. * @category Lang
  12596. * @param {*} value The value to check.
  12597. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12598. * @example
  12599. *
  12600. * _.isString('abc');
  12601. * // => true
  12602. *
  12603. * _.isString(1);
  12604. * // => false
  12605. */
  12606. function isString(value) {
  12607. return typeof value == 'string' ||
  12608. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12609. }
  12610. /**
  12611. * Checks if `value` is classified as a `Symbol` primitive or object.
  12612. *
  12613. * @static
  12614. * @memberOf _
  12615. * @since 4.0.0
  12616. * @category Lang
  12617. * @param {*} value The value to check.
  12618. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12619. * @example
  12620. *
  12621. * _.isSymbol(Symbol.iterator);
  12622. * // => true
  12623. *
  12624. * _.isSymbol('abc');
  12625. * // => false
  12626. */
  12627. function isSymbol(value) {
  12628. return typeof value == 'symbol' ||
  12629. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12630. }
  12631. /**
  12632. * Checks if `value` is classified as a typed array.
  12633. *
  12634. * @static
  12635. * @memberOf _
  12636. * @since 3.0.0
  12637. * @category Lang
  12638. * @param {*} value The value to check.
  12639. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12640. * @example
  12641. *
  12642. * _.isTypedArray(new Uint8Array);
  12643. * // => true
  12644. *
  12645. * _.isTypedArray([]);
  12646. * // => false
  12647. */
  12648. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12649. /**
  12650. * Checks if `value` is `undefined`.
  12651. *
  12652. * @static
  12653. * @since 0.1.0
  12654. * @memberOf _
  12655. * @category Lang
  12656. * @param {*} value The value to check.
  12657. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12658. * @example
  12659. *
  12660. * _.isUndefined(void 0);
  12661. * // => true
  12662. *
  12663. * _.isUndefined(null);
  12664. * // => false
  12665. */
  12666. function isUndefined(value) {
  12667. return value === undefined;
  12668. }
  12669. /**
  12670. * Checks if `value` is classified as a `WeakMap` object.
  12671. *
  12672. * @static
  12673. * @memberOf _
  12674. * @since 4.3.0
  12675. * @category Lang
  12676. * @param {*} value The value to check.
  12677. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12678. * @example
  12679. *
  12680. * _.isWeakMap(new WeakMap);
  12681. * // => true
  12682. *
  12683. * _.isWeakMap(new Map);
  12684. * // => false
  12685. */
  12686. function isWeakMap(value) {
  12687. return isObjectLike(value) && getTag(value) == weakMapTag;
  12688. }
  12689. /**
  12690. * Checks if `value` is classified as a `WeakSet` object.
  12691. *
  12692. * @static
  12693. * @memberOf _
  12694. * @since 4.3.0
  12695. * @category Lang
  12696. * @param {*} value The value to check.
  12697. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12698. * @example
  12699. *
  12700. * _.isWeakSet(new WeakSet);
  12701. * // => true
  12702. *
  12703. * _.isWeakSet(new Set);
  12704. * // => false
  12705. */
  12706. function isWeakSet(value) {
  12707. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12708. }
  12709. /**
  12710. * Checks if `value` is less than `other`.
  12711. *
  12712. * @static
  12713. * @memberOf _
  12714. * @since 3.9.0
  12715. * @category Lang
  12716. * @param {*} value The value to compare.
  12717. * @param {*} other The other value to compare.
  12718. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12719. * else `false`.
  12720. * @see _.gt
  12721. * @example
  12722. *
  12723. * _.lt(1, 3);
  12724. * // => true
  12725. *
  12726. * _.lt(3, 3);
  12727. * // => false
  12728. *
  12729. * _.lt(3, 1);
  12730. * // => false
  12731. */
  12732. var lt = createRelationalOperation(baseLt);
  12733. /**
  12734. * Checks if `value` is less than or equal to `other`.
  12735. *
  12736. * @static
  12737. * @memberOf _
  12738. * @since 3.9.0
  12739. * @category Lang
  12740. * @param {*} value The value to compare.
  12741. * @param {*} other The other value to compare.
  12742. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12743. * `other`, else `false`.
  12744. * @see _.gte
  12745. * @example
  12746. *
  12747. * _.lte(1, 3);
  12748. * // => true
  12749. *
  12750. * _.lte(3, 3);
  12751. * // => true
  12752. *
  12753. * _.lte(3, 1);
  12754. * // => false
  12755. */
  12756. var lte = createRelationalOperation(function(value, other) {
  12757. return value <= other;
  12758. });
  12759. /**
  12760. * Converts `value` to an array.
  12761. *
  12762. * @static
  12763. * @since 0.1.0
  12764. * @memberOf _
  12765. * @category Lang
  12766. * @param {*} value The value to convert.
  12767. * @returns {Array} Returns the converted array.
  12768. * @example
  12769. *
  12770. * _.toArray({ 'a': 1, 'b': 2 });
  12771. * // => [1, 2]
  12772. *
  12773. * _.toArray('abc');
  12774. * // => ['a', 'b', 'c']
  12775. *
  12776. * _.toArray(1);
  12777. * // => []
  12778. *
  12779. * _.toArray(null);
  12780. * // => []
  12781. */
  12782. function toArray(value) {
  12783. if (!value) {
  12784. return [];
  12785. }
  12786. if (isArrayLike(value)) {
  12787. return isString(value) ? stringToArray(value) : copyArray(value);
  12788. }
  12789. if (symIterator && value[symIterator]) {
  12790. return iteratorToArray(value[symIterator]());
  12791. }
  12792. var tag = getTag(value),
  12793. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12794. return func(value);
  12795. }
  12796. /**
  12797. * Converts `value` to a finite number.
  12798. *
  12799. * @static
  12800. * @memberOf _
  12801. * @since 4.12.0
  12802. * @category Lang
  12803. * @param {*} value The value to convert.
  12804. * @returns {number} Returns the converted number.
  12805. * @example
  12806. *
  12807. * _.toFinite(3.2);
  12808. * // => 3.2
  12809. *
  12810. * _.toFinite(Number.MIN_VALUE);
  12811. * // => 5e-324
  12812. *
  12813. * _.toFinite(Infinity);
  12814. * // => 1.7976931348623157e+308
  12815. *
  12816. * _.toFinite('3.2');
  12817. * // => 3.2
  12818. */
  12819. function toFinite(value) {
  12820. if (!value) {
  12821. return value === 0 ? value : 0;
  12822. }
  12823. value = toNumber(value);
  12824. if (value === INFINITY || value === -INFINITY) {
  12825. var sign = (value < 0 ? -1 : 1);
  12826. return sign * MAX_INTEGER;
  12827. }
  12828. return value === value ? value : 0;
  12829. }
  12830. /**
  12831. * Converts `value` to an integer.
  12832. *
  12833. * **Note:** This method is loosely based on
  12834. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12835. *
  12836. * @static
  12837. * @memberOf _
  12838. * @since 4.0.0
  12839. * @category Lang
  12840. * @param {*} value The value to convert.
  12841. * @returns {number} Returns the converted integer.
  12842. * @example
  12843. *
  12844. * _.toInteger(3.2);
  12845. * // => 3
  12846. *
  12847. * _.toInteger(Number.MIN_VALUE);
  12848. * // => 0
  12849. *
  12850. * _.toInteger(Infinity);
  12851. * // => 1.7976931348623157e+308
  12852. *
  12853. * _.toInteger('3.2');
  12854. * // => 3
  12855. */
  12856. function toInteger(value) {
  12857. var result = toFinite(value),
  12858. remainder = result % 1;
  12859. return result === result ? (remainder ? result - remainder : result) : 0;
  12860. }
  12861. /**
  12862. * Converts `value` to an integer suitable for use as the length of an
  12863. * array-like object.
  12864. *
  12865. * **Note:** This method is based on
  12866. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12867. *
  12868. * @static
  12869. * @memberOf _
  12870. * @since 4.0.0
  12871. * @category Lang
  12872. * @param {*} value The value to convert.
  12873. * @returns {number} Returns the converted integer.
  12874. * @example
  12875. *
  12876. * _.toLength(3.2);
  12877. * // => 3
  12878. *
  12879. * _.toLength(Number.MIN_VALUE);
  12880. * // => 0
  12881. *
  12882. * _.toLength(Infinity);
  12883. * // => 4294967295
  12884. *
  12885. * _.toLength('3.2');
  12886. * // => 3
  12887. */
  12888. function toLength(value) {
  12889. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12890. }
  12891. /**
  12892. * Converts `value` to a number.
  12893. *
  12894. * @static
  12895. * @memberOf _
  12896. * @since 4.0.0
  12897. * @category Lang
  12898. * @param {*} value The value to process.
  12899. * @returns {number} Returns the number.
  12900. * @example
  12901. *
  12902. * _.toNumber(3.2);
  12903. * // => 3.2
  12904. *
  12905. * _.toNumber(Number.MIN_VALUE);
  12906. * // => 5e-324
  12907. *
  12908. * _.toNumber(Infinity);
  12909. * // => Infinity
  12910. *
  12911. * _.toNumber('3.2');
  12912. * // => 3.2
  12913. */
  12914. function toNumber(value) {
  12915. if (typeof value == 'number') {
  12916. return value;
  12917. }
  12918. if (isSymbol(value)) {
  12919. return NAN;
  12920. }
  12921. if (isObject(value)) {
  12922. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12923. value = isObject(other) ? (other + '') : other;
  12924. }
  12925. if (typeof value != 'string') {
  12926. return value === 0 ? value : +value;
  12927. }
  12928. value = baseTrim(value);
  12929. var isBinary = reIsBinary.test(value);
  12930. return (isBinary || reIsOctal.test(value))
  12931. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12932. : (reIsBadHex.test(value) ? NAN : +value);
  12933. }
  12934. /**
  12935. * Converts `value` to a plain object flattening inherited enumerable string
  12936. * keyed properties of `value` to own properties of the plain object.
  12937. *
  12938. * @static
  12939. * @memberOf _
  12940. * @since 3.0.0
  12941. * @category Lang
  12942. * @param {*} value The value to convert.
  12943. * @returns {Object} Returns the converted plain object.
  12944. * @example
  12945. *
  12946. * function Foo() {
  12947. * this.b = 2;
  12948. * }
  12949. *
  12950. * Foo.prototype.c = 3;
  12951. *
  12952. * _.assign({ 'a': 1 }, new Foo);
  12953. * // => { 'a': 1, 'b': 2 }
  12954. *
  12955. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12956. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12957. */
  12958. function toPlainObject(value) {
  12959. return copyObject(value, keysIn(value));
  12960. }
  12961. /**
  12962. * Converts `value` to a safe integer. A safe integer can be compared and
  12963. * represented correctly.
  12964. *
  12965. * @static
  12966. * @memberOf _
  12967. * @since 4.0.0
  12968. * @category Lang
  12969. * @param {*} value The value to convert.
  12970. * @returns {number} Returns the converted integer.
  12971. * @example
  12972. *
  12973. * _.toSafeInteger(3.2);
  12974. * // => 3
  12975. *
  12976. * _.toSafeInteger(Number.MIN_VALUE);
  12977. * // => 0
  12978. *
  12979. * _.toSafeInteger(Infinity);
  12980. * // => 9007199254740991
  12981. *
  12982. * _.toSafeInteger('3.2');
  12983. * // => 3
  12984. */
  12985. function toSafeInteger(value) {
  12986. return value
  12987. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12988. : (value === 0 ? value : 0);
  12989. }
  12990. /**
  12991. * Converts `value` to a string. An empty string is returned for `null`
  12992. * and `undefined` values. The sign of `-0` is preserved.
  12993. *
  12994. * @static
  12995. * @memberOf _
  12996. * @since 4.0.0
  12997. * @category Lang
  12998. * @param {*} value The value to convert.
  12999. * @returns {string} Returns the converted string.
  13000. * @example
  13001. *
  13002. * _.toString(null);
  13003. * // => ''
  13004. *
  13005. * _.toString(-0);
  13006. * // => '-0'
  13007. *
  13008. * _.toString([1, 2, 3]);
  13009. * // => '1,2,3'
  13010. */
  13011. function toString(value) {
  13012. return value == null ? '' : baseToString(value);
  13013. }
  13014. /*------------------------------------------------------------------------*/
  13015. /**
  13016. * Assigns own enumerable string keyed properties of source objects to the
  13017. * destination object. Source objects are applied from left to right.
  13018. * Subsequent sources overwrite property assignments of previous sources.
  13019. *
  13020. * **Note:** This method mutates `object` and is loosely based on
  13021. * [`Object.assign`](https://mdn.io/Object/assign).
  13022. *
  13023. * @static
  13024. * @memberOf _
  13025. * @since 0.10.0
  13026. * @category Object
  13027. * @param {Object} object The destination object.
  13028. * @param {...Object} [sources] The source objects.
  13029. * @returns {Object} Returns `object`.
  13030. * @see _.assignIn
  13031. * @example
  13032. *
  13033. * function Foo() {
  13034. * this.a = 1;
  13035. * }
  13036. *
  13037. * function Bar() {
  13038. * this.c = 3;
  13039. * }
  13040. *
  13041. * Foo.prototype.b = 2;
  13042. * Bar.prototype.d = 4;
  13043. *
  13044. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13045. * // => { 'a': 1, 'c': 3 }
  13046. */
  13047. var assign = createAssigner(function(object, source) {
  13048. if (isPrototype(source) || isArrayLike(source)) {
  13049. copyObject(source, keys(source), object);
  13050. return;
  13051. }
  13052. for (var key in source) {
  13053. if (hasOwnProperty.call(source, key)) {
  13054. assignValue(object, key, source[key]);
  13055. }
  13056. }
  13057. });
  13058. /**
  13059. * This method is like `_.assign` except that it iterates over own and
  13060. * inherited source properties.
  13061. *
  13062. * **Note:** This method mutates `object`.
  13063. *
  13064. * @static
  13065. * @memberOf _
  13066. * @since 4.0.0
  13067. * @alias extend
  13068. * @category Object
  13069. * @param {Object} object The destination object.
  13070. * @param {...Object} [sources] The source objects.
  13071. * @returns {Object} Returns `object`.
  13072. * @see _.assign
  13073. * @example
  13074. *
  13075. * function Foo() {
  13076. * this.a = 1;
  13077. * }
  13078. *
  13079. * function Bar() {
  13080. * this.c = 3;
  13081. * }
  13082. *
  13083. * Foo.prototype.b = 2;
  13084. * Bar.prototype.d = 4;
  13085. *
  13086. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13087. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13088. */
  13089. var assignIn = createAssigner(function(object, source) {
  13090. copyObject(source, keysIn(source), object);
  13091. });
  13092. /**
  13093. * This method is like `_.assignIn` except that it accepts `customizer`
  13094. * which is invoked to produce the assigned values. If `customizer` returns
  13095. * `undefined`, assignment is handled by the method instead. The `customizer`
  13096. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13097. *
  13098. * **Note:** This method mutates `object`.
  13099. *
  13100. * @static
  13101. * @memberOf _
  13102. * @since 4.0.0
  13103. * @alias extendWith
  13104. * @category Object
  13105. * @param {Object} object The destination object.
  13106. * @param {...Object} sources The source objects.
  13107. * @param {Function} [customizer] The function to customize assigned values.
  13108. * @returns {Object} Returns `object`.
  13109. * @see _.assignWith
  13110. * @example
  13111. *
  13112. * function customizer(objValue, srcValue) {
  13113. * return _.isUndefined(objValue) ? srcValue : objValue;
  13114. * }
  13115. *
  13116. * var defaults = _.partialRight(_.assignInWith, customizer);
  13117. *
  13118. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13119. * // => { 'a': 1, 'b': 2 }
  13120. */
  13121. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13122. copyObject(source, keysIn(source), object, customizer);
  13123. });
  13124. /**
  13125. * This method is like `_.assign` except that it accepts `customizer`
  13126. * which is invoked to produce the assigned values. If `customizer` returns
  13127. * `undefined`, assignment is handled by the method instead. The `customizer`
  13128. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13129. *
  13130. * **Note:** This method mutates `object`.
  13131. *
  13132. * @static
  13133. * @memberOf _
  13134. * @since 4.0.0
  13135. * @category Object
  13136. * @param {Object} object The destination object.
  13137. * @param {...Object} sources The source objects.
  13138. * @param {Function} [customizer] The function to customize assigned values.
  13139. * @returns {Object} Returns `object`.
  13140. * @see _.assignInWith
  13141. * @example
  13142. *
  13143. * function customizer(objValue, srcValue) {
  13144. * return _.isUndefined(objValue) ? srcValue : objValue;
  13145. * }
  13146. *
  13147. * var defaults = _.partialRight(_.assignWith, customizer);
  13148. *
  13149. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13150. * // => { 'a': 1, 'b': 2 }
  13151. */
  13152. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13153. copyObject(source, keys(source), object, customizer);
  13154. });
  13155. /**
  13156. * Creates an array of values corresponding to `paths` of `object`.
  13157. *
  13158. * @static
  13159. * @memberOf _
  13160. * @since 1.0.0
  13161. * @category Object
  13162. * @param {Object} object The object to iterate over.
  13163. * @param {...(string|string[])} [paths] The property paths to pick.
  13164. * @returns {Array} Returns the picked values.
  13165. * @example
  13166. *
  13167. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13168. *
  13169. * _.at(object, ['a[0].b.c', 'a[1]']);
  13170. * // => [3, 4]
  13171. */
  13172. var at = flatRest(baseAt);
  13173. /**
  13174. * Creates an object that inherits from the `prototype` object. If a
  13175. * `properties` object is given, its own enumerable string keyed properties
  13176. * are assigned to the created object.
  13177. *
  13178. * @static
  13179. * @memberOf _
  13180. * @since 2.3.0
  13181. * @category Object
  13182. * @param {Object} prototype The object to inherit from.
  13183. * @param {Object} [properties] The properties to assign to the object.
  13184. * @returns {Object} Returns the new object.
  13185. * @example
  13186. *
  13187. * function Shape() {
  13188. * this.x = 0;
  13189. * this.y = 0;
  13190. * }
  13191. *
  13192. * function Circle() {
  13193. * Shape.call(this);
  13194. * }
  13195. *
  13196. * Circle.prototype = _.create(Shape.prototype, {
  13197. * 'constructor': Circle
  13198. * });
  13199. *
  13200. * var circle = new Circle;
  13201. * circle instanceof Circle;
  13202. * // => true
  13203. *
  13204. * circle instanceof Shape;
  13205. * // => true
  13206. */
  13207. function create(prototype, properties) {
  13208. var result = baseCreate(prototype);
  13209. return properties == null ? result : baseAssign(result, properties);
  13210. }
  13211. /**
  13212. * Assigns own and inherited enumerable string keyed properties of source
  13213. * objects to the destination object for all destination properties that
  13214. * resolve to `undefined`. Source objects are applied from left to right.
  13215. * Once a property is set, additional values of the same property are ignored.
  13216. *
  13217. * **Note:** This method mutates `object`.
  13218. *
  13219. * @static
  13220. * @since 0.1.0
  13221. * @memberOf _
  13222. * @category Object
  13223. * @param {Object} object The destination object.
  13224. * @param {...Object} [sources] The source objects.
  13225. * @returns {Object} Returns `object`.
  13226. * @see _.defaultsDeep
  13227. * @example
  13228. *
  13229. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13230. * // => { 'a': 1, 'b': 2 }
  13231. */
  13232. var defaults = baseRest(function(object, sources) {
  13233. object = Object(object);
  13234. var index = -1;
  13235. var length = sources.length;
  13236. var guard = length > 2 ? sources[2] : undefined;
  13237. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13238. length = 1;
  13239. }
  13240. while (++index < length) {
  13241. var source = sources[index];
  13242. var props = keysIn(source);
  13243. var propsIndex = -1;
  13244. var propsLength = props.length;
  13245. while (++propsIndex < propsLength) {
  13246. var key = props[propsIndex];
  13247. var value = object[key];
  13248. if (value === undefined ||
  13249. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13250. object[key] = source[key];
  13251. }
  13252. }
  13253. }
  13254. return object;
  13255. });
  13256. /**
  13257. * This method is like `_.defaults` except that it recursively assigns
  13258. * default properties.
  13259. *
  13260. * **Note:** This method mutates `object`.
  13261. *
  13262. * @static
  13263. * @memberOf _
  13264. * @since 3.10.0
  13265. * @category Object
  13266. * @param {Object} object The destination object.
  13267. * @param {...Object} [sources] The source objects.
  13268. * @returns {Object} Returns `object`.
  13269. * @see _.defaults
  13270. * @example
  13271. *
  13272. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13273. * // => { 'a': { 'b': 2, 'c': 3 } }
  13274. */
  13275. var defaultsDeep = baseRest(function(args) {
  13276. args.push(undefined, customDefaultsMerge);
  13277. return apply(mergeWith, undefined, args);
  13278. });
  13279. /**
  13280. * This method is like `_.find` except that it returns the key of the first
  13281. * element `predicate` returns truthy for instead of the element itself.
  13282. *
  13283. * @static
  13284. * @memberOf _
  13285. * @since 1.1.0
  13286. * @category Object
  13287. * @param {Object} object The object to inspect.
  13288. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13289. * @returns {string|undefined} Returns the key of the matched element,
  13290. * else `undefined`.
  13291. * @example
  13292. *
  13293. * var users = {
  13294. * 'barney': { 'age': 36, 'active': true },
  13295. * 'fred': { 'age': 40, 'active': false },
  13296. * 'pebbles': { 'age': 1, 'active': true }
  13297. * };
  13298. *
  13299. * _.findKey(users, function(o) { return o.age < 40; });
  13300. * // => 'barney' (iteration order is not guaranteed)
  13301. *
  13302. * // The `_.matches` iteratee shorthand.
  13303. * _.findKey(users, { 'age': 1, 'active': true });
  13304. * // => 'pebbles'
  13305. *
  13306. * // The `_.matchesProperty` iteratee shorthand.
  13307. * _.findKey(users, ['active', false]);
  13308. * // => 'fred'
  13309. *
  13310. * // The `_.property` iteratee shorthand.
  13311. * _.findKey(users, 'active');
  13312. * // => 'barney'
  13313. */
  13314. function findKey(object, predicate) {
  13315. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13316. }
  13317. /**
  13318. * This method is like `_.findKey` except that it iterates over elements of
  13319. * a collection in the opposite order.
  13320. *
  13321. * @static
  13322. * @memberOf _
  13323. * @since 2.0.0
  13324. * @category Object
  13325. * @param {Object} object The object to inspect.
  13326. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13327. * @returns {string|undefined} Returns the key of the matched element,
  13328. * else `undefined`.
  13329. * @example
  13330. *
  13331. * var users = {
  13332. * 'barney': { 'age': 36, 'active': true },
  13333. * 'fred': { 'age': 40, 'active': false },
  13334. * 'pebbles': { 'age': 1, 'active': true }
  13335. * };
  13336. *
  13337. * _.findLastKey(users, function(o) { return o.age < 40; });
  13338. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13339. *
  13340. * // The `_.matches` iteratee shorthand.
  13341. * _.findLastKey(users, { 'age': 36, 'active': true });
  13342. * // => 'barney'
  13343. *
  13344. * // The `_.matchesProperty` iteratee shorthand.
  13345. * _.findLastKey(users, ['active', false]);
  13346. * // => 'fred'
  13347. *
  13348. * // The `_.property` iteratee shorthand.
  13349. * _.findLastKey(users, 'active');
  13350. * // => 'pebbles'
  13351. */
  13352. function findLastKey(object, predicate) {
  13353. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13354. }
  13355. /**
  13356. * Iterates over own and inherited enumerable string keyed properties of an
  13357. * object and invokes `iteratee` for each property. The iteratee is invoked
  13358. * with three arguments: (value, key, object). Iteratee functions may exit
  13359. * iteration early by explicitly returning `false`.
  13360. *
  13361. * @static
  13362. * @memberOf _
  13363. * @since 0.3.0
  13364. * @category Object
  13365. * @param {Object} object The object to iterate over.
  13366. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13367. * @returns {Object} Returns `object`.
  13368. * @see _.forInRight
  13369. * @example
  13370. *
  13371. * function Foo() {
  13372. * this.a = 1;
  13373. * this.b = 2;
  13374. * }
  13375. *
  13376. * Foo.prototype.c = 3;
  13377. *
  13378. * _.forIn(new Foo, function(value, key) {
  13379. * console.log(key);
  13380. * });
  13381. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13382. */
  13383. function forIn(object, iteratee) {
  13384. return object == null
  13385. ? object
  13386. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13387. }
  13388. /**
  13389. * This method is like `_.forIn` except that it iterates over properties of
  13390. * `object` in the opposite order.
  13391. *
  13392. * @static
  13393. * @memberOf _
  13394. * @since 2.0.0
  13395. * @category Object
  13396. * @param {Object} object The object to iterate over.
  13397. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13398. * @returns {Object} Returns `object`.
  13399. * @see _.forIn
  13400. * @example
  13401. *
  13402. * function Foo() {
  13403. * this.a = 1;
  13404. * this.b = 2;
  13405. * }
  13406. *
  13407. * Foo.prototype.c = 3;
  13408. *
  13409. * _.forInRight(new Foo, function(value, key) {
  13410. * console.log(key);
  13411. * });
  13412. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13413. */
  13414. function forInRight(object, iteratee) {
  13415. return object == null
  13416. ? object
  13417. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13418. }
  13419. /**
  13420. * Iterates over own enumerable string keyed properties of an object and
  13421. * invokes `iteratee` for each property. The iteratee is invoked with three
  13422. * arguments: (value, key, object). Iteratee functions may exit iteration
  13423. * early by explicitly returning `false`.
  13424. *
  13425. * @static
  13426. * @memberOf _
  13427. * @since 0.3.0
  13428. * @category Object
  13429. * @param {Object} object The object to iterate over.
  13430. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13431. * @returns {Object} Returns `object`.
  13432. * @see _.forOwnRight
  13433. * @example
  13434. *
  13435. * function Foo() {
  13436. * this.a = 1;
  13437. * this.b = 2;
  13438. * }
  13439. *
  13440. * Foo.prototype.c = 3;
  13441. *
  13442. * _.forOwn(new Foo, function(value, key) {
  13443. * console.log(key);
  13444. * });
  13445. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13446. */
  13447. function forOwn(object, iteratee) {
  13448. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13449. }
  13450. /**
  13451. * This method is like `_.forOwn` except that it iterates over properties of
  13452. * `object` in the opposite order.
  13453. *
  13454. * @static
  13455. * @memberOf _
  13456. * @since 2.0.0
  13457. * @category Object
  13458. * @param {Object} object The object to iterate over.
  13459. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13460. * @returns {Object} Returns `object`.
  13461. * @see _.forOwn
  13462. * @example
  13463. *
  13464. * function Foo() {
  13465. * this.a = 1;
  13466. * this.b = 2;
  13467. * }
  13468. *
  13469. * Foo.prototype.c = 3;
  13470. *
  13471. * _.forOwnRight(new Foo, function(value, key) {
  13472. * console.log(key);
  13473. * });
  13474. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13475. */
  13476. function forOwnRight(object, iteratee) {
  13477. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13478. }
  13479. /**
  13480. * Creates an array of function property names from own enumerable properties
  13481. * of `object`.
  13482. *
  13483. * @static
  13484. * @since 0.1.0
  13485. * @memberOf _
  13486. * @category Object
  13487. * @param {Object} object The object to inspect.
  13488. * @returns {Array} Returns the function names.
  13489. * @see _.functionsIn
  13490. * @example
  13491. *
  13492. * function Foo() {
  13493. * this.a = _.constant('a');
  13494. * this.b = _.constant('b');
  13495. * }
  13496. *
  13497. * Foo.prototype.c = _.constant('c');
  13498. *
  13499. * _.functions(new Foo);
  13500. * // => ['a', 'b']
  13501. */
  13502. function functions(object) {
  13503. return object == null ? [] : baseFunctions(object, keys(object));
  13504. }
  13505. /**
  13506. * Creates an array of function property names from own and inherited
  13507. * enumerable properties of `object`.
  13508. *
  13509. * @static
  13510. * @memberOf _
  13511. * @since 4.0.0
  13512. * @category Object
  13513. * @param {Object} object The object to inspect.
  13514. * @returns {Array} Returns the function names.
  13515. * @see _.functions
  13516. * @example
  13517. *
  13518. * function Foo() {
  13519. * this.a = _.constant('a');
  13520. * this.b = _.constant('b');
  13521. * }
  13522. *
  13523. * Foo.prototype.c = _.constant('c');
  13524. *
  13525. * _.functionsIn(new Foo);
  13526. * // => ['a', 'b', 'c']
  13527. */
  13528. function functionsIn(object) {
  13529. return object == null ? [] : baseFunctions(object, keysIn(object));
  13530. }
  13531. /**
  13532. * Gets the value at `path` of `object`. If the resolved value is
  13533. * `undefined`, the `defaultValue` is returned in its place.
  13534. *
  13535. * @static
  13536. * @memberOf _
  13537. * @since 3.7.0
  13538. * @category Object
  13539. * @param {Object} object The object to query.
  13540. * @param {Array|string} path The path of the property to get.
  13541. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13542. * @returns {*} Returns the resolved value.
  13543. * @example
  13544. *
  13545. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13546. *
  13547. * _.get(object, 'a[0].b.c');
  13548. * // => 3
  13549. *
  13550. * _.get(object, ['a', '0', 'b', 'c']);
  13551. * // => 3
  13552. *
  13553. * _.get(object, 'a.b.c', 'default');
  13554. * // => 'default'
  13555. */
  13556. function get(object, path, defaultValue) {
  13557. var result = object == null ? undefined : baseGet(object, path);
  13558. return result === undefined ? defaultValue : result;
  13559. }
  13560. /**
  13561. * Checks if `path` is a direct property of `object`.
  13562. *
  13563. * @static
  13564. * @since 0.1.0
  13565. * @memberOf _
  13566. * @category Object
  13567. * @param {Object} object The object to query.
  13568. * @param {Array|string} path The path to check.
  13569. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13570. * @example
  13571. *
  13572. * var object = { 'a': { 'b': 2 } };
  13573. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13574. *
  13575. * _.has(object, 'a');
  13576. * // => true
  13577. *
  13578. * _.has(object, 'a.b');
  13579. * // => true
  13580. *
  13581. * _.has(object, ['a', 'b']);
  13582. * // => true
  13583. *
  13584. * _.has(other, 'a');
  13585. * // => false
  13586. */
  13587. function has(object, path) {
  13588. return object != null && hasPath(object, path, baseHas);
  13589. }
  13590. /**
  13591. * Checks if `path` is a direct or inherited property of `object`.
  13592. *
  13593. * @static
  13594. * @memberOf _
  13595. * @since 4.0.0
  13596. * @category Object
  13597. * @param {Object} object The object to query.
  13598. * @param {Array|string} path The path to check.
  13599. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13600. * @example
  13601. *
  13602. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13603. *
  13604. * _.hasIn(object, 'a');
  13605. * // => true
  13606. *
  13607. * _.hasIn(object, 'a.b');
  13608. * // => true
  13609. *
  13610. * _.hasIn(object, ['a', 'b']);
  13611. * // => true
  13612. *
  13613. * _.hasIn(object, 'b');
  13614. * // => false
  13615. */
  13616. function hasIn(object, path) {
  13617. return object != null && hasPath(object, path, baseHasIn);
  13618. }
  13619. /**
  13620. * Creates an object composed of the inverted keys and values of `object`.
  13621. * If `object` contains duplicate values, subsequent values overwrite
  13622. * property assignments of previous values.
  13623. *
  13624. * @static
  13625. * @memberOf _
  13626. * @since 0.7.0
  13627. * @category Object
  13628. * @param {Object} object The object to invert.
  13629. * @returns {Object} Returns the new inverted object.
  13630. * @example
  13631. *
  13632. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13633. *
  13634. * _.invert(object);
  13635. * // => { '1': 'c', '2': 'b' }
  13636. */
  13637. var invert = createInverter(function(result, value, key) {
  13638. if (value != null &&
  13639. typeof value.toString != 'function') {
  13640. value = nativeObjectToString.call(value);
  13641. }
  13642. result[value] = key;
  13643. }, constant(identity));
  13644. /**
  13645. * This method is like `_.invert` except that the inverted object is generated
  13646. * from the results of running each element of `object` thru `iteratee`. The
  13647. * corresponding inverted value of each inverted key is an array of keys
  13648. * responsible for generating the inverted value. The iteratee is invoked
  13649. * with one argument: (value).
  13650. *
  13651. * @static
  13652. * @memberOf _
  13653. * @since 4.1.0
  13654. * @category Object
  13655. * @param {Object} object The object to invert.
  13656. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13657. * @returns {Object} Returns the new inverted object.
  13658. * @example
  13659. *
  13660. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13661. *
  13662. * _.invertBy(object);
  13663. * // => { '1': ['a', 'c'], '2': ['b'] }
  13664. *
  13665. * _.invertBy(object, function(value) {
  13666. * return 'group' + value;
  13667. * });
  13668. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13669. */
  13670. var invertBy = createInverter(function(result, value, key) {
  13671. if (value != null &&
  13672. typeof value.toString != 'function') {
  13673. value = nativeObjectToString.call(value);
  13674. }
  13675. if (hasOwnProperty.call(result, value)) {
  13676. result[value].push(key);
  13677. } else {
  13678. result[value] = [key];
  13679. }
  13680. }, getIteratee);
  13681. /**
  13682. * Invokes the method at `path` of `object`.
  13683. *
  13684. * @static
  13685. * @memberOf _
  13686. * @since 4.0.0
  13687. * @category Object
  13688. * @param {Object} object The object to query.
  13689. * @param {Array|string} path The path of the method to invoke.
  13690. * @param {...*} [args] The arguments to invoke the method with.
  13691. * @returns {*} Returns the result of the invoked method.
  13692. * @example
  13693. *
  13694. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13695. *
  13696. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13697. * // => [2, 3]
  13698. */
  13699. var invoke = baseRest(baseInvoke);
  13700. /**
  13701. * Creates an array of the own enumerable property names of `object`.
  13702. *
  13703. * **Note:** Non-object values are coerced to objects. See the
  13704. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13705. * for more details.
  13706. *
  13707. * @static
  13708. * @since 0.1.0
  13709. * @memberOf _
  13710. * @category Object
  13711. * @param {Object} object The object to query.
  13712. * @returns {Array} Returns the array of property names.
  13713. * @example
  13714. *
  13715. * function Foo() {
  13716. * this.a = 1;
  13717. * this.b = 2;
  13718. * }
  13719. *
  13720. * Foo.prototype.c = 3;
  13721. *
  13722. * _.keys(new Foo);
  13723. * // => ['a', 'b'] (iteration order is not guaranteed)
  13724. *
  13725. * _.keys('hi');
  13726. * // => ['0', '1']
  13727. */
  13728. function keys(object) {
  13729. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13730. }
  13731. /**
  13732. * Creates an array of the own and inherited enumerable property names of `object`.
  13733. *
  13734. * **Note:** Non-object values are coerced to objects.
  13735. *
  13736. * @static
  13737. * @memberOf _
  13738. * @since 3.0.0
  13739. * @category Object
  13740. * @param {Object} object The object to query.
  13741. * @returns {Array} Returns the array of property names.
  13742. * @example
  13743. *
  13744. * function Foo() {
  13745. * this.a = 1;
  13746. * this.b = 2;
  13747. * }
  13748. *
  13749. * Foo.prototype.c = 3;
  13750. *
  13751. * _.keysIn(new Foo);
  13752. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13753. */
  13754. function keysIn(object) {
  13755. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13756. }
  13757. /**
  13758. * The opposite of `_.mapValues`; this method creates an object with the
  13759. * same values as `object` and keys generated by running each own enumerable
  13760. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13761. * with three arguments: (value, key, object).
  13762. *
  13763. * @static
  13764. * @memberOf _
  13765. * @since 3.8.0
  13766. * @category Object
  13767. * @param {Object} object The object to iterate over.
  13768. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13769. * @returns {Object} Returns the new mapped object.
  13770. * @see _.mapValues
  13771. * @example
  13772. *
  13773. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13774. * return key + value;
  13775. * });
  13776. * // => { 'a1': 1, 'b2': 2 }
  13777. */
  13778. function mapKeys(object, iteratee) {
  13779. var result = {};
  13780. iteratee = getIteratee(iteratee, 3);
  13781. baseForOwn(object, function(value, key, object) {
  13782. baseAssignValue(result, iteratee(value, key, object), value);
  13783. });
  13784. return result;
  13785. }
  13786. /**
  13787. * Creates an object with the same keys as `object` and values generated
  13788. * by running each own enumerable string keyed property of `object` thru
  13789. * `iteratee`. The iteratee is invoked with three arguments:
  13790. * (value, key, object).
  13791. *
  13792. * @static
  13793. * @memberOf _
  13794. * @since 2.4.0
  13795. * @category Object
  13796. * @param {Object} object The object to iterate over.
  13797. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13798. * @returns {Object} Returns the new mapped object.
  13799. * @see _.mapKeys
  13800. * @example
  13801. *
  13802. * var users = {
  13803. * 'fred': { 'user': 'fred', 'age': 40 },
  13804. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13805. * };
  13806. *
  13807. * _.mapValues(users, function(o) { return o.age; });
  13808. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13809. *
  13810. * // The `_.property` iteratee shorthand.
  13811. * _.mapValues(users, 'age');
  13812. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13813. */
  13814. function mapValues(object, iteratee) {
  13815. var result = {};
  13816. iteratee = getIteratee(iteratee, 3);
  13817. baseForOwn(object, function(value, key, object) {
  13818. baseAssignValue(result, key, iteratee(value, key, object));
  13819. });
  13820. return result;
  13821. }
  13822. /**
  13823. * This method is like `_.assign` except that it recursively merges own and
  13824. * inherited enumerable string keyed properties of source objects into the
  13825. * destination object. Source properties that resolve to `undefined` are
  13826. * skipped if a destination value exists. Array and plain object properties
  13827. * are merged recursively. Other objects and value types are overridden by
  13828. * assignment. Source objects are applied from left to right. Subsequent
  13829. * sources overwrite property assignments of previous sources.
  13830. *
  13831. * **Note:** This method mutates `object`.
  13832. *
  13833. * @static
  13834. * @memberOf _
  13835. * @since 0.5.0
  13836. * @category Object
  13837. * @param {Object} object The destination object.
  13838. * @param {...Object} [sources] The source objects.
  13839. * @returns {Object} Returns `object`.
  13840. * @example
  13841. *
  13842. * var object = {
  13843. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13844. * };
  13845. *
  13846. * var other = {
  13847. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13848. * };
  13849. *
  13850. * _.merge(object, other);
  13851. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13852. */
  13853. var merge = createAssigner(function(object, source, srcIndex) {
  13854. baseMerge(object, source, srcIndex);
  13855. });
  13856. /**
  13857. * This method is like `_.merge` except that it accepts `customizer` which
  13858. * is invoked to produce the merged values of the destination and source
  13859. * properties. If `customizer` returns `undefined`, merging is handled by the
  13860. * method instead. The `customizer` is invoked with six arguments:
  13861. * (objValue, srcValue, key, object, source, stack).
  13862. *
  13863. * **Note:** This method mutates `object`.
  13864. *
  13865. * @static
  13866. * @memberOf _
  13867. * @since 4.0.0
  13868. * @category Object
  13869. * @param {Object} object The destination object.
  13870. * @param {...Object} sources The source objects.
  13871. * @param {Function} customizer The function to customize assigned values.
  13872. * @returns {Object} Returns `object`.
  13873. * @example
  13874. *
  13875. * function customizer(objValue, srcValue) {
  13876. * if (_.isArray(objValue)) {
  13877. * return objValue.concat(srcValue);
  13878. * }
  13879. * }
  13880. *
  13881. * var object = { 'a': [1], 'b': [2] };
  13882. * var other = { 'a': [3], 'b': [4] };
  13883. *
  13884. * _.mergeWith(object, other, customizer);
  13885. * // => { 'a': [1, 3], 'b': [2, 4] }
  13886. */
  13887. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13888. baseMerge(object, source, srcIndex, customizer);
  13889. });
  13890. /**
  13891. * The opposite of `_.pick`; this method creates an object composed of the
  13892. * own and inherited enumerable property paths of `object` that are not omitted.
  13893. *
  13894. * **Note:** This method is considerably slower than `_.pick`.
  13895. *
  13896. * @static
  13897. * @since 0.1.0
  13898. * @memberOf _
  13899. * @category Object
  13900. * @param {Object} object The source object.
  13901. * @param {...(string|string[])} [paths] The property paths to omit.
  13902. * @returns {Object} Returns the new object.
  13903. * @example
  13904. *
  13905. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13906. *
  13907. * _.omit(object, ['a', 'c']);
  13908. * // => { 'b': '2' }
  13909. */
  13910. var omit = flatRest(function(object, paths) {
  13911. var result = {};
  13912. if (object == null) {
  13913. return result;
  13914. }
  13915. var isDeep = false;
  13916. paths = arrayMap(paths, function(path) {
  13917. path = castPath(path, object);
  13918. isDeep || (isDeep = path.length > 1);
  13919. return path;
  13920. });
  13921. copyObject(object, getAllKeysIn(object), result);
  13922. if (isDeep) {
  13923. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13924. }
  13925. var length = paths.length;
  13926. while (length--) {
  13927. baseUnset(result, paths[length]);
  13928. }
  13929. return result;
  13930. });
  13931. /**
  13932. * The opposite of `_.pickBy`; this method creates an object composed of
  13933. * the own and inherited enumerable string keyed properties of `object` that
  13934. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13935. * arguments: (value, key).
  13936. *
  13937. * @static
  13938. * @memberOf _
  13939. * @since 4.0.0
  13940. * @category Object
  13941. * @param {Object} object The source object.
  13942. * @param {Function} [predicate=_.identity] The function invoked per property.
  13943. * @returns {Object} Returns the new object.
  13944. * @example
  13945. *
  13946. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13947. *
  13948. * _.omitBy(object, _.isNumber);
  13949. * // => { 'b': '2' }
  13950. */
  13951. function omitBy(object, predicate) {
  13952. return pickBy(object, negate(getIteratee(predicate)));
  13953. }
  13954. /**
  13955. * Creates an object composed of the picked `object` properties.
  13956. *
  13957. * @static
  13958. * @since 0.1.0
  13959. * @memberOf _
  13960. * @category Object
  13961. * @param {Object} object The source object.
  13962. * @param {...(string|string[])} [paths] The property paths to pick.
  13963. * @returns {Object} Returns the new object.
  13964. * @example
  13965. *
  13966. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13967. *
  13968. * _.pick(object, ['a', 'c']);
  13969. * // => { 'a': 1, 'c': 3 }
  13970. */
  13971. var pick = flatRest(function(object, paths) {
  13972. return object == null ? {} : basePick(object, paths);
  13973. });
  13974. /**
  13975. * Creates an object composed of the `object` properties `predicate` returns
  13976. * truthy for. The predicate is invoked with two arguments: (value, key).
  13977. *
  13978. * @static
  13979. * @memberOf _
  13980. * @since 4.0.0
  13981. * @category Object
  13982. * @param {Object} object The source object.
  13983. * @param {Function} [predicate=_.identity] The function invoked per property.
  13984. * @returns {Object} Returns the new object.
  13985. * @example
  13986. *
  13987. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13988. *
  13989. * _.pickBy(object, _.isNumber);
  13990. * // => { 'a': 1, 'c': 3 }
  13991. */
  13992. function pickBy(object, predicate) {
  13993. if (object == null) {
  13994. return {};
  13995. }
  13996. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13997. return [prop];
  13998. });
  13999. predicate = getIteratee(predicate);
  14000. return basePickBy(object, props, function(value, path) {
  14001. return predicate(value, path[0]);
  14002. });
  14003. }
  14004. /**
  14005. * This method is like `_.get` except that if the resolved value is a
  14006. * function it's invoked with the `this` binding of its parent object and
  14007. * its result is returned.
  14008. *
  14009. * @static
  14010. * @since 0.1.0
  14011. * @memberOf _
  14012. * @category Object
  14013. * @param {Object} object The object to query.
  14014. * @param {Array|string} path The path of the property to resolve.
  14015. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14016. * @returns {*} Returns the resolved value.
  14017. * @example
  14018. *
  14019. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14020. *
  14021. * _.result(object, 'a[0].b.c1');
  14022. * // => 3
  14023. *
  14024. * _.result(object, 'a[0].b.c2');
  14025. * // => 4
  14026. *
  14027. * _.result(object, 'a[0].b.c3', 'default');
  14028. * // => 'default'
  14029. *
  14030. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14031. * // => 'default'
  14032. */
  14033. function result(object, path, defaultValue) {
  14034. path = castPath(path, object);
  14035. var index = -1,
  14036. length = path.length;
  14037. // Ensure the loop is entered when path is empty.
  14038. if (!length) {
  14039. length = 1;
  14040. object = undefined;
  14041. }
  14042. while (++index < length) {
  14043. var value = object == null ? undefined : object[toKey(path[index])];
  14044. if (value === undefined) {
  14045. index = length;
  14046. value = defaultValue;
  14047. }
  14048. object = isFunction(value) ? value.call(object) : value;
  14049. }
  14050. return object;
  14051. }
  14052. /**
  14053. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14054. * it's created. Arrays are created for missing index properties while objects
  14055. * are created for all other missing properties. Use `_.setWith` to customize
  14056. * `path` creation.
  14057. *
  14058. * **Note:** This method mutates `object`.
  14059. *
  14060. * @static
  14061. * @memberOf _
  14062. * @since 3.7.0
  14063. * @category Object
  14064. * @param {Object} object The object to modify.
  14065. * @param {Array|string} path The path of the property to set.
  14066. * @param {*} value The value to set.
  14067. * @returns {Object} Returns `object`.
  14068. * @example
  14069. *
  14070. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14071. *
  14072. * _.set(object, 'a[0].b.c', 4);
  14073. * console.log(object.a[0].b.c);
  14074. * // => 4
  14075. *
  14076. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14077. * console.log(object.x[0].y.z);
  14078. * // => 5
  14079. */
  14080. function set(object, path, value) {
  14081. return object == null ? object : baseSet(object, path, value);
  14082. }
  14083. /**
  14084. * This method is like `_.set` except that it accepts `customizer` which is
  14085. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14086. * path creation is handled by the method instead. The `customizer` is invoked
  14087. * with three arguments: (nsValue, key, nsObject).
  14088. *
  14089. * **Note:** This method mutates `object`.
  14090. *
  14091. * @static
  14092. * @memberOf _
  14093. * @since 4.0.0
  14094. * @category Object
  14095. * @param {Object} object The object to modify.
  14096. * @param {Array|string} path The path of the property to set.
  14097. * @param {*} value The value to set.
  14098. * @param {Function} [customizer] The function to customize assigned values.
  14099. * @returns {Object} Returns `object`.
  14100. * @example
  14101. *
  14102. * var object = {};
  14103. *
  14104. * _.setWith(object, '[0][1]', 'a', Object);
  14105. * // => { '0': { '1': 'a' } }
  14106. */
  14107. function setWith(object, path, value, customizer) {
  14108. customizer = typeof customizer == 'function' ? customizer : undefined;
  14109. return object == null ? object : baseSet(object, path, value, customizer);
  14110. }
  14111. /**
  14112. * Creates an array of own enumerable string keyed-value pairs for `object`
  14113. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14114. * entries are returned.
  14115. *
  14116. * @static
  14117. * @memberOf _
  14118. * @since 4.0.0
  14119. * @alias entries
  14120. * @category Object
  14121. * @param {Object} object The object to query.
  14122. * @returns {Array} Returns the key-value pairs.
  14123. * @example
  14124. *
  14125. * function Foo() {
  14126. * this.a = 1;
  14127. * this.b = 2;
  14128. * }
  14129. *
  14130. * Foo.prototype.c = 3;
  14131. *
  14132. * _.toPairs(new Foo);
  14133. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14134. */
  14135. var toPairs = createToPairs(keys);
  14136. /**
  14137. * Creates an array of own and inherited enumerable string keyed-value pairs
  14138. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14139. * or set, its entries are returned.
  14140. *
  14141. * @static
  14142. * @memberOf _
  14143. * @since 4.0.0
  14144. * @alias entriesIn
  14145. * @category Object
  14146. * @param {Object} object The object to query.
  14147. * @returns {Array} Returns the key-value pairs.
  14148. * @example
  14149. *
  14150. * function Foo() {
  14151. * this.a = 1;
  14152. * this.b = 2;
  14153. * }
  14154. *
  14155. * Foo.prototype.c = 3;
  14156. *
  14157. * _.toPairsIn(new Foo);
  14158. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14159. */
  14160. var toPairsIn = createToPairs(keysIn);
  14161. /**
  14162. * An alternative to `_.reduce`; this method transforms `object` to a new
  14163. * `accumulator` object which is the result of running each of its own
  14164. * enumerable string keyed properties thru `iteratee`, with each invocation
  14165. * potentially mutating the `accumulator` object. If `accumulator` is not
  14166. * provided, a new object with the same `[[Prototype]]` will be used. The
  14167. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14168. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14169. *
  14170. * @static
  14171. * @memberOf _
  14172. * @since 1.3.0
  14173. * @category Object
  14174. * @param {Object} object The object to iterate over.
  14175. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14176. * @param {*} [accumulator] The custom accumulator value.
  14177. * @returns {*} Returns the accumulated value.
  14178. * @example
  14179. *
  14180. * _.transform([2, 3, 4], function(result, n) {
  14181. * result.push(n *= n);
  14182. * return n % 2 == 0;
  14183. * }, []);
  14184. * // => [4, 9]
  14185. *
  14186. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14187. * (result[value] || (result[value] = [])).push(key);
  14188. * }, {});
  14189. * // => { '1': ['a', 'c'], '2': ['b'] }
  14190. */
  14191. function transform(object, iteratee, accumulator) {
  14192. var isArr = isArray(object),
  14193. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14194. iteratee = getIteratee(iteratee, 4);
  14195. if (accumulator == null) {
  14196. var Ctor = object && object.constructor;
  14197. if (isArrLike) {
  14198. accumulator = isArr ? new Ctor : [];
  14199. }
  14200. else if (isObject(object)) {
  14201. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14202. }
  14203. else {
  14204. accumulator = {};
  14205. }
  14206. }
  14207. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14208. return iteratee(accumulator, value, index, object);
  14209. });
  14210. return accumulator;
  14211. }
  14212. /**
  14213. * Removes the property at `path` of `object`.
  14214. *
  14215. * **Note:** This method mutates `object`.
  14216. *
  14217. * @static
  14218. * @memberOf _
  14219. * @since 4.0.0
  14220. * @category Object
  14221. * @param {Object} object The object to modify.
  14222. * @param {Array|string} path The path of the property to unset.
  14223. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14224. * @example
  14225. *
  14226. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14227. * _.unset(object, 'a[0].b.c');
  14228. * // => true
  14229. *
  14230. * console.log(object);
  14231. * // => { 'a': [{ 'b': {} }] };
  14232. *
  14233. * _.unset(object, ['a', '0', 'b', 'c']);
  14234. * // => true
  14235. *
  14236. * console.log(object);
  14237. * // => { 'a': [{ 'b': {} }] };
  14238. */
  14239. function unset(object, path) {
  14240. return object == null ? true : baseUnset(object, path);
  14241. }
  14242. /**
  14243. * This method is like `_.set` except that accepts `updater` to produce the
  14244. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14245. * is invoked with one argument: (value).
  14246. *
  14247. * **Note:** This method mutates `object`.
  14248. *
  14249. * @static
  14250. * @memberOf _
  14251. * @since 4.6.0
  14252. * @category Object
  14253. * @param {Object} object The object to modify.
  14254. * @param {Array|string} path The path of the property to set.
  14255. * @param {Function} updater The function to produce the updated value.
  14256. * @returns {Object} Returns `object`.
  14257. * @example
  14258. *
  14259. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14260. *
  14261. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14262. * console.log(object.a[0].b.c);
  14263. * // => 9
  14264. *
  14265. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14266. * console.log(object.x[0].y.z);
  14267. * // => 0
  14268. */
  14269. function update(object, path, updater) {
  14270. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14271. }
  14272. /**
  14273. * This method is like `_.update` except that it accepts `customizer` which is
  14274. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14275. * path creation is handled by the method instead. The `customizer` is invoked
  14276. * with three arguments: (nsValue, key, nsObject).
  14277. *
  14278. * **Note:** This method mutates `object`.
  14279. *
  14280. * @static
  14281. * @memberOf _
  14282. * @since 4.6.0
  14283. * @category Object
  14284. * @param {Object} object The object to modify.
  14285. * @param {Array|string} path The path of the property to set.
  14286. * @param {Function} updater The function to produce the updated value.
  14287. * @param {Function} [customizer] The function to customize assigned values.
  14288. * @returns {Object} Returns `object`.
  14289. * @example
  14290. *
  14291. * var object = {};
  14292. *
  14293. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14294. * // => { '0': { '1': 'a' } }
  14295. */
  14296. function updateWith(object, path, updater, customizer) {
  14297. customizer = typeof customizer == 'function' ? customizer : undefined;
  14298. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14299. }
  14300. /**
  14301. * Creates an array of the own enumerable string keyed property values of `object`.
  14302. *
  14303. * **Note:** Non-object values are coerced to objects.
  14304. *
  14305. * @static
  14306. * @since 0.1.0
  14307. * @memberOf _
  14308. * @category Object
  14309. * @param {Object} object The object to query.
  14310. * @returns {Array} Returns the array of property values.
  14311. * @example
  14312. *
  14313. * function Foo() {
  14314. * this.a = 1;
  14315. * this.b = 2;
  14316. * }
  14317. *
  14318. * Foo.prototype.c = 3;
  14319. *
  14320. * _.values(new Foo);
  14321. * // => [1, 2] (iteration order is not guaranteed)
  14322. *
  14323. * _.values('hi');
  14324. * // => ['h', 'i']
  14325. */
  14326. function values(object) {
  14327. return object == null ? [] : baseValues(object, keys(object));
  14328. }
  14329. /**
  14330. * Creates an array of the own and inherited enumerable string keyed property
  14331. * values of `object`.
  14332. *
  14333. * **Note:** Non-object values are coerced to objects.
  14334. *
  14335. * @static
  14336. * @memberOf _
  14337. * @since 3.0.0
  14338. * @category Object
  14339. * @param {Object} object The object to query.
  14340. * @returns {Array} Returns the array of property values.
  14341. * @example
  14342. *
  14343. * function Foo() {
  14344. * this.a = 1;
  14345. * this.b = 2;
  14346. * }
  14347. *
  14348. * Foo.prototype.c = 3;
  14349. *
  14350. * _.valuesIn(new Foo);
  14351. * // => [1, 2, 3] (iteration order is not guaranteed)
  14352. */
  14353. function valuesIn(object) {
  14354. return object == null ? [] : baseValues(object, keysIn(object));
  14355. }
  14356. /*------------------------------------------------------------------------*/
  14357. /**
  14358. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14359. *
  14360. * @static
  14361. * @memberOf _
  14362. * @since 4.0.0
  14363. * @category Number
  14364. * @param {number} number The number to clamp.
  14365. * @param {number} [lower] The lower bound.
  14366. * @param {number} upper The upper bound.
  14367. * @returns {number} Returns the clamped number.
  14368. * @example
  14369. *
  14370. * _.clamp(-10, -5, 5);
  14371. * // => -5
  14372. *
  14373. * _.clamp(10, -5, 5);
  14374. * // => 5
  14375. */
  14376. function clamp(number, lower, upper) {
  14377. if (upper === undefined) {
  14378. upper = lower;
  14379. lower = undefined;
  14380. }
  14381. if (upper !== undefined) {
  14382. upper = toNumber(upper);
  14383. upper = upper === upper ? upper : 0;
  14384. }
  14385. if (lower !== undefined) {
  14386. lower = toNumber(lower);
  14387. lower = lower === lower ? lower : 0;
  14388. }
  14389. return baseClamp(toNumber(number), lower, upper);
  14390. }
  14391. /**
  14392. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14393. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14394. * If `start` is greater than `end` the params are swapped to support
  14395. * negative ranges.
  14396. *
  14397. * @static
  14398. * @memberOf _
  14399. * @since 3.3.0
  14400. * @category Number
  14401. * @param {number} number The number to check.
  14402. * @param {number} [start=0] The start of the range.
  14403. * @param {number} end The end of the range.
  14404. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14405. * @see _.range, _.rangeRight
  14406. * @example
  14407. *
  14408. * _.inRange(3, 2, 4);
  14409. * // => true
  14410. *
  14411. * _.inRange(4, 8);
  14412. * // => true
  14413. *
  14414. * _.inRange(4, 2);
  14415. * // => false
  14416. *
  14417. * _.inRange(2, 2);
  14418. * // => false
  14419. *
  14420. * _.inRange(1.2, 2);
  14421. * // => true
  14422. *
  14423. * _.inRange(5.2, 4);
  14424. * // => false
  14425. *
  14426. * _.inRange(-3, -2, -6);
  14427. * // => true
  14428. */
  14429. function inRange(number, start, end) {
  14430. start = toFinite(start);
  14431. if (end === undefined) {
  14432. end = start;
  14433. start = 0;
  14434. } else {
  14435. end = toFinite(end);
  14436. }
  14437. number = toNumber(number);
  14438. return baseInRange(number, start, end);
  14439. }
  14440. /**
  14441. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14442. * If only one argument is provided a number between `0` and the given number
  14443. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14444. * floats, a floating-point number is returned instead of an integer.
  14445. *
  14446. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14447. * floating-point values which can produce unexpected results.
  14448. *
  14449. * @static
  14450. * @memberOf _
  14451. * @since 0.7.0
  14452. * @category Number
  14453. * @param {number} [lower=0] The lower bound.
  14454. * @param {number} [upper=1] The upper bound.
  14455. * @param {boolean} [floating] Specify returning a floating-point number.
  14456. * @returns {number} Returns the random number.
  14457. * @example
  14458. *
  14459. * _.random(0, 5);
  14460. * // => an integer between 0 and 5
  14461. *
  14462. * _.random(5);
  14463. * // => also an integer between 0 and 5
  14464. *
  14465. * _.random(5, true);
  14466. * // => a floating-point number between 0 and 5
  14467. *
  14468. * _.random(1.2, 5.2);
  14469. * // => a floating-point number between 1.2 and 5.2
  14470. */
  14471. function random(lower, upper, floating) {
  14472. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14473. upper = floating = undefined;
  14474. }
  14475. if (floating === undefined) {
  14476. if (typeof upper == 'boolean') {
  14477. floating = upper;
  14478. upper = undefined;
  14479. }
  14480. else if (typeof lower == 'boolean') {
  14481. floating = lower;
  14482. lower = undefined;
  14483. }
  14484. }
  14485. if (lower === undefined && upper === undefined) {
  14486. lower = 0;
  14487. upper = 1;
  14488. }
  14489. else {
  14490. lower = toFinite(lower);
  14491. if (upper === undefined) {
  14492. upper = lower;
  14493. lower = 0;
  14494. } else {
  14495. upper = toFinite(upper);
  14496. }
  14497. }
  14498. if (lower > upper) {
  14499. var temp = lower;
  14500. lower = upper;
  14501. upper = temp;
  14502. }
  14503. if (floating || lower % 1 || upper % 1) {
  14504. var rand = nativeRandom();
  14505. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14506. }
  14507. return baseRandom(lower, upper);
  14508. }
  14509. /*------------------------------------------------------------------------*/
  14510. /**
  14511. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14512. *
  14513. * @static
  14514. * @memberOf _
  14515. * @since 3.0.0
  14516. * @category String
  14517. * @param {string} [string=''] The string to convert.
  14518. * @returns {string} Returns the camel cased string.
  14519. * @example
  14520. *
  14521. * _.camelCase('Foo Bar');
  14522. * // => 'fooBar'
  14523. *
  14524. * _.camelCase('--foo-bar--');
  14525. * // => 'fooBar'
  14526. *
  14527. * _.camelCase('__FOO_BAR__');
  14528. * // => 'fooBar'
  14529. */
  14530. var camelCase = createCompounder(function(result, word, index) {
  14531. word = word.toLowerCase();
  14532. return result + (index ? capitalize(word) : word);
  14533. });
  14534. /**
  14535. * Converts the first character of `string` to upper case and the remaining
  14536. * to lower case.
  14537. *
  14538. * @static
  14539. * @memberOf _
  14540. * @since 3.0.0
  14541. * @category String
  14542. * @param {string} [string=''] The string to capitalize.
  14543. * @returns {string} Returns the capitalized string.
  14544. * @example
  14545. *
  14546. * _.capitalize('FRED');
  14547. * // => 'Fred'
  14548. */
  14549. function capitalize(string) {
  14550. return upperFirst(toString(string).toLowerCase());
  14551. }
  14552. /**
  14553. * Deburrs `string` by converting
  14554. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14555. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14556. * letters to basic Latin letters and removing
  14557. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14558. *
  14559. * @static
  14560. * @memberOf _
  14561. * @since 3.0.0
  14562. * @category String
  14563. * @param {string} [string=''] The string to deburr.
  14564. * @returns {string} Returns the deburred string.
  14565. * @example
  14566. *
  14567. * _.deburr('déjà vu');
  14568. * // => 'deja vu'
  14569. */
  14570. function deburr(string) {
  14571. string = toString(string);
  14572. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14573. }
  14574. /**
  14575. * Checks if `string` ends with the given target string.
  14576. *
  14577. * @static
  14578. * @memberOf _
  14579. * @since 3.0.0
  14580. * @category String
  14581. * @param {string} [string=''] The string to inspect.
  14582. * @param {string} [target] The string to search for.
  14583. * @param {number} [position=string.length] The position to search up to.
  14584. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14585. * else `false`.
  14586. * @example
  14587. *
  14588. * _.endsWith('abc', 'c');
  14589. * // => true
  14590. *
  14591. * _.endsWith('abc', 'b');
  14592. * // => false
  14593. *
  14594. * _.endsWith('abc', 'b', 2);
  14595. * // => true
  14596. */
  14597. function endsWith(string, target, position) {
  14598. string = toString(string);
  14599. target = baseToString(target);
  14600. var length = string.length;
  14601. position = position === undefined
  14602. ? length
  14603. : baseClamp(toInteger(position), 0, length);
  14604. var end = position;
  14605. position -= target.length;
  14606. return position >= 0 && string.slice(position, end) == target;
  14607. }
  14608. /**
  14609. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14610. * corresponding HTML entities.
  14611. *
  14612. * **Note:** No other characters are escaped. To escape additional
  14613. * characters use a third-party library like [_he_](https://mths.be/he).
  14614. *
  14615. * Though the ">" character is escaped for symmetry, characters like
  14616. * ">" and "/" don't need escaping in HTML and have no special meaning
  14617. * unless they're part of a tag or unquoted attribute value. See
  14618. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14619. * (under "semi-related fun fact") for more details.
  14620. *
  14621. * When working with HTML you should always
  14622. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14623. * XSS vectors.
  14624. *
  14625. * @static
  14626. * @since 0.1.0
  14627. * @memberOf _
  14628. * @category String
  14629. * @param {string} [string=''] The string to escape.
  14630. * @returns {string} Returns the escaped string.
  14631. * @example
  14632. *
  14633. * _.escape('fred, barney, & pebbles');
  14634. * // => 'fred, barney, &amp; pebbles'
  14635. */
  14636. function escape(string) {
  14637. string = toString(string);
  14638. return (string && reHasUnescapedHtml.test(string))
  14639. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14640. : string;
  14641. }
  14642. /**
  14643. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14644. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14645. *
  14646. * @static
  14647. * @memberOf _
  14648. * @since 3.0.0
  14649. * @category String
  14650. * @param {string} [string=''] The string to escape.
  14651. * @returns {string} Returns the escaped string.
  14652. * @example
  14653. *
  14654. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14655. * // => '\[lodash\]\(https://lodash\.com/\)'
  14656. */
  14657. function escapeRegExp(string) {
  14658. string = toString(string);
  14659. return (string && reHasRegExpChar.test(string))
  14660. ? string.replace(reRegExpChar, '\\$&')
  14661. : string;
  14662. }
  14663. /**
  14664. * Converts `string` to
  14665. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14666. *
  14667. * @static
  14668. * @memberOf _
  14669. * @since 3.0.0
  14670. * @category String
  14671. * @param {string} [string=''] The string to convert.
  14672. * @returns {string} Returns the kebab cased string.
  14673. * @example
  14674. *
  14675. * _.kebabCase('Foo Bar');
  14676. * // => 'foo-bar'
  14677. *
  14678. * _.kebabCase('fooBar');
  14679. * // => 'foo-bar'
  14680. *
  14681. * _.kebabCase('__FOO_BAR__');
  14682. * // => 'foo-bar'
  14683. */
  14684. var kebabCase = createCompounder(function(result, word, index) {
  14685. return result + (index ? '-' : '') + word.toLowerCase();
  14686. });
  14687. /**
  14688. * Converts `string`, as space separated words, to lower case.
  14689. *
  14690. * @static
  14691. * @memberOf _
  14692. * @since 4.0.0
  14693. * @category String
  14694. * @param {string} [string=''] The string to convert.
  14695. * @returns {string} Returns the lower cased string.
  14696. * @example
  14697. *
  14698. * _.lowerCase('--Foo-Bar--');
  14699. * // => 'foo bar'
  14700. *
  14701. * _.lowerCase('fooBar');
  14702. * // => 'foo bar'
  14703. *
  14704. * _.lowerCase('__FOO_BAR__');
  14705. * // => 'foo bar'
  14706. */
  14707. var lowerCase = createCompounder(function(result, word, index) {
  14708. return result + (index ? ' ' : '') + word.toLowerCase();
  14709. });
  14710. /**
  14711. * Converts the first character of `string` to lower case.
  14712. *
  14713. * @static
  14714. * @memberOf _
  14715. * @since 4.0.0
  14716. * @category String
  14717. * @param {string} [string=''] The string to convert.
  14718. * @returns {string} Returns the converted string.
  14719. * @example
  14720. *
  14721. * _.lowerFirst('Fred');
  14722. * // => 'fred'
  14723. *
  14724. * _.lowerFirst('FRED');
  14725. * // => 'fRED'
  14726. */
  14727. var lowerFirst = createCaseFirst('toLowerCase');
  14728. /**
  14729. * Pads `string` on the left and right sides if it's shorter than `length`.
  14730. * Padding characters are truncated if they can't be evenly divided by `length`.
  14731. *
  14732. * @static
  14733. * @memberOf _
  14734. * @since 3.0.0
  14735. * @category String
  14736. * @param {string} [string=''] The string to pad.
  14737. * @param {number} [length=0] The padding length.
  14738. * @param {string} [chars=' '] The string used as padding.
  14739. * @returns {string} Returns the padded string.
  14740. * @example
  14741. *
  14742. * _.pad('abc', 8);
  14743. * // => ' abc '
  14744. *
  14745. * _.pad('abc', 8, '_-');
  14746. * // => '_-abc_-_'
  14747. *
  14748. * _.pad('abc', 3);
  14749. * // => 'abc'
  14750. */
  14751. function pad(string, length, chars) {
  14752. string = toString(string);
  14753. length = toInteger(length);
  14754. var strLength = length ? stringSize(string) : 0;
  14755. if (!length || strLength >= length) {
  14756. return string;
  14757. }
  14758. var mid = (length - strLength) / 2;
  14759. return (
  14760. createPadding(nativeFloor(mid), chars) +
  14761. string +
  14762. createPadding(nativeCeil(mid), chars)
  14763. );
  14764. }
  14765. /**
  14766. * Pads `string` on the right side if it's shorter than `length`. Padding
  14767. * characters are truncated if they exceed `length`.
  14768. *
  14769. * @static
  14770. * @memberOf _
  14771. * @since 4.0.0
  14772. * @category String
  14773. * @param {string} [string=''] The string to pad.
  14774. * @param {number} [length=0] The padding length.
  14775. * @param {string} [chars=' '] The string used as padding.
  14776. * @returns {string} Returns the padded string.
  14777. * @example
  14778. *
  14779. * _.padEnd('abc', 6);
  14780. * // => 'abc '
  14781. *
  14782. * _.padEnd('abc', 6, '_-');
  14783. * // => 'abc_-_'
  14784. *
  14785. * _.padEnd('abc', 3);
  14786. * // => 'abc'
  14787. */
  14788. function padEnd(string, length, chars) {
  14789. string = toString(string);
  14790. length = toInteger(length);
  14791. var strLength = length ? stringSize(string) : 0;
  14792. return (length && strLength < length)
  14793. ? (string + createPadding(length - strLength, chars))
  14794. : string;
  14795. }
  14796. /**
  14797. * Pads `string` on the left side if it's shorter than `length`. Padding
  14798. * characters are truncated if they exceed `length`.
  14799. *
  14800. * @static
  14801. * @memberOf _
  14802. * @since 4.0.0
  14803. * @category String
  14804. * @param {string} [string=''] The string to pad.
  14805. * @param {number} [length=0] The padding length.
  14806. * @param {string} [chars=' '] The string used as padding.
  14807. * @returns {string} Returns the padded string.
  14808. * @example
  14809. *
  14810. * _.padStart('abc', 6);
  14811. * // => ' abc'
  14812. *
  14813. * _.padStart('abc', 6, '_-');
  14814. * // => '_-_abc'
  14815. *
  14816. * _.padStart('abc', 3);
  14817. * // => 'abc'
  14818. */
  14819. function padStart(string, length, chars) {
  14820. string = toString(string);
  14821. length = toInteger(length);
  14822. var strLength = length ? stringSize(string) : 0;
  14823. return (length && strLength < length)
  14824. ? (createPadding(length - strLength, chars) + string)
  14825. : string;
  14826. }
  14827. /**
  14828. * Converts `string` to an integer of the specified radix. If `radix` is
  14829. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14830. * hexadecimal, in which case a `radix` of `16` is used.
  14831. *
  14832. * **Note:** This method aligns with the
  14833. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14834. *
  14835. * @static
  14836. * @memberOf _
  14837. * @since 1.1.0
  14838. * @category String
  14839. * @param {string} string The string to convert.
  14840. * @param {number} [radix=10] The radix to interpret `value` by.
  14841. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14842. * @returns {number} Returns the converted integer.
  14843. * @example
  14844. *
  14845. * _.parseInt('08');
  14846. * // => 8
  14847. *
  14848. * _.map(['6', '08', '10'], _.parseInt);
  14849. * // => [6, 8, 10]
  14850. */
  14851. function parseInt(string, radix, guard) {
  14852. if (guard || radix == null) {
  14853. radix = 0;
  14854. } else if (radix) {
  14855. radix = +radix;
  14856. }
  14857. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14858. }
  14859. /**
  14860. * Repeats the given string `n` times.
  14861. *
  14862. * @static
  14863. * @memberOf _
  14864. * @since 3.0.0
  14865. * @category String
  14866. * @param {string} [string=''] The string to repeat.
  14867. * @param {number} [n=1] The number of times to repeat the string.
  14868. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14869. * @returns {string} Returns the repeated string.
  14870. * @example
  14871. *
  14872. * _.repeat('*', 3);
  14873. * // => '***'
  14874. *
  14875. * _.repeat('abc', 2);
  14876. * // => 'abcabc'
  14877. *
  14878. * _.repeat('abc', 0);
  14879. * // => ''
  14880. */
  14881. function repeat(string, n, guard) {
  14882. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14883. n = 1;
  14884. } else {
  14885. n = toInteger(n);
  14886. }
  14887. return baseRepeat(toString(string), n);
  14888. }
  14889. /**
  14890. * Replaces matches for `pattern` in `string` with `replacement`.
  14891. *
  14892. * **Note:** This method is based on
  14893. * [`String#replace`](https://mdn.io/String/replace).
  14894. *
  14895. * @static
  14896. * @memberOf _
  14897. * @since 4.0.0
  14898. * @category String
  14899. * @param {string} [string=''] The string to modify.
  14900. * @param {RegExp|string} pattern The pattern to replace.
  14901. * @param {Function|string} replacement The match replacement.
  14902. * @returns {string} Returns the modified string.
  14903. * @example
  14904. *
  14905. * _.replace('Hi Fred', 'Fred', 'Barney');
  14906. * // => 'Hi Barney'
  14907. */
  14908. function replace() {
  14909. var args = arguments,
  14910. string = toString(args[0]);
  14911. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14912. }
  14913. /**
  14914. * Converts `string` to
  14915. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14916. *
  14917. * @static
  14918. * @memberOf _
  14919. * @since 3.0.0
  14920. * @category String
  14921. * @param {string} [string=''] The string to convert.
  14922. * @returns {string} Returns the snake cased string.
  14923. * @example
  14924. *
  14925. * _.snakeCase('Foo Bar');
  14926. * // => 'foo_bar'
  14927. *
  14928. * _.snakeCase('fooBar');
  14929. * // => 'foo_bar'
  14930. *
  14931. * _.snakeCase('--FOO-BAR--');
  14932. * // => 'foo_bar'
  14933. */
  14934. var snakeCase = createCompounder(function(result, word, index) {
  14935. return result + (index ? '_' : '') + word.toLowerCase();
  14936. });
  14937. /**
  14938. * Splits `string` by `separator`.
  14939. *
  14940. * **Note:** This method is based on
  14941. * [`String#split`](https://mdn.io/String/split).
  14942. *
  14943. * @static
  14944. * @memberOf _
  14945. * @since 4.0.0
  14946. * @category String
  14947. * @param {string} [string=''] The string to split.
  14948. * @param {RegExp|string} separator The separator pattern to split by.
  14949. * @param {number} [limit] The length to truncate results to.
  14950. * @returns {Array} Returns the string segments.
  14951. * @example
  14952. *
  14953. * _.split('a-b-c', '-', 2);
  14954. * // => ['a', 'b']
  14955. */
  14956. function split(string, separator, limit) {
  14957. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14958. separator = limit = undefined;
  14959. }
  14960. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14961. if (!limit) {
  14962. return [];
  14963. }
  14964. string = toString(string);
  14965. if (string && (
  14966. typeof separator == 'string' ||
  14967. (separator != null && !isRegExp(separator))
  14968. )) {
  14969. separator = baseToString(separator);
  14970. if (!separator && hasUnicode(string)) {
  14971. return castSlice(stringToArray(string), 0, limit);
  14972. }
  14973. }
  14974. return string.split(separator, limit);
  14975. }
  14976. /**
  14977. * Converts `string` to
  14978. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14979. *
  14980. * @static
  14981. * @memberOf _
  14982. * @since 3.1.0
  14983. * @category String
  14984. * @param {string} [string=''] The string to convert.
  14985. * @returns {string} Returns the start cased string.
  14986. * @example
  14987. *
  14988. * _.startCase('--foo-bar--');
  14989. * // => 'Foo Bar'
  14990. *
  14991. * _.startCase('fooBar');
  14992. * // => 'Foo Bar'
  14993. *
  14994. * _.startCase('__FOO_BAR__');
  14995. * // => 'FOO BAR'
  14996. */
  14997. var startCase = createCompounder(function(result, word, index) {
  14998. return result + (index ? ' ' : '') + upperFirst(word);
  14999. });
  15000. /**
  15001. * Checks if `string` starts with the given target string.
  15002. *
  15003. * @static
  15004. * @memberOf _
  15005. * @since 3.0.0
  15006. * @category String
  15007. * @param {string} [string=''] The string to inspect.
  15008. * @param {string} [target] The string to search for.
  15009. * @param {number} [position=0] The position to search from.
  15010. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15011. * else `false`.
  15012. * @example
  15013. *
  15014. * _.startsWith('abc', 'a');
  15015. * // => true
  15016. *
  15017. * _.startsWith('abc', 'b');
  15018. * // => false
  15019. *
  15020. * _.startsWith('abc', 'b', 1);
  15021. * // => true
  15022. */
  15023. function startsWith(string, target, position) {
  15024. string = toString(string);
  15025. position = position == null
  15026. ? 0
  15027. : baseClamp(toInteger(position), 0, string.length);
  15028. target = baseToString(target);
  15029. return string.slice(position, position + target.length) == target;
  15030. }
  15031. /**
  15032. * Creates a compiled template function that can interpolate data properties
  15033. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15034. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15035. * properties may be accessed as free variables in the template. If a setting
  15036. * object is given, it takes precedence over `_.templateSettings` values.
  15037. *
  15038. * **Note:** In the development build `_.template` utilizes
  15039. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15040. * for easier debugging.
  15041. *
  15042. * For more information on precompiling templates see
  15043. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15044. *
  15045. * For more information on Chrome extension sandboxes see
  15046. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15047. *
  15048. * @static
  15049. * @since 0.1.0
  15050. * @memberOf _
  15051. * @category String
  15052. * @param {string} [string=''] The template string.
  15053. * @param {Object} [options={}] The options object.
  15054. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15055. * The HTML "escape" delimiter.
  15056. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15057. * The "evaluate" delimiter.
  15058. * @param {Object} [options.imports=_.templateSettings.imports]
  15059. * An object to import into the template as free variables.
  15060. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15061. * The "interpolate" delimiter.
  15062. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15063. * The sourceURL of the compiled template.
  15064. * @param {string} [options.variable='obj']
  15065. * The data object variable name.
  15066. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15067. * @returns {Function} Returns the compiled template function.
  15068. * @example
  15069. *
  15070. * // Use the "interpolate" delimiter to create a compiled template.
  15071. * var compiled = _.template('hello <%= user %>!');
  15072. * compiled({ 'user': 'fred' });
  15073. * // => 'hello fred!'
  15074. *
  15075. * // Use the HTML "escape" delimiter to escape data property values.
  15076. * var compiled = _.template('<b><%- value %></b>');
  15077. * compiled({ 'value': '<script>' });
  15078. * // => '<b>&lt;script&gt;</b>'
  15079. *
  15080. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15081. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15082. * compiled({ 'users': ['fred', 'barney'] });
  15083. * // => '<li>fred</li><li>barney</li>'
  15084. *
  15085. * // Use the internal `print` function in "evaluate" delimiters.
  15086. * var compiled = _.template('<% print("hello " + user); %>!');
  15087. * compiled({ 'user': 'barney' });
  15088. * // => 'hello barney!'
  15089. *
  15090. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15091. * // Disable support by replacing the "interpolate" delimiter.
  15092. * var compiled = _.template('hello ${ user }!');
  15093. * compiled({ 'user': 'pebbles' });
  15094. * // => 'hello pebbles!'
  15095. *
  15096. * // Use backslashes to treat delimiters as plain text.
  15097. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15098. * compiled({ 'value': 'ignored' });
  15099. * // => '<%- value %>'
  15100. *
  15101. * // Use the `imports` option to import `jQuery` as `jq`.
  15102. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15103. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15104. * compiled({ 'users': ['fred', 'barney'] });
  15105. * // => '<li>fred</li><li>barney</li>'
  15106. *
  15107. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15108. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15109. * compiled(data);
  15110. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15111. *
  15112. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15113. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15114. * compiled.source;
  15115. * // => function(data) {
  15116. * // var __t, __p = '';
  15117. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15118. * // return __p;
  15119. * // }
  15120. *
  15121. * // Use custom template delimiters.
  15122. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15123. * var compiled = _.template('hello {{ user }}!');
  15124. * compiled({ 'user': 'mustache' });
  15125. * // => 'hello mustache!'
  15126. *
  15127. * // Use the `source` property to inline compiled templates for meaningful
  15128. * // line numbers in error messages and stack traces.
  15129. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15130. * var JST = {\
  15131. * "main": ' + _.template(mainText).source + '\
  15132. * };\
  15133. * ');
  15134. */
  15135. function template(string, options, guard) {
  15136. // Based on John Resig's `tmpl` implementation
  15137. // (http://ejohn.org/blog/javascript-micro-templating/)
  15138. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15139. var settings = lodash.templateSettings;
  15140. if (guard && isIterateeCall(string, options, guard)) {
  15141. options = undefined;
  15142. }
  15143. string = toString(string);
  15144. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15145. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15146. importsKeys = keys(imports),
  15147. importsValues = baseValues(imports, importsKeys);
  15148. var isEscaping,
  15149. isEvaluating,
  15150. index = 0,
  15151. interpolate = options.interpolate || reNoMatch,
  15152. source = "__p += '";
  15153. // Compile the regexp to match each delimiter.
  15154. var reDelimiters = RegExp(
  15155. (options.escape || reNoMatch).source + '|' +
  15156. interpolate.source + '|' +
  15157. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15158. (options.evaluate || reNoMatch).source + '|$'
  15159. , 'g');
  15160. // Use a sourceURL for easier debugging.
  15161. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15162. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15163. // and escape the comment, thus injecting code that gets evaled.
  15164. var sourceURL = '//# sourceURL=' +
  15165. (hasOwnProperty.call(options, 'sourceURL')
  15166. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15167. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15168. ) + '\n';
  15169. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15170. interpolateValue || (interpolateValue = esTemplateValue);
  15171. // Escape characters that can't be included in string literals.
  15172. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15173. // Replace delimiters with snippets.
  15174. if (escapeValue) {
  15175. isEscaping = true;
  15176. source += "' +\n__e(" + escapeValue + ") +\n'";
  15177. }
  15178. if (evaluateValue) {
  15179. isEvaluating = true;
  15180. source += "';\n" + evaluateValue + ";\n__p += '";
  15181. }
  15182. if (interpolateValue) {
  15183. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15184. }
  15185. index = offset + match.length;
  15186. // The JS engine embedded in Adobe products needs `match` returned in
  15187. // order to produce the correct `offset` value.
  15188. return match;
  15189. });
  15190. source += "';\n";
  15191. // If `variable` is not specified wrap a with-statement around the generated
  15192. // code to add the data object to the top of the scope chain.
  15193. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15194. if (!variable) {
  15195. source = 'with (obj) {\n' + source + '\n}\n';
  15196. }
  15197. // Throw an error if a forbidden character was found in `variable`, to prevent
  15198. // potential command injection attacks.
  15199. else if (reForbiddenIdentifierChars.test(variable)) {
  15200. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15201. }
  15202. // Cleanup code by stripping empty strings.
  15203. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15204. .replace(reEmptyStringMiddle, '$1')
  15205. .replace(reEmptyStringTrailing, '$1;');
  15206. // Frame code as the function body.
  15207. source = 'function(' + (variable || 'obj') + ') {\n' +
  15208. (variable
  15209. ? ''
  15210. : 'obj || (obj = {});\n'
  15211. ) +
  15212. "var __t, __p = ''" +
  15213. (isEscaping
  15214. ? ', __e = _.escape'
  15215. : ''
  15216. ) +
  15217. (isEvaluating
  15218. ? ', __j = Array.prototype.join;\n' +
  15219. "function print() { __p += __j.call(arguments, '') }\n"
  15220. : ';\n'
  15221. ) +
  15222. source +
  15223. 'return __p\n}';
  15224. var result = attempt(function() {
  15225. return Function(importsKeys, sourceURL + 'return ' + source)
  15226. .apply(undefined, importsValues);
  15227. });
  15228. // Provide the compiled function's source by its `toString` method or
  15229. // the `source` property as a convenience for inlining compiled templates.
  15230. result.source = source;
  15231. if (isError(result)) {
  15232. throw result;
  15233. }
  15234. return result;
  15235. }
  15236. /**
  15237. * Converts `string`, as a whole, to lower case just like
  15238. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15239. *
  15240. * @static
  15241. * @memberOf _
  15242. * @since 4.0.0
  15243. * @category String
  15244. * @param {string} [string=''] The string to convert.
  15245. * @returns {string} Returns the lower cased string.
  15246. * @example
  15247. *
  15248. * _.toLower('--Foo-Bar--');
  15249. * // => '--foo-bar--'
  15250. *
  15251. * _.toLower('fooBar');
  15252. * // => 'foobar'
  15253. *
  15254. * _.toLower('__FOO_BAR__');
  15255. * // => '__foo_bar__'
  15256. */
  15257. function toLower(value) {
  15258. return toString(value).toLowerCase();
  15259. }
  15260. /**
  15261. * Converts `string`, as a whole, to upper case just like
  15262. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15263. *
  15264. * @static
  15265. * @memberOf _
  15266. * @since 4.0.0
  15267. * @category String
  15268. * @param {string} [string=''] The string to convert.
  15269. * @returns {string} Returns the upper cased string.
  15270. * @example
  15271. *
  15272. * _.toUpper('--foo-bar--');
  15273. * // => '--FOO-BAR--'
  15274. *
  15275. * _.toUpper('fooBar');
  15276. * // => 'FOOBAR'
  15277. *
  15278. * _.toUpper('__foo_bar__');
  15279. * // => '__FOO_BAR__'
  15280. */
  15281. function toUpper(value) {
  15282. return toString(value).toUpperCase();
  15283. }
  15284. /**
  15285. * Removes leading and trailing whitespace or specified characters from `string`.
  15286. *
  15287. * @static
  15288. * @memberOf _
  15289. * @since 3.0.0
  15290. * @category String
  15291. * @param {string} [string=''] The string to trim.
  15292. * @param {string} [chars=whitespace] The characters to trim.
  15293. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15294. * @returns {string} Returns the trimmed string.
  15295. * @example
  15296. *
  15297. * _.trim(' abc ');
  15298. * // => 'abc'
  15299. *
  15300. * _.trim('-_-abc-_-', '_-');
  15301. * // => 'abc'
  15302. *
  15303. * _.map([' foo ', ' bar '], _.trim);
  15304. * // => ['foo', 'bar']
  15305. */
  15306. function trim(string, chars, guard) {
  15307. string = toString(string);
  15308. if (string && (guard || chars === undefined)) {
  15309. return baseTrim(string);
  15310. }
  15311. if (!string || !(chars = baseToString(chars))) {
  15312. return string;
  15313. }
  15314. var strSymbols = stringToArray(string),
  15315. chrSymbols = stringToArray(chars),
  15316. start = charsStartIndex(strSymbols, chrSymbols),
  15317. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15318. return castSlice(strSymbols, start, end).join('');
  15319. }
  15320. /**
  15321. * Removes trailing whitespace or specified characters from `string`.
  15322. *
  15323. * @static
  15324. * @memberOf _
  15325. * @since 4.0.0
  15326. * @category String
  15327. * @param {string} [string=''] The string to trim.
  15328. * @param {string} [chars=whitespace] The characters to trim.
  15329. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15330. * @returns {string} Returns the trimmed string.
  15331. * @example
  15332. *
  15333. * _.trimEnd(' abc ');
  15334. * // => ' abc'
  15335. *
  15336. * _.trimEnd('-_-abc-_-', '_-');
  15337. * // => '-_-abc'
  15338. */
  15339. function trimEnd(string, chars, guard) {
  15340. string = toString(string);
  15341. if (string && (guard || chars === undefined)) {
  15342. return string.slice(0, trimmedEndIndex(string) + 1);
  15343. }
  15344. if (!string || !(chars = baseToString(chars))) {
  15345. return string;
  15346. }
  15347. var strSymbols = stringToArray(string),
  15348. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15349. return castSlice(strSymbols, 0, end).join('');
  15350. }
  15351. /**
  15352. * Removes leading whitespace or specified characters from `string`.
  15353. *
  15354. * @static
  15355. * @memberOf _
  15356. * @since 4.0.0
  15357. * @category String
  15358. * @param {string} [string=''] The string to trim.
  15359. * @param {string} [chars=whitespace] The characters to trim.
  15360. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15361. * @returns {string} Returns the trimmed string.
  15362. * @example
  15363. *
  15364. * _.trimStart(' abc ');
  15365. * // => 'abc '
  15366. *
  15367. * _.trimStart('-_-abc-_-', '_-');
  15368. * // => 'abc-_-'
  15369. */
  15370. function trimStart(string, chars, guard) {
  15371. string = toString(string);
  15372. if (string && (guard || chars === undefined)) {
  15373. return string.replace(reTrimStart, '');
  15374. }
  15375. if (!string || !(chars = baseToString(chars))) {
  15376. return string;
  15377. }
  15378. var strSymbols = stringToArray(string),
  15379. start = charsStartIndex(strSymbols, stringToArray(chars));
  15380. return castSlice(strSymbols, start).join('');
  15381. }
  15382. /**
  15383. * Truncates `string` if it's longer than the given maximum string length.
  15384. * The last characters of the truncated string are replaced with the omission
  15385. * string which defaults to "...".
  15386. *
  15387. * @static
  15388. * @memberOf _
  15389. * @since 4.0.0
  15390. * @category String
  15391. * @param {string} [string=''] The string to truncate.
  15392. * @param {Object} [options={}] The options object.
  15393. * @param {number} [options.length=30] The maximum string length.
  15394. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15395. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15396. * @returns {string} Returns the truncated string.
  15397. * @example
  15398. *
  15399. * _.truncate('hi-diddly-ho there, neighborino');
  15400. * // => 'hi-diddly-ho there, neighbo...'
  15401. *
  15402. * _.truncate('hi-diddly-ho there, neighborino', {
  15403. * 'length': 24,
  15404. * 'separator': ' '
  15405. * });
  15406. * // => 'hi-diddly-ho there,...'
  15407. *
  15408. * _.truncate('hi-diddly-ho there, neighborino', {
  15409. * 'length': 24,
  15410. * 'separator': /,? +/
  15411. * });
  15412. * // => 'hi-diddly-ho there...'
  15413. *
  15414. * _.truncate('hi-diddly-ho there, neighborino', {
  15415. * 'omission': ' [...]'
  15416. * });
  15417. * // => 'hi-diddly-ho there, neig [...]'
  15418. */
  15419. function truncate(string, options) {
  15420. var length = DEFAULT_TRUNC_LENGTH,
  15421. omission = DEFAULT_TRUNC_OMISSION;
  15422. if (isObject(options)) {
  15423. var separator = 'separator' in options ? options.separator : separator;
  15424. length = 'length' in options ? toInteger(options.length) : length;
  15425. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15426. }
  15427. string = toString(string);
  15428. var strLength = string.length;
  15429. if (hasUnicode(string)) {
  15430. var strSymbols = stringToArray(string);
  15431. strLength = strSymbols.length;
  15432. }
  15433. if (length >= strLength) {
  15434. return string;
  15435. }
  15436. var end = length - stringSize(omission);
  15437. if (end < 1) {
  15438. return omission;
  15439. }
  15440. var result = strSymbols
  15441. ? castSlice(strSymbols, 0, end).join('')
  15442. : string.slice(0, end);
  15443. if (separator === undefined) {
  15444. return result + omission;
  15445. }
  15446. if (strSymbols) {
  15447. end += (result.length - end);
  15448. }
  15449. if (isRegExp(separator)) {
  15450. if (string.slice(end).search(separator)) {
  15451. var match,
  15452. substring = result;
  15453. if (!separator.global) {
  15454. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15455. }
  15456. separator.lastIndex = 0;
  15457. while ((match = separator.exec(substring))) {
  15458. var newEnd = match.index;
  15459. }
  15460. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15461. }
  15462. } else if (string.indexOf(baseToString(separator), end) != end) {
  15463. var index = result.lastIndexOf(separator);
  15464. if (index > -1) {
  15465. result = result.slice(0, index);
  15466. }
  15467. }
  15468. return result + omission;
  15469. }
  15470. /**
  15471. * The inverse of `_.escape`; this method converts the HTML entities
  15472. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15473. * their corresponding characters.
  15474. *
  15475. * **Note:** No other HTML entities are unescaped. To unescape additional
  15476. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15477. *
  15478. * @static
  15479. * @memberOf _
  15480. * @since 0.6.0
  15481. * @category String
  15482. * @param {string} [string=''] The string to unescape.
  15483. * @returns {string} Returns the unescaped string.
  15484. * @example
  15485. *
  15486. * _.unescape('fred, barney, &amp; pebbles');
  15487. * // => 'fred, barney, & pebbles'
  15488. */
  15489. function unescape(string) {
  15490. string = toString(string);
  15491. return (string && reHasEscapedHtml.test(string))
  15492. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15493. : string;
  15494. }
  15495. /**
  15496. * Converts `string`, as space separated words, to upper case.
  15497. *
  15498. * @static
  15499. * @memberOf _
  15500. * @since 4.0.0
  15501. * @category String
  15502. * @param {string} [string=''] The string to convert.
  15503. * @returns {string} Returns the upper cased string.
  15504. * @example
  15505. *
  15506. * _.upperCase('--foo-bar');
  15507. * // => 'FOO BAR'
  15508. *
  15509. * _.upperCase('fooBar');
  15510. * // => 'FOO BAR'
  15511. *
  15512. * _.upperCase('__foo_bar__');
  15513. * // => 'FOO BAR'
  15514. */
  15515. var upperCase = createCompounder(function(result, word, index) {
  15516. return result + (index ? ' ' : '') + word.toUpperCase();
  15517. });
  15518. /**
  15519. * Converts the first character of `string` to upper case.
  15520. *
  15521. * @static
  15522. * @memberOf _
  15523. * @since 4.0.0
  15524. * @category String
  15525. * @param {string} [string=''] The string to convert.
  15526. * @returns {string} Returns the converted string.
  15527. * @example
  15528. *
  15529. * _.upperFirst('fred');
  15530. * // => 'Fred'
  15531. *
  15532. * _.upperFirst('FRED');
  15533. * // => 'FRED'
  15534. */
  15535. var upperFirst = createCaseFirst('toUpperCase');
  15536. /**
  15537. * Splits `string` into an array of its words.
  15538. *
  15539. * @static
  15540. * @memberOf _
  15541. * @since 3.0.0
  15542. * @category String
  15543. * @param {string} [string=''] The string to inspect.
  15544. * @param {RegExp|string} [pattern] The pattern to match words.
  15545. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15546. * @returns {Array} Returns the words of `string`.
  15547. * @example
  15548. *
  15549. * _.words('fred, barney, & pebbles');
  15550. * // => ['fred', 'barney', 'pebbles']
  15551. *
  15552. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15553. * // => ['fred', 'barney', '&', 'pebbles']
  15554. */
  15555. function words(string, pattern, guard) {
  15556. string = toString(string);
  15557. pattern = guard ? undefined : pattern;
  15558. if (pattern === undefined) {
  15559. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15560. }
  15561. return string.match(pattern) || [];
  15562. }
  15563. /*------------------------------------------------------------------------*/
  15564. /**
  15565. * Attempts to invoke `func`, returning either the result or the caught error
  15566. * object. Any additional arguments are provided to `func` when it's invoked.
  15567. *
  15568. * @static
  15569. * @memberOf _
  15570. * @since 3.0.0
  15571. * @category Util
  15572. * @param {Function} func The function to attempt.
  15573. * @param {...*} [args] The arguments to invoke `func` with.
  15574. * @returns {*} Returns the `func` result or error object.
  15575. * @example
  15576. *
  15577. * // Avoid throwing errors for invalid selectors.
  15578. * var elements = _.attempt(function(selector) {
  15579. * return document.querySelectorAll(selector);
  15580. * }, '>_>');
  15581. *
  15582. * if (_.isError(elements)) {
  15583. * elements = [];
  15584. * }
  15585. */
  15586. var attempt = baseRest(function(func, args) {
  15587. try {
  15588. return apply(func, undefined, args);
  15589. } catch (e) {
  15590. return isError(e) ? e : new Error(e);
  15591. }
  15592. });
  15593. /**
  15594. * Binds methods of an object to the object itself, overwriting the existing
  15595. * method.
  15596. *
  15597. * **Note:** This method doesn't set the "length" property of bound functions.
  15598. *
  15599. * @static
  15600. * @since 0.1.0
  15601. * @memberOf _
  15602. * @category Util
  15603. * @param {Object} object The object to bind and assign the bound methods to.
  15604. * @param {...(string|string[])} methodNames The object method names to bind.
  15605. * @returns {Object} Returns `object`.
  15606. * @example
  15607. *
  15608. * var view = {
  15609. * 'label': 'docs',
  15610. * 'click': function() {
  15611. * console.log('clicked ' + this.label);
  15612. * }
  15613. * };
  15614. *
  15615. * _.bindAll(view, ['click']);
  15616. * jQuery(element).on('click', view.click);
  15617. * // => Logs 'clicked docs' when clicked.
  15618. */
  15619. var bindAll = flatRest(function(object, methodNames) {
  15620. arrayEach(methodNames, function(key) {
  15621. key = toKey(key);
  15622. baseAssignValue(object, key, bind(object[key], object));
  15623. });
  15624. return object;
  15625. });
  15626. /**
  15627. * Creates a function that iterates over `pairs` and invokes the corresponding
  15628. * function of the first predicate to return truthy. The predicate-function
  15629. * pairs are invoked with the `this` binding and arguments of the created
  15630. * function.
  15631. *
  15632. * @static
  15633. * @memberOf _
  15634. * @since 4.0.0
  15635. * @category Util
  15636. * @param {Array} pairs The predicate-function pairs.
  15637. * @returns {Function} Returns the new composite function.
  15638. * @example
  15639. *
  15640. * var func = _.cond([
  15641. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15642. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15643. * [_.stubTrue, _.constant('no match')]
  15644. * ]);
  15645. *
  15646. * func({ 'a': 1, 'b': 2 });
  15647. * // => 'matches A'
  15648. *
  15649. * func({ 'a': 0, 'b': 1 });
  15650. * // => 'matches B'
  15651. *
  15652. * func({ 'a': '1', 'b': '2' });
  15653. * // => 'no match'
  15654. */
  15655. function cond(pairs) {
  15656. var length = pairs == null ? 0 : pairs.length,
  15657. toIteratee = getIteratee();
  15658. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15659. if (typeof pair[1] != 'function') {
  15660. throw new TypeError(FUNC_ERROR_TEXT);
  15661. }
  15662. return [toIteratee(pair[0]), pair[1]];
  15663. });
  15664. return baseRest(function(args) {
  15665. var index = -1;
  15666. while (++index < length) {
  15667. var pair = pairs[index];
  15668. if (apply(pair[0], this, args)) {
  15669. return apply(pair[1], this, args);
  15670. }
  15671. }
  15672. });
  15673. }
  15674. /**
  15675. * Creates a function that invokes the predicate properties of `source` with
  15676. * the corresponding property values of a given object, returning `true` if
  15677. * all predicates return truthy, else `false`.
  15678. *
  15679. * **Note:** The created function is equivalent to `_.conformsTo` with
  15680. * `source` partially applied.
  15681. *
  15682. * @static
  15683. * @memberOf _
  15684. * @since 4.0.0
  15685. * @category Util
  15686. * @param {Object} source The object of property predicates to conform to.
  15687. * @returns {Function} Returns the new spec function.
  15688. * @example
  15689. *
  15690. * var objects = [
  15691. * { 'a': 2, 'b': 1 },
  15692. * { 'a': 1, 'b': 2 }
  15693. * ];
  15694. *
  15695. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15696. * // => [{ 'a': 1, 'b': 2 }]
  15697. */
  15698. function conforms(source) {
  15699. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15700. }
  15701. /**
  15702. * Creates a function that returns `value`.
  15703. *
  15704. * @static
  15705. * @memberOf _
  15706. * @since 2.4.0
  15707. * @category Util
  15708. * @param {*} value The value to return from the new function.
  15709. * @returns {Function} Returns the new constant function.
  15710. * @example
  15711. *
  15712. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15713. *
  15714. * console.log(objects);
  15715. * // => [{ 'a': 1 }, { 'a': 1 }]
  15716. *
  15717. * console.log(objects[0] === objects[1]);
  15718. * // => true
  15719. */
  15720. function constant(value) {
  15721. return function() {
  15722. return value;
  15723. };
  15724. }
  15725. /**
  15726. * Checks `value` to determine whether a default value should be returned in
  15727. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15728. * or `undefined`.
  15729. *
  15730. * @static
  15731. * @memberOf _
  15732. * @since 4.14.0
  15733. * @category Util
  15734. * @param {*} value The value to check.
  15735. * @param {*} defaultValue The default value.
  15736. * @returns {*} Returns the resolved value.
  15737. * @example
  15738. *
  15739. * _.defaultTo(1, 10);
  15740. * // => 1
  15741. *
  15742. * _.defaultTo(undefined, 10);
  15743. * // => 10
  15744. */
  15745. function defaultTo(value, defaultValue) {
  15746. return (value == null || value !== value) ? defaultValue : value;
  15747. }
  15748. /**
  15749. * Creates a function that returns the result of invoking the given functions
  15750. * with the `this` binding of the created function, where each successive
  15751. * invocation is supplied the return value of the previous.
  15752. *
  15753. * @static
  15754. * @memberOf _
  15755. * @since 3.0.0
  15756. * @category Util
  15757. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15758. * @returns {Function} Returns the new composite function.
  15759. * @see _.flowRight
  15760. * @example
  15761. *
  15762. * function square(n) {
  15763. * return n * n;
  15764. * }
  15765. *
  15766. * var addSquare = _.flow([_.add, square]);
  15767. * addSquare(1, 2);
  15768. * // => 9
  15769. */
  15770. var flow = createFlow();
  15771. /**
  15772. * This method is like `_.flow` except that it creates a function that
  15773. * invokes the given functions from right to left.
  15774. *
  15775. * @static
  15776. * @since 3.0.0
  15777. * @memberOf _
  15778. * @category Util
  15779. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15780. * @returns {Function} Returns the new composite function.
  15781. * @see _.flow
  15782. * @example
  15783. *
  15784. * function square(n) {
  15785. * return n * n;
  15786. * }
  15787. *
  15788. * var addSquare = _.flowRight([square, _.add]);
  15789. * addSquare(1, 2);
  15790. * // => 9
  15791. */
  15792. var flowRight = createFlow(true);
  15793. /**
  15794. * This method returns the first argument it receives.
  15795. *
  15796. * @static
  15797. * @since 0.1.0
  15798. * @memberOf _
  15799. * @category Util
  15800. * @param {*} value Any value.
  15801. * @returns {*} Returns `value`.
  15802. * @example
  15803. *
  15804. * var object = { 'a': 1 };
  15805. *
  15806. * console.log(_.identity(object) === object);
  15807. * // => true
  15808. */
  15809. function identity(value) {
  15810. return value;
  15811. }
  15812. /**
  15813. * Creates a function that invokes `func` with the arguments of the created
  15814. * function. If `func` is a property name, the created function returns the
  15815. * property value for a given element. If `func` is an array or object, the
  15816. * created function returns `true` for elements that contain the equivalent
  15817. * source properties, otherwise it returns `false`.
  15818. *
  15819. * @static
  15820. * @since 4.0.0
  15821. * @memberOf _
  15822. * @category Util
  15823. * @param {*} [func=_.identity] The value to convert to a callback.
  15824. * @returns {Function} Returns the callback.
  15825. * @example
  15826. *
  15827. * var users = [
  15828. * { 'user': 'barney', 'age': 36, 'active': true },
  15829. * { 'user': 'fred', 'age': 40, 'active': false }
  15830. * ];
  15831. *
  15832. * // The `_.matches` iteratee shorthand.
  15833. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15834. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15835. *
  15836. * // The `_.matchesProperty` iteratee shorthand.
  15837. * _.filter(users, _.iteratee(['user', 'fred']));
  15838. * // => [{ 'user': 'fred', 'age': 40 }]
  15839. *
  15840. * // The `_.property` iteratee shorthand.
  15841. * _.map(users, _.iteratee('user'));
  15842. * // => ['barney', 'fred']
  15843. *
  15844. * // Create custom iteratee shorthands.
  15845. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15846. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15847. * return func.test(string);
  15848. * };
  15849. * });
  15850. *
  15851. * _.filter(['abc', 'def'], /ef/);
  15852. * // => ['def']
  15853. */
  15854. function iteratee(func) {
  15855. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15856. }
  15857. /**
  15858. * Creates a function that performs a partial deep comparison between a given
  15859. * object and `source`, returning `true` if the given object has equivalent
  15860. * property values, else `false`.
  15861. *
  15862. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15863. * partially applied.
  15864. *
  15865. * Partial comparisons will match empty array and empty object `source`
  15866. * values against any array or object value, respectively. See `_.isEqual`
  15867. * for a list of supported value comparisons.
  15868. *
  15869. * **Note:** Multiple values can be checked by combining several matchers
  15870. * using `_.overSome`
  15871. *
  15872. * @static
  15873. * @memberOf _
  15874. * @since 3.0.0
  15875. * @category Util
  15876. * @param {Object} source The object of property values to match.
  15877. * @returns {Function} Returns the new spec function.
  15878. * @example
  15879. *
  15880. * var objects = [
  15881. * { 'a': 1, 'b': 2, 'c': 3 },
  15882. * { 'a': 4, 'b': 5, 'c': 6 }
  15883. * ];
  15884. *
  15885. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15886. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15887. *
  15888. * // Checking for several possible values
  15889. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15890. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15891. */
  15892. function matches(source) {
  15893. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15894. }
  15895. /**
  15896. * Creates a function that performs a partial deep comparison between the
  15897. * value at `path` of a given object to `srcValue`, returning `true` if the
  15898. * object value is equivalent, else `false`.
  15899. *
  15900. * **Note:** Partial comparisons will match empty array and empty object
  15901. * `srcValue` values against any array or object value, respectively. See
  15902. * `_.isEqual` for a list of supported value comparisons.
  15903. *
  15904. * **Note:** Multiple values can be checked by combining several matchers
  15905. * using `_.overSome`
  15906. *
  15907. * @static
  15908. * @memberOf _
  15909. * @since 3.2.0
  15910. * @category Util
  15911. * @param {Array|string} path The path of the property to get.
  15912. * @param {*} srcValue The value to match.
  15913. * @returns {Function} Returns the new spec function.
  15914. * @example
  15915. *
  15916. * var objects = [
  15917. * { 'a': 1, 'b': 2, 'c': 3 },
  15918. * { 'a': 4, 'b': 5, 'c': 6 }
  15919. * ];
  15920. *
  15921. * _.find(objects, _.matchesProperty('a', 4));
  15922. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15923. *
  15924. * // Checking for several possible values
  15925. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15926. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15927. */
  15928. function matchesProperty(path, srcValue) {
  15929. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15930. }
  15931. /**
  15932. * Creates a function that invokes the method at `path` of a given object.
  15933. * Any additional arguments are provided to the invoked method.
  15934. *
  15935. * @static
  15936. * @memberOf _
  15937. * @since 3.7.0
  15938. * @category Util
  15939. * @param {Array|string} path The path of the method to invoke.
  15940. * @param {...*} [args] The arguments to invoke the method with.
  15941. * @returns {Function} Returns the new invoker function.
  15942. * @example
  15943. *
  15944. * var objects = [
  15945. * { 'a': { 'b': _.constant(2) } },
  15946. * { 'a': { 'b': _.constant(1) } }
  15947. * ];
  15948. *
  15949. * _.map(objects, _.method('a.b'));
  15950. * // => [2, 1]
  15951. *
  15952. * _.map(objects, _.method(['a', 'b']));
  15953. * // => [2, 1]
  15954. */
  15955. var method = baseRest(function(path, args) {
  15956. return function(object) {
  15957. return baseInvoke(object, path, args);
  15958. };
  15959. });
  15960. /**
  15961. * The opposite of `_.method`; this method creates a function that invokes
  15962. * the method at a given path of `object`. Any additional arguments are
  15963. * provided to the invoked method.
  15964. *
  15965. * @static
  15966. * @memberOf _
  15967. * @since 3.7.0
  15968. * @category Util
  15969. * @param {Object} object The object to query.
  15970. * @param {...*} [args] The arguments to invoke the method with.
  15971. * @returns {Function} Returns the new invoker function.
  15972. * @example
  15973. *
  15974. * var array = _.times(3, _.constant),
  15975. * object = { 'a': array, 'b': array, 'c': array };
  15976. *
  15977. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15978. * // => [2, 0]
  15979. *
  15980. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15981. * // => [2, 0]
  15982. */
  15983. var methodOf = baseRest(function(object, args) {
  15984. return function(path) {
  15985. return baseInvoke(object, path, args);
  15986. };
  15987. });
  15988. /**
  15989. * Adds all own enumerable string keyed function properties of a source
  15990. * object to the destination object. If `object` is a function, then methods
  15991. * are added to its prototype as well.
  15992. *
  15993. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15994. * avoid conflicts caused by modifying the original.
  15995. *
  15996. * @static
  15997. * @since 0.1.0
  15998. * @memberOf _
  15999. * @category Util
  16000. * @param {Function|Object} [object=lodash] The destination object.
  16001. * @param {Object} source The object of functions to add.
  16002. * @param {Object} [options={}] The options object.
  16003. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16004. * @returns {Function|Object} Returns `object`.
  16005. * @example
  16006. *
  16007. * function vowels(string) {
  16008. * return _.filter(string, function(v) {
  16009. * return /[aeiou]/i.test(v);
  16010. * });
  16011. * }
  16012. *
  16013. * _.mixin({ 'vowels': vowels });
  16014. * _.vowels('fred');
  16015. * // => ['e']
  16016. *
  16017. * _('fred').vowels().value();
  16018. * // => ['e']
  16019. *
  16020. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16021. * _('fred').vowels();
  16022. * // => ['e']
  16023. */
  16024. function mixin(object, source, options) {
  16025. var props = keys(source),
  16026. methodNames = baseFunctions(source, props);
  16027. if (options == null &&
  16028. !(isObject(source) && (methodNames.length || !props.length))) {
  16029. options = source;
  16030. source = object;
  16031. object = this;
  16032. methodNames = baseFunctions(source, keys(source));
  16033. }
  16034. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16035. isFunc = isFunction(object);
  16036. arrayEach(methodNames, function(methodName) {
  16037. var func = source[methodName];
  16038. object[methodName] = func;
  16039. if (isFunc) {
  16040. object.prototype[methodName] = function() {
  16041. var chainAll = this.__chain__;
  16042. if (chain || chainAll) {
  16043. var result = object(this.__wrapped__),
  16044. actions = result.__actions__ = copyArray(this.__actions__);
  16045. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16046. result.__chain__ = chainAll;
  16047. return result;
  16048. }
  16049. return func.apply(object, arrayPush([this.value()], arguments));
  16050. };
  16051. }
  16052. });
  16053. return object;
  16054. }
  16055. /**
  16056. * Reverts the `_` variable to its previous value and returns a reference to
  16057. * the `lodash` function.
  16058. *
  16059. * @static
  16060. * @since 0.1.0
  16061. * @memberOf _
  16062. * @category Util
  16063. * @returns {Function} Returns the `lodash` function.
  16064. * @example
  16065. *
  16066. * var lodash = _.noConflict();
  16067. */
  16068. function noConflict() {
  16069. if (root._ === this) {
  16070. root._ = oldDash;
  16071. }
  16072. return this;
  16073. }
  16074. /**
  16075. * This method returns `undefined`.
  16076. *
  16077. * @static
  16078. * @memberOf _
  16079. * @since 2.3.0
  16080. * @category Util
  16081. * @example
  16082. *
  16083. * _.times(2, _.noop);
  16084. * // => [undefined, undefined]
  16085. */
  16086. function noop() {
  16087. // No operation performed.
  16088. }
  16089. /**
  16090. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16091. * the nth argument from the end is returned.
  16092. *
  16093. * @static
  16094. * @memberOf _
  16095. * @since 4.0.0
  16096. * @category Util
  16097. * @param {number} [n=0] The index of the argument to return.
  16098. * @returns {Function} Returns the new pass-thru function.
  16099. * @example
  16100. *
  16101. * var func = _.nthArg(1);
  16102. * func('a', 'b', 'c', 'd');
  16103. * // => 'b'
  16104. *
  16105. * var func = _.nthArg(-2);
  16106. * func('a', 'b', 'c', 'd');
  16107. * // => 'c'
  16108. */
  16109. function nthArg(n) {
  16110. n = toInteger(n);
  16111. return baseRest(function(args) {
  16112. return baseNth(args, n);
  16113. });
  16114. }
  16115. /**
  16116. * Creates a function that invokes `iteratees` with the arguments it receives
  16117. * and returns their results.
  16118. *
  16119. * @static
  16120. * @memberOf _
  16121. * @since 4.0.0
  16122. * @category Util
  16123. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16124. * The iteratees to invoke.
  16125. * @returns {Function} Returns the new function.
  16126. * @example
  16127. *
  16128. * var func = _.over([Math.max, Math.min]);
  16129. *
  16130. * func(1, 2, 3, 4);
  16131. * // => [4, 1]
  16132. */
  16133. var over = createOver(arrayMap);
  16134. /**
  16135. * Creates a function that checks if **all** of the `predicates` return
  16136. * truthy when invoked with the arguments it receives.
  16137. *
  16138. * Following shorthands are possible for providing predicates.
  16139. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16140. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16141. *
  16142. * @static
  16143. * @memberOf _
  16144. * @since 4.0.0
  16145. * @category Util
  16146. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16147. * The predicates to check.
  16148. * @returns {Function} Returns the new function.
  16149. * @example
  16150. *
  16151. * var func = _.overEvery([Boolean, isFinite]);
  16152. *
  16153. * func('1');
  16154. * // => true
  16155. *
  16156. * func(null);
  16157. * // => false
  16158. *
  16159. * func(NaN);
  16160. * // => false
  16161. */
  16162. var overEvery = createOver(arrayEvery);
  16163. /**
  16164. * Creates a function that checks if **any** of the `predicates` return
  16165. * truthy when invoked with the arguments it receives.
  16166. *
  16167. * Following shorthands are possible for providing predicates.
  16168. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16169. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16170. *
  16171. * @static
  16172. * @memberOf _
  16173. * @since 4.0.0
  16174. * @category Util
  16175. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16176. * The predicates to check.
  16177. * @returns {Function} Returns the new function.
  16178. * @example
  16179. *
  16180. * var func = _.overSome([Boolean, isFinite]);
  16181. *
  16182. * func('1');
  16183. * // => true
  16184. *
  16185. * func(null);
  16186. * // => true
  16187. *
  16188. * func(NaN);
  16189. * // => false
  16190. *
  16191. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16192. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16193. */
  16194. var overSome = createOver(arraySome);
  16195. /**
  16196. * Creates a function that returns the value at `path` of a given object.
  16197. *
  16198. * @static
  16199. * @memberOf _
  16200. * @since 2.4.0
  16201. * @category Util
  16202. * @param {Array|string} path The path of the property to get.
  16203. * @returns {Function} Returns the new accessor function.
  16204. * @example
  16205. *
  16206. * var objects = [
  16207. * { 'a': { 'b': 2 } },
  16208. * { 'a': { 'b': 1 } }
  16209. * ];
  16210. *
  16211. * _.map(objects, _.property('a.b'));
  16212. * // => [2, 1]
  16213. *
  16214. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16215. * // => [1, 2]
  16216. */
  16217. function property(path) {
  16218. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16219. }
  16220. /**
  16221. * The opposite of `_.property`; this method creates a function that returns
  16222. * the value at a given path of `object`.
  16223. *
  16224. * @static
  16225. * @memberOf _
  16226. * @since 3.0.0
  16227. * @category Util
  16228. * @param {Object} object The object to query.
  16229. * @returns {Function} Returns the new accessor function.
  16230. * @example
  16231. *
  16232. * var array = [0, 1, 2],
  16233. * object = { 'a': array, 'b': array, 'c': array };
  16234. *
  16235. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16236. * // => [2, 0]
  16237. *
  16238. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16239. * // => [2, 0]
  16240. */
  16241. function propertyOf(object) {
  16242. return function(path) {
  16243. return object == null ? undefined : baseGet(object, path);
  16244. };
  16245. }
  16246. /**
  16247. * Creates an array of numbers (positive and/or negative) progressing from
  16248. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16249. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16250. * it's set to `start` with `start` then set to `0`.
  16251. *
  16252. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16253. * floating-point values which can produce unexpected results.
  16254. *
  16255. * @static
  16256. * @since 0.1.0
  16257. * @memberOf _
  16258. * @category Util
  16259. * @param {number} [start=0] The start of the range.
  16260. * @param {number} end The end of the range.
  16261. * @param {number} [step=1] The value to increment or decrement by.
  16262. * @returns {Array} Returns the range of numbers.
  16263. * @see _.inRange, _.rangeRight
  16264. * @example
  16265. *
  16266. * _.range(4);
  16267. * // => [0, 1, 2, 3]
  16268. *
  16269. * _.range(-4);
  16270. * // => [0, -1, -2, -3]
  16271. *
  16272. * _.range(1, 5);
  16273. * // => [1, 2, 3, 4]
  16274. *
  16275. * _.range(0, 20, 5);
  16276. * // => [0, 5, 10, 15]
  16277. *
  16278. * _.range(0, -4, -1);
  16279. * // => [0, -1, -2, -3]
  16280. *
  16281. * _.range(1, 4, 0);
  16282. * // => [1, 1, 1]
  16283. *
  16284. * _.range(0);
  16285. * // => []
  16286. */
  16287. var range = createRange();
  16288. /**
  16289. * This method is like `_.range` except that it populates values in
  16290. * descending order.
  16291. *
  16292. * @static
  16293. * @memberOf _
  16294. * @since 4.0.0
  16295. * @category Util
  16296. * @param {number} [start=0] The start of the range.
  16297. * @param {number} end The end of the range.
  16298. * @param {number} [step=1] The value to increment or decrement by.
  16299. * @returns {Array} Returns the range of numbers.
  16300. * @see _.inRange, _.range
  16301. * @example
  16302. *
  16303. * _.rangeRight(4);
  16304. * // => [3, 2, 1, 0]
  16305. *
  16306. * _.rangeRight(-4);
  16307. * // => [-3, -2, -1, 0]
  16308. *
  16309. * _.rangeRight(1, 5);
  16310. * // => [4, 3, 2, 1]
  16311. *
  16312. * _.rangeRight(0, 20, 5);
  16313. * // => [15, 10, 5, 0]
  16314. *
  16315. * _.rangeRight(0, -4, -1);
  16316. * // => [-3, -2, -1, 0]
  16317. *
  16318. * _.rangeRight(1, 4, 0);
  16319. * // => [1, 1, 1]
  16320. *
  16321. * _.rangeRight(0);
  16322. * // => []
  16323. */
  16324. var rangeRight = createRange(true);
  16325. /**
  16326. * This method returns a new empty array.
  16327. *
  16328. * @static
  16329. * @memberOf _
  16330. * @since 4.13.0
  16331. * @category Util
  16332. * @returns {Array} Returns the new empty array.
  16333. * @example
  16334. *
  16335. * var arrays = _.times(2, _.stubArray);
  16336. *
  16337. * console.log(arrays);
  16338. * // => [[], []]
  16339. *
  16340. * console.log(arrays[0] === arrays[1]);
  16341. * // => false
  16342. */
  16343. function stubArray() {
  16344. return [];
  16345. }
  16346. /**
  16347. * This method returns `false`.
  16348. *
  16349. * @static
  16350. * @memberOf _
  16351. * @since 4.13.0
  16352. * @category Util
  16353. * @returns {boolean} Returns `false`.
  16354. * @example
  16355. *
  16356. * _.times(2, _.stubFalse);
  16357. * // => [false, false]
  16358. */
  16359. function stubFalse() {
  16360. return false;
  16361. }
  16362. /**
  16363. * This method returns a new empty object.
  16364. *
  16365. * @static
  16366. * @memberOf _
  16367. * @since 4.13.0
  16368. * @category Util
  16369. * @returns {Object} Returns the new empty object.
  16370. * @example
  16371. *
  16372. * var objects = _.times(2, _.stubObject);
  16373. *
  16374. * console.log(objects);
  16375. * // => [{}, {}]
  16376. *
  16377. * console.log(objects[0] === objects[1]);
  16378. * // => false
  16379. */
  16380. function stubObject() {
  16381. return {};
  16382. }
  16383. /**
  16384. * This method returns an empty string.
  16385. *
  16386. * @static
  16387. * @memberOf _
  16388. * @since 4.13.0
  16389. * @category Util
  16390. * @returns {string} Returns the empty string.
  16391. * @example
  16392. *
  16393. * _.times(2, _.stubString);
  16394. * // => ['', '']
  16395. */
  16396. function stubString() {
  16397. return '';
  16398. }
  16399. /**
  16400. * This method returns `true`.
  16401. *
  16402. * @static
  16403. * @memberOf _
  16404. * @since 4.13.0
  16405. * @category Util
  16406. * @returns {boolean} Returns `true`.
  16407. * @example
  16408. *
  16409. * _.times(2, _.stubTrue);
  16410. * // => [true, true]
  16411. */
  16412. function stubTrue() {
  16413. return true;
  16414. }
  16415. /**
  16416. * Invokes the iteratee `n` times, returning an array of the results of
  16417. * each invocation. The iteratee is invoked with one argument; (index).
  16418. *
  16419. * @static
  16420. * @since 0.1.0
  16421. * @memberOf _
  16422. * @category Util
  16423. * @param {number} n The number of times to invoke `iteratee`.
  16424. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16425. * @returns {Array} Returns the array of results.
  16426. * @example
  16427. *
  16428. * _.times(3, String);
  16429. * // => ['0', '1', '2']
  16430. *
  16431. * _.times(4, _.constant(0));
  16432. * // => [0, 0, 0, 0]
  16433. */
  16434. function times(n, iteratee) {
  16435. n = toInteger(n);
  16436. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16437. return [];
  16438. }
  16439. var index = MAX_ARRAY_LENGTH,
  16440. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16441. iteratee = getIteratee(iteratee);
  16442. n -= MAX_ARRAY_LENGTH;
  16443. var result = baseTimes(length, iteratee);
  16444. while (++index < n) {
  16445. iteratee(index);
  16446. }
  16447. return result;
  16448. }
  16449. /**
  16450. * Converts `value` to a property path array.
  16451. *
  16452. * @static
  16453. * @memberOf _
  16454. * @since 4.0.0
  16455. * @category Util
  16456. * @param {*} value The value to convert.
  16457. * @returns {Array} Returns the new property path array.
  16458. * @example
  16459. *
  16460. * _.toPath('a.b.c');
  16461. * // => ['a', 'b', 'c']
  16462. *
  16463. * _.toPath('a[0].b.c');
  16464. * // => ['a', '0', 'b', 'c']
  16465. */
  16466. function toPath(value) {
  16467. if (isArray(value)) {
  16468. return arrayMap(value, toKey);
  16469. }
  16470. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16471. }
  16472. /**
  16473. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16474. *
  16475. * @static
  16476. * @since 0.1.0
  16477. * @memberOf _
  16478. * @category Util
  16479. * @param {string} [prefix=''] The value to prefix the ID with.
  16480. * @returns {string} Returns the unique ID.
  16481. * @example
  16482. *
  16483. * _.uniqueId('contact_');
  16484. * // => 'contact_104'
  16485. *
  16486. * _.uniqueId();
  16487. * // => '105'
  16488. */
  16489. function uniqueId(prefix) {
  16490. var id = ++idCounter;
  16491. return toString(prefix) + id;
  16492. }
  16493. /*------------------------------------------------------------------------*/
  16494. /**
  16495. * Adds two numbers.
  16496. *
  16497. * @static
  16498. * @memberOf _
  16499. * @since 3.4.0
  16500. * @category Math
  16501. * @param {number} augend The first number in an addition.
  16502. * @param {number} addend The second number in an addition.
  16503. * @returns {number} Returns the total.
  16504. * @example
  16505. *
  16506. * _.add(6, 4);
  16507. * // => 10
  16508. */
  16509. var add = createMathOperation(function(augend, addend) {
  16510. return augend + addend;
  16511. }, 0);
  16512. /**
  16513. * Computes `number` rounded up to `precision`.
  16514. *
  16515. * @static
  16516. * @memberOf _
  16517. * @since 3.10.0
  16518. * @category Math
  16519. * @param {number} number The number to round up.
  16520. * @param {number} [precision=0] The precision to round up to.
  16521. * @returns {number} Returns the rounded up number.
  16522. * @example
  16523. *
  16524. * _.ceil(4.006);
  16525. * // => 5
  16526. *
  16527. * _.ceil(6.004, 2);
  16528. * // => 6.01
  16529. *
  16530. * _.ceil(6040, -2);
  16531. * // => 6100
  16532. */
  16533. var ceil = createRound('ceil');
  16534. /**
  16535. * Divide two numbers.
  16536. *
  16537. * @static
  16538. * @memberOf _
  16539. * @since 4.7.0
  16540. * @category Math
  16541. * @param {number} dividend The first number in a division.
  16542. * @param {number} divisor The second number in a division.
  16543. * @returns {number} Returns the quotient.
  16544. * @example
  16545. *
  16546. * _.divide(6, 4);
  16547. * // => 1.5
  16548. */
  16549. var divide = createMathOperation(function(dividend, divisor) {
  16550. return dividend / divisor;
  16551. }, 1);
  16552. /**
  16553. * Computes `number` rounded down to `precision`.
  16554. *
  16555. * @static
  16556. * @memberOf _
  16557. * @since 3.10.0
  16558. * @category Math
  16559. * @param {number} number The number to round down.
  16560. * @param {number} [precision=0] The precision to round down to.
  16561. * @returns {number} Returns the rounded down number.
  16562. * @example
  16563. *
  16564. * _.floor(4.006);
  16565. * // => 4
  16566. *
  16567. * _.floor(0.046, 2);
  16568. * // => 0.04
  16569. *
  16570. * _.floor(4060, -2);
  16571. * // => 4000
  16572. */
  16573. var floor = createRound('floor');
  16574. /**
  16575. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16576. * `undefined` is returned.
  16577. *
  16578. * @static
  16579. * @since 0.1.0
  16580. * @memberOf _
  16581. * @category Math
  16582. * @param {Array} array The array to iterate over.
  16583. * @returns {*} Returns the maximum value.
  16584. * @example
  16585. *
  16586. * _.max([4, 2, 8, 6]);
  16587. * // => 8
  16588. *
  16589. * _.max([]);
  16590. * // => undefined
  16591. */
  16592. function max(array) {
  16593. return (array && array.length)
  16594. ? baseExtremum(array, identity, baseGt)
  16595. : undefined;
  16596. }
  16597. /**
  16598. * This method is like `_.max` except that it accepts `iteratee` which is
  16599. * invoked for each element in `array` to generate the criterion by which
  16600. * the value is ranked. The iteratee is invoked with one argument: (value).
  16601. *
  16602. * @static
  16603. * @memberOf _
  16604. * @since 4.0.0
  16605. * @category Math
  16606. * @param {Array} array The array to iterate over.
  16607. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16608. * @returns {*} Returns the maximum value.
  16609. * @example
  16610. *
  16611. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16612. *
  16613. * _.maxBy(objects, function(o) { return o.n; });
  16614. * // => { 'n': 2 }
  16615. *
  16616. * // The `_.property` iteratee shorthand.
  16617. * _.maxBy(objects, 'n');
  16618. * // => { 'n': 2 }
  16619. */
  16620. function maxBy(array, iteratee) {
  16621. return (array && array.length)
  16622. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16623. : undefined;
  16624. }
  16625. /**
  16626. * Computes the mean of the values in `array`.
  16627. *
  16628. * @static
  16629. * @memberOf _
  16630. * @since 4.0.0
  16631. * @category Math
  16632. * @param {Array} array The array to iterate over.
  16633. * @returns {number} Returns the mean.
  16634. * @example
  16635. *
  16636. * _.mean([4, 2, 8, 6]);
  16637. * // => 5
  16638. */
  16639. function mean(array) {
  16640. return baseMean(array, identity);
  16641. }
  16642. /**
  16643. * This method is like `_.mean` except that it accepts `iteratee` which is
  16644. * invoked for each element in `array` to generate the value to be averaged.
  16645. * The iteratee is invoked with one argument: (value).
  16646. *
  16647. * @static
  16648. * @memberOf _
  16649. * @since 4.7.0
  16650. * @category Math
  16651. * @param {Array} array The array to iterate over.
  16652. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16653. * @returns {number} Returns the mean.
  16654. * @example
  16655. *
  16656. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16657. *
  16658. * _.meanBy(objects, function(o) { return o.n; });
  16659. * // => 5
  16660. *
  16661. * // The `_.property` iteratee shorthand.
  16662. * _.meanBy(objects, 'n');
  16663. * // => 5
  16664. */
  16665. function meanBy(array, iteratee) {
  16666. return baseMean(array, getIteratee(iteratee, 2));
  16667. }
  16668. /**
  16669. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16670. * `undefined` is returned.
  16671. *
  16672. * @static
  16673. * @since 0.1.0
  16674. * @memberOf _
  16675. * @category Math
  16676. * @param {Array} array The array to iterate over.
  16677. * @returns {*} Returns the minimum value.
  16678. * @example
  16679. *
  16680. * _.min([4, 2, 8, 6]);
  16681. * // => 2
  16682. *
  16683. * _.min([]);
  16684. * // => undefined
  16685. */
  16686. function min(array) {
  16687. return (array && array.length)
  16688. ? baseExtremum(array, identity, baseLt)
  16689. : undefined;
  16690. }
  16691. /**
  16692. * This method is like `_.min` except that it accepts `iteratee` which is
  16693. * invoked for each element in `array` to generate the criterion by which
  16694. * the value is ranked. The iteratee is invoked with one argument: (value).
  16695. *
  16696. * @static
  16697. * @memberOf _
  16698. * @since 4.0.0
  16699. * @category Math
  16700. * @param {Array} array The array to iterate over.
  16701. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16702. * @returns {*} Returns the minimum value.
  16703. * @example
  16704. *
  16705. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16706. *
  16707. * _.minBy(objects, function(o) { return o.n; });
  16708. * // => { 'n': 1 }
  16709. *
  16710. * // The `_.property` iteratee shorthand.
  16711. * _.minBy(objects, 'n');
  16712. * // => { 'n': 1 }
  16713. */
  16714. function minBy(array, iteratee) {
  16715. return (array && array.length)
  16716. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16717. : undefined;
  16718. }
  16719. /**
  16720. * Multiply two numbers.
  16721. *
  16722. * @static
  16723. * @memberOf _
  16724. * @since 4.7.0
  16725. * @category Math
  16726. * @param {number} multiplier The first number in a multiplication.
  16727. * @param {number} multiplicand The second number in a multiplication.
  16728. * @returns {number} Returns the product.
  16729. * @example
  16730. *
  16731. * _.multiply(6, 4);
  16732. * // => 24
  16733. */
  16734. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16735. return multiplier * multiplicand;
  16736. }, 1);
  16737. /**
  16738. * Computes `number` rounded to `precision`.
  16739. *
  16740. * @static
  16741. * @memberOf _
  16742. * @since 3.10.0
  16743. * @category Math
  16744. * @param {number} number The number to round.
  16745. * @param {number} [precision=0] The precision to round to.
  16746. * @returns {number} Returns the rounded number.
  16747. * @example
  16748. *
  16749. * _.round(4.006);
  16750. * // => 4
  16751. *
  16752. * _.round(4.006, 2);
  16753. * // => 4.01
  16754. *
  16755. * _.round(4060, -2);
  16756. * // => 4100
  16757. */
  16758. var round = createRound('round');
  16759. /**
  16760. * Subtract two numbers.
  16761. *
  16762. * @static
  16763. * @memberOf _
  16764. * @since 4.0.0
  16765. * @category Math
  16766. * @param {number} minuend The first number in a subtraction.
  16767. * @param {number} subtrahend The second number in a subtraction.
  16768. * @returns {number} Returns the difference.
  16769. * @example
  16770. *
  16771. * _.subtract(6, 4);
  16772. * // => 2
  16773. */
  16774. var subtract = createMathOperation(function(minuend, subtrahend) {
  16775. return minuend - subtrahend;
  16776. }, 0);
  16777. /**
  16778. * Computes the sum of the values in `array`.
  16779. *
  16780. * @static
  16781. * @memberOf _
  16782. * @since 3.4.0
  16783. * @category Math
  16784. * @param {Array} array The array to iterate over.
  16785. * @returns {number} Returns the sum.
  16786. * @example
  16787. *
  16788. * _.sum([4, 2, 8, 6]);
  16789. * // => 20
  16790. */
  16791. function sum(array) {
  16792. return (array && array.length)
  16793. ? baseSum(array, identity)
  16794. : 0;
  16795. }
  16796. /**
  16797. * This method is like `_.sum` except that it accepts `iteratee` which is
  16798. * invoked for each element in `array` to generate the value to be summed.
  16799. * The iteratee is invoked with one argument: (value).
  16800. *
  16801. * @static
  16802. * @memberOf _
  16803. * @since 4.0.0
  16804. * @category Math
  16805. * @param {Array} array The array to iterate over.
  16806. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16807. * @returns {number} Returns the sum.
  16808. * @example
  16809. *
  16810. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16811. *
  16812. * _.sumBy(objects, function(o) { return o.n; });
  16813. * // => 20
  16814. *
  16815. * // The `_.property` iteratee shorthand.
  16816. * _.sumBy(objects, 'n');
  16817. * // => 20
  16818. */
  16819. function sumBy(array, iteratee) {
  16820. return (array && array.length)
  16821. ? baseSum(array, getIteratee(iteratee, 2))
  16822. : 0;
  16823. }
  16824. /*------------------------------------------------------------------------*/
  16825. // Add methods that return wrapped values in chain sequences.
  16826. lodash.after = after;
  16827. lodash.ary = ary;
  16828. lodash.assign = assign;
  16829. lodash.assignIn = assignIn;
  16830. lodash.assignInWith = assignInWith;
  16831. lodash.assignWith = assignWith;
  16832. lodash.at = at;
  16833. lodash.before = before;
  16834. lodash.bind = bind;
  16835. lodash.bindAll = bindAll;
  16836. lodash.bindKey = bindKey;
  16837. lodash.castArray = castArray;
  16838. lodash.chain = chain;
  16839. lodash.chunk = chunk;
  16840. lodash.compact = compact;
  16841. lodash.concat = concat;
  16842. lodash.cond = cond;
  16843. lodash.conforms = conforms;
  16844. lodash.constant = constant;
  16845. lodash.countBy = countBy;
  16846. lodash.create = create;
  16847. lodash.curry = curry;
  16848. lodash.curryRight = curryRight;
  16849. lodash.debounce = debounce;
  16850. lodash.defaults = defaults;
  16851. lodash.defaultsDeep = defaultsDeep;
  16852. lodash.defer = defer;
  16853. lodash.delay = delay;
  16854. lodash.difference = difference;
  16855. lodash.differenceBy = differenceBy;
  16856. lodash.differenceWith = differenceWith;
  16857. lodash.drop = drop;
  16858. lodash.dropRight = dropRight;
  16859. lodash.dropRightWhile = dropRightWhile;
  16860. lodash.dropWhile = dropWhile;
  16861. lodash.fill = fill;
  16862. lodash.filter = filter;
  16863. lodash.flatMap = flatMap;
  16864. lodash.flatMapDeep = flatMapDeep;
  16865. lodash.flatMapDepth = flatMapDepth;
  16866. lodash.flatten = flatten;
  16867. lodash.flattenDeep = flattenDeep;
  16868. lodash.flattenDepth = flattenDepth;
  16869. lodash.flip = flip;
  16870. lodash.flow = flow;
  16871. lodash.flowRight = flowRight;
  16872. lodash.fromPairs = fromPairs;
  16873. lodash.functions = functions;
  16874. lodash.functionsIn = functionsIn;
  16875. lodash.groupBy = groupBy;
  16876. lodash.initial = initial;
  16877. lodash.intersection = intersection;
  16878. lodash.intersectionBy = intersectionBy;
  16879. lodash.intersectionWith = intersectionWith;
  16880. lodash.invert = invert;
  16881. lodash.invertBy = invertBy;
  16882. lodash.invokeMap = invokeMap;
  16883. lodash.iteratee = iteratee;
  16884. lodash.keyBy = keyBy;
  16885. lodash.keys = keys;
  16886. lodash.keysIn = keysIn;
  16887. lodash.map = map;
  16888. lodash.mapKeys = mapKeys;
  16889. lodash.mapValues = mapValues;
  16890. lodash.matches = matches;
  16891. lodash.matchesProperty = matchesProperty;
  16892. lodash.memoize = memoize;
  16893. lodash.merge = merge;
  16894. lodash.mergeWith = mergeWith;
  16895. lodash.method = method;
  16896. lodash.methodOf = methodOf;
  16897. lodash.mixin = mixin;
  16898. lodash.negate = negate;
  16899. lodash.nthArg = nthArg;
  16900. lodash.omit = omit;
  16901. lodash.omitBy = omitBy;
  16902. lodash.once = once;
  16903. lodash.orderBy = orderBy;
  16904. lodash.over = over;
  16905. lodash.overArgs = overArgs;
  16906. lodash.overEvery = overEvery;
  16907. lodash.overSome = overSome;
  16908. lodash.partial = partial;
  16909. lodash.partialRight = partialRight;
  16910. lodash.partition = partition;
  16911. lodash.pick = pick;
  16912. lodash.pickBy = pickBy;
  16913. lodash.property = property;
  16914. lodash.propertyOf = propertyOf;
  16915. lodash.pull = pull;
  16916. lodash.pullAll = pullAll;
  16917. lodash.pullAllBy = pullAllBy;
  16918. lodash.pullAllWith = pullAllWith;
  16919. lodash.pullAt = pullAt;
  16920. lodash.range = range;
  16921. lodash.rangeRight = rangeRight;
  16922. lodash.rearg = rearg;
  16923. lodash.reject = reject;
  16924. lodash.remove = remove;
  16925. lodash.rest = rest;
  16926. lodash.reverse = reverse;
  16927. lodash.sampleSize = sampleSize;
  16928. lodash.set = set;
  16929. lodash.setWith = setWith;
  16930. lodash.shuffle = shuffle;
  16931. lodash.slice = slice;
  16932. lodash.sortBy = sortBy;
  16933. lodash.sortedUniq = sortedUniq;
  16934. lodash.sortedUniqBy = sortedUniqBy;
  16935. lodash.split = split;
  16936. lodash.spread = spread;
  16937. lodash.tail = tail;
  16938. lodash.take = take;
  16939. lodash.takeRight = takeRight;
  16940. lodash.takeRightWhile = takeRightWhile;
  16941. lodash.takeWhile = takeWhile;
  16942. lodash.tap = tap;
  16943. lodash.throttle = throttle;
  16944. lodash.thru = thru;
  16945. lodash.toArray = toArray;
  16946. lodash.toPairs = toPairs;
  16947. lodash.toPairsIn = toPairsIn;
  16948. lodash.toPath = toPath;
  16949. lodash.toPlainObject = toPlainObject;
  16950. lodash.transform = transform;
  16951. lodash.unary = unary;
  16952. lodash.union = union;
  16953. lodash.unionBy = unionBy;
  16954. lodash.unionWith = unionWith;
  16955. lodash.uniq = uniq;
  16956. lodash.uniqBy = uniqBy;
  16957. lodash.uniqWith = uniqWith;
  16958. lodash.unset = unset;
  16959. lodash.unzip = unzip;
  16960. lodash.unzipWith = unzipWith;
  16961. lodash.update = update;
  16962. lodash.updateWith = updateWith;
  16963. lodash.values = values;
  16964. lodash.valuesIn = valuesIn;
  16965. lodash.without = without;
  16966. lodash.words = words;
  16967. lodash.wrap = wrap;
  16968. lodash.xor = xor;
  16969. lodash.xorBy = xorBy;
  16970. lodash.xorWith = xorWith;
  16971. lodash.zip = zip;
  16972. lodash.zipObject = zipObject;
  16973. lodash.zipObjectDeep = zipObjectDeep;
  16974. lodash.zipWith = zipWith;
  16975. // Add aliases.
  16976. lodash.entries = toPairs;
  16977. lodash.entriesIn = toPairsIn;
  16978. lodash.extend = assignIn;
  16979. lodash.extendWith = assignInWith;
  16980. // Add methods to `lodash.prototype`.
  16981. mixin(lodash, lodash);
  16982. /*------------------------------------------------------------------------*/
  16983. // Add methods that return unwrapped values in chain sequences.
  16984. lodash.add = add;
  16985. lodash.attempt = attempt;
  16986. lodash.camelCase = camelCase;
  16987. lodash.capitalize = capitalize;
  16988. lodash.ceil = ceil;
  16989. lodash.clamp = clamp;
  16990. lodash.clone = clone;
  16991. lodash.cloneDeep = cloneDeep;
  16992. lodash.cloneDeepWith = cloneDeepWith;
  16993. lodash.cloneWith = cloneWith;
  16994. lodash.conformsTo = conformsTo;
  16995. lodash.deburr = deburr;
  16996. lodash.defaultTo = defaultTo;
  16997. lodash.divide = divide;
  16998. lodash.endsWith = endsWith;
  16999. lodash.eq = eq;
  17000. lodash.escape = escape;
  17001. lodash.escapeRegExp = escapeRegExp;
  17002. lodash.every = every;
  17003. lodash.find = find;
  17004. lodash.findIndex = findIndex;
  17005. lodash.findKey = findKey;
  17006. lodash.findLast = findLast;
  17007. lodash.findLastIndex = findLastIndex;
  17008. lodash.findLastKey = findLastKey;
  17009. lodash.floor = floor;
  17010. lodash.forEach = forEach;
  17011. lodash.forEachRight = forEachRight;
  17012. lodash.forIn = forIn;
  17013. lodash.forInRight = forInRight;
  17014. lodash.forOwn = forOwn;
  17015. lodash.forOwnRight = forOwnRight;
  17016. lodash.get = get;
  17017. lodash.gt = gt;
  17018. lodash.gte = gte;
  17019. lodash.has = has;
  17020. lodash.hasIn = hasIn;
  17021. lodash.head = head;
  17022. lodash.identity = identity;
  17023. lodash.includes = includes;
  17024. lodash.indexOf = indexOf;
  17025. lodash.inRange = inRange;
  17026. lodash.invoke = invoke;
  17027. lodash.isArguments = isArguments;
  17028. lodash.isArray = isArray;
  17029. lodash.isArrayBuffer = isArrayBuffer;
  17030. lodash.isArrayLike = isArrayLike;
  17031. lodash.isArrayLikeObject = isArrayLikeObject;
  17032. lodash.isBoolean = isBoolean;
  17033. lodash.isBuffer = isBuffer;
  17034. lodash.isDate = isDate;
  17035. lodash.isElement = isElement;
  17036. lodash.isEmpty = isEmpty;
  17037. lodash.isEqual = isEqual;
  17038. lodash.isEqualWith = isEqualWith;
  17039. lodash.isError = isError;
  17040. lodash.isFinite = isFinite;
  17041. lodash.isFunction = isFunction;
  17042. lodash.isInteger = isInteger;
  17043. lodash.isLength = isLength;
  17044. lodash.isMap = isMap;
  17045. lodash.isMatch = isMatch;
  17046. lodash.isMatchWith = isMatchWith;
  17047. lodash.isNaN = isNaN;
  17048. lodash.isNative = isNative;
  17049. lodash.isNil = isNil;
  17050. lodash.isNull = isNull;
  17051. lodash.isNumber = isNumber;
  17052. lodash.isObject = isObject;
  17053. lodash.isObjectLike = isObjectLike;
  17054. lodash.isPlainObject = isPlainObject;
  17055. lodash.isRegExp = isRegExp;
  17056. lodash.isSafeInteger = isSafeInteger;
  17057. lodash.isSet = isSet;
  17058. lodash.isString = isString;
  17059. lodash.isSymbol = isSymbol;
  17060. lodash.isTypedArray = isTypedArray;
  17061. lodash.isUndefined = isUndefined;
  17062. lodash.isWeakMap = isWeakMap;
  17063. lodash.isWeakSet = isWeakSet;
  17064. lodash.join = join;
  17065. lodash.kebabCase = kebabCase;
  17066. lodash.last = last;
  17067. lodash.lastIndexOf = lastIndexOf;
  17068. lodash.lowerCase = lowerCase;
  17069. lodash.lowerFirst = lowerFirst;
  17070. lodash.lt = lt;
  17071. lodash.lte = lte;
  17072. lodash.max = max;
  17073. lodash.maxBy = maxBy;
  17074. lodash.mean = mean;
  17075. lodash.meanBy = meanBy;
  17076. lodash.min = min;
  17077. lodash.minBy = minBy;
  17078. lodash.stubArray = stubArray;
  17079. lodash.stubFalse = stubFalse;
  17080. lodash.stubObject = stubObject;
  17081. lodash.stubString = stubString;
  17082. lodash.stubTrue = stubTrue;
  17083. lodash.multiply = multiply;
  17084. lodash.nth = nth;
  17085. lodash.noConflict = noConflict;
  17086. lodash.noop = noop;
  17087. lodash.now = now;
  17088. lodash.pad = pad;
  17089. lodash.padEnd = padEnd;
  17090. lodash.padStart = padStart;
  17091. lodash.parseInt = parseInt;
  17092. lodash.random = random;
  17093. lodash.reduce = reduce;
  17094. lodash.reduceRight = reduceRight;
  17095. lodash.repeat = repeat;
  17096. lodash.replace = replace;
  17097. lodash.result = result;
  17098. lodash.round = round;
  17099. lodash.runInContext = runInContext;
  17100. lodash.sample = sample;
  17101. lodash.size = size;
  17102. lodash.snakeCase = snakeCase;
  17103. lodash.some = some;
  17104. lodash.sortedIndex = sortedIndex;
  17105. lodash.sortedIndexBy = sortedIndexBy;
  17106. lodash.sortedIndexOf = sortedIndexOf;
  17107. lodash.sortedLastIndex = sortedLastIndex;
  17108. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17109. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17110. lodash.startCase = startCase;
  17111. lodash.startsWith = startsWith;
  17112. lodash.subtract = subtract;
  17113. lodash.sum = sum;
  17114. lodash.sumBy = sumBy;
  17115. lodash.template = template;
  17116. lodash.times = times;
  17117. lodash.toFinite = toFinite;
  17118. lodash.toInteger = toInteger;
  17119. lodash.toLength = toLength;
  17120. lodash.toLower = toLower;
  17121. lodash.toNumber = toNumber;
  17122. lodash.toSafeInteger = toSafeInteger;
  17123. lodash.toString = toString;
  17124. lodash.toUpper = toUpper;
  17125. lodash.trim = trim;
  17126. lodash.trimEnd = trimEnd;
  17127. lodash.trimStart = trimStart;
  17128. lodash.truncate = truncate;
  17129. lodash.unescape = unescape;
  17130. lodash.uniqueId = uniqueId;
  17131. lodash.upperCase = upperCase;
  17132. lodash.upperFirst = upperFirst;
  17133. // Add aliases.
  17134. lodash.each = forEach;
  17135. lodash.eachRight = forEachRight;
  17136. lodash.first = head;
  17137. mixin(lodash, (function() {
  17138. var source = {};
  17139. baseForOwn(lodash, function(func, methodName) {
  17140. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17141. source[methodName] = func;
  17142. }
  17143. });
  17144. return source;
  17145. }()), { 'chain': false });
  17146. /*------------------------------------------------------------------------*/
  17147. /**
  17148. * The semantic version number.
  17149. *
  17150. * @static
  17151. * @memberOf _
  17152. * @type {string}
  17153. */
  17154. lodash.VERSION = VERSION;
  17155. // Assign default placeholders.
  17156. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17157. lodash[methodName].placeholder = lodash;
  17158. });
  17159. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17160. arrayEach(['drop', 'take'], function(methodName, index) {
  17161. LazyWrapper.prototype[methodName] = function(n) {
  17162. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17163. var result = (this.__filtered__ && !index)
  17164. ? new LazyWrapper(this)
  17165. : this.clone();
  17166. if (result.__filtered__) {
  17167. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17168. } else {
  17169. result.__views__.push({
  17170. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17171. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17172. });
  17173. }
  17174. return result;
  17175. };
  17176. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17177. return this.reverse()[methodName](n).reverse();
  17178. };
  17179. });
  17180. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17181. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17182. var type = index + 1,
  17183. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17184. LazyWrapper.prototype[methodName] = function(iteratee) {
  17185. var result = this.clone();
  17186. result.__iteratees__.push({
  17187. 'iteratee': getIteratee(iteratee, 3),
  17188. 'type': type
  17189. });
  17190. result.__filtered__ = result.__filtered__ || isFilter;
  17191. return result;
  17192. };
  17193. });
  17194. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17195. arrayEach(['head', 'last'], function(methodName, index) {
  17196. var takeName = 'take' + (index ? 'Right' : '');
  17197. LazyWrapper.prototype[methodName] = function() {
  17198. return this[takeName](1).value()[0];
  17199. };
  17200. });
  17201. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17202. arrayEach(['initial', 'tail'], function(methodName, index) {
  17203. var dropName = 'drop' + (index ? '' : 'Right');
  17204. LazyWrapper.prototype[methodName] = function() {
  17205. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17206. };
  17207. });
  17208. LazyWrapper.prototype.compact = function() {
  17209. return this.filter(identity);
  17210. };
  17211. LazyWrapper.prototype.find = function(predicate) {
  17212. return this.filter(predicate).head();
  17213. };
  17214. LazyWrapper.prototype.findLast = function(predicate) {
  17215. return this.reverse().find(predicate);
  17216. };
  17217. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17218. if (typeof path == 'function') {
  17219. return new LazyWrapper(this);
  17220. }
  17221. return this.map(function(value) {
  17222. return baseInvoke(value, path, args);
  17223. });
  17224. });
  17225. LazyWrapper.prototype.reject = function(predicate) {
  17226. return this.filter(negate(getIteratee(predicate)));
  17227. };
  17228. LazyWrapper.prototype.slice = function(start, end) {
  17229. start = toInteger(start);
  17230. var result = this;
  17231. if (result.__filtered__ && (start > 0 || end < 0)) {
  17232. return new LazyWrapper(result);
  17233. }
  17234. if (start < 0) {
  17235. result = result.takeRight(-start);
  17236. } else if (start) {
  17237. result = result.drop(start);
  17238. }
  17239. if (end !== undefined) {
  17240. end = toInteger(end);
  17241. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17242. }
  17243. return result;
  17244. };
  17245. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17246. return this.reverse().takeWhile(predicate).reverse();
  17247. };
  17248. LazyWrapper.prototype.toArray = function() {
  17249. return this.take(MAX_ARRAY_LENGTH);
  17250. };
  17251. // Add `LazyWrapper` methods to `lodash.prototype`.
  17252. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17253. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17254. isTaker = /^(?:head|last)$/.test(methodName),
  17255. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17256. retUnwrapped = isTaker || /^find/.test(methodName);
  17257. if (!lodashFunc) {
  17258. return;
  17259. }
  17260. lodash.prototype[methodName] = function() {
  17261. var value = this.__wrapped__,
  17262. args = isTaker ? [1] : arguments,
  17263. isLazy = value instanceof LazyWrapper,
  17264. iteratee = args[0],
  17265. useLazy = isLazy || isArray(value);
  17266. var interceptor = function(value) {
  17267. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17268. return (isTaker && chainAll) ? result[0] : result;
  17269. };
  17270. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17271. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17272. isLazy = useLazy = false;
  17273. }
  17274. var chainAll = this.__chain__,
  17275. isHybrid = !!this.__actions__.length,
  17276. isUnwrapped = retUnwrapped && !chainAll,
  17277. onlyLazy = isLazy && !isHybrid;
  17278. if (!retUnwrapped && useLazy) {
  17279. value = onlyLazy ? value : new LazyWrapper(this);
  17280. var result = func.apply(value, args);
  17281. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17282. return new LodashWrapper(result, chainAll);
  17283. }
  17284. if (isUnwrapped && onlyLazy) {
  17285. return func.apply(this, args);
  17286. }
  17287. result = this.thru(interceptor);
  17288. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17289. };
  17290. });
  17291. // Add `Array` methods to `lodash.prototype`.
  17292. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17293. var func = arrayProto[methodName],
  17294. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17295. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17296. lodash.prototype[methodName] = function() {
  17297. var args = arguments;
  17298. if (retUnwrapped && !this.__chain__) {
  17299. var value = this.value();
  17300. return func.apply(isArray(value) ? value : [], args);
  17301. }
  17302. return this[chainName](function(value) {
  17303. return func.apply(isArray(value) ? value : [], args);
  17304. });
  17305. };
  17306. });
  17307. // Map minified method names to their real names.
  17308. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17309. var lodashFunc = lodash[methodName];
  17310. if (lodashFunc) {
  17311. var key = lodashFunc.name + '';
  17312. if (!hasOwnProperty.call(realNames, key)) {
  17313. realNames[key] = [];
  17314. }
  17315. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17316. }
  17317. });
  17318. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17319. 'name': 'wrapper',
  17320. 'func': undefined
  17321. }];
  17322. // Add methods to `LazyWrapper`.
  17323. LazyWrapper.prototype.clone = lazyClone;
  17324. LazyWrapper.prototype.reverse = lazyReverse;
  17325. LazyWrapper.prototype.value = lazyValue;
  17326. // Add chain sequence methods to the `lodash` wrapper.
  17327. lodash.prototype.at = wrapperAt;
  17328. lodash.prototype.chain = wrapperChain;
  17329. lodash.prototype.commit = wrapperCommit;
  17330. lodash.prototype.next = wrapperNext;
  17331. lodash.prototype.plant = wrapperPlant;
  17332. lodash.prototype.reverse = wrapperReverse;
  17333. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17334. // Add lazy aliases.
  17335. lodash.prototype.first = lodash.prototype.head;
  17336. if (symIterator) {
  17337. lodash.prototype[symIterator] = wrapperToIterator;
  17338. }
  17339. return lodash;
  17340. });
  17341. /*--------------------------------------------------------------------------*/
  17342. // Export lodash.
  17343. var _ = runInContext();
  17344. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17345. if (true) {
  17346. // Expose Lodash on the global object to prevent errors when Lodash is
  17347. // loaded by a script tag in the presence of an AMD loader.
  17348. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17349. // Use `_.noConflict` to remove Lodash from the global object.
  17350. root._ = _;
  17351. // Define as an anonymous module so, through path mapping, it can be
  17352. // referenced as the "underscore" module.
  17353. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17354. return _;
  17355. }).call(exports, __webpack_require__, exports, module),
  17356. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17357. }
  17358. // Check for `exports` after `define` in case a build optimizer adds it.
  17359. else {}
  17360. }.call(this));
  17361. /***/ }),
  17362. /***/ "./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":
  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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17367. "use strict";
  17368. __webpack_require__.r(__webpack_exports__);
  17369. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17370. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17371. /* harmony export */ });
  17372. /* 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");
  17373. /* 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__);
  17374. /* 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");
  17375. var options = {};
  17376. options.insert = "head";
  17377. options.singleton = false;
  17378. 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);
  17379. /* 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 || {});
  17380. /***/ }),
  17381. /***/ "./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":
  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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17386. "use strict";
  17387. __webpack_require__.r(__webpack_exports__);
  17388. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17389. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17390. /* harmony export */ });
  17391. /* 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");
  17392. /* 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__);
  17393. /* 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");
  17394. var options = {};
  17395. options.insert = "head";
  17396. options.singleton = false;
  17397. 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);
  17398. /* 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 || {});
  17399. /***/ }),
  17400. /***/ "./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":
  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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17405. "use strict";
  17406. __webpack_require__.r(__webpack_exports__);
  17407. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17408. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17409. /* harmony export */ });
  17410. /* 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");
  17411. /* 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__);
  17412. /* 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");
  17413. var options = {};
  17414. options.insert = "head";
  17415. options.singleton = false;
  17416. 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);
  17417. /* 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 || {});
  17418. /***/ }),
  17419. /***/ "./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":
  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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17424. "use strict";
  17425. __webpack_require__.r(__webpack_exports__);
  17426. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17427. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17428. /* harmony export */ });
  17429. /* 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");
  17430. /* 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__);
  17431. /* 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");
  17432. var options = {};
  17433. options.insert = "head";
  17434. options.singleton = false;
  17435. 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);
  17436. /* 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 || {});
  17437. /***/ }),
  17438. /***/ "./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":
  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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17443. "use strict";
  17444. __webpack_require__.r(__webpack_exports__);
  17445. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17446. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17447. /* harmony export */ });
  17448. /* 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");
  17449. /* 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__);
  17450. /* 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");
  17451. var options = {};
  17452. options.insert = "head";
  17453. options.singleton = false;
  17454. 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);
  17455. /* 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 || {});
  17456. /***/ }),
  17457. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17458. /*!******************************************************!*\
  17459. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17460. \******************************************************/
  17461. /***/ ((__unused_webpack_module, exports) => {
  17462. "use strict";
  17463. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17464. // runtime helper for setting properties on components
  17465. // in a tree-shakable way
  17466. exports["default"] = (sfc, props) => {
  17467. const target = sfc.__vccOpts || sfc;
  17468. for (const [key, val] of props) {
  17469. target[key] = val;
  17470. }
  17471. return target;
  17472. };
  17473. /***/ }),
  17474. /***/ "./resources/js/components/AppButtonLink.vue":
  17475. /*!***************************************************!*\
  17476. !*** ./resources/js/components/AppButtonLink.vue ***!
  17477. \***************************************************/
  17478. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17479. "use strict";
  17480. __webpack_require__.r(__webpack_exports__);
  17481. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17482. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17483. /* harmony export */ });
  17484. /* 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");
  17485. /* 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");
  17486. /* 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");
  17487. ;
  17488. 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"]])
  17489. /* hot reload */
  17490. if (false) {}
  17491. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17492. /***/ }),
  17493. /***/ "./resources/js/components/AppFooter.vue":
  17494. /*!***********************************************!*\
  17495. !*** ./resources/js/components/AppFooter.vue ***!
  17496. \***********************************************/
  17497. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17498. "use strict";
  17499. __webpack_require__.r(__webpack_exports__);
  17500. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17501. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17502. /* harmony export */ });
  17503. /* 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");
  17504. /* 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");
  17505. /* 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");
  17506. const script = {}
  17507. ;
  17508. 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"]])
  17509. /* hot reload */
  17510. if (false) {}
  17511. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17512. /***/ }),
  17513. /***/ "./resources/js/components/AppMessage.vue":
  17514. /*!************************************************!*\
  17515. !*** ./resources/js/components/AppMessage.vue ***!
  17516. \************************************************/
  17517. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17518. "use strict";
  17519. __webpack_require__.r(__webpack_exports__);
  17520. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17521. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17522. /* harmony export */ });
  17523. /* harmony import */ var _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");
  17524. /* 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");
  17525. /* 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");
  17526. ;
  17527. 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"]])
  17528. /* hot reload */
  17529. if (false) {}
  17530. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17531. /***/ }),
  17532. /***/ "./resources/js/components/AppPagination.vue":
  17533. /*!***************************************************!*\
  17534. !*** ./resources/js/components/AppPagination.vue ***!
  17535. \***************************************************/
  17536. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17537. "use strict";
  17538. __webpack_require__.r(__webpack_exports__);
  17539. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17540. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17541. /* harmony export */ });
  17542. /* 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");
  17543. /* 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");
  17544. /* 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");
  17545. ;
  17546. 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"]])
  17547. /* hot reload */
  17548. if (false) {}
  17549. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17550. /***/ }),
  17551. /***/ "./resources/js/components/AppSidebar.vue":
  17552. /*!************************************************!*\
  17553. !*** ./resources/js/components/AppSidebar.vue ***!
  17554. \************************************************/
  17555. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17556. "use strict";
  17557. __webpack_require__.r(__webpack_exports__);
  17558. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17559. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17560. /* harmony export */ });
  17561. /* 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");
  17562. /* 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");
  17563. /* 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");
  17564. /* 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");
  17565. ;
  17566. 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"]])
  17567. /* hot reload */
  17568. if (false) {}
  17569. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17570. /***/ }),
  17571. /***/ "./resources/js/components/AppSubSidebar.vue":
  17572. /*!***************************************************!*\
  17573. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17574. \***************************************************/
  17575. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17576. "use strict";
  17577. __webpack_require__.r(__webpack_exports__);
  17578. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17579. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17580. /* harmony export */ });
  17581. /* 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");
  17582. /* 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");
  17583. /* 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");
  17584. /* 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");
  17585. ;
  17586. 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"]])
  17587. /* hot reload */
  17588. if (false) {}
  17589. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17590. /***/ }),
  17591. /***/ "./resources/js/components/AppTopBar.vue":
  17592. /*!***********************************************!*\
  17593. !*** ./resources/js/components/AppTopBar.vue ***!
  17594. \***********************************************/
  17595. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17596. "use strict";
  17597. __webpack_require__.r(__webpack_exports__);
  17598. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17599. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17600. /* harmony export */ });
  17601. /* 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");
  17602. /* 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");
  17603. /* 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");
  17604. /* 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");
  17605. ;
  17606. 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"]])
  17607. /* hot reload */
  17608. if (false) {}
  17609. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17610. /***/ }),
  17611. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17612. /*!**************************************************!*\
  17613. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17614. \**************************************************/
  17615. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17616. "use strict";
  17617. __webpack_require__.r(__webpack_exports__);
  17618. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17619. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17620. /* harmony export */ });
  17621. /* 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");
  17622. /* 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");
  17623. /* 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");
  17624. /* 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");
  17625. ;
  17626. 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"]])
  17627. /* hot reload */
  17628. if (false) {}
  17629. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17630. /***/ }),
  17631. /***/ "./resources/js/pages/expense/Index.vue":
  17632. /*!**********************************************!*\
  17633. !*** ./resources/js/pages/expense/Index.vue ***!
  17634. \**********************************************/
  17635. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17636. "use strict";
  17637. __webpack_require__.r(__webpack_exports__);
  17638. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17639. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17640. /* harmony export */ });
  17641. /* 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");
  17642. /* 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");
  17643. /* 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");
  17644. ;
  17645. 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"]])
  17646. /* hot reload */
  17647. if (false) {}
  17648. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17649. /***/ }),
  17650. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17651. /*!**************************************************************************************!*\
  17652. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17653. \**************************************************************************************/
  17654. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17655. "use strict";
  17656. __webpack_require__.r(__webpack_exports__);
  17657. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17658. /* 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"])
  17659. /* harmony export */ });
  17660. /* 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");
  17661. /***/ }),
  17662. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17663. /*!***********************************************************************************!*\
  17664. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17665. \***********************************************************************************/
  17666. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17667. "use strict";
  17668. __webpack_require__.r(__webpack_exports__);
  17669. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17670. /* 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"])
  17671. /* harmony export */ });
  17672. /* 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");
  17673. /***/ }),
  17674. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17675. /*!**************************************************************************************!*\
  17676. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17677. \**************************************************************************************/
  17678. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17679. "use strict";
  17680. __webpack_require__.r(__webpack_exports__);
  17681. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17682. /* 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"])
  17683. /* harmony export */ });
  17684. /* 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");
  17685. /***/ }),
  17686. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17687. /*!***********************************************************************************!*\
  17688. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17689. \***********************************************************************************/
  17690. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17691. "use strict";
  17692. __webpack_require__.r(__webpack_exports__);
  17693. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17694. /* 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"])
  17695. /* harmony export */ });
  17696. /* 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");
  17697. /***/ }),
  17698. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17699. /*!**************************************************************************************!*\
  17700. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17701. \**************************************************************************************/
  17702. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17703. "use strict";
  17704. __webpack_require__.r(__webpack_exports__);
  17705. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17706. /* 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"])
  17707. /* harmony export */ });
  17708. /* 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");
  17709. /***/ }),
  17710. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17711. /*!**********************************************************************************!*\
  17712. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17713. \**********************************************************************************/
  17714. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17715. "use strict";
  17716. __webpack_require__.r(__webpack_exports__);
  17717. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17718. /* 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"])
  17719. /* harmony export */ });
  17720. /* 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");
  17721. /***/ }),
  17722. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17723. /*!*************************************************************************************!*\
  17724. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17725. \*************************************************************************************/
  17726. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17727. "use strict";
  17728. __webpack_require__.r(__webpack_exports__);
  17729. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17730. /* 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"])
  17731. /* harmony export */ });
  17732. /* 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");
  17733. /***/ }),
  17734. /***/ "./resources/js/pages/expense/Index.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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17739. "use strict";
  17740. __webpack_require__.r(__webpack_exports__);
  17741. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17742. /* 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"])
  17743. /* harmony export */ });
  17744. /* 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");
  17745. /***/ }),
  17746. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17747. /*!*********************************************************************************!*\
  17748. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17749. \*********************************************************************************/
  17750. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17751. "use strict";
  17752. __webpack_require__.r(__webpack_exports__);
  17753. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17754. /* 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)
  17755. /* harmony export */ });
  17756. /* 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");
  17757. /***/ }),
  17758. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17759. /*!*****************************************************************************************!*\
  17760. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17761. \*****************************************************************************************/
  17762. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17763. "use strict";
  17764. __webpack_require__.r(__webpack_exports__);
  17765. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17766. /* 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)
  17767. /* harmony export */ });
  17768. /* 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");
  17769. /***/ }),
  17770. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17771. /*!******************************************************************************!*\
  17772. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17773. \******************************************************************************/
  17774. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17775. "use strict";
  17776. __webpack_require__.r(__webpack_exports__);
  17777. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17778. /* 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)
  17779. /* harmony export */ });
  17780. /* 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");
  17781. /***/ }),
  17782. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17783. /*!*********************************************************************************!*\
  17784. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17785. \*********************************************************************************/
  17786. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17787. "use strict";
  17788. __webpack_require__.r(__webpack_exports__);
  17789. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17790. /* 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)
  17791. /* harmony export */ });
  17792. /* 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");
  17793. /***/ }),
  17794. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17795. /*!******************************************************************************************!*\
  17796. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17797. \******************************************************************************************/
  17798. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17799. "use strict";
  17800. __webpack_require__.r(__webpack_exports__);
  17801. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17802. /* 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)
  17803. /* harmony export */ });
  17804. /* 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");
  17805. /***/ }),
  17806. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17807. /*!*********************************************************************************************!*\
  17808. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17809. \*********************************************************************************************/
  17810. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17811. "use strict";
  17812. __webpack_require__.r(__webpack_exports__);
  17813. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17814. /* 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)
  17815. /* harmony export */ });
  17816. /* 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");
  17817. /***/ }),
  17818. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17819. /*!*****************************************************************************************!*\
  17820. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17821. \*****************************************************************************************/
  17822. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17823. "use strict";
  17824. __webpack_require__.r(__webpack_exports__);
  17825. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17826. /* 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)
  17827. /* harmony export */ });
  17828. /* 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");
  17829. /***/ }),
  17830. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17831. /*!********************************************************************************************!*\
  17832. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17833. \********************************************************************************************/
  17834. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17835. "use strict";
  17836. __webpack_require__.r(__webpack_exports__);
  17837. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17838. /* 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)
  17839. /* harmony export */ });
  17840. /* 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");
  17841. /***/ }),
  17842. /***/ "./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822":
  17843. /*!****************************************************************************!*\
  17844. !*** ./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822 ***!
  17845. \****************************************************************************/
  17846. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17847. "use strict";
  17848. __webpack_require__.r(__webpack_exports__);
  17849. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17850. /* 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)
  17851. /* harmony export */ });
  17852. /* 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");
  17853. /***/ }),
  17854. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17855. /*!********************************************************************************************************!*\
  17856. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17857. \********************************************************************************************************/
  17858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17859. "use strict";
  17860. __webpack_require__.r(__webpack_exports__);
  17861. /* 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");
  17862. /***/ }),
  17863. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17864. /*!*********************************************************************************************************!*\
  17865. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17866. \*********************************************************************************************************/
  17867. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17868. "use strict";
  17869. __webpack_require__.r(__webpack_exports__);
  17870. /* 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");
  17871. /***/ }),
  17872. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17873. /*!************************************************************************************************************!*\
  17874. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17875. \************************************************************************************************************/
  17876. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17877. "use strict";
  17878. __webpack_require__.r(__webpack_exports__);
  17879. /* 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");
  17880. /***/ }),
  17881. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17882. /*!********************************************************************************************************!*\
  17883. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17884. \********************************************************************************************************/
  17885. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17886. "use strict";
  17887. __webpack_require__.r(__webpack_exports__);
  17888. /* 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");
  17889. /***/ }),
  17890. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17891. /*!***********************************************************************************************************!*\
  17892. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17893. \***********************************************************************************************************/
  17894. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17895. "use strict";
  17896. __webpack_require__.r(__webpack_exports__);
  17897. /* 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");
  17898. /***/ })
  17899. }]);