resources_js_pages_expense_Index_vue.js 702KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377
  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. "class": "grid"
  424. };
  425. var _hoisted_2 = {
  426. "class": "col-12"
  427. };
  428. var _hoisted_3 = {
  429. key: 0
  430. };
  431. var _hoisted_4 = {
  432. key: 1
  433. };
  434. function render(_ctx, _cache, $props, $setup, $data, $options) {
  435. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  436. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  437. key: 0,
  438. severity: "success",
  439. onClose: $setup.onClose
  440. }, {
  441. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  442. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  443. /* TEXT */
  444. )];
  445. }),
  446. _: 1
  447. /* STABLE */
  448. })) : (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, {
  449. key: 1,
  450. severity: "error",
  451. onClose: $setup.onClose
  452. }, {
  453. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  454. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  455. /* TEXT */
  456. )];
  457. }),
  458. _: 1
  459. /* STABLE */
  460. })) : (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, {
  461. key: 2,
  462. severity: "error",
  463. onClose: $setup.onClose
  464. }, {
  465. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  466. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3, "Ditemukan satu error pada form")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4, "Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form", 1
  467. /* TEXT */
  468. ))];
  469. }),
  470. _: 1
  471. /* STABLE */
  472. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])]);
  473. }
  474. /***/ }),
  475. /***/ "./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":
  476. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  477. !*** ./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 ***!
  478. \***********************************************************************************************************************************************************************************************************************************************************************************/
  479. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  480. "use strict";
  481. __webpack_require__.r(__webpack_exports__);
  482. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  483. /* harmony export */ "render": () => (/* binding */ render)
  484. /* harmony export */ });
  485. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  486. var _hoisted_1 = {
  487. key: 0,
  488. "class": "p-paginator p-component flex justify-content-start"
  489. };
  490. var _hoisted_2 = {
  491. "class": "p-paginator-pages"
  492. };
  493. var _hoisted_3 = ["innerHTML"];
  494. function render(_ctx, _cache, $props, $setup, $data, $options) {
  495. 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) {
  496. 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", {
  497. key: "link-".concat(key),
  498. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  499. 'p-disabled': link
  500. }]),
  501. innerHTML: link.label
  502. }, null, 10
  503. /* CLASS, PROPS */
  504. , _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"], {
  505. key: "link-".concat(key),
  506. href: link.url,
  507. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  508. 'p-highlight': link.active
  509. }, "p-paginator-page p-paginator-element p-link"]),
  510. innerHTML: link.label
  511. }, null, 8
  512. /* PROPS */
  513. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  514. /* STABLE_FRAGMENT */
  515. );
  516. }), 256
  517. /* UNKEYED_FRAGMENT */
  518. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  519. }
  520. /***/ }),
  521. /***/ "./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":
  522. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  523. !*** ./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 ***!
  524. \********************************************************************************************************************************************************************************************************************************************************************************************/
  525. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  526. "use strict";
  527. __webpack_require__.r(__webpack_exports__);
  528. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  529. /* harmony export */ "render": () => (/* binding */ render)
  530. /* harmony export */ });
  531. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  532. function render(_ctx, _cache, $props, $setup, $data, $options) {
  533. 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"], {
  534. "class": "layout-menu",
  535. items: $props.menu,
  536. root: true
  537. }, null, 8
  538. /* PROPS */
  539. , ["items"])]);
  540. }
  541. /***/ }),
  542. /***/ "./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":
  543. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  544. !*** ./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 ***!
  545. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  546. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  547. "use strict";
  548. __webpack_require__.r(__webpack_exports__);
  549. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  550. /* harmony export */ "render": () => (/* binding */ render)
  551. /* harmony export */ });
  552. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  553. var _withScopeId = function _withScopeId(n) {
  554. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  555. };
  556. var _hoisted_1 = {
  557. key: 0
  558. };
  559. var _hoisted_2 = ["aria-label"];
  560. var _hoisted_3 = ["aria-label"];
  561. function render(_ctx, _cache, $props, $setup, $data, $options) {
  562. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  563. 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) {
  564. 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", {
  565. key: i,
  566. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  567. 'layout-menuitem-category': $props.root
  568. }]),
  569. role: "none"
  570. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  571. key: 0
  572. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  573. "class": "layout-menuitem-root-text",
  574. "aria-label": item.label
  575. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  576. /* TEXT, PROPS */
  577. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  578. items: item.items
  579. }, null, 8
  580. /* PROPS */
  581. , ["items"])], 64
  582. /* STABLE_FRAGMENT */
  583. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  584. key: 1
  585. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  586. key: 0,
  587. role: "menuitem",
  588. href: item.to,
  589. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  590. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  591. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  592. }]),
  593. "aria-label": item.label
  594. }, {
  595. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  596. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  597. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  598. }, null, 2
  599. /* CLASS */
  600. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  601. /* TEXT */
  602. )];
  603. }),
  604. _: 2
  605. /* DYNAMIC */
  606. }, 1032
  607. /* PROPS, DYNAMIC_SLOTS */
  608. , ["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", {
  609. key: 1,
  610. href: "#",
  611. role: "menuitem",
  612. "aria-label": item.label
  613. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  614. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  615. }, null, 2
  616. /* CLASS */
  617. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  618. /* TEXT */
  619. )], 8
  620. /* PROPS */
  621. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  622. items: item.items
  623. }, null, 8
  624. /* PROPS */
  625. , ["items"])], 64
  626. /* STABLE_FRAGMENT */
  627. ))], 2
  628. /* CLASS */
  629. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  630. /* STABLE_FRAGMENT */
  631. );
  632. }), 256
  633. /* UNKEYED_FRAGMENT */
  634. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  635. }
  636. /***/ }),
  637. /***/ "./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":
  638. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  639. !*** ./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 ***!
  640. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  641. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  642. "use strict";
  643. __webpack_require__.r(__webpack_exports__);
  644. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  645. /* harmony export */ "render": () => (/* binding */ render)
  646. /* harmony export */ });
  647. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  648. var _withScopeId = function _withScopeId(n) {
  649. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  650. };
  651. var _hoisted_1 = {
  652. "class": "layout-topbar"
  653. };
  654. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  655. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  656. alt: "Logo",
  657. src: "/images/logo.svg",
  658. "class": "md:mr-3"
  659. }, null, -1
  660. /* HOISTED */
  661. );
  662. });
  663. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  664. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  665. /* HOISTED */
  666. );
  667. });
  668. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  669. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  670. "class": "pi pi-bars"
  671. }, null, -1
  672. /* HOISTED */
  673. );
  674. });
  675. var _hoisted_5 = [_hoisted_4];
  676. var _hoisted_6 = {
  677. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  678. };
  679. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  680. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  681. "class": "pi pi-ellipsis-v"
  682. }, null, -1
  683. /* HOISTED */
  684. );
  685. });
  686. var _hoisted_8 = [_hoisted_7];
  687. var _hoisted_9 = {
  688. "class": "layout-topbar-menu hidden lg:flex origin-top"
  689. };
  690. var _hoisted_10 = {
  691. "class": "align-self-center"
  692. };
  693. var _hoisted_11 = {
  694. "class": "hidden lg:inline"
  695. };
  696. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  697. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  698. "class": "pi pi-user"
  699. }, null, -1
  700. /* HOISTED */
  701. );
  702. });
  703. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  704. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Profil Saya", -1
  705. /* HOISTED */
  706. );
  707. });
  708. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  709. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  710. "class": "pi pi-sign-out"
  711. }, null, -1
  712. /* HOISTED */
  713. );
  714. });
  715. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  716. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Sign Out", -1
  717. /* HOISTED */
  718. );
  719. });
  720. function render(_ctx, _cache, $props, $setup, $data, $options) {
  721. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  722. 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"], {
  723. href: "/",
  724. "class": "layout-topbar-logo"
  725. }, {
  726. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  727. return [_hoisted_2, _hoisted_3];
  728. }),
  729. _: 1
  730. /* STABLE */
  731. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  732. "class": "p-link layout-menu-button layout-topbar-button",
  733. onClick: _cache[0] || (_cache[0] = function ($event) {
  734. return _ctx.$emit('menu-toggle', $event);
  735. })
  736. }, _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, {
  737. selector: '@next',
  738. enterClass: 'hidden',
  739. enterActiveClass: 'scalein',
  740. leaveToClass: 'hidden',
  741. leaveActiveClass: 'fadeout',
  742. hideOnOutsideClick: true
  743. }]]), (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
  744. /* TEXT */
  745. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  746. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  747. "class": "p-link layout-topbar-button"
  748. }, {
  749. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  750. return [_hoisted_12, _hoisted_13];
  751. }),
  752. _: 1
  753. /* STABLE */
  754. }, 8
  755. /* PROPS */
  756. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  757. href: _ctx.route('logout'),
  758. as: "button",
  759. method: "post",
  760. "class": "p-link layout-topbar-button"
  761. }, {
  762. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  763. return [_hoisted_14, _hoisted_15];
  764. }),
  765. _: 1
  766. /* STABLE */
  767. }, 8
  768. /* PROPS */
  769. , ["href"])])])]);
  770. }
  771. /***/ }),
  772. /***/ "./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":
  773. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  774. !*** ./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 ***!
  775. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  776. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  777. "use strict";
  778. __webpack_require__.r(__webpack_exports__);
  779. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  780. /* harmony export */ "render": () => (/* binding */ render)
  781. /* harmony export */ });
  782. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  783. var _withScopeId = function _withScopeId(n) {
  784. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  785. };
  786. var _hoisted_1 = {
  787. "class": "layout-sidebar"
  788. };
  789. var _hoisted_2 = {
  790. "class": "layout-main-container"
  791. };
  792. var _hoisted_3 = {
  793. "class": "layout-main"
  794. };
  795. var _hoisted_4 = {
  796. key: 0,
  797. "class": "layout-mask p-component-overlay"
  798. };
  799. function render(_ctx, _cache, $props, $setup, $data, $options) {
  800. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  801. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  802. onClick: $setup.onWrapperClick
  803. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  804. onMenuToggle: $setup.onMenuToggle
  805. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  806. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  807. }, null, 8
  808. /* PROPS */
  809. , ["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, {
  810. name: "layout-mask"
  811. }, {
  812. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  813. 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)];
  814. }),
  815. _: 1
  816. /* STABLE */
  817. })], 2
  818. /* CLASS */
  819. );
  820. }
  821. /***/ }),
  822. /***/ "./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":
  823. /*!******************************************************************************************************************************************************************************************************************************************************************************!*\
  824. !*** ./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 ***!
  825. \******************************************************************************************************************************************************************************************************************************************************************************/
  826. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  827. "use strict";
  828. __webpack_require__.r(__webpack_exports__);
  829. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  830. /* harmony export */ "render": () => (/* binding */ render)
  831. /* harmony export */ });
  832. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  833. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Pengeluaran", -1
  834. /* HOISTED */
  835. );
  836. var _hoisted_2 = {
  837. "class": "grid"
  838. };
  839. var _hoisted_3 = {
  840. "class": "col-12 md:col-8"
  841. };
  842. var _hoisted_4 = {
  843. "class": "grid"
  844. };
  845. var _hoisted_5 = {
  846. "class": "col-12 md:col-4"
  847. };
  848. var _hoisted_6 = {
  849. "class": "col-auto mt-2 ml-2"
  850. };
  851. var _hoisted_7 = {
  852. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  853. };
  854. function render(_ctx, _cache, $props, $setup, $data, $options) {
  855. var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
  856. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  857. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  858. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  859. 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"], {
  860. title: "Pengeluaran"
  861. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  862. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  863. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  864. "responsive-layout": "scroll",
  865. "column-resize-mode": "expand",
  866. value: $props.expenses.data,
  867. "row-hover": true,
  868. "striped-rows": true
  869. }, {
  870. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  871. 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, {
  872. "touch-u-i": "",
  873. "class": "w-full",
  874. modelValue: $setup.dates,
  875. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  876. return $setup.dates = $event;
  877. }),
  878. "selection-mode": "range",
  879. placeholder: "filter waktu...",
  880. "date-format": "dd/mm/yy",
  881. "manual-input": false
  882. }, null, 8
  883. /* PROPS */
  884. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  885. label: "reset",
  886. "class": "p-button-link",
  887. onClick: $setup.filterReset
  888. })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  889. label: "Tambah Pengeluaran",
  890. "class": "p-button-outlined",
  891. icon: "pi pi-pencil",
  892. href: _ctx.route('expenses.create')
  893. }, null, 8
  894. /* PROPS */
  895. , ["href"])])])];
  896. }),
  897. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  898. 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) {
  899. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  900. field: value.field,
  901. header: value.header,
  902. key: value.field
  903. }, null, 8
  904. /* PROPS */
  905. , ["field", "header"]);
  906. }), 128
  907. /* KEYED_FRAGMENT */
  908. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  909. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  910. var data = _ref.data;
  911. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  912. icon: "pi pi-eye",
  913. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  914. href: _ctx.route('expenses.show', data.id)
  915. }, null, 8
  916. /* PROPS */
  917. , ["href"])];
  918. }),
  919. _: 1
  920. /* STABLE */
  921. })];
  922. }),
  923. _: 1
  924. /* STABLE */
  925. }, 8
  926. /* PROPS */
  927. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  928. links: $props.expenses.links
  929. }, null, 8
  930. /* PROPS */
  931. , ["links"])];
  932. }),
  933. _: 1
  934. /* STABLE */
  935. })], 64
  936. /* STABLE_FRAGMENT */
  937. );
  938. }
  939. /***/ }),
  940. /***/ "./resources/js/components/useDateRangeFilter.js":
  941. /*!*******************************************************!*\
  942. !*** ./resources/js/components/useDateRangeFilter.js ***!
  943. \*******************************************************/
  944. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  945. "use strict";
  946. __webpack_require__.r(__webpack_exports__);
  947. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  948. /* harmony export */ "useDateRangeFilter": () => (/* binding */ useDateRangeFilter)
  949. /* harmony export */ });
  950. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  951. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
  952. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
  953. function useDateRangeFilter() {
  954. var initialDateRage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  955. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  956. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  957. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  958. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  959. if (initialDateRage[0] || initialDateRage[1]) {
  960. if (initialDateRage[1]) {
  961. dates.push([new Date(initialDateRage[0]), new Date(initialDateRage[1])]);
  962. } else {
  963. dates.push([new Date(props.initialDateRage[1]), null]);
  964. }
  965. }
  966. });
  967. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  968. if (dates.value[1]) {
  969. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  970. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  971. } else if (dates.value[0]) {
  972. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  973. endDate.value = null;
  974. }
  975. });
  976. return {
  977. dates: dates,
  978. startDate: startDate,
  979. endDate: endDate
  980. };
  981. }
  982. /***/ }),
  983. /***/ "./resources/js/pages/expense/tableHeader.js":
  984. /*!***************************************************!*\
  985. !*** ./resources/js/pages/expense/tableHeader.js ***!
  986. \***************************************************/
  987. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  988. "use strict";
  989. __webpack_require__.r(__webpack_exports__);
  990. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  991. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  992. /* harmony export */ });
  993. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  994. field: 'createdAt',
  995. header: 'Tanggal'
  996. }, {
  997. field: 'amount',
  998. header: 'Pengeluaran'
  999. }, {
  1000. field: 'user',
  1001. header: 'User'
  1002. }]);
  1003. /***/ }),
  1004. /***/ "./resources/js/utils/menu.js":
  1005. /*!************************************!*\
  1006. !*** ./resources/js/utils/menu.js ***!
  1007. \************************************/
  1008. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1009. "use strict";
  1010. __webpack_require__.r(__webpack_exports__);
  1011. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1012. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1013. /* harmony export */ });
  1014. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1015. // Admin
  1016. 1: [{
  1017. label: 'Home',
  1018. items: [{
  1019. label: 'Dashboard',
  1020. icon: 'pi pi-home',
  1021. to: '/dashboards',
  1022. component: 'home/Index'
  1023. }]
  1024. }, {
  1025. label: 'Master',
  1026. items: [{
  1027. label: 'User',
  1028. icon: 'pi pi-user',
  1029. to: '/users',
  1030. component: 'user/Index'
  1031. }]
  1032. }],
  1033. // Supervisor
  1034. 2: [{
  1035. label: 'Home',
  1036. items: [{
  1037. label: 'Dashboard',
  1038. icon: 'pi pi-home',
  1039. to: '/dashboards',
  1040. component: 'home/Index'
  1041. }]
  1042. }, {
  1043. label: 'Menu',
  1044. items: [{
  1045. label: 'Pengeluaran',
  1046. icon: 'pi pi-wallet',
  1047. to: '/expenses',
  1048. component: 'expense/Index'
  1049. }, {
  1050. label: 'Laporan',
  1051. icon: 'pi pi-book',
  1052. items: [{
  1053. label: 'Mutasi',
  1054. icon: 'pi pi-circle',
  1055. to: '/reports/mutations',
  1056. component: 'mutation/Report'
  1057. }]
  1058. }]
  1059. }, {
  1060. label: 'Master',
  1061. items: [{
  1062. label: 'Jenis Kendaraan',
  1063. icon: 'pi pi-car',
  1064. to: '/type-vehicles',
  1065. component: 'typevehicle/Index'
  1066. }, {
  1067. label: 'Jenis Member',
  1068. icon: 'pi pi-id-card',
  1069. to: '/type-members',
  1070. component: 'typemember/Index'
  1071. }]
  1072. }, {
  1073. label: 'Pengaturan',
  1074. items: [{
  1075. label: 'Tarif Parkir',
  1076. icon: 'pi pi-car',
  1077. to: '/parking-fees/create',
  1078. component: 'parkingfee/Create'
  1079. }]
  1080. }],
  1081. // Operator
  1082. 3: [{
  1083. label: 'Home',
  1084. items: [{
  1085. label: 'Dashboard',
  1086. icon: 'pi pi-home',
  1087. to: '/dashboards',
  1088. component: 'home/Index'
  1089. }]
  1090. }, {
  1091. label: 'Menu',
  1092. items: [{
  1093. label: 'Pengeluaran',
  1094. icon: 'pi pi-wallet',
  1095. to: '/expenses',
  1096. component: 'expense/Index'
  1097. }, {
  1098. label: 'Member',
  1099. icon: 'pi pi-id-card',
  1100. to: '/members',
  1101. component: 'member/Index'
  1102. }, {
  1103. label: 'Top Up',
  1104. icon: 'pi pi-car',
  1105. to: '/top-ups',
  1106. component: 'topup/Index'
  1107. }]
  1108. }]
  1109. });
  1110. /***/ }),
  1111. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1112. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1113. !*** ./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 ***!
  1114. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1115. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1116. "use strict";
  1117. __webpack_require__.r(__webpack_exports__);
  1118. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1119. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1120. /* harmony export */ });
  1121. /* 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");
  1122. /* 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__);
  1123. // Imports
  1124. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1125. // Module
  1126. ___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}", ""]);
  1127. // Exports
  1128. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1129. /***/ }),
  1130. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1131. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1132. !*** ./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 ***!
  1133. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1134. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1135. "use strict";
  1136. __webpack_require__.r(__webpack_exports__);
  1137. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1138. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1139. /* harmony export */ });
  1140. /* 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");
  1141. /* 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__);
  1142. // Imports
  1143. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1144. // Module
  1145. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1146. // Exports
  1147. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1148. /***/ }),
  1149. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1150. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1151. !*** ./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 ***!
  1152. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1153. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1154. "use strict";
  1155. __webpack_require__.r(__webpack_exports__);
  1156. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1157. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1158. /* harmony export */ });
  1159. /* 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");
  1160. /* 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__);
  1161. // Imports
  1162. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1163. // Module
  1164. ___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}", ""]);
  1165. // Exports
  1166. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1167. /***/ }),
  1168. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1169. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1170. !*** ./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 ***!
  1171. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1172. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1173. "use strict";
  1174. __webpack_require__.r(__webpack_exports__);
  1175. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1176. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1177. /* harmony export */ });
  1178. /* 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");
  1179. /* 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__);
  1180. // Imports
  1181. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1182. // Module
  1183. ___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: 12px;\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}", ""]);
  1184. // Exports
  1185. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1186. /***/ }),
  1187. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1188. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1189. !*** ./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 ***!
  1190. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1191. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1192. "use strict";
  1193. __webpack_require__.r(__webpack_exports__);
  1194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1196. /* harmony export */ });
  1197. /* 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");
  1198. /* 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__);
  1199. // Imports
  1200. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1201. // Module
  1202. ___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}", ""]);
  1203. // Exports
  1204. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1205. /***/ }),
  1206. /***/ "./node_modules/dayjs/dayjs.min.js":
  1207. /*!*****************************************!*\
  1208. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1209. \*****************************************/
  1210. /***/ (function(module) {
  1211. !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}));
  1212. /***/ }),
  1213. /***/ "./node_modules/lodash/lodash.js":
  1214. /*!***************************************!*\
  1215. !*** ./node_modules/lodash/lodash.js ***!
  1216. \***************************************/
  1217. /***/ (function(module, exports, __webpack_require__) {
  1218. /* module decorator */ module = __webpack_require__.nmd(module);
  1219. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1220. * @license
  1221. * Lodash <https://lodash.com/>
  1222. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1223. * Released under MIT license <https://lodash.com/license>
  1224. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1225. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1226. */
  1227. ;(function() {
  1228. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1229. var undefined;
  1230. /** Used as the semantic version number. */
  1231. var VERSION = '4.17.21';
  1232. /** Used as the size to enable large array optimizations. */
  1233. var LARGE_ARRAY_SIZE = 200;
  1234. /** Error message constants. */
  1235. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1236. FUNC_ERROR_TEXT = 'Expected a function',
  1237. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1238. /** Used to stand-in for `undefined` hash values. */
  1239. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1240. /** Used as the maximum memoize cache size. */
  1241. var MAX_MEMOIZE_SIZE = 500;
  1242. /** Used as the internal argument placeholder. */
  1243. var PLACEHOLDER = '__lodash_placeholder__';
  1244. /** Used to compose bitmasks for cloning. */
  1245. var CLONE_DEEP_FLAG = 1,
  1246. CLONE_FLAT_FLAG = 2,
  1247. CLONE_SYMBOLS_FLAG = 4;
  1248. /** Used to compose bitmasks for value comparisons. */
  1249. var COMPARE_PARTIAL_FLAG = 1,
  1250. COMPARE_UNORDERED_FLAG = 2;
  1251. /** Used to compose bitmasks for function metadata. */
  1252. var WRAP_BIND_FLAG = 1,
  1253. WRAP_BIND_KEY_FLAG = 2,
  1254. WRAP_CURRY_BOUND_FLAG = 4,
  1255. WRAP_CURRY_FLAG = 8,
  1256. WRAP_CURRY_RIGHT_FLAG = 16,
  1257. WRAP_PARTIAL_FLAG = 32,
  1258. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1259. WRAP_ARY_FLAG = 128,
  1260. WRAP_REARG_FLAG = 256,
  1261. WRAP_FLIP_FLAG = 512;
  1262. /** Used as default options for `_.truncate`. */
  1263. var DEFAULT_TRUNC_LENGTH = 30,
  1264. DEFAULT_TRUNC_OMISSION = '...';
  1265. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1266. var HOT_COUNT = 800,
  1267. HOT_SPAN = 16;
  1268. /** Used to indicate the type of lazy iteratees. */
  1269. var LAZY_FILTER_FLAG = 1,
  1270. LAZY_MAP_FLAG = 2,
  1271. LAZY_WHILE_FLAG = 3;
  1272. /** Used as references for various `Number` constants. */
  1273. var INFINITY = 1 / 0,
  1274. MAX_SAFE_INTEGER = 9007199254740991,
  1275. MAX_INTEGER = 1.7976931348623157e+308,
  1276. NAN = 0 / 0;
  1277. /** Used as references for the maximum length and index of an array. */
  1278. var MAX_ARRAY_LENGTH = 4294967295,
  1279. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1280. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1281. /** Used to associate wrap methods with their bit flags. */
  1282. var wrapFlags = [
  1283. ['ary', WRAP_ARY_FLAG],
  1284. ['bind', WRAP_BIND_FLAG],
  1285. ['bindKey', WRAP_BIND_KEY_FLAG],
  1286. ['curry', WRAP_CURRY_FLAG],
  1287. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1288. ['flip', WRAP_FLIP_FLAG],
  1289. ['partial', WRAP_PARTIAL_FLAG],
  1290. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1291. ['rearg', WRAP_REARG_FLAG]
  1292. ];
  1293. /** `Object#toString` result references. */
  1294. var argsTag = '[object Arguments]',
  1295. arrayTag = '[object Array]',
  1296. asyncTag = '[object AsyncFunction]',
  1297. boolTag = '[object Boolean]',
  1298. dateTag = '[object Date]',
  1299. domExcTag = '[object DOMException]',
  1300. errorTag = '[object Error]',
  1301. funcTag = '[object Function]',
  1302. genTag = '[object GeneratorFunction]',
  1303. mapTag = '[object Map]',
  1304. numberTag = '[object Number]',
  1305. nullTag = '[object Null]',
  1306. objectTag = '[object Object]',
  1307. promiseTag = '[object Promise]',
  1308. proxyTag = '[object Proxy]',
  1309. regexpTag = '[object RegExp]',
  1310. setTag = '[object Set]',
  1311. stringTag = '[object String]',
  1312. symbolTag = '[object Symbol]',
  1313. undefinedTag = '[object Undefined]',
  1314. weakMapTag = '[object WeakMap]',
  1315. weakSetTag = '[object WeakSet]';
  1316. var arrayBufferTag = '[object ArrayBuffer]',
  1317. dataViewTag = '[object DataView]',
  1318. float32Tag = '[object Float32Array]',
  1319. float64Tag = '[object Float64Array]',
  1320. int8Tag = '[object Int8Array]',
  1321. int16Tag = '[object Int16Array]',
  1322. int32Tag = '[object Int32Array]',
  1323. uint8Tag = '[object Uint8Array]',
  1324. uint8ClampedTag = '[object Uint8ClampedArray]',
  1325. uint16Tag = '[object Uint16Array]',
  1326. uint32Tag = '[object Uint32Array]';
  1327. /** Used to match empty string literals in compiled template source. */
  1328. var reEmptyStringLeading = /\b__p \+= '';/g,
  1329. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1330. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1331. /** Used to match HTML entities and HTML characters. */
  1332. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1333. reUnescapedHtml = /[&<>"']/g,
  1334. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1335. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1336. /** Used to match template delimiters. */
  1337. var reEscape = /<%-([\s\S]+?)%>/g,
  1338. reEvaluate = /<%([\s\S]+?)%>/g,
  1339. reInterpolate = /<%=([\s\S]+?)%>/g;
  1340. /** Used to match property names within property paths. */
  1341. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1342. reIsPlainProp = /^\w*$/,
  1343. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1344. /**
  1345. * Used to match `RegExp`
  1346. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1347. */
  1348. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1349. reHasRegExpChar = RegExp(reRegExpChar.source);
  1350. /** Used to match leading whitespace. */
  1351. var reTrimStart = /^\s+/;
  1352. /** Used to match a single whitespace character. */
  1353. var reWhitespace = /\s/;
  1354. /** Used to match wrap detail comments. */
  1355. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1356. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1357. reSplitDetails = /,? & /;
  1358. /** Used to match words composed of alphanumeric characters. */
  1359. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1360. /**
  1361. * Used to validate the `validate` option in `_.template` variable.
  1362. *
  1363. * Forbids characters which could potentially change the meaning of the function argument definition:
  1364. * - "()," (modification of function parameters)
  1365. * - "=" (default value)
  1366. * - "[]{}" (destructuring of function parameters)
  1367. * - "/" (beginning of a comment)
  1368. * - whitespace
  1369. */
  1370. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1371. /** Used to match backslashes in property paths. */
  1372. var reEscapeChar = /\\(\\)?/g;
  1373. /**
  1374. * Used to match
  1375. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1376. */
  1377. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1378. /** Used to match `RegExp` flags from their coerced string values. */
  1379. var reFlags = /\w*$/;
  1380. /** Used to detect bad signed hexadecimal string values. */
  1381. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1382. /** Used to detect binary string values. */
  1383. var reIsBinary = /^0b[01]+$/i;
  1384. /** Used to detect host constructors (Safari). */
  1385. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1386. /** Used to detect octal string values. */
  1387. var reIsOctal = /^0o[0-7]+$/i;
  1388. /** Used to detect unsigned integer values. */
  1389. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1390. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1391. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1392. /** Used to ensure capturing order of template delimiters. */
  1393. var reNoMatch = /($^)/;
  1394. /** Used to match unescaped characters in compiled string literals. */
  1395. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1396. /** Used to compose unicode character classes. */
  1397. var rsAstralRange = '\\ud800-\\udfff',
  1398. rsComboMarksRange = '\\u0300-\\u036f',
  1399. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1400. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1401. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1402. rsDingbatRange = '\\u2700-\\u27bf',
  1403. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1404. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1405. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1406. rsPunctuationRange = '\\u2000-\\u206f',
  1407. 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',
  1408. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1409. rsVarRange = '\\ufe0e\\ufe0f',
  1410. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1411. /** Used to compose unicode capture groups. */
  1412. var rsApos = "['\u2019]",
  1413. rsAstral = '[' + rsAstralRange + ']',
  1414. rsBreak = '[' + rsBreakRange + ']',
  1415. rsCombo = '[' + rsComboRange + ']',
  1416. rsDigits = '\\d+',
  1417. rsDingbat = '[' + rsDingbatRange + ']',
  1418. rsLower = '[' + rsLowerRange + ']',
  1419. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1420. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1421. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1422. rsNonAstral = '[^' + rsAstralRange + ']',
  1423. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1424. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1425. rsUpper = '[' + rsUpperRange + ']',
  1426. rsZWJ = '\\u200d';
  1427. /** Used to compose unicode regexes. */
  1428. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1429. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1430. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1431. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1432. reOptMod = rsModifier + '?',
  1433. rsOptVar = '[' + rsVarRange + ']?',
  1434. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1435. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1436. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1437. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1438. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1439. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1440. /** Used to match apostrophes. */
  1441. var reApos = RegExp(rsApos, 'g');
  1442. /**
  1443. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1444. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1445. */
  1446. var reComboMark = RegExp(rsCombo, 'g');
  1447. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1448. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1449. /** Used to match complex or compound words. */
  1450. var reUnicodeWord = RegExp([
  1451. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1452. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1453. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1454. rsUpper + '+' + rsOptContrUpper,
  1455. rsOrdUpper,
  1456. rsOrdLower,
  1457. rsDigits,
  1458. rsEmoji
  1459. ].join('|'), 'g');
  1460. /** 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/). */
  1461. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1462. /** Used to detect strings that need a more robust regexp to match words. */
  1463. 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 ]/;
  1464. /** Used to assign default `context` object properties. */
  1465. var contextProps = [
  1466. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1467. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1468. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1469. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1470. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1471. ];
  1472. /** Used to make template sourceURLs easier to identify. */
  1473. var templateCounter = -1;
  1474. /** Used to identify `toStringTag` values of typed arrays. */
  1475. var typedArrayTags = {};
  1476. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1477. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1478. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1479. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1480. typedArrayTags[uint32Tag] = true;
  1481. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1482. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1483. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1484. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1485. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1486. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1487. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1488. typedArrayTags[weakMapTag] = false;
  1489. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1490. var cloneableTags = {};
  1491. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1492. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1493. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1494. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1495. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1496. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1497. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1498. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1499. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1500. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1501. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1502. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1503. cloneableTags[weakMapTag] = false;
  1504. /** Used to map Latin Unicode letters to basic Latin letters. */
  1505. var deburredLetters = {
  1506. // Latin-1 Supplement block.
  1507. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1508. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1509. '\xc7': 'C', '\xe7': 'c',
  1510. '\xd0': 'D', '\xf0': 'd',
  1511. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1512. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1513. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1514. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1515. '\xd1': 'N', '\xf1': 'n',
  1516. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1517. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1518. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1519. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1520. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1521. '\xc6': 'Ae', '\xe6': 'ae',
  1522. '\xde': 'Th', '\xfe': 'th',
  1523. '\xdf': 'ss',
  1524. // Latin Extended-A block.
  1525. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1526. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1527. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1528. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1529. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1530. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1531. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1532. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1533. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1534. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1535. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1536. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1537. '\u0134': 'J', '\u0135': 'j',
  1538. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1539. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1540. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1541. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1542. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1543. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1544. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1545. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1546. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1547. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1548. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1549. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1550. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1551. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1552. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1553. '\u0174': 'W', '\u0175': 'w',
  1554. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1555. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1556. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1557. '\u0132': 'IJ', '\u0133': 'ij',
  1558. '\u0152': 'Oe', '\u0153': 'oe',
  1559. '\u0149': "'n", '\u017f': 's'
  1560. };
  1561. /** Used to map characters to HTML entities. */
  1562. var htmlEscapes = {
  1563. '&': '&amp;',
  1564. '<': '&lt;',
  1565. '>': '&gt;',
  1566. '"': '&quot;',
  1567. "'": '&#39;'
  1568. };
  1569. /** Used to map HTML entities to characters. */
  1570. var htmlUnescapes = {
  1571. '&amp;': '&',
  1572. '&lt;': '<',
  1573. '&gt;': '>',
  1574. '&quot;': '"',
  1575. '&#39;': "'"
  1576. };
  1577. /** Used to escape characters for inclusion in compiled string literals. */
  1578. var stringEscapes = {
  1579. '\\': '\\',
  1580. "'": "'",
  1581. '\n': 'n',
  1582. '\r': 'r',
  1583. '\u2028': 'u2028',
  1584. '\u2029': 'u2029'
  1585. };
  1586. /** Built-in method references without a dependency on `root`. */
  1587. var freeParseFloat = parseFloat,
  1588. freeParseInt = parseInt;
  1589. /** Detect free variable `global` from Node.js. */
  1590. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1591. /** Detect free variable `self`. */
  1592. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1593. /** Used as a reference to the global object. */
  1594. var root = freeGlobal || freeSelf || Function('return this')();
  1595. /** Detect free variable `exports`. */
  1596. var freeExports = true && exports && !exports.nodeType && exports;
  1597. /** Detect free variable `module`. */
  1598. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1599. /** Detect the popular CommonJS extension `module.exports`. */
  1600. var moduleExports = freeModule && freeModule.exports === freeExports;
  1601. /** Detect free variable `process` from Node.js. */
  1602. var freeProcess = moduleExports && freeGlobal.process;
  1603. /** Used to access faster Node.js helpers. */
  1604. var nodeUtil = (function() {
  1605. try {
  1606. // Use `util.types` for Node.js 10+.
  1607. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1608. if (types) {
  1609. return types;
  1610. }
  1611. // Legacy `process.binding('util')` for Node.js < 10.
  1612. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1613. } catch (e) {}
  1614. }());
  1615. /* Node.js helper references. */
  1616. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1617. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1618. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1619. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1620. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1621. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1622. /*--------------------------------------------------------------------------*/
  1623. /**
  1624. * A faster alternative to `Function#apply`, this function invokes `func`
  1625. * with the `this` binding of `thisArg` and the arguments of `args`.
  1626. *
  1627. * @private
  1628. * @param {Function} func The function to invoke.
  1629. * @param {*} thisArg The `this` binding of `func`.
  1630. * @param {Array} args The arguments to invoke `func` with.
  1631. * @returns {*} Returns the result of `func`.
  1632. */
  1633. function apply(func, thisArg, args) {
  1634. switch (args.length) {
  1635. case 0: return func.call(thisArg);
  1636. case 1: return func.call(thisArg, args[0]);
  1637. case 2: return func.call(thisArg, args[0], args[1]);
  1638. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1639. }
  1640. return func.apply(thisArg, args);
  1641. }
  1642. /**
  1643. * A specialized version of `baseAggregator` for arrays.
  1644. *
  1645. * @private
  1646. * @param {Array} [array] The array to iterate over.
  1647. * @param {Function} setter The function to set `accumulator` values.
  1648. * @param {Function} iteratee The iteratee to transform keys.
  1649. * @param {Object} accumulator The initial aggregated object.
  1650. * @returns {Function} Returns `accumulator`.
  1651. */
  1652. function arrayAggregator(array, setter, iteratee, accumulator) {
  1653. var index = -1,
  1654. length = array == null ? 0 : array.length;
  1655. while (++index < length) {
  1656. var value = array[index];
  1657. setter(accumulator, value, iteratee(value), array);
  1658. }
  1659. return accumulator;
  1660. }
  1661. /**
  1662. * A specialized version of `_.forEach` for arrays without support for
  1663. * iteratee shorthands.
  1664. *
  1665. * @private
  1666. * @param {Array} [array] The array to iterate over.
  1667. * @param {Function} iteratee The function invoked per iteration.
  1668. * @returns {Array} Returns `array`.
  1669. */
  1670. function arrayEach(array, iteratee) {
  1671. var index = -1,
  1672. length = array == null ? 0 : array.length;
  1673. while (++index < length) {
  1674. if (iteratee(array[index], index, array) === false) {
  1675. break;
  1676. }
  1677. }
  1678. return array;
  1679. }
  1680. /**
  1681. * A specialized version of `_.forEachRight` for arrays without support for
  1682. * iteratee shorthands.
  1683. *
  1684. * @private
  1685. * @param {Array} [array] The array to iterate over.
  1686. * @param {Function} iteratee The function invoked per iteration.
  1687. * @returns {Array} Returns `array`.
  1688. */
  1689. function arrayEachRight(array, iteratee) {
  1690. var length = array == null ? 0 : array.length;
  1691. while (length--) {
  1692. if (iteratee(array[length], length, array) === false) {
  1693. break;
  1694. }
  1695. }
  1696. return array;
  1697. }
  1698. /**
  1699. * A specialized version of `_.every` for arrays without support for
  1700. * iteratee shorthands.
  1701. *
  1702. * @private
  1703. * @param {Array} [array] The array to iterate over.
  1704. * @param {Function} predicate The function invoked per iteration.
  1705. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1706. * else `false`.
  1707. */
  1708. function arrayEvery(array, predicate) {
  1709. var index = -1,
  1710. length = array == null ? 0 : array.length;
  1711. while (++index < length) {
  1712. if (!predicate(array[index], index, array)) {
  1713. return false;
  1714. }
  1715. }
  1716. return true;
  1717. }
  1718. /**
  1719. * A specialized version of `_.filter` for arrays without support for
  1720. * iteratee shorthands.
  1721. *
  1722. * @private
  1723. * @param {Array} [array] The array to iterate over.
  1724. * @param {Function} predicate The function invoked per iteration.
  1725. * @returns {Array} Returns the new filtered array.
  1726. */
  1727. function arrayFilter(array, predicate) {
  1728. var index = -1,
  1729. length = array == null ? 0 : array.length,
  1730. resIndex = 0,
  1731. result = [];
  1732. while (++index < length) {
  1733. var value = array[index];
  1734. if (predicate(value, index, array)) {
  1735. result[resIndex++] = value;
  1736. }
  1737. }
  1738. return result;
  1739. }
  1740. /**
  1741. * A specialized version of `_.includes` for arrays without support for
  1742. * specifying an index to search from.
  1743. *
  1744. * @private
  1745. * @param {Array} [array] The array to inspect.
  1746. * @param {*} target The value to search for.
  1747. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1748. */
  1749. function arrayIncludes(array, value) {
  1750. var length = array == null ? 0 : array.length;
  1751. return !!length && baseIndexOf(array, value, 0) > -1;
  1752. }
  1753. /**
  1754. * This function is like `arrayIncludes` except that it accepts a comparator.
  1755. *
  1756. * @private
  1757. * @param {Array} [array] The array to inspect.
  1758. * @param {*} target The value to search for.
  1759. * @param {Function} comparator The comparator invoked per element.
  1760. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1761. */
  1762. function arrayIncludesWith(array, value, comparator) {
  1763. var index = -1,
  1764. length = array == null ? 0 : array.length;
  1765. while (++index < length) {
  1766. if (comparator(value, array[index])) {
  1767. return true;
  1768. }
  1769. }
  1770. return false;
  1771. }
  1772. /**
  1773. * A specialized version of `_.map` for arrays without support for iteratee
  1774. * shorthands.
  1775. *
  1776. * @private
  1777. * @param {Array} [array] The array to iterate over.
  1778. * @param {Function} iteratee The function invoked per iteration.
  1779. * @returns {Array} Returns the new mapped array.
  1780. */
  1781. function arrayMap(array, iteratee) {
  1782. var index = -1,
  1783. length = array == null ? 0 : array.length,
  1784. result = Array(length);
  1785. while (++index < length) {
  1786. result[index] = iteratee(array[index], index, array);
  1787. }
  1788. return result;
  1789. }
  1790. /**
  1791. * Appends the elements of `values` to `array`.
  1792. *
  1793. * @private
  1794. * @param {Array} array The array to modify.
  1795. * @param {Array} values The values to append.
  1796. * @returns {Array} Returns `array`.
  1797. */
  1798. function arrayPush(array, values) {
  1799. var index = -1,
  1800. length = values.length,
  1801. offset = array.length;
  1802. while (++index < length) {
  1803. array[offset + index] = values[index];
  1804. }
  1805. return array;
  1806. }
  1807. /**
  1808. * A specialized version of `_.reduce` for arrays without support for
  1809. * iteratee shorthands.
  1810. *
  1811. * @private
  1812. * @param {Array} [array] The array to iterate over.
  1813. * @param {Function} iteratee The function invoked per iteration.
  1814. * @param {*} [accumulator] The initial value.
  1815. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1816. * the initial value.
  1817. * @returns {*} Returns the accumulated value.
  1818. */
  1819. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1820. var index = -1,
  1821. length = array == null ? 0 : array.length;
  1822. if (initAccum && length) {
  1823. accumulator = array[++index];
  1824. }
  1825. while (++index < length) {
  1826. accumulator = iteratee(accumulator, array[index], index, array);
  1827. }
  1828. return accumulator;
  1829. }
  1830. /**
  1831. * A specialized version of `_.reduceRight` for arrays without support for
  1832. * iteratee shorthands.
  1833. *
  1834. * @private
  1835. * @param {Array} [array] The array to iterate over.
  1836. * @param {Function} iteratee The function invoked per iteration.
  1837. * @param {*} [accumulator] The initial value.
  1838. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1839. * the initial value.
  1840. * @returns {*} Returns the accumulated value.
  1841. */
  1842. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1843. var length = array == null ? 0 : array.length;
  1844. if (initAccum && length) {
  1845. accumulator = array[--length];
  1846. }
  1847. while (length--) {
  1848. accumulator = iteratee(accumulator, array[length], length, array);
  1849. }
  1850. return accumulator;
  1851. }
  1852. /**
  1853. * A specialized version of `_.some` for arrays without support for iteratee
  1854. * shorthands.
  1855. *
  1856. * @private
  1857. * @param {Array} [array] The array to iterate over.
  1858. * @param {Function} predicate The function invoked per iteration.
  1859. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1860. * else `false`.
  1861. */
  1862. function arraySome(array, predicate) {
  1863. var index = -1,
  1864. length = array == null ? 0 : array.length;
  1865. while (++index < length) {
  1866. if (predicate(array[index], index, array)) {
  1867. return true;
  1868. }
  1869. }
  1870. return false;
  1871. }
  1872. /**
  1873. * Gets the size of an ASCII `string`.
  1874. *
  1875. * @private
  1876. * @param {string} string The string inspect.
  1877. * @returns {number} Returns the string size.
  1878. */
  1879. var asciiSize = baseProperty('length');
  1880. /**
  1881. * Converts an ASCII `string` to an array.
  1882. *
  1883. * @private
  1884. * @param {string} string The string to convert.
  1885. * @returns {Array} Returns the converted array.
  1886. */
  1887. function asciiToArray(string) {
  1888. return string.split('');
  1889. }
  1890. /**
  1891. * Splits an ASCII `string` into an array of its words.
  1892. *
  1893. * @private
  1894. * @param {string} The string to inspect.
  1895. * @returns {Array} Returns the words of `string`.
  1896. */
  1897. function asciiWords(string) {
  1898. return string.match(reAsciiWord) || [];
  1899. }
  1900. /**
  1901. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1902. * without support for iteratee shorthands, which iterates over `collection`
  1903. * using `eachFunc`.
  1904. *
  1905. * @private
  1906. * @param {Array|Object} collection The collection to inspect.
  1907. * @param {Function} predicate The function invoked per iteration.
  1908. * @param {Function} eachFunc The function to iterate over `collection`.
  1909. * @returns {*} Returns the found element or its key, else `undefined`.
  1910. */
  1911. function baseFindKey(collection, predicate, eachFunc) {
  1912. var result;
  1913. eachFunc(collection, function(value, key, collection) {
  1914. if (predicate(value, key, collection)) {
  1915. result = key;
  1916. return false;
  1917. }
  1918. });
  1919. return result;
  1920. }
  1921. /**
  1922. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1923. * support for iteratee shorthands.
  1924. *
  1925. * @private
  1926. * @param {Array} array The array to inspect.
  1927. * @param {Function} predicate The function invoked per iteration.
  1928. * @param {number} fromIndex The index to search from.
  1929. * @param {boolean} [fromRight] Specify iterating from right to left.
  1930. * @returns {number} Returns the index of the matched value, else `-1`.
  1931. */
  1932. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1933. var length = array.length,
  1934. index = fromIndex + (fromRight ? 1 : -1);
  1935. while ((fromRight ? index-- : ++index < length)) {
  1936. if (predicate(array[index], index, array)) {
  1937. return index;
  1938. }
  1939. }
  1940. return -1;
  1941. }
  1942. /**
  1943. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1944. *
  1945. * @private
  1946. * @param {Array} array The array to inspect.
  1947. * @param {*} value The value to search for.
  1948. * @param {number} fromIndex The index to search from.
  1949. * @returns {number} Returns the index of the matched value, else `-1`.
  1950. */
  1951. function baseIndexOf(array, value, fromIndex) {
  1952. return value === value
  1953. ? strictIndexOf(array, value, fromIndex)
  1954. : baseFindIndex(array, baseIsNaN, fromIndex);
  1955. }
  1956. /**
  1957. * This function is like `baseIndexOf` except that it accepts a comparator.
  1958. *
  1959. * @private
  1960. * @param {Array} array The array to inspect.
  1961. * @param {*} value The value to search for.
  1962. * @param {number} fromIndex The index to search from.
  1963. * @param {Function} comparator The comparator invoked per element.
  1964. * @returns {number} Returns the index of the matched value, else `-1`.
  1965. */
  1966. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1967. var index = fromIndex - 1,
  1968. length = array.length;
  1969. while (++index < length) {
  1970. if (comparator(array[index], value)) {
  1971. return index;
  1972. }
  1973. }
  1974. return -1;
  1975. }
  1976. /**
  1977. * The base implementation of `_.isNaN` without support for number objects.
  1978. *
  1979. * @private
  1980. * @param {*} value The value to check.
  1981. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1982. */
  1983. function baseIsNaN(value) {
  1984. return value !== value;
  1985. }
  1986. /**
  1987. * The base implementation of `_.mean` and `_.meanBy` without support for
  1988. * iteratee shorthands.
  1989. *
  1990. * @private
  1991. * @param {Array} array The array to iterate over.
  1992. * @param {Function} iteratee The function invoked per iteration.
  1993. * @returns {number} Returns the mean.
  1994. */
  1995. function baseMean(array, iteratee) {
  1996. var length = array == null ? 0 : array.length;
  1997. return length ? (baseSum(array, iteratee) / length) : NAN;
  1998. }
  1999. /**
  2000. * The base implementation of `_.property` without support for deep paths.
  2001. *
  2002. * @private
  2003. * @param {string} key The key of the property to get.
  2004. * @returns {Function} Returns the new accessor function.
  2005. */
  2006. function baseProperty(key) {
  2007. return function(object) {
  2008. return object == null ? undefined : object[key];
  2009. };
  2010. }
  2011. /**
  2012. * The base implementation of `_.propertyOf` without support for deep paths.
  2013. *
  2014. * @private
  2015. * @param {Object} object The object to query.
  2016. * @returns {Function} Returns the new accessor function.
  2017. */
  2018. function basePropertyOf(object) {
  2019. return function(key) {
  2020. return object == null ? undefined : object[key];
  2021. };
  2022. }
  2023. /**
  2024. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2025. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2026. *
  2027. * @private
  2028. * @param {Array|Object} collection The collection to iterate over.
  2029. * @param {Function} iteratee The function invoked per iteration.
  2030. * @param {*} accumulator The initial value.
  2031. * @param {boolean} initAccum Specify using the first or last element of
  2032. * `collection` as the initial value.
  2033. * @param {Function} eachFunc The function to iterate over `collection`.
  2034. * @returns {*} Returns the accumulated value.
  2035. */
  2036. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2037. eachFunc(collection, function(value, index, collection) {
  2038. accumulator = initAccum
  2039. ? (initAccum = false, value)
  2040. : iteratee(accumulator, value, index, collection);
  2041. });
  2042. return accumulator;
  2043. }
  2044. /**
  2045. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2046. * sort order of `array` and replaces criteria objects with their corresponding
  2047. * values.
  2048. *
  2049. * @private
  2050. * @param {Array} array The array to sort.
  2051. * @param {Function} comparer The function to define sort order.
  2052. * @returns {Array} Returns `array`.
  2053. */
  2054. function baseSortBy(array, comparer) {
  2055. var length = array.length;
  2056. array.sort(comparer);
  2057. while (length--) {
  2058. array[length] = array[length].value;
  2059. }
  2060. return array;
  2061. }
  2062. /**
  2063. * The base implementation of `_.sum` and `_.sumBy` without support for
  2064. * iteratee shorthands.
  2065. *
  2066. * @private
  2067. * @param {Array} array The array to iterate over.
  2068. * @param {Function} iteratee The function invoked per iteration.
  2069. * @returns {number} Returns the sum.
  2070. */
  2071. function baseSum(array, iteratee) {
  2072. var result,
  2073. index = -1,
  2074. length = array.length;
  2075. while (++index < length) {
  2076. var current = iteratee(array[index]);
  2077. if (current !== undefined) {
  2078. result = result === undefined ? current : (result + current);
  2079. }
  2080. }
  2081. return result;
  2082. }
  2083. /**
  2084. * The base implementation of `_.times` without support for iteratee shorthands
  2085. * or max array length checks.
  2086. *
  2087. * @private
  2088. * @param {number} n The number of times to invoke `iteratee`.
  2089. * @param {Function} iteratee The function invoked per iteration.
  2090. * @returns {Array} Returns the array of results.
  2091. */
  2092. function baseTimes(n, iteratee) {
  2093. var index = -1,
  2094. result = Array(n);
  2095. while (++index < n) {
  2096. result[index] = iteratee(index);
  2097. }
  2098. return result;
  2099. }
  2100. /**
  2101. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2102. * of key-value pairs for `object` corresponding to the property names of `props`.
  2103. *
  2104. * @private
  2105. * @param {Object} object The object to query.
  2106. * @param {Array} props The property names to get values for.
  2107. * @returns {Object} Returns the key-value pairs.
  2108. */
  2109. function baseToPairs(object, props) {
  2110. return arrayMap(props, function(key) {
  2111. return [key, object[key]];
  2112. });
  2113. }
  2114. /**
  2115. * The base implementation of `_.trim`.
  2116. *
  2117. * @private
  2118. * @param {string} string The string to trim.
  2119. * @returns {string} Returns the trimmed string.
  2120. */
  2121. function baseTrim(string) {
  2122. return string
  2123. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2124. : string;
  2125. }
  2126. /**
  2127. * The base implementation of `_.unary` without support for storing metadata.
  2128. *
  2129. * @private
  2130. * @param {Function} func The function to cap arguments for.
  2131. * @returns {Function} Returns the new capped function.
  2132. */
  2133. function baseUnary(func) {
  2134. return function(value) {
  2135. return func(value);
  2136. };
  2137. }
  2138. /**
  2139. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2140. * array of `object` property values corresponding to the property names
  2141. * of `props`.
  2142. *
  2143. * @private
  2144. * @param {Object} object The object to query.
  2145. * @param {Array} props The property names to get values for.
  2146. * @returns {Object} Returns the array of property values.
  2147. */
  2148. function baseValues(object, props) {
  2149. return arrayMap(props, function(key) {
  2150. return object[key];
  2151. });
  2152. }
  2153. /**
  2154. * Checks if a `cache` value for `key` exists.
  2155. *
  2156. * @private
  2157. * @param {Object} cache The cache to query.
  2158. * @param {string} key The key of the entry to check.
  2159. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2160. */
  2161. function cacheHas(cache, key) {
  2162. return cache.has(key);
  2163. }
  2164. /**
  2165. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2166. * that is not found in the character symbols.
  2167. *
  2168. * @private
  2169. * @param {Array} strSymbols The string symbols to inspect.
  2170. * @param {Array} chrSymbols The character symbols to find.
  2171. * @returns {number} Returns the index of the first unmatched string symbol.
  2172. */
  2173. function charsStartIndex(strSymbols, chrSymbols) {
  2174. var index = -1,
  2175. length = strSymbols.length;
  2176. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2177. return index;
  2178. }
  2179. /**
  2180. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2181. * that is not found in the character symbols.
  2182. *
  2183. * @private
  2184. * @param {Array} strSymbols The string symbols to inspect.
  2185. * @param {Array} chrSymbols The character symbols to find.
  2186. * @returns {number} Returns the index of the last unmatched string symbol.
  2187. */
  2188. function charsEndIndex(strSymbols, chrSymbols) {
  2189. var index = strSymbols.length;
  2190. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2191. return index;
  2192. }
  2193. /**
  2194. * Gets the number of `placeholder` occurrences in `array`.
  2195. *
  2196. * @private
  2197. * @param {Array} array The array to inspect.
  2198. * @param {*} placeholder The placeholder to search for.
  2199. * @returns {number} Returns the placeholder count.
  2200. */
  2201. function countHolders(array, placeholder) {
  2202. var length = array.length,
  2203. result = 0;
  2204. while (length--) {
  2205. if (array[length] === placeholder) {
  2206. ++result;
  2207. }
  2208. }
  2209. return result;
  2210. }
  2211. /**
  2212. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2213. * letters to basic Latin letters.
  2214. *
  2215. * @private
  2216. * @param {string} letter The matched letter to deburr.
  2217. * @returns {string} Returns the deburred letter.
  2218. */
  2219. var deburrLetter = basePropertyOf(deburredLetters);
  2220. /**
  2221. * Used by `_.escape` to convert characters to HTML entities.
  2222. *
  2223. * @private
  2224. * @param {string} chr The matched character to escape.
  2225. * @returns {string} Returns the escaped character.
  2226. */
  2227. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2228. /**
  2229. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2230. *
  2231. * @private
  2232. * @param {string} chr The matched character to escape.
  2233. * @returns {string} Returns the escaped character.
  2234. */
  2235. function escapeStringChar(chr) {
  2236. return '\\' + stringEscapes[chr];
  2237. }
  2238. /**
  2239. * Gets the value at `key` of `object`.
  2240. *
  2241. * @private
  2242. * @param {Object} [object] The object to query.
  2243. * @param {string} key The key of the property to get.
  2244. * @returns {*} Returns the property value.
  2245. */
  2246. function getValue(object, key) {
  2247. return object == null ? undefined : object[key];
  2248. }
  2249. /**
  2250. * Checks if `string` contains Unicode symbols.
  2251. *
  2252. * @private
  2253. * @param {string} string The string to inspect.
  2254. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2255. */
  2256. function hasUnicode(string) {
  2257. return reHasUnicode.test(string);
  2258. }
  2259. /**
  2260. * Checks if `string` contains a word composed of Unicode symbols.
  2261. *
  2262. * @private
  2263. * @param {string} string The string to inspect.
  2264. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2265. */
  2266. function hasUnicodeWord(string) {
  2267. return reHasUnicodeWord.test(string);
  2268. }
  2269. /**
  2270. * Converts `iterator` to an array.
  2271. *
  2272. * @private
  2273. * @param {Object} iterator The iterator to convert.
  2274. * @returns {Array} Returns the converted array.
  2275. */
  2276. function iteratorToArray(iterator) {
  2277. var data,
  2278. result = [];
  2279. while (!(data = iterator.next()).done) {
  2280. result.push(data.value);
  2281. }
  2282. return result;
  2283. }
  2284. /**
  2285. * Converts `map` to its key-value pairs.
  2286. *
  2287. * @private
  2288. * @param {Object} map The map to convert.
  2289. * @returns {Array} Returns the key-value pairs.
  2290. */
  2291. function mapToArray(map) {
  2292. var index = -1,
  2293. result = Array(map.size);
  2294. map.forEach(function(value, key) {
  2295. result[++index] = [key, value];
  2296. });
  2297. return result;
  2298. }
  2299. /**
  2300. * Creates a unary function that invokes `func` with its argument transformed.
  2301. *
  2302. * @private
  2303. * @param {Function} func The function to wrap.
  2304. * @param {Function} transform The argument transform.
  2305. * @returns {Function} Returns the new function.
  2306. */
  2307. function overArg(func, transform) {
  2308. return function(arg) {
  2309. return func(transform(arg));
  2310. };
  2311. }
  2312. /**
  2313. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2314. * and returns an array of their indexes.
  2315. *
  2316. * @private
  2317. * @param {Array} array The array to modify.
  2318. * @param {*} placeholder The placeholder to replace.
  2319. * @returns {Array} Returns the new array of placeholder indexes.
  2320. */
  2321. function replaceHolders(array, placeholder) {
  2322. var index = -1,
  2323. length = array.length,
  2324. resIndex = 0,
  2325. result = [];
  2326. while (++index < length) {
  2327. var value = array[index];
  2328. if (value === placeholder || value === PLACEHOLDER) {
  2329. array[index] = PLACEHOLDER;
  2330. result[resIndex++] = index;
  2331. }
  2332. }
  2333. return result;
  2334. }
  2335. /**
  2336. * Converts `set` to an array of its values.
  2337. *
  2338. * @private
  2339. * @param {Object} set The set to convert.
  2340. * @returns {Array} Returns the values.
  2341. */
  2342. function setToArray(set) {
  2343. var index = -1,
  2344. result = Array(set.size);
  2345. set.forEach(function(value) {
  2346. result[++index] = value;
  2347. });
  2348. return result;
  2349. }
  2350. /**
  2351. * Converts `set` to its value-value pairs.
  2352. *
  2353. * @private
  2354. * @param {Object} set The set to convert.
  2355. * @returns {Array} Returns the value-value pairs.
  2356. */
  2357. function setToPairs(set) {
  2358. var index = -1,
  2359. result = Array(set.size);
  2360. set.forEach(function(value) {
  2361. result[++index] = [value, value];
  2362. });
  2363. return result;
  2364. }
  2365. /**
  2366. * A specialized version of `_.indexOf` which performs strict equality
  2367. * comparisons of values, i.e. `===`.
  2368. *
  2369. * @private
  2370. * @param {Array} array The array to inspect.
  2371. * @param {*} value The value to search for.
  2372. * @param {number} fromIndex The index to search from.
  2373. * @returns {number} Returns the index of the matched value, else `-1`.
  2374. */
  2375. function strictIndexOf(array, value, fromIndex) {
  2376. var index = fromIndex - 1,
  2377. length = array.length;
  2378. while (++index < length) {
  2379. if (array[index] === value) {
  2380. return index;
  2381. }
  2382. }
  2383. return -1;
  2384. }
  2385. /**
  2386. * A specialized version of `_.lastIndexOf` which performs strict equality
  2387. * comparisons of values, i.e. `===`.
  2388. *
  2389. * @private
  2390. * @param {Array} array The array to inspect.
  2391. * @param {*} value The value to search for.
  2392. * @param {number} fromIndex The index to search from.
  2393. * @returns {number} Returns the index of the matched value, else `-1`.
  2394. */
  2395. function strictLastIndexOf(array, value, fromIndex) {
  2396. var index = fromIndex + 1;
  2397. while (index--) {
  2398. if (array[index] === value) {
  2399. return index;
  2400. }
  2401. }
  2402. return index;
  2403. }
  2404. /**
  2405. * Gets the number of symbols in `string`.
  2406. *
  2407. * @private
  2408. * @param {string} string The string to inspect.
  2409. * @returns {number} Returns the string size.
  2410. */
  2411. function stringSize(string) {
  2412. return hasUnicode(string)
  2413. ? unicodeSize(string)
  2414. : asciiSize(string);
  2415. }
  2416. /**
  2417. * Converts `string` to an array.
  2418. *
  2419. * @private
  2420. * @param {string} string The string to convert.
  2421. * @returns {Array} Returns the converted array.
  2422. */
  2423. function stringToArray(string) {
  2424. return hasUnicode(string)
  2425. ? unicodeToArray(string)
  2426. : asciiToArray(string);
  2427. }
  2428. /**
  2429. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2430. * character of `string`.
  2431. *
  2432. * @private
  2433. * @param {string} string The string to inspect.
  2434. * @returns {number} Returns the index of the last non-whitespace character.
  2435. */
  2436. function trimmedEndIndex(string) {
  2437. var index = string.length;
  2438. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2439. return index;
  2440. }
  2441. /**
  2442. * Used by `_.unescape` to convert HTML entities to characters.
  2443. *
  2444. * @private
  2445. * @param {string} chr The matched character to unescape.
  2446. * @returns {string} Returns the unescaped character.
  2447. */
  2448. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2449. /**
  2450. * Gets the size of a Unicode `string`.
  2451. *
  2452. * @private
  2453. * @param {string} string The string inspect.
  2454. * @returns {number} Returns the string size.
  2455. */
  2456. function unicodeSize(string) {
  2457. var result = reUnicode.lastIndex = 0;
  2458. while (reUnicode.test(string)) {
  2459. ++result;
  2460. }
  2461. return result;
  2462. }
  2463. /**
  2464. * Converts a Unicode `string` to an array.
  2465. *
  2466. * @private
  2467. * @param {string} string The string to convert.
  2468. * @returns {Array} Returns the converted array.
  2469. */
  2470. function unicodeToArray(string) {
  2471. return string.match(reUnicode) || [];
  2472. }
  2473. /**
  2474. * Splits a Unicode `string` into an array of its words.
  2475. *
  2476. * @private
  2477. * @param {string} The string to inspect.
  2478. * @returns {Array} Returns the words of `string`.
  2479. */
  2480. function unicodeWords(string) {
  2481. return string.match(reUnicodeWord) || [];
  2482. }
  2483. /*--------------------------------------------------------------------------*/
  2484. /**
  2485. * Create a new pristine `lodash` function using the `context` object.
  2486. *
  2487. * @static
  2488. * @memberOf _
  2489. * @since 1.1.0
  2490. * @category Util
  2491. * @param {Object} [context=root] The context object.
  2492. * @returns {Function} Returns a new `lodash` function.
  2493. * @example
  2494. *
  2495. * _.mixin({ 'foo': _.constant('foo') });
  2496. *
  2497. * var lodash = _.runInContext();
  2498. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2499. *
  2500. * _.isFunction(_.foo);
  2501. * // => true
  2502. * _.isFunction(_.bar);
  2503. * // => false
  2504. *
  2505. * lodash.isFunction(lodash.foo);
  2506. * // => false
  2507. * lodash.isFunction(lodash.bar);
  2508. * // => true
  2509. *
  2510. * // Create a suped-up `defer` in Node.js.
  2511. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2512. */
  2513. var runInContext = (function runInContext(context) {
  2514. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2515. /** Built-in constructor references. */
  2516. var Array = context.Array,
  2517. Date = context.Date,
  2518. Error = context.Error,
  2519. Function = context.Function,
  2520. Math = context.Math,
  2521. Object = context.Object,
  2522. RegExp = context.RegExp,
  2523. String = context.String,
  2524. TypeError = context.TypeError;
  2525. /** Used for built-in method references. */
  2526. var arrayProto = Array.prototype,
  2527. funcProto = Function.prototype,
  2528. objectProto = Object.prototype;
  2529. /** Used to detect overreaching core-js shims. */
  2530. var coreJsData = context['__core-js_shared__'];
  2531. /** Used to resolve the decompiled source of functions. */
  2532. var funcToString = funcProto.toString;
  2533. /** Used to check objects for own properties. */
  2534. var hasOwnProperty = objectProto.hasOwnProperty;
  2535. /** Used to generate unique IDs. */
  2536. var idCounter = 0;
  2537. /** Used to detect methods masquerading as native. */
  2538. var maskSrcKey = (function() {
  2539. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2540. return uid ? ('Symbol(src)_1.' + uid) : '';
  2541. }());
  2542. /**
  2543. * Used to resolve the
  2544. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2545. * of values.
  2546. */
  2547. var nativeObjectToString = objectProto.toString;
  2548. /** Used to infer the `Object` constructor. */
  2549. var objectCtorString = funcToString.call(Object);
  2550. /** Used to restore the original `_` reference in `_.noConflict`. */
  2551. var oldDash = root._;
  2552. /** Used to detect if a method is native. */
  2553. var reIsNative = RegExp('^' +
  2554. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2555. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2556. );
  2557. /** Built-in value references. */
  2558. var Buffer = moduleExports ? context.Buffer : undefined,
  2559. Symbol = context.Symbol,
  2560. Uint8Array = context.Uint8Array,
  2561. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2562. getPrototype = overArg(Object.getPrototypeOf, Object),
  2563. objectCreate = Object.create,
  2564. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2565. splice = arrayProto.splice,
  2566. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2567. symIterator = Symbol ? Symbol.iterator : undefined,
  2568. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2569. var defineProperty = (function() {
  2570. try {
  2571. var func = getNative(Object, 'defineProperty');
  2572. func({}, '', {});
  2573. return func;
  2574. } catch (e) {}
  2575. }());
  2576. /** Mocked built-ins. */
  2577. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2578. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2579. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2580. /* Built-in method references for those with the same name as other `lodash` methods. */
  2581. var nativeCeil = Math.ceil,
  2582. nativeFloor = Math.floor,
  2583. nativeGetSymbols = Object.getOwnPropertySymbols,
  2584. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2585. nativeIsFinite = context.isFinite,
  2586. nativeJoin = arrayProto.join,
  2587. nativeKeys = overArg(Object.keys, Object),
  2588. nativeMax = Math.max,
  2589. nativeMin = Math.min,
  2590. nativeNow = Date.now,
  2591. nativeParseInt = context.parseInt,
  2592. nativeRandom = Math.random,
  2593. nativeReverse = arrayProto.reverse;
  2594. /* Built-in method references that are verified to be native. */
  2595. var DataView = getNative(context, 'DataView'),
  2596. Map = getNative(context, 'Map'),
  2597. Promise = getNative(context, 'Promise'),
  2598. Set = getNative(context, 'Set'),
  2599. WeakMap = getNative(context, 'WeakMap'),
  2600. nativeCreate = getNative(Object, 'create');
  2601. /** Used to store function metadata. */
  2602. var metaMap = WeakMap && new WeakMap;
  2603. /** Used to lookup unminified function names. */
  2604. var realNames = {};
  2605. /** Used to detect maps, sets, and weakmaps. */
  2606. var dataViewCtorString = toSource(DataView),
  2607. mapCtorString = toSource(Map),
  2608. promiseCtorString = toSource(Promise),
  2609. setCtorString = toSource(Set),
  2610. weakMapCtorString = toSource(WeakMap);
  2611. /** Used to convert symbols to primitives and strings. */
  2612. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2613. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2614. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2615. /*------------------------------------------------------------------------*/
  2616. /**
  2617. * Creates a `lodash` object which wraps `value` to enable implicit method
  2618. * chain sequences. Methods that operate on and return arrays, collections,
  2619. * and functions can be chained together. Methods that retrieve a single value
  2620. * or may return a primitive value will automatically end the chain sequence
  2621. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2622. * with `_#value`.
  2623. *
  2624. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2625. * enabled using `_.chain`.
  2626. *
  2627. * The execution of chained methods is lazy, that is, it's deferred until
  2628. * `_#value` is implicitly or explicitly called.
  2629. *
  2630. * Lazy evaluation allows several methods to support shortcut fusion.
  2631. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2632. * the creation of intermediate arrays and can greatly reduce the number of
  2633. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2634. * fusion if the section is applied to an array and iteratees accept only
  2635. * one argument. The heuristic for whether a section qualifies for shortcut
  2636. * fusion is subject to change.
  2637. *
  2638. * Chaining is supported in custom builds as long as the `_#value` method is
  2639. * directly or indirectly included in the build.
  2640. *
  2641. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2642. *
  2643. * The wrapper `Array` methods are:
  2644. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2645. *
  2646. * The wrapper `String` methods are:
  2647. * `replace` and `split`
  2648. *
  2649. * The wrapper methods that support shortcut fusion are:
  2650. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2651. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2652. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2653. *
  2654. * The chainable wrapper methods are:
  2655. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2656. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2657. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2658. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2659. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2660. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2661. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2662. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2663. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2664. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2665. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2666. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2667. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2668. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2669. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2670. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2671. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2672. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2673. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2674. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2675. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2676. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2677. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2678. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2679. *
  2680. * The wrapper methods that are **not** chainable by default are:
  2681. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2682. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2683. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2684. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2685. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2686. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2687. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2688. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2689. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2690. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2691. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2692. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2693. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2694. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2695. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2696. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2697. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2698. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2699. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2700. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2701. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2702. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2703. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2704. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2705. * `upperFirst`, `value`, and `words`
  2706. *
  2707. * @name _
  2708. * @constructor
  2709. * @category Seq
  2710. * @param {*} value The value to wrap in a `lodash` instance.
  2711. * @returns {Object} Returns the new `lodash` wrapper instance.
  2712. * @example
  2713. *
  2714. * function square(n) {
  2715. * return n * n;
  2716. * }
  2717. *
  2718. * var wrapped = _([1, 2, 3]);
  2719. *
  2720. * // Returns an unwrapped value.
  2721. * wrapped.reduce(_.add);
  2722. * // => 6
  2723. *
  2724. * // Returns a wrapped value.
  2725. * var squares = wrapped.map(square);
  2726. *
  2727. * _.isArray(squares);
  2728. * // => false
  2729. *
  2730. * _.isArray(squares.value());
  2731. * // => true
  2732. */
  2733. function lodash(value) {
  2734. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2735. if (value instanceof LodashWrapper) {
  2736. return value;
  2737. }
  2738. if (hasOwnProperty.call(value, '__wrapped__')) {
  2739. return wrapperClone(value);
  2740. }
  2741. }
  2742. return new LodashWrapper(value);
  2743. }
  2744. /**
  2745. * The base implementation of `_.create` without support for assigning
  2746. * properties to the created object.
  2747. *
  2748. * @private
  2749. * @param {Object} proto The object to inherit from.
  2750. * @returns {Object} Returns the new object.
  2751. */
  2752. var baseCreate = (function() {
  2753. function object() {}
  2754. return function(proto) {
  2755. if (!isObject(proto)) {
  2756. return {};
  2757. }
  2758. if (objectCreate) {
  2759. return objectCreate(proto);
  2760. }
  2761. object.prototype = proto;
  2762. var result = new object;
  2763. object.prototype = undefined;
  2764. return result;
  2765. };
  2766. }());
  2767. /**
  2768. * The function whose prototype chain sequence wrappers inherit from.
  2769. *
  2770. * @private
  2771. */
  2772. function baseLodash() {
  2773. // No operation performed.
  2774. }
  2775. /**
  2776. * The base constructor for creating `lodash` wrapper objects.
  2777. *
  2778. * @private
  2779. * @param {*} value The value to wrap.
  2780. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2781. */
  2782. function LodashWrapper(value, chainAll) {
  2783. this.__wrapped__ = value;
  2784. this.__actions__ = [];
  2785. this.__chain__ = !!chainAll;
  2786. this.__index__ = 0;
  2787. this.__values__ = undefined;
  2788. }
  2789. /**
  2790. * By default, the template delimiters used by lodash are like those in
  2791. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2792. * following template settings to use alternative delimiters.
  2793. *
  2794. * @static
  2795. * @memberOf _
  2796. * @type {Object}
  2797. */
  2798. lodash.templateSettings = {
  2799. /**
  2800. * Used to detect `data` property values to be HTML-escaped.
  2801. *
  2802. * @memberOf _.templateSettings
  2803. * @type {RegExp}
  2804. */
  2805. 'escape': reEscape,
  2806. /**
  2807. * Used to detect code to be evaluated.
  2808. *
  2809. * @memberOf _.templateSettings
  2810. * @type {RegExp}
  2811. */
  2812. 'evaluate': reEvaluate,
  2813. /**
  2814. * Used to detect `data` property values to inject.
  2815. *
  2816. * @memberOf _.templateSettings
  2817. * @type {RegExp}
  2818. */
  2819. 'interpolate': reInterpolate,
  2820. /**
  2821. * Used to reference the data object in the template text.
  2822. *
  2823. * @memberOf _.templateSettings
  2824. * @type {string}
  2825. */
  2826. 'variable': '',
  2827. /**
  2828. * Used to import variables into the compiled template.
  2829. *
  2830. * @memberOf _.templateSettings
  2831. * @type {Object}
  2832. */
  2833. 'imports': {
  2834. /**
  2835. * A reference to the `lodash` function.
  2836. *
  2837. * @memberOf _.templateSettings.imports
  2838. * @type {Function}
  2839. */
  2840. '_': lodash
  2841. }
  2842. };
  2843. // Ensure wrappers are instances of `baseLodash`.
  2844. lodash.prototype = baseLodash.prototype;
  2845. lodash.prototype.constructor = lodash;
  2846. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2847. LodashWrapper.prototype.constructor = LodashWrapper;
  2848. /*------------------------------------------------------------------------*/
  2849. /**
  2850. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2851. *
  2852. * @private
  2853. * @constructor
  2854. * @param {*} value The value to wrap.
  2855. */
  2856. function LazyWrapper(value) {
  2857. this.__wrapped__ = value;
  2858. this.__actions__ = [];
  2859. this.__dir__ = 1;
  2860. this.__filtered__ = false;
  2861. this.__iteratees__ = [];
  2862. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2863. this.__views__ = [];
  2864. }
  2865. /**
  2866. * Creates a clone of the lazy wrapper object.
  2867. *
  2868. * @private
  2869. * @name clone
  2870. * @memberOf LazyWrapper
  2871. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2872. */
  2873. function lazyClone() {
  2874. var result = new LazyWrapper(this.__wrapped__);
  2875. result.__actions__ = copyArray(this.__actions__);
  2876. result.__dir__ = this.__dir__;
  2877. result.__filtered__ = this.__filtered__;
  2878. result.__iteratees__ = copyArray(this.__iteratees__);
  2879. result.__takeCount__ = this.__takeCount__;
  2880. result.__views__ = copyArray(this.__views__);
  2881. return result;
  2882. }
  2883. /**
  2884. * Reverses the direction of lazy iteration.
  2885. *
  2886. * @private
  2887. * @name reverse
  2888. * @memberOf LazyWrapper
  2889. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2890. */
  2891. function lazyReverse() {
  2892. if (this.__filtered__) {
  2893. var result = new LazyWrapper(this);
  2894. result.__dir__ = -1;
  2895. result.__filtered__ = true;
  2896. } else {
  2897. result = this.clone();
  2898. result.__dir__ *= -1;
  2899. }
  2900. return result;
  2901. }
  2902. /**
  2903. * Extracts the unwrapped value from its lazy wrapper.
  2904. *
  2905. * @private
  2906. * @name value
  2907. * @memberOf LazyWrapper
  2908. * @returns {*} Returns the unwrapped value.
  2909. */
  2910. function lazyValue() {
  2911. var array = this.__wrapped__.value(),
  2912. dir = this.__dir__,
  2913. isArr = isArray(array),
  2914. isRight = dir < 0,
  2915. arrLength = isArr ? array.length : 0,
  2916. view = getView(0, arrLength, this.__views__),
  2917. start = view.start,
  2918. end = view.end,
  2919. length = end - start,
  2920. index = isRight ? end : (start - 1),
  2921. iteratees = this.__iteratees__,
  2922. iterLength = iteratees.length,
  2923. resIndex = 0,
  2924. takeCount = nativeMin(length, this.__takeCount__);
  2925. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2926. return baseWrapperValue(array, this.__actions__);
  2927. }
  2928. var result = [];
  2929. outer:
  2930. while (length-- && resIndex < takeCount) {
  2931. index += dir;
  2932. var iterIndex = -1,
  2933. value = array[index];
  2934. while (++iterIndex < iterLength) {
  2935. var data = iteratees[iterIndex],
  2936. iteratee = data.iteratee,
  2937. type = data.type,
  2938. computed = iteratee(value);
  2939. if (type == LAZY_MAP_FLAG) {
  2940. value = computed;
  2941. } else if (!computed) {
  2942. if (type == LAZY_FILTER_FLAG) {
  2943. continue outer;
  2944. } else {
  2945. break outer;
  2946. }
  2947. }
  2948. }
  2949. result[resIndex++] = value;
  2950. }
  2951. return result;
  2952. }
  2953. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2954. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2955. LazyWrapper.prototype.constructor = LazyWrapper;
  2956. /*------------------------------------------------------------------------*/
  2957. /**
  2958. * Creates a hash object.
  2959. *
  2960. * @private
  2961. * @constructor
  2962. * @param {Array} [entries] The key-value pairs to cache.
  2963. */
  2964. function Hash(entries) {
  2965. var index = -1,
  2966. length = entries == null ? 0 : entries.length;
  2967. this.clear();
  2968. while (++index < length) {
  2969. var entry = entries[index];
  2970. this.set(entry[0], entry[1]);
  2971. }
  2972. }
  2973. /**
  2974. * Removes all key-value entries from the hash.
  2975. *
  2976. * @private
  2977. * @name clear
  2978. * @memberOf Hash
  2979. */
  2980. function hashClear() {
  2981. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2982. this.size = 0;
  2983. }
  2984. /**
  2985. * Removes `key` and its value from the hash.
  2986. *
  2987. * @private
  2988. * @name delete
  2989. * @memberOf Hash
  2990. * @param {Object} hash The hash to modify.
  2991. * @param {string} key The key of the value to remove.
  2992. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2993. */
  2994. function hashDelete(key) {
  2995. var result = this.has(key) && delete this.__data__[key];
  2996. this.size -= result ? 1 : 0;
  2997. return result;
  2998. }
  2999. /**
  3000. * Gets the hash value for `key`.
  3001. *
  3002. * @private
  3003. * @name get
  3004. * @memberOf Hash
  3005. * @param {string} key The key of the value to get.
  3006. * @returns {*} Returns the entry value.
  3007. */
  3008. function hashGet(key) {
  3009. var data = this.__data__;
  3010. if (nativeCreate) {
  3011. var result = data[key];
  3012. return result === HASH_UNDEFINED ? undefined : result;
  3013. }
  3014. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3015. }
  3016. /**
  3017. * Checks if a hash value for `key` exists.
  3018. *
  3019. * @private
  3020. * @name has
  3021. * @memberOf Hash
  3022. * @param {string} key The key of the entry to check.
  3023. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3024. */
  3025. function hashHas(key) {
  3026. var data = this.__data__;
  3027. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3028. }
  3029. /**
  3030. * Sets the hash `key` to `value`.
  3031. *
  3032. * @private
  3033. * @name set
  3034. * @memberOf Hash
  3035. * @param {string} key The key of the value to set.
  3036. * @param {*} value The value to set.
  3037. * @returns {Object} Returns the hash instance.
  3038. */
  3039. function hashSet(key, value) {
  3040. var data = this.__data__;
  3041. this.size += this.has(key) ? 0 : 1;
  3042. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3043. return this;
  3044. }
  3045. // Add methods to `Hash`.
  3046. Hash.prototype.clear = hashClear;
  3047. Hash.prototype['delete'] = hashDelete;
  3048. Hash.prototype.get = hashGet;
  3049. Hash.prototype.has = hashHas;
  3050. Hash.prototype.set = hashSet;
  3051. /*------------------------------------------------------------------------*/
  3052. /**
  3053. * Creates an list cache object.
  3054. *
  3055. * @private
  3056. * @constructor
  3057. * @param {Array} [entries] The key-value pairs to cache.
  3058. */
  3059. function ListCache(entries) {
  3060. var index = -1,
  3061. length = entries == null ? 0 : entries.length;
  3062. this.clear();
  3063. while (++index < length) {
  3064. var entry = entries[index];
  3065. this.set(entry[0], entry[1]);
  3066. }
  3067. }
  3068. /**
  3069. * Removes all key-value entries from the list cache.
  3070. *
  3071. * @private
  3072. * @name clear
  3073. * @memberOf ListCache
  3074. */
  3075. function listCacheClear() {
  3076. this.__data__ = [];
  3077. this.size = 0;
  3078. }
  3079. /**
  3080. * Removes `key` and its value from the list cache.
  3081. *
  3082. * @private
  3083. * @name delete
  3084. * @memberOf ListCache
  3085. * @param {string} key The key of the value to remove.
  3086. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3087. */
  3088. function listCacheDelete(key) {
  3089. var data = this.__data__,
  3090. index = assocIndexOf(data, key);
  3091. if (index < 0) {
  3092. return false;
  3093. }
  3094. var lastIndex = data.length - 1;
  3095. if (index == lastIndex) {
  3096. data.pop();
  3097. } else {
  3098. splice.call(data, index, 1);
  3099. }
  3100. --this.size;
  3101. return true;
  3102. }
  3103. /**
  3104. * Gets the list cache value for `key`.
  3105. *
  3106. * @private
  3107. * @name get
  3108. * @memberOf ListCache
  3109. * @param {string} key The key of the value to get.
  3110. * @returns {*} Returns the entry value.
  3111. */
  3112. function listCacheGet(key) {
  3113. var data = this.__data__,
  3114. index = assocIndexOf(data, key);
  3115. return index < 0 ? undefined : data[index][1];
  3116. }
  3117. /**
  3118. * Checks if a list cache value for `key` exists.
  3119. *
  3120. * @private
  3121. * @name has
  3122. * @memberOf ListCache
  3123. * @param {string} key The key of the entry to check.
  3124. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3125. */
  3126. function listCacheHas(key) {
  3127. return assocIndexOf(this.__data__, key) > -1;
  3128. }
  3129. /**
  3130. * Sets the list cache `key` to `value`.
  3131. *
  3132. * @private
  3133. * @name set
  3134. * @memberOf ListCache
  3135. * @param {string} key The key of the value to set.
  3136. * @param {*} value The value to set.
  3137. * @returns {Object} Returns the list cache instance.
  3138. */
  3139. function listCacheSet(key, value) {
  3140. var data = this.__data__,
  3141. index = assocIndexOf(data, key);
  3142. if (index < 0) {
  3143. ++this.size;
  3144. data.push([key, value]);
  3145. } else {
  3146. data[index][1] = value;
  3147. }
  3148. return this;
  3149. }
  3150. // Add methods to `ListCache`.
  3151. ListCache.prototype.clear = listCacheClear;
  3152. ListCache.prototype['delete'] = listCacheDelete;
  3153. ListCache.prototype.get = listCacheGet;
  3154. ListCache.prototype.has = listCacheHas;
  3155. ListCache.prototype.set = listCacheSet;
  3156. /*------------------------------------------------------------------------*/
  3157. /**
  3158. * Creates a map cache object to store key-value pairs.
  3159. *
  3160. * @private
  3161. * @constructor
  3162. * @param {Array} [entries] The key-value pairs to cache.
  3163. */
  3164. function MapCache(entries) {
  3165. var index = -1,
  3166. length = entries == null ? 0 : entries.length;
  3167. this.clear();
  3168. while (++index < length) {
  3169. var entry = entries[index];
  3170. this.set(entry[0], entry[1]);
  3171. }
  3172. }
  3173. /**
  3174. * Removes all key-value entries from the map.
  3175. *
  3176. * @private
  3177. * @name clear
  3178. * @memberOf MapCache
  3179. */
  3180. function mapCacheClear() {
  3181. this.size = 0;
  3182. this.__data__ = {
  3183. 'hash': new Hash,
  3184. 'map': new (Map || ListCache),
  3185. 'string': new Hash
  3186. };
  3187. }
  3188. /**
  3189. * Removes `key` and its value from the map.
  3190. *
  3191. * @private
  3192. * @name delete
  3193. * @memberOf MapCache
  3194. * @param {string} key The key of the value to remove.
  3195. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3196. */
  3197. function mapCacheDelete(key) {
  3198. var result = getMapData(this, key)['delete'](key);
  3199. this.size -= result ? 1 : 0;
  3200. return result;
  3201. }
  3202. /**
  3203. * Gets the map value for `key`.
  3204. *
  3205. * @private
  3206. * @name get
  3207. * @memberOf MapCache
  3208. * @param {string} key The key of the value to get.
  3209. * @returns {*} Returns the entry value.
  3210. */
  3211. function mapCacheGet(key) {
  3212. return getMapData(this, key).get(key);
  3213. }
  3214. /**
  3215. * Checks if a map value for `key` exists.
  3216. *
  3217. * @private
  3218. * @name has
  3219. * @memberOf MapCache
  3220. * @param {string} key The key of the entry to check.
  3221. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3222. */
  3223. function mapCacheHas(key) {
  3224. return getMapData(this, key).has(key);
  3225. }
  3226. /**
  3227. * Sets the map `key` to `value`.
  3228. *
  3229. * @private
  3230. * @name set
  3231. * @memberOf MapCache
  3232. * @param {string} key The key of the value to set.
  3233. * @param {*} value The value to set.
  3234. * @returns {Object} Returns the map cache instance.
  3235. */
  3236. function mapCacheSet(key, value) {
  3237. var data = getMapData(this, key),
  3238. size = data.size;
  3239. data.set(key, value);
  3240. this.size += data.size == size ? 0 : 1;
  3241. return this;
  3242. }
  3243. // Add methods to `MapCache`.
  3244. MapCache.prototype.clear = mapCacheClear;
  3245. MapCache.prototype['delete'] = mapCacheDelete;
  3246. MapCache.prototype.get = mapCacheGet;
  3247. MapCache.prototype.has = mapCacheHas;
  3248. MapCache.prototype.set = mapCacheSet;
  3249. /*------------------------------------------------------------------------*/
  3250. /**
  3251. *
  3252. * Creates an array cache object to store unique values.
  3253. *
  3254. * @private
  3255. * @constructor
  3256. * @param {Array} [values] The values to cache.
  3257. */
  3258. function SetCache(values) {
  3259. var index = -1,
  3260. length = values == null ? 0 : values.length;
  3261. this.__data__ = new MapCache;
  3262. while (++index < length) {
  3263. this.add(values[index]);
  3264. }
  3265. }
  3266. /**
  3267. * Adds `value` to the array cache.
  3268. *
  3269. * @private
  3270. * @name add
  3271. * @memberOf SetCache
  3272. * @alias push
  3273. * @param {*} value The value to cache.
  3274. * @returns {Object} Returns the cache instance.
  3275. */
  3276. function setCacheAdd(value) {
  3277. this.__data__.set(value, HASH_UNDEFINED);
  3278. return this;
  3279. }
  3280. /**
  3281. * Checks if `value` is in the array cache.
  3282. *
  3283. * @private
  3284. * @name has
  3285. * @memberOf SetCache
  3286. * @param {*} value The value to search for.
  3287. * @returns {number} Returns `true` if `value` is found, else `false`.
  3288. */
  3289. function setCacheHas(value) {
  3290. return this.__data__.has(value);
  3291. }
  3292. // Add methods to `SetCache`.
  3293. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3294. SetCache.prototype.has = setCacheHas;
  3295. /*------------------------------------------------------------------------*/
  3296. /**
  3297. * Creates a stack cache object to store key-value pairs.
  3298. *
  3299. * @private
  3300. * @constructor
  3301. * @param {Array} [entries] The key-value pairs to cache.
  3302. */
  3303. function Stack(entries) {
  3304. var data = this.__data__ = new ListCache(entries);
  3305. this.size = data.size;
  3306. }
  3307. /**
  3308. * Removes all key-value entries from the stack.
  3309. *
  3310. * @private
  3311. * @name clear
  3312. * @memberOf Stack
  3313. */
  3314. function stackClear() {
  3315. this.__data__ = new ListCache;
  3316. this.size = 0;
  3317. }
  3318. /**
  3319. * Removes `key` and its value from the stack.
  3320. *
  3321. * @private
  3322. * @name delete
  3323. * @memberOf Stack
  3324. * @param {string} key The key of the value to remove.
  3325. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3326. */
  3327. function stackDelete(key) {
  3328. var data = this.__data__,
  3329. result = data['delete'](key);
  3330. this.size = data.size;
  3331. return result;
  3332. }
  3333. /**
  3334. * Gets the stack value for `key`.
  3335. *
  3336. * @private
  3337. * @name get
  3338. * @memberOf Stack
  3339. * @param {string} key The key of the value to get.
  3340. * @returns {*} Returns the entry value.
  3341. */
  3342. function stackGet(key) {
  3343. return this.__data__.get(key);
  3344. }
  3345. /**
  3346. * Checks if a stack value for `key` exists.
  3347. *
  3348. * @private
  3349. * @name has
  3350. * @memberOf Stack
  3351. * @param {string} key The key of the entry to check.
  3352. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3353. */
  3354. function stackHas(key) {
  3355. return this.__data__.has(key);
  3356. }
  3357. /**
  3358. * Sets the stack `key` to `value`.
  3359. *
  3360. * @private
  3361. * @name set
  3362. * @memberOf Stack
  3363. * @param {string} key The key of the value to set.
  3364. * @param {*} value The value to set.
  3365. * @returns {Object} Returns the stack cache instance.
  3366. */
  3367. function stackSet(key, value) {
  3368. var data = this.__data__;
  3369. if (data instanceof ListCache) {
  3370. var pairs = data.__data__;
  3371. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3372. pairs.push([key, value]);
  3373. this.size = ++data.size;
  3374. return this;
  3375. }
  3376. data = this.__data__ = new MapCache(pairs);
  3377. }
  3378. data.set(key, value);
  3379. this.size = data.size;
  3380. return this;
  3381. }
  3382. // Add methods to `Stack`.
  3383. Stack.prototype.clear = stackClear;
  3384. Stack.prototype['delete'] = stackDelete;
  3385. Stack.prototype.get = stackGet;
  3386. Stack.prototype.has = stackHas;
  3387. Stack.prototype.set = stackSet;
  3388. /*------------------------------------------------------------------------*/
  3389. /**
  3390. * Creates an array of the enumerable property names of the array-like `value`.
  3391. *
  3392. * @private
  3393. * @param {*} value The value to query.
  3394. * @param {boolean} inherited Specify returning inherited property names.
  3395. * @returns {Array} Returns the array of property names.
  3396. */
  3397. function arrayLikeKeys(value, inherited) {
  3398. var isArr = isArray(value),
  3399. isArg = !isArr && isArguments(value),
  3400. isBuff = !isArr && !isArg && isBuffer(value),
  3401. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3402. skipIndexes = isArr || isArg || isBuff || isType,
  3403. result = skipIndexes ? baseTimes(value.length, String) : [],
  3404. length = result.length;
  3405. for (var key in value) {
  3406. if ((inherited || hasOwnProperty.call(value, key)) &&
  3407. !(skipIndexes && (
  3408. // Safari 9 has enumerable `arguments.length` in strict mode.
  3409. key == 'length' ||
  3410. // Node.js 0.10 has enumerable non-index properties on buffers.
  3411. (isBuff && (key == 'offset' || key == 'parent')) ||
  3412. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3413. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3414. // Skip index properties.
  3415. isIndex(key, length)
  3416. ))) {
  3417. result.push(key);
  3418. }
  3419. }
  3420. return result;
  3421. }
  3422. /**
  3423. * A specialized version of `_.sample` for arrays.
  3424. *
  3425. * @private
  3426. * @param {Array} array The array to sample.
  3427. * @returns {*} Returns the random element.
  3428. */
  3429. function arraySample(array) {
  3430. var length = array.length;
  3431. return length ? array[baseRandom(0, length - 1)] : undefined;
  3432. }
  3433. /**
  3434. * A specialized version of `_.sampleSize` for arrays.
  3435. *
  3436. * @private
  3437. * @param {Array} array The array to sample.
  3438. * @param {number} n The number of elements to sample.
  3439. * @returns {Array} Returns the random elements.
  3440. */
  3441. function arraySampleSize(array, n) {
  3442. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3443. }
  3444. /**
  3445. * A specialized version of `_.shuffle` for arrays.
  3446. *
  3447. * @private
  3448. * @param {Array} array The array to shuffle.
  3449. * @returns {Array} Returns the new shuffled array.
  3450. */
  3451. function arrayShuffle(array) {
  3452. return shuffleSelf(copyArray(array));
  3453. }
  3454. /**
  3455. * This function is like `assignValue` except that it doesn't assign
  3456. * `undefined` values.
  3457. *
  3458. * @private
  3459. * @param {Object} object The object to modify.
  3460. * @param {string} key The key of the property to assign.
  3461. * @param {*} value The value to assign.
  3462. */
  3463. function assignMergeValue(object, key, value) {
  3464. if ((value !== undefined && !eq(object[key], value)) ||
  3465. (value === undefined && !(key in object))) {
  3466. baseAssignValue(object, key, value);
  3467. }
  3468. }
  3469. /**
  3470. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3471. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3472. * for equality comparisons.
  3473. *
  3474. * @private
  3475. * @param {Object} object The object to modify.
  3476. * @param {string} key The key of the property to assign.
  3477. * @param {*} value The value to assign.
  3478. */
  3479. function assignValue(object, key, value) {
  3480. var objValue = object[key];
  3481. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3482. (value === undefined && !(key in object))) {
  3483. baseAssignValue(object, key, value);
  3484. }
  3485. }
  3486. /**
  3487. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3488. *
  3489. * @private
  3490. * @param {Array} array The array to inspect.
  3491. * @param {*} key The key to search for.
  3492. * @returns {number} Returns the index of the matched value, else `-1`.
  3493. */
  3494. function assocIndexOf(array, key) {
  3495. var length = array.length;
  3496. while (length--) {
  3497. if (eq(array[length][0], key)) {
  3498. return length;
  3499. }
  3500. }
  3501. return -1;
  3502. }
  3503. /**
  3504. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3505. * by `iteratee` and values set by `setter`.
  3506. *
  3507. * @private
  3508. * @param {Array|Object} collection The collection to iterate over.
  3509. * @param {Function} setter The function to set `accumulator` values.
  3510. * @param {Function} iteratee The iteratee to transform keys.
  3511. * @param {Object} accumulator The initial aggregated object.
  3512. * @returns {Function} Returns `accumulator`.
  3513. */
  3514. function baseAggregator(collection, setter, iteratee, accumulator) {
  3515. baseEach(collection, function(value, key, collection) {
  3516. setter(accumulator, value, iteratee(value), collection);
  3517. });
  3518. return accumulator;
  3519. }
  3520. /**
  3521. * The base implementation of `_.assign` without support for multiple sources
  3522. * or `customizer` functions.
  3523. *
  3524. * @private
  3525. * @param {Object} object The destination object.
  3526. * @param {Object} source The source object.
  3527. * @returns {Object} Returns `object`.
  3528. */
  3529. function baseAssign(object, source) {
  3530. return object && copyObject(source, keys(source), object);
  3531. }
  3532. /**
  3533. * The base implementation of `_.assignIn` without support for multiple sources
  3534. * or `customizer` functions.
  3535. *
  3536. * @private
  3537. * @param {Object} object The destination object.
  3538. * @param {Object} source The source object.
  3539. * @returns {Object} Returns `object`.
  3540. */
  3541. function baseAssignIn(object, source) {
  3542. return object && copyObject(source, keysIn(source), object);
  3543. }
  3544. /**
  3545. * The base implementation of `assignValue` and `assignMergeValue` without
  3546. * value checks.
  3547. *
  3548. * @private
  3549. * @param {Object} object The object to modify.
  3550. * @param {string} key The key of the property to assign.
  3551. * @param {*} value The value to assign.
  3552. */
  3553. function baseAssignValue(object, key, value) {
  3554. if (key == '__proto__' && defineProperty) {
  3555. defineProperty(object, key, {
  3556. 'configurable': true,
  3557. 'enumerable': true,
  3558. 'value': value,
  3559. 'writable': true
  3560. });
  3561. } else {
  3562. object[key] = value;
  3563. }
  3564. }
  3565. /**
  3566. * The base implementation of `_.at` without support for individual paths.
  3567. *
  3568. * @private
  3569. * @param {Object} object The object to iterate over.
  3570. * @param {string[]} paths The property paths to pick.
  3571. * @returns {Array} Returns the picked elements.
  3572. */
  3573. function baseAt(object, paths) {
  3574. var index = -1,
  3575. length = paths.length,
  3576. result = Array(length),
  3577. skip = object == null;
  3578. while (++index < length) {
  3579. result[index] = skip ? undefined : get(object, paths[index]);
  3580. }
  3581. return result;
  3582. }
  3583. /**
  3584. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3585. *
  3586. * @private
  3587. * @param {number} number The number to clamp.
  3588. * @param {number} [lower] The lower bound.
  3589. * @param {number} upper The upper bound.
  3590. * @returns {number} Returns the clamped number.
  3591. */
  3592. function baseClamp(number, lower, upper) {
  3593. if (number === number) {
  3594. if (upper !== undefined) {
  3595. number = number <= upper ? number : upper;
  3596. }
  3597. if (lower !== undefined) {
  3598. number = number >= lower ? number : lower;
  3599. }
  3600. }
  3601. return number;
  3602. }
  3603. /**
  3604. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3605. * traversed objects.
  3606. *
  3607. * @private
  3608. * @param {*} value The value to clone.
  3609. * @param {boolean} bitmask The bitmask flags.
  3610. * 1 - Deep clone
  3611. * 2 - Flatten inherited properties
  3612. * 4 - Clone symbols
  3613. * @param {Function} [customizer] The function to customize cloning.
  3614. * @param {string} [key] The key of `value`.
  3615. * @param {Object} [object] The parent object of `value`.
  3616. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3617. * @returns {*} Returns the cloned value.
  3618. */
  3619. function baseClone(value, bitmask, customizer, key, object, stack) {
  3620. var result,
  3621. isDeep = bitmask & CLONE_DEEP_FLAG,
  3622. isFlat = bitmask & CLONE_FLAT_FLAG,
  3623. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3624. if (customizer) {
  3625. result = object ? customizer(value, key, object, stack) : customizer(value);
  3626. }
  3627. if (result !== undefined) {
  3628. return result;
  3629. }
  3630. if (!isObject(value)) {
  3631. return value;
  3632. }
  3633. var isArr = isArray(value);
  3634. if (isArr) {
  3635. result = initCloneArray(value);
  3636. if (!isDeep) {
  3637. return copyArray(value, result);
  3638. }
  3639. } else {
  3640. var tag = getTag(value),
  3641. isFunc = tag == funcTag || tag == genTag;
  3642. if (isBuffer(value)) {
  3643. return cloneBuffer(value, isDeep);
  3644. }
  3645. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3646. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3647. if (!isDeep) {
  3648. return isFlat
  3649. ? copySymbolsIn(value, baseAssignIn(result, value))
  3650. : copySymbols(value, baseAssign(result, value));
  3651. }
  3652. } else {
  3653. if (!cloneableTags[tag]) {
  3654. return object ? value : {};
  3655. }
  3656. result = initCloneByTag(value, tag, isDeep);
  3657. }
  3658. }
  3659. // Check for circular references and return its corresponding clone.
  3660. stack || (stack = new Stack);
  3661. var stacked = stack.get(value);
  3662. if (stacked) {
  3663. return stacked;
  3664. }
  3665. stack.set(value, result);
  3666. if (isSet(value)) {
  3667. value.forEach(function(subValue) {
  3668. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3669. });
  3670. } else if (isMap(value)) {
  3671. value.forEach(function(subValue, key) {
  3672. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3673. });
  3674. }
  3675. var keysFunc = isFull
  3676. ? (isFlat ? getAllKeysIn : getAllKeys)
  3677. : (isFlat ? keysIn : keys);
  3678. var props = isArr ? undefined : keysFunc(value);
  3679. arrayEach(props || value, function(subValue, key) {
  3680. if (props) {
  3681. key = subValue;
  3682. subValue = value[key];
  3683. }
  3684. // Recursively populate clone (susceptible to call stack limits).
  3685. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3686. });
  3687. return result;
  3688. }
  3689. /**
  3690. * The base implementation of `_.conforms` which doesn't clone `source`.
  3691. *
  3692. * @private
  3693. * @param {Object} source The object of property predicates to conform to.
  3694. * @returns {Function} Returns the new spec function.
  3695. */
  3696. function baseConforms(source) {
  3697. var props = keys(source);
  3698. return function(object) {
  3699. return baseConformsTo(object, source, props);
  3700. };
  3701. }
  3702. /**
  3703. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3704. *
  3705. * @private
  3706. * @param {Object} object The object to inspect.
  3707. * @param {Object} source The object of property predicates to conform to.
  3708. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3709. */
  3710. function baseConformsTo(object, source, props) {
  3711. var length = props.length;
  3712. if (object == null) {
  3713. return !length;
  3714. }
  3715. object = Object(object);
  3716. while (length--) {
  3717. var key = props[length],
  3718. predicate = source[key],
  3719. value = object[key];
  3720. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3721. return false;
  3722. }
  3723. }
  3724. return true;
  3725. }
  3726. /**
  3727. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3728. * to provide to `func`.
  3729. *
  3730. * @private
  3731. * @param {Function} func The function to delay.
  3732. * @param {number} wait The number of milliseconds to delay invocation.
  3733. * @param {Array} args The arguments to provide to `func`.
  3734. * @returns {number|Object} Returns the timer id or timeout object.
  3735. */
  3736. function baseDelay(func, wait, args) {
  3737. if (typeof func != 'function') {
  3738. throw new TypeError(FUNC_ERROR_TEXT);
  3739. }
  3740. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3741. }
  3742. /**
  3743. * The base implementation of methods like `_.difference` without support
  3744. * for excluding multiple arrays or iteratee shorthands.
  3745. *
  3746. * @private
  3747. * @param {Array} array The array to inspect.
  3748. * @param {Array} values The values to exclude.
  3749. * @param {Function} [iteratee] The iteratee invoked per element.
  3750. * @param {Function} [comparator] The comparator invoked per element.
  3751. * @returns {Array} Returns the new array of filtered values.
  3752. */
  3753. function baseDifference(array, values, iteratee, comparator) {
  3754. var index = -1,
  3755. includes = arrayIncludes,
  3756. isCommon = true,
  3757. length = array.length,
  3758. result = [],
  3759. valuesLength = values.length;
  3760. if (!length) {
  3761. return result;
  3762. }
  3763. if (iteratee) {
  3764. values = arrayMap(values, baseUnary(iteratee));
  3765. }
  3766. if (comparator) {
  3767. includes = arrayIncludesWith;
  3768. isCommon = false;
  3769. }
  3770. else if (values.length >= LARGE_ARRAY_SIZE) {
  3771. includes = cacheHas;
  3772. isCommon = false;
  3773. values = new SetCache(values);
  3774. }
  3775. outer:
  3776. while (++index < length) {
  3777. var value = array[index],
  3778. computed = iteratee == null ? value : iteratee(value);
  3779. value = (comparator || value !== 0) ? value : 0;
  3780. if (isCommon && computed === computed) {
  3781. var valuesIndex = valuesLength;
  3782. while (valuesIndex--) {
  3783. if (values[valuesIndex] === computed) {
  3784. continue outer;
  3785. }
  3786. }
  3787. result.push(value);
  3788. }
  3789. else if (!includes(values, computed, comparator)) {
  3790. result.push(value);
  3791. }
  3792. }
  3793. return result;
  3794. }
  3795. /**
  3796. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3797. *
  3798. * @private
  3799. * @param {Array|Object} collection The collection to iterate over.
  3800. * @param {Function} iteratee The function invoked per iteration.
  3801. * @returns {Array|Object} Returns `collection`.
  3802. */
  3803. var baseEach = createBaseEach(baseForOwn);
  3804. /**
  3805. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3806. *
  3807. * @private
  3808. * @param {Array|Object} collection The collection to iterate over.
  3809. * @param {Function} iteratee The function invoked per iteration.
  3810. * @returns {Array|Object} Returns `collection`.
  3811. */
  3812. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3813. /**
  3814. * The base implementation of `_.every` without support for iteratee shorthands.
  3815. *
  3816. * @private
  3817. * @param {Array|Object} collection The collection to iterate over.
  3818. * @param {Function} predicate The function invoked per iteration.
  3819. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3820. * else `false`
  3821. */
  3822. function baseEvery(collection, predicate) {
  3823. var result = true;
  3824. baseEach(collection, function(value, index, collection) {
  3825. result = !!predicate(value, index, collection);
  3826. return result;
  3827. });
  3828. return result;
  3829. }
  3830. /**
  3831. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3832. * `comparator` to determine the extremum value.
  3833. *
  3834. * @private
  3835. * @param {Array} array The array to iterate over.
  3836. * @param {Function} iteratee The iteratee invoked per iteration.
  3837. * @param {Function} comparator The comparator used to compare values.
  3838. * @returns {*} Returns the extremum value.
  3839. */
  3840. function baseExtremum(array, iteratee, comparator) {
  3841. var index = -1,
  3842. length = array.length;
  3843. while (++index < length) {
  3844. var value = array[index],
  3845. current = iteratee(value);
  3846. if (current != null && (computed === undefined
  3847. ? (current === current && !isSymbol(current))
  3848. : comparator(current, computed)
  3849. )) {
  3850. var computed = current,
  3851. result = value;
  3852. }
  3853. }
  3854. return result;
  3855. }
  3856. /**
  3857. * The base implementation of `_.fill` without an iteratee call guard.
  3858. *
  3859. * @private
  3860. * @param {Array} array The array to fill.
  3861. * @param {*} value The value to fill `array` with.
  3862. * @param {number} [start=0] The start position.
  3863. * @param {number} [end=array.length] The end position.
  3864. * @returns {Array} Returns `array`.
  3865. */
  3866. function baseFill(array, value, start, end) {
  3867. var length = array.length;
  3868. start = toInteger(start);
  3869. if (start < 0) {
  3870. start = -start > length ? 0 : (length + start);
  3871. }
  3872. end = (end === undefined || end > length) ? length : toInteger(end);
  3873. if (end < 0) {
  3874. end += length;
  3875. }
  3876. end = start > end ? 0 : toLength(end);
  3877. while (start < end) {
  3878. array[start++] = value;
  3879. }
  3880. return array;
  3881. }
  3882. /**
  3883. * The base implementation of `_.filter` without support for iteratee shorthands.
  3884. *
  3885. * @private
  3886. * @param {Array|Object} collection The collection to iterate over.
  3887. * @param {Function} predicate The function invoked per iteration.
  3888. * @returns {Array} Returns the new filtered array.
  3889. */
  3890. function baseFilter(collection, predicate) {
  3891. var result = [];
  3892. baseEach(collection, function(value, index, collection) {
  3893. if (predicate(value, index, collection)) {
  3894. result.push(value);
  3895. }
  3896. });
  3897. return result;
  3898. }
  3899. /**
  3900. * The base implementation of `_.flatten` with support for restricting flattening.
  3901. *
  3902. * @private
  3903. * @param {Array} array The array to flatten.
  3904. * @param {number} depth The maximum recursion depth.
  3905. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3906. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3907. * @param {Array} [result=[]] The initial result value.
  3908. * @returns {Array} Returns the new flattened array.
  3909. */
  3910. function baseFlatten(array, depth, predicate, isStrict, result) {
  3911. var index = -1,
  3912. length = array.length;
  3913. predicate || (predicate = isFlattenable);
  3914. result || (result = []);
  3915. while (++index < length) {
  3916. var value = array[index];
  3917. if (depth > 0 && predicate(value)) {
  3918. if (depth > 1) {
  3919. // Recursively flatten arrays (susceptible to call stack limits).
  3920. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3921. } else {
  3922. arrayPush(result, value);
  3923. }
  3924. } else if (!isStrict) {
  3925. result[result.length] = value;
  3926. }
  3927. }
  3928. return result;
  3929. }
  3930. /**
  3931. * The base implementation of `baseForOwn` which iterates over `object`
  3932. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3933. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3934. *
  3935. * @private
  3936. * @param {Object} object The object to iterate over.
  3937. * @param {Function} iteratee The function invoked per iteration.
  3938. * @param {Function} keysFunc The function to get the keys of `object`.
  3939. * @returns {Object} Returns `object`.
  3940. */
  3941. var baseFor = createBaseFor();
  3942. /**
  3943. * This function is like `baseFor` except that it iterates over properties
  3944. * in the opposite order.
  3945. *
  3946. * @private
  3947. * @param {Object} object The object to iterate over.
  3948. * @param {Function} iteratee The function invoked per iteration.
  3949. * @param {Function} keysFunc The function to get the keys of `object`.
  3950. * @returns {Object} Returns `object`.
  3951. */
  3952. var baseForRight = createBaseFor(true);
  3953. /**
  3954. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3955. *
  3956. * @private
  3957. * @param {Object} object The object to iterate over.
  3958. * @param {Function} iteratee The function invoked per iteration.
  3959. * @returns {Object} Returns `object`.
  3960. */
  3961. function baseForOwn(object, iteratee) {
  3962. return object && baseFor(object, iteratee, keys);
  3963. }
  3964. /**
  3965. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3966. *
  3967. * @private
  3968. * @param {Object} object The object to iterate over.
  3969. * @param {Function} iteratee The function invoked per iteration.
  3970. * @returns {Object} Returns `object`.
  3971. */
  3972. function baseForOwnRight(object, iteratee) {
  3973. return object && baseForRight(object, iteratee, keys);
  3974. }
  3975. /**
  3976. * The base implementation of `_.functions` which creates an array of
  3977. * `object` function property names filtered from `props`.
  3978. *
  3979. * @private
  3980. * @param {Object} object The object to inspect.
  3981. * @param {Array} props The property names to filter.
  3982. * @returns {Array} Returns the function names.
  3983. */
  3984. function baseFunctions(object, props) {
  3985. return arrayFilter(props, function(key) {
  3986. return isFunction(object[key]);
  3987. });
  3988. }
  3989. /**
  3990. * The base implementation of `_.get` without support for default values.
  3991. *
  3992. * @private
  3993. * @param {Object} object The object to query.
  3994. * @param {Array|string} path The path of the property to get.
  3995. * @returns {*} Returns the resolved value.
  3996. */
  3997. function baseGet(object, path) {
  3998. path = castPath(path, object);
  3999. var index = 0,
  4000. length = path.length;
  4001. while (object != null && index < length) {
  4002. object = object[toKey(path[index++])];
  4003. }
  4004. return (index && index == length) ? object : undefined;
  4005. }
  4006. /**
  4007. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4008. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4009. * symbols of `object`.
  4010. *
  4011. * @private
  4012. * @param {Object} object The object to query.
  4013. * @param {Function} keysFunc The function to get the keys of `object`.
  4014. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4015. * @returns {Array} Returns the array of property names and symbols.
  4016. */
  4017. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4018. var result = keysFunc(object);
  4019. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4020. }
  4021. /**
  4022. * The base implementation of `getTag` without fallbacks for buggy environments.
  4023. *
  4024. * @private
  4025. * @param {*} value The value to query.
  4026. * @returns {string} Returns the `toStringTag`.
  4027. */
  4028. function baseGetTag(value) {
  4029. if (value == null) {
  4030. return value === undefined ? undefinedTag : nullTag;
  4031. }
  4032. return (symToStringTag && symToStringTag in Object(value))
  4033. ? getRawTag(value)
  4034. : objectToString(value);
  4035. }
  4036. /**
  4037. * The base implementation of `_.gt` which doesn't coerce arguments.
  4038. *
  4039. * @private
  4040. * @param {*} value The value to compare.
  4041. * @param {*} other The other value to compare.
  4042. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4043. * else `false`.
  4044. */
  4045. function baseGt(value, other) {
  4046. return value > other;
  4047. }
  4048. /**
  4049. * The base implementation of `_.has` without support for deep paths.
  4050. *
  4051. * @private
  4052. * @param {Object} [object] The object to query.
  4053. * @param {Array|string} key The key to check.
  4054. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4055. */
  4056. function baseHas(object, key) {
  4057. return object != null && hasOwnProperty.call(object, key);
  4058. }
  4059. /**
  4060. * The base implementation of `_.hasIn` without support for deep paths.
  4061. *
  4062. * @private
  4063. * @param {Object} [object] The object to query.
  4064. * @param {Array|string} key The key to check.
  4065. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4066. */
  4067. function baseHasIn(object, key) {
  4068. return object != null && key in Object(object);
  4069. }
  4070. /**
  4071. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4072. *
  4073. * @private
  4074. * @param {number} number The number to check.
  4075. * @param {number} start The start of the range.
  4076. * @param {number} end The end of the range.
  4077. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4078. */
  4079. function baseInRange(number, start, end) {
  4080. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4081. }
  4082. /**
  4083. * The base implementation of methods like `_.intersection`, without support
  4084. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4085. *
  4086. * @private
  4087. * @param {Array} arrays The arrays to inspect.
  4088. * @param {Function} [iteratee] The iteratee invoked per element.
  4089. * @param {Function} [comparator] The comparator invoked per element.
  4090. * @returns {Array} Returns the new array of shared values.
  4091. */
  4092. function baseIntersection(arrays, iteratee, comparator) {
  4093. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4094. length = arrays[0].length,
  4095. othLength = arrays.length,
  4096. othIndex = othLength,
  4097. caches = Array(othLength),
  4098. maxLength = Infinity,
  4099. result = [];
  4100. while (othIndex--) {
  4101. var array = arrays[othIndex];
  4102. if (othIndex && iteratee) {
  4103. array = arrayMap(array, baseUnary(iteratee));
  4104. }
  4105. maxLength = nativeMin(array.length, maxLength);
  4106. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4107. ? new SetCache(othIndex && array)
  4108. : undefined;
  4109. }
  4110. array = arrays[0];
  4111. var index = -1,
  4112. seen = caches[0];
  4113. outer:
  4114. while (++index < length && result.length < maxLength) {
  4115. var value = array[index],
  4116. computed = iteratee ? iteratee(value) : value;
  4117. value = (comparator || value !== 0) ? value : 0;
  4118. if (!(seen
  4119. ? cacheHas(seen, computed)
  4120. : includes(result, computed, comparator)
  4121. )) {
  4122. othIndex = othLength;
  4123. while (--othIndex) {
  4124. var cache = caches[othIndex];
  4125. if (!(cache
  4126. ? cacheHas(cache, computed)
  4127. : includes(arrays[othIndex], computed, comparator))
  4128. ) {
  4129. continue outer;
  4130. }
  4131. }
  4132. if (seen) {
  4133. seen.push(computed);
  4134. }
  4135. result.push(value);
  4136. }
  4137. }
  4138. return result;
  4139. }
  4140. /**
  4141. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4142. * `object` with values transformed by `iteratee` and set by `setter`.
  4143. *
  4144. * @private
  4145. * @param {Object} object The object to iterate over.
  4146. * @param {Function} setter The function to set `accumulator` values.
  4147. * @param {Function} iteratee The iteratee to transform values.
  4148. * @param {Object} accumulator The initial inverted object.
  4149. * @returns {Function} Returns `accumulator`.
  4150. */
  4151. function baseInverter(object, setter, iteratee, accumulator) {
  4152. baseForOwn(object, function(value, key, object) {
  4153. setter(accumulator, iteratee(value), key, object);
  4154. });
  4155. return accumulator;
  4156. }
  4157. /**
  4158. * The base implementation of `_.invoke` without support for individual
  4159. * method arguments.
  4160. *
  4161. * @private
  4162. * @param {Object} object The object to query.
  4163. * @param {Array|string} path The path of the method to invoke.
  4164. * @param {Array} args The arguments to invoke the method with.
  4165. * @returns {*} Returns the result of the invoked method.
  4166. */
  4167. function baseInvoke(object, path, args) {
  4168. path = castPath(path, object);
  4169. object = parent(object, path);
  4170. var func = object == null ? object : object[toKey(last(path))];
  4171. return func == null ? undefined : apply(func, object, args);
  4172. }
  4173. /**
  4174. * The base implementation of `_.isArguments`.
  4175. *
  4176. * @private
  4177. * @param {*} value The value to check.
  4178. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4179. */
  4180. function baseIsArguments(value) {
  4181. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4182. }
  4183. /**
  4184. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4185. *
  4186. * @private
  4187. * @param {*} value The value to check.
  4188. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4189. */
  4190. function baseIsArrayBuffer(value) {
  4191. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4192. }
  4193. /**
  4194. * The base implementation of `_.isDate` without Node.js optimizations.
  4195. *
  4196. * @private
  4197. * @param {*} value The value to check.
  4198. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4199. */
  4200. function baseIsDate(value) {
  4201. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4202. }
  4203. /**
  4204. * The base implementation of `_.isEqual` which supports partial comparisons
  4205. * and tracks traversed objects.
  4206. *
  4207. * @private
  4208. * @param {*} value The value to compare.
  4209. * @param {*} other The other value to compare.
  4210. * @param {boolean} bitmask The bitmask flags.
  4211. * 1 - Unordered comparison
  4212. * 2 - Partial comparison
  4213. * @param {Function} [customizer] The function to customize comparisons.
  4214. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4215. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4216. */
  4217. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4218. if (value === other) {
  4219. return true;
  4220. }
  4221. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4222. return value !== value && other !== other;
  4223. }
  4224. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4225. }
  4226. /**
  4227. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4228. * deep comparisons and tracks traversed objects enabling objects with circular
  4229. * references to be compared.
  4230. *
  4231. * @private
  4232. * @param {Object} object The object to compare.
  4233. * @param {Object} other The other object to compare.
  4234. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4235. * @param {Function} customizer The function to customize comparisons.
  4236. * @param {Function} equalFunc The function to determine equivalents of values.
  4237. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4238. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4239. */
  4240. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4241. var objIsArr = isArray(object),
  4242. othIsArr = isArray(other),
  4243. objTag = objIsArr ? arrayTag : getTag(object),
  4244. othTag = othIsArr ? arrayTag : getTag(other);
  4245. objTag = objTag == argsTag ? objectTag : objTag;
  4246. othTag = othTag == argsTag ? objectTag : othTag;
  4247. var objIsObj = objTag == objectTag,
  4248. othIsObj = othTag == objectTag,
  4249. isSameTag = objTag == othTag;
  4250. if (isSameTag && isBuffer(object)) {
  4251. if (!isBuffer(other)) {
  4252. return false;
  4253. }
  4254. objIsArr = true;
  4255. objIsObj = false;
  4256. }
  4257. if (isSameTag && !objIsObj) {
  4258. stack || (stack = new Stack);
  4259. return (objIsArr || isTypedArray(object))
  4260. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4261. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4262. }
  4263. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4264. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4265. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4266. if (objIsWrapped || othIsWrapped) {
  4267. var objUnwrapped = objIsWrapped ? object.value() : object,
  4268. othUnwrapped = othIsWrapped ? other.value() : other;
  4269. stack || (stack = new Stack);
  4270. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4271. }
  4272. }
  4273. if (!isSameTag) {
  4274. return false;
  4275. }
  4276. stack || (stack = new Stack);
  4277. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4278. }
  4279. /**
  4280. * The base implementation of `_.isMap` without Node.js optimizations.
  4281. *
  4282. * @private
  4283. * @param {*} value The value to check.
  4284. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4285. */
  4286. function baseIsMap(value) {
  4287. return isObjectLike(value) && getTag(value) == mapTag;
  4288. }
  4289. /**
  4290. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4291. *
  4292. * @private
  4293. * @param {Object} object The object to inspect.
  4294. * @param {Object} source The object of property values to match.
  4295. * @param {Array} matchData The property names, values, and compare flags to match.
  4296. * @param {Function} [customizer] The function to customize comparisons.
  4297. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4298. */
  4299. function baseIsMatch(object, source, matchData, customizer) {
  4300. var index = matchData.length,
  4301. length = index,
  4302. noCustomizer = !customizer;
  4303. if (object == null) {
  4304. return !length;
  4305. }
  4306. object = Object(object);
  4307. while (index--) {
  4308. var data = matchData[index];
  4309. if ((noCustomizer && data[2])
  4310. ? data[1] !== object[data[0]]
  4311. : !(data[0] in object)
  4312. ) {
  4313. return false;
  4314. }
  4315. }
  4316. while (++index < length) {
  4317. data = matchData[index];
  4318. var key = data[0],
  4319. objValue = object[key],
  4320. srcValue = data[1];
  4321. if (noCustomizer && data[2]) {
  4322. if (objValue === undefined && !(key in object)) {
  4323. return false;
  4324. }
  4325. } else {
  4326. var stack = new Stack;
  4327. if (customizer) {
  4328. var result = customizer(objValue, srcValue, key, object, source, stack);
  4329. }
  4330. if (!(result === undefined
  4331. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4332. : result
  4333. )) {
  4334. return false;
  4335. }
  4336. }
  4337. }
  4338. return true;
  4339. }
  4340. /**
  4341. * The base implementation of `_.isNative` without bad shim checks.
  4342. *
  4343. * @private
  4344. * @param {*} value The value to check.
  4345. * @returns {boolean} Returns `true` if `value` is a native function,
  4346. * else `false`.
  4347. */
  4348. function baseIsNative(value) {
  4349. if (!isObject(value) || isMasked(value)) {
  4350. return false;
  4351. }
  4352. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4353. return pattern.test(toSource(value));
  4354. }
  4355. /**
  4356. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4357. *
  4358. * @private
  4359. * @param {*} value The value to check.
  4360. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4361. */
  4362. function baseIsRegExp(value) {
  4363. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4364. }
  4365. /**
  4366. * The base implementation of `_.isSet` without Node.js optimizations.
  4367. *
  4368. * @private
  4369. * @param {*} value The value to check.
  4370. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4371. */
  4372. function baseIsSet(value) {
  4373. return isObjectLike(value) && getTag(value) == setTag;
  4374. }
  4375. /**
  4376. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4377. *
  4378. * @private
  4379. * @param {*} value The value to check.
  4380. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4381. */
  4382. function baseIsTypedArray(value) {
  4383. return isObjectLike(value) &&
  4384. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4385. }
  4386. /**
  4387. * The base implementation of `_.iteratee`.
  4388. *
  4389. * @private
  4390. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4391. * @returns {Function} Returns the iteratee.
  4392. */
  4393. function baseIteratee(value) {
  4394. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4395. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4396. if (typeof value == 'function') {
  4397. return value;
  4398. }
  4399. if (value == null) {
  4400. return identity;
  4401. }
  4402. if (typeof value == 'object') {
  4403. return isArray(value)
  4404. ? baseMatchesProperty(value[0], value[1])
  4405. : baseMatches(value);
  4406. }
  4407. return property(value);
  4408. }
  4409. /**
  4410. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4411. *
  4412. * @private
  4413. * @param {Object} object The object to query.
  4414. * @returns {Array} Returns the array of property names.
  4415. */
  4416. function baseKeys(object) {
  4417. if (!isPrototype(object)) {
  4418. return nativeKeys(object);
  4419. }
  4420. var result = [];
  4421. for (var key in Object(object)) {
  4422. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4423. result.push(key);
  4424. }
  4425. }
  4426. return result;
  4427. }
  4428. /**
  4429. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4430. *
  4431. * @private
  4432. * @param {Object} object The object to query.
  4433. * @returns {Array} Returns the array of property names.
  4434. */
  4435. function baseKeysIn(object) {
  4436. if (!isObject(object)) {
  4437. return nativeKeysIn(object);
  4438. }
  4439. var isProto = isPrototype(object),
  4440. result = [];
  4441. for (var key in object) {
  4442. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4443. result.push(key);
  4444. }
  4445. }
  4446. return result;
  4447. }
  4448. /**
  4449. * The base implementation of `_.lt` which doesn't coerce arguments.
  4450. *
  4451. * @private
  4452. * @param {*} value The value to compare.
  4453. * @param {*} other The other value to compare.
  4454. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4455. * else `false`.
  4456. */
  4457. function baseLt(value, other) {
  4458. return value < other;
  4459. }
  4460. /**
  4461. * The base implementation of `_.map` without support for iteratee shorthands.
  4462. *
  4463. * @private
  4464. * @param {Array|Object} collection The collection to iterate over.
  4465. * @param {Function} iteratee The function invoked per iteration.
  4466. * @returns {Array} Returns the new mapped array.
  4467. */
  4468. function baseMap(collection, iteratee) {
  4469. var index = -1,
  4470. result = isArrayLike(collection) ? Array(collection.length) : [];
  4471. baseEach(collection, function(value, key, collection) {
  4472. result[++index] = iteratee(value, key, collection);
  4473. });
  4474. return result;
  4475. }
  4476. /**
  4477. * The base implementation of `_.matches` which doesn't clone `source`.
  4478. *
  4479. * @private
  4480. * @param {Object} source The object of property values to match.
  4481. * @returns {Function} Returns the new spec function.
  4482. */
  4483. function baseMatches(source) {
  4484. var matchData = getMatchData(source);
  4485. if (matchData.length == 1 && matchData[0][2]) {
  4486. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4487. }
  4488. return function(object) {
  4489. return object === source || baseIsMatch(object, source, matchData);
  4490. };
  4491. }
  4492. /**
  4493. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4494. *
  4495. * @private
  4496. * @param {string} path The path of the property to get.
  4497. * @param {*} srcValue The value to match.
  4498. * @returns {Function} Returns the new spec function.
  4499. */
  4500. function baseMatchesProperty(path, srcValue) {
  4501. if (isKey(path) && isStrictComparable(srcValue)) {
  4502. return matchesStrictComparable(toKey(path), srcValue);
  4503. }
  4504. return function(object) {
  4505. var objValue = get(object, path);
  4506. return (objValue === undefined && objValue === srcValue)
  4507. ? hasIn(object, path)
  4508. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4509. };
  4510. }
  4511. /**
  4512. * The base implementation of `_.merge` without support for multiple sources.
  4513. *
  4514. * @private
  4515. * @param {Object} object The destination object.
  4516. * @param {Object} source The source object.
  4517. * @param {number} srcIndex The index of `source`.
  4518. * @param {Function} [customizer] The function to customize merged values.
  4519. * @param {Object} [stack] Tracks traversed source values and their merged
  4520. * counterparts.
  4521. */
  4522. function baseMerge(object, source, srcIndex, customizer, stack) {
  4523. if (object === source) {
  4524. return;
  4525. }
  4526. baseFor(source, function(srcValue, key) {
  4527. stack || (stack = new Stack);
  4528. if (isObject(srcValue)) {
  4529. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4530. }
  4531. else {
  4532. var newValue = customizer
  4533. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4534. : undefined;
  4535. if (newValue === undefined) {
  4536. newValue = srcValue;
  4537. }
  4538. assignMergeValue(object, key, newValue);
  4539. }
  4540. }, keysIn);
  4541. }
  4542. /**
  4543. * A specialized version of `baseMerge` for arrays and objects which performs
  4544. * deep merges and tracks traversed objects enabling objects with circular
  4545. * references to be merged.
  4546. *
  4547. * @private
  4548. * @param {Object} object The destination object.
  4549. * @param {Object} source The source object.
  4550. * @param {string} key The key of the value to merge.
  4551. * @param {number} srcIndex The index of `source`.
  4552. * @param {Function} mergeFunc The function to merge values.
  4553. * @param {Function} [customizer] The function to customize assigned values.
  4554. * @param {Object} [stack] Tracks traversed source values and their merged
  4555. * counterparts.
  4556. */
  4557. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4558. var objValue = safeGet(object, key),
  4559. srcValue = safeGet(source, key),
  4560. stacked = stack.get(srcValue);
  4561. if (stacked) {
  4562. assignMergeValue(object, key, stacked);
  4563. return;
  4564. }
  4565. var newValue = customizer
  4566. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4567. : undefined;
  4568. var isCommon = newValue === undefined;
  4569. if (isCommon) {
  4570. var isArr = isArray(srcValue),
  4571. isBuff = !isArr && isBuffer(srcValue),
  4572. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4573. newValue = srcValue;
  4574. if (isArr || isBuff || isTyped) {
  4575. if (isArray(objValue)) {
  4576. newValue = objValue;
  4577. }
  4578. else if (isArrayLikeObject(objValue)) {
  4579. newValue = copyArray(objValue);
  4580. }
  4581. else if (isBuff) {
  4582. isCommon = false;
  4583. newValue = cloneBuffer(srcValue, true);
  4584. }
  4585. else if (isTyped) {
  4586. isCommon = false;
  4587. newValue = cloneTypedArray(srcValue, true);
  4588. }
  4589. else {
  4590. newValue = [];
  4591. }
  4592. }
  4593. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4594. newValue = objValue;
  4595. if (isArguments(objValue)) {
  4596. newValue = toPlainObject(objValue);
  4597. }
  4598. else if (!isObject(objValue) || isFunction(objValue)) {
  4599. newValue = initCloneObject(srcValue);
  4600. }
  4601. }
  4602. else {
  4603. isCommon = false;
  4604. }
  4605. }
  4606. if (isCommon) {
  4607. // Recursively merge objects and arrays (susceptible to call stack limits).
  4608. stack.set(srcValue, newValue);
  4609. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4610. stack['delete'](srcValue);
  4611. }
  4612. assignMergeValue(object, key, newValue);
  4613. }
  4614. /**
  4615. * The base implementation of `_.nth` which doesn't coerce arguments.
  4616. *
  4617. * @private
  4618. * @param {Array} array The array to query.
  4619. * @param {number} n The index of the element to return.
  4620. * @returns {*} Returns the nth element of `array`.
  4621. */
  4622. function baseNth(array, n) {
  4623. var length = array.length;
  4624. if (!length) {
  4625. return;
  4626. }
  4627. n += n < 0 ? length : 0;
  4628. return isIndex(n, length) ? array[n] : undefined;
  4629. }
  4630. /**
  4631. * The base implementation of `_.orderBy` without param guards.
  4632. *
  4633. * @private
  4634. * @param {Array|Object} collection The collection to iterate over.
  4635. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4636. * @param {string[]} orders The sort orders of `iteratees`.
  4637. * @returns {Array} Returns the new sorted array.
  4638. */
  4639. function baseOrderBy(collection, iteratees, orders) {
  4640. if (iteratees.length) {
  4641. iteratees = arrayMap(iteratees, function(iteratee) {
  4642. if (isArray(iteratee)) {
  4643. return function(value) {
  4644. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4645. }
  4646. }
  4647. return iteratee;
  4648. });
  4649. } else {
  4650. iteratees = [identity];
  4651. }
  4652. var index = -1;
  4653. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4654. var result = baseMap(collection, function(value, key, collection) {
  4655. var criteria = arrayMap(iteratees, function(iteratee) {
  4656. return iteratee(value);
  4657. });
  4658. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4659. });
  4660. return baseSortBy(result, function(object, other) {
  4661. return compareMultiple(object, other, orders);
  4662. });
  4663. }
  4664. /**
  4665. * The base implementation of `_.pick` without support for individual
  4666. * property identifiers.
  4667. *
  4668. * @private
  4669. * @param {Object} object The source object.
  4670. * @param {string[]} paths The property paths to pick.
  4671. * @returns {Object} Returns the new object.
  4672. */
  4673. function basePick(object, paths) {
  4674. return basePickBy(object, paths, function(value, path) {
  4675. return hasIn(object, path);
  4676. });
  4677. }
  4678. /**
  4679. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4680. *
  4681. * @private
  4682. * @param {Object} object The source object.
  4683. * @param {string[]} paths The property paths to pick.
  4684. * @param {Function} predicate The function invoked per property.
  4685. * @returns {Object} Returns the new object.
  4686. */
  4687. function basePickBy(object, paths, predicate) {
  4688. var index = -1,
  4689. length = paths.length,
  4690. result = {};
  4691. while (++index < length) {
  4692. var path = paths[index],
  4693. value = baseGet(object, path);
  4694. if (predicate(value, path)) {
  4695. baseSet(result, castPath(path, object), value);
  4696. }
  4697. }
  4698. return result;
  4699. }
  4700. /**
  4701. * A specialized version of `baseProperty` which supports deep paths.
  4702. *
  4703. * @private
  4704. * @param {Array|string} path The path of the property to get.
  4705. * @returns {Function} Returns the new accessor function.
  4706. */
  4707. function basePropertyDeep(path) {
  4708. return function(object) {
  4709. return baseGet(object, path);
  4710. };
  4711. }
  4712. /**
  4713. * The base implementation of `_.pullAllBy` without support for iteratee
  4714. * shorthands.
  4715. *
  4716. * @private
  4717. * @param {Array} array The array to modify.
  4718. * @param {Array} values The values to remove.
  4719. * @param {Function} [iteratee] The iteratee invoked per element.
  4720. * @param {Function} [comparator] The comparator invoked per element.
  4721. * @returns {Array} Returns `array`.
  4722. */
  4723. function basePullAll(array, values, iteratee, comparator) {
  4724. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4725. index = -1,
  4726. length = values.length,
  4727. seen = array;
  4728. if (array === values) {
  4729. values = copyArray(values);
  4730. }
  4731. if (iteratee) {
  4732. seen = arrayMap(array, baseUnary(iteratee));
  4733. }
  4734. while (++index < length) {
  4735. var fromIndex = 0,
  4736. value = values[index],
  4737. computed = iteratee ? iteratee(value) : value;
  4738. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4739. if (seen !== array) {
  4740. splice.call(seen, fromIndex, 1);
  4741. }
  4742. splice.call(array, fromIndex, 1);
  4743. }
  4744. }
  4745. return array;
  4746. }
  4747. /**
  4748. * The base implementation of `_.pullAt` without support for individual
  4749. * indexes or capturing the removed elements.
  4750. *
  4751. * @private
  4752. * @param {Array} array The array to modify.
  4753. * @param {number[]} indexes The indexes of elements to remove.
  4754. * @returns {Array} Returns `array`.
  4755. */
  4756. function basePullAt(array, indexes) {
  4757. var length = array ? indexes.length : 0,
  4758. lastIndex = length - 1;
  4759. while (length--) {
  4760. var index = indexes[length];
  4761. if (length == lastIndex || index !== previous) {
  4762. var previous = index;
  4763. if (isIndex(index)) {
  4764. splice.call(array, index, 1);
  4765. } else {
  4766. baseUnset(array, index);
  4767. }
  4768. }
  4769. }
  4770. return array;
  4771. }
  4772. /**
  4773. * The base implementation of `_.random` without support for returning
  4774. * floating-point numbers.
  4775. *
  4776. * @private
  4777. * @param {number} lower The lower bound.
  4778. * @param {number} upper The upper bound.
  4779. * @returns {number} Returns the random number.
  4780. */
  4781. function baseRandom(lower, upper) {
  4782. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4783. }
  4784. /**
  4785. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4786. * coerce arguments.
  4787. *
  4788. * @private
  4789. * @param {number} start The start of the range.
  4790. * @param {number} end The end of the range.
  4791. * @param {number} step The value to increment or decrement by.
  4792. * @param {boolean} [fromRight] Specify iterating from right to left.
  4793. * @returns {Array} Returns the range of numbers.
  4794. */
  4795. function baseRange(start, end, step, fromRight) {
  4796. var index = -1,
  4797. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4798. result = Array(length);
  4799. while (length--) {
  4800. result[fromRight ? length : ++index] = start;
  4801. start += step;
  4802. }
  4803. return result;
  4804. }
  4805. /**
  4806. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4807. *
  4808. * @private
  4809. * @param {string} string The string to repeat.
  4810. * @param {number} n The number of times to repeat the string.
  4811. * @returns {string} Returns the repeated string.
  4812. */
  4813. function baseRepeat(string, n) {
  4814. var result = '';
  4815. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4816. return result;
  4817. }
  4818. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4819. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4820. do {
  4821. if (n % 2) {
  4822. result += string;
  4823. }
  4824. n = nativeFloor(n / 2);
  4825. if (n) {
  4826. string += string;
  4827. }
  4828. } while (n);
  4829. return result;
  4830. }
  4831. /**
  4832. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4833. *
  4834. * @private
  4835. * @param {Function} func The function to apply a rest parameter to.
  4836. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4837. * @returns {Function} Returns the new function.
  4838. */
  4839. function baseRest(func, start) {
  4840. return setToString(overRest(func, start, identity), func + '');
  4841. }
  4842. /**
  4843. * The base implementation of `_.sample`.
  4844. *
  4845. * @private
  4846. * @param {Array|Object} collection The collection to sample.
  4847. * @returns {*} Returns the random element.
  4848. */
  4849. function baseSample(collection) {
  4850. return arraySample(values(collection));
  4851. }
  4852. /**
  4853. * The base implementation of `_.sampleSize` without param guards.
  4854. *
  4855. * @private
  4856. * @param {Array|Object} collection The collection to sample.
  4857. * @param {number} n The number of elements to sample.
  4858. * @returns {Array} Returns the random elements.
  4859. */
  4860. function baseSampleSize(collection, n) {
  4861. var array = values(collection);
  4862. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4863. }
  4864. /**
  4865. * The base implementation of `_.set`.
  4866. *
  4867. * @private
  4868. * @param {Object} object The object to modify.
  4869. * @param {Array|string} path The path of the property to set.
  4870. * @param {*} value The value to set.
  4871. * @param {Function} [customizer] The function to customize path creation.
  4872. * @returns {Object} Returns `object`.
  4873. */
  4874. function baseSet(object, path, value, customizer) {
  4875. if (!isObject(object)) {
  4876. return object;
  4877. }
  4878. path = castPath(path, object);
  4879. var index = -1,
  4880. length = path.length,
  4881. lastIndex = length - 1,
  4882. nested = object;
  4883. while (nested != null && ++index < length) {
  4884. var key = toKey(path[index]),
  4885. newValue = value;
  4886. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4887. return object;
  4888. }
  4889. if (index != lastIndex) {
  4890. var objValue = nested[key];
  4891. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4892. if (newValue === undefined) {
  4893. newValue = isObject(objValue)
  4894. ? objValue
  4895. : (isIndex(path[index + 1]) ? [] : {});
  4896. }
  4897. }
  4898. assignValue(nested, key, newValue);
  4899. nested = nested[key];
  4900. }
  4901. return object;
  4902. }
  4903. /**
  4904. * The base implementation of `setData` without support for hot loop shorting.
  4905. *
  4906. * @private
  4907. * @param {Function} func The function to associate metadata with.
  4908. * @param {*} data The metadata.
  4909. * @returns {Function} Returns `func`.
  4910. */
  4911. var baseSetData = !metaMap ? identity : function(func, data) {
  4912. metaMap.set(func, data);
  4913. return func;
  4914. };
  4915. /**
  4916. * The base implementation of `setToString` without support for hot loop shorting.
  4917. *
  4918. * @private
  4919. * @param {Function} func The function to modify.
  4920. * @param {Function} string The `toString` result.
  4921. * @returns {Function} Returns `func`.
  4922. */
  4923. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4924. return defineProperty(func, 'toString', {
  4925. 'configurable': true,
  4926. 'enumerable': false,
  4927. 'value': constant(string),
  4928. 'writable': true
  4929. });
  4930. };
  4931. /**
  4932. * The base implementation of `_.shuffle`.
  4933. *
  4934. * @private
  4935. * @param {Array|Object} collection The collection to shuffle.
  4936. * @returns {Array} Returns the new shuffled array.
  4937. */
  4938. function baseShuffle(collection) {
  4939. return shuffleSelf(values(collection));
  4940. }
  4941. /**
  4942. * The base implementation of `_.slice` without an iteratee call guard.
  4943. *
  4944. * @private
  4945. * @param {Array} array The array to slice.
  4946. * @param {number} [start=0] The start position.
  4947. * @param {number} [end=array.length] The end position.
  4948. * @returns {Array} Returns the slice of `array`.
  4949. */
  4950. function baseSlice(array, start, end) {
  4951. var index = -1,
  4952. length = array.length;
  4953. if (start < 0) {
  4954. start = -start > length ? 0 : (length + start);
  4955. }
  4956. end = end > length ? length : end;
  4957. if (end < 0) {
  4958. end += length;
  4959. }
  4960. length = start > end ? 0 : ((end - start) >>> 0);
  4961. start >>>= 0;
  4962. var result = Array(length);
  4963. while (++index < length) {
  4964. result[index] = array[index + start];
  4965. }
  4966. return result;
  4967. }
  4968. /**
  4969. * The base implementation of `_.some` without support for iteratee shorthands.
  4970. *
  4971. * @private
  4972. * @param {Array|Object} collection The collection to iterate over.
  4973. * @param {Function} predicate The function invoked per iteration.
  4974. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4975. * else `false`.
  4976. */
  4977. function baseSome(collection, predicate) {
  4978. var result;
  4979. baseEach(collection, function(value, index, collection) {
  4980. result = predicate(value, index, collection);
  4981. return !result;
  4982. });
  4983. return !!result;
  4984. }
  4985. /**
  4986. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4987. * performs a binary search of `array` to determine the index at which `value`
  4988. * should be inserted into `array` in order to maintain its sort order.
  4989. *
  4990. * @private
  4991. * @param {Array} array The sorted array to inspect.
  4992. * @param {*} value The value to evaluate.
  4993. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4994. * @returns {number} Returns the index at which `value` should be inserted
  4995. * into `array`.
  4996. */
  4997. function baseSortedIndex(array, value, retHighest) {
  4998. var low = 0,
  4999. high = array == null ? low : array.length;
  5000. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5001. while (low < high) {
  5002. var mid = (low + high) >>> 1,
  5003. computed = array[mid];
  5004. if (computed !== null && !isSymbol(computed) &&
  5005. (retHighest ? (computed <= value) : (computed < value))) {
  5006. low = mid + 1;
  5007. } else {
  5008. high = mid;
  5009. }
  5010. }
  5011. return high;
  5012. }
  5013. return baseSortedIndexBy(array, value, identity, retHighest);
  5014. }
  5015. /**
  5016. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5017. * which invokes `iteratee` for `value` and each element of `array` to compute
  5018. * their sort ranking. The iteratee is invoked with one argument; (value).
  5019. *
  5020. * @private
  5021. * @param {Array} array The sorted array to inspect.
  5022. * @param {*} value The value to evaluate.
  5023. * @param {Function} iteratee The iteratee invoked per element.
  5024. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5025. * @returns {number} Returns the index at which `value` should be inserted
  5026. * into `array`.
  5027. */
  5028. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5029. var low = 0,
  5030. high = array == null ? 0 : array.length;
  5031. if (high === 0) {
  5032. return 0;
  5033. }
  5034. value = iteratee(value);
  5035. var valIsNaN = value !== value,
  5036. valIsNull = value === null,
  5037. valIsSymbol = isSymbol(value),
  5038. valIsUndefined = value === undefined;
  5039. while (low < high) {
  5040. var mid = nativeFloor((low + high) / 2),
  5041. computed = iteratee(array[mid]),
  5042. othIsDefined = computed !== undefined,
  5043. othIsNull = computed === null,
  5044. othIsReflexive = computed === computed,
  5045. othIsSymbol = isSymbol(computed);
  5046. if (valIsNaN) {
  5047. var setLow = retHighest || othIsReflexive;
  5048. } else if (valIsUndefined) {
  5049. setLow = othIsReflexive && (retHighest || othIsDefined);
  5050. } else if (valIsNull) {
  5051. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5052. } else if (valIsSymbol) {
  5053. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5054. } else if (othIsNull || othIsSymbol) {
  5055. setLow = false;
  5056. } else {
  5057. setLow = retHighest ? (computed <= value) : (computed < value);
  5058. }
  5059. if (setLow) {
  5060. low = mid + 1;
  5061. } else {
  5062. high = mid;
  5063. }
  5064. }
  5065. return nativeMin(high, MAX_ARRAY_INDEX);
  5066. }
  5067. /**
  5068. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5069. * support for iteratee shorthands.
  5070. *
  5071. * @private
  5072. * @param {Array} array The array to inspect.
  5073. * @param {Function} [iteratee] The iteratee invoked per element.
  5074. * @returns {Array} Returns the new duplicate free array.
  5075. */
  5076. function baseSortedUniq(array, iteratee) {
  5077. var index = -1,
  5078. length = array.length,
  5079. resIndex = 0,
  5080. result = [];
  5081. while (++index < length) {
  5082. var value = array[index],
  5083. computed = iteratee ? iteratee(value) : value;
  5084. if (!index || !eq(computed, seen)) {
  5085. var seen = computed;
  5086. result[resIndex++] = value === 0 ? 0 : value;
  5087. }
  5088. }
  5089. return result;
  5090. }
  5091. /**
  5092. * The base implementation of `_.toNumber` which doesn't ensure correct
  5093. * conversions of binary, hexadecimal, or octal string values.
  5094. *
  5095. * @private
  5096. * @param {*} value The value to process.
  5097. * @returns {number} Returns the number.
  5098. */
  5099. function baseToNumber(value) {
  5100. if (typeof value == 'number') {
  5101. return value;
  5102. }
  5103. if (isSymbol(value)) {
  5104. return NAN;
  5105. }
  5106. return +value;
  5107. }
  5108. /**
  5109. * The base implementation of `_.toString` which doesn't convert nullish
  5110. * values to empty strings.
  5111. *
  5112. * @private
  5113. * @param {*} value The value to process.
  5114. * @returns {string} Returns the string.
  5115. */
  5116. function baseToString(value) {
  5117. // Exit early for strings to avoid a performance hit in some environments.
  5118. if (typeof value == 'string') {
  5119. return value;
  5120. }
  5121. if (isArray(value)) {
  5122. // Recursively convert values (susceptible to call stack limits).
  5123. return arrayMap(value, baseToString) + '';
  5124. }
  5125. if (isSymbol(value)) {
  5126. return symbolToString ? symbolToString.call(value) : '';
  5127. }
  5128. var result = (value + '');
  5129. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5130. }
  5131. /**
  5132. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5133. *
  5134. * @private
  5135. * @param {Array} array The array to inspect.
  5136. * @param {Function} [iteratee] The iteratee invoked per element.
  5137. * @param {Function} [comparator] The comparator invoked per element.
  5138. * @returns {Array} Returns the new duplicate free array.
  5139. */
  5140. function baseUniq(array, iteratee, comparator) {
  5141. var index = -1,
  5142. includes = arrayIncludes,
  5143. length = array.length,
  5144. isCommon = true,
  5145. result = [],
  5146. seen = result;
  5147. if (comparator) {
  5148. isCommon = false;
  5149. includes = arrayIncludesWith;
  5150. }
  5151. else if (length >= LARGE_ARRAY_SIZE) {
  5152. var set = iteratee ? null : createSet(array);
  5153. if (set) {
  5154. return setToArray(set);
  5155. }
  5156. isCommon = false;
  5157. includes = cacheHas;
  5158. seen = new SetCache;
  5159. }
  5160. else {
  5161. seen = iteratee ? [] : result;
  5162. }
  5163. outer:
  5164. while (++index < length) {
  5165. var value = array[index],
  5166. computed = iteratee ? iteratee(value) : value;
  5167. value = (comparator || value !== 0) ? value : 0;
  5168. if (isCommon && computed === computed) {
  5169. var seenIndex = seen.length;
  5170. while (seenIndex--) {
  5171. if (seen[seenIndex] === computed) {
  5172. continue outer;
  5173. }
  5174. }
  5175. if (iteratee) {
  5176. seen.push(computed);
  5177. }
  5178. result.push(value);
  5179. }
  5180. else if (!includes(seen, computed, comparator)) {
  5181. if (seen !== result) {
  5182. seen.push(computed);
  5183. }
  5184. result.push(value);
  5185. }
  5186. }
  5187. return result;
  5188. }
  5189. /**
  5190. * The base implementation of `_.unset`.
  5191. *
  5192. * @private
  5193. * @param {Object} object The object to modify.
  5194. * @param {Array|string} path The property path to unset.
  5195. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5196. */
  5197. function baseUnset(object, path) {
  5198. path = castPath(path, object);
  5199. object = parent(object, path);
  5200. return object == null || delete object[toKey(last(path))];
  5201. }
  5202. /**
  5203. * The base implementation of `_.update`.
  5204. *
  5205. * @private
  5206. * @param {Object} object The object to modify.
  5207. * @param {Array|string} path The path of the property to update.
  5208. * @param {Function} updater The function to produce the updated value.
  5209. * @param {Function} [customizer] The function to customize path creation.
  5210. * @returns {Object} Returns `object`.
  5211. */
  5212. function baseUpdate(object, path, updater, customizer) {
  5213. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5214. }
  5215. /**
  5216. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5217. * without support for iteratee shorthands.
  5218. *
  5219. * @private
  5220. * @param {Array} array The array to query.
  5221. * @param {Function} predicate The function invoked per iteration.
  5222. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5223. * @param {boolean} [fromRight] Specify iterating from right to left.
  5224. * @returns {Array} Returns the slice of `array`.
  5225. */
  5226. function baseWhile(array, predicate, isDrop, fromRight) {
  5227. var length = array.length,
  5228. index = fromRight ? length : -1;
  5229. while ((fromRight ? index-- : ++index < length) &&
  5230. predicate(array[index], index, array)) {}
  5231. return isDrop
  5232. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5233. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5234. }
  5235. /**
  5236. * The base implementation of `wrapperValue` which returns the result of
  5237. * performing a sequence of actions on the unwrapped `value`, where each
  5238. * successive action is supplied the return value of the previous.
  5239. *
  5240. * @private
  5241. * @param {*} value The unwrapped value.
  5242. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5243. * @returns {*} Returns the resolved value.
  5244. */
  5245. function baseWrapperValue(value, actions) {
  5246. var result = value;
  5247. if (result instanceof LazyWrapper) {
  5248. result = result.value();
  5249. }
  5250. return arrayReduce(actions, function(result, action) {
  5251. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5252. }, result);
  5253. }
  5254. /**
  5255. * The base implementation of methods like `_.xor`, without support for
  5256. * iteratee shorthands, that accepts an array of arrays to inspect.
  5257. *
  5258. * @private
  5259. * @param {Array} arrays The arrays to inspect.
  5260. * @param {Function} [iteratee] The iteratee invoked per element.
  5261. * @param {Function} [comparator] The comparator invoked per element.
  5262. * @returns {Array} Returns the new array of values.
  5263. */
  5264. function baseXor(arrays, iteratee, comparator) {
  5265. var length = arrays.length;
  5266. if (length < 2) {
  5267. return length ? baseUniq(arrays[0]) : [];
  5268. }
  5269. var index = -1,
  5270. result = Array(length);
  5271. while (++index < length) {
  5272. var array = arrays[index],
  5273. othIndex = -1;
  5274. while (++othIndex < length) {
  5275. if (othIndex != index) {
  5276. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5277. }
  5278. }
  5279. }
  5280. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5281. }
  5282. /**
  5283. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5284. *
  5285. * @private
  5286. * @param {Array} props The property identifiers.
  5287. * @param {Array} values The property values.
  5288. * @param {Function} assignFunc The function to assign values.
  5289. * @returns {Object} Returns the new object.
  5290. */
  5291. function baseZipObject(props, values, assignFunc) {
  5292. var index = -1,
  5293. length = props.length,
  5294. valsLength = values.length,
  5295. result = {};
  5296. while (++index < length) {
  5297. var value = index < valsLength ? values[index] : undefined;
  5298. assignFunc(result, props[index], value);
  5299. }
  5300. return result;
  5301. }
  5302. /**
  5303. * Casts `value` to an empty array if it's not an array like object.
  5304. *
  5305. * @private
  5306. * @param {*} value The value to inspect.
  5307. * @returns {Array|Object} Returns the cast array-like object.
  5308. */
  5309. function castArrayLikeObject(value) {
  5310. return isArrayLikeObject(value) ? value : [];
  5311. }
  5312. /**
  5313. * Casts `value` to `identity` if it's not a function.
  5314. *
  5315. * @private
  5316. * @param {*} value The value to inspect.
  5317. * @returns {Function} Returns cast function.
  5318. */
  5319. function castFunction(value) {
  5320. return typeof value == 'function' ? value : identity;
  5321. }
  5322. /**
  5323. * Casts `value` to a path array if it's not one.
  5324. *
  5325. * @private
  5326. * @param {*} value The value to inspect.
  5327. * @param {Object} [object] The object to query keys on.
  5328. * @returns {Array} Returns the cast property path array.
  5329. */
  5330. function castPath(value, object) {
  5331. if (isArray(value)) {
  5332. return value;
  5333. }
  5334. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5335. }
  5336. /**
  5337. * A `baseRest` alias which can be replaced with `identity` by module
  5338. * replacement plugins.
  5339. *
  5340. * @private
  5341. * @type {Function}
  5342. * @param {Function} func The function to apply a rest parameter to.
  5343. * @returns {Function} Returns the new function.
  5344. */
  5345. var castRest = baseRest;
  5346. /**
  5347. * Casts `array` to a slice if it's needed.
  5348. *
  5349. * @private
  5350. * @param {Array} array The array to inspect.
  5351. * @param {number} start The start position.
  5352. * @param {number} [end=array.length] The end position.
  5353. * @returns {Array} Returns the cast slice.
  5354. */
  5355. function castSlice(array, start, end) {
  5356. var length = array.length;
  5357. end = end === undefined ? length : end;
  5358. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5359. }
  5360. /**
  5361. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5362. *
  5363. * @private
  5364. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5365. */
  5366. var clearTimeout = ctxClearTimeout || function(id) {
  5367. return root.clearTimeout(id);
  5368. };
  5369. /**
  5370. * Creates a clone of `buffer`.
  5371. *
  5372. * @private
  5373. * @param {Buffer} buffer The buffer to clone.
  5374. * @param {boolean} [isDeep] Specify a deep clone.
  5375. * @returns {Buffer} Returns the cloned buffer.
  5376. */
  5377. function cloneBuffer(buffer, isDeep) {
  5378. if (isDeep) {
  5379. return buffer.slice();
  5380. }
  5381. var length = buffer.length,
  5382. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5383. buffer.copy(result);
  5384. return result;
  5385. }
  5386. /**
  5387. * Creates a clone of `arrayBuffer`.
  5388. *
  5389. * @private
  5390. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5391. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5392. */
  5393. function cloneArrayBuffer(arrayBuffer) {
  5394. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5395. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5396. return result;
  5397. }
  5398. /**
  5399. * Creates a clone of `dataView`.
  5400. *
  5401. * @private
  5402. * @param {Object} dataView The data view to clone.
  5403. * @param {boolean} [isDeep] Specify a deep clone.
  5404. * @returns {Object} Returns the cloned data view.
  5405. */
  5406. function cloneDataView(dataView, isDeep) {
  5407. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5408. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5409. }
  5410. /**
  5411. * Creates a clone of `regexp`.
  5412. *
  5413. * @private
  5414. * @param {Object} regexp The regexp to clone.
  5415. * @returns {Object} Returns the cloned regexp.
  5416. */
  5417. function cloneRegExp(regexp) {
  5418. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5419. result.lastIndex = regexp.lastIndex;
  5420. return result;
  5421. }
  5422. /**
  5423. * Creates a clone of the `symbol` object.
  5424. *
  5425. * @private
  5426. * @param {Object} symbol The symbol object to clone.
  5427. * @returns {Object} Returns the cloned symbol object.
  5428. */
  5429. function cloneSymbol(symbol) {
  5430. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5431. }
  5432. /**
  5433. * Creates a clone of `typedArray`.
  5434. *
  5435. * @private
  5436. * @param {Object} typedArray The typed array to clone.
  5437. * @param {boolean} [isDeep] Specify a deep clone.
  5438. * @returns {Object} Returns the cloned typed array.
  5439. */
  5440. function cloneTypedArray(typedArray, isDeep) {
  5441. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5442. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5443. }
  5444. /**
  5445. * Compares values to sort them in ascending order.
  5446. *
  5447. * @private
  5448. * @param {*} value The value to compare.
  5449. * @param {*} other The other value to compare.
  5450. * @returns {number} Returns the sort order indicator for `value`.
  5451. */
  5452. function compareAscending(value, other) {
  5453. if (value !== other) {
  5454. var valIsDefined = value !== undefined,
  5455. valIsNull = value === null,
  5456. valIsReflexive = value === value,
  5457. valIsSymbol = isSymbol(value);
  5458. var othIsDefined = other !== undefined,
  5459. othIsNull = other === null,
  5460. othIsReflexive = other === other,
  5461. othIsSymbol = isSymbol(other);
  5462. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5463. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5464. (valIsNull && othIsDefined && othIsReflexive) ||
  5465. (!valIsDefined && othIsReflexive) ||
  5466. !valIsReflexive) {
  5467. return 1;
  5468. }
  5469. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5470. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5471. (othIsNull && valIsDefined && valIsReflexive) ||
  5472. (!othIsDefined && valIsReflexive) ||
  5473. !othIsReflexive) {
  5474. return -1;
  5475. }
  5476. }
  5477. return 0;
  5478. }
  5479. /**
  5480. * Used by `_.orderBy` to compare multiple properties of a value to another
  5481. * and stable sort them.
  5482. *
  5483. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5484. * specify an order of "desc" for descending or "asc" for ascending sort order
  5485. * of corresponding values.
  5486. *
  5487. * @private
  5488. * @param {Object} object The object to compare.
  5489. * @param {Object} other The other object to compare.
  5490. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5491. * @returns {number} Returns the sort order indicator for `object`.
  5492. */
  5493. function compareMultiple(object, other, orders) {
  5494. var index = -1,
  5495. objCriteria = object.criteria,
  5496. othCriteria = other.criteria,
  5497. length = objCriteria.length,
  5498. ordersLength = orders.length;
  5499. while (++index < length) {
  5500. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5501. if (result) {
  5502. if (index >= ordersLength) {
  5503. return result;
  5504. }
  5505. var order = orders[index];
  5506. return result * (order == 'desc' ? -1 : 1);
  5507. }
  5508. }
  5509. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5510. // that causes it, under certain circumstances, to provide the same value for
  5511. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5512. // for more details.
  5513. //
  5514. // This also ensures a stable sort in V8 and other engines.
  5515. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5516. return object.index - other.index;
  5517. }
  5518. /**
  5519. * Creates an array that is the composition of partially applied arguments,
  5520. * placeholders, and provided arguments into a single array of arguments.
  5521. *
  5522. * @private
  5523. * @param {Array} args The provided arguments.
  5524. * @param {Array} partials The arguments to prepend to those provided.
  5525. * @param {Array} holders The `partials` placeholder indexes.
  5526. * @params {boolean} [isCurried] Specify composing for a curried function.
  5527. * @returns {Array} Returns the new array of composed arguments.
  5528. */
  5529. function composeArgs(args, partials, holders, isCurried) {
  5530. var argsIndex = -1,
  5531. argsLength = args.length,
  5532. holdersLength = holders.length,
  5533. leftIndex = -1,
  5534. leftLength = partials.length,
  5535. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5536. result = Array(leftLength + rangeLength),
  5537. isUncurried = !isCurried;
  5538. while (++leftIndex < leftLength) {
  5539. result[leftIndex] = partials[leftIndex];
  5540. }
  5541. while (++argsIndex < holdersLength) {
  5542. if (isUncurried || argsIndex < argsLength) {
  5543. result[holders[argsIndex]] = args[argsIndex];
  5544. }
  5545. }
  5546. while (rangeLength--) {
  5547. result[leftIndex++] = args[argsIndex++];
  5548. }
  5549. return result;
  5550. }
  5551. /**
  5552. * This function is like `composeArgs` except that the arguments composition
  5553. * is tailored for `_.partialRight`.
  5554. *
  5555. * @private
  5556. * @param {Array} args The provided arguments.
  5557. * @param {Array} partials The arguments to append to those provided.
  5558. * @param {Array} holders The `partials` placeholder indexes.
  5559. * @params {boolean} [isCurried] Specify composing for a curried function.
  5560. * @returns {Array} Returns the new array of composed arguments.
  5561. */
  5562. function composeArgsRight(args, partials, holders, isCurried) {
  5563. var argsIndex = -1,
  5564. argsLength = args.length,
  5565. holdersIndex = -1,
  5566. holdersLength = holders.length,
  5567. rightIndex = -1,
  5568. rightLength = partials.length,
  5569. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5570. result = Array(rangeLength + rightLength),
  5571. isUncurried = !isCurried;
  5572. while (++argsIndex < rangeLength) {
  5573. result[argsIndex] = args[argsIndex];
  5574. }
  5575. var offset = argsIndex;
  5576. while (++rightIndex < rightLength) {
  5577. result[offset + rightIndex] = partials[rightIndex];
  5578. }
  5579. while (++holdersIndex < holdersLength) {
  5580. if (isUncurried || argsIndex < argsLength) {
  5581. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5582. }
  5583. }
  5584. return result;
  5585. }
  5586. /**
  5587. * Copies the values of `source` to `array`.
  5588. *
  5589. * @private
  5590. * @param {Array} source The array to copy values from.
  5591. * @param {Array} [array=[]] The array to copy values to.
  5592. * @returns {Array} Returns `array`.
  5593. */
  5594. function copyArray(source, array) {
  5595. var index = -1,
  5596. length = source.length;
  5597. array || (array = Array(length));
  5598. while (++index < length) {
  5599. array[index] = source[index];
  5600. }
  5601. return array;
  5602. }
  5603. /**
  5604. * Copies properties of `source` to `object`.
  5605. *
  5606. * @private
  5607. * @param {Object} source The object to copy properties from.
  5608. * @param {Array} props The property identifiers to copy.
  5609. * @param {Object} [object={}] The object to copy properties to.
  5610. * @param {Function} [customizer] The function to customize copied values.
  5611. * @returns {Object} Returns `object`.
  5612. */
  5613. function copyObject(source, props, object, customizer) {
  5614. var isNew = !object;
  5615. object || (object = {});
  5616. var index = -1,
  5617. length = props.length;
  5618. while (++index < length) {
  5619. var key = props[index];
  5620. var newValue = customizer
  5621. ? customizer(object[key], source[key], key, object, source)
  5622. : undefined;
  5623. if (newValue === undefined) {
  5624. newValue = source[key];
  5625. }
  5626. if (isNew) {
  5627. baseAssignValue(object, key, newValue);
  5628. } else {
  5629. assignValue(object, key, newValue);
  5630. }
  5631. }
  5632. return object;
  5633. }
  5634. /**
  5635. * Copies own symbols of `source` to `object`.
  5636. *
  5637. * @private
  5638. * @param {Object} source The object to copy symbols from.
  5639. * @param {Object} [object={}] The object to copy symbols to.
  5640. * @returns {Object} Returns `object`.
  5641. */
  5642. function copySymbols(source, object) {
  5643. return copyObject(source, getSymbols(source), object);
  5644. }
  5645. /**
  5646. * Copies own and inherited symbols of `source` to `object`.
  5647. *
  5648. * @private
  5649. * @param {Object} source The object to copy symbols from.
  5650. * @param {Object} [object={}] The object to copy symbols to.
  5651. * @returns {Object} Returns `object`.
  5652. */
  5653. function copySymbolsIn(source, object) {
  5654. return copyObject(source, getSymbolsIn(source), object);
  5655. }
  5656. /**
  5657. * Creates a function like `_.groupBy`.
  5658. *
  5659. * @private
  5660. * @param {Function} setter The function to set accumulator values.
  5661. * @param {Function} [initializer] The accumulator object initializer.
  5662. * @returns {Function} Returns the new aggregator function.
  5663. */
  5664. function createAggregator(setter, initializer) {
  5665. return function(collection, iteratee) {
  5666. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5667. accumulator = initializer ? initializer() : {};
  5668. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5669. };
  5670. }
  5671. /**
  5672. * Creates a function like `_.assign`.
  5673. *
  5674. * @private
  5675. * @param {Function} assigner The function to assign values.
  5676. * @returns {Function} Returns the new assigner function.
  5677. */
  5678. function createAssigner(assigner) {
  5679. return baseRest(function(object, sources) {
  5680. var index = -1,
  5681. length = sources.length,
  5682. customizer = length > 1 ? sources[length - 1] : undefined,
  5683. guard = length > 2 ? sources[2] : undefined;
  5684. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5685. ? (length--, customizer)
  5686. : undefined;
  5687. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5688. customizer = length < 3 ? undefined : customizer;
  5689. length = 1;
  5690. }
  5691. object = Object(object);
  5692. while (++index < length) {
  5693. var source = sources[index];
  5694. if (source) {
  5695. assigner(object, source, index, customizer);
  5696. }
  5697. }
  5698. return object;
  5699. });
  5700. }
  5701. /**
  5702. * Creates a `baseEach` or `baseEachRight` function.
  5703. *
  5704. * @private
  5705. * @param {Function} eachFunc The function to iterate over a collection.
  5706. * @param {boolean} [fromRight] Specify iterating from right to left.
  5707. * @returns {Function} Returns the new base function.
  5708. */
  5709. function createBaseEach(eachFunc, fromRight) {
  5710. return function(collection, iteratee) {
  5711. if (collection == null) {
  5712. return collection;
  5713. }
  5714. if (!isArrayLike(collection)) {
  5715. return eachFunc(collection, iteratee);
  5716. }
  5717. var length = collection.length,
  5718. index = fromRight ? length : -1,
  5719. iterable = Object(collection);
  5720. while ((fromRight ? index-- : ++index < length)) {
  5721. if (iteratee(iterable[index], index, iterable) === false) {
  5722. break;
  5723. }
  5724. }
  5725. return collection;
  5726. };
  5727. }
  5728. /**
  5729. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5730. *
  5731. * @private
  5732. * @param {boolean} [fromRight] Specify iterating from right to left.
  5733. * @returns {Function} Returns the new base function.
  5734. */
  5735. function createBaseFor(fromRight) {
  5736. return function(object, iteratee, keysFunc) {
  5737. var index = -1,
  5738. iterable = Object(object),
  5739. props = keysFunc(object),
  5740. length = props.length;
  5741. while (length--) {
  5742. var key = props[fromRight ? length : ++index];
  5743. if (iteratee(iterable[key], key, iterable) === false) {
  5744. break;
  5745. }
  5746. }
  5747. return object;
  5748. };
  5749. }
  5750. /**
  5751. * Creates a function that wraps `func` to invoke it with the optional `this`
  5752. * binding of `thisArg`.
  5753. *
  5754. * @private
  5755. * @param {Function} func The function to wrap.
  5756. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5757. * @param {*} [thisArg] The `this` binding of `func`.
  5758. * @returns {Function} Returns the new wrapped function.
  5759. */
  5760. function createBind(func, bitmask, thisArg) {
  5761. var isBind = bitmask & WRAP_BIND_FLAG,
  5762. Ctor = createCtor(func);
  5763. function wrapper() {
  5764. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5765. return fn.apply(isBind ? thisArg : this, arguments);
  5766. }
  5767. return wrapper;
  5768. }
  5769. /**
  5770. * Creates a function like `_.lowerFirst`.
  5771. *
  5772. * @private
  5773. * @param {string} methodName The name of the `String` case method to use.
  5774. * @returns {Function} Returns the new case function.
  5775. */
  5776. function createCaseFirst(methodName) {
  5777. return function(string) {
  5778. string = toString(string);
  5779. var strSymbols = hasUnicode(string)
  5780. ? stringToArray(string)
  5781. : undefined;
  5782. var chr = strSymbols
  5783. ? strSymbols[0]
  5784. : string.charAt(0);
  5785. var trailing = strSymbols
  5786. ? castSlice(strSymbols, 1).join('')
  5787. : string.slice(1);
  5788. return chr[methodName]() + trailing;
  5789. };
  5790. }
  5791. /**
  5792. * Creates a function like `_.camelCase`.
  5793. *
  5794. * @private
  5795. * @param {Function} callback The function to combine each word.
  5796. * @returns {Function} Returns the new compounder function.
  5797. */
  5798. function createCompounder(callback) {
  5799. return function(string) {
  5800. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5801. };
  5802. }
  5803. /**
  5804. * Creates a function that produces an instance of `Ctor` regardless of
  5805. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5806. *
  5807. * @private
  5808. * @param {Function} Ctor The constructor to wrap.
  5809. * @returns {Function} Returns the new wrapped function.
  5810. */
  5811. function createCtor(Ctor) {
  5812. return function() {
  5813. // Use a `switch` statement to work with class constructors. See
  5814. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5815. // for more details.
  5816. var args = arguments;
  5817. switch (args.length) {
  5818. case 0: return new Ctor;
  5819. case 1: return new Ctor(args[0]);
  5820. case 2: return new Ctor(args[0], args[1]);
  5821. case 3: return new Ctor(args[0], args[1], args[2]);
  5822. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5823. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5824. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5825. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5826. }
  5827. var thisBinding = baseCreate(Ctor.prototype),
  5828. result = Ctor.apply(thisBinding, args);
  5829. // Mimic the constructor's `return` behavior.
  5830. // See https://es5.github.io/#x13.2.2 for more details.
  5831. return isObject(result) ? result : thisBinding;
  5832. };
  5833. }
  5834. /**
  5835. * Creates a function that wraps `func` to enable currying.
  5836. *
  5837. * @private
  5838. * @param {Function} func The function to wrap.
  5839. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5840. * @param {number} arity The arity of `func`.
  5841. * @returns {Function} Returns the new wrapped function.
  5842. */
  5843. function createCurry(func, bitmask, arity) {
  5844. var Ctor = createCtor(func);
  5845. function wrapper() {
  5846. var length = arguments.length,
  5847. args = Array(length),
  5848. index = length,
  5849. placeholder = getHolder(wrapper);
  5850. while (index--) {
  5851. args[index] = arguments[index];
  5852. }
  5853. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5854. ? []
  5855. : replaceHolders(args, placeholder);
  5856. length -= holders.length;
  5857. if (length < arity) {
  5858. return createRecurry(
  5859. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5860. args, holders, undefined, undefined, arity - length);
  5861. }
  5862. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5863. return apply(fn, this, args);
  5864. }
  5865. return wrapper;
  5866. }
  5867. /**
  5868. * Creates a `_.find` or `_.findLast` function.
  5869. *
  5870. * @private
  5871. * @param {Function} findIndexFunc The function to find the collection index.
  5872. * @returns {Function} Returns the new find function.
  5873. */
  5874. function createFind(findIndexFunc) {
  5875. return function(collection, predicate, fromIndex) {
  5876. var iterable = Object(collection);
  5877. if (!isArrayLike(collection)) {
  5878. var iteratee = getIteratee(predicate, 3);
  5879. collection = keys(collection);
  5880. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5881. }
  5882. var index = findIndexFunc(collection, predicate, fromIndex);
  5883. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5884. };
  5885. }
  5886. /**
  5887. * Creates a `_.flow` or `_.flowRight` function.
  5888. *
  5889. * @private
  5890. * @param {boolean} [fromRight] Specify iterating from right to left.
  5891. * @returns {Function} Returns the new flow function.
  5892. */
  5893. function createFlow(fromRight) {
  5894. return flatRest(function(funcs) {
  5895. var length = funcs.length,
  5896. index = length,
  5897. prereq = LodashWrapper.prototype.thru;
  5898. if (fromRight) {
  5899. funcs.reverse();
  5900. }
  5901. while (index--) {
  5902. var func = funcs[index];
  5903. if (typeof func != 'function') {
  5904. throw new TypeError(FUNC_ERROR_TEXT);
  5905. }
  5906. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5907. var wrapper = new LodashWrapper([], true);
  5908. }
  5909. }
  5910. index = wrapper ? index : length;
  5911. while (++index < length) {
  5912. func = funcs[index];
  5913. var funcName = getFuncName(func),
  5914. data = funcName == 'wrapper' ? getData(func) : undefined;
  5915. if (data && isLaziable(data[0]) &&
  5916. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5917. !data[4].length && data[9] == 1
  5918. ) {
  5919. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5920. } else {
  5921. wrapper = (func.length == 1 && isLaziable(func))
  5922. ? wrapper[funcName]()
  5923. : wrapper.thru(func);
  5924. }
  5925. }
  5926. return function() {
  5927. var args = arguments,
  5928. value = args[0];
  5929. if (wrapper && args.length == 1 && isArray(value)) {
  5930. return wrapper.plant(value).value();
  5931. }
  5932. var index = 0,
  5933. result = length ? funcs[index].apply(this, args) : value;
  5934. while (++index < length) {
  5935. result = funcs[index].call(this, result);
  5936. }
  5937. return result;
  5938. };
  5939. });
  5940. }
  5941. /**
  5942. * Creates a function that wraps `func` to invoke it with optional `this`
  5943. * binding of `thisArg`, partial application, and currying.
  5944. *
  5945. * @private
  5946. * @param {Function|string} func The function or method name to wrap.
  5947. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5948. * @param {*} [thisArg] The `this` binding of `func`.
  5949. * @param {Array} [partials] The arguments to prepend to those provided to
  5950. * the new function.
  5951. * @param {Array} [holders] The `partials` placeholder indexes.
  5952. * @param {Array} [partialsRight] The arguments to append to those provided
  5953. * to the new function.
  5954. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5955. * @param {Array} [argPos] The argument positions of the new function.
  5956. * @param {number} [ary] The arity cap of `func`.
  5957. * @param {number} [arity] The arity of `func`.
  5958. * @returns {Function} Returns the new wrapped function.
  5959. */
  5960. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5961. var isAry = bitmask & WRAP_ARY_FLAG,
  5962. isBind = bitmask & WRAP_BIND_FLAG,
  5963. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5964. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5965. isFlip = bitmask & WRAP_FLIP_FLAG,
  5966. Ctor = isBindKey ? undefined : createCtor(func);
  5967. function wrapper() {
  5968. var length = arguments.length,
  5969. args = Array(length),
  5970. index = length;
  5971. while (index--) {
  5972. args[index] = arguments[index];
  5973. }
  5974. if (isCurried) {
  5975. var placeholder = getHolder(wrapper),
  5976. holdersCount = countHolders(args, placeholder);
  5977. }
  5978. if (partials) {
  5979. args = composeArgs(args, partials, holders, isCurried);
  5980. }
  5981. if (partialsRight) {
  5982. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5983. }
  5984. length -= holdersCount;
  5985. if (isCurried && length < arity) {
  5986. var newHolders = replaceHolders(args, placeholder);
  5987. return createRecurry(
  5988. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5989. args, newHolders, argPos, ary, arity - length
  5990. );
  5991. }
  5992. var thisBinding = isBind ? thisArg : this,
  5993. fn = isBindKey ? thisBinding[func] : func;
  5994. length = args.length;
  5995. if (argPos) {
  5996. args = reorder(args, argPos);
  5997. } else if (isFlip && length > 1) {
  5998. args.reverse();
  5999. }
  6000. if (isAry && ary < length) {
  6001. args.length = ary;
  6002. }
  6003. if (this && this !== root && this instanceof wrapper) {
  6004. fn = Ctor || createCtor(fn);
  6005. }
  6006. return fn.apply(thisBinding, args);
  6007. }
  6008. return wrapper;
  6009. }
  6010. /**
  6011. * Creates a function like `_.invertBy`.
  6012. *
  6013. * @private
  6014. * @param {Function} setter The function to set accumulator values.
  6015. * @param {Function} toIteratee The function to resolve iteratees.
  6016. * @returns {Function} Returns the new inverter function.
  6017. */
  6018. function createInverter(setter, toIteratee) {
  6019. return function(object, iteratee) {
  6020. return baseInverter(object, setter, toIteratee(iteratee), {});
  6021. };
  6022. }
  6023. /**
  6024. * Creates a function that performs a mathematical operation on two values.
  6025. *
  6026. * @private
  6027. * @param {Function} operator The function to perform the operation.
  6028. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6029. * @returns {Function} Returns the new mathematical operation function.
  6030. */
  6031. function createMathOperation(operator, defaultValue) {
  6032. return function(value, other) {
  6033. var result;
  6034. if (value === undefined && other === undefined) {
  6035. return defaultValue;
  6036. }
  6037. if (value !== undefined) {
  6038. result = value;
  6039. }
  6040. if (other !== undefined) {
  6041. if (result === undefined) {
  6042. return other;
  6043. }
  6044. if (typeof value == 'string' || typeof other == 'string') {
  6045. value = baseToString(value);
  6046. other = baseToString(other);
  6047. } else {
  6048. value = baseToNumber(value);
  6049. other = baseToNumber(other);
  6050. }
  6051. result = operator(value, other);
  6052. }
  6053. return result;
  6054. };
  6055. }
  6056. /**
  6057. * Creates a function like `_.over`.
  6058. *
  6059. * @private
  6060. * @param {Function} arrayFunc The function to iterate over iteratees.
  6061. * @returns {Function} Returns the new over function.
  6062. */
  6063. function createOver(arrayFunc) {
  6064. return flatRest(function(iteratees) {
  6065. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6066. return baseRest(function(args) {
  6067. var thisArg = this;
  6068. return arrayFunc(iteratees, function(iteratee) {
  6069. return apply(iteratee, thisArg, args);
  6070. });
  6071. });
  6072. });
  6073. }
  6074. /**
  6075. * Creates the padding for `string` based on `length`. The `chars` string
  6076. * is truncated if the number of characters exceeds `length`.
  6077. *
  6078. * @private
  6079. * @param {number} length The padding length.
  6080. * @param {string} [chars=' '] The string used as padding.
  6081. * @returns {string} Returns the padding for `string`.
  6082. */
  6083. function createPadding(length, chars) {
  6084. chars = chars === undefined ? ' ' : baseToString(chars);
  6085. var charsLength = chars.length;
  6086. if (charsLength < 2) {
  6087. return charsLength ? baseRepeat(chars, length) : chars;
  6088. }
  6089. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6090. return hasUnicode(chars)
  6091. ? castSlice(stringToArray(result), 0, length).join('')
  6092. : result.slice(0, length);
  6093. }
  6094. /**
  6095. * Creates a function that wraps `func` to invoke it with the `this` binding
  6096. * of `thisArg` and `partials` prepended to the arguments it receives.
  6097. *
  6098. * @private
  6099. * @param {Function} func The function to wrap.
  6100. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6101. * @param {*} thisArg The `this` binding of `func`.
  6102. * @param {Array} partials The arguments to prepend to those provided to
  6103. * the new function.
  6104. * @returns {Function} Returns the new wrapped function.
  6105. */
  6106. function createPartial(func, bitmask, thisArg, partials) {
  6107. var isBind = bitmask & WRAP_BIND_FLAG,
  6108. Ctor = createCtor(func);
  6109. function wrapper() {
  6110. var argsIndex = -1,
  6111. argsLength = arguments.length,
  6112. leftIndex = -1,
  6113. leftLength = partials.length,
  6114. args = Array(leftLength + argsLength),
  6115. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6116. while (++leftIndex < leftLength) {
  6117. args[leftIndex] = partials[leftIndex];
  6118. }
  6119. while (argsLength--) {
  6120. args[leftIndex++] = arguments[++argsIndex];
  6121. }
  6122. return apply(fn, isBind ? thisArg : this, args);
  6123. }
  6124. return wrapper;
  6125. }
  6126. /**
  6127. * Creates a `_.range` or `_.rangeRight` function.
  6128. *
  6129. * @private
  6130. * @param {boolean} [fromRight] Specify iterating from right to left.
  6131. * @returns {Function} Returns the new range function.
  6132. */
  6133. function createRange(fromRight) {
  6134. return function(start, end, step) {
  6135. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6136. end = step = undefined;
  6137. }
  6138. // Ensure the sign of `-0` is preserved.
  6139. start = toFinite(start);
  6140. if (end === undefined) {
  6141. end = start;
  6142. start = 0;
  6143. } else {
  6144. end = toFinite(end);
  6145. }
  6146. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6147. return baseRange(start, end, step, fromRight);
  6148. };
  6149. }
  6150. /**
  6151. * Creates a function that performs a relational operation on two values.
  6152. *
  6153. * @private
  6154. * @param {Function} operator The function to perform the operation.
  6155. * @returns {Function} Returns the new relational operation function.
  6156. */
  6157. function createRelationalOperation(operator) {
  6158. return function(value, other) {
  6159. if (!(typeof value == 'string' && typeof other == 'string')) {
  6160. value = toNumber(value);
  6161. other = toNumber(other);
  6162. }
  6163. return operator(value, other);
  6164. };
  6165. }
  6166. /**
  6167. * Creates a function that wraps `func` to continue currying.
  6168. *
  6169. * @private
  6170. * @param {Function} func The function to wrap.
  6171. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6172. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6173. * @param {*} placeholder The placeholder value.
  6174. * @param {*} [thisArg] The `this` binding of `func`.
  6175. * @param {Array} [partials] The arguments to prepend to those provided to
  6176. * the new function.
  6177. * @param {Array} [holders] The `partials` placeholder indexes.
  6178. * @param {Array} [argPos] The argument positions of the new function.
  6179. * @param {number} [ary] The arity cap of `func`.
  6180. * @param {number} [arity] The arity of `func`.
  6181. * @returns {Function} Returns the new wrapped function.
  6182. */
  6183. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6184. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6185. newHolders = isCurry ? holders : undefined,
  6186. newHoldersRight = isCurry ? undefined : holders,
  6187. newPartials = isCurry ? partials : undefined,
  6188. newPartialsRight = isCurry ? undefined : partials;
  6189. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6190. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6191. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6192. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6193. }
  6194. var newData = [
  6195. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6196. newHoldersRight, argPos, ary, arity
  6197. ];
  6198. var result = wrapFunc.apply(undefined, newData);
  6199. if (isLaziable(func)) {
  6200. setData(result, newData);
  6201. }
  6202. result.placeholder = placeholder;
  6203. return setWrapToString(result, func, bitmask);
  6204. }
  6205. /**
  6206. * Creates a function like `_.round`.
  6207. *
  6208. * @private
  6209. * @param {string} methodName The name of the `Math` method to use when rounding.
  6210. * @returns {Function} Returns the new round function.
  6211. */
  6212. function createRound(methodName) {
  6213. var func = Math[methodName];
  6214. return function(number, precision) {
  6215. number = toNumber(number);
  6216. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6217. if (precision && nativeIsFinite(number)) {
  6218. // Shift with exponential notation to avoid floating-point issues.
  6219. // See [MDN](https://mdn.io/round#Examples) for more details.
  6220. var pair = (toString(number) + 'e').split('e'),
  6221. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6222. pair = (toString(value) + 'e').split('e');
  6223. return +(pair[0] + 'e' + (+pair[1] - precision));
  6224. }
  6225. return func(number);
  6226. };
  6227. }
  6228. /**
  6229. * Creates a set object of `values`.
  6230. *
  6231. * @private
  6232. * @param {Array} values The values to add to the set.
  6233. * @returns {Object} Returns the new set.
  6234. */
  6235. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6236. return new Set(values);
  6237. };
  6238. /**
  6239. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6240. *
  6241. * @private
  6242. * @param {Function} keysFunc The function to get the keys of a given object.
  6243. * @returns {Function} Returns the new pairs function.
  6244. */
  6245. function createToPairs(keysFunc) {
  6246. return function(object) {
  6247. var tag = getTag(object);
  6248. if (tag == mapTag) {
  6249. return mapToArray(object);
  6250. }
  6251. if (tag == setTag) {
  6252. return setToPairs(object);
  6253. }
  6254. return baseToPairs(object, keysFunc(object));
  6255. };
  6256. }
  6257. /**
  6258. * Creates a function that either curries or invokes `func` with optional
  6259. * `this` binding and partially applied arguments.
  6260. *
  6261. * @private
  6262. * @param {Function|string} func The function or method name to wrap.
  6263. * @param {number} bitmask The bitmask flags.
  6264. * 1 - `_.bind`
  6265. * 2 - `_.bindKey`
  6266. * 4 - `_.curry` or `_.curryRight` of a bound function
  6267. * 8 - `_.curry`
  6268. * 16 - `_.curryRight`
  6269. * 32 - `_.partial`
  6270. * 64 - `_.partialRight`
  6271. * 128 - `_.rearg`
  6272. * 256 - `_.ary`
  6273. * 512 - `_.flip`
  6274. * @param {*} [thisArg] The `this` binding of `func`.
  6275. * @param {Array} [partials] The arguments to be partially applied.
  6276. * @param {Array} [holders] The `partials` placeholder indexes.
  6277. * @param {Array} [argPos] The argument positions of the new function.
  6278. * @param {number} [ary] The arity cap of `func`.
  6279. * @param {number} [arity] The arity of `func`.
  6280. * @returns {Function} Returns the new wrapped function.
  6281. */
  6282. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6283. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6284. if (!isBindKey && typeof func != 'function') {
  6285. throw new TypeError(FUNC_ERROR_TEXT);
  6286. }
  6287. var length = partials ? partials.length : 0;
  6288. if (!length) {
  6289. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6290. partials = holders = undefined;
  6291. }
  6292. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6293. arity = arity === undefined ? arity : toInteger(arity);
  6294. length -= holders ? holders.length : 0;
  6295. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6296. var partialsRight = partials,
  6297. holdersRight = holders;
  6298. partials = holders = undefined;
  6299. }
  6300. var data = isBindKey ? undefined : getData(func);
  6301. var newData = [
  6302. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6303. argPos, ary, arity
  6304. ];
  6305. if (data) {
  6306. mergeData(newData, data);
  6307. }
  6308. func = newData[0];
  6309. bitmask = newData[1];
  6310. thisArg = newData[2];
  6311. partials = newData[3];
  6312. holders = newData[4];
  6313. arity = newData[9] = newData[9] === undefined
  6314. ? (isBindKey ? 0 : func.length)
  6315. : nativeMax(newData[9] - length, 0);
  6316. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6317. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6318. }
  6319. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6320. var result = createBind(func, bitmask, thisArg);
  6321. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6322. result = createCurry(func, bitmask, arity);
  6323. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6324. result = createPartial(func, bitmask, thisArg, partials);
  6325. } else {
  6326. result = createHybrid.apply(undefined, newData);
  6327. }
  6328. var setter = data ? baseSetData : setData;
  6329. return setWrapToString(setter(result, newData), func, bitmask);
  6330. }
  6331. /**
  6332. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6333. * of source objects to the destination object for all destination properties
  6334. * that resolve to `undefined`.
  6335. *
  6336. * @private
  6337. * @param {*} objValue The destination value.
  6338. * @param {*} srcValue The source value.
  6339. * @param {string} key The key of the property to assign.
  6340. * @param {Object} object The parent object of `objValue`.
  6341. * @returns {*} Returns the value to assign.
  6342. */
  6343. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6344. if (objValue === undefined ||
  6345. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6346. return srcValue;
  6347. }
  6348. return objValue;
  6349. }
  6350. /**
  6351. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6352. * objects into destination objects that are passed thru.
  6353. *
  6354. * @private
  6355. * @param {*} objValue The destination value.
  6356. * @param {*} srcValue The source value.
  6357. * @param {string} key The key of the property to merge.
  6358. * @param {Object} object The parent object of `objValue`.
  6359. * @param {Object} source The parent object of `srcValue`.
  6360. * @param {Object} [stack] Tracks traversed source values and their merged
  6361. * counterparts.
  6362. * @returns {*} Returns the value to assign.
  6363. */
  6364. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6365. if (isObject(objValue) && isObject(srcValue)) {
  6366. // Recursively merge objects and arrays (susceptible to call stack limits).
  6367. stack.set(srcValue, objValue);
  6368. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6369. stack['delete'](srcValue);
  6370. }
  6371. return objValue;
  6372. }
  6373. /**
  6374. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6375. * objects.
  6376. *
  6377. * @private
  6378. * @param {*} value The value to inspect.
  6379. * @param {string} key The key of the property to inspect.
  6380. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6381. */
  6382. function customOmitClone(value) {
  6383. return isPlainObject(value) ? undefined : value;
  6384. }
  6385. /**
  6386. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6387. * partial deep comparisons.
  6388. *
  6389. * @private
  6390. * @param {Array} array The array to compare.
  6391. * @param {Array} other The other array to compare.
  6392. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6393. * @param {Function} customizer The function to customize comparisons.
  6394. * @param {Function} equalFunc The function to determine equivalents of values.
  6395. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6396. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6397. */
  6398. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6399. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6400. arrLength = array.length,
  6401. othLength = other.length;
  6402. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6403. return false;
  6404. }
  6405. // Check that cyclic values are equal.
  6406. var arrStacked = stack.get(array);
  6407. var othStacked = stack.get(other);
  6408. if (arrStacked && othStacked) {
  6409. return arrStacked == other && othStacked == array;
  6410. }
  6411. var index = -1,
  6412. result = true,
  6413. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6414. stack.set(array, other);
  6415. stack.set(other, array);
  6416. // Ignore non-index properties.
  6417. while (++index < arrLength) {
  6418. var arrValue = array[index],
  6419. othValue = other[index];
  6420. if (customizer) {
  6421. var compared = isPartial
  6422. ? customizer(othValue, arrValue, index, other, array, stack)
  6423. : customizer(arrValue, othValue, index, array, other, stack);
  6424. }
  6425. if (compared !== undefined) {
  6426. if (compared) {
  6427. continue;
  6428. }
  6429. result = false;
  6430. break;
  6431. }
  6432. // Recursively compare arrays (susceptible to call stack limits).
  6433. if (seen) {
  6434. if (!arraySome(other, function(othValue, othIndex) {
  6435. if (!cacheHas(seen, othIndex) &&
  6436. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6437. return seen.push(othIndex);
  6438. }
  6439. })) {
  6440. result = false;
  6441. break;
  6442. }
  6443. } else if (!(
  6444. arrValue === othValue ||
  6445. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6446. )) {
  6447. result = false;
  6448. break;
  6449. }
  6450. }
  6451. stack['delete'](array);
  6452. stack['delete'](other);
  6453. return result;
  6454. }
  6455. /**
  6456. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6457. * the same `toStringTag`.
  6458. *
  6459. * **Note:** This function only supports comparing values with tags of
  6460. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6461. *
  6462. * @private
  6463. * @param {Object} object The object to compare.
  6464. * @param {Object} other The other object to compare.
  6465. * @param {string} tag The `toStringTag` of the objects to compare.
  6466. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6467. * @param {Function} customizer The function to customize comparisons.
  6468. * @param {Function} equalFunc The function to determine equivalents of values.
  6469. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6470. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6471. */
  6472. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6473. switch (tag) {
  6474. case dataViewTag:
  6475. if ((object.byteLength != other.byteLength) ||
  6476. (object.byteOffset != other.byteOffset)) {
  6477. return false;
  6478. }
  6479. object = object.buffer;
  6480. other = other.buffer;
  6481. case arrayBufferTag:
  6482. if ((object.byteLength != other.byteLength) ||
  6483. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6484. return false;
  6485. }
  6486. return true;
  6487. case boolTag:
  6488. case dateTag:
  6489. case numberTag:
  6490. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6491. // Invalid dates are coerced to `NaN`.
  6492. return eq(+object, +other);
  6493. case errorTag:
  6494. return object.name == other.name && object.message == other.message;
  6495. case regexpTag:
  6496. case stringTag:
  6497. // Coerce regexes to strings and treat strings, primitives and objects,
  6498. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6499. // for more details.
  6500. return object == (other + '');
  6501. case mapTag:
  6502. var convert = mapToArray;
  6503. case setTag:
  6504. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6505. convert || (convert = setToArray);
  6506. if (object.size != other.size && !isPartial) {
  6507. return false;
  6508. }
  6509. // Assume cyclic values are equal.
  6510. var stacked = stack.get(object);
  6511. if (stacked) {
  6512. return stacked == other;
  6513. }
  6514. bitmask |= COMPARE_UNORDERED_FLAG;
  6515. // Recursively compare objects (susceptible to call stack limits).
  6516. stack.set(object, other);
  6517. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6518. stack['delete'](object);
  6519. return result;
  6520. case symbolTag:
  6521. if (symbolValueOf) {
  6522. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6523. }
  6524. }
  6525. return false;
  6526. }
  6527. /**
  6528. * A specialized version of `baseIsEqualDeep` for objects with support for
  6529. * partial deep comparisons.
  6530. *
  6531. * @private
  6532. * @param {Object} object The object to compare.
  6533. * @param {Object} other The other object to compare.
  6534. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6535. * @param {Function} customizer The function to customize comparisons.
  6536. * @param {Function} equalFunc The function to determine equivalents of values.
  6537. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6538. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6539. */
  6540. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6541. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6542. objProps = getAllKeys(object),
  6543. objLength = objProps.length,
  6544. othProps = getAllKeys(other),
  6545. othLength = othProps.length;
  6546. if (objLength != othLength && !isPartial) {
  6547. return false;
  6548. }
  6549. var index = objLength;
  6550. while (index--) {
  6551. var key = objProps[index];
  6552. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6553. return false;
  6554. }
  6555. }
  6556. // Check that cyclic values are equal.
  6557. var objStacked = stack.get(object);
  6558. var othStacked = stack.get(other);
  6559. if (objStacked && othStacked) {
  6560. return objStacked == other && othStacked == object;
  6561. }
  6562. var result = true;
  6563. stack.set(object, other);
  6564. stack.set(other, object);
  6565. var skipCtor = isPartial;
  6566. while (++index < objLength) {
  6567. key = objProps[index];
  6568. var objValue = object[key],
  6569. othValue = other[key];
  6570. if (customizer) {
  6571. var compared = isPartial
  6572. ? customizer(othValue, objValue, key, other, object, stack)
  6573. : customizer(objValue, othValue, key, object, other, stack);
  6574. }
  6575. // Recursively compare objects (susceptible to call stack limits).
  6576. if (!(compared === undefined
  6577. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6578. : compared
  6579. )) {
  6580. result = false;
  6581. break;
  6582. }
  6583. skipCtor || (skipCtor = key == 'constructor');
  6584. }
  6585. if (result && !skipCtor) {
  6586. var objCtor = object.constructor,
  6587. othCtor = other.constructor;
  6588. // Non `Object` object instances with different constructors are not equal.
  6589. if (objCtor != othCtor &&
  6590. ('constructor' in object && 'constructor' in other) &&
  6591. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6592. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6593. result = false;
  6594. }
  6595. }
  6596. stack['delete'](object);
  6597. stack['delete'](other);
  6598. return result;
  6599. }
  6600. /**
  6601. * A specialized version of `baseRest` which flattens the rest array.
  6602. *
  6603. * @private
  6604. * @param {Function} func The function to apply a rest parameter to.
  6605. * @returns {Function} Returns the new function.
  6606. */
  6607. function flatRest(func) {
  6608. return setToString(overRest(func, undefined, flatten), func + '');
  6609. }
  6610. /**
  6611. * Creates an array of own enumerable property names and symbols of `object`.
  6612. *
  6613. * @private
  6614. * @param {Object} object The object to query.
  6615. * @returns {Array} Returns the array of property names and symbols.
  6616. */
  6617. function getAllKeys(object) {
  6618. return baseGetAllKeys(object, keys, getSymbols);
  6619. }
  6620. /**
  6621. * Creates an array of own and inherited enumerable property names and
  6622. * symbols of `object`.
  6623. *
  6624. * @private
  6625. * @param {Object} object The object to query.
  6626. * @returns {Array} Returns the array of property names and symbols.
  6627. */
  6628. function getAllKeysIn(object) {
  6629. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6630. }
  6631. /**
  6632. * Gets metadata for `func`.
  6633. *
  6634. * @private
  6635. * @param {Function} func The function to query.
  6636. * @returns {*} Returns the metadata for `func`.
  6637. */
  6638. var getData = !metaMap ? noop : function(func) {
  6639. return metaMap.get(func);
  6640. };
  6641. /**
  6642. * Gets the name of `func`.
  6643. *
  6644. * @private
  6645. * @param {Function} func The function to query.
  6646. * @returns {string} Returns the function name.
  6647. */
  6648. function getFuncName(func) {
  6649. var result = (func.name + ''),
  6650. array = realNames[result],
  6651. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6652. while (length--) {
  6653. var data = array[length],
  6654. otherFunc = data.func;
  6655. if (otherFunc == null || otherFunc == func) {
  6656. return data.name;
  6657. }
  6658. }
  6659. return result;
  6660. }
  6661. /**
  6662. * Gets the argument placeholder value for `func`.
  6663. *
  6664. * @private
  6665. * @param {Function} func The function to inspect.
  6666. * @returns {*} Returns the placeholder value.
  6667. */
  6668. function getHolder(func) {
  6669. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6670. return object.placeholder;
  6671. }
  6672. /**
  6673. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6674. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6675. * If arguments are provided, the chosen function is invoked with them and
  6676. * its result is returned.
  6677. *
  6678. * @private
  6679. * @param {*} [value] The value to convert to an iteratee.
  6680. * @param {number} [arity] The arity of the created iteratee.
  6681. * @returns {Function} Returns the chosen function or its result.
  6682. */
  6683. function getIteratee() {
  6684. var result = lodash.iteratee || iteratee;
  6685. result = result === iteratee ? baseIteratee : result;
  6686. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6687. }
  6688. /**
  6689. * Gets the data for `map`.
  6690. *
  6691. * @private
  6692. * @param {Object} map The map to query.
  6693. * @param {string} key The reference key.
  6694. * @returns {*} Returns the map data.
  6695. */
  6696. function getMapData(map, key) {
  6697. var data = map.__data__;
  6698. return isKeyable(key)
  6699. ? data[typeof key == 'string' ? 'string' : 'hash']
  6700. : data.map;
  6701. }
  6702. /**
  6703. * Gets the property names, values, and compare flags of `object`.
  6704. *
  6705. * @private
  6706. * @param {Object} object The object to query.
  6707. * @returns {Array} Returns the match data of `object`.
  6708. */
  6709. function getMatchData(object) {
  6710. var result = keys(object),
  6711. length = result.length;
  6712. while (length--) {
  6713. var key = result[length],
  6714. value = object[key];
  6715. result[length] = [key, value, isStrictComparable(value)];
  6716. }
  6717. return result;
  6718. }
  6719. /**
  6720. * Gets the native function at `key` of `object`.
  6721. *
  6722. * @private
  6723. * @param {Object} object The object to query.
  6724. * @param {string} key The key of the method to get.
  6725. * @returns {*} Returns the function if it's native, else `undefined`.
  6726. */
  6727. function getNative(object, key) {
  6728. var value = getValue(object, key);
  6729. return baseIsNative(value) ? value : undefined;
  6730. }
  6731. /**
  6732. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6733. *
  6734. * @private
  6735. * @param {*} value The value to query.
  6736. * @returns {string} Returns the raw `toStringTag`.
  6737. */
  6738. function getRawTag(value) {
  6739. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6740. tag = value[symToStringTag];
  6741. try {
  6742. value[symToStringTag] = undefined;
  6743. var unmasked = true;
  6744. } catch (e) {}
  6745. var result = nativeObjectToString.call(value);
  6746. if (unmasked) {
  6747. if (isOwn) {
  6748. value[symToStringTag] = tag;
  6749. } else {
  6750. delete value[symToStringTag];
  6751. }
  6752. }
  6753. return result;
  6754. }
  6755. /**
  6756. * Creates an array of the own enumerable symbols of `object`.
  6757. *
  6758. * @private
  6759. * @param {Object} object The object to query.
  6760. * @returns {Array} Returns the array of symbols.
  6761. */
  6762. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6763. if (object == null) {
  6764. return [];
  6765. }
  6766. object = Object(object);
  6767. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6768. return propertyIsEnumerable.call(object, symbol);
  6769. });
  6770. };
  6771. /**
  6772. * Creates an array of the own and inherited enumerable symbols of `object`.
  6773. *
  6774. * @private
  6775. * @param {Object} object The object to query.
  6776. * @returns {Array} Returns the array of symbols.
  6777. */
  6778. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6779. var result = [];
  6780. while (object) {
  6781. arrayPush(result, getSymbols(object));
  6782. object = getPrototype(object);
  6783. }
  6784. return result;
  6785. };
  6786. /**
  6787. * Gets the `toStringTag` of `value`.
  6788. *
  6789. * @private
  6790. * @param {*} value The value to query.
  6791. * @returns {string} Returns the `toStringTag`.
  6792. */
  6793. var getTag = baseGetTag;
  6794. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6795. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6796. (Map && getTag(new Map) != mapTag) ||
  6797. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6798. (Set && getTag(new Set) != setTag) ||
  6799. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6800. getTag = function(value) {
  6801. var result = baseGetTag(value),
  6802. Ctor = result == objectTag ? value.constructor : undefined,
  6803. ctorString = Ctor ? toSource(Ctor) : '';
  6804. if (ctorString) {
  6805. switch (ctorString) {
  6806. case dataViewCtorString: return dataViewTag;
  6807. case mapCtorString: return mapTag;
  6808. case promiseCtorString: return promiseTag;
  6809. case setCtorString: return setTag;
  6810. case weakMapCtorString: return weakMapTag;
  6811. }
  6812. }
  6813. return result;
  6814. };
  6815. }
  6816. /**
  6817. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6818. *
  6819. * @private
  6820. * @param {number} start The start of the view.
  6821. * @param {number} end The end of the view.
  6822. * @param {Array} transforms The transformations to apply to the view.
  6823. * @returns {Object} Returns an object containing the `start` and `end`
  6824. * positions of the view.
  6825. */
  6826. function getView(start, end, transforms) {
  6827. var index = -1,
  6828. length = transforms.length;
  6829. while (++index < length) {
  6830. var data = transforms[index],
  6831. size = data.size;
  6832. switch (data.type) {
  6833. case 'drop': start += size; break;
  6834. case 'dropRight': end -= size; break;
  6835. case 'take': end = nativeMin(end, start + size); break;
  6836. case 'takeRight': start = nativeMax(start, end - size); break;
  6837. }
  6838. }
  6839. return { 'start': start, 'end': end };
  6840. }
  6841. /**
  6842. * Extracts wrapper details from the `source` body comment.
  6843. *
  6844. * @private
  6845. * @param {string} source The source to inspect.
  6846. * @returns {Array} Returns the wrapper details.
  6847. */
  6848. function getWrapDetails(source) {
  6849. var match = source.match(reWrapDetails);
  6850. return match ? match[1].split(reSplitDetails) : [];
  6851. }
  6852. /**
  6853. * Checks if `path` exists on `object`.
  6854. *
  6855. * @private
  6856. * @param {Object} object The object to query.
  6857. * @param {Array|string} path The path to check.
  6858. * @param {Function} hasFunc The function to check properties.
  6859. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6860. */
  6861. function hasPath(object, path, hasFunc) {
  6862. path = castPath(path, object);
  6863. var index = -1,
  6864. length = path.length,
  6865. result = false;
  6866. while (++index < length) {
  6867. var key = toKey(path[index]);
  6868. if (!(result = object != null && hasFunc(object, key))) {
  6869. break;
  6870. }
  6871. object = object[key];
  6872. }
  6873. if (result || ++index != length) {
  6874. return result;
  6875. }
  6876. length = object == null ? 0 : object.length;
  6877. return !!length && isLength(length) && isIndex(key, length) &&
  6878. (isArray(object) || isArguments(object));
  6879. }
  6880. /**
  6881. * Initializes an array clone.
  6882. *
  6883. * @private
  6884. * @param {Array} array The array to clone.
  6885. * @returns {Array} Returns the initialized clone.
  6886. */
  6887. function initCloneArray(array) {
  6888. var length = array.length,
  6889. result = new array.constructor(length);
  6890. // Add properties assigned by `RegExp#exec`.
  6891. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6892. result.index = array.index;
  6893. result.input = array.input;
  6894. }
  6895. return result;
  6896. }
  6897. /**
  6898. * Initializes an object clone.
  6899. *
  6900. * @private
  6901. * @param {Object} object The object to clone.
  6902. * @returns {Object} Returns the initialized clone.
  6903. */
  6904. function initCloneObject(object) {
  6905. return (typeof object.constructor == 'function' && !isPrototype(object))
  6906. ? baseCreate(getPrototype(object))
  6907. : {};
  6908. }
  6909. /**
  6910. * Initializes an object clone based on its `toStringTag`.
  6911. *
  6912. * **Note:** This function only supports cloning values with tags of
  6913. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6914. *
  6915. * @private
  6916. * @param {Object} object The object to clone.
  6917. * @param {string} tag The `toStringTag` of the object to clone.
  6918. * @param {boolean} [isDeep] Specify a deep clone.
  6919. * @returns {Object} Returns the initialized clone.
  6920. */
  6921. function initCloneByTag(object, tag, isDeep) {
  6922. var Ctor = object.constructor;
  6923. switch (tag) {
  6924. case arrayBufferTag:
  6925. return cloneArrayBuffer(object);
  6926. case boolTag:
  6927. case dateTag:
  6928. return new Ctor(+object);
  6929. case dataViewTag:
  6930. return cloneDataView(object, isDeep);
  6931. case float32Tag: case float64Tag:
  6932. case int8Tag: case int16Tag: case int32Tag:
  6933. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6934. return cloneTypedArray(object, isDeep);
  6935. case mapTag:
  6936. return new Ctor;
  6937. case numberTag:
  6938. case stringTag:
  6939. return new Ctor(object);
  6940. case regexpTag:
  6941. return cloneRegExp(object);
  6942. case setTag:
  6943. return new Ctor;
  6944. case symbolTag:
  6945. return cloneSymbol(object);
  6946. }
  6947. }
  6948. /**
  6949. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6950. *
  6951. * @private
  6952. * @param {string} source The source to modify.
  6953. * @returns {Array} details The details to insert.
  6954. * @returns {string} Returns the modified source.
  6955. */
  6956. function insertWrapDetails(source, details) {
  6957. var length = details.length;
  6958. if (!length) {
  6959. return source;
  6960. }
  6961. var lastIndex = length - 1;
  6962. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6963. details = details.join(length > 2 ? ', ' : ' ');
  6964. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6965. }
  6966. /**
  6967. * Checks if `value` is a flattenable `arguments` object or array.
  6968. *
  6969. * @private
  6970. * @param {*} value The value to check.
  6971. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6972. */
  6973. function isFlattenable(value) {
  6974. return isArray(value) || isArguments(value) ||
  6975. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6976. }
  6977. /**
  6978. * Checks if `value` is a valid array-like index.
  6979. *
  6980. * @private
  6981. * @param {*} value The value to check.
  6982. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6983. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6984. */
  6985. function isIndex(value, length) {
  6986. var type = typeof value;
  6987. length = length == null ? MAX_SAFE_INTEGER : length;
  6988. return !!length &&
  6989. (type == 'number' ||
  6990. (type != 'symbol' && reIsUint.test(value))) &&
  6991. (value > -1 && value % 1 == 0 && value < length);
  6992. }
  6993. /**
  6994. * Checks if the given arguments are from an iteratee call.
  6995. *
  6996. * @private
  6997. * @param {*} value The potential iteratee value argument.
  6998. * @param {*} index The potential iteratee index or key argument.
  6999. * @param {*} object The potential iteratee object argument.
  7000. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7001. * else `false`.
  7002. */
  7003. function isIterateeCall(value, index, object) {
  7004. if (!isObject(object)) {
  7005. return false;
  7006. }
  7007. var type = typeof index;
  7008. if (type == 'number'
  7009. ? (isArrayLike(object) && isIndex(index, object.length))
  7010. : (type == 'string' && index in object)
  7011. ) {
  7012. return eq(object[index], value);
  7013. }
  7014. return false;
  7015. }
  7016. /**
  7017. * Checks if `value` is a property name and not a property path.
  7018. *
  7019. * @private
  7020. * @param {*} value The value to check.
  7021. * @param {Object} [object] The object to query keys on.
  7022. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7023. */
  7024. function isKey(value, object) {
  7025. if (isArray(value)) {
  7026. return false;
  7027. }
  7028. var type = typeof value;
  7029. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7030. value == null || isSymbol(value)) {
  7031. return true;
  7032. }
  7033. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7034. (object != null && value in Object(object));
  7035. }
  7036. /**
  7037. * Checks if `value` is suitable for use as unique object key.
  7038. *
  7039. * @private
  7040. * @param {*} value The value to check.
  7041. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7042. */
  7043. function isKeyable(value) {
  7044. var type = typeof value;
  7045. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7046. ? (value !== '__proto__')
  7047. : (value === null);
  7048. }
  7049. /**
  7050. * Checks if `func` has a lazy counterpart.
  7051. *
  7052. * @private
  7053. * @param {Function} func The function to check.
  7054. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7055. * else `false`.
  7056. */
  7057. function isLaziable(func) {
  7058. var funcName = getFuncName(func),
  7059. other = lodash[funcName];
  7060. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7061. return false;
  7062. }
  7063. if (func === other) {
  7064. return true;
  7065. }
  7066. var data = getData(other);
  7067. return !!data && func === data[0];
  7068. }
  7069. /**
  7070. * Checks if `func` has its source masked.
  7071. *
  7072. * @private
  7073. * @param {Function} func The function to check.
  7074. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7075. */
  7076. function isMasked(func) {
  7077. return !!maskSrcKey && (maskSrcKey in func);
  7078. }
  7079. /**
  7080. * Checks if `func` is capable of being masked.
  7081. *
  7082. * @private
  7083. * @param {*} value The value to check.
  7084. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7085. */
  7086. var isMaskable = coreJsData ? isFunction : stubFalse;
  7087. /**
  7088. * Checks if `value` is likely a prototype object.
  7089. *
  7090. * @private
  7091. * @param {*} value The value to check.
  7092. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7093. */
  7094. function isPrototype(value) {
  7095. var Ctor = value && value.constructor,
  7096. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7097. return value === proto;
  7098. }
  7099. /**
  7100. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7101. *
  7102. * @private
  7103. * @param {*} value The value to check.
  7104. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7105. * equality comparisons, else `false`.
  7106. */
  7107. function isStrictComparable(value) {
  7108. return value === value && !isObject(value);
  7109. }
  7110. /**
  7111. * A specialized version of `matchesProperty` for source values suitable
  7112. * for strict equality comparisons, i.e. `===`.
  7113. *
  7114. * @private
  7115. * @param {string} key The key of the property to get.
  7116. * @param {*} srcValue The value to match.
  7117. * @returns {Function} Returns the new spec function.
  7118. */
  7119. function matchesStrictComparable(key, srcValue) {
  7120. return function(object) {
  7121. if (object == null) {
  7122. return false;
  7123. }
  7124. return object[key] === srcValue &&
  7125. (srcValue !== undefined || (key in Object(object)));
  7126. };
  7127. }
  7128. /**
  7129. * A specialized version of `_.memoize` which clears the memoized function's
  7130. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7131. *
  7132. * @private
  7133. * @param {Function} func The function to have its output memoized.
  7134. * @returns {Function} Returns the new memoized function.
  7135. */
  7136. function memoizeCapped(func) {
  7137. var result = memoize(func, function(key) {
  7138. if (cache.size === MAX_MEMOIZE_SIZE) {
  7139. cache.clear();
  7140. }
  7141. return key;
  7142. });
  7143. var cache = result.cache;
  7144. return result;
  7145. }
  7146. /**
  7147. * Merges the function metadata of `source` into `data`.
  7148. *
  7149. * Merging metadata reduces the number of wrappers used to invoke a function.
  7150. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7151. * may be applied regardless of execution order. Methods like `_.ary` and
  7152. * `_.rearg` modify function arguments, making the order in which they are
  7153. * executed important, preventing the merging of metadata. However, we make
  7154. * an exception for a safe combined case where curried functions have `_.ary`
  7155. * and or `_.rearg` applied.
  7156. *
  7157. * @private
  7158. * @param {Array} data The destination metadata.
  7159. * @param {Array} source The source metadata.
  7160. * @returns {Array} Returns `data`.
  7161. */
  7162. function mergeData(data, source) {
  7163. var bitmask = data[1],
  7164. srcBitmask = source[1],
  7165. newBitmask = bitmask | srcBitmask,
  7166. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7167. var isCombo =
  7168. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7169. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7170. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7171. // Exit early if metadata can't be merged.
  7172. if (!(isCommon || isCombo)) {
  7173. return data;
  7174. }
  7175. // Use source `thisArg` if available.
  7176. if (srcBitmask & WRAP_BIND_FLAG) {
  7177. data[2] = source[2];
  7178. // Set when currying a bound function.
  7179. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7180. }
  7181. // Compose partial arguments.
  7182. var value = source[3];
  7183. if (value) {
  7184. var partials = data[3];
  7185. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7186. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7187. }
  7188. // Compose partial right arguments.
  7189. value = source[5];
  7190. if (value) {
  7191. partials = data[5];
  7192. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7193. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7194. }
  7195. // Use source `argPos` if available.
  7196. value = source[7];
  7197. if (value) {
  7198. data[7] = value;
  7199. }
  7200. // Use source `ary` if it's smaller.
  7201. if (srcBitmask & WRAP_ARY_FLAG) {
  7202. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7203. }
  7204. // Use source `arity` if one is not provided.
  7205. if (data[9] == null) {
  7206. data[9] = source[9];
  7207. }
  7208. // Use source `func` and merge bitmasks.
  7209. data[0] = source[0];
  7210. data[1] = newBitmask;
  7211. return data;
  7212. }
  7213. /**
  7214. * This function is like
  7215. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7216. * except that it includes inherited enumerable properties.
  7217. *
  7218. * @private
  7219. * @param {Object} object The object to query.
  7220. * @returns {Array} Returns the array of property names.
  7221. */
  7222. function nativeKeysIn(object) {
  7223. var result = [];
  7224. if (object != null) {
  7225. for (var key in Object(object)) {
  7226. result.push(key);
  7227. }
  7228. }
  7229. return result;
  7230. }
  7231. /**
  7232. * Converts `value` to a string using `Object.prototype.toString`.
  7233. *
  7234. * @private
  7235. * @param {*} value The value to convert.
  7236. * @returns {string} Returns the converted string.
  7237. */
  7238. function objectToString(value) {
  7239. return nativeObjectToString.call(value);
  7240. }
  7241. /**
  7242. * A specialized version of `baseRest` which transforms the rest array.
  7243. *
  7244. * @private
  7245. * @param {Function} func The function to apply a rest parameter to.
  7246. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7247. * @param {Function} transform The rest array transform.
  7248. * @returns {Function} Returns the new function.
  7249. */
  7250. function overRest(func, start, transform) {
  7251. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7252. return function() {
  7253. var args = arguments,
  7254. index = -1,
  7255. length = nativeMax(args.length - start, 0),
  7256. array = Array(length);
  7257. while (++index < length) {
  7258. array[index] = args[start + index];
  7259. }
  7260. index = -1;
  7261. var otherArgs = Array(start + 1);
  7262. while (++index < start) {
  7263. otherArgs[index] = args[index];
  7264. }
  7265. otherArgs[start] = transform(array);
  7266. return apply(func, this, otherArgs);
  7267. };
  7268. }
  7269. /**
  7270. * Gets the parent value at `path` of `object`.
  7271. *
  7272. * @private
  7273. * @param {Object} object The object to query.
  7274. * @param {Array} path The path to get the parent value of.
  7275. * @returns {*} Returns the parent value.
  7276. */
  7277. function parent(object, path) {
  7278. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7279. }
  7280. /**
  7281. * Reorder `array` according to the specified indexes where the element at
  7282. * the first index is assigned as the first element, the element at
  7283. * the second index is assigned as the second element, and so on.
  7284. *
  7285. * @private
  7286. * @param {Array} array The array to reorder.
  7287. * @param {Array} indexes The arranged array indexes.
  7288. * @returns {Array} Returns `array`.
  7289. */
  7290. function reorder(array, indexes) {
  7291. var arrLength = array.length,
  7292. length = nativeMin(indexes.length, arrLength),
  7293. oldArray = copyArray(array);
  7294. while (length--) {
  7295. var index = indexes[length];
  7296. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7297. }
  7298. return array;
  7299. }
  7300. /**
  7301. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7302. *
  7303. * @private
  7304. * @param {Object} object The object to query.
  7305. * @param {string} key The key of the property to get.
  7306. * @returns {*} Returns the property value.
  7307. */
  7308. function safeGet(object, key) {
  7309. if (key === 'constructor' && typeof object[key] === 'function') {
  7310. return;
  7311. }
  7312. if (key == '__proto__') {
  7313. return;
  7314. }
  7315. return object[key];
  7316. }
  7317. /**
  7318. * Sets metadata for `func`.
  7319. *
  7320. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7321. * period of time, it will trip its breaker and transition to an identity
  7322. * function to avoid garbage collection pauses in V8. See
  7323. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7324. * for more details.
  7325. *
  7326. * @private
  7327. * @param {Function} func The function to associate metadata with.
  7328. * @param {*} data The metadata.
  7329. * @returns {Function} Returns `func`.
  7330. */
  7331. var setData = shortOut(baseSetData);
  7332. /**
  7333. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7334. *
  7335. * @private
  7336. * @param {Function} func The function to delay.
  7337. * @param {number} wait The number of milliseconds to delay invocation.
  7338. * @returns {number|Object} Returns the timer id or timeout object.
  7339. */
  7340. var setTimeout = ctxSetTimeout || function(func, wait) {
  7341. return root.setTimeout(func, wait);
  7342. };
  7343. /**
  7344. * Sets the `toString` method of `func` to return `string`.
  7345. *
  7346. * @private
  7347. * @param {Function} func The function to modify.
  7348. * @param {Function} string The `toString` result.
  7349. * @returns {Function} Returns `func`.
  7350. */
  7351. var setToString = shortOut(baseSetToString);
  7352. /**
  7353. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7354. * with wrapper details in a comment at the top of the source body.
  7355. *
  7356. * @private
  7357. * @param {Function} wrapper The function to modify.
  7358. * @param {Function} reference The reference function.
  7359. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7360. * @returns {Function} Returns `wrapper`.
  7361. */
  7362. function setWrapToString(wrapper, reference, bitmask) {
  7363. var source = (reference + '');
  7364. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7365. }
  7366. /**
  7367. * Creates a function that'll short out and invoke `identity` instead
  7368. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7369. * milliseconds.
  7370. *
  7371. * @private
  7372. * @param {Function} func The function to restrict.
  7373. * @returns {Function} Returns the new shortable function.
  7374. */
  7375. function shortOut(func) {
  7376. var count = 0,
  7377. lastCalled = 0;
  7378. return function() {
  7379. var stamp = nativeNow(),
  7380. remaining = HOT_SPAN - (stamp - lastCalled);
  7381. lastCalled = stamp;
  7382. if (remaining > 0) {
  7383. if (++count >= HOT_COUNT) {
  7384. return arguments[0];
  7385. }
  7386. } else {
  7387. count = 0;
  7388. }
  7389. return func.apply(undefined, arguments);
  7390. };
  7391. }
  7392. /**
  7393. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7394. *
  7395. * @private
  7396. * @param {Array} array The array to shuffle.
  7397. * @param {number} [size=array.length] The size of `array`.
  7398. * @returns {Array} Returns `array`.
  7399. */
  7400. function shuffleSelf(array, size) {
  7401. var index = -1,
  7402. length = array.length,
  7403. lastIndex = length - 1;
  7404. size = size === undefined ? length : size;
  7405. while (++index < size) {
  7406. var rand = baseRandom(index, lastIndex),
  7407. value = array[rand];
  7408. array[rand] = array[index];
  7409. array[index] = value;
  7410. }
  7411. array.length = size;
  7412. return array;
  7413. }
  7414. /**
  7415. * Converts `string` to a property path array.
  7416. *
  7417. * @private
  7418. * @param {string} string The string to convert.
  7419. * @returns {Array} Returns the property path array.
  7420. */
  7421. var stringToPath = memoizeCapped(function(string) {
  7422. var result = [];
  7423. if (string.charCodeAt(0) === 46 /* . */) {
  7424. result.push('');
  7425. }
  7426. string.replace(rePropName, function(match, number, quote, subString) {
  7427. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7428. });
  7429. return result;
  7430. });
  7431. /**
  7432. * Converts `value` to a string key if it's not a string or symbol.
  7433. *
  7434. * @private
  7435. * @param {*} value The value to inspect.
  7436. * @returns {string|symbol} Returns the key.
  7437. */
  7438. function toKey(value) {
  7439. if (typeof value == 'string' || isSymbol(value)) {
  7440. return value;
  7441. }
  7442. var result = (value + '');
  7443. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7444. }
  7445. /**
  7446. * Converts `func` to its source code.
  7447. *
  7448. * @private
  7449. * @param {Function} func The function to convert.
  7450. * @returns {string} Returns the source code.
  7451. */
  7452. function toSource(func) {
  7453. if (func != null) {
  7454. try {
  7455. return funcToString.call(func);
  7456. } catch (e) {}
  7457. try {
  7458. return (func + '');
  7459. } catch (e) {}
  7460. }
  7461. return '';
  7462. }
  7463. /**
  7464. * Updates wrapper `details` based on `bitmask` flags.
  7465. *
  7466. * @private
  7467. * @returns {Array} details The details to modify.
  7468. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7469. * @returns {Array} Returns `details`.
  7470. */
  7471. function updateWrapDetails(details, bitmask) {
  7472. arrayEach(wrapFlags, function(pair) {
  7473. var value = '_.' + pair[0];
  7474. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7475. details.push(value);
  7476. }
  7477. });
  7478. return details.sort();
  7479. }
  7480. /**
  7481. * Creates a clone of `wrapper`.
  7482. *
  7483. * @private
  7484. * @param {Object} wrapper The wrapper to clone.
  7485. * @returns {Object} Returns the cloned wrapper.
  7486. */
  7487. function wrapperClone(wrapper) {
  7488. if (wrapper instanceof LazyWrapper) {
  7489. return wrapper.clone();
  7490. }
  7491. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7492. result.__actions__ = copyArray(wrapper.__actions__);
  7493. result.__index__ = wrapper.__index__;
  7494. result.__values__ = wrapper.__values__;
  7495. return result;
  7496. }
  7497. /*------------------------------------------------------------------------*/
  7498. /**
  7499. * Creates an array of elements split into groups the length of `size`.
  7500. * If `array` can't be split evenly, the final chunk will be the remaining
  7501. * elements.
  7502. *
  7503. * @static
  7504. * @memberOf _
  7505. * @since 3.0.0
  7506. * @category Array
  7507. * @param {Array} array The array to process.
  7508. * @param {number} [size=1] The length of each chunk
  7509. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7510. * @returns {Array} Returns the new array of chunks.
  7511. * @example
  7512. *
  7513. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7514. * // => [['a', 'b'], ['c', 'd']]
  7515. *
  7516. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7517. * // => [['a', 'b', 'c'], ['d']]
  7518. */
  7519. function chunk(array, size, guard) {
  7520. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7521. size = 1;
  7522. } else {
  7523. size = nativeMax(toInteger(size), 0);
  7524. }
  7525. var length = array == null ? 0 : array.length;
  7526. if (!length || size < 1) {
  7527. return [];
  7528. }
  7529. var index = 0,
  7530. resIndex = 0,
  7531. result = Array(nativeCeil(length / size));
  7532. while (index < length) {
  7533. result[resIndex++] = baseSlice(array, index, (index += size));
  7534. }
  7535. return result;
  7536. }
  7537. /**
  7538. * Creates an array with all falsey values removed. The values `false`, `null`,
  7539. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7540. *
  7541. * @static
  7542. * @memberOf _
  7543. * @since 0.1.0
  7544. * @category Array
  7545. * @param {Array} array The array to compact.
  7546. * @returns {Array} Returns the new array of filtered values.
  7547. * @example
  7548. *
  7549. * _.compact([0, 1, false, 2, '', 3]);
  7550. * // => [1, 2, 3]
  7551. */
  7552. function compact(array) {
  7553. var index = -1,
  7554. length = array == null ? 0 : array.length,
  7555. resIndex = 0,
  7556. result = [];
  7557. while (++index < length) {
  7558. var value = array[index];
  7559. if (value) {
  7560. result[resIndex++] = value;
  7561. }
  7562. }
  7563. return result;
  7564. }
  7565. /**
  7566. * Creates a new array concatenating `array` with any additional arrays
  7567. * and/or values.
  7568. *
  7569. * @static
  7570. * @memberOf _
  7571. * @since 4.0.0
  7572. * @category Array
  7573. * @param {Array} array The array to concatenate.
  7574. * @param {...*} [values] The values to concatenate.
  7575. * @returns {Array} Returns the new concatenated array.
  7576. * @example
  7577. *
  7578. * var array = [1];
  7579. * var other = _.concat(array, 2, [3], [[4]]);
  7580. *
  7581. * console.log(other);
  7582. * // => [1, 2, 3, [4]]
  7583. *
  7584. * console.log(array);
  7585. * // => [1]
  7586. */
  7587. function concat() {
  7588. var length = arguments.length;
  7589. if (!length) {
  7590. return [];
  7591. }
  7592. var args = Array(length - 1),
  7593. array = arguments[0],
  7594. index = length;
  7595. while (index--) {
  7596. args[index - 1] = arguments[index];
  7597. }
  7598. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7599. }
  7600. /**
  7601. * Creates an array of `array` values not included in the other given arrays
  7602. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7603. * for equality comparisons. The order and references of result values are
  7604. * determined by the first array.
  7605. *
  7606. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7607. *
  7608. * @static
  7609. * @memberOf _
  7610. * @since 0.1.0
  7611. * @category Array
  7612. * @param {Array} array The array to inspect.
  7613. * @param {...Array} [values] The values to exclude.
  7614. * @returns {Array} Returns the new array of filtered values.
  7615. * @see _.without, _.xor
  7616. * @example
  7617. *
  7618. * _.difference([2, 1], [2, 3]);
  7619. * // => [1]
  7620. */
  7621. var difference = baseRest(function(array, values) {
  7622. return isArrayLikeObject(array)
  7623. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7624. : [];
  7625. });
  7626. /**
  7627. * This method is like `_.difference` except that it accepts `iteratee` which
  7628. * is invoked for each element of `array` and `values` to generate the criterion
  7629. * by which they're compared. The order and references of result values are
  7630. * determined by the first array. The iteratee is invoked with one argument:
  7631. * (value).
  7632. *
  7633. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7634. *
  7635. * @static
  7636. * @memberOf _
  7637. * @since 4.0.0
  7638. * @category Array
  7639. * @param {Array} array The array to inspect.
  7640. * @param {...Array} [values] The values to exclude.
  7641. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7642. * @returns {Array} Returns the new array of filtered values.
  7643. * @example
  7644. *
  7645. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7646. * // => [1.2]
  7647. *
  7648. * // The `_.property` iteratee shorthand.
  7649. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7650. * // => [{ 'x': 2 }]
  7651. */
  7652. var differenceBy = baseRest(function(array, values) {
  7653. var iteratee = last(values);
  7654. if (isArrayLikeObject(iteratee)) {
  7655. iteratee = undefined;
  7656. }
  7657. return isArrayLikeObject(array)
  7658. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7659. : [];
  7660. });
  7661. /**
  7662. * This method is like `_.difference` except that it accepts `comparator`
  7663. * which is invoked to compare elements of `array` to `values`. The order and
  7664. * references of result values are determined by the first array. The comparator
  7665. * is invoked with two arguments: (arrVal, othVal).
  7666. *
  7667. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7668. *
  7669. * @static
  7670. * @memberOf _
  7671. * @since 4.0.0
  7672. * @category Array
  7673. * @param {Array} array The array to inspect.
  7674. * @param {...Array} [values] The values to exclude.
  7675. * @param {Function} [comparator] The comparator invoked per element.
  7676. * @returns {Array} Returns the new array of filtered values.
  7677. * @example
  7678. *
  7679. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7680. *
  7681. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7682. * // => [{ 'x': 2, 'y': 1 }]
  7683. */
  7684. var differenceWith = baseRest(function(array, values) {
  7685. var comparator = last(values);
  7686. if (isArrayLikeObject(comparator)) {
  7687. comparator = undefined;
  7688. }
  7689. return isArrayLikeObject(array)
  7690. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7691. : [];
  7692. });
  7693. /**
  7694. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7695. *
  7696. * @static
  7697. * @memberOf _
  7698. * @since 0.5.0
  7699. * @category Array
  7700. * @param {Array} array The array to query.
  7701. * @param {number} [n=1] The number of elements to drop.
  7702. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7703. * @returns {Array} Returns the slice of `array`.
  7704. * @example
  7705. *
  7706. * _.drop([1, 2, 3]);
  7707. * // => [2, 3]
  7708. *
  7709. * _.drop([1, 2, 3], 2);
  7710. * // => [3]
  7711. *
  7712. * _.drop([1, 2, 3], 5);
  7713. * // => []
  7714. *
  7715. * _.drop([1, 2, 3], 0);
  7716. * // => [1, 2, 3]
  7717. */
  7718. function drop(array, n, guard) {
  7719. var length = array == null ? 0 : array.length;
  7720. if (!length) {
  7721. return [];
  7722. }
  7723. n = (guard || n === undefined) ? 1 : toInteger(n);
  7724. return baseSlice(array, n < 0 ? 0 : n, length);
  7725. }
  7726. /**
  7727. * Creates a slice of `array` with `n` elements dropped from the end.
  7728. *
  7729. * @static
  7730. * @memberOf _
  7731. * @since 3.0.0
  7732. * @category Array
  7733. * @param {Array} array The array to query.
  7734. * @param {number} [n=1] The number of elements to drop.
  7735. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7736. * @returns {Array} Returns the slice of `array`.
  7737. * @example
  7738. *
  7739. * _.dropRight([1, 2, 3]);
  7740. * // => [1, 2]
  7741. *
  7742. * _.dropRight([1, 2, 3], 2);
  7743. * // => [1]
  7744. *
  7745. * _.dropRight([1, 2, 3], 5);
  7746. * // => []
  7747. *
  7748. * _.dropRight([1, 2, 3], 0);
  7749. * // => [1, 2, 3]
  7750. */
  7751. function dropRight(array, n, guard) {
  7752. var length = array == null ? 0 : array.length;
  7753. if (!length) {
  7754. return [];
  7755. }
  7756. n = (guard || n === undefined) ? 1 : toInteger(n);
  7757. n = length - n;
  7758. return baseSlice(array, 0, n < 0 ? 0 : n);
  7759. }
  7760. /**
  7761. * Creates a slice of `array` excluding elements dropped from the end.
  7762. * Elements are dropped until `predicate` returns falsey. The predicate is
  7763. * invoked with three arguments: (value, index, array).
  7764. *
  7765. * @static
  7766. * @memberOf _
  7767. * @since 3.0.0
  7768. * @category Array
  7769. * @param {Array} array The array to query.
  7770. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7771. * @returns {Array} Returns the slice of `array`.
  7772. * @example
  7773. *
  7774. * var users = [
  7775. * { 'user': 'barney', 'active': true },
  7776. * { 'user': 'fred', 'active': false },
  7777. * { 'user': 'pebbles', 'active': false }
  7778. * ];
  7779. *
  7780. * _.dropRightWhile(users, function(o) { return !o.active; });
  7781. * // => objects for ['barney']
  7782. *
  7783. * // The `_.matches` iteratee shorthand.
  7784. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7785. * // => objects for ['barney', 'fred']
  7786. *
  7787. * // The `_.matchesProperty` iteratee shorthand.
  7788. * _.dropRightWhile(users, ['active', false]);
  7789. * // => objects for ['barney']
  7790. *
  7791. * // The `_.property` iteratee shorthand.
  7792. * _.dropRightWhile(users, 'active');
  7793. * // => objects for ['barney', 'fred', 'pebbles']
  7794. */
  7795. function dropRightWhile(array, predicate) {
  7796. return (array && array.length)
  7797. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7798. : [];
  7799. }
  7800. /**
  7801. * Creates a slice of `array` excluding elements dropped from the beginning.
  7802. * Elements are dropped until `predicate` returns falsey. The predicate is
  7803. * invoked with three arguments: (value, index, array).
  7804. *
  7805. * @static
  7806. * @memberOf _
  7807. * @since 3.0.0
  7808. * @category Array
  7809. * @param {Array} array The array to query.
  7810. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7811. * @returns {Array} Returns the slice of `array`.
  7812. * @example
  7813. *
  7814. * var users = [
  7815. * { 'user': 'barney', 'active': false },
  7816. * { 'user': 'fred', 'active': false },
  7817. * { 'user': 'pebbles', 'active': true }
  7818. * ];
  7819. *
  7820. * _.dropWhile(users, function(o) { return !o.active; });
  7821. * // => objects for ['pebbles']
  7822. *
  7823. * // The `_.matches` iteratee shorthand.
  7824. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7825. * // => objects for ['fred', 'pebbles']
  7826. *
  7827. * // The `_.matchesProperty` iteratee shorthand.
  7828. * _.dropWhile(users, ['active', false]);
  7829. * // => objects for ['pebbles']
  7830. *
  7831. * // The `_.property` iteratee shorthand.
  7832. * _.dropWhile(users, 'active');
  7833. * // => objects for ['barney', 'fred', 'pebbles']
  7834. */
  7835. function dropWhile(array, predicate) {
  7836. return (array && array.length)
  7837. ? baseWhile(array, getIteratee(predicate, 3), true)
  7838. : [];
  7839. }
  7840. /**
  7841. * Fills elements of `array` with `value` from `start` up to, but not
  7842. * including, `end`.
  7843. *
  7844. * **Note:** This method mutates `array`.
  7845. *
  7846. * @static
  7847. * @memberOf _
  7848. * @since 3.2.0
  7849. * @category Array
  7850. * @param {Array} array The array to fill.
  7851. * @param {*} value The value to fill `array` with.
  7852. * @param {number} [start=0] The start position.
  7853. * @param {number} [end=array.length] The end position.
  7854. * @returns {Array} Returns `array`.
  7855. * @example
  7856. *
  7857. * var array = [1, 2, 3];
  7858. *
  7859. * _.fill(array, 'a');
  7860. * console.log(array);
  7861. * // => ['a', 'a', 'a']
  7862. *
  7863. * _.fill(Array(3), 2);
  7864. * // => [2, 2, 2]
  7865. *
  7866. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7867. * // => [4, '*', '*', 10]
  7868. */
  7869. function fill(array, value, start, end) {
  7870. var length = array == null ? 0 : array.length;
  7871. if (!length) {
  7872. return [];
  7873. }
  7874. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7875. start = 0;
  7876. end = length;
  7877. }
  7878. return baseFill(array, value, start, end);
  7879. }
  7880. /**
  7881. * This method is like `_.find` except that it returns the index of the first
  7882. * element `predicate` returns truthy for instead of the element itself.
  7883. *
  7884. * @static
  7885. * @memberOf _
  7886. * @since 1.1.0
  7887. * @category Array
  7888. * @param {Array} array The array to inspect.
  7889. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7890. * @param {number} [fromIndex=0] The index to search from.
  7891. * @returns {number} Returns the index of the found element, else `-1`.
  7892. * @example
  7893. *
  7894. * var users = [
  7895. * { 'user': 'barney', 'active': false },
  7896. * { 'user': 'fred', 'active': false },
  7897. * { 'user': 'pebbles', 'active': true }
  7898. * ];
  7899. *
  7900. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7901. * // => 0
  7902. *
  7903. * // The `_.matches` iteratee shorthand.
  7904. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7905. * // => 1
  7906. *
  7907. * // The `_.matchesProperty` iteratee shorthand.
  7908. * _.findIndex(users, ['active', false]);
  7909. * // => 0
  7910. *
  7911. * // The `_.property` iteratee shorthand.
  7912. * _.findIndex(users, 'active');
  7913. * // => 2
  7914. */
  7915. function findIndex(array, predicate, fromIndex) {
  7916. var length = array == null ? 0 : array.length;
  7917. if (!length) {
  7918. return -1;
  7919. }
  7920. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7921. if (index < 0) {
  7922. index = nativeMax(length + index, 0);
  7923. }
  7924. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7925. }
  7926. /**
  7927. * This method is like `_.findIndex` except that it iterates over elements
  7928. * of `collection` from right to left.
  7929. *
  7930. * @static
  7931. * @memberOf _
  7932. * @since 2.0.0
  7933. * @category Array
  7934. * @param {Array} array The array to inspect.
  7935. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7936. * @param {number} [fromIndex=array.length-1] The index to search from.
  7937. * @returns {number} Returns the index of the found element, else `-1`.
  7938. * @example
  7939. *
  7940. * var users = [
  7941. * { 'user': 'barney', 'active': true },
  7942. * { 'user': 'fred', 'active': false },
  7943. * { 'user': 'pebbles', 'active': false }
  7944. * ];
  7945. *
  7946. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7947. * // => 2
  7948. *
  7949. * // The `_.matches` iteratee shorthand.
  7950. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7951. * // => 0
  7952. *
  7953. * // The `_.matchesProperty` iteratee shorthand.
  7954. * _.findLastIndex(users, ['active', false]);
  7955. * // => 2
  7956. *
  7957. * // The `_.property` iteratee shorthand.
  7958. * _.findLastIndex(users, 'active');
  7959. * // => 0
  7960. */
  7961. function findLastIndex(array, predicate, fromIndex) {
  7962. var length = array == null ? 0 : array.length;
  7963. if (!length) {
  7964. return -1;
  7965. }
  7966. var index = length - 1;
  7967. if (fromIndex !== undefined) {
  7968. index = toInteger(fromIndex);
  7969. index = fromIndex < 0
  7970. ? nativeMax(length + index, 0)
  7971. : nativeMin(index, length - 1);
  7972. }
  7973. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7974. }
  7975. /**
  7976. * Flattens `array` a single level deep.
  7977. *
  7978. * @static
  7979. * @memberOf _
  7980. * @since 0.1.0
  7981. * @category Array
  7982. * @param {Array} array The array to flatten.
  7983. * @returns {Array} Returns the new flattened array.
  7984. * @example
  7985. *
  7986. * _.flatten([1, [2, [3, [4]], 5]]);
  7987. * // => [1, 2, [3, [4]], 5]
  7988. */
  7989. function flatten(array) {
  7990. var length = array == null ? 0 : array.length;
  7991. return length ? baseFlatten(array, 1) : [];
  7992. }
  7993. /**
  7994. * Recursively flattens `array`.
  7995. *
  7996. * @static
  7997. * @memberOf _
  7998. * @since 3.0.0
  7999. * @category Array
  8000. * @param {Array} array The array to flatten.
  8001. * @returns {Array} Returns the new flattened array.
  8002. * @example
  8003. *
  8004. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8005. * // => [1, 2, 3, 4, 5]
  8006. */
  8007. function flattenDeep(array) {
  8008. var length = array == null ? 0 : array.length;
  8009. return length ? baseFlatten(array, INFINITY) : [];
  8010. }
  8011. /**
  8012. * Recursively flatten `array` up to `depth` times.
  8013. *
  8014. * @static
  8015. * @memberOf _
  8016. * @since 4.4.0
  8017. * @category Array
  8018. * @param {Array} array The array to flatten.
  8019. * @param {number} [depth=1] The maximum recursion depth.
  8020. * @returns {Array} Returns the new flattened array.
  8021. * @example
  8022. *
  8023. * var array = [1, [2, [3, [4]], 5]];
  8024. *
  8025. * _.flattenDepth(array, 1);
  8026. * // => [1, 2, [3, [4]], 5]
  8027. *
  8028. * _.flattenDepth(array, 2);
  8029. * // => [1, 2, 3, [4], 5]
  8030. */
  8031. function flattenDepth(array, depth) {
  8032. var length = array == null ? 0 : array.length;
  8033. if (!length) {
  8034. return [];
  8035. }
  8036. depth = depth === undefined ? 1 : toInteger(depth);
  8037. return baseFlatten(array, depth);
  8038. }
  8039. /**
  8040. * The inverse of `_.toPairs`; this method returns an object composed
  8041. * from key-value `pairs`.
  8042. *
  8043. * @static
  8044. * @memberOf _
  8045. * @since 4.0.0
  8046. * @category Array
  8047. * @param {Array} pairs The key-value pairs.
  8048. * @returns {Object} Returns the new object.
  8049. * @example
  8050. *
  8051. * _.fromPairs([['a', 1], ['b', 2]]);
  8052. * // => { 'a': 1, 'b': 2 }
  8053. */
  8054. function fromPairs(pairs) {
  8055. var index = -1,
  8056. length = pairs == null ? 0 : pairs.length,
  8057. result = {};
  8058. while (++index < length) {
  8059. var pair = pairs[index];
  8060. result[pair[0]] = pair[1];
  8061. }
  8062. return result;
  8063. }
  8064. /**
  8065. * Gets the first element of `array`.
  8066. *
  8067. * @static
  8068. * @memberOf _
  8069. * @since 0.1.0
  8070. * @alias first
  8071. * @category Array
  8072. * @param {Array} array The array to query.
  8073. * @returns {*} Returns the first element of `array`.
  8074. * @example
  8075. *
  8076. * _.head([1, 2, 3]);
  8077. * // => 1
  8078. *
  8079. * _.head([]);
  8080. * // => undefined
  8081. */
  8082. function head(array) {
  8083. return (array && array.length) ? array[0] : undefined;
  8084. }
  8085. /**
  8086. * Gets the index at which the first occurrence of `value` is found in `array`
  8087. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8088. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8089. * offset from the end of `array`.
  8090. *
  8091. * @static
  8092. * @memberOf _
  8093. * @since 0.1.0
  8094. * @category Array
  8095. * @param {Array} array The array to inspect.
  8096. * @param {*} value The value to search for.
  8097. * @param {number} [fromIndex=0] The index to search from.
  8098. * @returns {number} Returns the index of the matched value, else `-1`.
  8099. * @example
  8100. *
  8101. * _.indexOf([1, 2, 1, 2], 2);
  8102. * // => 1
  8103. *
  8104. * // Search from the `fromIndex`.
  8105. * _.indexOf([1, 2, 1, 2], 2, 2);
  8106. * // => 3
  8107. */
  8108. function indexOf(array, value, fromIndex) {
  8109. var length = array == null ? 0 : array.length;
  8110. if (!length) {
  8111. return -1;
  8112. }
  8113. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8114. if (index < 0) {
  8115. index = nativeMax(length + index, 0);
  8116. }
  8117. return baseIndexOf(array, value, index);
  8118. }
  8119. /**
  8120. * Gets all but the last element of `array`.
  8121. *
  8122. * @static
  8123. * @memberOf _
  8124. * @since 0.1.0
  8125. * @category Array
  8126. * @param {Array} array The array to query.
  8127. * @returns {Array} Returns the slice of `array`.
  8128. * @example
  8129. *
  8130. * _.initial([1, 2, 3]);
  8131. * // => [1, 2]
  8132. */
  8133. function initial(array) {
  8134. var length = array == null ? 0 : array.length;
  8135. return length ? baseSlice(array, 0, -1) : [];
  8136. }
  8137. /**
  8138. * Creates an array of unique values that are included in all given arrays
  8139. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8140. * for equality comparisons. The order and references of result values are
  8141. * determined by the first array.
  8142. *
  8143. * @static
  8144. * @memberOf _
  8145. * @since 0.1.0
  8146. * @category Array
  8147. * @param {...Array} [arrays] The arrays to inspect.
  8148. * @returns {Array} Returns the new array of intersecting values.
  8149. * @example
  8150. *
  8151. * _.intersection([2, 1], [2, 3]);
  8152. * // => [2]
  8153. */
  8154. var intersection = baseRest(function(arrays) {
  8155. var mapped = arrayMap(arrays, castArrayLikeObject);
  8156. return (mapped.length && mapped[0] === arrays[0])
  8157. ? baseIntersection(mapped)
  8158. : [];
  8159. });
  8160. /**
  8161. * This method is like `_.intersection` except that it accepts `iteratee`
  8162. * which is invoked for each element of each `arrays` to generate the criterion
  8163. * by which they're compared. The order and references of result values are
  8164. * determined by the first array. The iteratee is invoked with one argument:
  8165. * (value).
  8166. *
  8167. * @static
  8168. * @memberOf _
  8169. * @since 4.0.0
  8170. * @category Array
  8171. * @param {...Array} [arrays] The arrays to inspect.
  8172. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8173. * @returns {Array} Returns the new array of intersecting values.
  8174. * @example
  8175. *
  8176. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8177. * // => [2.1]
  8178. *
  8179. * // The `_.property` iteratee shorthand.
  8180. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8181. * // => [{ 'x': 1 }]
  8182. */
  8183. var intersectionBy = baseRest(function(arrays) {
  8184. var iteratee = last(arrays),
  8185. mapped = arrayMap(arrays, castArrayLikeObject);
  8186. if (iteratee === last(mapped)) {
  8187. iteratee = undefined;
  8188. } else {
  8189. mapped.pop();
  8190. }
  8191. return (mapped.length && mapped[0] === arrays[0])
  8192. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8193. : [];
  8194. });
  8195. /**
  8196. * This method is like `_.intersection` except that it accepts `comparator`
  8197. * which is invoked to compare elements of `arrays`. The order and references
  8198. * of result values are determined by the first array. The comparator is
  8199. * invoked with two arguments: (arrVal, othVal).
  8200. *
  8201. * @static
  8202. * @memberOf _
  8203. * @since 4.0.0
  8204. * @category Array
  8205. * @param {...Array} [arrays] The arrays to inspect.
  8206. * @param {Function} [comparator] The comparator invoked per element.
  8207. * @returns {Array} Returns the new array of intersecting values.
  8208. * @example
  8209. *
  8210. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8211. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8212. *
  8213. * _.intersectionWith(objects, others, _.isEqual);
  8214. * // => [{ 'x': 1, 'y': 2 }]
  8215. */
  8216. var intersectionWith = baseRest(function(arrays) {
  8217. var comparator = last(arrays),
  8218. mapped = arrayMap(arrays, castArrayLikeObject);
  8219. comparator = typeof comparator == 'function' ? comparator : undefined;
  8220. if (comparator) {
  8221. mapped.pop();
  8222. }
  8223. return (mapped.length && mapped[0] === arrays[0])
  8224. ? baseIntersection(mapped, undefined, comparator)
  8225. : [];
  8226. });
  8227. /**
  8228. * Converts all elements in `array` into a string separated by `separator`.
  8229. *
  8230. * @static
  8231. * @memberOf _
  8232. * @since 4.0.0
  8233. * @category Array
  8234. * @param {Array} array The array to convert.
  8235. * @param {string} [separator=','] The element separator.
  8236. * @returns {string} Returns the joined string.
  8237. * @example
  8238. *
  8239. * _.join(['a', 'b', 'c'], '~');
  8240. * // => 'a~b~c'
  8241. */
  8242. function join(array, separator) {
  8243. return array == null ? '' : nativeJoin.call(array, separator);
  8244. }
  8245. /**
  8246. * Gets the last element of `array`.
  8247. *
  8248. * @static
  8249. * @memberOf _
  8250. * @since 0.1.0
  8251. * @category Array
  8252. * @param {Array} array The array to query.
  8253. * @returns {*} Returns the last element of `array`.
  8254. * @example
  8255. *
  8256. * _.last([1, 2, 3]);
  8257. * // => 3
  8258. */
  8259. function last(array) {
  8260. var length = array == null ? 0 : array.length;
  8261. return length ? array[length - 1] : undefined;
  8262. }
  8263. /**
  8264. * This method is like `_.indexOf` except that it iterates over elements of
  8265. * `array` from right to left.
  8266. *
  8267. * @static
  8268. * @memberOf _
  8269. * @since 0.1.0
  8270. * @category Array
  8271. * @param {Array} array The array to inspect.
  8272. * @param {*} value The value to search for.
  8273. * @param {number} [fromIndex=array.length-1] The index to search from.
  8274. * @returns {number} Returns the index of the matched value, else `-1`.
  8275. * @example
  8276. *
  8277. * _.lastIndexOf([1, 2, 1, 2], 2);
  8278. * // => 3
  8279. *
  8280. * // Search from the `fromIndex`.
  8281. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8282. * // => 1
  8283. */
  8284. function lastIndexOf(array, value, fromIndex) {
  8285. var length = array == null ? 0 : array.length;
  8286. if (!length) {
  8287. return -1;
  8288. }
  8289. var index = length;
  8290. if (fromIndex !== undefined) {
  8291. index = toInteger(fromIndex);
  8292. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8293. }
  8294. return value === value
  8295. ? strictLastIndexOf(array, value, index)
  8296. : baseFindIndex(array, baseIsNaN, index, true);
  8297. }
  8298. /**
  8299. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8300. * element from the end is returned.
  8301. *
  8302. * @static
  8303. * @memberOf _
  8304. * @since 4.11.0
  8305. * @category Array
  8306. * @param {Array} array The array to query.
  8307. * @param {number} [n=0] The index of the element to return.
  8308. * @returns {*} Returns the nth element of `array`.
  8309. * @example
  8310. *
  8311. * var array = ['a', 'b', 'c', 'd'];
  8312. *
  8313. * _.nth(array, 1);
  8314. * // => 'b'
  8315. *
  8316. * _.nth(array, -2);
  8317. * // => 'c';
  8318. */
  8319. function nth(array, n) {
  8320. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8321. }
  8322. /**
  8323. * Removes all given values from `array` using
  8324. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8325. * for equality comparisons.
  8326. *
  8327. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8328. * to remove elements from an array by predicate.
  8329. *
  8330. * @static
  8331. * @memberOf _
  8332. * @since 2.0.0
  8333. * @category Array
  8334. * @param {Array} array The array to modify.
  8335. * @param {...*} [values] The values to remove.
  8336. * @returns {Array} Returns `array`.
  8337. * @example
  8338. *
  8339. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8340. *
  8341. * _.pull(array, 'a', 'c');
  8342. * console.log(array);
  8343. * // => ['b', 'b']
  8344. */
  8345. var pull = baseRest(pullAll);
  8346. /**
  8347. * This method is like `_.pull` except that it accepts an array of values to remove.
  8348. *
  8349. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8350. *
  8351. * @static
  8352. * @memberOf _
  8353. * @since 4.0.0
  8354. * @category Array
  8355. * @param {Array} array The array to modify.
  8356. * @param {Array} values The values to remove.
  8357. * @returns {Array} Returns `array`.
  8358. * @example
  8359. *
  8360. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8361. *
  8362. * _.pullAll(array, ['a', 'c']);
  8363. * console.log(array);
  8364. * // => ['b', 'b']
  8365. */
  8366. function pullAll(array, values) {
  8367. return (array && array.length && values && values.length)
  8368. ? basePullAll(array, values)
  8369. : array;
  8370. }
  8371. /**
  8372. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8373. * invoked for each element of `array` and `values` to generate the criterion
  8374. * by which they're compared. The iteratee is invoked with one argument: (value).
  8375. *
  8376. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8377. *
  8378. * @static
  8379. * @memberOf _
  8380. * @since 4.0.0
  8381. * @category Array
  8382. * @param {Array} array The array to modify.
  8383. * @param {Array} values The values to remove.
  8384. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8385. * @returns {Array} Returns `array`.
  8386. * @example
  8387. *
  8388. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8389. *
  8390. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8391. * console.log(array);
  8392. * // => [{ 'x': 2 }]
  8393. */
  8394. function pullAllBy(array, values, iteratee) {
  8395. return (array && array.length && values && values.length)
  8396. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8397. : array;
  8398. }
  8399. /**
  8400. * This method is like `_.pullAll` except that it accepts `comparator` which
  8401. * is invoked to compare elements of `array` to `values`. The comparator is
  8402. * invoked with two arguments: (arrVal, othVal).
  8403. *
  8404. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8405. *
  8406. * @static
  8407. * @memberOf _
  8408. * @since 4.6.0
  8409. * @category Array
  8410. * @param {Array} array The array to modify.
  8411. * @param {Array} values The values to remove.
  8412. * @param {Function} [comparator] The comparator invoked per element.
  8413. * @returns {Array} Returns `array`.
  8414. * @example
  8415. *
  8416. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8417. *
  8418. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8419. * console.log(array);
  8420. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8421. */
  8422. function pullAllWith(array, values, comparator) {
  8423. return (array && array.length && values && values.length)
  8424. ? basePullAll(array, values, undefined, comparator)
  8425. : array;
  8426. }
  8427. /**
  8428. * Removes elements from `array` corresponding to `indexes` and returns an
  8429. * array of removed elements.
  8430. *
  8431. * **Note:** Unlike `_.at`, this method mutates `array`.
  8432. *
  8433. * @static
  8434. * @memberOf _
  8435. * @since 3.0.0
  8436. * @category Array
  8437. * @param {Array} array The array to modify.
  8438. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8439. * @returns {Array} Returns the new array of removed elements.
  8440. * @example
  8441. *
  8442. * var array = ['a', 'b', 'c', 'd'];
  8443. * var pulled = _.pullAt(array, [1, 3]);
  8444. *
  8445. * console.log(array);
  8446. * // => ['a', 'c']
  8447. *
  8448. * console.log(pulled);
  8449. * // => ['b', 'd']
  8450. */
  8451. var pullAt = flatRest(function(array, indexes) {
  8452. var length = array == null ? 0 : array.length,
  8453. result = baseAt(array, indexes);
  8454. basePullAt(array, arrayMap(indexes, function(index) {
  8455. return isIndex(index, length) ? +index : index;
  8456. }).sort(compareAscending));
  8457. return result;
  8458. });
  8459. /**
  8460. * Removes all elements from `array` that `predicate` returns truthy for
  8461. * and returns an array of the removed elements. The predicate is invoked
  8462. * with three arguments: (value, index, array).
  8463. *
  8464. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8465. * to pull elements from an array by value.
  8466. *
  8467. * @static
  8468. * @memberOf _
  8469. * @since 2.0.0
  8470. * @category Array
  8471. * @param {Array} array The array to modify.
  8472. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8473. * @returns {Array} Returns the new array of removed elements.
  8474. * @example
  8475. *
  8476. * var array = [1, 2, 3, 4];
  8477. * var evens = _.remove(array, function(n) {
  8478. * return n % 2 == 0;
  8479. * });
  8480. *
  8481. * console.log(array);
  8482. * // => [1, 3]
  8483. *
  8484. * console.log(evens);
  8485. * // => [2, 4]
  8486. */
  8487. function remove(array, predicate) {
  8488. var result = [];
  8489. if (!(array && array.length)) {
  8490. return result;
  8491. }
  8492. var index = -1,
  8493. indexes = [],
  8494. length = array.length;
  8495. predicate = getIteratee(predicate, 3);
  8496. while (++index < length) {
  8497. var value = array[index];
  8498. if (predicate(value, index, array)) {
  8499. result.push(value);
  8500. indexes.push(index);
  8501. }
  8502. }
  8503. basePullAt(array, indexes);
  8504. return result;
  8505. }
  8506. /**
  8507. * Reverses `array` so that the first element becomes the last, the second
  8508. * element becomes the second to last, and so on.
  8509. *
  8510. * **Note:** This method mutates `array` and is based on
  8511. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8512. *
  8513. * @static
  8514. * @memberOf _
  8515. * @since 4.0.0
  8516. * @category Array
  8517. * @param {Array} array The array to modify.
  8518. * @returns {Array} Returns `array`.
  8519. * @example
  8520. *
  8521. * var array = [1, 2, 3];
  8522. *
  8523. * _.reverse(array);
  8524. * // => [3, 2, 1]
  8525. *
  8526. * console.log(array);
  8527. * // => [3, 2, 1]
  8528. */
  8529. function reverse(array) {
  8530. return array == null ? array : nativeReverse.call(array);
  8531. }
  8532. /**
  8533. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8534. *
  8535. * **Note:** This method is used instead of
  8536. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8537. * returned.
  8538. *
  8539. * @static
  8540. * @memberOf _
  8541. * @since 3.0.0
  8542. * @category Array
  8543. * @param {Array} array The array to slice.
  8544. * @param {number} [start=0] The start position.
  8545. * @param {number} [end=array.length] The end position.
  8546. * @returns {Array} Returns the slice of `array`.
  8547. */
  8548. function slice(array, start, end) {
  8549. var length = array == null ? 0 : array.length;
  8550. if (!length) {
  8551. return [];
  8552. }
  8553. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8554. start = 0;
  8555. end = length;
  8556. }
  8557. else {
  8558. start = start == null ? 0 : toInteger(start);
  8559. end = end === undefined ? length : toInteger(end);
  8560. }
  8561. return baseSlice(array, start, end);
  8562. }
  8563. /**
  8564. * Uses a binary search to determine the lowest index at which `value`
  8565. * should be inserted into `array` in order to maintain its sort order.
  8566. *
  8567. * @static
  8568. * @memberOf _
  8569. * @since 0.1.0
  8570. * @category Array
  8571. * @param {Array} array The sorted array to inspect.
  8572. * @param {*} value The value to evaluate.
  8573. * @returns {number} Returns the index at which `value` should be inserted
  8574. * into `array`.
  8575. * @example
  8576. *
  8577. * _.sortedIndex([30, 50], 40);
  8578. * // => 1
  8579. */
  8580. function sortedIndex(array, value) {
  8581. return baseSortedIndex(array, value);
  8582. }
  8583. /**
  8584. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8585. * which is invoked for `value` and each element of `array` to compute their
  8586. * sort ranking. The iteratee is invoked with one argument: (value).
  8587. *
  8588. * @static
  8589. * @memberOf _
  8590. * @since 4.0.0
  8591. * @category Array
  8592. * @param {Array} array The sorted array to inspect.
  8593. * @param {*} value The value to evaluate.
  8594. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8595. * @returns {number} Returns the index at which `value` should be inserted
  8596. * into `array`.
  8597. * @example
  8598. *
  8599. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8600. *
  8601. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8602. * // => 0
  8603. *
  8604. * // The `_.property` iteratee shorthand.
  8605. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8606. * // => 0
  8607. */
  8608. function sortedIndexBy(array, value, iteratee) {
  8609. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8610. }
  8611. /**
  8612. * This method is like `_.indexOf` except that it performs a binary
  8613. * search on a sorted `array`.
  8614. *
  8615. * @static
  8616. * @memberOf _
  8617. * @since 4.0.0
  8618. * @category Array
  8619. * @param {Array} array The array to inspect.
  8620. * @param {*} value The value to search for.
  8621. * @returns {number} Returns the index of the matched value, else `-1`.
  8622. * @example
  8623. *
  8624. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8625. * // => 1
  8626. */
  8627. function sortedIndexOf(array, value) {
  8628. var length = array == null ? 0 : array.length;
  8629. if (length) {
  8630. var index = baseSortedIndex(array, value);
  8631. if (index < length && eq(array[index], value)) {
  8632. return index;
  8633. }
  8634. }
  8635. return -1;
  8636. }
  8637. /**
  8638. * This method is like `_.sortedIndex` except that it returns the highest
  8639. * index at which `value` should be inserted into `array` in order to
  8640. * maintain its sort order.
  8641. *
  8642. * @static
  8643. * @memberOf _
  8644. * @since 3.0.0
  8645. * @category Array
  8646. * @param {Array} array The sorted array to inspect.
  8647. * @param {*} value The value to evaluate.
  8648. * @returns {number} Returns the index at which `value` should be inserted
  8649. * into `array`.
  8650. * @example
  8651. *
  8652. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8653. * // => 4
  8654. */
  8655. function sortedLastIndex(array, value) {
  8656. return baseSortedIndex(array, value, true);
  8657. }
  8658. /**
  8659. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8660. * which is invoked for `value` and each element of `array` to compute their
  8661. * sort ranking. The iteratee is invoked with one argument: (value).
  8662. *
  8663. * @static
  8664. * @memberOf _
  8665. * @since 4.0.0
  8666. * @category Array
  8667. * @param {Array} array The sorted array to inspect.
  8668. * @param {*} value The value to evaluate.
  8669. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8670. * @returns {number} Returns the index at which `value` should be inserted
  8671. * into `array`.
  8672. * @example
  8673. *
  8674. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8675. *
  8676. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8677. * // => 1
  8678. *
  8679. * // The `_.property` iteratee shorthand.
  8680. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8681. * // => 1
  8682. */
  8683. function sortedLastIndexBy(array, value, iteratee) {
  8684. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8685. }
  8686. /**
  8687. * This method is like `_.lastIndexOf` except that it performs a binary
  8688. * search on a sorted `array`.
  8689. *
  8690. * @static
  8691. * @memberOf _
  8692. * @since 4.0.0
  8693. * @category Array
  8694. * @param {Array} array The array to inspect.
  8695. * @param {*} value The value to search for.
  8696. * @returns {number} Returns the index of the matched value, else `-1`.
  8697. * @example
  8698. *
  8699. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8700. * // => 3
  8701. */
  8702. function sortedLastIndexOf(array, value) {
  8703. var length = array == null ? 0 : array.length;
  8704. if (length) {
  8705. var index = baseSortedIndex(array, value, true) - 1;
  8706. if (eq(array[index], value)) {
  8707. return index;
  8708. }
  8709. }
  8710. return -1;
  8711. }
  8712. /**
  8713. * This method is like `_.uniq` except that it's designed and optimized
  8714. * for sorted arrays.
  8715. *
  8716. * @static
  8717. * @memberOf _
  8718. * @since 4.0.0
  8719. * @category Array
  8720. * @param {Array} array The array to inspect.
  8721. * @returns {Array} Returns the new duplicate free array.
  8722. * @example
  8723. *
  8724. * _.sortedUniq([1, 1, 2]);
  8725. * // => [1, 2]
  8726. */
  8727. function sortedUniq(array) {
  8728. return (array && array.length)
  8729. ? baseSortedUniq(array)
  8730. : [];
  8731. }
  8732. /**
  8733. * This method is like `_.uniqBy` except that it's designed and optimized
  8734. * for sorted arrays.
  8735. *
  8736. * @static
  8737. * @memberOf _
  8738. * @since 4.0.0
  8739. * @category Array
  8740. * @param {Array} array The array to inspect.
  8741. * @param {Function} [iteratee] The iteratee invoked per element.
  8742. * @returns {Array} Returns the new duplicate free array.
  8743. * @example
  8744. *
  8745. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8746. * // => [1.1, 2.3]
  8747. */
  8748. function sortedUniqBy(array, iteratee) {
  8749. return (array && array.length)
  8750. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8751. : [];
  8752. }
  8753. /**
  8754. * Gets all but the first element of `array`.
  8755. *
  8756. * @static
  8757. * @memberOf _
  8758. * @since 4.0.0
  8759. * @category Array
  8760. * @param {Array} array The array to query.
  8761. * @returns {Array} Returns the slice of `array`.
  8762. * @example
  8763. *
  8764. * _.tail([1, 2, 3]);
  8765. * // => [2, 3]
  8766. */
  8767. function tail(array) {
  8768. var length = array == null ? 0 : array.length;
  8769. return length ? baseSlice(array, 1, length) : [];
  8770. }
  8771. /**
  8772. * Creates a slice of `array` with `n` elements taken from the beginning.
  8773. *
  8774. * @static
  8775. * @memberOf _
  8776. * @since 0.1.0
  8777. * @category Array
  8778. * @param {Array} array The array to query.
  8779. * @param {number} [n=1] The number of elements to take.
  8780. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8781. * @returns {Array} Returns the slice of `array`.
  8782. * @example
  8783. *
  8784. * _.take([1, 2, 3]);
  8785. * // => [1]
  8786. *
  8787. * _.take([1, 2, 3], 2);
  8788. * // => [1, 2]
  8789. *
  8790. * _.take([1, 2, 3], 5);
  8791. * // => [1, 2, 3]
  8792. *
  8793. * _.take([1, 2, 3], 0);
  8794. * // => []
  8795. */
  8796. function take(array, n, guard) {
  8797. if (!(array && array.length)) {
  8798. return [];
  8799. }
  8800. n = (guard || n === undefined) ? 1 : toInteger(n);
  8801. return baseSlice(array, 0, n < 0 ? 0 : n);
  8802. }
  8803. /**
  8804. * Creates a slice of `array` with `n` elements taken from the end.
  8805. *
  8806. * @static
  8807. * @memberOf _
  8808. * @since 3.0.0
  8809. * @category Array
  8810. * @param {Array} array The array to query.
  8811. * @param {number} [n=1] The number of elements to take.
  8812. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8813. * @returns {Array} Returns the slice of `array`.
  8814. * @example
  8815. *
  8816. * _.takeRight([1, 2, 3]);
  8817. * // => [3]
  8818. *
  8819. * _.takeRight([1, 2, 3], 2);
  8820. * // => [2, 3]
  8821. *
  8822. * _.takeRight([1, 2, 3], 5);
  8823. * // => [1, 2, 3]
  8824. *
  8825. * _.takeRight([1, 2, 3], 0);
  8826. * // => []
  8827. */
  8828. function takeRight(array, n, guard) {
  8829. var length = array == null ? 0 : array.length;
  8830. if (!length) {
  8831. return [];
  8832. }
  8833. n = (guard || n === undefined) ? 1 : toInteger(n);
  8834. n = length - n;
  8835. return baseSlice(array, n < 0 ? 0 : n, length);
  8836. }
  8837. /**
  8838. * Creates a slice of `array` with elements taken from the end. Elements are
  8839. * taken until `predicate` returns falsey. The predicate is invoked with
  8840. * three arguments: (value, index, array).
  8841. *
  8842. * @static
  8843. * @memberOf _
  8844. * @since 3.0.0
  8845. * @category Array
  8846. * @param {Array} array The array to query.
  8847. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8848. * @returns {Array} Returns the slice of `array`.
  8849. * @example
  8850. *
  8851. * var users = [
  8852. * { 'user': 'barney', 'active': true },
  8853. * { 'user': 'fred', 'active': false },
  8854. * { 'user': 'pebbles', 'active': false }
  8855. * ];
  8856. *
  8857. * _.takeRightWhile(users, function(o) { return !o.active; });
  8858. * // => objects for ['fred', 'pebbles']
  8859. *
  8860. * // The `_.matches` iteratee shorthand.
  8861. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8862. * // => objects for ['pebbles']
  8863. *
  8864. * // The `_.matchesProperty` iteratee shorthand.
  8865. * _.takeRightWhile(users, ['active', false]);
  8866. * // => objects for ['fred', 'pebbles']
  8867. *
  8868. * // The `_.property` iteratee shorthand.
  8869. * _.takeRightWhile(users, 'active');
  8870. * // => []
  8871. */
  8872. function takeRightWhile(array, predicate) {
  8873. return (array && array.length)
  8874. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8875. : [];
  8876. }
  8877. /**
  8878. * Creates a slice of `array` with elements taken from the beginning. Elements
  8879. * are taken until `predicate` returns falsey. The predicate is invoked with
  8880. * three arguments: (value, index, array).
  8881. *
  8882. * @static
  8883. * @memberOf _
  8884. * @since 3.0.0
  8885. * @category Array
  8886. * @param {Array} array The array to query.
  8887. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8888. * @returns {Array} Returns the slice of `array`.
  8889. * @example
  8890. *
  8891. * var users = [
  8892. * { 'user': 'barney', 'active': false },
  8893. * { 'user': 'fred', 'active': false },
  8894. * { 'user': 'pebbles', 'active': true }
  8895. * ];
  8896. *
  8897. * _.takeWhile(users, function(o) { return !o.active; });
  8898. * // => objects for ['barney', 'fred']
  8899. *
  8900. * // The `_.matches` iteratee shorthand.
  8901. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8902. * // => objects for ['barney']
  8903. *
  8904. * // The `_.matchesProperty` iteratee shorthand.
  8905. * _.takeWhile(users, ['active', false]);
  8906. * // => objects for ['barney', 'fred']
  8907. *
  8908. * // The `_.property` iteratee shorthand.
  8909. * _.takeWhile(users, 'active');
  8910. * // => []
  8911. */
  8912. function takeWhile(array, predicate) {
  8913. return (array && array.length)
  8914. ? baseWhile(array, getIteratee(predicate, 3))
  8915. : [];
  8916. }
  8917. /**
  8918. * Creates an array of unique values, in order, from all given arrays using
  8919. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8920. * for equality comparisons.
  8921. *
  8922. * @static
  8923. * @memberOf _
  8924. * @since 0.1.0
  8925. * @category Array
  8926. * @param {...Array} [arrays] The arrays to inspect.
  8927. * @returns {Array} Returns the new array of combined values.
  8928. * @example
  8929. *
  8930. * _.union([2], [1, 2]);
  8931. * // => [2, 1]
  8932. */
  8933. var union = baseRest(function(arrays) {
  8934. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8935. });
  8936. /**
  8937. * This method is like `_.union` except that it accepts `iteratee` which is
  8938. * invoked for each element of each `arrays` to generate the criterion by
  8939. * which uniqueness is computed. Result values are chosen from the first
  8940. * array in which the value occurs. The iteratee is invoked with one argument:
  8941. * (value).
  8942. *
  8943. * @static
  8944. * @memberOf _
  8945. * @since 4.0.0
  8946. * @category Array
  8947. * @param {...Array} [arrays] The arrays to inspect.
  8948. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8949. * @returns {Array} Returns the new array of combined values.
  8950. * @example
  8951. *
  8952. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8953. * // => [2.1, 1.2]
  8954. *
  8955. * // The `_.property` iteratee shorthand.
  8956. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8957. * // => [{ 'x': 1 }, { 'x': 2 }]
  8958. */
  8959. var unionBy = baseRest(function(arrays) {
  8960. var iteratee = last(arrays);
  8961. if (isArrayLikeObject(iteratee)) {
  8962. iteratee = undefined;
  8963. }
  8964. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8965. });
  8966. /**
  8967. * This method is like `_.union` except that it accepts `comparator` which
  8968. * is invoked to compare elements of `arrays`. Result values are chosen from
  8969. * the first array in which the value occurs. The comparator is invoked
  8970. * with two arguments: (arrVal, othVal).
  8971. *
  8972. * @static
  8973. * @memberOf _
  8974. * @since 4.0.0
  8975. * @category Array
  8976. * @param {...Array} [arrays] The arrays to inspect.
  8977. * @param {Function} [comparator] The comparator invoked per element.
  8978. * @returns {Array} Returns the new array of combined values.
  8979. * @example
  8980. *
  8981. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8982. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8983. *
  8984. * _.unionWith(objects, others, _.isEqual);
  8985. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8986. */
  8987. var unionWith = baseRest(function(arrays) {
  8988. var comparator = last(arrays);
  8989. comparator = typeof comparator == 'function' ? comparator : undefined;
  8990. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8991. });
  8992. /**
  8993. * Creates a duplicate-free version of an array, using
  8994. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8995. * for equality comparisons, in which only the first occurrence of each element
  8996. * is kept. The order of result values is determined by the order they occur
  8997. * in the array.
  8998. *
  8999. * @static
  9000. * @memberOf _
  9001. * @since 0.1.0
  9002. * @category Array
  9003. * @param {Array} array The array to inspect.
  9004. * @returns {Array} Returns the new duplicate free array.
  9005. * @example
  9006. *
  9007. * _.uniq([2, 1, 2]);
  9008. * // => [2, 1]
  9009. */
  9010. function uniq(array) {
  9011. return (array && array.length) ? baseUniq(array) : [];
  9012. }
  9013. /**
  9014. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9015. * invoked for each element in `array` to generate the criterion by which
  9016. * uniqueness is computed. The order of result values is determined by the
  9017. * order they occur in the array. The iteratee is invoked with one argument:
  9018. * (value).
  9019. *
  9020. * @static
  9021. * @memberOf _
  9022. * @since 4.0.0
  9023. * @category Array
  9024. * @param {Array} array The array to inspect.
  9025. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9026. * @returns {Array} Returns the new duplicate free array.
  9027. * @example
  9028. *
  9029. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9030. * // => [2.1, 1.2]
  9031. *
  9032. * // The `_.property` iteratee shorthand.
  9033. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9034. * // => [{ 'x': 1 }, { 'x': 2 }]
  9035. */
  9036. function uniqBy(array, iteratee) {
  9037. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9038. }
  9039. /**
  9040. * This method is like `_.uniq` except that it accepts `comparator` which
  9041. * is invoked to compare elements of `array`. The order of result values is
  9042. * determined by the order they occur in the array.The comparator is invoked
  9043. * with two arguments: (arrVal, othVal).
  9044. *
  9045. * @static
  9046. * @memberOf _
  9047. * @since 4.0.0
  9048. * @category Array
  9049. * @param {Array} array The array to inspect.
  9050. * @param {Function} [comparator] The comparator invoked per element.
  9051. * @returns {Array} Returns the new duplicate free array.
  9052. * @example
  9053. *
  9054. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9055. *
  9056. * _.uniqWith(objects, _.isEqual);
  9057. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9058. */
  9059. function uniqWith(array, comparator) {
  9060. comparator = typeof comparator == 'function' ? comparator : undefined;
  9061. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9062. }
  9063. /**
  9064. * This method is like `_.zip` except that it accepts an array of grouped
  9065. * elements and creates an array regrouping the elements to their pre-zip
  9066. * configuration.
  9067. *
  9068. * @static
  9069. * @memberOf _
  9070. * @since 1.2.0
  9071. * @category Array
  9072. * @param {Array} array The array of grouped elements to process.
  9073. * @returns {Array} Returns the new array of regrouped elements.
  9074. * @example
  9075. *
  9076. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9077. * // => [['a', 1, true], ['b', 2, false]]
  9078. *
  9079. * _.unzip(zipped);
  9080. * // => [['a', 'b'], [1, 2], [true, false]]
  9081. */
  9082. function unzip(array) {
  9083. if (!(array && array.length)) {
  9084. return [];
  9085. }
  9086. var length = 0;
  9087. array = arrayFilter(array, function(group) {
  9088. if (isArrayLikeObject(group)) {
  9089. length = nativeMax(group.length, length);
  9090. return true;
  9091. }
  9092. });
  9093. return baseTimes(length, function(index) {
  9094. return arrayMap(array, baseProperty(index));
  9095. });
  9096. }
  9097. /**
  9098. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9099. * how regrouped values should be combined. The iteratee is invoked with the
  9100. * elements of each group: (...group).
  9101. *
  9102. * @static
  9103. * @memberOf _
  9104. * @since 3.8.0
  9105. * @category Array
  9106. * @param {Array} array The array of grouped elements to process.
  9107. * @param {Function} [iteratee=_.identity] The function to combine
  9108. * regrouped values.
  9109. * @returns {Array} Returns the new array of regrouped elements.
  9110. * @example
  9111. *
  9112. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9113. * // => [[1, 10, 100], [2, 20, 200]]
  9114. *
  9115. * _.unzipWith(zipped, _.add);
  9116. * // => [3, 30, 300]
  9117. */
  9118. function unzipWith(array, iteratee) {
  9119. if (!(array && array.length)) {
  9120. return [];
  9121. }
  9122. var result = unzip(array);
  9123. if (iteratee == null) {
  9124. return result;
  9125. }
  9126. return arrayMap(result, function(group) {
  9127. return apply(iteratee, undefined, group);
  9128. });
  9129. }
  9130. /**
  9131. * Creates an array excluding all given values using
  9132. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9133. * for equality comparisons.
  9134. *
  9135. * **Note:** Unlike `_.pull`, this method returns a new array.
  9136. *
  9137. * @static
  9138. * @memberOf _
  9139. * @since 0.1.0
  9140. * @category Array
  9141. * @param {Array} array The array to inspect.
  9142. * @param {...*} [values] The values to exclude.
  9143. * @returns {Array} Returns the new array of filtered values.
  9144. * @see _.difference, _.xor
  9145. * @example
  9146. *
  9147. * _.without([2, 1, 2, 3], 1, 2);
  9148. * // => [3]
  9149. */
  9150. var without = baseRest(function(array, values) {
  9151. return isArrayLikeObject(array)
  9152. ? baseDifference(array, values)
  9153. : [];
  9154. });
  9155. /**
  9156. * Creates an array of unique values that is the
  9157. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9158. * of the given arrays. The order of result values is determined by the order
  9159. * they occur in the arrays.
  9160. *
  9161. * @static
  9162. * @memberOf _
  9163. * @since 2.4.0
  9164. * @category Array
  9165. * @param {...Array} [arrays] The arrays to inspect.
  9166. * @returns {Array} Returns the new array of filtered values.
  9167. * @see _.difference, _.without
  9168. * @example
  9169. *
  9170. * _.xor([2, 1], [2, 3]);
  9171. * // => [1, 3]
  9172. */
  9173. var xor = baseRest(function(arrays) {
  9174. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9175. });
  9176. /**
  9177. * This method is like `_.xor` except that it accepts `iteratee` which is
  9178. * invoked for each element of each `arrays` to generate the criterion by
  9179. * which by which they're compared. The order of result values is determined
  9180. * by the order they occur in the arrays. The iteratee is invoked with one
  9181. * argument: (value).
  9182. *
  9183. * @static
  9184. * @memberOf _
  9185. * @since 4.0.0
  9186. * @category Array
  9187. * @param {...Array} [arrays] The arrays to inspect.
  9188. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9189. * @returns {Array} Returns the new array of filtered values.
  9190. * @example
  9191. *
  9192. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9193. * // => [1.2, 3.4]
  9194. *
  9195. * // The `_.property` iteratee shorthand.
  9196. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9197. * // => [{ 'x': 2 }]
  9198. */
  9199. var xorBy = baseRest(function(arrays) {
  9200. var iteratee = last(arrays);
  9201. if (isArrayLikeObject(iteratee)) {
  9202. iteratee = undefined;
  9203. }
  9204. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9205. });
  9206. /**
  9207. * This method is like `_.xor` except that it accepts `comparator` which is
  9208. * invoked to compare elements of `arrays`. The order of result values is
  9209. * determined by the order they occur in the arrays. The comparator is invoked
  9210. * with two arguments: (arrVal, othVal).
  9211. *
  9212. * @static
  9213. * @memberOf _
  9214. * @since 4.0.0
  9215. * @category Array
  9216. * @param {...Array} [arrays] The arrays to inspect.
  9217. * @param {Function} [comparator] The comparator invoked per element.
  9218. * @returns {Array} Returns the new array of filtered values.
  9219. * @example
  9220. *
  9221. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9222. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9223. *
  9224. * _.xorWith(objects, others, _.isEqual);
  9225. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9226. */
  9227. var xorWith = baseRest(function(arrays) {
  9228. var comparator = last(arrays);
  9229. comparator = typeof comparator == 'function' ? comparator : undefined;
  9230. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9231. });
  9232. /**
  9233. * Creates an array of grouped elements, the first of which contains the
  9234. * first elements of the given arrays, the second of which contains the
  9235. * second elements of the given arrays, and so on.
  9236. *
  9237. * @static
  9238. * @memberOf _
  9239. * @since 0.1.0
  9240. * @category Array
  9241. * @param {...Array} [arrays] The arrays to process.
  9242. * @returns {Array} Returns the new array of grouped elements.
  9243. * @example
  9244. *
  9245. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9246. * // => [['a', 1, true], ['b', 2, false]]
  9247. */
  9248. var zip = baseRest(unzip);
  9249. /**
  9250. * This method is like `_.fromPairs` except that it accepts two arrays,
  9251. * one of property identifiers and one of corresponding values.
  9252. *
  9253. * @static
  9254. * @memberOf _
  9255. * @since 0.4.0
  9256. * @category Array
  9257. * @param {Array} [props=[]] The property identifiers.
  9258. * @param {Array} [values=[]] The property values.
  9259. * @returns {Object} Returns the new object.
  9260. * @example
  9261. *
  9262. * _.zipObject(['a', 'b'], [1, 2]);
  9263. * // => { 'a': 1, 'b': 2 }
  9264. */
  9265. function zipObject(props, values) {
  9266. return baseZipObject(props || [], values || [], assignValue);
  9267. }
  9268. /**
  9269. * This method is like `_.zipObject` except that it supports property paths.
  9270. *
  9271. * @static
  9272. * @memberOf _
  9273. * @since 4.1.0
  9274. * @category Array
  9275. * @param {Array} [props=[]] The property identifiers.
  9276. * @param {Array} [values=[]] The property values.
  9277. * @returns {Object} Returns the new object.
  9278. * @example
  9279. *
  9280. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9281. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9282. */
  9283. function zipObjectDeep(props, values) {
  9284. return baseZipObject(props || [], values || [], baseSet);
  9285. }
  9286. /**
  9287. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9288. * how grouped values should be combined. The iteratee is invoked with the
  9289. * elements of each group: (...group).
  9290. *
  9291. * @static
  9292. * @memberOf _
  9293. * @since 3.8.0
  9294. * @category Array
  9295. * @param {...Array} [arrays] The arrays to process.
  9296. * @param {Function} [iteratee=_.identity] The function to combine
  9297. * grouped values.
  9298. * @returns {Array} Returns the new array of grouped elements.
  9299. * @example
  9300. *
  9301. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9302. * return a + b + c;
  9303. * });
  9304. * // => [111, 222]
  9305. */
  9306. var zipWith = baseRest(function(arrays) {
  9307. var length = arrays.length,
  9308. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9309. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9310. return unzipWith(arrays, iteratee);
  9311. });
  9312. /*------------------------------------------------------------------------*/
  9313. /**
  9314. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9315. * chain sequences enabled. The result of such sequences must be unwrapped
  9316. * with `_#value`.
  9317. *
  9318. * @static
  9319. * @memberOf _
  9320. * @since 1.3.0
  9321. * @category Seq
  9322. * @param {*} value The value to wrap.
  9323. * @returns {Object} Returns the new `lodash` wrapper instance.
  9324. * @example
  9325. *
  9326. * var users = [
  9327. * { 'user': 'barney', 'age': 36 },
  9328. * { 'user': 'fred', 'age': 40 },
  9329. * { 'user': 'pebbles', 'age': 1 }
  9330. * ];
  9331. *
  9332. * var youngest = _
  9333. * .chain(users)
  9334. * .sortBy('age')
  9335. * .map(function(o) {
  9336. * return o.user + ' is ' + o.age;
  9337. * })
  9338. * .head()
  9339. * .value();
  9340. * // => 'pebbles is 1'
  9341. */
  9342. function chain(value) {
  9343. var result = lodash(value);
  9344. result.__chain__ = true;
  9345. return result;
  9346. }
  9347. /**
  9348. * This method invokes `interceptor` and returns `value`. The interceptor
  9349. * is invoked with one argument; (value). The purpose of this method is to
  9350. * "tap into" a method chain sequence in order to modify intermediate results.
  9351. *
  9352. * @static
  9353. * @memberOf _
  9354. * @since 0.1.0
  9355. * @category Seq
  9356. * @param {*} value The value to provide to `interceptor`.
  9357. * @param {Function} interceptor The function to invoke.
  9358. * @returns {*} Returns `value`.
  9359. * @example
  9360. *
  9361. * _([1, 2, 3])
  9362. * .tap(function(array) {
  9363. * // Mutate input array.
  9364. * array.pop();
  9365. * })
  9366. * .reverse()
  9367. * .value();
  9368. * // => [2, 1]
  9369. */
  9370. function tap(value, interceptor) {
  9371. interceptor(value);
  9372. return value;
  9373. }
  9374. /**
  9375. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9376. * The purpose of this method is to "pass thru" values replacing intermediate
  9377. * results in a method chain sequence.
  9378. *
  9379. * @static
  9380. * @memberOf _
  9381. * @since 3.0.0
  9382. * @category Seq
  9383. * @param {*} value The value to provide to `interceptor`.
  9384. * @param {Function} interceptor The function to invoke.
  9385. * @returns {*} Returns the result of `interceptor`.
  9386. * @example
  9387. *
  9388. * _(' abc ')
  9389. * .chain()
  9390. * .trim()
  9391. * .thru(function(value) {
  9392. * return [value];
  9393. * })
  9394. * .value();
  9395. * // => ['abc']
  9396. */
  9397. function thru(value, interceptor) {
  9398. return interceptor(value);
  9399. }
  9400. /**
  9401. * This method is the wrapper version of `_.at`.
  9402. *
  9403. * @name at
  9404. * @memberOf _
  9405. * @since 1.0.0
  9406. * @category Seq
  9407. * @param {...(string|string[])} [paths] The property paths to pick.
  9408. * @returns {Object} Returns the new `lodash` wrapper instance.
  9409. * @example
  9410. *
  9411. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9412. *
  9413. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9414. * // => [3, 4]
  9415. */
  9416. var wrapperAt = flatRest(function(paths) {
  9417. var length = paths.length,
  9418. start = length ? paths[0] : 0,
  9419. value = this.__wrapped__,
  9420. interceptor = function(object) { return baseAt(object, paths); };
  9421. if (length > 1 || this.__actions__.length ||
  9422. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9423. return this.thru(interceptor);
  9424. }
  9425. value = value.slice(start, +start + (length ? 1 : 0));
  9426. value.__actions__.push({
  9427. 'func': thru,
  9428. 'args': [interceptor],
  9429. 'thisArg': undefined
  9430. });
  9431. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9432. if (length && !array.length) {
  9433. array.push(undefined);
  9434. }
  9435. return array;
  9436. });
  9437. });
  9438. /**
  9439. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9440. *
  9441. * @name chain
  9442. * @memberOf _
  9443. * @since 0.1.0
  9444. * @category Seq
  9445. * @returns {Object} Returns the new `lodash` wrapper instance.
  9446. * @example
  9447. *
  9448. * var users = [
  9449. * { 'user': 'barney', 'age': 36 },
  9450. * { 'user': 'fred', 'age': 40 }
  9451. * ];
  9452. *
  9453. * // A sequence without explicit chaining.
  9454. * _(users).head();
  9455. * // => { 'user': 'barney', 'age': 36 }
  9456. *
  9457. * // A sequence with explicit chaining.
  9458. * _(users)
  9459. * .chain()
  9460. * .head()
  9461. * .pick('user')
  9462. * .value();
  9463. * // => { 'user': 'barney' }
  9464. */
  9465. function wrapperChain() {
  9466. return chain(this);
  9467. }
  9468. /**
  9469. * Executes the chain sequence and returns the wrapped result.
  9470. *
  9471. * @name commit
  9472. * @memberOf _
  9473. * @since 3.2.0
  9474. * @category Seq
  9475. * @returns {Object} Returns the new `lodash` wrapper instance.
  9476. * @example
  9477. *
  9478. * var array = [1, 2];
  9479. * var wrapped = _(array).push(3);
  9480. *
  9481. * console.log(array);
  9482. * // => [1, 2]
  9483. *
  9484. * wrapped = wrapped.commit();
  9485. * console.log(array);
  9486. * // => [1, 2, 3]
  9487. *
  9488. * wrapped.last();
  9489. * // => 3
  9490. *
  9491. * console.log(array);
  9492. * // => [1, 2, 3]
  9493. */
  9494. function wrapperCommit() {
  9495. return new LodashWrapper(this.value(), this.__chain__);
  9496. }
  9497. /**
  9498. * Gets the next value on a wrapped object following the
  9499. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9500. *
  9501. * @name next
  9502. * @memberOf _
  9503. * @since 4.0.0
  9504. * @category Seq
  9505. * @returns {Object} Returns the next iterator value.
  9506. * @example
  9507. *
  9508. * var wrapped = _([1, 2]);
  9509. *
  9510. * wrapped.next();
  9511. * // => { 'done': false, 'value': 1 }
  9512. *
  9513. * wrapped.next();
  9514. * // => { 'done': false, 'value': 2 }
  9515. *
  9516. * wrapped.next();
  9517. * // => { 'done': true, 'value': undefined }
  9518. */
  9519. function wrapperNext() {
  9520. if (this.__values__ === undefined) {
  9521. this.__values__ = toArray(this.value());
  9522. }
  9523. var done = this.__index__ >= this.__values__.length,
  9524. value = done ? undefined : this.__values__[this.__index__++];
  9525. return { 'done': done, 'value': value };
  9526. }
  9527. /**
  9528. * Enables the wrapper to be iterable.
  9529. *
  9530. * @name Symbol.iterator
  9531. * @memberOf _
  9532. * @since 4.0.0
  9533. * @category Seq
  9534. * @returns {Object} Returns the wrapper object.
  9535. * @example
  9536. *
  9537. * var wrapped = _([1, 2]);
  9538. *
  9539. * wrapped[Symbol.iterator]() === wrapped;
  9540. * // => true
  9541. *
  9542. * Array.from(wrapped);
  9543. * // => [1, 2]
  9544. */
  9545. function wrapperToIterator() {
  9546. return this;
  9547. }
  9548. /**
  9549. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9550. *
  9551. * @name plant
  9552. * @memberOf _
  9553. * @since 3.2.0
  9554. * @category Seq
  9555. * @param {*} value The value to plant.
  9556. * @returns {Object} Returns the new `lodash` wrapper instance.
  9557. * @example
  9558. *
  9559. * function square(n) {
  9560. * return n * n;
  9561. * }
  9562. *
  9563. * var wrapped = _([1, 2]).map(square);
  9564. * var other = wrapped.plant([3, 4]);
  9565. *
  9566. * other.value();
  9567. * // => [9, 16]
  9568. *
  9569. * wrapped.value();
  9570. * // => [1, 4]
  9571. */
  9572. function wrapperPlant(value) {
  9573. var result,
  9574. parent = this;
  9575. while (parent instanceof baseLodash) {
  9576. var clone = wrapperClone(parent);
  9577. clone.__index__ = 0;
  9578. clone.__values__ = undefined;
  9579. if (result) {
  9580. previous.__wrapped__ = clone;
  9581. } else {
  9582. result = clone;
  9583. }
  9584. var previous = clone;
  9585. parent = parent.__wrapped__;
  9586. }
  9587. previous.__wrapped__ = value;
  9588. return result;
  9589. }
  9590. /**
  9591. * This method is the wrapper version of `_.reverse`.
  9592. *
  9593. * **Note:** This method mutates the wrapped array.
  9594. *
  9595. * @name reverse
  9596. * @memberOf _
  9597. * @since 0.1.0
  9598. * @category Seq
  9599. * @returns {Object} Returns the new `lodash` wrapper instance.
  9600. * @example
  9601. *
  9602. * var array = [1, 2, 3];
  9603. *
  9604. * _(array).reverse().value()
  9605. * // => [3, 2, 1]
  9606. *
  9607. * console.log(array);
  9608. * // => [3, 2, 1]
  9609. */
  9610. function wrapperReverse() {
  9611. var value = this.__wrapped__;
  9612. if (value instanceof LazyWrapper) {
  9613. var wrapped = value;
  9614. if (this.__actions__.length) {
  9615. wrapped = new LazyWrapper(this);
  9616. }
  9617. wrapped = wrapped.reverse();
  9618. wrapped.__actions__.push({
  9619. 'func': thru,
  9620. 'args': [reverse],
  9621. 'thisArg': undefined
  9622. });
  9623. return new LodashWrapper(wrapped, this.__chain__);
  9624. }
  9625. return this.thru(reverse);
  9626. }
  9627. /**
  9628. * Executes the chain sequence to resolve the unwrapped value.
  9629. *
  9630. * @name value
  9631. * @memberOf _
  9632. * @since 0.1.0
  9633. * @alias toJSON, valueOf
  9634. * @category Seq
  9635. * @returns {*} Returns the resolved unwrapped value.
  9636. * @example
  9637. *
  9638. * _([1, 2, 3]).value();
  9639. * // => [1, 2, 3]
  9640. */
  9641. function wrapperValue() {
  9642. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9643. }
  9644. /*------------------------------------------------------------------------*/
  9645. /**
  9646. * Creates an object composed of keys generated from the results of running
  9647. * each element of `collection` thru `iteratee`. The corresponding value of
  9648. * each key is the number of times the key was returned by `iteratee`. The
  9649. * iteratee is invoked with one argument: (value).
  9650. *
  9651. * @static
  9652. * @memberOf _
  9653. * @since 0.5.0
  9654. * @category Collection
  9655. * @param {Array|Object} collection The collection to iterate over.
  9656. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9657. * @returns {Object} Returns the composed aggregate object.
  9658. * @example
  9659. *
  9660. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9661. * // => { '4': 1, '6': 2 }
  9662. *
  9663. * // The `_.property` iteratee shorthand.
  9664. * _.countBy(['one', 'two', 'three'], 'length');
  9665. * // => { '3': 2, '5': 1 }
  9666. */
  9667. var countBy = createAggregator(function(result, value, key) {
  9668. if (hasOwnProperty.call(result, key)) {
  9669. ++result[key];
  9670. } else {
  9671. baseAssignValue(result, key, 1);
  9672. }
  9673. });
  9674. /**
  9675. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9676. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9677. * invoked with three arguments: (value, index|key, collection).
  9678. *
  9679. * **Note:** This method returns `true` for
  9680. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9681. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9682. * elements of empty collections.
  9683. *
  9684. * @static
  9685. * @memberOf _
  9686. * @since 0.1.0
  9687. * @category Collection
  9688. * @param {Array|Object} collection The collection to iterate over.
  9689. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9690. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9691. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9692. * else `false`.
  9693. * @example
  9694. *
  9695. * _.every([true, 1, null, 'yes'], Boolean);
  9696. * // => false
  9697. *
  9698. * var users = [
  9699. * { 'user': 'barney', 'age': 36, 'active': false },
  9700. * { 'user': 'fred', 'age': 40, 'active': false }
  9701. * ];
  9702. *
  9703. * // The `_.matches` iteratee shorthand.
  9704. * _.every(users, { 'user': 'barney', 'active': false });
  9705. * // => false
  9706. *
  9707. * // The `_.matchesProperty` iteratee shorthand.
  9708. * _.every(users, ['active', false]);
  9709. * // => true
  9710. *
  9711. * // The `_.property` iteratee shorthand.
  9712. * _.every(users, 'active');
  9713. * // => false
  9714. */
  9715. function every(collection, predicate, guard) {
  9716. var func = isArray(collection) ? arrayEvery : baseEvery;
  9717. if (guard && isIterateeCall(collection, predicate, guard)) {
  9718. predicate = undefined;
  9719. }
  9720. return func(collection, getIteratee(predicate, 3));
  9721. }
  9722. /**
  9723. * Iterates over elements of `collection`, returning an array of all elements
  9724. * `predicate` returns truthy for. The predicate is invoked with three
  9725. * arguments: (value, index|key, collection).
  9726. *
  9727. * **Note:** Unlike `_.remove`, this method returns a new array.
  9728. *
  9729. * @static
  9730. * @memberOf _
  9731. * @since 0.1.0
  9732. * @category Collection
  9733. * @param {Array|Object} collection The collection to iterate over.
  9734. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9735. * @returns {Array} Returns the new filtered array.
  9736. * @see _.reject
  9737. * @example
  9738. *
  9739. * var users = [
  9740. * { 'user': 'barney', 'age': 36, 'active': true },
  9741. * { 'user': 'fred', 'age': 40, 'active': false }
  9742. * ];
  9743. *
  9744. * _.filter(users, function(o) { return !o.active; });
  9745. * // => objects for ['fred']
  9746. *
  9747. * // The `_.matches` iteratee shorthand.
  9748. * _.filter(users, { 'age': 36, 'active': true });
  9749. * // => objects for ['barney']
  9750. *
  9751. * // The `_.matchesProperty` iteratee shorthand.
  9752. * _.filter(users, ['active', false]);
  9753. * // => objects for ['fred']
  9754. *
  9755. * // The `_.property` iteratee shorthand.
  9756. * _.filter(users, 'active');
  9757. * // => objects for ['barney']
  9758. *
  9759. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9760. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9761. * // => objects for ['fred', 'barney']
  9762. */
  9763. function filter(collection, predicate) {
  9764. var func = isArray(collection) ? arrayFilter : baseFilter;
  9765. return func(collection, getIteratee(predicate, 3));
  9766. }
  9767. /**
  9768. * Iterates over elements of `collection`, returning the first element
  9769. * `predicate` returns truthy for. The predicate is invoked with three
  9770. * arguments: (value, index|key, collection).
  9771. *
  9772. * @static
  9773. * @memberOf _
  9774. * @since 0.1.0
  9775. * @category Collection
  9776. * @param {Array|Object} collection The collection to inspect.
  9777. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9778. * @param {number} [fromIndex=0] The index to search from.
  9779. * @returns {*} Returns the matched element, else `undefined`.
  9780. * @example
  9781. *
  9782. * var users = [
  9783. * { 'user': 'barney', 'age': 36, 'active': true },
  9784. * { 'user': 'fred', 'age': 40, 'active': false },
  9785. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9786. * ];
  9787. *
  9788. * _.find(users, function(o) { return o.age < 40; });
  9789. * // => object for 'barney'
  9790. *
  9791. * // The `_.matches` iteratee shorthand.
  9792. * _.find(users, { 'age': 1, 'active': true });
  9793. * // => object for 'pebbles'
  9794. *
  9795. * // The `_.matchesProperty` iteratee shorthand.
  9796. * _.find(users, ['active', false]);
  9797. * // => object for 'fred'
  9798. *
  9799. * // The `_.property` iteratee shorthand.
  9800. * _.find(users, 'active');
  9801. * // => object for 'barney'
  9802. */
  9803. var find = createFind(findIndex);
  9804. /**
  9805. * This method is like `_.find` except that it iterates over elements of
  9806. * `collection` from right to left.
  9807. *
  9808. * @static
  9809. * @memberOf _
  9810. * @since 2.0.0
  9811. * @category Collection
  9812. * @param {Array|Object} collection The collection to inspect.
  9813. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9814. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9815. * @returns {*} Returns the matched element, else `undefined`.
  9816. * @example
  9817. *
  9818. * _.findLast([1, 2, 3, 4], function(n) {
  9819. * return n % 2 == 1;
  9820. * });
  9821. * // => 3
  9822. */
  9823. var findLast = createFind(findLastIndex);
  9824. /**
  9825. * Creates a flattened array of values by running each element in `collection`
  9826. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9827. * with three arguments: (value, index|key, collection).
  9828. *
  9829. * @static
  9830. * @memberOf _
  9831. * @since 4.0.0
  9832. * @category Collection
  9833. * @param {Array|Object} collection The collection to iterate over.
  9834. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9835. * @returns {Array} Returns the new flattened array.
  9836. * @example
  9837. *
  9838. * function duplicate(n) {
  9839. * return [n, n];
  9840. * }
  9841. *
  9842. * _.flatMap([1, 2], duplicate);
  9843. * // => [1, 1, 2, 2]
  9844. */
  9845. function flatMap(collection, iteratee) {
  9846. return baseFlatten(map(collection, iteratee), 1);
  9847. }
  9848. /**
  9849. * This method is like `_.flatMap` except that it recursively flattens the
  9850. * mapped results.
  9851. *
  9852. * @static
  9853. * @memberOf _
  9854. * @since 4.7.0
  9855. * @category Collection
  9856. * @param {Array|Object} collection The collection to iterate over.
  9857. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9858. * @returns {Array} Returns the new flattened array.
  9859. * @example
  9860. *
  9861. * function duplicate(n) {
  9862. * return [[[n, n]]];
  9863. * }
  9864. *
  9865. * _.flatMapDeep([1, 2], duplicate);
  9866. * // => [1, 1, 2, 2]
  9867. */
  9868. function flatMapDeep(collection, iteratee) {
  9869. return baseFlatten(map(collection, iteratee), INFINITY);
  9870. }
  9871. /**
  9872. * This method is like `_.flatMap` except that it recursively flattens the
  9873. * mapped results up to `depth` times.
  9874. *
  9875. * @static
  9876. * @memberOf _
  9877. * @since 4.7.0
  9878. * @category Collection
  9879. * @param {Array|Object} collection The collection to iterate over.
  9880. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9881. * @param {number} [depth=1] The maximum recursion depth.
  9882. * @returns {Array} Returns the new flattened array.
  9883. * @example
  9884. *
  9885. * function duplicate(n) {
  9886. * return [[[n, n]]];
  9887. * }
  9888. *
  9889. * _.flatMapDepth([1, 2], duplicate, 2);
  9890. * // => [[1, 1], [2, 2]]
  9891. */
  9892. function flatMapDepth(collection, iteratee, depth) {
  9893. depth = depth === undefined ? 1 : toInteger(depth);
  9894. return baseFlatten(map(collection, iteratee), depth);
  9895. }
  9896. /**
  9897. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9898. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9899. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9900. *
  9901. * **Note:** As with other "Collections" methods, objects with a "length"
  9902. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9903. * or `_.forOwn` for object iteration.
  9904. *
  9905. * @static
  9906. * @memberOf _
  9907. * @since 0.1.0
  9908. * @alias each
  9909. * @category Collection
  9910. * @param {Array|Object} collection The collection to iterate over.
  9911. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9912. * @returns {Array|Object} Returns `collection`.
  9913. * @see _.forEachRight
  9914. * @example
  9915. *
  9916. * _.forEach([1, 2], function(value) {
  9917. * console.log(value);
  9918. * });
  9919. * // => Logs `1` then `2`.
  9920. *
  9921. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9922. * console.log(key);
  9923. * });
  9924. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9925. */
  9926. function forEach(collection, iteratee) {
  9927. var func = isArray(collection) ? arrayEach : baseEach;
  9928. return func(collection, getIteratee(iteratee, 3));
  9929. }
  9930. /**
  9931. * This method is like `_.forEach` except that it iterates over elements of
  9932. * `collection` from right to left.
  9933. *
  9934. * @static
  9935. * @memberOf _
  9936. * @since 2.0.0
  9937. * @alias eachRight
  9938. * @category Collection
  9939. * @param {Array|Object} collection The collection to iterate over.
  9940. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9941. * @returns {Array|Object} Returns `collection`.
  9942. * @see _.forEach
  9943. * @example
  9944. *
  9945. * _.forEachRight([1, 2], function(value) {
  9946. * console.log(value);
  9947. * });
  9948. * // => Logs `2` then `1`.
  9949. */
  9950. function forEachRight(collection, iteratee) {
  9951. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9952. return func(collection, getIteratee(iteratee, 3));
  9953. }
  9954. /**
  9955. * Creates an object composed of keys generated from the results of running
  9956. * each element of `collection` thru `iteratee`. The order of grouped values
  9957. * is determined by the order they occur in `collection`. The corresponding
  9958. * value of each key is an array of elements responsible for generating the
  9959. * key. The iteratee is invoked with one argument: (value).
  9960. *
  9961. * @static
  9962. * @memberOf _
  9963. * @since 0.1.0
  9964. * @category Collection
  9965. * @param {Array|Object} collection The collection to iterate over.
  9966. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9967. * @returns {Object} Returns the composed aggregate object.
  9968. * @example
  9969. *
  9970. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9971. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9972. *
  9973. * // The `_.property` iteratee shorthand.
  9974. * _.groupBy(['one', 'two', 'three'], 'length');
  9975. * // => { '3': ['one', 'two'], '5': ['three'] }
  9976. */
  9977. var groupBy = createAggregator(function(result, value, key) {
  9978. if (hasOwnProperty.call(result, key)) {
  9979. result[key].push(value);
  9980. } else {
  9981. baseAssignValue(result, key, [value]);
  9982. }
  9983. });
  9984. /**
  9985. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9986. * checked for a substring of `value`, otherwise
  9987. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9988. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9989. * the offset from the end of `collection`.
  9990. *
  9991. * @static
  9992. * @memberOf _
  9993. * @since 0.1.0
  9994. * @category Collection
  9995. * @param {Array|Object|string} collection The collection to inspect.
  9996. * @param {*} value The value to search for.
  9997. * @param {number} [fromIndex=0] The index to search from.
  9998. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9999. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10000. * @example
  10001. *
  10002. * _.includes([1, 2, 3], 1);
  10003. * // => true
  10004. *
  10005. * _.includes([1, 2, 3], 1, 2);
  10006. * // => false
  10007. *
  10008. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10009. * // => true
  10010. *
  10011. * _.includes('abcd', 'bc');
  10012. * // => true
  10013. */
  10014. function includes(collection, value, fromIndex, guard) {
  10015. collection = isArrayLike(collection) ? collection : values(collection);
  10016. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10017. var length = collection.length;
  10018. if (fromIndex < 0) {
  10019. fromIndex = nativeMax(length + fromIndex, 0);
  10020. }
  10021. return isString(collection)
  10022. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10023. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10024. }
  10025. /**
  10026. * Invokes the method at `path` of each element in `collection`, returning
  10027. * an array of the results of each invoked method. Any additional arguments
  10028. * are provided to each invoked method. If `path` is a function, it's invoked
  10029. * for, and `this` bound to, each element in `collection`.
  10030. *
  10031. * @static
  10032. * @memberOf _
  10033. * @since 4.0.0
  10034. * @category Collection
  10035. * @param {Array|Object} collection The collection to iterate over.
  10036. * @param {Array|Function|string} path The path of the method to invoke or
  10037. * the function invoked per iteration.
  10038. * @param {...*} [args] The arguments to invoke each method with.
  10039. * @returns {Array} Returns the array of results.
  10040. * @example
  10041. *
  10042. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10043. * // => [[1, 5, 7], [1, 2, 3]]
  10044. *
  10045. * _.invokeMap([123, 456], String.prototype.split, '');
  10046. * // => [['1', '2', '3'], ['4', '5', '6']]
  10047. */
  10048. var invokeMap = baseRest(function(collection, path, args) {
  10049. var index = -1,
  10050. isFunc = typeof path == 'function',
  10051. result = isArrayLike(collection) ? Array(collection.length) : [];
  10052. baseEach(collection, function(value) {
  10053. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10054. });
  10055. return result;
  10056. });
  10057. /**
  10058. * Creates an object composed of keys generated from the results of running
  10059. * each element of `collection` thru `iteratee`. The corresponding value of
  10060. * each key is the last element responsible for generating the key. The
  10061. * iteratee is invoked with one argument: (value).
  10062. *
  10063. * @static
  10064. * @memberOf _
  10065. * @since 4.0.0
  10066. * @category Collection
  10067. * @param {Array|Object} collection The collection to iterate over.
  10068. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10069. * @returns {Object} Returns the composed aggregate object.
  10070. * @example
  10071. *
  10072. * var array = [
  10073. * { 'dir': 'left', 'code': 97 },
  10074. * { 'dir': 'right', 'code': 100 }
  10075. * ];
  10076. *
  10077. * _.keyBy(array, function(o) {
  10078. * return String.fromCharCode(o.code);
  10079. * });
  10080. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10081. *
  10082. * _.keyBy(array, 'dir');
  10083. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10084. */
  10085. var keyBy = createAggregator(function(result, value, key) {
  10086. baseAssignValue(result, key, value);
  10087. });
  10088. /**
  10089. * Creates an array of values by running each element in `collection` thru
  10090. * `iteratee`. The iteratee is invoked with three arguments:
  10091. * (value, index|key, collection).
  10092. *
  10093. * Many lodash methods are guarded to work as iteratees for methods like
  10094. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10095. *
  10096. * The guarded methods are:
  10097. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10098. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10099. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10100. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10101. *
  10102. * @static
  10103. * @memberOf _
  10104. * @since 0.1.0
  10105. * @category Collection
  10106. * @param {Array|Object} collection The collection to iterate over.
  10107. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10108. * @returns {Array} Returns the new mapped array.
  10109. * @example
  10110. *
  10111. * function square(n) {
  10112. * return n * n;
  10113. * }
  10114. *
  10115. * _.map([4, 8], square);
  10116. * // => [16, 64]
  10117. *
  10118. * _.map({ 'a': 4, 'b': 8 }, square);
  10119. * // => [16, 64] (iteration order is not guaranteed)
  10120. *
  10121. * var users = [
  10122. * { 'user': 'barney' },
  10123. * { 'user': 'fred' }
  10124. * ];
  10125. *
  10126. * // The `_.property` iteratee shorthand.
  10127. * _.map(users, 'user');
  10128. * // => ['barney', 'fred']
  10129. */
  10130. function map(collection, iteratee) {
  10131. var func = isArray(collection) ? arrayMap : baseMap;
  10132. return func(collection, getIteratee(iteratee, 3));
  10133. }
  10134. /**
  10135. * This method is like `_.sortBy` except that it allows specifying the sort
  10136. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10137. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10138. * descending or "asc" for ascending sort order of corresponding values.
  10139. *
  10140. * @static
  10141. * @memberOf _
  10142. * @since 4.0.0
  10143. * @category Collection
  10144. * @param {Array|Object} collection The collection to iterate over.
  10145. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10146. * The iteratees to sort by.
  10147. * @param {string[]} [orders] The sort orders of `iteratees`.
  10148. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10149. * @returns {Array} Returns the new sorted array.
  10150. * @example
  10151. *
  10152. * var users = [
  10153. * { 'user': 'fred', 'age': 48 },
  10154. * { 'user': 'barney', 'age': 34 },
  10155. * { 'user': 'fred', 'age': 40 },
  10156. * { 'user': 'barney', 'age': 36 }
  10157. * ];
  10158. *
  10159. * // Sort by `user` in ascending order and by `age` in descending order.
  10160. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10161. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10162. */
  10163. function orderBy(collection, iteratees, orders, guard) {
  10164. if (collection == null) {
  10165. return [];
  10166. }
  10167. if (!isArray(iteratees)) {
  10168. iteratees = iteratees == null ? [] : [iteratees];
  10169. }
  10170. orders = guard ? undefined : orders;
  10171. if (!isArray(orders)) {
  10172. orders = orders == null ? [] : [orders];
  10173. }
  10174. return baseOrderBy(collection, iteratees, orders);
  10175. }
  10176. /**
  10177. * Creates an array of elements split into two groups, the first of which
  10178. * contains elements `predicate` returns truthy for, the second of which
  10179. * contains elements `predicate` returns falsey for. The predicate is
  10180. * invoked with one argument: (value).
  10181. *
  10182. * @static
  10183. * @memberOf _
  10184. * @since 3.0.0
  10185. * @category Collection
  10186. * @param {Array|Object} collection The collection to iterate over.
  10187. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10188. * @returns {Array} Returns the array of grouped elements.
  10189. * @example
  10190. *
  10191. * var users = [
  10192. * { 'user': 'barney', 'age': 36, 'active': false },
  10193. * { 'user': 'fred', 'age': 40, 'active': true },
  10194. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10195. * ];
  10196. *
  10197. * _.partition(users, function(o) { return o.active; });
  10198. * // => objects for [['fred'], ['barney', 'pebbles']]
  10199. *
  10200. * // The `_.matches` iteratee shorthand.
  10201. * _.partition(users, { 'age': 1, 'active': false });
  10202. * // => objects for [['pebbles'], ['barney', 'fred']]
  10203. *
  10204. * // The `_.matchesProperty` iteratee shorthand.
  10205. * _.partition(users, ['active', false]);
  10206. * // => objects for [['barney', 'pebbles'], ['fred']]
  10207. *
  10208. * // The `_.property` iteratee shorthand.
  10209. * _.partition(users, 'active');
  10210. * // => objects for [['fred'], ['barney', 'pebbles']]
  10211. */
  10212. var partition = createAggregator(function(result, value, key) {
  10213. result[key ? 0 : 1].push(value);
  10214. }, function() { return [[], []]; });
  10215. /**
  10216. * Reduces `collection` to a value which is the accumulated result of running
  10217. * each element in `collection` thru `iteratee`, where each successive
  10218. * invocation is supplied the return value of the previous. If `accumulator`
  10219. * is not given, the first element of `collection` is used as the initial
  10220. * value. The iteratee is invoked with four arguments:
  10221. * (accumulator, value, index|key, collection).
  10222. *
  10223. * Many lodash methods are guarded to work as iteratees for methods like
  10224. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10225. *
  10226. * The guarded methods are:
  10227. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10228. * and `sortBy`
  10229. *
  10230. * @static
  10231. * @memberOf _
  10232. * @since 0.1.0
  10233. * @category Collection
  10234. * @param {Array|Object} collection The collection to iterate over.
  10235. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10236. * @param {*} [accumulator] The initial value.
  10237. * @returns {*} Returns the accumulated value.
  10238. * @see _.reduceRight
  10239. * @example
  10240. *
  10241. * _.reduce([1, 2], function(sum, n) {
  10242. * return sum + n;
  10243. * }, 0);
  10244. * // => 3
  10245. *
  10246. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10247. * (result[value] || (result[value] = [])).push(key);
  10248. * return result;
  10249. * }, {});
  10250. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10251. */
  10252. function reduce(collection, iteratee, accumulator) {
  10253. var func = isArray(collection) ? arrayReduce : baseReduce,
  10254. initAccum = arguments.length < 3;
  10255. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10256. }
  10257. /**
  10258. * This method is like `_.reduce` except that it iterates over elements of
  10259. * `collection` from right to left.
  10260. *
  10261. * @static
  10262. * @memberOf _
  10263. * @since 0.1.0
  10264. * @category Collection
  10265. * @param {Array|Object} collection The collection to iterate over.
  10266. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10267. * @param {*} [accumulator] The initial value.
  10268. * @returns {*} Returns the accumulated value.
  10269. * @see _.reduce
  10270. * @example
  10271. *
  10272. * var array = [[0, 1], [2, 3], [4, 5]];
  10273. *
  10274. * _.reduceRight(array, function(flattened, other) {
  10275. * return flattened.concat(other);
  10276. * }, []);
  10277. * // => [4, 5, 2, 3, 0, 1]
  10278. */
  10279. function reduceRight(collection, iteratee, accumulator) {
  10280. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10281. initAccum = arguments.length < 3;
  10282. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10283. }
  10284. /**
  10285. * The opposite of `_.filter`; this method returns the elements of `collection`
  10286. * that `predicate` does **not** return truthy for.
  10287. *
  10288. * @static
  10289. * @memberOf _
  10290. * @since 0.1.0
  10291. * @category Collection
  10292. * @param {Array|Object} collection The collection to iterate over.
  10293. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10294. * @returns {Array} Returns the new filtered array.
  10295. * @see _.filter
  10296. * @example
  10297. *
  10298. * var users = [
  10299. * { 'user': 'barney', 'age': 36, 'active': false },
  10300. * { 'user': 'fred', 'age': 40, 'active': true }
  10301. * ];
  10302. *
  10303. * _.reject(users, function(o) { return !o.active; });
  10304. * // => objects for ['fred']
  10305. *
  10306. * // The `_.matches` iteratee shorthand.
  10307. * _.reject(users, { 'age': 40, 'active': true });
  10308. * // => objects for ['barney']
  10309. *
  10310. * // The `_.matchesProperty` iteratee shorthand.
  10311. * _.reject(users, ['active', false]);
  10312. * // => objects for ['fred']
  10313. *
  10314. * // The `_.property` iteratee shorthand.
  10315. * _.reject(users, 'active');
  10316. * // => objects for ['barney']
  10317. */
  10318. function reject(collection, predicate) {
  10319. var func = isArray(collection) ? arrayFilter : baseFilter;
  10320. return func(collection, negate(getIteratee(predicate, 3)));
  10321. }
  10322. /**
  10323. * Gets a random element from `collection`.
  10324. *
  10325. * @static
  10326. * @memberOf _
  10327. * @since 2.0.0
  10328. * @category Collection
  10329. * @param {Array|Object} collection The collection to sample.
  10330. * @returns {*} Returns the random element.
  10331. * @example
  10332. *
  10333. * _.sample([1, 2, 3, 4]);
  10334. * // => 2
  10335. */
  10336. function sample(collection) {
  10337. var func = isArray(collection) ? arraySample : baseSample;
  10338. return func(collection);
  10339. }
  10340. /**
  10341. * Gets `n` random elements at unique keys from `collection` up to the
  10342. * size of `collection`.
  10343. *
  10344. * @static
  10345. * @memberOf _
  10346. * @since 4.0.0
  10347. * @category Collection
  10348. * @param {Array|Object} collection The collection to sample.
  10349. * @param {number} [n=1] The number of elements to sample.
  10350. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10351. * @returns {Array} Returns the random elements.
  10352. * @example
  10353. *
  10354. * _.sampleSize([1, 2, 3], 2);
  10355. * // => [3, 1]
  10356. *
  10357. * _.sampleSize([1, 2, 3], 4);
  10358. * // => [2, 3, 1]
  10359. */
  10360. function sampleSize(collection, n, guard) {
  10361. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10362. n = 1;
  10363. } else {
  10364. n = toInteger(n);
  10365. }
  10366. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10367. return func(collection, n);
  10368. }
  10369. /**
  10370. * Creates an array of shuffled values, using a version of the
  10371. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10372. *
  10373. * @static
  10374. * @memberOf _
  10375. * @since 0.1.0
  10376. * @category Collection
  10377. * @param {Array|Object} collection The collection to shuffle.
  10378. * @returns {Array} Returns the new shuffled array.
  10379. * @example
  10380. *
  10381. * _.shuffle([1, 2, 3, 4]);
  10382. * // => [4, 1, 3, 2]
  10383. */
  10384. function shuffle(collection) {
  10385. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10386. return func(collection);
  10387. }
  10388. /**
  10389. * Gets the size of `collection` by returning its length for array-like
  10390. * values or the number of own enumerable string keyed properties for objects.
  10391. *
  10392. * @static
  10393. * @memberOf _
  10394. * @since 0.1.0
  10395. * @category Collection
  10396. * @param {Array|Object|string} collection The collection to inspect.
  10397. * @returns {number} Returns the collection size.
  10398. * @example
  10399. *
  10400. * _.size([1, 2, 3]);
  10401. * // => 3
  10402. *
  10403. * _.size({ 'a': 1, 'b': 2 });
  10404. * // => 2
  10405. *
  10406. * _.size('pebbles');
  10407. * // => 7
  10408. */
  10409. function size(collection) {
  10410. if (collection == null) {
  10411. return 0;
  10412. }
  10413. if (isArrayLike(collection)) {
  10414. return isString(collection) ? stringSize(collection) : collection.length;
  10415. }
  10416. var tag = getTag(collection);
  10417. if (tag == mapTag || tag == setTag) {
  10418. return collection.size;
  10419. }
  10420. return baseKeys(collection).length;
  10421. }
  10422. /**
  10423. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10424. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10425. * invoked with three arguments: (value, index|key, collection).
  10426. *
  10427. * @static
  10428. * @memberOf _
  10429. * @since 0.1.0
  10430. * @category Collection
  10431. * @param {Array|Object} collection The collection to iterate over.
  10432. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10433. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10434. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10435. * else `false`.
  10436. * @example
  10437. *
  10438. * _.some([null, 0, 'yes', false], Boolean);
  10439. * // => true
  10440. *
  10441. * var users = [
  10442. * { 'user': 'barney', 'active': true },
  10443. * { 'user': 'fred', 'active': false }
  10444. * ];
  10445. *
  10446. * // The `_.matches` iteratee shorthand.
  10447. * _.some(users, { 'user': 'barney', 'active': false });
  10448. * // => false
  10449. *
  10450. * // The `_.matchesProperty` iteratee shorthand.
  10451. * _.some(users, ['active', false]);
  10452. * // => true
  10453. *
  10454. * // The `_.property` iteratee shorthand.
  10455. * _.some(users, 'active');
  10456. * // => true
  10457. */
  10458. function some(collection, predicate, guard) {
  10459. var func = isArray(collection) ? arraySome : baseSome;
  10460. if (guard && isIterateeCall(collection, predicate, guard)) {
  10461. predicate = undefined;
  10462. }
  10463. return func(collection, getIteratee(predicate, 3));
  10464. }
  10465. /**
  10466. * Creates an array of elements, sorted in ascending order by the results of
  10467. * running each element in a collection thru each iteratee. This method
  10468. * performs a stable sort, that is, it preserves the original sort order of
  10469. * equal elements. The iteratees are invoked with one argument: (value).
  10470. *
  10471. * @static
  10472. * @memberOf _
  10473. * @since 0.1.0
  10474. * @category Collection
  10475. * @param {Array|Object} collection The collection to iterate over.
  10476. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10477. * The iteratees to sort by.
  10478. * @returns {Array} Returns the new sorted array.
  10479. * @example
  10480. *
  10481. * var users = [
  10482. * { 'user': 'fred', 'age': 48 },
  10483. * { 'user': 'barney', 'age': 36 },
  10484. * { 'user': 'fred', 'age': 30 },
  10485. * { 'user': 'barney', 'age': 34 }
  10486. * ];
  10487. *
  10488. * _.sortBy(users, [function(o) { return o.user; }]);
  10489. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10490. *
  10491. * _.sortBy(users, ['user', 'age']);
  10492. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10493. */
  10494. var sortBy = baseRest(function(collection, iteratees) {
  10495. if (collection == null) {
  10496. return [];
  10497. }
  10498. var length = iteratees.length;
  10499. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10500. iteratees = [];
  10501. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10502. iteratees = [iteratees[0]];
  10503. }
  10504. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10505. });
  10506. /*------------------------------------------------------------------------*/
  10507. /**
  10508. * Gets the timestamp of the number of milliseconds that have elapsed since
  10509. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10510. *
  10511. * @static
  10512. * @memberOf _
  10513. * @since 2.4.0
  10514. * @category Date
  10515. * @returns {number} Returns the timestamp.
  10516. * @example
  10517. *
  10518. * _.defer(function(stamp) {
  10519. * console.log(_.now() - stamp);
  10520. * }, _.now());
  10521. * // => Logs the number of milliseconds it took for the deferred invocation.
  10522. */
  10523. var now = ctxNow || function() {
  10524. return root.Date.now();
  10525. };
  10526. /*------------------------------------------------------------------------*/
  10527. /**
  10528. * The opposite of `_.before`; this method creates a function that invokes
  10529. * `func` once it's called `n` or more times.
  10530. *
  10531. * @static
  10532. * @memberOf _
  10533. * @since 0.1.0
  10534. * @category Function
  10535. * @param {number} n The number of calls before `func` is invoked.
  10536. * @param {Function} func The function to restrict.
  10537. * @returns {Function} Returns the new restricted function.
  10538. * @example
  10539. *
  10540. * var saves = ['profile', 'settings'];
  10541. *
  10542. * var done = _.after(saves.length, function() {
  10543. * console.log('done saving!');
  10544. * });
  10545. *
  10546. * _.forEach(saves, function(type) {
  10547. * asyncSave({ 'type': type, 'complete': done });
  10548. * });
  10549. * // => Logs 'done saving!' after the two async saves have completed.
  10550. */
  10551. function after(n, func) {
  10552. if (typeof func != 'function') {
  10553. throw new TypeError(FUNC_ERROR_TEXT);
  10554. }
  10555. n = toInteger(n);
  10556. return function() {
  10557. if (--n < 1) {
  10558. return func.apply(this, arguments);
  10559. }
  10560. };
  10561. }
  10562. /**
  10563. * Creates a function that invokes `func`, with up to `n` arguments,
  10564. * ignoring any additional arguments.
  10565. *
  10566. * @static
  10567. * @memberOf _
  10568. * @since 3.0.0
  10569. * @category Function
  10570. * @param {Function} func The function to cap arguments for.
  10571. * @param {number} [n=func.length] The arity cap.
  10572. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10573. * @returns {Function} Returns the new capped function.
  10574. * @example
  10575. *
  10576. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10577. * // => [6, 8, 10]
  10578. */
  10579. function ary(func, n, guard) {
  10580. n = guard ? undefined : n;
  10581. n = (func && n == null) ? func.length : n;
  10582. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10583. }
  10584. /**
  10585. * Creates a function that invokes `func`, with the `this` binding and arguments
  10586. * of the created function, while it's called less than `n` times. Subsequent
  10587. * calls to the created function return the result of the last `func` invocation.
  10588. *
  10589. * @static
  10590. * @memberOf _
  10591. * @since 3.0.0
  10592. * @category Function
  10593. * @param {number} n The number of calls at which `func` is no longer invoked.
  10594. * @param {Function} func The function to restrict.
  10595. * @returns {Function} Returns the new restricted function.
  10596. * @example
  10597. *
  10598. * jQuery(element).on('click', _.before(5, addContactToList));
  10599. * // => Allows adding up to 4 contacts to the list.
  10600. */
  10601. function before(n, func) {
  10602. var result;
  10603. if (typeof func != 'function') {
  10604. throw new TypeError(FUNC_ERROR_TEXT);
  10605. }
  10606. n = toInteger(n);
  10607. return function() {
  10608. if (--n > 0) {
  10609. result = func.apply(this, arguments);
  10610. }
  10611. if (n <= 1) {
  10612. func = undefined;
  10613. }
  10614. return result;
  10615. };
  10616. }
  10617. /**
  10618. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10619. * and `partials` prepended to the arguments it receives.
  10620. *
  10621. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10622. * may be used as a placeholder for partially applied arguments.
  10623. *
  10624. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10625. * property of bound functions.
  10626. *
  10627. * @static
  10628. * @memberOf _
  10629. * @since 0.1.0
  10630. * @category Function
  10631. * @param {Function} func The function to bind.
  10632. * @param {*} thisArg The `this` binding of `func`.
  10633. * @param {...*} [partials] The arguments to be partially applied.
  10634. * @returns {Function} Returns the new bound function.
  10635. * @example
  10636. *
  10637. * function greet(greeting, punctuation) {
  10638. * return greeting + ' ' + this.user + punctuation;
  10639. * }
  10640. *
  10641. * var object = { 'user': 'fred' };
  10642. *
  10643. * var bound = _.bind(greet, object, 'hi');
  10644. * bound('!');
  10645. * // => 'hi fred!'
  10646. *
  10647. * // Bound with placeholders.
  10648. * var bound = _.bind(greet, object, _, '!');
  10649. * bound('hi');
  10650. * // => 'hi fred!'
  10651. */
  10652. var bind = baseRest(function(func, thisArg, partials) {
  10653. var bitmask = WRAP_BIND_FLAG;
  10654. if (partials.length) {
  10655. var holders = replaceHolders(partials, getHolder(bind));
  10656. bitmask |= WRAP_PARTIAL_FLAG;
  10657. }
  10658. return createWrap(func, bitmask, thisArg, partials, holders);
  10659. });
  10660. /**
  10661. * Creates a function that invokes the method at `object[key]` with `partials`
  10662. * prepended to the arguments it receives.
  10663. *
  10664. * This method differs from `_.bind` by allowing bound functions to reference
  10665. * methods that may be redefined or don't yet exist. See
  10666. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10667. * for more details.
  10668. *
  10669. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10670. * builds, may be used as a placeholder for partially applied arguments.
  10671. *
  10672. * @static
  10673. * @memberOf _
  10674. * @since 0.10.0
  10675. * @category Function
  10676. * @param {Object} object The object to invoke the method on.
  10677. * @param {string} key The key of the method.
  10678. * @param {...*} [partials] The arguments to be partially applied.
  10679. * @returns {Function} Returns the new bound function.
  10680. * @example
  10681. *
  10682. * var object = {
  10683. * 'user': 'fred',
  10684. * 'greet': function(greeting, punctuation) {
  10685. * return greeting + ' ' + this.user + punctuation;
  10686. * }
  10687. * };
  10688. *
  10689. * var bound = _.bindKey(object, 'greet', 'hi');
  10690. * bound('!');
  10691. * // => 'hi fred!'
  10692. *
  10693. * object.greet = function(greeting, punctuation) {
  10694. * return greeting + 'ya ' + this.user + punctuation;
  10695. * };
  10696. *
  10697. * bound('!');
  10698. * // => 'hiya fred!'
  10699. *
  10700. * // Bound with placeholders.
  10701. * var bound = _.bindKey(object, 'greet', _, '!');
  10702. * bound('hi');
  10703. * // => 'hiya fred!'
  10704. */
  10705. var bindKey = baseRest(function(object, key, partials) {
  10706. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10707. if (partials.length) {
  10708. var holders = replaceHolders(partials, getHolder(bindKey));
  10709. bitmask |= WRAP_PARTIAL_FLAG;
  10710. }
  10711. return createWrap(key, bitmask, object, partials, holders);
  10712. });
  10713. /**
  10714. * Creates a function that accepts arguments of `func` and either invokes
  10715. * `func` returning its result, if at least `arity` number of arguments have
  10716. * been provided, or returns a function that accepts the remaining `func`
  10717. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10718. * is not sufficient.
  10719. *
  10720. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10721. * may be used as a placeholder for provided arguments.
  10722. *
  10723. * **Note:** This method doesn't set the "length" property of curried functions.
  10724. *
  10725. * @static
  10726. * @memberOf _
  10727. * @since 2.0.0
  10728. * @category Function
  10729. * @param {Function} func The function to curry.
  10730. * @param {number} [arity=func.length] The arity of `func`.
  10731. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10732. * @returns {Function} Returns the new curried function.
  10733. * @example
  10734. *
  10735. * var abc = function(a, b, c) {
  10736. * return [a, b, c];
  10737. * };
  10738. *
  10739. * var curried = _.curry(abc);
  10740. *
  10741. * curried(1)(2)(3);
  10742. * // => [1, 2, 3]
  10743. *
  10744. * curried(1, 2)(3);
  10745. * // => [1, 2, 3]
  10746. *
  10747. * curried(1, 2, 3);
  10748. * // => [1, 2, 3]
  10749. *
  10750. * // Curried with placeholders.
  10751. * curried(1)(_, 3)(2);
  10752. * // => [1, 2, 3]
  10753. */
  10754. function curry(func, arity, guard) {
  10755. arity = guard ? undefined : arity;
  10756. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10757. result.placeholder = curry.placeholder;
  10758. return result;
  10759. }
  10760. /**
  10761. * This method is like `_.curry` except that arguments are applied to `func`
  10762. * in the manner of `_.partialRight` instead of `_.partial`.
  10763. *
  10764. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10765. * builds, may be used as a placeholder for provided arguments.
  10766. *
  10767. * **Note:** This method doesn't set the "length" property of curried functions.
  10768. *
  10769. * @static
  10770. * @memberOf _
  10771. * @since 3.0.0
  10772. * @category Function
  10773. * @param {Function} func The function to curry.
  10774. * @param {number} [arity=func.length] The arity of `func`.
  10775. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10776. * @returns {Function} Returns the new curried function.
  10777. * @example
  10778. *
  10779. * var abc = function(a, b, c) {
  10780. * return [a, b, c];
  10781. * };
  10782. *
  10783. * var curried = _.curryRight(abc);
  10784. *
  10785. * curried(3)(2)(1);
  10786. * // => [1, 2, 3]
  10787. *
  10788. * curried(2, 3)(1);
  10789. * // => [1, 2, 3]
  10790. *
  10791. * curried(1, 2, 3);
  10792. * // => [1, 2, 3]
  10793. *
  10794. * // Curried with placeholders.
  10795. * curried(3)(1, _)(2);
  10796. * // => [1, 2, 3]
  10797. */
  10798. function curryRight(func, arity, guard) {
  10799. arity = guard ? undefined : arity;
  10800. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10801. result.placeholder = curryRight.placeholder;
  10802. return result;
  10803. }
  10804. /**
  10805. * Creates a debounced function that delays invoking `func` until after `wait`
  10806. * milliseconds have elapsed since the last time the debounced function was
  10807. * invoked. The debounced function comes with a `cancel` method to cancel
  10808. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10809. * Provide `options` to indicate whether `func` should be invoked on the
  10810. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10811. * with the last arguments provided to the debounced function. Subsequent
  10812. * calls to the debounced function return the result of the last `func`
  10813. * invocation.
  10814. *
  10815. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10816. * invoked on the trailing edge of the timeout only if the debounced function
  10817. * is invoked more than once during the `wait` timeout.
  10818. *
  10819. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10820. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10821. *
  10822. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10823. * for details over the differences between `_.debounce` and `_.throttle`.
  10824. *
  10825. * @static
  10826. * @memberOf _
  10827. * @since 0.1.0
  10828. * @category Function
  10829. * @param {Function} func The function to debounce.
  10830. * @param {number} [wait=0] The number of milliseconds to delay.
  10831. * @param {Object} [options={}] The options object.
  10832. * @param {boolean} [options.leading=false]
  10833. * Specify invoking on the leading edge of the timeout.
  10834. * @param {number} [options.maxWait]
  10835. * The maximum time `func` is allowed to be delayed before it's invoked.
  10836. * @param {boolean} [options.trailing=true]
  10837. * Specify invoking on the trailing edge of the timeout.
  10838. * @returns {Function} Returns the new debounced function.
  10839. * @example
  10840. *
  10841. * // Avoid costly calculations while the window size is in flux.
  10842. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10843. *
  10844. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10845. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10846. * 'leading': true,
  10847. * 'trailing': false
  10848. * }));
  10849. *
  10850. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10851. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10852. * var source = new EventSource('/stream');
  10853. * jQuery(source).on('message', debounced);
  10854. *
  10855. * // Cancel the trailing debounced invocation.
  10856. * jQuery(window).on('popstate', debounced.cancel);
  10857. */
  10858. function debounce(func, wait, options) {
  10859. var lastArgs,
  10860. lastThis,
  10861. maxWait,
  10862. result,
  10863. timerId,
  10864. lastCallTime,
  10865. lastInvokeTime = 0,
  10866. leading = false,
  10867. maxing = false,
  10868. trailing = true;
  10869. if (typeof func != 'function') {
  10870. throw new TypeError(FUNC_ERROR_TEXT);
  10871. }
  10872. wait = toNumber(wait) || 0;
  10873. if (isObject(options)) {
  10874. leading = !!options.leading;
  10875. maxing = 'maxWait' in options;
  10876. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10877. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10878. }
  10879. function invokeFunc(time) {
  10880. var args = lastArgs,
  10881. thisArg = lastThis;
  10882. lastArgs = lastThis = undefined;
  10883. lastInvokeTime = time;
  10884. result = func.apply(thisArg, args);
  10885. return result;
  10886. }
  10887. function leadingEdge(time) {
  10888. // Reset any `maxWait` timer.
  10889. lastInvokeTime = time;
  10890. // Start the timer for the trailing edge.
  10891. timerId = setTimeout(timerExpired, wait);
  10892. // Invoke the leading edge.
  10893. return leading ? invokeFunc(time) : result;
  10894. }
  10895. function remainingWait(time) {
  10896. var timeSinceLastCall = time - lastCallTime,
  10897. timeSinceLastInvoke = time - lastInvokeTime,
  10898. timeWaiting = wait - timeSinceLastCall;
  10899. return maxing
  10900. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10901. : timeWaiting;
  10902. }
  10903. function shouldInvoke(time) {
  10904. var timeSinceLastCall = time - lastCallTime,
  10905. timeSinceLastInvoke = time - lastInvokeTime;
  10906. // Either this is the first call, activity has stopped and we're at the
  10907. // trailing edge, the system time has gone backwards and we're treating
  10908. // it as the trailing edge, or we've hit the `maxWait` limit.
  10909. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10910. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10911. }
  10912. function timerExpired() {
  10913. var time = now();
  10914. if (shouldInvoke(time)) {
  10915. return trailingEdge(time);
  10916. }
  10917. // Restart the timer.
  10918. timerId = setTimeout(timerExpired, remainingWait(time));
  10919. }
  10920. function trailingEdge(time) {
  10921. timerId = undefined;
  10922. // Only invoke if we have `lastArgs` which means `func` has been
  10923. // debounced at least once.
  10924. if (trailing && lastArgs) {
  10925. return invokeFunc(time);
  10926. }
  10927. lastArgs = lastThis = undefined;
  10928. return result;
  10929. }
  10930. function cancel() {
  10931. if (timerId !== undefined) {
  10932. clearTimeout(timerId);
  10933. }
  10934. lastInvokeTime = 0;
  10935. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10936. }
  10937. function flush() {
  10938. return timerId === undefined ? result : trailingEdge(now());
  10939. }
  10940. function debounced() {
  10941. var time = now(),
  10942. isInvoking = shouldInvoke(time);
  10943. lastArgs = arguments;
  10944. lastThis = this;
  10945. lastCallTime = time;
  10946. if (isInvoking) {
  10947. if (timerId === undefined) {
  10948. return leadingEdge(lastCallTime);
  10949. }
  10950. if (maxing) {
  10951. // Handle invocations in a tight loop.
  10952. clearTimeout(timerId);
  10953. timerId = setTimeout(timerExpired, wait);
  10954. return invokeFunc(lastCallTime);
  10955. }
  10956. }
  10957. if (timerId === undefined) {
  10958. timerId = setTimeout(timerExpired, wait);
  10959. }
  10960. return result;
  10961. }
  10962. debounced.cancel = cancel;
  10963. debounced.flush = flush;
  10964. return debounced;
  10965. }
  10966. /**
  10967. * Defers invoking the `func` until the current call stack has cleared. Any
  10968. * additional arguments are provided to `func` when it's invoked.
  10969. *
  10970. * @static
  10971. * @memberOf _
  10972. * @since 0.1.0
  10973. * @category Function
  10974. * @param {Function} func The function to defer.
  10975. * @param {...*} [args] The arguments to invoke `func` with.
  10976. * @returns {number} Returns the timer id.
  10977. * @example
  10978. *
  10979. * _.defer(function(text) {
  10980. * console.log(text);
  10981. * }, 'deferred');
  10982. * // => Logs 'deferred' after one millisecond.
  10983. */
  10984. var defer = baseRest(function(func, args) {
  10985. return baseDelay(func, 1, args);
  10986. });
  10987. /**
  10988. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10989. * provided to `func` when it's invoked.
  10990. *
  10991. * @static
  10992. * @memberOf _
  10993. * @since 0.1.0
  10994. * @category Function
  10995. * @param {Function} func The function to delay.
  10996. * @param {number} wait The number of milliseconds to delay invocation.
  10997. * @param {...*} [args] The arguments to invoke `func` with.
  10998. * @returns {number} Returns the timer id.
  10999. * @example
  11000. *
  11001. * _.delay(function(text) {
  11002. * console.log(text);
  11003. * }, 1000, 'later');
  11004. * // => Logs 'later' after one second.
  11005. */
  11006. var delay = baseRest(function(func, wait, args) {
  11007. return baseDelay(func, toNumber(wait) || 0, args);
  11008. });
  11009. /**
  11010. * Creates a function that invokes `func` with arguments reversed.
  11011. *
  11012. * @static
  11013. * @memberOf _
  11014. * @since 4.0.0
  11015. * @category Function
  11016. * @param {Function} func The function to flip arguments for.
  11017. * @returns {Function} Returns the new flipped function.
  11018. * @example
  11019. *
  11020. * var flipped = _.flip(function() {
  11021. * return _.toArray(arguments);
  11022. * });
  11023. *
  11024. * flipped('a', 'b', 'c', 'd');
  11025. * // => ['d', 'c', 'b', 'a']
  11026. */
  11027. function flip(func) {
  11028. return createWrap(func, WRAP_FLIP_FLAG);
  11029. }
  11030. /**
  11031. * Creates a function that memoizes the result of `func`. If `resolver` is
  11032. * provided, it determines the cache key for storing the result based on the
  11033. * arguments provided to the memoized function. By default, the first argument
  11034. * provided to the memoized function is used as the map cache key. The `func`
  11035. * is invoked with the `this` binding of the memoized function.
  11036. *
  11037. * **Note:** The cache is exposed as the `cache` property on the memoized
  11038. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11039. * constructor with one whose instances implement the
  11040. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11041. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11042. *
  11043. * @static
  11044. * @memberOf _
  11045. * @since 0.1.0
  11046. * @category Function
  11047. * @param {Function} func The function to have its output memoized.
  11048. * @param {Function} [resolver] The function to resolve the cache key.
  11049. * @returns {Function} Returns the new memoized function.
  11050. * @example
  11051. *
  11052. * var object = { 'a': 1, 'b': 2 };
  11053. * var other = { 'c': 3, 'd': 4 };
  11054. *
  11055. * var values = _.memoize(_.values);
  11056. * values(object);
  11057. * // => [1, 2]
  11058. *
  11059. * values(other);
  11060. * // => [3, 4]
  11061. *
  11062. * object.a = 2;
  11063. * values(object);
  11064. * // => [1, 2]
  11065. *
  11066. * // Modify the result cache.
  11067. * values.cache.set(object, ['a', 'b']);
  11068. * values(object);
  11069. * // => ['a', 'b']
  11070. *
  11071. * // Replace `_.memoize.Cache`.
  11072. * _.memoize.Cache = WeakMap;
  11073. */
  11074. function memoize(func, resolver) {
  11075. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11076. throw new TypeError(FUNC_ERROR_TEXT);
  11077. }
  11078. var memoized = function() {
  11079. var args = arguments,
  11080. key = resolver ? resolver.apply(this, args) : args[0],
  11081. cache = memoized.cache;
  11082. if (cache.has(key)) {
  11083. return cache.get(key);
  11084. }
  11085. var result = func.apply(this, args);
  11086. memoized.cache = cache.set(key, result) || cache;
  11087. return result;
  11088. };
  11089. memoized.cache = new (memoize.Cache || MapCache);
  11090. return memoized;
  11091. }
  11092. // Expose `MapCache`.
  11093. memoize.Cache = MapCache;
  11094. /**
  11095. * Creates a function that negates the result of the predicate `func`. The
  11096. * `func` predicate is invoked with the `this` binding and arguments of the
  11097. * created function.
  11098. *
  11099. * @static
  11100. * @memberOf _
  11101. * @since 3.0.0
  11102. * @category Function
  11103. * @param {Function} predicate The predicate to negate.
  11104. * @returns {Function} Returns the new negated function.
  11105. * @example
  11106. *
  11107. * function isEven(n) {
  11108. * return n % 2 == 0;
  11109. * }
  11110. *
  11111. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11112. * // => [1, 3, 5]
  11113. */
  11114. function negate(predicate) {
  11115. if (typeof predicate != 'function') {
  11116. throw new TypeError(FUNC_ERROR_TEXT);
  11117. }
  11118. return function() {
  11119. var args = arguments;
  11120. switch (args.length) {
  11121. case 0: return !predicate.call(this);
  11122. case 1: return !predicate.call(this, args[0]);
  11123. case 2: return !predicate.call(this, args[0], args[1]);
  11124. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11125. }
  11126. return !predicate.apply(this, args);
  11127. };
  11128. }
  11129. /**
  11130. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11131. * to the function return the value of the first invocation. The `func` is
  11132. * invoked with the `this` binding and arguments of the created function.
  11133. *
  11134. * @static
  11135. * @memberOf _
  11136. * @since 0.1.0
  11137. * @category Function
  11138. * @param {Function} func The function to restrict.
  11139. * @returns {Function} Returns the new restricted function.
  11140. * @example
  11141. *
  11142. * var initialize = _.once(createApplication);
  11143. * initialize();
  11144. * initialize();
  11145. * // => `createApplication` is invoked once
  11146. */
  11147. function once(func) {
  11148. return before(2, func);
  11149. }
  11150. /**
  11151. * Creates a function that invokes `func` with its arguments transformed.
  11152. *
  11153. * @static
  11154. * @since 4.0.0
  11155. * @memberOf _
  11156. * @category Function
  11157. * @param {Function} func The function to wrap.
  11158. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11159. * The argument transforms.
  11160. * @returns {Function} Returns the new function.
  11161. * @example
  11162. *
  11163. * function doubled(n) {
  11164. * return n * 2;
  11165. * }
  11166. *
  11167. * function square(n) {
  11168. * return n * n;
  11169. * }
  11170. *
  11171. * var func = _.overArgs(function(x, y) {
  11172. * return [x, y];
  11173. * }, [square, doubled]);
  11174. *
  11175. * func(9, 3);
  11176. * // => [81, 6]
  11177. *
  11178. * func(10, 5);
  11179. * // => [100, 10]
  11180. */
  11181. var overArgs = castRest(function(func, transforms) {
  11182. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11183. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11184. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11185. var funcsLength = transforms.length;
  11186. return baseRest(function(args) {
  11187. var index = -1,
  11188. length = nativeMin(args.length, funcsLength);
  11189. while (++index < length) {
  11190. args[index] = transforms[index].call(this, args[index]);
  11191. }
  11192. return apply(func, this, args);
  11193. });
  11194. });
  11195. /**
  11196. * Creates a function that invokes `func` with `partials` prepended to the
  11197. * arguments it receives. This method is like `_.bind` except it does **not**
  11198. * alter the `this` binding.
  11199. *
  11200. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11201. * builds, may be used as a placeholder for partially applied arguments.
  11202. *
  11203. * **Note:** This method doesn't set the "length" property of partially
  11204. * applied functions.
  11205. *
  11206. * @static
  11207. * @memberOf _
  11208. * @since 0.2.0
  11209. * @category Function
  11210. * @param {Function} func The function to partially apply arguments to.
  11211. * @param {...*} [partials] The arguments to be partially applied.
  11212. * @returns {Function} Returns the new partially applied function.
  11213. * @example
  11214. *
  11215. * function greet(greeting, name) {
  11216. * return greeting + ' ' + name;
  11217. * }
  11218. *
  11219. * var sayHelloTo = _.partial(greet, 'hello');
  11220. * sayHelloTo('fred');
  11221. * // => 'hello fred'
  11222. *
  11223. * // Partially applied with placeholders.
  11224. * var greetFred = _.partial(greet, _, 'fred');
  11225. * greetFred('hi');
  11226. * // => 'hi fred'
  11227. */
  11228. var partial = baseRest(function(func, partials) {
  11229. var holders = replaceHolders(partials, getHolder(partial));
  11230. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11231. });
  11232. /**
  11233. * This method is like `_.partial` except that partially applied arguments
  11234. * are appended to the arguments it receives.
  11235. *
  11236. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11237. * builds, may be used as a placeholder for partially applied arguments.
  11238. *
  11239. * **Note:** This method doesn't set the "length" property of partially
  11240. * applied functions.
  11241. *
  11242. * @static
  11243. * @memberOf _
  11244. * @since 1.0.0
  11245. * @category Function
  11246. * @param {Function} func The function to partially apply arguments to.
  11247. * @param {...*} [partials] The arguments to be partially applied.
  11248. * @returns {Function} Returns the new partially applied function.
  11249. * @example
  11250. *
  11251. * function greet(greeting, name) {
  11252. * return greeting + ' ' + name;
  11253. * }
  11254. *
  11255. * var greetFred = _.partialRight(greet, 'fred');
  11256. * greetFred('hi');
  11257. * // => 'hi fred'
  11258. *
  11259. * // Partially applied with placeholders.
  11260. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11261. * sayHelloTo('fred');
  11262. * // => 'hello fred'
  11263. */
  11264. var partialRight = baseRest(function(func, partials) {
  11265. var holders = replaceHolders(partials, getHolder(partialRight));
  11266. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11267. });
  11268. /**
  11269. * Creates a function that invokes `func` with arguments arranged according
  11270. * to the specified `indexes` where the argument value at the first index is
  11271. * provided as the first argument, the argument value at the second index is
  11272. * provided as the second argument, and so on.
  11273. *
  11274. * @static
  11275. * @memberOf _
  11276. * @since 3.0.0
  11277. * @category Function
  11278. * @param {Function} func The function to rearrange arguments for.
  11279. * @param {...(number|number[])} indexes The arranged argument indexes.
  11280. * @returns {Function} Returns the new function.
  11281. * @example
  11282. *
  11283. * var rearged = _.rearg(function(a, b, c) {
  11284. * return [a, b, c];
  11285. * }, [2, 0, 1]);
  11286. *
  11287. * rearged('b', 'c', 'a')
  11288. * // => ['a', 'b', 'c']
  11289. */
  11290. var rearg = flatRest(function(func, indexes) {
  11291. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11292. });
  11293. /**
  11294. * Creates a function that invokes `func` with the `this` binding of the
  11295. * created function and arguments from `start` and beyond provided as
  11296. * an array.
  11297. *
  11298. * **Note:** This method is based on the
  11299. * [rest parameter](https://mdn.io/rest_parameters).
  11300. *
  11301. * @static
  11302. * @memberOf _
  11303. * @since 4.0.0
  11304. * @category Function
  11305. * @param {Function} func The function to apply a rest parameter to.
  11306. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11307. * @returns {Function} Returns the new function.
  11308. * @example
  11309. *
  11310. * var say = _.rest(function(what, names) {
  11311. * return what + ' ' + _.initial(names).join(', ') +
  11312. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11313. * });
  11314. *
  11315. * say('hello', 'fred', 'barney', 'pebbles');
  11316. * // => 'hello fred, barney, & pebbles'
  11317. */
  11318. function rest(func, start) {
  11319. if (typeof func != 'function') {
  11320. throw new TypeError(FUNC_ERROR_TEXT);
  11321. }
  11322. start = start === undefined ? start : toInteger(start);
  11323. return baseRest(func, start);
  11324. }
  11325. /**
  11326. * Creates a function that invokes `func` with the `this` binding of the
  11327. * create function and an array of arguments much like
  11328. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11329. *
  11330. * **Note:** This method is based on the
  11331. * [spread operator](https://mdn.io/spread_operator).
  11332. *
  11333. * @static
  11334. * @memberOf _
  11335. * @since 3.2.0
  11336. * @category Function
  11337. * @param {Function} func The function to spread arguments over.
  11338. * @param {number} [start=0] The start position of the spread.
  11339. * @returns {Function} Returns the new function.
  11340. * @example
  11341. *
  11342. * var say = _.spread(function(who, what) {
  11343. * return who + ' says ' + what;
  11344. * });
  11345. *
  11346. * say(['fred', 'hello']);
  11347. * // => 'fred says hello'
  11348. *
  11349. * var numbers = Promise.all([
  11350. * Promise.resolve(40),
  11351. * Promise.resolve(36)
  11352. * ]);
  11353. *
  11354. * numbers.then(_.spread(function(x, y) {
  11355. * return x + y;
  11356. * }));
  11357. * // => a Promise of 76
  11358. */
  11359. function spread(func, start) {
  11360. if (typeof func != 'function') {
  11361. throw new TypeError(FUNC_ERROR_TEXT);
  11362. }
  11363. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11364. return baseRest(function(args) {
  11365. var array = args[start],
  11366. otherArgs = castSlice(args, 0, start);
  11367. if (array) {
  11368. arrayPush(otherArgs, array);
  11369. }
  11370. return apply(func, this, otherArgs);
  11371. });
  11372. }
  11373. /**
  11374. * Creates a throttled function that only invokes `func` at most once per
  11375. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11376. * method to cancel delayed `func` invocations and a `flush` method to
  11377. * immediately invoke them. Provide `options` to indicate whether `func`
  11378. * should be invoked on the leading and/or trailing edge of the `wait`
  11379. * timeout. The `func` is invoked with the last arguments provided to the
  11380. * throttled function. Subsequent calls to the throttled function return the
  11381. * result of the last `func` invocation.
  11382. *
  11383. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11384. * invoked on the trailing edge of the timeout only if the throttled function
  11385. * is invoked more than once during the `wait` timeout.
  11386. *
  11387. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11388. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11389. *
  11390. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11391. * for details over the differences between `_.throttle` and `_.debounce`.
  11392. *
  11393. * @static
  11394. * @memberOf _
  11395. * @since 0.1.0
  11396. * @category Function
  11397. * @param {Function} func The function to throttle.
  11398. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11399. * @param {Object} [options={}] The options object.
  11400. * @param {boolean} [options.leading=true]
  11401. * Specify invoking on the leading edge of the timeout.
  11402. * @param {boolean} [options.trailing=true]
  11403. * Specify invoking on the trailing edge of the timeout.
  11404. * @returns {Function} Returns the new throttled function.
  11405. * @example
  11406. *
  11407. * // Avoid excessively updating the position while scrolling.
  11408. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11409. *
  11410. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11411. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11412. * jQuery(element).on('click', throttled);
  11413. *
  11414. * // Cancel the trailing throttled invocation.
  11415. * jQuery(window).on('popstate', throttled.cancel);
  11416. */
  11417. function throttle(func, wait, options) {
  11418. var leading = true,
  11419. trailing = true;
  11420. if (typeof func != 'function') {
  11421. throw new TypeError(FUNC_ERROR_TEXT);
  11422. }
  11423. if (isObject(options)) {
  11424. leading = 'leading' in options ? !!options.leading : leading;
  11425. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11426. }
  11427. return debounce(func, wait, {
  11428. 'leading': leading,
  11429. 'maxWait': wait,
  11430. 'trailing': trailing
  11431. });
  11432. }
  11433. /**
  11434. * Creates a function that accepts up to one argument, ignoring any
  11435. * additional arguments.
  11436. *
  11437. * @static
  11438. * @memberOf _
  11439. * @since 4.0.0
  11440. * @category Function
  11441. * @param {Function} func The function to cap arguments for.
  11442. * @returns {Function} Returns the new capped function.
  11443. * @example
  11444. *
  11445. * _.map(['6', '8', '10'], _.unary(parseInt));
  11446. * // => [6, 8, 10]
  11447. */
  11448. function unary(func) {
  11449. return ary(func, 1);
  11450. }
  11451. /**
  11452. * Creates a function that provides `value` to `wrapper` as its first
  11453. * argument. Any additional arguments provided to the function are appended
  11454. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11455. * binding of the created function.
  11456. *
  11457. * @static
  11458. * @memberOf _
  11459. * @since 0.1.0
  11460. * @category Function
  11461. * @param {*} value The value to wrap.
  11462. * @param {Function} [wrapper=identity] The wrapper function.
  11463. * @returns {Function} Returns the new function.
  11464. * @example
  11465. *
  11466. * var p = _.wrap(_.escape, function(func, text) {
  11467. * return '<p>' + func(text) + '</p>';
  11468. * });
  11469. *
  11470. * p('fred, barney, & pebbles');
  11471. * // => '<p>fred, barney, &amp; pebbles</p>'
  11472. */
  11473. function wrap(value, wrapper) {
  11474. return partial(castFunction(wrapper), value);
  11475. }
  11476. /*------------------------------------------------------------------------*/
  11477. /**
  11478. * Casts `value` as an array if it's not one.
  11479. *
  11480. * @static
  11481. * @memberOf _
  11482. * @since 4.4.0
  11483. * @category Lang
  11484. * @param {*} value The value to inspect.
  11485. * @returns {Array} Returns the cast array.
  11486. * @example
  11487. *
  11488. * _.castArray(1);
  11489. * // => [1]
  11490. *
  11491. * _.castArray({ 'a': 1 });
  11492. * // => [{ 'a': 1 }]
  11493. *
  11494. * _.castArray('abc');
  11495. * // => ['abc']
  11496. *
  11497. * _.castArray(null);
  11498. * // => [null]
  11499. *
  11500. * _.castArray(undefined);
  11501. * // => [undefined]
  11502. *
  11503. * _.castArray();
  11504. * // => []
  11505. *
  11506. * var array = [1, 2, 3];
  11507. * console.log(_.castArray(array) === array);
  11508. * // => true
  11509. */
  11510. function castArray() {
  11511. if (!arguments.length) {
  11512. return [];
  11513. }
  11514. var value = arguments[0];
  11515. return isArray(value) ? value : [value];
  11516. }
  11517. /**
  11518. * Creates a shallow clone of `value`.
  11519. *
  11520. * **Note:** This method is loosely based on the
  11521. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11522. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11523. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11524. * arrays. The own enumerable properties of `arguments` objects are cloned
  11525. * as plain objects. An empty object is returned for uncloneable values such
  11526. * as error objects, functions, DOM nodes, and WeakMaps.
  11527. *
  11528. * @static
  11529. * @memberOf _
  11530. * @since 0.1.0
  11531. * @category Lang
  11532. * @param {*} value The value to clone.
  11533. * @returns {*} Returns the cloned value.
  11534. * @see _.cloneDeep
  11535. * @example
  11536. *
  11537. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11538. *
  11539. * var shallow = _.clone(objects);
  11540. * console.log(shallow[0] === objects[0]);
  11541. * // => true
  11542. */
  11543. function clone(value) {
  11544. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11545. }
  11546. /**
  11547. * This method is like `_.clone` except that it accepts `customizer` which
  11548. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11549. * cloning is handled by the method instead. The `customizer` is invoked with
  11550. * up to four arguments; (value [, index|key, object, stack]).
  11551. *
  11552. * @static
  11553. * @memberOf _
  11554. * @since 4.0.0
  11555. * @category Lang
  11556. * @param {*} value The value to clone.
  11557. * @param {Function} [customizer] The function to customize cloning.
  11558. * @returns {*} Returns the cloned value.
  11559. * @see _.cloneDeepWith
  11560. * @example
  11561. *
  11562. * function customizer(value) {
  11563. * if (_.isElement(value)) {
  11564. * return value.cloneNode(false);
  11565. * }
  11566. * }
  11567. *
  11568. * var el = _.cloneWith(document.body, customizer);
  11569. *
  11570. * console.log(el === document.body);
  11571. * // => false
  11572. * console.log(el.nodeName);
  11573. * // => 'BODY'
  11574. * console.log(el.childNodes.length);
  11575. * // => 0
  11576. */
  11577. function cloneWith(value, customizer) {
  11578. customizer = typeof customizer == 'function' ? customizer : undefined;
  11579. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11580. }
  11581. /**
  11582. * This method is like `_.clone` except that it recursively clones `value`.
  11583. *
  11584. * @static
  11585. * @memberOf _
  11586. * @since 1.0.0
  11587. * @category Lang
  11588. * @param {*} value The value to recursively clone.
  11589. * @returns {*} Returns the deep cloned value.
  11590. * @see _.clone
  11591. * @example
  11592. *
  11593. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11594. *
  11595. * var deep = _.cloneDeep(objects);
  11596. * console.log(deep[0] === objects[0]);
  11597. * // => false
  11598. */
  11599. function cloneDeep(value) {
  11600. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11601. }
  11602. /**
  11603. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11604. *
  11605. * @static
  11606. * @memberOf _
  11607. * @since 4.0.0
  11608. * @category Lang
  11609. * @param {*} value The value to recursively clone.
  11610. * @param {Function} [customizer] The function to customize cloning.
  11611. * @returns {*} Returns the deep cloned value.
  11612. * @see _.cloneWith
  11613. * @example
  11614. *
  11615. * function customizer(value) {
  11616. * if (_.isElement(value)) {
  11617. * return value.cloneNode(true);
  11618. * }
  11619. * }
  11620. *
  11621. * var el = _.cloneDeepWith(document.body, customizer);
  11622. *
  11623. * console.log(el === document.body);
  11624. * // => false
  11625. * console.log(el.nodeName);
  11626. * // => 'BODY'
  11627. * console.log(el.childNodes.length);
  11628. * // => 20
  11629. */
  11630. function cloneDeepWith(value, customizer) {
  11631. customizer = typeof customizer == 'function' ? customizer : undefined;
  11632. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11633. }
  11634. /**
  11635. * Checks if `object` conforms to `source` by invoking the predicate
  11636. * properties of `source` with the corresponding property values of `object`.
  11637. *
  11638. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11639. * partially applied.
  11640. *
  11641. * @static
  11642. * @memberOf _
  11643. * @since 4.14.0
  11644. * @category Lang
  11645. * @param {Object} object The object to inspect.
  11646. * @param {Object} source The object of property predicates to conform to.
  11647. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11648. * @example
  11649. *
  11650. * var object = { 'a': 1, 'b': 2 };
  11651. *
  11652. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11653. * // => true
  11654. *
  11655. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11656. * // => false
  11657. */
  11658. function conformsTo(object, source) {
  11659. return source == null || baseConformsTo(object, source, keys(source));
  11660. }
  11661. /**
  11662. * Performs a
  11663. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11664. * comparison between two values to determine if they are equivalent.
  11665. *
  11666. * @static
  11667. * @memberOf _
  11668. * @since 4.0.0
  11669. * @category Lang
  11670. * @param {*} value The value to compare.
  11671. * @param {*} other The other value to compare.
  11672. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11673. * @example
  11674. *
  11675. * var object = { 'a': 1 };
  11676. * var other = { 'a': 1 };
  11677. *
  11678. * _.eq(object, object);
  11679. * // => true
  11680. *
  11681. * _.eq(object, other);
  11682. * // => false
  11683. *
  11684. * _.eq('a', 'a');
  11685. * // => true
  11686. *
  11687. * _.eq('a', Object('a'));
  11688. * // => false
  11689. *
  11690. * _.eq(NaN, NaN);
  11691. * // => true
  11692. */
  11693. function eq(value, other) {
  11694. return value === other || (value !== value && other !== other);
  11695. }
  11696. /**
  11697. * Checks if `value` is greater than `other`.
  11698. *
  11699. * @static
  11700. * @memberOf _
  11701. * @since 3.9.0
  11702. * @category Lang
  11703. * @param {*} value The value to compare.
  11704. * @param {*} other The other value to compare.
  11705. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11706. * else `false`.
  11707. * @see _.lt
  11708. * @example
  11709. *
  11710. * _.gt(3, 1);
  11711. * // => true
  11712. *
  11713. * _.gt(3, 3);
  11714. * // => false
  11715. *
  11716. * _.gt(1, 3);
  11717. * // => false
  11718. */
  11719. var gt = createRelationalOperation(baseGt);
  11720. /**
  11721. * Checks if `value` is greater than or equal to `other`.
  11722. *
  11723. * @static
  11724. * @memberOf _
  11725. * @since 3.9.0
  11726. * @category Lang
  11727. * @param {*} value The value to compare.
  11728. * @param {*} other The other value to compare.
  11729. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11730. * `other`, else `false`.
  11731. * @see _.lte
  11732. * @example
  11733. *
  11734. * _.gte(3, 1);
  11735. * // => true
  11736. *
  11737. * _.gte(3, 3);
  11738. * // => true
  11739. *
  11740. * _.gte(1, 3);
  11741. * // => false
  11742. */
  11743. var gte = createRelationalOperation(function(value, other) {
  11744. return value >= other;
  11745. });
  11746. /**
  11747. * Checks if `value` is likely an `arguments` object.
  11748. *
  11749. * @static
  11750. * @memberOf _
  11751. * @since 0.1.0
  11752. * @category Lang
  11753. * @param {*} value The value to check.
  11754. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11755. * else `false`.
  11756. * @example
  11757. *
  11758. * _.isArguments(function() { return arguments; }());
  11759. * // => true
  11760. *
  11761. * _.isArguments([1, 2, 3]);
  11762. * // => false
  11763. */
  11764. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11765. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11766. !propertyIsEnumerable.call(value, 'callee');
  11767. };
  11768. /**
  11769. * Checks if `value` is classified as an `Array` object.
  11770. *
  11771. * @static
  11772. * @memberOf _
  11773. * @since 0.1.0
  11774. * @category Lang
  11775. * @param {*} value The value to check.
  11776. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11777. * @example
  11778. *
  11779. * _.isArray([1, 2, 3]);
  11780. * // => true
  11781. *
  11782. * _.isArray(document.body.children);
  11783. * // => false
  11784. *
  11785. * _.isArray('abc');
  11786. * // => false
  11787. *
  11788. * _.isArray(_.noop);
  11789. * // => false
  11790. */
  11791. var isArray = Array.isArray;
  11792. /**
  11793. * Checks if `value` is classified as an `ArrayBuffer` object.
  11794. *
  11795. * @static
  11796. * @memberOf _
  11797. * @since 4.3.0
  11798. * @category Lang
  11799. * @param {*} value The value to check.
  11800. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11801. * @example
  11802. *
  11803. * _.isArrayBuffer(new ArrayBuffer(2));
  11804. * // => true
  11805. *
  11806. * _.isArrayBuffer(new Array(2));
  11807. * // => false
  11808. */
  11809. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11810. /**
  11811. * Checks if `value` is array-like. A value is considered array-like if it's
  11812. * not a function and has a `value.length` that's an integer greater than or
  11813. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11814. *
  11815. * @static
  11816. * @memberOf _
  11817. * @since 4.0.0
  11818. * @category Lang
  11819. * @param {*} value The value to check.
  11820. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11821. * @example
  11822. *
  11823. * _.isArrayLike([1, 2, 3]);
  11824. * // => true
  11825. *
  11826. * _.isArrayLike(document.body.children);
  11827. * // => true
  11828. *
  11829. * _.isArrayLike('abc');
  11830. * // => true
  11831. *
  11832. * _.isArrayLike(_.noop);
  11833. * // => false
  11834. */
  11835. function isArrayLike(value) {
  11836. return value != null && isLength(value.length) && !isFunction(value);
  11837. }
  11838. /**
  11839. * This method is like `_.isArrayLike` except that it also checks if `value`
  11840. * is an object.
  11841. *
  11842. * @static
  11843. * @memberOf _
  11844. * @since 4.0.0
  11845. * @category Lang
  11846. * @param {*} value The value to check.
  11847. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11848. * else `false`.
  11849. * @example
  11850. *
  11851. * _.isArrayLikeObject([1, 2, 3]);
  11852. * // => true
  11853. *
  11854. * _.isArrayLikeObject(document.body.children);
  11855. * // => true
  11856. *
  11857. * _.isArrayLikeObject('abc');
  11858. * // => false
  11859. *
  11860. * _.isArrayLikeObject(_.noop);
  11861. * // => false
  11862. */
  11863. function isArrayLikeObject(value) {
  11864. return isObjectLike(value) && isArrayLike(value);
  11865. }
  11866. /**
  11867. * Checks if `value` is classified as a boolean primitive or object.
  11868. *
  11869. * @static
  11870. * @memberOf _
  11871. * @since 0.1.0
  11872. * @category Lang
  11873. * @param {*} value The value to check.
  11874. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11875. * @example
  11876. *
  11877. * _.isBoolean(false);
  11878. * // => true
  11879. *
  11880. * _.isBoolean(null);
  11881. * // => false
  11882. */
  11883. function isBoolean(value) {
  11884. return value === true || value === false ||
  11885. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11886. }
  11887. /**
  11888. * Checks if `value` is a buffer.
  11889. *
  11890. * @static
  11891. * @memberOf _
  11892. * @since 4.3.0
  11893. * @category Lang
  11894. * @param {*} value The value to check.
  11895. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11896. * @example
  11897. *
  11898. * _.isBuffer(new Buffer(2));
  11899. * // => true
  11900. *
  11901. * _.isBuffer(new Uint8Array(2));
  11902. * // => false
  11903. */
  11904. var isBuffer = nativeIsBuffer || stubFalse;
  11905. /**
  11906. * Checks if `value` is classified as a `Date` object.
  11907. *
  11908. * @static
  11909. * @memberOf _
  11910. * @since 0.1.0
  11911. * @category Lang
  11912. * @param {*} value The value to check.
  11913. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11914. * @example
  11915. *
  11916. * _.isDate(new Date);
  11917. * // => true
  11918. *
  11919. * _.isDate('Mon April 23 2012');
  11920. * // => false
  11921. */
  11922. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11923. /**
  11924. * Checks if `value` is likely a DOM element.
  11925. *
  11926. * @static
  11927. * @memberOf _
  11928. * @since 0.1.0
  11929. * @category Lang
  11930. * @param {*} value The value to check.
  11931. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11932. * @example
  11933. *
  11934. * _.isElement(document.body);
  11935. * // => true
  11936. *
  11937. * _.isElement('<body>');
  11938. * // => false
  11939. */
  11940. function isElement(value) {
  11941. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11942. }
  11943. /**
  11944. * Checks if `value` is an empty object, collection, map, or set.
  11945. *
  11946. * Objects are considered empty if they have no own enumerable string keyed
  11947. * properties.
  11948. *
  11949. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11950. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11951. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11952. *
  11953. * @static
  11954. * @memberOf _
  11955. * @since 0.1.0
  11956. * @category Lang
  11957. * @param {*} value The value to check.
  11958. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11959. * @example
  11960. *
  11961. * _.isEmpty(null);
  11962. * // => true
  11963. *
  11964. * _.isEmpty(true);
  11965. * // => true
  11966. *
  11967. * _.isEmpty(1);
  11968. * // => true
  11969. *
  11970. * _.isEmpty([1, 2, 3]);
  11971. * // => false
  11972. *
  11973. * _.isEmpty({ 'a': 1 });
  11974. * // => false
  11975. */
  11976. function isEmpty(value) {
  11977. if (value == null) {
  11978. return true;
  11979. }
  11980. if (isArrayLike(value) &&
  11981. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11982. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11983. return !value.length;
  11984. }
  11985. var tag = getTag(value);
  11986. if (tag == mapTag || tag == setTag) {
  11987. return !value.size;
  11988. }
  11989. if (isPrototype(value)) {
  11990. return !baseKeys(value).length;
  11991. }
  11992. for (var key in value) {
  11993. if (hasOwnProperty.call(value, key)) {
  11994. return false;
  11995. }
  11996. }
  11997. return true;
  11998. }
  11999. /**
  12000. * Performs a deep comparison between two values to determine if they are
  12001. * equivalent.
  12002. *
  12003. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12004. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12005. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12006. * by their own, not inherited, enumerable properties. Functions and DOM
  12007. * nodes are compared by strict equality, i.e. `===`.
  12008. *
  12009. * @static
  12010. * @memberOf _
  12011. * @since 0.1.0
  12012. * @category Lang
  12013. * @param {*} value The value to compare.
  12014. * @param {*} other The other value to compare.
  12015. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12016. * @example
  12017. *
  12018. * var object = { 'a': 1 };
  12019. * var other = { 'a': 1 };
  12020. *
  12021. * _.isEqual(object, other);
  12022. * // => true
  12023. *
  12024. * object === other;
  12025. * // => false
  12026. */
  12027. function isEqual(value, other) {
  12028. return baseIsEqual(value, other);
  12029. }
  12030. /**
  12031. * This method is like `_.isEqual` except that it accepts `customizer` which
  12032. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12033. * are handled by the method instead. The `customizer` is invoked with up to
  12034. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12035. *
  12036. * @static
  12037. * @memberOf _
  12038. * @since 4.0.0
  12039. * @category Lang
  12040. * @param {*} value The value to compare.
  12041. * @param {*} other The other value to compare.
  12042. * @param {Function} [customizer] The function to customize comparisons.
  12043. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12044. * @example
  12045. *
  12046. * function isGreeting(value) {
  12047. * return /^h(?:i|ello)$/.test(value);
  12048. * }
  12049. *
  12050. * function customizer(objValue, othValue) {
  12051. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12052. * return true;
  12053. * }
  12054. * }
  12055. *
  12056. * var array = ['hello', 'goodbye'];
  12057. * var other = ['hi', 'goodbye'];
  12058. *
  12059. * _.isEqualWith(array, other, customizer);
  12060. * // => true
  12061. */
  12062. function isEqualWith(value, other, customizer) {
  12063. customizer = typeof customizer == 'function' ? customizer : undefined;
  12064. var result = customizer ? customizer(value, other) : undefined;
  12065. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12066. }
  12067. /**
  12068. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12069. * `SyntaxError`, `TypeError`, or `URIError` object.
  12070. *
  12071. * @static
  12072. * @memberOf _
  12073. * @since 3.0.0
  12074. * @category Lang
  12075. * @param {*} value The value to check.
  12076. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12077. * @example
  12078. *
  12079. * _.isError(new Error);
  12080. * // => true
  12081. *
  12082. * _.isError(Error);
  12083. * // => false
  12084. */
  12085. function isError(value) {
  12086. if (!isObjectLike(value)) {
  12087. return false;
  12088. }
  12089. var tag = baseGetTag(value);
  12090. return tag == errorTag || tag == domExcTag ||
  12091. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12092. }
  12093. /**
  12094. * Checks if `value` is a finite primitive number.
  12095. *
  12096. * **Note:** This method is based on
  12097. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12098. *
  12099. * @static
  12100. * @memberOf _
  12101. * @since 0.1.0
  12102. * @category Lang
  12103. * @param {*} value The value to check.
  12104. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12105. * @example
  12106. *
  12107. * _.isFinite(3);
  12108. * // => true
  12109. *
  12110. * _.isFinite(Number.MIN_VALUE);
  12111. * // => true
  12112. *
  12113. * _.isFinite(Infinity);
  12114. * // => false
  12115. *
  12116. * _.isFinite('3');
  12117. * // => false
  12118. */
  12119. function isFinite(value) {
  12120. return typeof value == 'number' && nativeIsFinite(value);
  12121. }
  12122. /**
  12123. * Checks if `value` is classified as a `Function` object.
  12124. *
  12125. * @static
  12126. * @memberOf _
  12127. * @since 0.1.0
  12128. * @category Lang
  12129. * @param {*} value The value to check.
  12130. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12131. * @example
  12132. *
  12133. * _.isFunction(_);
  12134. * // => true
  12135. *
  12136. * _.isFunction(/abc/);
  12137. * // => false
  12138. */
  12139. function isFunction(value) {
  12140. if (!isObject(value)) {
  12141. return false;
  12142. }
  12143. // The use of `Object#toString` avoids issues with the `typeof` operator
  12144. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12145. var tag = baseGetTag(value);
  12146. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12147. }
  12148. /**
  12149. * Checks if `value` is an integer.
  12150. *
  12151. * **Note:** This method is based on
  12152. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12153. *
  12154. * @static
  12155. * @memberOf _
  12156. * @since 4.0.0
  12157. * @category Lang
  12158. * @param {*} value The value to check.
  12159. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12160. * @example
  12161. *
  12162. * _.isInteger(3);
  12163. * // => true
  12164. *
  12165. * _.isInteger(Number.MIN_VALUE);
  12166. * // => false
  12167. *
  12168. * _.isInteger(Infinity);
  12169. * // => false
  12170. *
  12171. * _.isInteger('3');
  12172. * // => false
  12173. */
  12174. function isInteger(value) {
  12175. return typeof value == 'number' && value == toInteger(value);
  12176. }
  12177. /**
  12178. * Checks if `value` is a valid array-like length.
  12179. *
  12180. * **Note:** This method is loosely based on
  12181. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12182. *
  12183. * @static
  12184. * @memberOf _
  12185. * @since 4.0.0
  12186. * @category Lang
  12187. * @param {*} value The value to check.
  12188. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12189. * @example
  12190. *
  12191. * _.isLength(3);
  12192. * // => true
  12193. *
  12194. * _.isLength(Number.MIN_VALUE);
  12195. * // => false
  12196. *
  12197. * _.isLength(Infinity);
  12198. * // => false
  12199. *
  12200. * _.isLength('3');
  12201. * // => false
  12202. */
  12203. function isLength(value) {
  12204. return typeof value == 'number' &&
  12205. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12206. }
  12207. /**
  12208. * Checks if `value` is the
  12209. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12210. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12211. *
  12212. * @static
  12213. * @memberOf _
  12214. * @since 0.1.0
  12215. * @category Lang
  12216. * @param {*} value The value to check.
  12217. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12218. * @example
  12219. *
  12220. * _.isObject({});
  12221. * // => true
  12222. *
  12223. * _.isObject([1, 2, 3]);
  12224. * // => true
  12225. *
  12226. * _.isObject(_.noop);
  12227. * // => true
  12228. *
  12229. * _.isObject(null);
  12230. * // => false
  12231. */
  12232. function isObject(value) {
  12233. var type = typeof value;
  12234. return value != null && (type == 'object' || type == 'function');
  12235. }
  12236. /**
  12237. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12238. * and has a `typeof` result of "object".
  12239. *
  12240. * @static
  12241. * @memberOf _
  12242. * @since 4.0.0
  12243. * @category Lang
  12244. * @param {*} value The value to check.
  12245. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12246. * @example
  12247. *
  12248. * _.isObjectLike({});
  12249. * // => true
  12250. *
  12251. * _.isObjectLike([1, 2, 3]);
  12252. * // => true
  12253. *
  12254. * _.isObjectLike(_.noop);
  12255. * // => false
  12256. *
  12257. * _.isObjectLike(null);
  12258. * // => false
  12259. */
  12260. function isObjectLike(value) {
  12261. return value != null && typeof value == 'object';
  12262. }
  12263. /**
  12264. * Checks if `value` is classified as a `Map` object.
  12265. *
  12266. * @static
  12267. * @memberOf _
  12268. * @since 4.3.0
  12269. * @category Lang
  12270. * @param {*} value The value to check.
  12271. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12272. * @example
  12273. *
  12274. * _.isMap(new Map);
  12275. * // => true
  12276. *
  12277. * _.isMap(new WeakMap);
  12278. * // => false
  12279. */
  12280. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12281. /**
  12282. * Performs a partial deep comparison between `object` and `source` to
  12283. * determine if `object` contains equivalent property values.
  12284. *
  12285. * **Note:** This method is equivalent to `_.matches` when `source` is
  12286. * partially applied.
  12287. *
  12288. * Partial comparisons will match empty array and empty object `source`
  12289. * values against any array or object value, respectively. See `_.isEqual`
  12290. * for a list of supported value comparisons.
  12291. *
  12292. * @static
  12293. * @memberOf _
  12294. * @since 3.0.0
  12295. * @category Lang
  12296. * @param {Object} object The object to inspect.
  12297. * @param {Object} source The object of property values to match.
  12298. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12299. * @example
  12300. *
  12301. * var object = { 'a': 1, 'b': 2 };
  12302. *
  12303. * _.isMatch(object, { 'b': 2 });
  12304. * // => true
  12305. *
  12306. * _.isMatch(object, { 'b': 1 });
  12307. * // => false
  12308. */
  12309. function isMatch(object, source) {
  12310. return object === source || baseIsMatch(object, source, getMatchData(source));
  12311. }
  12312. /**
  12313. * This method is like `_.isMatch` except that it accepts `customizer` which
  12314. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12315. * are handled by the method instead. The `customizer` is invoked with five
  12316. * arguments: (objValue, srcValue, index|key, object, source).
  12317. *
  12318. * @static
  12319. * @memberOf _
  12320. * @since 4.0.0
  12321. * @category Lang
  12322. * @param {Object} object The object to inspect.
  12323. * @param {Object} source The object of property values to match.
  12324. * @param {Function} [customizer] The function to customize comparisons.
  12325. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12326. * @example
  12327. *
  12328. * function isGreeting(value) {
  12329. * return /^h(?:i|ello)$/.test(value);
  12330. * }
  12331. *
  12332. * function customizer(objValue, srcValue) {
  12333. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12334. * return true;
  12335. * }
  12336. * }
  12337. *
  12338. * var object = { 'greeting': 'hello' };
  12339. * var source = { 'greeting': 'hi' };
  12340. *
  12341. * _.isMatchWith(object, source, customizer);
  12342. * // => true
  12343. */
  12344. function isMatchWith(object, source, customizer) {
  12345. customizer = typeof customizer == 'function' ? customizer : undefined;
  12346. return baseIsMatch(object, source, getMatchData(source), customizer);
  12347. }
  12348. /**
  12349. * Checks if `value` is `NaN`.
  12350. *
  12351. * **Note:** This method is based on
  12352. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12353. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12354. * `undefined` and other non-number values.
  12355. *
  12356. * @static
  12357. * @memberOf _
  12358. * @since 0.1.0
  12359. * @category Lang
  12360. * @param {*} value The value to check.
  12361. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12362. * @example
  12363. *
  12364. * _.isNaN(NaN);
  12365. * // => true
  12366. *
  12367. * _.isNaN(new Number(NaN));
  12368. * // => true
  12369. *
  12370. * isNaN(undefined);
  12371. * // => true
  12372. *
  12373. * _.isNaN(undefined);
  12374. * // => false
  12375. */
  12376. function isNaN(value) {
  12377. // An `NaN` primitive is the only value that is not equal to itself.
  12378. // Perform the `toStringTag` check first to avoid errors with some
  12379. // ActiveX objects in IE.
  12380. return isNumber(value) && value != +value;
  12381. }
  12382. /**
  12383. * Checks if `value` is a pristine native function.
  12384. *
  12385. * **Note:** This method can't reliably detect native functions in the presence
  12386. * of the core-js package because core-js circumvents this kind of detection.
  12387. * Despite multiple requests, the core-js maintainer has made it clear: any
  12388. * attempt to fix the detection will be obstructed. As a result, we're left
  12389. * with little choice but to throw an error. Unfortunately, this also affects
  12390. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12391. * which rely on core-js.
  12392. *
  12393. * @static
  12394. * @memberOf _
  12395. * @since 3.0.0
  12396. * @category Lang
  12397. * @param {*} value The value to check.
  12398. * @returns {boolean} Returns `true` if `value` is a native function,
  12399. * else `false`.
  12400. * @example
  12401. *
  12402. * _.isNative(Array.prototype.push);
  12403. * // => true
  12404. *
  12405. * _.isNative(_);
  12406. * // => false
  12407. */
  12408. function isNative(value) {
  12409. if (isMaskable(value)) {
  12410. throw new Error(CORE_ERROR_TEXT);
  12411. }
  12412. return baseIsNative(value);
  12413. }
  12414. /**
  12415. * Checks if `value` is `null`.
  12416. *
  12417. * @static
  12418. * @memberOf _
  12419. * @since 0.1.0
  12420. * @category Lang
  12421. * @param {*} value The value to check.
  12422. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12423. * @example
  12424. *
  12425. * _.isNull(null);
  12426. * // => true
  12427. *
  12428. * _.isNull(void 0);
  12429. * // => false
  12430. */
  12431. function isNull(value) {
  12432. return value === null;
  12433. }
  12434. /**
  12435. * Checks if `value` is `null` or `undefined`.
  12436. *
  12437. * @static
  12438. * @memberOf _
  12439. * @since 4.0.0
  12440. * @category Lang
  12441. * @param {*} value The value to check.
  12442. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12443. * @example
  12444. *
  12445. * _.isNil(null);
  12446. * // => true
  12447. *
  12448. * _.isNil(void 0);
  12449. * // => true
  12450. *
  12451. * _.isNil(NaN);
  12452. * // => false
  12453. */
  12454. function isNil(value) {
  12455. return value == null;
  12456. }
  12457. /**
  12458. * Checks if `value` is classified as a `Number` primitive or object.
  12459. *
  12460. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12461. * classified as numbers, use the `_.isFinite` method.
  12462. *
  12463. * @static
  12464. * @memberOf _
  12465. * @since 0.1.0
  12466. * @category Lang
  12467. * @param {*} value The value to check.
  12468. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12469. * @example
  12470. *
  12471. * _.isNumber(3);
  12472. * // => true
  12473. *
  12474. * _.isNumber(Number.MIN_VALUE);
  12475. * // => true
  12476. *
  12477. * _.isNumber(Infinity);
  12478. * // => true
  12479. *
  12480. * _.isNumber('3');
  12481. * // => false
  12482. */
  12483. function isNumber(value) {
  12484. return typeof value == 'number' ||
  12485. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12486. }
  12487. /**
  12488. * Checks if `value` is a plain object, that is, an object created by the
  12489. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12490. *
  12491. * @static
  12492. * @memberOf _
  12493. * @since 0.8.0
  12494. * @category Lang
  12495. * @param {*} value The value to check.
  12496. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12497. * @example
  12498. *
  12499. * function Foo() {
  12500. * this.a = 1;
  12501. * }
  12502. *
  12503. * _.isPlainObject(new Foo);
  12504. * // => false
  12505. *
  12506. * _.isPlainObject([1, 2, 3]);
  12507. * // => false
  12508. *
  12509. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12510. * // => true
  12511. *
  12512. * _.isPlainObject(Object.create(null));
  12513. * // => true
  12514. */
  12515. function isPlainObject(value) {
  12516. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12517. return false;
  12518. }
  12519. var proto = getPrototype(value);
  12520. if (proto === null) {
  12521. return true;
  12522. }
  12523. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12524. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12525. funcToString.call(Ctor) == objectCtorString;
  12526. }
  12527. /**
  12528. * Checks if `value` is classified as a `RegExp` object.
  12529. *
  12530. * @static
  12531. * @memberOf _
  12532. * @since 0.1.0
  12533. * @category Lang
  12534. * @param {*} value The value to check.
  12535. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12536. * @example
  12537. *
  12538. * _.isRegExp(/abc/);
  12539. * // => true
  12540. *
  12541. * _.isRegExp('/abc/');
  12542. * // => false
  12543. */
  12544. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12545. /**
  12546. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12547. * double precision number which isn't the result of a rounded unsafe integer.
  12548. *
  12549. * **Note:** This method is based on
  12550. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12551. *
  12552. * @static
  12553. * @memberOf _
  12554. * @since 4.0.0
  12555. * @category Lang
  12556. * @param {*} value The value to check.
  12557. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12558. * @example
  12559. *
  12560. * _.isSafeInteger(3);
  12561. * // => true
  12562. *
  12563. * _.isSafeInteger(Number.MIN_VALUE);
  12564. * // => false
  12565. *
  12566. * _.isSafeInteger(Infinity);
  12567. * // => false
  12568. *
  12569. * _.isSafeInteger('3');
  12570. * // => false
  12571. */
  12572. function isSafeInteger(value) {
  12573. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12574. }
  12575. /**
  12576. * Checks if `value` is classified as a `Set` object.
  12577. *
  12578. * @static
  12579. * @memberOf _
  12580. * @since 4.3.0
  12581. * @category Lang
  12582. * @param {*} value The value to check.
  12583. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12584. * @example
  12585. *
  12586. * _.isSet(new Set);
  12587. * // => true
  12588. *
  12589. * _.isSet(new WeakSet);
  12590. * // => false
  12591. */
  12592. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12593. /**
  12594. * Checks if `value` is classified as a `String` primitive or object.
  12595. *
  12596. * @static
  12597. * @since 0.1.0
  12598. * @memberOf _
  12599. * @category Lang
  12600. * @param {*} value The value to check.
  12601. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12602. * @example
  12603. *
  12604. * _.isString('abc');
  12605. * // => true
  12606. *
  12607. * _.isString(1);
  12608. * // => false
  12609. */
  12610. function isString(value) {
  12611. return typeof value == 'string' ||
  12612. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12613. }
  12614. /**
  12615. * Checks if `value` is classified as a `Symbol` primitive or object.
  12616. *
  12617. * @static
  12618. * @memberOf _
  12619. * @since 4.0.0
  12620. * @category Lang
  12621. * @param {*} value The value to check.
  12622. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12623. * @example
  12624. *
  12625. * _.isSymbol(Symbol.iterator);
  12626. * // => true
  12627. *
  12628. * _.isSymbol('abc');
  12629. * // => false
  12630. */
  12631. function isSymbol(value) {
  12632. return typeof value == 'symbol' ||
  12633. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12634. }
  12635. /**
  12636. * Checks if `value` is classified as a typed array.
  12637. *
  12638. * @static
  12639. * @memberOf _
  12640. * @since 3.0.0
  12641. * @category Lang
  12642. * @param {*} value The value to check.
  12643. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12644. * @example
  12645. *
  12646. * _.isTypedArray(new Uint8Array);
  12647. * // => true
  12648. *
  12649. * _.isTypedArray([]);
  12650. * // => false
  12651. */
  12652. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12653. /**
  12654. * Checks if `value` is `undefined`.
  12655. *
  12656. * @static
  12657. * @since 0.1.0
  12658. * @memberOf _
  12659. * @category Lang
  12660. * @param {*} value The value to check.
  12661. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12662. * @example
  12663. *
  12664. * _.isUndefined(void 0);
  12665. * // => true
  12666. *
  12667. * _.isUndefined(null);
  12668. * // => false
  12669. */
  12670. function isUndefined(value) {
  12671. return value === undefined;
  12672. }
  12673. /**
  12674. * Checks if `value` is classified as a `WeakMap` object.
  12675. *
  12676. * @static
  12677. * @memberOf _
  12678. * @since 4.3.0
  12679. * @category Lang
  12680. * @param {*} value The value to check.
  12681. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12682. * @example
  12683. *
  12684. * _.isWeakMap(new WeakMap);
  12685. * // => true
  12686. *
  12687. * _.isWeakMap(new Map);
  12688. * // => false
  12689. */
  12690. function isWeakMap(value) {
  12691. return isObjectLike(value) && getTag(value) == weakMapTag;
  12692. }
  12693. /**
  12694. * Checks if `value` is classified as a `WeakSet` object.
  12695. *
  12696. * @static
  12697. * @memberOf _
  12698. * @since 4.3.0
  12699. * @category Lang
  12700. * @param {*} value The value to check.
  12701. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12702. * @example
  12703. *
  12704. * _.isWeakSet(new WeakSet);
  12705. * // => true
  12706. *
  12707. * _.isWeakSet(new Set);
  12708. * // => false
  12709. */
  12710. function isWeakSet(value) {
  12711. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12712. }
  12713. /**
  12714. * Checks if `value` is less than `other`.
  12715. *
  12716. * @static
  12717. * @memberOf _
  12718. * @since 3.9.0
  12719. * @category Lang
  12720. * @param {*} value The value to compare.
  12721. * @param {*} other The other value to compare.
  12722. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12723. * else `false`.
  12724. * @see _.gt
  12725. * @example
  12726. *
  12727. * _.lt(1, 3);
  12728. * // => true
  12729. *
  12730. * _.lt(3, 3);
  12731. * // => false
  12732. *
  12733. * _.lt(3, 1);
  12734. * // => false
  12735. */
  12736. var lt = createRelationalOperation(baseLt);
  12737. /**
  12738. * Checks if `value` is less than or equal to `other`.
  12739. *
  12740. * @static
  12741. * @memberOf _
  12742. * @since 3.9.0
  12743. * @category Lang
  12744. * @param {*} value The value to compare.
  12745. * @param {*} other The other value to compare.
  12746. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12747. * `other`, else `false`.
  12748. * @see _.gte
  12749. * @example
  12750. *
  12751. * _.lte(1, 3);
  12752. * // => true
  12753. *
  12754. * _.lte(3, 3);
  12755. * // => true
  12756. *
  12757. * _.lte(3, 1);
  12758. * // => false
  12759. */
  12760. var lte = createRelationalOperation(function(value, other) {
  12761. return value <= other;
  12762. });
  12763. /**
  12764. * Converts `value` to an array.
  12765. *
  12766. * @static
  12767. * @since 0.1.0
  12768. * @memberOf _
  12769. * @category Lang
  12770. * @param {*} value The value to convert.
  12771. * @returns {Array} Returns the converted array.
  12772. * @example
  12773. *
  12774. * _.toArray({ 'a': 1, 'b': 2 });
  12775. * // => [1, 2]
  12776. *
  12777. * _.toArray('abc');
  12778. * // => ['a', 'b', 'c']
  12779. *
  12780. * _.toArray(1);
  12781. * // => []
  12782. *
  12783. * _.toArray(null);
  12784. * // => []
  12785. */
  12786. function toArray(value) {
  12787. if (!value) {
  12788. return [];
  12789. }
  12790. if (isArrayLike(value)) {
  12791. return isString(value) ? stringToArray(value) : copyArray(value);
  12792. }
  12793. if (symIterator && value[symIterator]) {
  12794. return iteratorToArray(value[symIterator]());
  12795. }
  12796. var tag = getTag(value),
  12797. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12798. return func(value);
  12799. }
  12800. /**
  12801. * Converts `value` to a finite number.
  12802. *
  12803. * @static
  12804. * @memberOf _
  12805. * @since 4.12.0
  12806. * @category Lang
  12807. * @param {*} value The value to convert.
  12808. * @returns {number} Returns the converted number.
  12809. * @example
  12810. *
  12811. * _.toFinite(3.2);
  12812. * // => 3.2
  12813. *
  12814. * _.toFinite(Number.MIN_VALUE);
  12815. * // => 5e-324
  12816. *
  12817. * _.toFinite(Infinity);
  12818. * // => 1.7976931348623157e+308
  12819. *
  12820. * _.toFinite('3.2');
  12821. * // => 3.2
  12822. */
  12823. function toFinite(value) {
  12824. if (!value) {
  12825. return value === 0 ? value : 0;
  12826. }
  12827. value = toNumber(value);
  12828. if (value === INFINITY || value === -INFINITY) {
  12829. var sign = (value < 0 ? -1 : 1);
  12830. return sign * MAX_INTEGER;
  12831. }
  12832. return value === value ? value : 0;
  12833. }
  12834. /**
  12835. * Converts `value` to an integer.
  12836. *
  12837. * **Note:** This method is loosely based on
  12838. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12839. *
  12840. * @static
  12841. * @memberOf _
  12842. * @since 4.0.0
  12843. * @category Lang
  12844. * @param {*} value The value to convert.
  12845. * @returns {number} Returns the converted integer.
  12846. * @example
  12847. *
  12848. * _.toInteger(3.2);
  12849. * // => 3
  12850. *
  12851. * _.toInteger(Number.MIN_VALUE);
  12852. * // => 0
  12853. *
  12854. * _.toInteger(Infinity);
  12855. * // => 1.7976931348623157e+308
  12856. *
  12857. * _.toInteger('3.2');
  12858. * // => 3
  12859. */
  12860. function toInteger(value) {
  12861. var result = toFinite(value),
  12862. remainder = result % 1;
  12863. return result === result ? (remainder ? result - remainder : result) : 0;
  12864. }
  12865. /**
  12866. * Converts `value` to an integer suitable for use as the length of an
  12867. * array-like object.
  12868. *
  12869. * **Note:** This method is based on
  12870. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12871. *
  12872. * @static
  12873. * @memberOf _
  12874. * @since 4.0.0
  12875. * @category Lang
  12876. * @param {*} value The value to convert.
  12877. * @returns {number} Returns the converted integer.
  12878. * @example
  12879. *
  12880. * _.toLength(3.2);
  12881. * // => 3
  12882. *
  12883. * _.toLength(Number.MIN_VALUE);
  12884. * // => 0
  12885. *
  12886. * _.toLength(Infinity);
  12887. * // => 4294967295
  12888. *
  12889. * _.toLength('3.2');
  12890. * // => 3
  12891. */
  12892. function toLength(value) {
  12893. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12894. }
  12895. /**
  12896. * Converts `value` to a number.
  12897. *
  12898. * @static
  12899. * @memberOf _
  12900. * @since 4.0.0
  12901. * @category Lang
  12902. * @param {*} value The value to process.
  12903. * @returns {number} Returns the number.
  12904. * @example
  12905. *
  12906. * _.toNumber(3.2);
  12907. * // => 3.2
  12908. *
  12909. * _.toNumber(Number.MIN_VALUE);
  12910. * // => 5e-324
  12911. *
  12912. * _.toNumber(Infinity);
  12913. * // => Infinity
  12914. *
  12915. * _.toNumber('3.2');
  12916. * // => 3.2
  12917. */
  12918. function toNumber(value) {
  12919. if (typeof value == 'number') {
  12920. return value;
  12921. }
  12922. if (isSymbol(value)) {
  12923. return NAN;
  12924. }
  12925. if (isObject(value)) {
  12926. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12927. value = isObject(other) ? (other + '') : other;
  12928. }
  12929. if (typeof value != 'string') {
  12930. return value === 0 ? value : +value;
  12931. }
  12932. value = baseTrim(value);
  12933. var isBinary = reIsBinary.test(value);
  12934. return (isBinary || reIsOctal.test(value))
  12935. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12936. : (reIsBadHex.test(value) ? NAN : +value);
  12937. }
  12938. /**
  12939. * Converts `value` to a plain object flattening inherited enumerable string
  12940. * keyed properties of `value` to own properties of the plain object.
  12941. *
  12942. * @static
  12943. * @memberOf _
  12944. * @since 3.0.0
  12945. * @category Lang
  12946. * @param {*} value The value to convert.
  12947. * @returns {Object} Returns the converted plain object.
  12948. * @example
  12949. *
  12950. * function Foo() {
  12951. * this.b = 2;
  12952. * }
  12953. *
  12954. * Foo.prototype.c = 3;
  12955. *
  12956. * _.assign({ 'a': 1 }, new Foo);
  12957. * // => { 'a': 1, 'b': 2 }
  12958. *
  12959. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12960. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12961. */
  12962. function toPlainObject(value) {
  12963. return copyObject(value, keysIn(value));
  12964. }
  12965. /**
  12966. * Converts `value` to a safe integer. A safe integer can be compared and
  12967. * represented correctly.
  12968. *
  12969. * @static
  12970. * @memberOf _
  12971. * @since 4.0.0
  12972. * @category Lang
  12973. * @param {*} value The value to convert.
  12974. * @returns {number} Returns the converted integer.
  12975. * @example
  12976. *
  12977. * _.toSafeInteger(3.2);
  12978. * // => 3
  12979. *
  12980. * _.toSafeInteger(Number.MIN_VALUE);
  12981. * // => 0
  12982. *
  12983. * _.toSafeInteger(Infinity);
  12984. * // => 9007199254740991
  12985. *
  12986. * _.toSafeInteger('3.2');
  12987. * // => 3
  12988. */
  12989. function toSafeInteger(value) {
  12990. return value
  12991. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12992. : (value === 0 ? value : 0);
  12993. }
  12994. /**
  12995. * Converts `value` to a string. An empty string is returned for `null`
  12996. * and `undefined` values. The sign of `-0` is preserved.
  12997. *
  12998. * @static
  12999. * @memberOf _
  13000. * @since 4.0.0
  13001. * @category Lang
  13002. * @param {*} value The value to convert.
  13003. * @returns {string} Returns the converted string.
  13004. * @example
  13005. *
  13006. * _.toString(null);
  13007. * // => ''
  13008. *
  13009. * _.toString(-0);
  13010. * // => '-0'
  13011. *
  13012. * _.toString([1, 2, 3]);
  13013. * // => '1,2,3'
  13014. */
  13015. function toString(value) {
  13016. return value == null ? '' : baseToString(value);
  13017. }
  13018. /*------------------------------------------------------------------------*/
  13019. /**
  13020. * Assigns own enumerable string keyed properties of source objects to the
  13021. * destination object. Source objects are applied from left to right.
  13022. * Subsequent sources overwrite property assignments of previous sources.
  13023. *
  13024. * **Note:** This method mutates `object` and is loosely based on
  13025. * [`Object.assign`](https://mdn.io/Object/assign).
  13026. *
  13027. * @static
  13028. * @memberOf _
  13029. * @since 0.10.0
  13030. * @category Object
  13031. * @param {Object} object The destination object.
  13032. * @param {...Object} [sources] The source objects.
  13033. * @returns {Object} Returns `object`.
  13034. * @see _.assignIn
  13035. * @example
  13036. *
  13037. * function Foo() {
  13038. * this.a = 1;
  13039. * }
  13040. *
  13041. * function Bar() {
  13042. * this.c = 3;
  13043. * }
  13044. *
  13045. * Foo.prototype.b = 2;
  13046. * Bar.prototype.d = 4;
  13047. *
  13048. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13049. * // => { 'a': 1, 'c': 3 }
  13050. */
  13051. var assign = createAssigner(function(object, source) {
  13052. if (isPrototype(source) || isArrayLike(source)) {
  13053. copyObject(source, keys(source), object);
  13054. return;
  13055. }
  13056. for (var key in source) {
  13057. if (hasOwnProperty.call(source, key)) {
  13058. assignValue(object, key, source[key]);
  13059. }
  13060. }
  13061. });
  13062. /**
  13063. * This method is like `_.assign` except that it iterates over own and
  13064. * inherited source properties.
  13065. *
  13066. * **Note:** This method mutates `object`.
  13067. *
  13068. * @static
  13069. * @memberOf _
  13070. * @since 4.0.0
  13071. * @alias extend
  13072. * @category Object
  13073. * @param {Object} object The destination object.
  13074. * @param {...Object} [sources] The source objects.
  13075. * @returns {Object} Returns `object`.
  13076. * @see _.assign
  13077. * @example
  13078. *
  13079. * function Foo() {
  13080. * this.a = 1;
  13081. * }
  13082. *
  13083. * function Bar() {
  13084. * this.c = 3;
  13085. * }
  13086. *
  13087. * Foo.prototype.b = 2;
  13088. * Bar.prototype.d = 4;
  13089. *
  13090. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13091. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13092. */
  13093. var assignIn = createAssigner(function(object, source) {
  13094. copyObject(source, keysIn(source), object);
  13095. });
  13096. /**
  13097. * This method is like `_.assignIn` except that it accepts `customizer`
  13098. * which is invoked to produce the assigned values. If `customizer` returns
  13099. * `undefined`, assignment is handled by the method instead. The `customizer`
  13100. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13101. *
  13102. * **Note:** This method mutates `object`.
  13103. *
  13104. * @static
  13105. * @memberOf _
  13106. * @since 4.0.0
  13107. * @alias extendWith
  13108. * @category Object
  13109. * @param {Object} object The destination object.
  13110. * @param {...Object} sources The source objects.
  13111. * @param {Function} [customizer] The function to customize assigned values.
  13112. * @returns {Object} Returns `object`.
  13113. * @see _.assignWith
  13114. * @example
  13115. *
  13116. * function customizer(objValue, srcValue) {
  13117. * return _.isUndefined(objValue) ? srcValue : objValue;
  13118. * }
  13119. *
  13120. * var defaults = _.partialRight(_.assignInWith, customizer);
  13121. *
  13122. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13123. * // => { 'a': 1, 'b': 2 }
  13124. */
  13125. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13126. copyObject(source, keysIn(source), object, customizer);
  13127. });
  13128. /**
  13129. * This method is like `_.assign` except that it accepts `customizer`
  13130. * which is invoked to produce the assigned values. If `customizer` returns
  13131. * `undefined`, assignment is handled by the method instead. The `customizer`
  13132. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13133. *
  13134. * **Note:** This method mutates `object`.
  13135. *
  13136. * @static
  13137. * @memberOf _
  13138. * @since 4.0.0
  13139. * @category Object
  13140. * @param {Object} object The destination object.
  13141. * @param {...Object} sources The source objects.
  13142. * @param {Function} [customizer] The function to customize assigned values.
  13143. * @returns {Object} Returns `object`.
  13144. * @see _.assignInWith
  13145. * @example
  13146. *
  13147. * function customizer(objValue, srcValue) {
  13148. * return _.isUndefined(objValue) ? srcValue : objValue;
  13149. * }
  13150. *
  13151. * var defaults = _.partialRight(_.assignWith, customizer);
  13152. *
  13153. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13154. * // => { 'a': 1, 'b': 2 }
  13155. */
  13156. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13157. copyObject(source, keys(source), object, customizer);
  13158. });
  13159. /**
  13160. * Creates an array of values corresponding to `paths` of `object`.
  13161. *
  13162. * @static
  13163. * @memberOf _
  13164. * @since 1.0.0
  13165. * @category Object
  13166. * @param {Object} object The object to iterate over.
  13167. * @param {...(string|string[])} [paths] The property paths to pick.
  13168. * @returns {Array} Returns the picked values.
  13169. * @example
  13170. *
  13171. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13172. *
  13173. * _.at(object, ['a[0].b.c', 'a[1]']);
  13174. * // => [3, 4]
  13175. */
  13176. var at = flatRest(baseAt);
  13177. /**
  13178. * Creates an object that inherits from the `prototype` object. If a
  13179. * `properties` object is given, its own enumerable string keyed properties
  13180. * are assigned to the created object.
  13181. *
  13182. * @static
  13183. * @memberOf _
  13184. * @since 2.3.0
  13185. * @category Object
  13186. * @param {Object} prototype The object to inherit from.
  13187. * @param {Object} [properties] The properties to assign to the object.
  13188. * @returns {Object} Returns the new object.
  13189. * @example
  13190. *
  13191. * function Shape() {
  13192. * this.x = 0;
  13193. * this.y = 0;
  13194. * }
  13195. *
  13196. * function Circle() {
  13197. * Shape.call(this);
  13198. * }
  13199. *
  13200. * Circle.prototype = _.create(Shape.prototype, {
  13201. * 'constructor': Circle
  13202. * });
  13203. *
  13204. * var circle = new Circle;
  13205. * circle instanceof Circle;
  13206. * // => true
  13207. *
  13208. * circle instanceof Shape;
  13209. * // => true
  13210. */
  13211. function create(prototype, properties) {
  13212. var result = baseCreate(prototype);
  13213. return properties == null ? result : baseAssign(result, properties);
  13214. }
  13215. /**
  13216. * Assigns own and inherited enumerable string keyed properties of source
  13217. * objects to the destination object for all destination properties that
  13218. * resolve to `undefined`. Source objects are applied from left to right.
  13219. * Once a property is set, additional values of the same property are ignored.
  13220. *
  13221. * **Note:** This method mutates `object`.
  13222. *
  13223. * @static
  13224. * @since 0.1.0
  13225. * @memberOf _
  13226. * @category Object
  13227. * @param {Object} object The destination object.
  13228. * @param {...Object} [sources] The source objects.
  13229. * @returns {Object} Returns `object`.
  13230. * @see _.defaultsDeep
  13231. * @example
  13232. *
  13233. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13234. * // => { 'a': 1, 'b': 2 }
  13235. */
  13236. var defaults = baseRest(function(object, sources) {
  13237. object = Object(object);
  13238. var index = -1;
  13239. var length = sources.length;
  13240. var guard = length > 2 ? sources[2] : undefined;
  13241. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13242. length = 1;
  13243. }
  13244. while (++index < length) {
  13245. var source = sources[index];
  13246. var props = keysIn(source);
  13247. var propsIndex = -1;
  13248. var propsLength = props.length;
  13249. while (++propsIndex < propsLength) {
  13250. var key = props[propsIndex];
  13251. var value = object[key];
  13252. if (value === undefined ||
  13253. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13254. object[key] = source[key];
  13255. }
  13256. }
  13257. }
  13258. return object;
  13259. });
  13260. /**
  13261. * This method is like `_.defaults` except that it recursively assigns
  13262. * default properties.
  13263. *
  13264. * **Note:** This method mutates `object`.
  13265. *
  13266. * @static
  13267. * @memberOf _
  13268. * @since 3.10.0
  13269. * @category Object
  13270. * @param {Object} object The destination object.
  13271. * @param {...Object} [sources] The source objects.
  13272. * @returns {Object} Returns `object`.
  13273. * @see _.defaults
  13274. * @example
  13275. *
  13276. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13277. * // => { 'a': { 'b': 2, 'c': 3 } }
  13278. */
  13279. var defaultsDeep = baseRest(function(args) {
  13280. args.push(undefined, customDefaultsMerge);
  13281. return apply(mergeWith, undefined, args);
  13282. });
  13283. /**
  13284. * This method is like `_.find` except that it returns the key of the first
  13285. * element `predicate` returns truthy for instead of the element itself.
  13286. *
  13287. * @static
  13288. * @memberOf _
  13289. * @since 1.1.0
  13290. * @category Object
  13291. * @param {Object} object The object to inspect.
  13292. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13293. * @returns {string|undefined} Returns the key of the matched element,
  13294. * else `undefined`.
  13295. * @example
  13296. *
  13297. * var users = {
  13298. * 'barney': { 'age': 36, 'active': true },
  13299. * 'fred': { 'age': 40, 'active': false },
  13300. * 'pebbles': { 'age': 1, 'active': true }
  13301. * };
  13302. *
  13303. * _.findKey(users, function(o) { return o.age < 40; });
  13304. * // => 'barney' (iteration order is not guaranteed)
  13305. *
  13306. * // The `_.matches` iteratee shorthand.
  13307. * _.findKey(users, { 'age': 1, 'active': true });
  13308. * // => 'pebbles'
  13309. *
  13310. * // The `_.matchesProperty` iteratee shorthand.
  13311. * _.findKey(users, ['active', false]);
  13312. * // => 'fred'
  13313. *
  13314. * // The `_.property` iteratee shorthand.
  13315. * _.findKey(users, 'active');
  13316. * // => 'barney'
  13317. */
  13318. function findKey(object, predicate) {
  13319. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13320. }
  13321. /**
  13322. * This method is like `_.findKey` except that it iterates over elements of
  13323. * a collection in the opposite order.
  13324. *
  13325. * @static
  13326. * @memberOf _
  13327. * @since 2.0.0
  13328. * @category Object
  13329. * @param {Object} object The object to inspect.
  13330. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13331. * @returns {string|undefined} Returns the key of the matched element,
  13332. * else `undefined`.
  13333. * @example
  13334. *
  13335. * var users = {
  13336. * 'barney': { 'age': 36, 'active': true },
  13337. * 'fred': { 'age': 40, 'active': false },
  13338. * 'pebbles': { 'age': 1, 'active': true }
  13339. * };
  13340. *
  13341. * _.findLastKey(users, function(o) { return o.age < 40; });
  13342. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13343. *
  13344. * // The `_.matches` iteratee shorthand.
  13345. * _.findLastKey(users, { 'age': 36, 'active': true });
  13346. * // => 'barney'
  13347. *
  13348. * // The `_.matchesProperty` iteratee shorthand.
  13349. * _.findLastKey(users, ['active', false]);
  13350. * // => 'fred'
  13351. *
  13352. * // The `_.property` iteratee shorthand.
  13353. * _.findLastKey(users, 'active');
  13354. * // => 'pebbles'
  13355. */
  13356. function findLastKey(object, predicate) {
  13357. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13358. }
  13359. /**
  13360. * Iterates over own and inherited enumerable string keyed properties of an
  13361. * object and invokes `iteratee` for each property. The iteratee is invoked
  13362. * with three arguments: (value, key, object). Iteratee functions may exit
  13363. * iteration early by explicitly returning `false`.
  13364. *
  13365. * @static
  13366. * @memberOf _
  13367. * @since 0.3.0
  13368. * @category Object
  13369. * @param {Object} object The object to iterate over.
  13370. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13371. * @returns {Object} Returns `object`.
  13372. * @see _.forInRight
  13373. * @example
  13374. *
  13375. * function Foo() {
  13376. * this.a = 1;
  13377. * this.b = 2;
  13378. * }
  13379. *
  13380. * Foo.prototype.c = 3;
  13381. *
  13382. * _.forIn(new Foo, function(value, key) {
  13383. * console.log(key);
  13384. * });
  13385. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13386. */
  13387. function forIn(object, iteratee) {
  13388. return object == null
  13389. ? object
  13390. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13391. }
  13392. /**
  13393. * This method is like `_.forIn` except that it iterates over properties of
  13394. * `object` in the opposite order.
  13395. *
  13396. * @static
  13397. * @memberOf _
  13398. * @since 2.0.0
  13399. * @category Object
  13400. * @param {Object} object The object to iterate over.
  13401. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13402. * @returns {Object} Returns `object`.
  13403. * @see _.forIn
  13404. * @example
  13405. *
  13406. * function Foo() {
  13407. * this.a = 1;
  13408. * this.b = 2;
  13409. * }
  13410. *
  13411. * Foo.prototype.c = 3;
  13412. *
  13413. * _.forInRight(new Foo, function(value, key) {
  13414. * console.log(key);
  13415. * });
  13416. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13417. */
  13418. function forInRight(object, iteratee) {
  13419. return object == null
  13420. ? object
  13421. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13422. }
  13423. /**
  13424. * Iterates over own enumerable string keyed properties of an object and
  13425. * invokes `iteratee` for each property. The iteratee is invoked with three
  13426. * arguments: (value, key, object). Iteratee functions may exit iteration
  13427. * early by explicitly returning `false`.
  13428. *
  13429. * @static
  13430. * @memberOf _
  13431. * @since 0.3.0
  13432. * @category Object
  13433. * @param {Object} object The object to iterate over.
  13434. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13435. * @returns {Object} Returns `object`.
  13436. * @see _.forOwnRight
  13437. * @example
  13438. *
  13439. * function Foo() {
  13440. * this.a = 1;
  13441. * this.b = 2;
  13442. * }
  13443. *
  13444. * Foo.prototype.c = 3;
  13445. *
  13446. * _.forOwn(new Foo, function(value, key) {
  13447. * console.log(key);
  13448. * });
  13449. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13450. */
  13451. function forOwn(object, iteratee) {
  13452. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13453. }
  13454. /**
  13455. * This method is like `_.forOwn` except that it iterates over properties of
  13456. * `object` in the opposite order.
  13457. *
  13458. * @static
  13459. * @memberOf _
  13460. * @since 2.0.0
  13461. * @category Object
  13462. * @param {Object} object The object to iterate over.
  13463. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13464. * @returns {Object} Returns `object`.
  13465. * @see _.forOwn
  13466. * @example
  13467. *
  13468. * function Foo() {
  13469. * this.a = 1;
  13470. * this.b = 2;
  13471. * }
  13472. *
  13473. * Foo.prototype.c = 3;
  13474. *
  13475. * _.forOwnRight(new Foo, function(value, key) {
  13476. * console.log(key);
  13477. * });
  13478. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13479. */
  13480. function forOwnRight(object, iteratee) {
  13481. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13482. }
  13483. /**
  13484. * Creates an array of function property names from own enumerable properties
  13485. * of `object`.
  13486. *
  13487. * @static
  13488. * @since 0.1.0
  13489. * @memberOf _
  13490. * @category Object
  13491. * @param {Object} object The object to inspect.
  13492. * @returns {Array} Returns the function names.
  13493. * @see _.functionsIn
  13494. * @example
  13495. *
  13496. * function Foo() {
  13497. * this.a = _.constant('a');
  13498. * this.b = _.constant('b');
  13499. * }
  13500. *
  13501. * Foo.prototype.c = _.constant('c');
  13502. *
  13503. * _.functions(new Foo);
  13504. * // => ['a', 'b']
  13505. */
  13506. function functions(object) {
  13507. return object == null ? [] : baseFunctions(object, keys(object));
  13508. }
  13509. /**
  13510. * Creates an array of function property names from own and inherited
  13511. * enumerable properties of `object`.
  13512. *
  13513. * @static
  13514. * @memberOf _
  13515. * @since 4.0.0
  13516. * @category Object
  13517. * @param {Object} object The object to inspect.
  13518. * @returns {Array} Returns the function names.
  13519. * @see _.functions
  13520. * @example
  13521. *
  13522. * function Foo() {
  13523. * this.a = _.constant('a');
  13524. * this.b = _.constant('b');
  13525. * }
  13526. *
  13527. * Foo.prototype.c = _.constant('c');
  13528. *
  13529. * _.functionsIn(new Foo);
  13530. * // => ['a', 'b', 'c']
  13531. */
  13532. function functionsIn(object) {
  13533. return object == null ? [] : baseFunctions(object, keysIn(object));
  13534. }
  13535. /**
  13536. * Gets the value at `path` of `object`. If the resolved value is
  13537. * `undefined`, the `defaultValue` is returned in its place.
  13538. *
  13539. * @static
  13540. * @memberOf _
  13541. * @since 3.7.0
  13542. * @category Object
  13543. * @param {Object} object The object to query.
  13544. * @param {Array|string} path The path of the property to get.
  13545. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13546. * @returns {*} Returns the resolved value.
  13547. * @example
  13548. *
  13549. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13550. *
  13551. * _.get(object, 'a[0].b.c');
  13552. * // => 3
  13553. *
  13554. * _.get(object, ['a', '0', 'b', 'c']);
  13555. * // => 3
  13556. *
  13557. * _.get(object, 'a.b.c', 'default');
  13558. * // => 'default'
  13559. */
  13560. function get(object, path, defaultValue) {
  13561. var result = object == null ? undefined : baseGet(object, path);
  13562. return result === undefined ? defaultValue : result;
  13563. }
  13564. /**
  13565. * Checks if `path` is a direct property of `object`.
  13566. *
  13567. * @static
  13568. * @since 0.1.0
  13569. * @memberOf _
  13570. * @category Object
  13571. * @param {Object} object The object to query.
  13572. * @param {Array|string} path The path to check.
  13573. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13574. * @example
  13575. *
  13576. * var object = { 'a': { 'b': 2 } };
  13577. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13578. *
  13579. * _.has(object, 'a');
  13580. * // => true
  13581. *
  13582. * _.has(object, 'a.b');
  13583. * // => true
  13584. *
  13585. * _.has(object, ['a', 'b']);
  13586. * // => true
  13587. *
  13588. * _.has(other, 'a');
  13589. * // => false
  13590. */
  13591. function has(object, path) {
  13592. return object != null && hasPath(object, path, baseHas);
  13593. }
  13594. /**
  13595. * Checks if `path` is a direct or inherited property of `object`.
  13596. *
  13597. * @static
  13598. * @memberOf _
  13599. * @since 4.0.0
  13600. * @category Object
  13601. * @param {Object} object The object to query.
  13602. * @param {Array|string} path The path to check.
  13603. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13604. * @example
  13605. *
  13606. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13607. *
  13608. * _.hasIn(object, 'a');
  13609. * // => true
  13610. *
  13611. * _.hasIn(object, 'a.b');
  13612. * // => true
  13613. *
  13614. * _.hasIn(object, ['a', 'b']);
  13615. * // => true
  13616. *
  13617. * _.hasIn(object, 'b');
  13618. * // => false
  13619. */
  13620. function hasIn(object, path) {
  13621. return object != null && hasPath(object, path, baseHasIn);
  13622. }
  13623. /**
  13624. * Creates an object composed of the inverted keys and values of `object`.
  13625. * If `object` contains duplicate values, subsequent values overwrite
  13626. * property assignments of previous values.
  13627. *
  13628. * @static
  13629. * @memberOf _
  13630. * @since 0.7.0
  13631. * @category Object
  13632. * @param {Object} object The object to invert.
  13633. * @returns {Object} Returns the new inverted object.
  13634. * @example
  13635. *
  13636. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13637. *
  13638. * _.invert(object);
  13639. * // => { '1': 'c', '2': 'b' }
  13640. */
  13641. var invert = createInverter(function(result, value, key) {
  13642. if (value != null &&
  13643. typeof value.toString != 'function') {
  13644. value = nativeObjectToString.call(value);
  13645. }
  13646. result[value] = key;
  13647. }, constant(identity));
  13648. /**
  13649. * This method is like `_.invert` except that the inverted object is generated
  13650. * from the results of running each element of `object` thru `iteratee`. The
  13651. * corresponding inverted value of each inverted key is an array of keys
  13652. * responsible for generating the inverted value. The iteratee is invoked
  13653. * with one argument: (value).
  13654. *
  13655. * @static
  13656. * @memberOf _
  13657. * @since 4.1.0
  13658. * @category Object
  13659. * @param {Object} object The object to invert.
  13660. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13661. * @returns {Object} Returns the new inverted object.
  13662. * @example
  13663. *
  13664. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13665. *
  13666. * _.invertBy(object);
  13667. * // => { '1': ['a', 'c'], '2': ['b'] }
  13668. *
  13669. * _.invertBy(object, function(value) {
  13670. * return 'group' + value;
  13671. * });
  13672. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13673. */
  13674. var invertBy = createInverter(function(result, value, key) {
  13675. if (value != null &&
  13676. typeof value.toString != 'function') {
  13677. value = nativeObjectToString.call(value);
  13678. }
  13679. if (hasOwnProperty.call(result, value)) {
  13680. result[value].push(key);
  13681. } else {
  13682. result[value] = [key];
  13683. }
  13684. }, getIteratee);
  13685. /**
  13686. * Invokes the method at `path` of `object`.
  13687. *
  13688. * @static
  13689. * @memberOf _
  13690. * @since 4.0.0
  13691. * @category Object
  13692. * @param {Object} object The object to query.
  13693. * @param {Array|string} path The path of the method to invoke.
  13694. * @param {...*} [args] The arguments to invoke the method with.
  13695. * @returns {*} Returns the result of the invoked method.
  13696. * @example
  13697. *
  13698. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13699. *
  13700. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13701. * // => [2, 3]
  13702. */
  13703. var invoke = baseRest(baseInvoke);
  13704. /**
  13705. * Creates an array of the own enumerable property names of `object`.
  13706. *
  13707. * **Note:** Non-object values are coerced to objects. See the
  13708. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13709. * for more details.
  13710. *
  13711. * @static
  13712. * @since 0.1.0
  13713. * @memberOf _
  13714. * @category Object
  13715. * @param {Object} object The object to query.
  13716. * @returns {Array} Returns the array of property names.
  13717. * @example
  13718. *
  13719. * function Foo() {
  13720. * this.a = 1;
  13721. * this.b = 2;
  13722. * }
  13723. *
  13724. * Foo.prototype.c = 3;
  13725. *
  13726. * _.keys(new Foo);
  13727. * // => ['a', 'b'] (iteration order is not guaranteed)
  13728. *
  13729. * _.keys('hi');
  13730. * // => ['0', '1']
  13731. */
  13732. function keys(object) {
  13733. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13734. }
  13735. /**
  13736. * Creates an array of the own and inherited enumerable property names of `object`.
  13737. *
  13738. * **Note:** Non-object values are coerced to objects.
  13739. *
  13740. * @static
  13741. * @memberOf _
  13742. * @since 3.0.0
  13743. * @category Object
  13744. * @param {Object} object The object to query.
  13745. * @returns {Array} Returns the array of property names.
  13746. * @example
  13747. *
  13748. * function Foo() {
  13749. * this.a = 1;
  13750. * this.b = 2;
  13751. * }
  13752. *
  13753. * Foo.prototype.c = 3;
  13754. *
  13755. * _.keysIn(new Foo);
  13756. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13757. */
  13758. function keysIn(object) {
  13759. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13760. }
  13761. /**
  13762. * The opposite of `_.mapValues`; this method creates an object with the
  13763. * same values as `object` and keys generated by running each own enumerable
  13764. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13765. * with three arguments: (value, key, object).
  13766. *
  13767. * @static
  13768. * @memberOf _
  13769. * @since 3.8.0
  13770. * @category Object
  13771. * @param {Object} object The object to iterate over.
  13772. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13773. * @returns {Object} Returns the new mapped object.
  13774. * @see _.mapValues
  13775. * @example
  13776. *
  13777. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13778. * return key + value;
  13779. * });
  13780. * // => { 'a1': 1, 'b2': 2 }
  13781. */
  13782. function mapKeys(object, iteratee) {
  13783. var result = {};
  13784. iteratee = getIteratee(iteratee, 3);
  13785. baseForOwn(object, function(value, key, object) {
  13786. baseAssignValue(result, iteratee(value, key, object), value);
  13787. });
  13788. return result;
  13789. }
  13790. /**
  13791. * Creates an object with the same keys as `object` and values generated
  13792. * by running each own enumerable string keyed property of `object` thru
  13793. * `iteratee`. The iteratee is invoked with three arguments:
  13794. * (value, key, object).
  13795. *
  13796. * @static
  13797. * @memberOf _
  13798. * @since 2.4.0
  13799. * @category Object
  13800. * @param {Object} object The object to iterate over.
  13801. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13802. * @returns {Object} Returns the new mapped object.
  13803. * @see _.mapKeys
  13804. * @example
  13805. *
  13806. * var users = {
  13807. * 'fred': { 'user': 'fred', 'age': 40 },
  13808. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13809. * };
  13810. *
  13811. * _.mapValues(users, function(o) { return o.age; });
  13812. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13813. *
  13814. * // The `_.property` iteratee shorthand.
  13815. * _.mapValues(users, 'age');
  13816. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13817. */
  13818. function mapValues(object, iteratee) {
  13819. var result = {};
  13820. iteratee = getIteratee(iteratee, 3);
  13821. baseForOwn(object, function(value, key, object) {
  13822. baseAssignValue(result, key, iteratee(value, key, object));
  13823. });
  13824. return result;
  13825. }
  13826. /**
  13827. * This method is like `_.assign` except that it recursively merges own and
  13828. * inherited enumerable string keyed properties of source objects into the
  13829. * destination object. Source properties that resolve to `undefined` are
  13830. * skipped if a destination value exists. Array and plain object properties
  13831. * are merged recursively. Other objects and value types are overridden by
  13832. * assignment. Source objects are applied from left to right. Subsequent
  13833. * sources overwrite property assignments of previous sources.
  13834. *
  13835. * **Note:** This method mutates `object`.
  13836. *
  13837. * @static
  13838. * @memberOf _
  13839. * @since 0.5.0
  13840. * @category Object
  13841. * @param {Object} object The destination object.
  13842. * @param {...Object} [sources] The source objects.
  13843. * @returns {Object} Returns `object`.
  13844. * @example
  13845. *
  13846. * var object = {
  13847. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13848. * };
  13849. *
  13850. * var other = {
  13851. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13852. * };
  13853. *
  13854. * _.merge(object, other);
  13855. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13856. */
  13857. var merge = createAssigner(function(object, source, srcIndex) {
  13858. baseMerge(object, source, srcIndex);
  13859. });
  13860. /**
  13861. * This method is like `_.merge` except that it accepts `customizer` which
  13862. * is invoked to produce the merged values of the destination and source
  13863. * properties. If `customizer` returns `undefined`, merging is handled by the
  13864. * method instead. The `customizer` is invoked with six arguments:
  13865. * (objValue, srcValue, key, object, source, stack).
  13866. *
  13867. * **Note:** This method mutates `object`.
  13868. *
  13869. * @static
  13870. * @memberOf _
  13871. * @since 4.0.0
  13872. * @category Object
  13873. * @param {Object} object The destination object.
  13874. * @param {...Object} sources The source objects.
  13875. * @param {Function} customizer The function to customize assigned values.
  13876. * @returns {Object} Returns `object`.
  13877. * @example
  13878. *
  13879. * function customizer(objValue, srcValue) {
  13880. * if (_.isArray(objValue)) {
  13881. * return objValue.concat(srcValue);
  13882. * }
  13883. * }
  13884. *
  13885. * var object = { 'a': [1], 'b': [2] };
  13886. * var other = { 'a': [3], 'b': [4] };
  13887. *
  13888. * _.mergeWith(object, other, customizer);
  13889. * // => { 'a': [1, 3], 'b': [2, 4] }
  13890. */
  13891. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13892. baseMerge(object, source, srcIndex, customizer);
  13893. });
  13894. /**
  13895. * The opposite of `_.pick`; this method creates an object composed of the
  13896. * own and inherited enumerable property paths of `object` that are not omitted.
  13897. *
  13898. * **Note:** This method is considerably slower than `_.pick`.
  13899. *
  13900. * @static
  13901. * @since 0.1.0
  13902. * @memberOf _
  13903. * @category Object
  13904. * @param {Object} object The source object.
  13905. * @param {...(string|string[])} [paths] The property paths to omit.
  13906. * @returns {Object} Returns the new object.
  13907. * @example
  13908. *
  13909. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13910. *
  13911. * _.omit(object, ['a', 'c']);
  13912. * // => { 'b': '2' }
  13913. */
  13914. var omit = flatRest(function(object, paths) {
  13915. var result = {};
  13916. if (object == null) {
  13917. return result;
  13918. }
  13919. var isDeep = false;
  13920. paths = arrayMap(paths, function(path) {
  13921. path = castPath(path, object);
  13922. isDeep || (isDeep = path.length > 1);
  13923. return path;
  13924. });
  13925. copyObject(object, getAllKeysIn(object), result);
  13926. if (isDeep) {
  13927. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13928. }
  13929. var length = paths.length;
  13930. while (length--) {
  13931. baseUnset(result, paths[length]);
  13932. }
  13933. return result;
  13934. });
  13935. /**
  13936. * The opposite of `_.pickBy`; this method creates an object composed of
  13937. * the own and inherited enumerable string keyed properties of `object` that
  13938. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13939. * arguments: (value, key).
  13940. *
  13941. * @static
  13942. * @memberOf _
  13943. * @since 4.0.0
  13944. * @category Object
  13945. * @param {Object} object The source object.
  13946. * @param {Function} [predicate=_.identity] The function invoked per property.
  13947. * @returns {Object} Returns the new object.
  13948. * @example
  13949. *
  13950. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13951. *
  13952. * _.omitBy(object, _.isNumber);
  13953. * // => { 'b': '2' }
  13954. */
  13955. function omitBy(object, predicate) {
  13956. return pickBy(object, negate(getIteratee(predicate)));
  13957. }
  13958. /**
  13959. * Creates an object composed of the picked `object` properties.
  13960. *
  13961. * @static
  13962. * @since 0.1.0
  13963. * @memberOf _
  13964. * @category Object
  13965. * @param {Object} object The source object.
  13966. * @param {...(string|string[])} [paths] The property paths to pick.
  13967. * @returns {Object} Returns the new object.
  13968. * @example
  13969. *
  13970. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13971. *
  13972. * _.pick(object, ['a', 'c']);
  13973. * // => { 'a': 1, 'c': 3 }
  13974. */
  13975. var pick = flatRest(function(object, paths) {
  13976. return object == null ? {} : basePick(object, paths);
  13977. });
  13978. /**
  13979. * Creates an object composed of the `object` properties `predicate` returns
  13980. * truthy for. The predicate is invoked with two arguments: (value, key).
  13981. *
  13982. * @static
  13983. * @memberOf _
  13984. * @since 4.0.0
  13985. * @category Object
  13986. * @param {Object} object The source object.
  13987. * @param {Function} [predicate=_.identity] The function invoked per property.
  13988. * @returns {Object} Returns the new object.
  13989. * @example
  13990. *
  13991. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13992. *
  13993. * _.pickBy(object, _.isNumber);
  13994. * // => { 'a': 1, 'c': 3 }
  13995. */
  13996. function pickBy(object, predicate) {
  13997. if (object == null) {
  13998. return {};
  13999. }
  14000. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14001. return [prop];
  14002. });
  14003. predicate = getIteratee(predicate);
  14004. return basePickBy(object, props, function(value, path) {
  14005. return predicate(value, path[0]);
  14006. });
  14007. }
  14008. /**
  14009. * This method is like `_.get` except that if the resolved value is a
  14010. * function it's invoked with the `this` binding of its parent object and
  14011. * its result is returned.
  14012. *
  14013. * @static
  14014. * @since 0.1.0
  14015. * @memberOf _
  14016. * @category Object
  14017. * @param {Object} object The object to query.
  14018. * @param {Array|string} path The path of the property to resolve.
  14019. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14020. * @returns {*} Returns the resolved value.
  14021. * @example
  14022. *
  14023. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14024. *
  14025. * _.result(object, 'a[0].b.c1');
  14026. * // => 3
  14027. *
  14028. * _.result(object, 'a[0].b.c2');
  14029. * // => 4
  14030. *
  14031. * _.result(object, 'a[0].b.c3', 'default');
  14032. * // => 'default'
  14033. *
  14034. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14035. * // => 'default'
  14036. */
  14037. function result(object, path, defaultValue) {
  14038. path = castPath(path, object);
  14039. var index = -1,
  14040. length = path.length;
  14041. // Ensure the loop is entered when path is empty.
  14042. if (!length) {
  14043. length = 1;
  14044. object = undefined;
  14045. }
  14046. while (++index < length) {
  14047. var value = object == null ? undefined : object[toKey(path[index])];
  14048. if (value === undefined) {
  14049. index = length;
  14050. value = defaultValue;
  14051. }
  14052. object = isFunction(value) ? value.call(object) : value;
  14053. }
  14054. return object;
  14055. }
  14056. /**
  14057. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14058. * it's created. Arrays are created for missing index properties while objects
  14059. * are created for all other missing properties. Use `_.setWith` to customize
  14060. * `path` creation.
  14061. *
  14062. * **Note:** This method mutates `object`.
  14063. *
  14064. * @static
  14065. * @memberOf _
  14066. * @since 3.7.0
  14067. * @category Object
  14068. * @param {Object} object The object to modify.
  14069. * @param {Array|string} path The path of the property to set.
  14070. * @param {*} value The value to set.
  14071. * @returns {Object} Returns `object`.
  14072. * @example
  14073. *
  14074. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14075. *
  14076. * _.set(object, 'a[0].b.c', 4);
  14077. * console.log(object.a[0].b.c);
  14078. * // => 4
  14079. *
  14080. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14081. * console.log(object.x[0].y.z);
  14082. * // => 5
  14083. */
  14084. function set(object, path, value) {
  14085. return object == null ? object : baseSet(object, path, value);
  14086. }
  14087. /**
  14088. * This method is like `_.set` except that it accepts `customizer` which is
  14089. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14090. * path creation is handled by the method instead. The `customizer` is invoked
  14091. * with three arguments: (nsValue, key, nsObject).
  14092. *
  14093. * **Note:** This method mutates `object`.
  14094. *
  14095. * @static
  14096. * @memberOf _
  14097. * @since 4.0.0
  14098. * @category Object
  14099. * @param {Object} object The object to modify.
  14100. * @param {Array|string} path The path of the property to set.
  14101. * @param {*} value The value to set.
  14102. * @param {Function} [customizer] The function to customize assigned values.
  14103. * @returns {Object} Returns `object`.
  14104. * @example
  14105. *
  14106. * var object = {};
  14107. *
  14108. * _.setWith(object, '[0][1]', 'a', Object);
  14109. * // => { '0': { '1': 'a' } }
  14110. */
  14111. function setWith(object, path, value, customizer) {
  14112. customizer = typeof customizer == 'function' ? customizer : undefined;
  14113. return object == null ? object : baseSet(object, path, value, customizer);
  14114. }
  14115. /**
  14116. * Creates an array of own enumerable string keyed-value pairs for `object`
  14117. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14118. * entries are returned.
  14119. *
  14120. * @static
  14121. * @memberOf _
  14122. * @since 4.0.0
  14123. * @alias entries
  14124. * @category Object
  14125. * @param {Object} object The object to query.
  14126. * @returns {Array} Returns the key-value pairs.
  14127. * @example
  14128. *
  14129. * function Foo() {
  14130. * this.a = 1;
  14131. * this.b = 2;
  14132. * }
  14133. *
  14134. * Foo.prototype.c = 3;
  14135. *
  14136. * _.toPairs(new Foo);
  14137. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14138. */
  14139. var toPairs = createToPairs(keys);
  14140. /**
  14141. * Creates an array of own and inherited enumerable string keyed-value pairs
  14142. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14143. * or set, its entries are returned.
  14144. *
  14145. * @static
  14146. * @memberOf _
  14147. * @since 4.0.0
  14148. * @alias entriesIn
  14149. * @category Object
  14150. * @param {Object} object The object to query.
  14151. * @returns {Array} Returns the key-value pairs.
  14152. * @example
  14153. *
  14154. * function Foo() {
  14155. * this.a = 1;
  14156. * this.b = 2;
  14157. * }
  14158. *
  14159. * Foo.prototype.c = 3;
  14160. *
  14161. * _.toPairsIn(new Foo);
  14162. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14163. */
  14164. var toPairsIn = createToPairs(keysIn);
  14165. /**
  14166. * An alternative to `_.reduce`; this method transforms `object` to a new
  14167. * `accumulator` object which is the result of running each of its own
  14168. * enumerable string keyed properties thru `iteratee`, with each invocation
  14169. * potentially mutating the `accumulator` object. If `accumulator` is not
  14170. * provided, a new object with the same `[[Prototype]]` will be used. The
  14171. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14172. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14173. *
  14174. * @static
  14175. * @memberOf _
  14176. * @since 1.3.0
  14177. * @category Object
  14178. * @param {Object} object The object to iterate over.
  14179. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14180. * @param {*} [accumulator] The custom accumulator value.
  14181. * @returns {*} Returns the accumulated value.
  14182. * @example
  14183. *
  14184. * _.transform([2, 3, 4], function(result, n) {
  14185. * result.push(n *= n);
  14186. * return n % 2 == 0;
  14187. * }, []);
  14188. * // => [4, 9]
  14189. *
  14190. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14191. * (result[value] || (result[value] = [])).push(key);
  14192. * }, {});
  14193. * // => { '1': ['a', 'c'], '2': ['b'] }
  14194. */
  14195. function transform(object, iteratee, accumulator) {
  14196. var isArr = isArray(object),
  14197. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14198. iteratee = getIteratee(iteratee, 4);
  14199. if (accumulator == null) {
  14200. var Ctor = object && object.constructor;
  14201. if (isArrLike) {
  14202. accumulator = isArr ? new Ctor : [];
  14203. }
  14204. else if (isObject(object)) {
  14205. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14206. }
  14207. else {
  14208. accumulator = {};
  14209. }
  14210. }
  14211. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14212. return iteratee(accumulator, value, index, object);
  14213. });
  14214. return accumulator;
  14215. }
  14216. /**
  14217. * Removes the property at `path` of `object`.
  14218. *
  14219. * **Note:** This method mutates `object`.
  14220. *
  14221. * @static
  14222. * @memberOf _
  14223. * @since 4.0.0
  14224. * @category Object
  14225. * @param {Object} object The object to modify.
  14226. * @param {Array|string} path The path of the property to unset.
  14227. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14228. * @example
  14229. *
  14230. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14231. * _.unset(object, 'a[0].b.c');
  14232. * // => true
  14233. *
  14234. * console.log(object);
  14235. * // => { 'a': [{ 'b': {} }] };
  14236. *
  14237. * _.unset(object, ['a', '0', 'b', 'c']);
  14238. * // => true
  14239. *
  14240. * console.log(object);
  14241. * // => { 'a': [{ 'b': {} }] };
  14242. */
  14243. function unset(object, path) {
  14244. return object == null ? true : baseUnset(object, path);
  14245. }
  14246. /**
  14247. * This method is like `_.set` except that accepts `updater` to produce the
  14248. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14249. * is invoked with one argument: (value).
  14250. *
  14251. * **Note:** This method mutates `object`.
  14252. *
  14253. * @static
  14254. * @memberOf _
  14255. * @since 4.6.0
  14256. * @category Object
  14257. * @param {Object} object The object to modify.
  14258. * @param {Array|string} path The path of the property to set.
  14259. * @param {Function} updater The function to produce the updated value.
  14260. * @returns {Object} Returns `object`.
  14261. * @example
  14262. *
  14263. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14264. *
  14265. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14266. * console.log(object.a[0].b.c);
  14267. * // => 9
  14268. *
  14269. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14270. * console.log(object.x[0].y.z);
  14271. * // => 0
  14272. */
  14273. function update(object, path, updater) {
  14274. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14275. }
  14276. /**
  14277. * This method is like `_.update` except that it accepts `customizer` which is
  14278. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14279. * path creation is handled by the method instead. The `customizer` is invoked
  14280. * with three arguments: (nsValue, key, nsObject).
  14281. *
  14282. * **Note:** This method mutates `object`.
  14283. *
  14284. * @static
  14285. * @memberOf _
  14286. * @since 4.6.0
  14287. * @category Object
  14288. * @param {Object} object The object to modify.
  14289. * @param {Array|string} path The path of the property to set.
  14290. * @param {Function} updater The function to produce the updated value.
  14291. * @param {Function} [customizer] The function to customize assigned values.
  14292. * @returns {Object} Returns `object`.
  14293. * @example
  14294. *
  14295. * var object = {};
  14296. *
  14297. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14298. * // => { '0': { '1': 'a' } }
  14299. */
  14300. function updateWith(object, path, updater, customizer) {
  14301. customizer = typeof customizer == 'function' ? customizer : undefined;
  14302. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14303. }
  14304. /**
  14305. * Creates an array of the own enumerable string keyed property values of `object`.
  14306. *
  14307. * **Note:** Non-object values are coerced to objects.
  14308. *
  14309. * @static
  14310. * @since 0.1.0
  14311. * @memberOf _
  14312. * @category Object
  14313. * @param {Object} object The object to query.
  14314. * @returns {Array} Returns the array of property values.
  14315. * @example
  14316. *
  14317. * function Foo() {
  14318. * this.a = 1;
  14319. * this.b = 2;
  14320. * }
  14321. *
  14322. * Foo.prototype.c = 3;
  14323. *
  14324. * _.values(new Foo);
  14325. * // => [1, 2] (iteration order is not guaranteed)
  14326. *
  14327. * _.values('hi');
  14328. * // => ['h', 'i']
  14329. */
  14330. function values(object) {
  14331. return object == null ? [] : baseValues(object, keys(object));
  14332. }
  14333. /**
  14334. * Creates an array of the own and inherited enumerable string keyed property
  14335. * values of `object`.
  14336. *
  14337. * **Note:** Non-object values are coerced to objects.
  14338. *
  14339. * @static
  14340. * @memberOf _
  14341. * @since 3.0.0
  14342. * @category Object
  14343. * @param {Object} object The object to query.
  14344. * @returns {Array} Returns the array of property values.
  14345. * @example
  14346. *
  14347. * function Foo() {
  14348. * this.a = 1;
  14349. * this.b = 2;
  14350. * }
  14351. *
  14352. * Foo.prototype.c = 3;
  14353. *
  14354. * _.valuesIn(new Foo);
  14355. * // => [1, 2, 3] (iteration order is not guaranteed)
  14356. */
  14357. function valuesIn(object) {
  14358. return object == null ? [] : baseValues(object, keysIn(object));
  14359. }
  14360. /*------------------------------------------------------------------------*/
  14361. /**
  14362. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14363. *
  14364. * @static
  14365. * @memberOf _
  14366. * @since 4.0.0
  14367. * @category Number
  14368. * @param {number} number The number to clamp.
  14369. * @param {number} [lower] The lower bound.
  14370. * @param {number} upper The upper bound.
  14371. * @returns {number} Returns the clamped number.
  14372. * @example
  14373. *
  14374. * _.clamp(-10, -5, 5);
  14375. * // => -5
  14376. *
  14377. * _.clamp(10, -5, 5);
  14378. * // => 5
  14379. */
  14380. function clamp(number, lower, upper) {
  14381. if (upper === undefined) {
  14382. upper = lower;
  14383. lower = undefined;
  14384. }
  14385. if (upper !== undefined) {
  14386. upper = toNumber(upper);
  14387. upper = upper === upper ? upper : 0;
  14388. }
  14389. if (lower !== undefined) {
  14390. lower = toNumber(lower);
  14391. lower = lower === lower ? lower : 0;
  14392. }
  14393. return baseClamp(toNumber(number), lower, upper);
  14394. }
  14395. /**
  14396. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14397. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14398. * If `start` is greater than `end` the params are swapped to support
  14399. * negative ranges.
  14400. *
  14401. * @static
  14402. * @memberOf _
  14403. * @since 3.3.0
  14404. * @category Number
  14405. * @param {number} number The number to check.
  14406. * @param {number} [start=0] The start of the range.
  14407. * @param {number} end The end of the range.
  14408. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14409. * @see _.range, _.rangeRight
  14410. * @example
  14411. *
  14412. * _.inRange(3, 2, 4);
  14413. * // => true
  14414. *
  14415. * _.inRange(4, 8);
  14416. * // => true
  14417. *
  14418. * _.inRange(4, 2);
  14419. * // => false
  14420. *
  14421. * _.inRange(2, 2);
  14422. * // => false
  14423. *
  14424. * _.inRange(1.2, 2);
  14425. * // => true
  14426. *
  14427. * _.inRange(5.2, 4);
  14428. * // => false
  14429. *
  14430. * _.inRange(-3, -2, -6);
  14431. * // => true
  14432. */
  14433. function inRange(number, start, end) {
  14434. start = toFinite(start);
  14435. if (end === undefined) {
  14436. end = start;
  14437. start = 0;
  14438. } else {
  14439. end = toFinite(end);
  14440. }
  14441. number = toNumber(number);
  14442. return baseInRange(number, start, end);
  14443. }
  14444. /**
  14445. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14446. * If only one argument is provided a number between `0` and the given number
  14447. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14448. * floats, a floating-point number is returned instead of an integer.
  14449. *
  14450. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14451. * floating-point values which can produce unexpected results.
  14452. *
  14453. * @static
  14454. * @memberOf _
  14455. * @since 0.7.0
  14456. * @category Number
  14457. * @param {number} [lower=0] The lower bound.
  14458. * @param {number} [upper=1] The upper bound.
  14459. * @param {boolean} [floating] Specify returning a floating-point number.
  14460. * @returns {number} Returns the random number.
  14461. * @example
  14462. *
  14463. * _.random(0, 5);
  14464. * // => an integer between 0 and 5
  14465. *
  14466. * _.random(5);
  14467. * // => also an integer between 0 and 5
  14468. *
  14469. * _.random(5, true);
  14470. * // => a floating-point number between 0 and 5
  14471. *
  14472. * _.random(1.2, 5.2);
  14473. * // => a floating-point number between 1.2 and 5.2
  14474. */
  14475. function random(lower, upper, floating) {
  14476. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14477. upper = floating = undefined;
  14478. }
  14479. if (floating === undefined) {
  14480. if (typeof upper == 'boolean') {
  14481. floating = upper;
  14482. upper = undefined;
  14483. }
  14484. else if (typeof lower == 'boolean') {
  14485. floating = lower;
  14486. lower = undefined;
  14487. }
  14488. }
  14489. if (lower === undefined && upper === undefined) {
  14490. lower = 0;
  14491. upper = 1;
  14492. }
  14493. else {
  14494. lower = toFinite(lower);
  14495. if (upper === undefined) {
  14496. upper = lower;
  14497. lower = 0;
  14498. } else {
  14499. upper = toFinite(upper);
  14500. }
  14501. }
  14502. if (lower > upper) {
  14503. var temp = lower;
  14504. lower = upper;
  14505. upper = temp;
  14506. }
  14507. if (floating || lower % 1 || upper % 1) {
  14508. var rand = nativeRandom();
  14509. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14510. }
  14511. return baseRandom(lower, upper);
  14512. }
  14513. /*------------------------------------------------------------------------*/
  14514. /**
  14515. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14516. *
  14517. * @static
  14518. * @memberOf _
  14519. * @since 3.0.0
  14520. * @category String
  14521. * @param {string} [string=''] The string to convert.
  14522. * @returns {string} Returns the camel cased string.
  14523. * @example
  14524. *
  14525. * _.camelCase('Foo Bar');
  14526. * // => 'fooBar'
  14527. *
  14528. * _.camelCase('--foo-bar--');
  14529. * // => 'fooBar'
  14530. *
  14531. * _.camelCase('__FOO_BAR__');
  14532. * // => 'fooBar'
  14533. */
  14534. var camelCase = createCompounder(function(result, word, index) {
  14535. word = word.toLowerCase();
  14536. return result + (index ? capitalize(word) : word);
  14537. });
  14538. /**
  14539. * Converts the first character of `string` to upper case and the remaining
  14540. * to lower case.
  14541. *
  14542. * @static
  14543. * @memberOf _
  14544. * @since 3.0.0
  14545. * @category String
  14546. * @param {string} [string=''] The string to capitalize.
  14547. * @returns {string} Returns the capitalized string.
  14548. * @example
  14549. *
  14550. * _.capitalize('FRED');
  14551. * // => 'Fred'
  14552. */
  14553. function capitalize(string) {
  14554. return upperFirst(toString(string).toLowerCase());
  14555. }
  14556. /**
  14557. * Deburrs `string` by converting
  14558. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14559. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14560. * letters to basic Latin letters and removing
  14561. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14562. *
  14563. * @static
  14564. * @memberOf _
  14565. * @since 3.0.0
  14566. * @category String
  14567. * @param {string} [string=''] The string to deburr.
  14568. * @returns {string} Returns the deburred string.
  14569. * @example
  14570. *
  14571. * _.deburr('déjà vu');
  14572. * // => 'deja vu'
  14573. */
  14574. function deburr(string) {
  14575. string = toString(string);
  14576. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14577. }
  14578. /**
  14579. * Checks if `string` ends with the given target string.
  14580. *
  14581. * @static
  14582. * @memberOf _
  14583. * @since 3.0.0
  14584. * @category String
  14585. * @param {string} [string=''] The string to inspect.
  14586. * @param {string} [target] The string to search for.
  14587. * @param {number} [position=string.length] The position to search up to.
  14588. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14589. * else `false`.
  14590. * @example
  14591. *
  14592. * _.endsWith('abc', 'c');
  14593. * // => true
  14594. *
  14595. * _.endsWith('abc', 'b');
  14596. * // => false
  14597. *
  14598. * _.endsWith('abc', 'b', 2);
  14599. * // => true
  14600. */
  14601. function endsWith(string, target, position) {
  14602. string = toString(string);
  14603. target = baseToString(target);
  14604. var length = string.length;
  14605. position = position === undefined
  14606. ? length
  14607. : baseClamp(toInteger(position), 0, length);
  14608. var end = position;
  14609. position -= target.length;
  14610. return position >= 0 && string.slice(position, end) == target;
  14611. }
  14612. /**
  14613. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14614. * corresponding HTML entities.
  14615. *
  14616. * **Note:** No other characters are escaped. To escape additional
  14617. * characters use a third-party library like [_he_](https://mths.be/he).
  14618. *
  14619. * Though the ">" character is escaped for symmetry, characters like
  14620. * ">" and "/" don't need escaping in HTML and have no special meaning
  14621. * unless they're part of a tag or unquoted attribute value. See
  14622. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14623. * (under "semi-related fun fact") for more details.
  14624. *
  14625. * When working with HTML you should always
  14626. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14627. * XSS vectors.
  14628. *
  14629. * @static
  14630. * @since 0.1.0
  14631. * @memberOf _
  14632. * @category String
  14633. * @param {string} [string=''] The string to escape.
  14634. * @returns {string} Returns the escaped string.
  14635. * @example
  14636. *
  14637. * _.escape('fred, barney, & pebbles');
  14638. * // => 'fred, barney, &amp; pebbles'
  14639. */
  14640. function escape(string) {
  14641. string = toString(string);
  14642. return (string && reHasUnescapedHtml.test(string))
  14643. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14644. : string;
  14645. }
  14646. /**
  14647. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14648. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14649. *
  14650. * @static
  14651. * @memberOf _
  14652. * @since 3.0.0
  14653. * @category String
  14654. * @param {string} [string=''] The string to escape.
  14655. * @returns {string} Returns the escaped string.
  14656. * @example
  14657. *
  14658. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14659. * // => '\[lodash\]\(https://lodash\.com/\)'
  14660. */
  14661. function escapeRegExp(string) {
  14662. string = toString(string);
  14663. return (string && reHasRegExpChar.test(string))
  14664. ? string.replace(reRegExpChar, '\\$&')
  14665. : string;
  14666. }
  14667. /**
  14668. * Converts `string` to
  14669. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14670. *
  14671. * @static
  14672. * @memberOf _
  14673. * @since 3.0.0
  14674. * @category String
  14675. * @param {string} [string=''] The string to convert.
  14676. * @returns {string} Returns the kebab cased string.
  14677. * @example
  14678. *
  14679. * _.kebabCase('Foo Bar');
  14680. * // => 'foo-bar'
  14681. *
  14682. * _.kebabCase('fooBar');
  14683. * // => 'foo-bar'
  14684. *
  14685. * _.kebabCase('__FOO_BAR__');
  14686. * // => 'foo-bar'
  14687. */
  14688. var kebabCase = createCompounder(function(result, word, index) {
  14689. return result + (index ? '-' : '') + word.toLowerCase();
  14690. });
  14691. /**
  14692. * Converts `string`, as space separated words, to lower case.
  14693. *
  14694. * @static
  14695. * @memberOf _
  14696. * @since 4.0.0
  14697. * @category String
  14698. * @param {string} [string=''] The string to convert.
  14699. * @returns {string} Returns the lower cased string.
  14700. * @example
  14701. *
  14702. * _.lowerCase('--Foo-Bar--');
  14703. * // => 'foo bar'
  14704. *
  14705. * _.lowerCase('fooBar');
  14706. * // => 'foo bar'
  14707. *
  14708. * _.lowerCase('__FOO_BAR__');
  14709. * // => 'foo bar'
  14710. */
  14711. var lowerCase = createCompounder(function(result, word, index) {
  14712. return result + (index ? ' ' : '') + word.toLowerCase();
  14713. });
  14714. /**
  14715. * Converts the first character of `string` to lower case.
  14716. *
  14717. * @static
  14718. * @memberOf _
  14719. * @since 4.0.0
  14720. * @category String
  14721. * @param {string} [string=''] The string to convert.
  14722. * @returns {string} Returns the converted string.
  14723. * @example
  14724. *
  14725. * _.lowerFirst('Fred');
  14726. * // => 'fred'
  14727. *
  14728. * _.lowerFirst('FRED');
  14729. * // => 'fRED'
  14730. */
  14731. var lowerFirst = createCaseFirst('toLowerCase');
  14732. /**
  14733. * Pads `string` on the left and right sides if it's shorter than `length`.
  14734. * Padding characters are truncated if they can't be evenly divided by `length`.
  14735. *
  14736. * @static
  14737. * @memberOf _
  14738. * @since 3.0.0
  14739. * @category String
  14740. * @param {string} [string=''] The string to pad.
  14741. * @param {number} [length=0] The padding length.
  14742. * @param {string} [chars=' '] The string used as padding.
  14743. * @returns {string} Returns the padded string.
  14744. * @example
  14745. *
  14746. * _.pad('abc', 8);
  14747. * // => ' abc '
  14748. *
  14749. * _.pad('abc', 8, '_-');
  14750. * // => '_-abc_-_'
  14751. *
  14752. * _.pad('abc', 3);
  14753. * // => 'abc'
  14754. */
  14755. function pad(string, length, chars) {
  14756. string = toString(string);
  14757. length = toInteger(length);
  14758. var strLength = length ? stringSize(string) : 0;
  14759. if (!length || strLength >= length) {
  14760. return string;
  14761. }
  14762. var mid = (length - strLength) / 2;
  14763. return (
  14764. createPadding(nativeFloor(mid), chars) +
  14765. string +
  14766. createPadding(nativeCeil(mid), chars)
  14767. );
  14768. }
  14769. /**
  14770. * Pads `string` on the right side if it's shorter than `length`. Padding
  14771. * characters are truncated if they exceed `length`.
  14772. *
  14773. * @static
  14774. * @memberOf _
  14775. * @since 4.0.0
  14776. * @category String
  14777. * @param {string} [string=''] The string to pad.
  14778. * @param {number} [length=0] The padding length.
  14779. * @param {string} [chars=' '] The string used as padding.
  14780. * @returns {string} Returns the padded string.
  14781. * @example
  14782. *
  14783. * _.padEnd('abc', 6);
  14784. * // => 'abc '
  14785. *
  14786. * _.padEnd('abc', 6, '_-');
  14787. * // => 'abc_-_'
  14788. *
  14789. * _.padEnd('abc', 3);
  14790. * // => 'abc'
  14791. */
  14792. function padEnd(string, length, chars) {
  14793. string = toString(string);
  14794. length = toInteger(length);
  14795. var strLength = length ? stringSize(string) : 0;
  14796. return (length && strLength < length)
  14797. ? (string + createPadding(length - strLength, chars))
  14798. : string;
  14799. }
  14800. /**
  14801. * Pads `string` on the left side if it's shorter than `length`. Padding
  14802. * characters are truncated if they exceed `length`.
  14803. *
  14804. * @static
  14805. * @memberOf _
  14806. * @since 4.0.0
  14807. * @category String
  14808. * @param {string} [string=''] The string to pad.
  14809. * @param {number} [length=0] The padding length.
  14810. * @param {string} [chars=' '] The string used as padding.
  14811. * @returns {string} Returns the padded string.
  14812. * @example
  14813. *
  14814. * _.padStart('abc', 6);
  14815. * // => ' abc'
  14816. *
  14817. * _.padStart('abc', 6, '_-');
  14818. * // => '_-_abc'
  14819. *
  14820. * _.padStart('abc', 3);
  14821. * // => 'abc'
  14822. */
  14823. function padStart(string, length, chars) {
  14824. string = toString(string);
  14825. length = toInteger(length);
  14826. var strLength = length ? stringSize(string) : 0;
  14827. return (length && strLength < length)
  14828. ? (createPadding(length - strLength, chars) + string)
  14829. : string;
  14830. }
  14831. /**
  14832. * Converts `string` to an integer of the specified radix. If `radix` is
  14833. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14834. * hexadecimal, in which case a `radix` of `16` is used.
  14835. *
  14836. * **Note:** This method aligns with the
  14837. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14838. *
  14839. * @static
  14840. * @memberOf _
  14841. * @since 1.1.0
  14842. * @category String
  14843. * @param {string} string The string to convert.
  14844. * @param {number} [radix=10] The radix to interpret `value` by.
  14845. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14846. * @returns {number} Returns the converted integer.
  14847. * @example
  14848. *
  14849. * _.parseInt('08');
  14850. * // => 8
  14851. *
  14852. * _.map(['6', '08', '10'], _.parseInt);
  14853. * // => [6, 8, 10]
  14854. */
  14855. function parseInt(string, radix, guard) {
  14856. if (guard || radix == null) {
  14857. radix = 0;
  14858. } else if (radix) {
  14859. radix = +radix;
  14860. }
  14861. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14862. }
  14863. /**
  14864. * Repeats the given string `n` times.
  14865. *
  14866. * @static
  14867. * @memberOf _
  14868. * @since 3.0.0
  14869. * @category String
  14870. * @param {string} [string=''] The string to repeat.
  14871. * @param {number} [n=1] The number of times to repeat the string.
  14872. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14873. * @returns {string} Returns the repeated string.
  14874. * @example
  14875. *
  14876. * _.repeat('*', 3);
  14877. * // => '***'
  14878. *
  14879. * _.repeat('abc', 2);
  14880. * // => 'abcabc'
  14881. *
  14882. * _.repeat('abc', 0);
  14883. * // => ''
  14884. */
  14885. function repeat(string, n, guard) {
  14886. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14887. n = 1;
  14888. } else {
  14889. n = toInteger(n);
  14890. }
  14891. return baseRepeat(toString(string), n);
  14892. }
  14893. /**
  14894. * Replaces matches for `pattern` in `string` with `replacement`.
  14895. *
  14896. * **Note:** This method is based on
  14897. * [`String#replace`](https://mdn.io/String/replace).
  14898. *
  14899. * @static
  14900. * @memberOf _
  14901. * @since 4.0.0
  14902. * @category String
  14903. * @param {string} [string=''] The string to modify.
  14904. * @param {RegExp|string} pattern The pattern to replace.
  14905. * @param {Function|string} replacement The match replacement.
  14906. * @returns {string} Returns the modified string.
  14907. * @example
  14908. *
  14909. * _.replace('Hi Fred', 'Fred', 'Barney');
  14910. * // => 'Hi Barney'
  14911. */
  14912. function replace() {
  14913. var args = arguments,
  14914. string = toString(args[0]);
  14915. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14916. }
  14917. /**
  14918. * Converts `string` to
  14919. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14920. *
  14921. * @static
  14922. * @memberOf _
  14923. * @since 3.0.0
  14924. * @category String
  14925. * @param {string} [string=''] The string to convert.
  14926. * @returns {string} Returns the snake cased string.
  14927. * @example
  14928. *
  14929. * _.snakeCase('Foo Bar');
  14930. * // => 'foo_bar'
  14931. *
  14932. * _.snakeCase('fooBar');
  14933. * // => 'foo_bar'
  14934. *
  14935. * _.snakeCase('--FOO-BAR--');
  14936. * // => 'foo_bar'
  14937. */
  14938. var snakeCase = createCompounder(function(result, word, index) {
  14939. return result + (index ? '_' : '') + word.toLowerCase();
  14940. });
  14941. /**
  14942. * Splits `string` by `separator`.
  14943. *
  14944. * **Note:** This method is based on
  14945. * [`String#split`](https://mdn.io/String/split).
  14946. *
  14947. * @static
  14948. * @memberOf _
  14949. * @since 4.0.0
  14950. * @category String
  14951. * @param {string} [string=''] The string to split.
  14952. * @param {RegExp|string} separator The separator pattern to split by.
  14953. * @param {number} [limit] The length to truncate results to.
  14954. * @returns {Array} Returns the string segments.
  14955. * @example
  14956. *
  14957. * _.split('a-b-c', '-', 2);
  14958. * // => ['a', 'b']
  14959. */
  14960. function split(string, separator, limit) {
  14961. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14962. separator = limit = undefined;
  14963. }
  14964. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14965. if (!limit) {
  14966. return [];
  14967. }
  14968. string = toString(string);
  14969. if (string && (
  14970. typeof separator == 'string' ||
  14971. (separator != null && !isRegExp(separator))
  14972. )) {
  14973. separator = baseToString(separator);
  14974. if (!separator && hasUnicode(string)) {
  14975. return castSlice(stringToArray(string), 0, limit);
  14976. }
  14977. }
  14978. return string.split(separator, limit);
  14979. }
  14980. /**
  14981. * Converts `string` to
  14982. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14983. *
  14984. * @static
  14985. * @memberOf _
  14986. * @since 3.1.0
  14987. * @category String
  14988. * @param {string} [string=''] The string to convert.
  14989. * @returns {string} Returns the start cased string.
  14990. * @example
  14991. *
  14992. * _.startCase('--foo-bar--');
  14993. * // => 'Foo Bar'
  14994. *
  14995. * _.startCase('fooBar');
  14996. * // => 'Foo Bar'
  14997. *
  14998. * _.startCase('__FOO_BAR__');
  14999. * // => 'FOO BAR'
  15000. */
  15001. var startCase = createCompounder(function(result, word, index) {
  15002. return result + (index ? ' ' : '') + upperFirst(word);
  15003. });
  15004. /**
  15005. * Checks if `string` starts with the given target string.
  15006. *
  15007. * @static
  15008. * @memberOf _
  15009. * @since 3.0.0
  15010. * @category String
  15011. * @param {string} [string=''] The string to inspect.
  15012. * @param {string} [target] The string to search for.
  15013. * @param {number} [position=0] The position to search from.
  15014. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15015. * else `false`.
  15016. * @example
  15017. *
  15018. * _.startsWith('abc', 'a');
  15019. * // => true
  15020. *
  15021. * _.startsWith('abc', 'b');
  15022. * // => false
  15023. *
  15024. * _.startsWith('abc', 'b', 1);
  15025. * // => true
  15026. */
  15027. function startsWith(string, target, position) {
  15028. string = toString(string);
  15029. position = position == null
  15030. ? 0
  15031. : baseClamp(toInteger(position), 0, string.length);
  15032. target = baseToString(target);
  15033. return string.slice(position, position + target.length) == target;
  15034. }
  15035. /**
  15036. * Creates a compiled template function that can interpolate data properties
  15037. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15038. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15039. * properties may be accessed as free variables in the template. If a setting
  15040. * object is given, it takes precedence over `_.templateSettings` values.
  15041. *
  15042. * **Note:** In the development build `_.template` utilizes
  15043. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15044. * for easier debugging.
  15045. *
  15046. * For more information on precompiling templates see
  15047. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15048. *
  15049. * For more information on Chrome extension sandboxes see
  15050. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15051. *
  15052. * @static
  15053. * @since 0.1.0
  15054. * @memberOf _
  15055. * @category String
  15056. * @param {string} [string=''] The template string.
  15057. * @param {Object} [options={}] The options object.
  15058. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15059. * The HTML "escape" delimiter.
  15060. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15061. * The "evaluate" delimiter.
  15062. * @param {Object} [options.imports=_.templateSettings.imports]
  15063. * An object to import into the template as free variables.
  15064. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15065. * The "interpolate" delimiter.
  15066. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15067. * The sourceURL of the compiled template.
  15068. * @param {string} [options.variable='obj']
  15069. * The data object variable name.
  15070. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15071. * @returns {Function} Returns the compiled template function.
  15072. * @example
  15073. *
  15074. * // Use the "interpolate" delimiter to create a compiled template.
  15075. * var compiled = _.template('hello <%= user %>!');
  15076. * compiled({ 'user': 'fred' });
  15077. * // => 'hello fred!'
  15078. *
  15079. * // Use the HTML "escape" delimiter to escape data property values.
  15080. * var compiled = _.template('<b><%- value %></b>');
  15081. * compiled({ 'value': '<script>' });
  15082. * // => '<b>&lt;script&gt;</b>'
  15083. *
  15084. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15085. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15086. * compiled({ 'users': ['fred', 'barney'] });
  15087. * // => '<li>fred</li><li>barney</li>'
  15088. *
  15089. * // Use the internal `print` function in "evaluate" delimiters.
  15090. * var compiled = _.template('<% print("hello " + user); %>!');
  15091. * compiled({ 'user': 'barney' });
  15092. * // => 'hello barney!'
  15093. *
  15094. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15095. * // Disable support by replacing the "interpolate" delimiter.
  15096. * var compiled = _.template('hello ${ user }!');
  15097. * compiled({ 'user': 'pebbles' });
  15098. * // => 'hello pebbles!'
  15099. *
  15100. * // Use backslashes to treat delimiters as plain text.
  15101. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15102. * compiled({ 'value': 'ignored' });
  15103. * // => '<%- value %>'
  15104. *
  15105. * // Use the `imports` option to import `jQuery` as `jq`.
  15106. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15107. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15108. * compiled({ 'users': ['fred', 'barney'] });
  15109. * // => '<li>fred</li><li>barney</li>'
  15110. *
  15111. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15112. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15113. * compiled(data);
  15114. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15115. *
  15116. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15117. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15118. * compiled.source;
  15119. * // => function(data) {
  15120. * // var __t, __p = '';
  15121. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15122. * // return __p;
  15123. * // }
  15124. *
  15125. * // Use custom template delimiters.
  15126. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15127. * var compiled = _.template('hello {{ user }}!');
  15128. * compiled({ 'user': 'mustache' });
  15129. * // => 'hello mustache!'
  15130. *
  15131. * // Use the `source` property to inline compiled templates for meaningful
  15132. * // line numbers in error messages and stack traces.
  15133. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15134. * var JST = {\
  15135. * "main": ' + _.template(mainText).source + '\
  15136. * };\
  15137. * ');
  15138. */
  15139. function template(string, options, guard) {
  15140. // Based on John Resig's `tmpl` implementation
  15141. // (http://ejohn.org/blog/javascript-micro-templating/)
  15142. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15143. var settings = lodash.templateSettings;
  15144. if (guard && isIterateeCall(string, options, guard)) {
  15145. options = undefined;
  15146. }
  15147. string = toString(string);
  15148. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15149. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15150. importsKeys = keys(imports),
  15151. importsValues = baseValues(imports, importsKeys);
  15152. var isEscaping,
  15153. isEvaluating,
  15154. index = 0,
  15155. interpolate = options.interpolate || reNoMatch,
  15156. source = "__p += '";
  15157. // Compile the regexp to match each delimiter.
  15158. var reDelimiters = RegExp(
  15159. (options.escape || reNoMatch).source + '|' +
  15160. interpolate.source + '|' +
  15161. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15162. (options.evaluate || reNoMatch).source + '|$'
  15163. , 'g');
  15164. // Use a sourceURL for easier debugging.
  15165. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15166. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15167. // and escape the comment, thus injecting code that gets evaled.
  15168. var sourceURL = '//# sourceURL=' +
  15169. (hasOwnProperty.call(options, 'sourceURL')
  15170. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15171. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15172. ) + '\n';
  15173. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15174. interpolateValue || (interpolateValue = esTemplateValue);
  15175. // Escape characters that can't be included in string literals.
  15176. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15177. // Replace delimiters with snippets.
  15178. if (escapeValue) {
  15179. isEscaping = true;
  15180. source += "' +\n__e(" + escapeValue + ") +\n'";
  15181. }
  15182. if (evaluateValue) {
  15183. isEvaluating = true;
  15184. source += "';\n" + evaluateValue + ";\n__p += '";
  15185. }
  15186. if (interpolateValue) {
  15187. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15188. }
  15189. index = offset + match.length;
  15190. // The JS engine embedded in Adobe products needs `match` returned in
  15191. // order to produce the correct `offset` value.
  15192. return match;
  15193. });
  15194. source += "';\n";
  15195. // If `variable` is not specified wrap a with-statement around the generated
  15196. // code to add the data object to the top of the scope chain.
  15197. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15198. if (!variable) {
  15199. source = 'with (obj) {\n' + source + '\n}\n';
  15200. }
  15201. // Throw an error if a forbidden character was found in `variable`, to prevent
  15202. // potential command injection attacks.
  15203. else if (reForbiddenIdentifierChars.test(variable)) {
  15204. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15205. }
  15206. // Cleanup code by stripping empty strings.
  15207. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15208. .replace(reEmptyStringMiddle, '$1')
  15209. .replace(reEmptyStringTrailing, '$1;');
  15210. // Frame code as the function body.
  15211. source = 'function(' + (variable || 'obj') + ') {\n' +
  15212. (variable
  15213. ? ''
  15214. : 'obj || (obj = {});\n'
  15215. ) +
  15216. "var __t, __p = ''" +
  15217. (isEscaping
  15218. ? ', __e = _.escape'
  15219. : ''
  15220. ) +
  15221. (isEvaluating
  15222. ? ', __j = Array.prototype.join;\n' +
  15223. "function print() { __p += __j.call(arguments, '') }\n"
  15224. : ';\n'
  15225. ) +
  15226. source +
  15227. 'return __p\n}';
  15228. var result = attempt(function() {
  15229. return Function(importsKeys, sourceURL + 'return ' + source)
  15230. .apply(undefined, importsValues);
  15231. });
  15232. // Provide the compiled function's source by its `toString` method or
  15233. // the `source` property as a convenience for inlining compiled templates.
  15234. result.source = source;
  15235. if (isError(result)) {
  15236. throw result;
  15237. }
  15238. return result;
  15239. }
  15240. /**
  15241. * Converts `string`, as a whole, to lower case just like
  15242. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15243. *
  15244. * @static
  15245. * @memberOf _
  15246. * @since 4.0.0
  15247. * @category String
  15248. * @param {string} [string=''] The string to convert.
  15249. * @returns {string} Returns the lower cased string.
  15250. * @example
  15251. *
  15252. * _.toLower('--Foo-Bar--');
  15253. * // => '--foo-bar--'
  15254. *
  15255. * _.toLower('fooBar');
  15256. * // => 'foobar'
  15257. *
  15258. * _.toLower('__FOO_BAR__');
  15259. * // => '__foo_bar__'
  15260. */
  15261. function toLower(value) {
  15262. return toString(value).toLowerCase();
  15263. }
  15264. /**
  15265. * Converts `string`, as a whole, to upper case just like
  15266. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15267. *
  15268. * @static
  15269. * @memberOf _
  15270. * @since 4.0.0
  15271. * @category String
  15272. * @param {string} [string=''] The string to convert.
  15273. * @returns {string} Returns the upper cased string.
  15274. * @example
  15275. *
  15276. * _.toUpper('--foo-bar--');
  15277. * // => '--FOO-BAR--'
  15278. *
  15279. * _.toUpper('fooBar');
  15280. * // => 'FOOBAR'
  15281. *
  15282. * _.toUpper('__foo_bar__');
  15283. * // => '__FOO_BAR__'
  15284. */
  15285. function toUpper(value) {
  15286. return toString(value).toUpperCase();
  15287. }
  15288. /**
  15289. * Removes leading and trailing whitespace or specified characters from `string`.
  15290. *
  15291. * @static
  15292. * @memberOf _
  15293. * @since 3.0.0
  15294. * @category String
  15295. * @param {string} [string=''] The string to trim.
  15296. * @param {string} [chars=whitespace] The characters to trim.
  15297. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15298. * @returns {string} Returns the trimmed string.
  15299. * @example
  15300. *
  15301. * _.trim(' abc ');
  15302. * // => 'abc'
  15303. *
  15304. * _.trim('-_-abc-_-', '_-');
  15305. * // => 'abc'
  15306. *
  15307. * _.map([' foo ', ' bar '], _.trim);
  15308. * // => ['foo', 'bar']
  15309. */
  15310. function trim(string, chars, guard) {
  15311. string = toString(string);
  15312. if (string && (guard || chars === undefined)) {
  15313. return baseTrim(string);
  15314. }
  15315. if (!string || !(chars = baseToString(chars))) {
  15316. return string;
  15317. }
  15318. var strSymbols = stringToArray(string),
  15319. chrSymbols = stringToArray(chars),
  15320. start = charsStartIndex(strSymbols, chrSymbols),
  15321. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15322. return castSlice(strSymbols, start, end).join('');
  15323. }
  15324. /**
  15325. * Removes trailing whitespace or specified characters from `string`.
  15326. *
  15327. * @static
  15328. * @memberOf _
  15329. * @since 4.0.0
  15330. * @category String
  15331. * @param {string} [string=''] The string to trim.
  15332. * @param {string} [chars=whitespace] The characters to trim.
  15333. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15334. * @returns {string} Returns the trimmed string.
  15335. * @example
  15336. *
  15337. * _.trimEnd(' abc ');
  15338. * // => ' abc'
  15339. *
  15340. * _.trimEnd('-_-abc-_-', '_-');
  15341. * // => '-_-abc'
  15342. */
  15343. function trimEnd(string, chars, guard) {
  15344. string = toString(string);
  15345. if (string && (guard || chars === undefined)) {
  15346. return string.slice(0, trimmedEndIndex(string) + 1);
  15347. }
  15348. if (!string || !(chars = baseToString(chars))) {
  15349. return string;
  15350. }
  15351. var strSymbols = stringToArray(string),
  15352. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15353. return castSlice(strSymbols, 0, end).join('');
  15354. }
  15355. /**
  15356. * Removes leading whitespace or specified characters from `string`.
  15357. *
  15358. * @static
  15359. * @memberOf _
  15360. * @since 4.0.0
  15361. * @category String
  15362. * @param {string} [string=''] The string to trim.
  15363. * @param {string} [chars=whitespace] The characters to trim.
  15364. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15365. * @returns {string} Returns the trimmed string.
  15366. * @example
  15367. *
  15368. * _.trimStart(' abc ');
  15369. * // => 'abc '
  15370. *
  15371. * _.trimStart('-_-abc-_-', '_-');
  15372. * // => 'abc-_-'
  15373. */
  15374. function trimStart(string, chars, guard) {
  15375. string = toString(string);
  15376. if (string && (guard || chars === undefined)) {
  15377. return string.replace(reTrimStart, '');
  15378. }
  15379. if (!string || !(chars = baseToString(chars))) {
  15380. return string;
  15381. }
  15382. var strSymbols = stringToArray(string),
  15383. start = charsStartIndex(strSymbols, stringToArray(chars));
  15384. return castSlice(strSymbols, start).join('');
  15385. }
  15386. /**
  15387. * Truncates `string` if it's longer than the given maximum string length.
  15388. * The last characters of the truncated string are replaced with the omission
  15389. * string which defaults to "...".
  15390. *
  15391. * @static
  15392. * @memberOf _
  15393. * @since 4.0.0
  15394. * @category String
  15395. * @param {string} [string=''] The string to truncate.
  15396. * @param {Object} [options={}] The options object.
  15397. * @param {number} [options.length=30] The maximum string length.
  15398. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15399. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15400. * @returns {string} Returns the truncated string.
  15401. * @example
  15402. *
  15403. * _.truncate('hi-diddly-ho there, neighborino');
  15404. * // => 'hi-diddly-ho there, neighbo...'
  15405. *
  15406. * _.truncate('hi-diddly-ho there, neighborino', {
  15407. * 'length': 24,
  15408. * 'separator': ' '
  15409. * });
  15410. * // => 'hi-diddly-ho there,...'
  15411. *
  15412. * _.truncate('hi-diddly-ho there, neighborino', {
  15413. * 'length': 24,
  15414. * 'separator': /,? +/
  15415. * });
  15416. * // => 'hi-diddly-ho there...'
  15417. *
  15418. * _.truncate('hi-diddly-ho there, neighborino', {
  15419. * 'omission': ' [...]'
  15420. * });
  15421. * // => 'hi-diddly-ho there, neig [...]'
  15422. */
  15423. function truncate(string, options) {
  15424. var length = DEFAULT_TRUNC_LENGTH,
  15425. omission = DEFAULT_TRUNC_OMISSION;
  15426. if (isObject(options)) {
  15427. var separator = 'separator' in options ? options.separator : separator;
  15428. length = 'length' in options ? toInteger(options.length) : length;
  15429. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15430. }
  15431. string = toString(string);
  15432. var strLength = string.length;
  15433. if (hasUnicode(string)) {
  15434. var strSymbols = stringToArray(string);
  15435. strLength = strSymbols.length;
  15436. }
  15437. if (length >= strLength) {
  15438. return string;
  15439. }
  15440. var end = length - stringSize(omission);
  15441. if (end < 1) {
  15442. return omission;
  15443. }
  15444. var result = strSymbols
  15445. ? castSlice(strSymbols, 0, end).join('')
  15446. : string.slice(0, end);
  15447. if (separator === undefined) {
  15448. return result + omission;
  15449. }
  15450. if (strSymbols) {
  15451. end += (result.length - end);
  15452. }
  15453. if (isRegExp(separator)) {
  15454. if (string.slice(end).search(separator)) {
  15455. var match,
  15456. substring = result;
  15457. if (!separator.global) {
  15458. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15459. }
  15460. separator.lastIndex = 0;
  15461. while ((match = separator.exec(substring))) {
  15462. var newEnd = match.index;
  15463. }
  15464. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15465. }
  15466. } else if (string.indexOf(baseToString(separator), end) != end) {
  15467. var index = result.lastIndexOf(separator);
  15468. if (index > -1) {
  15469. result = result.slice(0, index);
  15470. }
  15471. }
  15472. return result + omission;
  15473. }
  15474. /**
  15475. * The inverse of `_.escape`; this method converts the HTML entities
  15476. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15477. * their corresponding characters.
  15478. *
  15479. * **Note:** No other HTML entities are unescaped. To unescape additional
  15480. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15481. *
  15482. * @static
  15483. * @memberOf _
  15484. * @since 0.6.0
  15485. * @category String
  15486. * @param {string} [string=''] The string to unescape.
  15487. * @returns {string} Returns the unescaped string.
  15488. * @example
  15489. *
  15490. * _.unescape('fred, barney, &amp; pebbles');
  15491. * // => 'fred, barney, & pebbles'
  15492. */
  15493. function unescape(string) {
  15494. string = toString(string);
  15495. return (string && reHasEscapedHtml.test(string))
  15496. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15497. : string;
  15498. }
  15499. /**
  15500. * Converts `string`, as space separated words, to upper case.
  15501. *
  15502. * @static
  15503. * @memberOf _
  15504. * @since 4.0.0
  15505. * @category String
  15506. * @param {string} [string=''] The string to convert.
  15507. * @returns {string} Returns the upper cased string.
  15508. * @example
  15509. *
  15510. * _.upperCase('--foo-bar');
  15511. * // => 'FOO BAR'
  15512. *
  15513. * _.upperCase('fooBar');
  15514. * // => 'FOO BAR'
  15515. *
  15516. * _.upperCase('__foo_bar__');
  15517. * // => 'FOO BAR'
  15518. */
  15519. var upperCase = createCompounder(function(result, word, index) {
  15520. return result + (index ? ' ' : '') + word.toUpperCase();
  15521. });
  15522. /**
  15523. * Converts the first character of `string` to upper case.
  15524. *
  15525. * @static
  15526. * @memberOf _
  15527. * @since 4.0.0
  15528. * @category String
  15529. * @param {string} [string=''] The string to convert.
  15530. * @returns {string} Returns the converted string.
  15531. * @example
  15532. *
  15533. * _.upperFirst('fred');
  15534. * // => 'Fred'
  15535. *
  15536. * _.upperFirst('FRED');
  15537. * // => 'FRED'
  15538. */
  15539. var upperFirst = createCaseFirst('toUpperCase');
  15540. /**
  15541. * Splits `string` into an array of its words.
  15542. *
  15543. * @static
  15544. * @memberOf _
  15545. * @since 3.0.0
  15546. * @category String
  15547. * @param {string} [string=''] The string to inspect.
  15548. * @param {RegExp|string} [pattern] The pattern to match words.
  15549. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15550. * @returns {Array} Returns the words of `string`.
  15551. * @example
  15552. *
  15553. * _.words('fred, barney, & pebbles');
  15554. * // => ['fred', 'barney', 'pebbles']
  15555. *
  15556. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15557. * // => ['fred', 'barney', '&', 'pebbles']
  15558. */
  15559. function words(string, pattern, guard) {
  15560. string = toString(string);
  15561. pattern = guard ? undefined : pattern;
  15562. if (pattern === undefined) {
  15563. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15564. }
  15565. return string.match(pattern) || [];
  15566. }
  15567. /*------------------------------------------------------------------------*/
  15568. /**
  15569. * Attempts to invoke `func`, returning either the result or the caught error
  15570. * object. Any additional arguments are provided to `func` when it's invoked.
  15571. *
  15572. * @static
  15573. * @memberOf _
  15574. * @since 3.0.0
  15575. * @category Util
  15576. * @param {Function} func The function to attempt.
  15577. * @param {...*} [args] The arguments to invoke `func` with.
  15578. * @returns {*} Returns the `func` result or error object.
  15579. * @example
  15580. *
  15581. * // Avoid throwing errors for invalid selectors.
  15582. * var elements = _.attempt(function(selector) {
  15583. * return document.querySelectorAll(selector);
  15584. * }, '>_>');
  15585. *
  15586. * if (_.isError(elements)) {
  15587. * elements = [];
  15588. * }
  15589. */
  15590. var attempt = baseRest(function(func, args) {
  15591. try {
  15592. return apply(func, undefined, args);
  15593. } catch (e) {
  15594. return isError(e) ? e : new Error(e);
  15595. }
  15596. });
  15597. /**
  15598. * Binds methods of an object to the object itself, overwriting the existing
  15599. * method.
  15600. *
  15601. * **Note:** This method doesn't set the "length" property of bound functions.
  15602. *
  15603. * @static
  15604. * @since 0.1.0
  15605. * @memberOf _
  15606. * @category Util
  15607. * @param {Object} object The object to bind and assign the bound methods to.
  15608. * @param {...(string|string[])} methodNames The object method names to bind.
  15609. * @returns {Object} Returns `object`.
  15610. * @example
  15611. *
  15612. * var view = {
  15613. * 'label': 'docs',
  15614. * 'click': function() {
  15615. * console.log('clicked ' + this.label);
  15616. * }
  15617. * };
  15618. *
  15619. * _.bindAll(view, ['click']);
  15620. * jQuery(element).on('click', view.click);
  15621. * // => Logs 'clicked docs' when clicked.
  15622. */
  15623. var bindAll = flatRest(function(object, methodNames) {
  15624. arrayEach(methodNames, function(key) {
  15625. key = toKey(key);
  15626. baseAssignValue(object, key, bind(object[key], object));
  15627. });
  15628. return object;
  15629. });
  15630. /**
  15631. * Creates a function that iterates over `pairs` and invokes the corresponding
  15632. * function of the first predicate to return truthy. The predicate-function
  15633. * pairs are invoked with the `this` binding and arguments of the created
  15634. * function.
  15635. *
  15636. * @static
  15637. * @memberOf _
  15638. * @since 4.0.0
  15639. * @category Util
  15640. * @param {Array} pairs The predicate-function pairs.
  15641. * @returns {Function} Returns the new composite function.
  15642. * @example
  15643. *
  15644. * var func = _.cond([
  15645. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15646. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15647. * [_.stubTrue, _.constant('no match')]
  15648. * ]);
  15649. *
  15650. * func({ 'a': 1, 'b': 2 });
  15651. * // => 'matches A'
  15652. *
  15653. * func({ 'a': 0, 'b': 1 });
  15654. * // => 'matches B'
  15655. *
  15656. * func({ 'a': '1', 'b': '2' });
  15657. * // => 'no match'
  15658. */
  15659. function cond(pairs) {
  15660. var length = pairs == null ? 0 : pairs.length,
  15661. toIteratee = getIteratee();
  15662. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15663. if (typeof pair[1] != 'function') {
  15664. throw new TypeError(FUNC_ERROR_TEXT);
  15665. }
  15666. return [toIteratee(pair[0]), pair[1]];
  15667. });
  15668. return baseRest(function(args) {
  15669. var index = -1;
  15670. while (++index < length) {
  15671. var pair = pairs[index];
  15672. if (apply(pair[0], this, args)) {
  15673. return apply(pair[1], this, args);
  15674. }
  15675. }
  15676. });
  15677. }
  15678. /**
  15679. * Creates a function that invokes the predicate properties of `source` with
  15680. * the corresponding property values of a given object, returning `true` if
  15681. * all predicates return truthy, else `false`.
  15682. *
  15683. * **Note:** The created function is equivalent to `_.conformsTo` with
  15684. * `source` partially applied.
  15685. *
  15686. * @static
  15687. * @memberOf _
  15688. * @since 4.0.0
  15689. * @category Util
  15690. * @param {Object} source The object of property predicates to conform to.
  15691. * @returns {Function} Returns the new spec function.
  15692. * @example
  15693. *
  15694. * var objects = [
  15695. * { 'a': 2, 'b': 1 },
  15696. * { 'a': 1, 'b': 2 }
  15697. * ];
  15698. *
  15699. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15700. * // => [{ 'a': 1, 'b': 2 }]
  15701. */
  15702. function conforms(source) {
  15703. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15704. }
  15705. /**
  15706. * Creates a function that returns `value`.
  15707. *
  15708. * @static
  15709. * @memberOf _
  15710. * @since 2.4.0
  15711. * @category Util
  15712. * @param {*} value The value to return from the new function.
  15713. * @returns {Function} Returns the new constant function.
  15714. * @example
  15715. *
  15716. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15717. *
  15718. * console.log(objects);
  15719. * // => [{ 'a': 1 }, { 'a': 1 }]
  15720. *
  15721. * console.log(objects[0] === objects[1]);
  15722. * // => true
  15723. */
  15724. function constant(value) {
  15725. return function() {
  15726. return value;
  15727. };
  15728. }
  15729. /**
  15730. * Checks `value` to determine whether a default value should be returned in
  15731. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15732. * or `undefined`.
  15733. *
  15734. * @static
  15735. * @memberOf _
  15736. * @since 4.14.0
  15737. * @category Util
  15738. * @param {*} value The value to check.
  15739. * @param {*} defaultValue The default value.
  15740. * @returns {*} Returns the resolved value.
  15741. * @example
  15742. *
  15743. * _.defaultTo(1, 10);
  15744. * // => 1
  15745. *
  15746. * _.defaultTo(undefined, 10);
  15747. * // => 10
  15748. */
  15749. function defaultTo(value, defaultValue) {
  15750. return (value == null || value !== value) ? defaultValue : value;
  15751. }
  15752. /**
  15753. * Creates a function that returns the result of invoking the given functions
  15754. * with the `this` binding of the created function, where each successive
  15755. * invocation is supplied the return value of the previous.
  15756. *
  15757. * @static
  15758. * @memberOf _
  15759. * @since 3.0.0
  15760. * @category Util
  15761. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15762. * @returns {Function} Returns the new composite function.
  15763. * @see _.flowRight
  15764. * @example
  15765. *
  15766. * function square(n) {
  15767. * return n * n;
  15768. * }
  15769. *
  15770. * var addSquare = _.flow([_.add, square]);
  15771. * addSquare(1, 2);
  15772. * // => 9
  15773. */
  15774. var flow = createFlow();
  15775. /**
  15776. * This method is like `_.flow` except that it creates a function that
  15777. * invokes the given functions from right to left.
  15778. *
  15779. * @static
  15780. * @since 3.0.0
  15781. * @memberOf _
  15782. * @category Util
  15783. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15784. * @returns {Function} Returns the new composite function.
  15785. * @see _.flow
  15786. * @example
  15787. *
  15788. * function square(n) {
  15789. * return n * n;
  15790. * }
  15791. *
  15792. * var addSquare = _.flowRight([square, _.add]);
  15793. * addSquare(1, 2);
  15794. * // => 9
  15795. */
  15796. var flowRight = createFlow(true);
  15797. /**
  15798. * This method returns the first argument it receives.
  15799. *
  15800. * @static
  15801. * @since 0.1.0
  15802. * @memberOf _
  15803. * @category Util
  15804. * @param {*} value Any value.
  15805. * @returns {*} Returns `value`.
  15806. * @example
  15807. *
  15808. * var object = { 'a': 1 };
  15809. *
  15810. * console.log(_.identity(object) === object);
  15811. * // => true
  15812. */
  15813. function identity(value) {
  15814. return value;
  15815. }
  15816. /**
  15817. * Creates a function that invokes `func` with the arguments of the created
  15818. * function. If `func` is a property name, the created function returns the
  15819. * property value for a given element. If `func` is an array or object, the
  15820. * created function returns `true` for elements that contain the equivalent
  15821. * source properties, otherwise it returns `false`.
  15822. *
  15823. * @static
  15824. * @since 4.0.0
  15825. * @memberOf _
  15826. * @category Util
  15827. * @param {*} [func=_.identity] The value to convert to a callback.
  15828. * @returns {Function} Returns the callback.
  15829. * @example
  15830. *
  15831. * var users = [
  15832. * { 'user': 'barney', 'age': 36, 'active': true },
  15833. * { 'user': 'fred', 'age': 40, 'active': false }
  15834. * ];
  15835. *
  15836. * // The `_.matches` iteratee shorthand.
  15837. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15838. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15839. *
  15840. * // The `_.matchesProperty` iteratee shorthand.
  15841. * _.filter(users, _.iteratee(['user', 'fred']));
  15842. * // => [{ 'user': 'fred', 'age': 40 }]
  15843. *
  15844. * // The `_.property` iteratee shorthand.
  15845. * _.map(users, _.iteratee('user'));
  15846. * // => ['barney', 'fred']
  15847. *
  15848. * // Create custom iteratee shorthands.
  15849. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15850. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15851. * return func.test(string);
  15852. * };
  15853. * });
  15854. *
  15855. * _.filter(['abc', 'def'], /ef/);
  15856. * // => ['def']
  15857. */
  15858. function iteratee(func) {
  15859. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15860. }
  15861. /**
  15862. * Creates a function that performs a partial deep comparison between a given
  15863. * object and `source`, returning `true` if the given object has equivalent
  15864. * property values, else `false`.
  15865. *
  15866. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15867. * partially applied.
  15868. *
  15869. * Partial comparisons will match empty array and empty object `source`
  15870. * values against any array or object value, respectively. See `_.isEqual`
  15871. * for a list of supported value comparisons.
  15872. *
  15873. * **Note:** Multiple values can be checked by combining several matchers
  15874. * using `_.overSome`
  15875. *
  15876. * @static
  15877. * @memberOf _
  15878. * @since 3.0.0
  15879. * @category Util
  15880. * @param {Object} source The object of property values to match.
  15881. * @returns {Function} Returns the new spec function.
  15882. * @example
  15883. *
  15884. * var objects = [
  15885. * { 'a': 1, 'b': 2, 'c': 3 },
  15886. * { 'a': 4, 'b': 5, 'c': 6 }
  15887. * ];
  15888. *
  15889. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15890. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15891. *
  15892. * // Checking for several possible values
  15893. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15894. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15895. */
  15896. function matches(source) {
  15897. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15898. }
  15899. /**
  15900. * Creates a function that performs a partial deep comparison between the
  15901. * value at `path` of a given object to `srcValue`, returning `true` if the
  15902. * object value is equivalent, else `false`.
  15903. *
  15904. * **Note:** Partial comparisons will match empty array and empty object
  15905. * `srcValue` values against any array or object value, respectively. See
  15906. * `_.isEqual` for a list of supported value comparisons.
  15907. *
  15908. * **Note:** Multiple values can be checked by combining several matchers
  15909. * using `_.overSome`
  15910. *
  15911. * @static
  15912. * @memberOf _
  15913. * @since 3.2.0
  15914. * @category Util
  15915. * @param {Array|string} path The path of the property to get.
  15916. * @param {*} srcValue The value to match.
  15917. * @returns {Function} Returns the new spec function.
  15918. * @example
  15919. *
  15920. * var objects = [
  15921. * { 'a': 1, 'b': 2, 'c': 3 },
  15922. * { 'a': 4, 'b': 5, 'c': 6 }
  15923. * ];
  15924. *
  15925. * _.find(objects, _.matchesProperty('a', 4));
  15926. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15927. *
  15928. * // Checking for several possible values
  15929. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15930. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15931. */
  15932. function matchesProperty(path, srcValue) {
  15933. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15934. }
  15935. /**
  15936. * Creates a function that invokes the method at `path` of a given object.
  15937. * Any additional arguments are provided to the invoked method.
  15938. *
  15939. * @static
  15940. * @memberOf _
  15941. * @since 3.7.0
  15942. * @category Util
  15943. * @param {Array|string} path The path of the method to invoke.
  15944. * @param {...*} [args] The arguments to invoke the method with.
  15945. * @returns {Function} Returns the new invoker function.
  15946. * @example
  15947. *
  15948. * var objects = [
  15949. * { 'a': { 'b': _.constant(2) } },
  15950. * { 'a': { 'b': _.constant(1) } }
  15951. * ];
  15952. *
  15953. * _.map(objects, _.method('a.b'));
  15954. * // => [2, 1]
  15955. *
  15956. * _.map(objects, _.method(['a', 'b']));
  15957. * // => [2, 1]
  15958. */
  15959. var method = baseRest(function(path, args) {
  15960. return function(object) {
  15961. return baseInvoke(object, path, args);
  15962. };
  15963. });
  15964. /**
  15965. * The opposite of `_.method`; this method creates a function that invokes
  15966. * the method at a given path of `object`. Any additional arguments are
  15967. * provided to the invoked method.
  15968. *
  15969. * @static
  15970. * @memberOf _
  15971. * @since 3.7.0
  15972. * @category Util
  15973. * @param {Object} object The object to query.
  15974. * @param {...*} [args] The arguments to invoke the method with.
  15975. * @returns {Function} Returns the new invoker function.
  15976. * @example
  15977. *
  15978. * var array = _.times(3, _.constant),
  15979. * object = { 'a': array, 'b': array, 'c': array };
  15980. *
  15981. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15982. * // => [2, 0]
  15983. *
  15984. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15985. * // => [2, 0]
  15986. */
  15987. var methodOf = baseRest(function(object, args) {
  15988. return function(path) {
  15989. return baseInvoke(object, path, args);
  15990. };
  15991. });
  15992. /**
  15993. * Adds all own enumerable string keyed function properties of a source
  15994. * object to the destination object. If `object` is a function, then methods
  15995. * are added to its prototype as well.
  15996. *
  15997. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15998. * avoid conflicts caused by modifying the original.
  15999. *
  16000. * @static
  16001. * @since 0.1.0
  16002. * @memberOf _
  16003. * @category Util
  16004. * @param {Function|Object} [object=lodash] The destination object.
  16005. * @param {Object} source The object of functions to add.
  16006. * @param {Object} [options={}] The options object.
  16007. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16008. * @returns {Function|Object} Returns `object`.
  16009. * @example
  16010. *
  16011. * function vowels(string) {
  16012. * return _.filter(string, function(v) {
  16013. * return /[aeiou]/i.test(v);
  16014. * });
  16015. * }
  16016. *
  16017. * _.mixin({ 'vowels': vowels });
  16018. * _.vowels('fred');
  16019. * // => ['e']
  16020. *
  16021. * _('fred').vowels().value();
  16022. * // => ['e']
  16023. *
  16024. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16025. * _('fred').vowels();
  16026. * // => ['e']
  16027. */
  16028. function mixin(object, source, options) {
  16029. var props = keys(source),
  16030. methodNames = baseFunctions(source, props);
  16031. if (options == null &&
  16032. !(isObject(source) && (methodNames.length || !props.length))) {
  16033. options = source;
  16034. source = object;
  16035. object = this;
  16036. methodNames = baseFunctions(source, keys(source));
  16037. }
  16038. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16039. isFunc = isFunction(object);
  16040. arrayEach(methodNames, function(methodName) {
  16041. var func = source[methodName];
  16042. object[methodName] = func;
  16043. if (isFunc) {
  16044. object.prototype[methodName] = function() {
  16045. var chainAll = this.__chain__;
  16046. if (chain || chainAll) {
  16047. var result = object(this.__wrapped__),
  16048. actions = result.__actions__ = copyArray(this.__actions__);
  16049. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16050. result.__chain__ = chainAll;
  16051. return result;
  16052. }
  16053. return func.apply(object, arrayPush([this.value()], arguments));
  16054. };
  16055. }
  16056. });
  16057. return object;
  16058. }
  16059. /**
  16060. * Reverts the `_` variable to its previous value and returns a reference to
  16061. * the `lodash` function.
  16062. *
  16063. * @static
  16064. * @since 0.1.0
  16065. * @memberOf _
  16066. * @category Util
  16067. * @returns {Function} Returns the `lodash` function.
  16068. * @example
  16069. *
  16070. * var lodash = _.noConflict();
  16071. */
  16072. function noConflict() {
  16073. if (root._ === this) {
  16074. root._ = oldDash;
  16075. }
  16076. return this;
  16077. }
  16078. /**
  16079. * This method returns `undefined`.
  16080. *
  16081. * @static
  16082. * @memberOf _
  16083. * @since 2.3.0
  16084. * @category Util
  16085. * @example
  16086. *
  16087. * _.times(2, _.noop);
  16088. * // => [undefined, undefined]
  16089. */
  16090. function noop() {
  16091. // No operation performed.
  16092. }
  16093. /**
  16094. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16095. * the nth argument from the end is returned.
  16096. *
  16097. * @static
  16098. * @memberOf _
  16099. * @since 4.0.0
  16100. * @category Util
  16101. * @param {number} [n=0] The index of the argument to return.
  16102. * @returns {Function} Returns the new pass-thru function.
  16103. * @example
  16104. *
  16105. * var func = _.nthArg(1);
  16106. * func('a', 'b', 'c', 'd');
  16107. * // => 'b'
  16108. *
  16109. * var func = _.nthArg(-2);
  16110. * func('a', 'b', 'c', 'd');
  16111. * // => 'c'
  16112. */
  16113. function nthArg(n) {
  16114. n = toInteger(n);
  16115. return baseRest(function(args) {
  16116. return baseNth(args, n);
  16117. });
  16118. }
  16119. /**
  16120. * Creates a function that invokes `iteratees` with the arguments it receives
  16121. * and returns their results.
  16122. *
  16123. * @static
  16124. * @memberOf _
  16125. * @since 4.0.0
  16126. * @category Util
  16127. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16128. * The iteratees to invoke.
  16129. * @returns {Function} Returns the new function.
  16130. * @example
  16131. *
  16132. * var func = _.over([Math.max, Math.min]);
  16133. *
  16134. * func(1, 2, 3, 4);
  16135. * // => [4, 1]
  16136. */
  16137. var over = createOver(arrayMap);
  16138. /**
  16139. * Creates a function that checks if **all** of the `predicates` return
  16140. * truthy when invoked with the arguments it receives.
  16141. *
  16142. * Following shorthands are possible for providing predicates.
  16143. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16144. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16145. *
  16146. * @static
  16147. * @memberOf _
  16148. * @since 4.0.0
  16149. * @category Util
  16150. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16151. * The predicates to check.
  16152. * @returns {Function} Returns the new function.
  16153. * @example
  16154. *
  16155. * var func = _.overEvery([Boolean, isFinite]);
  16156. *
  16157. * func('1');
  16158. * // => true
  16159. *
  16160. * func(null);
  16161. * // => false
  16162. *
  16163. * func(NaN);
  16164. * // => false
  16165. */
  16166. var overEvery = createOver(arrayEvery);
  16167. /**
  16168. * Creates a function that checks if **any** of the `predicates` return
  16169. * truthy when invoked with the arguments it receives.
  16170. *
  16171. * Following shorthands are possible for providing predicates.
  16172. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16173. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16174. *
  16175. * @static
  16176. * @memberOf _
  16177. * @since 4.0.0
  16178. * @category Util
  16179. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16180. * The predicates to check.
  16181. * @returns {Function} Returns the new function.
  16182. * @example
  16183. *
  16184. * var func = _.overSome([Boolean, isFinite]);
  16185. *
  16186. * func('1');
  16187. * // => true
  16188. *
  16189. * func(null);
  16190. * // => true
  16191. *
  16192. * func(NaN);
  16193. * // => false
  16194. *
  16195. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16196. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16197. */
  16198. var overSome = createOver(arraySome);
  16199. /**
  16200. * Creates a function that returns the value at `path` of a given object.
  16201. *
  16202. * @static
  16203. * @memberOf _
  16204. * @since 2.4.0
  16205. * @category Util
  16206. * @param {Array|string} path The path of the property to get.
  16207. * @returns {Function} Returns the new accessor function.
  16208. * @example
  16209. *
  16210. * var objects = [
  16211. * { 'a': { 'b': 2 } },
  16212. * { 'a': { 'b': 1 } }
  16213. * ];
  16214. *
  16215. * _.map(objects, _.property('a.b'));
  16216. * // => [2, 1]
  16217. *
  16218. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16219. * // => [1, 2]
  16220. */
  16221. function property(path) {
  16222. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16223. }
  16224. /**
  16225. * The opposite of `_.property`; this method creates a function that returns
  16226. * the value at a given path of `object`.
  16227. *
  16228. * @static
  16229. * @memberOf _
  16230. * @since 3.0.0
  16231. * @category Util
  16232. * @param {Object} object The object to query.
  16233. * @returns {Function} Returns the new accessor function.
  16234. * @example
  16235. *
  16236. * var array = [0, 1, 2],
  16237. * object = { 'a': array, 'b': array, 'c': array };
  16238. *
  16239. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16240. * // => [2, 0]
  16241. *
  16242. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16243. * // => [2, 0]
  16244. */
  16245. function propertyOf(object) {
  16246. return function(path) {
  16247. return object == null ? undefined : baseGet(object, path);
  16248. };
  16249. }
  16250. /**
  16251. * Creates an array of numbers (positive and/or negative) progressing from
  16252. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16253. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16254. * it's set to `start` with `start` then set to `0`.
  16255. *
  16256. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16257. * floating-point values which can produce unexpected results.
  16258. *
  16259. * @static
  16260. * @since 0.1.0
  16261. * @memberOf _
  16262. * @category Util
  16263. * @param {number} [start=0] The start of the range.
  16264. * @param {number} end The end of the range.
  16265. * @param {number} [step=1] The value to increment or decrement by.
  16266. * @returns {Array} Returns the range of numbers.
  16267. * @see _.inRange, _.rangeRight
  16268. * @example
  16269. *
  16270. * _.range(4);
  16271. * // => [0, 1, 2, 3]
  16272. *
  16273. * _.range(-4);
  16274. * // => [0, -1, -2, -3]
  16275. *
  16276. * _.range(1, 5);
  16277. * // => [1, 2, 3, 4]
  16278. *
  16279. * _.range(0, 20, 5);
  16280. * // => [0, 5, 10, 15]
  16281. *
  16282. * _.range(0, -4, -1);
  16283. * // => [0, -1, -2, -3]
  16284. *
  16285. * _.range(1, 4, 0);
  16286. * // => [1, 1, 1]
  16287. *
  16288. * _.range(0);
  16289. * // => []
  16290. */
  16291. var range = createRange();
  16292. /**
  16293. * This method is like `_.range` except that it populates values in
  16294. * descending order.
  16295. *
  16296. * @static
  16297. * @memberOf _
  16298. * @since 4.0.0
  16299. * @category Util
  16300. * @param {number} [start=0] The start of the range.
  16301. * @param {number} end The end of the range.
  16302. * @param {number} [step=1] The value to increment or decrement by.
  16303. * @returns {Array} Returns the range of numbers.
  16304. * @see _.inRange, _.range
  16305. * @example
  16306. *
  16307. * _.rangeRight(4);
  16308. * // => [3, 2, 1, 0]
  16309. *
  16310. * _.rangeRight(-4);
  16311. * // => [-3, -2, -1, 0]
  16312. *
  16313. * _.rangeRight(1, 5);
  16314. * // => [4, 3, 2, 1]
  16315. *
  16316. * _.rangeRight(0, 20, 5);
  16317. * // => [15, 10, 5, 0]
  16318. *
  16319. * _.rangeRight(0, -4, -1);
  16320. * // => [-3, -2, -1, 0]
  16321. *
  16322. * _.rangeRight(1, 4, 0);
  16323. * // => [1, 1, 1]
  16324. *
  16325. * _.rangeRight(0);
  16326. * // => []
  16327. */
  16328. var rangeRight = createRange(true);
  16329. /**
  16330. * This method returns a new empty array.
  16331. *
  16332. * @static
  16333. * @memberOf _
  16334. * @since 4.13.0
  16335. * @category Util
  16336. * @returns {Array} Returns the new empty array.
  16337. * @example
  16338. *
  16339. * var arrays = _.times(2, _.stubArray);
  16340. *
  16341. * console.log(arrays);
  16342. * // => [[], []]
  16343. *
  16344. * console.log(arrays[0] === arrays[1]);
  16345. * // => false
  16346. */
  16347. function stubArray() {
  16348. return [];
  16349. }
  16350. /**
  16351. * This method returns `false`.
  16352. *
  16353. * @static
  16354. * @memberOf _
  16355. * @since 4.13.0
  16356. * @category Util
  16357. * @returns {boolean} Returns `false`.
  16358. * @example
  16359. *
  16360. * _.times(2, _.stubFalse);
  16361. * // => [false, false]
  16362. */
  16363. function stubFalse() {
  16364. return false;
  16365. }
  16366. /**
  16367. * This method returns a new empty object.
  16368. *
  16369. * @static
  16370. * @memberOf _
  16371. * @since 4.13.0
  16372. * @category Util
  16373. * @returns {Object} Returns the new empty object.
  16374. * @example
  16375. *
  16376. * var objects = _.times(2, _.stubObject);
  16377. *
  16378. * console.log(objects);
  16379. * // => [{}, {}]
  16380. *
  16381. * console.log(objects[0] === objects[1]);
  16382. * // => false
  16383. */
  16384. function stubObject() {
  16385. return {};
  16386. }
  16387. /**
  16388. * This method returns an empty string.
  16389. *
  16390. * @static
  16391. * @memberOf _
  16392. * @since 4.13.0
  16393. * @category Util
  16394. * @returns {string} Returns the empty string.
  16395. * @example
  16396. *
  16397. * _.times(2, _.stubString);
  16398. * // => ['', '']
  16399. */
  16400. function stubString() {
  16401. return '';
  16402. }
  16403. /**
  16404. * This method returns `true`.
  16405. *
  16406. * @static
  16407. * @memberOf _
  16408. * @since 4.13.0
  16409. * @category Util
  16410. * @returns {boolean} Returns `true`.
  16411. * @example
  16412. *
  16413. * _.times(2, _.stubTrue);
  16414. * // => [true, true]
  16415. */
  16416. function stubTrue() {
  16417. return true;
  16418. }
  16419. /**
  16420. * Invokes the iteratee `n` times, returning an array of the results of
  16421. * each invocation. The iteratee is invoked with one argument; (index).
  16422. *
  16423. * @static
  16424. * @since 0.1.0
  16425. * @memberOf _
  16426. * @category Util
  16427. * @param {number} n The number of times to invoke `iteratee`.
  16428. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16429. * @returns {Array} Returns the array of results.
  16430. * @example
  16431. *
  16432. * _.times(3, String);
  16433. * // => ['0', '1', '2']
  16434. *
  16435. * _.times(4, _.constant(0));
  16436. * // => [0, 0, 0, 0]
  16437. */
  16438. function times(n, iteratee) {
  16439. n = toInteger(n);
  16440. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16441. return [];
  16442. }
  16443. var index = MAX_ARRAY_LENGTH,
  16444. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16445. iteratee = getIteratee(iteratee);
  16446. n -= MAX_ARRAY_LENGTH;
  16447. var result = baseTimes(length, iteratee);
  16448. while (++index < n) {
  16449. iteratee(index);
  16450. }
  16451. return result;
  16452. }
  16453. /**
  16454. * Converts `value` to a property path array.
  16455. *
  16456. * @static
  16457. * @memberOf _
  16458. * @since 4.0.0
  16459. * @category Util
  16460. * @param {*} value The value to convert.
  16461. * @returns {Array} Returns the new property path array.
  16462. * @example
  16463. *
  16464. * _.toPath('a.b.c');
  16465. * // => ['a', 'b', 'c']
  16466. *
  16467. * _.toPath('a[0].b.c');
  16468. * // => ['a', '0', 'b', 'c']
  16469. */
  16470. function toPath(value) {
  16471. if (isArray(value)) {
  16472. return arrayMap(value, toKey);
  16473. }
  16474. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16475. }
  16476. /**
  16477. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16478. *
  16479. * @static
  16480. * @since 0.1.0
  16481. * @memberOf _
  16482. * @category Util
  16483. * @param {string} [prefix=''] The value to prefix the ID with.
  16484. * @returns {string} Returns the unique ID.
  16485. * @example
  16486. *
  16487. * _.uniqueId('contact_');
  16488. * // => 'contact_104'
  16489. *
  16490. * _.uniqueId();
  16491. * // => '105'
  16492. */
  16493. function uniqueId(prefix) {
  16494. var id = ++idCounter;
  16495. return toString(prefix) + id;
  16496. }
  16497. /*------------------------------------------------------------------------*/
  16498. /**
  16499. * Adds two numbers.
  16500. *
  16501. * @static
  16502. * @memberOf _
  16503. * @since 3.4.0
  16504. * @category Math
  16505. * @param {number} augend The first number in an addition.
  16506. * @param {number} addend The second number in an addition.
  16507. * @returns {number} Returns the total.
  16508. * @example
  16509. *
  16510. * _.add(6, 4);
  16511. * // => 10
  16512. */
  16513. var add = createMathOperation(function(augend, addend) {
  16514. return augend + addend;
  16515. }, 0);
  16516. /**
  16517. * Computes `number` rounded up to `precision`.
  16518. *
  16519. * @static
  16520. * @memberOf _
  16521. * @since 3.10.0
  16522. * @category Math
  16523. * @param {number} number The number to round up.
  16524. * @param {number} [precision=0] The precision to round up to.
  16525. * @returns {number} Returns the rounded up number.
  16526. * @example
  16527. *
  16528. * _.ceil(4.006);
  16529. * // => 5
  16530. *
  16531. * _.ceil(6.004, 2);
  16532. * // => 6.01
  16533. *
  16534. * _.ceil(6040, -2);
  16535. * // => 6100
  16536. */
  16537. var ceil = createRound('ceil');
  16538. /**
  16539. * Divide two numbers.
  16540. *
  16541. * @static
  16542. * @memberOf _
  16543. * @since 4.7.0
  16544. * @category Math
  16545. * @param {number} dividend The first number in a division.
  16546. * @param {number} divisor The second number in a division.
  16547. * @returns {number} Returns the quotient.
  16548. * @example
  16549. *
  16550. * _.divide(6, 4);
  16551. * // => 1.5
  16552. */
  16553. var divide = createMathOperation(function(dividend, divisor) {
  16554. return dividend / divisor;
  16555. }, 1);
  16556. /**
  16557. * Computes `number` rounded down to `precision`.
  16558. *
  16559. * @static
  16560. * @memberOf _
  16561. * @since 3.10.0
  16562. * @category Math
  16563. * @param {number} number The number to round down.
  16564. * @param {number} [precision=0] The precision to round down to.
  16565. * @returns {number} Returns the rounded down number.
  16566. * @example
  16567. *
  16568. * _.floor(4.006);
  16569. * // => 4
  16570. *
  16571. * _.floor(0.046, 2);
  16572. * // => 0.04
  16573. *
  16574. * _.floor(4060, -2);
  16575. * // => 4000
  16576. */
  16577. var floor = createRound('floor');
  16578. /**
  16579. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16580. * `undefined` is returned.
  16581. *
  16582. * @static
  16583. * @since 0.1.0
  16584. * @memberOf _
  16585. * @category Math
  16586. * @param {Array} array The array to iterate over.
  16587. * @returns {*} Returns the maximum value.
  16588. * @example
  16589. *
  16590. * _.max([4, 2, 8, 6]);
  16591. * // => 8
  16592. *
  16593. * _.max([]);
  16594. * // => undefined
  16595. */
  16596. function max(array) {
  16597. return (array && array.length)
  16598. ? baseExtremum(array, identity, baseGt)
  16599. : undefined;
  16600. }
  16601. /**
  16602. * This method is like `_.max` except that it accepts `iteratee` which is
  16603. * invoked for each element in `array` to generate the criterion by which
  16604. * the value is ranked. The iteratee is invoked with one argument: (value).
  16605. *
  16606. * @static
  16607. * @memberOf _
  16608. * @since 4.0.0
  16609. * @category Math
  16610. * @param {Array} array The array to iterate over.
  16611. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16612. * @returns {*} Returns the maximum value.
  16613. * @example
  16614. *
  16615. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16616. *
  16617. * _.maxBy(objects, function(o) { return o.n; });
  16618. * // => { 'n': 2 }
  16619. *
  16620. * // The `_.property` iteratee shorthand.
  16621. * _.maxBy(objects, 'n');
  16622. * // => { 'n': 2 }
  16623. */
  16624. function maxBy(array, iteratee) {
  16625. return (array && array.length)
  16626. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16627. : undefined;
  16628. }
  16629. /**
  16630. * Computes the mean of the values in `array`.
  16631. *
  16632. * @static
  16633. * @memberOf _
  16634. * @since 4.0.0
  16635. * @category Math
  16636. * @param {Array} array The array to iterate over.
  16637. * @returns {number} Returns the mean.
  16638. * @example
  16639. *
  16640. * _.mean([4, 2, 8, 6]);
  16641. * // => 5
  16642. */
  16643. function mean(array) {
  16644. return baseMean(array, identity);
  16645. }
  16646. /**
  16647. * This method is like `_.mean` except that it accepts `iteratee` which is
  16648. * invoked for each element in `array` to generate the value to be averaged.
  16649. * The iteratee is invoked with one argument: (value).
  16650. *
  16651. * @static
  16652. * @memberOf _
  16653. * @since 4.7.0
  16654. * @category Math
  16655. * @param {Array} array The array to iterate over.
  16656. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16657. * @returns {number} Returns the mean.
  16658. * @example
  16659. *
  16660. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16661. *
  16662. * _.meanBy(objects, function(o) { return o.n; });
  16663. * // => 5
  16664. *
  16665. * // The `_.property` iteratee shorthand.
  16666. * _.meanBy(objects, 'n');
  16667. * // => 5
  16668. */
  16669. function meanBy(array, iteratee) {
  16670. return baseMean(array, getIteratee(iteratee, 2));
  16671. }
  16672. /**
  16673. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16674. * `undefined` is returned.
  16675. *
  16676. * @static
  16677. * @since 0.1.0
  16678. * @memberOf _
  16679. * @category Math
  16680. * @param {Array} array The array to iterate over.
  16681. * @returns {*} Returns the minimum value.
  16682. * @example
  16683. *
  16684. * _.min([4, 2, 8, 6]);
  16685. * // => 2
  16686. *
  16687. * _.min([]);
  16688. * // => undefined
  16689. */
  16690. function min(array) {
  16691. return (array && array.length)
  16692. ? baseExtremum(array, identity, baseLt)
  16693. : undefined;
  16694. }
  16695. /**
  16696. * This method is like `_.min` except that it accepts `iteratee` which is
  16697. * invoked for each element in `array` to generate the criterion by which
  16698. * the value is ranked. The iteratee is invoked with one argument: (value).
  16699. *
  16700. * @static
  16701. * @memberOf _
  16702. * @since 4.0.0
  16703. * @category Math
  16704. * @param {Array} array The array to iterate over.
  16705. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16706. * @returns {*} Returns the minimum value.
  16707. * @example
  16708. *
  16709. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16710. *
  16711. * _.minBy(objects, function(o) { return o.n; });
  16712. * // => { 'n': 1 }
  16713. *
  16714. * // The `_.property` iteratee shorthand.
  16715. * _.minBy(objects, 'n');
  16716. * // => { 'n': 1 }
  16717. */
  16718. function minBy(array, iteratee) {
  16719. return (array && array.length)
  16720. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16721. : undefined;
  16722. }
  16723. /**
  16724. * Multiply two numbers.
  16725. *
  16726. * @static
  16727. * @memberOf _
  16728. * @since 4.7.0
  16729. * @category Math
  16730. * @param {number} multiplier The first number in a multiplication.
  16731. * @param {number} multiplicand The second number in a multiplication.
  16732. * @returns {number} Returns the product.
  16733. * @example
  16734. *
  16735. * _.multiply(6, 4);
  16736. * // => 24
  16737. */
  16738. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16739. return multiplier * multiplicand;
  16740. }, 1);
  16741. /**
  16742. * Computes `number` rounded to `precision`.
  16743. *
  16744. * @static
  16745. * @memberOf _
  16746. * @since 3.10.0
  16747. * @category Math
  16748. * @param {number} number The number to round.
  16749. * @param {number} [precision=0] The precision to round to.
  16750. * @returns {number} Returns the rounded number.
  16751. * @example
  16752. *
  16753. * _.round(4.006);
  16754. * // => 4
  16755. *
  16756. * _.round(4.006, 2);
  16757. * // => 4.01
  16758. *
  16759. * _.round(4060, -2);
  16760. * // => 4100
  16761. */
  16762. var round = createRound('round');
  16763. /**
  16764. * Subtract two numbers.
  16765. *
  16766. * @static
  16767. * @memberOf _
  16768. * @since 4.0.0
  16769. * @category Math
  16770. * @param {number} minuend The first number in a subtraction.
  16771. * @param {number} subtrahend The second number in a subtraction.
  16772. * @returns {number} Returns the difference.
  16773. * @example
  16774. *
  16775. * _.subtract(6, 4);
  16776. * // => 2
  16777. */
  16778. var subtract = createMathOperation(function(minuend, subtrahend) {
  16779. return minuend - subtrahend;
  16780. }, 0);
  16781. /**
  16782. * Computes the sum of the values in `array`.
  16783. *
  16784. * @static
  16785. * @memberOf _
  16786. * @since 3.4.0
  16787. * @category Math
  16788. * @param {Array} array The array to iterate over.
  16789. * @returns {number} Returns the sum.
  16790. * @example
  16791. *
  16792. * _.sum([4, 2, 8, 6]);
  16793. * // => 20
  16794. */
  16795. function sum(array) {
  16796. return (array && array.length)
  16797. ? baseSum(array, identity)
  16798. : 0;
  16799. }
  16800. /**
  16801. * This method is like `_.sum` except that it accepts `iteratee` which is
  16802. * invoked for each element in `array` to generate the value to be summed.
  16803. * The iteratee is invoked with one argument: (value).
  16804. *
  16805. * @static
  16806. * @memberOf _
  16807. * @since 4.0.0
  16808. * @category Math
  16809. * @param {Array} array The array to iterate over.
  16810. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16811. * @returns {number} Returns the sum.
  16812. * @example
  16813. *
  16814. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16815. *
  16816. * _.sumBy(objects, function(o) { return o.n; });
  16817. * // => 20
  16818. *
  16819. * // The `_.property` iteratee shorthand.
  16820. * _.sumBy(objects, 'n');
  16821. * // => 20
  16822. */
  16823. function sumBy(array, iteratee) {
  16824. return (array && array.length)
  16825. ? baseSum(array, getIteratee(iteratee, 2))
  16826. : 0;
  16827. }
  16828. /*------------------------------------------------------------------------*/
  16829. // Add methods that return wrapped values in chain sequences.
  16830. lodash.after = after;
  16831. lodash.ary = ary;
  16832. lodash.assign = assign;
  16833. lodash.assignIn = assignIn;
  16834. lodash.assignInWith = assignInWith;
  16835. lodash.assignWith = assignWith;
  16836. lodash.at = at;
  16837. lodash.before = before;
  16838. lodash.bind = bind;
  16839. lodash.bindAll = bindAll;
  16840. lodash.bindKey = bindKey;
  16841. lodash.castArray = castArray;
  16842. lodash.chain = chain;
  16843. lodash.chunk = chunk;
  16844. lodash.compact = compact;
  16845. lodash.concat = concat;
  16846. lodash.cond = cond;
  16847. lodash.conforms = conforms;
  16848. lodash.constant = constant;
  16849. lodash.countBy = countBy;
  16850. lodash.create = create;
  16851. lodash.curry = curry;
  16852. lodash.curryRight = curryRight;
  16853. lodash.debounce = debounce;
  16854. lodash.defaults = defaults;
  16855. lodash.defaultsDeep = defaultsDeep;
  16856. lodash.defer = defer;
  16857. lodash.delay = delay;
  16858. lodash.difference = difference;
  16859. lodash.differenceBy = differenceBy;
  16860. lodash.differenceWith = differenceWith;
  16861. lodash.drop = drop;
  16862. lodash.dropRight = dropRight;
  16863. lodash.dropRightWhile = dropRightWhile;
  16864. lodash.dropWhile = dropWhile;
  16865. lodash.fill = fill;
  16866. lodash.filter = filter;
  16867. lodash.flatMap = flatMap;
  16868. lodash.flatMapDeep = flatMapDeep;
  16869. lodash.flatMapDepth = flatMapDepth;
  16870. lodash.flatten = flatten;
  16871. lodash.flattenDeep = flattenDeep;
  16872. lodash.flattenDepth = flattenDepth;
  16873. lodash.flip = flip;
  16874. lodash.flow = flow;
  16875. lodash.flowRight = flowRight;
  16876. lodash.fromPairs = fromPairs;
  16877. lodash.functions = functions;
  16878. lodash.functionsIn = functionsIn;
  16879. lodash.groupBy = groupBy;
  16880. lodash.initial = initial;
  16881. lodash.intersection = intersection;
  16882. lodash.intersectionBy = intersectionBy;
  16883. lodash.intersectionWith = intersectionWith;
  16884. lodash.invert = invert;
  16885. lodash.invertBy = invertBy;
  16886. lodash.invokeMap = invokeMap;
  16887. lodash.iteratee = iteratee;
  16888. lodash.keyBy = keyBy;
  16889. lodash.keys = keys;
  16890. lodash.keysIn = keysIn;
  16891. lodash.map = map;
  16892. lodash.mapKeys = mapKeys;
  16893. lodash.mapValues = mapValues;
  16894. lodash.matches = matches;
  16895. lodash.matchesProperty = matchesProperty;
  16896. lodash.memoize = memoize;
  16897. lodash.merge = merge;
  16898. lodash.mergeWith = mergeWith;
  16899. lodash.method = method;
  16900. lodash.methodOf = methodOf;
  16901. lodash.mixin = mixin;
  16902. lodash.negate = negate;
  16903. lodash.nthArg = nthArg;
  16904. lodash.omit = omit;
  16905. lodash.omitBy = omitBy;
  16906. lodash.once = once;
  16907. lodash.orderBy = orderBy;
  16908. lodash.over = over;
  16909. lodash.overArgs = overArgs;
  16910. lodash.overEvery = overEvery;
  16911. lodash.overSome = overSome;
  16912. lodash.partial = partial;
  16913. lodash.partialRight = partialRight;
  16914. lodash.partition = partition;
  16915. lodash.pick = pick;
  16916. lodash.pickBy = pickBy;
  16917. lodash.property = property;
  16918. lodash.propertyOf = propertyOf;
  16919. lodash.pull = pull;
  16920. lodash.pullAll = pullAll;
  16921. lodash.pullAllBy = pullAllBy;
  16922. lodash.pullAllWith = pullAllWith;
  16923. lodash.pullAt = pullAt;
  16924. lodash.range = range;
  16925. lodash.rangeRight = rangeRight;
  16926. lodash.rearg = rearg;
  16927. lodash.reject = reject;
  16928. lodash.remove = remove;
  16929. lodash.rest = rest;
  16930. lodash.reverse = reverse;
  16931. lodash.sampleSize = sampleSize;
  16932. lodash.set = set;
  16933. lodash.setWith = setWith;
  16934. lodash.shuffle = shuffle;
  16935. lodash.slice = slice;
  16936. lodash.sortBy = sortBy;
  16937. lodash.sortedUniq = sortedUniq;
  16938. lodash.sortedUniqBy = sortedUniqBy;
  16939. lodash.split = split;
  16940. lodash.spread = spread;
  16941. lodash.tail = tail;
  16942. lodash.take = take;
  16943. lodash.takeRight = takeRight;
  16944. lodash.takeRightWhile = takeRightWhile;
  16945. lodash.takeWhile = takeWhile;
  16946. lodash.tap = tap;
  16947. lodash.throttle = throttle;
  16948. lodash.thru = thru;
  16949. lodash.toArray = toArray;
  16950. lodash.toPairs = toPairs;
  16951. lodash.toPairsIn = toPairsIn;
  16952. lodash.toPath = toPath;
  16953. lodash.toPlainObject = toPlainObject;
  16954. lodash.transform = transform;
  16955. lodash.unary = unary;
  16956. lodash.union = union;
  16957. lodash.unionBy = unionBy;
  16958. lodash.unionWith = unionWith;
  16959. lodash.uniq = uniq;
  16960. lodash.uniqBy = uniqBy;
  16961. lodash.uniqWith = uniqWith;
  16962. lodash.unset = unset;
  16963. lodash.unzip = unzip;
  16964. lodash.unzipWith = unzipWith;
  16965. lodash.update = update;
  16966. lodash.updateWith = updateWith;
  16967. lodash.values = values;
  16968. lodash.valuesIn = valuesIn;
  16969. lodash.without = without;
  16970. lodash.words = words;
  16971. lodash.wrap = wrap;
  16972. lodash.xor = xor;
  16973. lodash.xorBy = xorBy;
  16974. lodash.xorWith = xorWith;
  16975. lodash.zip = zip;
  16976. lodash.zipObject = zipObject;
  16977. lodash.zipObjectDeep = zipObjectDeep;
  16978. lodash.zipWith = zipWith;
  16979. // Add aliases.
  16980. lodash.entries = toPairs;
  16981. lodash.entriesIn = toPairsIn;
  16982. lodash.extend = assignIn;
  16983. lodash.extendWith = assignInWith;
  16984. // Add methods to `lodash.prototype`.
  16985. mixin(lodash, lodash);
  16986. /*------------------------------------------------------------------------*/
  16987. // Add methods that return unwrapped values in chain sequences.
  16988. lodash.add = add;
  16989. lodash.attempt = attempt;
  16990. lodash.camelCase = camelCase;
  16991. lodash.capitalize = capitalize;
  16992. lodash.ceil = ceil;
  16993. lodash.clamp = clamp;
  16994. lodash.clone = clone;
  16995. lodash.cloneDeep = cloneDeep;
  16996. lodash.cloneDeepWith = cloneDeepWith;
  16997. lodash.cloneWith = cloneWith;
  16998. lodash.conformsTo = conformsTo;
  16999. lodash.deburr = deburr;
  17000. lodash.defaultTo = defaultTo;
  17001. lodash.divide = divide;
  17002. lodash.endsWith = endsWith;
  17003. lodash.eq = eq;
  17004. lodash.escape = escape;
  17005. lodash.escapeRegExp = escapeRegExp;
  17006. lodash.every = every;
  17007. lodash.find = find;
  17008. lodash.findIndex = findIndex;
  17009. lodash.findKey = findKey;
  17010. lodash.findLast = findLast;
  17011. lodash.findLastIndex = findLastIndex;
  17012. lodash.findLastKey = findLastKey;
  17013. lodash.floor = floor;
  17014. lodash.forEach = forEach;
  17015. lodash.forEachRight = forEachRight;
  17016. lodash.forIn = forIn;
  17017. lodash.forInRight = forInRight;
  17018. lodash.forOwn = forOwn;
  17019. lodash.forOwnRight = forOwnRight;
  17020. lodash.get = get;
  17021. lodash.gt = gt;
  17022. lodash.gte = gte;
  17023. lodash.has = has;
  17024. lodash.hasIn = hasIn;
  17025. lodash.head = head;
  17026. lodash.identity = identity;
  17027. lodash.includes = includes;
  17028. lodash.indexOf = indexOf;
  17029. lodash.inRange = inRange;
  17030. lodash.invoke = invoke;
  17031. lodash.isArguments = isArguments;
  17032. lodash.isArray = isArray;
  17033. lodash.isArrayBuffer = isArrayBuffer;
  17034. lodash.isArrayLike = isArrayLike;
  17035. lodash.isArrayLikeObject = isArrayLikeObject;
  17036. lodash.isBoolean = isBoolean;
  17037. lodash.isBuffer = isBuffer;
  17038. lodash.isDate = isDate;
  17039. lodash.isElement = isElement;
  17040. lodash.isEmpty = isEmpty;
  17041. lodash.isEqual = isEqual;
  17042. lodash.isEqualWith = isEqualWith;
  17043. lodash.isError = isError;
  17044. lodash.isFinite = isFinite;
  17045. lodash.isFunction = isFunction;
  17046. lodash.isInteger = isInteger;
  17047. lodash.isLength = isLength;
  17048. lodash.isMap = isMap;
  17049. lodash.isMatch = isMatch;
  17050. lodash.isMatchWith = isMatchWith;
  17051. lodash.isNaN = isNaN;
  17052. lodash.isNative = isNative;
  17053. lodash.isNil = isNil;
  17054. lodash.isNull = isNull;
  17055. lodash.isNumber = isNumber;
  17056. lodash.isObject = isObject;
  17057. lodash.isObjectLike = isObjectLike;
  17058. lodash.isPlainObject = isPlainObject;
  17059. lodash.isRegExp = isRegExp;
  17060. lodash.isSafeInteger = isSafeInteger;
  17061. lodash.isSet = isSet;
  17062. lodash.isString = isString;
  17063. lodash.isSymbol = isSymbol;
  17064. lodash.isTypedArray = isTypedArray;
  17065. lodash.isUndefined = isUndefined;
  17066. lodash.isWeakMap = isWeakMap;
  17067. lodash.isWeakSet = isWeakSet;
  17068. lodash.join = join;
  17069. lodash.kebabCase = kebabCase;
  17070. lodash.last = last;
  17071. lodash.lastIndexOf = lastIndexOf;
  17072. lodash.lowerCase = lowerCase;
  17073. lodash.lowerFirst = lowerFirst;
  17074. lodash.lt = lt;
  17075. lodash.lte = lte;
  17076. lodash.max = max;
  17077. lodash.maxBy = maxBy;
  17078. lodash.mean = mean;
  17079. lodash.meanBy = meanBy;
  17080. lodash.min = min;
  17081. lodash.minBy = minBy;
  17082. lodash.stubArray = stubArray;
  17083. lodash.stubFalse = stubFalse;
  17084. lodash.stubObject = stubObject;
  17085. lodash.stubString = stubString;
  17086. lodash.stubTrue = stubTrue;
  17087. lodash.multiply = multiply;
  17088. lodash.nth = nth;
  17089. lodash.noConflict = noConflict;
  17090. lodash.noop = noop;
  17091. lodash.now = now;
  17092. lodash.pad = pad;
  17093. lodash.padEnd = padEnd;
  17094. lodash.padStart = padStart;
  17095. lodash.parseInt = parseInt;
  17096. lodash.random = random;
  17097. lodash.reduce = reduce;
  17098. lodash.reduceRight = reduceRight;
  17099. lodash.repeat = repeat;
  17100. lodash.replace = replace;
  17101. lodash.result = result;
  17102. lodash.round = round;
  17103. lodash.runInContext = runInContext;
  17104. lodash.sample = sample;
  17105. lodash.size = size;
  17106. lodash.snakeCase = snakeCase;
  17107. lodash.some = some;
  17108. lodash.sortedIndex = sortedIndex;
  17109. lodash.sortedIndexBy = sortedIndexBy;
  17110. lodash.sortedIndexOf = sortedIndexOf;
  17111. lodash.sortedLastIndex = sortedLastIndex;
  17112. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17113. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17114. lodash.startCase = startCase;
  17115. lodash.startsWith = startsWith;
  17116. lodash.subtract = subtract;
  17117. lodash.sum = sum;
  17118. lodash.sumBy = sumBy;
  17119. lodash.template = template;
  17120. lodash.times = times;
  17121. lodash.toFinite = toFinite;
  17122. lodash.toInteger = toInteger;
  17123. lodash.toLength = toLength;
  17124. lodash.toLower = toLower;
  17125. lodash.toNumber = toNumber;
  17126. lodash.toSafeInteger = toSafeInteger;
  17127. lodash.toString = toString;
  17128. lodash.toUpper = toUpper;
  17129. lodash.trim = trim;
  17130. lodash.trimEnd = trimEnd;
  17131. lodash.trimStart = trimStart;
  17132. lodash.truncate = truncate;
  17133. lodash.unescape = unescape;
  17134. lodash.uniqueId = uniqueId;
  17135. lodash.upperCase = upperCase;
  17136. lodash.upperFirst = upperFirst;
  17137. // Add aliases.
  17138. lodash.each = forEach;
  17139. lodash.eachRight = forEachRight;
  17140. lodash.first = head;
  17141. mixin(lodash, (function() {
  17142. var source = {};
  17143. baseForOwn(lodash, function(func, methodName) {
  17144. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17145. source[methodName] = func;
  17146. }
  17147. });
  17148. return source;
  17149. }()), { 'chain': false });
  17150. /*------------------------------------------------------------------------*/
  17151. /**
  17152. * The semantic version number.
  17153. *
  17154. * @static
  17155. * @memberOf _
  17156. * @type {string}
  17157. */
  17158. lodash.VERSION = VERSION;
  17159. // Assign default placeholders.
  17160. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17161. lodash[methodName].placeholder = lodash;
  17162. });
  17163. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17164. arrayEach(['drop', 'take'], function(methodName, index) {
  17165. LazyWrapper.prototype[methodName] = function(n) {
  17166. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17167. var result = (this.__filtered__ && !index)
  17168. ? new LazyWrapper(this)
  17169. : this.clone();
  17170. if (result.__filtered__) {
  17171. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17172. } else {
  17173. result.__views__.push({
  17174. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17175. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17176. });
  17177. }
  17178. return result;
  17179. };
  17180. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17181. return this.reverse()[methodName](n).reverse();
  17182. };
  17183. });
  17184. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17185. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17186. var type = index + 1,
  17187. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17188. LazyWrapper.prototype[methodName] = function(iteratee) {
  17189. var result = this.clone();
  17190. result.__iteratees__.push({
  17191. 'iteratee': getIteratee(iteratee, 3),
  17192. 'type': type
  17193. });
  17194. result.__filtered__ = result.__filtered__ || isFilter;
  17195. return result;
  17196. };
  17197. });
  17198. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17199. arrayEach(['head', 'last'], function(methodName, index) {
  17200. var takeName = 'take' + (index ? 'Right' : '');
  17201. LazyWrapper.prototype[methodName] = function() {
  17202. return this[takeName](1).value()[0];
  17203. };
  17204. });
  17205. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17206. arrayEach(['initial', 'tail'], function(methodName, index) {
  17207. var dropName = 'drop' + (index ? '' : 'Right');
  17208. LazyWrapper.prototype[methodName] = function() {
  17209. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17210. };
  17211. });
  17212. LazyWrapper.prototype.compact = function() {
  17213. return this.filter(identity);
  17214. };
  17215. LazyWrapper.prototype.find = function(predicate) {
  17216. return this.filter(predicate).head();
  17217. };
  17218. LazyWrapper.prototype.findLast = function(predicate) {
  17219. return this.reverse().find(predicate);
  17220. };
  17221. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17222. if (typeof path == 'function') {
  17223. return new LazyWrapper(this);
  17224. }
  17225. return this.map(function(value) {
  17226. return baseInvoke(value, path, args);
  17227. });
  17228. });
  17229. LazyWrapper.prototype.reject = function(predicate) {
  17230. return this.filter(negate(getIteratee(predicate)));
  17231. };
  17232. LazyWrapper.prototype.slice = function(start, end) {
  17233. start = toInteger(start);
  17234. var result = this;
  17235. if (result.__filtered__ && (start > 0 || end < 0)) {
  17236. return new LazyWrapper(result);
  17237. }
  17238. if (start < 0) {
  17239. result = result.takeRight(-start);
  17240. } else if (start) {
  17241. result = result.drop(start);
  17242. }
  17243. if (end !== undefined) {
  17244. end = toInteger(end);
  17245. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17246. }
  17247. return result;
  17248. };
  17249. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17250. return this.reverse().takeWhile(predicate).reverse();
  17251. };
  17252. LazyWrapper.prototype.toArray = function() {
  17253. return this.take(MAX_ARRAY_LENGTH);
  17254. };
  17255. // Add `LazyWrapper` methods to `lodash.prototype`.
  17256. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17257. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17258. isTaker = /^(?:head|last)$/.test(methodName),
  17259. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17260. retUnwrapped = isTaker || /^find/.test(methodName);
  17261. if (!lodashFunc) {
  17262. return;
  17263. }
  17264. lodash.prototype[methodName] = function() {
  17265. var value = this.__wrapped__,
  17266. args = isTaker ? [1] : arguments,
  17267. isLazy = value instanceof LazyWrapper,
  17268. iteratee = args[0],
  17269. useLazy = isLazy || isArray(value);
  17270. var interceptor = function(value) {
  17271. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17272. return (isTaker && chainAll) ? result[0] : result;
  17273. };
  17274. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17275. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17276. isLazy = useLazy = false;
  17277. }
  17278. var chainAll = this.__chain__,
  17279. isHybrid = !!this.__actions__.length,
  17280. isUnwrapped = retUnwrapped && !chainAll,
  17281. onlyLazy = isLazy && !isHybrid;
  17282. if (!retUnwrapped && useLazy) {
  17283. value = onlyLazy ? value : new LazyWrapper(this);
  17284. var result = func.apply(value, args);
  17285. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17286. return new LodashWrapper(result, chainAll);
  17287. }
  17288. if (isUnwrapped && onlyLazy) {
  17289. return func.apply(this, args);
  17290. }
  17291. result = this.thru(interceptor);
  17292. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17293. };
  17294. });
  17295. // Add `Array` methods to `lodash.prototype`.
  17296. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17297. var func = arrayProto[methodName],
  17298. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17299. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17300. lodash.prototype[methodName] = function() {
  17301. var args = arguments;
  17302. if (retUnwrapped && !this.__chain__) {
  17303. var value = this.value();
  17304. return func.apply(isArray(value) ? value : [], args);
  17305. }
  17306. return this[chainName](function(value) {
  17307. return func.apply(isArray(value) ? value : [], args);
  17308. });
  17309. };
  17310. });
  17311. // Map minified method names to their real names.
  17312. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17313. var lodashFunc = lodash[methodName];
  17314. if (lodashFunc) {
  17315. var key = lodashFunc.name + '';
  17316. if (!hasOwnProperty.call(realNames, key)) {
  17317. realNames[key] = [];
  17318. }
  17319. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17320. }
  17321. });
  17322. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17323. 'name': 'wrapper',
  17324. 'func': undefined
  17325. }];
  17326. // Add methods to `LazyWrapper`.
  17327. LazyWrapper.prototype.clone = lazyClone;
  17328. LazyWrapper.prototype.reverse = lazyReverse;
  17329. LazyWrapper.prototype.value = lazyValue;
  17330. // Add chain sequence methods to the `lodash` wrapper.
  17331. lodash.prototype.at = wrapperAt;
  17332. lodash.prototype.chain = wrapperChain;
  17333. lodash.prototype.commit = wrapperCommit;
  17334. lodash.prototype.next = wrapperNext;
  17335. lodash.prototype.plant = wrapperPlant;
  17336. lodash.prototype.reverse = wrapperReverse;
  17337. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17338. // Add lazy aliases.
  17339. lodash.prototype.first = lodash.prototype.head;
  17340. if (symIterator) {
  17341. lodash.prototype[symIterator] = wrapperToIterator;
  17342. }
  17343. return lodash;
  17344. });
  17345. /*--------------------------------------------------------------------------*/
  17346. // Export lodash.
  17347. var _ = runInContext();
  17348. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17349. if (true) {
  17350. // Expose Lodash on the global object to prevent errors when Lodash is
  17351. // loaded by a script tag in the presence of an AMD loader.
  17352. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17353. // Use `_.noConflict` to remove Lodash from the global object.
  17354. root._ = _;
  17355. // Define as an anonymous module so, through path mapping, it can be
  17356. // referenced as the "underscore" module.
  17357. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17358. return _;
  17359. }).call(exports, __webpack_require__, exports, module),
  17360. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17361. }
  17362. // Check for `exports` after `define` in case a build optimizer adds it.
  17363. else {}
  17364. }.call(this));
  17365. /***/ }),
  17366. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17367. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17368. !*** ./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 ***!
  17369. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17370. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17371. "use strict";
  17372. __webpack_require__.r(__webpack_exports__);
  17373. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17374. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17375. /* harmony export */ });
  17376. /* 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");
  17377. /* 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__);
  17378. /* 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");
  17379. var options = {};
  17380. options.insert = "head";
  17381. options.singleton = false;
  17382. 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);
  17383. /* 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 || {});
  17384. /***/ }),
  17385. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17386. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17387. !*** ./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 ***!
  17388. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17389. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17390. "use strict";
  17391. __webpack_require__.r(__webpack_exports__);
  17392. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17393. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17394. /* harmony export */ });
  17395. /* 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");
  17396. /* 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__);
  17397. /* 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");
  17398. var options = {};
  17399. options.insert = "head";
  17400. options.singleton = false;
  17401. 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);
  17402. /* 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 || {});
  17403. /***/ }),
  17404. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17405. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17406. !*** ./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 ***!
  17407. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17408. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17409. "use strict";
  17410. __webpack_require__.r(__webpack_exports__);
  17411. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17412. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17413. /* harmony export */ });
  17414. /* 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");
  17415. /* 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__);
  17416. /* 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");
  17417. var options = {};
  17418. options.insert = "head";
  17419. options.singleton = false;
  17420. 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);
  17421. /* 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 || {});
  17422. /***/ }),
  17423. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17424. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17425. !*** ./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 ***!
  17426. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17427. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17428. "use strict";
  17429. __webpack_require__.r(__webpack_exports__);
  17430. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17431. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17432. /* harmony export */ });
  17433. /* 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");
  17434. /* 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__);
  17435. /* 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");
  17436. var options = {};
  17437. options.insert = "head";
  17438. options.singleton = false;
  17439. 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);
  17440. /* 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 || {});
  17441. /***/ }),
  17442. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17443. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17444. !*** ./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 ***!
  17445. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17446. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17447. "use strict";
  17448. __webpack_require__.r(__webpack_exports__);
  17449. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17450. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17451. /* harmony export */ });
  17452. /* 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");
  17453. /* 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__);
  17454. /* 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");
  17455. var options = {};
  17456. options.insert = "head";
  17457. options.singleton = false;
  17458. 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);
  17459. /* 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 || {});
  17460. /***/ }),
  17461. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17462. /*!******************************************************!*\
  17463. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17464. \******************************************************/
  17465. /***/ ((__unused_webpack_module, exports) => {
  17466. "use strict";
  17467. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17468. // runtime helper for setting properties on components
  17469. // in a tree-shakable way
  17470. exports["default"] = (sfc, props) => {
  17471. const target = sfc.__vccOpts || sfc;
  17472. for (const [key, val] of props) {
  17473. target[key] = val;
  17474. }
  17475. return target;
  17476. };
  17477. /***/ }),
  17478. /***/ "./resources/js/components/AppButtonLink.vue":
  17479. /*!***************************************************!*\
  17480. !*** ./resources/js/components/AppButtonLink.vue ***!
  17481. \***************************************************/
  17482. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17483. "use strict";
  17484. __webpack_require__.r(__webpack_exports__);
  17485. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17486. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17487. /* harmony export */ });
  17488. /* 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");
  17489. /* 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");
  17490. /* 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");
  17491. ;
  17492. 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"]])
  17493. /* hot reload */
  17494. if (false) {}
  17495. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17496. /***/ }),
  17497. /***/ "./resources/js/components/AppFooter.vue":
  17498. /*!***********************************************!*\
  17499. !*** ./resources/js/components/AppFooter.vue ***!
  17500. \***********************************************/
  17501. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17502. "use strict";
  17503. __webpack_require__.r(__webpack_exports__);
  17504. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17505. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17506. /* harmony export */ });
  17507. /* 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");
  17508. /* 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");
  17509. /* 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");
  17510. const script = {}
  17511. ;
  17512. 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"]])
  17513. /* hot reload */
  17514. if (false) {}
  17515. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17516. /***/ }),
  17517. /***/ "./resources/js/components/AppMessage.vue":
  17518. /*!************************************************!*\
  17519. !*** ./resources/js/components/AppMessage.vue ***!
  17520. \************************************************/
  17521. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17522. "use strict";
  17523. __webpack_require__.r(__webpack_exports__);
  17524. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17525. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17526. /* harmony export */ });
  17527. /* 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");
  17528. /* 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");
  17529. /* 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");
  17530. ;
  17531. 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"]])
  17532. /* hot reload */
  17533. if (false) {}
  17534. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17535. /***/ }),
  17536. /***/ "./resources/js/components/AppPagination.vue":
  17537. /*!***************************************************!*\
  17538. !*** ./resources/js/components/AppPagination.vue ***!
  17539. \***************************************************/
  17540. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17541. "use strict";
  17542. __webpack_require__.r(__webpack_exports__);
  17543. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17544. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17545. /* harmony export */ });
  17546. /* 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");
  17547. /* 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");
  17548. /* 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");
  17549. ;
  17550. 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"]])
  17551. /* hot reload */
  17552. if (false) {}
  17553. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17554. /***/ }),
  17555. /***/ "./resources/js/components/AppSidebar.vue":
  17556. /*!************************************************!*\
  17557. !*** ./resources/js/components/AppSidebar.vue ***!
  17558. \************************************************/
  17559. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17560. "use strict";
  17561. __webpack_require__.r(__webpack_exports__);
  17562. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17563. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17564. /* harmony export */ });
  17565. /* 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");
  17566. /* 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");
  17567. /* 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");
  17568. /* 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");
  17569. ;
  17570. 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"]])
  17571. /* hot reload */
  17572. if (false) {}
  17573. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17574. /***/ }),
  17575. /***/ "./resources/js/components/AppSubSidebar.vue":
  17576. /*!***************************************************!*\
  17577. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17578. \***************************************************/
  17579. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17580. "use strict";
  17581. __webpack_require__.r(__webpack_exports__);
  17582. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17583. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17584. /* harmony export */ });
  17585. /* 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");
  17586. /* 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");
  17587. /* 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");
  17588. /* 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");
  17589. ;
  17590. 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"]])
  17591. /* hot reload */
  17592. if (false) {}
  17593. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17594. /***/ }),
  17595. /***/ "./resources/js/components/AppTopBar.vue":
  17596. /*!***********************************************!*\
  17597. !*** ./resources/js/components/AppTopBar.vue ***!
  17598. \***********************************************/
  17599. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17600. "use strict";
  17601. __webpack_require__.r(__webpack_exports__);
  17602. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17603. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17604. /* harmony export */ });
  17605. /* 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");
  17606. /* 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");
  17607. /* 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");
  17608. /* 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");
  17609. ;
  17610. 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"]])
  17611. /* hot reload */
  17612. if (false) {}
  17613. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17614. /***/ }),
  17615. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17616. /*!**************************************************!*\
  17617. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17618. \**************************************************/
  17619. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17620. "use strict";
  17621. __webpack_require__.r(__webpack_exports__);
  17622. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17623. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17624. /* harmony export */ });
  17625. /* 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");
  17626. /* 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");
  17627. /* 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");
  17628. /* 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");
  17629. ;
  17630. 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"]])
  17631. /* hot reload */
  17632. if (false) {}
  17633. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17634. /***/ }),
  17635. /***/ "./resources/js/pages/expense/Index.vue":
  17636. /*!**********************************************!*\
  17637. !*** ./resources/js/pages/expense/Index.vue ***!
  17638. \**********************************************/
  17639. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17640. "use strict";
  17641. __webpack_require__.r(__webpack_exports__);
  17642. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17643. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17644. /* harmony export */ });
  17645. /* 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");
  17646. /* 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");
  17647. /* 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");
  17648. ;
  17649. 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"]])
  17650. /* hot reload */
  17651. if (false) {}
  17652. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17653. /***/ }),
  17654. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17655. /*!**************************************************************************************!*\
  17656. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17657. \**************************************************************************************/
  17658. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17659. "use strict";
  17660. __webpack_require__.r(__webpack_exports__);
  17661. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17662. /* 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"])
  17663. /* harmony export */ });
  17664. /* 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");
  17665. /***/ }),
  17666. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17667. /*!***********************************************************************************!*\
  17668. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17669. \***********************************************************************************/
  17670. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17671. "use strict";
  17672. __webpack_require__.r(__webpack_exports__);
  17673. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17674. /* 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"])
  17675. /* harmony export */ });
  17676. /* 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");
  17677. /***/ }),
  17678. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17679. /*!**************************************************************************************!*\
  17680. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17681. \**************************************************************************************/
  17682. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17683. "use strict";
  17684. __webpack_require__.r(__webpack_exports__);
  17685. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17686. /* 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"])
  17687. /* harmony export */ });
  17688. /* 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");
  17689. /***/ }),
  17690. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17691. /*!***********************************************************************************!*\
  17692. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17693. \***********************************************************************************/
  17694. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17695. "use strict";
  17696. __webpack_require__.r(__webpack_exports__);
  17697. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17698. /* 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"])
  17699. /* harmony export */ });
  17700. /* 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");
  17701. /***/ }),
  17702. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17703. /*!**************************************************************************************!*\
  17704. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17705. \**************************************************************************************/
  17706. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17707. "use strict";
  17708. __webpack_require__.r(__webpack_exports__);
  17709. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17710. /* 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"])
  17711. /* harmony export */ });
  17712. /* 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");
  17713. /***/ }),
  17714. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17715. /*!**********************************************************************************!*\
  17716. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17717. \**********************************************************************************/
  17718. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17719. "use strict";
  17720. __webpack_require__.r(__webpack_exports__);
  17721. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17722. /* 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"])
  17723. /* harmony export */ });
  17724. /* 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");
  17725. /***/ }),
  17726. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17727. /*!*************************************************************************************!*\
  17728. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17729. \*************************************************************************************/
  17730. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17731. "use strict";
  17732. __webpack_require__.r(__webpack_exports__);
  17733. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17734. /* 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"])
  17735. /* harmony export */ });
  17736. /* 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");
  17737. /***/ }),
  17738. /***/ "./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js":
  17739. /*!*********************************************************************************!*\
  17740. !*** ./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js ***!
  17741. \*********************************************************************************/
  17742. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17743. "use strict";
  17744. __webpack_require__.r(__webpack_exports__);
  17745. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17746. /* 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"])
  17747. /* harmony export */ });
  17748. /* 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");
  17749. /***/ }),
  17750. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17751. /*!*********************************************************************************!*\
  17752. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17753. \*********************************************************************************/
  17754. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17755. "use strict";
  17756. __webpack_require__.r(__webpack_exports__);
  17757. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17758. /* 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)
  17759. /* harmony export */ });
  17760. /* 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");
  17761. /***/ }),
  17762. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17763. /*!*****************************************************************************************!*\
  17764. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17765. \*****************************************************************************************/
  17766. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17767. "use strict";
  17768. __webpack_require__.r(__webpack_exports__);
  17769. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17770. /* 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)
  17771. /* harmony export */ });
  17772. /* 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");
  17773. /***/ }),
  17774. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17775. /*!******************************************************************************!*\
  17776. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17777. \******************************************************************************/
  17778. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17779. "use strict";
  17780. __webpack_require__.r(__webpack_exports__);
  17781. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17782. /* 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)
  17783. /* harmony export */ });
  17784. /* 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");
  17785. /***/ }),
  17786. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17787. /*!*********************************************************************************!*\
  17788. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17789. \*********************************************************************************/
  17790. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17791. "use strict";
  17792. __webpack_require__.r(__webpack_exports__);
  17793. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17794. /* 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)
  17795. /* harmony export */ });
  17796. /* 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");
  17797. /***/ }),
  17798. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17799. /*!******************************************************************************************!*\
  17800. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17801. \******************************************************************************************/
  17802. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17803. "use strict";
  17804. __webpack_require__.r(__webpack_exports__);
  17805. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17806. /* 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)
  17807. /* harmony export */ });
  17808. /* 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");
  17809. /***/ }),
  17810. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17811. /*!*********************************************************************************************!*\
  17812. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17813. \*********************************************************************************************/
  17814. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17815. "use strict";
  17816. __webpack_require__.r(__webpack_exports__);
  17817. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17818. /* 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)
  17819. /* harmony export */ });
  17820. /* 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");
  17821. /***/ }),
  17822. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17823. /*!*****************************************************************************************!*\
  17824. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17825. \*****************************************************************************************/
  17826. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17827. "use strict";
  17828. __webpack_require__.r(__webpack_exports__);
  17829. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17830. /* 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)
  17831. /* harmony export */ });
  17832. /* 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");
  17833. /***/ }),
  17834. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17835. /*!********************************************************************************************!*\
  17836. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17837. \********************************************************************************************/
  17838. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17839. "use strict";
  17840. __webpack_require__.r(__webpack_exports__);
  17841. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17842. /* 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)
  17843. /* harmony export */ });
  17844. /* 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");
  17845. /***/ }),
  17846. /***/ "./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822":
  17847. /*!****************************************************************************!*\
  17848. !*** ./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822 ***!
  17849. \****************************************************************************/
  17850. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17851. "use strict";
  17852. __webpack_require__.r(__webpack_exports__);
  17853. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17854. /* 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)
  17855. /* harmony export */ });
  17856. /* 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");
  17857. /***/ }),
  17858. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17859. /*!********************************************************************************************************!*\
  17860. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17861. \********************************************************************************************************/
  17862. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17863. "use strict";
  17864. __webpack_require__.r(__webpack_exports__);
  17865. /* 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");
  17866. /***/ }),
  17867. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17868. /*!*********************************************************************************************************!*\
  17869. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17870. \*********************************************************************************************************/
  17871. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17872. "use strict";
  17873. __webpack_require__.r(__webpack_exports__);
  17874. /* 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");
  17875. /***/ }),
  17876. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17877. /*!************************************************************************************************************!*\
  17878. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17879. \************************************************************************************************************/
  17880. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17881. "use strict";
  17882. __webpack_require__.r(__webpack_exports__);
  17883. /* 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");
  17884. /***/ }),
  17885. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17886. /*!********************************************************************************************************!*\
  17887. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17888. \********************************************************************************************************/
  17889. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17890. "use strict";
  17891. __webpack_require__.r(__webpack_exports__);
  17892. /* 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");
  17893. /***/ }),
  17894. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17895. /*!***********************************************************************************************************!*\
  17896. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17897. \***********************************************************************************************************/
  17898. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17899. "use strict";
  17900. __webpack_require__.r(__webpack_exports__);
  17901. /* 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");
  17902. /***/ })
  17903. }]);