resources_js_pages_home_Index_vue.js 676KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_home_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.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/AppMessage.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. setup: function setup(__props, _ref) {
  15. var expose = _ref.expose;
  16. expose();
  17. var onClose = function onClose() {
  18. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  19. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  20. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  21. };
  22. var __returned__ = {
  23. onClose: onClose,
  24. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  25. };
  26. Object.defineProperty(__returned__, '__isScriptSetup', {
  27. enumerable: false,
  28. value: true
  29. });
  30. return __returned__;
  31. }
  32. });
  33. /***/ }),
  34. /***/ "./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":
  35. /*!***************************************************************************************************************************************************************************************************************!*\
  36. !*** ./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 ***!
  37. \***************************************************************************************************************************************************************************************************************/
  38. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  39. "use strict";
  40. __webpack_require__.r(__webpack_exports__);
  41. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  42. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  43. /* harmony export */ });
  44. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  45. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  46. props: {
  47. menu: Array
  48. },
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var __returned__ = {
  53. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  54. };
  55. Object.defineProperty(__returned__, '__isScriptSetup', {
  56. enumerable: false,
  57. value: true
  58. });
  59. return __returned__;
  60. }
  61. });
  62. /***/ }),
  63. /***/ "./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":
  64. /*!******************************************************************************************************************************************************************************************************************!*\
  65. !*** ./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 ***!
  66. \******************************************************************************************************************************************************************************************************************/
  67. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  68. "use strict";
  69. __webpack_require__.r(__webpack_exports__);
  70. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  71. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  72. /* harmony export */ });
  73. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  74. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  75. props: {
  76. items: Array,
  77. root: {
  78. type: Boolean,
  79. "default": false
  80. }
  81. },
  82. setup: function setup(__props, _ref) {
  83. var expose = _ref.expose;
  84. expose();
  85. var __returned__ = {
  86. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  87. };
  88. Object.defineProperty(__returned__, '__isScriptSetup', {
  89. enumerable: false,
  90. value: true
  91. });
  92. return __returned__;
  93. }
  94. });
  95. /***/ }),
  96. /***/ "./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":
  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/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  99. \**************************************************************************************************************************************************************************************************************/
  100. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  101. "use strict";
  102. __webpack_require__.r(__webpack_exports__);
  103. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  104. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  105. /* harmony export */ });
  106. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  107. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  108. emits: ['menu-toggle'],
  109. setup: function setup(__props, _ref) {
  110. var expose = _ref.expose;
  111. expose();
  112. var __returned__ = {
  113. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  114. };
  115. Object.defineProperty(__returned__, '__isScriptSetup', {
  116. enumerable: false,
  117. value: true
  118. });
  119. return __returned__;
  120. }
  121. });
  122. /***/ }),
  123. /***/ "./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":
  124. /*!*****************************************************************************************************************************************************************************************************************!*\
  125. !*** ./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 ***!
  126. \*****************************************************************************************************************************************************************************************************************/
  127. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  128. "use strict";
  129. __webpack_require__.r(__webpack_exports__);
  130. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  131. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  132. /* harmony export */ });
  133. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  134. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  135. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  136. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  137. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  138. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  139. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  140. setup: function setup(__props, _ref) {
  141. var expose = _ref.expose;
  142. expose();
  143. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  144. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  145. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  146. var isDesktop = function isDesktop() {
  147. return window.innerWidth >= 992;
  148. };
  149. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  150. return ['layout-wrapper', {
  151. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  152. 'layout-mobile-sidebar-active': mobileMenuActive.value
  153. }];
  154. });
  155. var onWrapperClick = function onWrapperClick() {
  156. if (!menuClick.value) {
  157. mobileMenuActive.value = false;
  158. }
  159. menuClick.value = false;
  160. };
  161. var onMenuToggle = function onMenuToggle(event) {
  162. menuClick.value = true;
  163. if (isDesktop()) {
  164. staticMenuInactive.value = !staticMenuInactive.value;
  165. } else {
  166. mobileMenuActive.value = !mobileMenuActive.value;
  167. }
  168. event.preventDefault();
  169. };
  170. var __returned__ = {
  171. mobileMenuActive: mobileMenuActive,
  172. staticMenuInactive: staticMenuInactive,
  173. menuClick: menuClick,
  174. isDesktop: isDesktop,
  175. containerClass: containerClass,
  176. onWrapperClick: onWrapperClick,
  177. onMenuToggle: onMenuToggle,
  178. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  179. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  180. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  181. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  182. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  183. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  184. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  185. };
  186. Object.defineProperty(__returned__, '__isScriptSetup', {
  187. enumerable: false,
  188. value: true
  189. });
  190. return __returned__;
  191. }
  192. });
  193. /***/ }),
  194. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js":
  195. /*!**********************************************************************************************************************************************************************************************************!*\
  196. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js ***!
  197. \**********************************************************************************************************************************************************************************************************/
  198. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  199. "use strict";
  200. __webpack_require__.r(__webpack_exports__);
  201. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  202. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  203. /* harmony export */ });
  204. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  205. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  206. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
  207. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  208. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  209. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  210. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  211. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  212. props: {
  213. cardStatistics: Array,
  214. barStatistics: Array,
  215. barHorizontalStatistics: Array
  216. },
  217. setup: function setup(__props, _ref) {
  218. var expose = _ref.expose;
  219. expose();
  220. var colors = ['#349dcf', '#00b2da', '#00c7dd', '#1fdbdb', '#57eed3', '#88ffc9', '#96ed9a', '#a8d96c', '#bbc242', '#cda91d'];
  221. var barChart = function barChart(chartData) {
  222. var colors = ['#349dcf', '#a8d96c'];
  223. var data = {
  224. datasets: []
  225. };
  226. var id = 0;
  227. for (var key in chartData) {
  228. data.datasets.push({
  229. label: key,
  230. backgroundColor: colors[id],
  231. data: chartData[key]
  232. });
  233. id++;
  234. }
  235. return data;
  236. };
  237. var barChartOption = {
  238. maintainAspectRatio: false,
  239. datasetFill: false
  240. };
  241. var barHorizontalChart = function barHorizontalChart(chartData) {
  242. var labels = [];
  243. var data = [];
  244. var _iterator = _createForOfIteratorHelper(chartData),
  245. _step;
  246. try {
  247. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  248. var obj = _step.value;
  249. labels.push([obj.label1, obj.label2]);
  250. data.push(obj.data);
  251. }
  252. } catch (err) {
  253. _iterator.e(err);
  254. } finally {
  255. _iterator.f();
  256. }
  257. return {
  258. labels: labels,
  259. datasets: [{
  260. data: data,
  261. backgroundColor: colors
  262. }]
  263. };
  264. };
  265. var barHorizontalChartOption = {
  266. maintainAspectRatio: false,
  267. datasetFill: false,
  268. indexAxis: 'y',
  269. plugins: {
  270. legend: {
  271. display: false
  272. }
  273. }
  274. };
  275. var pieChart = function pieChart(chartData) {
  276. var labels = [];
  277. var data = [];
  278. for (var key in chartData) {
  279. labels.push(key);
  280. data.push(chartData[key]);
  281. }
  282. return {
  283. labels: labels,
  284. datasets: [{
  285. data: data,
  286. backgroundColor: colors
  287. }]
  288. };
  289. };
  290. var pieChartOption = {
  291. maintainAspectRatio: false,
  292. datasetFill: false
  293. };
  294. var __returned__ = {
  295. colors: colors,
  296. barChart: barChart,
  297. barChartOption: barChartOption,
  298. barHorizontalChart: barHorizontalChart,
  299. barHorizontalChartOption: barHorizontalChartOption,
  300. pieChart: pieChart,
  301. pieChartOption: pieChartOption,
  302. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Head,
  303. includes: lodash__WEBPACK_IMPORTED_MODULE_1__.includes,
  304. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_2__["default"]
  305. };
  306. Object.defineProperty(__returned__, '__isScriptSetup', {
  307. enumerable: false,
  308. value: true
  309. });
  310. return __returned__;
  311. }
  312. });
  313. /***/ }),
  314. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  315. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  316. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  317. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  318. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  319. "use strict";
  320. __webpack_require__.r(__webpack_exports__);
  321. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  322. /* harmony export */ "render": () => (/* binding */ render)
  323. /* harmony export */ });
  324. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  325. var _withScopeId = function _withScopeId(n) {
  326. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  327. };
  328. var _hoisted_1 = {
  329. "class": "layout-footer"
  330. };
  331. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  332. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  333. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  334. href: "https://dijitalcode.com",
  335. target: "_blank",
  336. "class": "font-medium ml-2"
  337. }, "DijitalCODE", -1
  338. /* HOISTED */
  339. );
  340. });
  341. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  342. function render(_ctx, _cache) {
  343. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  344. }
  345. /***/ }),
  346. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  347. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  348. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  349. \********************************************************************************************************************************************************************************************************************************************************************************/
  350. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  351. "use strict";
  352. __webpack_require__.r(__webpack_exports__);
  353. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  354. /* harmony export */ "render": () => (/* binding */ render)
  355. /* harmony export */ });
  356. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  357. var _hoisted_1 = {
  358. key: 0
  359. };
  360. var _hoisted_2 = {
  361. key: 1
  362. };
  363. function render(_ctx, _cache, $props, $setup, $data, $options) {
  364. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  365. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  366. key: 0,
  367. severity: "success",
  368. onClose: $setup.onClose
  369. }, {
  370. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  371. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  372. /* TEXT */
  373. )];
  374. }),
  375. _: 1
  376. /* STABLE */
  377. })) : (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, {
  378. key: 1,
  379. severity: "error",
  380. onClose: $setup.onClose
  381. }, {
  382. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  383. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  384. /* TEXT */
  385. )];
  386. }),
  387. _: 1
  388. /* STABLE */
  389. })) : (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, {
  390. key: 2,
  391. severity: "error",
  392. onClose: $setup.onClose
  393. }, {
  394. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  395. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, "Ditemukan satu error pada form")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, "Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form", 1
  396. /* TEXT */
  397. ))];
  398. }),
  399. _: 1
  400. /* STABLE */
  401. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  402. /* STABLE_FRAGMENT */
  403. );
  404. }
  405. /***/ }),
  406. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  407. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  408. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  409. \********************************************************************************************************************************************************************************************************************************************************************************************/
  410. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  411. "use strict";
  412. __webpack_require__.r(__webpack_exports__);
  413. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  414. /* harmony export */ "render": () => (/* binding */ render)
  415. /* harmony export */ });
  416. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  417. function render(_ctx, _cache, $props, $setup, $data, $options) {
  418. 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"], {
  419. "class": "layout-menu",
  420. items: $props.menu,
  421. root: true
  422. }, null, 8
  423. /* PROPS */
  424. , ["items"])]);
  425. }
  426. /***/ }),
  427. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  428. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  429. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  430. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  431. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  432. "use strict";
  433. __webpack_require__.r(__webpack_exports__);
  434. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  435. /* harmony export */ "render": () => (/* binding */ render)
  436. /* harmony export */ });
  437. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  438. var _withScopeId = function _withScopeId(n) {
  439. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  440. };
  441. var _hoisted_1 = {
  442. key: 0
  443. };
  444. var _hoisted_2 = ["aria-label"];
  445. var _hoisted_3 = ["aria-label"];
  446. function render(_ctx, _cache, $props, $setup, $data, $options) {
  447. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  448. 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) {
  449. 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", {
  450. key: i,
  451. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  452. 'layout-menuitem-category': $props.root
  453. }]),
  454. role: "none"
  455. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  456. key: 0
  457. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  458. "class": "layout-menuitem-root-text",
  459. "aria-label": item.label
  460. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  461. /* TEXT, PROPS */
  462. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  463. items: item.items
  464. }, null, 8
  465. /* PROPS */
  466. , ["items"])], 64
  467. /* STABLE_FRAGMENT */
  468. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  469. key: 1
  470. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  471. key: 0,
  472. role: "menuitem",
  473. href: item.to,
  474. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  475. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  476. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  477. }]),
  478. "aria-label": item.label
  479. }, {
  480. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  481. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  482. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  483. }, null, 2
  484. /* CLASS */
  485. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  486. /* TEXT */
  487. )];
  488. }),
  489. _: 2
  490. /* DYNAMIC */
  491. }, 1032
  492. /* PROPS, DYNAMIC_SLOTS */
  493. , ["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", {
  494. key: 1,
  495. href: "#",
  496. role: "menuitem",
  497. "aria-label": item.label
  498. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  499. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  500. }, null, 2
  501. /* CLASS */
  502. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  503. /* TEXT */
  504. )], 8
  505. /* PROPS */
  506. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  507. items: item.items
  508. }, null, 8
  509. /* PROPS */
  510. , ["items"])], 64
  511. /* STABLE_FRAGMENT */
  512. ))], 2
  513. /* CLASS */
  514. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  515. /* STABLE_FRAGMENT */
  516. );
  517. }), 256
  518. /* UNKEYED_FRAGMENT */
  519. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  520. }
  521. /***/ }),
  522. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  523. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  524. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  525. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  526. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  527. "use strict";
  528. __webpack_require__.r(__webpack_exports__);
  529. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  530. /* harmony export */ "render": () => (/* binding */ render)
  531. /* harmony export */ });
  532. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  533. var _withScopeId = function _withScopeId(n) {
  534. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  535. };
  536. var _hoisted_1 = {
  537. "class": "layout-topbar"
  538. };
  539. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  540. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  541. alt: "Logo",
  542. src: "/images/logo.svg",
  543. "class": "md:mr-3"
  544. }, null, -1
  545. /* HOISTED */
  546. );
  547. });
  548. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  549. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  550. /* HOISTED */
  551. );
  552. });
  553. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  554. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  555. "class": "pi pi-bars"
  556. }, null, -1
  557. /* HOISTED */
  558. );
  559. });
  560. var _hoisted_5 = [_hoisted_4];
  561. var _hoisted_6 = {
  562. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  563. };
  564. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  565. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  566. "class": "pi pi-ellipsis-v"
  567. }, null, -1
  568. /* HOISTED */
  569. );
  570. });
  571. var _hoisted_8 = [_hoisted_7];
  572. var _hoisted_9 = {
  573. "class": "layout-topbar-menu hidden lg:flex origin-top"
  574. };
  575. var _hoisted_10 = {
  576. "class": "align-self-center"
  577. };
  578. var _hoisted_11 = {
  579. "class": "hidden lg:inline"
  580. };
  581. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  582. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  583. "class": "pi pi-user"
  584. }, null, -1
  585. /* HOISTED */
  586. );
  587. });
  588. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  589. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Profil Saya", -1
  590. /* HOISTED */
  591. );
  592. });
  593. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  594. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  595. "class": "pi pi-sign-out"
  596. }, null, -1
  597. /* HOISTED */
  598. );
  599. });
  600. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  601. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Sign Out", -1
  602. /* HOISTED */
  603. );
  604. });
  605. function render(_ctx, _cache, $props, $setup, $data, $options) {
  606. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  607. 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"], {
  608. href: "/",
  609. "class": "layout-topbar-logo"
  610. }, {
  611. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  612. return [_hoisted_2, _hoisted_3];
  613. }),
  614. _: 1
  615. /* STABLE */
  616. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  617. "class": "p-link layout-menu-button layout-topbar-button",
  618. onClick: _cache[0] || (_cache[0] = function ($event) {
  619. return _ctx.$emit('menu-toggle', $event);
  620. })
  621. }, _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, {
  622. selector: '@next',
  623. enterClass: 'hidden',
  624. enterActiveClass: 'scalein',
  625. leaveToClass: 'hidden',
  626. leaveActiveClass: 'fadeout',
  627. hideOnOutsideClick: true
  628. }]]), (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
  629. /* TEXT */
  630. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  631. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  632. "class": "p-link layout-topbar-button"
  633. }, {
  634. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  635. return [_hoisted_12, _hoisted_13];
  636. }),
  637. _: 1
  638. /* STABLE */
  639. }, 8
  640. /* PROPS */
  641. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  642. href: _ctx.route('logout'),
  643. as: "button",
  644. method: "post",
  645. "class": "p-link layout-topbar-button"
  646. }, {
  647. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  648. return [_hoisted_14, _hoisted_15];
  649. }),
  650. _: 1
  651. /* STABLE */
  652. }, 8
  653. /* PROPS */
  654. , ["href"])])])]);
  655. }
  656. /***/ }),
  657. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  658. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  659. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  660. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  661. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  662. "use strict";
  663. __webpack_require__.r(__webpack_exports__);
  664. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  665. /* harmony export */ "render": () => (/* binding */ render)
  666. /* harmony export */ });
  667. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  668. var _withScopeId = function _withScopeId(n) {
  669. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  670. };
  671. var _hoisted_1 = {
  672. "class": "layout-sidebar"
  673. };
  674. var _hoisted_2 = {
  675. "class": "layout-main-container"
  676. };
  677. var _hoisted_3 = {
  678. "class": "layout-main"
  679. };
  680. var _hoisted_4 = {
  681. key: 0,
  682. "class": "layout-mask p-component-overlay"
  683. };
  684. function render(_ctx, _cache, $props, $setup, $data, $options) {
  685. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  686. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  687. onClick: $setup.onWrapperClick
  688. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  689. onMenuToggle: $setup.onMenuToggle
  690. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  691. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  692. }, null, 8
  693. /* PROPS */
  694. , ["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, {
  695. name: "layout-mask"
  696. }, {
  697. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  698. 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)];
  699. }),
  700. _: 1
  701. /* STABLE */
  702. })], 2
  703. /* CLASS */
  704. );
  705. }
  706. /***/ }),
  707. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa":
  708. /*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  709. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa ***!
  710. \***************************************************************************************************************************************************************************************************************************************************************************/
  711. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  712. "use strict";
  713. __webpack_require__.r(__webpack_exports__);
  714. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  715. /* harmony export */ "render": () => (/* binding */ render)
  716. /* harmony export */ });
  717. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  718. var _hoisted_1 = {
  719. "class": "grid"
  720. };
  721. var _hoisted_2 = {
  722. key: 0,
  723. "class": "col-12 md:col-4 xl:col-3"
  724. };
  725. var _hoisted_3 = {
  726. "class": "flex justify-content-between mb-3"
  727. };
  728. var _hoisted_4 = {
  729. "class": "block text-500 font-medium mb-3"
  730. };
  731. var _hoisted_5 = {
  732. key: 0,
  733. "class": "text-900 font-medium text-xl"
  734. };
  735. var _hoisted_6 = {
  736. "class": "flex align-items-center justify-content-center bg-orange-100 border-round",
  737. style: {
  738. "width": "2.5rem",
  739. "height": "2.5rem"
  740. }
  741. };
  742. var _hoisted_7 = {
  743. "class": "text-green-500 font-medium"
  744. };
  745. var _hoisted_8 = {
  746. "class": "text-500"
  747. };
  748. var _hoisted_9 = {
  749. "class": "grid"
  750. };
  751. var _hoisted_10 = {
  752. key: 0,
  753. "class": "col-12 md:col-6"
  754. };
  755. var _hoisted_11 = {
  756. "class": "flex flex-column"
  757. };
  758. var _hoisted_12 = {
  759. key: 0,
  760. "class": "text-base font-normal"
  761. };
  762. function render(_ctx, _cache, $props, $setup, $data, $options) {
  763. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  764. var _component_Chart = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Chart");
  765. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], null, {
  766. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  767. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  768. title: "Dashboard"
  769. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _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.cardStatistics, function (cardStatistic) {
  770. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [$setup.includes(cardStatistic.roleId, _ctx.$page.props.auth.user.role_id) ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, {
  771. "class": "h-full"
  772. }, {
  773. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  774. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(cardStatistic.title), 1
  775. /* TEXT */
  776. ), cardStatistic.value ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_5, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(cardStatistic.value), 1
  777. /* TEXT */
  778. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  779. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["text-orange-500 text-xl", cardStatistic.icon])
  780. }, null, 2
  781. /* CLASS */
  782. )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_7, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(cardStatistic.amount), 1
  783. /* TEXT */
  784. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_8, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(' ' + cardStatistic.amountLabel), 1
  785. /* TEXT */
  786. )];
  787. }),
  788. _: 2
  789. /* DYNAMIC */
  790. }, 1024
  791. /* DYNAMIC_SLOTS */
  792. )])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  793. /* STABLE_FRAGMENT */
  794. );
  795. }), 256
  796. /* UNKEYED_FRAGMENT */
  797. ))]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_9, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.barStatistics, function (barStatistic) {
  798. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [$setup.includes(barStatistic.roleId, _ctx.$page.props.auth.user.role_id) ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({
  799. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  800. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_11, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(barStatistic.title), 1
  801. /* TEXT */
  802. ), barStatistic.description ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(barStatistic.description), 1
  803. /* TEXT */
  804. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])];
  805. }),
  806. _: 2
  807. /* DYNAMIC */
  808. }, [Object.keys(barStatistic.data).length ? {
  809. name: "content",
  810. fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  811. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Chart, {
  812. type: "bar",
  813. width: 600,
  814. height: 300,
  815. data: $setup.barChart(barStatistic.data),
  816. options: $setup.barChartOption
  817. }, null, 8
  818. /* PROPS */
  819. , ["data"])];
  820. })
  821. } : undefined]), 1024
  822. /* DYNAMIC_SLOTS */
  823. )])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  824. /* STABLE_FRAGMENT */
  825. );
  826. }), 256
  827. /* UNKEYED_FRAGMENT */
  828. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" <div v-for=\"barHorizontalStatistic in barHorizontalStatistics\" class=\"col-12 md:col-6\">\n <Card>\n <template #title>\n <div class=\"flex flex-column\">\n <span>{{ barHorizontalStatistic.title }}</span>\n <span v-if=\"barHorizontalStatistic.description\" class=\"text-base font-normal\">{{\n barHorizontalStatistic.description\n }}</span>\n </div>\n </template>\n <template #content>\n <Chart\n type=\"bar\"\n :width=\"600\"\n :height=\"300\"\n :data=\"barHorizontalChart(barHorizontalStatistic.data)\"\n :options=\"barHorizontalChartOption\"\n />\n </template>\n </Card>\n </div> "), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" <div v-for=\"pieStatistic in pieStatistics\" class=\"col-12 md:col-6\">\n <Card>\n <template #title>\n <div class=\"flex flex-column\">\n <span>{{ pieStatistic.title }}</span>\n <span v-if=\"pieStatistic.description\" class=\"text-base font-normal\">{{ pieStatistic.description }}</span>\n </div>\n </template>\n <template #content>\n <Chart\n type=\"pie\"\n :width=\"600\"\n :height=\"300\"\n :data=\"pieChart(pieStatistic.data)\"\n :options=\"pieChartOption\"\n />\n </template>\n </Card>\n </div> ")])];
  829. }),
  830. _: 1
  831. /* STABLE */
  832. });
  833. }
  834. /***/ }),
  835. /***/ "./resources/js/utils/menu.js":
  836. /*!************************************!*\
  837. !*** ./resources/js/utils/menu.js ***!
  838. \************************************/
  839. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  840. "use strict";
  841. __webpack_require__.r(__webpack_exports__);
  842. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  843. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  844. /* harmony export */ });
  845. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  846. // Admin
  847. 1: [{
  848. label: 'Home',
  849. items: [{
  850. label: 'Dashboard',
  851. icon: 'pi pi-home',
  852. to: '/dashboards',
  853. component: 'home/Index'
  854. }]
  855. }, {
  856. label: 'Master',
  857. items: [{
  858. label: 'User',
  859. icon: 'pi pi-user',
  860. to: '/users',
  861. component: 'user/Index'
  862. }]
  863. }],
  864. // Supervisor
  865. 2: [{
  866. label: 'Home',
  867. items: [{
  868. label: 'Dashboard',
  869. icon: 'pi pi-home',
  870. to: '/dashboards',
  871. component: 'home/Index'
  872. }]
  873. }, {
  874. label: 'Menu',
  875. items: [{
  876. label: 'Pengeluaran',
  877. icon: 'pi pi-wallet',
  878. to: '/expenses',
  879. component: 'expense/Index'
  880. }, {
  881. label: 'Laporan',
  882. icon: 'pi pi-book',
  883. items: [{
  884. label: 'Mutasi',
  885. icon: 'pi pi-circle',
  886. to: '/reports/mutations',
  887. component: 'mutation/Report'
  888. }]
  889. }]
  890. }, {
  891. label: 'Master',
  892. items: [{
  893. label: 'Jenis Kendaraan',
  894. icon: 'pi pi-car',
  895. to: '/type-vehicles',
  896. component: 'typevehicle/Index'
  897. }, {
  898. label: 'Jenis Member',
  899. icon: 'pi pi-id-card',
  900. to: '/type-members',
  901. component: 'typemember/Index'
  902. }]
  903. }, {
  904. label: 'Pengaturan',
  905. items: [{
  906. label: 'Tarif Parkir',
  907. icon: 'pi pi-car',
  908. to: '/parking-fees/create',
  909. component: 'parkingfee/Create'
  910. }]
  911. }],
  912. // Operator
  913. 3: [{
  914. label: 'Home',
  915. items: [{
  916. label: 'Dashboard',
  917. icon: 'pi pi-home',
  918. to: '/dashboards',
  919. component: 'home/Index'
  920. }]
  921. }, {
  922. label: 'Menu',
  923. items: [{
  924. label: 'Pengeluaran',
  925. icon: 'pi pi-wallet',
  926. to: '/expenses',
  927. component: 'expense/Index'
  928. }, {
  929. label: 'Member',
  930. icon: 'pi pi-id-card',
  931. to: '/members',
  932. component: 'member/Index'
  933. }, {
  934. label: 'Top Up',
  935. icon: 'pi pi-car',
  936. to: '/top-ups',
  937. component: 'topup/Index'
  938. }]
  939. }]
  940. });
  941. /***/ }),
  942. /***/ "./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":
  943. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  944. !*** ./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 ***!
  945. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  946. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  947. "use strict";
  948. __webpack_require__.r(__webpack_exports__);
  949. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  950. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  951. /* harmony export */ });
  952. /* 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");
  953. /* 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__);
  954. // Imports
  955. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  956. // Module
  957. ___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}", ""]);
  958. // Exports
  959. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  960. /***/ }),
  961. /***/ "./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":
  962. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  963. !*** ./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 ***!
  964. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  965. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  966. "use strict";
  967. __webpack_require__.r(__webpack_exports__);
  968. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  969. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  970. /* harmony export */ });
  971. /* 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");
  972. /* 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__);
  973. // Imports
  974. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  975. // Module
  976. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  977. // Exports
  978. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  979. /***/ }),
  980. /***/ "./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":
  981. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  982. !*** ./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 ***!
  983. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  984. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  985. "use strict";
  986. __webpack_require__.r(__webpack_exports__);
  987. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  988. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  989. /* harmony export */ });
  990. /* 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");
  991. /* 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__);
  992. // Imports
  993. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  994. // Module
  995. ___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}", ""]);
  996. // Exports
  997. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  998. /***/ }),
  999. /***/ "./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":
  1000. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1001. !*** ./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 ***!
  1002. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1003. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1004. "use strict";
  1005. __webpack_require__.r(__webpack_exports__);
  1006. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1007. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1008. /* harmony export */ });
  1009. /* 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");
  1010. /* 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__);
  1011. // Imports
  1012. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1013. // Module
  1014. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1015. // Exports
  1016. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1017. /***/ }),
  1018. /***/ "./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":
  1019. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1020. !*** ./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 ***!
  1021. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1022. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1023. "use strict";
  1024. __webpack_require__.r(__webpack_exports__);
  1025. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1026. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1027. /* harmony export */ });
  1028. /* 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");
  1029. /* 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__);
  1030. // Imports
  1031. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1032. // Module
  1033. ___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}", ""]);
  1034. // Exports
  1035. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1036. /***/ }),
  1037. /***/ "./node_modules/lodash/lodash.js":
  1038. /*!***************************************!*\
  1039. !*** ./node_modules/lodash/lodash.js ***!
  1040. \***************************************/
  1041. /***/ (function(module, exports, __webpack_require__) {
  1042. /* module decorator */ module = __webpack_require__.nmd(module);
  1043. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1044. * @license
  1045. * Lodash <https://lodash.com/>
  1046. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1047. * Released under MIT license <https://lodash.com/license>
  1048. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1049. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1050. */
  1051. ;(function() {
  1052. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1053. var undefined;
  1054. /** Used as the semantic version number. */
  1055. var VERSION = '4.17.21';
  1056. /** Used as the size to enable large array optimizations. */
  1057. var LARGE_ARRAY_SIZE = 200;
  1058. /** Error message constants. */
  1059. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1060. FUNC_ERROR_TEXT = 'Expected a function',
  1061. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1062. /** Used to stand-in for `undefined` hash values. */
  1063. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1064. /** Used as the maximum memoize cache size. */
  1065. var MAX_MEMOIZE_SIZE = 500;
  1066. /** Used as the internal argument placeholder. */
  1067. var PLACEHOLDER = '__lodash_placeholder__';
  1068. /** Used to compose bitmasks for cloning. */
  1069. var CLONE_DEEP_FLAG = 1,
  1070. CLONE_FLAT_FLAG = 2,
  1071. CLONE_SYMBOLS_FLAG = 4;
  1072. /** Used to compose bitmasks for value comparisons. */
  1073. var COMPARE_PARTIAL_FLAG = 1,
  1074. COMPARE_UNORDERED_FLAG = 2;
  1075. /** Used to compose bitmasks for function metadata. */
  1076. var WRAP_BIND_FLAG = 1,
  1077. WRAP_BIND_KEY_FLAG = 2,
  1078. WRAP_CURRY_BOUND_FLAG = 4,
  1079. WRAP_CURRY_FLAG = 8,
  1080. WRAP_CURRY_RIGHT_FLAG = 16,
  1081. WRAP_PARTIAL_FLAG = 32,
  1082. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1083. WRAP_ARY_FLAG = 128,
  1084. WRAP_REARG_FLAG = 256,
  1085. WRAP_FLIP_FLAG = 512;
  1086. /** Used as default options for `_.truncate`. */
  1087. var DEFAULT_TRUNC_LENGTH = 30,
  1088. DEFAULT_TRUNC_OMISSION = '...';
  1089. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1090. var HOT_COUNT = 800,
  1091. HOT_SPAN = 16;
  1092. /** Used to indicate the type of lazy iteratees. */
  1093. var LAZY_FILTER_FLAG = 1,
  1094. LAZY_MAP_FLAG = 2,
  1095. LAZY_WHILE_FLAG = 3;
  1096. /** Used as references for various `Number` constants. */
  1097. var INFINITY = 1 / 0,
  1098. MAX_SAFE_INTEGER = 9007199254740991,
  1099. MAX_INTEGER = 1.7976931348623157e+308,
  1100. NAN = 0 / 0;
  1101. /** Used as references for the maximum length and index of an array. */
  1102. var MAX_ARRAY_LENGTH = 4294967295,
  1103. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1104. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1105. /** Used to associate wrap methods with their bit flags. */
  1106. var wrapFlags = [
  1107. ['ary', WRAP_ARY_FLAG],
  1108. ['bind', WRAP_BIND_FLAG],
  1109. ['bindKey', WRAP_BIND_KEY_FLAG],
  1110. ['curry', WRAP_CURRY_FLAG],
  1111. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1112. ['flip', WRAP_FLIP_FLAG],
  1113. ['partial', WRAP_PARTIAL_FLAG],
  1114. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1115. ['rearg', WRAP_REARG_FLAG]
  1116. ];
  1117. /** `Object#toString` result references. */
  1118. var argsTag = '[object Arguments]',
  1119. arrayTag = '[object Array]',
  1120. asyncTag = '[object AsyncFunction]',
  1121. boolTag = '[object Boolean]',
  1122. dateTag = '[object Date]',
  1123. domExcTag = '[object DOMException]',
  1124. errorTag = '[object Error]',
  1125. funcTag = '[object Function]',
  1126. genTag = '[object GeneratorFunction]',
  1127. mapTag = '[object Map]',
  1128. numberTag = '[object Number]',
  1129. nullTag = '[object Null]',
  1130. objectTag = '[object Object]',
  1131. promiseTag = '[object Promise]',
  1132. proxyTag = '[object Proxy]',
  1133. regexpTag = '[object RegExp]',
  1134. setTag = '[object Set]',
  1135. stringTag = '[object String]',
  1136. symbolTag = '[object Symbol]',
  1137. undefinedTag = '[object Undefined]',
  1138. weakMapTag = '[object WeakMap]',
  1139. weakSetTag = '[object WeakSet]';
  1140. var arrayBufferTag = '[object ArrayBuffer]',
  1141. dataViewTag = '[object DataView]',
  1142. float32Tag = '[object Float32Array]',
  1143. float64Tag = '[object Float64Array]',
  1144. int8Tag = '[object Int8Array]',
  1145. int16Tag = '[object Int16Array]',
  1146. int32Tag = '[object Int32Array]',
  1147. uint8Tag = '[object Uint8Array]',
  1148. uint8ClampedTag = '[object Uint8ClampedArray]',
  1149. uint16Tag = '[object Uint16Array]',
  1150. uint32Tag = '[object Uint32Array]';
  1151. /** Used to match empty string literals in compiled template source. */
  1152. var reEmptyStringLeading = /\b__p \+= '';/g,
  1153. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1154. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1155. /** Used to match HTML entities and HTML characters. */
  1156. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1157. reUnescapedHtml = /[&<>"']/g,
  1158. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1159. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1160. /** Used to match template delimiters. */
  1161. var reEscape = /<%-([\s\S]+?)%>/g,
  1162. reEvaluate = /<%([\s\S]+?)%>/g,
  1163. reInterpolate = /<%=([\s\S]+?)%>/g;
  1164. /** Used to match property names within property paths. */
  1165. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1166. reIsPlainProp = /^\w*$/,
  1167. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1168. /**
  1169. * Used to match `RegExp`
  1170. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1171. */
  1172. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1173. reHasRegExpChar = RegExp(reRegExpChar.source);
  1174. /** Used to match leading whitespace. */
  1175. var reTrimStart = /^\s+/;
  1176. /** Used to match a single whitespace character. */
  1177. var reWhitespace = /\s/;
  1178. /** Used to match wrap detail comments. */
  1179. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1180. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1181. reSplitDetails = /,? & /;
  1182. /** Used to match words composed of alphanumeric characters. */
  1183. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1184. /**
  1185. * Used to validate the `validate` option in `_.template` variable.
  1186. *
  1187. * Forbids characters which could potentially change the meaning of the function argument definition:
  1188. * - "()," (modification of function parameters)
  1189. * - "=" (default value)
  1190. * - "[]{}" (destructuring of function parameters)
  1191. * - "/" (beginning of a comment)
  1192. * - whitespace
  1193. */
  1194. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1195. /** Used to match backslashes in property paths. */
  1196. var reEscapeChar = /\\(\\)?/g;
  1197. /**
  1198. * Used to match
  1199. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1200. */
  1201. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1202. /** Used to match `RegExp` flags from their coerced string values. */
  1203. var reFlags = /\w*$/;
  1204. /** Used to detect bad signed hexadecimal string values. */
  1205. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1206. /** Used to detect binary string values. */
  1207. var reIsBinary = /^0b[01]+$/i;
  1208. /** Used to detect host constructors (Safari). */
  1209. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1210. /** Used to detect octal string values. */
  1211. var reIsOctal = /^0o[0-7]+$/i;
  1212. /** Used to detect unsigned integer values. */
  1213. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1214. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1215. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1216. /** Used to ensure capturing order of template delimiters. */
  1217. var reNoMatch = /($^)/;
  1218. /** Used to match unescaped characters in compiled string literals. */
  1219. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1220. /** Used to compose unicode character classes. */
  1221. var rsAstralRange = '\\ud800-\\udfff',
  1222. rsComboMarksRange = '\\u0300-\\u036f',
  1223. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1224. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1225. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1226. rsDingbatRange = '\\u2700-\\u27bf',
  1227. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1228. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1229. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1230. rsPunctuationRange = '\\u2000-\\u206f',
  1231. 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',
  1232. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1233. rsVarRange = '\\ufe0e\\ufe0f',
  1234. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1235. /** Used to compose unicode capture groups. */
  1236. var rsApos = "['\u2019]",
  1237. rsAstral = '[' + rsAstralRange + ']',
  1238. rsBreak = '[' + rsBreakRange + ']',
  1239. rsCombo = '[' + rsComboRange + ']',
  1240. rsDigits = '\\d+',
  1241. rsDingbat = '[' + rsDingbatRange + ']',
  1242. rsLower = '[' + rsLowerRange + ']',
  1243. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1244. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1245. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1246. rsNonAstral = '[^' + rsAstralRange + ']',
  1247. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1248. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1249. rsUpper = '[' + rsUpperRange + ']',
  1250. rsZWJ = '\\u200d';
  1251. /** Used to compose unicode regexes. */
  1252. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1253. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1254. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1255. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1256. reOptMod = rsModifier + '?',
  1257. rsOptVar = '[' + rsVarRange + ']?',
  1258. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1259. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1260. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1261. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1262. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1263. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1264. /** Used to match apostrophes. */
  1265. var reApos = RegExp(rsApos, 'g');
  1266. /**
  1267. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1268. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1269. */
  1270. var reComboMark = RegExp(rsCombo, 'g');
  1271. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1272. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1273. /** Used to match complex or compound words. */
  1274. var reUnicodeWord = RegExp([
  1275. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1276. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1277. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1278. rsUpper + '+' + rsOptContrUpper,
  1279. rsOrdUpper,
  1280. rsOrdLower,
  1281. rsDigits,
  1282. rsEmoji
  1283. ].join('|'), 'g');
  1284. /** 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/). */
  1285. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1286. /** Used to detect strings that need a more robust regexp to match words. */
  1287. 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 ]/;
  1288. /** Used to assign default `context` object properties. */
  1289. var contextProps = [
  1290. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1291. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1292. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1293. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1294. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1295. ];
  1296. /** Used to make template sourceURLs easier to identify. */
  1297. var templateCounter = -1;
  1298. /** Used to identify `toStringTag` values of typed arrays. */
  1299. var typedArrayTags = {};
  1300. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1301. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1302. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1303. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1304. typedArrayTags[uint32Tag] = true;
  1305. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1306. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1307. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1308. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1309. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1310. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1311. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1312. typedArrayTags[weakMapTag] = false;
  1313. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1314. var cloneableTags = {};
  1315. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1316. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1317. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1318. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1319. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1320. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1321. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1322. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1323. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1324. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1325. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1326. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1327. cloneableTags[weakMapTag] = false;
  1328. /** Used to map Latin Unicode letters to basic Latin letters. */
  1329. var deburredLetters = {
  1330. // Latin-1 Supplement block.
  1331. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1332. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1333. '\xc7': 'C', '\xe7': 'c',
  1334. '\xd0': 'D', '\xf0': 'd',
  1335. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1336. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1337. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1338. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1339. '\xd1': 'N', '\xf1': 'n',
  1340. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1341. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1342. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1343. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1344. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1345. '\xc6': 'Ae', '\xe6': 'ae',
  1346. '\xde': 'Th', '\xfe': 'th',
  1347. '\xdf': 'ss',
  1348. // Latin Extended-A block.
  1349. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1350. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1351. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1352. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1353. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1354. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1355. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1356. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1357. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1358. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1359. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1360. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1361. '\u0134': 'J', '\u0135': 'j',
  1362. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1363. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1364. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1365. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1366. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1367. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1368. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1369. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1370. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1371. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1372. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1373. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1374. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1375. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1376. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1377. '\u0174': 'W', '\u0175': 'w',
  1378. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1379. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1380. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1381. '\u0132': 'IJ', '\u0133': 'ij',
  1382. '\u0152': 'Oe', '\u0153': 'oe',
  1383. '\u0149': "'n", '\u017f': 's'
  1384. };
  1385. /** Used to map characters to HTML entities. */
  1386. var htmlEscapes = {
  1387. '&': '&amp;',
  1388. '<': '&lt;',
  1389. '>': '&gt;',
  1390. '"': '&quot;',
  1391. "'": '&#39;'
  1392. };
  1393. /** Used to map HTML entities to characters. */
  1394. var htmlUnescapes = {
  1395. '&amp;': '&',
  1396. '&lt;': '<',
  1397. '&gt;': '>',
  1398. '&quot;': '"',
  1399. '&#39;': "'"
  1400. };
  1401. /** Used to escape characters for inclusion in compiled string literals. */
  1402. var stringEscapes = {
  1403. '\\': '\\',
  1404. "'": "'",
  1405. '\n': 'n',
  1406. '\r': 'r',
  1407. '\u2028': 'u2028',
  1408. '\u2029': 'u2029'
  1409. };
  1410. /** Built-in method references without a dependency on `root`. */
  1411. var freeParseFloat = parseFloat,
  1412. freeParseInt = parseInt;
  1413. /** Detect free variable `global` from Node.js. */
  1414. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1415. /** Detect free variable `self`. */
  1416. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1417. /** Used as a reference to the global object. */
  1418. var root = freeGlobal || freeSelf || Function('return this')();
  1419. /** Detect free variable `exports`. */
  1420. var freeExports = true && exports && !exports.nodeType && exports;
  1421. /** Detect free variable `module`. */
  1422. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1423. /** Detect the popular CommonJS extension `module.exports`. */
  1424. var moduleExports = freeModule && freeModule.exports === freeExports;
  1425. /** Detect free variable `process` from Node.js. */
  1426. var freeProcess = moduleExports && freeGlobal.process;
  1427. /** Used to access faster Node.js helpers. */
  1428. var nodeUtil = (function() {
  1429. try {
  1430. // Use `util.types` for Node.js 10+.
  1431. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1432. if (types) {
  1433. return types;
  1434. }
  1435. // Legacy `process.binding('util')` for Node.js < 10.
  1436. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1437. } catch (e) {}
  1438. }());
  1439. /* Node.js helper references. */
  1440. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1441. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1442. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1443. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1444. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1445. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1446. /*--------------------------------------------------------------------------*/
  1447. /**
  1448. * A faster alternative to `Function#apply`, this function invokes `func`
  1449. * with the `this` binding of `thisArg` and the arguments of `args`.
  1450. *
  1451. * @private
  1452. * @param {Function} func The function to invoke.
  1453. * @param {*} thisArg The `this` binding of `func`.
  1454. * @param {Array} args The arguments to invoke `func` with.
  1455. * @returns {*} Returns the result of `func`.
  1456. */
  1457. function apply(func, thisArg, args) {
  1458. switch (args.length) {
  1459. case 0: return func.call(thisArg);
  1460. case 1: return func.call(thisArg, args[0]);
  1461. case 2: return func.call(thisArg, args[0], args[1]);
  1462. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1463. }
  1464. return func.apply(thisArg, args);
  1465. }
  1466. /**
  1467. * A specialized version of `baseAggregator` for arrays.
  1468. *
  1469. * @private
  1470. * @param {Array} [array] The array to iterate over.
  1471. * @param {Function} setter The function to set `accumulator` values.
  1472. * @param {Function} iteratee The iteratee to transform keys.
  1473. * @param {Object} accumulator The initial aggregated object.
  1474. * @returns {Function} Returns `accumulator`.
  1475. */
  1476. function arrayAggregator(array, setter, iteratee, accumulator) {
  1477. var index = -1,
  1478. length = array == null ? 0 : array.length;
  1479. while (++index < length) {
  1480. var value = array[index];
  1481. setter(accumulator, value, iteratee(value), array);
  1482. }
  1483. return accumulator;
  1484. }
  1485. /**
  1486. * A specialized version of `_.forEach` for arrays without support for
  1487. * iteratee shorthands.
  1488. *
  1489. * @private
  1490. * @param {Array} [array] The array to iterate over.
  1491. * @param {Function} iteratee The function invoked per iteration.
  1492. * @returns {Array} Returns `array`.
  1493. */
  1494. function arrayEach(array, iteratee) {
  1495. var index = -1,
  1496. length = array == null ? 0 : array.length;
  1497. while (++index < length) {
  1498. if (iteratee(array[index], index, array) === false) {
  1499. break;
  1500. }
  1501. }
  1502. return array;
  1503. }
  1504. /**
  1505. * A specialized version of `_.forEachRight` for arrays without support for
  1506. * iteratee shorthands.
  1507. *
  1508. * @private
  1509. * @param {Array} [array] The array to iterate over.
  1510. * @param {Function} iteratee The function invoked per iteration.
  1511. * @returns {Array} Returns `array`.
  1512. */
  1513. function arrayEachRight(array, iteratee) {
  1514. var length = array == null ? 0 : array.length;
  1515. while (length--) {
  1516. if (iteratee(array[length], length, array) === false) {
  1517. break;
  1518. }
  1519. }
  1520. return array;
  1521. }
  1522. /**
  1523. * A specialized version of `_.every` for arrays without support for
  1524. * iteratee shorthands.
  1525. *
  1526. * @private
  1527. * @param {Array} [array] The array to iterate over.
  1528. * @param {Function} predicate The function invoked per iteration.
  1529. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1530. * else `false`.
  1531. */
  1532. function arrayEvery(array, predicate) {
  1533. var index = -1,
  1534. length = array == null ? 0 : array.length;
  1535. while (++index < length) {
  1536. if (!predicate(array[index], index, array)) {
  1537. return false;
  1538. }
  1539. }
  1540. return true;
  1541. }
  1542. /**
  1543. * A specialized version of `_.filter` for arrays without support for
  1544. * iteratee shorthands.
  1545. *
  1546. * @private
  1547. * @param {Array} [array] The array to iterate over.
  1548. * @param {Function} predicate The function invoked per iteration.
  1549. * @returns {Array} Returns the new filtered array.
  1550. */
  1551. function arrayFilter(array, predicate) {
  1552. var index = -1,
  1553. length = array == null ? 0 : array.length,
  1554. resIndex = 0,
  1555. result = [];
  1556. while (++index < length) {
  1557. var value = array[index];
  1558. if (predicate(value, index, array)) {
  1559. result[resIndex++] = value;
  1560. }
  1561. }
  1562. return result;
  1563. }
  1564. /**
  1565. * A specialized version of `_.includes` for arrays without support for
  1566. * specifying an index to search from.
  1567. *
  1568. * @private
  1569. * @param {Array} [array] The array to inspect.
  1570. * @param {*} target The value to search for.
  1571. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1572. */
  1573. function arrayIncludes(array, value) {
  1574. var length = array == null ? 0 : array.length;
  1575. return !!length && baseIndexOf(array, value, 0) > -1;
  1576. }
  1577. /**
  1578. * This function is like `arrayIncludes` except that it accepts a comparator.
  1579. *
  1580. * @private
  1581. * @param {Array} [array] The array to inspect.
  1582. * @param {*} target The value to search for.
  1583. * @param {Function} comparator The comparator invoked per element.
  1584. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1585. */
  1586. function arrayIncludesWith(array, value, comparator) {
  1587. var index = -1,
  1588. length = array == null ? 0 : array.length;
  1589. while (++index < length) {
  1590. if (comparator(value, array[index])) {
  1591. return true;
  1592. }
  1593. }
  1594. return false;
  1595. }
  1596. /**
  1597. * A specialized version of `_.map` for arrays without support for iteratee
  1598. * shorthands.
  1599. *
  1600. * @private
  1601. * @param {Array} [array] The array to iterate over.
  1602. * @param {Function} iteratee The function invoked per iteration.
  1603. * @returns {Array} Returns the new mapped array.
  1604. */
  1605. function arrayMap(array, iteratee) {
  1606. var index = -1,
  1607. length = array == null ? 0 : array.length,
  1608. result = Array(length);
  1609. while (++index < length) {
  1610. result[index] = iteratee(array[index], index, array);
  1611. }
  1612. return result;
  1613. }
  1614. /**
  1615. * Appends the elements of `values` to `array`.
  1616. *
  1617. * @private
  1618. * @param {Array} array The array to modify.
  1619. * @param {Array} values The values to append.
  1620. * @returns {Array} Returns `array`.
  1621. */
  1622. function arrayPush(array, values) {
  1623. var index = -1,
  1624. length = values.length,
  1625. offset = array.length;
  1626. while (++index < length) {
  1627. array[offset + index] = values[index];
  1628. }
  1629. return array;
  1630. }
  1631. /**
  1632. * A specialized version of `_.reduce` for arrays without support for
  1633. * iteratee shorthands.
  1634. *
  1635. * @private
  1636. * @param {Array} [array] The array to iterate over.
  1637. * @param {Function} iteratee The function invoked per iteration.
  1638. * @param {*} [accumulator] The initial value.
  1639. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1640. * the initial value.
  1641. * @returns {*} Returns the accumulated value.
  1642. */
  1643. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1644. var index = -1,
  1645. length = array == null ? 0 : array.length;
  1646. if (initAccum && length) {
  1647. accumulator = array[++index];
  1648. }
  1649. while (++index < length) {
  1650. accumulator = iteratee(accumulator, array[index], index, array);
  1651. }
  1652. return accumulator;
  1653. }
  1654. /**
  1655. * A specialized version of `_.reduceRight` for arrays without support for
  1656. * iteratee shorthands.
  1657. *
  1658. * @private
  1659. * @param {Array} [array] The array to iterate over.
  1660. * @param {Function} iteratee The function invoked per iteration.
  1661. * @param {*} [accumulator] The initial value.
  1662. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1663. * the initial value.
  1664. * @returns {*} Returns the accumulated value.
  1665. */
  1666. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1667. var length = array == null ? 0 : array.length;
  1668. if (initAccum && length) {
  1669. accumulator = array[--length];
  1670. }
  1671. while (length--) {
  1672. accumulator = iteratee(accumulator, array[length], length, array);
  1673. }
  1674. return accumulator;
  1675. }
  1676. /**
  1677. * A specialized version of `_.some` for arrays without support for iteratee
  1678. * shorthands.
  1679. *
  1680. * @private
  1681. * @param {Array} [array] The array to iterate over.
  1682. * @param {Function} predicate The function invoked per iteration.
  1683. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1684. * else `false`.
  1685. */
  1686. function arraySome(array, predicate) {
  1687. var index = -1,
  1688. length = array == null ? 0 : array.length;
  1689. while (++index < length) {
  1690. if (predicate(array[index], index, array)) {
  1691. return true;
  1692. }
  1693. }
  1694. return false;
  1695. }
  1696. /**
  1697. * Gets the size of an ASCII `string`.
  1698. *
  1699. * @private
  1700. * @param {string} string The string inspect.
  1701. * @returns {number} Returns the string size.
  1702. */
  1703. var asciiSize = baseProperty('length');
  1704. /**
  1705. * Converts an ASCII `string` to an array.
  1706. *
  1707. * @private
  1708. * @param {string} string The string to convert.
  1709. * @returns {Array} Returns the converted array.
  1710. */
  1711. function asciiToArray(string) {
  1712. return string.split('');
  1713. }
  1714. /**
  1715. * Splits an ASCII `string` into an array of its words.
  1716. *
  1717. * @private
  1718. * @param {string} The string to inspect.
  1719. * @returns {Array} Returns the words of `string`.
  1720. */
  1721. function asciiWords(string) {
  1722. return string.match(reAsciiWord) || [];
  1723. }
  1724. /**
  1725. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1726. * without support for iteratee shorthands, which iterates over `collection`
  1727. * using `eachFunc`.
  1728. *
  1729. * @private
  1730. * @param {Array|Object} collection The collection to inspect.
  1731. * @param {Function} predicate The function invoked per iteration.
  1732. * @param {Function} eachFunc The function to iterate over `collection`.
  1733. * @returns {*} Returns the found element or its key, else `undefined`.
  1734. */
  1735. function baseFindKey(collection, predicate, eachFunc) {
  1736. var result;
  1737. eachFunc(collection, function(value, key, collection) {
  1738. if (predicate(value, key, collection)) {
  1739. result = key;
  1740. return false;
  1741. }
  1742. });
  1743. return result;
  1744. }
  1745. /**
  1746. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1747. * support for iteratee shorthands.
  1748. *
  1749. * @private
  1750. * @param {Array} array The array to inspect.
  1751. * @param {Function} predicate The function invoked per iteration.
  1752. * @param {number} fromIndex The index to search from.
  1753. * @param {boolean} [fromRight] Specify iterating from right to left.
  1754. * @returns {number} Returns the index of the matched value, else `-1`.
  1755. */
  1756. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1757. var length = array.length,
  1758. index = fromIndex + (fromRight ? 1 : -1);
  1759. while ((fromRight ? index-- : ++index < length)) {
  1760. if (predicate(array[index], index, array)) {
  1761. return index;
  1762. }
  1763. }
  1764. return -1;
  1765. }
  1766. /**
  1767. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1768. *
  1769. * @private
  1770. * @param {Array} array The array to inspect.
  1771. * @param {*} value The value to search for.
  1772. * @param {number} fromIndex The index to search from.
  1773. * @returns {number} Returns the index of the matched value, else `-1`.
  1774. */
  1775. function baseIndexOf(array, value, fromIndex) {
  1776. return value === value
  1777. ? strictIndexOf(array, value, fromIndex)
  1778. : baseFindIndex(array, baseIsNaN, fromIndex);
  1779. }
  1780. /**
  1781. * This function is like `baseIndexOf` except that it accepts a comparator.
  1782. *
  1783. * @private
  1784. * @param {Array} array The array to inspect.
  1785. * @param {*} value The value to search for.
  1786. * @param {number} fromIndex The index to search from.
  1787. * @param {Function} comparator The comparator invoked per element.
  1788. * @returns {number} Returns the index of the matched value, else `-1`.
  1789. */
  1790. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1791. var index = fromIndex - 1,
  1792. length = array.length;
  1793. while (++index < length) {
  1794. if (comparator(array[index], value)) {
  1795. return index;
  1796. }
  1797. }
  1798. return -1;
  1799. }
  1800. /**
  1801. * The base implementation of `_.isNaN` without support for number objects.
  1802. *
  1803. * @private
  1804. * @param {*} value The value to check.
  1805. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1806. */
  1807. function baseIsNaN(value) {
  1808. return value !== value;
  1809. }
  1810. /**
  1811. * The base implementation of `_.mean` and `_.meanBy` without support for
  1812. * iteratee shorthands.
  1813. *
  1814. * @private
  1815. * @param {Array} array The array to iterate over.
  1816. * @param {Function} iteratee The function invoked per iteration.
  1817. * @returns {number} Returns the mean.
  1818. */
  1819. function baseMean(array, iteratee) {
  1820. var length = array == null ? 0 : array.length;
  1821. return length ? (baseSum(array, iteratee) / length) : NAN;
  1822. }
  1823. /**
  1824. * The base implementation of `_.property` without support for deep paths.
  1825. *
  1826. * @private
  1827. * @param {string} key The key of the property to get.
  1828. * @returns {Function} Returns the new accessor function.
  1829. */
  1830. function baseProperty(key) {
  1831. return function(object) {
  1832. return object == null ? undefined : object[key];
  1833. };
  1834. }
  1835. /**
  1836. * The base implementation of `_.propertyOf` without support for deep paths.
  1837. *
  1838. * @private
  1839. * @param {Object} object The object to query.
  1840. * @returns {Function} Returns the new accessor function.
  1841. */
  1842. function basePropertyOf(object) {
  1843. return function(key) {
  1844. return object == null ? undefined : object[key];
  1845. };
  1846. }
  1847. /**
  1848. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1849. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1850. *
  1851. * @private
  1852. * @param {Array|Object} collection The collection to iterate over.
  1853. * @param {Function} iteratee The function invoked per iteration.
  1854. * @param {*} accumulator The initial value.
  1855. * @param {boolean} initAccum Specify using the first or last element of
  1856. * `collection` as the initial value.
  1857. * @param {Function} eachFunc The function to iterate over `collection`.
  1858. * @returns {*} Returns the accumulated value.
  1859. */
  1860. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1861. eachFunc(collection, function(value, index, collection) {
  1862. accumulator = initAccum
  1863. ? (initAccum = false, value)
  1864. : iteratee(accumulator, value, index, collection);
  1865. });
  1866. return accumulator;
  1867. }
  1868. /**
  1869. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1870. * sort order of `array` and replaces criteria objects with their corresponding
  1871. * values.
  1872. *
  1873. * @private
  1874. * @param {Array} array The array to sort.
  1875. * @param {Function} comparer The function to define sort order.
  1876. * @returns {Array} Returns `array`.
  1877. */
  1878. function baseSortBy(array, comparer) {
  1879. var length = array.length;
  1880. array.sort(comparer);
  1881. while (length--) {
  1882. array[length] = array[length].value;
  1883. }
  1884. return array;
  1885. }
  1886. /**
  1887. * The base implementation of `_.sum` and `_.sumBy` without support for
  1888. * iteratee shorthands.
  1889. *
  1890. * @private
  1891. * @param {Array} array The array to iterate over.
  1892. * @param {Function} iteratee The function invoked per iteration.
  1893. * @returns {number} Returns the sum.
  1894. */
  1895. function baseSum(array, iteratee) {
  1896. var result,
  1897. index = -1,
  1898. length = array.length;
  1899. while (++index < length) {
  1900. var current = iteratee(array[index]);
  1901. if (current !== undefined) {
  1902. result = result === undefined ? current : (result + current);
  1903. }
  1904. }
  1905. return result;
  1906. }
  1907. /**
  1908. * The base implementation of `_.times` without support for iteratee shorthands
  1909. * or max array length checks.
  1910. *
  1911. * @private
  1912. * @param {number} n The number of times to invoke `iteratee`.
  1913. * @param {Function} iteratee The function invoked per iteration.
  1914. * @returns {Array} Returns the array of results.
  1915. */
  1916. function baseTimes(n, iteratee) {
  1917. var index = -1,
  1918. result = Array(n);
  1919. while (++index < n) {
  1920. result[index] = iteratee(index);
  1921. }
  1922. return result;
  1923. }
  1924. /**
  1925. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  1926. * of key-value pairs for `object` corresponding to the property names of `props`.
  1927. *
  1928. * @private
  1929. * @param {Object} object The object to query.
  1930. * @param {Array} props The property names to get values for.
  1931. * @returns {Object} Returns the key-value pairs.
  1932. */
  1933. function baseToPairs(object, props) {
  1934. return arrayMap(props, function(key) {
  1935. return [key, object[key]];
  1936. });
  1937. }
  1938. /**
  1939. * The base implementation of `_.trim`.
  1940. *
  1941. * @private
  1942. * @param {string} string The string to trim.
  1943. * @returns {string} Returns the trimmed string.
  1944. */
  1945. function baseTrim(string) {
  1946. return string
  1947. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  1948. : string;
  1949. }
  1950. /**
  1951. * The base implementation of `_.unary` without support for storing metadata.
  1952. *
  1953. * @private
  1954. * @param {Function} func The function to cap arguments for.
  1955. * @returns {Function} Returns the new capped function.
  1956. */
  1957. function baseUnary(func) {
  1958. return function(value) {
  1959. return func(value);
  1960. };
  1961. }
  1962. /**
  1963. * The base implementation of `_.values` and `_.valuesIn` which creates an
  1964. * array of `object` property values corresponding to the property names
  1965. * of `props`.
  1966. *
  1967. * @private
  1968. * @param {Object} object The object to query.
  1969. * @param {Array} props The property names to get values for.
  1970. * @returns {Object} Returns the array of property values.
  1971. */
  1972. function baseValues(object, props) {
  1973. return arrayMap(props, function(key) {
  1974. return object[key];
  1975. });
  1976. }
  1977. /**
  1978. * Checks if a `cache` value for `key` exists.
  1979. *
  1980. * @private
  1981. * @param {Object} cache The cache to query.
  1982. * @param {string} key The key of the entry to check.
  1983. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1984. */
  1985. function cacheHas(cache, key) {
  1986. return cache.has(key);
  1987. }
  1988. /**
  1989. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  1990. * that is not found in the character symbols.
  1991. *
  1992. * @private
  1993. * @param {Array} strSymbols The string symbols to inspect.
  1994. * @param {Array} chrSymbols The character symbols to find.
  1995. * @returns {number} Returns the index of the first unmatched string symbol.
  1996. */
  1997. function charsStartIndex(strSymbols, chrSymbols) {
  1998. var index = -1,
  1999. length = strSymbols.length;
  2000. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2001. return index;
  2002. }
  2003. /**
  2004. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2005. * that is not found in the character symbols.
  2006. *
  2007. * @private
  2008. * @param {Array} strSymbols The string symbols to inspect.
  2009. * @param {Array} chrSymbols The character symbols to find.
  2010. * @returns {number} Returns the index of the last unmatched string symbol.
  2011. */
  2012. function charsEndIndex(strSymbols, chrSymbols) {
  2013. var index = strSymbols.length;
  2014. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2015. return index;
  2016. }
  2017. /**
  2018. * Gets the number of `placeholder` occurrences in `array`.
  2019. *
  2020. * @private
  2021. * @param {Array} array The array to inspect.
  2022. * @param {*} placeholder The placeholder to search for.
  2023. * @returns {number} Returns the placeholder count.
  2024. */
  2025. function countHolders(array, placeholder) {
  2026. var length = array.length,
  2027. result = 0;
  2028. while (length--) {
  2029. if (array[length] === placeholder) {
  2030. ++result;
  2031. }
  2032. }
  2033. return result;
  2034. }
  2035. /**
  2036. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2037. * letters to basic Latin letters.
  2038. *
  2039. * @private
  2040. * @param {string} letter The matched letter to deburr.
  2041. * @returns {string} Returns the deburred letter.
  2042. */
  2043. var deburrLetter = basePropertyOf(deburredLetters);
  2044. /**
  2045. * Used by `_.escape` to convert characters to HTML entities.
  2046. *
  2047. * @private
  2048. * @param {string} chr The matched character to escape.
  2049. * @returns {string} Returns the escaped character.
  2050. */
  2051. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2052. /**
  2053. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2054. *
  2055. * @private
  2056. * @param {string} chr The matched character to escape.
  2057. * @returns {string} Returns the escaped character.
  2058. */
  2059. function escapeStringChar(chr) {
  2060. return '\\' + stringEscapes[chr];
  2061. }
  2062. /**
  2063. * Gets the value at `key` of `object`.
  2064. *
  2065. * @private
  2066. * @param {Object} [object] The object to query.
  2067. * @param {string} key The key of the property to get.
  2068. * @returns {*} Returns the property value.
  2069. */
  2070. function getValue(object, key) {
  2071. return object == null ? undefined : object[key];
  2072. }
  2073. /**
  2074. * Checks if `string` contains Unicode symbols.
  2075. *
  2076. * @private
  2077. * @param {string} string The string to inspect.
  2078. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2079. */
  2080. function hasUnicode(string) {
  2081. return reHasUnicode.test(string);
  2082. }
  2083. /**
  2084. * Checks if `string` contains a word composed of Unicode symbols.
  2085. *
  2086. * @private
  2087. * @param {string} string The string to inspect.
  2088. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2089. */
  2090. function hasUnicodeWord(string) {
  2091. return reHasUnicodeWord.test(string);
  2092. }
  2093. /**
  2094. * Converts `iterator` to an array.
  2095. *
  2096. * @private
  2097. * @param {Object} iterator The iterator to convert.
  2098. * @returns {Array} Returns the converted array.
  2099. */
  2100. function iteratorToArray(iterator) {
  2101. var data,
  2102. result = [];
  2103. while (!(data = iterator.next()).done) {
  2104. result.push(data.value);
  2105. }
  2106. return result;
  2107. }
  2108. /**
  2109. * Converts `map` to its key-value pairs.
  2110. *
  2111. * @private
  2112. * @param {Object} map The map to convert.
  2113. * @returns {Array} Returns the key-value pairs.
  2114. */
  2115. function mapToArray(map) {
  2116. var index = -1,
  2117. result = Array(map.size);
  2118. map.forEach(function(value, key) {
  2119. result[++index] = [key, value];
  2120. });
  2121. return result;
  2122. }
  2123. /**
  2124. * Creates a unary function that invokes `func` with its argument transformed.
  2125. *
  2126. * @private
  2127. * @param {Function} func The function to wrap.
  2128. * @param {Function} transform The argument transform.
  2129. * @returns {Function} Returns the new function.
  2130. */
  2131. function overArg(func, transform) {
  2132. return function(arg) {
  2133. return func(transform(arg));
  2134. };
  2135. }
  2136. /**
  2137. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2138. * and returns an array of their indexes.
  2139. *
  2140. * @private
  2141. * @param {Array} array The array to modify.
  2142. * @param {*} placeholder The placeholder to replace.
  2143. * @returns {Array} Returns the new array of placeholder indexes.
  2144. */
  2145. function replaceHolders(array, placeholder) {
  2146. var index = -1,
  2147. length = array.length,
  2148. resIndex = 0,
  2149. result = [];
  2150. while (++index < length) {
  2151. var value = array[index];
  2152. if (value === placeholder || value === PLACEHOLDER) {
  2153. array[index] = PLACEHOLDER;
  2154. result[resIndex++] = index;
  2155. }
  2156. }
  2157. return result;
  2158. }
  2159. /**
  2160. * Converts `set` to an array of its values.
  2161. *
  2162. * @private
  2163. * @param {Object} set The set to convert.
  2164. * @returns {Array} Returns the values.
  2165. */
  2166. function setToArray(set) {
  2167. var index = -1,
  2168. result = Array(set.size);
  2169. set.forEach(function(value) {
  2170. result[++index] = value;
  2171. });
  2172. return result;
  2173. }
  2174. /**
  2175. * Converts `set` to its value-value pairs.
  2176. *
  2177. * @private
  2178. * @param {Object} set The set to convert.
  2179. * @returns {Array} Returns the value-value pairs.
  2180. */
  2181. function setToPairs(set) {
  2182. var index = -1,
  2183. result = Array(set.size);
  2184. set.forEach(function(value) {
  2185. result[++index] = [value, value];
  2186. });
  2187. return result;
  2188. }
  2189. /**
  2190. * A specialized version of `_.indexOf` which performs strict equality
  2191. * comparisons of values, i.e. `===`.
  2192. *
  2193. * @private
  2194. * @param {Array} array The array to inspect.
  2195. * @param {*} value The value to search for.
  2196. * @param {number} fromIndex The index to search from.
  2197. * @returns {number} Returns the index of the matched value, else `-1`.
  2198. */
  2199. function strictIndexOf(array, value, fromIndex) {
  2200. var index = fromIndex - 1,
  2201. length = array.length;
  2202. while (++index < length) {
  2203. if (array[index] === value) {
  2204. return index;
  2205. }
  2206. }
  2207. return -1;
  2208. }
  2209. /**
  2210. * A specialized version of `_.lastIndexOf` which performs strict equality
  2211. * comparisons of values, i.e. `===`.
  2212. *
  2213. * @private
  2214. * @param {Array} array The array to inspect.
  2215. * @param {*} value The value to search for.
  2216. * @param {number} fromIndex The index to search from.
  2217. * @returns {number} Returns the index of the matched value, else `-1`.
  2218. */
  2219. function strictLastIndexOf(array, value, fromIndex) {
  2220. var index = fromIndex + 1;
  2221. while (index--) {
  2222. if (array[index] === value) {
  2223. return index;
  2224. }
  2225. }
  2226. return index;
  2227. }
  2228. /**
  2229. * Gets the number of symbols in `string`.
  2230. *
  2231. * @private
  2232. * @param {string} string The string to inspect.
  2233. * @returns {number} Returns the string size.
  2234. */
  2235. function stringSize(string) {
  2236. return hasUnicode(string)
  2237. ? unicodeSize(string)
  2238. : asciiSize(string);
  2239. }
  2240. /**
  2241. * Converts `string` to an array.
  2242. *
  2243. * @private
  2244. * @param {string} string The string to convert.
  2245. * @returns {Array} Returns the converted array.
  2246. */
  2247. function stringToArray(string) {
  2248. return hasUnicode(string)
  2249. ? unicodeToArray(string)
  2250. : asciiToArray(string);
  2251. }
  2252. /**
  2253. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2254. * character of `string`.
  2255. *
  2256. * @private
  2257. * @param {string} string The string to inspect.
  2258. * @returns {number} Returns the index of the last non-whitespace character.
  2259. */
  2260. function trimmedEndIndex(string) {
  2261. var index = string.length;
  2262. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2263. return index;
  2264. }
  2265. /**
  2266. * Used by `_.unescape` to convert HTML entities to characters.
  2267. *
  2268. * @private
  2269. * @param {string} chr The matched character to unescape.
  2270. * @returns {string} Returns the unescaped character.
  2271. */
  2272. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2273. /**
  2274. * Gets the size of a Unicode `string`.
  2275. *
  2276. * @private
  2277. * @param {string} string The string inspect.
  2278. * @returns {number} Returns the string size.
  2279. */
  2280. function unicodeSize(string) {
  2281. var result = reUnicode.lastIndex = 0;
  2282. while (reUnicode.test(string)) {
  2283. ++result;
  2284. }
  2285. return result;
  2286. }
  2287. /**
  2288. * Converts a Unicode `string` to an array.
  2289. *
  2290. * @private
  2291. * @param {string} string The string to convert.
  2292. * @returns {Array} Returns the converted array.
  2293. */
  2294. function unicodeToArray(string) {
  2295. return string.match(reUnicode) || [];
  2296. }
  2297. /**
  2298. * Splits a Unicode `string` into an array of its words.
  2299. *
  2300. * @private
  2301. * @param {string} The string to inspect.
  2302. * @returns {Array} Returns the words of `string`.
  2303. */
  2304. function unicodeWords(string) {
  2305. return string.match(reUnicodeWord) || [];
  2306. }
  2307. /*--------------------------------------------------------------------------*/
  2308. /**
  2309. * Create a new pristine `lodash` function using the `context` object.
  2310. *
  2311. * @static
  2312. * @memberOf _
  2313. * @since 1.1.0
  2314. * @category Util
  2315. * @param {Object} [context=root] The context object.
  2316. * @returns {Function} Returns a new `lodash` function.
  2317. * @example
  2318. *
  2319. * _.mixin({ 'foo': _.constant('foo') });
  2320. *
  2321. * var lodash = _.runInContext();
  2322. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2323. *
  2324. * _.isFunction(_.foo);
  2325. * // => true
  2326. * _.isFunction(_.bar);
  2327. * // => false
  2328. *
  2329. * lodash.isFunction(lodash.foo);
  2330. * // => false
  2331. * lodash.isFunction(lodash.bar);
  2332. * // => true
  2333. *
  2334. * // Create a suped-up `defer` in Node.js.
  2335. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2336. */
  2337. var runInContext = (function runInContext(context) {
  2338. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2339. /** Built-in constructor references. */
  2340. var Array = context.Array,
  2341. Date = context.Date,
  2342. Error = context.Error,
  2343. Function = context.Function,
  2344. Math = context.Math,
  2345. Object = context.Object,
  2346. RegExp = context.RegExp,
  2347. String = context.String,
  2348. TypeError = context.TypeError;
  2349. /** Used for built-in method references. */
  2350. var arrayProto = Array.prototype,
  2351. funcProto = Function.prototype,
  2352. objectProto = Object.prototype;
  2353. /** Used to detect overreaching core-js shims. */
  2354. var coreJsData = context['__core-js_shared__'];
  2355. /** Used to resolve the decompiled source of functions. */
  2356. var funcToString = funcProto.toString;
  2357. /** Used to check objects for own properties. */
  2358. var hasOwnProperty = objectProto.hasOwnProperty;
  2359. /** Used to generate unique IDs. */
  2360. var idCounter = 0;
  2361. /** Used to detect methods masquerading as native. */
  2362. var maskSrcKey = (function() {
  2363. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2364. return uid ? ('Symbol(src)_1.' + uid) : '';
  2365. }());
  2366. /**
  2367. * Used to resolve the
  2368. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2369. * of values.
  2370. */
  2371. var nativeObjectToString = objectProto.toString;
  2372. /** Used to infer the `Object` constructor. */
  2373. var objectCtorString = funcToString.call(Object);
  2374. /** Used to restore the original `_` reference in `_.noConflict`. */
  2375. var oldDash = root._;
  2376. /** Used to detect if a method is native. */
  2377. var reIsNative = RegExp('^' +
  2378. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2379. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2380. );
  2381. /** Built-in value references. */
  2382. var Buffer = moduleExports ? context.Buffer : undefined,
  2383. Symbol = context.Symbol,
  2384. Uint8Array = context.Uint8Array,
  2385. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2386. getPrototype = overArg(Object.getPrototypeOf, Object),
  2387. objectCreate = Object.create,
  2388. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2389. splice = arrayProto.splice,
  2390. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2391. symIterator = Symbol ? Symbol.iterator : undefined,
  2392. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2393. var defineProperty = (function() {
  2394. try {
  2395. var func = getNative(Object, 'defineProperty');
  2396. func({}, '', {});
  2397. return func;
  2398. } catch (e) {}
  2399. }());
  2400. /** Mocked built-ins. */
  2401. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2402. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2403. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2404. /* Built-in method references for those with the same name as other `lodash` methods. */
  2405. var nativeCeil = Math.ceil,
  2406. nativeFloor = Math.floor,
  2407. nativeGetSymbols = Object.getOwnPropertySymbols,
  2408. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2409. nativeIsFinite = context.isFinite,
  2410. nativeJoin = arrayProto.join,
  2411. nativeKeys = overArg(Object.keys, Object),
  2412. nativeMax = Math.max,
  2413. nativeMin = Math.min,
  2414. nativeNow = Date.now,
  2415. nativeParseInt = context.parseInt,
  2416. nativeRandom = Math.random,
  2417. nativeReverse = arrayProto.reverse;
  2418. /* Built-in method references that are verified to be native. */
  2419. var DataView = getNative(context, 'DataView'),
  2420. Map = getNative(context, 'Map'),
  2421. Promise = getNative(context, 'Promise'),
  2422. Set = getNative(context, 'Set'),
  2423. WeakMap = getNative(context, 'WeakMap'),
  2424. nativeCreate = getNative(Object, 'create');
  2425. /** Used to store function metadata. */
  2426. var metaMap = WeakMap && new WeakMap;
  2427. /** Used to lookup unminified function names. */
  2428. var realNames = {};
  2429. /** Used to detect maps, sets, and weakmaps. */
  2430. var dataViewCtorString = toSource(DataView),
  2431. mapCtorString = toSource(Map),
  2432. promiseCtorString = toSource(Promise),
  2433. setCtorString = toSource(Set),
  2434. weakMapCtorString = toSource(WeakMap);
  2435. /** Used to convert symbols to primitives and strings. */
  2436. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2437. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2438. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2439. /*------------------------------------------------------------------------*/
  2440. /**
  2441. * Creates a `lodash` object which wraps `value` to enable implicit method
  2442. * chain sequences. Methods that operate on and return arrays, collections,
  2443. * and functions can be chained together. Methods that retrieve a single value
  2444. * or may return a primitive value will automatically end the chain sequence
  2445. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2446. * with `_#value`.
  2447. *
  2448. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2449. * enabled using `_.chain`.
  2450. *
  2451. * The execution of chained methods is lazy, that is, it's deferred until
  2452. * `_#value` is implicitly or explicitly called.
  2453. *
  2454. * Lazy evaluation allows several methods to support shortcut fusion.
  2455. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2456. * the creation of intermediate arrays and can greatly reduce the number of
  2457. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2458. * fusion if the section is applied to an array and iteratees accept only
  2459. * one argument. The heuristic for whether a section qualifies for shortcut
  2460. * fusion is subject to change.
  2461. *
  2462. * Chaining is supported in custom builds as long as the `_#value` method is
  2463. * directly or indirectly included in the build.
  2464. *
  2465. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2466. *
  2467. * The wrapper `Array` methods are:
  2468. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2469. *
  2470. * The wrapper `String` methods are:
  2471. * `replace` and `split`
  2472. *
  2473. * The wrapper methods that support shortcut fusion are:
  2474. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2475. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2476. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2477. *
  2478. * The chainable wrapper methods are:
  2479. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2480. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2481. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2482. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2483. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2484. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2485. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2486. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2487. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2488. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2489. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2490. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2491. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2492. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2493. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2494. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2495. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2496. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2497. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2498. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2499. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2500. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2501. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2502. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2503. *
  2504. * The wrapper methods that are **not** chainable by default are:
  2505. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2506. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2507. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2508. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2509. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2510. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2511. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2512. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2513. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2514. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2515. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2516. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2517. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2518. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2519. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2520. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2521. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2522. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2523. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2524. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2525. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2526. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2527. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2528. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2529. * `upperFirst`, `value`, and `words`
  2530. *
  2531. * @name _
  2532. * @constructor
  2533. * @category Seq
  2534. * @param {*} value The value to wrap in a `lodash` instance.
  2535. * @returns {Object} Returns the new `lodash` wrapper instance.
  2536. * @example
  2537. *
  2538. * function square(n) {
  2539. * return n * n;
  2540. * }
  2541. *
  2542. * var wrapped = _([1, 2, 3]);
  2543. *
  2544. * // Returns an unwrapped value.
  2545. * wrapped.reduce(_.add);
  2546. * // => 6
  2547. *
  2548. * // Returns a wrapped value.
  2549. * var squares = wrapped.map(square);
  2550. *
  2551. * _.isArray(squares);
  2552. * // => false
  2553. *
  2554. * _.isArray(squares.value());
  2555. * // => true
  2556. */
  2557. function lodash(value) {
  2558. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2559. if (value instanceof LodashWrapper) {
  2560. return value;
  2561. }
  2562. if (hasOwnProperty.call(value, '__wrapped__')) {
  2563. return wrapperClone(value);
  2564. }
  2565. }
  2566. return new LodashWrapper(value);
  2567. }
  2568. /**
  2569. * The base implementation of `_.create` without support for assigning
  2570. * properties to the created object.
  2571. *
  2572. * @private
  2573. * @param {Object} proto The object to inherit from.
  2574. * @returns {Object} Returns the new object.
  2575. */
  2576. var baseCreate = (function() {
  2577. function object() {}
  2578. return function(proto) {
  2579. if (!isObject(proto)) {
  2580. return {};
  2581. }
  2582. if (objectCreate) {
  2583. return objectCreate(proto);
  2584. }
  2585. object.prototype = proto;
  2586. var result = new object;
  2587. object.prototype = undefined;
  2588. return result;
  2589. };
  2590. }());
  2591. /**
  2592. * The function whose prototype chain sequence wrappers inherit from.
  2593. *
  2594. * @private
  2595. */
  2596. function baseLodash() {
  2597. // No operation performed.
  2598. }
  2599. /**
  2600. * The base constructor for creating `lodash` wrapper objects.
  2601. *
  2602. * @private
  2603. * @param {*} value The value to wrap.
  2604. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2605. */
  2606. function LodashWrapper(value, chainAll) {
  2607. this.__wrapped__ = value;
  2608. this.__actions__ = [];
  2609. this.__chain__ = !!chainAll;
  2610. this.__index__ = 0;
  2611. this.__values__ = undefined;
  2612. }
  2613. /**
  2614. * By default, the template delimiters used by lodash are like those in
  2615. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2616. * following template settings to use alternative delimiters.
  2617. *
  2618. * @static
  2619. * @memberOf _
  2620. * @type {Object}
  2621. */
  2622. lodash.templateSettings = {
  2623. /**
  2624. * Used to detect `data` property values to be HTML-escaped.
  2625. *
  2626. * @memberOf _.templateSettings
  2627. * @type {RegExp}
  2628. */
  2629. 'escape': reEscape,
  2630. /**
  2631. * Used to detect code to be evaluated.
  2632. *
  2633. * @memberOf _.templateSettings
  2634. * @type {RegExp}
  2635. */
  2636. 'evaluate': reEvaluate,
  2637. /**
  2638. * Used to detect `data` property values to inject.
  2639. *
  2640. * @memberOf _.templateSettings
  2641. * @type {RegExp}
  2642. */
  2643. 'interpolate': reInterpolate,
  2644. /**
  2645. * Used to reference the data object in the template text.
  2646. *
  2647. * @memberOf _.templateSettings
  2648. * @type {string}
  2649. */
  2650. 'variable': '',
  2651. /**
  2652. * Used to import variables into the compiled template.
  2653. *
  2654. * @memberOf _.templateSettings
  2655. * @type {Object}
  2656. */
  2657. 'imports': {
  2658. /**
  2659. * A reference to the `lodash` function.
  2660. *
  2661. * @memberOf _.templateSettings.imports
  2662. * @type {Function}
  2663. */
  2664. '_': lodash
  2665. }
  2666. };
  2667. // Ensure wrappers are instances of `baseLodash`.
  2668. lodash.prototype = baseLodash.prototype;
  2669. lodash.prototype.constructor = lodash;
  2670. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2671. LodashWrapper.prototype.constructor = LodashWrapper;
  2672. /*------------------------------------------------------------------------*/
  2673. /**
  2674. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2675. *
  2676. * @private
  2677. * @constructor
  2678. * @param {*} value The value to wrap.
  2679. */
  2680. function LazyWrapper(value) {
  2681. this.__wrapped__ = value;
  2682. this.__actions__ = [];
  2683. this.__dir__ = 1;
  2684. this.__filtered__ = false;
  2685. this.__iteratees__ = [];
  2686. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2687. this.__views__ = [];
  2688. }
  2689. /**
  2690. * Creates a clone of the lazy wrapper object.
  2691. *
  2692. * @private
  2693. * @name clone
  2694. * @memberOf LazyWrapper
  2695. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2696. */
  2697. function lazyClone() {
  2698. var result = new LazyWrapper(this.__wrapped__);
  2699. result.__actions__ = copyArray(this.__actions__);
  2700. result.__dir__ = this.__dir__;
  2701. result.__filtered__ = this.__filtered__;
  2702. result.__iteratees__ = copyArray(this.__iteratees__);
  2703. result.__takeCount__ = this.__takeCount__;
  2704. result.__views__ = copyArray(this.__views__);
  2705. return result;
  2706. }
  2707. /**
  2708. * Reverses the direction of lazy iteration.
  2709. *
  2710. * @private
  2711. * @name reverse
  2712. * @memberOf LazyWrapper
  2713. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2714. */
  2715. function lazyReverse() {
  2716. if (this.__filtered__) {
  2717. var result = new LazyWrapper(this);
  2718. result.__dir__ = -1;
  2719. result.__filtered__ = true;
  2720. } else {
  2721. result = this.clone();
  2722. result.__dir__ *= -1;
  2723. }
  2724. return result;
  2725. }
  2726. /**
  2727. * Extracts the unwrapped value from its lazy wrapper.
  2728. *
  2729. * @private
  2730. * @name value
  2731. * @memberOf LazyWrapper
  2732. * @returns {*} Returns the unwrapped value.
  2733. */
  2734. function lazyValue() {
  2735. var array = this.__wrapped__.value(),
  2736. dir = this.__dir__,
  2737. isArr = isArray(array),
  2738. isRight = dir < 0,
  2739. arrLength = isArr ? array.length : 0,
  2740. view = getView(0, arrLength, this.__views__),
  2741. start = view.start,
  2742. end = view.end,
  2743. length = end - start,
  2744. index = isRight ? end : (start - 1),
  2745. iteratees = this.__iteratees__,
  2746. iterLength = iteratees.length,
  2747. resIndex = 0,
  2748. takeCount = nativeMin(length, this.__takeCount__);
  2749. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2750. return baseWrapperValue(array, this.__actions__);
  2751. }
  2752. var result = [];
  2753. outer:
  2754. while (length-- && resIndex < takeCount) {
  2755. index += dir;
  2756. var iterIndex = -1,
  2757. value = array[index];
  2758. while (++iterIndex < iterLength) {
  2759. var data = iteratees[iterIndex],
  2760. iteratee = data.iteratee,
  2761. type = data.type,
  2762. computed = iteratee(value);
  2763. if (type == LAZY_MAP_FLAG) {
  2764. value = computed;
  2765. } else if (!computed) {
  2766. if (type == LAZY_FILTER_FLAG) {
  2767. continue outer;
  2768. } else {
  2769. break outer;
  2770. }
  2771. }
  2772. }
  2773. result[resIndex++] = value;
  2774. }
  2775. return result;
  2776. }
  2777. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2778. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2779. LazyWrapper.prototype.constructor = LazyWrapper;
  2780. /*------------------------------------------------------------------------*/
  2781. /**
  2782. * Creates a hash object.
  2783. *
  2784. * @private
  2785. * @constructor
  2786. * @param {Array} [entries] The key-value pairs to cache.
  2787. */
  2788. function Hash(entries) {
  2789. var index = -1,
  2790. length = entries == null ? 0 : entries.length;
  2791. this.clear();
  2792. while (++index < length) {
  2793. var entry = entries[index];
  2794. this.set(entry[0], entry[1]);
  2795. }
  2796. }
  2797. /**
  2798. * Removes all key-value entries from the hash.
  2799. *
  2800. * @private
  2801. * @name clear
  2802. * @memberOf Hash
  2803. */
  2804. function hashClear() {
  2805. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2806. this.size = 0;
  2807. }
  2808. /**
  2809. * Removes `key` and its value from the hash.
  2810. *
  2811. * @private
  2812. * @name delete
  2813. * @memberOf Hash
  2814. * @param {Object} hash The hash to modify.
  2815. * @param {string} key The key of the value to remove.
  2816. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2817. */
  2818. function hashDelete(key) {
  2819. var result = this.has(key) && delete this.__data__[key];
  2820. this.size -= result ? 1 : 0;
  2821. return result;
  2822. }
  2823. /**
  2824. * Gets the hash value for `key`.
  2825. *
  2826. * @private
  2827. * @name get
  2828. * @memberOf Hash
  2829. * @param {string} key The key of the value to get.
  2830. * @returns {*} Returns the entry value.
  2831. */
  2832. function hashGet(key) {
  2833. var data = this.__data__;
  2834. if (nativeCreate) {
  2835. var result = data[key];
  2836. return result === HASH_UNDEFINED ? undefined : result;
  2837. }
  2838. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2839. }
  2840. /**
  2841. * Checks if a hash value for `key` exists.
  2842. *
  2843. * @private
  2844. * @name has
  2845. * @memberOf Hash
  2846. * @param {string} key The key of the entry to check.
  2847. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2848. */
  2849. function hashHas(key) {
  2850. var data = this.__data__;
  2851. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2852. }
  2853. /**
  2854. * Sets the hash `key` to `value`.
  2855. *
  2856. * @private
  2857. * @name set
  2858. * @memberOf Hash
  2859. * @param {string} key The key of the value to set.
  2860. * @param {*} value The value to set.
  2861. * @returns {Object} Returns the hash instance.
  2862. */
  2863. function hashSet(key, value) {
  2864. var data = this.__data__;
  2865. this.size += this.has(key) ? 0 : 1;
  2866. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2867. return this;
  2868. }
  2869. // Add methods to `Hash`.
  2870. Hash.prototype.clear = hashClear;
  2871. Hash.prototype['delete'] = hashDelete;
  2872. Hash.prototype.get = hashGet;
  2873. Hash.prototype.has = hashHas;
  2874. Hash.prototype.set = hashSet;
  2875. /*------------------------------------------------------------------------*/
  2876. /**
  2877. * Creates an list cache object.
  2878. *
  2879. * @private
  2880. * @constructor
  2881. * @param {Array} [entries] The key-value pairs to cache.
  2882. */
  2883. function ListCache(entries) {
  2884. var index = -1,
  2885. length = entries == null ? 0 : entries.length;
  2886. this.clear();
  2887. while (++index < length) {
  2888. var entry = entries[index];
  2889. this.set(entry[0], entry[1]);
  2890. }
  2891. }
  2892. /**
  2893. * Removes all key-value entries from the list cache.
  2894. *
  2895. * @private
  2896. * @name clear
  2897. * @memberOf ListCache
  2898. */
  2899. function listCacheClear() {
  2900. this.__data__ = [];
  2901. this.size = 0;
  2902. }
  2903. /**
  2904. * Removes `key` and its value from the list cache.
  2905. *
  2906. * @private
  2907. * @name delete
  2908. * @memberOf ListCache
  2909. * @param {string} key The key of the value to remove.
  2910. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2911. */
  2912. function listCacheDelete(key) {
  2913. var data = this.__data__,
  2914. index = assocIndexOf(data, key);
  2915. if (index < 0) {
  2916. return false;
  2917. }
  2918. var lastIndex = data.length - 1;
  2919. if (index == lastIndex) {
  2920. data.pop();
  2921. } else {
  2922. splice.call(data, index, 1);
  2923. }
  2924. --this.size;
  2925. return true;
  2926. }
  2927. /**
  2928. * Gets the list cache value for `key`.
  2929. *
  2930. * @private
  2931. * @name get
  2932. * @memberOf ListCache
  2933. * @param {string} key The key of the value to get.
  2934. * @returns {*} Returns the entry value.
  2935. */
  2936. function listCacheGet(key) {
  2937. var data = this.__data__,
  2938. index = assocIndexOf(data, key);
  2939. return index < 0 ? undefined : data[index][1];
  2940. }
  2941. /**
  2942. * Checks if a list cache value for `key` exists.
  2943. *
  2944. * @private
  2945. * @name has
  2946. * @memberOf ListCache
  2947. * @param {string} key The key of the entry to check.
  2948. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2949. */
  2950. function listCacheHas(key) {
  2951. return assocIndexOf(this.__data__, key) > -1;
  2952. }
  2953. /**
  2954. * Sets the list cache `key` to `value`.
  2955. *
  2956. * @private
  2957. * @name set
  2958. * @memberOf ListCache
  2959. * @param {string} key The key of the value to set.
  2960. * @param {*} value The value to set.
  2961. * @returns {Object} Returns the list cache instance.
  2962. */
  2963. function listCacheSet(key, value) {
  2964. var data = this.__data__,
  2965. index = assocIndexOf(data, key);
  2966. if (index < 0) {
  2967. ++this.size;
  2968. data.push([key, value]);
  2969. } else {
  2970. data[index][1] = value;
  2971. }
  2972. return this;
  2973. }
  2974. // Add methods to `ListCache`.
  2975. ListCache.prototype.clear = listCacheClear;
  2976. ListCache.prototype['delete'] = listCacheDelete;
  2977. ListCache.prototype.get = listCacheGet;
  2978. ListCache.prototype.has = listCacheHas;
  2979. ListCache.prototype.set = listCacheSet;
  2980. /*------------------------------------------------------------------------*/
  2981. /**
  2982. * Creates a map cache object to store key-value pairs.
  2983. *
  2984. * @private
  2985. * @constructor
  2986. * @param {Array} [entries] The key-value pairs to cache.
  2987. */
  2988. function MapCache(entries) {
  2989. var index = -1,
  2990. length = entries == null ? 0 : entries.length;
  2991. this.clear();
  2992. while (++index < length) {
  2993. var entry = entries[index];
  2994. this.set(entry[0], entry[1]);
  2995. }
  2996. }
  2997. /**
  2998. * Removes all key-value entries from the map.
  2999. *
  3000. * @private
  3001. * @name clear
  3002. * @memberOf MapCache
  3003. */
  3004. function mapCacheClear() {
  3005. this.size = 0;
  3006. this.__data__ = {
  3007. 'hash': new Hash,
  3008. 'map': new (Map || ListCache),
  3009. 'string': new Hash
  3010. };
  3011. }
  3012. /**
  3013. * Removes `key` and its value from the map.
  3014. *
  3015. * @private
  3016. * @name delete
  3017. * @memberOf MapCache
  3018. * @param {string} key The key of the value to remove.
  3019. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3020. */
  3021. function mapCacheDelete(key) {
  3022. var result = getMapData(this, key)['delete'](key);
  3023. this.size -= result ? 1 : 0;
  3024. return result;
  3025. }
  3026. /**
  3027. * Gets the map value for `key`.
  3028. *
  3029. * @private
  3030. * @name get
  3031. * @memberOf MapCache
  3032. * @param {string} key The key of the value to get.
  3033. * @returns {*} Returns the entry value.
  3034. */
  3035. function mapCacheGet(key) {
  3036. return getMapData(this, key).get(key);
  3037. }
  3038. /**
  3039. * Checks if a map value for `key` exists.
  3040. *
  3041. * @private
  3042. * @name has
  3043. * @memberOf MapCache
  3044. * @param {string} key The key of the entry to check.
  3045. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3046. */
  3047. function mapCacheHas(key) {
  3048. return getMapData(this, key).has(key);
  3049. }
  3050. /**
  3051. * Sets the map `key` to `value`.
  3052. *
  3053. * @private
  3054. * @name set
  3055. * @memberOf MapCache
  3056. * @param {string} key The key of the value to set.
  3057. * @param {*} value The value to set.
  3058. * @returns {Object} Returns the map cache instance.
  3059. */
  3060. function mapCacheSet(key, value) {
  3061. var data = getMapData(this, key),
  3062. size = data.size;
  3063. data.set(key, value);
  3064. this.size += data.size == size ? 0 : 1;
  3065. return this;
  3066. }
  3067. // Add methods to `MapCache`.
  3068. MapCache.prototype.clear = mapCacheClear;
  3069. MapCache.prototype['delete'] = mapCacheDelete;
  3070. MapCache.prototype.get = mapCacheGet;
  3071. MapCache.prototype.has = mapCacheHas;
  3072. MapCache.prototype.set = mapCacheSet;
  3073. /*------------------------------------------------------------------------*/
  3074. /**
  3075. *
  3076. * Creates an array cache object to store unique values.
  3077. *
  3078. * @private
  3079. * @constructor
  3080. * @param {Array} [values] The values to cache.
  3081. */
  3082. function SetCache(values) {
  3083. var index = -1,
  3084. length = values == null ? 0 : values.length;
  3085. this.__data__ = new MapCache;
  3086. while (++index < length) {
  3087. this.add(values[index]);
  3088. }
  3089. }
  3090. /**
  3091. * Adds `value` to the array cache.
  3092. *
  3093. * @private
  3094. * @name add
  3095. * @memberOf SetCache
  3096. * @alias push
  3097. * @param {*} value The value to cache.
  3098. * @returns {Object} Returns the cache instance.
  3099. */
  3100. function setCacheAdd(value) {
  3101. this.__data__.set(value, HASH_UNDEFINED);
  3102. return this;
  3103. }
  3104. /**
  3105. * Checks if `value` is in the array cache.
  3106. *
  3107. * @private
  3108. * @name has
  3109. * @memberOf SetCache
  3110. * @param {*} value The value to search for.
  3111. * @returns {number} Returns `true` if `value` is found, else `false`.
  3112. */
  3113. function setCacheHas(value) {
  3114. return this.__data__.has(value);
  3115. }
  3116. // Add methods to `SetCache`.
  3117. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3118. SetCache.prototype.has = setCacheHas;
  3119. /*------------------------------------------------------------------------*/
  3120. /**
  3121. * Creates a stack cache object to store key-value pairs.
  3122. *
  3123. * @private
  3124. * @constructor
  3125. * @param {Array} [entries] The key-value pairs to cache.
  3126. */
  3127. function Stack(entries) {
  3128. var data = this.__data__ = new ListCache(entries);
  3129. this.size = data.size;
  3130. }
  3131. /**
  3132. * Removes all key-value entries from the stack.
  3133. *
  3134. * @private
  3135. * @name clear
  3136. * @memberOf Stack
  3137. */
  3138. function stackClear() {
  3139. this.__data__ = new ListCache;
  3140. this.size = 0;
  3141. }
  3142. /**
  3143. * Removes `key` and its value from the stack.
  3144. *
  3145. * @private
  3146. * @name delete
  3147. * @memberOf Stack
  3148. * @param {string} key The key of the value to remove.
  3149. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3150. */
  3151. function stackDelete(key) {
  3152. var data = this.__data__,
  3153. result = data['delete'](key);
  3154. this.size = data.size;
  3155. return result;
  3156. }
  3157. /**
  3158. * Gets the stack value for `key`.
  3159. *
  3160. * @private
  3161. * @name get
  3162. * @memberOf Stack
  3163. * @param {string} key The key of the value to get.
  3164. * @returns {*} Returns the entry value.
  3165. */
  3166. function stackGet(key) {
  3167. return this.__data__.get(key);
  3168. }
  3169. /**
  3170. * Checks if a stack value for `key` exists.
  3171. *
  3172. * @private
  3173. * @name has
  3174. * @memberOf Stack
  3175. * @param {string} key The key of the entry to check.
  3176. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3177. */
  3178. function stackHas(key) {
  3179. return this.__data__.has(key);
  3180. }
  3181. /**
  3182. * Sets the stack `key` to `value`.
  3183. *
  3184. * @private
  3185. * @name set
  3186. * @memberOf Stack
  3187. * @param {string} key The key of the value to set.
  3188. * @param {*} value The value to set.
  3189. * @returns {Object} Returns the stack cache instance.
  3190. */
  3191. function stackSet(key, value) {
  3192. var data = this.__data__;
  3193. if (data instanceof ListCache) {
  3194. var pairs = data.__data__;
  3195. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3196. pairs.push([key, value]);
  3197. this.size = ++data.size;
  3198. return this;
  3199. }
  3200. data = this.__data__ = new MapCache(pairs);
  3201. }
  3202. data.set(key, value);
  3203. this.size = data.size;
  3204. return this;
  3205. }
  3206. // Add methods to `Stack`.
  3207. Stack.prototype.clear = stackClear;
  3208. Stack.prototype['delete'] = stackDelete;
  3209. Stack.prototype.get = stackGet;
  3210. Stack.prototype.has = stackHas;
  3211. Stack.prototype.set = stackSet;
  3212. /*------------------------------------------------------------------------*/
  3213. /**
  3214. * Creates an array of the enumerable property names of the array-like `value`.
  3215. *
  3216. * @private
  3217. * @param {*} value The value to query.
  3218. * @param {boolean} inherited Specify returning inherited property names.
  3219. * @returns {Array} Returns the array of property names.
  3220. */
  3221. function arrayLikeKeys(value, inherited) {
  3222. var isArr = isArray(value),
  3223. isArg = !isArr && isArguments(value),
  3224. isBuff = !isArr && !isArg && isBuffer(value),
  3225. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3226. skipIndexes = isArr || isArg || isBuff || isType,
  3227. result = skipIndexes ? baseTimes(value.length, String) : [],
  3228. length = result.length;
  3229. for (var key in value) {
  3230. if ((inherited || hasOwnProperty.call(value, key)) &&
  3231. !(skipIndexes && (
  3232. // Safari 9 has enumerable `arguments.length` in strict mode.
  3233. key == 'length' ||
  3234. // Node.js 0.10 has enumerable non-index properties on buffers.
  3235. (isBuff && (key == 'offset' || key == 'parent')) ||
  3236. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3237. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3238. // Skip index properties.
  3239. isIndex(key, length)
  3240. ))) {
  3241. result.push(key);
  3242. }
  3243. }
  3244. return result;
  3245. }
  3246. /**
  3247. * A specialized version of `_.sample` for arrays.
  3248. *
  3249. * @private
  3250. * @param {Array} array The array to sample.
  3251. * @returns {*} Returns the random element.
  3252. */
  3253. function arraySample(array) {
  3254. var length = array.length;
  3255. return length ? array[baseRandom(0, length - 1)] : undefined;
  3256. }
  3257. /**
  3258. * A specialized version of `_.sampleSize` for arrays.
  3259. *
  3260. * @private
  3261. * @param {Array} array The array to sample.
  3262. * @param {number} n The number of elements to sample.
  3263. * @returns {Array} Returns the random elements.
  3264. */
  3265. function arraySampleSize(array, n) {
  3266. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3267. }
  3268. /**
  3269. * A specialized version of `_.shuffle` for arrays.
  3270. *
  3271. * @private
  3272. * @param {Array} array The array to shuffle.
  3273. * @returns {Array} Returns the new shuffled array.
  3274. */
  3275. function arrayShuffle(array) {
  3276. return shuffleSelf(copyArray(array));
  3277. }
  3278. /**
  3279. * This function is like `assignValue` except that it doesn't assign
  3280. * `undefined` values.
  3281. *
  3282. * @private
  3283. * @param {Object} object The object to modify.
  3284. * @param {string} key The key of the property to assign.
  3285. * @param {*} value The value to assign.
  3286. */
  3287. function assignMergeValue(object, key, value) {
  3288. if ((value !== undefined && !eq(object[key], value)) ||
  3289. (value === undefined && !(key in object))) {
  3290. baseAssignValue(object, key, value);
  3291. }
  3292. }
  3293. /**
  3294. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3295. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3296. * for equality comparisons.
  3297. *
  3298. * @private
  3299. * @param {Object} object The object to modify.
  3300. * @param {string} key The key of the property to assign.
  3301. * @param {*} value The value to assign.
  3302. */
  3303. function assignValue(object, key, value) {
  3304. var objValue = object[key];
  3305. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3306. (value === undefined && !(key in object))) {
  3307. baseAssignValue(object, key, value);
  3308. }
  3309. }
  3310. /**
  3311. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3312. *
  3313. * @private
  3314. * @param {Array} array The array to inspect.
  3315. * @param {*} key The key to search for.
  3316. * @returns {number} Returns the index of the matched value, else `-1`.
  3317. */
  3318. function assocIndexOf(array, key) {
  3319. var length = array.length;
  3320. while (length--) {
  3321. if (eq(array[length][0], key)) {
  3322. return length;
  3323. }
  3324. }
  3325. return -1;
  3326. }
  3327. /**
  3328. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3329. * by `iteratee` and values set by `setter`.
  3330. *
  3331. * @private
  3332. * @param {Array|Object} collection The collection to iterate over.
  3333. * @param {Function} setter The function to set `accumulator` values.
  3334. * @param {Function} iteratee The iteratee to transform keys.
  3335. * @param {Object} accumulator The initial aggregated object.
  3336. * @returns {Function} Returns `accumulator`.
  3337. */
  3338. function baseAggregator(collection, setter, iteratee, accumulator) {
  3339. baseEach(collection, function(value, key, collection) {
  3340. setter(accumulator, value, iteratee(value), collection);
  3341. });
  3342. return accumulator;
  3343. }
  3344. /**
  3345. * The base implementation of `_.assign` without support for multiple sources
  3346. * or `customizer` functions.
  3347. *
  3348. * @private
  3349. * @param {Object} object The destination object.
  3350. * @param {Object} source The source object.
  3351. * @returns {Object} Returns `object`.
  3352. */
  3353. function baseAssign(object, source) {
  3354. return object && copyObject(source, keys(source), object);
  3355. }
  3356. /**
  3357. * The base implementation of `_.assignIn` without support for multiple sources
  3358. * or `customizer` functions.
  3359. *
  3360. * @private
  3361. * @param {Object} object The destination object.
  3362. * @param {Object} source The source object.
  3363. * @returns {Object} Returns `object`.
  3364. */
  3365. function baseAssignIn(object, source) {
  3366. return object && copyObject(source, keysIn(source), object);
  3367. }
  3368. /**
  3369. * The base implementation of `assignValue` and `assignMergeValue` without
  3370. * value checks.
  3371. *
  3372. * @private
  3373. * @param {Object} object The object to modify.
  3374. * @param {string} key The key of the property to assign.
  3375. * @param {*} value The value to assign.
  3376. */
  3377. function baseAssignValue(object, key, value) {
  3378. if (key == '__proto__' && defineProperty) {
  3379. defineProperty(object, key, {
  3380. 'configurable': true,
  3381. 'enumerable': true,
  3382. 'value': value,
  3383. 'writable': true
  3384. });
  3385. } else {
  3386. object[key] = value;
  3387. }
  3388. }
  3389. /**
  3390. * The base implementation of `_.at` without support for individual paths.
  3391. *
  3392. * @private
  3393. * @param {Object} object The object to iterate over.
  3394. * @param {string[]} paths The property paths to pick.
  3395. * @returns {Array} Returns the picked elements.
  3396. */
  3397. function baseAt(object, paths) {
  3398. var index = -1,
  3399. length = paths.length,
  3400. result = Array(length),
  3401. skip = object == null;
  3402. while (++index < length) {
  3403. result[index] = skip ? undefined : get(object, paths[index]);
  3404. }
  3405. return result;
  3406. }
  3407. /**
  3408. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3409. *
  3410. * @private
  3411. * @param {number} number The number to clamp.
  3412. * @param {number} [lower] The lower bound.
  3413. * @param {number} upper The upper bound.
  3414. * @returns {number} Returns the clamped number.
  3415. */
  3416. function baseClamp(number, lower, upper) {
  3417. if (number === number) {
  3418. if (upper !== undefined) {
  3419. number = number <= upper ? number : upper;
  3420. }
  3421. if (lower !== undefined) {
  3422. number = number >= lower ? number : lower;
  3423. }
  3424. }
  3425. return number;
  3426. }
  3427. /**
  3428. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3429. * traversed objects.
  3430. *
  3431. * @private
  3432. * @param {*} value The value to clone.
  3433. * @param {boolean} bitmask The bitmask flags.
  3434. * 1 - Deep clone
  3435. * 2 - Flatten inherited properties
  3436. * 4 - Clone symbols
  3437. * @param {Function} [customizer] The function to customize cloning.
  3438. * @param {string} [key] The key of `value`.
  3439. * @param {Object} [object] The parent object of `value`.
  3440. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3441. * @returns {*} Returns the cloned value.
  3442. */
  3443. function baseClone(value, bitmask, customizer, key, object, stack) {
  3444. var result,
  3445. isDeep = bitmask & CLONE_DEEP_FLAG,
  3446. isFlat = bitmask & CLONE_FLAT_FLAG,
  3447. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3448. if (customizer) {
  3449. result = object ? customizer(value, key, object, stack) : customizer(value);
  3450. }
  3451. if (result !== undefined) {
  3452. return result;
  3453. }
  3454. if (!isObject(value)) {
  3455. return value;
  3456. }
  3457. var isArr = isArray(value);
  3458. if (isArr) {
  3459. result = initCloneArray(value);
  3460. if (!isDeep) {
  3461. return copyArray(value, result);
  3462. }
  3463. } else {
  3464. var tag = getTag(value),
  3465. isFunc = tag == funcTag || tag == genTag;
  3466. if (isBuffer(value)) {
  3467. return cloneBuffer(value, isDeep);
  3468. }
  3469. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3470. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3471. if (!isDeep) {
  3472. return isFlat
  3473. ? copySymbolsIn(value, baseAssignIn(result, value))
  3474. : copySymbols(value, baseAssign(result, value));
  3475. }
  3476. } else {
  3477. if (!cloneableTags[tag]) {
  3478. return object ? value : {};
  3479. }
  3480. result = initCloneByTag(value, tag, isDeep);
  3481. }
  3482. }
  3483. // Check for circular references and return its corresponding clone.
  3484. stack || (stack = new Stack);
  3485. var stacked = stack.get(value);
  3486. if (stacked) {
  3487. return stacked;
  3488. }
  3489. stack.set(value, result);
  3490. if (isSet(value)) {
  3491. value.forEach(function(subValue) {
  3492. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3493. });
  3494. } else if (isMap(value)) {
  3495. value.forEach(function(subValue, key) {
  3496. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3497. });
  3498. }
  3499. var keysFunc = isFull
  3500. ? (isFlat ? getAllKeysIn : getAllKeys)
  3501. : (isFlat ? keysIn : keys);
  3502. var props = isArr ? undefined : keysFunc(value);
  3503. arrayEach(props || value, function(subValue, key) {
  3504. if (props) {
  3505. key = subValue;
  3506. subValue = value[key];
  3507. }
  3508. // Recursively populate clone (susceptible to call stack limits).
  3509. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3510. });
  3511. return result;
  3512. }
  3513. /**
  3514. * The base implementation of `_.conforms` which doesn't clone `source`.
  3515. *
  3516. * @private
  3517. * @param {Object} source The object of property predicates to conform to.
  3518. * @returns {Function} Returns the new spec function.
  3519. */
  3520. function baseConforms(source) {
  3521. var props = keys(source);
  3522. return function(object) {
  3523. return baseConformsTo(object, source, props);
  3524. };
  3525. }
  3526. /**
  3527. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3528. *
  3529. * @private
  3530. * @param {Object} object The object to inspect.
  3531. * @param {Object} source The object of property predicates to conform to.
  3532. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3533. */
  3534. function baseConformsTo(object, source, props) {
  3535. var length = props.length;
  3536. if (object == null) {
  3537. return !length;
  3538. }
  3539. object = Object(object);
  3540. while (length--) {
  3541. var key = props[length],
  3542. predicate = source[key],
  3543. value = object[key];
  3544. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3545. return false;
  3546. }
  3547. }
  3548. return true;
  3549. }
  3550. /**
  3551. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3552. * to provide to `func`.
  3553. *
  3554. * @private
  3555. * @param {Function} func The function to delay.
  3556. * @param {number} wait The number of milliseconds to delay invocation.
  3557. * @param {Array} args The arguments to provide to `func`.
  3558. * @returns {number|Object} Returns the timer id or timeout object.
  3559. */
  3560. function baseDelay(func, wait, args) {
  3561. if (typeof func != 'function') {
  3562. throw new TypeError(FUNC_ERROR_TEXT);
  3563. }
  3564. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3565. }
  3566. /**
  3567. * The base implementation of methods like `_.difference` without support
  3568. * for excluding multiple arrays or iteratee shorthands.
  3569. *
  3570. * @private
  3571. * @param {Array} array The array to inspect.
  3572. * @param {Array} values The values to exclude.
  3573. * @param {Function} [iteratee] The iteratee invoked per element.
  3574. * @param {Function} [comparator] The comparator invoked per element.
  3575. * @returns {Array} Returns the new array of filtered values.
  3576. */
  3577. function baseDifference(array, values, iteratee, comparator) {
  3578. var index = -1,
  3579. includes = arrayIncludes,
  3580. isCommon = true,
  3581. length = array.length,
  3582. result = [],
  3583. valuesLength = values.length;
  3584. if (!length) {
  3585. return result;
  3586. }
  3587. if (iteratee) {
  3588. values = arrayMap(values, baseUnary(iteratee));
  3589. }
  3590. if (comparator) {
  3591. includes = arrayIncludesWith;
  3592. isCommon = false;
  3593. }
  3594. else if (values.length >= LARGE_ARRAY_SIZE) {
  3595. includes = cacheHas;
  3596. isCommon = false;
  3597. values = new SetCache(values);
  3598. }
  3599. outer:
  3600. while (++index < length) {
  3601. var value = array[index],
  3602. computed = iteratee == null ? value : iteratee(value);
  3603. value = (comparator || value !== 0) ? value : 0;
  3604. if (isCommon && computed === computed) {
  3605. var valuesIndex = valuesLength;
  3606. while (valuesIndex--) {
  3607. if (values[valuesIndex] === computed) {
  3608. continue outer;
  3609. }
  3610. }
  3611. result.push(value);
  3612. }
  3613. else if (!includes(values, computed, comparator)) {
  3614. result.push(value);
  3615. }
  3616. }
  3617. return result;
  3618. }
  3619. /**
  3620. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3621. *
  3622. * @private
  3623. * @param {Array|Object} collection The collection to iterate over.
  3624. * @param {Function} iteratee The function invoked per iteration.
  3625. * @returns {Array|Object} Returns `collection`.
  3626. */
  3627. var baseEach = createBaseEach(baseForOwn);
  3628. /**
  3629. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3630. *
  3631. * @private
  3632. * @param {Array|Object} collection The collection to iterate over.
  3633. * @param {Function} iteratee The function invoked per iteration.
  3634. * @returns {Array|Object} Returns `collection`.
  3635. */
  3636. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3637. /**
  3638. * The base implementation of `_.every` without support for iteratee shorthands.
  3639. *
  3640. * @private
  3641. * @param {Array|Object} collection The collection to iterate over.
  3642. * @param {Function} predicate The function invoked per iteration.
  3643. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3644. * else `false`
  3645. */
  3646. function baseEvery(collection, predicate) {
  3647. var result = true;
  3648. baseEach(collection, function(value, index, collection) {
  3649. result = !!predicate(value, index, collection);
  3650. return result;
  3651. });
  3652. return result;
  3653. }
  3654. /**
  3655. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3656. * `comparator` to determine the extremum value.
  3657. *
  3658. * @private
  3659. * @param {Array} array The array to iterate over.
  3660. * @param {Function} iteratee The iteratee invoked per iteration.
  3661. * @param {Function} comparator The comparator used to compare values.
  3662. * @returns {*} Returns the extremum value.
  3663. */
  3664. function baseExtremum(array, iteratee, comparator) {
  3665. var index = -1,
  3666. length = array.length;
  3667. while (++index < length) {
  3668. var value = array[index],
  3669. current = iteratee(value);
  3670. if (current != null && (computed === undefined
  3671. ? (current === current && !isSymbol(current))
  3672. : comparator(current, computed)
  3673. )) {
  3674. var computed = current,
  3675. result = value;
  3676. }
  3677. }
  3678. return result;
  3679. }
  3680. /**
  3681. * The base implementation of `_.fill` without an iteratee call guard.
  3682. *
  3683. * @private
  3684. * @param {Array} array The array to fill.
  3685. * @param {*} value The value to fill `array` with.
  3686. * @param {number} [start=0] The start position.
  3687. * @param {number} [end=array.length] The end position.
  3688. * @returns {Array} Returns `array`.
  3689. */
  3690. function baseFill(array, value, start, end) {
  3691. var length = array.length;
  3692. start = toInteger(start);
  3693. if (start < 0) {
  3694. start = -start > length ? 0 : (length + start);
  3695. }
  3696. end = (end === undefined || end > length) ? length : toInteger(end);
  3697. if (end < 0) {
  3698. end += length;
  3699. }
  3700. end = start > end ? 0 : toLength(end);
  3701. while (start < end) {
  3702. array[start++] = value;
  3703. }
  3704. return array;
  3705. }
  3706. /**
  3707. * The base implementation of `_.filter` without support for iteratee shorthands.
  3708. *
  3709. * @private
  3710. * @param {Array|Object} collection The collection to iterate over.
  3711. * @param {Function} predicate The function invoked per iteration.
  3712. * @returns {Array} Returns the new filtered array.
  3713. */
  3714. function baseFilter(collection, predicate) {
  3715. var result = [];
  3716. baseEach(collection, function(value, index, collection) {
  3717. if (predicate(value, index, collection)) {
  3718. result.push(value);
  3719. }
  3720. });
  3721. return result;
  3722. }
  3723. /**
  3724. * The base implementation of `_.flatten` with support for restricting flattening.
  3725. *
  3726. * @private
  3727. * @param {Array} array The array to flatten.
  3728. * @param {number} depth The maximum recursion depth.
  3729. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3730. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3731. * @param {Array} [result=[]] The initial result value.
  3732. * @returns {Array} Returns the new flattened array.
  3733. */
  3734. function baseFlatten(array, depth, predicate, isStrict, result) {
  3735. var index = -1,
  3736. length = array.length;
  3737. predicate || (predicate = isFlattenable);
  3738. result || (result = []);
  3739. while (++index < length) {
  3740. var value = array[index];
  3741. if (depth > 0 && predicate(value)) {
  3742. if (depth > 1) {
  3743. // Recursively flatten arrays (susceptible to call stack limits).
  3744. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3745. } else {
  3746. arrayPush(result, value);
  3747. }
  3748. } else if (!isStrict) {
  3749. result[result.length] = value;
  3750. }
  3751. }
  3752. return result;
  3753. }
  3754. /**
  3755. * The base implementation of `baseForOwn` which iterates over `object`
  3756. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3757. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3758. *
  3759. * @private
  3760. * @param {Object} object The object to iterate over.
  3761. * @param {Function} iteratee The function invoked per iteration.
  3762. * @param {Function} keysFunc The function to get the keys of `object`.
  3763. * @returns {Object} Returns `object`.
  3764. */
  3765. var baseFor = createBaseFor();
  3766. /**
  3767. * This function is like `baseFor` except that it iterates over properties
  3768. * in the opposite order.
  3769. *
  3770. * @private
  3771. * @param {Object} object The object to iterate over.
  3772. * @param {Function} iteratee The function invoked per iteration.
  3773. * @param {Function} keysFunc The function to get the keys of `object`.
  3774. * @returns {Object} Returns `object`.
  3775. */
  3776. var baseForRight = createBaseFor(true);
  3777. /**
  3778. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3779. *
  3780. * @private
  3781. * @param {Object} object The object to iterate over.
  3782. * @param {Function} iteratee The function invoked per iteration.
  3783. * @returns {Object} Returns `object`.
  3784. */
  3785. function baseForOwn(object, iteratee) {
  3786. return object && baseFor(object, iteratee, keys);
  3787. }
  3788. /**
  3789. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3790. *
  3791. * @private
  3792. * @param {Object} object The object to iterate over.
  3793. * @param {Function} iteratee The function invoked per iteration.
  3794. * @returns {Object} Returns `object`.
  3795. */
  3796. function baseForOwnRight(object, iteratee) {
  3797. return object && baseForRight(object, iteratee, keys);
  3798. }
  3799. /**
  3800. * The base implementation of `_.functions` which creates an array of
  3801. * `object` function property names filtered from `props`.
  3802. *
  3803. * @private
  3804. * @param {Object} object The object to inspect.
  3805. * @param {Array} props The property names to filter.
  3806. * @returns {Array} Returns the function names.
  3807. */
  3808. function baseFunctions(object, props) {
  3809. return arrayFilter(props, function(key) {
  3810. return isFunction(object[key]);
  3811. });
  3812. }
  3813. /**
  3814. * The base implementation of `_.get` without support for default values.
  3815. *
  3816. * @private
  3817. * @param {Object} object The object to query.
  3818. * @param {Array|string} path The path of the property to get.
  3819. * @returns {*} Returns the resolved value.
  3820. */
  3821. function baseGet(object, path) {
  3822. path = castPath(path, object);
  3823. var index = 0,
  3824. length = path.length;
  3825. while (object != null && index < length) {
  3826. object = object[toKey(path[index++])];
  3827. }
  3828. return (index && index == length) ? object : undefined;
  3829. }
  3830. /**
  3831. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3832. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3833. * symbols of `object`.
  3834. *
  3835. * @private
  3836. * @param {Object} object The object to query.
  3837. * @param {Function} keysFunc The function to get the keys of `object`.
  3838. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3839. * @returns {Array} Returns the array of property names and symbols.
  3840. */
  3841. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3842. var result = keysFunc(object);
  3843. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3844. }
  3845. /**
  3846. * The base implementation of `getTag` without fallbacks for buggy environments.
  3847. *
  3848. * @private
  3849. * @param {*} value The value to query.
  3850. * @returns {string} Returns the `toStringTag`.
  3851. */
  3852. function baseGetTag(value) {
  3853. if (value == null) {
  3854. return value === undefined ? undefinedTag : nullTag;
  3855. }
  3856. return (symToStringTag && symToStringTag in Object(value))
  3857. ? getRawTag(value)
  3858. : objectToString(value);
  3859. }
  3860. /**
  3861. * The base implementation of `_.gt` which doesn't coerce arguments.
  3862. *
  3863. * @private
  3864. * @param {*} value The value to compare.
  3865. * @param {*} other The other value to compare.
  3866. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3867. * else `false`.
  3868. */
  3869. function baseGt(value, other) {
  3870. return value > other;
  3871. }
  3872. /**
  3873. * The base implementation of `_.has` without support for deep paths.
  3874. *
  3875. * @private
  3876. * @param {Object} [object] The object to query.
  3877. * @param {Array|string} key The key to check.
  3878. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3879. */
  3880. function baseHas(object, key) {
  3881. return object != null && hasOwnProperty.call(object, key);
  3882. }
  3883. /**
  3884. * The base implementation of `_.hasIn` without support for deep paths.
  3885. *
  3886. * @private
  3887. * @param {Object} [object] The object to query.
  3888. * @param {Array|string} key The key to check.
  3889. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3890. */
  3891. function baseHasIn(object, key) {
  3892. return object != null && key in Object(object);
  3893. }
  3894. /**
  3895. * The base implementation of `_.inRange` which doesn't coerce arguments.
  3896. *
  3897. * @private
  3898. * @param {number} number The number to check.
  3899. * @param {number} start The start of the range.
  3900. * @param {number} end The end of the range.
  3901. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  3902. */
  3903. function baseInRange(number, start, end) {
  3904. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  3905. }
  3906. /**
  3907. * The base implementation of methods like `_.intersection`, without support
  3908. * for iteratee shorthands, that accepts an array of arrays to inspect.
  3909. *
  3910. * @private
  3911. * @param {Array} arrays The arrays to inspect.
  3912. * @param {Function} [iteratee] The iteratee invoked per element.
  3913. * @param {Function} [comparator] The comparator invoked per element.
  3914. * @returns {Array} Returns the new array of shared values.
  3915. */
  3916. function baseIntersection(arrays, iteratee, comparator) {
  3917. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  3918. length = arrays[0].length,
  3919. othLength = arrays.length,
  3920. othIndex = othLength,
  3921. caches = Array(othLength),
  3922. maxLength = Infinity,
  3923. result = [];
  3924. while (othIndex--) {
  3925. var array = arrays[othIndex];
  3926. if (othIndex && iteratee) {
  3927. array = arrayMap(array, baseUnary(iteratee));
  3928. }
  3929. maxLength = nativeMin(array.length, maxLength);
  3930. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  3931. ? new SetCache(othIndex && array)
  3932. : undefined;
  3933. }
  3934. array = arrays[0];
  3935. var index = -1,
  3936. seen = caches[0];
  3937. outer:
  3938. while (++index < length && result.length < maxLength) {
  3939. var value = array[index],
  3940. computed = iteratee ? iteratee(value) : value;
  3941. value = (comparator || value !== 0) ? value : 0;
  3942. if (!(seen
  3943. ? cacheHas(seen, computed)
  3944. : includes(result, computed, comparator)
  3945. )) {
  3946. othIndex = othLength;
  3947. while (--othIndex) {
  3948. var cache = caches[othIndex];
  3949. if (!(cache
  3950. ? cacheHas(cache, computed)
  3951. : includes(arrays[othIndex], computed, comparator))
  3952. ) {
  3953. continue outer;
  3954. }
  3955. }
  3956. if (seen) {
  3957. seen.push(computed);
  3958. }
  3959. result.push(value);
  3960. }
  3961. }
  3962. return result;
  3963. }
  3964. /**
  3965. * The base implementation of `_.invert` and `_.invertBy` which inverts
  3966. * `object` with values transformed by `iteratee` and set by `setter`.
  3967. *
  3968. * @private
  3969. * @param {Object} object The object to iterate over.
  3970. * @param {Function} setter The function to set `accumulator` values.
  3971. * @param {Function} iteratee The iteratee to transform values.
  3972. * @param {Object} accumulator The initial inverted object.
  3973. * @returns {Function} Returns `accumulator`.
  3974. */
  3975. function baseInverter(object, setter, iteratee, accumulator) {
  3976. baseForOwn(object, function(value, key, object) {
  3977. setter(accumulator, iteratee(value), key, object);
  3978. });
  3979. return accumulator;
  3980. }
  3981. /**
  3982. * The base implementation of `_.invoke` without support for individual
  3983. * method arguments.
  3984. *
  3985. * @private
  3986. * @param {Object} object The object to query.
  3987. * @param {Array|string} path The path of the method to invoke.
  3988. * @param {Array} args The arguments to invoke the method with.
  3989. * @returns {*} Returns the result of the invoked method.
  3990. */
  3991. function baseInvoke(object, path, args) {
  3992. path = castPath(path, object);
  3993. object = parent(object, path);
  3994. var func = object == null ? object : object[toKey(last(path))];
  3995. return func == null ? undefined : apply(func, object, args);
  3996. }
  3997. /**
  3998. * The base implementation of `_.isArguments`.
  3999. *
  4000. * @private
  4001. * @param {*} value The value to check.
  4002. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4003. */
  4004. function baseIsArguments(value) {
  4005. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4006. }
  4007. /**
  4008. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4009. *
  4010. * @private
  4011. * @param {*} value The value to check.
  4012. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4013. */
  4014. function baseIsArrayBuffer(value) {
  4015. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4016. }
  4017. /**
  4018. * The base implementation of `_.isDate` without Node.js optimizations.
  4019. *
  4020. * @private
  4021. * @param {*} value The value to check.
  4022. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4023. */
  4024. function baseIsDate(value) {
  4025. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4026. }
  4027. /**
  4028. * The base implementation of `_.isEqual` which supports partial comparisons
  4029. * and tracks traversed objects.
  4030. *
  4031. * @private
  4032. * @param {*} value The value to compare.
  4033. * @param {*} other The other value to compare.
  4034. * @param {boolean} bitmask The bitmask flags.
  4035. * 1 - Unordered comparison
  4036. * 2 - Partial comparison
  4037. * @param {Function} [customizer] The function to customize comparisons.
  4038. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4039. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4040. */
  4041. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4042. if (value === other) {
  4043. return true;
  4044. }
  4045. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4046. return value !== value && other !== other;
  4047. }
  4048. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4049. }
  4050. /**
  4051. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4052. * deep comparisons and tracks traversed objects enabling objects with circular
  4053. * references to be compared.
  4054. *
  4055. * @private
  4056. * @param {Object} object The object to compare.
  4057. * @param {Object} other The other object to compare.
  4058. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4059. * @param {Function} customizer The function to customize comparisons.
  4060. * @param {Function} equalFunc The function to determine equivalents of values.
  4061. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4062. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4063. */
  4064. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4065. var objIsArr = isArray(object),
  4066. othIsArr = isArray(other),
  4067. objTag = objIsArr ? arrayTag : getTag(object),
  4068. othTag = othIsArr ? arrayTag : getTag(other);
  4069. objTag = objTag == argsTag ? objectTag : objTag;
  4070. othTag = othTag == argsTag ? objectTag : othTag;
  4071. var objIsObj = objTag == objectTag,
  4072. othIsObj = othTag == objectTag,
  4073. isSameTag = objTag == othTag;
  4074. if (isSameTag && isBuffer(object)) {
  4075. if (!isBuffer(other)) {
  4076. return false;
  4077. }
  4078. objIsArr = true;
  4079. objIsObj = false;
  4080. }
  4081. if (isSameTag && !objIsObj) {
  4082. stack || (stack = new Stack);
  4083. return (objIsArr || isTypedArray(object))
  4084. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4085. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4086. }
  4087. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4088. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4089. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4090. if (objIsWrapped || othIsWrapped) {
  4091. var objUnwrapped = objIsWrapped ? object.value() : object,
  4092. othUnwrapped = othIsWrapped ? other.value() : other;
  4093. stack || (stack = new Stack);
  4094. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4095. }
  4096. }
  4097. if (!isSameTag) {
  4098. return false;
  4099. }
  4100. stack || (stack = new Stack);
  4101. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4102. }
  4103. /**
  4104. * The base implementation of `_.isMap` without Node.js optimizations.
  4105. *
  4106. * @private
  4107. * @param {*} value The value to check.
  4108. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4109. */
  4110. function baseIsMap(value) {
  4111. return isObjectLike(value) && getTag(value) == mapTag;
  4112. }
  4113. /**
  4114. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4115. *
  4116. * @private
  4117. * @param {Object} object The object to inspect.
  4118. * @param {Object} source The object of property values to match.
  4119. * @param {Array} matchData The property names, values, and compare flags to match.
  4120. * @param {Function} [customizer] The function to customize comparisons.
  4121. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4122. */
  4123. function baseIsMatch(object, source, matchData, customizer) {
  4124. var index = matchData.length,
  4125. length = index,
  4126. noCustomizer = !customizer;
  4127. if (object == null) {
  4128. return !length;
  4129. }
  4130. object = Object(object);
  4131. while (index--) {
  4132. var data = matchData[index];
  4133. if ((noCustomizer && data[2])
  4134. ? data[1] !== object[data[0]]
  4135. : !(data[0] in object)
  4136. ) {
  4137. return false;
  4138. }
  4139. }
  4140. while (++index < length) {
  4141. data = matchData[index];
  4142. var key = data[0],
  4143. objValue = object[key],
  4144. srcValue = data[1];
  4145. if (noCustomizer && data[2]) {
  4146. if (objValue === undefined && !(key in object)) {
  4147. return false;
  4148. }
  4149. } else {
  4150. var stack = new Stack;
  4151. if (customizer) {
  4152. var result = customizer(objValue, srcValue, key, object, source, stack);
  4153. }
  4154. if (!(result === undefined
  4155. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4156. : result
  4157. )) {
  4158. return false;
  4159. }
  4160. }
  4161. }
  4162. return true;
  4163. }
  4164. /**
  4165. * The base implementation of `_.isNative` without bad shim checks.
  4166. *
  4167. * @private
  4168. * @param {*} value The value to check.
  4169. * @returns {boolean} Returns `true` if `value` is a native function,
  4170. * else `false`.
  4171. */
  4172. function baseIsNative(value) {
  4173. if (!isObject(value) || isMasked(value)) {
  4174. return false;
  4175. }
  4176. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4177. return pattern.test(toSource(value));
  4178. }
  4179. /**
  4180. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4181. *
  4182. * @private
  4183. * @param {*} value The value to check.
  4184. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4185. */
  4186. function baseIsRegExp(value) {
  4187. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4188. }
  4189. /**
  4190. * The base implementation of `_.isSet` without Node.js optimizations.
  4191. *
  4192. * @private
  4193. * @param {*} value The value to check.
  4194. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4195. */
  4196. function baseIsSet(value) {
  4197. return isObjectLike(value) && getTag(value) == setTag;
  4198. }
  4199. /**
  4200. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4201. *
  4202. * @private
  4203. * @param {*} value The value to check.
  4204. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4205. */
  4206. function baseIsTypedArray(value) {
  4207. return isObjectLike(value) &&
  4208. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4209. }
  4210. /**
  4211. * The base implementation of `_.iteratee`.
  4212. *
  4213. * @private
  4214. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4215. * @returns {Function} Returns the iteratee.
  4216. */
  4217. function baseIteratee(value) {
  4218. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4219. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4220. if (typeof value == 'function') {
  4221. return value;
  4222. }
  4223. if (value == null) {
  4224. return identity;
  4225. }
  4226. if (typeof value == 'object') {
  4227. return isArray(value)
  4228. ? baseMatchesProperty(value[0], value[1])
  4229. : baseMatches(value);
  4230. }
  4231. return property(value);
  4232. }
  4233. /**
  4234. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4235. *
  4236. * @private
  4237. * @param {Object} object The object to query.
  4238. * @returns {Array} Returns the array of property names.
  4239. */
  4240. function baseKeys(object) {
  4241. if (!isPrototype(object)) {
  4242. return nativeKeys(object);
  4243. }
  4244. var result = [];
  4245. for (var key in Object(object)) {
  4246. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4247. result.push(key);
  4248. }
  4249. }
  4250. return result;
  4251. }
  4252. /**
  4253. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4254. *
  4255. * @private
  4256. * @param {Object} object The object to query.
  4257. * @returns {Array} Returns the array of property names.
  4258. */
  4259. function baseKeysIn(object) {
  4260. if (!isObject(object)) {
  4261. return nativeKeysIn(object);
  4262. }
  4263. var isProto = isPrototype(object),
  4264. result = [];
  4265. for (var key in object) {
  4266. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4267. result.push(key);
  4268. }
  4269. }
  4270. return result;
  4271. }
  4272. /**
  4273. * The base implementation of `_.lt` which doesn't coerce arguments.
  4274. *
  4275. * @private
  4276. * @param {*} value The value to compare.
  4277. * @param {*} other The other value to compare.
  4278. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4279. * else `false`.
  4280. */
  4281. function baseLt(value, other) {
  4282. return value < other;
  4283. }
  4284. /**
  4285. * The base implementation of `_.map` without support for iteratee shorthands.
  4286. *
  4287. * @private
  4288. * @param {Array|Object} collection The collection to iterate over.
  4289. * @param {Function} iteratee The function invoked per iteration.
  4290. * @returns {Array} Returns the new mapped array.
  4291. */
  4292. function baseMap(collection, iteratee) {
  4293. var index = -1,
  4294. result = isArrayLike(collection) ? Array(collection.length) : [];
  4295. baseEach(collection, function(value, key, collection) {
  4296. result[++index] = iteratee(value, key, collection);
  4297. });
  4298. return result;
  4299. }
  4300. /**
  4301. * The base implementation of `_.matches` which doesn't clone `source`.
  4302. *
  4303. * @private
  4304. * @param {Object} source The object of property values to match.
  4305. * @returns {Function} Returns the new spec function.
  4306. */
  4307. function baseMatches(source) {
  4308. var matchData = getMatchData(source);
  4309. if (matchData.length == 1 && matchData[0][2]) {
  4310. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4311. }
  4312. return function(object) {
  4313. return object === source || baseIsMatch(object, source, matchData);
  4314. };
  4315. }
  4316. /**
  4317. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4318. *
  4319. * @private
  4320. * @param {string} path The path of the property to get.
  4321. * @param {*} srcValue The value to match.
  4322. * @returns {Function} Returns the new spec function.
  4323. */
  4324. function baseMatchesProperty(path, srcValue) {
  4325. if (isKey(path) && isStrictComparable(srcValue)) {
  4326. return matchesStrictComparable(toKey(path), srcValue);
  4327. }
  4328. return function(object) {
  4329. var objValue = get(object, path);
  4330. return (objValue === undefined && objValue === srcValue)
  4331. ? hasIn(object, path)
  4332. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4333. };
  4334. }
  4335. /**
  4336. * The base implementation of `_.merge` without support for multiple sources.
  4337. *
  4338. * @private
  4339. * @param {Object} object The destination object.
  4340. * @param {Object} source The source object.
  4341. * @param {number} srcIndex The index of `source`.
  4342. * @param {Function} [customizer] The function to customize merged values.
  4343. * @param {Object} [stack] Tracks traversed source values and their merged
  4344. * counterparts.
  4345. */
  4346. function baseMerge(object, source, srcIndex, customizer, stack) {
  4347. if (object === source) {
  4348. return;
  4349. }
  4350. baseFor(source, function(srcValue, key) {
  4351. stack || (stack = new Stack);
  4352. if (isObject(srcValue)) {
  4353. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4354. }
  4355. else {
  4356. var newValue = customizer
  4357. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4358. : undefined;
  4359. if (newValue === undefined) {
  4360. newValue = srcValue;
  4361. }
  4362. assignMergeValue(object, key, newValue);
  4363. }
  4364. }, keysIn);
  4365. }
  4366. /**
  4367. * A specialized version of `baseMerge` for arrays and objects which performs
  4368. * deep merges and tracks traversed objects enabling objects with circular
  4369. * references to be merged.
  4370. *
  4371. * @private
  4372. * @param {Object} object The destination object.
  4373. * @param {Object} source The source object.
  4374. * @param {string} key The key of the value to merge.
  4375. * @param {number} srcIndex The index of `source`.
  4376. * @param {Function} mergeFunc The function to merge values.
  4377. * @param {Function} [customizer] The function to customize assigned values.
  4378. * @param {Object} [stack] Tracks traversed source values and their merged
  4379. * counterparts.
  4380. */
  4381. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4382. var objValue = safeGet(object, key),
  4383. srcValue = safeGet(source, key),
  4384. stacked = stack.get(srcValue);
  4385. if (stacked) {
  4386. assignMergeValue(object, key, stacked);
  4387. return;
  4388. }
  4389. var newValue = customizer
  4390. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4391. : undefined;
  4392. var isCommon = newValue === undefined;
  4393. if (isCommon) {
  4394. var isArr = isArray(srcValue),
  4395. isBuff = !isArr && isBuffer(srcValue),
  4396. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4397. newValue = srcValue;
  4398. if (isArr || isBuff || isTyped) {
  4399. if (isArray(objValue)) {
  4400. newValue = objValue;
  4401. }
  4402. else if (isArrayLikeObject(objValue)) {
  4403. newValue = copyArray(objValue);
  4404. }
  4405. else if (isBuff) {
  4406. isCommon = false;
  4407. newValue = cloneBuffer(srcValue, true);
  4408. }
  4409. else if (isTyped) {
  4410. isCommon = false;
  4411. newValue = cloneTypedArray(srcValue, true);
  4412. }
  4413. else {
  4414. newValue = [];
  4415. }
  4416. }
  4417. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4418. newValue = objValue;
  4419. if (isArguments(objValue)) {
  4420. newValue = toPlainObject(objValue);
  4421. }
  4422. else if (!isObject(objValue) || isFunction(objValue)) {
  4423. newValue = initCloneObject(srcValue);
  4424. }
  4425. }
  4426. else {
  4427. isCommon = false;
  4428. }
  4429. }
  4430. if (isCommon) {
  4431. // Recursively merge objects and arrays (susceptible to call stack limits).
  4432. stack.set(srcValue, newValue);
  4433. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4434. stack['delete'](srcValue);
  4435. }
  4436. assignMergeValue(object, key, newValue);
  4437. }
  4438. /**
  4439. * The base implementation of `_.nth` which doesn't coerce arguments.
  4440. *
  4441. * @private
  4442. * @param {Array} array The array to query.
  4443. * @param {number} n The index of the element to return.
  4444. * @returns {*} Returns the nth element of `array`.
  4445. */
  4446. function baseNth(array, n) {
  4447. var length = array.length;
  4448. if (!length) {
  4449. return;
  4450. }
  4451. n += n < 0 ? length : 0;
  4452. return isIndex(n, length) ? array[n] : undefined;
  4453. }
  4454. /**
  4455. * The base implementation of `_.orderBy` without param guards.
  4456. *
  4457. * @private
  4458. * @param {Array|Object} collection The collection to iterate over.
  4459. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4460. * @param {string[]} orders The sort orders of `iteratees`.
  4461. * @returns {Array} Returns the new sorted array.
  4462. */
  4463. function baseOrderBy(collection, iteratees, orders) {
  4464. if (iteratees.length) {
  4465. iteratees = arrayMap(iteratees, function(iteratee) {
  4466. if (isArray(iteratee)) {
  4467. return function(value) {
  4468. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4469. }
  4470. }
  4471. return iteratee;
  4472. });
  4473. } else {
  4474. iteratees = [identity];
  4475. }
  4476. var index = -1;
  4477. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4478. var result = baseMap(collection, function(value, key, collection) {
  4479. var criteria = arrayMap(iteratees, function(iteratee) {
  4480. return iteratee(value);
  4481. });
  4482. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4483. });
  4484. return baseSortBy(result, function(object, other) {
  4485. return compareMultiple(object, other, orders);
  4486. });
  4487. }
  4488. /**
  4489. * The base implementation of `_.pick` without support for individual
  4490. * property identifiers.
  4491. *
  4492. * @private
  4493. * @param {Object} object The source object.
  4494. * @param {string[]} paths The property paths to pick.
  4495. * @returns {Object} Returns the new object.
  4496. */
  4497. function basePick(object, paths) {
  4498. return basePickBy(object, paths, function(value, path) {
  4499. return hasIn(object, path);
  4500. });
  4501. }
  4502. /**
  4503. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4504. *
  4505. * @private
  4506. * @param {Object} object The source object.
  4507. * @param {string[]} paths The property paths to pick.
  4508. * @param {Function} predicate The function invoked per property.
  4509. * @returns {Object} Returns the new object.
  4510. */
  4511. function basePickBy(object, paths, predicate) {
  4512. var index = -1,
  4513. length = paths.length,
  4514. result = {};
  4515. while (++index < length) {
  4516. var path = paths[index],
  4517. value = baseGet(object, path);
  4518. if (predicate(value, path)) {
  4519. baseSet(result, castPath(path, object), value);
  4520. }
  4521. }
  4522. return result;
  4523. }
  4524. /**
  4525. * A specialized version of `baseProperty` which supports deep paths.
  4526. *
  4527. * @private
  4528. * @param {Array|string} path The path of the property to get.
  4529. * @returns {Function} Returns the new accessor function.
  4530. */
  4531. function basePropertyDeep(path) {
  4532. return function(object) {
  4533. return baseGet(object, path);
  4534. };
  4535. }
  4536. /**
  4537. * The base implementation of `_.pullAllBy` without support for iteratee
  4538. * shorthands.
  4539. *
  4540. * @private
  4541. * @param {Array} array The array to modify.
  4542. * @param {Array} values The values to remove.
  4543. * @param {Function} [iteratee] The iteratee invoked per element.
  4544. * @param {Function} [comparator] The comparator invoked per element.
  4545. * @returns {Array} Returns `array`.
  4546. */
  4547. function basePullAll(array, values, iteratee, comparator) {
  4548. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4549. index = -1,
  4550. length = values.length,
  4551. seen = array;
  4552. if (array === values) {
  4553. values = copyArray(values);
  4554. }
  4555. if (iteratee) {
  4556. seen = arrayMap(array, baseUnary(iteratee));
  4557. }
  4558. while (++index < length) {
  4559. var fromIndex = 0,
  4560. value = values[index],
  4561. computed = iteratee ? iteratee(value) : value;
  4562. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4563. if (seen !== array) {
  4564. splice.call(seen, fromIndex, 1);
  4565. }
  4566. splice.call(array, fromIndex, 1);
  4567. }
  4568. }
  4569. return array;
  4570. }
  4571. /**
  4572. * The base implementation of `_.pullAt` without support for individual
  4573. * indexes or capturing the removed elements.
  4574. *
  4575. * @private
  4576. * @param {Array} array The array to modify.
  4577. * @param {number[]} indexes The indexes of elements to remove.
  4578. * @returns {Array} Returns `array`.
  4579. */
  4580. function basePullAt(array, indexes) {
  4581. var length = array ? indexes.length : 0,
  4582. lastIndex = length - 1;
  4583. while (length--) {
  4584. var index = indexes[length];
  4585. if (length == lastIndex || index !== previous) {
  4586. var previous = index;
  4587. if (isIndex(index)) {
  4588. splice.call(array, index, 1);
  4589. } else {
  4590. baseUnset(array, index);
  4591. }
  4592. }
  4593. }
  4594. return array;
  4595. }
  4596. /**
  4597. * The base implementation of `_.random` without support for returning
  4598. * floating-point numbers.
  4599. *
  4600. * @private
  4601. * @param {number} lower The lower bound.
  4602. * @param {number} upper The upper bound.
  4603. * @returns {number} Returns the random number.
  4604. */
  4605. function baseRandom(lower, upper) {
  4606. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4607. }
  4608. /**
  4609. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4610. * coerce arguments.
  4611. *
  4612. * @private
  4613. * @param {number} start The start of the range.
  4614. * @param {number} end The end of the range.
  4615. * @param {number} step The value to increment or decrement by.
  4616. * @param {boolean} [fromRight] Specify iterating from right to left.
  4617. * @returns {Array} Returns the range of numbers.
  4618. */
  4619. function baseRange(start, end, step, fromRight) {
  4620. var index = -1,
  4621. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4622. result = Array(length);
  4623. while (length--) {
  4624. result[fromRight ? length : ++index] = start;
  4625. start += step;
  4626. }
  4627. return result;
  4628. }
  4629. /**
  4630. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4631. *
  4632. * @private
  4633. * @param {string} string The string to repeat.
  4634. * @param {number} n The number of times to repeat the string.
  4635. * @returns {string} Returns the repeated string.
  4636. */
  4637. function baseRepeat(string, n) {
  4638. var result = '';
  4639. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4640. return result;
  4641. }
  4642. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4643. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4644. do {
  4645. if (n % 2) {
  4646. result += string;
  4647. }
  4648. n = nativeFloor(n / 2);
  4649. if (n) {
  4650. string += string;
  4651. }
  4652. } while (n);
  4653. return result;
  4654. }
  4655. /**
  4656. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4657. *
  4658. * @private
  4659. * @param {Function} func The function to apply a rest parameter to.
  4660. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4661. * @returns {Function} Returns the new function.
  4662. */
  4663. function baseRest(func, start) {
  4664. return setToString(overRest(func, start, identity), func + '');
  4665. }
  4666. /**
  4667. * The base implementation of `_.sample`.
  4668. *
  4669. * @private
  4670. * @param {Array|Object} collection The collection to sample.
  4671. * @returns {*} Returns the random element.
  4672. */
  4673. function baseSample(collection) {
  4674. return arraySample(values(collection));
  4675. }
  4676. /**
  4677. * The base implementation of `_.sampleSize` without param guards.
  4678. *
  4679. * @private
  4680. * @param {Array|Object} collection The collection to sample.
  4681. * @param {number} n The number of elements to sample.
  4682. * @returns {Array} Returns the random elements.
  4683. */
  4684. function baseSampleSize(collection, n) {
  4685. var array = values(collection);
  4686. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4687. }
  4688. /**
  4689. * The base implementation of `_.set`.
  4690. *
  4691. * @private
  4692. * @param {Object} object The object to modify.
  4693. * @param {Array|string} path The path of the property to set.
  4694. * @param {*} value The value to set.
  4695. * @param {Function} [customizer] The function to customize path creation.
  4696. * @returns {Object} Returns `object`.
  4697. */
  4698. function baseSet(object, path, value, customizer) {
  4699. if (!isObject(object)) {
  4700. return object;
  4701. }
  4702. path = castPath(path, object);
  4703. var index = -1,
  4704. length = path.length,
  4705. lastIndex = length - 1,
  4706. nested = object;
  4707. while (nested != null && ++index < length) {
  4708. var key = toKey(path[index]),
  4709. newValue = value;
  4710. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4711. return object;
  4712. }
  4713. if (index != lastIndex) {
  4714. var objValue = nested[key];
  4715. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4716. if (newValue === undefined) {
  4717. newValue = isObject(objValue)
  4718. ? objValue
  4719. : (isIndex(path[index + 1]) ? [] : {});
  4720. }
  4721. }
  4722. assignValue(nested, key, newValue);
  4723. nested = nested[key];
  4724. }
  4725. return object;
  4726. }
  4727. /**
  4728. * The base implementation of `setData` without support for hot loop shorting.
  4729. *
  4730. * @private
  4731. * @param {Function} func The function to associate metadata with.
  4732. * @param {*} data The metadata.
  4733. * @returns {Function} Returns `func`.
  4734. */
  4735. var baseSetData = !metaMap ? identity : function(func, data) {
  4736. metaMap.set(func, data);
  4737. return func;
  4738. };
  4739. /**
  4740. * The base implementation of `setToString` without support for hot loop shorting.
  4741. *
  4742. * @private
  4743. * @param {Function} func The function to modify.
  4744. * @param {Function} string The `toString` result.
  4745. * @returns {Function} Returns `func`.
  4746. */
  4747. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4748. return defineProperty(func, 'toString', {
  4749. 'configurable': true,
  4750. 'enumerable': false,
  4751. 'value': constant(string),
  4752. 'writable': true
  4753. });
  4754. };
  4755. /**
  4756. * The base implementation of `_.shuffle`.
  4757. *
  4758. * @private
  4759. * @param {Array|Object} collection The collection to shuffle.
  4760. * @returns {Array} Returns the new shuffled array.
  4761. */
  4762. function baseShuffle(collection) {
  4763. return shuffleSelf(values(collection));
  4764. }
  4765. /**
  4766. * The base implementation of `_.slice` without an iteratee call guard.
  4767. *
  4768. * @private
  4769. * @param {Array} array The array to slice.
  4770. * @param {number} [start=0] The start position.
  4771. * @param {number} [end=array.length] The end position.
  4772. * @returns {Array} Returns the slice of `array`.
  4773. */
  4774. function baseSlice(array, start, end) {
  4775. var index = -1,
  4776. length = array.length;
  4777. if (start < 0) {
  4778. start = -start > length ? 0 : (length + start);
  4779. }
  4780. end = end > length ? length : end;
  4781. if (end < 0) {
  4782. end += length;
  4783. }
  4784. length = start > end ? 0 : ((end - start) >>> 0);
  4785. start >>>= 0;
  4786. var result = Array(length);
  4787. while (++index < length) {
  4788. result[index] = array[index + start];
  4789. }
  4790. return result;
  4791. }
  4792. /**
  4793. * The base implementation of `_.some` without support for iteratee shorthands.
  4794. *
  4795. * @private
  4796. * @param {Array|Object} collection The collection to iterate over.
  4797. * @param {Function} predicate The function invoked per iteration.
  4798. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4799. * else `false`.
  4800. */
  4801. function baseSome(collection, predicate) {
  4802. var result;
  4803. baseEach(collection, function(value, index, collection) {
  4804. result = predicate(value, index, collection);
  4805. return !result;
  4806. });
  4807. return !!result;
  4808. }
  4809. /**
  4810. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4811. * performs a binary search of `array` to determine the index at which `value`
  4812. * should be inserted into `array` in order to maintain its sort order.
  4813. *
  4814. * @private
  4815. * @param {Array} array The sorted array to inspect.
  4816. * @param {*} value The value to evaluate.
  4817. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4818. * @returns {number} Returns the index at which `value` should be inserted
  4819. * into `array`.
  4820. */
  4821. function baseSortedIndex(array, value, retHighest) {
  4822. var low = 0,
  4823. high = array == null ? low : array.length;
  4824. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4825. while (low < high) {
  4826. var mid = (low + high) >>> 1,
  4827. computed = array[mid];
  4828. if (computed !== null && !isSymbol(computed) &&
  4829. (retHighest ? (computed <= value) : (computed < value))) {
  4830. low = mid + 1;
  4831. } else {
  4832. high = mid;
  4833. }
  4834. }
  4835. return high;
  4836. }
  4837. return baseSortedIndexBy(array, value, identity, retHighest);
  4838. }
  4839. /**
  4840. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4841. * which invokes `iteratee` for `value` and each element of `array` to compute
  4842. * their sort ranking. The iteratee is invoked with one argument; (value).
  4843. *
  4844. * @private
  4845. * @param {Array} array The sorted array to inspect.
  4846. * @param {*} value The value to evaluate.
  4847. * @param {Function} iteratee The iteratee invoked per element.
  4848. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4849. * @returns {number} Returns the index at which `value` should be inserted
  4850. * into `array`.
  4851. */
  4852. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4853. var low = 0,
  4854. high = array == null ? 0 : array.length;
  4855. if (high === 0) {
  4856. return 0;
  4857. }
  4858. value = iteratee(value);
  4859. var valIsNaN = value !== value,
  4860. valIsNull = value === null,
  4861. valIsSymbol = isSymbol(value),
  4862. valIsUndefined = value === undefined;
  4863. while (low < high) {
  4864. var mid = nativeFloor((low + high) / 2),
  4865. computed = iteratee(array[mid]),
  4866. othIsDefined = computed !== undefined,
  4867. othIsNull = computed === null,
  4868. othIsReflexive = computed === computed,
  4869. othIsSymbol = isSymbol(computed);
  4870. if (valIsNaN) {
  4871. var setLow = retHighest || othIsReflexive;
  4872. } else if (valIsUndefined) {
  4873. setLow = othIsReflexive && (retHighest || othIsDefined);
  4874. } else if (valIsNull) {
  4875. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4876. } else if (valIsSymbol) {
  4877. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4878. } else if (othIsNull || othIsSymbol) {
  4879. setLow = false;
  4880. } else {
  4881. setLow = retHighest ? (computed <= value) : (computed < value);
  4882. }
  4883. if (setLow) {
  4884. low = mid + 1;
  4885. } else {
  4886. high = mid;
  4887. }
  4888. }
  4889. return nativeMin(high, MAX_ARRAY_INDEX);
  4890. }
  4891. /**
  4892. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  4893. * support for iteratee shorthands.
  4894. *
  4895. * @private
  4896. * @param {Array} array The array to inspect.
  4897. * @param {Function} [iteratee] The iteratee invoked per element.
  4898. * @returns {Array} Returns the new duplicate free array.
  4899. */
  4900. function baseSortedUniq(array, iteratee) {
  4901. var index = -1,
  4902. length = array.length,
  4903. resIndex = 0,
  4904. result = [];
  4905. while (++index < length) {
  4906. var value = array[index],
  4907. computed = iteratee ? iteratee(value) : value;
  4908. if (!index || !eq(computed, seen)) {
  4909. var seen = computed;
  4910. result[resIndex++] = value === 0 ? 0 : value;
  4911. }
  4912. }
  4913. return result;
  4914. }
  4915. /**
  4916. * The base implementation of `_.toNumber` which doesn't ensure correct
  4917. * conversions of binary, hexadecimal, or octal string values.
  4918. *
  4919. * @private
  4920. * @param {*} value The value to process.
  4921. * @returns {number} Returns the number.
  4922. */
  4923. function baseToNumber(value) {
  4924. if (typeof value == 'number') {
  4925. return value;
  4926. }
  4927. if (isSymbol(value)) {
  4928. return NAN;
  4929. }
  4930. return +value;
  4931. }
  4932. /**
  4933. * The base implementation of `_.toString` which doesn't convert nullish
  4934. * values to empty strings.
  4935. *
  4936. * @private
  4937. * @param {*} value The value to process.
  4938. * @returns {string} Returns the string.
  4939. */
  4940. function baseToString(value) {
  4941. // Exit early for strings to avoid a performance hit in some environments.
  4942. if (typeof value == 'string') {
  4943. return value;
  4944. }
  4945. if (isArray(value)) {
  4946. // Recursively convert values (susceptible to call stack limits).
  4947. return arrayMap(value, baseToString) + '';
  4948. }
  4949. if (isSymbol(value)) {
  4950. return symbolToString ? symbolToString.call(value) : '';
  4951. }
  4952. var result = (value + '');
  4953. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  4954. }
  4955. /**
  4956. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  4957. *
  4958. * @private
  4959. * @param {Array} array The array to inspect.
  4960. * @param {Function} [iteratee] The iteratee invoked per element.
  4961. * @param {Function} [comparator] The comparator invoked per element.
  4962. * @returns {Array} Returns the new duplicate free array.
  4963. */
  4964. function baseUniq(array, iteratee, comparator) {
  4965. var index = -1,
  4966. includes = arrayIncludes,
  4967. length = array.length,
  4968. isCommon = true,
  4969. result = [],
  4970. seen = result;
  4971. if (comparator) {
  4972. isCommon = false;
  4973. includes = arrayIncludesWith;
  4974. }
  4975. else if (length >= LARGE_ARRAY_SIZE) {
  4976. var set = iteratee ? null : createSet(array);
  4977. if (set) {
  4978. return setToArray(set);
  4979. }
  4980. isCommon = false;
  4981. includes = cacheHas;
  4982. seen = new SetCache;
  4983. }
  4984. else {
  4985. seen = iteratee ? [] : result;
  4986. }
  4987. outer:
  4988. while (++index < length) {
  4989. var value = array[index],
  4990. computed = iteratee ? iteratee(value) : value;
  4991. value = (comparator || value !== 0) ? value : 0;
  4992. if (isCommon && computed === computed) {
  4993. var seenIndex = seen.length;
  4994. while (seenIndex--) {
  4995. if (seen[seenIndex] === computed) {
  4996. continue outer;
  4997. }
  4998. }
  4999. if (iteratee) {
  5000. seen.push(computed);
  5001. }
  5002. result.push(value);
  5003. }
  5004. else if (!includes(seen, computed, comparator)) {
  5005. if (seen !== result) {
  5006. seen.push(computed);
  5007. }
  5008. result.push(value);
  5009. }
  5010. }
  5011. return result;
  5012. }
  5013. /**
  5014. * The base implementation of `_.unset`.
  5015. *
  5016. * @private
  5017. * @param {Object} object The object to modify.
  5018. * @param {Array|string} path The property path to unset.
  5019. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5020. */
  5021. function baseUnset(object, path) {
  5022. path = castPath(path, object);
  5023. object = parent(object, path);
  5024. return object == null || delete object[toKey(last(path))];
  5025. }
  5026. /**
  5027. * The base implementation of `_.update`.
  5028. *
  5029. * @private
  5030. * @param {Object} object The object to modify.
  5031. * @param {Array|string} path The path of the property to update.
  5032. * @param {Function} updater The function to produce the updated value.
  5033. * @param {Function} [customizer] The function to customize path creation.
  5034. * @returns {Object} Returns `object`.
  5035. */
  5036. function baseUpdate(object, path, updater, customizer) {
  5037. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5038. }
  5039. /**
  5040. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5041. * without support for iteratee shorthands.
  5042. *
  5043. * @private
  5044. * @param {Array} array The array to query.
  5045. * @param {Function} predicate The function invoked per iteration.
  5046. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5047. * @param {boolean} [fromRight] Specify iterating from right to left.
  5048. * @returns {Array} Returns the slice of `array`.
  5049. */
  5050. function baseWhile(array, predicate, isDrop, fromRight) {
  5051. var length = array.length,
  5052. index = fromRight ? length : -1;
  5053. while ((fromRight ? index-- : ++index < length) &&
  5054. predicate(array[index], index, array)) {}
  5055. return isDrop
  5056. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5057. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5058. }
  5059. /**
  5060. * The base implementation of `wrapperValue` which returns the result of
  5061. * performing a sequence of actions on the unwrapped `value`, where each
  5062. * successive action is supplied the return value of the previous.
  5063. *
  5064. * @private
  5065. * @param {*} value The unwrapped value.
  5066. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5067. * @returns {*} Returns the resolved value.
  5068. */
  5069. function baseWrapperValue(value, actions) {
  5070. var result = value;
  5071. if (result instanceof LazyWrapper) {
  5072. result = result.value();
  5073. }
  5074. return arrayReduce(actions, function(result, action) {
  5075. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5076. }, result);
  5077. }
  5078. /**
  5079. * The base implementation of methods like `_.xor`, without support for
  5080. * iteratee shorthands, that accepts an array of arrays to inspect.
  5081. *
  5082. * @private
  5083. * @param {Array} arrays The arrays to inspect.
  5084. * @param {Function} [iteratee] The iteratee invoked per element.
  5085. * @param {Function} [comparator] The comparator invoked per element.
  5086. * @returns {Array} Returns the new array of values.
  5087. */
  5088. function baseXor(arrays, iteratee, comparator) {
  5089. var length = arrays.length;
  5090. if (length < 2) {
  5091. return length ? baseUniq(arrays[0]) : [];
  5092. }
  5093. var index = -1,
  5094. result = Array(length);
  5095. while (++index < length) {
  5096. var array = arrays[index],
  5097. othIndex = -1;
  5098. while (++othIndex < length) {
  5099. if (othIndex != index) {
  5100. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5101. }
  5102. }
  5103. }
  5104. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5105. }
  5106. /**
  5107. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5108. *
  5109. * @private
  5110. * @param {Array} props The property identifiers.
  5111. * @param {Array} values The property values.
  5112. * @param {Function} assignFunc The function to assign values.
  5113. * @returns {Object} Returns the new object.
  5114. */
  5115. function baseZipObject(props, values, assignFunc) {
  5116. var index = -1,
  5117. length = props.length,
  5118. valsLength = values.length,
  5119. result = {};
  5120. while (++index < length) {
  5121. var value = index < valsLength ? values[index] : undefined;
  5122. assignFunc(result, props[index], value);
  5123. }
  5124. return result;
  5125. }
  5126. /**
  5127. * Casts `value` to an empty array if it's not an array like object.
  5128. *
  5129. * @private
  5130. * @param {*} value The value to inspect.
  5131. * @returns {Array|Object} Returns the cast array-like object.
  5132. */
  5133. function castArrayLikeObject(value) {
  5134. return isArrayLikeObject(value) ? value : [];
  5135. }
  5136. /**
  5137. * Casts `value` to `identity` if it's not a function.
  5138. *
  5139. * @private
  5140. * @param {*} value The value to inspect.
  5141. * @returns {Function} Returns cast function.
  5142. */
  5143. function castFunction(value) {
  5144. return typeof value == 'function' ? value : identity;
  5145. }
  5146. /**
  5147. * Casts `value` to a path array if it's not one.
  5148. *
  5149. * @private
  5150. * @param {*} value The value to inspect.
  5151. * @param {Object} [object] The object to query keys on.
  5152. * @returns {Array} Returns the cast property path array.
  5153. */
  5154. function castPath(value, object) {
  5155. if (isArray(value)) {
  5156. return value;
  5157. }
  5158. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5159. }
  5160. /**
  5161. * A `baseRest` alias which can be replaced with `identity` by module
  5162. * replacement plugins.
  5163. *
  5164. * @private
  5165. * @type {Function}
  5166. * @param {Function} func The function to apply a rest parameter to.
  5167. * @returns {Function} Returns the new function.
  5168. */
  5169. var castRest = baseRest;
  5170. /**
  5171. * Casts `array` to a slice if it's needed.
  5172. *
  5173. * @private
  5174. * @param {Array} array The array to inspect.
  5175. * @param {number} start The start position.
  5176. * @param {number} [end=array.length] The end position.
  5177. * @returns {Array} Returns the cast slice.
  5178. */
  5179. function castSlice(array, start, end) {
  5180. var length = array.length;
  5181. end = end === undefined ? length : end;
  5182. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5183. }
  5184. /**
  5185. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5186. *
  5187. * @private
  5188. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5189. */
  5190. var clearTimeout = ctxClearTimeout || function(id) {
  5191. return root.clearTimeout(id);
  5192. };
  5193. /**
  5194. * Creates a clone of `buffer`.
  5195. *
  5196. * @private
  5197. * @param {Buffer} buffer The buffer to clone.
  5198. * @param {boolean} [isDeep] Specify a deep clone.
  5199. * @returns {Buffer} Returns the cloned buffer.
  5200. */
  5201. function cloneBuffer(buffer, isDeep) {
  5202. if (isDeep) {
  5203. return buffer.slice();
  5204. }
  5205. var length = buffer.length,
  5206. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5207. buffer.copy(result);
  5208. return result;
  5209. }
  5210. /**
  5211. * Creates a clone of `arrayBuffer`.
  5212. *
  5213. * @private
  5214. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5215. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5216. */
  5217. function cloneArrayBuffer(arrayBuffer) {
  5218. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5219. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5220. return result;
  5221. }
  5222. /**
  5223. * Creates a clone of `dataView`.
  5224. *
  5225. * @private
  5226. * @param {Object} dataView The data view to clone.
  5227. * @param {boolean} [isDeep] Specify a deep clone.
  5228. * @returns {Object} Returns the cloned data view.
  5229. */
  5230. function cloneDataView(dataView, isDeep) {
  5231. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5232. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5233. }
  5234. /**
  5235. * Creates a clone of `regexp`.
  5236. *
  5237. * @private
  5238. * @param {Object} regexp The regexp to clone.
  5239. * @returns {Object} Returns the cloned regexp.
  5240. */
  5241. function cloneRegExp(regexp) {
  5242. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5243. result.lastIndex = regexp.lastIndex;
  5244. return result;
  5245. }
  5246. /**
  5247. * Creates a clone of the `symbol` object.
  5248. *
  5249. * @private
  5250. * @param {Object} symbol The symbol object to clone.
  5251. * @returns {Object} Returns the cloned symbol object.
  5252. */
  5253. function cloneSymbol(symbol) {
  5254. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5255. }
  5256. /**
  5257. * Creates a clone of `typedArray`.
  5258. *
  5259. * @private
  5260. * @param {Object} typedArray The typed array to clone.
  5261. * @param {boolean} [isDeep] Specify a deep clone.
  5262. * @returns {Object} Returns the cloned typed array.
  5263. */
  5264. function cloneTypedArray(typedArray, isDeep) {
  5265. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5266. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5267. }
  5268. /**
  5269. * Compares values to sort them in ascending order.
  5270. *
  5271. * @private
  5272. * @param {*} value The value to compare.
  5273. * @param {*} other The other value to compare.
  5274. * @returns {number} Returns the sort order indicator for `value`.
  5275. */
  5276. function compareAscending(value, other) {
  5277. if (value !== other) {
  5278. var valIsDefined = value !== undefined,
  5279. valIsNull = value === null,
  5280. valIsReflexive = value === value,
  5281. valIsSymbol = isSymbol(value);
  5282. var othIsDefined = other !== undefined,
  5283. othIsNull = other === null,
  5284. othIsReflexive = other === other,
  5285. othIsSymbol = isSymbol(other);
  5286. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5287. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5288. (valIsNull && othIsDefined && othIsReflexive) ||
  5289. (!valIsDefined && othIsReflexive) ||
  5290. !valIsReflexive) {
  5291. return 1;
  5292. }
  5293. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5294. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5295. (othIsNull && valIsDefined && valIsReflexive) ||
  5296. (!othIsDefined && valIsReflexive) ||
  5297. !othIsReflexive) {
  5298. return -1;
  5299. }
  5300. }
  5301. return 0;
  5302. }
  5303. /**
  5304. * Used by `_.orderBy` to compare multiple properties of a value to another
  5305. * and stable sort them.
  5306. *
  5307. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5308. * specify an order of "desc" for descending or "asc" for ascending sort order
  5309. * of corresponding values.
  5310. *
  5311. * @private
  5312. * @param {Object} object The object to compare.
  5313. * @param {Object} other The other object to compare.
  5314. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5315. * @returns {number} Returns the sort order indicator for `object`.
  5316. */
  5317. function compareMultiple(object, other, orders) {
  5318. var index = -1,
  5319. objCriteria = object.criteria,
  5320. othCriteria = other.criteria,
  5321. length = objCriteria.length,
  5322. ordersLength = orders.length;
  5323. while (++index < length) {
  5324. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5325. if (result) {
  5326. if (index >= ordersLength) {
  5327. return result;
  5328. }
  5329. var order = orders[index];
  5330. return result * (order == 'desc' ? -1 : 1);
  5331. }
  5332. }
  5333. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5334. // that causes it, under certain circumstances, to provide the same value for
  5335. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5336. // for more details.
  5337. //
  5338. // This also ensures a stable sort in V8 and other engines.
  5339. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5340. return object.index - other.index;
  5341. }
  5342. /**
  5343. * Creates an array that is the composition of partially applied arguments,
  5344. * placeholders, and provided arguments into a single array of arguments.
  5345. *
  5346. * @private
  5347. * @param {Array} args The provided arguments.
  5348. * @param {Array} partials The arguments to prepend to those provided.
  5349. * @param {Array} holders The `partials` placeholder indexes.
  5350. * @params {boolean} [isCurried] Specify composing for a curried function.
  5351. * @returns {Array} Returns the new array of composed arguments.
  5352. */
  5353. function composeArgs(args, partials, holders, isCurried) {
  5354. var argsIndex = -1,
  5355. argsLength = args.length,
  5356. holdersLength = holders.length,
  5357. leftIndex = -1,
  5358. leftLength = partials.length,
  5359. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5360. result = Array(leftLength + rangeLength),
  5361. isUncurried = !isCurried;
  5362. while (++leftIndex < leftLength) {
  5363. result[leftIndex] = partials[leftIndex];
  5364. }
  5365. while (++argsIndex < holdersLength) {
  5366. if (isUncurried || argsIndex < argsLength) {
  5367. result[holders[argsIndex]] = args[argsIndex];
  5368. }
  5369. }
  5370. while (rangeLength--) {
  5371. result[leftIndex++] = args[argsIndex++];
  5372. }
  5373. return result;
  5374. }
  5375. /**
  5376. * This function is like `composeArgs` except that the arguments composition
  5377. * is tailored for `_.partialRight`.
  5378. *
  5379. * @private
  5380. * @param {Array} args The provided arguments.
  5381. * @param {Array} partials The arguments to append to those provided.
  5382. * @param {Array} holders The `partials` placeholder indexes.
  5383. * @params {boolean} [isCurried] Specify composing for a curried function.
  5384. * @returns {Array} Returns the new array of composed arguments.
  5385. */
  5386. function composeArgsRight(args, partials, holders, isCurried) {
  5387. var argsIndex = -1,
  5388. argsLength = args.length,
  5389. holdersIndex = -1,
  5390. holdersLength = holders.length,
  5391. rightIndex = -1,
  5392. rightLength = partials.length,
  5393. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5394. result = Array(rangeLength + rightLength),
  5395. isUncurried = !isCurried;
  5396. while (++argsIndex < rangeLength) {
  5397. result[argsIndex] = args[argsIndex];
  5398. }
  5399. var offset = argsIndex;
  5400. while (++rightIndex < rightLength) {
  5401. result[offset + rightIndex] = partials[rightIndex];
  5402. }
  5403. while (++holdersIndex < holdersLength) {
  5404. if (isUncurried || argsIndex < argsLength) {
  5405. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5406. }
  5407. }
  5408. return result;
  5409. }
  5410. /**
  5411. * Copies the values of `source` to `array`.
  5412. *
  5413. * @private
  5414. * @param {Array} source The array to copy values from.
  5415. * @param {Array} [array=[]] The array to copy values to.
  5416. * @returns {Array} Returns `array`.
  5417. */
  5418. function copyArray(source, array) {
  5419. var index = -1,
  5420. length = source.length;
  5421. array || (array = Array(length));
  5422. while (++index < length) {
  5423. array[index] = source[index];
  5424. }
  5425. return array;
  5426. }
  5427. /**
  5428. * Copies properties of `source` to `object`.
  5429. *
  5430. * @private
  5431. * @param {Object} source The object to copy properties from.
  5432. * @param {Array} props The property identifiers to copy.
  5433. * @param {Object} [object={}] The object to copy properties to.
  5434. * @param {Function} [customizer] The function to customize copied values.
  5435. * @returns {Object} Returns `object`.
  5436. */
  5437. function copyObject(source, props, object, customizer) {
  5438. var isNew = !object;
  5439. object || (object = {});
  5440. var index = -1,
  5441. length = props.length;
  5442. while (++index < length) {
  5443. var key = props[index];
  5444. var newValue = customizer
  5445. ? customizer(object[key], source[key], key, object, source)
  5446. : undefined;
  5447. if (newValue === undefined) {
  5448. newValue = source[key];
  5449. }
  5450. if (isNew) {
  5451. baseAssignValue(object, key, newValue);
  5452. } else {
  5453. assignValue(object, key, newValue);
  5454. }
  5455. }
  5456. return object;
  5457. }
  5458. /**
  5459. * Copies own symbols of `source` to `object`.
  5460. *
  5461. * @private
  5462. * @param {Object} source The object to copy symbols from.
  5463. * @param {Object} [object={}] The object to copy symbols to.
  5464. * @returns {Object} Returns `object`.
  5465. */
  5466. function copySymbols(source, object) {
  5467. return copyObject(source, getSymbols(source), object);
  5468. }
  5469. /**
  5470. * Copies own and inherited symbols of `source` to `object`.
  5471. *
  5472. * @private
  5473. * @param {Object} source The object to copy symbols from.
  5474. * @param {Object} [object={}] The object to copy symbols to.
  5475. * @returns {Object} Returns `object`.
  5476. */
  5477. function copySymbolsIn(source, object) {
  5478. return copyObject(source, getSymbolsIn(source), object);
  5479. }
  5480. /**
  5481. * Creates a function like `_.groupBy`.
  5482. *
  5483. * @private
  5484. * @param {Function} setter The function to set accumulator values.
  5485. * @param {Function} [initializer] The accumulator object initializer.
  5486. * @returns {Function} Returns the new aggregator function.
  5487. */
  5488. function createAggregator(setter, initializer) {
  5489. return function(collection, iteratee) {
  5490. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5491. accumulator = initializer ? initializer() : {};
  5492. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5493. };
  5494. }
  5495. /**
  5496. * Creates a function like `_.assign`.
  5497. *
  5498. * @private
  5499. * @param {Function} assigner The function to assign values.
  5500. * @returns {Function} Returns the new assigner function.
  5501. */
  5502. function createAssigner(assigner) {
  5503. return baseRest(function(object, sources) {
  5504. var index = -1,
  5505. length = sources.length,
  5506. customizer = length > 1 ? sources[length - 1] : undefined,
  5507. guard = length > 2 ? sources[2] : undefined;
  5508. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5509. ? (length--, customizer)
  5510. : undefined;
  5511. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5512. customizer = length < 3 ? undefined : customizer;
  5513. length = 1;
  5514. }
  5515. object = Object(object);
  5516. while (++index < length) {
  5517. var source = sources[index];
  5518. if (source) {
  5519. assigner(object, source, index, customizer);
  5520. }
  5521. }
  5522. return object;
  5523. });
  5524. }
  5525. /**
  5526. * Creates a `baseEach` or `baseEachRight` function.
  5527. *
  5528. * @private
  5529. * @param {Function} eachFunc The function to iterate over a collection.
  5530. * @param {boolean} [fromRight] Specify iterating from right to left.
  5531. * @returns {Function} Returns the new base function.
  5532. */
  5533. function createBaseEach(eachFunc, fromRight) {
  5534. return function(collection, iteratee) {
  5535. if (collection == null) {
  5536. return collection;
  5537. }
  5538. if (!isArrayLike(collection)) {
  5539. return eachFunc(collection, iteratee);
  5540. }
  5541. var length = collection.length,
  5542. index = fromRight ? length : -1,
  5543. iterable = Object(collection);
  5544. while ((fromRight ? index-- : ++index < length)) {
  5545. if (iteratee(iterable[index], index, iterable) === false) {
  5546. break;
  5547. }
  5548. }
  5549. return collection;
  5550. };
  5551. }
  5552. /**
  5553. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5554. *
  5555. * @private
  5556. * @param {boolean} [fromRight] Specify iterating from right to left.
  5557. * @returns {Function} Returns the new base function.
  5558. */
  5559. function createBaseFor(fromRight) {
  5560. return function(object, iteratee, keysFunc) {
  5561. var index = -1,
  5562. iterable = Object(object),
  5563. props = keysFunc(object),
  5564. length = props.length;
  5565. while (length--) {
  5566. var key = props[fromRight ? length : ++index];
  5567. if (iteratee(iterable[key], key, iterable) === false) {
  5568. break;
  5569. }
  5570. }
  5571. return object;
  5572. };
  5573. }
  5574. /**
  5575. * Creates a function that wraps `func` to invoke it with the optional `this`
  5576. * binding of `thisArg`.
  5577. *
  5578. * @private
  5579. * @param {Function} func The function to wrap.
  5580. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5581. * @param {*} [thisArg] The `this` binding of `func`.
  5582. * @returns {Function} Returns the new wrapped function.
  5583. */
  5584. function createBind(func, bitmask, thisArg) {
  5585. var isBind = bitmask & WRAP_BIND_FLAG,
  5586. Ctor = createCtor(func);
  5587. function wrapper() {
  5588. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5589. return fn.apply(isBind ? thisArg : this, arguments);
  5590. }
  5591. return wrapper;
  5592. }
  5593. /**
  5594. * Creates a function like `_.lowerFirst`.
  5595. *
  5596. * @private
  5597. * @param {string} methodName The name of the `String` case method to use.
  5598. * @returns {Function} Returns the new case function.
  5599. */
  5600. function createCaseFirst(methodName) {
  5601. return function(string) {
  5602. string = toString(string);
  5603. var strSymbols = hasUnicode(string)
  5604. ? stringToArray(string)
  5605. : undefined;
  5606. var chr = strSymbols
  5607. ? strSymbols[0]
  5608. : string.charAt(0);
  5609. var trailing = strSymbols
  5610. ? castSlice(strSymbols, 1).join('')
  5611. : string.slice(1);
  5612. return chr[methodName]() + trailing;
  5613. };
  5614. }
  5615. /**
  5616. * Creates a function like `_.camelCase`.
  5617. *
  5618. * @private
  5619. * @param {Function} callback The function to combine each word.
  5620. * @returns {Function} Returns the new compounder function.
  5621. */
  5622. function createCompounder(callback) {
  5623. return function(string) {
  5624. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5625. };
  5626. }
  5627. /**
  5628. * Creates a function that produces an instance of `Ctor` regardless of
  5629. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5630. *
  5631. * @private
  5632. * @param {Function} Ctor The constructor to wrap.
  5633. * @returns {Function} Returns the new wrapped function.
  5634. */
  5635. function createCtor(Ctor) {
  5636. return function() {
  5637. // Use a `switch` statement to work with class constructors. See
  5638. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5639. // for more details.
  5640. var args = arguments;
  5641. switch (args.length) {
  5642. case 0: return new Ctor;
  5643. case 1: return new Ctor(args[0]);
  5644. case 2: return new Ctor(args[0], args[1]);
  5645. case 3: return new Ctor(args[0], args[1], args[2]);
  5646. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5647. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5648. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5649. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5650. }
  5651. var thisBinding = baseCreate(Ctor.prototype),
  5652. result = Ctor.apply(thisBinding, args);
  5653. // Mimic the constructor's `return` behavior.
  5654. // See https://es5.github.io/#x13.2.2 for more details.
  5655. return isObject(result) ? result : thisBinding;
  5656. };
  5657. }
  5658. /**
  5659. * Creates a function that wraps `func` to enable currying.
  5660. *
  5661. * @private
  5662. * @param {Function} func The function to wrap.
  5663. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5664. * @param {number} arity The arity of `func`.
  5665. * @returns {Function} Returns the new wrapped function.
  5666. */
  5667. function createCurry(func, bitmask, arity) {
  5668. var Ctor = createCtor(func);
  5669. function wrapper() {
  5670. var length = arguments.length,
  5671. args = Array(length),
  5672. index = length,
  5673. placeholder = getHolder(wrapper);
  5674. while (index--) {
  5675. args[index] = arguments[index];
  5676. }
  5677. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5678. ? []
  5679. : replaceHolders(args, placeholder);
  5680. length -= holders.length;
  5681. if (length < arity) {
  5682. return createRecurry(
  5683. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5684. args, holders, undefined, undefined, arity - length);
  5685. }
  5686. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5687. return apply(fn, this, args);
  5688. }
  5689. return wrapper;
  5690. }
  5691. /**
  5692. * Creates a `_.find` or `_.findLast` function.
  5693. *
  5694. * @private
  5695. * @param {Function} findIndexFunc The function to find the collection index.
  5696. * @returns {Function} Returns the new find function.
  5697. */
  5698. function createFind(findIndexFunc) {
  5699. return function(collection, predicate, fromIndex) {
  5700. var iterable = Object(collection);
  5701. if (!isArrayLike(collection)) {
  5702. var iteratee = getIteratee(predicate, 3);
  5703. collection = keys(collection);
  5704. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5705. }
  5706. var index = findIndexFunc(collection, predicate, fromIndex);
  5707. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5708. };
  5709. }
  5710. /**
  5711. * Creates a `_.flow` or `_.flowRight` function.
  5712. *
  5713. * @private
  5714. * @param {boolean} [fromRight] Specify iterating from right to left.
  5715. * @returns {Function} Returns the new flow function.
  5716. */
  5717. function createFlow(fromRight) {
  5718. return flatRest(function(funcs) {
  5719. var length = funcs.length,
  5720. index = length,
  5721. prereq = LodashWrapper.prototype.thru;
  5722. if (fromRight) {
  5723. funcs.reverse();
  5724. }
  5725. while (index--) {
  5726. var func = funcs[index];
  5727. if (typeof func != 'function') {
  5728. throw new TypeError(FUNC_ERROR_TEXT);
  5729. }
  5730. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5731. var wrapper = new LodashWrapper([], true);
  5732. }
  5733. }
  5734. index = wrapper ? index : length;
  5735. while (++index < length) {
  5736. func = funcs[index];
  5737. var funcName = getFuncName(func),
  5738. data = funcName == 'wrapper' ? getData(func) : undefined;
  5739. if (data && isLaziable(data[0]) &&
  5740. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5741. !data[4].length && data[9] == 1
  5742. ) {
  5743. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5744. } else {
  5745. wrapper = (func.length == 1 && isLaziable(func))
  5746. ? wrapper[funcName]()
  5747. : wrapper.thru(func);
  5748. }
  5749. }
  5750. return function() {
  5751. var args = arguments,
  5752. value = args[0];
  5753. if (wrapper && args.length == 1 && isArray(value)) {
  5754. return wrapper.plant(value).value();
  5755. }
  5756. var index = 0,
  5757. result = length ? funcs[index].apply(this, args) : value;
  5758. while (++index < length) {
  5759. result = funcs[index].call(this, result);
  5760. }
  5761. return result;
  5762. };
  5763. });
  5764. }
  5765. /**
  5766. * Creates a function that wraps `func` to invoke it with optional `this`
  5767. * binding of `thisArg`, partial application, and currying.
  5768. *
  5769. * @private
  5770. * @param {Function|string} func The function or method name to wrap.
  5771. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5772. * @param {*} [thisArg] The `this` binding of `func`.
  5773. * @param {Array} [partials] The arguments to prepend to those provided to
  5774. * the new function.
  5775. * @param {Array} [holders] The `partials` placeholder indexes.
  5776. * @param {Array} [partialsRight] The arguments to append to those provided
  5777. * to the new function.
  5778. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5779. * @param {Array} [argPos] The argument positions of the new function.
  5780. * @param {number} [ary] The arity cap of `func`.
  5781. * @param {number} [arity] The arity of `func`.
  5782. * @returns {Function} Returns the new wrapped function.
  5783. */
  5784. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5785. var isAry = bitmask & WRAP_ARY_FLAG,
  5786. isBind = bitmask & WRAP_BIND_FLAG,
  5787. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5788. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5789. isFlip = bitmask & WRAP_FLIP_FLAG,
  5790. Ctor = isBindKey ? undefined : createCtor(func);
  5791. function wrapper() {
  5792. var length = arguments.length,
  5793. args = Array(length),
  5794. index = length;
  5795. while (index--) {
  5796. args[index] = arguments[index];
  5797. }
  5798. if (isCurried) {
  5799. var placeholder = getHolder(wrapper),
  5800. holdersCount = countHolders(args, placeholder);
  5801. }
  5802. if (partials) {
  5803. args = composeArgs(args, partials, holders, isCurried);
  5804. }
  5805. if (partialsRight) {
  5806. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5807. }
  5808. length -= holdersCount;
  5809. if (isCurried && length < arity) {
  5810. var newHolders = replaceHolders(args, placeholder);
  5811. return createRecurry(
  5812. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5813. args, newHolders, argPos, ary, arity - length
  5814. );
  5815. }
  5816. var thisBinding = isBind ? thisArg : this,
  5817. fn = isBindKey ? thisBinding[func] : func;
  5818. length = args.length;
  5819. if (argPos) {
  5820. args = reorder(args, argPos);
  5821. } else if (isFlip && length > 1) {
  5822. args.reverse();
  5823. }
  5824. if (isAry && ary < length) {
  5825. args.length = ary;
  5826. }
  5827. if (this && this !== root && this instanceof wrapper) {
  5828. fn = Ctor || createCtor(fn);
  5829. }
  5830. return fn.apply(thisBinding, args);
  5831. }
  5832. return wrapper;
  5833. }
  5834. /**
  5835. * Creates a function like `_.invertBy`.
  5836. *
  5837. * @private
  5838. * @param {Function} setter The function to set accumulator values.
  5839. * @param {Function} toIteratee The function to resolve iteratees.
  5840. * @returns {Function} Returns the new inverter function.
  5841. */
  5842. function createInverter(setter, toIteratee) {
  5843. return function(object, iteratee) {
  5844. return baseInverter(object, setter, toIteratee(iteratee), {});
  5845. };
  5846. }
  5847. /**
  5848. * Creates a function that performs a mathematical operation on two values.
  5849. *
  5850. * @private
  5851. * @param {Function} operator The function to perform the operation.
  5852. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5853. * @returns {Function} Returns the new mathematical operation function.
  5854. */
  5855. function createMathOperation(operator, defaultValue) {
  5856. return function(value, other) {
  5857. var result;
  5858. if (value === undefined && other === undefined) {
  5859. return defaultValue;
  5860. }
  5861. if (value !== undefined) {
  5862. result = value;
  5863. }
  5864. if (other !== undefined) {
  5865. if (result === undefined) {
  5866. return other;
  5867. }
  5868. if (typeof value == 'string' || typeof other == 'string') {
  5869. value = baseToString(value);
  5870. other = baseToString(other);
  5871. } else {
  5872. value = baseToNumber(value);
  5873. other = baseToNumber(other);
  5874. }
  5875. result = operator(value, other);
  5876. }
  5877. return result;
  5878. };
  5879. }
  5880. /**
  5881. * Creates a function like `_.over`.
  5882. *
  5883. * @private
  5884. * @param {Function} arrayFunc The function to iterate over iteratees.
  5885. * @returns {Function} Returns the new over function.
  5886. */
  5887. function createOver(arrayFunc) {
  5888. return flatRest(function(iteratees) {
  5889. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5890. return baseRest(function(args) {
  5891. var thisArg = this;
  5892. return arrayFunc(iteratees, function(iteratee) {
  5893. return apply(iteratee, thisArg, args);
  5894. });
  5895. });
  5896. });
  5897. }
  5898. /**
  5899. * Creates the padding for `string` based on `length`. The `chars` string
  5900. * is truncated if the number of characters exceeds `length`.
  5901. *
  5902. * @private
  5903. * @param {number} length The padding length.
  5904. * @param {string} [chars=' '] The string used as padding.
  5905. * @returns {string} Returns the padding for `string`.
  5906. */
  5907. function createPadding(length, chars) {
  5908. chars = chars === undefined ? ' ' : baseToString(chars);
  5909. var charsLength = chars.length;
  5910. if (charsLength < 2) {
  5911. return charsLength ? baseRepeat(chars, length) : chars;
  5912. }
  5913. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  5914. return hasUnicode(chars)
  5915. ? castSlice(stringToArray(result), 0, length).join('')
  5916. : result.slice(0, length);
  5917. }
  5918. /**
  5919. * Creates a function that wraps `func` to invoke it with the `this` binding
  5920. * of `thisArg` and `partials` prepended to the arguments it receives.
  5921. *
  5922. * @private
  5923. * @param {Function} func The function to wrap.
  5924. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5925. * @param {*} thisArg The `this` binding of `func`.
  5926. * @param {Array} partials The arguments to prepend to those provided to
  5927. * the new function.
  5928. * @returns {Function} Returns the new wrapped function.
  5929. */
  5930. function createPartial(func, bitmask, thisArg, partials) {
  5931. var isBind = bitmask & WRAP_BIND_FLAG,
  5932. Ctor = createCtor(func);
  5933. function wrapper() {
  5934. var argsIndex = -1,
  5935. argsLength = arguments.length,
  5936. leftIndex = -1,
  5937. leftLength = partials.length,
  5938. args = Array(leftLength + argsLength),
  5939. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5940. while (++leftIndex < leftLength) {
  5941. args[leftIndex] = partials[leftIndex];
  5942. }
  5943. while (argsLength--) {
  5944. args[leftIndex++] = arguments[++argsIndex];
  5945. }
  5946. return apply(fn, isBind ? thisArg : this, args);
  5947. }
  5948. return wrapper;
  5949. }
  5950. /**
  5951. * Creates a `_.range` or `_.rangeRight` function.
  5952. *
  5953. * @private
  5954. * @param {boolean} [fromRight] Specify iterating from right to left.
  5955. * @returns {Function} Returns the new range function.
  5956. */
  5957. function createRange(fromRight) {
  5958. return function(start, end, step) {
  5959. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  5960. end = step = undefined;
  5961. }
  5962. // Ensure the sign of `-0` is preserved.
  5963. start = toFinite(start);
  5964. if (end === undefined) {
  5965. end = start;
  5966. start = 0;
  5967. } else {
  5968. end = toFinite(end);
  5969. }
  5970. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  5971. return baseRange(start, end, step, fromRight);
  5972. };
  5973. }
  5974. /**
  5975. * Creates a function that performs a relational operation on two values.
  5976. *
  5977. * @private
  5978. * @param {Function} operator The function to perform the operation.
  5979. * @returns {Function} Returns the new relational operation function.
  5980. */
  5981. function createRelationalOperation(operator) {
  5982. return function(value, other) {
  5983. if (!(typeof value == 'string' && typeof other == 'string')) {
  5984. value = toNumber(value);
  5985. other = toNumber(other);
  5986. }
  5987. return operator(value, other);
  5988. };
  5989. }
  5990. /**
  5991. * Creates a function that wraps `func` to continue currying.
  5992. *
  5993. * @private
  5994. * @param {Function} func The function to wrap.
  5995. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5996. * @param {Function} wrapFunc The function to create the `func` wrapper.
  5997. * @param {*} placeholder The placeholder value.
  5998. * @param {*} [thisArg] The `this` binding of `func`.
  5999. * @param {Array} [partials] The arguments to prepend to those provided to
  6000. * the new function.
  6001. * @param {Array} [holders] The `partials` placeholder indexes.
  6002. * @param {Array} [argPos] The argument positions of the new function.
  6003. * @param {number} [ary] The arity cap of `func`.
  6004. * @param {number} [arity] The arity of `func`.
  6005. * @returns {Function} Returns the new wrapped function.
  6006. */
  6007. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6008. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6009. newHolders = isCurry ? holders : undefined,
  6010. newHoldersRight = isCurry ? undefined : holders,
  6011. newPartials = isCurry ? partials : undefined,
  6012. newPartialsRight = isCurry ? undefined : partials;
  6013. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6014. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6015. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6016. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6017. }
  6018. var newData = [
  6019. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6020. newHoldersRight, argPos, ary, arity
  6021. ];
  6022. var result = wrapFunc.apply(undefined, newData);
  6023. if (isLaziable(func)) {
  6024. setData(result, newData);
  6025. }
  6026. result.placeholder = placeholder;
  6027. return setWrapToString(result, func, bitmask);
  6028. }
  6029. /**
  6030. * Creates a function like `_.round`.
  6031. *
  6032. * @private
  6033. * @param {string} methodName The name of the `Math` method to use when rounding.
  6034. * @returns {Function} Returns the new round function.
  6035. */
  6036. function createRound(methodName) {
  6037. var func = Math[methodName];
  6038. return function(number, precision) {
  6039. number = toNumber(number);
  6040. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6041. if (precision && nativeIsFinite(number)) {
  6042. // Shift with exponential notation to avoid floating-point issues.
  6043. // See [MDN](https://mdn.io/round#Examples) for more details.
  6044. var pair = (toString(number) + 'e').split('e'),
  6045. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6046. pair = (toString(value) + 'e').split('e');
  6047. return +(pair[0] + 'e' + (+pair[1] - precision));
  6048. }
  6049. return func(number);
  6050. };
  6051. }
  6052. /**
  6053. * Creates a set object of `values`.
  6054. *
  6055. * @private
  6056. * @param {Array} values The values to add to the set.
  6057. * @returns {Object} Returns the new set.
  6058. */
  6059. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6060. return new Set(values);
  6061. };
  6062. /**
  6063. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6064. *
  6065. * @private
  6066. * @param {Function} keysFunc The function to get the keys of a given object.
  6067. * @returns {Function} Returns the new pairs function.
  6068. */
  6069. function createToPairs(keysFunc) {
  6070. return function(object) {
  6071. var tag = getTag(object);
  6072. if (tag == mapTag) {
  6073. return mapToArray(object);
  6074. }
  6075. if (tag == setTag) {
  6076. return setToPairs(object);
  6077. }
  6078. return baseToPairs(object, keysFunc(object));
  6079. };
  6080. }
  6081. /**
  6082. * Creates a function that either curries or invokes `func` with optional
  6083. * `this` binding and partially applied arguments.
  6084. *
  6085. * @private
  6086. * @param {Function|string} func The function or method name to wrap.
  6087. * @param {number} bitmask The bitmask flags.
  6088. * 1 - `_.bind`
  6089. * 2 - `_.bindKey`
  6090. * 4 - `_.curry` or `_.curryRight` of a bound function
  6091. * 8 - `_.curry`
  6092. * 16 - `_.curryRight`
  6093. * 32 - `_.partial`
  6094. * 64 - `_.partialRight`
  6095. * 128 - `_.rearg`
  6096. * 256 - `_.ary`
  6097. * 512 - `_.flip`
  6098. * @param {*} [thisArg] The `this` binding of `func`.
  6099. * @param {Array} [partials] The arguments to be partially applied.
  6100. * @param {Array} [holders] The `partials` placeholder indexes.
  6101. * @param {Array} [argPos] The argument positions of the new function.
  6102. * @param {number} [ary] The arity cap of `func`.
  6103. * @param {number} [arity] The arity of `func`.
  6104. * @returns {Function} Returns the new wrapped function.
  6105. */
  6106. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6107. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6108. if (!isBindKey && typeof func != 'function') {
  6109. throw new TypeError(FUNC_ERROR_TEXT);
  6110. }
  6111. var length = partials ? partials.length : 0;
  6112. if (!length) {
  6113. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6114. partials = holders = undefined;
  6115. }
  6116. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6117. arity = arity === undefined ? arity : toInteger(arity);
  6118. length -= holders ? holders.length : 0;
  6119. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6120. var partialsRight = partials,
  6121. holdersRight = holders;
  6122. partials = holders = undefined;
  6123. }
  6124. var data = isBindKey ? undefined : getData(func);
  6125. var newData = [
  6126. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6127. argPos, ary, arity
  6128. ];
  6129. if (data) {
  6130. mergeData(newData, data);
  6131. }
  6132. func = newData[0];
  6133. bitmask = newData[1];
  6134. thisArg = newData[2];
  6135. partials = newData[3];
  6136. holders = newData[4];
  6137. arity = newData[9] = newData[9] === undefined
  6138. ? (isBindKey ? 0 : func.length)
  6139. : nativeMax(newData[9] - length, 0);
  6140. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6141. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6142. }
  6143. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6144. var result = createBind(func, bitmask, thisArg);
  6145. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6146. result = createCurry(func, bitmask, arity);
  6147. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6148. result = createPartial(func, bitmask, thisArg, partials);
  6149. } else {
  6150. result = createHybrid.apply(undefined, newData);
  6151. }
  6152. var setter = data ? baseSetData : setData;
  6153. return setWrapToString(setter(result, newData), func, bitmask);
  6154. }
  6155. /**
  6156. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6157. * of source objects to the destination object for all destination properties
  6158. * that resolve to `undefined`.
  6159. *
  6160. * @private
  6161. * @param {*} objValue The destination value.
  6162. * @param {*} srcValue The source value.
  6163. * @param {string} key The key of the property to assign.
  6164. * @param {Object} object The parent object of `objValue`.
  6165. * @returns {*} Returns the value to assign.
  6166. */
  6167. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6168. if (objValue === undefined ||
  6169. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6170. return srcValue;
  6171. }
  6172. return objValue;
  6173. }
  6174. /**
  6175. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6176. * objects into destination objects that are passed thru.
  6177. *
  6178. * @private
  6179. * @param {*} objValue The destination value.
  6180. * @param {*} srcValue The source value.
  6181. * @param {string} key The key of the property to merge.
  6182. * @param {Object} object The parent object of `objValue`.
  6183. * @param {Object} source The parent object of `srcValue`.
  6184. * @param {Object} [stack] Tracks traversed source values and their merged
  6185. * counterparts.
  6186. * @returns {*} Returns the value to assign.
  6187. */
  6188. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6189. if (isObject(objValue) && isObject(srcValue)) {
  6190. // Recursively merge objects and arrays (susceptible to call stack limits).
  6191. stack.set(srcValue, objValue);
  6192. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6193. stack['delete'](srcValue);
  6194. }
  6195. return objValue;
  6196. }
  6197. /**
  6198. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6199. * objects.
  6200. *
  6201. * @private
  6202. * @param {*} value The value to inspect.
  6203. * @param {string} key The key of the property to inspect.
  6204. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6205. */
  6206. function customOmitClone(value) {
  6207. return isPlainObject(value) ? undefined : value;
  6208. }
  6209. /**
  6210. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6211. * partial deep comparisons.
  6212. *
  6213. * @private
  6214. * @param {Array} array The array to compare.
  6215. * @param {Array} other The other array to compare.
  6216. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6217. * @param {Function} customizer The function to customize comparisons.
  6218. * @param {Function} equalFunc The function to determine equivalents of values.
  6219. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6220. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6221. */
  6222. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6223. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6224. arrLength = array.length,
  6225. othLength = other.length;
  6226. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6227. return false;
  6228. }
  6229. // Check that cyclic values are equal.
  6230. var arrStacked = stack.get(array);
  6231. var othStacked = stack.get(other);
  6232. if (arrStacked && othStacked) {
  6233. return arrStacked == other && othStacked == array;
  6234. }
  6235. var index = -1,
  6236. result = true,
  6237. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6238. stack.set(array, other);
  6239. stack.set(other, array);
  6240. // Ignore non-index properties.
  6241. while (++index < arrLength) {
  6242. var arrValue = array[index],
  6243. othValue = other[index];
  6244. if (customizer) {
  6245. var compared = isPartial
  6246. ? customizer(othValue, arrValue, index, other, array, stack)
  6247. : customizer(arrValue, othValue, index, array, other, stack);
  6248. }
  6249. if (compared !== undefined) {
  6250. if (compared) {
  6251. continue;
  6252. }
  6253. result = false;
  6254. break;
  6255. }
  6256. // Recursively compare arrays (susceptible to call stack limits).
  6257. if (seen) {
  6258. if (!arraySome(other, function(othValue, othIndex) {
  6259. if (!cacheHas(seen, othIndex) &&
  6260. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6261. return seen.push(othIndex);
  6262. }
  6263. })) {
  6264. result = false;
  6265. break;
  6266. }
  6267. } else if (!(
  6268. arrValue === othValue ||
  6269. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6270. )) {
  6271. result = false;
  6272. break;
  6273. }
  6274. }
  6275. stack['delete'](array);
  6276. stack['delete'](other);
  6277. return result;
  6278. }
  6279. /**
  6280. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6281. * the same `toStringTag`.
  6282. *
  6283. * **Note:** This function only supports comparing values with tags of
  6284. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6285. *
  6286. * @private
  6287. * @param {Object} object The object to compare.
  6288. * @param {Object} other The other object to compare.
  6289. * @param {string} tag The `toStringTag` of the objects to compare.
  6290. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6291. * @param {Function} customizer The function to customize comparisons.
  6292. * @param {Function} equalFunc The function to determine equivalents of values.
  6293. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6294. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6295. */
  6296. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6297. switch (tag) {
  6298. case dataViewTag:
  6299. if ((object.byteLength != other.byteLength) ||
  6300. (object.byteOffset != other.byteOffset)) {
  6301. return false;
  6302. }
  6303. object = object.buffer;
  6304. other = other.buffer;
  6305. case arrayBufferTag:
  6306. if ((object.byteLength != other.byteLength) ||
  6307. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6308. return false;
  6309. }
  6310. return true;
  6311. case boolTag:
  6312. case dateTag:
  6313. case numberTag:
  6314. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6315. // Invalid dates are coerced to `NaN`.
  6316. return eq(+object, +other);
  6317. case errorTag:
  6318. return object.name == other.name && object.message == other.message;
  6319. case regexpTag:
  6320. case stringTag:
  6321. // Coerce regexes to strings and treat strings, primitives and objects,
  6322. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6323. // for more details.
  6324. return object == (other + '');
  6325. case mapTag:
  6326. var convert = mapToArray;
  6327. case setTag:
  6328. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6329. convert || (convert = setToArray);
  6330. if (object.size != other.size && !isPartial) {
  6331. return false;
  6332. }
  6333. // Assume cyclic values are equal.
  6334. var stacked = stack.get(object);
  6335. if (stacked) {
  6336. return stacked == other;
  6337. }
  6338. bitmask |= COMPARE_UNORDERED_FLAG;
  6339. // Recursively compare objects (susceptible to call stack limits).
  6340. stack.set(object, other);
  6341. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6342. stack['delete'](object);
  6343. return result;
  6344. case symbolTag:
  6345. if (symbolValueOf) {
  6346. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6347. }
  6348. }
  6349. return false;
  6350. }
  6351. /**
  6352. * A specialized version of `baseIsEqualDeep` for objects with support for
  6353. * partial deep comparisons.
  6354. *
  6355. * @private
  6356. * @param {Object} object The object to compare.
  6357. * @param {Object} other The other object to compare.
  6358. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6359. * @param {Function} customizer The function to customize comparisons.
  6360. * @param {Function} equalFunc The function to determine equivalents of values.
  6361. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6362. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6363. */
  6364. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6365. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6366. objProps = getAllKeys(object),
  6367. objLength = objProps.length,
  6368. othProps = getAllKeys(other),
  6369. othLength = othProps.length;
  6370. if (objLength != othLength && !isPartial) {
  6371. return false;
  6372. }
  6373. var index = objLength;
  6374. while (index--) {
  6375. var key = objProps[index];
  6376. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6377. return false;
  6378. }
  6379. }
  6380. // Check that cyclic values are equal.
  6381. var objStacked = stack.get(object);
  6382. var othStacked = stack.get(other);
  6383. if (objStacked && othStacked) {
  6384. return objStacked == other && othStacked == object;
  6385. }
  6386. var result = true;
  6387. stack.set(object, other);
  6388. stack.set(other, object);
  6389. var skipCtor = isPartial;
  6390. while (++index < objLength) {
  6391. key = objProps[index];
  6392. var objValue = object[key],
  6393. othValue = other[key];
  6394. if (customizer) {
  6395. var compared = isPartial
  6396. ? customizer(othValue, objValue, key, other, object, stack)
  6397. : customizer(objValue, othValue, key, object, other, stack);
  6398. }
  6399. // Recursively compare objects (susceptible to call stack limits).
  6400. if (!(compared === undefined
  6401. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6402. : compared
  6403. )) {
  6404. result = false;
  6405. break;
  6406. }
  6407. skipCtor || (skipCtor = key == 'constructor');
  6408. }
  6409. if (result && !skipCtor) {
  6410. var objCtor = object.constructor,
  6411. othCtor = other.constructor;
  6412. // Non `Object` object instances with different constructors are not equal.
  6413. if (objCtor != othCtor &&
  6414. ('constructor' in object && 'constructor' in other) &&
  6415. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6416. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6417. result = false;
  6418. }
  6419. }
  6420. stack['delete'](object);
  6421. stack['delete'](other);
  6422. return result;
  6423. }
  6424. /**
  6425. * A specialized version of `baseRest` which flattens the rest array.
  6426. *
  6427. * @private
  6428. * @param {Function} func The function to apply a rest parameter to.
  6429. * @returns {Function} Returns the new function.
  6430. */
  6431. function flatRest(func) {
  6432. return setToString(overRest(func, undefined, flatten), func + '');
  6433. }
  6434. /**
  6435. * Creates an array of own enumerable property names and symbols of `object`.
  6436. *
  6437. * @private
  6438. * @param {Object} object The object to query.
  6439. * @returns {Array} Returns the array of property names and symbols.
  6440. */
  6441. function getAllKeys(object) {
  6442. return baseGetAllKeys(object, keys, getSymbols);
  6443. }
  6444. /**
  6445. * Creates an array of own and inherited enumerable property names and
  6446. * symbols of `object`.
  6447. *
  6448. * @private
  6449. * @param {Object} object The object to query.
  6450. * @returns {Array} Returns the array of property names and symbols.
  6451. */
  6452. function getAllKeysIn(object) {
  6453. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6454. }
  6455. /**
  6456. * Gets metadata for `func`.
  6457. *
  6458. * @private
  6459. * @param {Function} func The function to query.
  6460. * @returns {*} Returns the metadata for `func`.
  6461. */
  6462. var getData = !metaMap ? noop : function(func) {
  6463. return metaMap.get(func);
  6464. };
  6465. /**
  6466. * Gets the name of `func`.
  6467. *
  6468. * @private
  6469. * @param {Function} func The function to query.
  6470. * @returns {string} Returns the function name.
  6471. */
  6472. function getFuncName(func) {
  6473. var result = (func.name + ''),
  6474. array = realNames[result],
  6475. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6476. while (length--) {
  6477. var data = array[length],
  6478. otherFunc = data.func;
  6479. if (otherFunc == null || otherFunc == func) {
  6480. return data.name;
  6481. }
  6482. }
  6483. return result;
  6484. }
  6485. /**
  6486. * Gets the argument placeholder value for `func`.
  6487. *
  6488. * @private
  6489. * @param {Function} func The function to inspect.
  6490. * @returns {*} Returns the placeholder value.
  6491. */
  6492. function getHolder(func) {
  6493. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6494. return object.placeholder;
  6495. }
  6496. /**
  6497. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6498. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6499. * If arguments are provided, the chosen function is invoked with them and
  6500. * its result is returned.
  6501. *
  6502. * @private
  6503. * @param {*} [value] The value to convert to an iteratee.
  6504. * @param {number} [arity] The arity of the created iteratee.
  6505. * @returns {Function} Returns the chosen function or its result.
  6506. */
  6507. function getIteratee() {
  6508. var result = lodash.iteratee || iteratee;
  6509. result = result === iteratee ? baseIteratee : result;
  6510. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6511. }
  6512. /**
  6513. * Gets the data for `map`.
  6514. *
  6515. * @private
  6516. * @param {Object} map The map to query.
  6517. * @param {string} key The reference key.
  6518. * @returns {*} Returns the map data.
  6519. */
  6520. function getMapData(map, key) {
  6521. var data = map.__data__;
  6522. return isKeyable(key)
  6523. ? data[typeof key == 'string' ? 'string' : 'hash']
  6524. : data.map;
  6525. }
  6526. /**
  6527. * Gets the property names, values, and compare flags of `object`.
  6528. *
  6529. * @private
  6530. * @param {Object} object The object to query.
  6531. * @returns {Array} Returns the match data of `object`.
  6532. */
  6533. function getMatchData(object) {
  6534. var result = keys(object),
  6535. length = result.length;
  6536. while (length--) {
  6537. var key = result[length],
  6538. value = object[key];
  6539. result[length] = [key, value, isStrictComparable(value)];
  6540. }
  6541. return result;
  6542. }
  6543. /**
  6544. * Gets the native function at `key` of `object`.
  6545. *
  6546. * @private
  6547. * @param {Object} object The object to query.
  6548. * @param {string} key The key of the method to get.
  6549. * @returns {*} Returns the function if it's native, else `undefined`.
  6550. */
  6551. function getNative(object, key) {
  6552. var value = getValue(object, key);
  6553. return baseIsNative(value) ? value : undefined;
  6554. }
  6555. /**
  6556. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6557. *
  6558. * @private
  6559. * @param {*} value The value to query.
  6560. * @returns {string} Returns the raw `toStringTag`.
  6561. */
  6562. function getRawTag(value) {
  6563. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6564. tag = value[symToStringTag];
  6565. try {
  6566. value[symToStringTag] = undefined;
  6567. var unmasked = true;
  6568. } catch (e) {}
  6569. var result = nativeObjectToString.call(value);
  6570. if (unmasked) {
  6571. if (isOwn) {
  6572. value[symToStringTag] = tag;
  6573. } else {
  6574. delete value[symToStringTag];
  6575. }
  6576. }
  6577. return result;
  6578. }
  6579. /**
  6580. * Creates an array of the own enumerable symbols of `object`.
  6581. *
  6582. * @private
  6583. * @param {Object} object The object to query.
  6584. * @returns {Array} Returns the array of symbols.
  6585. */
  6586. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6587. if (object == null) {
  6588. return [];
  6589. }
  6590. object = Object(object);
  6591. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6592. return propertyIsEnumerable.call(object, symbol);
  6593. });
  6594. };
  6595. /**
  6596. * Creates an array of the own and inherited enumerable symbols of `object`.
  6597. *
  6598. * @private
  6599. * @param {Object} object The object to query.
  6600. * @returns {Array} Returns the array of symbols.
  6601. */
  6602. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6603. var result = [];
  6604. while (object) {
  6605. arrayPush(result, getSymbols(object));
  6606. object = getPrototype(object);
  6607. }
  6608. return result;
  6609. };
  6610. /**
  6611. * Gets the `toStringTag` of `value`.
  6612. *
  6613. * @private
  6614. * @param {*} value The value to query.
  6615. * @returns {string} Returns the `toStringTag`.
  6616. */
  6617. var getTag = baseGetTag;
  6618. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6619. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6620. (Map && getTag(new Map) != mapTag) ||
  6621. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6622. (Set && getTag(new Set) != setTag) ||
  6623. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6624. getTag = function(value) {
  6625. var result = baseGetTag(value),
  6626. Ctor = result == objectTag ? value.constructor : undefined,
  6627. ctorString = Ctor ? toSource(Ctor) : '';
  6628. if (ctorString) {
  6629. switch (ctorString) {
  6630. case dataViewCtorString: return dataViewTag;
  6631. case mapCtorString: return mapTag;
  6632. case promiseCtorString: return promiseTag;
  6633. case setCtorString: return setTag;
  6634. case weakMapCtorString: return weakMapTag;
  6635. }
  6636. }
  6637. return result;
  6638. };
  6639. }
  6640. /**
  6641. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6642. *
  6643. * @private
  6644. * @param {number} start The start of the view.
  6645. * @param {number} end The end of the view.
  6646. * @param {Array} transforms The transformations to apply to the view.
  6647. * @returns {Object} Returns an object containing the `start` and `end`
  6648. * positions of the view.
  6649. */
  6650. function getView(start, end, transforms) {
  6651. var index = -1,
  6652. length = transforms.length;
  6653. while (++index < length) {
  6654. var data = transforms[index],
  6655. size = data.size;
  6656. switch (data.type) {
  6657. case 'drop': start += size; break;
  6658. case 'dropRight': end -= size; break;
  6659. case 'take': end = nativeMin(end, start + size); break;
  6660. case 'takeRight': start = nativeMax(start, end - size); break;
  6661. }
  6662. }
  6663. return { 'start': start, 'end': end };
  6664. }
  6665. /**
  6666. * Extracts wrapper details from the `source` body comment.
  6667. *
  6668. * @private
  6669. * @param {string} source The source to inspect.
  6670. * @returns {Array} Returns the wrapper details.
  6671. */
  6672. function getWrapDetails(source) {
  6673. var match = source.match(reWrapDetails);
  6674. return match ? match[1].split(reSplitDetails) : [];
  6675. }
  6676. /**
  6677. * Checks if `path` exists on `object`.
  6678. *
  6679. * @private
  6680. * @param {Object} object The object to query.
  6681. * @param {Array|string} path The path to check.
  6682. * @param {Function} hasFunc The function to check properties.
  6683. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6684. */
  6685. function hasPath(object, path, hasFunc) {
  6686. path = castPath(path, object);
  6687. var index = -1,
  6688. length = path.length,
  6689. result = false;
  6690. while (++index < length) {
  6691. var key = toKey(path[index]);
  6692. if (!(result = object != null && hasFunc(object, key))) {
  6693. break;
  6694. }
  6695. object = object[key];
  6696. }
  6697. if (result || ++index != length) {
  6698. return result;
  6699. }
  6700. length = object == null ? 0 : object.length;
  6701. return !!length && isLength(length) && isIndex(key, length) &&
  6702. (isArray(object) || isArguments(object));
  6703. }
  6704. /**
  6705. * Initializes an array clone.
  6706. *
  6707. * @private
  6708. * @param {Array} array The array to clone.
  6709. * @returns {Array} Returns the initialized clone.
  6710. */
  6711. function initCloneArray(array) {
  6712. var length = array.length,
  6713. result = new array.constructor(length);
  6714. // Add properties assigned by `RegExp#exec`.
  6715. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6716. result.index = array.index;
  6717. result.input = array.input;
  6718. }
  6719. return result;
  6720. }
  6721. /**
  6722. * Initializes an object clone.
  6723. *
  6724. * @private
  6725. * @param {Object} object The object to clone.
  6726. * @returns {Object} Returns the initialized clone.
  6727. */
  6728. function initCloneObject(object) {
  6729. return (typeof object.constructor == 'function' && !isPrototype(object))
  6730. ? baseCreate(getPrototype(object))
  6731. : {};
  6732. }
  6733. /**
  6734. * Initializes an object clone based on its `toStringTag`.
  6735. *
  6736. * **Note:** This function only supports cloning values with tags of
  6737. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6738. *
  6739. * @private
  6740. * @param {Object} object The object to clone.
  6741. * @param {string} tag The `toStringTag` of the object to clone.
  6742. * @param {boolean} [isDeep] Specify a deep clone.
  6743. * @returns {Object} Returns the initialized clone.
  6744. */
  6745. function initCloneByTag(object, tag, isDeep) {
  6746. var Ctor = object.constructor;
  6747. switch (tag) {
  6748. case arrayBufferTag:
  6749. return cloneArrayBuffer(object);
  6750. case boolTag:
  6751. case dateTag:
  6752. return new Ctor(+object);
  6753. case dataViewTag:
  6754. return cloneDataView(object, isDeep);
  6755. case float32Tag: case float64Tag:
  6756. case int8Tag: case int16Tag: case int32Tag:
  6757. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6758. return cloneTypedArray(object, isDeep);
  6759. case mapTag:
  6760. return new Ctor;
  6761. case numberTag:
  6762. case stringTag:
  6763. return new Ctor(object);
  6764. case regexpTag:
  6765. return cloneRegExp(object);
  6766. case setTag:
  6767. return new Ctor;
  6768. case symbolTag:
  6769. return cloneSymbol(object);
  6770. }
  6771. }
  6772. /**
  6773. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6774. *
  6775. * @private
  6776. * @param {string} source The source to modify.
  6777. * @returns {Array} details The details to insert.
  6778. * @returns {string} Returns the modified source.
  6779. */
  6780. function insertWrapDetails(source, details) {
  6781. var length = details.length;
  6782. if (!length) {
  6783. return source;
  6784. }
  6785. var lastIndex = length - 1;
  6786. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6787. details = details.join(length > 2 ? ', ' : ' ');
  6788. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6789. }
  6790. /**
  6791. * Checks if `value` is a flattenable `arguments` object or array.
  6792. *
  6793. * @private
  6794. * @param {*} value The value to check.
  6795. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6796. */
  6797. function isFlattenable(value) {
  6798. return isArray(value) || isArguments(value) ||
  6799. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6800. }
  6801. /**
  6802. * Checks if `value` is a valid array-like index.
  6803. *
  6804. * @private
  6805. * @param {*} value The value to check.
  6806. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6807. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6808. */
  6809. function isIndex(value, length) {
  6810. var type = typeof value;
  6811. length = length == null ? MAX_SAFE_INTEGER : length;
  6812. return !!length &&
  6813. (type == 'number' ||
  6814. (type != 'symbol' && reIsUint.test(value))) &&
  6815. (value > -1 && value % 1 == 0 && value < length);
  6816. }
  6817. /**
  6818. * Checks if the given arguments are from an iteratee call.
  6819. *
  6820. * @private
  6821. * @param {*} value The potential iteratee value argument.
  6822. * @param {*} index The potential iteratee index or key argument.
  6823. * @param {*} object The potential iteratee object argument.
  6824. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6825. * else `false`.
  6826. */
  6827. function isIterateeCall(value, index, object) {
  6828. if (!isObject(object)) {
  6829. return false;
  6830. }
  6831. var type = typeof index;
  6832. if (type == 'number'
  6833. ? (isArrayLike(object) && isIndex(index, object.length))
  6834. : (type == 'string' && index in object)
  6835. ) {
  6836. return eq(object[index], value);
  6837. }
  6838. return false;
  6839. }
  6840. /**
  6841. * Checks if `value` is a property name and not a property path.
  6842. *
  6843. * @private
  6844. * @param {*} value The value to check.
  6845. * @param {Object} [object] The object to query keys on.
  6846. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6847. */
  6848. function isKey(value, object) {
  6849. if (isArray(value)) {
  6850. return false;
  6851. }
  6852. var type = typeof value;
  6853. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6854. value == null || isSymbol(value)) {
  6855. return true;
  6856. }
  6857. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6858. (object != null && value in Object(object));
  6859. }
  6860. /**
  6861. * Checks if `value` is suitable for use as unique object key.
  6862. *
  6863. * @private
  6864. * @param {*} value The value to check.
  6865. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6866. */
  6867. function isKeyable(value) {
  6868. var type = typeof value;
  6869. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6870. ? (value !== '__proto__')
  6871. : (value === null);
  6872. }
  6873. /**
  6874. * Checks if `func` has a lazy counterpart.
  6875. *
  6876. * @private
  6877. * @param {Function} func The function to check.
  6878. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  6879. * else `false`.
  6880. */
  6881. function isLaziable(func) {
  6882. var funcName = getFuncName(func),
  6883. other = lodash[funcName];
  6884. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  6885. return false;
  6886. }
  6887. if (func === other) {
  6888. return true;
  6889. }
  6890. var data = getData(other);
  6891. return !!data && func === data[0];
  6892. }
  6893. /**
  6894. * Checks if `func` has its source masked.
  6895. *
  6896. * @private
  6897. * @param {Function} func The function to check.
  6898. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  6899. */
  6900. function isMasked(func) {
  6901. return !!maskSrcKey && (maskSrcKey in func);
  6902. }
  6903. /**
  6904. * Checks if `func` is capable of being masked.
  6905. *
  6906. * @private
  6907. * @param {*} value The value to check.
  6908. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  6909. */
  6910. var isMaskable = coreJsData ? isFunction : stubFalse;
  6911. /**
  6912. * Checks if `value` is likely a prototype object.
  6913. *
  6914. * @private
  6915. * @param {*} value The value to check.
  6916. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  6917. */
  6918. function isPrototype(value) {
  6919. var Ctor = value && value.constructor,
  6920. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  6921. return value === proto;
  6922. }
  6923. /**
  6924. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  6925. *
  6926. * @private
  6927. * @param {*} value The value to check.
  6928. * @returns {boolean} Returns `true` if `value` if suitable for strict
  6929. * equality comparisons, else `false`.
  6930. */
  6931. function isStrictComparable(value) {
  6932. return value === value && !isObject(value);
  6933. }
  6934. /**
  6935. * A specialized version of `matchesProperty` for source values suitable
  6936. * for strict equality comparisons, i.e. `===`.
  6937. *
  6938. * @private
  6939. * @param {string} key The key of the property to get.
  6940. * @param {*} srcValue The value to match.
  6941. * @returns {Function} Returns the new spec function.
  6942. */
  6943. function matchesStrictComparable(key, srcValue) {
  6944. return function(object) {
  6945. if (object == null) {
  6946. return false;
  6947. }
  6948. return object[key] === srcValue &&
  6949. (srcValue !== undefined || (key in Object(object)));
  6950. };
  6951. }
  6952. /**
  6953. * A specialized version of `_.memoize` which clears the memoized function's
  6954. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  6955. *
  6956. * @private
  6957. * @param {Function} func The function to have its output memoized.
  6958. * @returns {Function} Returns the new memoized function.
  6959. */
  6960. function memoizeCapped(func) {
  6961. var result = memoize(func, function(key) {
  6962. if (cache.size === MAX_MEMOIZE_SIZE) {
  6963. cache.clear();
  6964. }
  6965. return key;
  6966. });
  6967. var cache = result.cache;
  6968. return result;
  6969. }
  6970. /**
  6971. * Merges the function metadata of `source` into `data`.
  6972. *
  6973. * Merging metadata reduces the number of wrappers used to invoke a function.
  6974. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  6975. * may be applied regardless of execution order. Methods like `_.ary` and
  6976. * `_.rearg` modify function arguments, making the order in which they are
  6977. * executed important, preventing the merging of metadata. However, we make
  6978. * an exception for a safe combined case where curried functions have `_.ary`
  6979. * and or `_.rearg` applied.
  6980. *
  6981. * @private
  6982. * @param {Array} data The destination metadata.
  6983. * @param {Array} source The source metadata.
  6984. * @returns {Array} Returns `data`.
  6985. */
  6986. function mergeData(data, source) {
  6987. var bitmask = data[1],
  6988. srcBitmask = source[1],
  6989. newBitmask = bitmask | srcBitmask,
  6990. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  6991. var isCombo =
  6992. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  6993. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  6994. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  6995. // Exit early if metadata can't be merged.
  6996. if (!(isCommon || isCombo)) {
  6997. return data;
  6998. }
  6999. // Use source `thisArg` if available.
  7000. if (srcBitmask & WRAP_BIND_FLAG) {
  7001. data[2] = source[2];
  7002. // Set when currying a bound function.
  7003. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7004. }
  7005. // Compose partial arguments.
  7006. var value = source[3];
  7007. if (value) {
  7008. var partials = data[3];
  7009. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7010. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7011. }
  7012. // Compose partial right arguments.
  7013. value = source[5];
  7014. if (value) {
  7015. partials = data[5];
  7016. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7017. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7018. }
  7019. // Use source `argPos` if available.
  7020. value = source[7];
  7021. if (value) {
  7022. data[7] = value;
  7023. }
  7024. // Use source `ary` if it's smaller.
  7025. if (srcBitmask & WRAP_ARY_FLAG) {
  7026. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7027. }
  7028. // Use source `arity` if one is not provided.
  7029. if (data[9] == null) {
  7030. data[9] = source[9];
  7031. }
  7032. // Use source `func` and merge bitmasks.
  7033. data[0] = source[0];
  7034. data[1] = newBitmask;
  7035. return data;
  7036. }
  7037. /**
  7038. * This function is like
  7039. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7040. * except that it includes inherited enumerable properties.
  7041. *
  7042. * @private
  7043. * @param {Object} object The object to query.
  7044. * @returns {Array} Returns the array of property names.
  7045. */
  7046. function nativeKeysIn(object) {
  7047. var result = [];
  7048. if (object != null) {
  7049. for (var key in Object(object)) {
  7050. result.push(key);
  7051. }
  7052. }
  7053. return result;
  7054. }
  7055. /**
  7056. * Converts `value` to a string using `Object.prototype.toString`.
  7057. *
  7058. * @private
  7059. * @param {*} value The value to convert.
  7060. * @returns {string} Returns the converted string.
  7061. */
  7062. function objectToString(value) {
  7063. return nativeObjectToString.call(value);
  7064. }
  7065. /**
  7066. * A specialized version of `baseRest` which transforms the rest array.
  7067. *
  7068. * @private
  7069. * @param {Function} func The function to apply a rest parameter to.
  7070. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7071. * @param {Function} transform The rest array transform.
  7072. * @returns {Function} Returns the new function.
  7073. */
  7074. function overRest(func, start, transform) {
  7075. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7076. return function() {
  7077. var args = arguments,
  7078. index = -1,
  7079. length = nativeMax(args.length - start, 0),
  7080. array = Array(length);
  7081. while (++index < length) {
  7082. array[index] = args[start + index];
  7083. }
  7084. index = -1;
  7085. var otherArgs = Array(start + 1);
  7086. while (++index < start) {
  7087. otherArgs[index] = args[index];
  7088. }
  7089. otherArgs[start] = transform(array);
  7090. return apply(func, this, otherArgs);
  7091. };
  7092. }
  7093. /**
  7094. * Gets the parent value at `path` of `object`.
  7095. *
  7096. * @private
  7097. * @param {Object} object The object to query.
  7098. * @param {Array} path The path to get the parent value of.
  7099. * @returns {*} Returns the parent value.
  7100. */
  7101. function parent(object, path) {
  7102. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7103. }
  7104. /**
  7105. * Reorder `array` according to the specified indexes where the element at
  7106. * the first index is assigned as the first element, the element at
  7107. * the second index is assigned as the second element, and so on.
  7108. *
  7109. * @private
  7110. * @param {Array} array The array to reorder.
  7111. * @param {Array} indexes The arranged array indexes.
  7112. * @returns {Array} Returns `array`.
  7113. */
  7114. function reorder(array, indexes) {
  7115. var arrLength = array.length,
  7116. length = nativeMin(indexes.length, arrLength),
  7117. oldArray = copyArray(array);
  7118. while (length--) {
  7119. var index = indexes[length];
  7120. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7121. }
  7122. return array;
  7123. }
  7124. /**
  7125. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7126. *
  7127. * @private
  7128. * @param {Object} object The object to query.
  7129. * @param {string} key The key of the property to get.
  7130. * @returns {*} Returns the property value.
  7131. */
  7132. function safeGet(object, key) {
  7133. if (key === 'constructor' && typeof object[key] === 'function') {
  7134. return;
  7135. }
  7136. if (key == '__proto__') {
  7137. return;
  7138. }
  7139. return object[key];
  7140. }
  7141. /**
  7142. * Sets metadata for `func`.
  7143. *
  7144. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7145. * period of time, it will trip its breaker and transition to an identity
  7146. * function to avoid garbage collection pauses in V8. See
  7147. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7148. * for more details.
  7149. *
  7150. * @private
  7151. * @param {Function} func The function to associate metadata with.
  7152. * @param {*} data The metadata.
  7153. * @returns {Function} Returns `func`.
  7154. */
  7155. var setData = shortOut(baseSetData);
  7156. /**
  7157. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7158. *
  7159. * @private
  7160. * @param {Function} func The function to delay.
  7161. * @param {number} wait The number of milliseconds to delay invocation.
  7162. * @returns {number|Object} Returns the timer id or timeout object.
  7163. */
  7164. var setTimeout = ctxSetTimeout || function(func, wait) {
  7165. return root.setTimeout(func, wait);
  7166. };
  7167. /**
  7168. * Sets the `toString` method of `func` to return `string`.
  7169. *
  7170. * @private
  7171. * @param {Function} func The function to modify.
  7172. * @param {Function} string The `toString` result.
  7173. * @returns {Function} Returns `func`.
  7174. */
  7175. var setToString = shortOut(baseSetToString);
  7176. /**
  7177. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7178. * with wrapper details in a comment at the top of the source body.
  7179. *
  7180. * @private
  7181. * @param {Function} wrapper The function to modify.
  7182. * @param {Function} reference The reference function.
  7183. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7184. * @returns {Function} Returns `wrapper`.
  7185. */
  7186. function setWrapToString(wrapper, reference, bitmask) {
  7187. var source = (reference + '');
  7188. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7189. }
  7190. /**
  7191. * Creates a function that'll short out and invoke `identity` instead
  7192. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7193. * milliseconds.
  7194. *
  7195. * @private
  7196. * @param {Function} func The function to restrict.
  7197. * @returns {Function} Returns the new shortable function.
  7198. */
  7199. function shortOut(func) {
  7200. var count = 0,
  7201. lastCalled = 0;
  7202. return function() {
  7203. var stamp = nativeNow(),
  7204. remaining = HOT_SPAN - (stamp - lastCalled);
  7205. lastCalled = stamp;
  7206. if (remaining > 0) {
  7207. if (++count >= HOT_COUNT) {
  7208. return arguments[0];
  7209. }
  7210. } else {
  7211. count = 0;
  7212. }
  7213. return func.apply(undefined, arguments);
  7214. };
  7215. }
  7216. /**
  7217. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7218. *
  7219. * @private
  7220. * @param {Array} array The array to shuffle.
  7221. * @param {number} [size=array.length] The size of `array`.
  7222. * @returns {Array} Returns `array`.
  7223. */
  7224. function shuffleSelf(array, size) {
  7225. var index = -1,
  7226. length = array.length,
  7227. lastIndex = length - 1;
  7228. size = size === undefined ? length : size;
  7229. while (++index < size) {
  7230. var rand = baseRandom(index, lastIndex),
  7231. value = array[rand];
  7232. array[rand] = array[index];
  7233. array[index] = value;
  7234. }
  7235. array.length = size;
  7236. return array;
  7237. }
  7238. /**
  7239. * Converts `string` to a property path array.
  7240. *
  7241. * @private
  7242. * @param {string} string The string to convert.
  7243. * @returns {Array} Returns the property path array.
  7244. */
  7245. var stringToPath = memoizeCapped(function(string) {
  7246. var result = [];
  7247. if (string.charCodeAt(0) === 46 /* . */) {
  7248. result.push('');
  7249. }
  7250. string.replace(rePropName, function(match, number, quote, subString) {
  7251. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7252. });
  7253. return result;
  7254. });
  7255. /**
  7256. * Converts `value` to a string key if it's not a string or symbol.
  7257. *
  7258. * @private
  7259. * @param {*} value The value to inspect.
  7260. * @returns {string|symbol} Returns the key.
  7261. */
  7262. function toKey(value) {
  7263. if (typeof value == 'string' || isSymbol(value)) {
  7264. return value;
  7265. }
  7266. var result = (value + '');
  7267. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7268. }
  7269. /**
  7270. * Converts `func` to its source code.
  7271. *
  7272. * @private
  7273. * @param {Function} func The function to convert.
  7274. * @returns {string} Returns the source code.
  7275. */
  7276. function toSource(func) {
  7277. if (func != null) {
  7278. try {
  7279. return funcToString.call(func);
  7280. } catch (e) {}
  7281. try {
  7282. return (func + '');
  7283. } catch (e) {}
  7284. }
  7285. return '';
  7286. }
  7287. /**
  7288. * Updates wrapper `details` based on `bitmask` flags.
  7289. *
  7290. * @private
  7291. * @returns {Array} details The details to modify.
  7292. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7293. * @returns {Array} Returns `details`.
  7294. */
  7295. function updateWrapDetails(details, bitmask) {
  7296. arrayEach(wrapFlags, function(pair) {
  7297. var value = '_.' + pair[0];
  7298. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7299. details.push(value);
  7300. }
  7301. });
  7302. return details.sort();
  7303. }
  7304. /**
  7305. * Creates a clone of `wrapper`.
  7306. *
  7307. * @private
  7308. * @param {Object} wrapper The wrapper to clone.
  7309. * @returns {Object} Returns the cloned wrapper.
  7310. */
  7311. function wrapperClone(wrapper) {
  7312. if (wrapper instanceof LazyWrapper) {
  7313. return wrapper.clone();
  7314. }
  7315. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7316. result.__actions__ = copyArray(wrapper.__actions__);
  7317. result.__index__ = wrapper.__index__;
  7318. result.__values__ = wrapper.__values__;
  7319. return result;
  7320. }
  7321. /*------------------------------------------------------------------------*/
  7322. /**
  7323. * Creates an array of elements split into groups the length of `size`.
  7324. * If `array` can't be split evenly, the final chunk will be the remaining
  7325. * elements.
  7326. *
  7327. * @static
  7328. * @memberOf _
  7329. * @since 3.0.0
  7330. * @category Array
  7331. * @param {Array} array The array to process.
  7332. * @param {number} [size=1] The length of each chunk
  7333. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7334. * @returns {Array} Returns the new array of chunks.
  7335. * @example
  7336. *
  7337. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7338. * // => [['a', 'b'], ['c', 'd']]
  7339. *
  7340. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7341. * // => [['a', 'b', 'c'], ['d']]
  7342. */
  7343. function chunk(array, size, guard) {
  7344. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7345. size = 1;
  7346. } else {
  7347. size = nativeMax(toInteger(size), 0);
  7348. }
  7349. var length = array == null ? 0 : array.length;
  7350. if (!length || size < 1) {
  7351. return [];
  7352. }
  7353. var index = 0,
  7354. resIndex = 0,
  7355. result = Array(nativeCeil(length / size));
  7356. while (index < length) {
  7357. result[resIndex++] = baseSlice(array, index, (index += size));
  7358. }
  7359. return result;
  7360. }
  7361. /**
  7362. * Creates an array with all falsey values removed. The values `false`, `null`,
  7363. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7364. *
  7365. * @static
  7366. * @memberOf _
  7367. * @since 0.1.0
  7368. * @category Array
  7369. * @param {Array} array The array to compact.
  7370. * @returns {Array} Returns the new array of filtered values.
  7371. * @example
  7372. *
  7373. * _.compact([0, 1, false, 2, '', 3]);
  7374. * // => [1, 2, 3]
  7375. */
  7376. function compact(array) {
  7377. var index = -1,
  7378. length = array == null ? 0 : array.length,
  7379. resIndex = 0,
  7380. result = [];
  7381. while (++index < length) {
  7382. var value = array[index];
  7383. if (value) {
  7384. result[resIndex++] = value;
  7385. }
  7386. }
  7387. return result;
  7388. }
  7389. /**
  7390. * Creates a new array concatenating `array` with any additional arrays
  7391. * and/or values.
  7392. *
  7393. * @static
  7394. * @memberOf _
  7395. * @since 4.0.0
  7396. * @category Array
  7397. * @param {Array} array The array to concatenate.
  7398. * @param {...*} [values] The values to concatenate.
  7399. * @returns {Array} Returns the new concatenated array.
  7400. * @example
  7401. *
  7402. * var array = [1];
  7403. * var other = _.concat(array, 2, [3], [[4]]);
  7404. *
  7405. * console.log(other);
  7406. * // => [1, 2, 3, [4]]
  7407. *
  7408. * console.log(array);
  7409. * // => [1]
  7410. */
  7411. function concat() {
  7412. var length = arguments.length;
  7413. if (!length) {
  7414. return [];
  7415. }
  7416. var args = Array(length - 1),
  7417. array = arguments[0],
  7418. index = length;
  7419. while (index--) {
  7420. args[index - 1] = arguments[index];
  7421. }
  7422. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7423. }
  7424. /**
  7425. * Creates an array of `array` values not included in the other given arrays
  7426. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7427. * for equality comparisons. The order and references of result values are
  7428. * determined by the first array.
  7429. *
  7430. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7431. *
  7432. * @static
  7433. * @memberOf _
  7434. * @since 0.1.0
  7435. * @category Array
  7436. * @param {Array} array The array to inspect.
  7437. * @param {...Array} [values] The values to exclude.
  7438. * @returns {Array} Returns the new array of filtered values.
  7439. * @see _.without, _.xor
  7440. * @example
  7441. *
  7442. * _.difference([2, 1], [2, 3]);
  7443. * // => [1]
  7444. */
  7445. var difference = baseRest(function(array, values) {
  7446. return isArrayLikeObject(array)
  7447. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7448. : [];
  7449. });
  7450. /**
  7451. * This method is like `_.difference` except that it accepts `iteratee` which
  7452. * is invoked for each element of `array` and `values` to generate the criterion
  7453. * by which they're compared. The order and references of result values are
  7454. * determined by the first array. The iteratee is invoked with one argument:
  7455. * (value).
  7456. *
  7457. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7458. *
  7459. * @static
  7460. * @memberOf _
  7461. * @since 4.0.0
  7462. * @category Array
  7463. * @param {Array} array The array to inspect.
  7464. * @param {...Array} [values] The values to exclude.
  7465. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7466. * @returns {Array} Returns the new array of filtered values.
  7467. * @example
  7468. *
  7469. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7470. * // => [1.2]
  7471. *
  7472. * // The `_.property` iteratee shorthand.
  7473. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7474. * // => [{ 'x': 2 }]
  7475. */
  7476. var differenceBy = baseRest(function(array, values) {
  7477. var iteratee = last(values);
  7478. if (isArrayLikeObject(iteratee)) {
  7479. iteratee = undefined;
  7480. }
  7481. return isArrayLikeObject(array)
  7482. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7483. : [];
  7484. });
  7485. /**
  7486. * This method is like `_.difference` except that it accepts `comparator`
  7487. * which is invoked to compare elements of `array` to `values`. The order and
  7488. * references of result values are determined by the first array. The comparator
  7489. * is invoked with two arguments: (arrVal, othVal).
  7490. *
  7491. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7492. *
  7493. * @static
  7494. * @memberOf _
  7495. * @since 4.0.0
  7496. * @category Array
  7497. * @param {Array} array The array to inspect.
  7498. * @param {...Array} [values] The values to exclude.
  7499. * @param {Function} [comparator] The comparator invoked per element.
  7500. * @returns {Array} Returns the new array of filtered values.
  7501. * @example
  7502. *
  7503. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7504. *
  7505. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7506. * // => [{ 'x': 2, 'y': 1 }]
  7507. */
  7508. var differenceWith = baseRest(function(array, values) {
  7509. var comparator = last(values);
  7510. if (isArrayLikeObject(comparator)) {
  7511. comparator = undefined;
  7512. }
  7513. return isArrayLikeObject(array)
  7514. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7515. : [];
  7516. });
  7517. /**
  7518. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7519. *
  7520. * @static
  7521. * @memberOf _
  7522. * @since 0.5.0
  7523. * @category Array
  7524. * @param {Array} array The array to query.
  7525. * @param {number} [n=1] The number of elements to drop.
  7526. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7527. * @returns {Array} Returns the slice of `array`.
  7528. * @example
  7529. *
  7530. * _.drop([1, 2, 3]);
  7531. * // => [2, 3]
  7532. *
  7533. * _.drop([1, 2, 3], 2);
  7534. * // => [3]
  7535. *
  7536. * _.drop([1, 2, 3], 5);
  7537. * // => []
  7538. *
  7539. * _.drop([1, 2, 3], 0);
  7540. * // => [1, 2, 3]
  7541. */
  7542. function drop(array, n, guard) {
  7543. var length = array == null ? 0 : array.length;
  7544. if (!length) {
  7545. return [];
  7546. }
  7547. n = (guard || n === undefined) ? 1 : toInteger(n);
  7548. return baseSlice(array, n < 0 ? 0 : n, length);
  7549. }
  7550. /**
  7551. * Creates a slice of `array` with `n` elements dropped from the end.
  7552. *
  7553. * @static
  7554. * @memberOf _
  7555. * @since 3.0.0
  7556. * @category Array
  7557. * @param {Array} array The array to query.
  7558. * @param {number} [n=1] The number of elements to drop.
  7559. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7560. * @returns {Array} Returns the slice of `array`.
  7561. * @example
  7562. *
  7563. * _.dropRight([1, 2, 3]);
  7564. * // => [1, 2]
  7565. *
  7566. * _.dropRight([1, 2, 3], 2);
  7567. * // => [1]
  7568. *
  7569. * _.dropRight([1, 2, 3], 5);
  7570. * // => []
  7571. *
  7572. * _.dropRight([1, 2, 3], 0);
  7573. * // => [1, 2, 3]
  7574. */
  7575. function dropRight(array, n, guard) {
  7576. var length = array == null ? 0 : array.length;
  7577. if (!length) {
  7578. return [];
  7579. }
  7580. n = (guard || n === undefined) ? 1 : toInteger(n);
  7581. n = length - n;
  7582. return baseSlice(array, 0, n < 0 ? 0 : n);
  7583. }
  7584. /**
  7585. * Creates a slice of `array` excluding elements dropped from the end.
  7586. * Elements are dropped until `predicate` returns falsey. The predicate is
  7587. * invoked with three arguments: (value, index, array).
  7588. *
  7589. * @static
  7590. * @memberOf _
  7591. * @since 3.0.0
  7592. * @category Array
  7593. * @param {Array} array The array to query.
  7594. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7595. * @returns {Array} Returns the slice of `array`.
  7596. * @example
  7597. *
  7598. * var users = [
  7599. * { 'user': 'barney', 'active': true },
  7600. * { 'user': 'fred', 'active': false },
  7601. * { 'user': 'pebbles', 'active': false }
  7602. * ];
  7603. *
  7604. * _.dropRightWhile(users, function(o) { return !o.active; });
  7605. * // => objects for ['barney']
  7606. *
  7607. * // The `_.matches` iteratee shorthand.
  7608. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7609. * // => objects for ['barney', 'fred']
  7610. *
  7611. * // The `_.matchesProperty` iteratee shorthand.
  7612. * _.dropRightWhile(users, ['active', false]);
  7613. * // => objects for ['barney']
  7614. *
  7615. * // The `_.property` iteratee shorthand.
  7616. * _.dropRightWhile(users, 'active');
  7617. * // => objects for ['barney', 'fred', 'pebbles']
  7618. */
  7619. function dropRightWhile(array, predicate) {
  7620. return (array && array.length)
  7621. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7622. : [];
  7623. }
  7624. /**
  7625. * Creates a slice of `array` excluding elements dropped from the beginning.
  7626. * Elements are dropped until `predicate` returns falsey. The predicate is
  7627. * invoked with three arguments: (value, index, array).
  7628. *
  7629. * @static
  7630. * @memberOf _
  7631. * @since 3.0.0
  7632. * @category Array
  7633. * @param {Array} array The array to query.
  7634. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7635. * @returns {Array} Returns the slice of `array`.
  7636. * @example
  7637. *
  7638. * var users = [
  7639. * { 'user': 'barney', 'active': false },
  7640. * { 'user': 'fred', 'active': false },
  7641. * { 'user': 'pebbles', 'active': true }
  7642. * ];
  7643. *
  7644. * _.dropWhile(users, function(o) { return !o.active; });
  7645. * // => objects for ['pebbles']
  7646. *
  7647. * // The `_.matches` iteratee shorthand.
  7648. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7649. * // => objects for ['fred', 'pebbles']
  7650. *
  7651. * // The `_.matchesProperty` iteratee shorthand.
  7652. * _.dropWhile(users, ['active', false]);
  7653. * // => objects for ['pebbles']
  7654. *
  7655. * // The `_.property` iteratee shorthand.
  7656. * _.dropWhile(users, 'active');
  7657. * // => objects for ['barney', 'fred', 'pebbles']
  7658. */
  7659. function dropWhile(array, predicate) {
  7660. return (array && array.length)
  7661. ? baseWhile(array, getIteratee(predicate, 3), true)
  7662. : [];
  7663. }
  7664. /**
  7665. * Fills elements of `array` with `value` from `start` up to, but not
  7666. * including, `end`.
  7667. *
  7668. * **Note:** This method mutates `array`.
  7669. *
  7670. * @static
  7671. * @memberOf _
  7672. * @since 3.2.0
  7673. * @category Array
  7674. * @param {Array} array The array to fill.
  7675. * @param {*} value The value to fill `array` with.
  7676. * @param {number} [start=0] The start position.
  7677. * @param {number} [end=array.length] The end position.
  7678. * @returns {Array} Returns `array`.
  7679. * @example
  7680. *
  7681. * var array = [1, 2, 3];
  7682. *
  7683. * _.fill(array, 'a');
  7684. * console.log(array);
  7685. * // => ['a', 'a', 'a']
  7686. *
  7687. * _.fill(Array(3), 2);
  7688. * // => [2, 2, 2]
  7689. *
  7690. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7691. * // => [4, '*', '*', 10]
  7692. */
  7693. function fill(array, value, start, end) {
  7694. var length = array == null ? 0 : array.length;
  7695. if (!length) {
  7696. return [];
  7697. }
  7698. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7699. start = 0;
  7700. end = length;
  7701. }
  7702. return baseFill(array, value, start, end);
  7703. }
  7704. /**
  7705. * This method is like `_.find` except that it returns the index of the first
  7706. * element `predicate` returns truthy for instead of the element itself.
  7707. *
  7708. * @static
  7709. * @memberOf _
  7710. * @since 1.1.0
  7711. * @category Array
  7712. * @param {Array} array The array to inspect.
  7713. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7714. * @param {number} [fromIndex=0] The index to search from.
  7715. * @returns {number} Returns the index of the found element, else `-1`.
  7716. * @example
  7717. *
  7718. * var users = [
  7719. * { 'user': 'barney', 'active': false },
  7720. * { 'user': 'fred', 'active': false },
  7721. * { 'user': 'pebbles', 'active': true }
  7722. * ];
  7723. *
  7724. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7725. * // => 0
  7726. *
  7727. * // The `_.matches` iteratee shorthand.
  7728. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7729. * // => 1
  7730. *
  7731. * // The `_.matchesProperty` iteratee shorthand.
  7732. * _.findIndex(users, ['active', false]);
  7733. * // => 0
  7734. *
  7735. * // The `_.property` iteratee shorthand.
  7736. * _.findIndex(users, 'active');
  7737. * // => 2
  7738. */
  7739. function findIndex(array, predicate, fromIndex) {
  7740. var length = array == null ? 0 : array.length;
  7741. if (!length) {
  7742. return -1;
  7743. }
  7744. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7745. if (index < 0) {
  7746. index = nativeMax(length + index, 0);
  7747. }
  7748. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7749. }
  7750. /**
  7751. * This method is like `_.findIndex` except that it iterates over elements
  7752. * of `collection` from right to left.
  7753. *
  7754. * @static
  7755. * @memberOf _
  7756. * @since 2.0.0
  7757. * @category Array
  7758. * @param {Array} array The array to inspect.
  7759. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7760. * @param {number} [fromIndex=array.length-1] The index to search from.
  7761. * @returns {number} Returns the index of the found element, else `-1`.
  7762. * @example
  7763. *
  7764. * var users = [
  7765. * { 'user': 'barney', 'active': true },
  7766. * { 'user': 'fred', 'active': false },
  7767. * { 'user': 'pebbles', 'active': false }
  7768. * ];
  7769. *
  7770. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7771. * // => 2
  7772. *
  7773. * // The `_.matches` iteratee shorthand.
  7774. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7775. * // => 0
  7776. *
  7777. * // The `_.matchesProperty` iteratee shorthand.
  7778. * _.findLastIndex(users, ['active', false]);
  7779. * // => 2
  7780. *
  7781. * // The `_.property` iteratee shorthand.
  7782. * _.findLastIndex(users, 'active');
  7783. * // => 0
  7784. */
  7785. function findLastIndex(array, predicate, fromIndex) {
  7786. var length = array == null ? 0 : array.length;
  7787. if (!length) {
  7788. return -1;
  7789. }
  7790. var index = length - 1;
  7791. if (fromIndex !== undefined) {
  7792. index = toInteger(fromIndex);
  7793. index = fromIndex < 0
  7794. ? nativeMax(length + index, 0)
  7795. : nativeMin(index, length - 1);
  7796. }
  7797. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7798. }
  7799. /**
  7800. * Flattens `array` a single level deep.
  7801. *
  7802. * @static
  7803. * @memberOf _
  7804. * @since 0.1.0
  7805. * @category Array
  7806. * @param {Array} array The array to flatten.
  7807. * @returns {Array} Returns the new flattened array.
  7808. * @example
  7809. *
  7810. * _.flatten([1, [2, [3, [4]], 5]]);
  7811. * // => [1, 2, [3, [4]], 5]
  7812. */
  7813. function flatten(array) {
  7814. var length = array == null ? 0 : array.length;
  7815. return length ? baseFlatten(array, 1) : [];
  7816. }
  7817. /**
  7818. * Recursively flattens `array`.
  7819. *
  7820. * @static
  7821. * @memberOf _
  7822. * @since 3.0.0
  7823. * @category Array
  7824. * @param {Array} array The array to flatten.
  7825. * @returns {Array} Returns the new flattened array.
  7826. * @example
  7827. *
  7828. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7829. * // => [1, 2, 3, 4, 5]
  7830. */
  7831. function flattenDeep(array) {
  7832. var length = array == null ? 0 : array.length;
  7833. return length ? baseFlatten(array, INFINITY) : [];
  7834. }
  7835. /**
  7836. * Recursively flatten `array` up to `depth` times.
  7837. *
  7838. * @static
  7839. * @memberOf _
  7840. * @since 4.4.0
  7841. * @category Array
  7842. * @param {Array} array The array to flatten.
  7843. * @param {number} [depth=1] The maximum recursion depth.
  7844. * @returns {Array} Returns the new flattened array.
  7845. * @example
  7846. *
  7847. * var array = [1, [2, [3, [4]], 5]];
  7848. *
  7849. * _.flattenDepth(array, 1);
  7850. * // => [1, 2, [3, [4]], 5]
  7851. *
  7852. * _.flattenDepth(array, 2);
  7853. * // => [1, 2, 3, [4], 5]
  7854. */
  7855. function flattenDepth(array, depth) {
  7856. var length = array == null ? 0 : array.length;
  7857. if (!length) {
  7858. return [];
  7859. }
  7860. depth = depth === undefined ? 1 : toInteger(depth);
  7861. return baseFlatten(array, depth);
  7862. }
  7863. /**
  7864. * The inverse of `_.toPairs`; this method returns an object composed
  7865. * from key-value `pairs`.
  7866. *
  7867. * @static
  7868. * @memberOf _
  7869. * @since 4.0.0
  7870. * @category Array
  7871. * @param {Array} pairs The key-value pairs.
  7872. * @returns {Object} Returns the new object.
  7873. * @example
  7874. *
  7875. * _.fromPairs([['a', 1], ['b', 2]]);
  7876. * // => { 'a': 1, 'b': 2 }
  7877. */
  7878. function fromPairs(pairs) {
  7879. var index = -1,
  7880. length = pairs == null ? 0 : pairs.length,
  7881. result = {};
  7882. while (++index < length) {
  7883. var pair = pairs[index];
  7884. result[pair[0]] = pair[1];
  7885. }
  7886. return result;
  7887. }
  7888. /**
  7889. * Gets the first element of `array`.
  7890. *
  7891. * @static
  7892. * @memberOf _
  7893. * @since 0.1.0
  7894. * @alias first
  7895. * @category Array
  7896. * @param {Array} array The array to query.
  7897. * @returns {*} Returns the first element of `array`.
  7898. * @example
  7899. *
  7900. * _.head([1, 2, 3]);
  7901. * // => 1
  7902. *
  7903. * _.head([]);
  7904. * // => undefined
  7905. */
  7906. function head(array) {
  7907. return (array && array.length) ? array[0] : undefined;
  7908. }
  7909. /**
  7910. * Gets the index at which the first occurrence of `value` is found in `array`
  7911. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7912. * for equality comparisons. If `fromIndex` is negative, it's used as the
  7913. * offset from the end of `array`.
  7914. *
  7915. * @static
  7916. * @memberOf _
  7917. * @since 0.1.0
  7918. * @category Array
  7919. * @param {Array} array The array to inspect.
  7920. * @param {*} value The value to search for.
  7921. * @param {number} [fromIndex=0] The index to search from.
  7922. * @returns {number} Returns the index of the matched value, else `-1`.
  7923. * @example
  7924. *
  7925. * _.indexOf([1, 2, 1, 2], 2);
  7926. * // => 1
  7927. *
  7928. * // Search from the `fromIndex`.
  7929. * _.indexOf([1, 2, 1, 2], 2, 2);
  7930. * // => 3
  7931. */
  7932. function indexOf(array, value, fromIndex) {
  7933. var length = array == null ? 0 : array.length;
  7934. if (!length) {
  7935. return -1;
  7936. }
  7937. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7938. if (index < 0) {
  7939. index = nativeMax(length + index, 0);
  7940. }
  7941. return baseIndexOf(array, value, index);
  7942. }
  7943. /**
  7944. * Gets all but the last element of `array`.
  7945. *
  7946. * @static
  7947. * @memberOf _
  7948. * @since 0.1.0
  7949. * @category Array
  7950. * @param {Array} array The array to query.
  7951. * @returns {Array} Returns the slice of `array`.
  7952. * @example
  7953. *
  7954. * _.initial([1, 2, 3]);
  7955. * // => [1, 2]
  7956. */
  7957. function initial(array) {
  7958. var length = array == null ? 0 : array.length;
  7959. return length ? baseSlice(array, 0, -1) : [];
  7960. }
  7961. /**
  7962. * Creates an array of unique values that are included in all given arrays
  7963. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7964. * for equality comparisons. The order and references of result values are
  7965. * determined by the first array.
  7966. *
  7967. * @static
  7968. * @memberOf _
  7969. * @since 0.1.0
  7970. * @category Array
  7971. * @param {...Array} [arrays] The arrays to inspect.
  7972. * @returns {Array} Returns the new array of intersecting values.
  7973. * @example
  7974. *
  7975. * _.intersection([2, 1], [2, 3]);
  7976. * // => [2]
  7977. */
  7978. var intersection = baseRest(function(arrays) {
  7979. var mapped = arrayMap(arrays, castArrayLikeObject);
  7980. return (mapped.length && mapped[0] === arrays[0])
  7981. ? baseIntersection(mapped)
  7982. : [];
  7983. });
  7984. /**
  7985. * This method is like `_.intersection` except that it accepts `iteratee`
  7986. * which is invoked for each element of each `arrays` to generate the criterion
  7987. * by which they're compared. The order and references of result values are
  7988. * determined by the first array. The iteratee is invoked with one argument:
  7989. * (value).
  7990. *
  7991. * @static
  7992. * @memberOf _
  7993. * @since 4.0.0
  7994. * @category Array
  7995. * @param {...Array} [arrays] The arrays to inspect.
  7996. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7997. * @returns {Array} Returns the new array of intersecting values.
  7998. * @example
  7999. *
  8000. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8001. * // => [2.1]
  8002. *
  8003. * // The `_.property` iteratee shorthand.
  8004. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8005. * // => [{ 'x': 1 }]
  8006. */
  8007. var intersectionBy = baseRest(function(arrays) {
  8008. var iteratee = last(arrays),
  8009. mapped = arrayMap(arrays, castArrayLikeObject);
  8010. if (iteratee === last(mapped)) {
  8011. iteratee = undefined;
  8012. } else {
  8013. mapped.pop();
  8014. }
  8015. return (mapped.length && mapped[0] === arrays[0])
  8016. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8017. : [];
  8018. });
  8019. /**
  8020. * This method is like `_.intersection` except that it accepts `comparator`
  8021. * which is invoked to compare elements of `arrays`. The order and references
  8022. * of result values are determined by the first array. The comparator is
  8023. * invoked with two arguments: (arrVal, othVal).
  8024. *
  8025. * @static
  8026. * @memberOf _
  8027. * @since 4.0.0
  8028. * @category Array
  8029. * @param {...Array} [arrays] The arrays to inspect.
  8030. * @param {Function} [comparator] The comparator invoked per element.
  8031. * @returns {Array} Returns the new array of intersecting values.
  8032. * @example
  8033. *
  8034. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8035. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8036. *
  8037. * _.intersectionWith(objects, others, _.isEqual);
  8038. * // => [{ 'x': 1, 'y': 2 }]
  8039. */
  8040. var intersectionWith = baseRest(function(arrays) {
  8041. var comparator = last(arrays),
  8042. mapped = arrayMap(arrays, castArrayLikeObject);
  8043. comparator = typeof comparator == 'function' ? comparator : undefined;
  8044. if (comparator) {
  8045. mapped.pop();
  8046. }
  8047. return (mapped.length && mapped[0] === arrays[0])
  8048. ? baseIntersection(mapped, undefined, comparator)
  8049. : [];
  8050. });
  8051. /**
  8052. * Converts all elements in `array` into a string separated by `separator`.
  8053. *
  8054. * @static
  8055. * @memberOf _
  8056. * @since 4.0.0
  8057. * @category Array
  8058. * @param {Array} array The array to convert.
  8059. * @param {string} [separator=','] The element separator.
  8060. * @returns {string} Returns the joined string.
  8061. * @example
  8062. *
  8063. * _.join(['a', 'b', 'c'], '~');
  8064. * // => 'a~b~c'
  8065. */
  8066. function join(array, separator) {
  8067. return array == null ? '' : nativeJoin.call(array, separator);
  8068. }
  8069. /**
  8070. * Gets the last element of `array`.
  8071. *
  8072. * @static
  8073. * @memberOf _
  8074. * @since 0.1.0
  8075. * @category Array
  8076. * @param {Array} array The array to query.
  8077. * @returns {*} Returns the last element of `array`.
  8078. * @example
  8079. *
  8080. * _.last([1, 2, 3]);
  8081. * // => 3
  8082. */
  8083. function last(array) {
  8084. var length = array == null ? 0 : array.length;
  8085. return length ? array[length - 1] : undefined;
  8086. }
  8087. /**
  8088. * This method is like `_.indexOf` except that it iterates over elements of
  8089. * `array` from right to left.
  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=array.length-1] The index to search from.
  8098. * @returns {number} Returns the index of the matched value, else `-1`.
  8099. * @example
  8100. *
  8101. * _.lastIndexOf([1, 2, 1, 2], 2);
  8102. * // => 3
  8103. *
  8104. * // Search from the `fromIndex`.
  8105. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8106. * // => 1
  8107. */
  8108. function lastIndexOf(array, value, fromIndex) {
  8109. var length = array == null ? 0 : array.length;
  8110. if (!length) {
  8111. return -1;
  8112. }
  8113. var index = length;
  8114. if (fromIndex !== undefined) {
  8115. index = toInteger(fromIndex);
  8116. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8117. }
  8118. return value === value
  8119. ? strictLastIndexOf(array, value, index)
  8120. : baseFindIndex(array, baseIsNaN, index, true);
  8121. }
  8122. /**
  8123. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8124. * element from the end is returned.
  8125. *
  8126. * @static
  8127. * @memberOf _
  8128. * @since 4.11.0
  8129. * @category Array
  8130. * @param {Array} array The array to query.
  8131. * @param {number} [n=0] The index of the element to return.
  8132. * @returns {*} Returns the nth element of `array`.
  8133. * @example
  8134. *
  8135. * var array = ['a', 'b', 'c', 'd'];
  8136. *
  8137. * _.nth(array, 1);
  8138. * // => 'b'
  8139. *
  8140. * _.nth(array, -2);
  8141. * // => 'c';
  8142. */
  8143. function nth(array, n) {
  8144. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8145. }
  8146. /**
  8147. * Removes all given values from `array` using
  8148. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8149. * for equality comparisons.
  8150. *
  8151. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8152. * to remove elements from an array by predicate.
  8153. *
  8154. * @static
  8155. * @memberOf _
  8156. * @since 2.0.0
  8157. * @category Array
  8158. * @param {Array} array The array to modify.
  8159. * @param {...*} [values] The values to remove.
  8160. * @returns {Array} Returns `array`.
  8161. * @example
  8162. *
  8163. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8164. *
  8165. * _.pull(array, 'a', 'c');
  8166. * console.log(array);
  8167. * // => ['b', 'b']
  8168. */
  8169. var pull = baseRest(pullAll);
  8170. /**
  8171. * This method is like `_.pull` except that it accepts an array of values to remove.
  8172. *
  8173. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8174. *
  8175. * @static
  8176. * @memberOf _
  8177. * @since 4.0.0
  8178. * @category Array
  8179. * @param {Array} array The array to modify.
  8180. * @param {Array} values The values to remove.
  8181. * @returns {Array} Returns `array`.
  8182. * @example
  8183. *
  8184. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8185. *
  8186. * _.pullAll(array, ['a', 'c']);
  8187. * console.log(array);
  8188. * // => ['b', 'b']
  8189. */
  8190. function pullAll(array, values) {
  8191. return (array && array.length && values && values.length)
  8192. ? basePullAll(array, values)
  8193. : array;
  8194. }
  8195. /**
  8196. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8197. * invoked for each element of `array` and `values` to generate the criterion
  8198. * by which they're compared. The iteratee is invoked with one argument: (value).
  8199. *
  8200. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8201. *
  8202. * @static
  8203. * @memberOf _
  8204. * @since 4.0.0
  8205. * @category Array
  8206. * @param {Array} array The array to modify.
  8207. * @param {Array} values The values to remove.
  8208. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8209. * @returns {Array} Returns `array`.
  8210. * @example
  8211. *
  8212. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8213. *
  8214. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8215. * console.log(array);
  8216. * // => [{ 'x': 2 }]
  8217. */
  8218. function pullAllBy(array, values, iteratee) {
  8219. return (array && array.length && values && values.length)
  8220. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8221. : array;
  8222. }
  8223. /**
  8224. * This method is like `_.pullAll` except that it accepts `comparator` which
  8225. * is invoked to compare elements of `array` to `values`. The comparator is
  8226. * invoked with two arguments: (arrVal, othVal).
  8227. *
  8228. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8229. *
  8230. * @static
  8231. * @memberOf _
  8232. * @since 4.6.0
  8233. * @category Array
  8234. * @param {Array} array The array to modify.
  8235. * @param {Array} values The values to remove.
  8236. * @param {Function} [comparator] The comparator invoked per element.
  8237. * @returns {Array} Returns `array`.
  8238. * @example
  8239. *
  8240. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8241. *
  8242. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8243. * console.log(array);
  8244. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8245. */
  8246. function pullAllWith(array, values, comparator) {
  8247. return (array && array.length && values && values.length)
  8248. ? basePullAll(array, values, undefined, comparator)
  8249. : array;
  8250. }
  8251. /**
  8252. * Removes elements from `array` corresponding to `indexes` and returns an
  8253. * array of removed elements.
  8254. *
  8255. * **Note:** Unlike `_.at`, this method mutates `array`.
  8256. *
  8257. * @static
  8258. * @memberOf _
  8259. * @since 3.0.0
  8260. * @category Array
  8261. * @param {Array} array The array to modify.
  8262. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8263. * @returns {Array} Returns the new array of removed elements.
  8264. * @example
  8265. *
  8266. * var array = ['a', 'b', 'c', 'd'];
  8267. * var pulled = _.pullAt(array, [1, 3]);
  8268. *
  8269. * console.log(array);
  8270. * // => ['a', 'c']
  8271. *
  8272. * console.log(pulled);
  8273. * // => ['b', 'd']
  8274. */
  8275. var pullAt = flatRest(function(array, indexes) {
  8276. var length = array == null ? 0 : array.length,
  8277. result = baseAt(array, indexes);
  8278. basePullAt(array, arrayMap(indexes, function(index) {
  8279. return isIndex(index, length) ? +index : index;
  8280. }).sort(compareAscending));
  8281. return result;
  8282. });
  8283. /**
  8284. * Removes all elements from `array` that `predicate` returns truthy for
  8285. * and returns an array of the removed elements. The predicate is invoked
  8286. * with three arguments: (value, index, array).
  8287. *
  8288. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8289. * to pull elements from an array by value.
  8290. *
  8291. * @static
  8292. * @memberOf _
  8293. * @since 2.0.0
  8294. * @category Array
  8295. * @param {Array} array The array to modify.
  8296. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8297. * @returns {Array} Returns the new array of removed elements.
  8298. * @example
  8299. *
  8300. * var array = [1, 2, 3, 4];
  8301. * var evens = _.remove(array, function(n) {
  8302. * return n % 2 == 0;
  8303. * });
  8304. *
  8305. * console.log(array);
  8306. * // => [1, 3]
  8307. *
  8308. * console.log(evens);
  8309. * // => [2, 4]
  8310. */
  8311. function remove(array, predicate) {
  8312. var result = [];
  8313. if (!(array && array.length)) {
  8314. return result;
  8315. }
  8316. var index = -1,
  8317. indexes = [],
  8318. length = array.length;
  8319. predicate = getIteratee(predicate, 3);
  8320. while (++index < length) {
  8321. var value = array[index];
  8322. if (predicate(value, index, array)) {
  8323. result.push(value);
  8324. indexes.push(index);
  8325. }
  8326. }
  8327. basePullAt(array, indexes);
  8328. return result;
  8329. }
  8330. /**
  8331. * Reverses `array` so that the first element becomes the last, the second
  8332. * element becomes the second to last, and so on.
  8333. *
  8334. * **Note:** This method mutates `array` and is based on
  8335. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8336. *
  8337. * @static
  8338. * @memberOf _
  8339. * @since 4.0.0
  8340. * @category Array
  8341. * @param {Array} array The array to modify.
  8342. * @returns {Array} Returns `array`.
  8343. * @example
  8344. *
  8345. * var array = [1, 2, 3];
  8346. *
  8347. * _.reverse(array);
  8348. * // => [3, 2, 1]
  8349. *
  8350. * console.log(array);
  8351. * // => [3, 2, 1]
  8352. */
  8353. function reverse(array) {
  8354. return array == null ? array : nativeReverse.call(array);
  8355. }
  8356. /**
  8357. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8358. *
  8359. * **Note:** This method is used instead of
  8360. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8361. * returned.
  8362. *
  8363. * @static
  8364. * @memberOf _
  8365. * @since 3.0.0
  8366. * @category Array
  8367. * @param {Array} array The array to slice.
  8368. * @param {number} [start=0] The start position.
  8369. * @param {number} [end=array.length] The end position.
  8370. * @returns {Array} Returns the slice of `array`.
  8371. */
  8372. function slice(array, start, end) {
  8373. var length = array == null ? 0 : array.length;
  8374. if (!length) {
  8375. return [];
  8376. }
  8377. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8378. start = 0;
  8379. end = length;
  8380. }
  8381. else {
  8382. start = start == null ? 0 : toInteger(start);
  8383. end = end === undefined ? length : toInteger(end);
  8384. }
  8385. return baseSlice(array, start, end);
  8386. }
  8387. /**
  8388. * Uses a binary search to determine the lowest index at which `value`
  8389. * should be inserted into `array` in order to maintain its sort order.
  8390. *
  8391. * @static
  8392. * @memberOf _
  8393. * @since 0.1.0
  8394. * @category Array
  8395. * @param {Array} array The sorted array to inspect.
  8396. * @param {*} value The value to evaluate.
  8397. * @returns {number} Returns the index at which `value` should be inserted
  8398. * into `array`.
  8399. * @example
  8400. *
  8401. * _.sortedIndex([30, 50], 40);
  8402. * // => 1
  8403. */
  8404. function sortedIndex(array, value) {
  8405. return baseSortedIndex(array, value);
  8406. }
  8407. /**
  8408. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8409. * which is invoked for `value` and each element of `array` to compute their
  8410. * sort ranking. The iteratee is invoked with one argument: (value).
  8411. *
  8412. * @static
  8413. * @memberOf _
  8414. * @since 4.0.0
  8415. * @category Array
  8416. * @param {Array} array The sorted array to inspect.
  8417. * @param {*} value The value to evaluate.
  8418. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8419. * @returns {number} Returns the index at which `value` should be inserted
  8420. * into `array`.
  8421. * @example
  8422. *
  8423. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8424. *
  8425. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8426. * // => 0
  8427. *
  8428. * // The `_.property` iteratee shorthand.
  8429. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8430. * // => 0
  8431. */
  8432. function sortedIndexBy(array, value, iteratee) {
  8433. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8434. }
  8435. /**
  8436. * This method is like `_.indexOf` except that it performs a binary
  8437. * search on a sorted `array`.
  8438. *
  8439. * @static
  8440. * @memberOf _
  8441. * @since 4.0.0
  8442. * @category Array
  8443. * @param {Array} array The array to inspect.
  8444. * @param {*} value The value to search for.
  8445. * @returns {number} Returns the index of the matched value, else `-1`.
  8446. * @example
  8447. *
  8448. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8449. * // => 1
  8450. */
  8451. function sortedIndexOf(array, value) {
  8452. var length = array == null ? 0 : array.length;
  8453. if (length) {
  8454. var index = baseSortedIndex(array, value);
  8455. if (index < length && eq(array[index], value)) {
  8456. return index;
  8457. }
  8458. }
  8459. return -1;
  8460. }
  8461. /**
  8462. * This method is like `_.sortedIndex` except that it returns the highest
  8463. * index at which `value` should be inserted into `array` in order to
  8464. * maintain its sort order.
  8465. *
  8466. * @static
  8467. * @memberOf _
  8468. * @since 3.0.0
  8469. * @category Array
  8470. * @param {Array} array The sorted array to inspect.
  8471. * @param {*} value The value to evaluate.
  8472. * @returns {number} Returns the index at which `value` should be inserted
  8473. * into `array`.
  8474. * @example
  8475. *
  8476. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8477. * // => 4
  8478. */
  8479. function sortedLastIndex(array, value) {
  8480. return baseSortedIndex(array, value, true);
  8481. }
  8482. /**
  8483. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8484. * which is invoked for `value` and each element of `array` to compute their
  8485. * sort ranking. The iteratee is invoked with one argument: (value).
  8486. *
  8487. * @static
  8488. * @memberOf _
  8489. * @since 4.0.0
  8490. * @category Array
  8491. * @param {Array} array The sorted array to inspect.
  8492. * @param {*} value The value to evaluate.
  8493. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8494. * @returns {number} Returns the index at which `value` should be inserted
  8495. * into `array`.
  8496. * @example
  8497. *
  8498. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8499. *
  8500. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8501. * // => 1
  8502. *
  8503. * // The `_.property` iteratee shorthand.
  8504. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8505. * // => 1
  8506. */
  8507. function sortedLastIndexBy(array, value, iteratee) {
  8508. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8509. }
  8510. /**
  8511. * This method is like `_.lastIndexOf` except that it performs a binary
  8512. * search on a sorted `array`.
  8513. *
  8514. * @static
  8515. * @memberOf _
  8516. * @since 4.0.0
  8517. * @category Array
  8518. * @param {Array} array The array to inspect.
  8519. * @param {*} value The value to search for.
  8520. * @returns {number} Returns the index of the matched value, else `-1`.
  8521. * @example
  8522. *
  8523. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8524. * // => 3
  8525. */
  8526. function sortedLastIndexOf(array, value) {
  8527. var length = array == null ? 0 : array.length;
  8528. if (length) {
  8529. var index = baseSortedIndex(array, value, true) - 1;
  8530. if (eq(array[index], value)) {
  8531. return index;
  8532. }
  8533. }
  8534. return -1;
  8535. }
  8536. /**
  8537. * This method is like `_.uniq` except that it's designed and optimized
  8538. * for sorted arrays.
  8539. *
  8540. * @static
  8541. * @memberOf _
  8542. * @since 4.0.0
  8543. * @category Array
  8544. * @param {Array} array The array to inspect.
  8545. * @returns {Array} Returns the new duplicate free array.
  8546. * @example
  8547. *
  8548. * _.sortedUniq([1, 1, 2]);
  8549. * // => [1, 2]
  8550. */
  8551. function sortedUniq(array) {
  8552. return (array && array.length)
  8553. ? baseSortedUniq(array)
  8554. : [];
  8555. }
  8556. /**
  8557. * This method is like `_.uniqBy` except that it's designed and optimized
  8558. * for sorted arrays.
  8559. *
  8560. * @static
  8561. * @memberOf _
  8562. * @since 4.0.0
  8563. * @category Array
  8564. * @param {Array} array The array to inspect.
  8565. * @param {Function} [iteratee] The iteratee invoked per element.
  8566. * @returns {Array} Returns the new duplicate free array.
  8567. * @example
  8568. *
  8569. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8570. * // => [1.1, 2.3]
  8571. */
  8572. function sortedUniqBy(array, iteratee) {
  8573. return (array && array.length)
  8574. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8575. : [];
  8576. }
  8577. /**
  8578. * Gets all but the first element of `array`.
  8579. *
  8580. * @static
  8581. * @memberOf _
  8582. * @since 4.0.0
  8583. * @category Array
  8584. * @param {Array} array The array to query.
  8585. * @returns {Array} Returns the slice of `array`.
  8586. * @example
  8587. *
  8588. * _.tail([1, 2, 3]);
  8589. * // => [2, 3]
  8590. */
  8591. function tail(array) {
  8592. var length = array == null ? 0 : array.length;
  8593. return length ? baseSlice(array, 1, length) : [];
  8594. }
  8595. /**
  8596. * Creates a slice of `array` with `n` elements taken from the beginning.
  8597. *
  8598. * @static
  8599. * @memberOf _
  8600. * @since 0.1.0
  8601. * @category Array
  8602. * @param {Array} array The array to query.
  8603. * @param {number} [n=1] The number of elements to take.
  8604. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8605. * @returns {Array} Returns the slice of `array`.
  8606. * @example
  8607. *
  8608. * _.take([1, 2, 3]);
  8609. * // => [1]
  8610. *
  8611. * _.take([1, 2, 3], 2);
  8612. * // => [1, 2]
  8613. *
  8614. * _.take([1, 2, 3], 5);
  8615. * // => [1, 2, 3]
  8616. *
  8617. * _.take([1, 2, 3], 0);
  8618. * // => []
  8619. */
  8620. function take(array, n, guard) {
  8621. if (!(array && array.length)) {
  8622. return [];
  8623. }
  8624. n = (guard || n === undefined) ? 1 : toInteger(n);
  8625. return baseSlice(array, 0, n < 0 ? 0 : n);
  8626. }
  8627. /**
  8628. * Creates a slice of `array` with `n` elements taken from the end.
  8629. *
  8630. * @static
  8631. * @memberOf _
  8632. * @since 3.0.0
  8633. * @category Array
  8634. * @param {Array} array The array to query.
  8635. * @param {number} [n=1] The number of elements to take.
  8636. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8637. * @returns {Array} Returns the slice of `array`.
  8638. * @example
  8639. *
  8640. * _.takeRight([1, 2, 3]);
  8641. * // => [3]
  8642. *
  8643. * _.takeRight([1, 2, 3], 2);
  8644. * // => [2, 3]
  8645. *
  8646. * _.takeRight([1, 2, 3], 5);
  8647. * // => [1, 2, 3]
  8648. *
  8649. * _.takeRight([1, 2, 3], 0);
  8650. * // => []
  8651. */
  8652. function takeRight(array, n, guard) {
  8653. var length = array == null ? 0 : array.length;
  8654. if (!length) {
  8655. return [];
  8656. }
  8657. n = (guard || n === undefined) ? 1 : toInteger(n);
  8658. n = length - n;
  8659. return baseSlice(array, n < 0 ? 0 : n, length);
  8660. }
  8661. /**
  8662. * Creates a slice of `array` with elements taken from the end. Elements are
  8663. * taken until `predicate` returns falsey. The predicate is invoked with
  8664. * three arguments: (value, index, array).
  8665. *
  8666. * @static
  8667. * @memberOf _
  8668. * @since 3.0.0
  8669. * @category Array
  8670. * @param {Array} array The array to query.
  8671. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8672. * @returns {Array} Returns the slice of `array`.
  8673. * @example
  8674. *
  8675. * var users = [
  8676. * { 'user': 'barney', 'active': true },
  8677. * { 'user': 'fred', 'active': false },
  8678. * { 'user': 'pebbles', 'active': false }
  8679. * ];
  8680. *
  8681. * _.takeRightWhile(users, function(o) { return !o.active; });
  8682. * // => objects for ['fred', 'pebbles']
  8683. *
  8684. * // The `_.matches` iteratee shorthand.
  8685. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8686. * // => objects for ['pebbles']
  8687. *
  8688. * // The `_.matchesProperty` iteratee shorthand.
  8689. * _.takeRightWhile(users, ['active', false]);
  8690. * // => objects for ['fred', 'pebbles']
  8691. *
  8692. * // The `_.property` iteratee shorthand.
  8693. * _.takeRightWhile(users, 'active');
  8694. * // => []
  8695. */
  8696. function takeRightWhile(array, predicate) {
  8697. return (array && array.length)
  8698. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8699. : [];
  8700. }
  8701. /**
  8702. * Creates a slice of `array` with elements taken from the beginning. Elements
  8703. * are taken until `predicate` returns falsey. The predicate is invoked with
  8704. * three arguments: (value, index, array).
  8705. *
  8706. * @static
  8707. * @memberOf _
  8708. * @since 3.0.0
  8709. * @category Array
  8710. * @param {Array} array The array to query.
  8711. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8712. * @returns {Array} Returns the slice of `array`.
  8713. * @example
  8714. *
  8715. * var users = [
  8716. * { 'user': 'barney', 'active': false },
  8717. * { 'user': 'fred', 'active': false },
  8718. * { 'user': 'pebbles', 'active': true }
  8719. * ];
  8720. *
  8721. * _.takeWhile(users, function(o) { return !o.active; });
  8722. * // => objects for ['barney', 'fred']
  8723. *
  8724. * // The `_.matches` iteratee shorthand.
  8725. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8726. * // => objects for ['barney']
  8727. *
  8728. * // The `_.matchesProperty` iteratee shorthand.
  8729. * _.takeWhile(users, ['active', false]);
  8730. * // => objects for ['barney', 'fred']
  8731. *
  8732. * // The `_.property` iteratee shorthand.
  8733. * _.takeWhile(users, 'active');
  8734. * // => []
  8735. */
  8736. function takeWhile(array, predicate) {
  8737. return (array && array.length)
  8738. ? baseWhile(array, getIteratee(predicate, 3))
  8739. : [];
  8740. }
  8741. /**
  8742. * Creates an array of unique values, in order, from all given arrays using
  8743. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8744. * for equality comparisons.
  8745. *
  8746. * @static
  8747. * @memberOf _
  8748. * @since 0.1.0
  8749. * @category Array
  8750. * @param {...Array} [arrays] The arrays to inspect.
  8751. * @returns {Array} Returns the new array of combined values.
  8752. * @example
  8753. *
  8754. * _.union([2], [1, 2]);
  8755. * // => [2, 1]
  8756. */
  8757. var union = baseRest(function(arrays) {
  8758. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8759. });
  8760. /**
  8761. * This method is like `_.union` except that it accepts `iteratee` which is
  8762. * invoked for each element of each `arrays` to generate the criterion by
  8763. * which uniqueness is computed. Result values are chosen from the first
  8764. * array in which the value occurs. The iteratee is invoked with one argument:
  8765. * (value).
  8766. *
  8767. * @static
  8768. * @memberOf _
  8769. * @since 4.0.0
  8770. * @category Array
  8771. * @param {...Array} [arrays] The arrays to inspect.
  8772. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8773. * @returns {Array} Returns the new array of combined values.
  8774. * @example
  8775. *
  8776. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8777. * // => [2.1, 1.2]
  8778. *
  8779. * // The `_.property` iteratee shorthand.
  8780. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8781. * // => [{ 'x': 1 }, { 'x': 2 }]
  8782. */
  8783. var unionBy = baseRest(function(arrays) {
  8784. var iteratee = last(arrays);
  8785. if (isArrayLikeObject(iteratee)) {
  8786. iteratee = undefined;
  8787. }
  8788. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8789. });
  8790. /**
  8791. * This method is like `_.union` except that it accepts `comparator` which
  8792. * is invoked to compare elements of `arrays`. Result values are chosen from
  8793. * the first array in which the value occurs. The comparator is invoked
  8794. * with two arguments: (arrVal, othVal).
  8795. *
  8796. * @static
  8797. * @memberOf _
  8798. * @since 4.0.0
  8799. * @category Array
  8800. * @param {...Array} [arrays] The arrays to inspect.
  8801. * @param {Function} [comparator] The comparator invoked per element.
  8802. * @returns {Array} Returns the new array of combined values.
  8803. * @example
  8804. *
  8805. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8806. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8807. *
  8808. * _.unionWith(objects, others, _.isEqual);
  8809. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8810. */
  8811. var unionWith = baseRest(function(arrays) {
  8812. var comparator = last(arrays);
  8813. comparator = typeof comparator == 'function' ? comparator : undefined;
  8814. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8815. });
  8816. /**
  8817. * Creates a duplicate-free version of an array, using
  8818. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8819. * for equality comparisons, in which only the first occurrence of each element
  8820. * is kept. The order of result values is determined by the order they occur
  8821. * in the array.
  8822. *
  8823. * @static
  8824. * @memberOf _
  8825. * @since 0.1.0
  8826. * @category Array
  8827. * @param {Array} array The array to inspect.
  8828. * @returns {Array} Returns the new duplicate free array.
  8829. * @example
  8830. *
  8831. * _.uniq([2, 1, 2]);
  8832. * // => [2, 1]
  8833. */
  8834. function uniq(array) {
  8835. return (array && array.length) ? baseUniq(array) : [];
  8836. }
  8837. /**
  8838. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8839. * invoked for each element in `array` to generate the criterion by which
  8840. * uniqueness is computed. The order of result values is determined by the
  8841. * order they occur in the array. The iteratee is invoked with one argument:
  8842. * (value).
  8843. *
  8844. * @static
  8845. * @memberOf _
  8846. * @since 4.0.0
  8847. * @category Array
  8848. * @param {Array} array The array to inspect.
  8849. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8850. * @returns {Array} Returns the new duplicate free array.
  8851. * @example
  8852. *
  8853. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8854. * // => [2.1, 1.2]
  8855. *
  8856. * // The `_.property` iteratee shorthand.
  8857. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8858. * // => [{ 'x': 1 }, { 'x': 2 }]
  8859. */
  8860. function uniqBy(array, iteratee) {
  8861. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8862. }
  8863. /**
  8864. * This method is like `_.uniq` except that it accepts `comparator` which
  8865. * is invoked to compare elements of `array`. The order of result values is
  8866. * determined by the order they occur in the array.The comparator is invoked
  8867. * with two arguments: (arrVal, othVal).
  8868. *
  8869. * @static
  8870. * @memberOf _
  8871. * @since 4.0.0
  8872. * @category Array
  8873. * @param {Array} array The array to inspect.
  8874. * @param {Function} [comparator] The comparator invoked per element.
  8875. * @returns {Array} Returns the new duplicate free array.
  8876. * @example
  8877. *
  8878. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8879. *
  8880. * _.uniqWith(objects, _.isEqual);
  8881. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  8882. */
  8883. function uniqWith(array, comparator) {
  8884. comparator = typeof comparator == 'function' ? comparator : undefined;
  8885. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  8886. }
  8887. /**
  8888. * This method is like `_.zip` except that it accepts an array of grouped
  8889. * elements and creates an array regrouping the elements to their pre-zip
  8890. * configuration.
  8891. *
  8892. * @static
  8893. * @memberOf _
  8894. * @since 1.2.0
  8895. * @category Array
  8896. * @param {Array} array The array of grouped elements to process.
  8897. * @returns {Array} Returns the new array of regrouped elements.
  8898. * @example
  8899. *
  8900. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  8901. * // => [['a', 1, true], ['b', 2, false]]
  8902. *
  8903. * _.unzip(zipped);
  8904. * // => [['a', 'b'], [1, 2], [true, false]]
  8905. */
  8906. function unzip(array) {
  8907. if (!(array && array.length)) {
  8908. return [];
  8909. }
  8910. var length = 0;
  8911. array = arrayFilter(array, function(group) {
  8912. if (isArrayLikeObject(group)) {
  8913. length = nativeMax(group.length, length);
  8914. return true;
  8915. }
  8916. });
  8917. return baseTimes(length, function(index) {
  8918. return arrayMap(array, baseProperty(index));
  8919. });
  8920. }
  8921. /**
  8922. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  8923. * how regrouped values should be combined. The iteratee is invoked with the
  8924. * elements of each group: (...group).
  8925. *
  8926. * @static
  8927. * @memberOf _
  8928. * @since 3.8.0
  8929. * @category Array
  8930. * @param {Array} array The array of grouped elements to process.
  8931. * @param {Function} [iteratee=_.identity] The function to combine
  8932. * regrouped values.
  8933. * @returns {Array} Returns the new array of regrouped elements.
  8934. * @example
  8935. *
  8936. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  8937. * // => [[1, 10, 100], [2, 20, 200]]
  8938. *
  8939. * _.unzipWith(zipped, _.add);
  8940. * // => [3, 30, 300]
  8941. */
  8942. function unzipWith(array, iteratee) {
  8943. if (!(array && array.length)) {
  8944. return [];
  8945. }
  8946. var result = unzip(array);
  8947. if (iteratee == null) {
  8948. return result;
  8949. }
  8950. return arrayMap(result, function(group) {
  8951. return apply(iteratee, undefined, group);
  8952. });
  8953. }
  8954. /**
  8955. * Creates an array excluding all given values using
  8956. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8957. * for equality comparisons.
  8958. *
  8959. * **Note:** Unlike `_.pull`, this method returns a new array.
  8960. *
  8961. * @static
  8962. * @memberOf _
  8963. * @since 0.1.0
  8964. * @category Array
  8965. * @param {Array} array The array to inspect.
  8966. * @param {...*} [values] The values to exclude.
  8967. * @returns {Array} Returns the new array of filtered values.
  8968. * @see _.difference, _.xor
  8969. * @example
  8970. *
  8971. * _.without([2, 1, 2, 3], 1, 2);
  8972. * // => [3]
  8973. */
  8974. var without = baseRest(function(array, values) {
  8975. return isArrayLikeObject(array)
  8976. ? baseDifference(array, values)
  8977. : [];
  8978. });
  8979. /**
  8980. * Creates an array of unique values that is the
  8981. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  8982. * of the given arrays. The order of result values is determined by the order
  8983. * they occur in the arrays.
  8984. *
  8985. * @static
  8986. * @memberOf _
  8987. * @since 2.4.0
  8988. * @category Array
  8989. * @param {...Array} [arrays] The arrays to inspect.
  8990. * @returns {Array} Returns the new array of filtered values.
  8991. * @see _.difference, _.without
  8992. * @example
  8993. *
  8994. * _.xor([2, 1], [2, 3]);
  8995. * // => [1, 3]
  8996. */
  8997. var xor = baseRest(function(arrays) {
  8998. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  8999. });
  9000. /**
  9001. * This method is like `_.xor` except that it accepts `iteratee` which is
  9002. * invoked for each element of each `arrays` to generate the criterion by
  9003. * which by which they're compared. The order of result values is determined
  9004. * by the order they occur in the arrays. The iteratee is invoked with one
  9005. * argument: (value).
  9006. *
  9007. * @static
  9008. * @memberOf _
  9009. * @since 4.0.0
  9010. * @category Array
  9011. * @param {...Array} [arrays] The arrays to inspect.
  9012. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9013. * @returns {Array} Returns the new array of filtered values.
  9014. * @example
  9015. *
  9016. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9017. * // => [1.2, 3.4]
  9018. *
  9019. * // The `_.property` iteratee shorthand.
  9020. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9021. * // => [{ 'x': 2 }]
  9022. */
  9023. var xorBy = baseRest(function(arrays) {
  9024. var iteratee = last(arrays);
  9025. if (isArrayLikeObject(iteratee)) {
  9026. iteratee = undefined;
  9027. }
  9028. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9029. });
  9030. /**
  9031. * This method is like `_.xor` except that it accepts `comparator` which is
  9032. * invoked to compare elements of `arrays`. The order of result values is
  9033. * determined by the order they occur in the arrays. The comparator is invoked
  9034. * with two arguments: (arrVal, othVal).
  9035. *
  9036. * @static
  9037. * @memberOf _
  9038. * @since 4.0.0
  9039. * @category Array
  9040. * @param {...Array} [arrays] The arrays to inspect.
  9041. * @param {Function} [comparator] The comparator invoked per element.
  9042. * @returns {Array} Returns the new array of filtered values.
  9043. * @example
  9044. *
  9045. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9046. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9047. *
  9048. * _.xorWith(objects, others, _.isEqual);
  9049. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9050. */
  9051. var xorWith = baseRest(function(arrays) {
  9052. var comparator = last(arrays);
  9053. comparator = typeof comparator == 'function' ? comparator : undefined;
  9054. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9055. });
  9056. /**
  9057. * Creates an array of grouped elements, the first of which contains the
  9058. * first elements of the given arrays, the second of which contains the
  9059. * second elements of the given arrays, and so on.
  9060. *
  9061. * @static
  9062. * @memberOf _
  9063. * @since 0.1.0
  9064. * @category Array
  9065. * @param {...Array} [arrays] The arrays to process.
  9066. * @returns {Array} Returns the new array of grouped elements.
  9067. * @example
  9068. *
  9069. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9070. * // => [['a', 1, true], ['b', 2, false]]
  9071. */
  9072. var zip = baseRest(unzip);
  9073. /**
  9074. * This method is like `_.fromPairs` except that it accepts two arrays,
  9075. * one of property identifiers and one of corresponding values.
  9076. *
  9077. * @static
  9078. * @memberOf _
  9079. * @since 0.4.0
  9080. * @category Array
  9081. * @param {Array} [props=[]] The property identifiers.
  9082. * @param {Array} [values=[]] The property values.
  9083. * @returns {Object} Returns the new object.
  9084. * @example
  9085. *
  9086. * _.zipObject(['a', 'b'], [1, 2]);
  9087. * // => { 'a': 1, 'b': 2 }
  9088. */
  9089. function zipObject(props, values) {
  9090. return baseZipObject(props || [], values || [], assignValue);
  9091. }
  9092. /**
  9093. * This method is like `_.zipObject` except that it supports property paths.
  9094. *
  9095. * @static
  9096. * @memberOf _
  9097. * @since 4.1.0
  9098. * @category Array
  9099. * @param {Array} [props=[]] The property identifiers.
  9100. * @param {Array} [values=[]] The property values.
  9101. * @returns {Object} Returns the new object.
  9102. * @example
  9103. *
  9104. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9105. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9106. */
  9107. function zipObjectDeep(props, values) {
  9108. return baseZipObject(props || [], values || [], baseSet);
  9109. }
  9110. /**
  9111. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9112. * how grouped values should be combined. The iteratee is invoked with the
  9113. * elements of each group: (...group).
  9114. *
  9115. * @static
  9116. * @memberOf _
  9117. * @since 3.8.0
  9118. * @category Array
  9119. * @param {...Array} [arrays] The arrays to process.
  9120. * @param {Function} [iteratee=_.identity] The function to combine
  9121. * grouped values.
  9122. * @returns {Array} Returns the new array of grouped elements.
  9123. * @example
  9124. *
  9125. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9126. * return a + b + c;
  9127. * });
  9128. * // => [111, 222]
  9129. */
  9130. var zipWith = baseRest(function(arrays) {
  9131. var length = arrays.length,
  9132. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9133. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9134. return unzipWith(arrays, iteratee);
  9135. });
  9136. /*------------------------------------------------------------------------*/
  9137. /**
  9138. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9139. * chain sequences enabled. The result of such sequences must be unwrapped
  9140. * with `_#value`.
  9141. *
  9142. * @static
  9143. * @memberOf _
  9144. * @since 1.3.0
  9145. * @category Seq
  9146. * @param {*} value The value to wrap.
  9147. * @returns {Object} Returns the new `lodash` wrapper instance.
  9148. * @example
  9149. *
  9150. * var users = [
  9151. * { 'user': 'barney', 'age': 36 },
  9152. * { 'user': 'fred', 'age': 40 },
  9153. * { 'user': 'pebbles', 'age': 1 }
  9154. * ];
  9155. *
  9156. * var youngest = _
  9157. * .chain(users)
  9158. * .sortBy('age')
  9159. * .map(function(o) {
  9160. * return o.user + ' is ' + o.age;
  9161. * })
  9162. * .head()
  9163. * .value();
  9164. * // => 'pebbles is 1'
  9165. */
  9166. function chain(value) {
  9167. var result = lodash(value);
  9168. result.__chain__ = true;
  9169. return result;
  9170. }
  9171. /**
  9172. * This method invokes `interceptor` and returns `value`. The interceptor
  9173. * is invoked with one argument; (value). The purpose of this method is to
  9174. * "tap into" a method chain sequence in order to modify intermediate results.
  9175. *
  9176. * @static
  9177. * @memberOf _
  9178. * @since 0.1.0
  9179. * @category Seq
  9180. * @param {*} value The value to provide to `interceptor`.
  9181. * @param {Function} interceptor The function to invoke.
  9182. * @returns {*} Returns `value`.
  9183. * @example
  9184. *
  9185. * _([1, 2, 3])
  9186. * .tap(function(array) {
  9187. * // Mutate input array.
  9188. * array.pop();
  9189. * })
  9190. * .reverse()
  9191. * .value();
  9192. * // => [2, 1]
  9193. */
  9194. function tap(value, interceptor) {
  9195. interceptor(value);
  9196. return value;
  9197. }
  9198. /**
  9199. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9200. * The purpose of this method is to "pass thru" values replacing intermediate
  9201. * results in a method chain sequence.
  9202. *
  9203. * @static
  9204. * @memberOf _
  9205. * @since 3.0.0
  9206. * @category Seq
  9207. * @param {*} value The value to provide to `interceptor`.
  9208. * @param {Function} interceptor The function to invoke.
  9209. * @returns {*} Returns the result of `interceptor`.
  9210. * @example
  9211. *
  9212. * _(' abc ')
  9213. * .chain()
  9214. * .trim()
  9215. * .thru(function(value) {
  9216. * return [value];
  9217. * })
  9218. * .value();
  9219. * // => ['abc']
  9220. */
  9221. function thru(value, interceptor) {
  9222. return interceptor(value);
  9223. }
  9224. /**
  9225. * This method is the wrapper version of `_.at`.
  9226. *
  9227. * @name at
  9228. * @memberOf _
  9229. * @since 1.0.0
  9230. * @category Seq
  9231. * @param {...(string|string[])} [paths] The property paths to pick.
  9232. * @returns {Object} Returns the new `lodash` wrapper instance.
  9233. * @example
  9234. *
  9235. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9236. *
  9237. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9238. * // => [3, 4]
  9239. */
  9240. var wrapperAt = flatRest(function(paths) {
  9241. var length = paths.length,
  9242. start = length ? paths[0] : 0,
  9243. value = this.__wrapped__,
  9244. interceptor = function(object) { return baseAt(object, paths); };
  9245. if (length > 1 || this.__actions__.length ||
  9246. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9247. return this.thru(interceptor);
  9248. }
  9249. value = value.slice(start, +start + (length ? 1 : 0));
  9250. value.__actions__.push({
  9251. 'func': thru,
  9252. 'args': [interceptor],
  9253. 'thisArg': undefined
  9254. });
  9255. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9256. if (length && !array.length) {
  9257. array.push(undefined);
  9258. }
  9259. return array;
  9260. });
  9261. });
  9262. /**
  9263. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9264. *
  9265. * @name chain
  9266. * @memberOf _
  9267. * @since 0.1.0
  9268. * @category Seq
  9269. * @returns {Object} Returns the new `lodash` wrapper instance.
  9270. * @example
  9271. *
  9272. * var users = [
  9273. * { 'user': 'barney', 'age': 36 },
  9274. * { 'user': 'fred', 'age': 40 }
  9275. * ];
  9276. *
  9277. * // A sequence without explicit chaining.
  9278. * _(users).head();
  9279. * // => { 'user': 'barney', 'age': 36 }
  9280. *
  9281. * // A sequence with explicit chaining.
  9282. * _(users)
  9283. * .chain()
  9284. * .head()
  9285. * .pick('user')
  9286. * .value();
  9287. * // => { 'user': 'barney' }
  9288. */
  9289. function wrapperChain() {
  9290. return chain(this);
  9291. }
  9292. /**
  9293. * Executes the chain sequence and returns the wrapped result.
  9294. *
  9295. * @name commit
  9296. * @memberOf _
  9297. * @since 3.2.0
  9298. * @category Seq
  9299. * @returns {Object} Returns the new `lodash` wrapper instance.
  9300. * @example
  9301. *
  9302. * var array = [1, 2];
  9303. * var wrapped = _(array).push(3);
  9304. *
  9305. * console.log(array);
  9306. * // => [1, 2]
  9307. *
  9308. * wrapped = wrapped.commit();
  9309. * console.log(array);
  9310. * // => [1, 2, 3]
  9311. *
  9312. * wrapped.last();
  9313. * // => 3
  9314. *
  9315. * console.log(array);
  9316. * // => [1, 2, 3]
  9317. */
  9318. function wrapperCommit() {
  9319. return new LodashWrapper(this.value(), this.__chain__);
  9320. }
  9321. /**
  9322. * Gets the next value on a wrapped object following the
  9323. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9324. *
  9325. * @name next
  9326. * @memberOf _
  9327. * @since 4.0.0
  9328. * @category Seq
  9329. * @returns {Object} Returns the next iterator value.
  9330. * @example
  9331. *
  9332. * var wrapped = _([1, 2]);
  9333. *
  9334. * wrapped.next();
  9335. * // => { 'done': false, 'value': 1 }
  9336. *
  9337. * wrapped.next();
  9338. * // => { 'done': false, 'value': 2 }
  9339. *
  9340. * wrapped.next();
  9341. * // => { 'done': true, 'value': undefined }
  9342. */
  9343. function wrapperNext() {
  9344. if (this.__values__ === undefined) {
  9345. this.__values__ = toArray(this.value());
  9346. }
  9347. var done = this.__index__ >= this.__values__.length,
  9348. value = done ? undefined : this.__values__[this.__index__++];
  9349. return { 'done': done, 'value': value };
  9350. }
  9351. /**
  9352. * Enables the wrapper to be iterable.
  9353. *
  9354. * @name Symbol.iterator
  9355. * @memberOf _
  9356. * @since 4.0.0
  9357. * @category Seq
  9358. * @returns {Object} Returns the wrapper object.
  9359. * @example
  9360. *
  9361. * var wrapped = _([1, 2]);
  9362. *
  9363. * wrapped[Symbol.iterator]() === wrapped;
  9364. * // => true
  9365. *
  9366. * Array.from(wrapped);
  9367. * // => [1, 2]
  9368. */
  9369. function wrapperToIterator() {
  9370. return this;
  9371. }
  9372. /**
  9373. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9374. *
  9375. * @name plant
  9376. * @memberOf _
  9377. * @since 3.2.0
  9378. * @category Seq
  9379. * @param {*} value The value to plant.
  9380. * @returns {Object} Returns the new `lodash` wrapper instance.
  9381. * @example
  9382. *
  9383. * function square(n) {
  9384. * return n * n;
  9385. * }
  9386. *
  9387. * var wrapped = _([1, 2]).map(square);
  9388. * var other = wrapped.plant([3, 4]);
  9389. *
  9390. * other.value();
  9391. * // => [9, 16]
  9392. *
  9393. * wrapped.value();
  9394. * // => [1, 4]
  9395. */
  9396. function wrapperPlant(value) {
  9397. var result,
  9398. parent = this;
  9399. while (parent instanceof baseLodash) {
  9400. var clone = wrapperClone(parent);
  9401. clone.__index__ = 0;
  9402. clone.__values__ = undefined;
  9403. if (result) {
  9404. previous.__wrapped__ = clone;
  9405. } else {
  9406. result = clone;
  9407. }
  9408. var previous = clone;
  9409. parent = parent.__wrapped__;
  9410. }
  9411. previous.__wrapped__ = value;
  9412. return result;
  9413. }
  9414. /**
  9415. * This method is the wrapper version of `_.reverse`.
  9416. *
  9417. * **Note:** This method mutates the wrapped array.
  9418. *
  9419. * @name reverse
  9420. * @memberOf _
  9421. * @since 0.1.0
  9422. * @category Seq
  9423. * @returns {Object} Returns the new `lodash` wrapper instance.
  9424. * @example
  9425. *
  9426. * var array = [1, 2, 3];
  9427. *
  9428. * _(array).reverse().value()
  9429. * // => [3, 2, 1]
  9430. *
  9431. * console.log(array);
  9432. * // => [3, 2, 1]
  9433. */
  9434. function wrapperReverse() {
  9435. var value = this.__wrapped__;
  9436. if (value instanceof LazyWrapper) {
  9437. var wrapped = value;
  9438. if (this.__actions__.length) {
  9439. wrapped = new LazyWrapper(this);
  9440. }
  9441. wrapped = wrapped.reverse();
  9442. wrapped.__actions__.push({
  9443. 'func': thru,
  9444. 'args': [reverse],
  9445. 'thisArg': undefined
  9446. });
  9447. return new LodashWrapper(wrapped, this.__chain__);
  9448. }
  9449. return this.thru(reverse);
  9450. }
  9451. /**
  9452. * Executes the chain sequence to resolve the unwrapped value.
  9453. *
  9454. * @name value
  9455. * @memberOf _
  9456. * @since 0.1.0
  9457. * @alias toJSON, valueOf
  9458. * @category Seq
  9459. * @returns {*} Returns the resolved unwrapped value.
  9460. * @example
  9461. *
  9462. * _([1, 2, 3]).value();
  9463. * // => [1, 2, 3]
  9464. */
  9465. function wrapperValue() {
  9466. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9467. }
  9468. /*------------------------------------------------------------------------*/
  9469. /**
  9470. * Creates an object composed of keys generated from the results of running
  9471. * each element of `collection` thru `iteratee`. The corresponding value of
  9472. * each key is the number of times the key was returned by `iteratee`. The
  9473. * iteratee is invoked with one argument: (value).
  9474. *
  9475. * @static
  9476. * @memberOf _
  9477. * @since 0.5.0
  9478. * @category Collection
  9479. * @param {Array|Object} collection The collection to iterate over.
  9480. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9481. * @returns {Object} Returns the composed aggregate object.
  9482. * @example
  9483. *
  9484. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9485. * // => { '4': 1, '6': 2 }
  9486. *
  9487. * // The `_.property` iteratee shorthand.
  9488. * _.countBy(['one', 'two', 'three'], 'length');
  9489. * // => { '3': 2, '5': 1 }
  9490. */
  9491. var countBy = createAggregator(function(result, value, key) {
  9492. if (hasOwnProperty.call(result, key)) {
  9493. ++result[key];
  9494. } else {
  9495. baseAssignValue(result, key, 1);
  9496. }
  9497. });
  9498. /**
  9499. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9500. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9501. * invoked with three arguments: (value, index|key, collection).
  9502. *
  9503. * **Note:** This method returns `true` for
  9504. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9505. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9506. * elements of empty collections.
  9507. *
  9508. * @static
  9509. * @memberOf _
  9510. * @since 0.1.0
  9511. * @category Collection
  9512. * @param {Array|Object} collection The collection to iterate over.
  9513. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9514. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9515. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9516. * else `false`.
  9517. * @example
  9518. *
  9519. * _.every([true, 1, null, 'yes'], Boolean);
  9520. * // => false
  9521. *
  9522. * var users = [
  9523. * { 'user': 'barney', 'age': 36, 'active': false },
  9524. * { 'user': 'fred', 'age': 40, 'active': false }
  9525. * ];
  9526. *
  9527. * // The `_.matches` iteratee shorthand.
  9528. * _.every(users, { 'user': 'barney', 'active': false });
  9529. * // => false
  9530. *
  9531. * // The `_.matchesProperty` iteratee shorthand.
  9532. * _.every(users, ['active', false]);
  9533. * // => true
  9534. *
  9535. * // The `_.property` iteratee shorthand.
  9536. * _.every(users, 'active');
  9537. * // => false
  9538. */
  9539. function every(collection, predicate, guard) {
  9540. var func = isArray(collection) ? arrayEvery : baseEvery;
  9541. if (guard && isIterateeCall(collection, predicate, guard)) {
  9542. predicate = undefined;
  9543. }
  9544. return func(collection, getIteratee(predicate, 3));
  9545. }
  9546. /**
  9547. * Iterates over elements of `collection`, returning an array of all elements
  9548. * `predicate` returns truthy for. The predicate is invoked with three
  9549. * arguments: (value, index|key, collection).
  9550. *
  9551. * **Note:** Unlike `_.remove`, this method returns a new array.
  9552. *
  9553. * @static
  9554. * @memberOf _
  9555. * @since 0.1.0
  9556. * @category Collection
  9557. * @param {Array|Object} collection The collection to iterate over.
  9558. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9559. * @returns {Array} Returns the new filtered array.
  9560. * @see _.reject
  9561. * @example
  9562. *
  9563. * var users = [
  9564. * { 'user': 'barney', 'age': 36, 'active': true },
  9565. * { 'user': 'fred', 'age': 40, 'active': false }
  9566. * ];
  9567. *
  9568. * _.filter(users, function(o) { return !o.active; });
  9569. * // => objects for ['fred']
  9570. *
  9571. * // The `_.matches` iteratee shorthand.
  9572. * _.filter(users, { 'age': 36, 'active': true });
  9573. * // => objects for ['barney']
  9574. *
  9575. * // The `_.matchesProperty` iteratee shorthand.
  9576. * _.filter(users, ['active', false]);
  9577. * // => objects for ['fred']
  9578. *
  9579. * // The `_.property` iteratee shorthand.
  9580. * _.filter(users, 'active');
  9581. * // => objects for ['barney']
  9582. *
  9583. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9584. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9585. * // => objects for ['fred', 'barney']
  9586. */
  9587. function filter(collection, predicate) {
  9588. var func = isArray(collection) ? arrayFilter : baseFilter;
  9589. return func(collection, getIteratee(predicate, 3));
  9590. }
  9591. /**
  9592. * Iterates over elements of `collection`, returning the first element
  9593. * `predicate` returns truthy for. The predicate is invoked with three
  9594. * arguments: (value, index|key, collection).
  9595. *
  9596. * @static
  9597. * @memberOf _
  9598. * @since 0.1.0
  9599. * @category Collection
  9600. * @param {Array|Object} collection The collection to inspect.
  9601. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9602. * @param {number} [fromIndex=0] The index to search from.
  9603. * @returns {*} Returns the matched element, else `undefined`.
  9604. * @example
  9605. *
  9606. * var users = [
  9607. * { 'user': 'barney', 'age': 36, 'active': true },
  9608. * { 'user': 'fred', 'age': 40, 'active': false },
  9609. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9610. * ];
  9611. *
  9612. * _.find(users, function(o) { return o.age < 40; });
  9613. * // => object for 'barney'
  9614. *
  9615. * // The `_.matches` iteratee shorthand.
  9616. * _.find(users, { 'age': 1, 'active': true });
  9617. * // => object for 'pebbles'
  9618. *
  9619. * // The `_.matchesProperty` iteratee shorthand.
  9620. * _.find(users, ['active', false]);
  9621. * // => object for 'fred'
  9622. *
  9623. * // The `_.property` iteratee shorthand.
  9624. * _.find(users, 'active');
  9625. * // => object for 'barney'
  9626. */
  9627. var find = createFind(findIndex);
  9628. /**
  9629. * This method is like `_.find` except that it iterates over elements of
  9630. * `collection` from right to left.
  9631. *
  9632. * @static
  9633. * @memberOf _
  9634. * @since 2.0.0
  9635. * @category Collection
  9636. * @param {Array|Object} collection The collection to inspect.
  9637. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9638. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9639. * @returns {*} Returns the matched element, else `undefined`.
  9640. * @example
  9641. *
  9642. * _.findLast([1, 2, 3, 4], function(n) {
  9643. * return n % 2 == 1;
  9644. * });
  9645. * // => 3
  9646. */
  9647. var findLast = createFind(findLastIndex);
  9648. /**
  9649. * Creates a flattened array of values by running each element in `collection`
  9650. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9651. * with three arguments: (value, index|key, collection).
  9652. *
  9653. * @static
  9654. * @memberOf _
  9655. * @since 4.0.0
  9656. * @category Collection
  9657. * @param {Array|Object} collection The collection to iterate over.
  9658. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9659. * @returns {Array} Returns the new flattened array.
  9660. * @example
  9661. *
  9662. * function duplicate(n) {
  9663. * return [n, n];
  9664. * }
  9665. *
  9666. * _.flatMap([1, 2], duplicate);
  9667. * // => [1, 1, 2, 2]
  9668. */
  9669. function flatMap(collection, iteratee) {
  9670. return baseFlatten(map(collection, iteratee), 1);
  9671. }
  9672. /**
  9673. * This method is like `_.flatMap` except that it recursively flattens the
  9674. * mapped results.
  9675. *
  9676. * @static
  9677. * @memberOf _
  9678. * @since 4.7.0
  9679. * @category Collection
  9680. * @param {Array|Object} collection The collection to iterate over.
  9681. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9682. * @returns {Array} Returns the new flattened array.
  9683. * @example
  9684. *
  9685. * function duplicate(n) {
  9686. * return [[[n, n]]];
  9687. * }
  9688. *
  9689. * _.flatMapDeep([1, 2], duplicate);
  9690. * // => [1, 1, 2, 2]
  9691. */
  9692. function flatMapDeep(collection, iteratee) {
  9693. return baseFlatten(map(collection, iteratee), INFINITY);
  9694. }
  9695. /**
  9696. * This method is like `_.flatMap` except that it recursively flattens the
  9697. * mapped results up to `depth` times.
  9698. *
  9699. * @static
  9700. * @memberOf _
  9701. * @since 4.7.0
  9702. * @category Collection
  9703. * @param {Array|Object} collection The collection to iterate over.
  9704. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9705. * @param {number} [depth=1] The maximum recursion depth.
  9706. * @returns {Array} Returns the new flattened array.
  9707. * @example
  9708. *
  9709. * function duplicate(n) {
  9710. * return [[[n, n]]];
  9711. * }
  9712. *
  9713. * _.flatMapDepth([1, 2], duplicate, 2);
  9714. * // => [[1, 1], [2, 2]]
  9715. */
  9716. function flatMapDepth(collection, iteratee, depth) {
  9717. depth = depth === undefined ? 1 : toInteger(depth);
  9718. return baseFlatten(map(collection, iteratee), depth);
  9719. }
  9720. /**
  9721. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9722. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9723. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9724. *
  9725. * **Note:** As with other "Collections" methods, objects with a "length"
  9726. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9727. * or `_.forOwn` for object iteration.
  9728. *
  9729. * @static
  9730. * @memberOf _
  9731. * @since 0.1.0
  9732. * @alias each
  9733. * @category Collection
  9734. * @param {Array|Object} collection The collection to iterate over.
  9735. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9736. * @returns {Array|Object} Returns `collection`.
  9737. * @see _.forEachRight
  9738. * @example
  9739. *
  9740. * _.forEach([1, 2], function(value) {
  9741. * console.log(value);
  9742. * });
  9743. * // => Logs `1` then `2`.
  9744. *
  9745. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9746. * console.log(key);
  9747. * });
  9748. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9749. */
  9750. function forEach(collection, iteratee) {
  9751. var func = isArray(collection) ? arrayEach : baseEach;
  9752. return func(collection, getIteratee(iteratee, 3));
  9753. }
  9754. /**
  9755. * This method is like `_.forEach` except that it iterates over elements of
  9756. * `collection` from right to left.
  9757. *
  9758. * @static
  9759. * @memberOf _
  9760. * @since 2.0.0
  9761. * @alias eachRight
  9762. * @category Collection
  9763. * @param {Array|Object} collection The collection to iterate over.
  9764. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9765. * @returns {Array|Object} Returns `collection`.
  9766. * @see _.forEach
  9767. * @example
  9768. *
  9769. * _.forEachRight([1, 2], function(value) {
  9770. * console.log(value);
  9771. * });
  9772. * // => Logs `2` then `1`.
  9773. */
  9774. function forEachRight(collection, iteratee) {
  9775. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9776. return func(collection, getIteratee(iteratee, 3));
  9777. }
  9778. /**
  9779. * Creates an object composed of keys generated from the results of running
  9780. * each element of `collection` thru `iteratee`. The order of grouped values
  9781. * is determined by the order they occur in `collection`. The corresponding
  9782. * value of each key is an array of elements responsible for generating the
  9783. * key. The iteratee is invoked with one argument: (value).
  9784. *
  9785. * @static
  9786. * @memberOf _
  9787. * @since 0.1.0
  9788. * @category Collection
  9789. * @param {Array|Object} collection The collection to iterate over.
  9790. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9791. * @returns {Object} Returns the composed aggregate object.
  9792. * @example
  9793. *
  9794. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9795. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9796. *
  9797. * // The `_.property` iteratee shorthand.
  9798. * _.groupBy(['one', 'two', 'three'], 'length');
  9799. * // => { '3': ['one', 'two'], '5': ['three'] }
  9800. */
  9801. var groupBy = createAggregator(function(result, value, key) {
  9802. if (hasOwnProperty.call(result, key)) {
  9803. result[key].push(value);
  9804. } else {
  9805. baseAssignValue(result, key, [value]);
  9806. }
  9807. });
  9808. /**
  9809. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9810. * checked for a substring of `value`, otherwise
  9811. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9812. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9813. * the offset from the end of `collection`.
  9814. *
  9815. * @static
  9816. * @memberOf _
  9817. * @since 0.1.0
  9818. * @category Collection
  9819. * @param {Array|Object|string} collection The collection to inspect.
  9820. * @param {*} value The value to search for.
  9821. * @param {number} [fromIndex=0] The index to search from.
  9822. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9823. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9824. * @example
  9825. *
  9826. * _.includes([1, 2, 3], 1);
  9827. * // => true
  9828. *
  9829. * _.includes([1, 2, 3], 1, 2);
  9830. * // => false
  9831. *
  9832. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9833. * // => true
  9834. *
  9835. * _.includes('abcd', 'bc');
  9836. * // => true
  9837. */
  9838. function includes(collection, value, fromIndex, guard) {
  9839. collection = isArrayLike(collection) ? collection : values(collection);
  9840. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9841. var length = collection.length;
  9842. if (fromIndex < 0) {
  9843. fromIndex = nativeMax(length + fromIndex, 0);
  9844. }
  9845. return isString(collection)
  9846. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9847. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9848. }
  9849. /**
  9850. * Invokes the method at `path` of each element in `collection`, returning
  9851. * an array of the results of each invoked method. Any additional arguments
  9852. * are provided to each invoked method. If `path` is a function, it's invoked
  9853. * for, and `this` bound to, each element in `collection`.
  9854. *
  9855. * @static
  9856. * @memberOf _
  9857. * @since 4.0.0
  9858. * @category Collection
  9859. * @param {Array|Object} collection The collection to iterate over.
  9860. * @param {Array|Function|string} path The path of the method to invoke or
  9861. * the function invoked per iteration.
  9862. * @param {...*} [args] The arguments to invoke each method with.
  9863. * @returns {Array} Returns the array of results.
  9864. * @example
  9865. *
  9866. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9867. * // => [[1, 5, 7], [1, 2, 3]]
  9868. *
  9869. * _.invokeMap([123, 456], String.prototype.split, '');
  9870. * // => [['1', '2', '3'], ['4', '5', '6']]
  9871. */
  9872. var invokeMap = baseRest(function(collection, path, args) {
  9873. var index = -1,
  9874. isFunc = typeof path == 'function',
  9875. result = isArrayLike(collection) ? Array(collection.length) : [];
  9876. baseEach(collection, function(value) {
  9877. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  9878. });
  9879. return result;
  9880. });
  9881. /**
  9882. * Creates an object composed of keys generated from the results of running
  9883. * each element of `collection` thru `iteratee`. The corresponding value of
  9884. * each key is the last element responsible for generating the key. The
  9885. * iteratee is invoked with one argument: (value).
  9886. *
  9887. * @static
  9888. * @memberOf _
  9889. * @since 4.0.0
  9890. * @category Collection
  9891. * @param {Array|Object} collection The collection to iterate over.
  9892. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9893. * @returns {Object} Returns the composed aggregate object.
  9894. * @example
  9895. *
  9896. * var array = [
  9897. * { 'dir': 'left', 'code': 97 },
  9898. * { 'dir': 'right', 'code': 100 }
  9899. * ];
  9900. *
  9901. * _.keyBy(array, function(o) {
  9902. * return String.fromCharCode(o.code);
  9903. * });
  9904. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  9905. *
  9906. * _.keyBy(array, 'dir');
  9907. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  9908. */
  9909. var keyBy = createAggregator(function(result, value, key) {
  9910. baseAssignValue(result, key, value);
  9911. });
  9912. /**
  9913. * Creates an array of values by running each element in `collection` thru
  9914. * `iteratee`. The iteratee is invoked with three arguments:
  9915. * (value, index|key, collection).
  9916. *
  9917. * Many lodash methods are guarded to work as iteratees for methods like
  9918. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  9919. *
  9920. * The guarded methods are:
  9921. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  9922. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  9923. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  9924. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  9925. *
  9926. * @static
  9927. * @memberOf _
  9928. * @since 0.1.0
  9929. * @category Collection
  9930. * @param {Array|Object} collection The collection to iterate over.
  9931. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9932. * @returns {Array} Returns the new mapped array.
  9933. * @example
  9934. *
  9935. * function square(n) {
  9936. * return n * n;
  9937. * }
  9938. *
  9939. * _.map([4, 8], square);
  9940. * // => [16, 64]
  9941. *
  9942. * _.map({ 'a': 4, 'b': 8 }, square);
  9943. * // => [16, 64] (iteration order is not guaranteed)
  9944. *
  9945. * var users = [
  9946. * { 'user': 'barney' },
  9947. * { 'user': 'fred' }
  9948. * ];
  9949. *
  9950. * // The `_.property` iteratee shorthand.
  9951. * _.map(users, 'user');
  9952. * // => ['barney', 'fred']
  9953. */
  9954. function map(collection, iteratee) {
  9955. var func = isArray(collection) ? arrayMap : baseMap;
  9956. return func(collection, getIteratee(iteratee, 3));
  9957. }
  9958. /**
  9959. * This method is like `_.sortBy` except that it allows specifying the sort
  9960. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  9961. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  9962. * descending or "asc" for ascending sort order of corresponding values.
  9963. *
  9964. * @static
  9965. * @memberOf _
  9966. * @since 4.0.0
  9967. * @category Collection
  9968. * @param {Array|Object} collection The collection to iterate over.
  9969. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  9970. * The iteratees to sort by.
  9971. * @param {string[]} [orders] The sort orders of `iteratees`.
  9972. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9973. * @returns {Array} Returns the new sorted array.
  9974. * @example
  9975. *
  9976. * var users = [
  9977. * { 'user': 'fred', 'age': 48 },
  9978. * { 'user': 'barney', 'age': 34 },
  9979. * { 'user': 'fred', 'age': 40 },
  9980. * { 'user': 'barney', 'age': 36 }
  9981. * ];
  9982. *
  9983. * // Sort by `user` in ascending order and by `age` in descending order.
  9984. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  9985. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  9986. */
  9987. function orderBy(collection, iteratees, orders, guard) {
  9988. if (collection == null) {
  9989. return [];
  9990. }
  9991. if (!isArray(iteratees)) {
  9992. iteratees = iteratees == null ? [] : [iteratees];
  9993. }
  9994. orders = guard ? undefined : orders;
  9995. if (!isArray(orders)) {
  9996. orders = orders == null ? [] : [orders];
  9997. }
  9998. return baseOrderBy(collection, iteratees, orders);
  9999. }
  10000. /**
  10001. * Creates an array of elements split into two groups, the first of which
  10002. * contains elements `predicate` returns truthy for, the second of which
  10003. * contains elements `predicate` returns falsey for. The predicate is
  10004. * invoked with one argument: (value).
  10005. *
  10006. * @static
  10007. * @memberOf _
  10008. * @since 3.0.0
  10009. * @category Collection
  10010. * @param {Array|Object} collection The collection to iterate over.
  10011. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10012. * @returns {Array} Returns the array of grouped elements.
  10013. * @example
  10014. *
  10015. * var users = [
  10016. * { 'user': 'barney', 'age': 36, 'active': false },
  10017. * { 'user': 'fred', 'age': 40, 'active': true },
  10018. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10019. * ];
  10020. *
  10021. * _.partition(users, function(o) { return o.active; });
  10022. * // => objects for [['fred'], ['barney', 'pebbles']]
  10023. *
  10024. * // The `_.matches` iteratee shorthand.
  10025. * _.partition(users, { 'age': 1, 'active': false });
  10026. * // => objects for [['pebbles'], ['barney', 'fred']]
  10027. *
  10028. * // The `_.matchesProperty` iteratee shorthand.
  10029. * _.partition(users, ['active', false]);
  10030. * // => objects for [['barney', 'pebbles'], ['fred']]
  10031. *
  10032. * // The `_.property` iteratee shorthand.
  10033. * _.partition(users, 'active');
  10034. * // => objects for [['fred'], ['barney', 'pebbles']]
  10035. */
  10036. var partition = createAggregator(function(result, value, key) {
  10037. result[key ? 0 : 1].push(value);
  10038. }, function() { return [[], []]; });
  10039. /**
  10040. * Reduces `collection` to a value which is the accumulated result of running
  10041. * each element in `collection` thru `iteratee`, where each successive
  10042. * invocation is supplied the return value of the previous. If `accumulator`
  10043. * is not given, the first element of `collection` is used as the initial
  10044. * value. The iteratee is invoked with four arguments:
  10045. * (accumulator, value, index|key, collection).
  10046. *
  10047. * Many lodash methods are guarded to work as iteratees for methods like
  10048. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10049. *
  10050. * The guarded methods are:
  10051. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10052. * and `sortBy`
  10053. *
  10054. * @static
  10055. * @memberOf _
  10056. * @since 0.1.0
  10057. * @category Collection
  10058. * @param {Array|Object} collection The collection to iterate over.
  10059. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10060. * @param {*} [accumulator] The initial value.
  10061. * @returns {*} Returns the accumulated value.
  10062. * @see _.reduceRight
  10063. * @example
  10064. *
  10065. * _.reduce([1, 2], function(sum, n) {
  10066. * return sum + n;
  10067. * }, 0);
  10068. * // => 3
  10069. *
  10070. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10071. * (result[value] || (result[value] = [])).push(key);
  10072. * return result;
  10073. * }, {});
  10074. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10075. */
  10076. function reduce(collection, iteratee, accumulator) {
  10077. var func = isArray(collection) ? arrayReduce : baseReduce,
  10078. initAccum = arguments.length < 3;
  10079. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10080. }
  10081. /**
  10082. * This method is like `_.reduce` except that it iterates over elements of
  10083. * `collection` from right to left.
  10084. *
  10085. * @static
  10086. * @memberOf _
  10087. * @since 0.1.0
  10088. * @category Collection
  10089. * @param {Array|Object} collection The collection to iterate over.
  10090. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10091. * @param {*} [accumulator] The initial value.
  10092. * @returns {*} Returns the accumulated value.
  10093. * @see _.reduce
  10094. * @example
  10095. *
  10096. * var array = [[0, 1], [2, 3], [4, 5]];
  10097. *
  10098. * _.reduceRight(array, function(flattened, other) {
  10099. * return flattened.concat(other);
  10100. * }, []);
  10101. * // => [4, 5, 2, 3, 0, 1]
  10102. */
  10103. function reduceRight(collection, iteratee, accumulator) {
  10104. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10105. initAccum = arguments.length < 3;
  10106. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10107. }
  10108. /**
  10109. * The opposite of `_.filter`; this method returns the elements of `collection`
  10110. * that `predicate` does **not** return truthy for.
  10111. *
  10112. * @static
  10113. * @memberOf _
  10114. * @since 0.1.0
  10115. * @category Collection
  10116. * @param {Array|Object} collection The collection to iterate over.
  10117. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10118. * @returns {Array} Returns the new filtered array.
  10119. * @see _.filter
  10120. * @example
  10121. *
  10122. * var users = [
  10123. * { 'user': 'barney', 'age': 36, 'active': false },
  10124. * { 'user': 'fred', 'age': 40, 'active': true }
  10125. * ];
  10126. *
  10127. * _.reject(users, function(o) { return !o.active; });
  10128. * // => objects for ['fred']
  10129. *
  10130. * // The `_.matches` iteratee shorthand.
  10131. * _.reject(users, { 'age': 40, 'active': true });
  10132. * // => objects for ['barney']
  10133. *
  10134. * // The `_.matchesProperty` iteratee shorthand.
  10135. * _.reject(users, ['active', false]);
  10136. * // => objects for ['fred']
  10137. *
  10138. * // The `_.property` iteratee shorthand.
  10139. * _.reject(users, 'active');
  10140. * // => objects for ['barney']
  10141. */
  10142. function reject(collection, predicate) {
  10143. var func = isArray(collection) ? arrayFilter : baseFilter;
  10144. return func(collection, negate(getIteratee(predicate, 3)));
  10145. }
  10146. /**
  10147. * Gets a random element from `collection`.
  10148. *
  10149. * @static
  10150. * @memberOf _
  10151. * @since 2.0.0
  10152. * @category Collection
  10153. * @param {Array|Object} collection The collection to sample.
  10154. * @returns {*} Returns the random element.
  10155. * @example
  10156. *
  10157. * _.sample([1, 2, 3, 4]);
  10158. * // => 2
  10159. */
  10160. function sample(collection) {
  10161. var func = isArray(collection) ? arraySample : baseSample;
  10162. return func(collection);
  10163. }
  10164. /**
  10165. * Gets `n` random elements at unique keys from `collection` up to the
  10166. * size of `collection`.
  10167. *
  10168. * @static
  10169. * @memberOf _
  10170. * @since 4.0.0
  10171. * @category Collection
  10172. * @param {Array|Object} collection The collection to sample.
  10173. * @param {number} [n=1] The number of elements to sample.
  10174. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10175. * @returns {Array} Returns the random elements.
  10176. * @example
  10177. *
  10178. * _.sampleSize([1, 2, 3], 2);
  10179. * // => [3, 1]
  10180. *
  10181. * _.sampleSize([1, 2, 3], 4);
  10182. * // => [2, 3, 1]
  10183. */
  10184. function sampleSize(collection, n, guard) {
  10185. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10186. n = 1;
  10187. } else {
  10188. n = toInteger(n);
  10189. }
  10190. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10191. return func(collection, n);
  10192. }
  10193. /**
  10194. * Creates an array of shuffled values, using a version of the
  10195. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10196. *
  10197. * @static
  10198. * @memberOf _
  10199. * @since 0.1.0
  10200. * @category Collection
  10201. * @param {Array|Object} collection The collection to shuffle.
  10202. * @returns {Array} Returns the new shuffled array.
  10203. * @example
  10204. *
  10205. * _.shuffle([1, 2, 3, 4]);
  10206. * // => [4, 1, 3, 2]
  10207. */
  10208. function shuffle(collection) {
  10209. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10210. return func(collection);
  10211. }
  10212. /**
  10213. * Gets the size of `collection` by returning its length for array-like
  10214. * values or the number of own enumerable string keyed properties for objects.
  10215. *
  10216. * @static
  10217. * @memberOf _
  10218. * @since 0.1.0
  10219. * @category Collection
  10220. * @param {Array|Object|string} collection The collection to inspect.
  10221. * @returns {number} Returns the collection size.
  10222. * @example
  10223. *
  10224. * _.size([1, 2, 3]);
  10225. * // => 3
  10226. *
  10227. * _.size({ 'a': 1, 'b': 2 });
  10228. * // => 2
  10229. *
  10230. * _.size('pebbles');
  10231. * // => 7
  10232. */
  10233. function size(collection) {
  10234. if (collection == null) {
  10235. return 0;
  10236. }
  10237. if (isArrayLike(collection)) {
  10238. return isString(collection) ? stringSize(collection) : collection.length;
  10239. }
  10240. var tag = getTag(collection);
  10241. if (tag == mapTag || tag == setTag) {
  10242. return collection.size;
  10243. }
  10244. return baseKeys(collection).length;
  10245. }
  10246. /**
  10247. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10248. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10249. * invoked with three arguments: (value, index|key, collection).
  10250. *
  10251. * @static
  10252. * @memberOf _
  10253. * @since 0.1.0
  10254. * @category Collection
  10255. * @param {Array|Object} collection The collection to iterate over.
  10256. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10257. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10258. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10259. * else `false`.
  10260. * @example
  10261. *
  10262. * _.some([null, 0, 'yes', false], Boolean);
  10263. * // => true
  10264. *
  10265. * var users = [
  10266. * { 'user': 'barney', 'active': true },
  10267. * { 'user': 'fred', 'active': false }
  10268. * ];
  10269. *
  10270. * // The `_.matches` iteratee shorthand.
  10271. * _.some(users, { 'user': 'barney', 'active': false });
  10272. * // => false
  10273. *
  10274. * // The `_.matchesProperty` iteratee shorthand.
  10275. * _.some(users, ['active', false]);
  10276. * // => true
  10277. *
  10278. * // The `_.property` iteratee shorthand.
  10279. * _.some(users, 'active');
  10280. * // => true
  10281. */
  10282. function some(collection, predicate, guard) {
  10283. var func = isArray(collection) ? arraySome : baseSome;
  10284. if (guard && isIterateeCall(collection, predicate, guard)) {
  10285. predicate = undefined;
  10286. }
  10287. return func(collection, getIteratee(predicate, 3));
  10288. }
  10289. /**
  10290. * Creates an array of elements, sorted in ascending order by the results of
  10291. * running each element in a collection thru each iteratee. This method
  10292. * performs a stable sort, that is, it preserves the original sort order of
  10293. * equal elements. The iteratees are invoked with one argument: (value).
  10294. *
  10295. * @static
  10296. * @memberOf _
  10297. * @since 0.1.0
  10298. * @category Collection
  10299. * @param {Array|Object} collection The collection to iterate over.
  10300. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10301. * The iteratees to sort by.
  10302. * @returns {Array} Returns the new sorted array.
  10303. * @example
  10304. *
  10305. * var users = [
  10306. * { 'user': 'fred', 'age': 48 },
  10307. * { 'user': 'barney', 'age': 36 },
  10308. * { 'user': 'fred', 'age': 30 },
  10309. * { 'user': 'barney', 'age': 34 }
  10310. * ];
  10311. *
  10312. * _.sortBy(users, [function(o) { return o.user; }]);
  10313. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10314. *
  10315. * _.sortBy(users, ['user', 'age']);
  10316. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10317. */
  10318. var sortBy = baseRest(function(collection, iteratees) {
  10319. if (collection == null) {
  10320. return [];
  10321. }
  10322. var length = iteratees.length;
  10323. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10324. iteratees = [];
  10325. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10326. iteratees = [iteratees[0]];
  10327. }
  10328. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10329. });
  10330. /*------------------------------------------------------------------------*/
  10331. /**
  10332. * Gets the timestamp of the number of milliseconds that have elapsed since
  10333. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10334. *
  10335. * @static
  10336. * @memberOf _
  10337. * @since 2.4.0
  10338. * @category Date
  10339. * @returns {number} Returns the timestamp.
  10340. * @example
  10341. *
  10342. * _.defer(function(stamp) {
  10343. * console.log(_.now() - stamp);
  10344. * }, _.now());
  10345. * // => Logs the number of milliseconds it took for the deferred invocation.
  10346. */
  10347. var now = ctxNow || function() {
  10348. return root.Date.now();
  10349. };
  10350. /*------------------------------------------------------------------------*/
  10351. /**
  10352. * The opposite of `_.before`; this method creates a function that invokes
  10353. * `func` once it's called `n` or more times.
  10354. *
  10355. * @static
  10356. * @memberOf _
  10357. * @since 0.1.0
  10358. * @category Function
  10359. * @param {number} n The number of calls before `func` is invoked.
  10360. * @param {Function} func The function to restrict.
  10361. * @returns {Function} Returns the new restricted function.
  10362. * @example
  10363. *
  10364. * var saves = ['profile', 'settings'];
  10365. *
  10366. * var done = _.after(saves.length, function() {
  10367. * console.log('done saving!');
  10368. * });
  10369. *
  10370. * _.forEach(saves, function(type) {
  10371. * asyncSave({ 'type': type, 'complete': done });
  10372. * });
  10373. * // => Logs 'done saving!' after the two async saves have completed.
  10374. */
  10375. function after(n, func) {
  10376. if (typeof func != 'function') {
  10377. throw new TypeError(FUNC_ERROR_TEXT);
  10378. }
  10379. n = toInteger(n);
  10380. return function() {
  10381. if (--n < 1) {
  10382. return func.apply(this, arguments);
  10383. }
  10384. };
  10385. }
  10386. /**
  10387. * Creates a function that invokes `func`, with up to `n` arguments,
  10388. * ignoring any additional arguments.
  10389. *
  10390. * @static
  10391. * @memberOf _
  10392. * @since 3.0.0
  10393. * @category Function
  10394. * @param {Function} func The function to cap arguments for.
  10395. * @param {number} [n=func.length] The arity cap.
  10396. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10397. * @returns {Function} Returns the new capped function.
  10398. * @example
  10399. *
  10400. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10401. * // => [6, 8, 10]
  10402. */
  10403. function ary(func, n, guard) {
  10404. n = guard ? undefined : n;
  10405. n = (func && n == null) ? func.length : n;
  10406. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10407. }
  10408. /**
  10409. * Creates a function that invokes `func`, with the `this` binding and arguments
  10410. * of the created function, while it's called less than `n` times. Subsequent
  10411. * calls to the created function return the result of the last `func` invocation.
  10412. *
  10413. * @static
  10414. * @memberOf _
  10415. * @since 3.0.0
  10416. * @category Function
  10417. * @param {number} n The number of calls at which `func` is no longer invoked.
  10418. * @param {Function} func The function to restrict.
  10419. * @returns {Function} Returns the new restricted function.
  10420. * @example
  10421. *
  10422. * jQuery(element).on('click', _.before(5, addContactToList));
  10423. * // => Allows adding up to 4 contacts to the list.
  10424. */
  10425. function before(n, func) {
  10426. var result;
  10427. if (typeof func != 'function') {
  10428. throw new TypeError(FUNC_ERROR_TEXT);
  10429. }
  10430. n = toInteger(n);
  10431. return function() {
  10432. if (--n > 0) {
  10433. result = func.apply(this, arguments);
  10434. }
  10435. if (n <= 1) {
  10436. func = undefined;
  10437. }
  10438. return result;
  10439. };
  10440. }
  10441. /**
  10442. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10443. * and `partials` prepended to the arguments it receives.
  10444. *
  10445. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10446. * may be used as a placeholder for partially applied arguments.
  10447. *
  10448. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10449. * property of bound functions.
  10450. *
  10451. * @static
  10452. * @memberOf _
  10453. * @since 0.1.0
  10454. * @category Function
  10455. * @param {Function} func The function to bind.
  10456. * @param {*} thisArg The `this` binding of `func`.
  10457. * @param {...*} [partials] The arguments to be partially applied.
  10458. * @returns {Function} Returns the new bound function.
  10459. * @example
  10460. *
  10461. * function greet(greeting, punctuation) {
  10462. * return greeting + ' ' + this.user + punctuation;
  10463. * }
  10464. *
  10465. * var object = { 'user': 'fred' };
  10466. *
  10467. * var bound = _.bind(greet, object, 'hi');
  10468. * bound('!');
  10469. * // => 'hi fred!'
  10470. *
  10471. * // Bound with placeholders.
  10472. * var bound = _.bind(greet, object, _, '!');
  10473. * bound('hi');
  10474. * // => 'hi fred!'
  10475. */
  10476. var bind = baseRest(function(func, thisArg, partials) {
  10477. var bitmask = WRAP_BIND_FLAG;
  10478. if (partials.length) {
  10479. var holders = replaceHolders(partials, getHolder(bind));
  10480. bitmask |= WRAP_PARTIAL_FLAG;
  10481. }
  10482. return createWrap(func, bitmask, thisArg, partials, holders);
  10483. });
  10484. /**
  10485. * Creates a function that invokes the method at `object[key]` with `partials`
  10486. * prepended to the arguments it receives.
  10487. *
  10488. * This method differs from `_.bind` by allowing bound functions to reference
  10489. * methods that may be redefined or don't yet exist. See
  10490. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10491. * for more details.
  10492. *
  10493. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10494. * builds, may be used as a placeholder for partially applied arguments.
  10495. *
  10496. * @static
  10497. * @memberOf _
  10498. * @since 0.10.0
  10499. * @category Function
  10500. * @param {Object} object The object to invoke the method on.
  10501. * @param {string} key The key of the method.
  10502. * @param {...*} [partials] The arguments to be partially applied.
  10503. * @returns {Function} Returns the new bound function.
  10504. * @example
  10505. *
  10506. * var object = {
  10507. * 'user': 'fred',
  10508. * 'greet': function(greeting, punctuation) {
  10509. * return greeting + ' ' + this.user + punctuation;
  10510. * }
  10511. * };
  10512. *
  10513. * var bound = _.bindKey(object, 'greet', 'hi');
  10514. * bound('!');
  10515. * // => 'hi fred!'
  10516. *
  10517. * object.greet = function(greeting, punctuation) {
  10518. * return greeting + 'ya ' + this.user + punctuation;
  10519. * };
  10520. *
  10521. * bound('!');
  10522. * // => 'hiya fred!'
  10523. *
  10524. * // Bound with placeholders.
  10525. * var bound = _.bindKey(object, 'greet', _, '!');
  10526. * bound('hi');
  10527. * // => 'hiya fred!'
  10528. */
  10529. var bindKey = baseRest(function(object, key, partials) {
  10530. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10531. if (partials.length) {
  10532. var holders = replaceHolders(partials, getHolder(bindKey));
  10533. bitmask |= WRAP_PARTIAL_FLAG;
  10534. }
  10535. return createWrap(key, bitmask, object, partials, holders);
  10536. });
  10537. /**
  10538. * Creates a function that accepts arguments of `func` and either invokes
  10539. * `func` returning its result, if at least `arity` number of arguments have
  10540. * been provided, or returns a function that accepts the remaining `func`
  10541. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10542. * is not sufficient.
  10543. *
  10544. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10545. * may be used as a placeholder for provided arguments.
  10546. *
  10547. * **Note:** This method doesn't set the "length" property of curried functions.
  10548. *
  10549. * @static
  10550. * @memberOf _
  10551. * @since 2.0.0
  10552. * @category Function
  10553. * @param {Function} func The function to curry.
  10554. * @param {number} [arity=func.length] The arity of `func`.
  10555. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10556. * @returns {Function} Returns the new curried function.
  10557. * @example
  10558. *
  10559. * var abc = function(a, b, c) {
  10560. * return [a, b, c];
  10561. * };
  10562. *
  10563. * var curried = _.curry(abc);
  10564. *
  10565. * curried(1)(2)(3);
  10566. * // => [1, 2, 3]
  10567. *
  10568. * curried(1, 2)(3);
  10569. * // => [1, 2, 3]
  10570. *
  10571. * curried(1, 2, 3);
  10572. * // => [1, 2, 3]
  10573. *
  10574. * // Curried with placeholders.
  10575. * curried(1)(_, 3)(2);
  10576. * // => [1, 2, 3]
  10577. */
  10578. function curry(func, arity, guard) {
  10579. arity = guard ? undefined : arity;
  10580. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10581. result.placeholder = curry.placeholder;
  10582. return result;
  10583. }
  10584. /**
  10585. * This method is like `_.curry` except that arguments are applied to `func`
  10586. * in the manner of `_.partialRight` instead of `_.partial`.
  10587. *
  10588. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10589. * builds, may be used as a placeholder for provided arguments.
  10590. *
  10591. * **Note:** This method doesn't set the "length" property of curried functions.
  10592. *
  10593. * @static
  10594. * @memberOf _
  10595. * @since 3.0.0
  10596. * @category Function
  10597. * @param {Function} func The function to curry.
  10598. * @param {number} [arity=func.length] The arity of `func`.
  10599. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10600. * @returns {Function} Returns the new curried function.
  10601. * @example
  10602. *
  10603. * var abc = function(a, b, c) {
  10604. * return [a, b, c];
  10605. * };
  10606. *
  10607. * var curried = _.curryRight(abc);
  10608. *
  10609. * curried(3)(2)(1);
  10610. * // => [1, 2, 3]
  10611. *
  10612. * curried(2, 3)(1);
  10613. * // => [1, 2, 3]
  10614. *
  10615. * curried(1, 2, 3);
  10616. * // => [1, 2, 3]
  10617. *
  10618. * // Curried with placeholders.
  10619. * curried(3)(1, _)(2);
  10620. * // => [1, 2, 3]
  10621. */
  10622. function curryRight(func, arity, guard) {
  10623. arity = guard ? undefined : arity;
  10624. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10625. result.placeholder = curryRight.placeholder;
  10626. return result;
  10627. }
  10628. /**
  10629. * Creates a debounced function that delays invoking `func` until after `wait`
  10630. * milliseconds have elapsed since the last time the debounced function was
  10631. * invoked. The debounced function comes with a `cancel` method to cancel
  10632. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10633. * Provide `options` to indicate whether `func` should be invoked on the
  10634. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10635. * with the last arguments provided to the debounced function. Subsequent
  10636. * calls to the debounced function return the result of the last `func`
  10637. * invocation.
  10638. *
  10639. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10640. * invoked on the trailing edge of the timeout only if the debounced function
  10641. * is invoked more than once during the `wait` timeout.
  10642. *
  10643. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10644. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10645. *
  10646. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10647. * for details over the differences between `_.debounce` and `_.throttle`.
  10648. *
  10649. * @static
  10650. * @memberOf _
  10651. * @since 0.1.0
  10652. * @category Function
  10653. * @param {Function} func The function to debounce.
  10654. * @param {number} [wait=0] The number of milliseconds to delay.
  10655. * @param {Object} [options={}] The options object.
  10656. * @param {boolean} [options.leading=false]
  10657. * Specify invoking on the leading edge of the timeout.
  10658. * @param {number} [options.maxWait]
  10659. * The maximum time `func` is allowed to be delayed before it's invoked.
  10660. * @param {boolean} [options.trailing=true]
  10661. * Specify invoking on the trailing edge of the timeout.
  10662. * @returns {Function} Returns the new debounced function.
  10663. * @example
  10664. *
  10665. * // Avoid costly calculations while the window size is in flux.
  10666. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10667. *
  10668. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10669. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10670. * 'leading': true,
  10671. * 'trailing': false
  10672. * }));
  10673. *
  10674. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10675. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10676. * var source = new EventSource('/stream');
  10677. * jQuery(source).on('message', debounced);
  10678. *
  10679. * // Cancel the trailing debounced invocation.
  10680. * jQuery(window).on('popstate', debounced.cancel);
  10681. */
  10682. function debounce(func, wait, options) {
  10683. var lastArgs,
  10684. lastThis,
  10685. maxWait,
  10686. result,
  10687. timerId,
  10688. lastCallTime,
  10689. lastInvokeTime = 0,
  10690. leading = false,
  10691. maxing = false,
  10692. trailing = true;
  10693. if (typeof func != 'function') {
  10694. throw new TypeError(FUNC_ERROR_TEXT);
  10695. }
  10696. wait = toNumber(wait) || 0;
  10697. if (isObject(options)) {
  10698. leading = !!options.leading;
  10699. maxing = 'maxWait' in options;
  10700. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10701. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10702. }
  10703. function invokeFunc(time) {
  10704. var args = lastArgs,
  10705. thisArg = lastThis;
  10706. lastArgs = lastThis = undefined;
  10707. lastInvokeTime = time;
  10708. result = func.apply(thisArg, args);
  10709. return result;
  10710. }
  10711. function leadingEdge(time) {
  10712. // Reset any `maxWait` timer.
  10713. lastInvokeTime = time;
  10714. // Start the timer for the trailing edge.
  10715. timerId = setTimeout(timerExpired, wait);
  10716. // Invoke the leading edge.
  10717. return leading ? invokeFunc(time) : result;
  10718. }
  10719. function remainingWait(time) {
  10720. var timeSinceLastCall = time - lastCallTime,
  10721. timeSinceLastInvoke = time - lastInvokeTime,
  10722. timeWaiting = wait - timeSinceLastCall;
  10723. return maxing
  10724. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10725. : timeWaiting;
  10726. }
  10727. function shouldInvoke(time) {
  10728. var timeSinceLastCall = time - lastCallTime,
  10729. timeSinceLastInvoke = time - lastInvokeTime;
  10730. // Either this is the first call, activity has stopped and we're at the
  10731. // trailing edge, the system time has gone backwards and we're treating
  10732. // it as the trailing edge, or we've hit the `maxWait` limit.
  10733. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10734. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10735. }
  10736. function timerExpired() {
  10737. var time = now();
  10738. if (shouldInvoke(time)) {
  10739. return trailingEdge(time);
  10740. }
  10741. // Restart the timer.
  10742. timerId = setTimeout(timerExpired, remainingWait(time));
  10743. }
  10744. function trailingEdge(time) {
  10745. timerId = undefined;
  10746. // Only invoke if we have `lastArgs` which means `func` has been
  10747. // debounced at least once.
  10748. if (trailing && lastArgs) {
  10749. return invokeFunc(time);
  10750. }
  10751. lastArgs = lastThis = undefined;
  10752. return result;
  10753. }
  10754. function cancel() {
  10755. if (timerId !== undefined) {
  10756. clearTimeout(timerId);
  10757. }
  10758. lastInvokeTime = 0;
  10759. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10760. }
  10761. function flush() {
  10762. return timerId === undefined ? result : trailingEdge(now());
  10763. }
  10764. function debounced() {
  10765. var time = now(),
  10766. isInvoking = shouldInvoke(time);
  10767. lastArgs = arguments;
  10768. lastThis = this;
  10769. lastCallTime = time;
  10770. if (isInvoking) {
  10771. if (timerId === undefined) {
  10772. return leadingEdge(lastCallTime);
  10773. }
  10774. if (maxing) {
  10775. // Handle invocations in a tight loop.
  10776. clearTimeout(timerId);
  10777. timerId = setTimeout(timerExpired, wait);
  10778. return invokeFunc(lastCallTime);
  10779. }
  10780. }
  10781. if (timerId === undefined) {
  10782. timerId = setTimeout(timerExpired, wait);
  10783. }
  10784. return result;
  10785. }
  10786. debounced.cancel = cancel;
  10787. debounced.flush = flush;
  10788. return debounced;
  10789. }
  10790. /**
  10791. * Defers invoking the `func` until the current call stack has cleared. Any
  10792. * additional arguments are provided to `func` when it's invoked.
  10793. *
  10794. * @static
  10795. * @memberOf _
  10796. * @since 0.1.0
  10797. * @category Function
  10798. * @param {Function} func The function to defer.
  10799. * @param {...*} [args] The arguments to invoke `func` with.
  10800. * @returns {number} Returns the timer id.
  10801. * @example
  10802. *
  10803. * _.defer(function(text) {
  10804. * console.log(text);
  10805. * }, 'deferred');
  10806. * // => Logs 'deferred' after one millisecond.
  10807. */
  10808. var defer = baseRest(function(func, args) {
  10809. return baseDelay(func, 1, args);
  10810. });
  10811. /**
  10812. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10813. * provided to `func` when it's invoked.
  10814. *
  10815. * @static
  10816. * @memberOf _
  10817. * @since 0.1.0
  10818. * @category Function
  10819. * @param {Function} func The function to delay.
  10820. * @param {number} wait The number of milliseconds to delay invocation.
  10821. * @param {...*} [args] The arguments to invoke `func` with.
  10822. * @returns {number} Returns the timer id.
  10823. * @example
  10824. *
  10825. * _.delay(function(text) {
  10826. * console.log(text);
  10827. * }, 1000, 'later');
  10828. * // => Logs 'later' after one second.
  10829. */
  10830. var delay = baseRest(function(func, wait, args) {
  10831. return baseDelay(func, toNumber(wait) || 0, args);
  10832. });
  10833. /**
  10834. * Creates a function that invokes `func` with arguments reversed.
  10835. *
  10836. * @static
  10837. * @memberOf _
  10838. * @since 4.0.0
  10839. * @category Function
  10840. * @param {Function} func The function to flip arguments for.
  10841. * @returns {Function} Returns the new flipped function.
  10842. * @example
  10843. *
  10844. * var flipped = _.flip(function() {
  10845. * return _.toArray(arguments);
  10846. * });
  10847. *
  10848. * flipped('a', 'b', 'c', 'd');
  10849. * // => ['d', 'c', 'b', 'a']
  10850. */
  10851. function flip(func) {
  10852. return createWrap(func, WRAP_FLIP_FLAG);
  10853. }
  10854. /**
  10855. * Creates a function that memoizes the result of `func`. If `resolver` is
  10856. * provided, it determines the cache key for storing the result based on the
  10857. * arguments provided to the memoized function. By default, the first argument
  10858. * provided to the memoized function is used as the map cache key. The `func`
  10859. * is invoked with the `this` binding of the memoized function.
  10860. *
  10861. * **Note:** The cache is exposed as the `cache` property on the memoized
  10862. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10863. * constructor with one whose instances implement the
  10864. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10865. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10866. *
  10867. * @static
  10868. * @memberOf _
  10869. * @since 0.1.0
  10870. * @category Function
  10871. * @param {Function} func The function to have its output memoized.
  10872. * @param {Function} [resolver] The function to resolve the cache key.
  10873. * @returns {Function} Returns the new memoized function.
  10874. * @example
  10875. *
  10876. * var object = { 'a': 1, 'b': 2 };
  10877. * var other = { 'c': 3, 'd': 4 };
  10878. *
  10879. * var values = _.memoize(_.values);
  10880. * values(object);
  10881. * // => [1, 2]
  10882. *
  10883. * values(other);
  10884. * // => [3, 4]
  10885. *
  10886. * object.a = 2;
  10887. * values(object);
  10888. * // => [1, 2]
  10889. *
  10890. * // Modify the result cache.
  10891. * values.cache.set(object, ['a', 'b']);
  10892. * values(object);
  10893. * // => ['a', 'b']
  10894. *
  10895. * // Replace `_.memoize.Cache`.
  10896. * _.memoize.Cache = WeakMap;
  10897. */
  10898. function memoize(func, resolver) {
  10899. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  10900. throw new TypeError(FUNC_ERROR_TEXT);
  10901. }
  10902. var memoized = function() {
  10903. var args = arguments,
  10904. key = resolver ? resolver.apply(this, args) : args[0],
  10905. cache = memoized.cache;
  10906. if (cache.has(key)) {
  10907. return cache.get(key);
  10908. }
  10909. var result = func.apply(this, args);
  10910. memoized.cache = cache.set(key, result) || cache;
  10911. return result;
  10912. };
  10913. memoized.cache = new (memoize.Cache || MapCache);
  10914. return memoized;
  10915. }
  10916. // Expose `MapCache`.
  10917. memoize.Cache = MapCache;
  10918. /**
  10919. * Creates a function that negates the result of the predicate `func`. The
  10920. * `func` predicate is invoked with the `this` binding and arguments of the
  10921. * created function.
  10922. *
  10923. * @static
  10924. * @memberOf _
  10925. * @since 3.0.0
  10926. * @category Function
  10927. * @param {Function} predicate The predicate to negate.
  10928. * @returns {Function} Returns the new negated function.
  10929. * @example
  10930. *
  10931. * function isEven(n) {
  10932. * return n % 2 == 0;
  10933. * }
  10934. *
  10935. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  10936. * // => [1, 3, 5]
  10937. */
  10938. function negate(predicate) {
  10939. if (typeof predicate != 'function') {
  10940. throw new TypeError(FUNC_ERROR_TEXT);
  10941. }
  10942. return function() {
  10943. var args = arguments;
  10944. switch (args.length) {
  10945. case 0: return !predicate.call(this);
  10946. case 1: return !predicate.call(this, args[0]);
  10947. case 2: return !predicate.call(this, args[0], args[1]);
  10948. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  10949. }
  10950. return !predicate.apply(this, args);
  10951. };
  10952. }
  10953. /**
  10954. * Creates a function that is restricted to invoking `func` once. Repeat calls
  10955. * to the function return the value of the first invocation. The `func` is
  10956. * invoked with the `this` binding and arguments of the created function.
  10957. *
  10958. * @static
  10959. * @memberOf _
  10960. * @since 0.1.0
  10961. * @category Function
  10962. * @param {Function} func The function to restrict.
  10963. * @returns {Function} Returns the new restricted function.
  10964. * @example
  10965. *
  10966. * var initialize = _.once(createApplication);
  10967. * initialize();
  10968. * initialize();
  10969. * // => `createApplication` is invoked once
  10970. */
  10971. function once(func) {
  10972. return before(2, func);
  10973. }
  10974. /**
  10975. * Creates a function that invokes `func` with its arguments transformed.
  10976. *
  10977. * @static
  10978. * @since 4.0.0
  10979. * @memberOf _
  10980. * @category Function
  10981. * @param {Function} func The function to wrap.
  10982. * @param {...(Function|Function[])} [transforms=[_.identity]]
  10983. * The argument transforms.
  10984. * @returns {Function} Returns the new function.
  10985. * @example
  10986. *
  10987. * function doubled(n) {
  10988. * return n * 2;
  10989. * }
  10990. *
  10991. * function square(n) {
  10992. * return n * n;
  10993. * }
  10994. *
  10995. * var func = _.overArgs(function(x, y) {
  10996. * return [x, y];
  10997. * }, [square, doubled]);
  10998. *
  10999. * func(9, 3);
  11000. * // => [81, 6]
  11001. *
  11002. * func(10, 5);
  11003. * // => [100, 10]
  11004. */
  11005. var overArgs = castRest(function(func, transforms) {
  11006. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11007. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11008. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11009. var funcsLength = transforms.length;
  11010. return baseRest(function(args) {
  11011. var index = -1,
  11012. length = nativeMin(args.length, funcsLength);
  11013. while (++index < length) {
  11014. args[index] = transforms[index].call(this, args[index]);
  11015. }
  11016. return apply(func, this, args);
  11017. });
  11018. });
  11019. /**
  11020. * Creates a function that invokes `func` with `partials` prepended to the
  11021. * arguments it receives. This method is like `_.bind` except it does **not**
  11022. * alter the `this` binding.
  11023. *
  11024. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11025. * builds, may be used as a placeholder for partially applied arguments.
  11026. *
  11027. * **Note:** This method doesn't set the "length" property of partially
  11028. * applied functions.
  11029. *
  11030. * @static
  11031. * @memberOf _
  11032. * @since 0.2.0
  11033. * @category Function
  11034. * @param {Function} func The function to partially apply arguments to.
  11035. * @param {...*} [partials] The arguments to be partially applied.
  11036. * @returns {Function} Returns the new partially applied function.
  11037. * @example
  11038. *
  11039. * function greet(greeting, name) {
  11040. * return greeting + ' ' + name;
  11041. * }
  11042. *
  11043. * var sayHelloTo = _.partial(greet, 'hello');
  11044. * sayHelloTo('fred');
  11045. * // => 'hello fred'
  11046. *
  11047. * // Partially applied with placeholders.
  11048. * var greetFred = _.partial(greet, _, 'fred');
  11049. * greetFred('hi');
  11050. * // => 'hi fred'
  11051. */
  11052. var partial = baseRest(function(func, partials) {
  11053. var holders = replaceHolders(partials, getHolder(partial));
  11054. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11055. });
  11056. /**
  11057. * This method is like `_.partial` except that partially applied arguments
  11058. * are appended to the arguments it receives.
  11059. *
  11060. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11061. * builds, may be used as a placeholder for partially applied arguments.
  11062. *
  11063. * **Note:** This method doesn't set the "length" property of partially
  11064. * applied functions.
  11065. *
  11066. * @static
  11067. * @memberOf _
  11068. * @since 1.0.0
  11069. * @category Function
  11070. * @param {Function} func The function to partially apply arguments to.
  11071. * @param {...*} [partials] The arguments to be partially applied.
  11072. * @returns {Function} Returns the new partially applied function.
  11073. * @example
  11074. *
  11075. * function greet(greeting, name) {
  11076. * return greeting + ' ' + name;
  11077. * }
  11078. *
  11079. * var greetFred = _.partialRight(greet, 'fred');
  11080. * greetFred('hi');
  11081. * // => 'hi fred'
  11082. *
  11083. * // Partially applied with placeholders.
  11084. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11085. * sayHelloTo('fred');
  11086. * // => 'hello fred'
  11087. */
  11088. var partialRight = baseRest(function(func, partials) {
  11089. var holders = replaceHolders(partials, getHolder(partialRight));
  11090. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11091. });
  11092. /**
  11093. * Creates a function that invokes `func` with arguments arranged according
  11094. * to the specified `indexes` where the argument value at the first index is
  11095. * provided as the first argument, the argument value at the second index is
  11096. * provided as the second argument, and so on.
  11097. *
  11098. * @static
  11099. * @memberOf _
  11100. * @since 3.0.0
  11101. * @category Function
  11102. * @param {Function} func The function to rearrange arguments for.
  11103. * @param {...(number|number[])} indexes The arranged argument indexes.
  11104. * @returns {Function} Returns the new function.
  11105. * @example
  11106. *
  11107. * var rearged = _.rearg(function(a, b, c) {
  11108. * return [a, b, c];
  11109. * }, [2, 0, 1]);
  11110. *
  11111. * rearged('b', 'c', 'a')
  11112. * // => ['a', 'b', 'c']
  11113. */
  11114. var rearg = flatRest(function(func, indexes) {
  11115. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11116. });
  11117. /**
  11118. * Creates a function that invokes `func` with the `this` binding of the
  11119. * created function and arguments from `start` and beyond provided as
  11120. * an array.
  11121. *
  11122. * **Note:** This method is based on the
  11123. * [rest parameter](https://mdn.io/rest_parameters).
  11124. *
  11125. * @static
  11126. * @memberOf _
  11127. * @since 4.0.0
  11128. * @category Function
  11129. * @param {Function} func The function to apply a rest parameter to.
  11130. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11131. * @returns {Function} Returns the new function.
  11132. * @example
  11133. *
  11134. * var say = _.rest(function(what, names) {
  11135. * return what + ' ' + _.initial(names).join(', ') +
  11136. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11137. * });
  11138. *
  11139. * say('hello', 'fred', 'barney', 'pebbles');
  11140. * // => 'hello fred, barney, & pebbles'
  11141. */
  11142. function rest(func, start) {
  11143. if (typeof func != 'function') {
  11144. throw new TypeError(FUNC_ERROR_TEXT);
  11145. }
  11146. start = start === undefined ? start : toInteger(start);
  11147. return baseRest(func, start);
  11148. }
  11149. /**
  11150. * Creates a function that invokes `func` with the `this` binding of the
  11151. * create function and an array of arguments much like
  11152. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11153. *
  11154. * **Note:** This method is based on the
  11155. * [spread operator](https://mdn.io/spread_operator).
  11156. *
  11157. * @static
  11158. * @memberOf _
  11159. * @since 3.2.0
  11160. * @category Function
  11161. * @param {Function} func The function to spread arguments over.
  11162. * @param {number} [start=0] The start position of the spread.
  11163. * @returns {Function} Returns the new function.
  11164. * @example
  11165. *
  11166. * var say = _.spread(function(who, what) {
  11167. * return who + ' says ' + what;
  11168. * });
  11169. *
  11170. * say(['fred', 'hello']);
  11171. * // => 'fred says hello'
  11172. *
  11173. * var numbers = Promise.all([
  11174. * Promise.resolve(40),
  11175. * Promise.resolve(36)
  11176. * ]);
  11177. *
  11178. * numbers.then(_.spread(function(x, y) {
  11179. * return x + y;
  11180. * }));
  11181. * // => a Promise of 76
  11182. */
  11183. function spread(func, start) {
  11184. if (typeof func != 'function') {
  11185. throw new TypeError(FUNC_ERROR_TEXT);
  11186. }
  11187. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11188. return baseRest(function(args) {
  11189. var array = args[start],
  11190. otherArgs = castSlice(args, 0, start);
  11191. if (array) {
  11192. arrayPush(otherArgs, array);
  11193. }
  11194. return apply(func, this, otherArgs);
  11195. });
  11196. }
  11197. /**
  11198. * Creates a throttled function that only invokes `func` at most once per
  11199. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11200. * method to cancel delayed `func` invocations and a `flush` method to
  11201. * immediately invoke them. Provide `options` to indicate whether `func`
  11202. * should be invoked on the leading and/or trailing edge of the `wait`
  11203. * timeout. The `func` is invoked with the last arguments provided to the
  11204. * throttled function. Subsequent calls to the throttled function return the
  11205. * result of the last `func` invocation.
  11206. *
  11207. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11208. * invoked on the trailing edge of the timeout only if the throttled function
  11209. * is invoked more than once during the `wait` timeout.
  11210. *
  11211. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11212. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11213. *
  11214. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11215. * for details over the differences between `_.throttle` and `_.debounce`.
  11216. *
  11217. * @static
  11218. * @memberOf _
  11219. * @since 0.1.0
  11220. * @category Function
  11221. * @param {Function} func The function to throttle.
  11222. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11223. * @param {Object} [options={}] The options object.
  11224. * @param {boolean} [options.leading=true]
  11225. * Specify invoking on the leading edge of the timeout.
  11226. * @param {boolean} [options.trailing=true]
  11227. * Specify invoking on the trailing edge of the timeout.
  11228. * @returns {Function} Returns the new throttled function.
  11229. * @example
  11230. *
  11231. * // Avoid excessively updating the position while scrolling.
  11232. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11233. *
  11234. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11235. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11236. * jQuery(element).on('click', throttled);
  11237. *
  11238. * // Cancel the trailing throttled invocation.
  11239. * jQuery(window).on('popstate', throttled.cancel);
  11240. */
  11241. function throttle(func, wait, options) {
  11242. var leading = true,
  11243. trailing = true;
  11244. if (typeof func != 'function') {
  11245. throw new TypeError(FUNC_ERROR_TEXT);
  11246. }
  11247. if (isObject(options)) {
  11248. leading = 'leading' in options ? !!options.leading : leading;
  11249. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11250. }
  11251. return debounce(func, wait, {
  11252. 'leading': leading,
  11253. 'maxWait': wait,
  11254. 'trailing': trailing
  11255. });
  11256. }
  11257. /**
  11258. * Creates a function that accepts up to one argument, ignoring any
  11259. * additional arguments.
  11260. *
  11261. * @static
  11262. * @memberOf _
  11263. * @since 4.0.0
  11264. * @category Function
  11265. * @param {Function} func The function to cap arguments for.
  11266. * @returns {Function} Returns the new capped function.
  11267. * @example
  11268. *
  11269. * _.map(['6', '8', '10'], _.unary(parseInt));
  11270. * // => [6, 8, 10]
  11271. */
  11272. function unary(func) {
  11273. return ary(func, 1);
  11274. }
  11275. /**
  11276. * Creates a function that provides `value` to `wrapper` as its first
  11277. * argument. Any additional arguments provided to the function are appended
  11278. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11279. * binding of the created function.
  11280. *
  11281. * @static
  11282. * @memberOf _
  11283. * @since 0.1.0
  11284. * @category Function
  11285. * @param {*} value The value to wrap.
  11286. * @param {Function} [wrapper=identity] The wrapper function.
  11287. * @returns {Function} Returns the new function.
  11288. * @example
  11289. *
  11290. * var p = _.wrap(_.escape, function(func, text) {
  11291. * return '<p>' + func(text) + '</p>';
  11292. * });
  11293. *
  11294. * p('fred, barney, & pebbles');
  11295. * // => '<p>fred, barney, &amp; pebbles</p>'
  11296. */
  11297. function wrap(value, wrapper) {
  11298. return partial(castFunction(wrapper), value);
  11299. }
  11300. /*------------------------------------------------------------------------*/
  11301. /**
  11302. * Casts `value` as an array if it's not one.
  11303. *
  11304. * @static
  11305. * @memberOf _
  11306. * @since 4.4.0
  11307. * @category Lang
  11308. * @param {*} value The value to inspect.
  11309. * @returns {Array} Returns the cast array.
  11310. * @example
  11311. *
  11312. * _.castArray(1);
  11313. * // => [1]
  11314. *
  11315. * _.castArray({ 'a': 1 });
  11316. * // => [{ 'a': 1 }]
  11317. *
  11318. * _.castArray('abc');
  11319. * // => ['abc']
  11320. *
  11321. * _.castArray(null);
  11322. * // => [null]
  11323. *
  11324. * _.castArray(undefined);
  11325. * // => [undefined]
  11326. *
  11327. * _.castArray();
  11328. * // => []
  11329. *
  11330. * var array = [1, 2, 3];
  11331. * console.log(_.castArray(array) === array);
  11332. * // => true
  11333. */
  11334. function castArray() {
  11335. if (!arguments.length) {
  11336. return [];
  11337. }
  11338. var value = arguments[0];
  11339. return isArray(value) ? value : [value];
  11340. }
  11341. /**
  11342. * Creates a shallow clone of `value`.
  11343. *
  11344. * **Note:** This method is loosely based on the
  11345. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11346. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11347. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11348. * arrays. The own enumerable properties of `arguments` objects are cloned
  11349. * as plain objects. An empty object is returned for uncloneable values such
  11350. * as error objects, functions, DOM nodes, and WeakMaps.
  11351. *
  11352. * @static
  11353. * @memberOf _
  11354. * @since 0.1.0
  11355. * @category Lang
  11356. * @param {*} value The value to clone.
  11357. * @returns {*} Returns the cloned value.
  11358. * @see _.cloneDeep
  11359. * @example
  11360. *
  11361. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11362. *
  11363. * var shallow = _.clone(objects);
  11364. * console.log(shallow[0] === objects[0]);
  11365. * // => true
  11366. */
  11367. function clone(value) {
  11368. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11369. }
  11370. /**
  11371. * This method is like `_.clone` except that it accepts `customizer` which
  11372. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11373. * cloning is handled by the method instead. The `customizer` is invoked with
  11374. * up to four arguments; (value [, index|key, object, stack]).
  11375. *
  11376. * @static
  11377. * @memberOf _
  11378. * @since 4.0.0
  11379. * @category Lang
  11380. * @param {*} value The value to clone.
  11381. * @param {Function} [customizer] The function to customize cloning.
  11382. * @returns {*} Returns the cloned value.
  11383. * @see _.cloneDeepWith
  11384. * @example
  11385. *
  11386. * function customizer(value) {
  11387. * if (_.isElement(value)) {
  11388. * return value.cloneNode(false);
  11389. * }
  11390. * }
  11391. *
  11392. * var el = _.cloneWith(document.body, customizer);
  11393. *
  11394. * console.log(el === document.body);
  11395. * // => false
  11396. * console.log(el.nodeName);
  11397. * // => 'BODY'
  11398. * console.log(el.childNodes.length);
  11399. * // => 0
  11400. */
  11401. function cloneWith(value, customizer) {
  11402. customizer = typeof customizer == 'function' ? customizer : undefined;
  11403. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11404. }
  11405. /**
  11406. * This method is like `_.clone` except that it recursively clones `value`.
  11407. *
  11408. * @static
  11409. * @memberOf _
  11410. * @since 1.0.0
  11411. * @category Lang
  11412. * @param {*} value The value to recursively clone.
  11413. * @returns {*} Returns the deep cloned value.
  11414. * @see _.clone
  11415. * @example
  11416. *
  11417. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11418. *
  11419. * var deep = _.cloneDeep(objects);
  11420. * console.log(deep[0] === objects[0]);
  11421. * // => false
  11422. */
  11423. function cloneDeep(value) {
  11424. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11425. }
  11426. /**
  11427. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11428. *
  11429. * @static
  11430. * @memberOf _
  11431. * @since 4.0.0
  11432. * @category Lang
  11433. * @param {*} value The value to recursively clone.
  11434. * @param {Function} [customizer] The function to customize cloning.
  11435. * @returns {*} Returns the deep cloned value.
  11436. * @see _.cloneWith
  11437. * @example
  11438. *
  11439. * function customizer(value) {
  11440. * if (_.isElement(value)) {
  11441. * return value.cloneNode(true);
  11442. * }
  11443. * }
  11444. *
  11445. * var el = _.cloneDeepWith(document.body, customizer);
  11446. *
  11447. * console.log(el === document.body);
  11448. * // => false
  11449. * console.log(el.nodeName);
  11450. * // => 'BODY'
  11451. * console.log(el.childNodes.length);
  11452. * // => 20
  11453. */
  11454. function cloneDeepWith(value, customizer) {
  11455. customizer = typeof customizer == 'function' ? customizer : undefined;
  11456. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11457. }
  11458. /**
  11459. * Checks if `object` conforms to `source` by invoking the predicate
  11460. * properties of `source` with the corresponding property values of `object`.
  11461. *
  11462. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11463. * partially applied.
  11464. *
  11465. * @static
  11466. * @memberOf _
  11467. * @since 4.14.0
  11468. * @category Lang
  11469. * @param {Object} object The object to inspect.
  11470. * @param {Object} source The object of property predicates to conform to.
  11471. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11472. * @example
  11473. *
  11474. * var object = { 'a': 1, 'b': 2 };
  11475. *
  11476. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11477. * // => true
  11478. *
  11479. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11480. * // => false
  11481. */
  11482. function conformsTo(object, source) {
  11483. return source == null || baseConformsTo(object, source, keys(source));
  11484. }
  11485. /**
  11486. * Performs a
  11487. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11488. * comparison between two values to determine if they are equivalent.
  11489. *
  11490. * @static
  11491. * @memberOf _
  11492. * @since 4.0.0
  11493. * @category Lang
  11494. * @param {*} value The value to compare.
  11495. * @param {*} other The other value to compare.
  11496. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11497. * @example
  11498. *
  11499. * var object = { 'a': 1 };
  11500. * var other = { 'a': 1 };
  11501. *
  11502. * _.eq(object, object);
  11503. * // => true
  11504. *
  11505. * _.eq(object, other);
  11506. * // => false
  11507. *
  11508. * _.eq('a', 'a');
  11509. * // => true
  11510. *
  11511. * _.eq('a', Object('a'));
  11512. * // => false
  11513. *
  11514. * _.eq(NaN, NaN);
  11515. * // => true
  11516. */
  11517. function eq(value, other) {
  11518. return value === other || (value !== value && other !== other);
  11519. }
  11520. /**
  11521. * Checks if `value` is greater than `other`.
  11522. *
  11523. * @static
  11524. * @memberOf _
  11525. * @since 3.9.0
  11526. * @category Lang
  11527. * @param {*} value The value to compare.
  11528. * @param {*} other The other value to compare.
  11529. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11530. * else `false`.
  11531. * @see _.lt
  11532. * @example
  11533. *
  11534. * _.gt(3, 1);
  11535. * // => true
  11536. *
  11537. * _.gt(3, 3);
  11538. * // => false
  11539. *
  11540. * _.gt(1, 3);
  11541. * // => false
  11542. */
  11543. var gt = createRelationalOperation(baseGt);
  11544. /**
  11545. * Checks if `value` is greater than or equal to `other`.
  11546. *
  11547. * @static
  11548. * @memberOf _
  11549. * @since 3.9.0
  11550. * @category Lang
  11551. * @param {*} value The value to compare.
  11552. * @param {*} other The other value to compare.
  11553. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11554. * `other`, else `false`.
  11555. * @see _.lte
  11556. * @example
  11557. *
  11558. * _.gte(3, 1);
  11559. * // => true
  11560. *
  11561. * _.gte(3, 3);
  11562. * // => true
  11563. *
  11564. * _.gte(1, 3);
  11565. * // => false
  11566. */
  11567. var gte = createRelationalOperation(function(value, other) {
  11568. return value >= other;
  11569. });
  11570. /**
  11571. * Checks if `value` is likely an `arguments` object.
  11572. *
  11573. * @static
  11574. * @memberOf _
  11575. * @since 0.1.0
  11576. * @category Lang
  11577. * @param {*} value The value to check.
  11578. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11579. * else `false`.
  11580. * @example
  11581. *
  11582. * _.isArguments(function() { return arguments; }());
  11583. * // => true
  11584. *
  11585. * _.isArguments([1, 2, 3]);
  11586. * // => false
  11587. */
  11588. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11589. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11590. !propertyIsEnumerable.call(value, 'callee');
  11591. };
  11592. /**
  11593. * Checks if `value` is classified as an `Array` object.
  11594. *
  11595. * @static
  11596. * @memberOf _
  11597. * @since 0.1.0
  11598. * @category Lang
  11599. * @param {*} value The value to check.
  11600. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11601. * @example
  11602. *
  11603. * _.isArray([1, 2, 3]);
  11604. * // => true
  11605. *
  11606. * _.isArray(document.body.children);
  11607. * // => false
  11608. *
  11609. * _.isArray('abc');
  11610. * // => false
  11611. *
  11612. * _.isArray(_.noop);
  11613. * // => false
  11614. */
  11615. var isArray = Array.isArray;
  11616. /**
  11617. * Checks if `value` is classified as an `ArrayBuffer` object.
  11618. *
  11619. * @static
  11620. * @memberOf _
  11621. * @since 4.3.0
  11622. * @category Lang
  11623. * @param {*} value The value to check.
  11624. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11625. * @example
  11626. *
  11627. * _.isArrayBuffer(new ArrayBuffer(2));
  11628. * // => true
  11629. *
  11630. * _.isArrayBuffer(new Array(2));
  11631. * // => false
  11632. */
  11633. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11634. /**
  11635. * Checks if `value` is array-like. A value is considered array-like if it's
  11636. * not a function and has a `value.length` that's an integer greater than or
  11637. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11638. *
  11639. * @static
  11640. * @memberOf _
  11641. * @since 4.0.0
  11642. * @category Lang
  11643. * @param {*} value The value to check.
  11644. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11645. * @example
  11646. *
  11647. * _.isArrayLike([1, 2, 3]);
  11648. * // => true
  11649. *
  11650. * _.isArrayLike(document.body.children);
  11651. * // => true
  11652. *
  11653. * _.isArrayLike('abc');
  11654. * // => true
  11655. *
  11656. * _.isArrayLike(_.noop);
  11657. * // => false
  11658. */
  11659. function isArrayLike(value) {
  11660. return value != null && isLength(value.length) && !isFunction(value);
  11661. }
  11662. /**
  11663. * This method is like `_.isArrayLike` except that it also checks if `value`
  11664. * is an object.
  11665. *
  11666. * @static
  11667. * @memberOf _
  11668. * @since 4.0.0
  11669. * @category Lang
  11670. * @param {*} value The value to check.
  11671. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11672. * else `false`.
  11673. * @example
  11674. *
  11675. * _.isArrayLikeObject([1, 2, 3]);
  11676. * // => true
  11677. *
  11678. * _.isArrayLikeObject(document.body.children);
  11679. * // => true
  11680. *
  11681. * _.isArrayLikeObject('abc');
  11682. * // => false
  11683. *
  11684. * _.isArrayLikeObject(_.noop);
  11685. * // => false
  11686. */
  11687. function isArrayLikeObject(value) {
  11688. return isObjectLike(value) && isArrayLike(value);
  11689. }
  11690. /**
  11691. * Checks if `value` is classified as a boolean primitive or object.
  11692. *
  11693. * @static
  11694. * @memberOf _
  11695. * @since 0.1.0
  11696. * @category Lang
  11697. * @param {*} value The value to check.
  11698. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11699. * @example
  11700. *
  11701. * _.isBoolean(false);
  11702. * // => true
  11703. *
  11704. * _.isBoolean(null);
  11705. * // => false
  11706. */
  11707. function isBoolean(value) {
  11708. return value === true || value === false ||
  11709. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11710. }
  11711. /**
  11712. * Checks if `value` is a buffer.
  11713. *
  11714. * @static
  11715. * @memberOf _
  11716. * @since 4.3.0
  11717. * @category Lang
  11718. * @param {*} value The value to check.
  11719. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11720. * @example
  11721. *
  11722. * _.isBuffer(new Buffer(2));
  11723. * // => true
  11724. *
  11725. * _.isBuffer(new Uint8Array(2));
  11726. * // => false
  11727. */
  11728. var isBuffer = nativeIsBuffer || stubFalse;
  11729. /**
  11730. * Checks if `value` is classified as a `Date` object.
  11731. *
  11732. * @static
  11733. * @memberOf _
  11734. * @since 0.1.0
  11735. * @category Lang
  11736. * @param {*} value The value to check.
  11737. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11738. * @example
  11739. *
  11740. * _.isDate(new Date);
  11741. * // => true
  11742. *
  11743. * _.isDate('Mon April 23 2012');
  11744. * // => false
  11745. */
  11746. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11747. /**
  11748. * Checks if `value` is likely a DOM element.
  11749. *
  11750. * @static
  11751. * @memberOf _
  11752. * @since 0.1.0
  11753. * @category Lang
  11754. * @param {*} value The value to check.
  11755. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11756. * @example
  11757. *
  11758. * _.isElement(document.body);
  11759. * // => true
  11760. *
  11761. * _.isElement('<body>');
  11762. * // => false
  11763. */
  11764. function isElement(value) {
  11765. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11766. }
  11767. /**
  11768. * Checks if `value` is an empty object, collection, map, or set.
  11769. *
  11770. * Objects are considered empty if they have no own enumerable string keyed
  11771. * properties.
  11772. *
  11773. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11774. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11775. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11776. *
  11777. * @static
  11778. * @memberOf _
  11779. * @since 0.1.0
  11780. * @category Lang
  11781. * @param {*} value The value to check.
  11782. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11783. * @example
  11784. *
  11785. * _.isEmpty(null);
  11786. * // => true
  11787. *
  11788. * _.isEmpty(true);
  11789. * // => true
  11790. *
  11791. * _.isEmpty(1);
  11792. * // => true
  11793. *
  11794. * _.isEmpty([1, 2, 3]);
  11795. * // => false
  11796. *
  11797. * _.isEmpty({ 'a': 1 });
  11798. * // => false
  11799. */
  11800. function isEmpty(value) {
  11801. if (value == null) {
  11802. return true;
  11803. }
  11804. if (isArrayLike(value) &&
  11805. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11806. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11807. return !value.length;
  11808. }
  11809. var tag = getTag(value);
  11810. if (tag == mapTag || tag == setTag) {
  11811. return !value.size;
  11812. }
  11813. if (isPrototype(value)) {
  11814. return !baseKeys(value).length;
  11815. }
  11816. for (var key in value) {
  11817. if (hasOwnProperty.call(value, key)) {
  11818. return false;
  11819. }
  11820. }
  11821. return true;
  11822. }
  11823. /**
  11824. * Performs a deep comparison between two values to determine if they are
  11825. * equivalent.
  11826. *
  11827. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11828. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11829. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11830. * by their own, not inherited, enumerable properties. Functions and DOM
  11831. * nodes are compared by strict equality, i.e. `===`.
  11832. *
  11833. * @static
  11834. * @memberOf _
  11835. * @since 0.1.0
  11836. * @category Lang
  11837. * @param {*} value The value to compare.
  11838. * @param {*} other The other value to compare.
  11839. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11840. * @example
  11841. *
  11842. * var object = { 'a': 1 };
  11843. * var other = { 'a': 1 };
  11844. *
  11845. * _.isEqual(object, other);
  11846. * // => true
  11847. *
  11848. * object === other;
  11849. * // => false
  11850. */
  11851. function isEqual(value, other) {
  11852. return baseIsEqual(value, other);
  11853. }
  11854. /**
  11855. * This method is like `_.isEqual` except that it accepts `customizer` which
  11856. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11857. * are handled by the method instead. The `customizer` is invoked with up to
  11858. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11859. *
  11860. * @static
  11861. * @memberOf _
  11862. * @since 4.0.0
  11863. * @category Lang
  11864. * @param {*} value The value to compare.
  11865. * @param {*} other The other value to compare.
  11866. * @param {Function} [customizer] The function to customize comparisons.
  11867. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11868. * @example
  11869. *
  11870. * function isGreeting(value) {
  11871. * return /^h(?:i|ello)$/.test(value);
  11872. * }
  11873. *
  11874. * function customizer(objValue, othValue) {
  11875. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11876. * return true;
  11877. * }
  11878. * }
  11879. *
  11880. * var array = ['hello', 'goodbye'];
  11881. * var other = ['hi', 'goodbye'];
  11882. *
  11883. * _.isEqualWith(array, other, customizer);
  11884. * // => true
  11885. */
  11886. function isEqualWith(value, other, customizer) {
  11887. customizer = typeof customizer == 'function' ? customizer : undefined;
  11888. var result = customizer ? customizer(value, other) : undefined;
  11889. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  11890. }
  11891. /**
  11892. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  11893. * `SyntaxError`, `TypeError`, or `URIError` object.
  11894. *
  11895. * @static
  11896. * @memberOf _
  11897. * @since 3.0.0
  11898. * @category Lang
  11899. * @param {*} value The value to check.
  11900. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  11901. * @example
  11902. *
  11903. * _.isError(new Error);
  11904. * // => true
  11905. *
  11906. * _.isError(Error);
  11907. * // => false
  11908. */
  11909. function isError(value) {
  11910. if (!isObjectLike(value)) {
  11911. return false;
  11912. }
  11913. var tag = baseGetTag(value);
  11914. return tag == errorTag || tag == domExcTag ||
  11915. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  11916. }
  11917. /**
  11918. * Checks if `value` is a finite primitive number.
  11919. *
  11920. * **Note:** This method is based on
  11921. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  11922. *
  11923. * @static
  11924. * @memberOf _
  11925. * @since 0.1.0
  11926. * @category Lang
  11927. * @param {*} value The value to check.
  11928. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  11929. * @example
  11930. *
  11931. * _.isFinite(3);
  11932. * // => true
  11933. *
  11934. * _.isFinite(Number.MIN_VALUE);
  11935. * // => true
  11936. *
  11937. * _.isFinite(Infinity);
  11938. * // => false
  11939. *
  11940. * _.isFinite('3');
  11941. * // => false
  11942. */
  11943. function isFinite(value) {
  11944. return typeof value == 'number' && nativeIsFinite(value);
  11945. }
  11946. /**
  11947. * Checks if `value` is classified as a `Function` object.
  11948. *
  11949. * @static
  11950. * @memberOf _
  11951. * @since 0.1.0
  11952. * @category Lang
  11953. * @param {*} value The value to check.
  11954. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  11955. * @example
  11956. *
  11957. * _.isFunction(_);
  11958. * // => true
  11959. *
  11960. * _.isFunction(/abc/);
  11961. * // => false
  11962. */
  11963. function isFunction(value) {
  11964. if (!isObject(value)) {
  11965. return false;
  11966. }
  11967. // The use of `Object#toString` avoids issues with the `typeof` operator
  11968. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  11969. var tag = baseGetTag(value);
  11970. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  11971. }
  11972. /**
  11973. * Checks if `value` is an integer.
  11974. *
  11975. * **Note:** This method is based on
  11976. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  11977. *
  11978. * @static
  11979. * @memberOf _
  11980. * @since 4.0.0
  11981. * @category Lang
  11982. * @param {*} value The value to check.
  11983. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  11984. * @example
  11985. *
  11986. * _.isInteger(3);
  11987. * // => true
  11988. *
  11989. * _.isInteger(Number.MIN_VALUE);
  11990. * // => false
  11991. *
  11992. * _.isInteger(Infinity);
  11993. * // => false
  11994. *
  11995. * _.isInteger('3');
  11996. * // => false
  11997. */
  11998. function isInteger(value) {
  11999. return typeof value == 'number' && value == toInteger(value);
  12000. }
  12001. /**
  12002. * Checks if `value` is a valid array-like length.
  12003. *
  12004. * **Note:** This method is loosely based on
  12005. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12006. *
  12007. * @static
  12008. * @memberOf _
  12009. * @since 4.0.0
  12010. * @category Lang
  12011. * @param {*} value The value to check.
  12012. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12013. * @example
  12014. *
  12015. * _.isLength(3);
  12016. * // => true
  12017. *
  12018. * _.isLength(Number.MIN_VALUE);
  12019. * // => false
  12020. *
  12021. * _.isLength(Infinity);
  12022. * // => false
  12023. *
  12024. * _.isLength('3');
  12025. * // => false
  12026. */
  12027. function isLength(value) {
  12028. return typeof value == 'number' &&
  12029. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12030. }
  12031. /**
  12032. * Checks if `value` is the
  12033. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12034. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12035. *
  12036. * @static
  12037. * @memberOf _
  12038. * @since 0.1.0
  12039. * @category Lang
  12040. * @param {*} value The value to check.
  12041. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12042. * @example
  12043. *
  12044. * _.isObject({});
  12045. * // => true
  12046. *
  12047. * _.isObject([1, 2, 3]);
  12048. * // => true
  12049. *
  12050. * _.isObject(_.noop);
  12051. * // => true
  12052. *
  12053. * _.isObject(null);
  12054. * // => false
  12055. */
  12056. function isObject(value) {
  12057. var type = typeof value;
  12058. return value != null && (type == 'object' || type == 'function');
  12059. }
  12060. /**
  12061. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12062. * and has a `typeof` result of "object".
  12063. *
  12064. * @static
  12065. * @memberOf _
  12066. * @since 4.0.0
  12067. * @category Lang
  12068. * @param {*} value The value to check.
  12069. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12070. * @example
  12071. *
  12072. * _.isObjectLike({});
  12073. * // => true
  12074. *
  12075. * _.isObjectLike([1, 2, 3]);
  12076. * // => true
  12077. *
  12078. * _.isObjectLike(_.noop);
  12079. * // => false
  12080. *
  12081. * _.isObjectLike(null);
  12082. * // => false
  12083. */
  12084. function isObjectLike(value) {
  12085. return value != null && typeof value == 'object';
  12086. }
  12087. /**
  12088. * Checks if `value` is classified as a `Map` object.
  12089. *
  12090. * @static
  12091. * @memberOf _
  12092. * @since 4.3.0
  12093. * @category Lang
  12094. * @param {*} value The value to check.
  12095. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12096. * @example
  12097. *
  12098. * _.isMap(new Map);
  12099. * // => true
  12100. *
  12101. * _.isMap(new WeakMap);
  12102. * // => false
  12103. */
  12104. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12105. /**
  12106. * Performs a partial deep comparison between `object` and `source` to
  12107. * determine if `object` contains equivalent property values.
  12108. *
  12109. * **Note:** This method is equivalent to `_.matches` when `source` is
  12110. * partially applied.
  12111. *
  12112. * Partial comparisons will match empty array and empty object `source`
  12113. * values against any array or object value, respectively. See `_.isEqual`
  12114. * for a list of supported value comparisons.
  12115. *
  12116. * @static
  12117. * @memberOf _
  12118. * @since 3.0.0
  12119. * @category Lang
  12120. * @param {Object} object The object to inspect.
  12121. * @param {Object} source The object of property values to match.
  12122. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12123. * @example
  12124. *
  12125. * var object = { 'a': 1, 'b': 2 };
  12126. *
  12127. * _.isMatch(object, { 'b': 2 });
  12128. * // => true
  12129. *
  12130. * _.isMatch(object, { 'b': 1 });
  12131. * // => false
  12132. */
  12133. function isMatch(object, source) {
  12134. return object === source || baseIsMatch(object, source, getMatchData(source));
  12135. }
  12136. /**
  12137. * This method is like `_.isMatch` except that it accepts `customizer` which
  12138. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12139. * are handled by the method instead. The `customizer` is invoked with five
  12140. * arguments: (objValue, srcValue, index|key, object, source).
  12141. *
  12142. * @static
  12143. * @memberOf _
  12144. * @since 4.0.0
  12145. * @category Lang
  12146. * @param {Object} object The object to inspect.
  12147. * @param {Object} source The object of property values to match.
  12148. * @param {Function} [customizer] The function to customize comparisons.
  12149. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12150. * @example
  12151. *
  12152. * function isGreeting(value) {
  12153. * return /^h(?:i|ello)$/.test(value);
  12154. * }
  12155. *
  12156. * function customizer(objValue, srcValue) {
  12157. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12158. * return true;
  12159. * }
  12160. * }
  12161. *
  12162. * var object = { 'greeting': 'hello' };
  12163. * var source = { 'greeting': 'hi' };
  12164. *
  12165. * _.isMatchWith(object, source, customizer);
  12166. * // => true
  12167. */
  12168. function isMatchWith(object, source, customizer) {
  12169. customizer = typeof customizer == 'function' ? customizer : undefined;
  12170. return baseIsMatch(object, source, getMatchData(source), customizer);
  12171. }
  12172. /**
  12173. * Checks if `value` is `NaN`.
  12174. *
  12175. * **Note:** This method is based on
  12176. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12177. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12178. * `undefined` and other non-number values.
  12179. *
  12180. * @static
  12181. * @memberOf _
  12182. * @since 0.1.0
  12183. * @category Lang
  12184. * @param {*} value The value to check.
  12185. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12186. * @example
  12187. *
  12188. * _.isNaN(NaN);
  12189. * // => true
  12190. *
  12191. * _.isNaN(new Number(NaN));
  12192. * // => true
  12193. *
  12194. * isNaN(undefined);
  12195. * // => true
  12196. *
  12197. * _.isNaN(undefined);
  12198. * // => false
  12199. */
  12200. function isNaN(value) {
  12201. // An `NaN` primitive is the only value that is not equal to itself.
  12202. // Perform the `toStringTag` check first to avoid errors with some
  12203. // ActiveX objects in IE.
  12204. return isNumber(value) && value != +value;
  12205. }
  12206. /**
  12207. * Checks if `value` is a pristine native function.
  12208. *
  12209. * **Note:** This method can't reliably detect native functions in the presence
  12210. * of the core-js package because core-js circumvents this kind of detection.
  12211. * Despite multiple requests, the core-js maintainer has made it clear: any
  12212. * attempt to fix the detection will be obstructed. As a result, we're left
  12213. * with little choice but to throw an error. Unfortunately, this also affects
  12214. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12215. * which rely on core-js.
  12216. *
  12217. * @static
  12218. * @memberOf _
  12219. * @since 3.0.0
  12220. * @category Lang
  12221. * @param {*} value The value to check.
  12222. * @returns {boolean} Returns `true` if `value` is a native function,
  12223. * else `false`.
  12224. * @example
  12225. *
  12226. * _.isNative(Array.prototype.push);
  12227. * // => true
  12228. *
  12229. * _.isNative(_);
  12230. * // => false
  12231. */
  12232. function isNative(value) {
  12233. if (isMaskable(value)) {
  12234. throw new Error(CORE_ERROR_TEXT);
  12235. }
  12236. return baseIsNative(value);
  12237. }
  12238. /**
  12239. * Checks if `value` is `null`.
  12240. *
  12241. * @static
  12242. * @memberOf _
  12243. * @since 0.1.0
  12244. * @category Lang
  12245. * @param {*} value The value to check.
  12246. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12247. * @example
  12248. *
  12249. * _.isNull(null);
  12250. * // => true
  12251. *
  12252. * _.isNull(void 0);
  12253. * // => false
  12254. */
  12255. function isNull(value) {
  12256. return value === null;
  12257. }
  12258. /**
  12259. * Checks if `value` is `null` or `undefined`.
  12260. *
  12261. * @static
  12262. * @memberOf _
  12263. * @since 4.0.0
  12264. * @category Lang
  12265. * @param {*} value The value to check.
  12266. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12267. * @example
  12268. *
  12269. * _.isNil(null);
  12270. * // => true
  12271. *
  12272. * _.isNil(void 0);
  12273. * // => true
  12274. *
  12275. * _.isNil(NaN);
  12276. * // => false
  12277. */
  12278. function isNil(value) {
  12279. return value == null;
  12280. }
  12281. /**
  12282. * Checks if `value` is classified as a `Number` primitive or object.
  12283. *
  12284. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12285. * classified as numbers, use the `_.isFinite` method.
  12286. *
  12287. * @static
  12288. * @memberOf _
  12289. * @since 0.1.0
  12290. * @category Lang
  12291. * @param {*} value The value to check.
  12292. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12293. * @example
  12294. *
  12295. * _.isNumber(3);
  12296. * // => true
  12297. *
  12298. * _.isNumber(Number.MIN_VALUE);
  12299. * // => true
  12300. *
  12301. * _.isNumber(Infinity);
  12302. * // => true
  12303. *
  12304. * _.isNumber('3');
  12305. * // => false
  12306. */
  12307. function isNumber(value) {
  12308. return typeof value == 'number' ||
  12309. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12310. }
  12311. /**
  12312. * Checks if `value` is a plain object, that is, an object created by the
  12313. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12314. *
  12315. * @static
  12316. * @memberOf _
  12317. * @since 0.8.0
  12318. * @category Lang
  12319. * @param {*} value The value to check.
  12320. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12321. * @example
  12322. *
  12323. * function Foo() {
  12324. * this.a = 1;
  12325. * }
  12326. *
  12327. * _.isPlainObject(new Foo);
  12328. * // => false
  12329. *
  12330. * _.isPlainObject([1, 2, 3]);
  12331. * // => false
  12332. *
  12333. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12334. * // => true
  12335. *
  12336. * _.isPlainObject(Object.create(null));
  12337. * // => true
  12338. */
  12339. function isPlainObject(value) {
  12340. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12341. return false;
  12342. }
  12343. var proto = getPrototype(value);
  12344. if (proto === null) {
  12345. return true;
  12346. }
  12347. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12348. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12349. funcToString.call(Ctor) == objectCtorString;
  12350. }
  12351. /**
  12352. * Checks if `value` is classified as a `RegExp` object.
  12353. *
  12354. * @static
  12355. * @memberOf _
  12356. * @since 0.1.0
  12357. * @category Lang
  12358. * @param {*} value The value to check.
  12359. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12360. * @example
  12361. *
  12362. * _.isRegExp(/abc/);
  12363. * // => true
  12364. *
  12365. * _.isRegExp('/abc/');
  12366. * // => false
  12367. */
  12368. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12369. /**
  12370. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12371. * double precision number which isn't the result of a rounded unsafe integer.
  12372. *
  12373. * **Note:** This method is based on
  12374. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12375. *
  12376. * @static
  12377. * @memberOf _
  12378. * @since 4.0.0
  12379. * @category Lang
  12380. * @param {*} value The value to check.
  12381. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12382. * @example
  12383. *
  12384. * _.isSafeInteger(3);
  12385. * // => true
  12386. *
  12387. * _.isSafeInteger(Number.MIN_VALUE);
  12388. * // => false
  12389. *
  12390. * _.isSafeInteger(Infinity);
  12391. * // => false
  12392. *
  12393. * _.isSafeInteger('3');
  12394. * // => false
  12395. */
  12396. function isSafeInteger(value) {
  12397. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12398. }
  12399. /**
  12400. * Checks if `value` is classified as a `Set` object.
  12401. *
  12402. * @static
  12403. * @memberOf _
  12404. * @since 4.3.0
  12405. * @category Lang
  12406. * @param {*} value The value to check.
  12407. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12408. * @example
  12409. *
  12410. * _.isSet(new Set);
  12411. * // => true
  12412. *
  12413. * _.isSet(new WeakSet);
  12414. * // => false
  12415. */
  12416. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12417. /**
  12418. * Checks if `value` is classified as a `String` primitive or object.
  12419. *
  12420. * @static
  12421. * @since 0.1.0
  12422. * @memberOf _
  12423. * @category Lang
  12424. * @param {*} value The value to check.
  12425. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12426. * @example
  12427. *
  12428. * _.isString('abc');
  12429. * // => true
  12430. *
  12431. * _.isString(1);
  12432. * // => false
  12433. */
  12434. function isString(value) {
  12435. return typeof value == 'string' ||
  12436. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12437. }
  12438. /**
  12439. * Checks if `value` is classified as a `Symbol` primitive or object.
  12440. *
  12441. * @static
  12442. * @memberOf _
  12443. * @since 4.0.0
  12444. * @category Lang
  12445. * @param {*} value The value to check.
  12446. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12447. * @example
  12448. *
  12449. * _.isSymbol(Symbol.iterator);
  12450. * // => true
  12451. *
  12452. * _.isSymbol('abc');
  12453. * // => false
  12454. */
  12455. function isSymbol(value) {
  12456. return typeof value == 'symbol' ||
  12457. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12458. }
  12459. /**
  12460. * Checks if `value` is classified as a typed array.
  12461. *
  12462. * @static
  12463. * @memberOf _
  12464. * @since 3.0.0
  12465. * @category Lang
  12466. * @param {*} value The value to check.
  12467. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12468. * @example
  12469. *
  12470. * _.isTypedArray(new Uint8Array);
  12471. * // => true
  12472. *
  12473. * _.isTypedArray([]);
  12474. * // => false
  12475. */
  12476. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12477. /**
  12478. * Checks if `value` is `undefined`.
  12479. *
  12480. * @static
  12481. * @since 0.1.0
  12482. * @memberOf _
  12483. * @category Lang
  12484. * @param {*} value The value to check.
  12485. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12486. * @example
  12487. *
  12488. * _.isUndefined(void 0);
  12489. * // => true
  12490. *
  12491. * _.isUndefined(null);
  12492. * // => false
  12493. */
  12494. function isUndefined(value) {
  12495. return value === undefined;
  12496. }
  12497. /**
  12498. * Checks if `value` is classified as a `WeakMap` object.
  12499. *
  12500. * @static
  12501. * @memberOf _
  12502. * @since 4.3.0
  12503. * @category Lang
  12504. * @param {*} value The value to check.
  12505. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12506. * @example
  12507. *
  12508. * _.isWeakMap(new WeakMap);
  12509. * // => true
  12510. *
  12511. * _.isWeakMap(new Map);
  12512. * // => false
  12513. */
  12514. function isWeakMap(value) {
  12515. return isObjectLike(value) && getTag(value) == weakMapTag;
  12516. }
  12517. /**
  12518. * Checks if `value` is classified as a `WeakSet` object.
  12519. *
  12520. * @static
  12521. * @memberOf _
  12522. * @since 4.3.0
  12523. * @category Lang
  12524. * @param {*} value The value to check.
  12525. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12526. * @example
  12527. *
  12528. * _.isWeakSet(new WeakSet);
  12529. * // => true
  12530. *
  12531. * _.isWeakSet(new Set);
  12532. * // => false
  12533. */
  12534. function isWeakSet(value) {
  12535. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12536. }
  12537. /**
  12538. * Checks if `value` is less than `other`.
  12539. *
  12540. * @static
  12541. * @memberOf _
  12542. * @since 3.9.0
  12543. * @category Lang
  12544. * @param {*} value The value to compare.
  12545. * @param {*} other The other value to compare.
  12546. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12547. * else `false`.
  12548. * @see _.gt
  12549. * @example
  12550. *
  12551. * _.lt(1, 3);
  12552. * // => true
  12553. *
  12554. * _.lt(3, 3);
  12555. * // => false
  12556. *
  12557. * _.lt(3, 1);
  12558. * // => false
  12559. */
  12560. var lt = createRelationalOperation(baseLt);
  12561. /**
  12562. * Checks if `value` is less than or equal to `other`.
  12563. *
  12564. * @static
  12565. * @memberOf _
  12566. * @since 3.9.0
  12567. * @category Lang
  12568. * @param {*} value The value to compare.
  12569. * @param {*} other The other value to compare.
  12570. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12571. * `other`, else `false`.
  12572. * @see _.gte
  12573. * @example
  12574. *
  12575. * _.lte(1, 3);
  12576. * // => true
  12577. *
  12578. * _.lte(3, 3);
  12579. * // => true
  12580. *
  12581. * _.lte(3, 1);
  12582. * // => false
  12583. */
  12584. var lte = createRelationalOperation(function(value, other) {
  12585. return value <= other;
  12586. });
  12587. /**
  12588. * Converts `value` to an array.
  12589. *
  12590. * @static
  12591. * @since 0.1.0
  12592. * @memberOf _
  12593. * @category Lang
  12594. * @param {*} value The value to convert.
  12595. * @returns {Array} Returns the converted array.
  12596. * @example
  12597. *
  12598. * _.toArray({ 'a': 1, 'b': 2 });
  12599. * // => [1, 2]
  12600. *
  12601. * _.toArray('abc');
  12602. * // => ['a', 'b', 'c']
  12603. *
  12604. * _.toArray(1);
  12605. * // => []
  12606. *
  12607. * _.toArray(null);
  12608. * // => []
  12609. */
  12610. function toArray(value) {
  12611. if (!value) {
  12612. return [];
  12613. }
  12614. if (isArrayLike(value)) {
  12615. return isString(value) ? stringToArray(value) : copyArray(value);
  12616. }
  12617. if (symIterator && value[symIterator]) {
  12618. return iteratorToArray(value[symIterator]());
  12619. }
  12620. var tag = getTag(value),
  12621. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12622. return func(value);
  12623. }
  12624. /**
  12625. * Converts `value` to a finite number.
  12626. *
  12627. * @static
  12628. * @memberOf _
  12629. * @since 4.12.0
  12630. * @category Lang
  12631. * @param {*} value The value to convert.
  12632. * @returns {number} Returns the converted number.
  12633. * @example
  12634. *
  12635. * _.toFinite(3.2);
  12636. * // => 3.2
  12637. *
  12638. * _.toFinite(Number.MIN_VALUE);
  12639. * // => 5e-324
  12640. *
  12641. * _.toFinite(Infinity);
  12642. * // => 1.7976931348623157e+308
  12643. *
  12644. * _.toFinite('3.2');
  12645. * // => 3.2
  12646. */
  12647. function toFinite(value) {
  12648. if (!value) {
  12649. return value === 0 ? value : 0;
  12650. }
  12651. value = toNumber(value);
  12652. if (value === INFINITY || value === -INFINITY) {
  12653. var sign = (value < 0 ? -1 : 1);
  12654. return sign * MAX_INTEGER;
  12655. }
  12656. return value === value ? value : 0;
  12657. }
  12658. /**
  12659. * Converts `value` to an integer.
  12660. *
  12661. * **Note:** This method is loosely based on
  12662. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12663. *
  12664. * @static
  12665. * @memberOf _
  12666. * @since 4.0.0
  12667. * @category Lang
  12668. * @param {*} value The value to convert.
  12669. * @returns {number} Returns the converted integer.
  12670. * @example
  12671. *
  12672. * _.toInteger(3.2);
  12673. * // => 3
  12674. *
  12675. * _.toInteger(Number.MIN_VALUE);
  12676. * // => 0
  12677. *
  12678. * _.toInteger(Infinity);
  12679. * // => 1.7976931348623157e+308
  12680. *
  12681. * _.toInteger('3.2');
  12682. * // => 3
  12683. */
  12684. function toInteger(value) {
  12685. var result = toFinite(value),
  12686. remainder = result % 1;
  12687. return result === result ? (remainder ? result - remainder : result) : 0;
  12688. }
  12689. /**
  12690. * Converts `value` to an integer suitable for use as the length of an
  12691. * array-like object.
  12692. *
  12693. * **Note:** This method is based on
  12694. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12695. *
  12696. * @static
  12697. * @memberOf _
  12698. * @since 4.0.0
  12699. * @category Lang
  12700. * @param {*} value The value to convert.
  12701. * @returns {number} Returns the converted integer.
  12702. * @example
  12703. *
  12704. * _.toLength(3.2);
  12705. * // => 3
  12706. *
  12707. * _.toLength(Number.MIN_VALUE);
  12708. * // => 0
  12709. *
  12710. * _.toLength(Infinity);
  12711. * // => 4294967295
  12712. *
  12713. * _.toLength('3.2');
  12714. * // => 3
  12715. */
  12716. function toLength(value) {
  12717. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12718. }
  12719. /**
  12720. * Converts `value` to a number.
  12721. *
  12722. * @static
  12723. * @memberOf _
  12724. * @since 4.0.0
  12725. * @category Lang
  12726. * @param {*} value The value to process.
  12727. * @returns {number} Returns the number.
  12728. * @example
  12729. *
  12730. * _.toNumber(3.2);
  12731. * // => 3.2
  12732. *
  12733. * _.toNumber(Number.MIN_VALUE);
  12734. * // => 5e-324
  12735. *
  12736. * _.toNumber(Infinity);
  12737. * // => Infinity
  12738. *
  12739. * _.toNumber('3.2');
  12740. * // => 3.2
  12741. */
  12742. function toNumber(value) {
  12743. if (typeof value == 'number') {
  12744. return value;
  12745. }
  12746. if (isSymbol(value)) {
  12747. return NAN;
  12748. }
  12749. if (isObject(value)) {
  12750. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12751. value = isObject(other) ? (other + '') : other;
  12752. }
  12753. if (typeof value != 'string') {
  12754. return value === 0 ? value : +value;
  12755. }
  12756. value = baseTrim(value);
  12757. var isBinary = reIsBinary.test(value);
  12758. return (isBinary || reIsOctal.test(value))
  12759. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12760. : (reIsBadHex.test(value) ? NAN : +value);
  12761. }
  12762. /**
  12763. * Converts `value` to a plain object flattening inherited enumerable string
  12764. * keyed properties of `value` to own properties of the plain object.
  12765. *
  12766. * @static
  12767. * @memberOf _
  12768. * @since 3.0.0
  12769. * @category Lang
  12770. * @param {*} value The value to convert.
  12771. * @returns {Object} Returns the converted plain object.
  12772. * @example
  12773. *
  12774. * function Foo() {
  12775. * this.b = 2;
  12776. * }
  12777. *
  12778. * Foo.prototype.c = 3;
  12779. *
  12780. * _.assign({ 'a': 1 }, new Foo);
  12781. * // => { 'a': 1, 'b': 2 }
  12782. *
  12783. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12784. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12785. */
  12786. function toPlainObject(value) {
  12787. return copyObject(value, keysIn(value));
  12788. }
  12789. /**
  12790. * Converts `value` to a safe integer. A safe integer can be compared and
  12791. * represented correctly.
  12792. *
  12793. * @static
  12794. * @memberOf _
  12795. * @since 4.0.0
  12796. * @category Lang
  12797. * @param {*} value The value to convert.
  12798. * @returns {number} Returns the converted integer.
  12799. * @example
  12800. *
  12801. * _.toSafeInteger(3.2);
  12802. * // => 3
  12803. *
  12804. * _.toSafeInteger(Number.MIN_VALUE);
  12805. * // => 0
  12806. *
  12807. * _.toSafeInteger(Infinity);
  12808. * // => 9007199254740991
  12809. *
  12810. * _.toSafeInteger('3.2');
  12811. * // => 3
  12812. */
  12813. function toSafeInteger(value) {
  12814. return value
  12815. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12816. : (value === 0 ? value : 0);
  12817. }
  12818. /**
  12819. * Converts `value` to a string. An empty string is returned for `null`
  12820. * and `undefined` values. The sign of `-0` is preserved.
  12821. *
  12822. * @static
  12823. * @memberOf _
  12824. * @since 4.0.0
  12825. * @category Lang
  12826. * @param {*} value The value to convert.
  12827. * @returns {string} Returns the converted string.
  12828. * @example
  12829. *
  12830. * _.toString(null);
  12831. * // => ''
  12832. *
  12833. * _.toString(-0);
  12834. * // => '-0'
  12835. *
  12836. * _.toString([1, 2, 3]);
  12837. * // => '1,2,3'
  12838. */
  12839. function toString(value) {
  12840. return value == null ? '' : baseToString(value);
  12841. }
  12842. /*------------------------------------------------------------------------*/
  12843. /**
  12844. * Assigns own enumerable string keyed properties of source objects to the
  12845. * destination object. Source objects are applied from left to right.
  12846. * Subsequent sources overwrite property assignments of previous sources.
  12847. *
  12848. * **Note:** This method mutates `object` and is loosely based on
  12849. * [`Object.assign`](https://mdn.io/Object/assign).
  12850. *
  12851. * @static
  12852. * @memberOf _
  12853. * @since 0.10.0
  12854. * @category Object
  12855. * @param {Object} object The destination object.
  12856. * @param {...Object} [sources] The source objects.
  12857. * @returns {Object} Returns `object`.
  12858. * @see _.assignIn
  12859. * @example
  12860. *
  12861. * function Foo() {
  12862. * this.a = 1;
  12863. * }
  12864. *
  12865. * function Bar() {
  12866. * this.c = 3;
  12867. * }
  12868. *
  12869. * Foo.prototype.b = 2;
  12870. * Bar.prototype.d = 4;
  12871. *
  12872. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12873. * // => { 'a': 1, 'c': 3 }
  12874. */
  12875. var assign = createAssigner(function(object, source) {
  12876. if (isPrototype(source) || isArrayLike(source)) {
  12877. copyObject(source, keys(source), object);
  12878. return;
  12879. }
  12880. for (var key in source) {
  12881. if (hasOwnProperty.call(source, key)) {
  12882. assignValue(object, key, source[key]);
  12883. }
  12884. }
  12885. });
  12886. /**
  12887. * This method is like `_.assign` except that it iterates over own and
  12888. * inherited source properties.
  12889. *
  12890. * **Note:** This method mutates `object`.
  12891. *
  12892. * @static
  12893. * @memberOf _
  12894. * @since 4.0.0
  12895. * @alias extend
  12896. * @category Object
  12897. * @param {Object} object The destination object.
  12898. * @param {...Object} [sources] The source objects.
  12899. * @returns {Object} Returns `object`.
  12900. * @see _.assign
  12901. * @example
  12902. *
  12903. * function Foo() {
  12904. * this.a = 1;
  12905. * }
  12906. *
  12907. * function Bar() {
  12908. * this.c = 3;
  12909. * }
  12910. *
  12911. * Foo.prototype.b = 2;
  12912. * Bar.prototype.d = 4;
  12913. *
  12914. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  12915. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  12916. */
  12917. var assignIn = createAssigner(function(object, source) {
  12918. copyObject(source, keysIn(source), object);
  12919. });
  12920. /**
  12921. * This method is like `_.assignIn` except that it accepts `customizer`
  12922. * which is invoked to produce the assigned values. If `customizer` returns
  12923. * `undefined`, assignment is handled by the method instead. The `customizer`
  12924. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  12925. *
  12926. * **Note:** This method mutates `object`.
  12927. *
  12928. * @static
  12929. * @memberOf _
  12930. * @since 4.0.0
  12931. * @alias extendWith
  12932. * @category Object
  12933. * @param {Object} object The destination object.
  12934. * @param {...Object} sources The source objects.
  12935. * @param {Function} [customizer] The function to customize assigned values.
  12936. * @returns {Object} Returns `object`.
  12937. * @see _.assignWith
  12938. * @example
  12939. *
  12940. * function customizer(objValue, srcValue) {
  12941. * return _.isUndefined(objValue) ? srcValue : objValue;
  12942. * }
  12943. *
  12944. * var defaults = _.partialRight(_.assignInWith, customizer);
  12945. *
  12946. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  12947. * // => { 'a': 1, 'b': 2 }
  12948. */
  12949. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  12950. copyObject(source, keysIn(source), object, customizer);
  12951. });
  12952. /**
  12953. * This method is like `_.assign` except that it accepts `customizer`
  12954. * which is invoked to produce the assigned values. If `customizer` returns
  12955. * `undefined`, assignment is handled by the method instead. The `customizer`
  12956. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  12957. *
  12958. * **Note:** This method mutates `object`.
  12959. *
  12960. * @static
  12961. * @memberOf _
  12962. * @since 4.0.0
  12963. * @category Object
  12964. * @param {Object} object The destination object.
  12965. * @param {...Object} sources The source objects.
  12966. * @param {Function} [customizer] The function to customize assigned values.
  12967. * @returns {Object} Returns `object`.
  12968. * @see _.assignInWith
  12969. * @example
  12970. *
  12971. * function customizer(objValue, srcValue) {
  12972. * return _.isUndefined(objValue) ? srcValue : objValue;
  12973. * }
  12974. *
  12975. * var defaults = _.partialRight(_.assignWith, customizer);
  12976. *
  12977. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  12978. * // => { 'a': 1, 'b': 2 }
  12979. */
  12980. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  12981. copyObject(source, keys(source), object, customizer);
  12982. });
  12983. /**
  12984. * Creates an array of values corresponding to `paths` of `object`.
  12985. *
  12986. * @static
  12987. * @memberOf _
  12988. * @since 1.0.0
  12989. * @category Object
  12990. * @param {Object} object The object to iterate over.
  12991. * @param {...(string|string[])} [paths] The property paths to pick.
  12992. * @returns {Array} Returns the picked values.
  12993. * @example
  12994. *
  12995. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  12996. *
  12997. * _.at(object, ['a[0].b.c', 'a[1]']);
  12998. * // => [3, 4]
  12999. */
  13000. var at = flatRest(baseAt);
  13001. /**
  13002. * Creates an object that inherits from the `prototype` object. If a
  13003. * `properties` object is given, its own enumerable string keyed properties
  13004. * are assigned to the created object.
  13005. *
  13006. * @static
  13007. * @memberOf _
  13008. * @since 2.3.0
  13009. * @category Object
  13010. * @param {Object} prototype The object to inherit from.
  13011. * @param {Object} [properties] The properties to assign to the object.
  13012. * @returns {Object} Returns the new object.
  13013. * @example
  13014. *
  13015. * function Shape() {
  13016. * this.x = 0;
  13017. * this.y = 0;
  13018. * }
  13019. *
  13020. * function Circle() {
  13021. * Shape.call(this);
  13022. * }
  13023. *
  13024. * Circle.prototype = _.create(Shape.prototype, {
  13025. * 'constructor': Circle
  13026. * });
  13027. *
  13028. * var circle = new Circle;
  13029. * circle instanceof Circle;
  13030. * // => true
  13031. *
  13032. * circle instanceof Shape;
  13033. * // => true
  13034. */
  13035. function create(prototype, properties) {
  13036. var result = baseCreate(prototype);
  13037. return properties == null ? result : baseAssign(result, properties);
  13038. }
  13039. /**
  13040. * Assigns own and inherited enumerable string keyed properties of source
  13041. * objects to the destination object for all destination properties that
  13042. * resolve to `undefined`. Source objects are applied from left to right.
  13043. * Once a property is set, additional values of the same property are ignored.
  13044. *
  13045. * **Note:** This method mutates `object`.
  13046. *
  13047. * @static
  13048. * @since 0.1.0
  13049. * @memberOf _
  13050. * @category Object
  13051. * @param {Object} object The destination object.
  13052. * @param {...Object} [sources] The source objects.
  13053. * @returns {Object} Returns `object`.
  13054. * @see _.defaultsDeep
  13055. * @example
  13056. *
  13057. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13058. * // => { 'a': 1, 'b': 2 }
  13059. */
  13060. var defaults = baseRest(function(object, sources) {
  13061. object = Object(object);
  13062. var index = -1;
  13063. var length = sources.length;
  13064. var guard = length > 2 ? sources[2] : undefined;
  13065. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13066. length = 1;
  13067. }
  13068. while (++index < length) {
  13069. var source = sources[index];
  13070. var props = keysIn(source);
  13071. var propsIndex = -1;
  13072. var propsLength = props.length;
  13073. while (++propsIndex < propsLength) {
  13074. var key = props[propsIndex];
  13075. var value = object[key];
  13076. if (value === undefined ||
  13077. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13078. object[key] = source[key];
  13079. }
  13080. }
  13081. }
  13082. return object;
  13083. });
  13084. /**
  13085. * This method is like `_.defaults` except that it recursively assigns
  13086. * default properties.
  13087. *
  13088. * **Note:** This method mutates `object`.
  13089. *
  13090. * @static
  13091. * @memberOf _
  13092. * @since 3.10.0
  13093. * @category Object
  13094. * @param {Object} object The destination object.
  13095. * @param {...Object} [sources] The source objects.
  13096. * @returns {Object} Returns `object`.
  13097. * @see _.defaults
  13098. * @example
  13099. *
  13100. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13101. * // => { 'a': { 'b': 2, 'c': 3 } }
  13102. */
  13103. var defaultsDeep = baseRest(function(args) {
  13104. args.push(undefined, customDefaultsMerge);
  13105. return apply(mergeWith, undefined, args);
  13106. });
  13107. /**
  13108. * This method is like `_.find` except that it returns the key of the first
  13109. * element `predicate` returns truthy for instead of the element itself.
  13110. *
  13111. * @static
  13112. * @memberOf _
  13113. * @since 1.1.0
  13114. * @category Object
  13115. * @param {Object} object The object to inspect.
  13116. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13117. * @returns {string|undefined} Returns the key of the matched element,
  13118. * else `undefined`.
  13119. * @example
  13120. *
  13121. * var users = {
  13122. * 'barney': { 'age': 36, 'active': true },
  13123. * 'fred': { 'age': 40, 'active': false },
  13124. * 'pebbles': { 'age': 1, 'active': true }
  13125. * };
  13126. *
  13127. * _.findKey(users, function(o) { return o.age < 40; });
  13128. * // => 'barney' (iteration order is not guaranteed)
  13129. *
  13130. * // The `_.matches` iteratee shorthand.
  13131. * _.findKey(users, { 'age': 1, 'active': true });
  13132. * // => 'pebbles'
  13133. *
  13134. * // The `_.matchesProperty` iteratee shorthand.
  13135. * _.findKey(users, ['active', false]);
  13136. * // => 'fred'
  13137. *
  13138. * // The `_.property` iteratee shorthand.
  13139. * _.findKey(users, 'active');
  13140. * // => 'barney'
  13141. */
  13142. function findKey(object, predicate) {
  13143. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13144. }
  13145. /**
  13146. * This method is like `_.findKey` except that it iterates over elements of
  13147. * a collection in the opposite order.
  13148. *
  13149. * @static
  13150. * @memberOf _
  13151. * @since 2.0.0
  13152. * @category Object
  13153. * @param {Object} object The object to inspect.
  13154. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13155. * @returns {string|undefined} Returns the key of the matched element,
  13156. * else `undefined`.
  13157. * @example
  13158. *
  13159. * var users = {
  13160. * 'barney': { 'age': 36, 'active': true },
  13161. * 'fred': { 'age': 40, 'active': false },
  13162. * 'pebbles': { 'age': 1, 'active': true }
  13163. * };
  13164. *
  13165. * _.findLastKey(users, function(o) { return o.age < 40; });
  13166. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13167. *
  13168. * // The `_.matches` iteratee shorthand.
  13169. * _.findLastKey(users, { 'age': 36, 'active': true });
  13170. * // => 'barney'
  13171. *
  13172. * // The `_.matchesProperty` iteratee shorthand.
  13173. * _.findLastKey(users, ['active', false]);
  13174. * // => 'fred'
  13175. *
  13176. * // The `_.property` iteratee shorthand.
  13177. * _.findLastKey(users, 'active');
  13178. * // => 'pebbles'
  13179. */
  13180. function findLastKey(object, predicate) {
  13181. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13182. }
  13183. /**
  13184. * Iterates over own and inherited enumerable string keyed properties of an
  13185. * object and invokes `iteratee` for each property. The iteratee is invoked
  13186. * with three arguments: (value, key, object). Iteratee functions may exit
  13187. * iteration early by explicitly returning `false`.
  13188. *
  13189. * @static
  13190. * @memberOf _
  13191. * @since 0.3.0
  13192. * @category Object
  13193. * @param {Object} object The object to iterate over.
  13194. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13195. * @returns {Object} Returns `object`.
  13196. * @see _.forInRight
  13197. * @example
  13198. *
  13199. * function Foo() {
  13200. * this.a = 1;
  13201. * this.b = 2;
  13202. * }
  13203. *
  13204. * Foo.prototype.c = 3;
  13205. *
  13206. * _.forIn(new Foo, function(value, key) {
  13207. * console.log(key);
  13208. * });
  13209. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13210. */
  13211. function forIn(object, iteratee) {
  13212. return object == null
  13213. ? object
  13214. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13215. }
  13216. /**
  13217. * This method is like `_.forIn` except that it iterates over properties of
  13218. * `object` in the opposite order.
  13219. *
  13220. * @static
  13221. * @memberOf _
  13222. * @since 2.0.0
  13223. * @category Object
  13224. * @param {Object} object The object to iterate over.
  13225. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13226. * @returns {Object} Returns `object`.
  13227. * @see _.forIn
  13228. * @example
  13229. *
  13230. * function Foo() {
  13231. * this.a = 1;
  13232. * this.b = 2;
  13233. * }
  13234. *
  13235. * Foo.prototype.c = 3;
  13236. *
  13237. * _.forInRight(new Foo, function(value, key) {
  13238. * console.log(key);
  13239. * });
  13240. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13241. */
  13242. function forInRight(object, iteratee) {
  13243. return object == null
  13244. ? object
  13245. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13246. }
  13247. /**
  13248. * Iterates over own enumerable string keyed properties of an object and
  13249. * invokes `iteratee` for each property. The iteratee is invoked with three
  13250. * arguments: (value, key, object). Iteratee functions may exit iteration
  13251. * early by explicitly returning `false`.
  13252. *
  13253. * @static
  13254. * @memberOf _
  13255. * @since 0.3.0
  13256. * @category Object
  13257. * @param {Object} object The object to iterate over.
  13258. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13259. * @returns {Object} Returns `object`.
  13260. * @see _.forOwnRight
  13261. * @example
  13262. *
  13263. * function Foo() {
  13264. * this.a = 1;
  13265. * this.b = 2;
  13266. * }
  13267. *
  13268. * Foo.prototype.c = 3;
  13269. *
  13270. * _.forOwn(new Foo, function(value, key) {
  13271. * console.log(key);
  13272. * });
  13273. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13274. */
  13275. function forOwn(object, iteratee) {
  13276. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13277. }
  13278. /**
  13279. * This method is like `_.forOwn` except that it iterates over properties of
  13280. * `object` in the opposite order.
  13281. *
  13282. * @static
  13283. * @memberOf _
  13284. * @since 2.0.0
  13285. * @category Object
  13286. * @param {Object} object The object to iterate over.
  13287. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13288. * @returns {Object} Returns `object`.
  13289. * @see _.forOwn
  13290. * @example
  13291. *
  13292. * function Foo() {
  13293. * this.a = 1;
  13294. * this.b = 2;
  13295. * }
  13296. *
  13297. * Foo.prototype.c = 3;
  13298. *
  13299. * _.forOwnRight(new Foo, function(value, key) {
  13300. * console.log(key);
  13301. * });
  13302. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13303. */
  13304. function forOwnRight(object, iteratee) {
  13305. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13306. }
  13307. /**
  13308. * Creates an array of function property names from own enumerable properties
  13309. * of `object`.
  13310. *
  13311. * @static
  13312. * @since 0.1.0
  13313. * @memberOf _
  13314. * @category Object
  13315. * @param {Object} object The object to inspect.
  13316. * @returns {Array} Returns the function names.
  13317. * @see _.functionsIn
  13318. * @example
  13319. *
  13320. * function Foo() {
  13321. * this.a = _.constant('a');
  13322. * this.b = _.constant('b');
  13323. * }
  13324. *
  13325. * Foo.prototype.c = _.constant('c');
  13326. *
  13327. * _.functions(new Foo);
  13328. * // => ['a', 'b']
  13329. */
  13330. function functions(object) {
  13331. return object == null ? [] : baseFunctions(object, keys(object));
  13332. }
  13333. /**
  13334. * Creates an array of function property names from own and inherited
  13335. * enumerable properties of `object`.
  13336. *
  13337. * @static
  13338. * @memberOf _
  13339. * @since 4.0.0
  13340. * @category Object
  13341. * @param {Object} object The object to inspect.
  13342. * @returns {Array} Returns the function names.
  13343. * @see _.functions
  13344. * @example
  13345. *
  13346. * function Foo() {
  13347. * this.a = _.constant('a');
  13348. * this.b = _.constant('b');
  13349. * }
  13350. *
  13351. * Foo.prototype.c = _.constant('c');
  13352. *
  13353. * _.functionsIn(new Foo);
  13354. * // => ['a', 'b', 'c']
  13355. */
  13356. function functionsIn(object) {
  13357. return object == null ? [] : baseFunctions(object, keysIn(object));
  13358. }
  13359. /**
  13360. * Gets the value at `path` of `object`. If the resolved value is
  13361. * `undefined`, the `defaultValue` is returned in its place.
  13362. *
  13363. * @static
  13364. * @memberOf _
  13365. * @since 3.7.0
  13366. * @category Object
  13367. * @param {Object} object The object to query.
  13368. * @param {Array|string} path The path of the property to get.
  13369. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13370. * @returns {*} Returns the resolved value.
  13371. * @example
  13372. *
  13373. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13374. *
  13375. * _.get(object, 'a[0].b.c');
  13376. * // => 3
  13377. *
  13378. * _.get(object, ['a', '0', 'b', 'c']);
  13379. * // => 3
  13380. *
  13381. * _.get(object, 'a.b.c', 'default');
  13382. * // => 'default'
  13383. */
  13384. function get(object, path, defaultValue) {
  13385. var result = object == null ? undefined : baseGet(object, path);
  13386. return result === undefined ? defaultValue : result;
  13387. }
  13388. /**
  13389. * Checks if `path` is a direct property of `object`.
  13390. *
  13391. * @static
  13392. * @since 0.1.0
  13393. * @memberOf _
  13394. * @category Object
  13395. * @param {Object} object The object to query.
  13396. * @param {Array|string} path The path to check.
  13397. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13398. * @example
  13399. *
  13400. * var object = { 'a': { 'b': 2 } };
  13401. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13402. *
  13403. * _.has(object, 'a');
  13404. * // => true
  13405. *
  13406. * _.has(object, 'a.b');
  13407. * // => true
  13408. *
  13409. * _.has(object, ['a', 'b']);
  13410. * // => true
  13411. *
  13412. * _.has(other, 'a');
  13413. * // => false
  13414. */
  13415. function has(object, path) {
  13416. return object != null && hasPath(object, path, baseHas);
  13417. }
  13418. /**
  13419. * Checks if `path` is a direct or inherited property of `object`.
  13420. *
  13421. * @static
  13422. * @memberOf _
  13423. * @since 4.0.0
  13424. * @category Object
  13425. * @param {Object} object The object to query.
  13426. * @param {Array|string} path The path to check.
  13427. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13428. * @example
  13429. *
  13430. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13431. *
  13432. * _.hasIn(object, 'a');
  13433. * // => true
  13434. *
  13435. * _.hasIn(object, 'a.b');
  13436. * // => true
  13437. *
  13438. * _.hasIn(object, ['a', 'b']);
  13439. * // => true
  13440. *
  13441. * _.hasIn(object, 'b');
  13442. * // => false
  13443. */
  13444. function hasIn(object, path) {
  13445. return object != null && hasPath(object, path, baseHasIn);
  13446. }
  13447. /**
  13448. * Creates an object composed of the inverted keys and values of `object`.
  13449. * If `object` contains duplicate values, subsequent values overwrite
  13450. * property assignments of previous values.
  13451. *
  13452. * @static
  13453. * @memberOf _
  13454. * @since 0.7.0
  13455. * @category Object
  13456. * @param {Object} object The object to invert.
  13457. * @returns {Object} Returns the new inverted object.
  13458. * @example
  13459. *
  13460. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13461. *
  13462. * _.invert(object);
  13463. * // => { '1': 'c', '2': 'b' }
  13464. */
  13465. var invert = createInverter(function(result, value, key) {
  13466. if (value != null &&
  13467. typeof value.toString != 'function') {
  13468. value = nativeObjectToString.call(value);
  13469. }
  13470. result[value] = key;
  13471. }, constant(identity));
  13472. /**
  13473. * This method is like `_.invert` except that the inverted object is generated
  13474. * from the results of running each element of `object` thru `iteratee`. The
  13475. * corresponding inverted value of each inverted key is an array of keys
  13476. * responsible for generating the inverted value. The iteratee is invoked
  13477. * with one argument: (value).
  13478. *
  13479. * @static
  13480. * @memberOf _
  13481. * @since 4.1.0
  13482. * @category Object
  13483. * @param {Object} object The object to invert.
  13484. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13485. * @returns {Object} Returns the new inverted object.
  13486. * @example
  13487. *
  13488. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13489. *
  13490. * _.invertBy(object);
  13491. * // => { '1': ['a', 'c'], '2': ['b'] }
  13492. *
  13493. * _.invertBy(object, function(value) {
  13494. * return 'group' + value;
  13495. * });
  13496. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13497. */
  13498. var invertBy = createInverter(function(result, value, key) {
  13499. if (value != null &&
  13500. typeof value.toString != 'function') {
  13501. value = nativeObjectToString.call(value);
  13502. }
  13503. if (hasOwnProperty.call(result, value)) {
  13504. result[value].push(key);
  13505. } else {
  13506. result[value] = [key];
  13507. }
  13508. }, getIteratee);
  13509. /**
  13510. * Invokes the method at `path` of `object`.
  13511. *
  13512. * @static
  13513. * @memberOf _
  13514. * @since 4.0.0
  13515. * @category Object
  13516. * @param {Object} object The object to query.
  13517. * @param {Array|string} path The path of the method to invoke.
  13518. * @param {...*} [args] The arguments to invoke the method with.
  13519. * @returns {*} Returns the result of the invoked method.
  13520. * @example
  13521. *
  13522. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13523. *
  13524. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13525. * // => [2, 3]
  13526. */
  13527. var invoke = baseRest(baseInvoke);
  13528. /**
  13529. * Creates an array of the own enumerable property names of `object`.
  13530. *
  13531. * **Note:** Non-object values are coerced to objects. See the
  13532. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13533. * for more details.
  13534. *
  13535. * @static
  13536. * @since 0.1.0
  13537. * @memberOf _
  13538. * @category Object
  13539. * @param {Object} object The object to query.
  13540. * @returns {Array} Returns the array of property names.
  13541. * @example
  13542. *
  13543. * function Foo() {
  13544. * this.a = 1;
  13545. * this.b = 2;
  13546. * }
  13547. *
  13548. * Foo.prototype.c = 3;
  13549. *
  13550. * _.keys(new Foo);
  13551. * // => ['a', 'b'] (iteration order is not guaranteed)
  13552. *
  13553. * _.keys('hi');
  13554. * // => ['0', '1']
  13555. */
  13556. function keys(object) {
  13557. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13558. }
  13559. /**
  13560. * Creates an array of the own and inherited enumerable property names of `object`.
  13561. *
  13562. * **Note:** Non-object values are coerced to objects.
  13563. *
  13564. * @static
  13565. * @memberOf _
  13566. * @since 3.0.0
  13567. * @category Object
  13568. * @param {Object} object The object to query.
  13569. * @returns {Array} Returns the array of property names.
  13570. * @example
  13571. *
  13572. * function Foo() {
  13573. * this.a = 1;
  13574. * this.b = 2;
  13575. * }
  13576. *
  13577. * Foo.prototype.c = 3;
  13578. *
  13579. * _.keysIn(new Foo);
  13580. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13581. */
  13582. function keysIn(object) {
  13583. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13584. }
  13585. /**
  13586. * The opposite of `_.mapValues`; this method creates an object with the
  13587. * same values as `object` and keys generated by running each own enumerable
  13588. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13589. * with three arguments: (value, key, object).
  13590. *
  13591. * @static
  13592. * @memberOf _
  13593. * @since 3.8.0
  13594. * @category Object
  13595. * @param {Object} object The object to iterate over.
  13596. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13597. * @returns {Object} Returns the new mapped object.
  13598. * @see _.mapValues
  13599. * @example
  13600. *
  13601. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13602. * return key + value;
  13603. * });
  13604. * // => { 'a1': 1, 'b2': 2 }
  13605. */
  13606. function mapKeys(object, iteratee) {
  13607. var result = {};
  13608. iteratee = getIteratee(iteratee, 3);
  13609. baseForOwn(object, function(value, key, object) {
  13610. baseAssignValue(result, iteratee(value, key, object), value);
  13611. });
  13612. return result;
  13613. }
  13614. /**
  13615. * Creates an object with the same keys as `object` and values generated
  13616. * by running each own enumerable string keyed property of `object` thru
  13617. * `iteratee`. The iteratee is invoked with three arguments:
  13618. * (value, key, object).
  13619. *
  13620. * @static
  13621. * @memberOf _
  13622. * @since 2.4.0
  13623. * @category Object
  13624. * @param {Object} object The object to iterate over.
  13625. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13626. * @returns {Object} Returns the new mapped object.
  13627. * @see _.mapKeys
  13628. * @example
  13629. *
  13630. * var users = {
  13631. * 'fred': { 'user': 'fred', 'age': 40 },
  13632. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13633. * };
  13634. *
  13635. * _.mapValues(users, function(o) { return o.age; });
  13636. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13637. *
  13638. * // The `_.property` iteratee shorthand.
  13639. * _.mapValues(users, 'age');
  13640. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13641. */
  13642. function mapValues(object, iteratee) {
  13643. var result = {};
  13644. iteratee = getIteratee(iteratee, 3);
  13645. baseForOwn(object, function(value, key, object) {
  13646. baseAssignValue(result, key, iteratee(value, key, object));
  13647. });
  13648. return result;
  13649. }
  13650. /**
  13651. * This method is like `_.assign` except that it recursively merges own and
  13652. * inherited enumerable string keyed properties of source objects into the
  13653. * destination object. Source properties that resolve to `undefined` are
  13654. * skipped if a destination value exists. Array and plain object properties
  13655. * are merged recursively. Other objects and value types are overridden by
  13656. * assignment. Source objects are applied from left to right. Subsequent
  13657. * sources overwrite property assignments of previous sources.
  13658. *
  13659. * **Note:** This method mutates `object`.
  13660. *
  13661. * @static
  13662. * @memberOf _
  13663. * @since 0.5.0
  13664. * @category Object
  13665. * @param {Object} object The destination object.
  13666. * @param {...Object} [sources] The source objects.
  13667. * @returns {Object} Returns `object`.
  13668. * @example
  13669. *
  13670. * var object = {
  13671. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13672. * };
  13673. *
  13674. * var other = {
  13675. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13676. * };
  13677. *
  13678. * _.merge(object, other);
  13679. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13680. */
  13681. var merge = createAssigner(function(object, source, srcIndex) {
  13682. baseMerge(object, source, srcIndex);
  13683. });
  13684. /**
  13685. * This method is like `_.merge` except that it accepts `customizer` which
  13686. * is invoked to produce the merged values of the destination and source
  13687. * properties. If `customizer` returns `undefined`, merging is handled by the
  13688. * method instead. The `customizer` is invoked with six arguments:
  13689. * (objValue, srcValue, key, object, source, stack).
  13690. *
  13691. * **Note:** This method mutates `object`.
  13692. *
  13693. * @static
  13694. * @memberOf _
  13695. * @since 4.0.0
  13696. * @category Object
  13697. * @param {Object} object The destination object.
  13698. * @param {...Object} sources The source objects.
  13699. * @param {Function} customizer The function to customize assigned values.
  13700. * @returns {Object} Returns `object`.
  13701. * @example
  13702. *
  13703. * function customizer(objValue, srcValue) {
  13704. * if (_.isArray(objValue)) {
  13705. * return objValue.concat(srcValue);
  13706. * }
  13707. * }
  13708. *
  13709. * var object = { 'a': [1], 'b': [2] };
  13710. * var other = { 'a': [3], 'b': [4] };
  13711. *
  13712. * _.mergeWith(object, other, customizer);
  13713. * // => { 'a': [1, 3], 'b': [2, 4] }
  13714. */
  13715. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13716. baseMerge(object, source, srcIndex, customizer);
  13717. });
  13718. /**
  13719. * The opposite of `_.pick`; this method creates an object composed of the
  13720. * own and inherited enumerable property paths of `object` that are not omitted.
  13721. *
  13722. * **Note:** This method is considerably slower than `_.pick`.
  13723. *
  13724. * @static
  13725. * @since 0.1.0
  13726. * @memberOf _
  13727. * @category Object
  13728. * @param {Object} object The source object.
  13729. * @param {...(string|string[])} [paths] The property paths to omit.
  13730. * @returns {Object} Returns the new object.
  13731. * @example
  13732. *
  13733. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13734. *
  13735. * _.omit(object, ['a', 'c']);
  13736. * // => { 'b': '2' }
  13737. */
  13738. var omit = flatRest(function(object, paths) {
  13739. var result = {};
  13740. if (object == null) {
  13741. return result;
  13742. }
  13743. var isDeep = false;
  13744. paths = arrayMap(paths, function(path) {
  13745. path = castPath(path, object);
  13746. isDeep || (isDeep = path.length > 1);
  13747. return path;
  13748. });
  13749. copyObject(object, getAllKeysIn(object), result);
  13750. if (isDeep) {
  13751. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13752. }
  13753. var length = paths.length;
  13754. while (length--) {
  13755. baseUnset(result, paths[length]);
  13756. }
  13757. return result;
  13758. });
  13759. /**
  13760. * The opposite of `_.pickBy`; this method creates an object composed of
  13761. * the own and inherited enumerable string keyed properties of `object` that
  13762. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13763. * arguments: (value, key).
  13764. *
  13765. * @static
  13766. * @memberOf _
  13767. * @since 4.0.0
  13768. * @category Object
  13769. * @param {Object} object The source object.
  13770. * @param {Function} [predicate=_.identity] The function invoked per property.
  13771. * @returns {Object} Returns the new object.
  13772. * @example
  13773. *
  13774. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13775. *
  13776. * _.omitBy(object, _.isNumber);
  13777. * // => { 'b': '2' }
  13778. */
  13779. function omitBy(object, predicate) {
  13780. return pickBy(object, negate(getIteratee(predicate)));
  13781. }
  13782. /**
  13783. * Creates an object composed of the picked `object` properties.
  13784. *
  13785. * @static
  13786. * @since 0.1.0
  13787. * @memberOf _
  13788. * @category Object
  13789. * @param {Object} object The source object.
  13790. * @param {...(string|string[])} [paths] The property paths to pick.
  13791. * @returns {Object} Returns the new object.
  13792. * @example
  13793. *
  13794. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13795. *
  13796. * _.pick(object, ['a', 'c']);
  13797. * // => { 'a': 1, 'c': 3 }
  13798. */
  13799. var pick = flatRest(function(object, paths) {
  13800. return object == null ? {} : basePick(object, paths);
  13801. });
  13802. /**
  13803. * Creates an object composed of the `object` properties `predicate` returns
  13804. * truthy for. The predicate is invoked with two arguments: (value, key).
  13805. *
  13806. * @static
  13807. * @memberOf _
  13808. * @since 4.0.0
  13809. * @category Object
  13810. * @param {Object} object The source object.
  13811. * @param {Function} [predicate=_.identity] The function invoked per property.
  13812. * @returns {Object} Returns the new object.
  13813. * @example
  13814. *
  13815. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13816. *
  13817. * _.pickBy(object, _.isNumber);
  13818. * // => { 'a': 1, 'c': 3 }
  13819. */
  13820. function pickBy(object, predicate) {
  13821. if (object == null) {
  13822. return {};
  13823. }
  13824. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13825. return [prop];
  13826. });
  13827. predicate = getIteratee(predicate);
  13828. return basePickBy(object, props, function(value, path) {
  13829. return predicate(value, path[0]);
  13830. });
  13831. }
  13832. /**
  13833. * This method is like `_.get` except that if the resolved value is a
  13834. * function it's invoked with the `this` binding of its parent object and
  13835. * its result is returned.
  13836. *
  13837. * @static
  13838. * @since 0.1.0
  13839. * @memberOf _
  13840. * @category Object
  13841. * @param {Object} object The object to query.
  13842. * @param {Array|string} path The path of the property to resolve.
  13843. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13844. * @returns {*} Returns the resolved value.
  13845. * @example
  13846. *
  13847. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13848. *
  13849. * _.result(object, 'a[0].b.c1');
  13850. * // => 3
  13851. *
  13852. * _.result(object, 'a[0].b.c2');
  13853. * // => 4
  13854. *
  13855. * _.result(object, 'a[0].b.c3', 'default');
  13856. * // => 'default'
  13857. *
  13858. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13859. * // => 'default'
  13860. */
  13861. function result(object, path, defaultValue) {
  13862. path = castPath(path, object);
  13863. var index = -1,
  13864. length = path.length;
  13865. // Ensure the loop is entered when path is empty.
  13866. if (!length) {
  13867. length = 1;
  13868. object = undefined;
  13869. }
  13870. while (++index < length) {
  13871. var value = object == null ? undefined : object[toKey(path[index])];
  13872. if (value === undefined) {
  13873. index = length;
  13874. value = defaultValue;
  13875. }
  13876. object = isFunction(value) ? value.call(object) : value;
  13877. }
  13878. return object;
  13879. }
  13880. /**
  13881. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13882. * it's created. Arrays are created for missing index properties while objects
  13883. * are created for all other missing properties. Use `_.setWith` to customize
  13884. * `path` creation.
  13885. *
  13886. * **Note:** This method mutates `object`.
  13887. *
  13888. * @static
  13889. * @memberOf _
  13890. * @since 3.7.0
  13891. * @category Object
  13892. * @param {Object} object The object to modify.
  13893. * @param {Array|string} path The path of the property to set.
  13894. * @param {*} value The value to set.
  13895. * @returns {Object} Returns `object`.
  13896. * @example
  13897. *
  13898. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13899. *
  13900. * _.set(object, 'a[0].b.c', 4);
  13901. * console.log(object.a[0].b.c);
  13902. * // => 4
  13903. *
  13904. * _.set(object, ['x', '0', 'y', 'z'], 5);
  13905. * console.log(object.x[0].y.z);
  13906. * // => 5
  13907. */
  13908. function set(object, path, value) {
  13909. return object == null ? object : baseSet(object, path, value);
  13910. }
  13911. /**
  13912. * This method is like `_.set` except that it accepts `customizer` which is
  13913. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  13914. * path creation is handled by the method instead. The `customizer` is invoked
  13915. * with three arguments: (nsValue, key, nsObject).
  13916. *
  13917. * **Note:** This method mutates `object`.
  13918. *
  13919. * @static
  13920. * @memberOf _
  13921. * @since 4.0.0
  13922. * @category Object
  13923. * @param {Object} object The object to modify.
  13924. * @param {Array|string} path The path of the property to set.
  13925. * @param {*} value The value to set.
  13926. * @param {Function} [customizer] The function to customize assigned values.
  13927. * @returns {Object} Returns `object`.
  13928. * @example
  13929. *
  13930. * var object = {};
  13931. *
  13932. * _.setWith(object, '[0][1]', 'a', Object);
  13933. * // => { '0': { '1': 'a' } }
  13934. */
  13935. function setWith(object, path, value, customizer) {
  13936. customizer = typeof customizer == 'function' ? customizer : undefined;
  13937. return object == null ? object : baseSet(object, path, value, customizer);
  13938. }
  13939. /**
  13940. * Creates an array of own enumerable string keyed-value pairs for `object`
  13941. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  13942. * entries are returned.
  13943. *
  13944. * @static
  13945. * @memberOf _
  13946. * @since 4.0.0
  13947. * @alias entries
  13948. * @category Object
  13949. * @param {Object} object The object to query.
  13950. * @returns {Array} Returns the key-value pairs.
  13951. * @example
  13952. *
  13953. * function Foo() {
  13954. * this.a = 1;
  13955. * this.b = 2;
  13956. * }
  13957. *
  13958. * Foo.prototype.c = 3;
  13959. *
  13960. * _.toPairs(new Foo);
  13961. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  13962. */
  13963. var toPairs = createToPairs(keys);
  13964. /**
  13965. * Creates an array of own and inherited enumerable string keyed-value pairs
  13966. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  13967. * or set, its entries are returned.
  13968. *
  13969. * @static
  13970. * @memberOf _
  13971. * @since 4.0.0
  13972. * @alias entriesIn
  13973. * @category Object
  13974. * @param {Object} object The object to query.
  13975. * @returns {Array} Returns the key-value pairs.
  13976. * @example
  13977. *
  13978. * function Foo() {
  13979. * this.a = 1;
  13980. * this.b = 2;
  13981. * }
  13982. *
  13983. * Foo.prototype.c = 3;
  13984. *
  13985. * _.toPairsIn(new Foo);
  13986. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  13987. */
  13988. var toPairsIn = createToPairs(keysIn);
  13989. /**
  13990. * An alternative to `_.reduce`; this method transforms `object` to a new
  13991. * `accumulator` object which is the result of running each of its own
  13992. * enumerable string keyed properties thru `iteratee`, with each invocation
  13993. * potentially mutating the `accumulator` object. If `accumulator` is not
  13994. * provided, a new object with the same `[[Prototype]]` will be used. The
  13995. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  13996. * Iteratee functions may exit iteration early by explicitly returning `false`.
  13997. *
  13998. * @static
  13999. * @memberOf _
  14000. * @since 1.3.0
  14001. * @category Object
  14002. * @param {Object} object The object to iterate over.
  14003. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14004. * @param {*} [accumulator] The custom accumulator value.
  14005. * @returns {*} Returns the accumulated value.
  14006. * @example
  14007. *
  14008. * _.transform([2, 3, 4], function(result, n) {
  14009. * result.push(n *= n);
  14010. * return n % 2 == 0;
  14011. * }, []);
  14012. * // => [4, 9]
  14013. *
  14014. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14015. * (result[value] || (result[value] = [])).push(key);
  14016. * }, {});
  14017. * // => { '1': ['a', 'c'], '2': ['b'] }
  14018. */
  14019. function transform(object, iteratee, accumulator) {
  14020. var isArr = isArray(object),
  14021. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14022. iteratee = getIteratee(iteratee, 4);
  14023. if (accumulator == null) {
  14024. var Ctor = object && object.constructor;
  14025. if (isArrLike) {
  14026. accumulator = isArr ? new Ctor : [];
  14027. }
  14028. else if (isObject(object)) {
  14029. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14030. }
  14031. else {
  14032. accumulator = {};
  14033. }
  14034. }
  14035. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14036. return iteratee(accumulator, value, index, object);
  14037. });
  14038. return accumulator;
  14039. }
  14040. /**
  14041. * Removes the property at `path` of `object`.
  14042. *
  14043. * **Note:** This method mutates `object`.
  14044. *
  14045. * @static
  14046. * @memberOf _
  14047. * @since 4.0.0
  14048. * @category Object
  14049. * @param {Object} object The object to modify.
  14050. * @param {Array|string} path The path of the property to unset.
  14051. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14052. * @example
  14053. *
  14054. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14055. * _.unset(object, 'a[0].b.c');
  14056. * // => true
  14057. *
  14058. * console.log(object);
  14059. * // => { 'a': [{ 'b': {} }] };
  14060. *
  14061. * _.unset(object, ['a', '0', 'b', 'c']);
  14062. * // => true
  14063. *
  14064. * console.log(object);
  14065. * // => { 'a': [{ 'b': {} }] };
  14066. */
  14067. function unset(object, path) {
  14068. return object == null ? true : baseUnset(object, path);
  14069. }
  14070. /**
  14071. * This method is like `_.set` except that accepts `updater` to produce the
  14072. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14073. * is invoked with one argument: (value).
  14074. *
  14075. * **Note:** This method mutates `object`.
  14076. *
  14077. * @static
  14078. * @memberOf _
  14079. * @since 4.6.0
  14080. * @category Object
  14081. * @param {Object} object The object to modify.
  14082. * @param {Array|string} path The path of the property to set.
  14083. * @param {Function} updater The function to produce the updated value.
  14084. * @returns {Object} Returns `object`.
  14085. * @example
  14086. *
  14087. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14088. *
  14089. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14090. * console.log(object.a[0].b.c);
  14091. * // => 9
  14092. *
  14093. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14094. * console.log(object.x[0].y.z);
  14095. * // => 0
  14096. */
  14097. function update(object, path, updater) {
  14098. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14099. }
  14100. /**
  14101. * This method is like `_.update` except that it accepts `customizer` which is
  14102. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14103. * path creation is handled by the method instead. The `customizer` is invoked
  14104. * with three arguments: (nsValue, key, nsObject).
  14105. *
  14106. * **Note:** This method mutates `object`.
  14107. *
  14108. * @static
  14109. * @memberOf _
  14110. * @since 4.6.0
  14111. * @category Object
  14112. * @param {Object} object The object to modify.
  14113. * @param {Array|string} path The path of the property to set.
  14114. * @param {Function} updater The function to produce the updated value.
  14115. * @param {Function} [customizer] The function to customize assigned values.
  14116. * @returns {Object} Returns `object`.
  14117. * @example
  14118. *
  14119. * var object = {};
  14120. *
  14121. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14122. * // => { '0': { '1': 'a' } }
  14123. */
  14124. function updateWith(object, path, updater, customizer) {
  14125. customizer = typeof customizer == 'function' ? customizer : undefined;
  14126. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14127. }
  14128. /**
  14129. * Creates an array of the own enumerable string keyed property values of `object`.
  14130. *
  14131. * **Note:** Non-object values are coerced to objects.
  14132. *
  14133. * @static
  14134. * @since 0.1.0
  14135. * @memberOf _
  14136. * @category Object
  14137. * @param {Object} object The object to query.
  14138. * @returns {Array} Returns the array of property values.
  14139. * @example
  14140. *
  14141. * function Foo() {
  14142. * this.a = 1;
  14143. * this.b = 2;
  14144. * }
  14145. *
  14146. * Foo.prototype.c = 3;
  14147. *
  14148. * _.values(new Foo);
  14149. * // => [1, 2] (iteration order is not guaranteed)
  14150. *
  14151. * _.values('hi');
  14152. * // => ['h', 'i']
  14153. */
  14154. function values(object) {
  14155. return object == null ? [] : baseValues(object, keys(object));
  14156. }
  14157. /**
  14158. * Creates an array of the own and inherited enumerable string keyed property
  14159. * values of `object`.
  14160. *
  14161. * **Note:** Non-object values are coerced to objects.
  14162. *
  14163. * @static
  14164. * @memberOf _
  14165. * @since 3.0.0
  14166. * @category Object
  14167. * @param {Object} object The object to query.
  14168. * @returns {Array} Returns the array of property values.
  14169. * @example
  14170. *
  14171. * function Foo() {
  14172. * this.a = 1;
  14173. * this.b = 2;
  14174. * }
  14175. *
  14176. * Foo.prototype.c = 3;
  14177. *
  14178. * _.valuesIn(new Foo);
  14179. * // => [1, 2, 3] (iteration order is not guaranteed)
  14180. */
  14181. function valuesIn(object) {
  14182. return object == null ? [] : baseValues(object, keysIn(object));
  14183. }
  14184. /*------------------------------------------------------------------------*/
  14185. /**
  14186. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14187. *
  14188. * @static
  14189. * @memberOf _
  14190. * @since 4.0.0
  14191. * @category Number
  14192. * @param {number} number The number to clamp.
  14193. * @param {number} [lower] The lower bound.
  14194. * @param {number} upper The upper bound.
  14195. * @returns {number} Returns the clamped number.
  14196. * @example
  14197. *
  14198. * _.clamp(-10, -5, 5);
  14199. * // => -5
  14200. *
  14201. * _.clamp(10, -5, 5);
  14202. * // => 5
  14203. */
  14204. function clamp(number, lower, upper) {
  14205. if (upper === undefined) {
  14206. upper = lower;
  14207. lower = undefined;
  14208. }
  14209. if (upper !== undefined) {
  14210. upper = toNumber(upper);
  14211. upper = upper === upper ? upper : 0;
  14212. }
  14213. if (lower !== undefined) {
  14214. lower = toNumber(lower);
  14215. lower = lower === lower ? lower : 0;
  14216. }
  14217. return baseClamp(toNumber(number), lower, upper);
  14218. }
  14219. /**
  14220. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14221. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14222. * If `start` is greater than `end` the params are swapped to support
  14223. * negative ranges.
  14224. *
  14225. * @static
  14226. * @memberOf _
  14227. * @since 3.3.0
  14228. * @category Number
  14229. * @param {number} number The number to check.
  14230. * @param {number} [start=0] The start of the range.
  14231. * @param {number} end The end of the range.
  14232. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14233. * @see _.range, _.rangeRight
  14234. * @example
  14235. *
  14236. * _.inRange(3, 2, 4);
  14237. * // => true
  14238. *
  14239. * _.inRange(4, 8);
  14240. * // => true
  14241. *
  14242. * _.inRange(4, 2);
  14243. * // => false
  14244. *
  14245. * _.inRange(2, 2);
  14246. * // => false
  14247. *
  14248. * _.inRange(1.2, 2);
  14249. * // => true
  14250. *
  14251. * _.inRange(5.2, 4);
  14252. * // => false
  14253. *
  14254. * _.inRange(-3, -2, -6);
  14255. * // => true
  14256. */
  14257. function inRange(number, start, end) {
  14258. start = toFinite(start);
  14259. if (end === undefined) {
  14260. end = start;
  14261. start = 0;
  14262. } else {
  14263. end = toFinite(end);
  14264. }
  14265. number = toNumber(number);
  14266. return baseInRange(number, start, end);
  14267. }
  14268. /**
  14269. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14270. * If only one argument is provided a number between `0` and the given number
  14271. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14272. * floats, a floating-point number is returned instead of an integer.
  14273. *
  14274. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14275. * floating-point values which can produce unexpected results.
  14276. *
  14277. * @static
  14278. * @memberOf _
  14279. * @since 0.7.0
  14280. * @category Number
  14281. * @param {number} [lower=0] The lower bound.
  14282. * @param {number} [upper=1] The upper bound.
  14283. * @param {boolean} [floating] Specify returning a floating-point number.
  14284. * @returns {number} Returns the random number.
  14285. * @example
  14286. *
  14287. * _.random(0, 5);
  14288. * // => an integer between 0 and 5
  14289. *
  14290. * _.random(5);
  14291. * // => also an integer between 0 and 5
  14292. *
  14293. * _.random(5, true);
  14294. * // => a floating-point number between 0 and 5
  14295. *
  14296. * _.random(1.2, 5.2);
  14297. * // => a floating-point number between 1.2 and 5.2
  14298. */
  14299. function random(lower, upper, floating) {
  14300. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14301. upper = floating = undefined;
  14302. }
  14303. if (floating === undefined) {
  14304. if (typeof upper == 'boolean') {
  14305. floating = upper;
  14306. upper = undefined;
  14307. }
  14308. else if (typeof lower == 'boolean') {
  14309. floating = lower;
  14310. lower = undefined;
  14311. }
  14312. }
  14313. if (lower === undefined && upper === undefined) {
  14314. lower = 0;
  14315. upper = 1;
  14316. }
  14317. else {
  14318. lower = toFinite(lower);
  14319. if (upper === undefined) {
  14320. upper = lower;
  14321. lower = 0;
  14322. } else {
  14323. upper = toFinite(upper);
  14324. }
  14325. }
  14326. if (lower > upper) {
  14327. var temp = lower;
  14328. lower = upper;
  14329. upper = temp;
  14330. }
  14331. if (floating || lower % 1 || upper % 1) {
  14332. var rand = nativeRandom();
  14333. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14334. }
  14335. return baseRandom(lower, upper);
  14336. }
  14337. /*------------------------------------------------------------------------*/
  14338. /**
  14339. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14340. *
  14341. * @static
  14342. * @memberOf _
  14343. * @since 3.0.0
  14344. * @category String
  14345. * @param {string} [string=''] The string to convert.
  14346. * @returns {string} Returns the camel cased string.
  14347. * @example
  14348. *
  14349. * _.camelCase('Foo Bar');
  14350. * // => 'fooBar'
  14351. *
  14352. * _.camelCase('--foo-bar--');
  14353. * // => 'fooBar'
  14354. *
  14355. * _.camelCase('__FOO_BAR__');
  14356. * // => 'fooBar'
  14357. */
  14358. var camelCase = createCompounder(function(result, word, index) {
  14359. word = word.toLowerCase();
  14360. return result + (index ? capitalize(word) : word);
  14361. });
  14362. /**
  14363. * Converts the first character of `string` to upper case and the remaining
  14364. * to lower case.
  14365. *
  14366. * @static
  14367. * @memberOf _
  14368. * @since 3.0.0
  14369. * @category String
  14370. * @param {string} [string=''] The string to capitalize.
  14371. * @returns {string} Returns the capitalized string.
  14372. * @example
  14373. *
  14374. * _.capitalize('FRED');
  14375. * // => 'Fred'
  14376. */
  14377. function capitalize(string) {
  14378. return upperFirst(toString(string).toLowerCase());
  14379. }
  14380. /**
  14381. * Deburrs `string` by converting
  14382. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14383. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14384. * letters to basic Latin letters and removing
  14385. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14386. *
  14387. * @static
  14388. * @memberOf _
  14389. * @since 3.0.0
  14390. * @category String
  14391. * @param {string} [string=''] The string to deburr.
  14392. * @returns {string} Returns the deburred string.
  14393. * @example
  14394. *
  14395. * _.deburr('déjà vu');
  14396. * // => 'deja vu'
  14397. */
  14398. function deburr(string) {
  14399. string = toString(string);
  14400. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14401. }
  14402. /**
  14403. * Checks if `string` ends with the given target string.
  14404. *
  14405. * @static
  14406. * @memberOf _
  14407. * @since 3.0.0
  14408. * @category String
  14409. * @param {string} [string=''] The string to inspect.
  14410. * @param {string} [target] The string to search for.
  14411. * @param {number} [position=string.length] The position to search up to.
  14412. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14413. * else `false`.
  14414. * @example
  14415. *
  14416. * _.endsWith('abc', 'c');
  14417. * // => true
  14418. *
  14419. * _.endsWith('abc', 'b');
  14420. * // => false
  14421. *
  14422. * _.endsWith('abc', 'b', 2);
  14423. * // => true
  14424. */
  14425. function endsWith(string, target, position) {
  14426. string = toString(string);
  14427. target = baseToString(target);
  14428. var length = string.length;
  14429. position = position === undefined
  14430. ? length
  14431. : baseClamp(toInteger(position), 0, length);
  14432. var end = position;
  14433. position -= target.length;
  14434. return position >= 0 && string.slice(position, end) == target;
  14435. }
  14436. /**
  14437. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14438. * corresponding HTML entities.
  14439. *
  14440. * **Note:** No other characters are escaped. To escape additional
  14441. * characters use a third-party library like [_he_](https://mths.be/he).
  14442. *
  14443. * Though the ">" character is escaped for symmetry, characters like
  14444. * ">" and "/" don't need escaping in HTML and have no special meaning
  14445. * unless they're part of a tag or unquoted attribute value. See
  14446. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14447. * (under "semi-related fun fact") for more details.
  14448. *
  14449. * When working with HTML you should always
  14450. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14451. * XSS vectors.
  14452. *
  14453. * @static
  14454. * @since 0.1.0
  14455. * @memberOf _
  14456. * @category String
  14457. * @param {string} [string=''] The string to escape.
  14458. * @returns {string} Returns the escaped string.
  14459. * @example
  14460. *
  14461. * _.escape('fred, barney, & pebbles');
  14462. * // => 'fred, barney, &amp; pebbles'
  14463. */
  14464. function escape(string) {
  14465. string = toString(string);
  14466. return (string && reHasUnescapedHtml.test(string))
  14467. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14468. : string;
  14469. }
  14470. /**
  14471. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14472. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14473. *
  14474. * @static
  14475. * @memberOf _
  14476. * @since 3.0.0
  14477. * @category String
  14478. * @param {string} [string=''] The string to escape.
  14479. * @returns {string} Returns the escaped string.
  14480. * @example
  14481. *
  14482. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14483. * // => '\[lodash\]\(https://lodash\.com/\)'
  14484. */
  14485. function escapeRegExp(string) {
  14486. string = toString(string);
  14487. return (string && reHasRegExpChar.test(string))
  14488. ? string.replace(reRegExpChar, '\\$&')
  14489. : string;
  14490. }
  14491. /**
  14492. * Converts `string` to
  14493. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14494. *
  14495. * @static
  14496. * @memberOf _
  14497. * @since 3.0.0
  14498. * @category String
  14499. * @param {string} [string=''] The string to convert.
  14500. * @returns {string} Returns the kebab cased string.
  14501. * @example
  14502. *
  14503. * _.kebabCase('Foo Bar');
  14504. * // => 'foo-bar'
  14505. *
  14506. * _.kebabCase('fooBar');
  14507. * // => 'foo-bar'
  14508. *
  14509. * _.kebabCase('__FOO_BAR__');
  14510. * // => 'foo-bar'
  14511. */
  14512. var kebabCase = createCompounder(function(result, word, index) {
  14513. return result + (index ? '-' : '') + word.toLowerCase();
  14514. });
  14515. /**
  14516. * Converts `string`, as space separated words, to lower case.
  14517. *
  14518. * @static
  14519. * @memberOf _
  14520. * @since 4.0.0
  14521. * @category String
  14522. * @param {string} [string=''] The string to convert.
  14523. * @returns {string} Returns the lower cased string.
  14524. * @example
  14525. *
  14526. * _.lowerCase('--Foo-Bar--');
  14527. * // => 'foo bar'
  14528. *
  14529. * _.lowerCase('fooBar');
  14530. * // => 'foo bar'
  14531. *
  14532. * _.lowerCase('__FOO_BAR__');
  14533. * // => 'foo bar'
  14534. */
  14535. var lowerCase = createCompounder(function(result, word, index) {
  14536. return result + (index ? ' ' : '') + word.toLowerCase();
  14537. });
  14538. /**
  14539. * Converts the first character of `string` to lower case.
  14540. *
  14541. * @static
  14542. * @memberOf _
  14543. * @since 4.0.0
  14544. * @category String
  14545. * @param {string} [string=''] The string to convert.
  14546. * @returns {string} Returns the converted string.
  14547. * @example
  14548. *
  14549. * _.lowerFirst('Fred');
  14550. * // => 'fred'
  14551. *
  14552. * _.lowerFirst('FRED');
  14553. * // => 'fRED'
  14554. */
  14555. var lowerFirst = createCaseFirst('toLowerCase');
  14556. /**
  14557. * Pads `string` on the left and right sides if it's shorter than `length`.
  14558. * Padding characters are truncated if they can't be evenly divided by `length`.
  14559. *
  14560. * @static
  14561. * @memberOf _
  14562. * @since 3.0.0
  14563. * @category String
  14564. * @param {string} [string=''] The string to pad.
  14565. * @param {number} [length=0] The padding length.
  14566. * @param {string} [chars=' '] The string used as padding.
  14567. * @returns {string} Returns the padded string.
  14568. * @example
  14569. *
  14570. * _.pad('abc', 8);
  14571. * // => ' abc '
  14572. *
  14573. * _.pad('abc', 8, '_-');
  14574. * // => '_-abc_-_'
  14575. *
  14576. * _.pad('abc', 3);
  14577. * // => 'abc'
  14578. */
  14579. function pad(string, length, chars) {
  14580. string = toString(string);
  14581. length = toInteger(length);
  14582. var strLength = length ? stringSize(string) : 0;
  14583. if (!length || strLength >= length) {
  14584. return string;
  14585. }
  14586. var mid = (length - strLength) / 2;
  14587. return (
  14588. createPadding(nativeFloor(mid), chars) +
  14589. string +
  14590. createPadding(nativeCeil(mid), chars)
  14591. );
  14592. }
  14593. /**
  14594. * Pads `string` on the right side if it's shorter than `length`. Padding
  14595. * characters are truncated if they exceed `length`.
  14596. *
  14597. * @static
  14598. * @memberOf _
  14599. * @since 4.0.0
  14600. * @category String
  14601. * @param {string} [string=''] The string to pad.
  14602. * @param {number} [length=0] The padding length.
  14603. * @param {string} [chars=' '] The string used as padding.
  14604. * @returns {string} Returns the padded string.
  14605. * @example
  14606. *
  14607. * _.padEnd('abc', 6);
  14608. * // => 'abc '
  14609. *
  14610. * _.padEnd('abc', 6, '_-');
  14611. * // => 'abc_-_'
  14612. *
  14613. * _.padEnd('abc', 3);
  14614. * // => 'abc'
  14615. */
  14616. function padEnd(string, length, chars) {
  14617. string = toString(string);
  14618. length = toInteger(length);
  14619. var strLength = length ? stringSize(string) : 0;
  14620. return (length && strLength < length)
  14621. ? (string + createPadding(length - strLength, chars))
  14622. : string;
  14623. }
  14624. /**
  14625. * Pads `string` on the left side if it's shorter than `length`. Padding
  14626. * characters are truncated if they exceed `length`.
  14627. *
  14628. * @static
  14629. * @memberOf _
  14630. * @since 4.0.0
  14631. * @category String
  14632. * @param {string} [string=''] The string to pad.
  14633. * @param {number} [length=0] The padding length.
  14634. * @param {string} [chars=' '] The string used as padding.
  14635. * @returns {string} Returns the padded string.
  14636. * @example
  14637. *
  14638. * _.padStart('abc', 6);
  14639. * // => ' abc'
  14640. *
  14641. * _.padStart('abc', 6, '_-');
  14642. * // => '_-_abc'
  14643. *
  14644. * _.padStart('abc', 3);
  14645. * // => 'abc'
  14646. */
  14647. function padStart(string, length, chars) {
  14648. string = toString(string);
  14649. length = toInteger(length);
  14650. var strLength = length ? stringSize(string) : 0;
  14651. return (length && strLength < length)
  14652. ? (createPadding(length - strLength, chars) + string)
  14653. : string;
  14654. }
  14655. /**
  14656. * Converts `string` to an integer of the specified radix. If `radix` is
  14657. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14658. * hexadecimal, in which case a `radix` of `16` is used.
  14659. *
  14660. * **Note:** This method aligns with the
  14661. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14662. *
  14663. * @static
  14664. * @memberOf _
  14665. * @since 1.1.0
  14666. * @category String
  14667. * @param {string} string The string to convert.
  14668. * @param {number} [radix=10] The radix to interpret `value` by.
  14669. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14670. * @returns {number} Returns the converted integer.
  14671. * @example
  14672. *
  14673. * _.parseInt('08');
  14674. * // => 8
  14675. *
  14676. * _.map(['6', '08', '10'], _.parseInt);
  14677. * // => [6, 8, 10]
  14678. */
  14679. function parseInt(string, radix, guard) {
  14680. if (guard || radix == null) {
  14681. radix = 0;
  14682. } else if (radix) {
  14683. radix = +radix;
  14684. }
  14685. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14686. }
  14687. /**
  14688. * Repeats the given string `n` times.
  14689. *
  14690. * @static
  14691. * @memberOf _
  14692. * @since 3.0.0
  14693. * @category String
  14694. * @param {string} [string=''] The string to repeat.
  14695. * @param {number} [n=1] The number of times to repeat the string.
  14696. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14697. * @returns {string} Returns the repeated string.
  14698. * @example
  14699. *
  14700. * _.repeat('*', 3);
  14701. * // => '***'
  14702. *
  14703. * _.repeat('abc', 2);
  14704. * // => 'abcabc'
  14705. *
  14706. * _.repeat('abc', 0);
  14707. * // => ''
  14708. */
  14709. function repeat(string, n, guard) {
  14710. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14711. n = 1;
  14712. } else {
  14713. n = toInteger(n);
  14714. }
  14715. return baseRepeat(toString(string), n);
  14716. }
  14717. /**
  14718. * Replaces matches for `pattern` in `string` with `replacement`.
  14719. *
  14720. * **Note:** This method is based on
  14721. * [`String#replace`](https://mdn.io/String/replace).
  14722. *
  14723. * @static
  14724. * @memberOf _
  14725. * @since 4.0.0
  14726. * @category String
  14727. * @param {string} [string=''] The string to modify.
  14728. * @param {RegExp|string} pattern The pattern to replace.
  14729. * @param {Function|string} replacement The match replacement.
  14730. * @returns {string} Returns the modified string.
  14731. * @example
  14732. *
  14733. * _.replace('Hi Fred', 'Fred', 'Barney');
  14734. * // => 'Hi Barney'
  14735. */
  14736. function replace() {
  14737. var args = arguments,
  14738. string = toString(args[0]);
  14739. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14740. }
  14741. /**
  14742. * Converts `string` to
  14743. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14744. *
  14745. * @static
  14746. * @memberOf _
  14747. * @since 3.0.0
  14748. * @category String
  14749. * @param {string} [string=''] The string to convert.
  14750. * @returns {string} Returns the snake cased string.
  14751. * @example
  14752. *
  14753. * _.snakeCase('Foo Bar');
  14754. * // => 'foo_bar'
  14755. *
  14756. * _.snakeCase('fooBar');
  14757. * // => 'foo_bar'
  14758. *
  14759. * _.snakeCase('--FOO-BAR--');
  14760. * // => 'foo_bar'
  14761. */
  14762. var snakeCase = createCompounder(function(result, word, index) {
  14763. return result + (index ? '_' : '') + word.toLowerCase();
  14764. });
  14765. /**
  14766. * Splits `string` by `separator`.
  14767. *
  14768. * **Note:** This method is based on
  14769. * [`String#split`](https://mdn.io/String/split).
  14770. *
  14771. * @static
  14772. * @memberOf _
  14773. * @since 4.0.0
  14774. * @category String
  14775. * @param {string} [string=''] The string to split.
  14776. * @param {RegExp|string} separator The separator pattern to split by.
  14777. * @param {number} [limit] The length to truncate results to.
  14778. * @returns {Array} Returns the string segments.
  14779. * @example
  14780. *
  14781. * _.split('a-b-c', '-', 2);
  14782. * // => ['a', 'b']
  14783. */
  14784. function split(string, separator, limit) {
  14785. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14786. separator = limit = undefined;
  14787. }
  14788. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14789. if (!limit) {
  14790. return [];
  14791. }
  14792. string = toString(string);
  14793. if (string && (
  14794. typeof separator == 'string' ||
  14795. (separator != null && !isRegExp(separator))
  14796. )) {
  14797. separator = baseToString(separator);
  14798. if (!separator && hasUnicode(string)) {
  14799. return castSlice(stringToArray(string), 0, limit);
  14800. }
  14801. }
  14802. return string.split(separator, limit);
  14803. }
  14804. /**
  14805. * Converts `string` to
  14806. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14807. *
  14808. * @static
  14809. * @memberOf _
  14810. * @since 3.1.0
  14811. * @category String
  14812. * @param {string} [string=''] The string to convert.
  14813. * @returns {string} Returns the start cased string.
  14814. * @example
  14815. *
  14816. * _.startCase('--foo-bar--');
  14817. * // => 'Foo Bar'
  14818. *
  14819. * _.startCase('fooBar');
  14820. * // => 'Foo Bar'
  14821. *
  14822. * _.startCase('__FOO_BAR__');
  14823. * // => 'FOO BAR'
  14824. */
  14825. var startCase = createCompounder(function(result, word, index) {
  14826. return result + (index ? ' ' : '') + upperFirst(word);
  14827. });
  14828. /**
  14829. * Checks if `string` starts with the given target string.
  14830. *
  14831. * @static
  14832. * @memberOf _
  14833. * @since 3.0.0
  14834. * @category String
  14835. * @param {string} [string=''] The string to inspect.
  14836. * @param {string} [target] The string to search for.
  14837. * @param {number} [position=0] The position to search from.
  14838. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14839. * else `false`.
  14840. * @example
  14841. *
  14842. * _.startsWith('abc', 'a');
  14843. * // => true
  14844. *
  14845. * _.startsWith('abc', 'b');
  14846. * // => false
  14847. *
  14848. * _.startsWith('abc', 'b', 1);
  14849. * // => true
  14850. */
  14851. function startsWith(string, target, position) {
  14852. string = toString(string);
  14853. position = position == null
  14854. ? 0
  14855. : baseClamp(toInteger(position), 0, string.length);
  14856. target = baseToString(target);
  14857. return string.slice(position, position + target.length) == target;
  14858. }
  14859. /**
  14860. * Creates a compiled template function that can interpolate data properties
  14861. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14862. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14863. * properties may be accessed as free variables in the template. If a setting
  14864. * object is given, it takes precedence over `_.templateSettings` values.
  14865. *
  14866. * **Note:** In the development build `_.template` utilizes
  14867. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14868. * for easier debugging.
  14869. *
  14870. * For more information on precompiling templates see
  14871. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14872. *
  14873. * For more information on Chrome extension sandboxes see
  14874. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14875. *
  14876. * @static
  14877. * @since 0.1.0
  14878. * @memberOf _
  14879. * @category String
  14880. * @param {string} [string=''] The template string.
  14881. * @param {Object} [options={}] The options object.
  14882. * @param {RegExp} [options.escape=_.templateSettings.escape]
  14883. * The HTML "escape" delimiter.
  14884. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  14885. * The "evaluate" delimiter.
  14886. * @param {Object} [options.imports=_.templateSettings.imports]
  14887. * An object to import into the template as free variables.
  14888. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  14889. * The "interpolate" delimiter.
  14890. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  14891. * The sourceURL of the compiled template.
  14892. * @param {string} [options.variable='obj']
  14893. * The data object variable name.
  14894. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14895. * @returns {Function} Returns the compiled template function.
  14896. * @example
  14897. *
  14898. * // Use the "interpolate" delimiter to create a compiled template.
  14899. * var compiled = _.template('hello <%= user %>!');
  14900. * compiled({ 'user': 'fred' });
  14901. * // => 'hello fred!'
  14902. *
  14903. * // Use the HTML "escape" delimiter to escape data property values.
  14904. * var compiled = _.template('<b><%- value %></b>');
  14905. * compiled({ 'value': '<script>' });
  14906. * // => '<b>&lt;script&gt;</b>'
  14907. *
  14908. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  14909. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  14910. * compiled({ 'users': ['fred', 'barney'] });
  14911. * // => '<li>fred</li><li>barney</li>'
  14912. *
  14913. * // Use the internal `print` function in "evaluate" delimiters.
  14914. * var compiled = _.template('<% print("hello " + user); %>!');
  14915. * compiled({ 'user': 'barney' });
  14916. * // => 'hello barney!'
  14917. *
  14918. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  14919. * // Disable support by replacing the "interpolate" delimiter.
  14920. * var compiled = _.template('hello ${ user }!');
  14921. * compiled({ 'user': 'pebbles' });
  14922. * // => 'hello pebbles!'
  14923. *
  14924. * // Use backslashes to treat delimiters as plain text.
  14925. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  14926. * compiled({ 'value': 'ignored' });
  14927. * // => '<%- value %>'
  14928. *
  14929. * // Use the `imports` option to import `jQuery` as `jq`.
  14930. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  14931. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  14932. * compiled({ 'users': ['fred', 'barney'] });
  14933. * // => '<li>fred</li><li>barney</li>'
  14934. *
  14935. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  14936. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  14937. * compiled(data);
  14938. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  14939. *
  14940. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  14941. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  14942. * compiled.source;
  14943. * // => function(data) {
  14944. * // var __t, __p = '';
  14945. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  14946. * // return __p;
  14947. * // }
  14948. *
  14949. * // Use custom template delimiters.
  14950. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  14951. * var compiled = _.template('hello {{ user }}!');
  14952. * compiled({ 'user': 'mustache' });
  14953. * // => 'hello mustache!'
  14954. *
  14955. * // Use the `source` property to inline compiled templates for meaningful
  14956. * // line numbers in error messages and stack traces.
  14957. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  14958. * var JST = {\
  14959. * "main": ' + _.template(mainText).source + '\
  14960. * };\
  14961. * ');
  14962. */
  14963. function template(string, options, guard) {
  14964. // Based on John Resig's `tmpl` implementation
  14965. // (http://ejohn.org/blog/javascript-micro-templating/)
  14966. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  14967. var settings = lodash.templateSettings;
  14968. if (guard && isIterateeCall(string, options, guard)) {
  14969. options = undefined;
  14970. }
  14971. string = toString(string);
  14972. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  14973. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  14974. importsKeys = keys(imports),
  14975. importsValues = baseValues(imports, importsKeys);
  14976. var isEscaping,
  14977. isEvaluating,
  14978. index = 0,
  14979. interpolate = options.interpolate || reNoMatch,
  14980. source = "__p += '";
  14981. // Compile the regexp to match each delimiter.
  14982. var reDelimiters = RegExp(
  14983. (options.escape || reNoMatch).source + '|' +
  14984. interpolate.source + '|' +
  14985. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  14986. (options.evaluate || reNoMatch).source + '|$'
  14987. , 'g');
  14988. // Use a sourceURL for easier debugging.
  14989. // The sourceURL gets injected into the source that's eval-ed, so be careful
  14990. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  14991. // and escape the comment, thus injecting code that gets evaled.
  14992. var sourceURL = '//# sourceURL=' +
  14993. (hasOwnProperty.call(options, 'sourceURL')
  14994. ? (options.sourceURL + '').replace(/\s/g, ' ')
  14995. : ('lodash.templateSources[' + (++templateCounter) + ']')
  14996. ) + '\n';
  14997. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  14998. interpolateValue || (interpolateValue = esTemplateValue);
  14999. // Escape characters that can't be included in string literals.
  15000. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15001. // Replace delimiters with snippets.
  15002. if (escapeValue) {
  15003. isEscaping = true;
  15004. source += "' +\n__e(" + escapeValue + ") +\n'";
  15005. }
  15006. if (evaluateValue) {
  15007. isEvaluating = true;
  15008. source += "';\n" + evaluateValue + ";\n__p += '";
  15009. }
  15010. if (interpolateValue) {
  15011. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15012. }
  15013. index = offset + match.length;
  15014. // The JS engine embedded in Adobe products needs `match` returned in
  15015. // order to produce the correct `offset` value.
  15016. return match;
  15017. });
  15018. source += "';\n";
  15019. // If `variable` is not specified wrap a with-statement around the generated
  15020. // code to add the data object to the top of the scope chain.
  15021. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15022. if (!variable) {
  15023. source = 'with (obj) {\n' + source + '\n}\n';
  15024. }
  15025. // Throw an error if a forbidden character was found in `variable`, to prevent
  15026. // potential command injection attacks.
  15027. else if (reForbiddenIdentifierChars.test(variable)) {
  15028. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15029. }
  15030. // Cleanup code by stripping empty strings.
  15031. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15032. .replace(reEmptyStringMiddle, '$1')
  15033. .replace(reEmptyStringTrailing, '$1;');
  15034. // Frame code as the function body.
  15035. source = 'function(' + (variable || 'obj') + ') {\n' +
  15036. (variable
  15037. ? ''
  15038. : 'obj || (obj = {});\n'
  15039. ) +
  15040. "var __t, __p = ''" +
  15041. (isEscaping
  15042. ? ', __e = _.escape'
  15043. : ''
  15044. ) +
  15045. (isEvaluating
  15046. ? ', __j = Array.prototype.join;\n' +
  15047. "function print() { __p += __j.call(arguments, '') }\n"
  15048. : ';\n'
  15049. ) +
  15050. source +
  15051. 'return __p\n}';
  15052. var result = attempt(function() {
  15053. return Function(importsKeys, sourceURL + 'return ' + source)
  15054. .apply(undefined, importsValues);
  15055. });
  15056. // Provide the compiled function's source by its `toString` method or
  15057. // the `source` property as a convenience for inlining compiled templates.
  15058. result.source = source;
  15059. if (isError(result)) {
  15060. throw result;
  15061. }
  15062. return result;
  15063. }
  15064. /**
  15065. * Converts `string`, as a whole, to lower case just like
  15066. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15067. *
  15068. * @static
  15069. * @memberOf _
  15070. * @since 4.0.0
  15071. * @category String
  15072. * @param {string} [string=''] The string to convert.
  15073. * @returns {string} Returns the lower cased string.
  15074. * @example
  15075. *
  15076. * _.toLower('--Foo-Bar--');
  15077. * // => '--foo-bar--'
  15078. *
  15079. * _.toLower('fooBar');
  15080. * // => 'foobar'
  15081. *
  15082. * _.toLower('__FOO_BAR__');
  15083. * // => '__foo_bar__'
  15084. */
  15085. function toLower(value) {
  15086. return toString(value).toLowerCase();
  15087. }
  15088. /**
  15089. * Converts `string`, as a whole, to upper case just like
  15090. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15091. *
  15092. * @static
  15093. * @memberOf _
  15094. * @since 4.0.0
  15095. * @category String
  15096. * @param {string} [string=''] The string to convert.
  15097. * @returns {string} Returns the upper cased string.
  15098. * @example
  15099. *
  15100. * _.toUpper('--foo-bar--');
  15101. * // => '--FOO-BAR--'
  15102. *
  15103. * _.toUpper('fooBar');
  15104. * // => 'FOOBAR'
  15105. *
  15106. * _.toUpper('__foo_bar__');
  15107. * // => '__FOO_BAR__'
  15108. */
  15109. function toUpper(value) {
  15110. return toString(value).toUpperCase();
  15111. }
  15112. /**
  15113. * Removes leading and trailing whitespace or specified characters from `string`.
  15114. *
  15115. * @static
  15116. * @memberOf _
  15117. * @since 3.0.0
  15118. * @category String
  15119. * @param {string} [string=''] The string to trim.
  15120. * @param {string} [chars=whitespace] The characters to trim.
  15121. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15122. * @returns {string} Returns the trimmed string.
  15123. * @example
  15124. *
  15125. * _.trim(' abc ');
  15126. * // => 'abc'
  15127. *
  15128. * _.trim('-_-abc-_-', '_-');
  15129. * // => 'abc'
  15130. *
  15131. * _.map([' foo ', ' bar '], _.trim);
  15132. * // => ['foo', 'bar']
  15133. */
  15134. function trim(string, chars, guard) {
  15135. string = toString(string);
  15136. if (string && (guard || chars === undefined)) {
  15137. return baseTrim(string);
  15138. }
  15139. if (!string || !(chars = baseToString(chars))) {
  15140. return string;
  15141. }
  15142. var strSymbols = stringToArray(string),
  15143. chrSymbols = stringToArray(chars),
  15144. start = charsStartIndex(strSymbols, chrSymbols),
  15145. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15146. return castSlice(strSymbols, start, end).join('');
  15147. }
  15148. /**
  15149. * Removes trailing whitespace or specified characters from `string`.
  15150. *
  15151. * @static
  15152. * @memberOf _
  15153. * @since 4.0.0
  15154. * @category String
  15155. * @param {string} [string=''] The string to trim.
  15156. * @param {string} [chars=whitespace] The characters to trim.
  15157. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15158. * @returns {string} Returns the trimmed string.
  15159. * @example
  15160. *
  15161. * _.trimEnd(' abc ');
  15162. * // => ' abc'
  15163. *
  15164. * _.trimEnd('-_-abc-_-', '_-');
  15165. * // => '-_-abc'
  15166. */
  15167. function trimEnd(string, chars, guard) {
  15168. string = toString(string);
  15169. if (string && (guard || chars === undefined)) {
  15170. return string.slice(0, trimmedEndIndex(string) + 1);
  15171. }
  15172. if (!string || !(chars = baseToString(chars))) {
  15173. return string;
  15174. }
  15175. var strSymbols = stringToArray(string),
  15176. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15177. return castSlice(strSymbols, 0, end).join('');
  15178. }
  15179. /**
  15180. * Removes leading whitespace or specified characters from `string`.
  15181. *
  15182. * @static
  15183. * @memberOf _
  15184. * @since 4.0.0
  15185. * @category String
  15186. * @param {string} [string=''] The string to trim.
  15187. * @param {string} [chars=whitespace] The characters to trim.
  15188. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15189. * @returns {string} Returns the trimmed string.
  15190. * @example
  15191. *
  15192. * _.trimStart(' abc ');
  15193. * // => 'abc '
  15194. *
  15195. * _.trimStart('-_-abc-_-', '_-');
  15196. * // => 'abc-_-'
  15197. */
  15198. function trimStart(string, chars, guard) {
  15199. string = toString(string);
  15200. if (string && (guard || chars === undefined)) {
  15201. return string.replace(reTrimStart, '');
  15202. }
  15203. if (!string || !(chars = baseToString(chars))) {
  15204. return string;
  15205. }
  15206. var strSymbols = stringToArray(string),
  15207. start = charsStartIndex(strSymbols, stringToArray(chars));
  15208. return castSlice(strSymbols, start).join('');
  15209. }
  15210. /**
  15211. * Truncates `string` if it's longer than the given maximum string length.
  15212. * The last characters of the truncated string are replaced with the omission
  15213. * string which defaults to "...".
  15214. *
  15215. * @static
  15216. * @memberOf _
  15217. * @since 4.0.0
  15218. * @category String
  15219. * @param {string} [string=''] The string to truncate.
  15220. * @param {Object} [options={}] The options object.
  15221. * @param {number} [options.length=30] The maximum string length.
  15222. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15223. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15224. * @returns {string} Returns the truncated string.
  15225. * @example
  15226. *
  15227. * _.truncate('hi-diddly-ho there, neighborino');
  15228. * // => 'hi-diddly-ho there, neighbo...'
  15229. *
  15230. * _.truncate('hi-diddly-ho there, neighborino', {
  15231. * 'length': 24,
  15232. * 'separator': ' '
  15233. * });
  15234. * // => 'hi-diddly-ho there,...'
  15235. *
  15236. * _.truncate('hi-diddly-ho there, neighborino', {
  15237. * 'length': 24,
  15238. * 'separator': /,? +/
  15239. * });
  15240. * // => 'hi-diddly-ho there...'
  15241. *
  15242. * _.truncate('hi-diddly-ho there, neighborino', {
  15243. * 'omission': ' [...]'
  15244. * });
  15245. * // => 'hi-diddly-ho there, neig [...]'
  15246. */
  15247. function truncate(string, options) {
  15248. var length = DEFAULT_TRUNC_LENGTH,
  15249. omission = DEFAULT_TRUNC_OMISSION;
  15250. if (isObject(options)) {
  15251. var separator = 'separator' in options ? options.separator : separator;
  15252. length = 'length' in options ? toInteger(options.length) : length;
  15253. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15254. }
  15255. string = toString(string);
  15256. var strLength = string.length;
  15257. if (hasUnicode(string)) {
  15258. var strSymbols = stringToArray(string);
  15259. strLength = strSymbols.length;
  15260. }
  15261. if (length >= strLength) {
  15262. return string;
  15263. }
  15264. var end = length - stringSize(omission);
  15265. if (end < 1) {
  15266. return omission;
  15267. }
  15268. var result = strSymbols
  15269. ? castSlice(strSymbols, 0, end).join('')
  15270. : string.slice(0, end);
  15271. if (separator === undefined) {
  15272. return result + omission;
  15273. }
  15274. if (strSymbols) {
  15275. end += (result.length - end);
  15276. }
  15277. if (isRegExp(separator)) {
  15278. if (string.slice(end).search(separator)) {
  15279. var match,
  15280. substring = result;
  15281. if (!separator.global) {
  15282. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15283. }
  15284. separator.lastIndex = 0;
  15285. while ((match = separator.exec(substring))) {
  15286. var newEnd = match.index;
  15287. }
  15288. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15289. }
  15290. } else if (string.indexOf(baseToString(separator), end) != end) {
  15291. var index = result.lastIndexOf(separator);
  15292. if (index > -1) {
  15293. result = result.slice(0, index);
  15294. }
  15295. }
  15296. return result + omission;
  15297. }
  15298. /**
  15299. * The inverse of `_.escape`; this method converts the HTML entities
  15300. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15301. * their corresponding characters.
  15302. *
  15303. * **Note:** No other HTML entities are unescaped. To unescape additional
  15304. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15305. *
  15306. * @static
  15307. * @memberOf _
  15308. * @since 0.6.0
  15309. * @category String
  15310. * @param {string} [string=''] The string to unescape.
  15311. * @returns {string} Returns the unescaped string.
  15312. * @example
  15313. *
  15314. * _.unescape('fred, barney, &amp; pebbles');
  15315. * // => 'fred, barney, & pebbles'
  15316. */
  15317. function unescape(string) {
  15318. string = toString(string);
  15319. return (string && reHasEscapedHtml.test(string))
  15320. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15321. : string;
  15322. }
  15323. /**
  15324. * Converts `string`, as space separated words, to upper case.
  15325. *
  15326. * @static
  15327. * @memberOf _
  15328. * @since 4.0.0
  15329. * @category String
  15330. * @param {string} [string=''] The string to convert.
  15331. * @returns {string} Returns the upper cased string.
  15332. * @example
  15333. *
  15334. * _.upperCase('--foo-bar');
  15335. * // => 'FOO BAR'
  15336. *
  15337. * _.upperCase('fooBar');
  15338. * // => 'FOO BAR'
  15339. *
  15340. * _.upperCase('__foo_bar__');
  15341. * // => 'FOO BAR'
  15342. */
  15343. var upperCase = createCompounder(function(result, word, index) {
  15344. return result + (index ? ' ' : '') + word.toUpperCase();
  15345. });
  15346. /**
  15347. * Converts the first character of `string` to upper case.
  15348. *
  15349. * @static
  15350. * @memberOf _
  15351. * @since 4.0.0
  15352. * @category String
  15353. * @param {string} [string=''] The string to convert.
  15354. * @returns {string} Returns the converted string.
  15355. * @example
  15356. *
  15357. * _.upperFirst('fred');
  15358. * // => 'Fred'
  15359. *
  15360. * _.upperFirst('FRED');
  15361. * // => 'FRED'
  15362. */
  15363. var upperFirst = createCaseFirst('toUpperCase');
  15364. /**
  15365. * Splits `string` into an array of its words.
  15366. *
  15367. * @static
  15368. * @memberOf _
  15369. * @since 3.0.0
  15370. * @category String
  15371. * @param {string} [string=''] The string to inspect.
  15372. * @param {RegExp|string} [pattern] The pattern to match words.
  15373. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15374. * @returns {Array} Returns the words of `string`.
  15375. * @example
  15376. *
  15377. * _.words('fred, barney, & pebbles');
  15378. * // => ['fred', 'barney', 'pebbles']
  15379. *
  15380. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15381. * // => ['fred', 'barney', '&', 'pebbles']
  15382. */
  15383. function words(string, pattern, guard) {
  15384. string = toString(string);
  15385. pattern = guard ? undefined : pattern;
  15386. if (pattern === undefined) {
  15387. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15388. }
  15389. return string.match(pattern) || [];
  15390. }
  15391. /*------------------------------------------------------------------------*/
  15392. /**
  15393. * Attempts to invoke `func`, returning either the result or the caught error
  15394. * object. Any additional arguments are provided to `func` when it's invoked.
  15395. *
  15396. * @static
  15397. * @memberOf _
  15398. * @since 3.0.0
  15399. * @category Util
  15400. * @param {Function} func The function to attempt.
  15401. * @param {...*} [args] The arguments to invoke `func` with.
  15402. * @returns {*} Returns the `func` result or error object.
  15403. * @example
  15404. *
  15405. * // Avoid throwing errors for invalid selectors.
  15406. * var elements = _.attempt(function(selector) {
  15407. * return document.querySelectorAll(selector);
  15408. * }, '>_>');
  15409. *
  15410. * if (_.isError(elements)) {
  15411. * elements = [];
  15412. * }
  15413. */
  15414. var attempt = baseRest(function(func, args) {
  15415. try {
  15416. return apply(func, undefined, args);
  15417. } catch (e) {
  15418. return isError(e) ? e : new Error(e);
  15419. }
  15420. });
  15421. /**
  15422. * Binds methods of an object to the object itself, overwriting the existing
  15423. * method.
  15424. *
  15425. * **Note:** This method doesn't set the "length" property of bound functions.
  15426. *
  15427. * @static
  15428. * @since 0.1.0
  15429. * @memberOf _
  15430. * @category Util
  15431. * @param {Object} object The object to bind and assign the bound methods to.
  15432. * @param {...(string|string[])} methodNames The object method names to bind.
  15433. * @returns {Object} Returns `object`.
  15434. * @example
  15435. *
  15436. * var view = {
  15437. * 'label': 'docs',
  15438. * 'click': function() {
  15439. * console.log('clicked ' + this.label);
  15440. * }
  15441. * };
  15442. *
  15443. * _.bindAll(view, ['click']);
  15444. * jQuery(element).on('click', view.click);
  15445. * // => Logs 'clicked docs' when clicked.
  15446. */
  15447. var bindAll = flatRest(function(object, methodNames) {
  15448. arrayEach(methodNames, function(key) {
  15449. key = toKey(key);
  15450. baseAssignValue(object, key, bind(object[key], object));
  15451. });
  15452. return object;
  15453. });
  15454. /**
  15455. * Creates a function that iterates over `pairs` and invokes the corresponding
  15456. * function of the first predicate to return truthy. The predicate-function
  15457. * pairs are invoked with the `this` binding and arguments of the created
  15458. * function.
  15459. *
  15460. * @static
  15461. * @memberOf _
  15462. * @since 4.0.0
  15463. * @category Util
  15464. * @param {Array} pairs The predicate-function pairs.
  15465. * @returns {Function} Returns the new composite function.
  15466. * @example
  15467. *
  15468. * var func = _.cond([
  15469. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15470. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15471. * [_.stubTrue, _.constant('no match')]
  15472. * ]);
  15473. *
  15474. * func({ 'a': 1, 'b': 2 });
  15475. * // => 'matches A'
  15476. *
  15477. * func({ 'a': 0, 'b': 1 });
  15478. * // => 'matches B'
  15479. *
  15480. * func({ 'a': '1', 'b': '2' });
  15481. * // => 'no match'
  15482. */
  15483. function cond(pairs) {
  15484. var length = pairs == null ? 0 : pairs.length,
  15485. toIteratee = getIteratee();
  15486. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15487. if (typeof pair[1] != 'function') {
  15488. throw new TypeError(FUNC_ERROR_TEXT);
  15489. }
  15490. return [toIteratee(pair[0]), pair[1]];
  15491. });
  15492. return baseRest(function(args) {
  15493. var index = -1;
  15494. while (++index < length) {
  15495. var pair = pairs[index];
  15496. if (apply(pair[0], this, args)) {
  15497. return apply(pair[1], this, args);
  15498. }
  15499. }
  15500. });
  15501. }
  15502. /**
  15503. * Creates a function that invokes the predicate properties of `source` with
  15504. * the corresponding property values of a given object, returning `true` if
  15505. * all predicates return truthy, else `false`.
  15506. *
  15507. * **Note:** The created function is equivalent to `_.conformsTo` with
  15508. * `source` partially applied.
  15509. *
  15510. * @static
  15511. * @memberOf _
  15512. * @since 4.0.0
  15513. * @category Util
  15514. * @param {Object} source The object of property predicates to conform to.
  15515. * @returns {Function} Returns the new spec function.
  15516. * @example
  15517. *
  15518. * var objects = [
  15519. * { 'a': 2, 'b': 1 },
  15520. * { 'a': 1, 'b': 2 }
  15521. * ];
  15522. *
  15523. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15524. * // => [{ 'a': 1, 'b': 2 }]
  15525. */
  15526. function conforms(source) {
  15527. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15528. }
  15529. /**
  15530. * Creates a function that returns `value`.
  15531. *
  15532. * @static
  15533. * @memberOf _
  15534. * @since 2.4.0
  15535. * @category Util
  15536. * @param {*} value The value to return from the new function.
  15537. * @returns {Function} Returns the new constant function.
  15538. * @example
  15539. *
  15540. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15541. *
  15542. * console.log(objects);
  15543. * // => [{ 'a': 1 }, { 'a': 1 }]
  15544. *
  15545. * console.log(objects[0] === objects[1]);
  15546. * // => true
  15547. */
  15548. function constant(value) {
  15549. return function() {
  15550. return value;
  15551. };
  15552. }
  15553. /**
  15554. * Checks `value` to determine whether a default value should be returned in
  15555. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15556. * or `undefined`.
  15557. *
  15558. * @static
  15559. * @memberOf _
  15560. * @since 4.14.0
  15561. * @category Util
  15562. * @param {*} value The value to check.
  15563. * @param {*} defaultValue The default value.
  15564. * @returns {*} Returns the resolved value.
  15565. * @example
  15566. *
  15567. * _.defaultTo(1, 10);
  15568. * // => 1
  15569. *
  15570. * _.defaultTo(undefined, 10);
  15571. * // => 10
  15572. */
  15573. function defaultTo(value, defaultValue) {
  15574. return (value == null || value !== value) ? defaultValue : value;
  15575. }
  15576. /**
  15577. * Creates a function that returns the result of invoking the given functions
  15578. * with the `this` binding of the created function, where each successive
  15579. * invocation is supplied the return value of the previous.
  15580. *
  15581. * @static
  15582. * @memberOf _
  15583. * @since 3.0.0
  15584. * @category Util
  15585. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15586. * @returns {Function} Returns the new composite function.
  15587. * @see _.flowRight
  15588. * @example
  15589. *
  15590. * function square(n) {
  15591. * return n * n;
  15592. * }
  15593. *
  15594. * var addSquare = _.flow([_.add, square]);
  15595. * addSquare(1, 2);
  15596. * // => 9
  15597. */
  15598. var flow = createFlow();
  15599. /**
  15600. * This method is like `_.flow` except that it creates a function that
  15601. * invokes the given functions from right to left.
  15602. *
  15603. * @static
  15604. * @since 3.0.0
  15605. * @memberOf _
  15606. * @category Util
  15607. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15608. * @returns {Function} Returns the new composite function.
  15609. * @see _.flow
  15610. * @example
  15611. *
  15612. * function square(n) {
  15613. * return n * n;
  15614. * }
  15615. *
  15616. * var addSquare = _.flowRight([square, _.add]);
  15617. * addSquare(1, 2);
  15618. * // => 9
  15619. */
  15620. var flowRight = createFlow(true);
  15621. /**
  15622. * This method returns the first argument it receives.
  15623. *
  15624. * @static
  15625. * @since 0.1.0
  15626. * @memberOf _
  15627. * @category Util
  15628. * @param {*} value Any value.
  15629. * @returns {*} Returns `value`.
  15630. * @example
  15631. *
  15632. * var object = { 'a': 1 };
  15633. *
  15634. * console.log(_.identity(object) === object);
  15635. * // => true
  15636. */
  15637. function identity(value) {
  15638. return value;
  15639. }
  15640. /**
  15641. * Creates a function that invokes `func` with the arguments of the created
  15642. * function. If `func` is a property name, the created function returns the
  15643. * property value for a given element. If `func` is an array or object, the
  15644. * created function returns `true` for elements that contain the equivalent
  15645. * source properties, otherwise it returns `false`.
  15646. *
  15647. * @static
  15648. * @since 4.0.0
  15649. * @memberOf _
  15650. * @category Util
  15651. * @param {*} [func=_.identity] The value to convert to a callback.
  15652. * @returns {Function} Returns the callback.
  15653. * @example
  15654. *
  15655. * var users = [
  15656. * { 'user': 'barney', 'age': 36, 'active': true },
  15657. * { 'user': 'fred', 'age': 40, 'active': false }
  15658. * ];
  15659. *
  15660. * // The `_.matches` iteratee shorthand.
  15661. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15662. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15663. *
  15664. * // The `_.matchesProperty` iteratee shorthand.
  15665. * _.filter(users, _.iteratee(['user', 'fred']));
  15666. * // => [{ 'user': 'fred', 'age': 40 }]
  15667. *
  15668. * // The `_.property` iteratee shorthand.
  15669. * _.map(users, _.iteratee('user'));
  15670. * // => ['barney', 'fred']
  15671. *
  15672. * // Create custom iteratee shorthands.
  15673. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15674. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15675. * return func.test(string);
  15676. * };
  15677. * });
  15678. *
  15679. * _.filter(['abc', 'def'], /ef/);
  15680. * // => ['def']
  15681. */
  15682. function iteratee(func) {
  15683. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15684. }
  15685. /**
  15686. * Creates a function that performs a partial deep comparison between a given
  15687. * object and `source`, returning `true` if the given object has equivalent
  15688. * property values, else `false`.
  15689. *
  15690. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15691. * partially applied.
  15692. *
  15693. * Partial comparisons will match empty array and empty object `source`
  15694. * values against any array or object value, respectively. See `_.isEqual`
  15695. * for a list of supported value comparisons.
  15696. *
  15697. * **Note:** Multiple values can be checked by combining several matchers
  15698. * using `_.overSome`
  15699. *
  15700. * @static
  15701. * @memberOf _
  15702. * @since 3.0.0
  15703. * @category Util
  15704. * @param {Object} source The object of property values to match.
  15705. * @returns {Function} Returns the new spec function.
  15706. * @example
  15707. *
  15708. * var objects = [
  15709. * { 'a': 1, 'b': 2, 'c': 3 },
  15710. * { 'a': 4, 'b': 5, 'c': 6 }
  15711. * ];
  15712. *
  15713. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15714. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15715. *
  15716. * // Checking for several possible values
  15717. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15718. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15719. */
  15720. function matches(source) {
  15721. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15722. }
  15723. /**
  15724. * Creates a function that performs a partial deep comparison between the
  15725. * value at `path` of a given object to `srcValue`, returning `true` if the
  15726. * object value is equivalent, else `false`.
  15727. *
  15728. * **Note:** Partial comparisons will match empty array and empty object
  15729. * `srcValue` values against any array or object value, respectively. See
  15730. * `_.isEqual` for a list of supported value comparisons.
  15731. *
  15732. * **Note:** Multiple values can be checked by combining several matchers
  15733. * using `_.overSome`
  15734. *
  15735. * @static
  15736. * @memberOf _
  15737. * @since 3.2.0
  15738. * @category Util
  15739. * @param {Array|string} path The path of the property to get.
  15740. * @param {*} srcValue The value to match.
  15741. * @returns {Function} Returns the new spec function.
  15742. * @example
  15743. *
  15744. * var objects = [
  15745. * { 'a': 1, 'b': 2, 'c': 3 },
  15746. * { 'a': 4, 'b': 5, 'c': 6 }
  15747. * ];
  15748. *
  15749. * _.find(objects, _.matchesProperty('a', 4));
  15750. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15751. *
  15752. * // Checking for several possible values
  15753. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15754. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15755. */
  15756. function matchesProperty(path, srcValue) {
  15757. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15758. }
  15759. /**
  15760. * Creates a function that invokes the method at `path` of a given object.
  15761. * Any additional arguments are provided to the invoked method.
  15762. *
  15763. * @static
  15764. * @memberOf _
  15765. * @since 3.7.0
  15766. * @category Util
  15767. * @param {Array|string} path The path of the method to invoke.
  15768. * @param {...*} [args] The arguments to invoke the method with.
  15769. * @returns {Function} Returns the new invoker function.
  15770. * @example
  15771. *
  15772. * var objects = [
  15773. * { 'a': { 'b': _.constant(2) } },
  15774. * { 'a': { 'b': _.constant(1) } }
  15775. * ];
  15776. *
  15777. * _.map(objects, _.method('a.b'));
  15778. * // => [2, 1]
  15779. *
  15780. * _.map(objects, _.method(['a', 'b']));
  15781. * // => [2, 1]
  15782. */
  15783. var method = baseRest(function(path, args) {
  15784. return function(object) {
  15785. return baseInvoke(object, path, args);
  15786. };
  15787. });
  15788. /**
  15789. * The opposite of `_.method`; this method creates a function that invokes
  15790. * the method at a given path of `object`. Any additional arguments are
  15791. * provided to the invoked method.
  15792. *
  15793. * @static
  15794. * @memberOf _
  15795. * @since 3.7.0
  15796. * @category Util
  15797. * @param {Object} object The object to query.
  15798. * @param {...*} [args] The arguments to invoke the method with.
  15799. * @returns {Function} Returns the new invoker function.
  15800. * @example
  15801. *
  15802. * var array = _.times(3, _.constant),
  15803. * object = { 'a': array, 'b': array, 'c': array };
  15804. *
  15805. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15806. * // => [2, 0]
  15807. *
  15808. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15809. * // => [2, 0]
  15810. */
  15811. var methodOf = baseRest(function(object, args) {
  15812. return function(path) {
  15813. return baseInvoke(object, path, args);
  15814. };
  15815. });
  15816. /**
  15817. * Adds all own enumerable string keyed function properties of a source
  15818. * object to the destination object. If `object` is a function, then methods
  15819. * are added to its prototype as well.
  15820. *
  15821. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15822. * avoid conflicts caused by modifying the original.
  15823. *
  15824. * @static
  15825. * @since 0.1.0
  15826. * @memberOf _
  15827. * @category Util
  15828. * @param {Function|Object} [object=lodash] The destination object.
  15829. * @param {Object} source The object of functions to add.
  15830. * @param {Object} [options={}] The options object.
  15831. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15832. * @returns {Function|Object} Returns `object`.
  15833. * @example
  15834. *
  15835. * function vowels(string) {
  15836. * return _.filter(string, function(v) {
  15837. * return /[aeiou]/i.test(v);
  15838. * });
  15839. * }
  15840. *
  15841. * _.mixin({ 'vowels': vowels });
  15842. * _.vowels('fred');
  15843. * // => ['e']
  15844. *
  15845. * _('fred').vowels().value();
  15846. * // => ['e']
  15847. *
  15848. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15849. * _('fred').vowels();
  15850. * // => ['e']
  15851. */
  15852. function mixin(object, source, options) {
  15853. var props = keys(source),
  15854. methodNames = baseFunctions(source, props);
  15855. if (options == null &&
  15856. !(isObject(source) && (methodNames.length || !props.length))) {
  15857. options = source;
  15858. source = object;
  15859. object = this;
  15860. methodNames = baseFunctions(source, keys(source));
  15861. }
  15862. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15863. isFunc = isFunction(object);
  15864. arrayEach(methodNames, function(methodName) {
  15865. var func = source[methodName];
  15866. object[methodName] = func;
  15867. if (isFunc) {
  15868. object.prototype[methodName] = function() {
  15869. var chainAll = this.__chain__;
  15870. if (chain || chainAll) {
  15871. var result = object(this.__wrapped__),
  15872. actions = result.__actions__ = copyArray(this.__actions__);
  15873. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15874. result.__chain__ = chainAll;
  15875. return result;
  15876. }
  15877. return func.apply(object, arrayPush([this.value()], arguments));
  15878. };
  15879. }
  15880. });
  15881. return object;
  15882. }
  15883. /**
  15884. * Reverts the `_` variable to its previous value and returns a reference to
  15885. * the `lodash` function.
  15886. *
  15887. * @static
  15888. * @since 0.1.0
  15889. * @memberOf _
  15890. * @category Util
  15891. * @returns {Function} Returns the `lodash` function.
  15892. * @example
  15893. *
  15894. * var lodash = _.noConflict();
  15895. */
  15896. function noConflict() {
  15897. if (root._ === this) {
  15898. root._ = oldDash;
  15899. }
  15900. return this;
  15901. }
  15902. /**
  15903. * This method returns `undefined`.
  15904. *
  15905. * @static
  15906. * @memberOf _
  15907. * @since 2.3.0
  15908. * @category Util
  15909. * @example
  15910. *
  15911. * _.times(2, _.noop);
  15912. * // => [undefined, undefined]
  15913. */
  15914. function noop() {
  15915. // No operation performed.
  15916. }
  15917. /**
  15918. * Creates a function that gets the argument at index `n`. If `n` is negative,
  15919. * the nth argument from the end is returned.
  15920. *
  15921. * @static
  15922. * @memberOf _
  15923. * @since 4.0.0
  15924. * @category Util
  15925. * @param {number} [n=0] The index of the argument to return.
  15926. * @returns {Function} Returns the new pass-thru function.
  15927. * @example
  15928. *
  15929. * var func = _.nthArg(1);
  15930. * func('a', 'b', 'c', 'd');
  15931. * // => 'b'
  15932. *
  15933. * var func = _.nthArg(-2);
  15934. * func('a', 'b', 'c', 'd');
  15935. * // => 'c'
  15936. */
  15937. function nthArg(n) {
  15938. n = toInteger(n);
  15939. return baseRest(function(args) {
  15940. return baseNth(args, n);
  15941. });
  15942. }
  15943. /**
  15944. * Creates a function that invokes `iteratees` with the arguments it receives
  15945. * and returns their results.
  15946. *
  15947. * @static
  15948. * @memberOf _
  15949. * @since 4.0.0
  15950. * @category Util
  15951. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  15952. * The iteratees to invoke.
  15953. * @returns {Function} Returns the new function.
  15954. * @example
  15955. *
  15956. * var func = _.over([Math.max, Math.min]);
  15957. *
  15958. * func(1, 2, 3, 4);
  15959. * // => [4, 1]
  15960. */
  15961. var over = createOver(arrayMap);
  15962. /**
  15963. * Creates a function that checks if **all** of the `predicates` return
  15964. * truthy when invoked with the arguments it receives.
  15965. *
  15966. * Following shorthands are possible for providing predicates.
  15967. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  15968. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  15969. *
  15970. * @static
  15971. * @memberOf _
  15972. * @since 4.0.0
  15973. * @category Util
  15974. * @param {...(Function|Function[])} [predicates=[_.identity]]
  15975. * The predicates to check.
  15976. * @returns {Function} Returns the new function.
  15977. * @example
  15978. *
  15979. * var func = _.overEvery([Boolean, isFinite]);
  15980. *
  15981. * func('1');
  15982. * // => true
  15983. *
  15984. * func(null);
  15985. * // => false
  15986. *
  15987. * func(NaN);
  15988. * // => false
  15989. */
  15990. var overEvery = createOver(arrayEvery);
  15991. /**
  15992. * Creates a function that checks if **any** of the `predicates` return
  15993. * truthy when invoked with the arguments it receives.
  15994. *
  15995. * Following shorthands are possible for providing predicates.
  15996. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  15997. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  15998. *
  15999. * @static
  16000. * @memberOf _
  16001. * @since 4.0.0
  16002. * @category Util
  16003. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16004. * The predicates to check.
  16005. * @returns {Function} Returns the new function.
  16006. * @example
  16007. *
  16008. * var func = _.overSome([Boolean, isFinite]);
  16009. *
  16010. * func('1');
  16011. * // => true
  16012. *
  16013. * func(null);
  16014. * // => true
  16015. *
  16016. * func(NaN);
  16017. * // => false
  16018. *
  16019. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16020. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16021. */
  16022. var overSome = createOver(arraySome);
  16023. /**
  16024. * Creates a function that returns the value at `path` of a given object.
  16025. *
  16026. * @static
  16027. * @memberOf _
  16028. * @since 2.4.0
  16029. * @category Util
  16030. * @param {Array|string} path The path of the property to get.
  16031. * @returns {Function} Returns the new accessor function.
  16032. * @example
  16033. *
  16034. * var objects = [
  16035. * { 'a': { 'b': 2 } },
  16036. * { 'a': { 'b': 1 } }
  16037. * ];
  16038. *
  16039. * _.map(objects, _.property('a.b'));
  16040. * // => [2, 1]
  16041. *
  16042. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16043. * // => [1, 2]
  16044. */
  16045. function property(path) {
  16046. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16047. }
  16048. /**
  16049. * The opposite of `_.property`; this method creates a function that returns
  16050. * the value at a given path of `object`.
  16051. *
  16052. * @static
  16053. * @memberOf _
  16054. * @since 3.0.0
  16055. * @category Util
  16056. * @param {Object} object The object to query.
  16057. * @returns {Function} Returns the new accessor function.
  16058. * @example
  16059. *
  16060. * var array = [0, 1, 2],
  16061. * object = { 'a': array, 'b': array, 'c': array };
  16062. *
  16063. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16064. * // => [2, 0]
  16065. *
  16066. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16067. * // => [2, 0]
  16068. */
  16069. function propertyOf(object) {
  16070. return function(path) {
  16071. return object == null ? undefined : baseGet(object, path);
  16072. };
  16073. }
  16074. /**
  16075. * Creates an array of numbers (positive and/or negative) progressing from
  16076. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16077. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16078. * it's set to `start` with `start` then set to `0`.
  16079. *
  16080. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16081. * floating-point values which can produce unexpected results.
  16082. *
  16083. * @static
  16084. * @since 0.1.0
  16085. * @memberOf _
  16086. * @category Util
  16087. * @param {number} [start=0] The start of the range.
  16088. * @param {number} end The end of the range.
  16089. * @param {number} [step=1] The value to increment or decrement by.
  16090. * @returns {Array} Returns the range of numbers.
  16091. * @see _.inRange, _.rangeRight
  16092. * @example
  16093. *
  16094. * _.range(4);
  16095. * // => [0, 1, 2, 3]
  16096. *
  16097. * _.range(-4);
  16098. * // => [0, -1, -2, -3]
  16099. *
  16100. * _.range(1, 5);
  16101. * // => [1, 2, 3, 4]
  16102. *
  16103. * _.range(0, 20, 5);
  16104. * // => [0, 5, 10, 15]
  16105. *
  16106. * _.range(0, -4, -1);
  16107. * // => [0, -1, -2, -3]
  16108. *
  16109. * _.range(1, 4, 0);
  16110. * // => [1, 1, 1]
  16111. *
  16112. * _.range(0);
  16113. * // => []
  16114. */
  16115. var range = createRange();
  16116. /**
  16117. * This method is like `_.range` except that it populates values in
  16118. * descending order.
  16119. *
  16120. * @static
  16121. * @memberOf _
  16122. * @since 4.0.0
  16123. * @category Util
  16124. * @param {number} [start=0] The start of the range.
  16125. * @param {number} end The end of the range.
  16126. * @param {number} [step=1] The value to increment or decrement by.
  16127. * @returns {Array} Returns the range of numbers.
  16128. * @see _.inRange, _.range
  16129. * @example
  16130. *
  16131. * _.rangeRight(4);
  16132. * // => [3, 2, 1, 0]
  16133. *
  16134. * _.rangeRight(-4);
  16135. * // => [-3, -2, -1, 0]
  16136. *
  16137. * _.rangeRight(1, 5);
  16138. * // => [4, 3, 2, 1]
  16139. *
  16140. * _.rangeRight(0, 20, 5);
  16141. * // => [15, 10, 5, 0]
  16142. *
  16143. * _.rangeRight(0, -4, -1);
  16144. * // => [-3, -2, -1, 0]
  16145. *
  16146. * _.rangeRight(1, 4, 0);
  16147. * // => [1, 1, 1]
  16148. *
  16149. * _.rangeRight(0);
  16150. * // => []
  16151. */
  16152. var rangeRight = createRange(true);
  16153. /**
  16154. * This method returns a new empty array.
  16155. *
  16156. * @static
  16157. * @memberOf _
  16158. * @since 4.13.0
  16159. * @category Util
  16160. * @returns {Array} Returns the new empty array.
  16161. * @example
  16162. *
  16163. * var arrays = _.times(2, _.stubArray);
  16164. *
  16165. * console.log(arrays);
  16166. * // => [[], []]
  16167. *
  16168. * console.log(arrays[0] === arrays[1]);
  16169. * // => false
  16170. */
  16171. function stubArray() {
  16172. return [];
  16173. }
  16174. /**
  16175. * This method returns `false`.
  16176. *
  16177. * @static
  16178. * @memberOf _
  16179. * @since 4.13.0
  16180. * @category Util
  16181. * @returns {boolean} Returns `false`.
  16182. * @example
  16183. *
  16184. * _.times(2, _.stubFalse);
  16185. * // => [false, false]
  16186. */
  16187. function stubFalse() {
  16188. return false;
  16189. }
  16190. /**
  16191. * This method returns a new empty object.
  16192. *
  16193. * @static
  16194. * @memberOf _
  16195. * @since 4.13.0
  16196. * @category Util
  16197. * @returns {Object} Returns the new empty object.
  16198. * @example
  16199. *
  16200. * var objects = _.times(2, _.stubObject);
  16201. *
  16202. * console.log(objects);
  16203. * // => [{}, {}]
  16204. *
  16205. * console.log(objects[0] === objects[1]);
  16206. * // => false
  16207. */
  16208. function stubObject() {
  16209. return {};
  16210. }
  16211. /**
  16212. * This method returns an empty string.
  16213. *
  16214. * @static
  16215. * @memberOf _
  16216. * @since 4.13.0
  16217. * @category Util
  16218. * @returns {string} Returns the empty string.
  16219. * @example
  16220. *
  16221. * _.times(2, _.stubString);
  16222. * // => ['', '']
  16223. */
  16224. function stubString() {
  16225. return '';
  16226. }
  16227. /**
  16228. * This method returns `true`.
  16229. *
  16230. * @static
  16231. * @memberOf _
  16232. * @since 4.13.0
  16233. * @category Util
  16234. * @returns {boolean} Returns `true`.
  16235. * @example
  16236. *
  16237. * _.times(2, _.stubTrue);
  16238. * // => [true, true]
  16239. */
  16240. function stubTrue() {
  16241. return true;
  16242. }
  16243. /**
  16244. * Invokes the iteratee `n` times, returning an array of the results of
  16245. * each invocation. The iteratee is invoked with one argument; (index).
  16246. *
  16247. * @static
  16248. * @since 0.1.0
  16249. * @memberOf _
  16250. * @category Util
  16251. * @param {number} n The number of times to invoke `iteratee`.
  16252. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16253. * @returns {Array} Returns the array of results.
  16254. * @example
  16255. *
  16256. * _.times(3, String);
  16257. * // => ['0', '1', '2']
  16258. *
  16259. * _.times(4, _.constant(0));
  16260. * // => [0, 0, 0, 0]
  16261. */
  16262. function times(n, iteratee) {
  16263. n = toInteger(n);
  16264. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16265. return [];
  16266. }
  16267. var index = MAX_ARRAY_LENGTH,
  16268. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16269. iteratee = getIteratee(iteratee);
  16270. n -= MAX_ARRAY_LENGTH;
  16271. var result = baseTimes(length, iteratee);
  16272. while (++index < n) {
  16273. iteratee(index);
  16274. }
  16275. return result;
  16276. }
  16277. /**
  16278. * Converts `value` to a property path array.
  16279. *
  16280. * @static
  16281. * @memberOf _
  16282. * @since 4.0.0
  16283. * @category Util
  16284. * @param {*} value The value to convert.
  16285. * @returns {Array} Returns the new property path array.
  16286. * @example
  16287. *
  16288. * _.toPath('a.b.c');
  16289. * // => ['a', 'b', 'c']
  16290. *
  16291. * _.toPath('a[0].b.c');
  16292. * // => ['a', '0', 'b', 'c']
  16293. */
  16294. function toPath(value) {
  16295. if (isArray(value)) {
  16296. return arrayMap(value, toKey);
  16297. }
  16298. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16299. }
  16300. /**
  16301. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16302. *
  16303. * @static
  16304. * @since 0.1.0
  16305. * @memberOf _
  16306. * @category Util
  16307. * @param {string} [prefix=''] The value to prefix the ID with.
  16308. * @returns {string} Returns the unique ID.
  16309. * @example
  16310. *
  16311. * _.uniqueId('contact_');
  16312. * // => 'contact_104'
  16313. *
  16314. * _.uniqueId();
  16315. * // => '105'
  16316. */
  16317. function uniqueId(prefix) {
  16318. var id = ++idCounter;
  16319. return toString(prefix) + id;
  16320. }
  16321. /*------------------------------------------------------------------------*/
  16322. /**
  16323. * Adds two numbers.
  16324. *
  16325. * @static
  16326. * @memberOf _
  16327. * @since 3.4.0
  16328. * @category Math
  16329. * @param {number} augend The first number in an addition.
  16330. * @param {number} addend The second number in an addition.
  16331. * @returns {number} Returns the total.
  16332. * @example
  16333. *
  16334. * _.add(6, 4);
  16335. * // => 10
  16336. */
  16337. var add = createMathOperation(function(augend, addend) {
  16338. return augend + addend;
  16339. }, 0);
  16340. /**
  16341. * Computes `number` rounded up to `precision`.
  16342. *
  16343. * @static
  16344. * @memberOf _
  16345. * @since 3.10.0
  16346. * @category Math
  16347. * @param {number} number The number to round up.
  16348. * @param {number} [precision=0] The precision to round up to.
  16349. * @returns {number} Returns the rounded up number.
  16350. * @example
  16351. *
  16352. * _.ceil(4.006);
  16353. * // => 5
  16354. *
  16355. * _.ceil(6.004, 2);
  16356. * // => 6.01
  16357. *
  16358. * _.ceil(6040, -2);
  16359. * // => 6100
  16360. */
  16361. var ceil = createRound('ceil');
  16362. /**
  16363. * Divide two numbers.
  16364. *
  16365. * @static
  16366. * @memberOf _
  16367. * @since 4.7.0
  16368. * @category Math
  16369. * @param {number} dividend The first number in a division.
  16370. * @param {number} divisor The second number in a division.
  16371. * @returns {number} Returns the quotient.
  16372. * @example
  16373. *
  16374. * _.divide(6, 4);
  16375. * // => 1.5
  16376. */
  16377. var divide = createMathOperation(function(dividend, divisor) {
  16378. return dividend / divisor;
  16379. }, 1);
  16380. /**
  16381. * Computes `number` rounded down to `precision`.
  16382. *
  16383. * @static
  16384. * @memberOf _
  16385. * @since 3.10.0
  16386. * @category Math
  16387. * @param {number} number The number to round down.
  16388. * @param {number} [precision=0] The precision to round down to.
  16389. * @returns {number} Returns the rounded down number.
  16390. * @example
  16391. *
  16392. * _.floor(4.006);
  16393. * // => 4
  16394. *
  16395. * _.floor(0.046, 2);
  16396. * // => 0.04
  16397. *
  16398. * _.floor(4060, -2);
  16399. * // => 4000
  16400. */
  16401. var floor = createRound('floor');
  16402. /**
  16403. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16404. * `undefined` is returned.
  16405. *
  16406. * @static
  16407. * @since 0.1.0
  16408. * @memberOf _
  16409. * @category Math
  16410. * @param {Array} array The array to iterate over.
  16411. * @returns {*} Returns the maximum value.
  16412. * @example
  16413. *
  16414. * _.max([4, 2, 8, 6]);
  16415. * // => 8
  16416. *
  16417. * _.max([]);
  16418. * // => undefined
  16419. */
  16420. function max(array) {
  16421. return (array && array.length)
  16422. ? baseExtremum(array, identity, baseGt)
  16423. : undefined;
  16424. }
  16425. /**
  16426. * This method is like `_.max` except that it accepts `iteratee` which is
  16427. * invoked for each element in `array` to generate the criterion by which
  16428. * the value is ranked. The iteratee is invoked with one argument: (value).
  16429. *
  16430. * @static
  16431. * @memberOf _
  16432. * @since 4.0.0
  16433. * @category Math
  16434. * @param {Array} array The array to iterate over.
  16435. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16436. * @returns {*} Returns the maximum value.
  16437. * @example
  16438. *
  16439. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16440. *
  16441. * _.maxBy(objects, function(o) { return o.n; });
  16442. * // => { 'n': 2 }
  16443. *
  16444. * // The `_.property` iteratee shorthand.
  16445. * _.maxBy(objects, 'n');
  16446. * // => { 'n': 2 }
  16447. */
  16448. function maxBy(array, iteratee) {
  16449. return (array && array.length)
  16450. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16451. : undefined;
  16452. }
  16453. /**
  16454. * Computes the mean of the values in `array`.
  16455. *
  16456. * @static
  16457. * @memberOf _
  16458. * @since 4.0.0
  16459. * @category Math
  16460. * @param {Array} array The array to iterate over.
  16461. * @returns {number} Returns the mean.
  16462. * @example
  16463. *
  16464. * _.mean([4, 2, 8, 6]);
  16465. * // => 5
  16466. */
  16467. function mean(array) {
  16468. return baseMean(array, identity);
  16469. }
  16470. /**
  16471. * This method is like `_.mean` except that it accepts `iteratee` which is
  16472. * invoked for each element in `array` to generate the value to be averaged.
  16473. * The iteratee is invoked with one argument: (value).
  16474. *
  16475. * @static
  16476. * @memberOf _
  16477. * @since 4.7.0
  16478. * @category Math
  16479. * @param {Array} array The array to iterate over.
  16480. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16481. * @returns {number} Returns the mean.
  16482. * @example
  16483. *
  16484. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16485. *
  16486. * _.meanBy(objects, function(o) { return o.n; });
  16487. * // => 5
  16488. *
  16489. * // The `_.property` iteratee shorthand.
  16490. * _.meanBy(objects, 'n');
  16491. * // => 5
  16492. */
  16493. function meanBy(array, iteratee) {
  16494. return baseMean(array, getIteratee(iteratee, 2));
  16495. }
  16496. /**
  16497. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16498. * `undefined` is returned.
  16499. *
  16500. * @static
  16501. * @since 0.1.0
  16502. * @memberOf _
  16503. * @category Math
  16504. * @param {Array} array The array to iterate over.
  16505. * @returns {*} Returns the minimum value.
  16506. * @example
  16507. *
  16508. * _.min([4, 2, 8, 6]);
  16509. * // => 2
  16510. *
  16511. * _.min([]);
  16512. * // => undefined
  16513. */
  16514. function min(array) {
  16515. return (array && array.length)
  16516. ? baseExtremum(array, identity, baseLt)
  16517. : undefined;
  16518. }
  16519. /**
  16520. * This method is like `_.min` except that it accepts `iteratee` which is
  16521. * invoked for each element in `array` to generate the criterion by which
  16522. * the value is ranked. The iteratee is invoked with one argument: (value).
  16523. *
  16524. * @static
  16525. * @memberOf _
  16526. * @since 4.0.0
  16527. * @category Math
  16528. * @param {Array} array The array to iterate over.
  16529. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16530. * @returns {*} Returns the minimum value.
  16531. * @example
  16532. *
  16533. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16534. *
  16535. * _.minBy(objects, function(o) { return o.n; });
  16536. * // => { 'n': 1 }
  16537. *
  16538. * // The `_.property` iteratee shorthand.
  16539. * _.minBy(objects, 'n');
  16540. * // => { 'n': 1 }
  16541. */
  16542. function minBy(array, iteratee) {
  16543. return (array && array.length)
  16544. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16545. : undefined;
  16546. }
  16547. /**
  16548. * Multiply two numbers.
  16549. *
  16550. * @static
  16551. * @memberOf _
  16552. * @since 4.7.0
  16553. * @category Math
  16554. * @param {number} multiplier The first number in a multiplication.
  16555. * @param {number} multiplicand The second number in a multiplication.
  16556. * @returns {number} Returns the product.
  16557. * @example
  16558. *
  16559. * _.multiply(6, 4);
  16560. * // => 24
  16561. */
  16562. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16563. return multiplier * multiplicand;
  16564. }, 1);
  16565. /**
  16566. * Computes `number` rounded to `precision`.
  16567. *
  16568. * @static
  16569. * @memberOf _
  16570. * @since 3.10.0
  16571. * @category Math
  16572. * @param {number} number The number to round.
  16573. * @param {number} [precision=0] The precision to round to.
  16574. * @returns {number} Returns the rounded number.
  16575. * @example
  16576. *
  16577. * _.round(4.006);
  16578. * // => 4
  16579. *
  16580. * _.round(4.006, 2);
  16581. * // => 4.01
  16582. *
  16583. * _.round(4060, -2);
  16584. * // => 4100
  16585. */
  16586. var round = createRound('round');
  16587. /**
  16588. * Subtract two numbers.
  16589. *
  16590. * @static
  16591. * @memberOf _
  16592. * @since 4.0.0
  16593. * @category Math
  16594. * @param {number} minuend The first number in a subtraction.
  16595. * @param {number} subtrahend The second number in a subtraction.
  16596. * @returns {number} Returns the difference.
  16597. * @example
  16598. *
  16599. * _.subtract(6, 4);
  16600. * // => 2
  16601. */
  16602. var subtract = createMathOperation(function(minuend, subtrahend) {
  16603. return minuend - subtrahend;
  16604. }, 0);
  16605. /**
  16606. * Computes the sum of the values in `array`.
  16607. *
  16608. * @static
  16609. * @memberOf _
  16610. * @since 3.4.0
  16611. * @category Math
  16612. * @param {Array} array The array to iterate over.
  16613. * @returns {number} Returns the sum.
  16614. * @example
  16615. *
  16616. * _.sum([4, 2, 8, 6]);
  16617. * // => 20
  16618. */
  16619. function sum(array) {
  16620. return (array && array.length)
  16621. ? baseSum(array, identity)
  16622. : 0;
  16623. }
  16624. /**
  16625. * This method is like `_.sum` except that it accepts `iteratee` which is
  16626. * invoked for each element in `array` to generate the value to be summed.
  16627. * The iteratee is invoked with one argument: (value).
  16628. *
  16629. * @static
  16630. * @memberOf _
  16631. * @since 4.0.0
  16632. * @category Math
  16633. * @param {Array} array The array to iterate over.
  16634. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16635. * @returns {number} Returns the sum.
  16636. * @example
  16637. *
  16638. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16639. *
  16640. * _.sumBy(objects, function(o) { return o.n; });
  16641. * // => 20
  16642. *
  16643. * // The `_.property` iteratee shorthand.
  16644. * _.sumBy(objects, 'n');
  16645. * // => 20
  16646. */
  16647. function sumBy(array, iteratee) {
  16648. return (array && array.length)
  16649. ? baseSum(array, getIteratee(iteratee, 2))
  16650. : 0;
  16651. }
  16652. /*------------------------------------------------------------------------*/
  16653. // Add methods that return wrapped values in chain sequences.
  16654. lodash.after = after;
  16655. lodash.ary = ary;
  16656. lodash.assign = assign;
  16657. lodash.assignIn = assignIn;
  16658. lodash.assignInWith = assignInWith;
  16659. lodash.assignWith = assignWith;
  16660. lodash.at = at;
  16661. lodash.before = before;
  16662. lodash.bind = bind;
  16663. lodash.bindAll = bindAll;
  16664. lodash.bindKey = bindKey;
  16665. lodash.castArray = castArray;
  16666. lodash.chain = chain;
  16667. lodash.chunk = chunk;
  16668. lodash.compact = compact;
  16669. lodash.concat = concat;
  16670. lodash.cond = cond;
  16671. lodash.conforms = conforms;
  16672. lodash.constant = constant;
  16673. lodash.countBy = countBy;
  16674. lodash.create = create;
  16675. lodash.curry = curry;
  16676. lodash.curryRight = curryRight;
  16677. lodash.debounce = debounce;
  16678. lodash.defaults = defaults;
  16679. lodash.defaultsDeep = defaultsDeep;
  16680. lodash.defer = defer;
  16681. lodash.delay = delay;
  16682. lodash.difference = difference;
  16683. lodash.differenceBy = differenceBy;
  16684. lodash.differenceWith = differenceWith;
  16685. lodash.drop = drop;
  16686. lodash.dropRight = dropRight;
  16687. lodash.dropRightWhile = dropRightWhile;
  16688. lodash.dropWhile = dropWhile;
  16689. lodash.fill = fill;
  16690. lodash.filter = filter;
  16691. lodash.flatMap = flatMap;
  16692. lodash.flatMapDeep = flatMapDeep;
  16693. lodash.flatMapDepth = flatMapDepth;
  16694. lodash.flatten = flatten;
  16695. lodash.flattenDeep = flattenDeep;
  16696. lodash.flattenDepth = flattenDepth;
  16697. lodash.flip = flip;
  16698. lodash.flow = flow;
  16699. lodash.flowRight = flowRight;
  16700. lodash.fromPairs = fromPairs;
  16701. lodash.functions = functions;
  16702. lodash.functionsIn = functionsIn;
  16703. lodash.groupBy = groupBy;
  16704. lodash.initial = initial;
  16705. lodash.intersection = intersection;
  16706. lodash.intersectionBy = intersectionBy;
  16707. lodash.intersectionWith = intersectionWith;
  16708. lodash.invert = invert;
  16709. lodash.invertBy = invertBy;
  16710. lodash.invokeMap = invokeMap;
  16711. lodash.iteratee = iteratee;
  16712. lodash.keyBy = keyBy;
  16713. lodash.keys = keys;
  16714. lodash.keysIn = keysIn;
  16715. lodash.map = map;
  16716. lodash.mapKeys = mapKeys;
  16717. lodash.mapValues = mapValues;
  16718. lodash.matches = matches;
  16719. lodash.matchesProperty = matchesProperty;
  16720. lodash.memoize = memoize;
  16721. lodash.merge = merge;
  16722. lodash.mergeWith = mergeWith;
  16723. lodash.method = method;
  16724. lodash.methodOf = methodOf;
  16725. lodash.mixin = mixin;
  16726. lodash.negate = negate;
  16727. lodash.nthArg = nthArg;
  16728. lodash.omit = omit;
  16729. lodash.omitBy = omitBy;
  16730. lodash.once = once;
  16731. lodash.orderBy = orderBy;
  16732. lodash.over = over;
  16733. lodash.overArgs = overArgs;
  16734. lodash.overEvery = overEvery;
  16735. lodash.overSome = overSome;
  16736. lodash.partial = partial;
  16737. lodash.partialRight = partialRight;
  16738. lodash.partition = partition;
  16739. lodash.pick = pick;
  16740. lodash.pickBy = pickBy;
  16741. lodash.property = property;
  16742. lodash.propertyOf = propertyOf;
  16743. lodash.pull = pull;
  16744. lodash.pullAll = pullAll;
  16745. lodash.pullAllBy = pullAllBy;
  16746. lodash.pullAllWith = pullAllWith;
  16747. lodash.pullAt = pullAt;
  16748. lodash.range = range;
  16749. lodash.rangeRight = rangeRight;
  16750. lodash.rearg = rearg;
  16751. lodash.reject = reject;
  16752. lodash.remove = remove;
  16753. lodash.rest = rest;
  16754. lodash.reverse = reverse;
  16755. lodash.sampleSize = sampleSize;
  16756. lodash.set = set;
  16757. lodash.setWith = setWith;
  16758. lodash.shuffle = shuffle;
  16759. lodash.slice = slice;
  16760. lodash.sortBy = sortBy;
  16761. lodash.sortedUniq = sortedUniq;
  16762. lodash.sortedUniqBy = sortedUniqBy;
  16763. lodash.split = split;
  16764. lodash.spread = spread;
  16765. lodash.tail = tail;
  16766. lodash.take = take;
  16767. lodash.takeRight = takeRight;
  16768. lodash.takeRightWhile = takeRightWhile;
  16769. lodash.takeWhile = takeWhile;
  16770. lodash.tap = tap;
  16771. lodash.throttle = throttle;
  16772. lodash.thru = thru;
  16773. lodash.toArray = toArray;
  16774. lodash.toPairs = toPairs;
  16775. lodash.toPairsIn = toPairsIn;
  16776. lodash.toPath = toPath;
  16777. lodash.toPlainObject = toPlainObject;
  16778. lodash.transform = transform;
  16779. lodash.unary = unary;
  16780. lodash.union = union;
  16781. lodash.unionBy = unionBy;
  16782. lodash.unionWith = unionWith;
  16783. lodash.uniq = uniq;
  16784. lodash.uniqBy = uniqBy;
  16785. lodash.uniqWith = uniqWith;
  16786. lodash.unset = unset;
  16787. lodash.unzip = unzip;
  16788. lodash.unzipWith = unzipWith;
  16789. lodash.update = update;
  16790. lodash.updateWith = updateWith;
  16791. lodash.values = values;
  16792. lodash.valuesIn = valuesIn;
  16793. lodash.without = without;
  16794. lodash.words = words;
  16795. lodash.wrap = wrap;
  16796. lodash.xor = xor;
  16797. lodash.xorBy = xorBy;
  16798. lodash.xorWith = xorWith;
  16799. lodash.zip = zip;
  16800. lodash.zipObject = zipObject;
  16801. lodash.zipObjectDeep = zipObjectDeep;
  16802. lodash.zipWith = zipWith;
  16803. // Add aliases.
  16804. lodash.entries = toPairs;
  16805. lodash.entriesIn = toPairsIn;
  16806. lodash.extend = assignIn;
  16807. lodash.extendWith = assignInWith;
  16808. // Add methods to `lodash.prototype`.
  16809. mixin(lodash, lodash);
  16810. /*------------------------------------------------------------------------*/
  16811. // Add methods that return unwrapped values in chain sequences.
  16812. lodash.add = add;
  16813. lodash.attempt = attempt;
  16814. lodash.camelCase = camelCase;
  16815. lodash.capitalize = capitalize;
  16816. lodash.ceil = ceil;
  16817. lodash.clamp = clamp;
  16818. lodash.clone = clone;
  16819. lodash.cloneDeep = cloneDeep;
  16820. lodash.cloneDeepWith = cloneDeepWith;
  16821. lodash.cloneWith = cloneWith;
  16822. lodash.conformsTo = conformsTo;
  16823. lodash.deburr = deburr;
  16824. lodash.defaultTo = defaultTo;
  16825. lodash.divide = divide;
  16826. lodash.endsWith = endsWith;
  16827. lodash.eq = eq;
  16828. lodash.escape = escape;
  16829. lodash.escapeRegExp = escapeRegExp;
  16830. lodash.every = every;
  16831. lodash.find = find;
  16832. lodash.findIndex = findIndex;
  16833. lodash.findKey = findKey;
  16834. lodash.findLast = findLast;
  16835. lodash.findLastIndex = findLastIndex;
  16836. lodash.findLastKey = findLastKey;
  16837. lodash.floor = floor;
  16838. lodash.forEach = forEach;
  16839. lodash.forEachRight = forEachRight;
  16840. lodash.forIn = forIn;
  16841. lodash.forInRight = forInRight;
  16842. lodash.forOwn = forOwn;
  16843. lodash.forOwnRight = forOwnRight;
  16844. lodash.get = get;
  16845. lodash.gt = gt;
  16846. lodash.gte = gte;
  16847. lodash.has = has;
  16848. lodash.hasIn = hasIn;
  16849. lodash.head = head;
  16850. lodash.identity = identity;
  16851. lodash.includes = includes;
  16852. lodash.indexOf = indexOf;
  16853. lodash.inRange = inRange;
  16854. lodash.invoke = invoke;
  16855. lodash.isArguments = isArguments;
  16856. lodash.isArray = isArray;
  16857. lodash.isArrayBuffer = isArrayBuffer;
  16858. lodash.isArrayLike = isArrayLike;
  16859. lodash.isArrayLikeObject = isArrayLikeObject;
  16860. lodash.isBoolean = isBoolean;
  16861. lodash.isBuffer = isBuffer;
  16862. lodash.isDate = isDate;
  16863. lodash.isElement = isElement;
  16864. lodash.isEmpty = isEmpty;
  16865. lodash.isEqual = isEqual;
  16866. lodash.isEqualWith = isEqualWith;
  16867. lodash.isError = isError;
  16868. lodash.isFinite = isFinite;
  16869. lodash.isFunction = isFunction;
  16870. lodash.isInteger = isInteger;
  16871. lodash.isLength = isLength;
  16872. lodash.isMap = isMap;
  16873. lodash.isMatch = isMatch;
  16874. lodash.isMatchWith = isMatchWith;
  16875. lodash.isNaN = isNaN;
  16876. lodash.isNative = isNative;
  16877. lodash.isNil = isNil;
  16878. lodash.isNull = isNull;
  16879. lodash.isNumber = isNumber;
  16880. lodash.isObject = isObject;
  16881. lodash.isObjectLike = isObjectLike;
  16882. lodash.isPlainObject = isPlainObject;
  16883. lodash.isRegExp = isRegExp;
  16884. lodash.isSafeInteger = isSafeInteger;
  16885. lodash.isSet = isSet;
  16886. lodash.isString = isString;
  16887. lodash.isSymbol = isSymbol;
  16888. lodash.isTypedArray = isTypedArray;
  16889. lodash.isUndefined = isUndefined;
  16890. lodash.isWeakMap = isWeakMap;
  16891. lodash.isWeakSet = isWeakSet;
  16892. lodash.join = join;
  16893. lodash.kebabCase = kebabCase;
  16894. lodash.last = last;
  16895. lodash.lastIndexOf = lastIndexOf;
  16896. lodash.lowerCase = lowerCase;
  16897. lodash.lowerFirst = lowerFirst;
  16898. lodash.lt = lt;
  16899. lodash.lte = lte;
  16900. lodash.max = max;
  16901. lodash.maxBy = maxBy;
  16902. lodash.mean = mean;
  16903. lodash.meanBy = meanBy;
  16904. lodash.min = min;
  16905. lodash.minBy = minBy;
  16906. lodash.stubArray = stubArray;
  16907. lodash.stubFalse = stubFalse;
  16908. lodash.stubObject = stubObject;
  16909. lodash.stubString = stubString;
  16910. lodash.stubTrue = stubTrue;
  16911. lodash.multiply = multiply;
  16912. lodash.nth = nth;
  16913. lodash.noConflict = noConflict;
  16914. lodash.noop = noop;
  16915. lodash.now = now;
  16916. lodash.pad = pad;
  16917. lodash.padEnd = padEnd;
  16918. lodash.padStart = padStart;
  16919. lodash.parseInt = parseInt;
  16920. lodash.random = random;
  16921. lodash.reduce = reduce;
  16922. lodash.reduceRight = reduceRight;
  16923. lodash.repeat = repeat;
  16924. lodash.replace = replace;
  16925. lodash.result = result;
  16926. lodash.round = round;
  16927. lodash.runInContext = runInContext;
  16928. lodash.sample = sample;
  16929. lodash.size = size;
  16930. lodash.snakeCase = snakeCase;
  16931. lodash.some = some;
  16932. lodash.sortedIndex = sortedIndex;
  16933. lodash.sortedIndexBy = sortedIndexBy;
  16934. lodash.sortedIndexOf = sortedIndexOf;
  16935. lodash.sortedLastIndex = sortedLastIndex;
  16936. lodash.sortedLastIndexBy = sortedLastIndexBy;
  16937. lodash.sortedLastIndexOf = sortedLastIndexOf;
  16938. lodash.startCase = startCase;
  16939. lodash.startsWith = startsWith;
  16940. lodash.subtract = subtract;
  16941. lodash.sum = sum;
  16942. lodash.sumBy = sumBy;
  16943. lodash.template = template;
  16944. lodash.times = times;
  16945. lodash.toFinite = toFinite;
  16946. lodash.toInteger = toInteger;
  16947. lodash.toLength = toLength;
  16948. lodash.toLower = toLower;
  16949. lodash.toNumber = toNumber;
  16950. lodash.toSafeInteger = toSafeInteger;
  16951. lodash.toString = toString;
  16952. lodash.toUpper = toUpper;
  16953. lodash.trim = trim;
  16954. lodash.trimEnd = trimEnd;
  16955. lodash.trimStart = trimStart;
  16956. lodash.truncate = truncate;
  16957. lodash.unescape = unescape;
  16958. lodash.uniqueId = uniqueId;
  16959. lodash.upperCase = upperCase;
  16960. lodash.upperFirst = upperFirst;
  16961. // Add aliases.
  16962. lodash.each = forEach;
  16963. lodash.eachRight = forEachRight;
  16964. lodash.first = head;
  16965. mixin(lodash, (function() {
  16966. var source = {};
  16967. baseForOwn(lodash, function(func, methodName) {
  16968. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  16969. source[methodName] = func;
  16970. }
  16971. });
  16972. return source;
  16973. }()), { 'chain': false });
  16974. /*------------------------------------------------------------------------*/
  16975. /**
  16976. * The semantic version number.
  16977. *
  16978. * @static
  16979. * @memberOf _
  16980. * @type {string}
  16981. */
  16982. lodash.VERSION = VERSION;
  16983. // Assign default placeholders.
  16984. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  16985. lodash[methodName].placeholder = lodash;
  16986. });
  16987. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  16988. arrayEach(['drop', 'take'], function(methodName, index) {
  16989. LazyWrapper.prototype[methodName] = function(n) {
  16990. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  16991. var result = (this.__filtered__ && !index)
  16992. ? new LazyWrapper(this)
  16993. : this.clone();
  16994. if (result.__filtered__) {
  16995. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  16996. } else {
  16997. result.__views__.push({
  16998. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  16999. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17000. });
  17001. }
  17002. return result;
  17003. };
  17004. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17005. return this.reverse()[methodName](n).reverse();
  17006. };
  17007. });
  17008. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17009. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17010. var type = index + 1,
  17011. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17012. LazyWrapper.prototype[methodName] = function(iteratee) {
  17013. var result = this.clone();
  17014. result.__iteratees__.push({
  17015. 'iteratee': getIteratee(iteratee, 3),
  17016. 'type': type
  17017. });
  17018. result.__filtered__ = result.__filtered__ || isFilter;
  17019. return result;
  17020. };
  17021. });
  17022. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17023. arrayEach(['head', 'last'], function(methodName, index) {
  17024. var takeName = 'take' + (index ? 'Right' : '');
  17025. LazyWrapper.prototype[methodName] = function() {
  17026. return this[takeName](1).value()[0];
  17027. };
  17028. });
  17029. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17030. arrayEach(['initial', 'tail'], function(methodName, index) {
  17031. var dropName = 'drop' + (index ? '' : 'Right');
  17032. LazyWrapper.prototype[methodName] = function() {
  17033. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17034. };
  17035. });
  17036. LazyWrapper.prototype.compact = function() {
  17037. return this.filter(identity);
  17038. };
  17039. LazyWrapper.prototype.find = function(predicate) {
  17040. return this.filter(predicate).head();
  17041. };
  17042. LazyWrapper.prototype.findLast = function(predicate) {
  17043. return this.reverse().find(predicate);
  17044. };
  17045. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17046. if (typeof path == 'function') {
  17047. return new LazyWrapper(this);
  17048. }
  17049. return this.map(function(value) {
  17050. return baseInvoke(value, path, args);
  17051. });
  17052. });
  17053. LazyWrapper.prototype.reject = function(predicate) {
  17054. return this.filter(negate(getIteratee(predicate)));
  17055. };
  17056. LazyWrapper.prototype.slice = function(start, end) {
  17057. start = toInteger(start);
  17058. var result = this;
  17059. if (result.__filtered__ && (start > 0 || end < 0)) {
  17060. return new LazyWrapper(result);
  17061. }
  17062. if (start < 0) {
  17063. result = result.takeRight(-start);
  17064. } else if (start) {
  17065. result = result.drop(start);
  17066. }
  17067. if (end !== undefined) {
  17068. end = toInteger(end);
  17069. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17070. }
  17071. return result;
  17072. };
  17073. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17074. return this.reverse().takeWhile(predicate).reverse();
  17075. };
  17076. LazyWrapper.prototype.toArray = function() {
  17077. return this.take(MAX_ARRAY_LENGTH);
  17078. };
  17079. // Add `LazyWrapper` methods to `lodash.prototype`.
  17080. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17081. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17082. isTaker = /^(?:head|last)$/.test(methodName),
  17083. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17084. retUnwrapped = isTaker || /^find/.test(methodName);
  17085. if (!lodashFunc) {
  17086. return;
  17087. }
  17088. lodash.prototype[methodName] = function() {
  17089. var value = this.__wrapped__,
  17090. args = isTaker ? [1] : arguments,
  17091. isLazy = value instanceof LazyWrapper,
  17092. iteratee = args[0],
  17093. useLazy = isLazy || isArray(value);
  17094. var interceptor = function(value) {
  17095. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17096. return (isTaker && chainAll) ? result[0] : result;
  17097. };
  17098. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17099. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17100. isLazy = useLazy = false;
  17101. }
  17102. var chainAll = this.__chain__,
  17103. isHybrid = !!this.__actions__.length,
  17104. isUnwrapped = retUnwrapped && !chainAll,
  17105. onlyLazy = isLazy && !isHybrid;
  17106. if (!retUnwrapped && useLazy) {
  17107. value = onlyLazy ? value : new LazyWrapper(this);
  17108. var result = func.apply(value, args);
  17109. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17110. return new LodashWrapper(result, chainAll);
  17111. }
  17112. if (isUnwrapped && onlyLazy) {
  17113. return func.apply(this, args);
  17114. }
  17115. result = this.thru(interceptor);
  17116. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17117. };
  17118. });
  17119. // Add `Array` methods to `lodash.prototype`.
  17120. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17121. var func = arrayProto[methodName],
  17122. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17123. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17124. lodash.prototype[methodName] = function() {
  17125. var args = arguments;
  17126. if (retUnwrapped && !this.__chain__) {
  17127. var value = this.value();
  17128. return func.apply(isArray(value) ? value : [], args);
  17129. }
  17130. return this[chainName](function(value) {
  17131. return func.apply(isArray(value) ? value : [], args);
  17132. });
  17133. };
  17134. });
  17135. // Map minified method names to their real names.
  17136. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17137. var lodashFunc = lodash[methodName];
  17138. if (lodashFunc) {
  17139. var key = lodashFunc.name + '';
  17140. if (!hasOwnProperty.call(realNames, key)) {
  17141. realNames[key] = [];
  17142. }
  17143. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17144. }
  17145. });
  17146. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17147. 'name': 'wrapper',
  17148. 'func': undefined
  17149. }];
  17150. // Add methods to `LazyWrapper`.
  17151. LazyWrapper.prototype.clone = lazyClone;
  17152. LazyWrapper.prototype.reverse = lazyReverse;
  17153. LazyWrapper.prototype.value = lazyValue;
  17154. // Add chain sequence methods to the `lodash` wrapper.
  17155. lodash.prototype.at = wrapperAt;
  17156. lodash.prototype.chain = wrapperChain;
  17157. lodash.prototype.commit = wrapperCommit;
  17158. lodash.prototype.next = wrapperNext;
  17159. lodash.prototype.plant = wrapperPlant;
  17160. lodash.prototype.reverse = wrapperReverse;
  17161. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17162. // Add lazy aliases.
  17163. lodash.prototype.first = lodash.prototype.head;
  17164. if (symIterator) {
  17165. lodash.prototype[symIterator] = wrapperToIterator;
  17166. }
  17167. return lodash;
  17168. });
  17169. /*--------------------------------------------------------------------------*/
  17170. // Export lodash.
  17171. var _ = runInContext();
  17172. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17173. if (true) {
  17174. // Expose Lodash on the global object to prevent errors when Lodash is
  17175. // loaded by a script tag in the presence of an AMD loader.
  17176. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17177. // Use `_.noConflict` to remove Lodash from the global object.
  17178. root._ = _;
  17179. // Define as an anonymous module so, through path mapping, it can be
  17180. // referenced as the "underscore" module.
  17181. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17182. return _;
  17183. }).call(exports, __webpack_require__, exports, module),
  17184. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17185. }
  17186. // Check for `exports` after `define` in case a build optimizer adds it.
  17187. else {}
  17188. }.call(this));
  17189. /***/ }),
  17190. /***/ "./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":
  17191. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17192. !*** ./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 ***!
  17193. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17194. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17195. "use strict";
  17196. __webpack_require__.r(__webpack_exports__);
  17197. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17198. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17199. /* harmony export */ });
  17200. /* 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");
  17201. /* 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__);
  17202. /* 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");
  17203. var options = {};
  17204. options.insert = "head";
  17205. options.singleton = false;
  17206. 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);
  17207. /* 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 || {});
  17208. /***/ }),
  17209. /***/ "./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":
  17210. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17211. !*** ./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 ***!
  17212. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17213. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17214. "use strict";
  17215. __webpack_require__.r(__webpack_exports__);
  17216. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17217. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17218. /* harmony export */ });
  17219. /* 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");
  17220. /* 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__);
  17221. /* 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");
  17222. var options = {};
  17223. options.insert = "head";
  17224. options.singleton = false;
  17225. 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);
  17226. /* 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 || {});
  17227. /***/ }),
  17228. /***/ "./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":
  17229. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17230. !*** ./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 ***!
  17231. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17232. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17233. "use strict";
  17234. __webpack_require__.r(__webpack_exports__);
  17235. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17236. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17237. /* harmony export */ });
  17238. /* 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");
  17239. /* 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__);
  17240. /* 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");
  17241. var options = {};
  17242. options.insert = "head";
  17243. options.singleton = false;
  17244. 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);
  17245. /* 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 || {});
  17246. /***/ }),
  17247. /***/ "./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":
  17248. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17249. !*** ./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 ***!
  17250. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17252. "use strict";
  17253. __webpack_require__.r(__webpack_exports__);
  17254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17255. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17256. /* harmony export */ });
  17257. /* 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");
  17258. /* 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__);
  17259. /* 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");
  17260. var options = {};
  17261. options.insert = "head";
  17262. options.singleton = false;
  17263. 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);
  17264. /* 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 || {});
  17265. /***/ }),
  17266. /***/ "./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":
  17267. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17268. !*** ./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 ***!
  17269. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17270. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17271. "use strict";
  17272. __webpack_require__.r(__webpack_exports__);
  17273. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17274. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17275. /* harmony export */ });
  17276. /* 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");
  17277. /* 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__);
  17278. /* 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");
  17279. var options = {};
  17280. options.insert = "head";
  17281. options.singleton = false;
  17282. 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);
  17283. /* 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 || {});
  17284. /***/ }),
  17285. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17286. /*!******************************************************!*\
  17287. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17288. \******************************************************/
  17289. /***/ ((__unused_webpack_module, exports) => {
  17290. "use strict";
  17291. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17292. // runtime helper for setting properties on components
  17293. // in a tree-shakable way
  17294. exports["default"] = (sfc, props) => {
  17295. const target = sfc.__vccOpts || sfc;
  17296. for (const [key, val] of props) {
  17297. target[key] = val;
  17298. }
  17299. return target;
  17300. };
  17301. /***/ }),
  17302. /***/ "./resources/js/components/AppFooter.vue":
  17303. /*!***********************************************!*\
  17304. !*** ./resources/js/components/AppFooter.vue ***!
  17305. \***********************************************/
  17306. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17307. "use strict";
  17308. __webpack_require__.r(__webpack_exports__);
  17309. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17310. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17311. /* harmony export */ });
  17312. /* 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");
  17313. /* 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");
  17314. /* 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");
  17315. const script = {}
  17316. ;
  17317. 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"]])
  17318. /* hot reload */
  17319. if (false) {}
  17320. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17321. /***/ }),
  17322. /***/ "./resources/js/components/AppMessage.vue":
  17323. /*!************************************************!*\
  17324. !*** ./resources/js/components/AppMessage.vue ***!
  17325. \************************************************/
  17326. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17327. "use strict";
  17328. __webpack_require__.r(__webpack_exports__);
  17329. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17330. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17331. /* harmony export */ });
  17332. /* 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");
  17333. /* 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");
  17334. /* 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");
  17335. ;
  17336. 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"]])
  17337. /* hot reload */
  17338. if (false) {}
  17339. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17340. /***/ }),
  17341. /***/ "./resources/js/components/AppSidebar.vue":
  17342. /*!************************************************!*\
  17343. !*** ./resources/js/components/AppSidebar.vue ***!
  17344. \************************************************/
  17345. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17346. "use strict";
  17347. __webpack_require__.r(__webpack_exports__);
  17348. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17349. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17350. /* harmony export */ });
  17351. /* 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");
  17352. /* 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");
  17353. /* 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");
  17354. /* 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");
  17355. ;
  17356. 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"]])
  17357. /* hot reload */
  17358. if (false) {}
  17359. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17360. /***/ }),
  17361. /***/ "./resources/js/components/AppSubSidebar.vue":
  17362. /*!***************************************************!*\
  17363. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17364. \***************************************************/
  17365. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17366. "use strict";
  17367. __webpack_require__.r(__webpack_exports__);
  17368. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17369. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17370. /* harmony export */ });
  17371. /* 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");
  17372. /* 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");
  17373. /* 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");
  17374. /* 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");
  17375. ;
  17376. 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"]])
  17377. /* hot reload */
  17378. if (false) {}
  17379. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17380. /***/ }),
  17381. /***/ "./resources/js/components/AppTopBar.vue":
  17382. /*!***********************************************!*\
  17383. !*** ./resources/js/components/AppTopBar.vue ***!
  17384. \***********************************************/
  17385. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17386. "use strict";
  17387. __webpack_require__.r(__webpack_exports__);
  17388. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17389. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17390. /* harmony export */ });
  17391. /* harmony import */ var _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");
  17392. /* 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");
  17393. /* 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");
  17394. /* 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");
  17395. ;
  17396. 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"]])
  17397. /* hot reload */
  17398. if (false) {}
  17399. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17400. /***/ }),
  17401. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17402. /*!**************************************************!*\
  17403. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17404. \**************************************************/
  17405. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17406. "use strict";
  17407. __webpack_require__.r(__webpack_exports__);
  17408. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17409. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17410. /* harmony export */ });
  17411. /* 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");
  17412. /* 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");
  17413. /* 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");
  17414. /* 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");
  17415. ;
  17416. 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"]])
  17417. /* hot reload */
  17418. if (false) {}
  17419. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17420. /***/ }),
  17421. /***/ "./resources/js/pages/home/Index.vue":
  17422. /*!*******************************************!*\
  17423. !*** ./resources/js/pages/home/Index.vue ***!
  17424. \*******************************************/
  17425. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17426. "use strict";
  17427. __webpack_require__.r(__webpack_exports__);
  17428. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17429. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17430. /* harmony export */ });
  17431. /* harmony import */ var _Index_vue_vue_type_template_id_9329f6aa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=9329f6aa */ "./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa");
  17432. /* harmony import */ var _Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Index.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js");
  17433. /* 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");
  17434. ;
  17435. 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_9329f6aa__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/home/Index.vue"]])
  17436. /* hot reload */
  17437. if (false) {}
  17438. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17439. /***/ }),
  17440. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17441. /*!***********************************************************************************!*\
  17442. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17443. \***********************************************************************************/
  17444. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17445. "use strict";
  17446. __webpack_require__.r(__webpack_exports__);
  17447. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17448. /* harmony export */ "default": () => (/* 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"])
  17449. /* harmony export */ });
  17450. /* 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");
  17451. /***/ }),
  17452. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17453. /*!***********************************************************************************!*\
  17454. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17455. \***********************************************************************************/
  17456. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17457. "use strict";
  17458. __webpack_require__.r(__webpack_exports__);
  17459. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17460. /* 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"])
  17461. /* harmony export */ });
  17462. /* 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");
  17463. /***/ }),
  17464. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17465. /*!**************************************************************************************!*\
  17466. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17467. \**************************************************************************************/
  17468. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17469. "use strict";
  17470. __webpack_require__.r(__webpack_exports__);
  17471. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17472. /* 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"])
  17473. /* harmony export */ });
  17474. /* 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");
  17475. /***/ }),
  17476. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17477. /*!**********************************************************************************!*\
  17478. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17479. \**********************************************************************************/
  17480. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17481. "use strict";
  17482. __webpack_require__.r(__webpack_exports__);
  17483. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17484. /* harmony export */ "default": () => (/* 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"])
  17485. /* harmony export */ });
  17486. /* 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");
  17487. /***/ }),
  17488. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17489. /*!*************************************************************************************!*\
  17490. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17491. \*************************************************************************************/
  17492. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17493. "use strict";
  17494. __webpack_require__.r(__webpack_exports__);
  17495. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17496. /* 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"])
  17497. /* harmony export */ });
  17498. /* 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");
  17499. /***/ }),
  17500. /***/ "./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js":
  17501. /*!******************************************************************************!*\
  17502. !*** ./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js ***!
  17503. \******************************************************************************/
  17504. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17505. "use strict";
  17506. __webpack_require__.r(__webpack_exports__);
  17507. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17508. /* 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"])
  17509. /* harmony export */ });
  17510. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js");
  17511. /***/ }),
  17512. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17513. /*!*****************************************************************************************!*\
  17514. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17515. \*****************************************************************************************/
  17516. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17517. "use strict";
  17518. __webpack_require__.r(__webpack_exports__);
  17519. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17520. /* 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)
  17521. /* harmony export */ });
  17522. /* 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");
  17523. /***/ }),
  17524. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17525. /*!******************************************************************************!*\
  17526. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17527. \******************************************************************************/
  17528. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17529. "use strict";
  17530. __webpack_require__.r(__webpack_exports__);
  17531. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17532. /* 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)
  17533. /* harmony export */ });
  17534. /* 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");
  17535. /***/ }),
  17536. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17537. /*!******************************************************************************************!*\
  17538. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  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 */ "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)
  17545. /* harmony export */ });
  17546. /* 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");
  17547. /***/ }),
  17548. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17549. /*!*********************************************************************************************!*\
  17550. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17551. \*********************************************************************************************/
  17552. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17553. "use strict";
  17554. __webpack_require__.r(__webpack_exports__);
  17555. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17556. /* 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)
  17557. /* harmony export */ });
  17558. /* 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");
  17559. /***/ }),
  17560. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17561. /*!*****************************************************************************************!*\
  17562. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17563. \*****************************************************************************************/
  17564. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17565. "use strict";
  17566. __webpack_require__.r(__webpack_exports__);
  17567. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17568. /* 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)
  17569. /* harmony export */ });
  17570. /* 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");
  17571. /***/ }),
  17572. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17573. /*!********************************************************************************************!*\
  17574. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17575. \********************************************************************************************/
  17576. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17577. "use strict";
  17578. __webpack_require__.r(__webpack_exports__);
  17579. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17580. /* harmony export */ "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)
  17581. /* harmony export */ });
  17582. /* 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");
  17583. /***/ }),
  17584. /***/ "./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa":
  17585. /*!*************************************************************************!*\
  17586. !*** ./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa ***!
  17587. \*************************************************************************/
  17588. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17589. "use strict";
  17590. __webpack_require__.r(__webpack_exports__);
  17591. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17592. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_9329f6aa__WEBPACK_IMPORTED_MODULE_0__.render)
  17593. /* harmony export */ });
  17594. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_9329f6aa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=template&id=9329f6aa */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa");
  17595. /***/ }),
  17596. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17597. /*!********************************************************************************************************!*\
  17598. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17599. \********************************************************************************************************/
  17600. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17601. "use strict";
  17602. __webpack_require__.r(__webpack_exports__);
  17603. /* 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");
  17604. /***/ }),
  17605. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17606. /*!*********************************************************************************************************!*\
  17607. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17608. \*********************************************************************************************************/
  17609. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17610. "use strict";
  17611. __webpack_require__.r(__webpack_exports__);
  17612. /* 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");
  17613. /***/ }),
  17614. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17615. /*!************************************************************************************************************!*\
  17616. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17617. \************************************************************************************************************/
  17618. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17619. "use strict";
  17620. __webpack_require__.r(__webpack_exports__);
  17621. /* 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");
  17622. /***/ }),
  17623. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17624. /*!********************************************************************************************************!*\
  17625. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17626. \********************************************************************************************************/
  17627. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17628. "use strict";
  17629. __webpack_require__.r(__webpack_exports__);
  17630. /* 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");
  17631. /***/ }),
  17632. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17633. /*!***********************************************************************************************************!*\
  17634. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17635. \***********************************************************************************************************/
  17636. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17637. "use strict";
  17638. __webpack_require__.r(__webpack_exports__);
  17639. /* 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");
  17640. /***/ })
  17641. }]);