resources_js_pages_user_Index_vue.js 694KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_user_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js":
  259. /*!**********************************************************************************************************************************************************************************************************!*\
  260. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js ***!
  261. \**********************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  269. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/user/tableHeader.js");
  274. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  275. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  276. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  277. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  278. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  279. props: {
  280. users: Object,
  281. initialSearch: String
  282. },
  283. setup: function setup(__props, _ref) {
  284. var expose = _ref.expose;
  285. expose();
  286. var props = __props;
  287. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  288. search = _useSearchText.search;
  289. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  290. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/users', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  291. search: search.value
  292. }), {
  293. preserveState: true
  294. });
  295. });
  296. var __returned__ = {
  297. props: props,
  298. search: search,
  299. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  300. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  301. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  302. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  303. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  304. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  305. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  306. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  307. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  308. };
  309. Object.defineProperty(__returned__, '__isScriptSetup', {
  310. enumerable: false,
  311. value: true
  312. });
  313. return __returned__;
  314. }
  315. });
  316. /***/ }),
  317. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  318. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  319. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  320. \***********************************************************************************************************************************************************************************************************************************************************************************/
  321. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  322. "use strict";
  323. __webpack_require__.r(__webpack_exports__);
  324. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  325. /* harmony export */ "render": () => (/* binding */ render)
  326. /* harmony export */ });
  327. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  328. var _hoisted_1 = {
  329. key: 1,
  330. "class": "p-button-label"
  331. };
  332. var _hoisted_2 = {
  333. key: 1,
  334. "class": "p-button-label"
  335. };
  336. function render(_ctx, _cache, $props, $setup, $data, $options) {
  337. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  338. key: 0,
  339. "class": "p-button p-component",
  340. as: "button",
  341. type: "button"
  342. }, {
  343. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  344. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  345. key: 0,
  346. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  347. }, null, 2
  348. /* CLASS */
  349. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  350. /* TEXT */
  351. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  352. }),
  353. _: 1
  354. /* STABLE */
  355. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  356. key: 1,
  357. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  358. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  359. key: 0,
  360. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  361. }, null, 2
  362. /* CLASS */
  363. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  364. /* TEXT */
  365. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  366. /* CLASS */
  367. ));
  368. }
  369. /***/ }),
  370. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  371. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  372. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  373. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  374. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  375. "use strict";
  376. __webpack_require__.r(__webpack_exports__);
  377. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  378. /* harmony export */ "render": () => (/* binding */ render)
  379. /* harmony export */ });
  380. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  381. var _withScopeId = function _withScopeId(n) {
  382. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  383. };
  384. var _hoisted_1 = {
  385. "class": "layout-footer"
  386. };
  387. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  388. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  389. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  390. href: "https://dijitalcode.com",
  391. target: "_blank",
  392. "class": "font-medium ml-2"
  393. }, "DijitalCODE", -1
  394. /* HOISTED */
  395. );
  396. });
  397. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  398. function render(_ctx, _cache) {
  399. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  400. }
  401. /***/ }),
  402. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  403. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  404. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  405. \********************************************************************************************************************************************************************************************************************************************************************************/
  406. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  407. "use strict";
  408. __webpack_require__.r(__webpack_exports__);
  409. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  410. /* harmony export */ "render": () => (/* binding */ render)
  411. /* harmony export */ });
  412. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  413. var _hoisted_1 = {
  414. key: 0
  415. };
  416. var _hoisted_2 = {
  417. key: 1
  418. };
  419. function render(_ctx, _cache, $props, $setup, $data, $options) {
  420. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  421. 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, {
  422. key: 0,
  423. severity: "success",
  424. onClose: $setup.onClose
  425. }, {
  426. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  427. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  428. /* TEXT */
  429. )];
  430. }),
  431. _: 1
  432. /* STABLE */
  433. })) : (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, {
  434. key: 1,
  435. severity: "error",
  436. onClose: $setup.onClose
  437. }, {
  438. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  439. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  440. /* TEXT */
  441. )];
  442. }),
  443. _: 1
  444. /* STABLE */
  445. })) : (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, {
  446. key: 2,
  447. severity: "error",
  448. onClose: $setup.onClose
  449. }, {
  450. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  451. 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
  452. /* TEXT */
  453. ))];
  454. }),
  455. _: 1
  456. /* STABLE */
  457. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  458. /* STABLE_FRAGMENT */
  459. );
  460. }
  461. /***/ }),
  462. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  463. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  464. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  465. \***********************************************************************************************************************************************************************************************************************************************************************************/
  466. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  467. "use strict";
  468. __webpack_require__.r(__webpack_exports__);
  469. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  470. /* harmony export */ "render": () => (/* binding */ render)
  471. /* harmony export */ });
  472. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  473. var _hoisted_1 = {
  474. key: 0,
  475. "class": "p-paginator p-component flex justify-content-start"
  476. };
  477. var _hoisted_2 = {
  478. "class": "p-paginator-pages"
  479. };
  480. var _hoisted_3 = ["innerHTML"];
  481. function render(_ctx, _cache, $props, $setup, $data, $options) {
  482. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  483. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  484. key: "link-".concat(key),
  485. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  486. 'p-disabled': link
  487. }]),
  488. innerHTML: link.label
  489. }, null, 10
  490. /* CLASS, PROPS */
  491. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  492. key: "link-".concat(key),
  493. href: link.url,
  494. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  495. 'p-highlight': link.active
  496. }, "p-paginator-page p-paginator-element p-link"]),
  497. innerHTML: link.label
  498. }, null, 8
  499. /* PROPS */
  500. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  501. /* STABLE_FRAGMENT */
  502. );
  503. }), 256
  504. /* UNKEYED_FRAGMENT */
  505. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  506. }
  507. /***/ }),
  508. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  509. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  510. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  511. \********************************************************************************************************************************************************************************************************************************************************************************************/
  512. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  513. "use strict";
  514. __webpack_require__.r(__webpack_exports__);
  515. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  516. /* harmony export */ "render": () => (/* binding */ render)
  517. /* harmony export */ });
  518. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  519. function render(_ctx, _cache, $props, $setup, $data, $options) {
  520. 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"], {
  521. "class": "layout-menu",
  522. items: $props.menu,
  523. root: true
  524. }, null, 8
  525. /* PROPS */
  526. , ["items"])]);
  527. }
  528. /***/ }),
  529. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  530. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  531. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  532. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  533. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  534. "use strict";
  535. __webpack_require__.r(__webpack_exports__);
  536. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  537. /* harmony export */ "render": () => (/* binding */ render)
  538. /* harmony export */ });
  539. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  540. var _withScopeId = function _withScopeId(n) {
  541. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  542. };
  543. var _hoisted_1 = {
  544. key: 0
  545. };
  546. var _hoisted_2 = ["aria-label"];
  547. var _hoisted_3 = ["aria-label"];
  548. function render(_ctx, _cache, $props, $setup, $data, $options) {
  549. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  550. 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) {
  551. 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", {
  552. key: i,
  553. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  554. 'layout-menuitem-category': $props.root
  555. }]),
  556. role: "none"
  557. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  558. key: 0
  559. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  560. "class": "layout-menuitem-root-text",
  561. "aria-label": item.label
  562. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  563. /* TEXT, PROPS */
  564. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  565. items: item.items
  566. }, null, 8
  567. /* PROPS */
  568. , ["items"])], 64
  569. /* STABLE_FRAGMENT */
  570. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  571. key: 1
  572. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  573. key: 0,
  574. role: "menuitem",
  575. href: item.to,
  576. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  577. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  578. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  579. }]),
  580. "aria-label": item.label
  581. }, {
  582. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  583. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  584. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  585. }, null, 2
  586. /* CLASS */
  587. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  588. /* TEXT */
  589. )];
  590. }),
  591. _: 2
  592. /* DYNAMIC */
  593. }, 1032
  594. /* PROPS, DYNAMIC_SLOTS */
  595. , ["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", {
  596. key: 1,
  597. href: "#",
  598. role: "menuitem",
  599. "aria-label": item.label
  600. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  601. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  602. }, null, 2
  603. /* CLASS */
  604. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  605. /* TEXT */
  606. )], 8
  607. /* PROPS */
  608. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  609. items: item.items
  610. }, null, 8
  611. /* PROPS */
  612. , ["items"])], 64
  613. /* STABLE_FRAGMENT */
  614. ))], 2
  615. /* CLASS */
  616. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  617. /* STABLE_FRAGMENT */
  618. );
  619. }), 256
  620. /* UNKEYED_FRAGMENT */
  621. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  622. }
  623. /***/ }),
  624. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  625. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  626. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  627. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  628. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  629. "use strict";
  630. __webpack_require__.r(__webpack_exports__);
  631. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  632. /* harmony export */ "render": () => (/* binding */ render)
  633. /* harmony export */ });
  634. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  635. var _withScopeId = function _withScopeId(n) {
  636. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  637. };
  638. var _hoisted_1 = {
  639. "class": "layout-topbar"
  640. };
  641. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  642. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  643. alt: "Logo",
  644. src: "/images/logo.svg",
  645. "class": "md:mr-3"
  646. }, null, -1
  647. /* HOISTED */
  648. );
  649. });
  650. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  651. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  652. /* HOISTED */
  653. );
  654. });
  655. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  656. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  657. "class": "pi pi-bars"
  658. }, null, -1
  659. /* HOISTED */
  660. );
  661. });
  662. var _hoisted_5 = [_hoisted_4];
  663. var _hoisted_6 = {
  664. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  665. };
  666. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  667. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  668. "class": "pi pi-ellipsis-v"
  669. }, null, -1
  670. /* HOISTED */
  671. );
  672. });
  673. var _hoisted_8 = [_hoisted_7];
  674. var _hoisted_9 = {
  675. "class": "layout-topbar-menu hidden lg:flex origin-top"
  676. };
  677. var _hoisted_10 = {
  678. "class": "align-self-center"
  679. };
  680. var _hoisted_11 = {
  681. "class": "hidden lg:inline"
  682. };
  683. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  684. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  685. "class": "pi pi-user"
  686. }, null, -1
  687. /* HOISTED */
  688. );
  689. });
  690. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  691. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  692. /* HOISTED */
  693. );
  694. });
  695. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  696. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  697. "class": "pi pi-sign-out"
  698. }, null, -1
  699. /* HOISTED */
  700. );
  701. });
  702. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  703. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  704. /* HOISTED */
  705. );
  706. });
  707. function render(_ctx, _cache, $props, $setup, $data, $options) {
  708. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  709. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  710. 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"], {
  711. href: "/",
  712. "class": "layout-topbar-logo"
  713. }, {
  714. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  715. return [_hoisted_2, _hoisted_3];
  716. }),
  717. _: 1
  718. /* STABLE */
  719. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  720. "class": "p-link layout-menu-button layout-topbar-button",
  721. onClick: _cache[0] || (_cache[0] = function ($event) {
  722. return _ctx.$emit('menu-toggle', $event);
  723. })
  724. }, _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, {
  725. selector: '@next',
  726. enterClass: 'hidden',
  727. enterActiveClass: 'scalein',
  728. leaveToClass: 'hidden',
  729. leaveActiveClass: 'fadeout',
  730. hideOnOutsideClick: true
  731. }]]), (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
  732. /* TEXT */
  733. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  734. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  735. "class": "p-link layout-topbar-button"
  736. }, {
  737. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  738. return [_hoisted_12, _hoisted_13];
  739. }),
  740. _: 1
  741. /* STABLE */
  742. }, 8
  743. /* PROPS */
  744. , ["href"])), [[_directive_tooltip, {
  745. value: 'Ubah Profil',
  746. "class": 'layout-topbar-menu-tooltip'
  747. }, void 0, {
  748. bottom: true
  749. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  750. href: _ctx.route('logout'),
  751. as: "button",
  752. method: "post",
  753. "class": "p-link layout-topbar-button"
  754. }, {
  755. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  756. return [_hoisted_14, _hoisted_15];
  757. }),
  758. _: 1
  759. /* STABLE */
  760. }, 8
  761. /* PROPS */
  762. , ["href"])), [[_directive_tooltip, {
  763. value: 'Keluar',
  764. "class": 'layout-topbar-menu-tooltip'
  765. }, void 0, {
  766. bottom: true
  767. }]])])])]);
  768. }
  769. /***/ }),
  770. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  771. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  772. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  773. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  774. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  775. "use strict";
  776. __webpack_require__.r(__webpack_exports__);
  777. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  778. /* harmony export */ "render": () => (/* binding */ render)
  779. /* harmony export */ });
  780. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  781. var _withScopeId = function _withScopeId(n) {
  782. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  783. };
  784. var _hoisted_1 = {
  785. "class": "layout-sidebar"
  786. };
  787. var _hoisted_2 = {
  788. "class": "layout-main-container"
  789. };
  790. var _hoisted_3 = {
  791. "class": "layout-main"
  792. };
  793. var _hoisted_4 = {
  794. key: 0,
  795. "class": "layout-mask p-component-overlay"
  796. };
  797. function render(_ctx, _cache, $props, $setup, $data, $options) {
  798. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  799. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  800. onClick: $setup.onWrapperClick
  801. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  802. onMenuToggle: $setup.onMenuToggle
  803. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  804. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  805. }, null, 8
  806. /* PROPS */
  807. , ["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, {
  808. name: "layout-mask"
  809. }, {
  810. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  811. 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)];
  812. }),
  813. _: 1
  814. /* STABLE */
  815. })], 2
  816. /* CLASS */
  817. );
  818. }
  819. /***/ }),
  820. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497":
  821. /*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  822. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497 ***!
  823. \***************************************************************************************************************************************************************************************************************************************************************************/
  824. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  825. "use strict";
  826. __webpack_require__.r(__webpack_exports__);
  827. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  828. /* harmony export */ "render": () => (/* binding */ render)
  829. /* harmony export */ });
  830. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  831. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "User", -1
  832. /* HOISTED */
  833. );
  834. var _hoisted_2 = {
  835. "class": "grid"
  836. };
  837. var _hoisted_3 = {
  838. "class": "col-12 md:col-8"
  839. };
  840. var _hoisted_4 = {
  841. "class": "flex align-items-center"
  842. };
  843. var _hoisted_5 = {
  844. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  845. };
  846. function render(_ctx, _cache, $props, $setup, $data, $options) {
  847. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  848. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  849. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  850. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  851. title: "Daftar User"
  852. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  853. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  854. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  855. responsiveLayout: "scroll",
  856. columnResizeMode: "expand",
  857. value: $props.users.data,
  858. rowHover: true,
  859. stripedRows: true
  860. }, {
  861. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  862. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  863. "class": "w-full md:w-27rem",
  864. placeholder: "cari, contoh: tina, tina@xx.com",
  865. modelValue: $setup.search,
  866. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  867. return $setup.search = $event;
  868. })
  869. }, null, 8
  870. /* PROPS */
  871. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  872. label: "Tambah User",
  873. icon: "pi pi-pencil",
  874. "class": "p-button-outlined",
  875. href: _ctx.route('users.create')
  876. }, null, 8
  877. /* PROPS */
  878. , ["href"])])])];
  879. }),
  880. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  881. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.tableHeader, function (value) {
  882. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  883. field: value.field,
  884. header: value.header,
  885. key: value.field
  886. }, null, 8
  887. /* PROPS */
  888. , ["field", "header"]);
  889. }), 128
  890. /* KEYED_FRAGMENT */
  891. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  892. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  893. var data = _ref.data;
  894. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  895. icon: "pi pi-pencil",
  896. "class": "p-button-icon-only p-button-rounded p-button-text",
  897. href: _ctx.route('users.edit', data.id)
  898. }, null, 8
  899. /* PROPS */
  900. , ["href"])];
  901. }),
  902. _: 1
  903. /* STABLE */
  904. })];
  905. }),
  906. _: 1
  907. /* STABLE */
  908. }, 8
  909. /* PROPS */
  910. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  911. links: $props.users.links
  912. }, null, 8
  913. /* PROPS */
  914. , ["links"])];
  915. }),
  916. _: 1
  917. /* STABLE */
  918. })], 64
  919. /* STABLE_FRAGMENT */
  920. );
  921. }
  922. /***/ }),
  923. /***/ "./resources/js/components/useSearchText.js":
  924. /*!**************************************************!*\
  925. !*** ./resources/js/components/useSearchText.js ***!
  926. \**************************************************/
  927. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  928. "use strict";
  929. __webpack_require__.r(__webpack_exports__);
  930. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  931. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  932. /* harmony export */ });
  933. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  934. function useSearchText(props) {
  935. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  936. return {
  937. search: search
  938. };
  939. }
  940. /***/ }),
  941. /***/ "./resources/js/pages/user/tableHeader.js":
  942. /*!************************************************!*\
  943. !*** ./resources/js/pages/user/tableHeader.js ***!
  944. \************************************************/
  945. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  946. "use strict";
  947. __webpack_require__.r(__webpack_exports__);
  948. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  949. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  950. /* harmony export */ });
  951. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  952. field: 'name',
  953. header: 'Nama'
  954. }, {
  955. field: 'email',
  956. header: 'Email'
  957. }, {
  958. field: 'role',
  959. header: 'Hak Akses'
  960. }, {
  961. field: 'status',
  962. header: 'Status'
  963. }]);
  964. /***/ }),
  965. /***/ "./resources/js/utils/menu.js":
  966. /*!************************************!*\
  967. !*** ./resources/js/utils/menu.js ***!
  968. \************************************/
  969. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  970. "use strict";
  971. __webpack_require__.r(__webpack_exports__);
  972. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  973. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  974. /* harmony export */ });
  975. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  976. // Admin
  977. 1: [{
  978. label: 'Home',
  979. items: [{
  980. label: 'Dashboard',
  981. icon: 'pi pi-home',
  982. to: '/dashboards',
  983. component: 'home/Index'
  984. }]
  985. }, {
  986. label: 'Master',
  987. items: [{
  988. label: 'User',
  989. icon: 'pi pi-user',
  990. to: '/users',
  991. component: 'user/Index'
  992. }]
  993. }],
  994. // Supervisor
  995. 2: [{
  996. label: 'Home',
  997. items: [{
  998. label: 'Dashboard',
  999. icon: 'pi pi-home',
  1000. to: '/dashboards',
  1001. component: 'home/Index'
  1002. }]
  1003. }, {
  1004. label: 'Menu',
  1005. items: [{
  1006. label: 'Pengeluaran',
  1007. icon: 'pi pi-wallet',
  1008. to: '/expenses',
  1009. component: 'expense/Index'
  1010. }, {
  1011. label: 'Laporan',
  1012. icon: 'pi pi-book',
  1013. items: [{
  1014. label: 'Mutasi',
  1015. icon: 'pi pi-circle',
  1016. to: '/reports/mutations',
  1017. component: 'mutation/Report'
  1018. }]
  1019. }]
  1020. }, {
  1021. label: 'Master',
  1022. items: [{
  1023. label: 'Jenis Kendaraan',
  1024. icon: 'pi pi-car',
  1025. to: '/type-vehicles',
  1026. component: 'typevehicle/Index'
  1027. }, {
  1028. label: 'Jenis Member',
  1029. icon: 'pi pi-id-card',
  1030. to: '/type-members',
  1031. component: 'typemember/Index'
  1032. }]
  1033. }, {
  1034. label: 'Pengaturan',
  1035. items: [{
  1036. label: 'Tarif Parkir',
  1037. icon: 'pi pi-car',
  1038. to: '/parking-fees/create',
  1039. component: 'parkingfee/Create'
  1040. }]
  1041. }],
  1042. // Operator
  1043. 3: [{
  1044. label: 'Home',
  1045. items: [{
  1046. label: 'Dashboard',
  1047. icon: 'pi pi-home',
  1048. to: '/dashboards',
  1049. component: 'home/Index'
  1050. }]
  1051. }, {
  1052. label: 'Transaksi',
  1053. items: [{
  1054. label: 'Transaksi masuk dan keluar',
  1055. icon: 'pi pi-car',
  1056. to: '/transactions/create',
  1057. component: 'transaction/Create'
  1058. }]
  1059. }, {
  1060. label: 'Menu',
  1061. items: [{
  1062. label: 'Pengeluaran',
  1063. icon: 'pi pi-wallet',
  1064. to: '/expenses',
  1065. component: 'expense/Index'
  1066. }, {
  1067. label: 'Member',
  1068. icon: 'pi pi-id-card',
  1069. to: '/members',
  1070. component: 'member/Index'
  1071. }, {
  1072. label: 'Top Up',
  1073. icon: 'pi pi-car',
  1074. to: '/top-ups',
  1075. component: 'topup/Index'
  1076. }]
  1077. }]
  1078. });
  1079. /***/ }),
  1080. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1081. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1082. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1083. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1084. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1085. "use strict";
  1086. __webpack_require__.r(__webpack_exports__);
  1087. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1088. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1089. /* harmony export */ });
  1090. /* 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");
  1091. /* 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__);
  1092. // Imports
  1093. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1094. // Module
  1095. ___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}", ""]);
  1096. // Exports
  1097. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1098. /***/ }),
  1099. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1100. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1101. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1102. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1103. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1104. "use strict";
  1105. __webpack_require__.r(__webpack_exports__);
  1106. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1107. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1108. /* harmony export */ });
  1109. /* 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");
  1110. /* 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__);
  1111. // Imports
  1112. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1113. // Module
  1114. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1115. // Exports
  1116. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1117. /***/ }),
  1118. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1119. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1120. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1121. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1122. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1123. "use strict";
  1124. __webpack_require__.r(__webpack_exports__);
  1125. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1126. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1127. /* harmony export */ });
  1128. /* 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");
  1129. /* 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__);
  1130. // Imports
  1131. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1132. // Module
  1133. ___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}", ""]);
  1134. // Exports
  1135. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1136. /***/ }),
  1137. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1138. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1139. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1140. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1141. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1142. "use strict";
  1143. __webpack_require__.r(__webpack_exports__);
  1144. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1145. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1146. /* harmony export */ });
  1147. /* 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");
  1148. /* 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__);
  1149. // Imports
  1150. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1151. // Module
  1152. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1153. // Exports
  1154. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1155. /***/ }),
  1156. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1157. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1158. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1159. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1160. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1161. "use strict";
  1162. __webpack_require__.r(__webpack_exports__);
  1163. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1164. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1165. /* harmony export */ });
  1166. /* 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");
  1167. /* 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__);
  1168. // Imports
  1169. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1170. // Module
  1171. ___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}", ""]);
  1172. // Exports
  1173. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1174. /***/ }),
  1175. /***/ "./node_modules/lodash/lodash.js":
  1176. /*!***************************************!*\
  1177. !*** ./node_modules/lodash/lodash.js ***!
  1178. \***************************************/
  1179. /***/ (function(module, exports, __webpack_require__) {
  1180. /* module decorator */ module = __webpack_require__.nmd(module);
  1181. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1182. * @license
  1183. * Lodash <https://lodash.com/>
  1184. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1185. * Released under MIT license <https://lodash.com/license>
  1186. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1187. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1188. */
  1189. ;(function() {
  1190. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1191. var undefined;
  1192. /** Used as the semantic version number. */
  1193. var VERSION = '4.17.21';
  1194. /** Used as the size to enable large array optimizations. */
  1195. var LARGE_ARRAY_SIZE = 200;
  1196. /** Error message constants. */
  1197. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1198. FUNC_ERROR_TEXT = 'Expected a function',
  1199. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1200. /** Used to stand-in for `undefined` hash values. */
  1201. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1202. /** Used as the maximum memoize cache size. */
  1203. var MAX_MEMOIZE_SIZE = 500;
  1204. /** Used as the internal argument placeholder. */
  1205. var PLACEHOLDER = '__lodash_placeholder__';
  1206. /** Used to compose bitmasks for cloning. */
  1207. var CLONE_DEEP_FLAG = 1,
  1208. CLONE_FLAT_FLAG = 2,
  1209. CLONE_SYMBOLS_FLAG = 4;
  1210. /** Used to compose bitmasks for value comparisons. */
  1211. var COMPARE_PARTIAL_FLAG = 1,
  1212. COMPARE_UNORDERED_FLAG = 2;
  1213. /** Used to compose bitmasks for function metadata. */
  1214. var WRAP_BIND_FLAG = 1,
  1215. WRAP_BIND_KEY_FLAG = 2,
  1216. WRAP_CURRY_BOUND_FLAG = 4,
  1217. WRAP_CURRY_FLAG = 8,
  1218. WRAP_CURRY_RIGHT_FLAG = 16,
  1219. WRAP_PARTIAL_FLAG = 32,
  1220. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1221. WRAP_ARY_FLAG = 128,
  1222. WRAP_REARG_FLAG = 256,
  1223. WRAP_FLIP_FLAG = 512;
  1224. /** Used as default options for `_.truncate`. */
  1225. var DEFAULT_TRUNC_LENGTH = 30,
  1226. DEFAULT_TRUNC_OMISSION = '...';
  1227. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1228. var HOT_COUNT = 800,
  1229. HOT_SPAN = 16;
  1230. /** Used to indicate the type of lazy iteratees. */
  1231. var LAZY_FILTER_FLAG = 1,
  1232. LAZY_MAP_FLAG = 2,
  1233. LAZY_WHILE_FLAG = 3;
  1234. /** Used as references for various `Number` constants. */
  1235. var INFINITY = 1 / 0,
  1236. MAX_SAFE_INTEGER = 9007199254740991,
  1237. MAX_INTEGER = 1.7976931348623157e+308,
  1238. NAN = 0 / 0;
  1239. /** Used as references for the maximum length and index of an array. */
  1240. var MAX_ARRAY_LENGTH = 4294967295,
  1241. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1242. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1243. /** Used to associate wrap methods with their bit flags. */
  1244. var wrapFlags = [
  1245. ['ary', WRAP_ARY_FLAG],
  1246. ['bind', WRAP_BIND_FLAG],
  1247. ['bindKey', WRAP_BIND_KEY_FLAG],
  1248. ['curry', WRAP_CURRY_FLAG],
  1249. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1250. ['flip', WRAP_FLIP_FLAG],
  1251. ['partial', WRAP_PARTIAL_FLAG],
  1252. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1253. ['rearg', WRAP_REARG_FLAG]
  1254. ];
  1255. /** `Object#toString` result references. */
  1256. var argsTag = '[object Arguments]',
  1257. arrayTag = '[object Array]',
  1258. asyncTag = '[object AsyncFunction]',
  1259. boolTag = '[object Boolean]',
  1260. dateTag = '[object Date]',
  1261. domExcTag = '[object DOMException]',
  1262. errorTag = '[object Error]',
  1263. funcTag = '[object Function]',
  1264. genTag = '[object GeneratorFunction]',
  1265. mapTag = '[object Map]',
  1266. numberTag = '[object Number]',
  1267. nullTag = '[object Null]',
  1268. objectTag = '[object Object]',
  1269. promiseTag = '[object Promise]',
  1270. proxyTag = '[object Proxy]',
  1271. regexpTag = '[object RegExp]',
  1272. setTag = '[object Set]',
  1273. stringTag = '[object String]',
  1274. symbolTag = '[object Symbol]',
  1275. undefinedTag = '[object Undefined]',
  1276. weakMapTag = '[object WeakMap]',
  1277. weakSetTag = '[object WeakSet]';
  1278. var arrayBufferTag = '[object ArrayBuffer]',
  1279. dataViewTag = '[object DataView]',
  1280. float32Tag = '[object Float32Array]',
  1281. float64Tag = '[object Float64Array]',
  1282. int8Tag = '[object Int8Array]',
  1283. int16Tag = '[object Int16Array]',
  1284. int32Tag = '[object Int32Array]',
  1285. uint8Tag = '[object Uint8Array]',
  1286. uint8ClampedTag = '[object Uint8ClampedArray]',
  1287. uint16Tag = '[object Uint16Array]',
  1288. uint32Tag = '[object Uint32Array]';
  1289. /** Used to match empty string literals in compiled template source. */
  1290. var reEmptyStringLeading = /\b__p \+= '';/g,
  1291. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1292. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1293. /** Used to match HTML entities and HTML characters. */
  1294. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1295. reUnescapedHtml = /[&<>"']/g,
  1296. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1297. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1298. /** Used to match template delimiters. */
  1299. var reEscape = /<%-([\s\S]+?)%>/g,
  1300. reEvaluate = /<%([\s\S]+?)%>/g,
  1301. reInterpolate = /<%=([\s\S]+?)%>/g;
  1302. /** Used to match property names within property paths. */
  1303. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1304. reIsPlainProp = /^\w*$/,
  1305. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1306. /**
  1307. * Used to match `RegExp`
  1308. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1309. */
  1310. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1311. reHasRegExpChar = RegExp(reRegExpChar.source);
  1312. /** Used to match leading whitespace. */
  1313. var reTrimStart = /^\s+/;
  1314. /** Used to match a single whitespace character. */
  1315. var reWhitespace = /\s/;
  1316. /** Used to match wrap detail comments. */
  1317. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1318. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1319. reSplitDetails = /,? & /;
  1320. /** Used to match words composed of alphanumeric characters. */
  1321. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1322. /**
  1323. * Used to validate the `validate` option in `_.template` variable.
  1324. *
  1325. * Forbids characters which could potentially change the meaning of the function argument definition:
  1326. * - "()," (modification of function parameters)
  1327. * - "=" (default value)
  1328. * - "[]{}" (destructuring of function parameters)
  1329. * - "/" (beginning of a comment)
  1330. * - whitespace
  1331. */
  1332. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1333. /** Used to match backslashes in property paths. */
  1334. var reEscapeChar = /\\(\\)?/g;
  1335. /**
  1336. * Used to match
  1337. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1338. */
  1339. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1340. /** Used to match `RegExp` flags from their coerced string values. */
  1341. var reFlags = /\w*$/;
  1342. /** Used to detect bad signed hexadecimal string values. */
  1343. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1344. /** Used to detect binary string values. */
  1345. var reIsBinary = /^0b[01]+$/i;
  1346. /** Used to detect host constructors (Safari). */
  1347. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1348. /** Used to detect octal string values. */
  1349. var reIsOctal = /^0o[0-7]+$/i;
  1350. /** Used to detect unsigned integer values. */
  1351. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1352. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1353. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1354. /** Used to ensure capturing order of template delimiters. */
  1355. var reNoMatch = /($^)/;
  1356. /** Used to match unescaped characters in compiled string literals. */
  1357. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1358. /** Used to compose unicode character classes. */
  1359. var rsAstralRange = '\\ud800-\\udfff',
  1360. rsComboMarksRange = '\\u0300-\\u036f',
  1361. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1362. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1363. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1364. rsDingbatRange = '\\u2700-\\u27bf',
  1365. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1366. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1367. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1368. rsPunctuationRange = '\\u2000-\\u206f',
  1369. 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',
  1370. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1371. rsVarRange = '\\ufe0e\\ufe0f',
  1372. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1373. /** Used to compose unicode capture groups. */
  1374. var rsApos = "['\u2019]",
  1375. rsAstral = '[' + rsAstralRange + ']',
  1376. rsBreak = '[' + rsBreakRange + ']',
  1377. rsCombo = '[' + rsComboRange + ']',
  1378. rsDigits = '\\d+',
  1379. rsDingbat = '[' + rsDingbatRange + ']',
  1380. rsLower = '[' + rsLowerRange + ']',
  1381. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1382. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1383. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1384. rsNonAstral = '[^' + rsAstralRange + ']',
  1385. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1386. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1387. rsUpper = '[' + rsUpperRange + ']',
  1388. rsZWJ = '\\u200d';
  1389. /** Used to compose unicode regexes. */
  1390. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1391. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1392. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1393. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1394. reOptMod = rsModifier + '?',
  1395. rsOptVar = '[' + rsVarRange + ']?',
  1396. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1397. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1398. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1399. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1400. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1401. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1402. /** Used to match apostrophes. */
  1403. var reApos = RegExp(rsApos, 'g');
  1404. /**
  1405. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1406. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1407. */
  1408. var reComboMark = RegExp(rsCombo, 'g');
  1409. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1410. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1411. /** Used to match complex or compound words. */
  1412. var reUnicodeWord = RegExp([
  1413. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1414. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1415. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1416. rsUpper + '+' + rsOptContrUpper,
  1417. rsOrdUpper,
  1418. rsOrdLower,
  1419. rsDigits,
  1420. rsEmoji
  1421. ].join('|'), 'g');
  1422. /** 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/). */
  1423. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1424. /** Used to detect strings that need a more robust regexp to match words. */
  1425. 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 ]/;
  1426. /** Used to assign default `context` object properties. */
  1427. var contextProps = [
  1428. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1429. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1430. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1431. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1432. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1433. ];
  1434. /** Used to make template sourceURLs easier to identify. */
  1435. var templateCounter = -1;
  1436. /** Used to identify `toStringTag` values of typed arrays. */
  1437. var typedArrayTags = {};
  1438. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1439. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1440. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1441. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1442. typedArrayTags[uint32Tag] = true;
  1443. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1444. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1445. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1446. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1447. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1448. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1449. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1450. typedArrayTags[weakMapTag] = false;
  1451. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1452. var cloneableTags = {};
  1453. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1454. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1455. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1456. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1457. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1458. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1459. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1460. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1461. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1462. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1463. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1464. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1465. cloneableTags[weakMapTag] = false;
  1466. /** Used to map Latin Unicode letters to basic Latin letters. */
  1467. var deburredLetters = {
  1468. // Latin-1 Supplement block.
  1469. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1470. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1471. '\xc7': 'C', '\xe7': 'c',
  1472. '\xd0': 'D', '\xf0': 'd',
  1473. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1474. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1475. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1476. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1477. '\xd1': 'N', '\xf1': 'n',
  1478. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1479. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1480. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1481. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1482. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1483. '\xc6': 'Ae', '\xe6': 'ae',
  1484. '\xde': 'Th', '\xfe': 'th',
  1485. '\xdf': 'ss',
  1486. // Latin Extended-A block.
  1487. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1488. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1489. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1490. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1491. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1492. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1493. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1494. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1495. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1496. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1497. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1498. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1499. '\u0134': 'J', '\u0135': 'j',
  1500. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1501. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1502. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1503. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1504. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1505. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1506. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1507. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1508. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1509. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1510. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1511. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1512. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1513. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1514. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1515. '\u0174': 'W', '\u0175': 'w',
  1516. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1517. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1518. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1519. '\u0132': 'IJ', '\u0133': 'ij',
  1520. '\u0152': 'Oe', '\u0153': 'oe',
  1521. '\u0149': "'n", '\u017f': 's'
  1522. };
  1523. /** Used to map characters to HTML entities. */
  1524. var htmlEscapes = {
  1525. '&': '&amp;',
  1526. '<': '&lt;',
  1527. '>': '&gt;',
  1528. '"': '&quot;',
  1529. "'": '&#39;'
  1530. };
  1531. /** Used to map HTML entities to characters. */
  1532. var htmlUnescapes = {
  1533. '&amp;': '&',
  1534. '&lt;': '<',
  1535. '&gt;': '>',
  1536. '&quot;': '"',
  1537. '&#39;': "'"
  1538. };
  1539. /** Used to escape characters for inclusion in compiled string literals. */
  1540. var stringEscapes = {
  1541. '\\': '\\',
  1542. "'": "'",
  1543. '\n': 'n',
  1544. '\r': 'r',
  1545. '\u2028': 'u2028',
  1546. '\u2029': 'u2029'
  1547. };
  1548. /** Built-in method references without a dependency on `root`. */
  1549. var freeParseFloat = parseFloat,
  1550. freeParseInt = parseInt;
  1551. /** Detect free variable `global` from Node.js. */
  1552. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1553. /** Detect free variable `self`. */
  1554. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1555. /** Used as a reference to the global object. */
  1556. var root = freeGlobal || freeSelf || Function('return this')();
  1557. /** Detect free variable `exports`. */
  1558. var freeExports = true && exports && !exports.nodeType && exports;
  1559. /** Detect free variable `module`. */
  1560. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1561. /** Detect the popular CommonJS extension `module.exports`. */
  1562. var moduleExports = freeModule && freeModule.exports === freeExports;
  1563. /** Detect free variable `process` from Node.js. */
  1564. var freeProcess = moduleExports && freeGlobal.process;
  1565. /** Used to access faster Node.js helpers. */
  1566. var nodeUtil = (function() {
  1567. try {
  1568. // Use `util.types` for Node.js 10+.
  1569. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1570. if (types) {
  1571. return types;
  1572. }
  1573. // Legacy `process.binding('util')` for Node.js < 10.
  1574. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1575. } catch (e) {}
  1576. }());
  1577. /* Node.js helper references. */
  1578. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1579. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1580. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1581. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1582. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1583. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1584. /*--------------------------------------------------------------------------*/
  1585. /**
  1586. * A faster alternative to `Function#apply`, this function invokes `func`
  1587. * with the `this` binding of `thisArg` and the arguments of `args`.
  1588. *
  1589. * @private
  1590. * @param {Function} func The function to invoke.
  1591. * @param {*} thisArg The `this` binding of `func`.
  1592. * @param {Array} args The arguments to invoke `func` with.
  1593. * @returns {*} Returns the result of `func`.
  1594. */
  1595. function apply(func, thisArg, args) {
  1596. switch (args.length) {
  1597. case 0: return func.call(thisArg);
  1598. case 1: return func.call(thisArg, args[0]);
  1599. case 2: return func.call(thisArg, args[0], args[1]);
  1600. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1601. }
  1602. return func.apply(thisArg, args);
  1603. }
  1604. /**
  1605. * A specialized version of `baseAggregator` for arrays.
  1606. *
  1607. * @private
  1608. * @param {Array} [array] The array to iterate over.
  1609. * @param {Function} setter The function to set `accumulator` values.
  1610. * @param {Function} iteratee The iteratee to transform keys.
  1611. * @param {Object} accumulator The initial aggregated object.
  1612. * @returns {Function} Returns `accumulator`.
  1613. */
  1614. function arrayAggregator(array, setter, iteratee, accumulator) {
  1615. var index = -1,
  1616. length = array == null ? 0 : array.length;
  1617. while (++index < length) {
  1618. var value = array[index];
  1619. setter(accumulator, value, iteratee(value), array);
  1620. }
  1621. return accumulator;
  1622. }
  1623. /**
  1624. * A specialized version of `_.forEach` for arrays without support for
  1625. * iteratee shorthands.
  1626. *
  1627. * @private
  1628. * @param {Array} [array] The array to iterate over.
  1629. * @param {Function} iteratee The function invoked per iteration.
  1630. * @returns {Array} Returns `array`.
  1631. */
  1632. function arrayEach(array, iteratee) {
  1633. var index = -1,
  1634. length = array == null ? 0 : array.length;
  1635. while (++index < length) {
  1636. if (iteratee(array[index], index, array) === false) {
  1637. break;
  1638. }
  1639. }
  1640. return array;
  1641. }
  1642. /**
  1643. * A specialized version of `_.forEachRight` for arrays without support for
  1644. * iteratee shorthands.
  1645. *
  1646. * @private
  1647. * @param {Array} [array] The array to iterate over.
  1648. * @param {Function} iteratee The function invoked per iteration.
  1649. * @returns {Array} Returns `array`.
  1650. */
  1651. function arrayEachRight(array, iteratee) {
  1652. var length = array == null ? 0 : array.length;
  1653. while (length--) {
  1654. if (iteratee(array[length], length, array) === false) {
  1655. break;
  1656. }
  1657. }
  1658. return array;
  1659. }
  1660. /**
  1661. * A specialized version of `_.every` for arrays without support for
  1662. * iteratee shorthands.
  1663. *
  1664. * @private
  1665. * @param {Array} [array] The array to iterate over.
  1666. * @param {Function} predicate The function invoked per iteration.
  1667. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1668. * else `false`.
  1669. */
  1670. function arrayEvery(array, predicate) {
  1671. var index = -1,
  1672. length = array == null ? 0 : array.length;
  1673. while (++index < length) {
  1674. if (!predicate(array[index], index, array)) {
  1675. return false;
  1676. }
  1677. }
  1678. return true;
  1679. }
  1680. /**
  1681. * A specialized version of `_.filter` for arrays without support for
  1682. * iteratee shorthands.
  1683. *
  1684. * @private
  1685. * @param {Array} [array] The array to iterate over.
  1686. * @param {Function} predicate The function invoked per iteration.
  1687. * @returns {Array} Returns the new filtered array.
  1688. */
  1689. function arrayFilter(array, predicate) {
  1690. var index = -1,
  1691. length = array == null ? 0 : array.length,
  1692. resIndex = 0,
  1693. result = [];
  1694. while (++index < length) {
  1695. var value = array[index];
  1696. if (predicate(value, index, array)) {
  1697. result[resIndex++] = value;
  1698. }
  1699. }
  1700. return result;
  1701. }
  1702. /**
  1703. * A specialized version of `_.includes` for arrays without support for
  1704. * specifying an index to search from.
  1705. *
  1706. * @private
  1707. * @param {Array} [array] The array to inspect.
  1708. * @param {*} target The value to search for.
  1709. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1710. */
  1711. function arrayIncludes(array, value) {
  1712. var length = array == null ? 0 : array.length;
  1713. return !!length && baseIndexOf(array, value, 0) > -1;
  1714. }
  1715. /**
  1716. * This function is like `arrayIncludes` except that it accepts a comparator.
  1717. *
  1718. * @private
  1719. * @param {Array} [array] The array to inspect.
  1720. * @param {*} target The value to search for.
  1721. * @param {Function} comparator The comparator invoked per element.
  1722. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1723. */
  1724. function arrayIncludesWith(array, value, comparator) {
  1725. var index = -1,
  1726. length = array == null ? 0 : array.length;
  1727. while (++index < length) {
  1728. if (comparator(value, array[index])) {
  1729. return true;
  1730. }
  1731. }
  1732. return false;
  1733. }
  1734. /**
  1735. * A specialized version of `_.map` for arrays without support for iteratee
  1736. * shorthands.
  1737. *
  1738. * @private
  1739. * @param {Array} [array] The array to iterate over.
  1740. * @param {Function} iteratee The function invoked per iteration.
  1741. * @returns {Array} Returns the new mapped array.
  1742. */
  1743. function arrayMap(array, iteratee) {
  1744. var index = -1,
  1745. length = array == null ? 0 : array.length,
  1746. result = Array(length);
  1747. while (++index < length) {
  1748. result[index] = iteratee(array[index], index, array);
  1749. }
  1750. return result;
  1751. }
  1752. /**
  1753. * Appends the elements of `values` to `array`.
  1754. *
  1755. * @private
  1756. * @param {Array} array The array to modify.
  1757. * @param {Array} values The values to append.
  1758. * @returns {Array} Returns `array`.
  1759. */
  1760. function arrayPush(array, values) {
  1761. var index = -1,
  1762. length = values.length,
  1763. offset = array.length;
  1764. while (++index < length) {
  1765. array[offset + index] = values[index];
  1766. }
  1767. return array;
  1768. }
  1769. /**
  1770. * A specialized version of `_.reduce` for arrays without support for
  1771. * iteratee shorthands.
  1772. *
  1773. * @private
  1774. * @param {Array} [array] The array to iterate over.
  1775. * @param {Function} iteratee The function invoked per iteration.
  1776. * @param {*} [accumulator] The initial value.
  1777. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1778. * the initial value.
  1779. * @returns {*} Returns the accumulated value.
  1780. */
  1781. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1782. var index = -1,
  1783. length = array == null ? 0 : array.length;
  1784. if (initAccum && length) {
  1785. accumulator = array[++index];
  1786. }
  1787. while (++index < length) {
  1788. accumulator = iteratee(accumulator, array[index], index, array);
  1789. }
  1790. return accumulator;
  1791. }
  1792. /**
  1793. * A specialized version of `_.reduceRight` for arrays without support for
  1794. * iteratee shorthands.
  1795. *
  1796. * @private
  1797. * @param {Array} [array] The array to iterate over.
  1798. * @param {Function} iteratee The function invoked per iteration.
  1799. * @param {*} [accumulator] The initial value.
  1800. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1801. * the initial value.
  1802. * @returns {*} Returns the accumulated value.
  1803. */
  1804. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1805. var length = array == null ? 0 : array.length;
  1806. if (initAccum && length) {
  1807. accumulator = array[--length];
  1808. }
  1809. while (length--) {
  1810. accumulator = iteratee(accumulator, array[length], length, array);
  1811. }
  1812. return accumulator;
  1813. }
  1814. /**
  1815. * A specialized version of `_.some` for arrays without support for iteratee
  1816. * shorthands.
  1817. *
  1818. * @private
  1819. * @param {Array} [array] The array to iterate over.
  1820. * @param {Function} predicate The function invoked per iteration.
  1821. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1822. * else `false`.
  1823. */
  1824. function arraySome(array, predicate) {
  1825. var index = -1,
  1826. length = array == null ? 0 : array.length;
  1827. while (++index < length) {
  1828. if (predicate(array[index], index, array)) {
  1829. return true;
  1830. }
  1831. }
  1832. return false;
  1833. }
  1834. /**
  1835. * Gets the size of an ASCII `string`.
  1836. *
  1837. * @private
  1838. * @param {string} string The string inspect.
  1839. * @returns {number} Returns the string size.
  1840. */
  1841. var asciiSize = baseProperty('length');
  1842. /**
  1843. * Converts an ASCII `string` to an array.
  1844. *
  1845. * @private
  1846. * @param {string} string The string to convert.
  1847. * @returns {Array} Returns the converted array.
  1848. */
  1849. function asciiToArray(string) {
  1850. return string.split('');
  1851. }
  1852. /**
  1853. * Splits an ASCII `string` into an array of its words.
  1854. *
  1855. * @private
  1856. * @param {string} The string to inspect.
  1857. * @returns {Array} Returns the words of `string`.
  1858. */
  1859. function asciiWords(string) {
  1860. return string.match(reAsciiWord) || [];
  1861. }
  1862. /**
  1863. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1864. * without support for iteratee shorthands, which iterates over `collection`
  1865. * using `eachFunc`.
  1866. *
  1867. * @private
  1868. * @param {Array|Object} collection The collection to inspect.
  1869. * @param {Function} predicate The function invoked per iteration.
  1870. * @param {Function} eachFunc The function to iterate over `collection`.
  1871. * @returns {*} Returns the found element or its key, else `undefined`.
  1872. */
  1873. function baseFindKey(collection, predicate, eachFunc) {
  1874. var result;
  1875. eachFunc(collection, function(value, key, collection) {
  1876. if (predicate(value, key, collection)) {
  1877. result = key;
  1878. return false;
  1879. }
  1880. });
  1881. return result;
  1882. }
  1883. /**
  1884. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1885. * support for iteratee shorthands.
  1886. *
  1887. * @private
  1888. * @param {Array} array The array to inspect.
  1889. * @param {Function} predicate The function invoked per iteration.
  1890. * @param {number} fromIndex The index to search from.
  1891. * @param {boolean} [fromRight] Specify iterating from right to left.
  1892. * @returns {number} Returns the index of the matched value, else `-1`.
  1893. */
  1894. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1895. var length = array.length,
  1896. index = fromIndex + (fromRight ? 1 : -1);
  1897. while ((fromRight ? index-- : ++index < length)) {
  1898. if (predicate(array[index], index, array)) {
  1899. return index;
  1900. }
  1901. }
  1902. return -1;
  1903. }
  1904. /**
  1905. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1906. *
  1907. * @private
  1908. * @param {Array} array The array to inspect.
  1909. * @param {*} value The value to search for.
  1910. * @param {number} fromIndex The index to search from.
  1911. * @returns {number} Returns the index of the matched value, else `-1`.
  1912. */
  1913. function baseIndexOf(array, value, fromIndex) {
  1914. return value === value
  1915. ? strictIndexOf(array, value, fromIndex)
  1916. : baseFindIndex(array, baseIsNaN, fromIndex);
  1917. }
  1918. /**
  1919. * This function is like `baseIndexOf` except that it accepts a comparator.
  1920. *
  1921. * @private
  1922. * @param {Array} array The array to inspect.
  1923. * @param {*} value The value to search for.
  1924. * @param {number} fromIndex The index to search from.
  1925. * @param {Function} comparator The comparator invoked per element.
  1926. * @returns {number} Returns the index of the matched value, else `-1`.
  1927. */
  1928. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1929. var index = fromIndex - 1,
  1930. length = array.length;
  1931. while (++index < length) {
  1932. if (comparator(array[index], value)) {
  1933. return index;
  1934. }
  1935. }
  1936. return -1;
  1937. }
  1938. /**
  1939. * The base implementation of `_.isNaN` without support for number objects.
  1940. *
  1941. * @private
  1942. * @param {*} value The value to check.
  1943. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1944. */
  1945. function baseIsNaN(value) {
  1946. return value !== value;
  1947. }
  1948. /**
  1949. * The base implementation of `_.mean` and `_.meanBy` without support for
  1950. * iteratee shorthands.
  1951. *
  1952. * @private
  1953. * @param {Array} array The array to iterate over.
  1954. * @param {Function} iteratee The function invoked per iteration.
  1955. * @returns {number} Returns the mean.
  1956. */
  1957. function baseMean(array, iteratee) {
  1958. var length = array == null ? 0 : array.length;
  1959. return length ? (baseSum(array, iteratee) / length) : NAN;
  1960. }
  1961. /**
  1962. * The base implementation of `_.property` without support for deep paths.
  1963. *
  1964. * @private
  1965. * @param {string} key The key of the property to get.
  1966. * @returns {Function} Returns the new accessor function.
  1967. */
  1968. function baseProperty(key) {
  1969. return function(object) {
  1970. return object == null ? undefined : object[key];
  1971. };
  1972. }
  1973. /**
  1974. * The base implementation of `_.propertyOf` without support for deep paths.
  1975. *
  1976. * @private
  1977. * @param {Object} object The object to query.
  1978. * @returns {Function} Returns the new accessor function.
  1979. */
  1980. function basePropertyOf(object) {
  1981. return function(key) {
  1982. return object == null ? undefined : object[key];
  1983. };
  1984. }
  1985. /**
  1986. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1987. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1988. *
  1989. * @private
  1990. * @param {Array|Object} collection The collection to iterate over.
  1991. * @param {Function} iteratee The function invoked per iteration.
  1992. * @param {*} accumulator The initial value.
  1993. * @param {boolean} initAccum Specify using the first or last element of
  1994. * `collection` as the initial value.
  1995. * @param {Function} eachFunc The function to iterate over `collection`.
  1996. * @returns {*} Returns the accumulated value.
  1997. */
  1998. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1999. eachFunc(collection, function(value, index, collection) {
  2000. accumulator = initAccum
  2001. ? (initAccum = false, value)
  2002. : iteratee(accumulator, value, index, collection);
  2003. });
  2004. return accumulator;
  2005. }
  2006. /**
  2007. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2008. * sort order of `array` and replaces criteria objects with their corresponding
  2009. * values.
  2010. *
  2011. * @private
  2012. * @param {Array} array The array to sort.
  2013. * @param {Function} comparer The function to define sort order.
  2014. * @returns {Array} Returns `array`.
  2015. */
  2016. function baseSortBy(array, comparer) {
  2017. var length = array.length;
  2018. array.sort(comparer);
  2019. while (length--) {
  2020. array[length] = array[length].value;
  2021. }
  2022. return array;
  2023. }
  2024. /**
  2025. * The base implementation of `_.sum` and `_.sumBy` without support for
  2026. * iteratee shorthands.
  2027. *
  2028. * @private
  2029. * @param {Array} array The array to iterate over.
  2030. * @param {Function} iteratee The function invoked per iteration.
  2031. * @returns {number} Returns the sum.
  2032. */
  2033. function baseSum(array, iteratee) {
  2034. var result,
  2035. index = -1,
  2036. length = array.length;
  2037. while (++index < length) {
  2038. var current = iteratee(array[index]);
  2039. if (current !== undefined) {
  2040. result = result === undefined ? current : (result + current);
  2041. }
  2042. }
  2043. return result;
  2044. }
  2045. /**
  2046. * The base implementation of `_.times` without support for iteratee shorthands
  2047. * or max array length checks.
  2048. *
  2049. * @private
  2050. * @param {number} n The number of times to invoke `iteratee`.
  2051. * @param {Function} iteratee The function invoked per iteration.
  2052. * @returns {Array} Returns the array of results.
  2053. */
  2054. function baseTimes(n, iteratee) {
  2055. var index = -1,
  2056. result = Array(n);
  2057. while (++index < n) {
  2058. result[index] = iteratee(index);
  2059. }
  2060. return result;
  2061. }
  2062. /**
  2063. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2064. * of key-value pairs for `object` corresponding to the property names of `props`.
  2065. *
  2066. * @private
  2067. * @param {Object} object The object to query.
  2068. * @param {Array} props The property names to get values for.
  2069. * @returns {Object} Returns the key-value pairs.
  2070. */
  2071. function baseToPairs(object, props) {
  2072. return arrayMap(props, function(key) {
  2073. return [key, object[key]];
  2074. });
  2075. }
  2076. /**
  2077. * The base implementation of `_.trim`.
  2078. *
  2079. * @private
  2080. * @param {string} string The string to trim.
  2081. * @returns {string} Returns the trimmed string.
  2082. */
  2083. function baseTrim(string) {
  2084. return string
  2085. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2086. : string;
  2087. }
  2088. /**
  2089. * The base implementation of `_.unary` without support for storing metadata.
  2090. *
  2091. * @private
  2092. * @param {Function} func The function to cap arguments for.
  2093. * @returns {Function} Returns the new capped function.
  2094. */
  2095. function baseUnary(func) {
  2096. return function(value) {
  2097. return func(value);
  2098. };
  2099. }
  2100. /**
  2101. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2102. * array of `object` property values corresponding to the property names
  2103. * of `props`.
  2104. *
  2105. * @private
  2106. * @param {Object} object The object to query.
  2107. * @param {Array} props The property names to get values for.
  2108. * @returns {Object} Returns the array of property values.
  2109. */
  2110. function baseValues(object, props) {
  2111. return arrayMap(props, function(key) {
  2112. return object[key];
  2113. });
  2114. }
  2115. /**
  2116. * Checks if a `cache` value for `key` exists.
  2117. *
  2118. * @private
  2119. * @param {Object} cache The cache to query.
  2120. * @param {string} key The key of the entry to check.
  2121. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2122. */
  2123. function cacheHas(cache, key) {
  2124. return cache.has(key);
  2125. }
  2126. /**
  2127. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2128. * that is not found in the character symbols.
  2129. *
  2130. * @private
  2131. * @param {Array} strSymbols The string symbols to inspect.
  2132. * @param {Array} chrSymbols The character symbols to find.
  2133. * @returns {number} Returns the index of the first unmatched string symbol.
  2134. */
  2135. function charsStartIndex(strSymbols, chrSymbols) {
  2136. var index = -1,
  2137. length = strSymbols.length;
  2138. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2139. return index;
  2140. }
  2141. /**
  2142. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2143. * that is not found in the character symbols.
  2144. *
  2145. * @private
  2146. * @param {Array} strSymbols The string symbols to inspect.
  2147. * @param {Array} chrSymbols The character symbols to find.
  2148. * @returns {number} Returns the index of the last unmatched string symbol.
  2149. */
  2150. function charsEndIndex(strSymbols, chrSymbols) {
  2151. var index = strSymbols.length;
  2152. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2153. return index;
  2154. }
  2155. /**
  2156. * Gets the number of `placeholder` occurrences in `array`.
  2157. *
  2158. * @private
  2159. * @param {Array} array The array to inspect.
  2160. * @param {*} placeholder The placeholder to search for.
  2161. * @returns {number} Returns the placeholder count.
  2162. */
  2163. function countHolders(array, placeholder) {
  2164. var length = array.length,
  2165. result = 0;
  2166. while (length--) {
  2167. if (array[length] === placeholder) {
  2168. ++result;
  2169. }
  2170. }
  2171. return result;
  2172. }
  2173. /**
  2174. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2175. * letters to basic Latin letters.
  2176. *
  2177. * @private
  2178. * @param {string} letter The matched letter to deburr.
  2179. * @returns {string} Returns the deburred letter.
  2180. */
  2181. var deburrLetter = basePropertyOf(deburredLetters);
  2182. /**
  2183. * Used by `_.escape` to convert characters to HTML entities.
  2184. *
  2185. * @private
  2186. * @param {string} chr The matched character to escape.
  2187. * @returns {string} Returns the escaped character.
  2188. */
  2189. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2190. /**
  2191. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2192. *
  2193. * @private
  2194. * @param {string} chr The matched character to escape.
  2195. * @returns {string} Returns the escaped character.
  2196. */
  2197. function escapeStringChar(chr) {
  2198. return '\\' + stringEscapes[chr];
  2199. }
  2200. /**
  2201. * Gets the value at `key` of `object`.
  2202. *
  2203. * @private
  2204. * @param {Object} [object] The object to query.
  2205. * @param {string} key The key of the property to get.
  2206. * @returns {*} Returns the property value.
  2207. */
  2208. function getValue(object, key) {
  2209. return object == null ? undefined : object[key];
  2210. }
  2211. /**
  2212. * Checks if `string` contains Unicode symbols.
  2213. *
  2214. * @private
  2215. * @param {string} string The string to inspect.
  2216. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2217. */
  2218. function hasUnicode(string) {
  2219. return reHasUnicode.test(string);
  2220. }
  2221. /**
  2222. * Checks if `string` contains a word composed of Unicode symbols.
  2223. *
  2224. * @private
  2225. * @param {string} string The string to inspect.
  2226. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2227. */
  2228. function hasUnicodeWord(string) {
  2229. return reHasUnicodeWord.test(string);
  2230. }
  2231. /**
  2232. * Converts `iterator` to an array.
  2233. *
  2234. * @private
  2235. * @param {Object} iterator The iterator to convert.
  2236. * @returns {Array} Returns the converted array.
  2237. */
  2238. function iteratorToArray(iterator) {
  2239. var data,
  2240. result = [];
  2241. while (!(data = iterator.next()).done) {
  2242. result.push(data.value);
  2243. }
  2244. return result;
  2245. }
  2246. /**
  2247. * Converts `map` to its key-value pairs.
  2248. *
  2249. * @private
  2250. * @param {Object} map The map to convert.
  2251. * @returns {Array} Returns the key-value pairs.
  2252. */
  2253. function mapToArray(map) {
  2254. var index = -1,
  2255. result = Array(map.size);
  2256. map.forEach(function(value, key) {
  2257. result[++index] = [key, value];
  2258. });
  2259. return result;
  2260. }
  2261. /**
  2262. * Creates a unary function that invokes `func` with its argument transformed.
  2263. *
  2264. * @private
  2265. * @param {Function} func The function to wrap.
  2266. * @param {Function} transform The argument transform.
  2267. * @returns {Function} Returns the new function.
  2268. */
  2269. function overArg(func, transform) {
  2270. return function(arg) {
  2271. return func(transform(arg));
  2272. };
  2273. }
  2274. /**
  2275. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2276. * and returns an array of their indexes.
  2277. *
  2278. * @private
  2279. * @param {Array} array The array to modify.
  2280. * @param {*} placeholder The placeholder to replace.
  2281. * @returns {Array} Returns the new array of placeholder indexes.
  2282. */
  2283. function replaceHolders(array, placeholder) {
  2284. var index = -1,
  2285. length = array.length,
  2286. resIndex = 0,
  2287. result = [];
  2288. while (++index < length) {
  2289. var value = array[index];
  2290. if (value === placeholder || value === PLACEHOLDER) {
  2291. array[index] = PLACEHOLDER;
  2292. result[resIndex++] = index;
  2293. }
  2294. }
  2295. return result;
  2296. }
  2297. /**
  2298. * Converts `set` to an array of its values.
  2299. *
  2300. * @private
  2301. * @param {Object} set The set to convert.
  2302. * @returns {Array} Returns the values.
  2303. */
  2304. function setToArray(set) {
  2305. var index = -1,
  2306. result = Array(set.size);
  2307. set.forEach(function(value) {
  2308. result[++index] = value;
  2309. });
  2310. return result;
  2311. }
  2312. /**
  2313. * Converts `set` to its value-value pairs.
  2314. *
  2315. * @private
  2316. * @param {Object} set The set to convert.
  2317. * @returns {Array} Returns the value-value pairs.
  2318. */
  2319. function setToPairs(set) {
  2320. var index = -1,
  2321. result = Array(set.size);
  2322. set.forEach(function(value) {
  2323. result[++index] = [value, value];
  2324. });
  2325. return result;
  2326. }
  2327. /**
  2328. * A specialized version of `_.indexOf` which performs strict equality
  2329. * comparisons of values, i.e. `===`.
  2330. *
  2331. * @private
  2332. * @param {Array} array The array to inspect.
  2333. * @param {*} value The value to search for.
  2334. * @param {number} fromIndex The index to search from.
  2335. * @returns {number} Returns the index of the matched value, else `-1`.
  2336. */
  2337. function strictIndexOf(array, value, fromIndex) {
  2338. var index = fromIndex - 1,
  2339. length = array.length;
  2340. while (++index < length) {
  2341. if (array[index] === value) {
  2342. return index;
  2343. }
  2344. }
  2345. return -1;
  2346. }
  2347. /**
  2348. * A specialized version of `_.lastIndexOf` which performs strict equality
  2349. * comparisons of values, i.e. `===`.
  2350. *
  2351. * @private
  2352. * @param {Array} array The array to inspect.
  2353. * @param {*} value The value to search for.
  2354. * @param {number} fromIndex The index to search from.
  2355. * @returns {number} Returns the index of the matched value, else `-1`.
  2356. */
  2357. function strictLastIndexOf(array, value, fromIndex) {
  2358. var index = fromIndex + 1;
  2359. while (index--) {
  2360. if (array[index] === value) {
  2361. return index;
  2362. }
  2363. }
  2364. return index;
  2365. }
  2366. /**
  2367. * Gets the number of symbols in `string`.
  2368. *
  2369. * @private
  2370. * @param {string} string The string to inspect.
  2371. * @returns {number} Returns the string size.
  2372. */
  2373. function stringSize(string) {
  2374. return hasUnicode(string)
  2375. ? unicodeSize(string)
  2376. : asciiSize(string);
  2377. }
  2378. /**
  2379. * Converts `string` to an array.
  2380. *
  2381. * @private
  2382. * @param {string} string The string to convert.
  2383. * @returns {Array} Returns the converted array.
  2384. */
  2385. function stringToArray(string) {
  2386. return hasUnicode(string)
  2387. ? unicodeToArray(string)
  2388. : asciiToArray(string);
  2389. }
  2390. /**
  2391. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2392. * character of `string`.
  2393. *
  2394. * @private
  2395. * @param {string} string The string to inspect.
  2396. * @returns {number} Returns the index of the last non-whitespace character.
  2397. */
  2398. function trimmedEndIndex(string) {
  2399. var index = string.length;
  2400. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2401. return index;
  2402. }
  2403. /**
  2404. * Used by `_.unescape` to convert HTML entities to characters.
  2405. *
  2406. * @private
  2407. * @param {string} chr The matched character to unescape.
  2408. * @returns {string} Returns the unescaped character.
  2409. */
  2410. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2411. /**
  2412. * Gets the size of a Unicode `string`.
  2413. *
  2414. * @private
  2415. * @param {string} string The string inspect.
  2416. * @returns {number} Returns the string size.
  2417. */
  2418. function unicodeSize(string) {
  2419. var result = reUnicode.lastIndex = 0;
  2420. while (reUnicode.test(string)) {
  2421. ++result;
  2422. }
  2423. return result;
  2424. }
  2425. /**
  2426. * Converts a Unicode `string` to an array.
  2427. *
  2428. * @private
  2429. * @param {string} string The string to convert.
  2430. * @returns {Array} Returns the converted array.
  2431. */
  2432. function unicodeToArray(string) {
  2433. return string.match(reUnicode) || [];
  2434. }
  2435. /**
  2436. * Splits a Unicode `string` into an array of its words.
  2437. *
  2438. * @private
  2439. * @param {string} The string to inspect.
  2440. * @returns {Array} Returns the words of `string`.
  2441. */
  2442. function unicodeWords(string) {
  2443. return string.match(reUnicodeWord) || [];
  2444. }
  2445. /*--------------------------------------------------------------------------*/
  2446. /**
  2447. * Create a new pristine `lodash` function using the `context` object.
  2448. *
  2449. * @static
  2450. * @memberOf _
  2451. * @since 1.1.0
  2452. * @category Util
  2453. * @param {Object} [context=root] The context object.
  2454. * @returns {Function} Returns a new `lodash` function.
  2455. * @example
  2456. *
  2457. * _.mixin({ 'foo': _.constant('foo') });
  2458. *
  2459. * var lodash = _.runInContext();
  2460. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2461. *
  2462. * _.isFunction(_.foo);
  2463. * // => true
  2464. * _.isFunction(_.bar);
  2465. * // => false
  2466. *
  2467. * lodash.isFunction(lodash.foo);
  2468. * // => false
  2469. * lodash.isFunction(lodash.bar);
  2470. * // => true
  2471. *
  2472. * // Create a suped-up `defer` in Node.js.
  2473. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2474. */
  2475. var runInContext = (function runInContext(context) {
  2476. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2477. /** Built-in constructor references. */
  2478. var Array = context.Array,
  2479. Date = context.Date,
  2480. Error = context.Error,
  2481. Function = context.Function,
  2482. Math = context.Math,
  2483. Object = context.Object,
  2484. RegExp = context.RegExp,
  2485. String = context.String,
  2486. TypeError = context.TypeError;
  2487. /** Used for built-in method references. */
  2488. var arrayProto = Array.prototype,
  2489. funcProto = Function.prototype,
  2490. objectProto = Object.prototype;
  2491. /** Used to detect overreaching core-js shims. */
  2492. var coreJsData = context['__core-js_shared__'];
  2493. /** Used to resolve the decompiled source of functions. */
  2494. var funcToString = funcProto.toString;
  2495. /** Used to check objects for own properties. */
  2496. var hasOwnProperty = objectProto.hasOwnProperty;
  2497. /** Used to generate unique IDs. */
  2498. var idCounter = 0;
  2499. /** Used to detect methods masquerading as native. */
  2500. var maskSrcKey = (function() {
  2501. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2502. return uid ? ('Symbol(src)_1.' + uid) : '';
  2503. }());
  2504. /**
  2505. * Used to resolve the
  2506. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2507. * of values.
  2508. */
  2509. var nativeObjectToString = objectProto.toString;
  2510. /** Used to infer the `Object` constructor. */
  2511. var objectCtorString = funcToString.call(Object);
  2512. /** Used to restore the original `_` reference in `_.noConflict`. */
  2513. var oldDash = root._;
  2514. /** Used to detect if a method is native. */
  2515. var reIsNative = RegExp('^' +
  2516. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2517. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2518. );
  2519. /** Built-in value references. */
  2520. var Buffer = moduleExports ? context.Buffer : undefined,
  2521. Symbol = context.Symbol,
  2522. Uint8Array = context.Uint8Array,
  2523. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2524. getPrototype = overArg(Object.getPrototypeOf, Object),
  2525. objectCreate = Object.create,
  2526. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2527. splice = arrayProto.splice,
  2528. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2529. symIterator = Symbol ? Symbol.iterator : undefined,
  2530. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2531. var defineProperty = (function() {
  2532. try {
  2533. var func = getNative(Object, 'defineProperty');
  2534. func({}, '', {});
  2535. return func;
  2536. } catch (e) {}
  2537. }());
  2538. /** Mocked built-ins. */
  2539. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2540. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2541. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2542. /* Built-in method references for those with the same name as other `lodash` methods. */
  2543. var nativeCeil = Math.ceil,
  2544. nativeFloor = Math.floor,
  2545. nativeGetSymbols = Object.getOwnPropertySymbols,
  2546. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2547. nativeIsFinite = context.isFinite,
  2548. nativeJoin = arrayProto.join,
  2549. nativeKeys = overArg(Object.keys, Object),
  2550. nativeMax = Math.max,
  2551. nativeMin = Math.min,
  2552. nativeNow = Date.now,
  2553. nativeParseInt = context.parseInt,
  2554. nativeRandom = Math.random,
  2555. nativeReverse = arrayProto.reverse;
  2556. /* Built-in method references that are verified to be native. */
  2557. var DataView = getNative(context, 'DataView'),
  2558. Map = getNative(context, 'Map'),
  2559. Promise = getNative(context, 'Promise'),
  2560. Set = getNative(context, 'Set'),
  2561. WeakMap = getNative(context, 'WeakMap'),
  2562. nativeCreate = getNative(Object, 'create');
  2563. /** Used to store function metadata. */
  2564. var metaMap = WeakMap && new WeakMap;
  2565. /** Used to lookup unminified function names. */
  2566. var realNames = {};
  2567. /** Used to detect maps, sets, and weakmaps. */
  2568. var dataViewCtorString = toSource(DataView),
  2569. mapCtorString = toSource(Map),
  2570. promiseCtorString = toSource(Promise),
  2571. setCtorString = toSource(Set),
  2572. weakMapCtorString = toSource(WeakMap);
  2573. /** Used to convert symbols to primitives and strings. */
  2574. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2575. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2576. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2577. /*------------------------------------------------------------------------*/
  2578. /**
  2579. * Creates a `lodash` object which wraps `value` to enable implicit method
  2580. * chain sequences. Methods that operate on and return arrays, collections,
  2581. * and functions can be chained together. Methods that retrieve a single value
  2582. * or may return a primitive value will automatically end the chain sequence
  2583. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2584. * with `_#value`.
  2585. *
  2586. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2587. * enabled using `_.chain`.
  2588. *
  2589. * The execution of chained methods is lazy, that is, it's deferred until
  2590. * `_#value` is implicitly or explicitly called.
  2591. *
  2592. * Lazy evaluation allows several methods to support shortcut fusion.
  2593. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2594. * the creation of intermediate arrays and can greatly reduce the number of
  2595. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2596. * fusion if the section is applied to an array and iteratees accept only
  2597. * one argument. The heuristic for whether a section qualifies for shortcut
  2598. * fusion is subject to change.
  2599. *
  2600. * Chaining is supported in custom builds as long as the `_#value` method is
  2601. * directly or indirectly included in the build.
  2602. *
  2603. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2604. *
  2605. * The wrapper `Array` methods are:
  2606. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2607. *
  2608. * The wrapper `String` methods are:
  2609. * `replace` and `split`
  2610. *
  2611. * The wrapper methods that support shortcut fusion are:
  2612. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2613. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2614. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2615. *
  2616. * The chainable wrapper methods are:
  2617. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2618. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2619. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2620. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2621. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2622. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2623. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2624. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2625. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2626. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2627. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2628. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2629. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2630. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2631. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2632. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2633. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2634. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2635. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2636. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2637. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2638. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2639. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2640. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2641. *
  2642. * The wrapper methods that are **not** chainable by default are:
  2643. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2644. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2645. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2646. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2647. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2648. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2649. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2650. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2651. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2652. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2653. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2654. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2655. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2656. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2657. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2658. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2659. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2660. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2661. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2662. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2663. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2664. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2665. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2666. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2667. * `upperFirst`, `value`, and `words`
  2668. *
  2669. * @name _
  2670. * @constructor
  2671. * @category Seq
  2672. * @param {*} value The value to wrap in a `lodash` instance.
  2673. * @returns {Object} Returns the new `lodash` wrapper instance.
  2674. * @example
  2675. *
  2676. * function square(n) {
  2677. * return n * n;
  2678. * }
  2679. *
  2680. * var wrapped = _([1, 2, 3]);
  2681. *
  2682. * // Returns an unwrapped value.
  2683. * wrapped.reduce(_.add);
  2684. * // => 6
  2685. *
  2686. * // Returns a wrapped value.
  2687. * var squares = wrapped.map(square);
  2688. *
  2689. * _.isArray(squares);
  2690. * // => false
  2691. *
  2692. * _.isArray(squares.value());
  2693. * // => true
  2694. */
  2695. function lodash(value) {
  2696. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2697. if (value instanceof LodashWrapper) {
  2698. return value;
  2699. }
  2700. if (hasOwnProperty.call(value, '__wrapped__')) {
  2701. return wrapperClone(value);
  2702. }
  2703. }
  2704. return new LodashWrapper(value);
  2705. }
  2706. /**
  2707. * The base implementation of `_.create` without support for assigning
  2708. * properties to the created object.
  2709. *
  2710. * @private
  2711. * @param {Object} proto The object to inherit from.
  2712. * @returns {Object} Returns the new object.
  2713. */
  2714. var baseCreate = (function() {
  2715. function object() {}
  2716. return function(proto) {
  2717. if (!isObject(proto)) {
  2718. return {};
  2719. }
  2720. if (objectCreate) {
  2721. return objectCreate(proto);
  2722. }
  2723. object.prototype = proto;
  2724. var result = new object;
  2725. object.prototype = undefined;
  2726. return result;
  2727. };
  2728. }());
  2729. /**
  2730. * The function whose prototype chain sequence wrappers inherit from.
  2731. *
  2732. * @private
  2733. */
  2734. function baseLodash() {
  2735. // No operation performed.
  2736. }
  2737. /**
  2738. * The base constructor for creating `lodash` wrapper objects.
  2739. *
  2740. * @private
  2741. * @param {*} value The value to wrap.
  2742. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2743. */
  2744. function LodashWrapper(value, chainAll) {
  2745. this.__wrapped__ = value;
  2746. this.__actions__ = [];
  2747. this.__chain__ = !!chainAll;
  2748. this.__index__ = 0;
  2749. this.__values__ = undefined;
  2750. }
  2751. /**
  2752. * By default, the template delimiters used by lodash are like those in
  2753. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2754. * following template settings to use alternative delimiters.
  2755. *
  2756. * @static
  2757. * @memberOf _
  2758. * @type {Object}
  2759. */
  2760. lodash.templateSettings = {
  2761. /**
  2762. * Used to detect `data` property values to be HTML-escaped.
  2763. *
  2764. * @memberOf _.templateSettings
  2765. * @type {RegExp}
  2766. */
  2767. 'escape': reEscape,
  2768. /**
  2769. * Used to detect code to be evaluated.
  2770. *
  2771. * @memberOf _.templateSettings
  2772. * @type {RegExp}
  2773. */
  2774. 'evaluate': reEvaluate,
  2775. /**
  2776. * Used to detect `data` property values to inject.
  2777. *
  2778. * @memberOf _.templateSettings
  2779. * @type {RegExp}
  2780. */
  2781. 'interpolate': reInterpolate,
  2782. /**
  2783. * Used to reference the data object in the template text.
  2784. *
  2785. * @memberOf _.templateSettings
  2786. * @type {string}
  2787. */
  2788. 'variable': '',
  2789. /**
  2790. * Used to import variables into the compiled template.
  2791. *
  2792. * @memberOf _.templateSettings
  2793. * @type {Object}
  2794. */
  2795. 'imports': {
  2796. /**
  2797. * A reference to the `lodash` function.
  2798. *
  2799. * @memberOf _.templateSettings.imports
  2800. * @type {Function}
  2801. */
  2802. '_': lodash
  2803. }
  2804. };
  2805. // Ensure wrappers are instances of `baseLodash`.
  2806. lodash.prototype = baseLodash.prototype;
  2807. lodash.prototype.constructor = lodash;
  2808. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2809. LodashWrapper.prototype.constructor = LodashWrapper;
  2810. /*------------------------------------------------------------------------*/
  2811. /**
  2812. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2813. *
  2814. * @private
  2815. * @constructor
  2816. * @param {*} value The value to wrap.
  2817. */
  2818. function LazyWrapper(value) {
  2819. this.__wrapped__ = value;
  2820. this.__actions__ = [];
  2821. this.__dir__ = 1;
  2822. this.__filtered__ = false;
  2823. this.__iteratees__ = [];
  2824. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2825. this.__views__ = [];
  2826. }
  2827. /**
  2828. * Creates a clone of the lazy wrapper object.
  2829. *
  2830. * @private
  2831. * @name clone
  2832. * @memberOf LazyWrapper
  2833. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2834. */
  2835. function lazyClone() {
  2836. var result = new LazyWrapper(this.__wrapped__);
  2837. result.__actions__ = copyArray(this.__actions__);
  2838. result.__dir__ = this.__dir__;
  2839. result.__filtered__ = this.__filtered__;
  2840. result.__iteratees__ = copyArray(this.__iteratees__);
  2841. result.__takeCount__ = this.__takeCount__;
  2842. result.__views__ = copyArray(this.__views__);
  2843. return result;
  2844. }
  2845. /**
  2846. * Reverses the direction of lazy iteration.
  2847. *
  2848. * @private
  2849. * @name reverse
  2850. * @memberOf LazyWrapper
  2851. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2852. */
  2853. function lazyReverse() {
  2854. if (this.__filtered__) {
  2855. var result = new LazyWrapper(this);
  2856. result.__dir__ = -1;
  2857. result.__filtered__ = true;
  2858. } else {
  2859. result = this.clone();
  2860. result.__dir__ *= -1;
  2861. }
  2862. return result;
  2863. }
  2864. /**
  2865. * Extracts the unwrapped value from its lazy wrapper.
  2866. *
  2867. * @private
  2868. * @name value
  2869. * @memberOf LazyWrapper
  2870. * @returns {*} Returns the unwrapped value.
  2871. */
  2872. function lazyValue() {
  2873. var array = this.__wrapped__.value(),
  2874. dir = this.__dir__,
  2875. isArr = isArray(array),
  2876. isRight = dir < 0,
  2877. arrLength = isArr ? array.length : 0,
  2878. view = getView(0, arrLength, this.__views__),
  2879. start = view.start,
  2880. end = view.end,
  2881. length = end - start,
  2882. index = isRight ? end : (start - 1),
  2883. iteratees = this.__iteratees__,
  2884. iterLength = iteratees.length,
  2885. resIndex = 0,
  2886. takeCount = nativeMin(length, this.__takeCount__);
  2887. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2888. return baseWrapperValue(array, this.__actions__);
  2889. }
  2890. var result = [];
  2891. outer:
  2892. while (length-- && resIndex < takeCount) {
  2893. index += dir;
  2894. var iterIndex = -1,
  2895. value = array[index];
  2896. while (++iterIndex < iterLength) {
  2897. var data = iteratees[iterIndex],
  2898. iteratee = data.iteratee,
  2899. type = data.type,
  2900. computed = iteratee(value);
  2901. if (type == LAZY_MAP_FLAG) {
  2902. value = computed;
  2903. } else if (!computed) {
  2904. if (type == LAZY_FILTER_FLAG) {
  2905. continue outer;
  2906. } else {
  2907. break outer;
  2908. }
  2909. }
  2910. }
  2911. result[resIndex++] = value;
  2912. }
  2913. return result;
  2914. }
  2915. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2916. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2917. LazyWrapper.prototype.constructor = LazyWrapper;
  2918. /*------------------------------------------------------------------------*/
  2919. /**
  2920. * Creates a hash object.
  2921. *
  2922. * @private
  2923. * @constructor
  2924. * @param {Array} [entries] The key-value pairs to cache.
  2925. */
  2926. function Hash(entries) {
  2927. var index = -1,
  2928. length = entries == null ? 0 : entries.length;
  2929. this.clear();
  2930. while (++index < length) {
  2931. var entry = entries[index];
  2932. this.set(entry[0], entry[1]);
  2933. }
  2934. }
  2935. /**
  2936. * Removes all key-value entries from the hash.
  2937. *
  2938. * @private
  2939. * @name clear
  2940. * @memberOf Hash
  2941. */
  2942. function hashClear() {
  2943. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2944. this.size = 0;
  2945. }
  2946. /**
  2947. * Removes `key` and its value from the hash.
  2948. *
  2949. * @private
  2950. * @name delete
  2951. * @memberOf Hash
  2952. * @param {Object} hash The hash to modify.
  2953. * @param {string} key The key of the value to remove.
  2954. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2955. */
  2956. function hashDelete(key) {
  2957. var result = this.has(key) && delete this.__data__[key];
  2958. this.size -= result ? 1 : 0;
  2959. return result;
  2960. }
  2961. /**
  2962. * Gets the hash value for `key`.
  2963. *
  2964. * @private
  2965. * @name get
  2966. * @memberOf Hash
  2967. * @param {string} key The key of the value to get.
  2968. * @returns {*} Returns the entry value.
  2969. */
  2970. function hashGet(key) {
  2971. var data = this.__data__;
  2972. if (nativeCreate) {
  2973. var result = data[key];
  2974. return result === HASH_UNDEFINED ? undefined : result;
  2975. }
  2976. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2977. }
  2978. /**
  2979. * Checks if a hash value for `key` exists.
  2980. *
  2981. * @private
  2982. * @name has
  2983. * @memberOf Hash
  2984. * @param {string} key The key of the entry to check.
  2985. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2986. */
  2987. function hashHas(key) {
  2988. var data = this.__data__;
  2989. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2990. }
  2991. /**
  2992. * Sets the hash `key` to `value`.
  2993. *
  2994. * @private
  2995. * @name set
  2996. * @memberOf Hash
  2997. * @param {string} key The key of the value to set.
  2998. * @param {*} value The value to set.
  2999. * @returns {Object} Returns the hash instance.
  3000. */
  3001. function hashSet(key, value) {
  3002. var data = this.__data__;
  3003. this.size += this.has(key) ? 0 : 1;
  3004. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3005. return this;
  3006. }
  3007. // Add methods to `Hash`.
  3008. Hash.prototype.clear = hashClear;
  3009. Hash.prototype['delete'] = hashDelete;
  3010. Hash.prototype.get = hashGet;
  3011. Hash.prototype.has = hashHas;
  3012. Hash.prototype.set = hashSet;
  3013. /*------------------------------------------------------------------------*/
  3014. /**
  3015. * Creates an list cache object.
  3016. *
  3017. * @private
  3018. * @constructor
  3019. * @param {Array} [entries] The key-value pairs to cache.
  3020. */
  3021. function ListCache(entries) {
  3022. var index = -1,
  3023. length = entries == null ? 0 : entries.length;
  3024. this.clear();
  3025. while (++index < length) {
  3026. var entry = entries[index];
  3027. this.set(entry[0], entry[1]);
  3028. }
  3029. }
  3030. /**
  3031. * Removes all key-value entries from the list cache.
  3032. *
  3033. * @private
  3034. * @name clear
  3035. * @memberOf ListCache
  3036. */
  3037. function listCacheClear() {
  3038. this.__data__ = [];
  3039. this.size = 0;
  3040. }
  3041. /**
  3042. * Removes `key` and its value from the list cache.
  3043. *
  3044. * @private
  3045. * @name delete
  3046. * @memberOf ListCache
  3047. * @param {string} key The key of the value to remove.
  3048. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3049. */
  3050. function listCacheDelete(key) {
  3051. var data = this.__data__,
  3052. index = assocIndexOf(data, key);
  3053. if (index < 0) {
  3054. return false;
  3055. }
  3056. var lastIndex = data.length - 1;
  3057. if (index == lastIndex) {
  3058. data.pop();
  3059. } else {
  3060. splice.call(data, index, 1);
  3061. }
  3062. --this.size;
  3063. return true;
  3064. }
  3065. /**
  3066. * Gets the list cache value for `key`.
  3067. *
  3068. * @private
  3069. * @name get
  3070. * @memberOf ListCache
  3071. * @param {string} key The key of the value to get.
  3072. * @returns {*} Returns the entry value.
  3073. */
  3074. function listCacheGet(key) {
  3075. var data = this.__data__,
  3076. index = assocIndexOf(data, key);
  3077. return index < 0 ? undefined : data[index][1];
  3078. }
  3079. /**
  3080. * Checks if a list cache value for `key` exists.
  3081. *
  3082. * @private
  3083. * @name has
  3084. * @memberOf ListCache
  3085. * @param {string} key The key of the entry to check.
  3086. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3087. */
  3088. function listCacheHas(key) {
  3089. return assocIndexOf(this.__data__, key) > -1;
  3090. }
  3091. /**
  3092. * Sets the list cache `key` to `value`.
  3093. *
  3094. * @private
  3095. * @name set
  3096. * @memberOf ListCache
  3097. * @param {string} key The key of the value to set.
  3098. * @param {*} value The value to set.
  3099. * @returns {Object} Returns the list cache instance.
  3100. */
  3101. function listCacheSet(key, value) {
  3102. var data = this.__data__,
  3103. index = assocIndexOf(data, key);
  3104. if (index < 0) {
  3105. ++this.size;
  3106. data.push([key, value]);
  3107. } else {
  3108. data[index][1] = value;
  3109. }
  3110. return this;
  3111. }
  3112. // Add methods to `ListCache`.
  3113. ListCache.prototype.clear = listCacheClear;
  3114. ListCache.prototype['delete'] = listCacheDelete;
  3115. ListCache.prototype.get = listCacheGet;
  3116. ListCache.prototype.has = listCacheHas;
  3117. ListCache.prototype.set = listCacheSet;
  3118. /*------------------------------------------------------------------------*/
  3119. /**
  3120. * Creates a map cache object to store key-value pairs.
  3121. *
  3122. * @private
  3123. * @constructor
  3124. * @param {Array} [entries] The key-value pairs to cache.
  3125. */
  3126. function MapCache(entries) {
  3127. var index = -1,
  3128. length = entries == null ? 0 : entries.length;
  3129. this.clear();
  3130. while (++index < length) {
  3131. var entry = entries[index];
  3132. this.set(entry[0], entry[1]);
  3133. }
  3134. }
  3135. /**
  3136. * Removes all key-value entries from the map.
  3137. *
  3138. * @private
  3139. * @name clear
  3140. * @memberOf MapCache
  3141. */
  3142. function mapCacheClear() {
  3143. this.size = 0;
  3144. this.__data__ = {
  3145. 'hash': new Hash,
  3146. 'map': new (Map || ListCache),
  3147. 'string': new Hash
  3148. };
  3149. }
  3150. /**
  3151. * Removes `key` and its value from the map.
  3152. *
  3153. * @private
  3154. * @name delete
  3155. * @memberOf MapCache
  3156. * @param {string} key The key of the value to remove.
  3157. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3158. */
  3159. function mapCacheDelete(key) {
  3160. var result = getMapData(this, key)['delete'](key);
  3161. this.size -= result ? 1 : 0;
  3162. return result;
  3163. }
  3164. /**
  3165. * Gets the map value for `key`.
  3166. *
  3167. * @private
  3168. * @name get
  3169. * @memberOf MapCache
  3170. * @param {string} key The key of the value to get.
  3171. * @returns {*} Returns the entry value.
  3172. */
  3173. function mapCacheGet(key) {
  3174. return getMapData(this, key).get(key);
  3175. }
  3176. /**
  3177. * Checks if a map value for `key` exists.
  3178. *
  3179. * @private
  3180. * @name has
  3181. * @memberOf MapCache
  3182. * @param {string} key The key of the entry to check.
  3183. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3184. */
  3185. function mapCacheHas(key) {
  3186. return getMapData(this, key).has(key);
  3187. }
  3188. /**
  3189. * Sets the map `key` to `value`.
  3190. *
  3191. * @private
  3192. * @name set
  3193. * @memberOf MapCache
  3194. * @param {string} key The key of the value to set.
  3195. * @param {*} value The value to set.
  3196. * @returns {Object} Returns the map cache instance.
  3197. */
  3198. function mapCacheSet(key, value) {
  3199. var data = getMapData(this, key),
  3200. size = data.size;
  3201. data.set(key, value);
  3202. this.size += data.size == size ? 0 : 1;
  3203. return this;
  3204. }
  3205. // Add methods to `MapCache`.
  3206. MapCache.prototype.clear = mapCacheClear;
  3207. MapCache.prototype['delete'] = mapCacheDelete;
  3208. MapCache.prototype.get = mapCacheGet;
  3209. MapCache.prototype.has = mapCacheHas;
  3210. MapCache.prototype.set = mapCacheSet;
  3211. /*------------------------------------------------------------------------*/
  3212. /**
  3213. *
  3214. * Creates an array cache object to store unique values.
  3215. *
  3216. * @private
  3217. * @constructor
  3218. * @param {Array} [values] The values to cache.
  3219. */
  3220. function SetCache(values) {
  3221. var index = -1,
  3222. length = values == null ? 0 : values.length;
  3223. this.__data__ = new MapCache;
  3224. while (++index < length) {
  3225. this.add(values[index]);
  3226. }
  3227. }
  3228. /**
  3229. * Adds `value` to the array cache.
  3230. *
  3231. * @private
  3232. * @name add
  3233. * @memberOf SetCache
  3234. * @alias push
  3235. * @param {*} value The value to cache.
  3236. * @returns {Object} Returns the cache instance.
  3237. */
  3238. function setCacheAdd(value) {
  3239. this.__data__.set(value, HASH_UNDEFINED);
  3240. return this;
  3241. }
  3242. /**
  3243. * Checks if `value` is in the array cache.
  3244. *
  3245. * @private
  3246. * @name has
  3247. * @memberOf SetCache
  3248. * @param {*} value The value to search for.
  3249. * @returns {number} Returns `true` if `value` is found, else `false`.
  3250. */
  3251. function setCacheHas(value) {
  3252. return this.__data__.has(value);
  3253. }
  3254. // Add methods to `SetCache`.
  3255. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3256. SetCache.prototype.has = setCacheHas;
  3257. /*------------------------------------------------------------------------*/
  3258. /**
  3259. * Creates a stack cache object to store key-value pairs.
  3260. *
  3261. * @private
  3262. * @constructor
  3263. * @param {Array} [entries] The key-value pairs to cache.
  3264. */
  3265. function Stack(entries) {
  3266. var data = this.__data__ = new ListCache(entries);
  3267. this.size = data.size;
  3268. }
  3269. /**
  3270. * Removes all key-value entries from the stack.
  3271. *
  3272. * @private
  3273. * @name clear
  3274. * @memberOf Stack
  3275. */
  3276. function stackClear() {
  3277. this.__data__ = new ListCache;
  3278. this.size = 0;
  3279. }
  3280. /**
  3281. * Removes `key` and its value from the stack.
  3282. *
  3283. * @private
  3284. * @name delete
  3285. * @memberOf Stack
  3286. * @param {string} key The key of the value to remove.
  3287. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3288. */
  3289. function stackDelete(key) {
  3290. var data = this.__data__,
  3291. result = data['delete'](key);
  3292. this.size = data.size;
  3293. return result;
  3294. }
  3295. /**
  3296. * Gets the stack value for `key`.
  3297. *
  3298. * @private
  3299. * @name get
  3300. * @memberOf Stack
  3301. * @param {string} key The key of the value to get.
  3302. * @returns {*} Returns the entry value.
  3303. */
  3304. function stackGet(key) {
  3305. return this.__data__.get(key);
  3306. }
  3307. /**
  3308. * Checks if a stack value for `key` exists.
  3309. *
  3310. * @private
  3311. * @name has
  3312. * @memberOf Stack
  3313. * @param {string} key The key of the entry to check.
  3314. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3315. */
  3316. function stackHas(key) {
  3317. return this.__data__.has(key);
  3318. }
  3319. /**
  3320. * Sets the stack `key` to `value`.
  3321. *
  3322. * @private
  3323. * @name set
  3324. * @memberOf Stack
  3325. * @param {string} key The key of the value to set.
  3326. * @param {*} value The value to set.
  3327. * @returns {Object} Returns the stack cache instance.
  3328. */
  3329. function stackSet(key, value) {
  3330. var data = this.__data__;
  3331. if (data instanceof ListCache) {
  3332. var pairs = data.__data__;
  3333. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3334. pairs.push([key, value]);
  3335. this.size = ++data.size;
  3336. return this;
  3337. }
  3338. data = this.__data__ = new MapCache(pairs);
  3339. }
  3340. data.set(key, value);
  3341. this.size = data.size;
  3342. return this;
  3343. }
  3344. // Add methods to `Stack`.
  3345. Stack.prototype.clear = stackClear;
  3346. Stack.prototype['delete'] = stackDelete;
  3347. Stack.prototype.get = stackGet;
  3348. Stack.prototype.has = stackHas;
  3349. Stack.prototype.set = stackSet;
  3350. /*------------------------------------------------------------------------*/
  3351. /**
  3352. * Creates an array of the enumerable property names of the array-like `value`.
  3353. *
  3354. * @private
  3355. * @param {*} value The value to query.
  3356. * @param {boolean} inherited Specify returning inherited property names.
  3357. * @returns {Array} Returns the array of property names.
  3358. */
  3359. function arrayLikeKeys(value, inherited) {
  3360. var isArr = isArray(value),
  3361. isArg = !isArr && isArguments(value),
  3362. isBuff = !isArr && !isArg && isBuffer(value),
  3363. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3364. skipIndexes = isArr || isArg || isBuff || isType,
  3365. result = skipIndexes ? baseTimes(value.length, String) : [],
  3366. length = result.length;
  3367. for (var key in value) {
  3368. if ((inherited || hasOwnProperty.call(value, key)) &&
  3369. !(skipIndexes && (
  3370. // Safari 9 has enumerable `arguments.length` in strict mode.
  3371. key == 'length' ||
  3372. // Node.js 0.10 has enumerable non-index properties on buffers.
  3373. (isBuff && (key == 'offset' || key == 'parent')) ||
  3374. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3375. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3376. // Skip index properties.
  3377. isIndex(key, length)
  3378. ))) {
  3379. result.push(key);
  3380. }
  3381. }
  3382. return result;
  3383. }
  3384. /**
  3385. * A specialized version of `_.sample` for arrays.
  3386. *
  3387. * @private
  3388. * @param {Array} array The array to sample.
  3389. * @returns {*} Returns the random element.
  3390. */
  3391. function arraySample(array) {
  3392. var length = array.length;
  3393. return length ? array[baseRandom(0, length - 1)] : undefined;
  3394. }
  3395. /**
  3396. * A specialized version of `_.sampleSize` for arrays.
  3397. *
  3398. * @private
  3399. * @param {Array} array The array to sample.
  3400. * @param {number} n The number of elements to sample.
  3401. * @returns {Array} Returns the random elements.
  3402. */
  3403. function arraySampleSize(array, n) {
  3404. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3405. }
  3406. /**
  3407. * A specialized version of `_.shuffle` for arrays.
  3408. *
  3409. * @private
  3410. * @param {Array} array The array to shuffle.
  3411. * @returns {Array} Returns the new shuffled array.
  3412. */
  3413. function arrayShuffle(array) {
  3414. return shuffleSelf(copyArray(array));
  3415. }
  3416. /**
  3417. * This function is like `assignValue` except that it doesn't assign
  3418. * `undefined` values.
  3419. *
  3420. * @private
  3421. * @param {Object} object The object to modify.
  3422. * @param {string} key The key of the property to assign.
  3423. * @param {*} value The value to assign.
  3424. */
  3425. function assignMergeValue(object, key, value) {
  3426. if ((value !== undefined && !eq(object[key], value)) ||
  3427. (value === undefined && !(key in object))) {
  3428. baseAssignValue(object, key, value);
  3429. }
  3430. }
  3431. /**
  3432. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3433. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3434. * for equality comparisons.
  3435. *
  3436. * @private
  3437. * @param {Object} object The object to modify.
  3438. * @param {string} key The key of the property to assign.
  3439. * @param {*} value The value to assign.
  3440. */
  3441. function assignValue(object, key, value) {
  3442. var objValue = object[key];
  3443. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3444. (value === undefined && !(key in object))) {
  3445. baseAssignValue(object, key, value);
  3446. }
  3447. }
  3448. /**
  3449. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3450. *
  3451. * @private
  3452. * @param {Array} array The array to inspect.
  3453. * @param {*} key The key to search for.
  3454. * @returns {number} Returns the index of the matched value, else `-1`.
  3455. */
  3456. function assocIndexOf(array, key) {
  3457. var length = array.length;
  3458. while (length--) {
  3459. if (eq(array[length][0], key)) {
  3460. return length;
  3461. }
  3462. }
  3463. return -1;
  3464. }
  3465. /**
  3466. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3467. * by `iteratee` and values set by `setter`.
  3468. *
  3469. * @private
  3470. * @param {Array|Object} collection The collection to iterate over.
  3471. * @param {Function} setter The function to set `accumulator` values.
  3472. * @param {Function} iteratee The iteratee to transform keys.
  3473. * @param {Object} accumulator The initial aggregated object.
  3474. * @returns {Function} Returns `accumulator`.
  3475. */
  3476. function baseAggregator(collection, setter, iteratee, accumulator) {
  3477. baseEach(collection, function(value, key, collection) {
  3478. setter(accumulator, value, iteratee(value), collection);
  3479. });
  3480. return accumulator;
  3481. }
  3482. /**
  3483. * The base implementation of `_.assign` without support for multiple sources
  3484. * or `customizer` functions.
  3485. *
  3486. * @private
  3487. * @param {Object} object The destination object.
  3488. * @param {Object} source The source object.
  3489. * @returns {Object} Returns `object`.
  3490. */
  3491. function baseAssign(object, source) {
  3492. return object && copyObject(source, keys(source), object);
  3493. }
  3494. /**
  3495. * The base implementation of `_.assignIn` without support for multiple sources
  3496. * or `customizer` functions.
  3497. *
  3498. * @private
  3499. * @param {Object} object The destination object.
  3500. * @param {Object} source The source object.
  3501. * @returns {Object} Returns `object`.
  3502. */
  3503. function baseAssignIn(object, source) {
  3504. return object && copyObject(source, keysIn(source), object);
  3505. }
  3506. /**
  3507. * The base implementation of `assignValue` and `assignMergeValue` without
  3508. * value checks.
  3509. *
  3510. * @private
  3511. * @param {Object} object The object to modify.
  3512. * @param {string} key The key of the property to assign.
  3513. * @param {*} value The value to assign.
  3514. */
  3515. function baseAssignValue(object, key, value) {
  3516. if (key == '__proto__' && defineProperty) {
  3517. defineProperty(object, key, {
  3518. 'configurable': true,
  3519. 'enumerable': true,
  3520. 'value': value,
  3521. 'writable': true
  3522. });
  3523. } else {
  3524. object[key] = value;
  3525. }
  3526. }
  3527. /**
  3528. * The base implementation of `_.at` without support for individual paths.
  3529. *
  3530. * @private
  3531. * @param {Object} object The object to iterate over.
  3532. * @param {string[]} paths The property paths to pick.
  3533. * @returns {Array} Returns the picked elements.
  3534. */
  3535. function baseAt(object, paths) {
  3536. var index = -1,
  3537. length = paths.length,
  3538. result = Array(length),
  3539. skip = object == null;
  3540. while (++index < length) {
  3541. result[index] = skip ? undefined : get(object, paths[index]);
  3542. }
  3543. return result;
  3544. }
  3545. /**
  3546. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3547. *
  3548. * @private
  3549. * @param {number} number The number to clamp.
  3550. * @param {number} [lower] The lower bound.
  3551. * @param {number} upper The upper bound.
  3552. * @returns {number} Returns the clamped number.
  3553. */
  3554. function baseClamp(number, lower, upper) {
  3555. if (number === number) {
  3556. if (upper !== undefined) {
  3557. number = number <= upper ? number : upper;
  3558. }
  3559. if (lower !== undefined) {
  3560. number = number >= lower ? number : lower;
  3561. }
  3562. }
  3563. return number;
  3564. }
  3565. /**
  3566. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3567. * traversed objects.
  3568. *
  3569. * @private
  3570. * @param {*} value The value to clone.
  3571. * @param {boolean} bitmask The bitmask flags.
  3572. * 1 - Deep clone
  3573. * 2 - Flatten inherited properties
  3574. * 4 - Clone symbols
  3575. * @param {Function} [customizer] The function to customize cloning.
  3576. * @param {string} [key] The key of `value`.
  3577. * @param {Object} [object] The parent object of `value`.
  3578. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3579. * @returns {*} Returns the cloned value.
  3580. */
  3581. function baseClone(value, bitmask, customizer, key, object, stack) {
  3582. var result,
  3583. isDeep = bitmask & CLONE_DEEP_FLAG,
  3584. isFlat = bitmask & CLONE_FLAT_FLAG,
  3585. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3586. if (customizer) {
  3587. result = object ? customizer(value, key, object, stack) : customizer(value);
  3588. }
  3589. if (result !== undefined) {
  3590. return result;
  3591. }
  3592. if (!isObject(value)) {
  3593. return value;
  3594. }
  3595. var isArr = isArray(value);
  3596. if (isArr) {
  3597. result = initCloneArray(value);
  3598. if (!isDeep) {
  3599. return copyArray(value, result);
  3600. }
  3601. } else {
  3602. var tag = getTag(value),
  3603. isFunc = tag == funcTag || tag == genTag;
  3604. if (isBuffer(value)) {
  3605. return cloneBuffer(value, isDeep);
  3606. }
  3607. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3608. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3609. if (!isDeep) {
  3610. return isFlat
  3611. ? copySymbolsIn(value, baseAssignIn(result, value))
  3612. : copySymbols(value, baseAssign(result, value));
  3613. }
  3614. } else {
  3615. if (!cloneableTags[tag]) {
  3616. return object ? value : {};
  3617. }
  3618. result = initCloneByTag(value, tag, isDeep);
  3619. }
  3620. }
  3621. // Check for circular references and return its corresponding clone.
  3622. stack || (stack = new Stack);
  3623. var stacked = stack.get(value);
  3624. if (stacked) {
  3625. return stacked;
  3626. }
  3627. stack.set(value, result);
  3628. if (isSet(value)) {
  3629. value.forEach(function(subValue) {
  3630. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3631. });
  3632. } else if (isMap(value)) {
  3633. value.forEach(function(subValue, key) {
  3634. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3635. });
  3636. }
  3637. var keysFunc = isFull
  3638. ? (isFlat ? getAllKeysIn : getAllKeys)
  3639. : (isFlat ? keysIn : keys);
  3640. var props = isArr ? undefined : keysFunc(value);
  3641. arrayEach(props || value, function(subValue, key) {
  3642. if (props) {
  3643. key = subValue;
  3644. subValue = value[key];
  3645. }
  3646. // Recursively populate clone (susceptible to call stack limits).
  3647. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3648. });
  3649. return result;
  3650. }
  3651. /**
  3652. * The base implementation of `_.conforms` which doesn't clone `source`.
  3653. *
  3654. * @private
  3655. * @param {Object} source The object of property predicates to conform to.
  3656. * @returns {Function} Returns the new spec function.
  3657. */
  3658. function baseConforms(source) {
  3659. var props = keys(source);
  3660. return function(object) {
  3661. return baseConformsTo(object, source, props);
  3662. };
  3663. }
  3664. /**
  3665. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3666. *
  3667. * @private
  3668. * @param {Object} object The object to inspect.
  3669. * @param {Object} source The object of property predicates to conform to.
  3670. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3671. */
  3672. function baseConformsTo(object, source, props) {
  3673. var length = props.length;
  3674. if (object == null) {
  3675. return !length;
  3676. }
  3677. object = Object(object);
  3678. while (length--) {
  3679. var key = props[length],
  3680. predicate = source[key],
  3681. value = object[key];
  3682. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3683. return false;
  3684. }
  3685. }
  3686. return true;
  3687. }
  3688. /**
  3689. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3690. * to provide to `func`.
  3691. *
  3692. * @private
  3693. * @param {Function} func The function to delay.
  3694. * @param {number} wait The number of milliseconds to delay invocation.
  3695. * @param {Array} args The arguments to provide to `func`.
  3696. * @returns {number|Object} Returns the timer id or timeout object.
  3697. */
  3698. function baseDelay(func, wait, args) {
  3699. if (typeof func != 'function') {
  3700. throw new TypeError(FUNC_ERROR_TEXT);
  3701. }
  3702. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3703. }
  3704. /**
  3705. * The base implementation of methods like `_.difference` without support
  3706. * for excluding multiple arrays or iteratee shorthands.
  3707. *
  3708. * @private
  3709. * @param {Array} array The array to inspect.
  3710. * @param {Array} values The values to exclude.
  3711. * @param {Function} [iteratee] The iteratee invoked per element.
  3712. * @param {Function} [comparator] The comparator invoked per element.
  3713. * @returns {Array} Returns the new array of filtered values.
  3714. */
  3715. function baseDifference(array, values, iteratee, comparator) {
  3716. var index = -1,
  3717. includes = arrayIncludes,
  3718. isCommon = true,
  3719. length = array.length,
  3720. result = [],
  3721. valuesLength = values.length;
  3722. if (!length) {
  3723. return result;
  3724. }
  3725. if (iteratee) {
  3726. values = arrayMap(values, baseUnary(iteratee));
  3727. }
  3728. if (comparator) {
  3729. includes = arrayIncludesWith;
  3730. isCommon = false;
  3731. }
  3732. else if (values.length >= LARGE_ARRAY_SIZE) {
  3733. includes = cacheHas;
  3734. isCommon = false;
  3735. values = new SetCache(values);
  3736. }
  3737. outer:
  3738. while (++index < length) {
  3739. var value = array[index],
  3740. computed = iteratee == null ? value : iteratee(value);
  3741. value = (comparator || value !== 0) ? value : 0;
  3742. if (isCommon && computed === computed) {
  3743. var valuesIndex = valuesLength;
  3744. while (valuesIndex--) {
  3745. if (values[valuesIndex] === computed) {
  3746. continue outer;
  3747. }
  3748. }
  3749. result.push(value);
  3750. }
  3751. else if (!includes(values, computed, comparator)) {
  3752. result.push(value);
  3753. }
  3754. }
  3755. return result;
  3756. }
  3757. /**
  3758. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3759. *
  3760. * @private
  3761. * @param {Array|Object} collection The collection to iterate over.
  3762. * @param {Function} iteratee The function invoked per iteration.
  3763. * @returns {Array|Object} Returns `collection`.
  3764. */
  3765. var baseEach = createBaseEach(baseForOwn);
  3766. /**
  3767. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3768. *
  3769. * @private
  3770. * @param {Array|Object} collection The collection to iterate over.
  3771. * @param {Function} iteratee The function invoked per iteration.
  3772. * @returns {Array|Object} Returns `collection`.
  3773. */
  3774. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3775. /**
  3776. * The base implementation of `_.every` without support for iteratee shorthands.
  3777. *
  3778. * @private
  3779. * @param {Array|Object} collection The collection to iterate over.
  3780. * @param {Function} predicate The function invoked per iteration.
  3781. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3782. * else `false`
  3783. */
  3784. function baseEvery(collection, predicate) {
  3785. var result = true;
  3786. baseEach(collection, function(value, index, collection) {
  3787. result = !!predicate(value, index, collection);
  3788. return result;
  3789. });
  3790. return result;
  3791. }
  3792. /**
  3793. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3794. * `comparator` to determine the extremum value.
  3795. *
  3796. * @private
  3797. * @param {Array} array The array to iterate over.
  3798. * @param {Function} iteratee The iteratee invoked per iteration.
  3799. * @param {Function} comparator The comparator used to compare values.
  3800. * @returns {*} Returns the extremum value.
  3801. */
  3802. function baseExtremum(array, iteratee, comparator) {
  3803. var index = -1,
  3804. length = array.length;
  3805. while (++index < length) {
  3806. var value = array[index],
  3807. current = iteratee(value);
  3808. if (current != null && (computed === undefined
  3809. ? (current === current && !isSymbol(current))
  3810. : comparator(current, computed)
  3811. )) {
  3812. var computed = current,
  3813. result = value;
  3814. }
  3815. }
  3816. return result;
  3817. }
  3818. /**
  3819. * The base implementation of `_.fill` without an iteratee call guard.
  3820. *
  3821. * @private
  3822. * @param {Array} array The array to fill.
  3823. * @param {*} value The value to fill `array` with.
  3824. * @param {number} [start=0] The start position.
  3825. * @param {number} [end=array.length] The end position.
  3826. * @returns {Array} Returns `array`.
  3827. */
  3828. function baseFill(array, value, start, end) {
  3829. var length = array.length;
  3830. start = toInteger(start);
  3831. if (start < 0) {
  3832. start = -start > length ? 0 : (length + start);
  3833. }
  3834. end = (end === undefined || end > length) ? length : toInteger(end);
  3835. if (end < 0) {
  3836. end += length;
  3837. }
  3838. end = start > end ? 0 : toLength(end);
  3839. while (start < end) {
  3840. array[start++] = value;
  3841. }
  3842. return array;
  3843. }
  3844. /**
  3845. * The base implementation of `_.filter` without support for iteratee shorthands.
  3846. *
  3847. * @private
  3848. * @param {Array|Object} collection The collection to iterate over.
  3849. * @param {Function} predicate The function invoked per iteration.
  3850. * @returns {Array} Returns the new filtered array.
  3851. */
  3852. function baseFilter(collection, predicate) {
  3853. var result = [];
  3854. baseEach(collection, function(value, index, collection) {
  3855. if (predicate(value, index, collection)) {
  3856. result.push(value);
  3857. }
  3858. });
  3859. return result;
  3860. }
  3861. /**
  3862. * The base implementation of `_.flatten` with support for restricting flattening.
  3863. *
  3864. * @private
  3865. * @param {Array} array The array to flatten.
  3866. * @param {number} depth The maximum recursion depth.
  3867. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3868. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3869. * @param {Array} [result=[]] The initial result value.
  3870. * @returns {Array} Returns the new flattened array.
  3871. */
  3872. function baseFlatten(array, depth, predicate, isStrict, result) {
  3873. var index = -1,
  3874. length = array.length;
  3875. predicate || (predicate = isFlattenable);
  3876. result || (result = []);
  3877. while (++index < length) {
  3878. var value = array[index];
  3879. if (depth > 0 && predicate(value)) {
  3880. if (depth > 1) {
  3881. // Recursively flatten arrays (susceptible to call stack limits).
  3882. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3883. } else {
  3884. arrayPush(result, value);
  3885. }
  3886. } else if (!isStrict) {
  3887. result[result.length] = value;
  3888. }
  3889. }
  3890. return result;
  3891. }
  3892. /**
  3893. * The base implementation of `baseForOwn` which iterates over `object`
  3894. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3895. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3896. *
  3897. * @private
  3898. * @param {Object} object The object to iterate over.
  3899. * @param {Function} iteratee The function invoked per iteration.
  3900. * @param {Function} keysFunc The function to get the keys of `object`.
  3901. * @returns {Object} Returns `object`.
  3902. */
  3903. var baseFor = createBaseFor();
  3904. /**
  3905. * This function is like `baseFor` except that it iterates over properties
  3906. * in the opposite order.
  3907. *
  3908. * @private
  3909. * @param {Object} object The object to iterate over.
  3910. * @param {Function} iteratee The function invoked per iteration.
  3911. * @param {Function} keysFunc The function to get the keys of `object`.
  3912. * @returns {Object} Returns `object`.
  3913. */
  3914. var baseForRight = createBaseFor(true);
  3915. /**
  3916. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3917. *
  3918. * @private
  3919. * @param {Object} object The object to iterate over.
  3920. * @param {Function} iteratee The function invoked per iteration.
  3921. * @returns {Object} Returns `object`.
  3922. */
  3923. function baseForOwn(object, iteratee) {
  3924. return object && baseFor(object, iteratee, keys);
  3925. }
  3926. /**
  3927. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3928. *
  3929. * @private
  3930. * @param {Object} object The object to iterate over.
  3931. * @param {Function} iteratee The function invoked per iteration.
  3932. * @returns {Object} Returns `object`.
  3933. */
  3934. function baseForOwnRight(object, iteratee) {
  3935. return object && baseForRight(object, iteratee, keys);
  3936. }
  3937. /**
  3938. * The base implementation of `_.functions` which creates an array of
  3939. * `object` function property names filtered from `props`.
  3940. *
  3941. * @private
  3942. * @param {Object} object The object to inspect.
  3943. * @param {Array} props The property names to filter.
  3944. * @returns {Array} Returns the function names.
  3945. */
  3946. function baseFunctions(object, props) {
  3947. return arrayFilter(props, function(key) {
  3948. return isFunction(object[key]);
  3949. });
  3950. }
  3951. /**
  3952. * The base implementation of `_.get` without support for default values.
  3953. *
  3954. * @private
  3955. * @param {Object} object The object to query.
  3956. * @param {Array|string} path The path of the property to get.
  3957. * @returns {*} Returns the resolved value.
  3958. */
  3959. function baseGet(object, path) {
  3960. path = castPath(path, object);
  3961. var index = 0,
  3962. length = path.length;
  3963. while (object != null && index < length) {
  3964. object = object[toKey(path[index++])];
  3965. }
  3966. return (index && index == length) ? object : undefined;
  3967. }
  3968. /**
  3969. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3970. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3971. * symbols of `object`.
  3972. *
  3973. * @private
  3974. * @param {Object} object The object to query.
  3975. * @param {Function} keysFunc The function to get the keys of `object`.
  3976. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3977. * @returns {Array} Returns the array of property names and symbols.
  3978. */
  3979. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3980. var result = keysFunc(object);
  3981. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3982. }
  3983. /**
  3984. * The base implementation of `getTag` without fallbacks for buggy environments.
  3985. *
  3986. * @private
  3987. * @param {*} value The value to query.
  3988. * @returns {string} Returns the `toStringTag`.
  3989. */
  3990. function baseGetTag(value) {
  3991. if (value == null) {
  3992. return value === undefined ? undefinedTag : nullTag;
  3993. }
  3994. return (symToStringTag && symToStringTag in Object(value))
  3995. ? getRawTag(value)
  3996. : objectToString(value);
  3997. }
  3998. /**
  3999. * The base implementation of `_.gt` which doesn't coerce arguments.
  4000. *
  4001. * @private
  4002. * @param {*} value The value to compare.
  4003. * @param {*} other The other value to compare.
  4004. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4005. * else `false`.
  4006. */
  4007. function baseGt(value, other) {
  4008. return value > other;
  4009. }
  4010. /**
  4011. * The base implementation of `_.has` without support for deep paths.
  4012. *
  4013. * @private
  4014. * @param {Object} [object] The object to query.
  4015. * @param {Array|string} key The key to check.
  4016. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4017. */
  4018. function baseHas(object, key) {
  4019. return object != null && hasOwnProperty.call(object, key);
  4020. }
  4021. /**
  4022. * The base implementation of `_.hasIn` without support for deep paths.
  4023. *
  4024. * @private
  4025. * @param {Object} [object] The object to query.
  4026. * @param {Array|string} key The key to check.
  4027. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4028. */
  4029. function baseHasIn(object, key) {
  4030. return object != null && key in Object(object);
  4031. }
  4032. /**
  4033. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4034. *
  4035. * @private
  4036. * @param {number} number The number to check.
  4037. * @param {number} start The start of the range.
  4038. * @param {number} end The end of the range.
  4039. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4040. */
  4041. function baseInRange(number, start, end) {
  4042. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4043. }
  4044. /**
  4045. * The base implementation of methods like `_.intersection`, without support
  4046. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4047. *
  4048. * @private
  4049. * @param {Array} arrays The arrays to inspect.
  4050. * @param {Function} [iteratee] The iteratee invoked per element.
  4051. * @param {Function} [comparator] The comparator invoked per element.
  4052. * @returns {Array} Returns the new array of shared values.
  4053. */
  4054. function baseIntersection(arrays, iteratee, comparator) {
  4055. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4056. length = arrays[0].length,
  4057. othLength = arrays.length,
  4058. othIndex = othLength,
  4059. caches = Array(othLength),
  4060. maxLength = Infinity,
  4061. result = [];
  4062. while (othIndex--) {
  4063. var array = arrays[othIndex];
  4064. if (othIndex && iteratee) {
  4065. array = arrayMap(array, baseUnary(iteratee));
  4066. }
  4067. maxLength = nativeMin(array.length, maxLength);
  4068. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4069. ? new SetCache(othIndex && array)
  4070. : undefined;
  4071. }
  4072. array = arrays[0];
  4073. var index = -1,
  4074. seen = caches[0];
  4075. outer:
  4076. while (++index < length && result.length < maxLength) {
  4077. var value = array[index],
  4078. computed = iteratee ? iteratee(value) : value;
  4079. value = (comparator || value !== 0) ? value : 0;
  4080. if (!(seen
  4081. ? cacheHas(seen, computed)
  4082. : includes(result, computed, comparator)
  4083. )) {
  4084. othIndex = othLength;
  4085. while (--othIndex) {
  4086. var cache = caches[othIndex];
  4087. if (!(cache
  4088. ? cacheHas(cache, computed)
  4089. : includes(arrays[othIndex], computed, comparator))
  4090. ) {
  4091. continue outer;
  4092. }
  4093. }
  4094. if (seen) {
  4095. seen.push(computed);
  4096. }
  4097. result.push(value);
  4098. }
  4099. }
  4100. return result;
  4101. }
  4102. /**
  4103. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4104. * `object` with values transformed by `iteratee` and set by `setter`.
  4105. *
  4106. * @private
  4107. * @param {Object} object The object to iterate over.
  4108. * @param {Function} setter The function to set `accumulator` values.
  4109. * @param {Function} iteratee The iteratee to transform values.
  4110. * @param {Object} accumulator The initial inverted object.
  4111. * @returns {Function} Returns `accumulator`.
  4112. */
  4113. function baseInverter(object, setter, iteratee, accumulator) {
  4114. baseForOwn(object, function(value, key, object) {
  4115. setter(accumulator, iteratee(value), key, object);
  4116. });
  4117. return accumulator;
  4118. }
  4119. /**
  4120. * The base implementation of `_.invoke` without support for individual
  4121. * method arguments.
  4122. *
  4123. * @private
  4124. * @param {Object} object The object to query.
  4125. * @param {Array|string} path The path of the method to invoke.
  4126. * @param {Array} args The arguments to invoke the method with.
  4127. * @returns {*} Returns the result of the invoked method.
  4128. */
  4129. function baseInvoke(object, path, args) {
  4130. path = castPath(path, object);
  4131. object = parent(object, path);
  4132. var func = object == null ? object : object[toKey(last(path))];
  4133. return func == null ? undefined : apply(func, object, args);
  4134. }
  4135. /**
  4136. * The base implementation of `_.isArguments`.
  4137. *
  4138. * @private
  4139. * @param {*} value The value to check.
  4140. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4141. */
  4142. function baseIsArguments(value) {
  4143. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4144. }
  4145. /**
  4146. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4147. *
  4148. * @private
  4149. * @param {*} value The value to check.
  4150. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4151. */
  4152. function baseIsArrayBuffer(value) {
  4153. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4154. }
  4155. /**
  4156. * The base implementation of `_.isDate` without Node.js optimizations.
  4157. *
  4158. * @private
  4159. * @param {*} value The value to check.
  4160. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4161. */
  4162. function baseIsDate(value) {
  4163. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4164. }
  4165. /**
  4166. * The base implementation of `_.isEqual` which supports partial comparisons
  4167. * and tracks traversed objects.
  4168. *
  4169. * @private
  4170. * @param {*} value The value to compare.
  4171. * @param {*} other The other value to compare.
  4172. * @param {boolean} bitmask The bitmask flags.
  4173. * 1 - Unordered comparison
  4174. * 2 - Partial comparison
  4175. * @param {Function} [customizer] The function to customize comparisons.
  4176. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4177. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4178. */
  4179. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4180. if (value === other) {
  4181. return true;
  4182. }
  4183. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4184. return value !== value && other !== other;
  4185. }
  4186. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4187. }
  4188. /**
  4189. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4190. * deep comparisons and tracks traversed objects enabling objects with circular
  4191. * references to be compared.
  4192. *
  4193. * @private
  4194. * @param {Object} object The object to compare.
  4195. * @param {Object} other The other object to compare.
  4196. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4197. * @param {Function} customizer The function to customize comparisons.
  4198. * @param {Function} equalFunc The function to determine equivalents of values.
  4199. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4200. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4201. */
  4202. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4203. var objIsArr = isArray(object),
  4204. othIsArr = isArray(other),
  4205. objTag = objIsArr ? arrayTag : getTag(object),
  4206. othTag = othIsArr ? arrayTag : getTag(other);
  4207. objTag = objTag == argsTag ? objectTag : objTag;
  4208. othTag = othTag == argsTag ? objectTag : othTag;
  4209. var objIsObj = objTag == objectTag,
  4210. othIsObj = othTag == objectTag,
  4211. isSameTag = objTag == othTag;
  4212. if (isSameTag && isBuffer(object)) {
  4213. if (!isBuffer(other)) {
  4214. return false;
  4215. }
  4216. objIsArr = true;
  4217. objIsObj = false;
  4218. }
  4219. if (isSameTag && !objIsObj) {
  4220. stack || (stack = new Stack);
  4221. return (objIsArr || isTypedArray(object))
  4222. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4223. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4224. }
  4225. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4226. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4227. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4228. if (objIsWrapped || othIsWrapped) {
  4229. var objUnwrapped = objIsWrapped ? object.value() : object,
  4230. othUnwrapped = othIsWrapped ? other.value() : other;
  4231. stack || (stack = new Stack);
  4232. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4233. }
  4234. }
  4235. if (!isSameTag) {
  4236. return false;
  4237. }
  4238. stack || (stack = new Stack);
  4239. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4240. }
  4241. /**
  4242. * The base implementation of `_.isMap` without Node.js optimizations.
  4243. *
  4244. * @private
  4245. * @param {*} value The value to check.
  4246. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4247. */
  4248. function baseIsMap(value) {
  4249. return isObjectLike(value) && getTag(value) == mapTag;
  4250. }
  4251. /**
  4252. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4253. *
  4254. * @private
  4255. * @param {Object} object The object to inspect.
  4256. * @param {Object} source The object of property values to match.
  4257. * @param {Array} matchData The property names, values, and compare flags to match.
  4258. * @param {Function} [customizer] The function to customize comparisons.
  4259. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4260. */
  4261. function baseIsMatch(object, source, matchData, customizer) {
  4262. var index = matchData.length,
  4263. length = index,
  4264. noCustomizer = !customizer;
  4265. if (object == null) {
  4266. return !length;
  4267. }
  4268. object = Object(object);
  4269. while (index--) {
  4270. var data = matchData[index];
  4271. if ((noCustomizer && data[2])
  4272. ? data[1] !== object[data[0]]
  4273. : !(data[0] in object)
  4274. ) {
  4275. return false;
  4276. }
  4277. }
  4278. while (++index < length) {
  4279. data = matchData[index];
  4280. var key = data[0],
  4281. objValue = object[key],
  4282. srcValue = data[1];
  4283. if (noCustomizer && data[2]) {
  4284. if (objValue === undefined && !(key in object)) {
  4285. return false;
  4286. }
  4287. } else {
  4288. var stack = new Stack;
  4289. if (customizer) {
  4290. var result = customizer(objValue, srcValue, key, object, source, stack);
  4291. }
  4292. if (!(result === undefined
  4293. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4294. : result
  4295. )) {
  4296. return false;
  4297. }
  4298. }
  4299. }
  4300. return true;
  4301. }
  4302. /**
  4303. * The base implementation of `_.isNative` without bad shim checks.
  4304. *
  4305. * @private
  4306. * @param {*} value The value to check.
  4307. * @returns {boolean} Returns `true` if `value` is a native function,
  4308. * else `false`.
  4309. */
  4310. function baseIsNative(value) {
  4311. if (!isObject(value) || isMasked(value)) {
  4312. return false;
  4313. }
  4314. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4315. return pattern.test(toSource(value));
  4316. }
  4317. /**
  4318. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4319. *
  4320. * @private
  4321. * @param {*} value The value to check.
  4322. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4323. */
  4324. function baseIsRegExp(value) {
  4325. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4326. }
  4327. /**
  4328. * The base implementation of `_.isSet` without Node.js optimizations.
  4329. *
  4330. * @private
  4331. * @param {*} value The value to check.
  4332. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4333. */
  4334. function baseIsSet(value) {
  4335. return isObjectLike(value) && getTag(value) == setTag;
  4336. }
  4337. /**
  4338. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4339. *
  4340. * @private
  4341. * @param {*} value The value to check.
  4342. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4343. */
  4344. function baseIsTypedArray(value) {
  4345. return isObjectLike(value) &&
  4346. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4347. }
  4348. /**
  4349. * The base implementation of `_.iteratee`.
  4350. *
  4351. * @private
  4352. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4353. * @returns {Function} Returns the iteratee.
  4354. */
  4355. function baseIteratee(value) {
  4356. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4357. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4358. if (typeof value == 'function') {
  4359. return value;
  4360. }
  4361. if (value == null) {
  4362. return identity;
  4363. }
  4364. if (typeof value == 'object') {
  4365. return isArray(value)
  4366. ? baseMatchesProperty(value[0], value[1])
  4367. : baseMatches(value);
  4368. }
  4369. return property(value);
  4370. }
  4371. /**
  4372. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4373. *
  4374. * @private
  4375. * @param {Object} object The object to query.
  4376. * @returns {Array} Returns the array of property names.
  4377. */
  4378. function baseKeys(object) {
  4379. if (!isPrototype(object)) {
  4380. return nativeKeys(object);
  4381. }
  4382. var result = [];
  4383. for (var key in Object(object)) {
  4384. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4385. result.push(key);
  4386. }
  4387. }
  4388. return result;
  4389. }
  4390. /**
  4391. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4392. *
  4393. * @private
  4394. * @param {Object} object The object to query.
  4395. * @returns {Array} Returns the array of property names.
  4396. */
  4397. function baseKeysIn(object) {
  4398. if (!isObject(object)) {
  4399. return nativeKeysIn(object);
  4400. }
  4401. var isProto = isPrototype(object),
  4402. result = [];
  4403. for (var key in object) {
  4404. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4405. result.push(key);
  4406. }
  4407. }
  4408. return result;
  4409. }
  4410. /**
  4411. * The base implementation of `_.lt` which doesn't coerce arguments.
  4412. *
  4413. * @private
  4414. * @param {*} value The value to compare.
  4415. * @param {*} other The other value to compare.
  4416. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4417. * else `false`.
  4418. */
  4419. function baseLt(value, other) {
  4420. return value < other;
  4421. }
  4422. /**
  4423. * The base implementation of `_.map` without support for iteratee shorthands.
  4424. *
  4425. * @private
  4426. * @param {Array|Object} collection The collection to iterate over.
  4427. * @param {Function} iteratee The function invoked per iteration.
  4428. * @returns {Array} Returns the new mapped array.
  4429. */
  4430. function baseMap(collection, iteratee) {
  4431. var index = -1,
  4432. result = isArrayLike(collection) ? Array(collection.length) : [];
  4433. baseEach(collection, function(value, key, collection) {
  4434. result[++index] = iteratee(value, key, collection);
  4435. });
  4436. return result;
  4437. }
  4438. /**
  4439. * The base implementation of `_.matches` which doesn't clone `source`.
  4440. *
  4441. * @private
  4442. * @param {Object} source The object of property values to match.
  4443. * @returns {Function} Returns the new spec function.
  4444. */
  4445. function baseMatches(source) {
  4446. var matchData = getMatchData(source);
  4447. if (matchData.length == 1 && matchData[0][2]) {
  4448. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4449. }
  4450. return function(object) {
  4451. return object === source || baseIsMatch(object, source, matchData);
  4452. };
  4453. }
  4454. /**
  4455. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4456. *
  4457. * @private
  4458. * @param {string} path The path of the property to get.
  4459. * @param {*} srcValue The value to match.
  4460. * @returns {Function} Returns the new spec function.
  4461. */
  4462. function baseMatchesProperty(path, srcValue) {
  4463. if (isKey(path) && isStrictComparable(srcValue)) {
  4464. return matchesStrictComparable(toKey(path), srcValue);
  4465. }
  4466. return function(object) {
  4467. var objValue = get(object, path);
  4468. return (objValue === undefined && objValue === srcValue)
  4469. ? hasIn(object, path)
  4470. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4471. };
  4472. }
  4473. /**
  4474. * The base implementation of `_.merge` without support for multiple sources.
  4475. *
  4476. * @private
  4477. * @param {Object} object The destination object.
  4478. * @param {Object} source The source object.
  4479. * @param {number} srcIndex The index of `source`.
  4480. * @param {Function} [customizer] The function to customize merged values.
  4481. * @param {Object} [stack] Tracks traversed source values and their merged
  4482. * counterparts.
  4483. */
  4484. function baseMerge(object, source, srcIndex, customizer, stack) {
  4485. if (object === source) {
  4486. return;
  4487. }
  4488. baseFor(source, function(srcValue, key) {
  4489. stack || (stack = new Stack);
  4490. if (isObject(srcValue)) {
  4491. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4492. }
  4493. else {
  4494. var newValue = customizer
  4495. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4496. : undefined;
  4497. if (newValue === undefined) {
  4498. newValue = srcValue;
  4499. }
  4500. assignMergeValue(object, key, newValue);
  4501. }
  4502. }, keysIn);
  4503. }
  4504. /**
  4505. * A specialized version of `baseMerge` for arrays and objects which performs
  4506. * deep merges and tracks traversed objects enabling objects with circular
  4507. * references to be merged.
  4508. *
  4509. * @private
  4510. * @param {Object} object The destination object.
  4511. * @param {Object} source The source object.
  4512. * @param {string} key The key of the value to merge.
  4513. * @param {number} srcIndex The index of `source`.
  4514. * @param {Function} mergeFunc The function to merge values.
  4515. * @param {Function} [customizer] The function to customize assigned values.
  4516. * @param {Object} [stack] Tracks traversed source values and their merged
  4517. * counterparts.
  4518. */
  4519. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4520. var objValue = safeGet(object, key),
  4521. srcValue = safeGet(source, key),
  4522. stacked = stack.get(srcValue);
  4523. if (stacked) {
  4524. assignMergeValue(object, key, stacked);
  4525. return;
  4526. }
  4527. var newValue = customizer
  4528. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4529. : undefined;
  4530. var isCommon = newValue === undefined;
  4531. if (isCommon) {
  4532. var isArr = isArray(srcValue),
  4533. isBuff = !isArr && isBuffer(srcValue),
  4534. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4535. newValue = srcValue;
  4536. if (isArr || isBuff || isTyped) {
  4537. if (isArray(objValue)) {
  4538. newValue = objValue;
  4539. }
  4540. else if (isArrayLikeObject(objValue)) {
  4541. newValue = copyArray(objValue);
  4542. }
  4543. else if (isBuff) {
  4544. isCommon = false;
  4545. newValue = cloneBuffer(srcValue, true);
  4546. }
  4547. else if (isTyped) {
  4548. isCommon = false;
  4549. newValue = cloneTypedArray(srcValue, true);
  4550. }
  4551. else {
  4552. newValue = [];
  4553. }
  4554. }
  4555. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4556. newValue = objValue;
  4557. if (isArguments(objValue)) {
  4558. newValue = toPlainObject(objValue);
  4559. }
  4560. else if (!isObject(objValue) || isFunction(objValue)) {
  4561. newValue = initCloneObject(srcValue);
  4562. }
  4563. }
  4564. else {
  4565. isCommon = false;
  4566. }
  4567. }
  4568. if (isCommon) {
  4569. // Recursively merge objects and arrays (susceptible to call stack limits).
  4570. stack.set(srcValue, newValue);
  4571. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4572. stack['delete'](srcValue);
  4573. }
  4574. assignMergeValue(object, key, newValue);
  4575. }
  4576. /**
  4577. * The base implementation of `_.nth` which doesn't coerce arguments.
  4578. *
  4579. * @private
  4580. * @param {Array} array The array to query.
  4581. * @param {number} n The index of the element to return.
  4582. * @returns {*} Returns the nth element of `array`.
  4583. */
  4584. function baseNth(array, n) {
  4585. var length = array.length;
  4586. if (!length) {
  4587. return;
  4588. }
  4589. n += n < 0 ? length : 0;
  4590. return isIndex(n, length) ? array[n] : undefined;
  4591. }
  4592. /**
  4593. * The base implementation of `_.orderBy` without param guards.
  4594. *
  4595. * @private
  4596. * @param {Array|Object} collection The collection to iterate over.
  4597. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4598. * @param {string[]} orders The sort orders of `iteratees`.
  4599. * @returns {Array} Returns the new sorted array.
  4600. */
  4601. function baseOrderBy(collection, iteratees, orders) {
  4602. if (iteratees.length) {
  4603. iteratees = arrayMap(iteratees, function(iteratee) {
  4604. if (isArray(iteratee)) {
  4605. return function(value) {
  4606. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4607. }
  4608. }
  4609. return iteratee;
  4610. });
  4611. } else {
  4612. iteratees = [identity];
  4613. }
  4614. var index = -1;
  4615. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4616. var result = baseMap(collection, function(value, key, collection) {
  4617. var criteria = arrayMap(iteratees, function(iteratee) {
  4618. return iteratee(value);
  4619. });
  4620. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4621. });
  4622. return baseSortBy(result, function(object, other) {
  4623. return compareMultiple(object, other, orders);
  4624. });
  4625. }
  4626. /**
  4627. * The base implementation of `_.pick` without support for individual
  4628. * property identifiers.
  4629. *
  4630. * @private
  4631. * @param {Object} object The source object.
  4632. * @param {string[]} paths The property paths to pick.
  4633. * @returns {Object} Returns the new object.
  4634. */
  4635. function basePick(object, paths) {
  4636. return basePickBy(object, paths, function(value, path) {
  4637. return hasIn(object, path);
  4638. });
  4639. }
  4640. /**
  4641. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4642. *
  4643. * @private
  4644. * @param {Object} object The source object.
  4645. * @param {string[]} paths The property paths to pick.
  4646. * @param {Function} predicate The function invoked per property.
  4647. * @returns {Object} Returns the new object.
  4648. */
  4649. function basePickBy(object, paths, predicate) {
  4650. var index = -1,
  4651. length = paths.length,
  4652. result = {};
  4653. while (++index < length) {
  4654. var path = paths[index],
  4655. value = baseGet(object, path);
  4656. if (predicate(value, path)) {
  4657. baseSet(result, castPath(path, object), value);
  4658. }
  4659. }
  4660. return result;
  4661. }
  4662. /**
  4663. * A specialized version of `baseProperty` which supports deep paths.
  4664. *
  4665. * @private
  4666. * @param {Array|string} path The path of the property to get.
  4667. * @returns {Function} Returns the new accessor function.
  4668. */
  4669. function basePropertyDeep(path) {
  4670. return function(object) {
  4671. return baseGet(object, path);
  4672. };
  4673. }
  4674. /**
  4675. * The base implementation of `_.pullAllBy` without support for iteratee
  4676. * shorthands.
  4677. *
  4678. * @private
  4679. * @param {Array} array The array to modify.
  4680. * @param {Array} values The values to remove.
  4681. * @param {Function} [iteratee] The iteratee invoked per element.
  4682. * @param {Function} [comparator] The comparator invoked per element.
  4683. * @returns {Array} Returns `array`.
  4684. */
  4685. function basePullAll(array, values, iteratee, comparator) {
  4686. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4687. index = -1,
  4688. length = values.length,
  4689. seen = array;
  4690. if (array === values) {
  4691. values = copyArray(values);
  4692. }
  4693. if (iteratee) {
  4694. seen = arrayMap(array, baseUnary(iteratee));
  4695. }
  4696. while (++index < length) {
  4697. var fromIndex = 0,
  4698. value = values[index],
  4699. computed = iteratee ? iteratee(value) : value;
  4700. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4701. if (seen !== array) {
  4702. splice.call(seen, fromIndex, 1);
  4703. }
  4704. splice.call(array, fromIndex, 1);
  4705. }
  4706. }
  4707. return array;
  4708. }
  4709. /**
  4710. * The base implementation of `_.pullAt` without support for individual
  4711. * indexes or capturing the removed elements.
  4712. *
  4713. * @private
  4714. * @param {Array} array The array to modify.
  4715. * @param {number[]} indexes The indexes of elements to remove.
  4716. * @returns {Array} Returns `array`.
  4717. */
  4718. function basePullAt(array, indexes) {
  4719. var length = array ? indexes.length : 0,
  4720. lastIndex = length - 1;
  4721. while (length--) {
  4722. var index = indexes[length];
  4723. if (length == lastIndex || index !== previous) {
  4724. var previous = index;
  4725. if (isIndex(index)) {
  4726. splice.call(array, index, 1);
  4727. } else {
  4728. baseUnset(array, index);
  4729. }
  4730. }
  4731. }
  4732. return array;
  4733. }
  4734. /**
  4735. * The base implementation of `_.random` without support for returning
  4736. * floating-point numbers.
  4737. *
  4738. * @private
  4739. * @param {number} lower The lower bound.
  4740. * @param {number} upper The upper bound.
  4741. * @returns {number} Returns the random number.
  4742. */
  4743. function baseRandom(lower, upper) {
  4744. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4745. }
  4746. /**
  4747. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4748. * coerce arguments.
  4749. *
  4750. * @private
  4751. * @param {number} start The start of the range.
  4752. * @param {number} end The end of the range.
  4753. * @param {number} step The value to increment or decrement by.
  4754. * @param {boolean} [fromRight] Specify iterating from right to left.
  4755. * @returns {Array} Returns the range of numbers.
  4756. */
  4757. function baseRange(start, end, step, fromRight) {
  4758. var index = -1,
  4759. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4760. result = Array(length);
  4761. while (length--) {
  4762. result[fromRight ? length : ++index] = start;
  4763. start += step;
  4764. }
  4765. return result;
  4766. }
  4767. /**
  4768. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4769. *
  4770. * @private
  4771. * @param {string} string The string to repeat.
  4772. * @param {number} n The number of times to repeat the string.
  4773. * @returns {string} Returns the repeated string.
  4774. */
  4775. function baseRepeat(string, n) {
  4776. var result = '';
  4777. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4778. return result;
  4779. }
  4780. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4781. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4782. do {
  4783. if (n % 2) {
  4784. result += string;
  4785. }
  4786. n = nativeFloor(n / 2);
  4787. if (n) {
  4788. string += string;
  4789. }
  4790. } while (n);
  4791. return result;
  4792. }
  4793. /**
  4794. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4795. *
  4796. * @private
  4797. * @param {Function} func The function to apply a rest parameter to.
  4798. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4799. * @returns {Function} Returns the new function.
  4800. */
  4801. function baseRest(func, start) {
  4802. return setToString(overRest(func, start, identity), func + '');
  4803. }
  4804. /**
  4805. * The base implementation of `_.sample`.
  4806. *
  4807. * @private
  4808. * @param {Array|Object} collection The collection to sample.
  4809. * @returns {*} Returns the random element.
  4810. */
  4811. function baseSample(collection) {
  4812. return arraySample(values(collection));
  4813. }
  4814. /**
  4815. * The base implementation of `_.sampleSize` without param guards.
  4816. *
  4817. * @private
  4818. * @param {Array|Object} collection The collection to sample.
  4819. * @param {number} n The number of elements to sample.
  4820. * @returns {Array} Returns the random elements.
  4821. */
  4822. function baseSampleSize(collection, n) {
  4823. var array = values(collection);
  4824. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4825. }
  4826. /**
  4827. * The base implementation of `_.set`.
  4828. *
  4829. * @private
  4830. * @param {Object} object The object to modify.
  4831. * @param {Array|string} path The path of the property to set.
  4832. * @param {*} value The value to set.
  4833. * @param {Function} [customizer] The function to customize path creation.
  4834. * @returns {Object} Returns `object`.
  4835. */
  4836. function baseSet(object, path, value, customizer) {
  4837. if (!isObject(object)) {
  4838. return object;
  4839. }
  4840. path = castPath(path, object);
  4841. var index = -1,
  4842. length = path.length,
  4843. lastIndex = length - 1,
  4844. nested = object;
  4845. while (nested != null && ++index < length) {
  4846. var key = toKey(path[index]),
  4847. newValue = value;
  4848. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4849. return object;
  4850. }
  4851. if (index != lastIndex) {
  4852. var objValue = nested[key];
  4853. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4854. if (newValue === undefined) {
  4855. newValue = isObject(objValue)
  4856. ? objValue
  4857. : (isIndex(path[index + 1]) ? [] : {});
  4858. }
  4859. }
  4860. assignValue(nested, key, newValue);
  4861. nested = nested[key];
  4862. }
  4863. return object;
  4864. }
  4865. /**
  4866. * The base implementation of `setData` without support for hot loop shorting.
  4867. *
  4868. * @private
  4869. * @param {Function} func The function to associate metadata with.
  4870. * @param {*} data The metadata.
  4871. * @returns {Function} Returns `func`.
  4872. */
  4873. var baseSetData = !metaMap ? identity : function(func, data) {
  4874. metaMap.set(func, data);
  4875. return func;
  4876. };
  4877. /**
  4878. * The base implementation of `setToString` without support for hot loop shorting.
  4879. *
  4880. * @private
  4881. * @param {Function} func The function to modify.
  4882. * @param {Function} string The `toString` result.
  4883. * @returns {Function} Returns `func`.
  4884. */
  4885. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4886. return defineProperty(func, 'toString', {
  4887. 'configurable': true,
  4888. 'enumerable': false,
  4889. 'value': constant(string),
  4890. 'writable': true
  4891. });
  4892. };
  4893. /**
  4894. * The base implementation of `_.shuffle`.
  4895. *
  4896. * @private
  4897. * @param {Array|Object} collection The collection to shuffle.
  4898. * @returns {Array} Returns the new shuffled array.
  4899. */
  4900. function baseShuffle(collection) {
  4901. return shuffleSelf(values(collection));
  4902. }
  4903. /**
  4904. * The base implementation of `_.slice` without an iteratee call guard.
  4905. *
  4906. * @private
  4907. * @param {Array} array The array to slice.
  4908. * @param {number} [start=0] The start position.
  4909. * @param {number} [end=array.length] The end position.
  4910. * @returns {Array} Returns the slice of `array`.
  4911. */
  4912. function baseSlice(array, start, end) {
  4913. var index = -1,
  4914. length = array.length;
  4915. if (start < 0) {
  4916. start = -start > length ? 0 : (length + start);
  4917. }
  4918. end = end > length ? length : end;
  4919. if (end < 0) {
  4920. end += length;
  4921. }
  4922. length = start > end ? 0 : ((end - start) >>> 0);
  4923. start >>>= 0;
  4924. var result = Array(length);
  4925. while (++index < length) {
  4926. result[index] = array[index + start];
  4927. }
  4928. return result;
  4929. }
  4930. /**
  4931. * The base implementation of `_.some` without support for iteratee shorthands.
  4932. *
  4933. * @private
  4934. * @param {Array|Object} collection The collection to iterate over.
  4935. * @param {Function} predicate The function invoked per iteration.
  4936. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4937. * else `false`.
  4938. */
  4939. function baseSome(collection, predicate) {
  4940. var result;
  4941. baseEach(collection, function(value, index, collection) {
  4942. result = predicate(value, index, collection);
  4943. return !result;
  4944. });
  4945. return !!result;
  4946. }
  4947. /**
  4948. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4949. * performs a binary search of `array` to determine the index at which `value`
  4950. * should be inserted into `array` in order to maintain its sort order.
  4951. *
  4952. * @private
  4953. * @param {Array} array The sorted array to inspect.
  4954. * @param {*} value The value to evaluate.
  4955. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4956. * @returns {number} Returns the index at which `value` should be inserted
  4957. * into `array`.
  4958. */
  4959. function baseSortedIndex(array, value, retHighest) {
  4960. var low = 0,
  4961. high = array == null ? low : array.length;
  4962. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4963. while (low < high) {
  4964. var mid = (low + high) >>> 1,
  4965. computed = array[mid];
  4966. if (computed !== null && !isSymbol(computed) &&
  4967. (retHighest ? (computed <= value) : (computed < value))) {
  4968. low = mid + 1;
  4969. } else {
  4970. high = mid;
  4971. }
  4972. }
  4973. return high;
  4974. }
  4975. return baseSortedIndexBy(array, value, identity, retHighest);
  4976. }
  4977. /**
  4978. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4979. * which invokes `iteratee` for `value` and each element of `array` to compute
  4980. * their sort ranking. The iteratee is invoked with one argument; (value).
  4981. *
  4982. * @private
  4983. * @param {Array} array The sorted array to inspect.
  4984. * @param {*} value The value to evaluate.
  4985. * @param {Function} iteratee The iteratee invoked per element.
  4986. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4987. * @returns {number} Returns the index at which `value` should be inserted
  4988. * into `array`.
  4989. */
  4990. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4991. var low = 0,
  4992. high = array == null ? 0 : array.length;
  4993. if (high === 0) {
  4994. return 0;
  4995. }
  4996. value = iteratee(value);
  4997. var valIsNaN = value !== value,
  4998. valIsNull = value === null,
  4999. valIsSymbol = isSymbol(value),
  5000. valIsUndefined = value === undefined;
  5001. while (low < high) {
  5002. var mid = nativeFloor((low + high) / 2),
  5003. computed = iteratee(array[mid]),
  5004. othIsDefined = computed !== undefined,
  5005. othIsNull = computed === null,
  5006. othIsReflexive = computed === computed,
  5007. othIsSymbol = isSymbol(computed);
  5008. if (valIsNaN) {
  5009. var setLow = retHighest || othIsReflexive;
  5010. } else if (valIsUndefined) {
  5011. setLow = othIsReflexive && (retHighest || othIsDefined);
  5012. } else if (valIsNull) {
  5013. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5014. } else if (valIsSymbol) {
  5015. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5016. } else if (othIsNull || othIsSymbol) {
  5017. setLow = false;
  5018. } else {
  5019. setLow = retHighest ? (computed <= value) : (computed < value);
  5020. }
  5021. if (setLow) {
  5022. low = mid + 1;
  5023. } else {
  5024. high = mid;
  5025. }
  5026. }
  5027. return nativeMin(high, MAX_ARRAY_INDEX);
  5028. }
  5029. /**
  5030. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5031. * support for iteratee shorthands.
  5032. *
  5033. * @private
  5034. * @param {Array} array The array to inspect.
  5035. * @param {Function} [iteratee] The iteratee invoked per element.
  5036. * @returns {Array} Returns the new duplicate free array.
  5037. */
  5038. function baseSortedUniq(array, iteratee) {
  5039. var index = -1,
  5040. length = array.length,
  5041. resIndex = 0,
  5042. result = [];
  5043. while (++index < length) {
  5044. var value = array[index],
  5045. computed = iteratee ? iteratee(value) : value;
  5046. if (!index || !eq(computed, seen)) {
  5047. var seen = computed;
  5048. result[resIndex++] = value === 0 ? 0 : value;
  5049. }
  5050. }
  5051. return result;
  5052. }
  5053. /**
  5054. * The base implementation of `_.toNumber` which doesn't ensure correct
  5055. * conversions of binary, hexadecimal, or octal string values.
  5056. *
  5057. * @private
  5058. * @param {*} value The value to process.
  5059. * @returns {number} Returns the number.
  5060. */
  5061. function baseToNumber(value) {
  5062. if (typeof value == 'number') {
  5063. return value;
  5064. }
  5065. if (isSymbol(value)) {
  5066. return NAN;
  5067. }
  5068. return +value;
  5069. }
  5070. /**
  5071. * The base implementation of `_.toString` which doesn't convert nullish
  5072. * values to empty strings.
  5073. *
  5074. * @private
  5075. * @param {*} value The value to process.
  5076. * @returns {string} Returns the string.
  5077. */
  5078. function baseToString(value) {
  5079. // Exit early for strings to avoid a performance hit in some environments.
  5080. if (typeof value == 'string') {
  5081. return value;
  5082. }
  5083. if (isArray(value)) {
  5084. // Recursively convert values (susceptible to call stack limits).
  5085. return arrayMap(value, baseToString) + '';
  5086. }
  5087. if (isSymbol(value)) {
  5088. return symbolToString ? symbolToString.call(value) : '';
  5089. }
  5090. var result = (value + '');
  5091. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5092. }
  5093. /**
  5094. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5095. *
  5096. * @private
  5097. * @param {Array} array The array to inspect.
  5098. * @param {Function} [iteratee] The iteratee invoked per element.
  5099. * @param {Function} [comparator] The comparator invoked per element.
  5100. * @returns {Array} Returns the new duplicate free array.
  5101. */
  5102. function baseUniq(array, iteratee, comparator) {
  5103. var index = -1,
  5104. includes = arrayIncludes,
  5105. length = array.length,
  5106. isCommon = true,
  5107. result = [],
  5108. seen = result;
  5109. if (comparator) {
  5110. isCommon = false;
  5111. includes = arrayIncludesWith;
  5112. }
  5113. else if (length >= LARGE_ARRAY_SIZE) {
  5114. var set = iteratee ? null : createSet(array);
  5115. if (set) {
  5116. return setToArray(set);
  5117. }
  5118. isCommon = false;
  5119. includes = cacheHas;
  5120. seen = new SetCache;
  5121. }
  5122. else {
  5123. seen = iteratee ? [] : result;
  5124. }
  5125. outer:
  5126. while (++index < length) {
  5127. var value = array[index],
  5128. computed = iteratee ? iteratee(value) : value;
  5129. value = (comparator || value !== 0) ? value : 0;
  5130. if (isCommon && computed === computed) {
  5131. var seenIndex = seen.length;
  5132. while (seenIndex--) {
  5133. if (seen[seenIndex] === computed) {
  5134. continue outer;
  5135. }
  5136. }
  5137. if (iteratee) {
  5138. seen.push(computed);
  5139. }
  5140. result.push(value);
  5141. }
  5142. else if (!includes(seen, computed, comparator)) {
  5143. if (seen !== result) {
  5144. seen.push(computed);
  5145. }
  5146. result.push(value);
  5147. }
  5148. }
  5149. return result;
  5150. }
  5151. /**
  5152. * The base implementation of `_.unset`.
  5153. *
  5154. * @private
  5155. * @param {Object} object The object to modify.
  5156. * @param {Array|string} path The property path to unset.
  5157. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5158. */
  5159. function baseUnset(object, path) {
  5160. path = castPath(path, object);
  5161. object = parent(object, path);
  5162. return object == null || delete object[toKey(last(path))];
  5163. }
  5164. /**
  5165. * The base implementation of `_.update`.
  5166. *
  5167. * @private
  5168. * @param {Object} object The object to modify.
  5169. * @param {Array|string} path The path of the property to update.
  5170. * @param {Function} updater The function to produce the updated value.
  5171. * @param {Function} [customizer] The function to customize path creation.
  5172. * @returns {Object} Returns `object`.
  5173. */
  5174. function baseUpdate(object, path, updater, customizer) {
  5175. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5176. }
  5177. /**
  5178. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5179. * without support for iteratee shorthands.
  5180. *
  5181. * @private
  5182. * @param {Array} array The array to query.
  5183. * @param {Function} predicate The function invoked per iteration.
  5184. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5185. * @param {boolean} [fromRight] Specify iterating from right to left.
  5186. * @returns {Array} Returns the slice of `array`.
  5187. */
  5188. function baseWhile(array, predicate, isDrop, fromRight) {
  5189. var length = array.length,
  5190. index = fromRight ? length : -1;
  5191. while ((fromRight ? index-- : ++index < length) &&
  5192. predicate(array[index], index, array)) {}
  5193. return isDrop
  5194. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5195. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5196. }
  5197. /**
  5198. * The base implementation of `wrapperValue` which returns the result of
  5199. * performing a sequence of actions on the unwrapped `value`, where each
  5200. * successive action is supplied the return value of the previous.
  5201. *
  5202. * @private
  5203. * @param {*} value The unwrapped value.
  5204. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5205. * @returns {*} Returns the resolved value.
  5206. */
  5207. function baseWrapperValue(value, actions) {
  5208. var result = value;
  5209. if (result instanceof LazyWrapper) {
  5210. result = result.value();
  5211. }
  5212. return arrayReduce(actions, function(result, action) {
  5213. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5214. }, result);
  5215. }
  5216. /**
  5217. * The base implementation of methods like `_.xor`, without support for
  5218. * iteratee shorthands, that accepts an array of arrays to inspect.
  5219. *
  5220. * @private
  5221. * @param {Array} arrays The arrays to inspect.
  5222. * @param {Function} [iteratee] The iteratee invoked per element.
  5223. * @param {Function} [comparator] The comparator invoked per element.
  5224. * @returns {Array} Returns the new array of values.
  5225. */
  5226. function baseXor(arrays, iteratee, comparator) {
  5227. var length = arrays.length;
  5228. if (length < 2) {
  5229. return length ? baseUniq(arrays[0]) : [];
  5230. }
  5231. var index = -1,
  5232. result = Array(length);
  5233. while (++index < length) {
  5234. var array = arrays[index],
  5235. othIndex = -1;
  5236. while (++othIndex < length) {
  5237. if (othIndex != index) {
  5238. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5239. }
  5240. }
  5241. }
  5242. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5243. }
  5244. /**
  5245. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5246. *
  5247. * @private
  5248. * @param {Array} props The property identifiers.
  5249. * @param {Array} values The property values.
  5250. * @param {Function} assignFunc The function to assign values.
  5251. * @returns {Object} Returns the new object.
  5252. */
  5253. function baseZipObject(props, values, assignFunc) {
  5254. var index = -1,
  5255. length = props.length,
  5256. valsLength = values.length,
  5257. result = {};
  5258. while (++index < length) {
  5259. var value = index < valsLength ? values[index] : undefined;
  5260. assignFunc(result, props[index], value);
  5261. }
  5262. return result;
  5263. }
  5264. /**
  5265. * Casts `value` to an empty array if it's not an array like object.
  5266. *
  5267. * @private
  5268. * @param {*} value The value to inspect.
  5269. * @returns {Array|Object} Returns the cast array-like object.
  5270. */
  5271. function castArrayLikeObject(value) {
  5272. return isArrayLikeObject(value) ? value : [];
  5273. }
  5274. /**
  5275. * Casts `value` to `identity` if it's not a function.
  5276. *
  5277. * @private
  5278. * @param {*} value The value to inspect.
  5279. * @returns {Function} Returns cast function.
  5280. */
  5281. function castFunction(value) {
  5282. return typeof value == 'function' ? value : identity;
  5283. }
  5284. /**
  5285. * Casts `value` to a path array if it's not one.
  5286. *
  5287. * @private
  5288. * @param {*} value The value to inspect.
  5289. * @param {Object} [object] The object to query keys on.
  5290. * @returns {Array} Returns the cast property path array.
  5291. */
  5292. function castPath(value, object) {
  5293. if (isArray(value)) {
  5294. return value;
  5295. }
  5296. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5297. }
  5298. /**
  5299. * A `baseRest` alias which can be replaced with `identity` by module
  5300. * replacement plugins.
  5301. *
  5302. * @private
  5303. * @type {Function}
  5304. * @param {Function} func The function to apply a rest parameter to.
  5305. * @returns {Function} Returns the new function.
  5306. */
  5307. var castRest = baseRest;
  5308. /**
  5309. * Casts `array` to a slice if it's needed.
  5310. *
  5311. * @private
  5312. * @param {Array} array The array to inspect.
  5313. * @param {number} start The start position.
  5314. * @param {number} [end=array.length] The end position.
  5315. * @returns {Array} Returns the cast slice.
  5316. */
  5317. function castSlice(array, start, end) {
  5318. var length = array.length;
  5319. end = end === undefined ? length : end;
  5320. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5321. }
  5322. /**
  5323. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5324. *
  5325. * @private
  5326. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5327. */
  5328. var clearTimeout = ctxClearTimeout || function(id) {
  5329. return root.clearTimeout(id);
  5330. };
  5331. /**
  5332. * Creates a clone of `buffer`.
  5333. *
  5334. * @private
  5335. * @param {Buffer} buffer The buffer to clone.
  5336. * @param {boolean} [isDeep] Specify a deep clone.
  5337. * @returns {Buffer} Returns the cloned buffer.
  5338. */
  5339. function cloneBuffer(buffer, isDeep) {
  5340. if (isDeep) {
  5341. return buffer.slice();
  5342. }
  5343. var length = buffer.length,
  5344. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5345. buffer.copy(result);
  5346. return result;
  5347. }
  5348. /**
  5349. * Creates a clone of `arrayBuffer`.
  5350. *
  5351. * @private
  5352. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5353. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5354. */
  5355. function cloneArrayBuffer(arrayBuffer) {
  5356. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5357. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5358. return result;
  5359. }
  5360. /**
  5361. * Creates a clone of `dataView`.
  5362. *
  5363. * @private
  5364. * @param {Object} dataView The data view to clone.
  5365. * @param {boolean} [isDeep] Specify a deep clone.
  5366. * @returns {Object} Returns the cloned data view.
  5367. */
  5368. function cloneDataView(dataView, isDeep) {
  5369. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5370. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5371. }
  5372. /**
  5373. * Creates a clone of `regexp`.
  5374. *
  5375. * @private
  5376. * @param {Object} regexp The regexp to clone.
  5377. * @returns {Object} Returns the cloned regexp.
  5378. */
  5379. function cloneRegExp(regexp) {
  5380. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5381. result.lastIndex = regexp.lastIndex;
  5382. return result;
  5383. }
  5384. /**
  5385. * Creates a clone of the `symbol` object.
  5386. *
  5387. * @private
  5388. * @param {Object} symbol The symbol object to clone.
  5389. * @returns {Object} Returns the cloned symbol object.
  5390. */
  5391. function cloneSymbol(symbol) {
  5392. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5393. }
  5394. /**
  5395. * Creates a clone of `typedArray`.
  5396. *
  5397. * @private
  5398. * @param {Object} typedArray The typed array to clone.
  5399. * @param {boolean} [isDeep] Specify a deep clone.
  5400. * @returns {Object} Returns the cloned typed array.
  5401. */
  5402. function cloneTypedArray(typedArray, isDeep) {
  5403. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5404. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5405. }
  5406. /**
  5407. * Compares values to sort them in ascending order.
  5408. *
  5409. * @private
  5410. * @param {*} value The value to compare.
  5411. * @param {*} other The other value to compare.
  5412. * @returns {number} Returns the sort order indicator for `value`.
  5413. */
  5414. function compareAscending(value, other) {
  5415. if (value !== other) {
  5416. var valIsDefined = value !== undefined,
  5417. valIsNull = value === null,
  5418. valIsReflexive = value === value,
  5419. valIsSymbol = isSymbol(value);
  5420. var othIsDefined = other !== undefined,
  5421. othIsNull = other === null,
  5422. othIsReflexive = other === other,
  5423. othIsSymbol = isSymbol(other);
  5424. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5425. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5426. (valIsNull && othIsDefined && othIsReflexive) ||
  5427. (!valIsDefined && othIsReflexive) ||
  5428. !valIsReflexive) {
  5429. return 1;
  5430. }
  5431. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5432. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5433. (othIsNull && valIsDefined && valIsReflexive) ||
  5434. (!othIsDefined && valIsReflexive) ||
  5435. !othIsReflexive) {
  5436. return -1;
  5437. }
  5438. }
  5439. return 0;
  5440. }
  5441. /**
  5442. * Used by `_.orderBy` to compare multiple properties of a value to another
  5443. * and stable sort them.
  5444. *
  5445. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5446. * specify an order of "desc" for descending or "asc" for ascending sort order
  5447. * of corresponding values.
  5448. *
  5449. * @private
  5450. * @param {Object} object The object to compare.
  5451. * @param {Object} other The other object to compare.
  5452. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5453. * @returns {number} Returns the sort order indicator for `object`.
  5454. */
  5455. function compareMultiple(object, other, orders) {
  5456. var index = -1,
  5457. objCriteria = object.criteria,
  5458. othCriteria = other.criteria,
  5459. length = objCriteria.length,
  5460. ordersLength = orders.length;
  5461. while (++index < length) {
  5462. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5463. if (result) {
  5464. if (index >= ordersLength) {
  5465. return result;
  5466. }
  5467. var order = orders[index];
  5468. return result * (order == 'desc' ? -1 : 1);
  5469. }
  5470. }
  5471. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5472. // that causes it, under certain circumstances, to provide the same value for
  5473. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5474. // for more details.
  5475. //
  5476. // This also ensures a stable sort in V8 and other engines.
  5477. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5478. return object.index - other.index;
  5479. }
  5480. /**
  5481. * Creates an array that is the composition of partially applied arguments,
  5482. * placeholders, and provided arguments into a single array of arguments.
  5483. *
  5484. * @private
  5485. * @param {Array} args The provided arguments.
  5486. * @param {Array} partials The arguments to prepend to those provided.
  5487. * @param {Array} holders The `partials` placeholder indexes.
  5488. * @params {boolean} [isCurried] Specify composing for a curried function.
  5489. * @returns {Array} Returns the new array of composed arguments.
  5490. */
  5491. function composeArgs(args, partials, holders, isCurried) {
  5492. var argsIndex = -1,
  5493. argsLength = args.length,
  5494. holdersLength = holders.length,
  5495. leftIndex = -1,
  5496. leftLength = partials.length,
  5497. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5498. result = Array(leftLength + rangeLength),
  5499. isUncurried = !isCurried;
  5500. while (++leftIndex < leftLength) {
  5501. result[leftIndex] = partials[leftIndex];
  5502. }
  5503. while (++argsIndex < holdersLength) {
  5504. if (isUncurried || argsIndex < argsLength) {
  5505. result[holders[argsIndex]] = args[argsIndex];
  5506. }
  5507. }
  5508. while (rangeLength--) {
  5509. result[leftIndex++] = args[argsIndex++];
  5510. }
  5511. return result;
  5512. }
  5513. /**
  5514. * This function is like `composeArgs` except that the arguments composition
  5515. * is tailored for `_.partialRight`.
  5516. *
  5517. * @private
  5518. * @param {Array} args The provided arguments.
  5519. * @param {Array} partials The arguments to append to those provided.
  5520. * @param {Array} holders The `partials` placeholder indexes.
  5521. * @params {boolean} [isCurried] Specify composing for a curried function.
  5522. * @returns {Array} Returns the new array of composed arguments.
  5523. */
  5524. function composeArgsRight(args, partials, holders, isCurried) {
  5525. var argsIndex = -1,
  5526. argsLength = args.length,
  5527. holdersIndex = -1,
  5528. holdersLength = holders.length,
  5529. rightIndex = -1,
  5530. rightLength = partials.length,
  5531. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5532. result = Array(rangeLength + rightLength),
  5533. isUncurried = !isCurried;
  5534. while (++argsIndex < rangeLength) {
  5535. result[argsIndex] = args[argsIndex];
  5536. }
  5537. var offset = argsIndex;
  5538. while (++rightIndex < rightLength) {
  5539. result[offset + rightIndex] = partials[rightIndex];
  5540. }
  5541. while (++holdersIndex < holdersLength) {
  5542. if (isUncurried || argsIndex < argsLength) {
  5543. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5544. }
  5545. }
  5546. return result;
  5547. }
  5548. /**
  5549. * Copies the values of `source` to `array`.
  5550. *
  5551. * @private
  5552. * @param {Array} source The array to copy values from.
  5553. * @param {Array} [array=[]] The array to copy values to.
  5554. * @returns {Array} Returns `array`.
  5555. */
  5556. function copyArray(source, array) {
  5557. var index = -1,
  5558. length = source.length;
  5559. array || (array = Array(length));
  5560. while (++index < length) {
  5561. array[index] = source[index];
  5562. }
  5563. return array;
  5564. }
  5565. /**
  5566. * Copies properties of `source` to `object`.
  5567. *
  5568. * @private
  5569. * @param {Object} source The object to copy properties from.
  5570. * @param {Array} props The property identifiers to copy.
  5571. * @param {Object} [object={}] The object to copy properties to.
  5572. * @param {Function} [customizer] The function to customize copied values.
  5573. * @returns {Object} Returns `object`.
  5574. */
  5575. function copyObject(source, props, object, customizer) {
  5576. var isNew = !object;
  5577. object || (object = {});
  5578. var index = -1,
  5579. length = props.length;
  5580. while (++index < length) {
  5581. var key = props[index];
  5582. var newValue = customizer
  5583. ? customizer(object[key], source[key], key, object, source)
  5584. : undefined;
  5585. if (newValue === undefined) {
  5586. newValue = source[key];
  5587. }
  5588. if (isNew) {
  5589. baseAssignValue(object, key, newValue);
  5590. } else {
  5591. assignValue(object, key, newValue);
  5592. }
  5593. }
  5594. return object;
  5595. }
  5596. /**
  5597. * Copies own symbols of `source` to `object`.
  5598. *
  5599. * @private
  5600. * @param {Object} source The object to copy symbols from.
  5601. * @param {Object} [object={}] The object to copy symbols to.
  5602. * @returns {Object} Returns `object`.
  5603. */
  5604. function copySymbols(source, object) {
  5605. return copyObject(source, getSymbols(source), object);
  5606. }
  5607. /**
  5608. * Copies own and inherited symbols of `source` to `object`.
  5609. *
  5610. * @private
  5611. * @param {Object} source The object to copy symbols from.
  5612. * @param {Object} [object={}] The object to copy symbols to.
  5613. * @returns {Object} Returns `object`.
  5614. */
  5615. function copySymbolsIn(source, object) {
  5616. return copyObject(source, getSymbolsIn(source), object);
  5617. }
  5618. /**
  5619. * Creates a function like `_.groupBy`.
  5620. *
  5621. * @private
  5622. * @param {Function} setter The function to set accumulator values.
  5623. * @param {Function} [initializer] The accumulator object initializer.
  5624. * @returns {Function} Returns the new aggregator function.
  5625. */
  5626. function createAggregator(setter, initializer) {
  5627. return function(collection, iteratee) {
  5628. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5629. accumulator = initializer ? initializer() : {};
  5630. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5631. };
  5632. }
  5633. /**
  5634. * Creates a function like `_.assign`.
  5635. *
  5636. * @private
  5637. * @param {Function} assigner The function to assign values.
  5638. * @returns {Function} Returns the new assigner function.
  5639. */
  5640. function createAssigner(assigner) {
  5641. return baseRest(function(object, sources) {
  5642. var index = -1,
  5643. length = sources.length,
  5644. customizer = length > 1 ? sources[length - 1] : undefined,
  5645. guard = length > 2 ? sources[2] : undefined;
  5646. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5647. ? (length--, customizer)
  5648. : undefined;
  5649. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5650. customizer = length < 3 ? undefined : customizer;
  5651. length = 1;
  5652. }
  5653. object = Object(object);
  5654. while (++index < length) {
  5655. var source = sources[index];
  5656. if (source) {
  5657. assigner(object, source, index, customizer);
  5658. }
  5659. }
  5660. return object;
  5661. });
  5662. }
  5663. /**
  5664. * Creates a `baseEach` or `baseEachRight` function.
  5665. *
  5666. * @private
  5667. * @param {Function} eachFunc The function to iterate over a collection.
  5668. * @param {boolean} [fromRight] Specify iterating from right to left.
  5669. * @returns {Function} Returns the new base function.
  5670. */
  5671. function createBaseEach(eachFunc, fromRight) {
  5672. return function(collection, iteratee) {
  5673. if (collection == null) {
  5674. return collection;
  5675. }
  5676. if (!isArrayLike(collection)) {
  5677. return eachFunc(collection, iteratee);
  5678. }
  5679. var length = collection.length,
  5680. index = fromRight ? length : -1,
  5681. iterable = Object(collection);
  5682. while ((fromRight ? index-- : ++index < length)) {
  5683. if (iteratee(iterable[index], index, iterable) === false) {
  5684. break;
  5685. }
  5686. }
  5687. return collection;
  5688. };
  5689. }
  5690. /**
  5691. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5692. *
  5693. * @private
  5694. * @param {boolean} [fromRight] Specify iterating from right to left.
  5695. * @returns {Function} Returns the new base function.
  5696. */
  5697. function createBaseFor(fromRight) {
  5698. return function(object, iteratee, keysFunc) {
  5699. var index = -1,
  5700. iterable = Object(object),
  5701. props = keysFunc(object),
  5702. length = props.length;
  5703. while (length--) {
  5704. var key = props[fromRight ? length : ++index];
  5705. if (iteratee(iterable[key], key, iterable) === false) {
  5706. break;
  5707. }
  5708. }
  5709. return object;
  5710. };
  5711. }
  5712. /**
  5713. * Creates a function that wraps `func` to invoke it with the optional `this`
  5714. * binding of `thisArg`.
  5715. *
  5716. * @private
  5717. * @param {Function} func The function to wrap.
  5718. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5719. * @param {*} [thisArg] The `this` binding of `func`.
  5720. * @returns {Function} Returns the new wrapped function.
  5721. */
  5722. function createBind(func, bitmask, thisArg) {
  5723. var isBind = bitmask & WRAP_BIND_FLAG,
  5724. Ctor = createCtor(func);
  5725. function wrapper() {
  5726. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5727. return fn.apply(isBind ? thisArg : this, arguments);
  5728. }
  5729. return wrapper;
  5730. }
  5731. /**
  5732. * Creates a function like `_.lowerFirst`.
  5733. *
  5734. * @private
  5735. * @param {string} methodName The name of the `String` case method to use.
  5736. * @returns {Function} Returns the new case function.
  5737. */
  5738. function createCaseFirst(methodName) {
  5739. return function(string) {
  5740. string = toString(string);
  5741. var strSymbols = hasUnicode(string)
  5742. ? stringToArray(string)
  5743. : undefined;
  5744. var chr = strSymbols
  5745. ? strSymbols[0]
  5746. : string.charAt(0);
  5747. var trailing = strSymbols
  5748. ? castSlice(strSymbols, 1).join('')
  5749. : string.slice(1);
  5750. return chr[methodName]() + trailing;
  5751. };
  5752. }
  5753. /**
  5754. * Creates a function like `_.camelCase`.
  5755. *
  5756. * @private
  5757. * @param {Function} callback The function to combine each word.
  5758. * @returns {Function} Returns the new compounder function.
  5759. */
  5760. function createCompounder(callback) {
  5761. return function(string) {
  5762. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5763. };
  5764. }
  5765. /**
  5766. * Creates a function that produces an instance of `Ctor` regardless of
  5767. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5768. *
  5769. * @private
  5770. * @param {Function} Ctor The constructor to wrap.
  5771. * @returns {Function} Returns the new wrapped function.
  5772. */
  5773. function createCtor(Ctor) {
  5774. return function() {
  5775. // Use a `switch` statement to work with class constructors. See
  5776. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5777. // for more details.
  5778. var args = arguments;
  5779. switch (args.length) {
  5780. case 0: return new Ctor;
  5781. case 1: return new Ctor(args[0]);
  5782. case 2: return new Ctor(args[0], args[1]);
  5783. case 3: return new Ctor(args[0], args[1], args[2]);
  5784. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5785. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5786. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5787. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5788. }
  5789. var thisBinding = baseCreate(Ctor.prototype),
  5790. result = Ctor.apply(thisBinding, args);
  5791. // Mimic the constructor's `return` behavior.
  5792. // See https://es5.github.io/#x13.2.2 for more details.
  5793. return isObject(result) ? result : thisBinding;
  5794. };
  5795. }
  5796. /**
  5797. * Creates a function that wraps `func` to enable currying.
  5798. *
  5799. * @private
  5800. * @param {Function} func The function to wrap.
  5801. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5802. * @param {number} arity The arity of `func`.
  5803. * @returns {Function} Returns the new wrapped function.
  5804. */
  5805. function createCurry(func, bitmask, arity) {
  5806. var Ctor = createCtor(func);
  5807. function wrapper() {
  5808. var length = arguments.length,
  5809. args = Array(length),
  5810. index = length,
  5811. placeholder = getHolder(wrapper);
  5812. while (index--) {
  5813. args[index] = arguments[index];
  5814. }
  5815. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5816. ? []
  5817. : replaceHolders(args, placeholder);
  5818. length -= holders.length;
  5819. if (length < arity) {
  5820. return createRecurry(
  5821. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5822. args, holders, undefined, undefined, arity - length);
  5823. }
  5824. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5825. return apply(fn, this, args);
  5826. }
  5827. return wrapper;
  5828. }
  5829. /**
  5830. * Creates a `_.find` or `_.findLast` function.
  5831. *
  5832. * @private
  5833. * @param {Function} findIndexFunc The function to find the collection index.
  5834. * @returns {Function} Returns the new find function.
  5835. */
  5836. function createFind(findIndexFunc) {
  5837. return function(collection, predicate, fromIndex) {
  5838. var iterable = Object(collection);
  5839. if (!isArrayLike(collection)) {
  5840. var iteratee = getIteratee(predicate, 3);
  5841. collection = keys(collection);
  5842. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5843. }
  5844. var index = findIndexFunc(collection, predicate, fromIndex);
  5845. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5846. };
  5847. }
  5848. /**
  5849. * Creates a `_.flow` or `_.flowRight` function.
  5850. *
  5851. * @private
  5852. * @param {boolean} [fromRight] Specify iterating from right to left.
  5853. * @returns {Function} Returns the new flow function.
  5854. */
  5855. function createFlow(fromRight) {
  5856. return flatRest(function(funcs) {
  5857. var length = funcs.length,
  5858. index = length,
  5859. prereq = LodashWrapper.prototype.thru;
  5860. if (fromRight) {
  5861. funcs.reverse();
  5862. }
  5863. while (index--) {
  5864. var func = funcs[index];
  5865. if (typeof func != 'function') {
  5866. throw new TypeError(FUNC_ERROR_TEXT);
  5867. }
  5868. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5869. var wrapper = new LodashWrapper([], true);
  5870. }
  5871. }
  5872. index = wrapper ? index : length;
  5873. while (++index < length) {
  5874. func = funcs[index];
  5875. var funcName = getFuncName(func),
  5876. data = funcName == 'wrapper' ? getData(func) : undefined;
  5877. if (data && isLaziable(data[0]) &&
  5878. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5879. !data[4].length && data[9] == 1
  5880. ) {
  5881. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5882. } else {
  5883. wrapper = (func.length == 1 && isLaziable(func))
  5884. ? wrapper[funcName]()
  5885. : wrapper.thru(func);
  5886. }
  5887. }
  5888. return function() {
  5889. var args = arguments,
  5890. value = args[0];
  5891. if (wrapper && args.length == 1 && isArray(value)) {
  5892. return wrapper.plant(value).value();
  5893. }
  5894. var index = 0,
  5895. result = length ? funcs[index].apply(this, args) : value;
  5896. while (++index < length) {
  5897. result = funcs[index].call(this, result);
  5898. }
  5899. return result;
  5900. };
  5901. });
  5902. }
  5903. /**
  5904. * Creates a function that wraps `func` to invoke it with optional `this`
  5905. * binding of `thisArg`, partial application, and currying.
  5906. *
  5907. * @private
  5908. * @param {Function|string} func The function or method name to wrap.
  5909. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5910. * @param {*} [thisArg] The `this` binding of `func`.
  5911. * @param {Array} [partials] The arguments to prepend to those provided to
  5912. * the new function.
  5913. * @param {Array} [holders] The `partials` placeholder indexes.
  5914. * @param {Array} [partialsRight] The arguments to append to those provided
  5915. * to the new function.
  5916. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5917. * @param {Array} [argPos] The argument positions of the new function.
  5918. * @param {number} [ary] The arity cap of `func`.
  5919. * @param {number} [arity] The arity of `func`.
  5920. * @returns {Function} Returns the new wrapped function.
  5921. */
  5922. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5923. var isAry = bitmask & WRAP_ARY_FLAG,
  5924. isBind = bitmask & WRAP_BIND_FLAG,
  5925. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5926. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5927. isFlip = bitmask & WRAP_FLIP_FLAG,
  5928. Ctor = isBindKey ? undefined : createCtor(func);
  5929. function wrapper() {
  5930. var length = arguments.length,
  5931. args = Array(length),
  5932. index = length;
  5933. while (index--) {
  5934. args[index] = arguments[index];
  5935. }
  5936. if (isCurried) {
  5937. var placeholder = getHolder(wrapper),
  5938. holdersCount = countHolders(args, placeholder);
  5939. }
  5940. if (partials) {
  5941. args = composeArgs(args, partials, holders, isCurried);
  5942. }
  5943. if (partialsRight) {
  5944. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5945. }
  5946. length -= holdersCount;
  5947. if (isCurried && length < arity) {
  5948. var newHolders = replaceHolders(args, placeholder);
  5949. return createRecurry(
  5950. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5951. args, newHolders, argPos, ary, arity - length
  5952. );
  5953. }
  5954. var thisBinding = isBind ? thisArg : this,
  5955. fn = isBindKey ? thisBinding[func] : func;
  5956. length = args.length;
  5957. if (argPos) {
  5958. args = reorder(args, argPos);
  5959. } else if (isFlip && length > 1) {
  5960. args.reverse();
  5961. }
  5962. if (isAry && ary < length) {
  5963. args.length = ary;
  5964. }
  5965. if (this && this !== root && this instanceof wrapper) {
  5966. fn = Ctor || createCtor(fn);
  5967. }
  5968. return fn.apply(thisBinding, args);
  5969. }
  5970. return wrapper;
  5971. }
  5972. /**
  5973. * Creates a function like `_.invertBy`.
  5974. *
  5975. * @private
  5976. * @param {Function} setter The function to set accumulator values.
  5977. * @param {Function} toIteratee The function to resolve iteratees.
  5978. * @returns {Function} Returns the new inverter function.
  5979. */
  5980. function createInverter(setter, toIteratee) {
  5981. return function(object, iteratee) {
  5982. return baseInverter(object, setter, toIteratee(iteratee), {});
  5983. };
  5984. }
  5985. /**
  5986. * Creates a function that performs a mathematical operation on two values.
  5987. *
  5988. * @private
  5989. * @param {Function} operator The function to perform the operation.
  5990. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5991. * @returns {Function} Returns the new mathematical operation function.
  5992. */
  5993. function createMathOperation(operator, defaultValue) {
  5994. return function(value, other) {
  5995. var result;
  5996. if (value === undefined && other === undefined) {
  5997. return defaultValue;
  5998. }
  5999. if (value !== undefined) {
  6000. result = value;
  6001. }
  6002. if (other !== undefined) {
  6003. if (result === undefined) {
  6004. return other;
  6005. }
  6006. if (typeof value == 'string' || typeof other == 'string') {
  6007. value = baseToString(value);
  6008. other = baseToString(other);
  6009. } else {
  6010. value = baseToNumber(value);
  6011. other = baseToNumber(other);
  6012. }
  6013. result = operator(value, other);
  6014. }
  6015. return result;
  6016. };
  6017. }
  6018. /**
  6019. * Creates a function like `_.over`.
  6020. *
  6021. * @private
  6022. * @param {Function} arrayFunc The function to iterate over iteratees.
  6023. * @returns {Function} Returns the new over function.
  6024. */
  6025. function createOver(arrayFunc) {
  6026. return flatRest(function(iteratees) {
  6027. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6028. return baseRest(function(args) {
  6029. var thisArg = this;
  6030. return arrayFunc(iteratees, function(iteratee) {
  6031. return apply(iteratee, thisArg, args);
  6032. });
  6033. });
  6034. });
  6035. }
  6036. /**
  6037. * Creates the padding for `string` based on `length`. The `chars` string
  6038. * is truncated if the number of characters exceeds `length`.
  6039. *
  6040. * @private
  6041. * @param {number} length The padding length.
  6042. * @param {string} [chars=' '] The string used as padding.
  6043. * @returns {string} Returns the padding for `string`.
  6044. */
  6045. function createPadding(length, chars) {
  6046. chars = chars === undefined ? ' ' : baseToString(chars);
  6047. var charsLength = chars.length;
  6048. if (charsLength < 2) {
  6049. return charsLength ? baseRepeat(chars, length) : chars;
  6050. }
  6051. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6052. return hasUnicode(chars)
  6053. ? castSlice(stringToArray(result), 0, length).join('')
  6054. : result.slice(0, length);
  6055. }
  6056. /**
  6057. * Creates a function that wraps `func` to invoke it with the `this` binding
  6058. * of `thisArg` and `partials` prepended to the arguments it receives.
  6059. *
  6060. * @private
  6061. * @param {Function} func The function to wrap.
  6062. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6063. * @param {*} thisArg The `this` binding of `func`.
  6064. * @param {Array} partials The arguments to prepend to those provided to
  6065. * the new function.
  6066. * @returns {Function} Returns the new wrapped function.
  6067. */
  6068. function createPartial(func, bitmask, thisArg, partials) {
  6069. var isBind = bitmask & WRAP_BIND_FLAG,
  6070. Ctor = createCtor(func);
  6071. function wrapper() {
  6072. var argsIndex = -1,
  6073. argsLength = arguments.length,
  6074. leftIndex = -1,
  6075. leftLength = partials.length,
  6076. args = Array(leftLength + argsLength),
  6077. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6078. while (++leftIndex < leftLength) {
  6079. args[leftIndex] = partials[leftIndex];
  6080. }
  6081. while (argsLength--) {
  6082. args[leftIndex++] = arguments[++argsIndex];
  6083. }
  6084. return apply(fn, isBind ? thisArg : this, args);
  6085. }
  6086. return wrapper;
  6087. }
  6088. /**
  6089. * Creates a `_.range` or `_.rangeRight` function.
  6090. *
  6091. * @private
  6092. * @param {boolean} [fromRight] Specify iterating from right to left.
  6093. * @returns {Function} Returns the new range function.
  6094. */
  6095. function createRange(fromRight) {
  6096. return function(start, end, step) {
  6097. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6098. end = step = undefined;
  6099. }
  6100. // Ensure the sign of `-0` is preserved.
  6101. start = toFinite(start);
  6102. if (end === undefined) {
  6103. end = start;
  6104. start = 0;
  6105. } else {
  6106. end = toFinite(end);
  6107. }
  6108. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6109. return baseRange(start, end, step, fromRight);
  6110. };
  6111. }
  6112. /**
  6113. * Creates a function that performs a relational operation on two values.
  6114. *
  6115. * @private
  6116. * @param {Function} operator The function to perform the operation.
  6117. * @returns {Function} Returns the new relational operation function.
  6118. */
  6119. function createRelationalOperation(operator) {
  6120. return function(value, other) {
  6121. if (!(typeof value == 'string' && typeof other == 'string')) {
  6122. value = toNumber(value);
  6123. other = toNumber(other);
  6124. }
  6125. return operator(value, other);
  6126. };
  6127. }
  6128. /**
  6129. * Creates a function that wraps `func` to continue currying.
  6130. *
  6131. * @private
  6132. * @param {Function} func The function to wrap.
  6133. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6134. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6135. * @param {*} placeholder The placeholder value.
  6136. * @param {*} [thisArg] The `this` binding of `func`.
  6137. * @param {Array} [partials] The arguments to prepend to those provided to
  6138. * the new function.
  6139. * @param {Array} [holders] The `partials` placeholder indexes.
  6140. * @param {Array} [argPos] The argument positions of the new function.
  6141. * @param {number} [ary] The arity cap of `func`.
  6142. * @param {number} [arity] The arity of `func`.
  6143. * @returns {Function} Returns the new wrapped function.
  6144. */
  6145. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6146. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6147. newHolders = isCurry ? holders : undefined,
  6148. newHoldersRight = isCurry ? undefined : holders,
  6149. newPartials = isCurry ? partials : undefined,
  6150. newPartialsRight = isCurry ? undefined : partials;
  6151. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6152. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6153. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6154. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6155. }
  6156. var newData = [
  6157. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6158. newHoldersRight, argPos, ary, arity
  6159. ];
  6160. var result = wrapFunc.apply(undefined, newData);
  6161. if (isLaziable(func)) {
  6162. setData(result, newData);
  6163. }
  6164. result.placeholder = placeholder;
  6165. return setWrapToString(result, func, bitmask);
  6166. }
  6167. /**
  6168. * Creates a function like `_.round`.
  6169. *
  6170. * @private
  6171. * @param {string} methodName The name of the `Math` method to use when rounding.
  6172. * @returns {Function} Returns the new round function.
  6173. */
  6174. function createRound(methodName) {
  6175. var func = Math[methodName];
  6176. return function(number, precision) {
  6177. number = toNumber(number);
  6178. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6179. if (precision && nativeIsFinite(number)) {
  6180. // Shift with exponential notation to avoid floating-point issues.
  6181. // See [MDN](https://mdn.io/round#Examples) for more details.
  6182. var pair = (toString(number) + 'e').split('e'),
  6183. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6184. pair = (toString(value) + 'e').split('e');
  6185. return +(pair[0] + 'e' + (+pair[1] - precision));
  6186. }
  6187. return func(number);
  6188. };
  6189. }
  6190. /**
  6191. * Creates a set object of `values`.
  6192. *
  6193. * @private
  6194. * @param {Array} values The values to add to the set.
  6195. * @returns {Object} Returns the new set.
  6196. */
  6197. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6198. return new Set(values);
  6199. };
  6200. /**
  6201. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6202. *
  6203. * @private
  6204. * @param {Function} keysFunc The function to get the keys of a given object.
  6205. * @returns {Function} Returns the new pairs function.
  6206. */
  6207. function createToPairs(keysFunc) {
  6208. return function(object) {
  6209. var tag = getTag(object);
  6210. if (tag == mapTag) {
  6211. return mapToArray(object);
  6212. }
  6213. if (tag == setTag) {
  6214. return setToPairs(object);
  6215. }
  6216. return baseToPairs(object, keysFunc(object));
  6217. };
  6218. }
  6219. /**
  6220. * Creates a function that either curries or invokes `func` with optional
  6221. * `this` binding and partially applied arguments.
  6222. *
  6223. * @private
  6224. * @param {Function|string} func The function or method name to wrap.
  6225. * @param {number} bitmask The bitmask flags.
  6226. * 1 - `_.bind`
  6227. * 2 - `_.bindKey`
  6228. * 4 - `_.curry` or `_.curryRight` of a bound function
  6229. * 8 - `_.curry`
  6230. * 16 - `_.curryRight`
  6231. * 32 - `_.partial`
  6232. * 64 - `_.partialRight`
  6233. * 128 - `_.rearg`
  6234. * 256 - `_.ary`
  6235. * 512 - `_.flip`
  6236. * @param {*} [thisArg] The `this` binding of `func`.
  6237. * @param {Array} [partials] The arguments to be partially applied.
  6238. * @param {Array} [holders] The `partials` placeholder indexes.
  6239. * @param {Array} [argPos] The argument positions of the new function.
  6240. * @param {number} [ary] The arity cap of `func`.
  6241. * @param {number} [arity] The arity of `func`.
  6242. * @returns {Function} Returns the new wrapped function.
  6243. */
  6244. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6245. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6246. if (!isBindKey && typeof func != 'function') {
  6247. throw new TypeError(FUNC_ERROR_TEXT);
  6248. }
  6249. var length = partials ? partials.length : 0;
  6250. if (!length) {
  6251. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6252. partials = holders = undefined;
  6253. }
  6254. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6255. arity = arity === undefined ? arity : toInteger(arity);
  6256. length -= holders ? holders.length : 0;
  6257. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6258. var partialsRight = partials,
  6259. holdersRight = holders;
  6260. partials = holders = undefined;
  6261. }
  6262. var data = isBindKey ? undefined : getData(func);
  6263. var newData = [
  6264. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6265. argPos, ary, arity
  6266. ];
  6267. if (data) {
  6268. mergeData(newData, data);
  6269. }
  6270. func = newData[0];
  6271. bitmask = newData[1];
  6272. thisArg = newData[2];
  6273. partials = newData[3];
  6274. holders = newData[4];
  6275. arity = newData[9] = newData[9] === undefined
  6276. ? (isBindKey ? 0 : func.length)
  6277. : nativeMax(newData[9] - length, 0);
  6278. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6279. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6280. }
  6281. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6282. var result = createBind(func, bitmask, thisArg);
  6283. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6284. result = createCurry(func, bitmask, arity);
  6285. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6286. result = createPartial(func, bitmask, thisArg, partials);
  6287. } else {
  6288. result = createHybrid.apply(undefined, newData);
  6289. }
  6290. var setter = data ? baseSetData : setData;
  6291. return setWrapToString(setter(result, newData), func, bitmask);
  6292. }
  6293. /**
  6294. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6295. * of source objects to the destination object for all destination properties
  6296. * that resolve to `undefined`.
  6297. *
  6298. * @private
  6299. * @param {*} objValue The destination value.
  6300. * @param {*} srcValue The source value.
  6301. * @param {string} key The key of the property to assign.
  6302. * @param {Object} object The parent object of `objValue`.
  6303. * @returns {*} Returns the value to assign.
  6304. */
  6305. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6306. if (objValue === undefined ||
  6307. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6308. return srcValue;
  6309. }
  6310. return objValue;
  6311. }
  6312. /**
  6313. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6314. * objects into destination objects that are passed thru.
  6315. *
  6316. * @private
  6317. * @param {*} objValue The destination value.
  6318. * @param {*} srcValue The source value.
  6319. * @param {string} key The key of the property to merge.
  6320. * @param {Object} object The parent object of `objValue`.
  6321. * @param {Object} source The parent object of `srcValue`.
  6322. * @param {Object} [stack] Tracks traversed source values and their merged
  6323. * counterparts.
  6324. * @returns {*} Returns the value to assign.
  6325. */
  6326. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6327. if (isObject(objValue) && isObject(srcValue)) {
  6328. // Recursively merge objects and arrays (susceptible to call stack limits).
  6329. stack.set(srcValue, objValue);
  6330. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6331. stack['delete'](srcValue);
  6332. }
  6333. return objValue;
  6334. }
  6335. /**
  6336. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6337. * objects.
  6338. *
  6339. * @private
  6340. * @param {*} value The value to inspect.
  6341. * @param {string} key The key of the property to inspect.
  6342. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6343. */
  6344. function customOmitClone(value) {
  6345. return isPlainObject(value) ? undefined : value;
  6346. }
  6347. /**
  6348. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6349. * partial deep comparisons.
  6350. *
  6351. * @private
  6352. * @param {Array} array The array to compare.
  6353. * @param {Array} other The other array to compare.
  6354. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6355. * @param {Function} customizer The function to customize comparisons.
  6356. * @param {Function} equalFunc The function to determine equivalents of values.
  6357. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6358. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6359. */
  6360. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6361. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6362. arrLength = array.length,
  6363. othLength = other.length;
  6364. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6365. return false;
  6366. }
  6367. // Check that cyclic values are equal.
  6368. var arrStacked = stack.get(array);
  6369. var othStacked = stack.get(other);
  6370. if (arrStacked && othStacked) {
  6371. return arrStacked == other && othStacked == array;
  6372. }
  6373. var index = -1,
  6374. result = true,
  6375. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6376. stack.set(array, other);
  6377. stack.set(other, array);
  6378. // Ignore non-index properties.
  6379. while (++index < arrLength) {
  6380. var arrValue = array[index],
  6381. othValue = other[index];
  6382. if (customizer) {
  6383. var compared = isPartial
  6384. ? customizer(othValue, arrValue, index, other, array, stack)
  6385. : customizer(arrValue, othValue, index, array, other, stack);
  6386. }
  6387. if (compared !== undefined) {
  6388. if (compared) {
  6389. continue;
  6390. }
  6391. result = false;
  6392. break;
  6393. }
  6394. // Recursively compare arrays (susceptible to call stack limits).
  6395. if (seen) {
  6396. if (!arraySome(other, function(othValue, othIndex) {
  6397. if (!cacheHas(seen, othIndex) &&
  6398. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6399. return seen.push(othIndex);
  6400. }
  6401. })) {
  6402. result = false;
  6403. break;
  6404. }
  6405. } else if (!(
  6406. arrValue === othValue ||
  6407. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6408. )) {
  6409. result = false;
  6410. break;
  6411. }
  6412. }
  6413. stack['delete'](array);
  6414. stack['delete'](other);
  6415. return result;
  6416. }
  6417. /**
  6418. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6419. * the same `toStringTag`.
  6420. *
  6421. * **Note:** This function only supports comparing values with tags of
  6422. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6423. *
  6424. * @private
  6425. * @param {Object} object The object to compare.
  6426. * @param {Object} other The other object to compare.
  6427. * @param {string} tag The `toStringTag` of the objects to compare.
  6428. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6429. * @param {Function} customizer The function to customize comparisons.
  6430. * @param {Function} equalFunc The function to determine equivalents of values.
  6431. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6432. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6433. */
  6434. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6435. switch (tag) {
  6436. case dataViewTag:
  6437. if ((object.byteLength != other.byteLength) ||
  6438. (object.byteOffset != other.byteOffset)) {
  6439. return false;
  6440. }
  6441. object = object.buffer;
  6442. other = other.buffer;
  6443. case arrayBufferTag:
  6444. if ((object.byteLength != other.byteLength) ||
  6445. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6446. return false;
  6447. }
  6448. return true;
  6449. case boolTag:
  6450. case dateTag:
  6451. case numberTag:
  6452. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6453. // Invalid dates are coerced to `NaN`.
  6454. return eq(+object, +other);
  6455. case errorTag:
  6456. return object.name == other.name && object.message == other.message;
  6457. case regexpTag:
  6458. case stringTag:
  6459. // Coerce regexes to strings and treat strings, primitives and objects,
  6460. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6461. // for more details.
  6462. return object == (other + '');
  6463. case mapTag:
  6464. var convert = mapToArray;
  6465. case setTag:
  6466. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6467. convert || (convert = setToArray);
  6468. if (object.size != other.size && !isPartial) {
  6469. return false;
  6470. }
  6471. // Assume cyclic values are equal.
  6472. var stacked = stack.get(object);
  6473. if (stacked) {
  6474. return stacked == other;
  6475. }
  6476. bitmask |= COMPARE_UNORDERED_FLAG;
  6477. // Recursively compare objects (susceptible to call stack limits).
  6478. stack.set(object, other);
  6479. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6480. stack['delete'](object);
  6481. return result;
  6482. case symbolTag:
  6483. if (symbolValueOf) {
  6484. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6485. }
  6486. }
  6487. return false;
  6488. }
  6489. /**
  6490. * A specialized version of `baseIsEqualDeep` for objects with support for
  6491. * partial deep comparisons.
  6492. *
  6493. * @private
  6494. * @param {Object} object The object to compare.
  6495. * @param {Object} other The other object to compare.
  6496. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6497. * @param {Function} customizer The function to customize comparisons.
  6498. * @param {Function} equalFunc The function to determine equivalents of values.
  6499. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6500. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6501. */
  6502. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6503. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6504. objProps = getAllKeys(object),
  6505. objLength = objProps.length,
  6506. othProps = getAllKeys(other),
  6507. othLength = othProps.length;
  6508. if (objLength != othLength && !isPartial) {
  6509. return false;
  6510. }
  6511. var index = objLength;
  6512. while (index--) {
  6513. var key = objProps[index];
  6514. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6515. return false;
  6516. }
  6517. }
  6518. // Check that cyclic values are equal.
  6519. var objStacked = stack.get(object);
  6520. var othStacked = stack.get(other);
  6521. if (objStacked && othStacked) {
  6522. return objStacked == other && othStacked == object;
  6523. }
  6524. var result = true;
  6525. stack.set(object, other);
  6526. stack.set(other, object);
  6527. var skipCtor = isPartial;
  6528. while (++index < objLength) {
  6529. key = objProps[index];
  6530. var objValue = object[key],
  6531. othValue = other[key];
  6532. if (customizer) {
  6533. var compared = isPartial
  6534. ? customizer(othValue, objValue, key, other, object, stack)
  6535. : customizer(objValue, othValue, key, object, other, stack);
  6536. }
  6537. // Recursively compare objects (susceptible to call stack limits).
  6538. if (!(compared === undefined
  6539. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6540. : compared
  6541. )) {
  6542. result = false;
  6543. break;
  6544. }
  6545. skipCtor || (skipCtor = key == 'constructor');
  6546. }
  6547. if (result && !skipCtor) {
  6548. var objCtor = object.constructor,
  6549. othCtor = other.constructor;
  6550. // Non `Object` object instances with different constructors are not equal.
  6551. if (objCtor != othCtor &&
  6552. ('constructor' in object && 'constructor' in other) &&
  6553. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6554. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6555. result = false;
  6556. }
  6557. }
  6558. stack['delete'](object);
  6559. stack['delete'](other);
  6560. return result;
  6561. }
  6562. /**
  6563. * A specialized version of `baseRest` which flattens the rest array.
  6564. *
  6565. * @private
  6566. * @param {Function} func The function to apply a rest parameter to.
  6567. * @returns {Function} Returns the new function.
  6568. */
  6569. function flatRest(func) {
  6570. return setToString(overRest(func, undefined, flatten), func + '');
  6571. }
  6572. /**
  6573. * Creates an array of own enumerable property names and symbols of `object`.
  6574. *
  6575. * @private
  6576. * @param {Object} object The object to query.
  6577. * @returns {Array} Returns the array of property names and symbols.
  6578. */
  6579. function getAllKeys(object) {
  6580. return baseGetAllKeys(object, keys, getSymbols);
  6581. }
  6582. /**
  6583. * Creates an array of own and inherited enumerable property names and
  6584. * symbols of `object`.
  6585. *
  6586. * @private
  6587. * @param {Object} object The object to query.
  6588. * @returns {Array} Returns the array of property names and symbols.
  6589. */
  6590. function getAllKeysIn(object) {
  6591. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6592. }
  6593. /**
  6594. * Gets metadata for `func`.
  6595. *
  6596. * @private
  6597. * @param {Function} func The function to query.
  6598. * @returns {*} Returns the metadata for `func`.
  6599. */
  6600. var getData = !metaMap ? noop : function(func) {
  6601. return metaMap.get(func);
  6602. };
  6603. /**
  6604. * Gets the name of `func`.
  6605. *
  6606. * @private
  6607. * @param {Function} func The function to query.
  6608. * @returns {string} Returns the function name.
  6609. */
  6610. function getFuncName(func) {
  6611. var result = (func.name + ''),
  6612. array = realNames[result],
  6613. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6614. while (length--) {
  6615. var data = array[length],
  6616. otherFunc = data.func;
  6617. if (otherFunc == null || otherFunc == func) {
  6618. return data.name;
  6619. }
  6620. }
  6621. return result;
  6622. }
  6623. /**
  6624. * Gets the argument placeholder value for `func`.
  6625. *
  6626. * @private
  6627. * @param {Function} func The function to inspect.
  6628. * @returns {*} Returns the placeholder value.
  6629. */
  6630. function getHolder(func) {
  6631. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6632. return object.placeholder;
  6633. }
  6634. /**
  6635. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6636. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6637. * If arguments are provided, the chosen function is invoked with them and
  6638. * its result is returned.
  6639. *
  6640. * @private
  6641. * @param {*} [value] The value to convert to an iteratee.
  6642. * @param {number} [arity] The arity of the created iteratee.
  6643. * @returns {Function} Returns the chosen function or its result.
  6644. */
  6645. function getIteratee() {
  6646. var result = lodash.iteratee || iteratee;
  6647. result = result === iteratee ? baseIteratee : result;
  6648. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6649. }
  6650. /**
  6651. * Gets the data for `map`.
  6652. *
  6653. * @private
  6654. * @param {Object} map The map to query.
  6655. * @param {string} key The reference key.
  6656. * @returns {*} Returns the map data.
  6657. */
  6658. function getMapData(map, key) {
  6659. var data = map.__data__;
  6660. return isKeyable(key)
  6661. ? data[typeof key == 'string' ? 'string' : 'hash']
  6662. : data.map;
  6663. }
  6664. /**
  6665. * Gets the property names, values, and compare flags of `object`.
  6666. *
  6667. * @private
  6668. * @param {Object} object The object to query.
  6669. * @returns {Array} Returns the match data of `object`.
  6670. */
  6671. function getMatchData(object) {
  6672. var result = keys(object),
  6673. length = result.length;
  6674. while (length--) {
  6675. var key = result[length],
  6676. value = object[key];
  6677. result[length] = [key, value, isStrictComparable(value)];
  6678. }
  6679. return result;
  6680. }
  6681. /**
  6682. * Gets the native function at `key` of `object`.
  6683. *
  6684. * @private
  6685. * @param {Object} object The object to query.
  6686. * @param {string} key The key of the method to get.
  6687. * @returns {*} Returns the function if it's native, else `undefined`.
  6688. */
  6689. function getNative(object, key) {
  6690. var value = getValue(object, key);
  6691. return baseIsNative(value) ? value : undefined;
  6692. }
  6693. /**
  6694. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6695. *
  6696. * @private
  6697. * @param {*} value The value to query.
  6698. * @returns {string} Returns the raw `toStringTag`.
  6699. */
  6700. function getRawTag(value) {
  6701. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6702. tag = value[symToStringTag];
  6703. try {
  6704. value[symToStringTag] = undefined;
  6705. var unmasked = true;
  6706. } catch (e) {}
  6707. var result = nativeObjectToString.call(value);
  6708. if (unmasked) {
  6709. if (isOwn) {
  6710. value[symToStringTag] = tag;
  6711. } else {
  6712. delete value[symToStringTag];
  6713. }
  6714. }
  6715. return result;
  6716. }
  6717. /**
  6718. * Creates an array of the own enumerable symbols of `object`.
  6719. *
  6720. * @private
  6721. * @param {Object} object The object to query.
  6722. * @returns {Array} Returns the array of symbols.
  6723. */
  6724. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6725. if (object == null) {
  6726. return [];
  6727. }
  6728. object = Object(object);
  6729. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6730. return propertyIsEnumerable.call(object, symbol);
  6731. });
  6732. };
  6733. /**
  6734. * Creates an array of the own and inherited enumerable symbols of `object`.
  6735. *
  6736. * @private
  6737. * @param {Object} object The object to query.
  6738. * @returns {Array} Returns the array of symbols.
  6739. */
  6740. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6741. var result = [];
  6742. while (object) {
  6743. arrayPush(result, getSymbols(object));
  6744. object = getPrototype(object);
  6745. }
  6746. return result;
  6747. };
  6748. /**
  6749. * Gets the `toStringTag` of `value`.
  6750. *
  6751. * @private
  6752. * @param {*} value The value to query.
  6753. * @returns {string} Returns the `toStringTag`.
  6754. */
  6755. var getTag = baseGetTag;
  6756. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6757. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6758. (Map && getTag(new Map) != mapTag) ||
  6759. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6760. (Set && getTag(new Set) != setTag) ||
  6761. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6762. getTag = function(value) {
  6763. var result = baseGetTag(value),
  6764. Ctor = result == objectTag ? value.constructor : undefined,
  6765. ctorString = Ctor ? toSource(Ctor) : '';
  6766. if (ctorString) {
  6767. switch (ctorString) {
  6768. case dataViewCtorString: return dataViewTag;
  6769. case mapCtorString: return mapTag;
  6770. case promiseCtorString: return promiseTag;
  6771. case setCtorString: return setTag;
  6772. case weakMapCtorString: return weakMapTag;
  6773. }
  6774. }
  6775. return result;
  6776. };
  6777. }
  6778. /**
  6779. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6780. *
  6781. * @private
  6782. * @param {number} start The start of the view.
  6783. * @param {number} end The end of the view.
  6784. * @param {Array} transforms The transformations to apply to the view.
  6785. * @returns {Object} Returns an object containing the `start` and `end`
  6786. * positions of the view.
  6787. */
  6788. function getView(start, end, transforms) {
  6789. var index = -1,
  6790. length = transforms.length;
  6791. while (++index < length) {
  6792. var data = transforms[index],
  6793. size = data.size;
  6794. switch (data.type) {
  6795. case 'drop': start += size; break;
  6796. case 'dropRight': end -= size; break;
  6797. case 'take': end = nativeMin(end, start + size); break;
  6798. case 'takeRight': start = nativeMax(start, end - size); break;
  6799. }
  6800. }
  6801. return { 'start': start, 'end': end };
  6802. }
  6803. /**
  6804. * Extracts wrapper details from the `source` body comment.
  6805. *
  6806. * @private
  6807. * @param {string} source The source to inspect.
  6808. * @returns {Array} Returns the wrapper details.
  6809. */
  6810. function getWrapDetails(source) {
  6811. var match = source.match(reWrapDetails);
  6812. return match ? match[1].split(reSplitDetails) : [];
  6813. }
  6814. /**
  6815. * Checks if `path` exists on `object`.
  6816. *
  6817. * @private
  6818. * @param {Object} object The object to query.
  6819. * @param {Array|string} path The path to check.
  6820. * @param {Function} hasFunc The function to check properties.
  6821. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6822. */
  6823. function hasPath(object, path, hasFunc) {
  6824. path = castPath(path, object);
  6825. var index = -1,
  6826. length = path.length,
  6827. result = false;
  6828. while (++index < length) {
  6829. var key = toKey(path[index]);
  6830. if (!(result = object != null && hasFunc(object, key))) {
  6831. break;
  6832. }
  6833. object = object[key];
  6834. }
  6835. if (result || ++index != length) {
  6836. return result;
  6837. }
  6838. length = object == null ? 0 : object.length;
  6839. return !!length && isLength(length) && isIndex(key, length) &&
  6840. (isArray(object) || isArguments(object));
  6841. }
  6842. /**
  6843. * Initializes an array clone.
  6844. *
  6845. * @private
  6846. * @param {Array} array The array to clone.
  6847. * @returns {Array} Returns the initialized clone.
  6848. */
  6849. function initCloneArray(array) {
  6850. var length = array.length,
  6851. result = new array.constructor(length);
  6852. // Add properties assigned by `RegExp#exec`.
  6853. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6854. result.index = array.index;
  6855. result.input = array.input;
  6856. }
  6857. return result;
  6858. }
  6859. /**
  6860. * Initializes an object clone.
  6861. *
  6862. * @private
  6863. * @param {Object} object The object to clone.
  6864. * @returns {Object} Returns the initialized clone.
  6865. */
  6866. function initCloneObject(object) {
  6867. return (typeof object.constructor == 'function' && !isPrototype(object))
  6868. ? baseCreate(getPrototype(object))
  6869. : {};
  6870. }
  6871. /**
  6872. * Initializes an object clone based on its `toStringTag`.
  6873. *
  6874. * **Note:** This function only supports cloning values with tags of
  6875. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6876. *
  6877. * @private
  6878. * @param {Object} object The object to clone.
  6879. * @param {string} tag The `toStringTag` of the object to clone.
  6880. * @param {boolean} [isDeep] Specify a deep clone.
  6881. * @returns {Object} Returns the initialized clone.
  6882. */
  6883. function initCloneByTag(object, tag, isDeep) {
  6884. var Ctor = object.constructor;
  6885. switch (tag) {
  6886. case arrayBufferTag:
  6887. return cloneArrayBuffer(object);
  6888. case boolTag:
  6889. case dateTag:
  6890. return new Ctor(+object);
  6891. case dataViewTag:
  6892. return cloneDataView(object, isDeep);
  6893. case float32Tag: case float64Tag:
  6894. case int8Tag: case int16Tag: case int32Tag:
  6895. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6896. return cloneTypedArray(object, isDeep);
  6897. case mapTag:
  6898. return new Ctor;
  6899. case numberTag:
  6900. case stringTag:
  6901. return new Ctor(object);
  6902. case regexpTag:
  6903. return cloneRegExp(object);
  6904. case setTag:
  6905. return new Ctor;
  6906. case symbolTag:
  6907. return cloneSymbol(object);
  6908. }
  6909. }
  6910. /**
  6911. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6912. *
  6913. * @private
  6914. * @param {string} source The source to modify.
  6915. * @returns {Array} details The details to insert.
  6916. * @returns {string} Returns the modified source.
  6917. */
  6918. function insertWrapDetails(source, details) {
  6919. var length = details.length;
  6920. if (!length) {
  6921. return source;
  6922. }
  6923. var lastIndex = length - 1;
  6924. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6925. details = details.join(length > 2 ? ', ' : ' ');
  6926. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6927. }
  6928. /**
  6929. * Checks if `value` is a flattenable `arguments` object or array.
  6930. *
  6931. * @private
  6932. * @param {*} value The value to check.
  6933. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6934. */
  6935. function isFlattenable(value) {
  6936. return isArray(value) || isArguments(value) ||
  6937. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6938. }
  6939. /**
  6940. * Checks if `value` is a valid array-like index.
  6941. *
  6942. * @private
  6943. * @param {*} value The value to check.
  6944. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6945. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6946. */
  6947. function isIndex(value, length) {
  6948. var type = typeof value;
  6949. length = length == null ? MAX_SAFE_INTEGER : length;
  6950. return !!length &&
  6951. (type == 'number' ||
  6952. (type != 'symbol' && reIsUint.test(value))) &&
  6953. (value > -1 && value % 1 == 0 && value < length);
  6954. }
  6955. /**
  6956. * Checks if the given arguments are from an iteratee call.
  6957. *
  6958. * @private
  6959. * @param {*} value The potential iteratee value argument.
  6960. * @param {*} index The potential iteratee index or key argument.
  6961. * @param {*} object The potential iteratee object argument.
  6962. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6963. * else `false`.
  6964. */
  6965. function isIterateeCall(value, index, object) {
  6966. if (!isObject(object)) {
  6967. return false;
  6968. }
  6969. var type = typeof index;
  6970. if (type == 'number'
  6971. ? (isArrayLike(object) && isIndex(index, object.length))
  6972. : (type == 'string' && index in object)
  6973. ) {
  6974. return eq(object[index], value);
  6975. }
  6976. return false;
  6977. }
  6978. /**
  6979. * Checks if `value` is a property name and not a property path.
  6980. *
  6981. * @private
  6982. * @param {*} value The value to check.
  6983. * @param {Object} [object] The object to query keys on.
  6984. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6985. */
  6986. function isKey(value, object) {
  6987. if (isArray(value)) {
  6988. return false;
  6989. }
  6990. var type = typeof value;
  6991. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6992. value == null || isSymbol(value)) {
  6993. return true;
  6994. }
  6995. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6996. (object != null && value in Object(object));
  6997. }
  6998. /**
  6999. * Checks if `value` is suitable for use as unique object key.
  7000. *
  7001. * @private
  7002. * @param {*} value The value to check.
  7003. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7004. */
  7005. function isKeyable(value) {
  7006. var type = typeof value;
  7007. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7008. ? (value !== '__proto__')
  7009. : (value === null);
  7010. }
  7011. /**
  7012. * Checks if `func` has a lazy counterpart.
  7013. *
  7014. * @private
  7015. * @param {Function} func The function to check.
  7016. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7017. * else `false`.
  7018. */
  7019. function isLaziable(func) {
  7020. var funcName = getFuncName(func),
  7021. other = lodash[funcName];
  7022. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7023. return false;
  7024. }
  7025. if (func === other) {
  7026. return true;
  7027. }
  7028. var data = getData(other);
  7029. return !!data && func === data[0];
  7030. }
  7031. /**
  7032. * Checks if `func` has its source masked.
  7033. *
  7034. * @private
  7035. * @param {Function} func The function to check.
  7036. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7037. */
  7038. function isMasked(func) {
  7039. return !!maskSrcKey && (maskSrcKey in func);
  7040. }
  7041. /**
  7042. * Checks if `func` is capable of being masked.
  7043. *
  7044. * @private
  7045. * @param {*} value The value to check.
  7046. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7047. */
  7048. var isMaskable = coreJsData ? isFunction : stubFalse;
  7049. /**
  7050. * Checks if `value` is likely a prototype object.
  7051. *
  7052. * @private
  7053. * @param {*} value The value to check.
  7054. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7055. */
  7056. function isPrototype(value) {
  7057. var Ctor = value && value.constructor,
  7058. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7059. return value === proto;
  7060. }
  7061. /**
  7062. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7063. *
  7064. * @private
  7065. * @param {*} value The value to check.
  7066. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7067. * equality comparisons, else `false`.
  7068. */
  7069. function isStrictComparable(value) {
  7070. return value === value && !isObject(value);
  7071. }
  7072. /**
  7073. * A specialized version of `matchesProperty` for source values suitable
  7074. * for strict equality comparisons, i.e. `===`.
  7075. *
  7076. * @private
  7077. * @param {string} key The key of the property to get.
  7078. * @param {*} srcValue The value to match.
  7079. * @returns {Function} Returns the new spec function.
  7080. */
  7081. function matchesStrictComparable(key, srcValue) {
  7082. return function(object) {
  7083. if (object == null) {
  7084. return false;
  7085. }
  7086. return object[key] === srcValue &&
  7087. (srcValue !== undefined || (key in Object(object)));
  7088. };
  7089. }
  7090. /**
  7091. * A specialized version of `_.memoize` which clears the memoized function's
  7092. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7093. *
  7094. * @private
  7095. * @param {Function} func The function to have its output memoized.
  7096. * @returns {Function} Returns the new memoized function.
  7097. */
  7098. function memoizeCapped(func) {
  7099. var result = memoize(func, function(key) {
  7100. if (cache.size === MAX_MEMOIZE_SIZE) {
  7101. cache.clear();
  7102. }
  7103. return key;
  7104. });
  7105. var cache = result.cache;
  7106. return result;
  7107. }
  7108. /**
  7109. * Merges the function metadata of `source` into `data`.
  7110. *
  7111. * Merging metadata reduces the number of wrappers used to invoke a function.
  7112. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7113. * may be applied regardless of execution order. Methods like `_.ary` and
  7114. * `_.rearg` modify function arguments, making the order in which they are
  7115. * executed important, preventing the merging of metadata. However, we make
  7116. * an exception for a safe combined case where curried functions have `_.ary`
  7117. * and or `_.rearg` applied.
  7118. *
  7119. * @private
  7120. * @param {Array} data The destination metadata.
  7121. * @param {Array} source The source metadata.
  7122. * @returns {Array} Returns `data`.
  7123. */
  7124. function mergeData(data, source) {
  7125. var bitmask = data[1],
  7126. srcBitmask = source[1],
  7127. newBitmask = bitmask | srcBitmask,
  7128. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7129. var isCombo =
  7130. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7131. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7132. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7133. // Exit early if metadata can't be merged.
  7134. if (!(isCommon || isCombo)) {
  7135. return data;
  7136. }
  7137. // Use source `thisArg` if available.
  7138. if (srcBitmask & WRAP_BIND_FLAG) {
  7139. data[2] = source[2];
  7140. // Set when currying a bound function.
  7141. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7142. }
  7143. // Compose partial arguments.
  7144. var value = source[3];
  7145. if (value) {
  7146. var partials = data[3];
  7147. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7148. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7149. }
  7150. // Compose partial right arguments.
  7151. value = source[5];
  7152. if (value) {
  7153. partials = data[5];
  7154. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7155. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7156. }
  7157. // Use source `argPos` if available.
  7158. value = source[7];
  7159. if (value) {
  7160. data[7] = value;
  7161. }
  7162. // Use source `ary` if it's smaller.
  7163. if (srcBitmask & WRAP_ARY_FLAG) {
  7164. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7165. }
  7166. // Use source `arity` if one is not provided.
  7167. if (data[9] == null) {
  7168. data[9] = source[9];
  7169. }
  7170. // Use source `func` and merge bitmasks.
  7171. data[0] = source[0];
  7172. data[1] = newBitmask;
  7173. return data;
  7174. }
  7175. /**
  7176. * This function is like
  7177. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7178. * except that it includes inherited enumerable properties.
  7179. *
  7180. * @private
  7181. * @param {Object} object The object to query.
  7182. * @returns {Array} Returns the array of property names.
  7183. */
  7184. function nativeKeysIn(object) {
  7185. var result = [];
  7186. if (object != null) {
  7187. for (var key in Object(object)) {
  7188. result.push(key);
  7189. }
  7190. }
  7191. return result;
  7192. }
  7193. /**
  7194. * Converts `value` to a string using `Object.prototype.toString`.
  7195. *
  7196. * @private
  7197. * @param {*} value The value to convert.
  7198. * @returns {string} Returns the converted string.
  7199. */
  7200. function objectToString(value) {
  7201. return nativeObjectToString.call(value);
  7202. }
  7203. /**
  7204. * A specialized version of `baseRest` which transforms the rest array.
  7205. *
  7206. * @private
  7207. * @param {Function} func The function to apply a rest parameter to.
  7208. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7209. * @param {Function} transform The rest array transform.
  7210. * @returns {Function} Returns the new function.
  7211. */
  7212. function overRest(func, start, transform) {
  7213. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7214. return function() {
  7215. var args = arguments,
  7216. index = -1,
  7217. length = nativeMax(args.length - start, 0),
  7218. array = Array(length);
  7219. while (++index < length) {
  7220. array[index] = args[start + index];
  7221. }
  7222. index = -1;
  7223. var otherArgs = Array(start + 1);
  7224. while (++index < start) {
  7225. otherArgs[index] = args[index];
  7226. }
  7227. otherArgs[start] = transform(array);
  7228. return apply(func, this, otherArgs);
  7229. };
  7230. }
  7231. /**
  7232. * Gets the parent value at `path` of `object`.
  7233. *
  7234. * @private
  7235. * @param {Object} object The object to query.
  7236. * @param {Array} path The path to get the parent value of.
  7237. * @returns {*} Returns the parent value.
  7238. */
  7239. function parent(object, path) {
  7240. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7241. }
  7242. /**
  7243. * Reorder `array` according to the specified indexes where the element at
  7244. * the first index is assigned as the first element, the element at
  7245. * the second index is assigned as the second element, and so on.
  7246. *
  7247. * @private
  7248. * @param {Array} array The array to reorder.
  7249. * @param {Array} indexes The arranged array indexes.
  7250. * @returns {Array} Returns `array`.
  7251. */
  7252. function reorder(array, indexes) {
  7253. var arrLength = array.length,
  7254. length = nativeMin(indexes.length, arrLength),
  7255. oldArray = copyArray(array);
  7256. while (length--) {
  7257. var index = indexes[length];
  7258. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7259. }
  7260. return array;
  7261. }
  7262. /**
  7263. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7264. *
  7265. * @private
  7266. * @param {Object} object The object to query.
  7267. * @param {string} key The key of the property to get.
  7268. * @returns {*} Returns the property value.
  7269. */
  7270. function safeGet(object, key) {
  7271. if (key === 'constructor' && typeof object[key] === 'function') {
  7272. return;
  7273. }
  7274. if (key == '__proto__') {
  7275. return;
  7276. }
  7277. return object[key];
  7278. }
  7279. /**
  7280. * Sets metadata for `func`.
  7281. *
  7282. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7283. * period of time, it will trip its breaker and transition to an identity
  7284. * function to avoid garbage collection pauses in V8. See
  7285. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7286. * for more details.
  7287. *
  7288. * @private
  7289. * @param {Function} func The function to associate metadata with.
  7290. * @param {*} data The metadata.
  7291. * @returns {Function} Returns `func`.
  7292. */
  7293. var setData = shortOut(baseSetData);
  7294. /**
  7295. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7296. *
  7297. * @private
  7298. * @param {Function} func The function to delay.
  7299. * @param {number} wait The number of milliseconds to delay invocation.
  7300. * @returns {number|Object} Returns the timer id or timeout object.
  7301. */
  7302. var setTimeout = ctxSetTimeout || function(func, wait) {
  7303. return root.setTimeout(func, wait);
  7304. };
  7305. /**
  7306. * Sets the `toString` method of `func` to return `string`.
  7307. *
  7308. * @private
  7309. * @param {Function} func The function to modify.
  7310. * @param {Function} string The `toString` result.
  7311. * @returns {Function} Returns `func`.
  7312. */
  7313. var setToString = shortOut(baseSetToString);
  7314. /**
  7315. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7316. * with wrapper details in a comment at the top of the source body.
  7317. *
  7318. * @private
  7319. * @param {Function} wrapper The function to modify.
  7320. * @param {Function} reference The reference function.
  7321. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7322. * @returns {Function} Returns `wrapper`.
  7323. */
  7324. function setWrapToString(wrapper, reference, bitmask) {
  7325. var source = (reference + '');
  7326. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7327. }
  7328. /**
  7329. * Creates a function that'll short out and invoke `identity` instead
  7330. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7331. * milliseconds.
  7332. *
  7333. * @private
  7334. * @param {Function} func The function to restrict.
  7335. * @returns {Function} Returns the new shortable function.
  7336. */
  7337. function shortOut(func) {
  7338. var count = 0,
  7339. lastCalled = 0;
  7340. return function() {
  7341. var stamp = nativeNow(),
  7342. remaining = HOT_SPAN - (stamp - lastCalled);
  7343. lastCalled = stamp;
  7344. if (remaining > 0) {
  7345. if (++count >= HOT_COUNT) {
  7346. return arguments[0];
  7347. }
  7348. } else {
  7349. count = 0;
  7350. }
  7351. return func.apply(undefined, arguments);
  7352. };
  7353. }
  7354. /**
  7355. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7356. *
  7357. * @private
  7358. * @param {Array} array The array to shuffle.
  7359. * @param {number} [size=array.length] The size of `array`.
  7360. * @returns {Array} Returns `array`.
  7361. */
  7362. function shuffleSelf(array, size) {
  7363. var index = -1,
  7364. length = array.length,
  7365. lastIndex = length - 1;
  7366. size = size === undefined ? length : size;
  7367. while (++index < size) {
  7368. var rand = baseRandom(index, lastIndex),
  7369. value = array[rand];
  7370. array[rand] = array[index];
  7371. array[index] = value;
  7372. }
  7373. array.length = size;
  7374. return array;
  7375. }
  7376. /**
  7377. * Converts `string` to a property path array.
  7378. *
  7379. * @private
  7380. * @param {string} string The string to convert.
  7381. * @returns {Array} Returns the property path array.
  7382. */
  7383. var stringToPath = memoizeCapped(function(string) {
  7384. var result = [];
  7385. if (string.charCodeAt(0) === 46 /* . */) {
  7386. result.push('');
  7387. }
  7388. string.replace(rePropName, function(match, number, quote, subString) {
  7389. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7390. });
  7391. return result;
  7392. });
  7393. /**
  7394. * Converts `value` to a string key if it's not a string or symbol.
  7395. *
  7396. * @private
  7397. * @param {*} value The value to inspect.
  7398. * @returns {string|symbol} Returns the key.
  7399. */
  7400. function toKey(value) {
  7401. if (typeof value == 'string' || isSymbol(value)) {
  7402. return value;
  7403. }
  7404. var result = (value + '');
  7405. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7406. }
  7407. /**
  7408. * Converts `func` to its source code.
  7409. *
  7410. * @private
  7411. * @param {Function} func The function to convert.
  7412. * @returns {string} Returns the source code.
  7413. */
  7414. function toSource(func) {
  7415. if (func != null) {
  7416. try {
  7417. return funcToString.call(func);
  7418. } catch (e) {}
  7419. try {
  7420. return (func + '');
  7421. } catch (e) {}
  7422. }
  7423. return '';
  7424. }
  7425. /**
  7426. * Updates wrapper `details` based on `bitmask` flags.
  7427. *
  7428. * @private
  7429. * @returns {Array} details The details to modify.
  7430. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7431. * @returns {Array} Returns `details`.
  7432. */
  7433. function updateWrapDetails(details, bitmask) {
  7434. arrayEach(wrapFlags, function(pair) {
  7435. var value = '_.' + pair[0];
  7436. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7437. details.push(value);
  7438. }
  7439. });
  7440. return details.sort();
  7441. }
  7442. /**
  7443. * Creates a clone of `wrapper`.
  7444. *
  7445. * @private
  7446. * @param {Object} wrapper The wrapper to clone.
  7447. * @returns {Object} Returns the cloned wrapper.
  7448. */
  7449. function wrapperClone(wrapper) {
  7450. if (wrapper instanceof LazyWrapper) {
  7451. return wrapper.clone();
  7452. }
  7453. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7454. result.__actions__ = copyArray(wrapper.__actions__);
  7455. result.__index__ = wrapper.__index__;
  7456. result.__values__ = wrapper.__values__;
  7457. return result;
  7458. }
  7459. /*------------------------------------------------------------------------*/
  7460. /**
  7461. * Creates an array of elements split into groups the length of `size`.
  7462. * If `array` can't be split evenly, the final chunk will be the remaining
  7463. * elements.
  7464. *
  7465. * @static
  7466. * @memberOf _
  7467. * @since 3.0.0
  7468. * @category Array
  7469. * @param {Array} array The array to process.
  7470. * @param {number} [size=1] The length of each chunk
  7471. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7472. * @returns {Array} Returns the new array of chunks.
  7473. * @example
  7474. *
  7475. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7476. * // => [['a', 'b'], ['c', 'd']]
  7477. *
  7478. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7479. * // => [['a', 'b', 'c'], ['d']]
  7480. */
  7481. function chunk(array, size, guard) {
  7482. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7483. size = 1;
  7484. } else {
  7485. size = nativeMax(toInteger(size), 0);
  7486. }
  7487. var length = array == null ? 0 : array.length;
  7488. if (!length || size < 1) {
  7489. return [];
  7490. }
  7491. var index = 0,
  7492. resIndex = 0,
  7493. result = Array(nativeCeil(length / size));
  7494. while (index < length) {
  7495. result[resIndex++] = baseSlice(array, index, (index += size));
  7496. }
  7497. return result;
  7498. }
  7499. /**
  7500. * Creates an array with all falsey values removed. The values `false`, `null`,
  7501. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7502. *
  7503. * @static
  7504. * @memberOf _
  7505. * @since 0.1.0
  7506. * @category Array
  7507. * @param {Array} array The array to compact.
  7508. * @returns {Array} Returns the new array of filtered values.
  7509. * @example
  7510. *
  7511. * _.compact([0, 1, false, 2, '', 3]);
  7512. * // => [1, 2, 3]
  7513. */
  7514. function compact(array) {
  7515. var index = -1,
  7516. length = array == null ? 0 : array.length,
  7517. resIndex = 0,
  7518. result = [];
  7519. while (++index < length) {
  7520. var value = array[index];
  7521. if (value) {
  7522. result[resIndex++] = value;
  7523. }
  7524. }
  7525. return result;
  7526. }
  7527. /**
  7528. * Creates a new array concatenating `array` with any additional arrays
  7529. * and/or values.
  7530. *
  7531. * @static
  7532. * @memberOf _
  7533. * @since 4.0.0
  7534. * @category Array
  7535. * @param {Array} array The array to concatenate.
  7536. * @param {...*} [values] The values to concatenate.
  7537. * @returns {Array} Returns the new concatenated array.
  7538. * @example
  7539. *
  7540. * var array = [1];
  7541. * var other = _.concat(array, 2, [3], [[4]]);
  7542. *
  7543. * console.log(other);
  7544. * // => [1, 2, 3, [4]]
  7545. *
  7546. * console.log(array);
  7547. * // => [1]
  7548. */
  7549. function concat() {
  7550. var length = arguments.length;
  7551. if (!length) {
  7552. return [];
  7553. }
  7554. var args = Array(length - 1),
  7555. array = arguments[0],
  7556. index = length;
  7557. while (index--) {
  7558. args[index - 1] = arguments[index];
  7559. }
  7560. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7561. }
  7562. /**
  7563. * Creates an array of `array` values not included in the other given arrays
  7564. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7565. * for equality comparisons. The order and references of result values are
  7566. * determined by the first array.
  7567. *
  7568. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7569. *
  7570. * @static
  7571. * @memberOf _
  7572. * @since 0.1.0
  7573. * @category Array
  7574. * @param {Array} array The array to inspect.
  7575. * @param {...Array} [values] The values to exclude.
  7576. * @returns {Array} Returns the new array of filtered values.
  7577. * @see _.without, _.xor
  7578. * @example
  7579. *
  7580. * _.difference([2, 1], [2, 3]);
  7581. * // => [1]
  7582. */
  7583. var difference = baseRest(function(array, values) {
  7584. return isArrayLikeObject(array)
  7585. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7586. : [];
  7587. });
  7588. /**
  7589. * This method is like `_.difference` except that it accepts `iteratee` which
  7590. * is invoked for each element of `array` and `values` to generate the criterion
  7591. * by which they're compared. The order and references of result values are
  7592. * determined by the first array. The iteratee is invoked with one argument:
  7593. * (value).
  7594. *
  7595. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7596. *
  7597. * @static
  7598. * @memberOf _
  7599. * @since 4.0.0
  7600. * @category Array
  7601. * @param {Array} array The array to inspect.
  7602. * @param {...Array} [values] The values to exclude.
  7603. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7604. * @returns {Array} Returns the new array of filtered values.
  7605. * @example
  7606. *
  7607. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7608. * // => [1.2]
  7609. *
  7610. * // The `_.property` iteratee shorthand.
  7611. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7612. * // => [{ 'x': 2 }]
  7613. */
  7614. var differenceBy = baseRest(function(array, values) {
  7615. var iteratee = last(values);
  7616. if (isArrayLikeObject(iteratee)) {
  7617. iteratee = undefined;
  7618. }
  7619. return isArrayLikeObject(array)
  7620. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7621. : [];
  7622. });
  7623. /**
  7624. * This method is like `_.difference` except that it accepts `comparator`
  7625. * which is invoked to compare elements of `array` to `values`. The order and
  7626. * references of result values are determined by the first array. The comparator
  7627. * is invoked with two arguments: (arrVal, othVal).
  7628. *
  7629. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7630. *
  7631. * @static
  7632. * @memberOf _
  7633. * @since 4.0.0
  7634. * @category Array
  7635. * @param {Array} array The array to inspect.
  7636. * @param {...Array} [values] The values to exclude.
  7637. * @param {Function} [comparator] The comparator invoked per element.
  7638. * @returns {Array} Returns the new array of filtered values.
  7639. * @example
  7640. *
  7641. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7642. *
  7643. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7644. * // => [{ 'x': 2, 'y': 1 }]
  7645. */
  7646. var differenceWith = baseRest(function(array, values) {
  7647. var comparator = last(values);
  7648. if (isArrayLikeObject(comparator)) {
  7649. comparator = undefined;
  7650. }
  7651. return isArrayLikeObject(array)
  7652. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7653. : [];
  7654. });
  7655. /**
  7656. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7657. *
  7658. * @static
  7659. * @memberOf _
  7660. * @since 0.5.0
  7661. * @category Array
  7662. * @param {Array} array The array to query.
  7663. * @param {number} [n=1] The number of elements to drop.
  7664. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7665. * @returns {Array} Returns the slice of `array`.
  7666. * @example
  7667. *
  7668. * _.drop([1, 2, 3]);
  7669. * // => [2, 3]
  7670. *
  7671. * _.drop([1, 2, 3], 2);
  7672. * // => [3]
  7673. *
  7674. * _.drop([1, 2, 3], 5);
  7675. * // => []
  7676. *
  7677. * _.drop([1, 2, 3], 0);
  7678. * // => [1, 2, 3]
  7679. */
  7680. function drop(array, n, guard) {
  7681. var length = array == null ? 0 : array.length;
  7682. if (!length) {
  7683. return [];
  7684. }
  7685. n = (guard || n === undefined) ? 1 : toInteger(n);
  7686. return baseSlice(array, n < 0 ? 0 : n, length);
  7687. }
  7688. /**
  7689. * Creates a slice of `array` with `n` elements dropped from the end.
  7690. *
  7691. * @static
  7692. * @memberOf _
  7693. * @since 3.0.0
  7694. * @category Array
  7695. * @param {Array} array The array to query.
  7696. * @param {number} [n=1] The number of elements to drop.
  7697. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7698. * @returns {Array} Returns the slice of `array`.
  7699. * @example
  7700. *
  7701. * _.dropRight([1, 2, 3]);
  7702. * // => [1, 2]
  7703. *
  7704. * _.dropRight([1, 2, 3], 2);
  7705. * // => [1]
  7706. *
  7707. * _.dropRight([1, 2, 3], 5);
  7708. * // => []
  7709. *
  7710. * _.dropRight([1, 2, 3], 0);
  7711. * // => [1, 2, 3]
  7712. */
  7713. function dropRight(array, n, guard) {
  7714. var length = array == null ? 0 : array.length;
  7715. if (!length) {
  7716. return [];
  7717. }
  7718. n = (guard || n === undefined) ? 1 : toInteger(n);
  7719. n = length - n;
  7720. return baseSlice(array, 0, n < 0 ? 0 : n);
  7721. }
  7722. /**
  7723. * Creates a slice of `array` excluding elements dropped from the end.
  7724. * Elements are dropped until `predicate` returns falsey. The predicate is
  7725. * invoked with three arguments: (value, index, array).
  7726. *
  7727. * @static
  7728. * @memberOf _
  7729. * @since 3.0.0
  7730. * @category Array
  7731. * @param {Array} array The array to query.
  7732. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7733. * @returns {Array} Returns the slice of `array`.
  7734. * @example
  7735. *
  7736. * var users = [
  7737. * { 'user': 'barney', 'active': true },
  7738. * { 'user': 'fred', 'active': false },
  7739. * { 'user': 'pebbles', 'active': false }
  7740. * ];
  7741. *
  7742. * _.dropRightWhile(users, function(o) { return !o.active; });
  7743. * // => objects for ['barney']
  7744. *
  7745. * // The `_.matches` iteratee shorthand.
  7746. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7747. * // => objects for ['barney', 'fred']
  7748. *
  7749. * // The `_.matchesProperty` iteratee shorthand.
  7750. * _.dropRightWhile(users, ['active', false]);
  7751. * // => objects for ['barney']
  7752. *
  7753. * // The `_.property` iteratee shorthand.
  7754. * _.dropRightWhile(users, 'active');
  7755. * // => objects for ['barney', 'fred', 'pebbles']
  7756. */
  7757. function dropRightWhile(array, predicate) {
  7758. return (array && array.length)
  7759. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7760. : [];
  7761. }
  7762. /**
  7763. * Creates a slice of `array` excluding elements dropped from the beginning.
  7764. * Elements are dropped until `predicate` returns falsey. The predicate is
  7765. * invoked with three arguments: (value, index, array).
  7766. *
  7767. * @static
  7768. * @memberOf _
  7769. * @since 3.0.0
  7770. * @category Array
  7771. * @param {Array} array The array to query.
  7772. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7773. * @returns {Array} Returns the slice of `array`.
  7774. * @example
  7775. *
  7776. * var users = [
  7777. * { 'user': 'barney', 'active': false },
  7778. * { 'user': 'fred', 'active': false },
  7779. * { 'user': 'pebbles', 'active': true }
  7780. * ];
  7781. *
  7782. * _.dropWhile(users, function(o) { return !o.active; });
  7783. * // => objects for ['pebbles']
  7784. *
  7785. * // The `_.matches` iteratee shorthand.
  7786. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7787. * // => objects for ['fred', 'pebbles']
  7788. *
  7789. * // The `_.matchesProperty` iteratee shorthand.
  7790. * _.dropWhile(users, ['active', false]);
  7791. * // => objects for ['pebbles']
  7792. *
  7793. * // The `_.property` iteratee shorthand.
  7794. * _.dropWhile(users, 'active');
  7795. * // => objects for ['barney', 'fred', 'pebbles']
  7796. */
  7797. function dropWhile(array, predicate) {
  7798. return (array && array.length)
  7799. ? baseWhile(array, getIteratee(predicate, 3), true)
  7800. : [];
  7801. }
  7802. /**
  7803. * Fills elements of `array` with `value` from `start` up to, but not
  7804. * including, `end`.
  7805. *
  7806. * **Note:** This method mutates `array`.
  7807. *
  7808. * @static
  7809. * @memberOf _
  7810. * @since 3.2.0
  7811. * @category Array
  7812. * @param {Array} array The array to fill.
  7813. * @param {*} value The value to fill `array` with.
  7814. * @param {number} [start=0] The start position.
  7815. * @param {number} [end=array.length] The end position.
  7816. * @returns {Array} Returns `array`.
  7817. * @example
  7818. *
  7819. * var array = [1, 2, 3];
  7820. *
  7821. * _.fill(array, 'a');
  7822. * console.log(array);
  7823. * // => ['a', 'a', 'a']
  7824. *
  7825. * _.fill(Array(3), 2);
  7826. * // => [2, 2, 2]
  7827. *
  7828. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7829. * // => [4, '*', '*', 10]
  7830. */
  7831. function fill(array, value, start, end) {
  7832. var length = array == null ? 0 : array.length;
  7833. if (!length) {
  7834. return [];
  7835. }
  7836. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7837. start = 0;
  7838. end = length;
  7839. }
  7840. return baseFill(array, value, start, end);
  7841. }
  7842. /**
  7843. * This method is like `_.find` except that it returns the index of the first
  7844. * element `predicate` returns truthy for instead of the element itself.
  7845. *
  7846. * @static
  7847. * @memberOf _
  7848. * @since 1.1.0
  7849. * @category Array
  7850. * @param {Array} array The array to inspect.
  7851. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7852. * @param {number} [fromIndex=0] The index to search from.
  7853. * @returns {number} Returns the index of the found element, else `-1`.
  7854. * @example
  7855. *
  7856. * var users = [
  7857. * { 'user': 'barney', 'active': false },
  7858. * { 'user': 'fred', 'active': false },
  7859. * { 'user': 'pebbles', 'active': true }
  7860. * ];
  7861. *
  7862. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7863. * // => 0
  7864. *
  7865. * // The `_.matches` iteratee shorthand.
  7866. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7867. * // => 1
  7868. *
  7869. * // The `_.matchesProperty` iteratee shorthand.
  7870. * _.findIndex(users, ['active', false]);
  7871. * // => 0
  7872. *
  7873. * // The `_.property` iteratee shorthand.
  7874. * _.findIndex(users, 'active');
  7875. * // => 2
  7876. */
  7877. function findIndex(array, predicate, fromIndex) {
  7878. var length = array == null ? 0 : array.length;
  7879. if (!length) {
  7880. return -1;
  7881. }
  7882. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7883. if (index < 0) {
  7884. index = nativeMax(length + index, 0);
  7885. }
  7886. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7887. }
  7888. /**
  7889. * This method is like `_.findIndex` except that it iterates over elements
  7890. * of `collection` from right to left.
  7891. *
  7892. * @static
  7893. * @memberOf _
  7894. * @since 2.0.0
  7895. * @category Array
  7896. * @param {Array} array The array to inspect.
  7897. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7898. * @param {number} [fromIndex=array.length-1] The index to search from.
  7899. * @returns {number} Returns the index of the found element, else `-1`.
  7900. * @example
  7901. *
  7902. * var users = [
  7903. * { 'user': 'barney', 'active': true },
  7904. * { 'user': 'fred', 'active': false },
  7905. * { 'user': 'pebbles', 'active': false }
  7906. * ];
  7907. *
  7908. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7909. * // => 2
  7910. *
  7911. * // The `_.matches` iteratee shorthand.
  7912. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7913. * // => 0
  7914. *
  7915. * // The `_.matchesProperty` iteratee shorthand.
  7916. * _.findLastIndex(users, ['active', false]);
  7917. * // => 2
  7918. *
  7919. * // The `_.property` iteratee shorthand.
  7920. * _.findLastIndex(users, 'active');
  7921. * // => 0
  7922. */
  7923. function findLastIndex(array, predicate, fromIndex) {
  7924. var length = array == null ? 0 : array.length;
  7925. if (!length) {
  7926. return -1;
  7927. }
  7928. var index = length - 1;
  7929. if (fromIndex !== undefined) {
  7930. index = toInteger(fromIndex);
  7931. index = fromIndex < 0
  7932. ? nativeMax(length + index, 0)
  7933. : nativeMin(index, length - 1);
  7934. }
  7935. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7936. }
  7937. /**
  7938. * Flattens `array` a single level deep.
  7939. *
  7940. * @static
  7941. * @memberOf _
  7942. * @since 0.1.0
  7943. * @category Array
  7944. * @param {Array} array The array to flatten.
  7945. * @returns {Array} Returns the new flattened array.
  7946. * @example
  7947. *
  7948. * _.flatten([1, [2, [3, [4]], 5]]);
  7949. * // => [1, 2, [3, [4]], 5]
  7950. */
  7951. function flatten(array) {
  7952. var length = array == null ? 0 : array.length;
  7953. return length ? baseFlatten(array, 1) : [];
  7954. }
  7955. /**
  7956. * Recursively flattens `array`.
  7957. *
  7958. * @static
  7959. * @memberOf _
  7960. * @since 3.0.0
  7961. * @category Array
  7962. * @param {Array} array The array to flatten.
  7963. * @returns {Array} Returns the new flattened array.
  7964. * @example
  7965. *
  7966. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7967. * // => [1, 2, 3, 4, 5]
  7968. */
  7969. function flattenDeep(array) {
  7970. var length = array == null ? 0 : array.length;
  7971. return length ? baseFlatten(array, INFINITY) : [];
  7972. }
  7973. /**
  7974. * Recursively flatten `array` up to `depth` times.
  7975. *
  7976. * @static
  7977. * @memberOf _
  7978. * @since 4.4.0
  7979. * @category Array
  7980. * @param {Array} array The array to flatten.
  7981. * @param {number} [depth=1] The maximum recursion depth.
  7982. * @returns {Array} Returns the new flattened array.
  7983. * @example
  7984. *
  7985. * var array = [1, [2, [3, [4]], 5]];
  7986. *
  7987. * _.flattenDepth(array, 1);
  7988. * // => [1, 2, [3, [4]], 5]
  7989. *
  7990. * _.flattenDepth(array, 2);
  7991. * // => [1, 2, 3, [4], 5]
  7992. */
  7993. function flattenDepth(array, depth) {
  7994. var length = array == null ? 0 : array.length;
  7995. if (!length) {
  7996. return [];
  7997. }
  7998. depth = depth === undefined ? 1 : toInteger(depth);
  7999. return baseFlatten(array, depth);
  8000. }
  8001. /**
  8002. * The inverse of `_.toPairs`; this method returns an object composed
  8003. * from key-value `pairs`.
  8004. *
  8005. * @static
  8006. * @memberOf _
  8007. * @since 4.0.0
  8008. * @category Array
  8009. * @param {Array} pairs The key-value pairs.
  8010. * @returns {Object} Returns the new object.
  8011. * @example
  8012. *
  8013. * _.fromPairs([['a', 1], ['b', 2]]);
  8014. * // => { 'a': 1, 'b': 2 }
  8015. */
  8016. function fromPairs(pairs) {
  8017. var index = -1,
  8018. length = pairs == null ? 0 : pairs.length,
  8019. result = {};
  8020. while (++index < length) {
  8021. var pair = pairs[index];
  8022. result[pair[0]] = pair[1];
  8023. }
  8024. return result;
  8025. }
  8026. /**
  8027. * Gets the first element of `array`.
  8028. *
  8029. * @static
  8030. * @memberOf _
  8031. * @since 0.1.0
  8032. * @alias first
  8033. * @category Array
  8034. * @param {Array} array The array to query.
  8035. * @returns {*} Returns the first element of `array`.
  8036. * @example
  8037. *
  8038. * _.head([1, 2, 3]);
  8039. * // => 1
  8040. *
  8041. * _.head([]);
  8042. * // => undefined
  8043. */
  8044. function head(array) {
  8045. return (array && array.length) ? array[0] : undefined;
  8046. }
  8047. /**
  8048. * Gets the index at which the first occurrence of `value` is found in `array`
  8049. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8050. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8051. * offset from the end of `array`.
  8052. *
  8053. * @static
  8054. * @memberOf _
  8055. * @since 0.1.0
  8056. * @category Array
  8057. * @param {Array} array The array to inspect.
  8058. * @param {*} value The value to search for.
  8059. * @param {number} [fromIndex=0] The index to search from.
  8060. * @returns {number} Returns the index of the matched value, else `-1`.
  8061. * @example
  8062. *
  8063. * _.indexOf([1, 2, 1, 2], 2);
  8064. * // => 1
  8065. *
  8066. * // Search from the `fromIndex`.
  8067. * _.indexOf([1, 2, 1, 2], 2, 2);
  8068. * // => 3
  8069. */
  8070. function indexOf(array, value, fromIndex) {
  8071. var length = array == null ? 0 : array.length;
  8072. if (!length) {
  8073. return -1;
  8074. }
  8075. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8076. if (index < 0) {
  8077. index = nativeMax(length + index, 0);
  8078. }
  8079. return baseIndexOf(array, value, index);
  8080. }
  8081. /**
  8082. * Gets all but the last element of `array`.
  8083. *
  8084. * @static
  8085. * @memberOf _
  8086. * @since 0.1.0
  8087. * @category Array
  8088. * @param {Array} array The array to query.
  8089. * @returns {Array} Returns the slice of `array`.
  8090. * @example
  8091. *
  8092. * _.initial([1, 2, 3]);
  8093. * // => [1, 2]
  8094. */
  8095. function initial(array) {
  8096. var length = array == null ? 0 : array.length;
  8097. return length ? baseSlice(array, 0, -1) : [];
  8098. }
  8099. /**
  8100. * Creates an array of unique values that are included in all given arrays
  8101. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8102. * for equality comparisons. The order and references of result values are
  8103. * determined by the first array.
  8104. *
  8105. * @static
  8106. * @memberOf _
  8107. * @since 0.1.0
  8108. * @category Array
  8109. * @param {...Array} [arrays] The arrays to inspect.
  8110. * @returns {Array} Returns the new array of intersecting values.
  8111. * @example
  8112. *
  8113. * _.intersection([2, 1], [2, 3]);
  8114. * // => [2]
  8115. */
  8116. var intersection = baseRest(function(arrays) {
  8117. var mapped = arrayMap(arrays, castArrayLikeObject);
  8118. return (mapped.length && mapped[0] === arrays[0])
  8119. ? baseIntersection(mapped)
  8120. : [];
  8121. });
  8122. /**
  8123. * This method is like `_.intersection` except that it accepts `iteratee`
  8124. * which is invoked for each element of each `arrays` to generate the criterion
  8125. * by which they're compared. The order and references of result values are
  8126. * determined by the first array. The iteratee is invoked with one argument:
  8127. * (value).
  8128. *
  8129. * @static
  8130. * @memberOf _
  8131. * @since 4.0.0
  8132. * @category Array
  8133. * @param {...Array} [arrays] The arrays to inspect.
  8134. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8135. * @returns {Array} Returns the new array of intersecting values.
  8136. * @example
  8137. *
  8138. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8139. * // => [2.1]
  8140. *
  8141. * // The `_.property` iteratee shorthand.
  8142. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8143. * // => [{ 'x': 1 }]
  8144. */
  8145. var intersectionBy = baseRest(function(arrays) {
  8146. var iteratee = last(arrays),
  8147. mapped = arrayMap(arrays, castArrayLikeObject);
  8148. if (iteratee === last(mapped)) {
  8149. iteratee = undefined;
  8150. } else {
  8151. mapped.pop();
  8152. }
  8153. return (mapped.length && mapped[0] === arrays[0])
  8154. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8155. : [];
  8156. });
  8157. /**
  8158. * This method is like `_.intersection` except that it accepts `comparator`
  8159. * which is invoked to compare elements of `arrays`. The order and references
  8160. * of result values are determined by the first array. The comparator is
  8161. * invoked with two arguments: (arrVal, othVal).
  8162. *
  8163. * @static
  8164. * @memberOf _
  8165. * @since 4.0.0
  8166. * @category Array
  8167. * @param {...Array} [arrays] The arrays to inspect.
  8168. * @param {Function} [comparator] The comparator invoked per element.
  8169. * @returns {Array} Returns the new array of intersecting values.
  8170. * @example
  8171. *
  8172. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8173. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8174. *
  8175. * _.intersectionWith(objects, others, _.isEqual);
  8176. * // => [{ 'x': 1, 'y': 2 }]
  8177. */
  8178. var intersectionWith = baseRest(function(arrays) {
  8179. var comparator = last(arrays),
  8180. mapped = arrayMap(arrays, castArrayLikeObject);
  8181. comparator = typeof comparator == 'function' ? comparator : undefined;
  8182. if (comparator) {
  8183. mapped.pop();
  8184. }
  8185. return (mapped.length && mapped[0] === arrays[0])
  8186. ? baseIntersection(mapped, undefined, comparator)
  8187. : [];
  8188. });
  8189. /**
  8190. * Converts all elements in `array` into a string separated by `separator`.
  8191. *
  8192. * @static
  8193. * @memberOf _
  8194. * @since 4.0.0
  8195. * @category Array
  8196. * @param {Array} array The array to convert.
  8197. * @param {string} [separator=','] The element separator.
  8198. * @returns {string} Returns the joined string.
  8199. * @example
  8200. *
  8201. * _.join(['a', 'b', 'c'], '~');
  8202. * // => 'a~b~c'
  8203. */
  8204. function join(array, separator) {
  8205. return array == null ? '' : nativeJoin.call(array, separator);
  8206. }
  8207. /**
  8208. * Gets the last element of `array`.
  8209. *
  8210. * @static
  8211. * @memberOf _
  8212. * @since 0.1.0
  8213. * @category Array
  8214. * @param {Array} array The array to query.
  8215. * @returns {*} Returns the last element of `array`.
  8216. * @example
  8217. *
  8218. * _.last([1, 2, 3]);
  8219. * // => 3
  8220. */
  8221. function last(array) {
  8222. var length = array == null ? 0 : array.length;
  8223. return length ? array[length - 1] : undefined;
  8224. }
  8225. /**
  8226. * This method is like `_.indexOf` except that it iterates over elements of
  8227. * `array` from right to left.
  8228. *
  8229. * @static
  8230. * @memberOf _
  8231. * @since 0.1.0
  8232. * @category Array
  8233. * @param {Array} array The array to inspect.
  8234. * @param {*} value The value to search for.
  8235. * @param {number} [fromIndex=array.length-1] The index to search from.
  8236. * @returns {number} Returns the index of the matched value, else `-1`.
  8237. * @example
  8238. *
  8239. * _.lastIndexOf([1, 2, 1, 2], 2);
  8240. * // => 3
  8241. *
  8242. * // Search from the `fromIndex`.
  8243. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8244. * // => 1
  8245. */
  8246. function lastIndexOf(array, value, fromIndex) {
  8247. var length = array == null ? 0 : array.length;
  8248. if (!length) {
  8249. return -1;
  8250. }
  8251. var index = length;
  8252. if (fromIndex !== undefined) {
  8253. index = toInteger(fromIndex);
  8254. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8255. }
  8256. return value === value
  8257. ? strictLastIndexOf(array, value, index)
  8258. : baseFindIndex(array, baseIsNaN, index, true);
  8259. }
  8260. /**
  8261. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8262. * element from the end is returned.
  8263. *
  8264. * @static
  8265. * @memberOf _
  8266. * @since 4.11.0
  8267. * @category Array
  8268. * @param {Array} array The array to query.
  8269. * @param {number} [n=0] The index of the element to return.
  8270. * @returns {*} Returns the nth element of `array`.
  8271. * @example
  8272. *
  8273. * var array = ['a', 'b', 'c', 'd'];
  8274. *
  8275. * _.nth(array, 1);
  8276. * // => 'b'
  8277. *
  8278. * _.nth(array, -2);
  8279. * // => 'c';
  8280. */
  8281. function nth(array, n) {
  8282. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8283. }
  8284. /**
  8285. * Removes all given values from `array` using
  8286. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8287. * for equality comparisons.
  8288. *
  8289. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8290. * to remove elements from an array by predicate.
  8291. *
  8292. * @static
  8293. * @memberOf _
  8294. * @since 2.0.0
  8295. * @category Array
  8296. * @param {Array} array The array to modify.
  8297. * @param {...*} [values] The values to remove.
  8298. * @returns {Array} Returns `array`.
  8299. * @example
  8300. *
  8301. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8302. *
  8303. * _.pull(array, 'a', 'c');
  8304. * console.log(array);
  8305. * // => ['b', 'b']
  8306. */
  8307. var pull = baseRest(pullAll);
  8308. /**
  8309. * This method is like `_.pull` except that it accepts an array of values to remove.
  8310. *
  8311. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8312. *
  8313. * @static
  8314. * @memberOf _
  8315. * @since 4.0.0
  8316. * @category Array
  8317. * @param {Array} array The array to modify.
  8318. * @param {Array} values The values to remove.
  8319. * @returns {Array} Returns `array`.
  8320. * @example
  8321. *
  8322. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8323. *
  8324. * _.pullAll(array, ['a', 'c']);
  8325. * console.log(array);
  8326. * // => ['b', 'b']
  8327. */
  8328. function pullAll(array, values) {
  8329. return (array && array.length && values && values.length)
  8330. ? basePullAll(array, values)
  8331. : array;
  8332. }
  8333. /**
  8334. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8335. * invoked for each element of `array` and `values` to generate the criterion
  8336. * by which they're compared. The iteratee is invoked with one argument: (value).
  8337. *
  8338. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8339. *
  8340. * @static
  8341. * @memberOf _
  8342. * @since 4.0.0
  8343. * @category Array
  8344. * @param {Array} array The array to modify.
  8345. * @param {Array} values The values to remove.
  8346. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8347. * @returns {Array} Returns `array`.
  8348. * @example
  8349. *
  8350. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8351. *
  8352. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8353. * console.log(array);
  8354. * // => [{ 'x': 2 }]
  8355. */
  8356. function pullAllBy(array, values, iteratee) {
  8357. return (array && array.length && values && values.length)
  8358. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8359. : array;
  8360. }
  8361. /**
  8362. * This method is like `_.pullAll` except that it accepts `comparator` which
  8363. * is invoked to compare elements of `array` to `values`. The comparator is
  8364. * invoked with two arguments: (arrVal, othVal).
  8365. *
  8366. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8367. *
  8368. * @static
  8369. * @memberOf _
  8370. * @since 4.6.0
  8371. * @category Array
  8372. * @param {Array} array The array to modify.
  8373. * @param {Array} values The values to remove.
  8374. * @param {Function} [comparator] The comparator invoked per element.
  8375. * @returns {Array} Returns `array`.
  8376. * @example
  8377. *
  8378. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8379. *
  8380. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8381. * console.log(array);
  8382. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8383. */
  8384. function pullAllWith(array, values, comparator) {
  8385. return (array && array.length && values && values.length)
  8386. ? basePullAll(array, values, undefined, comparator)
  8387. : array;
  8388. }
  8389. /**
  8390. * Removes elements from `array` corresponding to `indexes` and returns an
  8391. * array of removed elements.
  8392. *
  8393. * **Note:** Unlike `_.at`, this method mutates `array`.
  8394. *
  8395. * @static
  8396. * @memberOf _
  8397. * @since 3.0.0
  8398. * @category Array
  8399. * @param {Array} array The array to modify.
  8400. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8401. * @returns {Array} Returns the new array of removed elements.
  8402. * @example
  8403. *
  8404. * var array = ['a', 'b', 'c', 'd'];
  8405. * var pulled = _.pullAt(array, [1, 3]);
  8406. *
  8407. * console.log(array);
  8408. * // => ['a', 'c']
  8409. *
  8410. * console.log(pulled);
  8411. * // => ['b', 'd']
  8412. */
  8413. var pullAt = flatRest(function(array, indexes) {
  8414. var length = array == null ? 0 : array.length,
  8415. result = baseAt(array, indexes);
  8416. basePullAt(array, arrayMap(indexes, function(index) {
  8417. return isIndex(index, length) ? +index : index;
  8418. }).sort(compareAscending));
  8419. return result;
  8420. });
  8421. /**
  8422. * Removes all elements from `array` that `predicate` returns truthy for
  8423. * and returns an array of the removed elements. The predicate is invoked
  8424. * with three arguments: (value, index, array).
  8425. *
  8426. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8427. * to pull elements from an array by value.
  8428. *
  8429. * @static
  8430. * @memberOf _
  8431. * @since 2.0.0
  8432. * @category Array
  8433. * @param {Array} array The array to modify.
  8434. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8435. * @returns {Array} Returns the new array of removed elements.
  8436. * @example
  8437. *
  8438. * var array = [1, 2, 3, 4];
  8439. * var evens = _.remove(array, function(n) {
  8440. * return n % 2 == 0;
  8441. * });
  8442. *
  8443. * console.log(array);
  8444. * // => [1, 3]
  8445. *
  8446. * console.log(evens);
  8447. * // => [2, 4]
  8448. */
  8449. function remove(array, predicate) {
  8450. var result = [];
  8451. if (!(array && array.length)) {
  8452. return result;
  8453. }
  8454. var index = -1,
  8455. indexes = [],
  8456. length = array.length;
  8457. predicate = getIteratee(predicate, 3);
  8458. while (++index < length) {
  8459. var value = array[index];
  8460. if (predicate(value, index, array)) {
  8461. result.push(value);
  8462. indexes.push(index);
  8463. }
  8464. }
  8465. basePullAt(array, indexes);
  8466. return result;
  8467. }
  8468. /**
  8469. * Reverses `array` so that the first element becomes the last, the second
  8470. * element becomes the second to last, and so on.
  8471. *
  8472. * **Note:** This method mutates `array` and is based on
  8473. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8474. *
  8475. * @static
  8476. * @memberOf _
  8477. * @since 4.0.0
  8478. * @category Array
  8479. * @param {Array} array The array to modify.
  8480. * @returns {Array} Returns `array`.
  8481. * @example
  8482. *
  8483. * var array = [1, 2, 3];
  8484. *
  8485. * _.reverse(array);
  8486. * // => [3, 2, 1]
  8487. *
  8488. * console.log(array);
  8489. * // => [3, 2, 1]
  8490. */
  8491. function reverse(array) {
  8492. return array == null ? array : nativeReverse.call(array);
  8493. }
  8494. /**
  8495. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8496. *
  8497. * **Note:** This method is used instead of
  8498. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8499. * returned.
  8500. *
  8501. * @static
  8502. * @memberOf _
  8503. * @since 3.0.0
  8504. * @category Array
  8505. * @param {Array} array The array to slice.
  8506. * @param {number} [start=0] The start position.
  8507. * @param {number} [end=array.length] The end position.
  8508. * @returns {Array} Returns the slice of `array`.
  8509. */
  8510. function slice(array, start, end) {
  8511. var length = array == null ? 0 : array.length;
  8512. if (!length) {
  8513. return [];
  8514. }
  8515. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8516. start = 0;
  8517. end = length;
  8518. }
  8519. else {
  8520. start = start == null ? 0 : toInteger(start);
  8521. end = end === undefined ? length : toInteger(end);
  8522. }
  8523. return baseSlice(array, start, end);
  8524. }
  8525. /**
  8526. * Uses a binary search to determine the lowest index at which `value`
  8527. * should be inserted into `array` in order to maintain its sort order.
  8528. *
  8529. * @static
  8530. * @memberOf _
  8531. * @since 0.1.0
  8532. * @category Array
  8533. * @param {Array} array The sorted array to inspect.
  8534. * @param {*} value The value to evaluate.
  8535. * @returns {number} Returns the index at which `value` should be inserted
  8536. * into `array`.
  8537. * @example
  8538. *
  8539. * _.sortedIndex([30, 50], 40);
  8540. * // => 1
  8541. */
  8542. function sortedIndex(array, value) {
  8543. return baseSortedIndex(array, value);
  8544. }
  8545. /**
  8546. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8547. * which is invoked for `value` and each element of `array` to compute their
  8548. * sort ranking. The iteratee is invoked with one argument: (value).
  8549. *
  8550. * @static
  8551. * @memberOf _
  8552. * @since 4.0.0
  8553. * @category Array
  8554. * @param {Array} array The sorted array to inspect.
  8555. * @param {*} value The value to evaluate.
  8556. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8557. * @returns {number} Returns the index at which `value` should be inserted
  8558. * into `array`.
  8559. * @example
  8560. *
  8561. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8562. *
  8563. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8564. * // => 0
  8565. *
  8566. * // The `_.property` iteratee shorthand.
  8567. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8568. * // => 0
  8569. */
  8570. function sortedIndexBy(array, value, iteratee) {
  8571. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8572. }
  8573. /**
  8574. * This method is like `_.indexOf` except that it performs a binary
  8575. * search on a sorted `array`.
  8576. *
  8577. * @static
  8578. * @memberOf _
  8579. * @since 4.0.0
  8580. * @category Array
  8581. * @param {Array} array The array to inspect.
  8582. * @param {*} value The value to search for.
  8583. * @returns {number} Returns the index of the matched value, else `-1`.
  8584. * @example
  8585. *
  8586. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8587. * // => 1
  8588. */
  8589. function sortedIndexOf(array, value) {
  8590. var length = array == null ? 0 : array.length;
  8591. if (length) {
  8592. var index = baseSortedIndex(array, value);
  8593. if (index < length && eq(array[index], value)) {
  8594. return index;
  8595. }
  8596. }
  8597. return -1;
  8598. }
  8599. /**
  8600. * This method is like `_.sortedIndex` except that it returns the highest
  8601. * index at which `value` should be inserted into `array` in order to
  8602. * maintain its sort order.
  8603. *
  8604. * @static
  8605. * @memberOf _
  8606. * @since 3.0.0
  8607. * @category Array
  8608. * @param {Array} array The sorted array to inspect.
  8609. * @param {*} value The value to evaluate.
  8610. * @returns {number} Returns the index at which `value` should be inserted
  8611. * into `array`.
  8612. * @example
  8613. *
  8614. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8615. * // => 4
  8616. */
  8617. function sortedLastIndex(array, value) {
  8618. return baseSortedIndex(array, value, true);
  8619. }
  8620. /**
  8621. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8622. * which is invoked for `value` and each element of `array` to compute their
  8623. * sort ranking. The iteratee is invoked with one argument: (value).
  8624. *
  8625. * @static
  8626. * @memberOf _
  8627. * @since 4.0.0
  8628. * @category Array
  8629. * @param {Array} array The sorted array to inspect.
  8630. * @param {*} value The value to evaluate.
  8631. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8632. * @returns {number} Returns the index at which `value` should be inserted
  8633. * into `array`.
  8634. * @example
  8635. *
  8636. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8637. *
  8638. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8639. * // => 1
  8640. *
  8641. * // The `_.property` iteratee shorthand.
  8642. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8643. * // => 1
  8644. */
  8645. function sortedLastIndexBy(array, value, iteratee) {
  8646. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8647. }
  8648. /**
  8649. * This method is like `_.lastIndexOf` except that it performs a binary
  8650. * search on a sorted `array`.
  8651. *
  8652. * @static
  8653. * @memberOf _
  8654. * @since 4.0.0
  8655. * @category Array
  8656. * @param {Array} array The array to inspect.
  8657. * @param {*} value The value to search for.
  8658. * @returns {number} Returns the index of the matched value, else `-1`.
  8659. * @example
  8660. *
  8661. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8662. * // => 3
  8663. */
  8664. function sortedLastIndexOf(array, value) {
  8665. var length = array == null ? 0 : array.length;
  8666. if (length) {
  8667. var index = baseSortedIndex(array, value, true) - 1;
  8668. if (eq(array[index], value)) {
  8669. return index;
  8670. }
  8671. }
  8672. return -1;
  8673. }
  8674. /**
  8675. * This method is like `_.uniq` except that it's designed and optimized
  8676. * for sorted arrays.
  8677. *
  8678. * @static
  8679. * @memberOf _
  8680. * @since 4.0.0
  8681. * @category Array
  8682. * @param {Array} array The array to inspect.
  8683. * @returns {Array} Returns the new duplicate free array.
  8684. * @example
  8685. *
  8686. * _.sortedUniq([1, 1, 2]);
  8687. * // => [1, 2]
  8688. */
  8689. function sortedUniq(array) {
  8690. return (array && array.length)
  8691. ? baseSortedUniq(array)
  8692. : [];
  8693. }
  8694. /**
  8695. * This method is like `_.uniqBy` except that it's designed and optimized
  8696. * for sorted arrays.
  8697. *
  8698. * @static
  8699. * @memberOf _
  8700. * @since 4.0.0
  8701. * @category Array
  8702. * @param {Array} array The array to inspect.
  8703. * @param {Function} [iteratee] The iteratee invoked per element.
  8704. * @returns {Array} Returns the new duplicate free array.
  8705. * @example
  8706. *
  8707. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8708. * // => [1.1, 2.3]
  8709. */
  8710. function sortedUniqBy(array, iteratee) {
  8711. return (array && array.length)
  8712. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8713. : [];
  8714. }
  8715. /**
  8716. * Gets all but the first element of `array`.
  8717. *
  8718. * @static
  8719. * @memberOf _
  8720. * @since 4.0.0
  8721. * @category Array
  8722. * @param {Array} array The array to query.
  8723. * @returns {Array} Returns the slice of `array`.
  8724. * @example
  8725. *
  8726. * _.tail([1, 2, 3]);
  8727. * // => [2, 3]
  8728. */
  8729. function tail(array) {
  8730. var length = array == null ? 0 : array.length;
  8731. return length ? baseSlice(array, 1, length) : [];
  8732. }
  8733. /**
  8734. * Creates a slice of `array` with `n` elements taken from the beginning.
  8735. *
  8736. * @static
  8737. * @memberOf _
  8738. * @since 0.1.0
  8739. * @category Array
  8740. * @param {Array} array The array to query.
  8741. * @param {number} [n=1] The number of elements to take.
  8742. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8743. * @returns {Array} Returns the slice of `array`.
  8744. * @example
  8745. *
  8746. * _.take([1, 2, 3]);
  8747. * // => [1]
  8748. *
  8749. * _.take([1, 2, 3], 2);
  8750. * // => [1, 2]
  8751. *
  8752. * _.take([1, 2, 3], 5);
  8753. * // => [1, 2, 3]
  8754. *
  8755. * _.take([1, 2, 3], 0);
  8756. * // => []
  8757. */
  8758. function take(array, n, guard) {
  8759. if (!(array && array.length)) {
  8760. return [];
  8761. }
  8762. n = (guard || n === undefined) ? 1 : toInteger(n);
  8763. return baseSlice(array, 0, n < 0 ? 0 : n);
  8764. }
  8765. /**
  8766. * Creates a slice of `array` with `n` elements taken from the end.
  8767. *
  8768. * @static
  8769. * @memberOf _
  8770. * @since 3.0.0
  8771. * @category Array
  8772. * @param {Array} array The array to query.
  8773. * @param {number} [n=1] The number of elements to take.
  8774. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8775. * @returns {Array} Returns the slice of `array`.
  8776. * @example
  8777. *
  8778. * _.takeRight([1, 2, 3]);
  8779. * // => [3]
  8780. *
  8781. * _.takeRight([1, 2, 3], 2);
  8782. * // => [2, 3]
  8783. *
  8784. * _.takeRight([1, 2, 3], 5);
  8785. * // => [1, 2, 3]
  8786. *
  8787. * _.takeRight([1, 2, 3], 0);
  8788. * // => []
  8789. */
  8790. function takeRight(array, n, guard) {
  8791. var length = array == null ? 0 : array.length;
  8792. if (!length) {
  8793. return [];
  8794. }
  8795. n = (guard || n === undefined) ? 1 : toInteger(n);
  8796. n = length - n;
  8797. return baseSlice(array, n < 0 ? 0 : n, length);
  8798. }
  8799. /**
  8800. * Creates a slice of `array` with elements taken from the end. Elements are
  8801. * taken until `predicate` returns falsey. The predicate is invoked with
  8802. * three arguments: (value, index, array).
  8803. *
  8804. * @static
  8805. * @memberOf _
  8806. * @since 3.0.0
  8807. * @category Array
  8808. * @param {Array} array The array to query.
  8809. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8810. * @returns {Array} Returns the slice of `array`.
  8811. * @example
  8812. *
  8813. * var users = [
  8814. * { 'user': 'barney', 'active': true },
  8815. * { 'user': 'fred', 'active': false },
  8816. * { 'user': 'pebbles', 'active': false }
  8817. * ];
  8818. *
  8819. * _.takeRightWhile(users, function(o) { return !o.active; });
  8820. * // => objects for ['fred', 'pebbles']
  8821. *
  8822. * // The `_.matches` iteratee shorthand.
  8823. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8824. * // => objects for ['pebbles']
  8825. *
  8826. * // The `_.matchesProperty` iteratee shorthand.
  8827. * _.takeRightWhile(users, ['active', false]);
  8828. * // => objects for ['fred', 'pebbles']
  8829. *
  8830. * // The `_.property` iteratee shorthand.
  8831. * _.takeRightWhile(users, 'active');
  8832. * // => []
  8833. */
  8834. function takeRightWhile(array, predicate) {
  8835. return (array && array.length)
  8836. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8837. : [];
  8838. }
  8839. /**
  8840. * Creates a slice of `array` with elements taken from the beginning. Elements
  8841. * are taken until `predicate` returns falsey. The predicate is invoked with
  8842. * three arguments: (value, index, array).
  8843. *
  8844. * @static
  8845. * @memberOf _
  8846. * @since 3.0.0
  8847. * @category Array
  8848. * @param {Array} array The array to query.
  8849. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8850. * @returns {Array} Returns the slice of `array`.
  8851. * @example
  8852. *
  8853. * var users = [
  8854. * { 'user': 'barney', 'active': false },
  8855. * { 'user': 'fred', 'active': false },
  8856. * { 'user': 'pebbles', 'active': true }
  8857. * ];
  8858. *
  8859. * _.takeWhile(users, function(o) { return !o.active; });
  8860. * // => objects for ['barney', 'fred']
  8861. *
  8862. * // The `_.matches` iteratee shorthand.
  8863. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8864. * // => objects for ['barney']
  8865. *
  8866. * // The `_.matchesProperty` iteratee shorthand.
  8867. * _.takeWhile(users, ['active', false]);
  8868. * // => objects for ['barney', 'fred']
  8869. *
  8870. * // The `_.property` iteratee shorthand.
  8871. * _.takeWhile(users, 'active');
  8872. * // => []
  8873. */
  8874. function takeWhile(array, predicate) {
  8875. return (array && array.length)
  8876. ? baseWhile(array, getIteratee(predicate, 3))
  8877. : [];
  8878. }
  8879. /**
  8880. * Creates an array of unique values, in order, from all given arrays using
  8881. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8882. * for equality comparisons.
  8883. *
  8884. * @static
  8885. * @memberOf _
  8886. * @since 0.1.0
  8887. * @category Array
  8888. * @param {...Array} [arrays] The arrays to inspect.
  8889. * @returns {Array} Returns the new array of combined values.
  8890. * @example
  8891. *
  8892. * _.union([2], [1, 2]);
  8893. * // => [2, 1]
  8894. */
  8895. var union = baseRest(function(arrays) {
  8896. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8897. });
  8898. /**
  8899. * This method is like `_.union` except that it accepts `iteratee` which is
  8900. * invoked for each element of each `arrays` to generate the criterion by
  8901. * which uniqueness is computed. Result values are chosen from the first
  8902. * array in which the value occurs. The iteratee is invoked with one argument:
  8903. * (value).
  8904. *
  8905. * @static
  8906. * @memberOf _
  8907. * @since 4.0.0
  8908. * @category Array
  8909. * @param {...Array} [arrays] The arrays to inspect.
  8910. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8911. * @returns {Array} Returns the new array of combined values.
  8912. * @example
  8913. *
  8914. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8915. * // => [2.1, 1.2]
  8916. *
  8917. * // The `_.property` iteratee shorthand.
  8918. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8919. * // => [{ 'x': 1 }, { 'x': 2 }]
  8920. */
  8921. var unionBy = baseRest(function(arrays) {
  8922. var iteratee = last(arrays);
  8923. if (isArrayLikeObject(iteratee)) {
  8924. iteratee = undefined;
  8925. }
  8926. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8927. });
  8928. /**
  8929. * This method is like `_.union` except that it accepts `comparator` which
  8930. * is invoked to compare elements of `arrays`. Result values are chosen from
  8931. * the first array in which the value occurs. The comparator is invoked
  8932. * with two arguments: (arrVal, othVal).
  8933. *
  8934. * @static
  8935. * @memberOf _
  8936. * @since 4.0.0
  8937. * @category Array
  8938. * @param {...Array} [arrays] The arrays to inspect.
  8939. * @param {Function} [comparator] The comparator invoked per element.
  8940. * @returns {Array} Returns the new array of combined values.
  8941. * @example
  8942. *
  8943. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8944. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8945. *
  8946. * _.unionWith(objects, others, _.isEqual);
  8947. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8948. */
  8949. var unionWith = baseRest(function(arrays) {
  8950. var comparator = last(arrays);
  8951. comparator = typeof comparator == 'function' ? comparator : undefined;
  8952. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8953. });
  8954. /**
  8955. * Creates a duplicate-free version of an array, using
  8956. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8957. * for equality comparisons, in which only the first occurrence of each element
  8958. * is kept. The order of result values is determined by the order they occur
  8959. * in the array.
  8960. *
  8961. * @static
  8962. * @memberOf _
  8963. * @since 0.1.0
  8964. * @category Array
  8965. * @param {Array} array The array to inspect.
  8966. * @returns {Array} Returns the new duplicate free array.
  8967. * @example
  8968. *
  8969. * _.uniq([2, 1, 2]);
  8970. * // => [2, 1]
  8971. */
  8972. function uniq(array) {
  8973. return (array && array.length) ? baseUniq(array) : [];
  8974. }
  8975. /**
  8976. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8977. * invoked for each element in `array` to generate the criterion by which
  8978. * uniqueness is computed. The order of result values is determined by the
  8979. * order they occur in the array. The iteratee is invoked with one argument:
  8980. * (value).
  8981. *
  8982. * @static
  8983. * @memberOf _
  8984. * @since 4.0.0
  8985. * @category Array
  8986. * @param {Array} array The array to inspect.
  8987. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8988. * @returns {Array} Returns the new duplicate free array.
  8989. * @example
  8990. *
  8991. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8992. * // => [2.1, 1.2]
  8993. *
  8994. * // The `_.property` iteratee shorthand.
  8995. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8996. * // => [{ 'x': 1 }, { 'x': 2 }]
  8997. */
  8998. function uniqBy(array, iteratee) {
  8999. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9000. }
  9001. /**
  9002. * This method is like `_.uniq` except that it accepts `comparator` which
  9003. * is invoked to compare elements of `array`. The order of result values is
  9004. * determined by the order they occur in the array.The comparator is invoked
  9005. * with two arguments: (arrVal, othVal).
  9006. *
  9007. * @static
  9008. * @memberOf _
  9009. * @since 4.0.0
  9010. * @category Array
  9011. * @param {Array} array The array to inspect.
  9012. * @param {Function} [comparator] The comparator invoked per element.
  9013. * @returns {Array} Returns the new duplicate free array.
  9014. * @example
  9015. *
  9016. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9017. *
  9018. * _.uniqWith(objects, _.isEqual);
  9019. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9020. */
  9021. function uniqWith(array, comparator) {
  9022. comparator = typeof comparator == 'function' ? comparator : undefined;
  9023. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9024. }
  9025. /**
  9026. * This method is like `_.zip` except that it accepts an array of grouped
  9027. * elements and creates an array regrouping the elements to their pre-zip
  9028. * configuration.
  9029. *
  9030. * @static
  9031. * @memberOf _
  9032. * @since 1.2.0
  9033. * @category Array
  9034. * @param {Array} array The array of grouped elements to process.
  9035. * @returns {Array} Returns the new array of regrouped elements.
  9036. * @example
  9037. *
  9038. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9039. * // => [['a', 1, true], ['b', 2, false]]
  9040. *
  9041. * _.unzip(zipped);
  9042. * // => [['a', 'b'], [1, 2], [true, false]]
  9043. */
  9044. function unzip(array) {
  9045. if (!(array && array.length)) {
  9046. return [];
  9047. }
  9048. var length = 0;
  9049. array = arrayFilter(array, function(group) {
  9050. if (isArrayLikeObject(group)) {
  9051. length = nativeMax(group.length, length);
  9052. return true;
  9053. }
  9054. });
  9055. return baseTimes(length, function(index) {
  9056. return arrayMap(array, baseProperty(index));
  9057. });
  9058. }
  9059. /**
  9060. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9061. * how regrouped values should be combined. The iteratee is invoked with the
  9062. * elements of each group: (...group).
  9063. *
  9064. * @static
  9065. * @memberOf _
  9066. * @since 3.8.0
  9067. * @category Array
  9068. * @param {Array} array The array of grouped elements to process.
  9069. * @param {Function} [iteratee=_.identity] The function to combine
  9070. * regrouped values.
  9071. * @returns {Array} Returns the new array of regrouped elements.
  9072. * @example
  9073. *
  9074. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9075. * // => [[1, 10, 100], [2, 20, 200]]
  9076. *
  9077. * _.unzipWith(zipped, _.add);
  9078. * // => [3, 30, 300]
  9079. */
  9080. function unzipWith(array, iteratee) {
  9081. if (!(array && array.length)) {
  9082. return [];
  9083. }
  9084. var result = unzip(array);
  9085. if (iteratee == null) {
  9086. return result;
  9087. }
  9088. return arrayMap(result, function(group) {
  9089. return apply(iteratee, undefined, group);
  9090. });
  9091. }
  9092. /**
  9093. * Creates an array excluding all given values using
  9094. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9095. * for equality comparisons.
  9096. *
  9097. * **Note:** Unlike `_.pull`, this method returns a new array.
  9098. *
  9099. * @static
  9100. * @memberOf _
  9101. * @since 0.1.0
  9102. * @category Array
  9103. * @param {Array} array The array to inspect.
  9104. * @param {...*} [values] The values to exclude.
  9105. * @returns {Array} Returns the new array of filtered values.
  9106. * @see _.difference, _.xor
  9107. * @example
  9108. *
  9109. * _.without([2, 1, 2, 3], 1, 2);
  9110. * // => [3]
  9111. */
  9112. var without = baseRest(function(array, values) {
  9113. return isArrayLikeObject(array)
  9114. ? baseDifference(array, values)
  9115. : [];
  9116. });
  9117. /**
  9118. * Creates an array of unique values that is the
  9119. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9120. * of the given arrays. The order of result values is determined by the order
  9121. * they occur in the arrays.
  9122. *
  9123. * @static
  9124. * @memberOf _
  9125. * @since 2.4.0
  9126. * @category Array
  9127. * @param {...Array} [arrays] The arrays to inspect.
  9128. * @returns {Array} Returns the new array of filtered values.
  9129. * @see _.difference, _.without
  9130. * @example
  9131. *
  9132. * _.xor([2, 1], [2, 3]);
  9133. * // => [1, 3]
  9134. */
  9135. var xor = baseRest(function(arrays) {
  9136. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9137. });
  9138. /**
  9139. * This method is like `_.xor` except that it accepts `iteratee` which is
  9140. * invoked for each element of each `arrays` to generate the criterion by
  9141. * which by which they're compared. The order of result values is determined
  9142. * by the order they occur in the arrays. The iteratee is invoked with one
  9143. * argument: (value).
  9144. *
  9145. * @static
  9146. * @memberOf _
  9147. * @since 4.0.0
  9148. * @category Array
  9149. * @param {...Array} [arrays] The arrays to inspect.
  9150. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9151. * @returns {Array} Returns the new array of filtered values.
  9152. * @example
  9153. *
  9154. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9155. * // => [1.2, 3.4]
  9156. *
  9157. * // The `_.property` iteratee shorthand.
  9158. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9159. * // => [{ 'x': 2 }]
  9160. */
  9161. var xorBy = baseRest(function(arrays) {
  9162. var iteratee = last(arrays);
  9163. if (isArrayLikeObject(iteratee)) {
  9164. iteratee = undefined;
  9165. }
  9166. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9167. });
  9168. /**
  9169. * This method is like `_.xor` except that it accepts `comparator` which is
  9170. * invoked to compare elements of `arrays`. The order of result values is
  9171. * determined by the order they occur in the arrays. The comparator is invoked
  9172. * with two arguments: (arrVal, othVal).
  9173. *
  9174. * @static
  9175. * @memberOf _
  9176. * @since 4.0.0
  9177. * @category Array
  9178. * @param {...Array} [arrays] The arrays to inspect.
  9179. * @param {Function} [comparator] The comparator invoked per element.
  9180. * @returns {Array} Returns the new array of filtered values.
  9181. * @example
  9182. *
  9183. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9184. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9185. *
  9186. * _.xorWith(objects, others, _.isEqual);
  9187. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9188. */
  9189. var xorWith = baseRest(function(arrays) {
  9190. var comparator = last(arrays);
  9191. comparator = typeof comparator == 'function' ? comparator : undefined;
  9192. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9193. });
  9194. /**
  9195. * Creates an array of grouped elements, the first of which contains the
  9196. * first elements of the given arrays, the second of which contains the
  9197. * second elements of the given arrays, and so on.
  9198. *
  9199. * @static
  9200. * @memberOf _
  9201. * @since 0.1.0
  9202. * @category Array
  9203. * @param {...Array} [arrays] The arrays to process.
  9204. * @returns {Array} Returns the new array of grouped elements.
  9205. * @example
  9206. *
  9207. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9208. * // => [['a', 1, true], ['b', 2, false]]
  9209. */
  9210. var zip = baseRest(unzip);
  9211. /**
  9212. * This method is like `_.fromPairs` except that it accepts two arrays,
  9213. * one of property identifiers and one of corresponding values.
  9214. *
  9215. * @static
  9216. * @memberOf _
  9217. * @since 0.4.0
  9218. * @category Array
  9219. * @param {Array} [props=[]] The property identifiers.
  9220. * @param {Array} [values=[]] The property values.
  9221. * @returns {Object} Returns the new object.
  9222. * @example
  9223. *
  9224. * _.zipObject(['a', 'b'], [1, 2]);
  9225. * // => { 'a': 1, 'b': 2 }
  9226. */
  9227. function zipObject(props, values) {
  9228. return baseZipObject(props || [], values || [], assignValue);
  9229. }
  9230. /**
  9231. * This method is like `_.zipObject` except that it supports property paths.
  9232. *
  9233. * @static
  9234. * @memberOf _
  9235. * @since 4.1.0
  9236. * @category Array
  9237. * @param {Array} [props=[]] The property identifiers.
  9238. * @param {Array} [values=[]] The property values.
  9239. * @returns {Object} Returns the new object.
  9240. * @example
  9241. *
  9242. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9243. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9244. */
  9245. function zipObjectDeep(props, values) {
  9246. return baseZipObject(props || [], values || [], baseSet);
  9247. }
  9248. /**
  9249. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9250. * how grouped values should be combined. The iteratee is invoked with the
  9251. * elements of each group: (...group).
  9252. *
  9253. * @static
  9254. * @memberOf _
  9255. * @since 3.8.0
  9256. * @category Array
  9257. * @param {...Array} [arrays] The arrays to process.
  9258. * @param {Function} [iteratee=_.identity] The function to combine
  9259. * grouped values.
  9260. * @returns {Array} Returns the new array of grouped elements.
  9261. * @example
  9262. *
  9263. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9264. * return a + b + c;
  9265. * });
  9266. * // => [111, 222]
  9267. */
  9268. var zipWith = baseRest(function(arrays) {
  9269. var length = arrays.length,
  9270. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9271. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9272. return unzipWith(arrays, iteratee);
  9273. });
  9274. /*------------------------------------------------------------------------*/
  9275. /**
  9276. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9277. * chain sequences enabled. The result of such sequences must be unwrapped
  9278. * with `_#value`.
  9279. *
  9280. * @static
  9281. * @memberOf _
  9282. * @since 1.3.0
  9283. * @category Seq
  9284. * @param {*} value The value to wrap.
  9285. * @returns {Object} Returns the new `lodash` wrapper instance.
  9286. * @example
  9287. *
  9288. * var users = [
  9289. * { 'user': 'barney', 'age': 36 },
  9290. * { 'user': 'fred', 'age': 40 },
  9291. * { 'user': 'pebbles', 'age': 1 }
  9292. * ];
  9293. *
  9294. * var youngest = _
  9295. * .chain(users)
  9296. * .sortBy('age')
  9297. * .map(function(o) {
  9298. * return o.user + ' is ' + o.age;
  9299. * })
  9300. * .head()
  9301. * .value();
  9302. * // => 'pebbles is 1'
  9303. */
  9304. function chain(value) {
  9305. var result = lodash(value);
  9306. result.__chain__ = true;
  9307. return result;
  9308. }
  9309. /**
  9310. * This method invokes `interceptor` and returns `value`. The interceptor
  9311. * is invoked with one argument; (value). The purpose of this method is to
  9312. * "tap into" a method chain sequence in order to modify intermediate results.
  9313. *
  9314. * @static
  9315. * @memberOf _
  9316. * @since 0.1.0
  9317. * @category Seq
  9318. * @param {*} value The value to provide to `interceptor`.
  9319. * @param {Function} interceptor The function to invoke.
  9320. * @returns {*} Returns `value`.
  9321. * @example
  9322. *
  9323. * _([1, 2, 3])
  9324. * .tap(function(array) {
  9325. * // Mutate input array.
  9326. * array.pop();
  9327. * })
  9328. * .reverse()
  9329. * .value();
  9330. * // => [2, 1]
  9331. */
  9332. function tap(value, interceptor) {
  9333. interceptor(value);
  9334. return value;
  9335. }
  9336. /**
  9337. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9338. * The purpose of this method is to "pass thru" values replacing intermediate
  9339. * results in a method chain sequence.
  9340. *
  9341. * @static
  9342. * @memberOf _
  9343. * @since 3.0.0
  9344. * @category Seq
  9345. * @param {*} value The value to provide to `interceptor`.
  9346. * @param {Function} interceptor The function to invoke.
  9347. * @returns {*} Returns the result of `interceptor`.
  9348. * @example
  9349. *
  9350. * _(' abc ')
  9351. * .chain()
  9352. * .trim()
  9353. * .thru(function(value) {
  9354. * return [value];
  9355. * })
  9356. * .value();
  9357. * // => ['abc']
  9358. */
  9359. function thru(value, interceptor) {
  9360. return interceptor(value);
  9361. }
  9362. /**
  9363. * This method is the wrapper version of `_.at`.
  9364. *
  9365. * @name at
  9366. * @memberOf _
  9367. * @since 1.0.0
  9368. * @category Seq
  9369. * @param {...(string|string[])} [paths] The property paths to pick.
  9370. * @returns {Object} Returns the new `lodash` wrapper instance.
  9371. * @example
  9372. *
  9373. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9374. *
  9375. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9376. * // => [3, 4]
  9377. */
  9378. var wrapperAt = flatRest(function(paths) {
  9379. var length = paths.length,
  9380. start = length ? paths[0] : 0,
  9381. value = this.__wrapped__,
  9382. interceptor = function(object) { return baseAt(object, paths); };
  9383. if (length > 1 || this.__actions__.length ||
  9384. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9385. return this.thru(interceptor);
  9386. }
  9387. value = value.slice(start, +start + (length ? 1 : 0));
  9388. value.__actions__.push({
  9389. 'func': thru,
  9390. 'args': [interceptor],
  9391. 'thisArg': undefined
  9392. });
  9393. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9394. if (length && !array.length) {
  9395. array.push(undefined);
  9396. }
  9397. return array;
  9398. });
  9399. });
  9400. /**
  9401. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9402. *
  9403. * @name chain
  9404. * @memberOf _
  9405. * @since 0.1.0
  9406. * @category Seq
  9407. * @returns {Object} Returns the new `lodash` wrapper instance.
  9408. * @example
  9409. *
  9410. * var users = [
  9411. * { 'user': 'barney', 'age': 36 },
  9412. * { 'user': 'fred', 'age': 40 }
  9413. * ];
  9414. *
  9415. * // A sequence without explicit chaining.
  9416. * _(users).head();
  9417. * // => { 'user': 'barney', 'age': 36 }
  9418. *
  9419. * // A sequence with explicit chaining.
  9420. * _(users)
  9421. * .chain()
  9422. * .head()
  9423. * .pick('user')
  9424. * .value();
  9425. * // => { 'user': 'barney' }
  9426. */
  9427. function wrapperChain() {
  9428. return chain(this);
  9429. }
  9430. /**
  9431. * Executes the chain sequence and returns the wrapped result.
  9432. *
  9433. * @name commit
  9434. * @memberOf _
  9435. * @since 3.2.0
  9436. * @category Seq
  9437. * @returns {Object} Returns the new `lodash` wrapper instance.
  9438. * @example
  9439. *
  9440. * var array = [1, 2];
  9441. * var wrapped = _(array).push(3);
  9442. *
  9443. * console.log(array);
  9444. * // => [1, 2]
  9445. *
  9446. * wrapped = wrapped.commit();
  9447. * console.log(array);
  9448. * // => [1, 2, 3]
  9449. *
  9450. * wrapped.last();
  9451. * // => 3
  9452. *
  9453. * console.log(array);
  9454. * // => [1, 2, 3]
  9455. */
  9456. function wrapperCommit() {
  9457. return new LodashWrapper(this.value(), this.__chain__);
  9458. }
  9459. /**
  9460. * Gets the next value on a wrapped object following the
  9461. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9462. *
  9463. * @name next
  9464. * @memberOf _
  9465. * @since 4.0.0
  9466. * @category Seq
  9467. * @returns {Object} Returns the next iterator value.
  9468. * @example
  9469. *
  9470. * var wrapped = _([1, 2]);
  9471. *
  9472. * wrapped.next();
  9473. * // => { 'done': false, 'value': 1 }
  9474. *
  9475. * wrapped.next();
  9476. * // => { 'done': false, 'value': 2 }
  9477. *
  9478. * wrapped.next();
  9479. * // => { 'done': true, 'value': undefined }
  9480. */
  9481. function wrapperNext() {
  9482. if (this.__values__ === undefined) {
  9483. this.__values__ = toArray(this.value());
  9484. }
  9485. var done = this.__index__ >= this.__values__.length,
  9486. value = done ? undefined : this.__values__[this.__index__++];
  9487. return { 'done': done, 'value': value };
  9488. }
  9489. /**
  9490. * Enables the wrapper to be iterable.
  9491. *
  9492. * @name Symbol.iterator
  9493. * @memberOf _
  9494. * @since 4.0.0
  9495. * @category Seq
  9496. * @returns {Object} Returns the wrapper object.
  9497. * @example
  9498. *
  9499. * var wrapped = _([1, 2]);
  9500. *
  9501. * wrapped[Symbol.iterator]() === wrapped;
  9502. * // => true
  9503. *
  9504. * Array.from(wrapped);
  9505. * // => [1, 2]
  9506. */
  9507. function wrapperToIterator() {
  9508. return this;
  9509. }
  9510. /**
  9511. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9512. *
  9513. * @name plant
  9514. * @memberOf _
  9515. * @since 3.2.0
  9516. * @category Seq
  9517. * @param {*} value The value to plant.
  9518. * @returns {Object} Returns the new `lodash` wrapper instance.
  9519. * @example
  9520. *
  9521. * function square(n) {
  9522. * return n * n;
  9523. * }
  9524. *
  9525. * var wrapped = _([1, 2]).map(square);
  9526. * var other = wrapped.plant([3, 4]);
  9527. *
  9528. * other.value();
  9529. * // => [9, 16]
  9530. *
  9531. * wrapped.value();
  9532. * // => [1, 4]
  9533. */
  9534. function wrapperPlant(value) {
  9535. var result,
  9536. parent = this;
  9537. while (parent instanceof baseLodash) {
  9538. var clone = wrapperClone(parent);
  9539. clone.__index__ = 0;
  9540. clone.__values__ = undefined;
  9541. if (result) {
  9542. previous.__wrapped__ = clone;
  9543. } else {
  9544. result = clone;
  9545. }
  9546. var previous = clone;
  9547. parent = parent.__wrapped__;
  9548. }
  9549. previous.__wrapped__ = value;
  9550. return result;
  9551. }
  9552. /**
  9553. * This method is the wrapper version of `_.reverse`.
  9554. *
  9555. * **Note:** This method mutates the wrapped array.
  9556. *
  9557. * @name reverse
  9558. * @memberOf _
  9559. * @since 0.1.0
  9560. * @category Seq
  9561. * @returns {Object} Returns the new `lodash` wrapper instance.
  9562. * @example
  9563. *
  9564. * var array = [1, 2, 3];
  9565. *
  9566. * _(array).reverse().value()
  9567. * // => [3, 2, 1]
  9568. *
  9569. * console.log(array);
  9570. * // => [3, 2, 1]
  9571. */
  9572. function wrapperReverse() {
  9573. var value = this.__wrapped__;
  9574. if (value instanceof LazyWrapper) {
  9575. var wrapped = value;
  9576. if (this.__actions__.length) {
  9577. wrapped = new LazyWrapper(this);
  9578. }
  9579. wrapped = wrapped.reverse();
  9580. wrapped.__actions__.push({
  9581. 'func': thru,
  9582. 'args': [reverse],
  9583. 'thisArg': undefined
  9584. });
  9585. return new LodashWrapper(wrapped, this.__chain__);
  9586. }
  9587. return this.thru(reverse);
  9588. }
  9589. /**
  9590. * Executes the chain sequence to resolve the unwrapped value.
  9591. *
  9592. * @name value
  9593. * @memberOf _
  9594. * @since 0.1.0
  9595. * @alias toJSON, valueOf
  9596. * @category Seq
  9597. * @returns {*} Returns the resolved unwrapped value.
  9598. * @example
  9599. *
  9600. * _([1, 2, 3]).value();
  9601. * // => [1, 2, 3]
  9602. */
  9603. function wrapperValue() {
  9604. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9605. }
  9606. /*------------------------------------------------------------------------*/
  9607. /**
  9608. * Creates an object composed of keys generated from the results of running
  9609. * each element of `collection` thru `iteratee`. The corresponding value of
  9610. * each key is the number of times the key was returned by `iteratee`. The
  9611. * iteratee is invoked with one argument: (value).
  9612. *
  9613. * @static
  9614. * @memberOf _
  9615. * @since 0.5.0
  9616. * @category Collection
  9617. * @param {Array|Object} collection The collection to iterate over.
  9618. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9619. * @returns {Object} Returns the composed aggregate object.
  9620. * @example
  9621. *
  9622. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9623. * // => { '4': 1, '6': 2 }
  9624. *
  9625. * // The `_.property` iteratee shorthand.
  9626. * _.countBy(['one', 'two', 'three'], 'length');
  9627. * // => { '3': 2, '5': 1 }
  9628. */
  9629. var countBy = createAggregator(function(result, value, key) {
  9630. if (hasOwnProperty.call(result, key)) {
  9631. ++result[key];
  9632. } else {
  9633. baseAssignValue(result, key, 1);
  9634. }
  9635. });
  9636. /**
  9637. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9638. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9639. * invoked with three arguments: (value, index|key, collection).
  9640. *
  9641. * **Note:** This method returns `true` for
  9642. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9643. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9644. * elements of empty collections.
  9645. *
  9646. * @static
  9647. * @memberOf _
  9648. * @since 0.1.0
  9649. * @category Collection
  9650. * @param {Array|Object} collection The collection to iterate over.
  9651. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9652. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9653. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9654. * else `false`.
  9655. * @example
  9656. *
  9657. * _.every([true, 1, null, 'yes'], Boolean);
  9658. * // => false
  9659. *
  9660. * var users = [
  9661. * { 'user': 'barney', 'age': 36, 'active': false },
  9662. * { 'user': 'fred', 'age': 40, 'active': false }
  9663. * ];
  9664. *
  9665. * // The `_.matches` iteratee shorthand.
  9666. * _.every(users, { 'user': 'barney', 'active': false });
  9667. * // => false
  9668. *
  9669. * // The `_.matchesProperty` iteratee shorthand.
  9670. * _.every(users, ['active', false]);
  9671. * // => true
  9672. *
  9673. * // The `_.property` iteratee shorthand.
  9674. * _.every(users, 'active');
  9675. * // => false
  9676. */
  9677. function every(collection, predicate, guard) {
  9678. var func = isArray(collection) ? arrayEvery : baseEvery;
  9679. if (guard && isIterateeCall(collection, predicate, guard)) {
  9680. predicate = undefined;
  9681. }
  9682. return func(collection, getIteratee(predicate, 3));
  9683. }
  9684. /**
  9685. * Iterates over elements of `collection`, returning an array of all elements
  9686. * `predicate` returns truthy for. The predicate is invoked with three
  9687. * arguments: (value, index|key, collection).
  9688. *
  9689. * **Note:** Unlike `_.remove`, this method returns a new array.
  9690. *
  9691. * @static
  9692. * @memberOf _
  9693. * @since 0.1.0
  9694. * @category Collection
  9695. * @param {Array|Object} collection The collection to iterate over.
  9696. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9697. * @returns {Array} Returns the new filtered array.
  9698. * @see _.reject
  9699. * @example
  9700. *
  9701. * var users = [
  9702. * { 'user': 'barney', 'age': 36, 'active': true },
  9703. * { 'user': 'fred', 'age': 40, 'active': false }
  9704. * ];
  9705. *
  9706. * _.filter(users, function(o) { return !o.active; });
  9707. * // => objects for ['fred']
  9708. *
  9709. * // The `_.matches` iteratee shorthand.
  9710. * _.filter(users, { 'age': 36, 'active': true });
  9711. * // => objects for ['barney']
  9712. *
  9713. * // The `_.matchesProperty` iteratee shorthand.
  9714. * _.filter(users, ['active', false]);
  9715. * // => objects for ['fred']
  9716. *
  9717. * // The `_.property` iteratee shorthand.
  9718. * _.filter(users, 'active');
  9719. * // => objects for ['barney']
  9720. *
  9721. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9722. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9723. * // => objects for ['fred', 'barney']
  9724. */
  9725. function filter(collection, predicate) {
  9726. var func = isArray(collection) ? arrayFilter : baseFilter;
  9727. return func(collection, getIteratee(predicate, 3));
  9728. }
  9729. /**
  9730. * Iterates over elements of `collection`, returning the first element
  9731. * `predicate` returns truthy for. The predicate is invoked with three
  9732. * arguments: (value, index|key, collection).
  9733. *
  9734. * @static
  9735. * @memberOf _
  9736. * @since 0.1.0
  9737. * @category Collection
  9738. * @param {Array|Object} collection The collection to inspect.
  9739. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9740. * @param {number} [fromIndex=0] The index to search from.
  9741. * @returns {*} Returns the matched element, else `undefined`.
  9742. * @example
  9743. *
  9744. * var users = [
  9745. * { 'user': 'barney', 'age': 36, 'active': true },
  9746. * { 'user': 'fred', 'age': 40, 'active': false },
  9747. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9748. * ];
  9749. *
  9750. * _.find(users, function(o) { return o.age < 40; });
  9751. * // => object for 'barney'
  9752. *
  9753. * // The `_.matches` iteratee shorthand.
  9754. * _.find(users, { 'age': 1, 'active': true });
  9755. * // => object for 'pebbles'
  9756. *
  9757. * // The `_.matchesProperty` iteratee shorthand.
  9758. * _.find(users, ['active', false]);
  9759. * // => object for 'fred'
  9760. *
  9761. * // The `_.property` iteratee shorthand.
  9762. * _.find(users, 'active');
  9763. * // => object for 'barney'
  9764. */
  9765. var find = createFind(findIndex);
  9766. /**
  9767. * This method is like `_.find` except that it iterates over elements of
  9768. * `collection` from right to left.
  9769. *
  9770. * @static
  9771. * @memberOf _
  9772. * @since 2.0.0
  9773. * @category Collection
  9774. * @param {Array|Object} collection The collection to inspect.
  9775. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9776. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9777. * @returns {*} Returns the matched element, else `undefined`.
  9778. * @example
  9779. *
  9780. * _.findLast([1, 2, 3, 4], function(n) {
  9781. * return n % 2 == 1;
  9782. * });
  9783. * // => 3
  9784. */
  9785. var findLast = createFind(findLastIndex);
  9786. /**
  9787. * Creates a flattened array of values by running each element in `collection`
  9788. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9789. * with three arguments: (value, index|key, collection).
  9790. *
  9791. * @static
  9792. * @memberOf _
  9793. * @since 4.0.0
  9794. * @category Collection
  9795. * @param {Array|Object} collection The collection to iterate over.
  9796. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9797. * @returns {Array} Returns the new flattened array.
  9798. * @example
  9799. *
  9800. * function duplicate(n) {
  9801. * return [n, n];
  9802. * }
  9803. *
  9804. * _.flatMap([1, 2], duplicate);
  9805. * // => [1, 1, 2, 2]
  9806. */
  9807. function flatMap(collection, iteratee) {
  9808. return baseFlatten(map(collection, iteratee), 1);
  9809. }
  9810. /**
  9811. * This method is like `_.flatMap` except that it recursively flattens the
  9812. * mapped results.
  9813. *
  9814. * @static
  9815. * @memberOf _
  9816. * @since 4.7.0
  9817. * @category Collection
  9818. * @param {Array|Object} collection The collection to iterate over.
  9819. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9820. * @returns {Array} Returns the new flattened array.
  9821. * @example
  9822. *
  9823. * function duplicate(n) {
  9824. * return [[[n, n]]];
  9825. * }
  9826. *
  9827. * _.flatMapDeep([1, 2], duplicate);
  9828. * // => [1, 1, 2, 2]
  9829. */
  9830. function flatMapDeep(collection, iteratee) {
  9831. return baseFlatten(map(collection, iteratee), INFINITY);
  9832. }
  9833. /**
  9834. * This method is like `_.flatMap` except that it recursively flattens the
  9835. * mapped results up to `depth` times.
  9836. *
  9837. * @static
  9838. * @memberOf _
  9839. * @since 4.7.0
  9840. * @category Collection
  9841. * @param {Array|Object} collection The collection to iterate over.
  9842. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9843. * @param {number} [depth=1] The maximum recursion depth.
  9844. * @returns {Array} Returns the new flattened array.
  9845. * @example
  9846. *
  9847. * function duplicate(n) {
  9848. * return [[[n, n]]];
  9849. * }
  9850. *
  9851. * _.flatMapDepth([1, 2], duplicate, 2);
  9852. * // => [[1, 1], [2, 2]]
  9853. */
  9854. function flatMapDepth(collection, iteratee, depth) {
  9855. depth = depth === undefined ? 1 : toInteger(depth);
  9856. return baseFlatten(map(collection, iteratee), depth);
  9857. }
  9858. /**
  9859. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9860. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9861. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9862. *
  9863. * **Note:** As with other "Collections" methods, objects with a "length"
  9864. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9865. * or `_.forOwn` for object iteration.
  9866. *
  9867. * @static
  9868. * @memberOf _
  9869. * @since 0.1.0
  9870. * @alias each
  9871. * @category Collection
  9872. * @param {Array|Object} collection The collection to iterate over.
  9873. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9874. * @returns {Array|Object} Returns `collection`.
  9875. * @see _.forEachRight
  9876. * @example
  9877. *
  9878. * _.forEach([1, 2], function(value) {
  9879. * console.log(value);
  9880. * });
  9881. * // => Logs `1` then `2`.
  9882. *
  9883. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9884. * console.log(key);
  9885. * });
  9886. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9887. */
  9888. function forEach(collection, iteratee) {
  9889. var func = isArray(collection) ? arrayEach : baseEach;
  9890. return func(collection, getIteratee(iteratee, 3));
  9891. }
  9892. /**
  9893. * This method is like `_.forEach` except that it iterates over elements of
  9894. * `collection` from right to left.
  9895. *
  9896. * @static
  9897. * @memberOf _
  9898. * @since 2.0.0
  9899. * @alias eachRight
  9900. * @category Collection
  9901. * @param {Array|Object} collection The collection to iterate over.
  9902. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9903. * @returns {Array|Object} Returns `collection`.
  9904. * @see _.forEach
  9905. * @example
  9906. *
  9907. * _.forEachRight([1, 2], function(value) {
  9908. * console.log(value);
  9909. * });
  9910. * // => Logs `2` then `1`.
  9911. */
  9912. function forEachRight(collection, iteratee) {
  9913. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9914. return func(collection, getIteratee(iteratee, 3));
  9915. }
  9916. /**
  9917. * Creates an object composed of keys generated from the results of running
  9918. * each element of `collection` thru `iteratee`. The order of grouped values
  9919. * is determined by the order they occur in `collection`. The corresponding
  9920. * value of each key is an array of elements responsible for generating the
  9921. * key. The iteratee is invoked with one argument: (value).
  9922. *
  9923. * @static
  9924. * @memberOf _
  9925. * @since 0.1.0
  9926. * @category Collection
  9927. * @param {Array|Object} collection The collection to iterate over.
  9928. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9929. * @returns {Object} Returns the composed aggregate object.
  9930. * @example
  9931. *
  9932. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9933. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9934. *
  9935. * // The `_.property` iteratee shorthand.
  9936. * _.groupBy(['one', 'two', 'three'], 'length');
  9937. * // => { '3': ['one', 'two'], '5': ['three'] }
  9938. */
  9939. var groupBy = createAggregator(function(result, value, key) {
  9940. if (hasOwnProperty.call(result, key)) {
  9941. result[key].push(value);
  9942. } else {
  9943. baseAssignValue(result, key, [value]);
  9944. }
  9945. });
  9946. /**
  9947. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9948. * checked for a substring of `value`, otherwise
  9949. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9950. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9951. * the offset from the end of `collection`.
  9952. *
  9953. * @static
  9954. * @memberOf _
  9955. * @since 0.1.0
  9956. * @category Collection
  9957. * @param {Array|Object|string} collection The collection to inspect.
  9958. * @param {*} value The value to search for.
  9959. * @param {number} [fromIndex=0] The index to search from.
  9960. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9961. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9962. * @example
  9963. *
  9964. * _.includes([1, 2, 3], 1);
  9965. * // => true
  9966. *
  9967. * _.includes([1, 2, 3], 1, 2);
  9968. * // => false
  9969. *
  9970. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9971. * // => true
  9972. *
  9973. * _.includes('abcd', 'bc');
  9974. * // => true
  9975. */
  9976. function includes(collection, value, fromIndex, guard) {
  9977. collection = isArrayLike(collection) ? collection : values(collection);
  9978. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9979. var length = collection.length;
  9980. if (fromIndex < 0) {
  9981. fromIndex = nativeMax(length + fromIndex, 0);
  9982. }
  9983. return isString(collection)
  9984. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9985. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9986. }
  9987. /**
  9988. * Invokes the method at `path` of each element in `collection`, returning
  9989. * an array of the results of each invoked method. Any additional arguments
  9990. * are provided to each invoked method. If `path` is a function, it's invoked
  9991. * for, and `this` bound to, each element in `collection`.
  9992. *
  9993. * @static
  9994. * @memberOf _
  9995. * @since 4.0.0
  9996. * @category Collection
  9997. * @param {Array|Object} collection The collection to iterate over.
  9998. * @param {Array|Function|string} path The path of the method to invoke or
  9999. * the function invoked per iteration.
  10000. * @param {...*} [args] The arguments to invoke each method with.
  10001. * @returns {Array} Returns the array of results.
  10002. * @example
  10003. *
  10004. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10005. * // => [[1, 5, 7], [1, 2, 3]]
  10006. *
  10007. * _.invokeMap([123, 456], String.prototype.split, '');
  10008. * // => [['1', '2', '3'], ['4', '5', '6']]
  10009. */
  10010. var invokeMap = baseRest(function(collection, path, args) {
  10011. var index = -1,
  10012. isFunc = typeof path == 'function',
  10013. result = isArrayLike(collection) ? Array(collection.length) : [];
  10014. baseEach(collection, function(value) {
  10015. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10016. });
  10017. return result;
  10018. });
  10019. /**
  10020. * Creates an object composed of keys generated from the results of running
  10021. * each element of `collection` thru `iteratee`. The corresponding value of
  10022. * each key is the last element responsible for generating the key. The
  10023. * iteratee is invoked with one argument: (value).
  10024. *
  10025. * @static
  10026. * @memberOf _
  10027. * @since 4.0.0
  10028. * @category Collection
  10029. * @param {Array|Object} collection The collection to iterate over.
  10030. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10031. * @returns {Object} Returns the composed aggregate object.
  10032. * @example
  10033. *
  10034. * var array = [
  10035. * { 'dir': 'left', 'code': 97 },
  10036. * { 'dir': 'right', 'code': 100 }
  10037. * ];
  10038. *
  10039. * _.keyBy(array, function(o) {
  10040. * return String.fromCharCode(o.code);
  10041. * });
  10042. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10043. *
  10044. * _.keyBy(array, 'dir');
  10045. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10046. */
  10047. var keyBy = createAggregator(function(result, value, key) {
  10048. baseAssignValue(result, key, value);
  10049. });
  10050. /**
  10051. * Creates an array of values by running each element in `collection` thru
  10052. * `iteratee`. The iteratee is invoked with three arguments:
  10053. * (value, index|key, collection).
  10054. *
  10055. * Many lodash methods are guarded to work as iteratees for methods like
  10056. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10057. *
  10058. * The guarded methods are:
  10059. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10060. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10061. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10062. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10063. *
  10064. * @static
  10065. * @memberOf _
  10066. * @since 0.1.0
  10067. * @category Collection
  10068. * @param {Array|Object} collection The collection to iterate over.
  10069. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10070. * @returns {Array} Returns the new mapped array.
  10071. * @example
  10072. *
  10073. * function square(n) {
  10074. * return n * n;
  10075. * }
  10076. *
  10077. * _.map([4, 8], square);
  10078. * // => [16, 64]
  10079. *
  10080. * _.map({ 'a': 4, 'b': 8 }, square);
  10081. * // => [16, 64] (iteration order is not guaranteed)
  10082. *
  10083. * var users = [
  10084. * { 'user': 'barney' },
  10085. * { 'user': 'fred' }
  10086. * ];
  10087. *
  10088. * // The `_.property` iteratee shorthand.
  10089. * _.map(users, 'user');
  10090. * // => ['barney', 'fred']
  10091. */
  10092. function map(collection, iteratee) {
  10093. var func = isArray(collection) ? arrayMap : baseMap;
  10094. return func(collection, getIteratee(iteratee, 3));
  10095. }
  10096. /**
  10097. * This method is like `_.sortBy` except that it allows specifying the sort
  10098. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10099. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10100. * descending or "asc" for ascending sort order of corresponding values.
  10101. *
  10102. * @static
  10103. * @memberOf _
  10104. * @since 4.0.0
  10105. * @category Collection
  10106. * @param {Array|Object} collection The collection to iterate over.
  10107. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10108. * The iteratees to sort by.
  10109. * @param {string[]} [orders] The sort orders of `iteratees`.
  10110. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10111. * @returns {Array} Returns the new sorted array.
  10112. * @example
  10113. *
  10114. * var users = [
  10115. * { 'user': 'fred', 'age': 48 },
  10116. * { 'user': 'barney', 'age': 34 },
  10117. * { 'user': 'fred', 'age': 40 },
  10118. * { 'user': 'barney', 'age': 36 }
  10119. * ];
  10120. *
  10121. * // Sort by `user` in ascending order and by `age` in descending order.
  10122. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10123. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10124. */
  10125. function orderBy(collection, iteratees, orders, guard) {
  10126. if (collection == null) {
  10127. return [];
  10128. }
  10129. if (!isArray(iteratees)) {
  10130. iteratees = iteratees == null ? [] : [iteratees];
  10131. }
  10132. orders = guard ? undefined : orders;
  10133. if (!isArray(orders)) {
  10134. orders = orders == null ? [] : [orders];
  10135. }
  10136. return baseOrderBy(collection, iteratees, orders);
  10137. }
  10138. /**
  10139. * Creates an array of elements split into two groups, the first of which
  10140. * contains elements `predicate` returns truthy for, the second of which
  10141. * contains elements `predicate` returns falsey for. The predicate is
  10142. * invoked with one argument: (value).
  10143. *
  10144. * @static
  10145. * @memberOf _
  10146. * @since 3.0.0
  10147. * @category Collection
  10148. * @param {Array|Object} collection The collection to iterate over.
  10149. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10150. * @returns {Array} Returns the array of grouped elements.
  10151. * @example
  10152. *
  10153. * var users = [
  10154. * { 'user': 'barney', 'age': 36, 'active': false },
  10155. * { 'user': 'fred', 'age': 40, 'active': true },
  10156. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10157. * ];
  10158. *
  10159. * _.partition(users, function(o) { return o.active; });
  10160. * // => objects for [['fred'], ['barney', 'pebbles']]
  10161. *
  10162. * // The `_.matches` iteratee shorthand.
  10163. * _.partition(users, { 'age': 1, 'active': false });
  10164. * // => objects for [['pebbles'], ['barney', 'fred']]
  10165. *
  10166. * // The `_.matchesProperty` iteratee shorthand.
  10167. * _.partition(users, ['active', false]);
  10168. * // => objects for [['barney', 'pebbles'], ['fred']]
  10169. *
  10170. * // The `_.property` iteratee shorthand.
  10171. * _.partition(users, 'active');
  10172. * // => objects for [['fred'], ['barney', 'pebbles']]
  10173. */
  10174. var partition = createAggregator(function(result, value, key) {
  10175. result[key ? 0 : 1].push(value);
  10176. }, function() { return [[], []]; });
  10177. /**
  10178. * Reduces `collection` to a value which is the accumulated result of running
  10179. * each element in `collection` thru `iteratee`, where each successive
  10180. * invocation is supplied the return value of the previous. If `accumulator`
  10181. * is not given, the first element of `collection` is used as the initial
  10182. * value. The iteratee is invoked with four arguments:
  10183. * (accumulator, value, index|key, collection).
  10184. *
  10185. * Many lodash methods are guarded to work as iteratees for methods like
  10186. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10187. *
  10188. * The guarded methods are:
  10189. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10190. * and `sortBy`
  10191. *
  10192. * @static
  10193. * @memberOf _
  10194. * @since 0.1.0
  10195. * @category Collection
  10196. * @param {Array|Object} collection The collection to iterate over.
  10197. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10198. * @param {*} [accumulator] The initial value.
  10199. * @returns {*} Returns the accumulated value.
  10200. * @see _.reduceRight
  10201. * @example
  10202. *
  10203. * _.reduce([1, 2], function(sum, n) {
  10204. * return sum + n;
  10205. * }, 0);
  10206. * // => 3
  10207. *
  10208. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10209. * (result[value] || (result[value] = [])).push(key);
  10210. * return result;
  10211. * }, {});
  10212. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10213. */
  10214. function reduce(collection, iteratee, accumulator) {
  10215. var func = isArray(collection) ? arrayReduce : baseReduce,
  10216. initAccum = arguments.length < 3;
  10217. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10218. }
  10219. /**
  10220. * This method is like `_.reduce` except that it iterates over elements of
  10221. * `collection` from right to left.
  10222. *
  10223. * @static
  10224. * @memberOf _
  10225. * @since 0.1.0
  10226. * @category Collection
  10227. * @param {Array|Object} collection The collection to iterate over.
  10228. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10229. * @param {*} [accumulator] The initial value.
  10230. * @returns {*} Returns the accumulated value.
  10231. * @see _.reduce
  10232. * @example
  10233. *
  10234. * var array = [[0, 1], [2, 3], [4, 5]];
  10235. *
  10236. * _.reduceRight(array, function(flattened, other) {
  10237. * return flattened.concat(other);
  10238. * }, []);
  10239. * // => [4, 5, 2, 3, 0, 1]
  10240. */
  10241. function reduceRight(collection, iteratee, accumulator) {
  10242. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10243. initAccum = arguments.length < 3;
  10244. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10245. }
  10246. /**
  10247. * The opposite of `_.filter`; this method returns the elements of `collection`
  10248. * that `predicate` does **not** return truthy for.
  10249. *
  10250. * @static
  10251. * @memberOf _
  10252. * @since 0.1.0
  10253. * @category Collection
  10254. * @param {Array|Object} collection The collection to iterate over.
  10255. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10256. * @returns {Array} Returns the new filtered array.
  10257. * @see _.filter
  10258. * @example
  10259. *
  10260. * var users = [
  10261. * { 'user': 'barney', 'age': 36, 'active': false },
  10262. * { 'user': 'fred', 'age': 40, 'active': true }
  10263. * ];
  10264. *
  10265. * _.reject(users, function(o) { return !o.active; });
  10266. * // => objects for ['fred']
  10267. *
  10268. * // The `_.matches` iteratee shorthand.
  10269. * _.reject(users, { 'age': 40, 'active': true });
  10270. * // => objects for ['barney']
  10271. *
  10272. * // The `_.matchesProperty` iteratee shorthand.
  10273. * _.reject(users, ['active', false]);
  10274. * // => objects for ['fred']
  10275. *
  10276. * // The `_.property` iteratee shorthand.
  10277. * _.reject(users, 'active');
  10278. * // => objects for ['barney']
  10279. */
  10280. function reject(collection, predicate) {
  10281. var func = isArray(collection) ? arrayFilter : baseFilter;
  10282. return func(collection, negate(getIteratee(predicate, 3)));
  10283. }
  10284. /**
  10285. * Gets a random element from `collection`.
  10286. *
  10287. * @static
  10288. * @memberOf _
  10289. * @since 2.0.0
  10290. * @category Collection
  10291. * @param {Array|Object} collection The collection to sample.
  10292. * @returns {*} Returns the random element.
  10293. * @example
  10294. *
  10295. * _.sample([1, 2, 3, 4]);
  10296. * // => 2
  10297. */
  10298. function sample(collection) {
  10299. var func = isArray(collection) ? arraySample : baseSample;
  10300. return func(collection);
  10301. }
  10302. /**
  10303. * Gets `n` random elements at unique keys from `collection` up to the
  10304. * size of `collection`.
  10305. *
  10306. * @static
  10307. * @memberOf _
  10308. * @since 4.0.0
  10309. * @category Collection
  10310. * @param {Array|Object} collection The collection to sample.
  10311. * @param {number} [n=1] The number of elements to sample.
  10312. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10313. * @returns {Array} Returns the random elements.
  10314. * @example
  10315. *
  10316. * _.sampleSize([1, 2, 3], 2);
  10317. * // => [3, 1]
  10318. *
  10319. * _.sampleSize([1, 2, 3], 4);
  10320. * // => [2, 3, 1]
  10321. */
  10322. function sampleSize(collection, n, guard) {
  10323. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10324. n = 1;
  10325. } else {
  10326. n = toInteger(n);
  10327. }
  10328. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10329. return func(collection, n);
  10330. }
  10331. /**
  10332. * Creates an array of shuffled values, using a version of the
  10333. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10334. *
  10335. * @static
  10336. * @memberOf _
  10337. * @since 0.1.0
  10338. * @category Collection
  10339. * @param {Array|Object} collection The collection to shuffle.
  10340. * @returns {Array} Returns the new shuffled array.
  10341. * @example
  10342. *
  10343. * _.shuffle([1, 2, 3, 4]);
  10344. * // => [4, 1, 3, 2]
  10345. */
  10346. function shuffle(collection) {
  10347. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10348. return func(collection);
  10349. }
  10350. /**
  10351. * Gets the size of `collection` by returning its length for array-like
  10352. * values or the number of own enumerable string keyed properties for objects.
  10353. *
  10354. * @static
  10355. * @memberOf _
  10356. * @since 0.1.0
  10357. * @category Collection
  10358. * @param {Array|Object|string} collection The collection to inspect.
  10359. * @returns {number} Returns the collection size.
  10360. * @example
  10361. *
  10362. * _.size([1, 2, 3]);
  10363. * // => 3
  10364. *
  10365. * _.size({ 'a': 1, 'b': 2 });
  10366. * // => 2
  10367. *
  10368. * _.size('pebbles');
  10369. * // => 7
  10370. */
  10371. function size(collection) {
  10372. if (collection == null) {
  10373. return 0;
  10374. }
  10375. if (isArrayLike(collection)) {
  10376. return isString(collection) ? stringSize(collection) : collection.length;
  10377. }
  10378. var tag = getTag(collection);
  10379. if (tag == mapTag || tag == setTag) {
  10380. return collection.size;
  10381. }
  10382. return baseKeys(collection).length;
  10383. }
  10384. /**
  10385. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10386. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10387. * invoked with three arguments: (value, index|key, collection).
  10388. *
  10389. * @static
  10390. * @memberOf _
  10391. * @since 0.1.0
  10392. * @category Collection
  10393. * @param {Array|Object} collection The collection to iterate over.
  10394. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10395. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10396. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10397. * else `false`.
  10398. * @example
  10399. *
  10400. * _.some([null, 0, 'yes', false], Boolean);
  10401. * // => true
  10402. *
  10403. * var users = [
  10404. * { 'user': 'barney', 'active': true },
  10405. * { 'user': 'fred', 'active': false }
  10406. * ];
  10407. *
  10408. * // The `_.matches` iteratee shorthand.
  10409. * _.some(users, { 'user': 'barney', 'active': false });
  10410. * // => false
  10411. *
  10412. * // The `_.matchesProperty` iteratee shorthand.
  10413. * _.some(users, ['active', false]);
  10414. * // => true
  10415. *
  10416. * // The `_.property` iteratee shorthand.
  10417. * _.some(users, 'active');
  10418. * // => true
  10419. */
  10420. function some(collection, predicate, guard) {
  10421. var func = isArray(collection) ? arraySome : baseSome;
  10422. if (guard && isIterateeCall(collection, predicate, guard)) {
  10423. predicate = undefined;
  10424. }
  10425. return func(collection, getIteratee(predicate, 3));
  10426. }
  10427. /**
  10428. * Creates an array of elements, sorted in ascending order by the results of
  10429. * running each element in a collection thru each iteratee. This method
  10430. * performs a stable sort, that is, it preserves the original sort order of
  10431. * equal elements. The iteratees are invoked with one argument: (value).
  10432. *
  10433. * @static
  10434. * @memberOf _
  10435. * @since 0.1.0
  10436. * @category Collection
  10437. * @param {Array|Object} collection The collection to iterate over.
  10438. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10439. * The iteratees to sort by.
  10440. * @returns {Array} Returns the new sorted array.
  10441. * @example
  10442. *
  10443. * var users = [
  10444. * { 'user': 'fred', 'age': 48 },
  10445. * { 'user': 'barney', 'age': 36 },
  10446. * { 'user': 'fred', 'age': 30 },
  10447. * { 'user': 'barney', 'age': 34 }
  10448. * ];
  10449. *
  10450. * _.sortBy(users, [function(o) { return o.user; }]);
  10451. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10452. *
  10453. * _.sortBy(users, ['user', 'age']);
  10454. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10455. */
  10456. var sortBy = baseRest(function(collection, iteratees) {
  10457. if (collection == null) {
  10458. return [];
  10459. }
  10460. var length = iteratees.length;
  10461. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10462. iteratees = [];
  10463. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10464. iteratees = [iteratees[0]];
  10465. }
  10466. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10467. });
  10468. /*------------------------------------------------------------------------*/
  10469. /**
  10470. * Gets the timestamp of the number of milliseconds that have elapsed since
  10471. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10472. *
  10473. * @static
  10474. * @memberOf _
  10475. * @since 2.4.0
  10476. * @category Date
  10477. * @returns {number} Returns the timestamp.
  10478. * @example
  10479. *
  10480. * _.defer(function(stamp) {
  10481. * console.log(_.now() - stamp);
  10482. * }, _.now());
  10483. * // => Logs the number of milliseconds it took for the deferred invocation.
  10484. */
  10485. var now = ctxNow || function() {
  10486. return root.Date.now();
  10487. };
  10488. /*------------------------------------------------------------------------*/
  10489. /**
  10490. * The opposite of `_.before`; this method creates a function that invokes
  10491. * `func` once it's called `n` or more times.
  10492. *
  10493. * @static
  10494. * @memberOf _
  10495. * @since 0.1.0
  10496. * @category Function
  10497. * @param {number} n The number of calls before `func` is invoked.
  10498. * @param {Function} func The function to restrict.
  10499. * @returns {Function} Returns the new restricted function.
  10500. * @example
  10501. *
  10502. * var saves = ['profile', 'settings'];
  10503. *
  10504. * var done = _.after(saves.length, function() {
  10505. * console.log('done saving!');
  10506. * });
  10507. *
  10508. * _.forEach(saves, function(type) {
  10509. * asyncSave({ 'type': type, 'complete': done });
  10510. * });
  10511. * // => Logs 'done saving!' after the two async saves have completed.
  10512. */
  10513. function after(n, func) {
  10514. if (typeof func != 'function') {
  10515. throw new TypeError(FUNC_ERROR_TEXT);
  10516. }
  10517. n = toInteger(n);
  10518. return function() {
  10519. if (--n < 1) {
  10520. return func.apply(this, arguments);
  10521. }
  10522. };
  10523. }
  10524. /**
  10525. * Creates a function that invokes `func`, with up to `n` arguments,
  10526. * ignoring any additional arguments.
  10527. *
  10528. * @static
  10529. * @memberOf _
  10530. * @since 3.0.0
  10531. * @category Function
  10532. * @param {Function} func The function to cap arguments for.
  10533. * @param {number} [n=func.length] The arity cap.
  10534. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10535. * @returns {Function} Returns the new capped function.
  10536. * @example
  10537. *
  10538. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10539. * // => [6, 8, 10]
  10540. */
  10541. function ary(func, n, guard) {
  10542. n = guard ? undefined : n;
  10543. n = (func && n == null) ? func.length : n;
  10544. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10545. }
  10546. /**
  10547. * Creates a function that invokes `func`, with the `this` binding and arguments
  10548. * of the created function, while it's called less than `n` times. Subsequent
  10549. * calls to the created function return the result of the last `func` invocation.
  10550. *
  10551. * @static
  10552. * @memberOf _
  10553. * @since 3.0.0
  10554. * @category Function
  10555. * @param {number} n The number of calls at which `func` is no longer invoked.
  10556. * @param {Function} func The function to restrict.
  10557. * @returns {Function} Returns the new restricted function.
  10558. * @example
  10559. *
  10560. * jQuery(element).on('click', _.before(5, addContactToList));
  10561. * // => Allows adding up to 4 contacts to the list.
  10562. */
  10563. function before(n, func) {
  10564. var result;
  10565. if (typeof func != 'function') {
  10566. throw new TypeError(FUNC_ERROR_TEXT);
  10567. }
  10568. n = toInteger(n);
  10569. return function() {
  10570. if (--n > 0) {
  10571. result = func.apply(this, arguments);
  10572. }
  10573. if (n <= 1) {
  10574. func = undefined;
  10575. }
  10576. return result;
  10577. };
  10578. }
  10579. /**
  10580. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10581. * and `partials` prepended to the arguments it receives.
  10582. *
  10583. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10584. * may be used as a placeholder for partially applied arguments.
  10585. *
  10586. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10587. * property of bound functions.
  10588. *
  10589. * @static
  10590. * @memberOf _
  10591. * @since 0.1.0
  10592. * @category Function
  10593. * @param {Function} func The function to bind.
  10594. * @param {*} thisArg The `this` binding of `func`.
  10595. * @param {...*} [partials] The arguments to be partially applied.
  10596. * @returns {Function} Returns the new bound function.
  10597. * @example
  10598. *
  10599. * function greet(greeting, punctuation) {
  10600. * return greeting + ' ' + this.user + punctuation;
  10601. * }
  10602. *
  10603. * var object = { 'user': 'fred' };
  10604. *
  10605. * var bound = _.bind(greet, object, 'hi');
  10606. * bound('!');
  10607. * // => 'hi fred!'
  10608. *
  10609. * // Bound with placeholders.
  10610. * var bound = _.bind(greet, object, _, '!');
  10611. * bound('hi');
  10612. * // => 'hi fred!'
  10613. */
  10614. var bind = baseRest(function(func, thisArg, partials) {
  10615. var bitmask = WRAP_BIND_FLAG;
  10616. if (partials.length) {
  10617. var holders = replaceHolders(partials, getHolder(bind));
  10618. bitmask |= WRAP_PARTIAL_FLAG;
  10619. }
  10620. return createWrap(func, bitmask, thisArg, partials, holders);
  10621. });
  10622. /**
  10623. * Creates a function that invokes the method at `object[key]` with `partials`
  10624. * prepended to the arguments it receives.
  10625. *
  10626. * This method differs from `_.bind` by allowing bound functions to reference
  10627. * methods that may be redefined or don't yet exist. See
  10628. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10629. * for more details.
  10630. *
  10631. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10632. * builds, may be used as a placeholder for partially applied arguments.
  10633. *
  10634. * @static
  10635. * @memberOf _
  10636. * @since 0.10.0
  10637. * @category Function
  10638. * @param {Object} object The object to invoke the method on.
  10639. * @param {string} key The key of the method.
  10640. * @param {...*} [partials] The arguments to be partially applied.
  10641. * @returns {Function} Returns the new bound function.
  10642. * @example
  10643. *
  10644. * var object = {
  10645. * 'user': 'fred',
  10646. * 'greet': function(greeting, punctuation) {
  10647. * return greeting + ' ' + this.user + punctuation;
  10648. * }
  10649. * };
  10650. *
  10651. * var bound = _.bindKey(object, 'greet', 'hi');
  10652. * bound('!');
  10653. * // => 'hi fred!'
  10654. *
  10655. * object.greet = function(greeting, punctuation) {
  10656. * return greeting + 'ya ' + this.user + punctuation;
  10657. * };
  10658. *
  10659. * bound('!');
  10660. * // => 'hiya fred!'
  10661. *
  10662. * // Bound with placeholders.
  10663. * var bound = _.bindKey(object, 'greet', _, '!');
  10664. * bound('hi');
  10665. * // => 'hiya fred!'
  10666. */
  10667. var bindKey = baseRest(function(object, key, partials) {
  10668. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10669. if (partials.length) {
  10670. var holders = replaceHolders(partials, getHolder(bindKey));
  10671. bitmask |= WRAP_PARTIAL_FLAG;
  10672. }
  10673. return createWrap(key, bitmask, object, partials, holders);
  10674. });
  10675. /**
  10676. * Creates a function that accepts arguments of `func` and either invokes
  10677. * `func` returning its result, if at least `arity` number of arguments have
  10678. * been provided, or returns a function that accepts the remaining `func`
  10679. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10680. * is not sufficient.
  10681. *
  10682. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10683. * may be used as a placeholder for provided arguments.
  10684. *
  10685. * **Note:** This method doesn't set the "length" property of curried functions.
  10686. *
  10687. * @static
  10688. * @memberOf _
  10689. * @since 2.0.0
  10690. * @category Function
  10691. * @param {Function} func The function to curry.
  10692. * @param {number} [arity=func.length] The arity of `func`.
  10693. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10694. * @returns {Function} Returns the new curried function.
  10695. * @example
  10696. *
  10697. * var abc = function(a, b, c) {
  10698. * return [a, b, c];
  10699. * };
  10700. *
  10701. * var curried = _.curry(abc);
  10702. *
  10703. * curried(1)(2)(3);
  10704. * // => [1, 2, 3]
  10705. *
  10706. * curried(1, 2)(3);
  10707. * // => [1, 2, 3]
  10708. *
  10709. * curried(1, 2, 3);
  10710. * // => [1, 2, 3]
  10711. *
  10712. * // Curried with placeholders.
  10713. * curried(1)(_, 3)(2);
  10714. * // => [1, 2, 3]
  10715. */
  10716. function curry(func, arity, guard) {
  10717. arity = guard ? undefined : arity;
  10718. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10719. result.placeholder = curry.placeholder;
  10720. return result;
  10721. }
  10722. /**
  10723. * This method is like `_.curry` except that arguments are applied to `func`
  10724. * in the manner of `_.partialRight` instead of `_.partial`.
  10725. *
  10726. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10727. * builds, may be used as a placeholder for provided arguments.
  10728. *
  10729. * **Note:** This method doesn't set the "length" property of curried functions.
  10730. *
  10731. * @static
  10732. * @memberOf _
  10733. * @since 3.0.0
  10734. * @category Function
  10735. * @param {Function} func The function to curry.
  10736. * @param {number} [arity=func.length] The arity of `func`.
  10737. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10738. * @returns {Function} Returns the new curried function.
  10739. * @example
  10740. *
  10741. * var abc = function(a, b, c) {
  10742. * return [a, b, c];
  10743. * };
  10744. *
  10745. * var curried = _.curryRight(abc);
  10746. *
  10747. * curried(3)(2)(1);
  10748. * // => [1, 2, 3]
  10749. *
  10750. * curried(2, 3)(1);
  10751. * // => [1, 2, 3]
  10752. *
  10753. * curried(1, 2, 3);
  10754. * // => [1, 2, 3]
  10755. *
  10756. * // Curried with placeholders.
  10757. * curried(3)(1, _)(2);
  10758. * // => [1, 2, 3]
  10759. */
  10760. function curryRight(func, arity, guard) {
  10761. arity = guard ? undefined : arity;
  10762. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10763. result.placeholder = curryRight.placeholder;
  10764. return result;
  10765. }
  10766. /**
  10767. * Creates a debounced function that delays invoking `func` until after `wait`
  10768. * milliseconds have elapsed since the last time the debounced function was
  10769. * invoked. The debounced function comes with a `cancel` method to cancel
  10770. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10771. * Provide `options` to indicate whether `func` should be invoked on the
  10772. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10773. * with the last arguments provided to the debounced function. Subsequent
  10774. * calls to the debounced function return the result of the last `func`
  10775. * invocation.
  10776. *
  10777. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10778. * invoked on the trailing edge of the timeout only if the debounced function
  10779. * is invoked more than once during the `wait` timeout.
  10780. *
  10781. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10782. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10783. *
  10784. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10785. * for details over the differences between `_.debounce` and `_.throttle`.
  10786. *
  10787. * @static
  10788. * @memberOf _
  10789. * @since 0.1.0
  10790. * @category Function
  10791. * @param {Function} func The function to debounce.
  10792. * @param {number} [wait=0] The number of milliseconds to delay.
  10793. * @param {Object} [options={}] The options object.
  10794. * @param {boolean} [options.leading=false]
  10795. * Specify invoking on the leading edge of the timeout.
  10796. * @param {number} [options.maxWait]
  10797. * The maximum time `func` is allowed to be delayed before it's invoked.
  10798. * @param {boolean} [options.trailing=true]
  10799. * Specify invoking on the trailing edge of the timeout.
  10800. * @returns {Function} Returns the new debounced function.
  10801. * @example
  10802. *
  10803. * // Avoid costly calculations while the window size is in flux.
  10804. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10805. *
  10806. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10807. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10808. * 'leading': true,
  10809. * 'trailing': false
  10810. * }));
  10811. *
  10812. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10813. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10814. * var source = new EventSource('/stream');
  10815. * jQuery(source).on('message', debounced);
  10816. *
  10817. * // Cancel the trailing debounced invocation.
  10818. * jQuery(window).on('popstate', debounced.cancel);
  10819. */
  10820. function debounce(func, wait, options) {
  10821. var lastArgs,
  10822. lastThis,
  10823. maxWait,
  10824. result,
  10825. timerId,
  10826. lastCallTime,
  10827. lastInvokeTime = 0,
  10828. leading = false,
  10829. maxing = false,
  10830. trailing = true;
  10831. if (typeof func != 'function') {
  10832. throw new TypeError(FUNC_ERROR_TEXT);
  10833. }
  10834. wait = toNumber(wait) || 0;
  10835. if (isObject(options)) {
  10836. leading = !!options.leading;
  10837. maxing = 'maxWait' in options;
  10838. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10839. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10840. }
  10841. function invokeFunc(time) {
  10842. var args = lastArgs,
  10843. thisArg = lastThis;
  10844. lastArgs = lastThis = undefined;
  10845. lastInvokeTime = time;
  10846. result = func.apply(thisArg, args);
  10847. return result;
  10848. }
  10849. function leadingEdge(time) {
  10850. // Reset any `maxWait` timer.
  10851. lastInvokeTime = time;
  10852. // Start the timer for the trailing edge.
  10853. timerId = setTimeout(timerExpired, wait);
  10854. // Invoke the leading edge.
  10855. return leading ? invokeFunc(time) : result;
  10856. }
  10857. function remainingWait(time) {
  10858. var timeSinceLastCall = time - lastCallTime,
  10859. timeSinceLastInvoke = time - lastInvokeTime,
  10860. timeWaiting = wait - timeSinceLastCall;
  10861. return maxing
  10862. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10863. : timeWaiting;
  10864. }
  10865. function shouldInvoke(time) {
  10866. var timeSinceLastCall = time - lastCallTime,
  10867. timeSinceLastInvoke = time - lastInvokeTime;
  10868. // Either this is the first call, activity has stopped and we're at the
  10869. // trailing edge, the system time has gone backwards and we're treating
  10870. // it as the trailing edge, or we've hit the `maxWait` limit.
  10871. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10872. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10873. }
  10874. function timerExpired() {
  10875. var time = now();
  10876. if (shouldInvoke(time)) {
  10877. return trailingEdge(time);
  10878. }
  10879. // Restart the timer.
  10880. timerId = setTimeout(timerExpired, remainingWait(time));
  10881. }
  10882. function trailingEdge(time) {
  10883. timerId = undefined;
  10884. // Only invoke if we have `lastArgs` which means `func` has been
  10885. // debounced at least once.
  10886. if (trailing && lastArgs) {
  10887. return invokeFunc(time);
  10888. }
  10889. lastArgs = lastThis = undefined;
  10890. return result;
  10891. }
  10892. function cancel() {
  10893. if (timerId !== undefined) {
  10894. clearTimeout(timerId);
  10895. }
  10896. lastInvokeTime = 0;
  10897. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10898. }
  10899. function flush() {
  10900. return timerId === undefined ? result : trailingEdge(now());
  10901. }
  10902. function debounced() {
  10903. var time = now(),
  10904. isInvoking = shouldInvoke(time);
  10905. lastArgs = arguments;
  10906. lastThis = this;
  10907. lastCallTime = time;
  10908. if (isInvoking) {
  10909. if (timerId === undefined) {
  10910. return leadingEdge(lastCallTime);
  10911. }
  10912. if (maxing) {
  10913. // Handle invocations in a tight loop.
  10914. clearTimeout(timerId);
  10915. timerId = setTimeout(timerExpired, wait);
  10916. return invokeFunc(lastCallTime);
  10917. }
  10918. }
  10919. if (timerId === undefined) {
  10920. timerId = setTimeout(timerExpired, wait);
  10921. }
  10922. return result;
  10923. }
  10924. debounced.cancel = cancel;
  10925. debounced.flush = flush;
  10926. return debounced;
  10927. }
  10928. /**
  10929. * Defers invoking the `func` until the current call stack has cleared. Any
  10930. * additional arguments are provided to `func` when it's invoked.
  10931. *
  10932. * @static
  10933. * @memberOf _
  10934. * @since 0.1.0
  10935. * @category Function
  10936. * @param {Function} func The function to defer.
  10937. * @param {...*} [args] The arguments to invoke `func` with.
  10938. * @returns {number} Returns the timer id.
  10939. * @example
  10940. *
  10941. * _.defer(function(text) {
  10942. * console.log(text);
  10943. * }, 'deferred');
  10944. * // => Logs 'deferred' after one millisecond.
  10945. */
  10946. var defer = baseRest(function(func, args) {
  10947. return baseDelay(func, 1, args);
  10948. });
  10949. /**
  10950. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10951. * provided to `func` when it's invoked.
  10952. *
  10953. * @static
  10954. * @memberOf _
  10955. * @since 0.1.0
  10956. * @category Function
  10957. * @param {Function} func The function to delay.
  10958. * @param {number} wait The number of milliseconds to delay invocation.
  10959. * @param {...*} [args] The arguments to invoke `func` with.
  10960. * @returns {number} Returns the timer id.
  10961. * @example
  10962. *
  10963. * _.delay(function(text) {
  10964. * console.log(text);
  10965. * }, 1000, 'later');
  10966. * // => Logs 'later' after one second.
  10967. */
  10968. var delay = baseRest(function(func, wait, args) {
  10969. return baseDelay(func, toNumber(wait) || 0, args);
  10970. });
  10971. /**
  10972. * Creates a function that invokes `func` with arguments reversed.
  10973. *
  10974. * @static
  10975. * @memberOf _
  10976. * @since 4.0.0
  10977. * @category Function
  10978. * @param {Function} func The function to flip arguments for.
  10979. * @returns {Function} Returns the new flipped function.
  10980. * @example
  10981. *
  10982. * var flipped = _.flip(function() {
  10983. * return _.toArray(arguments);
  10984. * });
  10985. *
  10986. * flipped('a', 'b', 'c', 'd');
  10987. * // => ['d', 'c', 'b', 'a']
  10988. */
  10989. function flip(func) {
  10990. return createWrap(func, WRAP_FLIP_FLAG);
  10991. }
  10992. /**
  10993. * Creates a function that memoizes the result of `func`. If `resolver` is
  10994. * provided, it determines the cache key for storing the result based on the
  10995. * arguments provided to the memoized function. By default, the first argument
  10996. * provided to the memoized function is used as the map cache key. The `func`
  10997. * is invoked with the `this` binding of the memoized function.
  10998. *
  10999. * **Note:** The cache is exposed as the `cache` property on the memoized
  11000. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11001. * constructor with one whose instances implement the
  11002. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11003. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11004. *
  11005. * @static
  11006. * @memberOf _
  11007. * @since 0.1.0
  11008. * @category Function
  11009. * @param {Function} func The function to have its output memoized.
  11010. * @param {Function} [resolver] The function to resolve the cache key.
  11011. * @returns {Function} Returns the new memoized function.
  11012. * @example
  11013. *
  11014. * var object = { 'a': 1, 'b': 2 };
  11015. * var other = { 'c': 3, 'd': 4 };
  11016. *
  11017. * var values = _.memoize(_.values);
  11018. * values(object);
  11019. * // => [1, 2]
  11020. *
  11021. * values(other);
  11022. * // => [3, 4]
  11023. *
  11024. * object.a = 2;
  11025. * values(object);
  11026. * // => [1, 2]
  11027. *
  11028. * // Modify the result cache.
  11029. * values.cache.set(object, ['a', 'b']);
  11030. * values(object);
  11031. * // => ['a', 'b']
  11032. *
  11033. * // Replace `_.memoize.Cache`.
  11034. * _.memoize.Cache = WeakMap;
  11035. */
  11036. function memoize(func, resolver) {
  11037. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11038. throw new TypeError(FUNC_ERROR_TEXT);
  11039. }
  11040. var memoized = function() {
  11041. var args = arguments,
  11042. key = resolver ? resolver.apply(this, args) : args[0],
  11043. cache = memoized.cache;
  11044. if (cache.has(key)) {
  11045. return cache.get(key);
  11046. }
  11047. var result = func.apply(this, args);
  11048. memoized.cache = cache.set(key, result) || cache;
  11049. return result;
  11050. };
  11051. memoized.cache = new (memoize.Cache || MapCache);
  11052. return memoized;
  11053. }
  11054. // Expose `MapCache`.
  11055. memoize.Cache = MapCache;
  11056. /**
  11057. * Creates a function that negates the result of the predicate `func`. The
  11058. * `func` predicate is invoked with the `this` binding and arguments of the
  11059. * created function.
  11060. *
  11061. * @static
  11062. * @memberOf _
  11063. * @since 3.0.0
  11064. * @category Function
  11065. * @param {Function} predicate The predicate to negate.
  11066. * @returns {Function} Returns the new negated function.
  11067. * @example
  11068. *
  11069. * function isEven(n) {
  11070. * return n % 2 == 0;
  11071. * }
  11072. *
  11073. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11074. * // => [1, 3, 5]
  11075. */
  11076. function negate(predicate) {
  11077. if (typeof predicate != 'function') {
  11078. throw new TypeError(FUNC_ERROR_TEXT);
  11079. }
  11080. return function() {
  11081. var args = arguments;
  11082. switch (args.length) {
  11083. case 0: return !predicate.call(this);
  11084. case 1: return !predicate.call(this, args[0]);
  11085. case 2: return !predicate.call(this, args[0], args[1]);
  11086. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11087. }
  11088. return !predicate.apply(this, args);
  11089. };
  11090. }
  11091. /**
  11092. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11093. * to the function return the value of the first invocation. The `func` is
  11094. * invoked with the `this` binding and arguments of the created function.
  11095. *
  11096. * @static
  11097. * @memberOf _
  11098. * @since 0.1.0
  11099. * @category Function
  11100. * @param {Function} func The function to restrict.
  11101. * @returns {Function} Returns the new restricted function.
  11102. * @example
  11103. *
  11104. * var initialize = _.once(createApplication);
  11105. * initialize();
  11106. * initialize();
  11107. * // => `createApplication` is invoked once
  11108. */
  11109. function once(func) {
  11110. return before(2, func);
  11111. }
  11112. /**
  11113. * Creates a function that invokes `func` with its arguments transformed.
  11114. *
  11115. * @static
  11116. * @since 4.0.0
  11117. * @memberOf _
  11118. * @category Function
  11119. * @param {Function} func The function to wrap.
  11120. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11121. * The argument transforms.
  11122. * @returns {Function} Returns the new function.
  11123. * @example
  11124. *
  11125. * function doubled(n) {
  11126. * return n * 2;
  11127. * }
  11128. *
  11129. * function square(n) {
  11130. * return n * n;
  11131. * }
  11132. *
  11133. * var func = _.overArgs(function(x, y) {
  11134. * return [x, y];
  11135. * }, [square, doubled]);
  11136. *
  11137. * func(9, 3);
  11138. * // => [81, 6]
  11139. *
  11140. * func(10, 5);
  11141. * // => [100, 10]
  11142. */
  11143. var overArgs = castRest(function(func, transforms) {
  11144. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11145. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11146. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11147. var funcsLength = transforms.length;
  11148. return baseRest(function(args) {
  11149. var index = -1,
  11150. length = nativeMin(args.length, funcsLength);
  11151. while (++index < length) {
  11152. args[index] = transforms[index].call(this, args[index]);
  11153. }
  11154. return apply(func, this, args);
  11155. });
  11156. });
  11157. /**
  11158. * Creates a function that invokes `func` with `partials` prepended to the
  11159. * arguments it receives. This method is like `_.bind` except it does **not**
  11160. * alter the `this` binding.
  11161. *
  11162. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11163. * builds, may be used as a placeholder for partially applied arguments.
  11164. *
  11165. * **Note:** This method doesn't set the "length" property of partially
  11166. * applied functions.
  11167. *
  11168. * @static
  11169. * @memberOf _
  11170. * @since 0.2.0
  11171. * @category Function
  11172. * @param {Function} func The function to partially apply arguments to.
  11173. * @param {...*} [partials] The arguments to be partially applied.
  11174. * @returns {Function} Returns the new partially applied function.
  11175. * @example
  11176. *
  11177. * function greet(greeting, name) {
  11178. * return greeting + ' ' + name;
  11179. * }
  11180. *
  11181. * var sayHelloTo = _.partial(greet, 'hello');
  11182. * sayHelloTo('fred');
  11183. * // => 'hello fred'
  11184. *
  11185. * // Partially applied with placeholders.
  11186. * var greetFred = _.partial(greet, _, 'fred');
  11187. * greetFred('hi');
  11188. * // => 'hi fred'
  11189. */
  11190. var partial = baseRest(function(func, partials) {
  11191. var holders = replaceHolders(partials, getHolder(partial));
  11192. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11193. });
  11194. /**
  11195. * This method is like `_.partial` except that partially applied arguments
  11196. * are appended to the arguments it receives.
  11197. *
  11198. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11199. * builds, may be used as a placeholder for partially applied arguments.
  11200. *
  11201. * **Note:** This method doesn't set the "length" property of partially
  11202. * applied functions.
  11203. *
  11204. * @static
  11205. * @memberOf _
  11206. * @since 1.0.0
  11207. * @category Function
  11208. * @param {Function} func The function to partially apply arguments to.
  11209. * @param {...*} [partials] The arguments to be partially applied.
  11210. * @returns {Function} Returns the new partially applied function.
  11211. * @example
  11212. *
  11213. * function greet(greeting, name) {
  11214. * return greeting + ' ' + name;
  11215. * }
  11216. *
  11217. * var greetFred = _.partialRight(greet, 'fred');
  11218. * greetFred('hi');
  11219. * // => 'hi fred'
  11220. *
  11221. * // Partially applied with placeholders.
  11222. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11223. * sayHelloTo('fred');
  11224. * // => 'hello fred'
  11225. */
  11226. var partialRight = baseRest(function(func, partials) {
  11227. var holders = replaceHolders(partials, getHolder(partialRight));
  11228. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11229. });
  11230. /**
  11231. * Creates a function that invokes `func` with arguments arranged according
  11232. * to the specified `indexes` where the argument value at the first index is
  11233. * provided as the first argument, the argument value at the second index is
  11234. * provided as the second argument, and so on.
  11235. *
  11236. * @static
  11237. * @memberOf _
  11238. * @since 3.0.0
  11239. * @category Function
  11240. * @param {Function} func The function to rearrange arguments for.
  11241. * @param {...(number|number[])} indexes The arranged argument indexes.
  11242. * @returns {Function} Returns the new function.
  11243. * @example
  11244. *
  11245. * var rearged = _.rearg(function(a, b, c) {
  11246. * return [a, b, c];
  11247. * }, [2, 0, 1]);
  11248. *
  11249. * rearged('b', 'c', 'a')
  11250. * // => ['a', 'b', 'c']
  11251. */
  11252. var rearg = flatRest(function(func, indexes) {
  11253. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11254. });
  11255. /**
  11256. * Creates a function that invokes `func` with the `this` binding of the
  11257. * created function and arguments from `start` and beyond provided as
  11258. * an array.
  11259. *
  11260. * **Note:** This method is based on the
  11261. * [rest parameter](https://mdn.io/rest_parameters).
  11262. *
  11263. * @static
  11264. * @memberOf _
  11265. * @since 4.0.0
  11266. * @category Function
  11267. * @param {Function} func The function to apply a rest parameter to.
  11268. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11269. * @returns {Function} Returns the new function.
  11270. * @example
  11271. *
  11272. * var say = _.rest(function(what, names) {
  11273. * return what + ' ' + _.initial(names).join(', ') +
  11274. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11275. * });
  11276. *
  11277. * say('hello', 'fred', 'barney', 'pebbles');
  11278. * // => 'hello fred, barney, & pebbles'
  11279. */
  11280. function rest(func, start) {
  11281. if (typeof func != 'function') {
  11282. throw new TypeError(FUNC_ERROR_TEXT);
  11283. }
  11284. start = start === undefined ? start : toInteger(start);
  11285. return baseRest(func, start);
  11286. }
  11287. /**
  11288. * Creates a function that invokes `func` with the `this` binding of the
  11289. * create function and an array of arguments much like
  11290. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11291. *
  11292. * **Note:** This method is based on the
  11293. * [spread operator](https://mdn.io/spread_operator).
  11294. *
  11295. * @static
  11296. * @memberOf _
  11297. * @since 3.2.0
  11298. * @category Function
  11299. * @param {Function} func The function to spread arguments over.
  11300. * @param {number} [start=0] The start position of the spread.
  11301. * @returns {Function} Returns the new function.
  11302. * @example
  11303. *
  11304. * var say = _.spread(function(who, what) {
  11305. * return who + ' says ' + what;
  11306. * });
  11307. *
  11308. * say(['fred', 'hello']);
  11309. * // => 'fred says hello'
  11310. *
  11311. * var numbers = Promise.all([
  11312. * Promise.resolve(40),
  11313. * Promise.resolve(36)
  11314. * ]);
  11315. *
  11316. * numbers.then(_.spread(function(x, y) {
  11317. * return x + y;
  11318. * }));
  11319. * // => a Promise of 76
  11320. */
  11321. function spread(func, start) {
  11322. if (typeof func != 'function') {
  11323. throw new TypeError(FUNC_ERROR_TEXT);
  11324. }
  11325. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11326. return baseRest(function(args) {
  11327. var array = args[start],
  11328. otherArgs = castSlice(args, 0, start);
  11329. if (array) {
  11330. arrayPush(otherArgs, array);
  11331. }
  11332. return apply(func, this, otherArgs);
  11333. });
  11334. }
  11335. /**
  11336. * Creates a throttled function that only invokes `func` at most once per
  11337. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11338. * method to cancel delayed `func` invocations and a `flush` method to
  11339. * immediately invoke them. Provide `options` to indicate whether `func`
  11340. * should be invoked on the leading and/or trailing edge of the `wait`
  11341. * timeout. The `func` is invoked with the last arguments provided to the
  11342. * throttled function. Subsequent calls to the throttled function return the
  11343. * result of the last `func` invocation.
  11344. *
  11345. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11346. * invoked on the trailing edge of the timeout only if the throttled function
  11347. * is invoked more than once during the `wait` timeout.
  11348. *
  11349. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11350. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11351. *
  11352. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11353. * for details over the differences between `_.throttle` and `_.debounce`.
  11354. *
  11355. * @static
  11356. * @memberOf _
  11357. * @since 0.1.0
  11358. * @category Function
  11359. * @param {Function} func The function to throttle.
  11360. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11361. * @param {Object} [options={}] The options object.
  11362. * @param {boolean} [options.leading=true]
  11363. * Specify invoking on the leading edge of the timeout.
  11364. * @param {boolean} [options.trailing=true]
  11365. * Specify invoking on the trailing edge of the timeout.
  11366. * @returns {Function} Returns the new throttled function.
  11367. * @example
  11368. *
  11369. * // Avoid excessively updating the position while scrolling.
  11370. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11371. *
  11372. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11373. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11374. * jQuery(element).on('click', throttled);
  11375. *
  11376. * // Cancel the trailing throttled invocation.
  11377. * jQuery(window).on('popstate', throttled.cancel);
  11378. */
  11379. function throttle(func, wait, options) {
  11380. var leading = true,
  11381. trailing = true;
  11382. if (typeof func != 'function') {
  11383. throw new TypeError(FUNC_ERROR_TEXT);
  11384. }
  11385. if (isObject(options)) {
  11386. leading = 'leading' in options ? !!options.leading : leading;
  11387. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11388. }
  11389. return debounce(func, wait, {
  11390. 'leading': leading,
  11391. 'maxWait': wait,
  11392. 'trailing': trailing
  11393. });
  11394. }
  11395. /**
  11396. * Creates a function that accepts up to one argument, ignoring any
  11397. * additional arguments.
  11398. *
  11399. * @static
  11400. * @memberOf _
  11401. * @since 4.0.0
  11402. * @category Function
  11403. * @param {Function} func The function to cap arguments for.
  11404. * @returns {Function} Returns the new capped function.
  11405. * @example
  11406. *
  11407. * _.map(['6', '8', '10'], _.unary(parseInt));
  11408. * // => [6, 8, 10]
  11409. */
  11410. function unary(func) {
  11411. return ary(func, 1);
  11412. }
  11413. /**
  11414. * Creates a function that provides `value` to `wrapper` as its first
  11415. * argument. Any additional arguments provided to the function are appended
  11416. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11417. * binding of the created function.
  11418. *
  11419. * @static
  11420. * @memberOf _
  11421. * @since 0.1.0
  11422. * @category Function
  11423. * @param {*} value The value to wrap.
  11424. * @param {Function} [wrapper=identity] The wrapper function.
  11425. * @returns {Function} Returns the new function.
  11426. * @example
  11427. *
  11428. * var p = _.wrap(_.escape, function(func, text) {
  11429. * return '<p>' + func(text) + '</p>';
  11430. * });
  11431. *
  11432. * p('fred, barney, & pebbles');
  11433. * // => '<p>fred, barney, &amp; pebbles</p>'
  11434. */
  11435. function wrap(value, wrapper) {
  11436. return partial(castFunction(wrapper), value);
  11437. }
  11438. /*------------------------------------------------------------------------*/
  11439. /**
  11440. * Casts `value` as an array if it's not one.
  11441. *
  11442. * @static
  11443. * @memberOf _
  11444. * @since 4.4.0
  11445. * @category Lang
  11446. * @param {*} value The value to inspect.
  11447. * @returns {Array} Returns the cast array.
  11448. * @example
  11449. *
  11450. * _.castArray(1);
  11451. * // => [1]
  11452. *
  11453. * _.castArray({ 'a': 1 });
  11454. * // => [{ 'a': 1 }]
  11455. *
  11456. * _.castArray('abc');
  11457. * // => ['abc']
  11458. *
  11459. * _.castArray(null);
  11460. * // => [null]
  11461. *
  11462. * _.castArray(undefined);
  11463. * // => [undefined]
  11464. *
  11465. * _.castArray();
  11466. * // => []
  11467. *
  11468. * var array = [1, 2, 3];
  11469. * console.log(_.castArray(array) === array);
  11470. * // => true
  11471. */
  11472. function castArray() {
  11473. if (!arguments.length) {
  11474. return [];
  11475. }
  11476. var value = arguments[0];
  11477. return isArray(value) ? value : [value];
  11478. }
  11479. /**
  11480. * Creates a shallow clone of `value`.
  11481. *
  11482. * **Note:** This method is loosely based on the
  11483. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11484. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11485. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11486. * arrays. The own enumerable properties of `arguments` objects are cloned
  11487. * as plain objects. An empty object is returned for uncloneable values such
  11488. * as error objects, functions, DOM nodes, and WeakMaps.
  11489. *
  11490. * @static
  11491. * @memberOf _
  11492. * @since 0.1.0
  11493. * @category Lang
  11494. * @param {*} value The value to clone.
  11495. * @returns {*} Returns the cloned value.
  11496. * @see _.cloneDeep
  11497. * @example
  11498. *
  11499. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11500. *
  11501. * var shallow = _.clone(objects);
  11502. * console.log(shallow[0] === objects[0]);
  11503. * // => true
  11504. */
  11505. function clone(value) {
  11506. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11507. }
  11508. /**
  11509. * This method is like `_.clone` except that it accepts `customizer` which
  11510. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11511. * cloning is handled by the method instead. The `customizer` is invoked with
  11512. * up to four arguments; (value [, index|key, object, stack]).
  11513. *
  11514. * @static
  11515. * @memberOf _
  11516. * @since 4.0.0
  11517. * @category Lang
  11518. * @param {*} value The value to clone.
  11519. * @param {Function} [customizer] The function to customize cloning.
  11520. * @returns {*} Returns the cloned value.
  11521. * @see _.cloneDeepWith
  11522. * @example
  11523. *
  11524. * function customizer(value) {
  11525. * if (_.isElement(value)) {
  11526. * return value.cloneNode(false);
  11527. * }
  11528. * }
  11529. *
  11530. * var el = _.cloneWith(document.body, customizer);
  11531. *
  11532. * console.log(el === document.body);
  11533. * // => false
  11534. * console.log(el.nodeName);
  11535. * // => 'BODY'
  11536. * console.log(el.childNodes.length);
  11537. * // => 0
  11538. */
  11539. function cloneWith(value, customizer) {
  11540. customizer = typeof customizer == 'function' ? customizer : undefined;
  11541. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11542. }
  11543. /**
  11544. * This method is like `_.clone` except that it recursively clones `value`.
  11545. *
  11546. * @static
  11547. * @memberOf _
  11548. * @since 1.0.0
  11549. * @category Lang
  11550. * @param {*} value The value to recursively clone.
  11551. * @returns {*} Returns the deep cloned value.
  11552. * @see _.clone
  11553. * @example
  11554. *
  11555. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11556. *
  11557. * var deep = _.cloneDeep(objects);
  11558. * console.log(deep[0] === objects[0]);
  11559. * // => false
  11560. */
  11561. function cloneDeep(value) {
  11562. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11563. }
  11564. /**
  11565. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11566. *
  11567. * @static
  11568. * @memberOf _
  11569. * @since 4.0.0
  11570. * @category Lang
  11571. * @param {*} value The value to recursively clone.
  11572. * @param {Function} [customizer] The function to customize cloning.
  11573. * @returns {*} Returns the deep cloned value.
  11574. * @see _.cloneWith
  11575. * @example
  11576. *
  11577. * function customizer(value) {
  11578. * if (_.isElement(value)) {
  11579. * return value.cloneNode(true);
  11580. * }
  11581. * }
  11582. *
  11583. * var el = _.cloneDeepWith(document.body, customizer);
  11584. *
  11585. * console.log(el === document.body);
  11586. * // => false
  11587. * console.log(el.nodeName);
  11588. * // => 'BODY'
  11589. * console.log(el.childNodes.length);
  11590. * // => 20
  11591. */
  11592. function cloneDeepWith(value, customizer) {
  11593. customizer = typeof customizer == 'function' ? customizer : undefined;
  11594. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11595. }
  11596. /**
  11597. * Checks if `object` conforms to `source` by invoking the predicate
  11598. * properties of `source` with the corresponding property values of `object`.
  11599. *
  11600. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11601. * partially applied.
  11602. *
  11603. * @static
  11604. * @memberOf _
  11605. * @since 4.14.0
  11606. * @category Lang
  11607. * @param {Object} object The object to inspect.
  11608. * @param {Object} source The object of property predicates to conform to.
  11609. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11610. * @example
  11611. *
  11612. * var object = { 'a': 1, 'b': 2 };
  11613. *
  11614. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11615. * // => true
  11616. *
  11617. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11618. * // => false
  11619. */
  11620. function conformsTo(object, source) {
  11621. return source == null || baseConformsTo(object, source, keys(source));
  11622. }
  11623. /**
  11624. * Performs a
  11625. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11626. * comparison between two values to determine if they are equivalent.
  11627. *
  11628. * @static
  11629. * @memberOf _
  11630. * @since 4.0.0
  11631. * @category Lang
  11632. * @param {*} value The value to compare.
  11633. * @param {*} other The other value to compare.
  11634. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11635. * @example
  11636. *
  11637. * var object = { 'a': 1 };
  11638. * var other = { 'a': 1 };
  11639. *
  11640. * _.eq(object, object);
  11641. * // => true
  11642. *
  11643. * _.eq(object, other);
  11644. * // => false
  11645. *
  11646. * _.eq('a', 'a');
  11647. * // => true
  11648. *
  11649. * _.eq('a', Object('a'));
  11650. * // => false
  11651. *
  11652. * _.eq(NaN, NaN);
  11653. * // => true
  11654. */
  11655. function eq(value, other) {
  11656. return value === other || (value !== value && other !== other);
  11657. }
  11658. /**
  11659. * Checks if `value` is greater than `other`.
  11660. *
  11661. * @static
  11662. * @memberOf _
  11663. * @since 3.9.0
  11664. * @category Lang
  11665. * @param {*} value The value to compare.
  11666. * @param {*} other The other value to compare.
  11667. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11668. * else `false`.
  11669. * @see _.lt
  11670. * @example
  11671. *
  11672. * _.gt(3, 1);
  11673. * // => true
  11674. *
  11675. * _.gt(3, 3);
  11676. * // => false
  11677. *
  11678. * _.gt(1, 3);
  11679. * // => false
  11680. */
  11681. var gt = createRelationalOperation(baseGt);
  11682. /**
  11683. * Checks if `value` is greater than or equal to `other`.
  11684. *
  11685. * @static
  11686. * @memberOf _
  11687. * @since 3.9.0
  11688. * @category Lang
  11689. * @param {*} value The value to compare.
  11690. * @param {*} other The other value to compare.
  11691. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11692. * `other`, else `false`.
  11693. * @see _.lte
  11694. * @example
  11695. *
  11696. * _.gte(3, 1);
  11697. * // => true
  11698. *
  11699. * _.gte(3, 3);
  11700. * // => true
  11701. *
  11702. * _.gte(1, 3);
  11703. * // => false
  11704. */
  11705. var gte = createRelationalOperation(function(value, other) {
  11706. return value >= other;
  11707. });
  11708. /**
  11709. * Checks if `value` is likely an `arguments` object.
  11710. *
  11711. * @static
  11712. * @memberOf _
  11713. * @since 0.1.0
  11714. * @category Lang
  11715. * @param {*} value The value to check.
  11716. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11717. * else `false`.
  11718. * @example
  11719. *
  11720. * _.isArguments(function() { return arguments; }());
  11721. * // => true
  11722. *
  11723. * _.isArguments([1, 2, 3]);
  11724. * // => false
  11725. */
  11726. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11727. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11728. !propertyIsEnumerable.call(value, 'callee');
  11729. };
  11730. /**
  11731. * Checks if `value` is classified as an `Array` object.
  11732. *
  11733. * @static
  11734. * @memberOf _
  11735. * @since 0.1.0
  11736. * @category Lang
  11737. * @param {*} value The value to check.
  11738. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11739. * @example
  11740. *
  11741. * _.isArray([1, 2, 3]);
  11742. * // => true
  11743. *
  11744. * _.isArray(document.body.children);
  11745. * // => false
  11746. *
  11747. * _.isArray('abc');
  11748. * // => false
  11749. *
  11750. * _.isArray(_.noop);
  11751. * // => false
  11752. */
  11753. var isArray = Array.isArray;
  11754. /**
  11755. * Checks if `value` is classified as an `ArrayBuffer` object.
  11756. *
  11757. * @static
  11758. * @memberOf _
  11759. * @since 4.3.0
  11760. * @category Lang
  11761. * @param {*} value The value to check.
  11762. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11763. * @example
  11764. *
  11765. * _.isArrayBuffer(new ArrayBuffer(2));
  11766. * // => true
  11767. *
  11768. * _.isArrayBuffer(new Array(2));
  11769. * // => false
  11770. */
  11771. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11772. /**
  11773. * Checks if `value` is array-like. A value is considered array-like if it's
  11774. * not a function and has a `value.length` that's an integer greater than or
  11775. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11776. *
  11777. * @static
  11778. * @memberOf _
  11779. * @since 4.0.0
  11780. * @category Lang
  11781. * @param {*} value The value to check.
  11782. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11783. * @example
  11784. *
  11785. * _.isArrayLike([1, 2, 3]);
  11786. * // => true
  11787. *
  11788. * _.isArrayLike(document.body.children);
  11789. * // => true
  11790. *
  11791. * _.isArrayLike('abc');
  11792. * // => true
  11793. *
  11794. * _.isArrayLike(_.noop);
  11795. * // => false
  11796. */
  11797. function isArrayLike(value) {
  11798. return value != null && isLength(value.length) && !isFunction(value);
  11799. }
  11800. /**
  11801. * This method is like `_.isArrayLike` except that it also checks if `value`
  11802. * is an object.
  11803. *
  11804. * @static
  11805. * @memberOf _
  11806. * @since 4.0.0
  11807. * @category Lang
  11808. * @param {*} value The value to check.
  11809. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11810. * else `false`.
  11811. * @example
  11812. *
  11813. * _.isArrayLikeObject([1, 2, 3]);
  11814. * // => true
  11815. *
  11816. * _.isArrayLikeObject(document.body.children);
  11817. * // => true
  11818. *
  11819. * _.isArrayLikeObject('abc');
  11820. * // => false
  11821. *
  11822. * _.isArrayLikeObject(_.noop);
  11823. * // => false
  11824. */
  11825. function isArrayLikeObject(value) {
  11826. return isObjectLike(value) && isArrayLike(value);
  11827. }
  11828. /**
  11829. * Checks if `value` is classified as a boolean primitive or object.
  11830. *
  11831. * @static
  11832. * @memberOf _
  11833. * @since 0.1.0
  11834. * @category Lang
  11835. * @param {*} value The value to check.
  11836. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11837. * @example
  11838. *
  11839. * _.isBoolean(false);
  11840. * // => true
  11841. *
  11842. * _.isBoolean(null);
  11843. * // => false
  11844. */
  11845. function isBoolean(value) {
  11846. return value === true || value === false ||
  11847. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11848. }
  11849. /**
  11850. * Checks if `value` is a buffer.
  11851. *
  11852. * @static
  11853. * @memberOf _
  11854. * @since 4.3.0
  11855. * @category Lang
  11856. * @param {*} value The value to check.
  11857. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11858. * @example
  11859. *
  11860. * _.isBuffer(new Buffer(2));
  11861. * // => true
  11862. *
  11863. * _.isBuffer(new Uint8Array(2));
  11864. * // => false
  11865. */
  11866. var isBuffer = nativeIsBuffer || stubFalse;
  11867. /**
  11868. * Checks if `value` is classified as a `Date` object.
  11869. *
  11870. * @static
  11871. * @memberOf _
  11872. * @since 0.1.0
  11873. * @category Lang
  11874. * @param {*} value The value to check.
  11875. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11876. * @example
  11877. *
  11878. * _.isDate(new Date);
  11879. * // => true
  11880. *
  11881. * _.isDate('Mon April 23 2012');
  11882. * // => false
  11883. */
  11884. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11885. /**
  11886. * Checks if `value` is likely a DOM element.
  11887. *
  11888. * @static
  11889. * @memberOf _
  11890. * @since 0.1.0
  11891. * @category Lang
  11892. * @param {*} value The value to check.
  11893. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11894. * @example
  11895. *
  11896. * _.isElement(document.body);
  11897. * // => true
  11898. *
  11899. * _.isElement('<body>');
  11900. * // => false
  11901. */
  11902. function isElement(value) {
  11903. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11904. }
  11905. /**
  11906. * Checks if `value` is an empty object, collection, map, or set.
  11907. *
  11908. * Objects are considered empty if they have no own enumerable string keyed
  11909. * properties.
  11910. *
  11911. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11912. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11913. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11914. *
  11915. * @static
  11916. * @memberOf _
  11917. * @since 0.1.0
  11918. * @category Lang
  11919. * @param {*} value The value to check.
  11920. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11921. * @example
  11922. *
  11923. * _.isEmpty(null);
  11924. * // => true
  11925. *
  11926. * _.isEmpty(true);
  11927. * // => true
  11928. *
  11929. * _.isEmpty(1);
  11930. * // => true
  11931. *
  11932. * _.isEmpty([1, 2, 3]);
  11933. * // => false
  11934. *
  11935. * _.isEmpty({ 'a': 1 });
  11936. * // => false
  11937. */
  11938. function isEmpty(value) {
  11939. if (value == null) {
  11940. return true;
  11941. }
  11942. if (isArrayLike(value) &&
  11943. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11944. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11945. return !value.length;
  11946. }
  11947. var tag = getTag(value);
  11948. if (tag == mapTag || tag == setTag) {
  11949. return !value.size;
  11950. }
  11951. if (isPrototype(value)) {
  11952. return !baseKeys(value).length;
  11953. }
  11954. for (var key in value) {
  11955. if (hasOwnProperty.call(value, key)) {
  11956. return false;
  11957. }
  11958. }
  11959. return true;
  11960. }
  11961. /**
  11962. * Performs a deep comparison between two values to determine if they are
  11963. * equivalent.
  11964. *
  11965. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11966. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11967. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11968. * by their own, not inherited, enumerable properties. Functions and DOM
  11969. * nodes are compared by strict equality, i.e. `===`.
  11970. *
  11971. * @static
  11972. * @memberOf _
  11973. * @since 0.1.0
  11974. * @category Lang
  11975. * @param {*} value The value to compare.
  11976. * @param {*} other The other value to compare.
  11977. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11978. * @example
  11979. *
  11980. * var object = { 'a': 1 };
  11981. * var other = { 'a': 1 };
  11982. *
  11983. * _.isEqual(object, other);
  11984. * // => true
  11985. *
  11986. * object === other;
  11987. * // => false
  11988. */
  11989. function isEqual(value, other) {
  11990. return baseIsEqual(value, other);
  11991. }
  11992. /**
  11993. * This method is like `_.isEqual` except that it accepts `customizer` which
  11994. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11995. * are handled by the method instead. The `customizer` is invoked with up to
  11996. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11997. *
  11998. * @static
  11999. * @memberOf _
  12000. * @since 4.0.0
  12001. * @category Lang
  12002. * @param {*} value The value to compare.
  12003. * @param {*} other The other value to compare.
  12004. * @param {Function} [customizer] The function to customize comparisons.
  12005. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12006. * @example
  12007. *
  12008. * function isGreeting(value) {
  12009. * return /^h(?:i|ello)$/.test(value);
  12010. * }
  12011. *
  12012. * function customizer(objValue, othValue) {
  12013. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12014. * return true;
  12015. * }
  12016. * }
  12017. *
  12018. * var array = ['hello', 'goodbye'];
  12019. * var other = ['hi', 'goodbye'];
  12020. *
  12021. * _.isEqualWith(array, other, customizer);
  12022. * // => true
  12023. */
  12024. function isEqualWith(value, other, customizer) {
  12025. customizer = typeof customizer == 'function' ? customizer : undefined;
  12026. var result = customizer ? customizer(value, other) : undefined;
  12027. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12028. }
  12029. /**
  12030. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12031. * `SyntaxError`, `TypeError`, or `URIError` object.
  12032. *
  12033. * @static
  12034. * @memberOf _
  12035. * @since 3.0.0
  12036. * @category Lang
  12037. * @param {*} value The value to check.
  12038. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12039. * @example
  12040. *
  12041. * _.isError(new Error);
  12042. * // => true
  12043. *
  12044. * _.isError(Error);
  12045. * // => false
  12046. */
  12047. function isError(value) {
  12048. if (!isObjectLike(value)) {
  12049. return false;
  12050. }
  12051. var tag = baseGetTag(value);
  12052. return tag == errorTag || tag == domExcTag ||
  12053. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12054. }
  12055. /**
  12056. * Checks if `value` is a finite primitive number.
  12057. *
  12058. * **Note:** This method is based on
  12059. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12060. *
  12061. * @static
  12062. * @memberOf _
  12063. * @since 0.1.0
  12064. * @category Lang
  12065. * @param {*} value The value to check.
  12066. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12067. * @example
  12068. *
  12069. * _.isFinite(3);
  12070. * // => true
  12071. *
  12072. * _.isFinite(Number.MIN_VALUE);
  12073. * // => true
  12074. *
  12075. * _.isFinite(Infinity);
  12076. * // => false
  12077. *
  12078. * _.isFinite('3');
  12079. * // => false
  12080. */
  12081. function isFinite(value) {
  12082. return typeof value == 'number' && nativeIsFinite(value);
  12083. }
  12084. /**
  12085. * Checks if `value` is classified as a `Function` object.
  12086. *
  12087. * @static
  12088. * @memberOf _
  12089. * @since 0.1.0
  12090. * @category Lang
  12091. * @param {*} value The value to check.
  12092. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12093. * @example
  12094. *
  12095. * _.isFunction(_);
  12096. * // => true
  12097. *
  12098. * _.isFunction(/abc/);
  12099. * // => false
  12100. */
  12101. function isFunction(value) {
  12102. if (!isObject(value)) {
  12103. return false;
  12104. }
  12105. // The use of `Object#toString` avoids issues with the `typeof` operator
  12106. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12107. var tag = baseGetTag(value);
  12108. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12109. }
  12110. /**
  12111. * Checks if `value` is an integer.
  12112. *
  12113. * **Note:** This method is based on
  12114. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12115. *
  12116. * @static
  12117. * @memberOf _
  12118. * @since 4.0.0
  12119. * @category Lang
  12120. * @param {*} value The value to check.
  12121. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12122. * @example
  12123. *
  12124. * _.isInteger(3);
  12125. * // => true
  12126. *
  12127. * _.isInteger(Number.MIN_VALUE);
  12128. * // => false
  12129. *
  12130. * _.isInteger(Infinity);
  12131. * // => false
  12132. *
  12133. * _.isInteger('3');
  12134. * // => false
  12135. */
  12136. function isInteger(value) {
  12137. return typeof value == 'number' && value == toInteger(value);
  12138. }
  12139. /**
  12140. * Checks if `value` is a valid array-like length.
  12141. *
  12142. * **Note:** This method is loosely based on
  12143. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12144. *
  12145. * @static
  12146. * @memberOf _
  12147. * @since 4.0.0
  12148. * @category Lang
  12149. * @param {*} value The value to check.
  12150. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12151. * @example
  12152. *
  12153. * _.isLength(3);
  12154. * // => true
  12155. *
  12156. * _.isLength(Number.MIN_VALUE);
  12157. * // => false
  12158. *
  12159. * _.isLength(Infinity);
  12160. * // => false
  12161. *
  12162. * _.isLength('3');
  12163. * // => false
  12164. */
  12165. function isLength(value) {
  12166. return typeof value == 'number' &&
  12167. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12168. }
  12169. /**
  12170. * Checks if `value` is the
  12171. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12172. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12173. *
  12174. * @static
  12175. * @memberOf _
  12176. * @since 0.1.0
  12177. * @category Lang
  12178. * @param {*} value The value to check.
  12179. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12180. * @example
  12181. *
  12182. * _.isObject({});
  12183. * // => true
  12184. *
  12185. * _.isObject([1, 2, 3]);
  12186. * // => true
  12187. *
  12188. * _.isObject(_.noop);
  12189. * // => true
  12190. *
  12191. * _.isObject(null);
  12192. * // => false
  12193. */
  12194. function isObject(value) {
  12195. var type = typeof value;
  12196. return value != null && (type == 'object' || type == 'function');
  12197. }
  12198. /**
  12199. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12200. * and has a `typeof` result of "object".
  12201. *
  12202. * @static
  12203. * @memberOf _
  12204. * @since 4.0.0
  12205. * @category Lang
  12206. * @param {*} value The value to check.
  12207. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12208. * @example
  12209. *
  12210. * _.isObjectLike({});
  12211. * // => true
  12212. *
  12213. * _.isObjectLike([1, 2, 3]);
  12214. * // => true
  12215. *
  12216. * _.isObjectLike(_.noop);
  12217. * // => false
  12218. *
  12219. * _.isObjectLike(null);
  12220. * // => false
  12221. */
  12222. function isObjectLike(value) {
  12223. return value != null && typeof value == 'object';
  12224. }
  12225. /**
  12226. * Checks if `value` is classified as a `Map` object.
  12227. *
  12228. * @static
  12229. * @memberOf _
  12230. * @since 4.3.0
  12231. * @category Lang
  12232. * @param {*} value The value to check.
  12233. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12234. * @example
  12235. *
  12236. * _.isMap(new Map);
  12237. * // => true
  12238. *
  12239. * _.isMap(new WeakMap);
  12240. * // => false
  12241. */
  12242. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12243. /**
  12244. * Performs a partial deep comparison between `object` and `source` to
  12245. * determine if `object` contains equivalent property values.
  12246. *
  12247. * **Note:** This method is equivalent to `_.matches` when `source` is
  12248. * partially applied.
  12249. *
  12250. * Partial comparisons will match empty array and empty object `source`
  12251. * values against any array or object value, respectively. See `_.isEqual`
  12252. * for a list of supported value comparisons.
  12253. *
  12254. * @static
  12255. * @memberOf _
  12256. * @since 3.0.0
  12257. * @category Lang
  12258. * @param {Object} object The object to inspect.
  12259. * @param {Object} source The object of property values to match.
  12260. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12261. * @example
  12262. *
  12263. * var object = { 'a': 1, 'b': 2 };
  12264. *
  12265. * _.isMatch(object, { 'b': 2 });
  12266. * // => true
  12267. *
  12268. * _.isMatch(object, { 'b': 1 });
  12269. * // => false
  12270. */
  12271. function isMatch(object, source) {
  12272. return object === source || baseIsMatch(object, source, getMatchData(source));
  12273. }
  12274. /**
  12275. * This method is like `_.isMatch` except that it accepts `customizer` which
  12276. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12277. * are handled by the method instead. The `customizer` is invoked with five
  12278. * arguments: (objValue, srcValue, index|key, object, source).
  12279. *
  12280. * @static
  12281. * @memberOf _
  12282. * @since 4.0.0
  12283. * @category Lang
  12284. * @param {Object} object The object to inspect.
  12285. * @param {Object} source The object of property values to match.
  12286. * @param {Function} [customizer] The function to customize comparisons.
  12287. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12288. * @example
  12289. *
  12290. * function isGreeting(value) {
  12291. * return /^h(?:i|ello)$/.test(value);
  12292. * }
  12293. *
  12294. * function customizer(objValue, srcValue) {
  12295. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12296. * return true;
  12297. * }
  12298. * }
  12299. *
  12300. * var object = { 'greeting': 'hello' };
  12301. * var source = { 'greeting': 'hi' };
  12302. *
  12303. * _.isMatchWith(object, source, customizer);
  12304. * // => true
  12305. */
  12306. function isMatchWith(object, source, customizer) {
  12307. customizer = typeof customizer == 'function' ? customizer : undefined;
  12308. return baseIsMatch(object, source, getMatchData(source), customizer);
  12309. }
  12310. /**
  12311. * Checks if `value` is `NaN`.
  12312. *
  12313. * **Note:** This method is based on
  12314. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12315. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12316. * `undefined` and other non-number values.
  12317. *
  12318. * @static
  12319. * @memberOf _
  12320. * @since 0.1.0
  12321. * @category Lang
  12322. * @param {*} value The value to check.
  12323. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12324. * @example
  12325. *
  12326. * _.isNaN(NaN);
  12327. * // => true
  12328. *
  12329. * _.isNaN(new Number(NaN));
  12330. * // => true
  12331. *
  12332. * isNaN(undefined);
  12333. * // => true
  12334. *
  12335. * _.isNaN(undefined);
  12336. * // => false
  12337. */
  12338. function isNaN(value) {
  12339. // An `NaN` primitive is the only value that is not equal to itself.
  12340. // Perform the `toStringTag` check first to avoid errors with some
  12341. // ActiveX objects in IE.
  12342. return isNumber(value) && value != +value;
  12343. }
  12344. /**
  12345. * Checks if `value` is a pristine native function.
  12346. *
  12347. * **Note:** This method can't reliably detect native functions in the presence
  12348. * of the core-js package because core-js circumvents this kind of detection.
  12349. * Despite multiple requests, the core-js maintainer has made it clear: any
  12350. * attempt to fix the detection will be obstructed. As a result, we're left
  12351. * with little choice but to throw an error. Unfortunately, this also affects
  12352. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12353. * which rely on core-js.
  12354. *
  12355. * @static
  12356. * @memberOf _
  12357. * @since 3.0.0
  12358. * @category Lang
  12359. * @param {*} value The value to check.
  12360. * @returns {boolean} Returns `true` if `value` is a native function,
  12361. * else `false`.
  12362. * @example
  12363. *
  12364. * _.isNative(Array.prototype.push);
  12365. * // => true
  12366. *
  12367. * _.isNative(_);
  12368. * // => false
  12369. */
  12370. function isNative(value) {
  12371. if (isMaskable(value)) {
  12372. throw new Error(CORE_ERROR_TEXT);
  12373. }
  12374. return baseIsNative(value);
  12375. }
  12376. /**
  12377. * Checks if `value` is `null`.
  12378. *
  12379. * @static
  12380. * @memberOf _
  12381. * @since 0.1.0
  12382. * @category Lang
  12383. * @param {*} value The value to check.
  12384. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12385. * @example
  12386. *
  12387. * _.isNull(null);
  12388. * // => true
  12389. *
  12390. * _.isNull(void 0);
  12391. * // => false
  12392. */
  12393. function isNull(value) {
  12394. return value === null;
  12395. }
  12396. /**
  12397. * Checks if `value` is `null` or `undefined`.
  12398. *
  12399. * @static
  12400. * @memberOf _
  12401. * @since 4.0.0
  12402. * @category Lang
  12403. * @param {*} value The value to check.
  12404. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12405. * @example
  12406. *
  12407. * _.isNil(null);
  12408. * // => true
  12409. *
  12410. * _.isNil(void 0);
  12411. * // => true
  12412. *
  12413. * _.isNil(NaN);
  12414. * // => false
  12415. */
  12416. function isNil(value) {
  12417. return value == null;
  12418. }
  12419. /**
  12420. * Checks if `value` is classified as a `Number` primitive or object.
  12421. *
  12422. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12423. * classified as numbers, use the `_.isFinite` method.
  12424. *
  12425. * @static
  12426. * @memberOf _
  12427. * @since 0.1.0
  12428. * @category Lang
  12429. * @param {*} value The value to check.
  12430. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12431. * @example
  12432. *
  12433. * _.isNumber(3);
  12434. * // => true
  12435. *
  12436. * _.isNumber(Number.MIN_VALUE);
  12437. * // => true
  12438. *
  12439. * _.isNumber(Infinity);
  12440. * // => true
  12441. *
  12442. * _.isNumber('3');
  12443. * // => false
  12444. */
  12445. function isNumber(value) {
  12446. return typeof value == 'number' ||
  12447. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12448. }
  12449. /**
  12450. * Checks if `value` is a plain object, that is, an object created by the
  12451. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12452. *
  12453. * @static
  12454. * @memberOf _
  12455. * @since 0.8.0
  12456. * @category Lang
  12457. * @param {*} value The value to check.
  12458. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12459. * @example
  12460. *
  12461. * function Foo() {
  12462. * this.a = 1;
  12463. * }
  12464. *
  12465. * _.isPlainObject(new Foo);
  12466. * // => false
  12467. *
  12468. * _.isPlainObject([1, 2, 3]);
  12469. * // => false
  12470. *
  12471. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12472. * // => true
  12473. *
  12474. * _.isPlainObject(Object.create(null));
  12475. * // => true
  12476. */
  12477. function isPlainObject(value) {
  12478. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12479. return false;
  12480. }
  12481. var proto = getPrototype(value);
  12482. if (proto === null) {
  12483. return true;
  12484. }
  12485. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12486. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12487. funcToString.call(Ctor) == objectCtorString;
  12488. }
  12489. /**
  12490. * Checks if `value` is classified as a `RegExp` object.
  12491. *
  12492. * @static
  12493. * @memberOf _
  12494. * @since 0.1.0
  12495. * @category Lang
  12496. * @param {*} value The value to check.
  12497. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12498. * @example
  12499. *
  12500. * _.isRegExp(/abc/);
  12501. * // => true
  12502. *
  12503. * _.isRegExp('/abc/');
  12504. * // => false
  12505. */
  12506. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12507. /**
  12508. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12509. * double precision number which isn't the result of a rounded unsafe integer.
  12510. *
  12511. * **Note:** This method is based on
  12512. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12513. *
  12514. * @static
  12515. * @memberOf _
  12516. * @since 4.0.0
  12517. * @category Lang
  12518. * @param {*} value The value to check.
  12519. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12520. * @example
  12521. *
  12522. * _.isSafeInteger(3);
  12523. * // => true
  12524. *
  12525. * _.isSafeInteger(Number.MIN_VALUE);
  12526. * // => false
  12527. *
  12528. * _.isSafeInteger(Infinity);
  12529. * // => false
  12530. *
  12531. * _.isSafeInteger('3');
  12532. * // => false
  12533. */
  12534. function isSafeInteger(value) {
  12535. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12536. }
  12537. /**
  12538. * Checks if `value` is classified as a `Set` object.
  12539. *
  12540. * @static
  12541. * @memberOf _
  12542. * @since 4.3.0
  12543. * @category Lang
  12544. * @param {*} value The value to check.
  12545. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12546. * @example
  12547. *
  12548. * _.isSet(new Set);
  12549. * // => true
  12550. *
  12551. * _.isSet(new WeakSet);
  12552. * // => false
  12553. */
  12554. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12555. /**
  12556. * Checks if `value` is classified as a `String` primitive or object.
  12557. *
  12558. * @static
  12559. * @since 0.1.0
  12560. * @memberOf _
  12561. * @category Lang
  12562. * @param {*} value The value to check.
  12563. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12564. * @example
  12565. *
  12566. * _.isString('abc');
  12567. * // => true
  12568. *
  12569. * _.isString(1);
  12570. * // => false
  12571. */
  12572. function isString(value) {
  12573. return typeof value == 'string' ||
  12574. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12575. }
  12576. /**
  12577. * Checks if `value` is classified as a `Symbol` primitive or object.
  12578. *
  12579. * @static
  12580. * @memberOf _
  12581. * @since 4.0.0
  12582. * @category Lang
  12583. * @param {*} value The value to check.
  12584. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12585. * @example
  12586. *
  12587. * _.isSymbol(Symbol.iterator);
  12588. * // => true
  12589. *
  12590. * _.isSymbol('abc');
  12591. * // => false
  12592. */
  12593. function isSymbol(value) {
  12594. return typeof value == 'symbol' ||
  12595. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12596. }
  12597. /**
  12598. * Checks if `value` is classified as a typed array.
  12599. *
  12600. * @static
  12601. * @memberOf _
  12602. * @since 3.0.0
  12603. * @category Lang
  12604. * @param {*} value The value to check.
  12605. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12606. * @example
  12607. *
  12608. * _.isTypedArray(new Uint8Array);
  12609. * // => true
  12610. *
  12611. * _.isTypedArray([]);
  12612. * // => false
  12613. */
  12614. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12615. /**
  12616. * Checks if `value` is `undefined`.
  12617. *
  12618. * @static
  12619. * @since 0.1.0
  12620. * @memberOf _
  12621. * @category Lang
  12622. * @param {*} value The value to check.
  12623. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12624. * @example
  12625. *
  12626. * _.isUndefined(void 0);
  12627. * // => true
  12628. *
  12629. * _.isUndefined(null);
  12630. * // => false
  12631. */
  12632. function isUndefined(value) {
  12633. return value === undefined;
  12634. }
  12635. /**
  12636. * Checks if `value` is classified as a `WeakMap` object.
  12637. *
  12638. * @static
  12639. * @memberOf _
  12640. * @since 4.3.0
  12641. * @category Lang
  12642. * @param {*} value The value to check.
  12643. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12644. * @example
  12645. *
  12646. * _.isWeakMap(new WeakMap);
  12647. * // => true
  12648. *
  12649. * _.isWeakMap(new Map);
  12650. * // => false
  12651. */
  12652. function isWeakMap(value) {
  12653. return isObjectLike(value) && getTag(value) == weakMapTag;
  12654. }
  12655. /**
  12656. * Checks if `value` is classified as a `WeakSet` object.
  12657. *
  12658. * @static
  12659. * @memberOf _
  12660. * @since 4.3.0
  12661. * @category Lang
  12662. * @param {*} value The value to check.
  12663. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12664. * @example
  12665. *
  12666. * _.isWeakSet(new WeakSet);
  12667. * // => true
  12668. *
  12669. * _.isWeakSet(new Set);
  12670. * // => false
  12671. */
  12672. function isWeakSet(value) {
  12673. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12674. }
  12675. /**
  12676. * Checks if `value` is less than `other`.
  12677. *
  12678. * @static
  12679. * @memberOf _
  12680. * @since 3.9.0
  12681. * @category Lang
  12682. * @param {*} value The value to compare.
  12683. * @param {*} other The other value to compare.
  12684. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12685. * else `false`.
  12686. * @see _.gt
  12687. * @example
  12688. *
  12689. * _.lt(1, 3);
  12690. * // => true
  12691. *
  12692. * _.lt(3, 3);
  12693. * // => false
  12694. *
  12695. * _.lt(3, 1);
  12696. * // => false
  12697. */
  12698. var lt = createRelationalOperation(baseLt);
  12699. /**
  12700. * Checks if `value` is less than or equal to `other`.
  12701. *
  12702. * @static
  12703. * @memberOf _
  12704. * @since 3.9.0
  12705. * @category Lang
  12706. * @param {*} value The value to compare.
  12707. * @param {*} other The other value to compare.
  12708. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12709. * `other`, else `false`.
  12710. * @see _.gte
  12711. * @example
  12712. *
  12713. * _.lte(1, 3);
  12714. * // => true
  12715. *
  12716. * _.lte(3, 3);
  12717. * // => true
  12718. *
  12719. * _.lte(3, 1);
  12720. * // => false
  12721. */
  12722. var lte = createRelationalOperation(function(value, other) {
  12723. return value <= other;
  12724. });
  12725. /**
  12726. * Converts `value` to an array.
  12727. *
  12728. * @static
  12729. * @since 0.1.0
  12730. * @memberOf _
  12731. * @category Lang
  12732. * @param {*} value The value to convert.
  12733. * @returns {Array} Returns the converted array.
  12734. * @example
  12735. *
  12736. * _.toArray({ 'a': 1, 'b': 2 });
  12737. * // => [1, 2]
  12738. *
  12739. * _.toArray('abc');
  12740. * // => ['a', 'b', 'c']
  12741. *
  12742. * _.toArray(1);
  12743. * // => []
  12744. *
  12745. * _.toArray(null);
  12746. * // => []
  12747. */
  12748. function toArray(value) {
  12749. if (!value) {
  12750. return [];
  12751. }
  12752. if (isArrayLike(value)) {
  12753. return isString(value) ? stringToArray(value) : copyArray(value);
  12754. }
  12755. if (symIterator && value[symIterator]) {
  12756. return iteratorToArray(value[symIterator]());
  12757. }
  12758. var tag = getTag(value),
  12759. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12760. return func(value);
  12761. }
  12762. /**
  12763. * Converts `value` to a finite number.
  12764. *
  12765. * @static
  12766. * @memberOf _
  12767. * @since 4.12.0
  12768. * @category Lang
  12769. * @param {*} value The value to convert.
  12770. * @returns {number} Returns the converted number.
  12771. * @example
  12772. *
  12773. * _.toFinite(3.2);
  12774. * // => 3.2
  12775. *
  12776. * _.toFinite(Number.MIN_VALUE);
  12777. * // => 5e-324
  12778. *
  12779. * _.toFinite(Infinity);
  12780. * // => 1.7976931348623157e+308
  12781. *
  12782. * _.toFinite('3.2');
  12783. * // => 3.2
  12784. */
  12785. function toFinite(value) {
  12786. if (!value) {
  12787. return value === 0 ? value : 0;
  12788. }
  12789. value = toNumber(value);
  12790. if (value === INFINITY || value === -INFINITY) {
  12791. var sign = (value < 0 ? -1 : 1);
  12792. return sign * MAX_INTEGER;
  12793. }
  12794. return value === value ? value : 0;
  12795. }
  12796. /**
  12797. * Converts `value` to an integer.
  12798. *
  12799. * **Note:** This method is loosely based on
  12800. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12801. *
  12802. * @static
  12803. * @memberOf _
  12804. * @since 4.0.0
  12805. * @category Lang
  12806. * @param {*} value The value to convert.
  12807. * @returns {number} Returns the converted integer.
  12808. * @example
  12809. *
  12810. * _.toInteger(3.2);
  12811. * // => 3
  12812. *
  12813. * _.toInteger(Number.MIN_VALUE);
  12814. * // => 0
  12815. *
  12816. * _.toInteger(Infinity);
  12817. * // => 1.7976931348623157e+308
  12818. *
  12819. * _.toInteger('3.2');
  12820. * // => 3
  12821. */
  12822. function toInteger(value) {
  12823. var result = toFinite(value),
  12824. remainder = result % 1;
  12825. return result === result ? (remainder ? result - remainder : result) : 0;
  12826. }
  12827. /**
  12828. * Converts `value` to an integer suitable for use as the length of an
  12829. * array-like object.
  12830. *
  12831. * **Note:** This method is based on
  12832. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12833. *
  12834. * @static
  12835. * @memberOf _
  12836. * @since 4.0.0
  12837. * @category Lang
  12838. * @param {*} value The value to convert.
  12839. * @returns {number} Returns the converted integer.
  12840. * @example
  12841. *
  12842. * _.toLength(3.2);
  12843. * // => 3
  12844. *
  12845. * _.toLength(Number.MIN_VALUE);
  12846. * // => 0
  12847. *
  12848. * _.toLength(Infinity);
  12849. * // => 4294967295
  12850. *
  12851. * _.toLength('3.2');
  12852. * // => 3
  12853. */
  12854. function toLength(value) {
  12855. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12856. }
  12857. /**
  12858. * Converts `value` to a number.
  12859. *
  12860. * @static
  12861. * @memberOf _
  12862. * @since 4.0.0
  12863. * @category Lang
  12864. * @param {*} value The value to process.
  12865. * @returns {number} Returns the number.
  12866. * @example
  12867. *
  12868. * _.toNumber(3.2);
  12869. * // => 3.2
  12870. *
  12871. * _.toNumber(Number.MIN_VALUE);
  12872. * // => 5e-324
  12873. *
  12874. * _.toNumber(Infinity);
  12875. * // => Infinity
  12876. *
  12877. * _.toNumber('3.2');
  12878. * // => 3.2
  12879. */
  12880. function toNumber(value) {
  12881. if (typeof value == 'number') {
  12882. return value;
  12883. }
  12884. if (isSymbol(value)) {
  12885. return NAN;
  12886. }
  12887. if (isObject(value)) {
  12888. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12889. value = isObject(other) ? (other + '') : other;
  12890. }
  12891. if (typeof value != 'string') {
  12892. return value === 0 ? value : +value;
  12893. }
  12894. value = baseTrim(value);
  12895. var isBinary = reIsBinary.test(value);
  12896. return (isBinary || reIsOctal.test(value))
  12897. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12898. : (reIsBadHex.test(value) ? NAN : +value);
  12899. }
  12900. /**
  12901. * Converts `value` to a plain object flattening inherited enumerable string
  12902. * keyed properties of `value` to own properties of the plain object.
  12903. *
  12904. * @static
  12905. * @memberOf _
  12906. * @since 3.0.0
  12907. * @category Lang
  12908. * @param {*} value The value to convert.
  12909. * @returns {Object} Returns the converted plain object.
  12910. * @example
  12911. *
  12912. * function Foo() {
  12913. * this.b = 2;
  12914. * }
  12915. *
  12916. * Foo.prototype.c = 3;
  12917. *
  12918. * _.assign({ 'a': 1 }, new Foo);
  12919. * // => { 'a': 1, 'b': 2 }
  12920. *
  12921. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12922. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12923. */
  12924. function toPlainObject(value) {
  12925. return copyObject(value, keysIn(value));
  12926. }
  12927. /**
  12928. * Converts `value` to a safe integer. A safe integer can be compared and
  12929. * represented correctly.
  12930. *
  12931. * @static
  12932. * @memberOf _
  12933. * @since 4.0.0
  12934. * @category Lang
  12935. * @param {*} value The value to convert.
  12936. * @returns {number} Returns the converted integer.
  12937. * @example
  12938. *
  12939. * _.toSafeInteger(3.2);
  12940. * // => 3
  12941. *
  12942. * _.toSafeInteger(Number.MIN_VALUE);
  12943. * // => 0
  12944. *
  12945. * _.toSafeInteger(Infinity);
  12946. * // => 9007199254740991
  12947. *
  12948. * _.toSafeInteger('3.2');
  12949. * // => 3
  12950. */
  12951. function toSafeInteger(value) {
  12952. return value
  12953. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12954. : (value === 0 ? value : 0);
  12955. }
  12956. /**
  12957. * Converts `value` to a string. An empty string is returned for `null`
  12958. * and `undefined` values. The sign of `-0` is preserved.
  12959. *
  12960. * @static
  12961. * @memberOf _
  12962. * @since 4.0.0
  12963. * @category Lang
  12964. * @param {*} value The value to convert.
  12965. * @returns {string} Returns the converted string.
  12966. * @example
  12967. *
  12968. * _.toString(null);
  12969. * // => ''
  12970. *
  12971. * _.toString(-0);
  12972. * // => '-0'
  12973. *
  12974. * _.toString([1, 2, 3]);
  12975. * // => '1,2,3'
  12976. */
  12977. function toString(value) {
  12978. return value == null ? '' : baseToString(value);
  12979. }
  12980. /*------------------------------------------------------------------------*/
  12981. /**
  12982. * Assigns own enumerable string keyed properties of source objects to the
  12983. * destination object. Source objects are applied from left to right.
  12984. * Subsequent sources overwrite property assignments of previous sources.
  12985. *
  12986. * **Note:** This method mutates `object` and is loosely based on
  12987. * [`Object.assign`](https://mdn.io/Object/assign).
  12988. *
  12989. * @static
  12990. * @memberOf _
  12991. * @since 0.10.0
  12992. * @category Object
  12993. * @param {Object} object The destination object.
  12994. * @param {...Object} [sources] The source objects.
  12995. * @returns {Object} Returns `object`.
  12996. * @see _.assignIn
  12997. * @example
  12998. *
  12999. * function Foo() {
  13000. * this.a = 1;
  13001. * }
  13002. *
  13003. * function Bar() {
  13004. * this.c = 3;
  13005. * }
  13006. *
  13007. * Foo.prototype.b = 2;
  13008. * Bar.prototype.d = 4;
  13009. *
  13010. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13011. * // => { 'a': 1, 'c': 3 }
  13012. */
  13013. var assign = createAssigner(function(object, source) {
  13014. if (isPrototype(source) || isArrayLike(source)) {
  13015. copyObject(source, keys(source), object);
  13016. return;
  13017. }
  13018. for (var key in source) {
  13019. if (hasOwnProperty.call(source, key)) {
  13020. assignValue(object, key, source[key]);
  13021. }
  13022. }
  13023. });
  13024. /**
  13025. * This method is like `_.assign` except that it iterates over own and
  13026. * inherited source properties.
  13027. *
  13028. * **Note:** This method mutates `object`.
  13029. *
  13030. * @static
  13031. * @memberOf _
  13032. * @since 4.0.0
  13033. * @alias extend
  13034. * @category Object
  13035. * @param {Object} object The destination object.
  13036. * @param {...Object} [sources] The source objects.
  13037. * @returns {Object} Returns `object`.
  13038. * @see _.assign
  13039. * @example
  13040. *
  13041. * function Foo() {
  13042. * this.a = 1;
  13043. * }
  13044. *
  13045. * function Bar() {
  13046. * this.c = 3;
  13047. * }
  13048. *
  13049. * Foo.prototype.b = 2;
  13050. * Bar.prototype.d = 4;
  13051. *
  13052. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13053. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13054. */
  13055. var assignIn = createAssigner(function(object, source) {
  13056. copyObject(source, keysIn(source), object);
  13057. });
  13058. /**
  13059. * This method is like `_.assignIn` except that it accepts `customizer`
  13060. * which is invoked to produce the assigned values. If `customizer` returns
  13061. * `undefined`, assignment is handled by the method instead. The `customizer`
  13062. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13063. *
  13064. * **Note:** This method mutates `object`.
  13065. *
  13066. * @static
  13067. * @memberOf _
  13068. * @since 4.0.0
  13069. * @alias extendWith
  13070. * @category Object
  13071. * @param {Object} object The destination object.
  13072. * @param {...Object} sources The source objects.
  13073. * @param {Function} [customizer] The function to customize assigned values.
  13074. * @returns {Object} Returns `object`.
  13075. * @see _.assignWith
  13076. * @example
  13077. *
  13078. * function customizer(objValue, srcValue) {
  13079. * return _.isUndefined(objValue) ? srcValue : objValue;
  13080. * }
  13081. *
  13082. * var defaults = _.partialRight(_.assignInWith, customizer);
  13083. *
  13084. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13085. * // => { 'a': 1, 'b': 2 }
  13086. */
  13087. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13088. copyObject(source, keysIn(source), object, customizer);
  13089. });
  13090. /**
  13091. * This method is like `_.assign` except that it accepts `customizer`
  13092. * which is invoked to produce the assigned values. If `customizer` returns
  13093. * `undefined`, assignment is handled by the method instead. The `customizer`
  13094. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13095. *
  13096. * **Note:** This method mutates `object`.
  13097. *
  13098. * @static
  13099. * @memberOf _
  13100. * @since 4.0.0
  13101. * @category Object
  13102. * @param {Object} object The destination object.
  13103. * @param {...Object} sources The source objects.
  13104. * @param {Function} [customizer] The function to customize assigned values.
  13105. * @returns {Object} Returns `object`.
  13106. * @see _.assignInWith
  13107. * @example
  13108. *
  13109. * function customizer(objValue, srcValue) {
  13110. * return _.isUndefined(objValue) ? srcValue : objValue;
  13111. * }
  13112. *
  13113. * var defaults = _.partialRight(_.assignWith, customizer);
  13114. *
  13115. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13116. * // => { 'a': 1, 'b': 2 }
  13117. */
  13118. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13119. copyObject(source, keys(source), object, customizer);
  13120. });
  13121. /**
  13122. * Creates an array of values corresponding to `paths` of `object`.
  13123. *
  13124. * @static
  13125. * @memberOf _
  13126. * @since 1.0.0
  13127. * @category Object
  13128. * @param {Object} object The object to iterate over.
  13129. * @param {...(string|string[])} [paths] The property paths to pick.
  13130. * @returns {Array} Returns the picked values.
  13131. * @example
  13132. *
  13133. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13134. *
  13135. * _.at(object, ['a[0].b.c', 'a[1]']);
  13136. * // => [3, 4]
  13137. */
  13138. var at = flatRest(baseAt);
  13139. /**
  13140. * Creates an object that inherits from the `prototype` object. If a
  13141. * `properties` object is given, its own enumerable string keyed properties
  13142. * are assigned to the created object.
  13143. *
  13144. * @static
  13145. * @memberOf _
  13146. * @since 2.3.0
  13147. * @category Object
  13148. * @param {Object} prototype The object to inherit from.
  13149. * @param {Object} [properties] The properties to assign to the object.
  13150. * @returns {Object} Returns the new object.
  13151. * @example
  13152. *
  13153. * function Shape() {
  13154. * this.x = 0;
  13155. * this.y = 0;
  13156. * }
  13157. *
  13158. * function Circle() {
  13159. * Shape.call(this);
  13160. * }
  13161. *
  13162. * Circle.prototype = _.create(Shape.prototype, {
  13163. * 'constructor': Circle
  13164. * });
  13165. *
  13166. * var circle = new Circle;
  13167. * circle instanceof Circle;
  13168. * // => true
  13169. *
  13170. * circle instanceof Shape;
  13171. * // => true
  13172. */
  13173. function create(prototype, properties) {
  13174. var result = baseCreate(prototype);
  13175. return properties == null ? result : baseAssign(result, properties);
  13176. }
  13177. /**
  13178. * Assigns own and inherited enumerable string keyed properties of source
  13179. * objects to the destination object for all destination properties that
  13180. * resolve to `undefined`. Source objects are applied from left to right.
  13181. * Once a property is set, additional values of the same property are ignored.
  13182. *
  13183. * **Note:** This method mutates `object`.
  13184. *
  13185. * @static
  13186. * @since 0.1.0
  13187. * @memberOf _
  13188. * @category Object
  13189. * @param {Object} object The destination object.
  13190. * @param {...Object} [sources] The source objects.
  13191. * @returns {Object} Returns `object`.
  13192. * @see _.defaultsDeep
  13193. * @example
  13194. *
  13195. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13196. * // => { 'a': 1, 'b': 2 }
  13197. */
  13198. var defaults = baseRest(function(object, sources) {
  13199. object = Object(object);
  13200. var index = -1;
  13201. var length = sources.length;
  13202. var guard = length > 2 ? sources[2] : undefined;
  13203. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13204. length = 1;
  13205. }
  13206. while (++index < length) {
  13207. var source = sources[index];
  13208. var props = keysIn(source);
  13209. var propsIndex = -1;
  13210. var propsLength = props.length;
  13211. while (++propsIndex < propsLength) {
  13212. var key = props[propsIndex];
  13213. var value = object[key];
  13214. if (value === undefined ||
  13215. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13216. object[key] = source[key];
  13217. }
  13218. }
  13219. }
  13220. return object;
  13221. });
  13222. /**
  13223. * This method is like `_.defaults` except that it recursively assigns
  13224. * default properties.
  13225. *
  13226. * **Note:** This method mutates `object`.
  13227. *
  13228. * @static
  13229. * @memberOf _
  13230. * @since 3.10.0
  13231. * @category Object
  13232. * @param {Object} object The destination object.
  13233. * @param {...Object} [sources] The source objects.
  13234. * @returns {Object} Returns `object`.
  13235. * @see _.defaults
  13236. * @example
  13237. *
  13238. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13239. * // => { 'a': { 'b': 2, 'c': 3 } }
  13240. */
  13241. var defaultsDeep = baseRest(function(args) {
  13242. args.push(undefined, customDefaultsMerge);
  13243. return apply(mergeWith, undefined, args);
  13244. });
  13245. /**
  13246. * This method is like `_.find` except that it returns the key of the first
  13247. * element `predicate` returns truthy for instead of the element itself.
  13248. *
  13249. * @static
  13250. * @memberOf _
  13251. * @since 1.1.0
  13252. * @category Object
  13253. * @param {Object} object The object to inspect.
  13254. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13255. * @returns {string|undefined} Returns the key of the matched element,
  13256. * else `undefined`.
  13257. * @example
  13258. *
  13259. * var users = {
  13260. * 'barney': { 'age': 36, 'active': true },
  13261. * 'fred': { 'age': 40, 'active': false },
  13262. * 'pebbles': { 'age': 1, 'active': true }
  13263. * };
  13264. *
  13265. * _.findKey(users, function(o) { return o.age < 40; });
  13266. * // => 'barney' (iteration order is not guaranteed)
  13267. *
  13268. * // The `_.matches` iteratee shorthand.
  13269. * _.findKey(users, { 'age': 1, 'active': true });
  13270. * // => 'pebbles'
  13271. *
  13272. * // The `_.matchesProperty` iteratee shorthand.
  13273. * _.findKey(users, ['active', false]);
  13274. * // => 'fred'
  13275. *
  13276. * // The `_.property` iteratee shorthand.
  13277. * _.findKey(users, 'active');
  13278. * // => 'barney'
  13279. */
  13280. function findKey(object, predicate) {
  13281. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13282. }
  13283. /**
  13284. * This method is like `_.findKey` except that it iterates over elements of
  13285. * a collection in the opposite order.
  13286. *
  13287. * @static
  13288. * @memberOf _
  13289. * @since 2.0.0
  13290. * @category Object
  13291. * @param {Object} object The object to inspect.
  13292. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13293. * @returns {string|undefined} Returns the key of the matched element,
  13294. * else `undefined`.
  13295. * @example
  13296. *
  13297. * var users = {
  13298. * 'barney': { 'age': 36, 'active': true },
  13299. * 'fred': { 'age': 40, 'active': false },
  13300. * 'pebbles': { 'age': 1, 'active': true }
  13301. * };
  13302. *
  13303. * _.findLastKey(users, function(o) { return o.age < 40; });
  13304. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13305. *
  13306. * // The `_.matches` iteratee shorthand.
  13307. * _.findLastKey(users, { 'age': 36, 'active': true });
  13308. * // => 'barney'
  13309. *
  13310. * // The `_.matchesProperty` iteratee shorthand.
  13311. * _.findLastKey(users, ['active', false]);
  13312. * // => 'fred'
  13313. *
  13314. * // The `_.property` iteratee shorthand.
  13315. * _.findLastKey(users, 'active');
  13316. * // => 'pebbles'
  13317. */
  13318. function findLastKey(object, predicate) {
  13319. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13320. }
  13321. /**
  13322. * Iterates over own and inherited enumerable string keyed properties of an
  13323. * object and invokes `iteratee` for each property. The iteratee is invoked
  13324. * with three arguments: (value, key, object). Iteratee functions may exit
  13325. * iteration early by explicitly returning `false`.
  13326. *
  13327. * @static
  13328. * @memberOf _
  13329. * @since 0.3.0
  13330. * @category Object
  13331. * @param {Object} object The object to iterate over.
  13332. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13333. * @returns {Object} Returns `object`.
  13334. * @see _.forInRight
  13335. * @example
  13336. *
  13337. * function Foo() {
  13338. * this.a = 1;
  13339. * this.b = 2;
  13340. * }
  13341. *
  13342. * Foo.prototype.c = 3;
  13343. *
  13344. * _.forIn(new Foo, function(value, key) {
  13345. * console.log(key);
  13346. * });
  13347. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13348. */
  13349. function forIn(object, iteratee) {
  13350. return object == null
  13351. ? object
  13352. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13353. }
  13354. /**
  13355. * This method is like `_.forIn` except that it iterates over properties of
  13356. * `object` in the opposite order.
  13357. *
  13358. * @static
  13359. * @memberOf _
  13360. * @since 2.0.0
  13361. * @category Object
  13362. * @param {Object} object The object to iterate over.
  13363. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13364. * @returns {Object} Returns `object`.
  13365. * @see _.forIn
  13366. * @example
  13367. *
  13368. * function Foo() {
  13369. * this.a = 1;
  13370. * this.b = 2;
  13371. * }
  13372. *
  13373. * Foo.prototype.c = 3;
  13374. *
  13375. * _.forInRight(new Foo, function(value, key) {
  13376. * console.log(key);
  13377. * });
  13378. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13379. */
  13380. function forInRight(object, iteratee) {
  13381. return object == null
  13382. ? object
  13383. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13384. }
  13385. /**
  13386. * Iterates over own enumerable string keyed properties of an object and
  13387. * invokes `iteratee` for each property. The iteratee is invoked with three
  13388. * arguments: (value, key, object). Iteratee functions may exit iteration
  13389. * early by explicitly returning `false`.
  13390. *
  13391. * @static
  13392. * @memberOf _
  13393. * @since 0.3.0
  13394. * @category Object
  13395. * @param {Object} object The object to iterate over.
  13396. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13397. * @returns {Object} Returns `object`.
  13398. * @see _.forOwnRight
  13399. * @example
  13400. *
  13401. * function Foo() {
  13402. * this.a = 1;
  13403. * this.b = 2;
  13404. * }
  13405. *
  13406. * Foo.prototype.c = 3;
  13407. *
  13408. * _.forOwn(new Foo, function(value, key) {
  13409. * console.log(key);
  13410. * });
  13411. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13412. */
  13413. function forOwn(object, iteratee) {
  13414. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13415. }
  13416. /**
  13417. * This method is like `_.forOwn` except that it iterates over properties of
  13418. * `object` in the opposite order.
  13419. *
  13420. * @static
  13421. * @memberOf _
  13422. * @since 2.0.0
  13423. * @category Object
  13424. * @param {Object} object The object to iterate over.
  13425. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13426. * @returns {Object} Returns `object`.
  13427. * @see _.forOwn
  13428. * @example
  13429. *
  13430. * function Foo() {
  13431. * this.a = 1;
  13432. * this.b = 2;
  13433. * }
  13434. *
  13435. * Foo.prototype.c = 3;
  13436. *
  13437. * _.forOwnRight(new Foo, function(value, key) {
  13438. * console.log(key);
  13439. * });
  13440. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13441. */
  13442. function forOwnRight(object, iteratee) {
  13443. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13444. }
  13445. /**
  13446. * Creates an array of function property names from own enumerable properties
  13447. * of `object`.
  13448. *
  13449. * @static
  13450. * @since 0.1.0
  13451. * @memberOf _
  13452. * @category Object
  13453. * @param {Object} object The object to inspect.
  13454. * @returns {Array} Returns the function names.
  13455. * @see _.functionsIn
  13456. * @example
  13457. *
  13458. * function Foo() {
  13459. * this.a = _.constant('a');
  13460. * this.b = _.constant('b');
  13461. * }
  13462. *
  13463. * Foo.prototype.c = _.constant('c');
  13464. *
  13465. * _.functions(new Foo);
  13466. * // => ['a', 'b']
  13467. */
  13468. function functions(object) {
  13469. return object == null ? [] : baseFunctions(object, keys(object));
  13470. }
  13471. /**
  13472. * Creates an array of function property names from own and inherited
  13473. * enumerable properties of `object`.
  13474. *
  13475. * @static
  13476. * @memberOf _
  13477. * @since 4.0.0
  13478. * @category Object
  13479. * @param {Object} object The object to inspect.
  13480. * @returns {Array} Returns the function names.
  13481. * @see _.functions
  13482. * @example
  13483. *
  13484. * function Foo() {
  13485. * this.a = _.constant('a');
  13486. * this.b = _.constant('b');
  13487. * }
  13488. *
  13489. * Foo.prototype.c = _.constant('c');
  13490. *
  13491. * _.functionsIn(new Foo);
  13492. * // => ['a', 'b', 'c']
  13493. */
  13494. function functionsIn(object) {
  13495. return object == null ? [] : baseFunctions(object, keysIn(object));
  13496. }
  13497. /**
  13498. * Gets the value at `path` of `object`. If the resolved value is
  13499. * `undefined`, the `defaultValue` is returned in its place.
  13500. *
  13501. * @static
  13502. * @memberOf _
  13503. * @since 3.7.0
  13504. * @category Object
  13505. * @param {Object} object The object to query.
  13506. * @param {Array|string} path The path of the property to get.
  13507. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13508. * @returns {*} Returns the resolved value.
  13509. * @example
  13510. *
  13511. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13512. *
  13513. * _.get(object, 'a[0].b.c');
  13514. * // => 3
  13515. *
  13516. * _.get(object, ['a', '0', 'b', 'c']);
  13517. * // => 3
  13518. *
  13519. * _.get(object, 'a.b.c', 'default');
  13520. * // => 'default'
  13521. */
  13522. function get(object, path, defaultValue) {
  13523. var result = object == null ? undefined : baseGet(object, path);
  13524. return result === undefined ? defaultValue : result;
  13525. }
  13526. /**
  13527. * Checks if `path` is a direct property of `object`.
  13528. *
  13529. * @static
  13530. * @since 0.1.0
  13531. * @memberOf _
  13532. * @category Object
  13533. * @param {Object} object The object to query.
  13534. * @param {Array|string} path The path to check.
  13535. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13536. * @example
  13537. *
  13538. * var object = { 'a': { 'b': 2 } };
  13539. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13540. *
  13541. * _.has(object, 'a');
  13542. * // => true
  13543. *
  13544. * _.has(object, 'a.b');
  13545. * // => true
  13546. *
  13547. * _.has(object, ['a', 'b']);
  13548. * // => true
  13549. *
  13550. * _.has(other, 'a');
  13551. * // => false
  13552. */
  13553. function has(object, path) {
  13554. return object != null && hasPath(object, path, baseHas);
  13555. }
  13556. /**
  13557. * Checks if `path` is a direct or inherited property of `object`.
  13558. *
  13559. * @static
  13560. * @memberOf _
  13561. * @since 4.0.0
  13562. * @category Object
  13563. * @param {Object} object The object to query.
  13564. * @param {Array|string} path The path to check.
  13565. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13566. * @example
  13567. *
  13568. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13569. *
  13570. * _.hasIn(object, 'a');
  13571. * // => true
  13572. *
  13573. * _.hasIn(object, 'a.b');
  13574. * // => true
  13575. *
  13576. * _.hasIn(object, ['a', 'b']);
  13577. * // => true
  13578. *
  13579. * _.hasIn(object, 'b');
  13580. * // => false
  13581. */
  13582. function hasIn(object, path) {
  13583. return object != null && hasPath(object, path, baseHasIn);
  13584. }
  13585. /**
  13586. * Creates an object composed of the inverted keys and values of `object`.
  13587. * If `object` contains duplicate values, subsequent values overwrite
  13588. * property assignments of previous values.
  13589. *
  13590. * @static
  13591. * @memberOf _
  13592. * @since 0.7.0
  13593. * @category Object
  13594. * @param {Object} object The object to invert.
  13595. * @returns {Object} Returns the new inverted object.
  13596. * @example
  13597. *
  13598. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13599. *
  13600. * _.invert(object);
  13601. * // => { '1': 'c', '2': 'b' }
  13602. */
  13603. var invert = createInverter(function(result, value, key) {
  13604. if (value != null &&
  13605. typeof value.toString != 'function') {
  13606. value = nativeObjectToString.call(value);
  13607. }
  13608. result[value] = key;
  13609. }, constant(identity));
  13610. /**
  13611. * This method is like `_.invert` except that the inverted object is generated
  13612. * from the results of running each element of `object` thru `iteratee`. The
  13613. * corresponding inverted value of each inverted key is an array of keys
  13614. * responsible for generating the inverted value. The iteratee is invoked
  13615. * with one argument: (value).
  13616. *
  13617. * @static
  13618. * @memberOf _
  13619. * @since 4.1.0
  13620. * @category Object
  13621. * @param {Object} object The object to invert.
  13622. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13623. * @returns {Object} Returns the new inverted object.
  13624. * @example
  13625. *
  13626. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13627. *
  13628. * _.invertBy(object);
  13629. * // => { '1': ['a', 'c'], '2': ['b'] }
  13630. *
  13631. * _.invertBy(object, function(value) {
  13632. * return 'group' + value;
  13633. * });
  13634. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13635. */
  13636. var invertBy = createInverter(function(result, value, key) {
  13637. if (value != null &&
  13638. typeof value.toString != 'function') {
  13639. value = nativeObjectToString.call(value);
  13640. }
  13641. if (hasOwnProperty.call(result, value)) {
  13642. result[value].push(key);
  13643. } else {
  13644. result[value] = [key];
  13645. }
  13646. }, getIteratee);
  13647. /**
  13648. * Invokes the method at `path` of `object`.
  13649. *
  13650. * @static
  13651. * @memberOf _
  13652. * @since 4.0.0
  13653. * @category Object
  13654. * @param {Object} object The object to query.
  13655. * @param {Array|string} path The path of the method to invoke.
  13656. * @param {...*} [args] The arguments to invoke the method with.
  13657. * @returns {*} Returns the result of the invoked method.
  13658. * @example
  13659. *
  13660. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13661. *
  13662. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13663. * // => [2, 3]
  13664. */
  13665. var invoke = baseRest(baseInvoke);
  13666. /**
  13667. * Creates an array of the own enumerable property names of `object`.
  13668. *
  13669. * **Note:** Non-object values are coerced to objects. See the
  13670. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13671. * for more details.
  13672. *
  13673. * @static
  13674. * @since 0.1.0
  13675. * @memberOf _
  13676. * @category Object
  13677. * @param {Object} object The object to query.
  13678. * @returns {Array} Returns the array of property names.
  13679. * @example
  13680. *
  13681. * function Foo() {
  13682. * this.a = 1;
  13683. * this.b = 2;
  13684. * }
  13685. *
  13686. * Foo.prototype.c = 3;
  13687. *
  13688. * _.keys(new Foo);
  13689. * // => ['a', 'b'] (iteration order is not guaranteed)
  13690. *
  13691. * _.keys('hi');
  13692. * // => ['0', '1']
  13693. */
  13694. function keys(object) {
  13695. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13696. }
  13697. /**
  13698. * Creates an array of the own and inherited enumerable property names of `object`.
  13699. *
  13700. * **Note:** Non-object values are coerced to objects.
  13701. *
  13702. * @static
  13703. * @memberOf _
  13704. * @since 3.0.0
  13705. * @category Object
  13706. * @param {Object} object The object to query.
  13707. * @returns {Array} Returns the array of property names.
  13708. * @example
  13709. *
  13710. * function Foo() {
  13711. * this.a = 1;
  13712. * this.b = 2;
  13713. * }
  13714. *
  13715. * Foo.prototype.c = 3;
  13716. *
  13717. * _.keysIn(new Foo);
  13718. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13719. */
  13720. function keysIn(object) {
  13721. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13722. }
  13723. /**
  13724. * The opposite of `_.mapValues`; this method creates an object with the
  13725. * same values as `object` and keys generated by running each own enumerable
  13726. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13727. * with three arguments: (value, key, object).
  13728. *
  13729. * @static
  13730. * @memberOf _
  13731. * @since 3.8.0
  13732. * @category Object
  13733. * @param {Object} object The object to iterate over.
  13734. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13735. * @returns {Object} Returns the new mapped object.
  13736. * @see _.mapValues
  13737. * @example
  13738. *
  13739. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13740. * return key + value;
  13741. * });
  13742. * // => { 'a1': 1, 'b2': 2 }
  13743. */
  13744. function mapKeys(object, iteratee) {
  13745. var result = {};
  13746. iteratee = getIteratee(iteratee, 3);
  13747. baseForOwn(object, function(value, key, object) {
  13748. baseAssignValue(result, iteratee(value, key, object), value);
  13749. });
  13750. return result;
  13751. }
  13752. /**
  13753. * Creates an object with the same keys as `object` and values generated
  13754. * by running each own enumerable string keyed property of `object` thru
  13755. * `iteratee`. The iteratee is invoked with three arguments:
  13756. * (value, key, object).
  13757. *
  13758. * @static
  13759. * @memberOf _
  13760. * @since 2.4.0
  13761. * @category Object
  13762. * @param {Object} object The object to iterate over.
  13763. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13764. * @returns {Object} Returns the new mapped object.
  13765. * @see _.mapKeys
  13766. * @example
  13767. *
  13768. * var users = {
  13769. * 'fred': { 'user': 'fred', 'age': 40 },
  13770. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13771. * };
  13772. *
  13773. * _.mapValues(users, function(o) { return o.age; });
  13774. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13775. *
  13776. * // The `_.property` iteratee shorthand.
  13777. * _.mapValues(users, 'age');
  13778. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13779. */
  13780. function mapValues(object, iteratee) {
  13781. var result = {};
  13782. iteratee = getIteratee(iteratee, 3);
  13783. baseForOwn(object, function(value, key, object) {
  13784. baseAssignValue(result, key, iteratee(value, key, object));
  13785. });
  13786. return result;
  13787. }
  13788. /**
  13789. * This method is like `_.assign` except that it recursively merges own and
  13790. * inherited enumerable string keyed properties of source objects into the
  13791. * destination object. Source properties that resolve to `undefined` are
  13792. * skipped if a destination value exists. Array and plain object properties
  13793. * are merged recursively. Other objects and value types are overridden by
  13794. * assignment. Source objects are applied from left to right. Subsequent
  13795. * sources overwrite property assignments of previous sources.
  13796. *
  13797. * **Note:** This method mutates `object`.
  13798. *
  13799. * @static
  13800. * @memberOf _
  13801. * @since 0.5.0
  13802. * @category Object
  13803. * @param {Object} object The destination object.
  13804. * @param {...Object} [sources] The source objects.
  13805. * @returns {Object} Returns `object`.
  13806. * @example
  13807. *
  13808. * var object = {
  13809. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13810. * };
  13811. *
  13812. * var other = {
  13813. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13814. * };
  13815. *
  13816. * _.merge(object, other);
  13817. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13818. */
  13819. var merge = createAssigner(function(object, source, srcIndex) {
  13820. baseMerge(object, source, srcIndex);
  13821. });
  13822. /**
  13823. * This method is like `_.merge` except that it accepts `customizer` which
  13824. * is invoked to produce the merged values of the destination and source
  13825. * properties. If `customizer` returns `undefined`, merging is handled by the
  13826. * method instead. The `customizer` is invoked with six arguments:
  13827. * (objValue, srcValue, key, object, source, stack).
  13828. *
  13829. * **Note:** This method mutates `object`.
  13830. *
  13831. * @static
  13832. * @memberOf _
  13833. * @since 4.0.0
  13834. * @category Object
  13835. * @param {Object} object The destination object.
  13836. * @param {...Object} sources The source objects.
  13837. * @param {Function} customizer The function to customize assigned values.
  13838. * @returns {Object} Returns `object`.
  13839. * @example
  13840. *
  13841. * function customizer(objValue, srcValue) {
  13842. * if (_.isArray(objValue)) {
  13843. * return objValue.concat(srcValue);
  13844. * }
  13845. * }
  13846. *
  13847. * var object = { 'a': [1], 'b': [2] };
  13848. * var other = { 'a': [3], 'b': [4] };
  13849. *
  13850. * _.mergeWith(object, other, customizer);
  13851. * // => { 'a': [1, 3], 'b': [2, 4] }
  13852. */
  13853. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13854. baseMerge(object, source, srcIndex, customizer);
  13855. });
  13856. /**
  13857. * The opposite of `_.pick`; this method creates an object composed of the
  13858. * own and inherited enumerable property paths of `object` that are not omitted.
  13859. *
  13860. * **Note:** This method is considerably slower than `_.pick`.
  13861. *
  13862. * @static
  13863. * @since 0.1.0
  13864. * @memberOf _
  13865. * @category Object
  13866. * @param {Object} object The source object.
  13867. * @param {...(string|string[])} [paths] The property paths to omit.
  13868. * @returns {Object} Returns the new object.
  13869. * @example
  13870. *
  13871. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13872. *
  13873. * _.omit(object, ['a', 'c']);
  13874. * // => { 'b': '2' }
  13875. */
  13876. var omit = flatRest(function(object, paths) {
  13877. var result = {};
  13878. if (object == null) {
  13879. return result;
  13880. }
  13881. var isDeep = false;
  13882. paths = arrayMap(paths, function(path) {
  13883. path = castPath(path, object);
  13884. isDeep || (isDeep = path.length > 1);
  13885. return path;
  13886. });
  13887. copyObject(object, getAllKeysIn(object), result);
  13888. if (isDeep) {
  13889. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13890. }
  13891. var length = paths.length;
  13892. while (length--) {
  13893. baseUnset(result, paths[length]);
  13894. }
  13895. return result;
  13896. });
  13897. /**
  13898. * The opposite of `_.pickBy`; this method creates an object composed of
  13899. * the own and inherited enumerable string keyed properties of `object` that
  13900. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13901. * arguments: (value, key).
  13902. *
  13903. * @static
  13904. * @memberOf _
  13905. * @since 4.0.0
  13906. * @category Object
  13907. * @param {Object} object The source object.
  13908. * @param {Function} [predicate=_.identity] The function invoked per property.
  13909. * @returns {Object} Returns the new object.
  13910. * @example
  13911. *
  13912. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13913. *
  13914. * _.omitBy(object, _.isNumber);
  13915. * // => { 'b': '2' }
  13916. */
  13917. function omitBy(object, predicate) {
  13918. return pickBy(object, negate(getIteratee(predicate)));
  13919. }
  13920. /**
  13921. * Creates an object composed of the picked `object` properties.
  13922. *
  13923. * @static
  13924. * @since 0.1.0
  13925. * @memberOf _
  13926. * @category Object
  13927. * @param {Object} object The source object.
  13928. * @param {...(string|string[])} [paths] The property paths to pick.
  13929. * @returns {Object} Returns the new object.
  13930. * @example
  13931. *
  13932. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13933. *
  13934. * _.pick(object, ['a', 'c']);
  13935. * // => { 'a': 1, 'c': 3 }
  13936. */
  13937. var pick = flatRest(function(object, paths) {
  13938. return object == null ? {} : basePick(object, paths);
  13939. });
  13940. /**
  13941. * Creates an object composed of the `object` properties `predicate` returns
  13942. * truthy for. The predicate is invoked with two arguments: (value, key).
  13943. *
  13944. * @static
  13945. * @memberOf _
  13946. * @since 4.0.0
  13947. * @category Object
  13948. * @param {Object} object The source object.
  13949. * @param {Function} [predicate=_.identity] The function invoked per property.
  13950. * @returns {Object} Returns the new object.
  13951. * @example
  13952. *
  13953. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13954. *
  13955. * _.pickBy(object, _.isNumber);
  13956. * // => { 'a': 1, 'c': 3 }
  13957. */
  13958. function pickBy(object, predicate) {
  13959. if (object == null) {
  13960. return {};
  13961. }
  13962. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13963. return [prop];
  13964. });
  13965. predicate = getIteratee(predicate);
  13966. return basePickBy(object, props, function(value, path) {
  13967. return predicate(value, path[0]);
  13968. });
  13969. }
  13970. /**
  13971. * This method is like `_.get` except that if the resolved value is a
  13972. * function it's invoked with the `this` binding of its parent object and
  13973. * its result is returned.
  13974. *
  13975. * @static
  13976. * @since 0.1.0
  13977. * @memberOf _
  13978. * @category Object
  13979. * @param {Object} object The object to query.
  13980. * @param {Array|string} path The path of the property to resolve.
  13981. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13982. * @returns {*} Returns the resolved value.
  13983. * @example
  13984. *
  13985. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13986. *
  13987. * _.result(object, 'a[0].b.c1');
  13988. * // => 3
  13989. *
  13990. * _.result(object, 'a[0].b.c2');
  13991. * // => 4
  13992. *
  13993. * _.result(object, 'a[0].b.c3', 'default');
  13994. * // => 'default'
  13995. *
  13996. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13997. * // => 'default'
  13998. */
  13999. function result(object, path, defaultValue) {
  14000. path = castPath(path, object);
  14001. var index = -1,
  14002. length = path.length;
  14003. // Ensure the loop is entered when path is empty.
  14004. if (!length) {
  14005. length = 1;
  14006. object = undefined;
  14007. }
  14008. while (++index < length) {
  14009. var value = object == null ? undefined : object[toKey(path[index])];
  14010. if (value === undefined) {
  14011. index = length;
  14012. value = defaultValue;
  14013. }
  14014. object = isFunction(value) ? value.call(object) : value;
  14015. }
  14016. return object;
  14017. }
  14018. /**
  14019. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14020. * it's created. Arrays are created for missing index properties while objects
  14021. * are created for all other missing properties. Use `_.setWith` to customize
  14022. * `path` creation.
  14023. *
  14024. * **Note:** This method mutates `object`.
  14025. *
  14026. * @static
  14027. * @memberOf _
  14028. * @since 3.7.0
  14029. * @category Object
  14030. * @param {Object} object The object to modify.
  14031. * @param {Array|string} path The path of the property to set.
  14032. * @param {*} value The value to set.
  14033. * @returns {Object} Returns `object`.
  14034. * @example
  14035. *
  14036. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14037. *
  14038. * _.set(object, 'a[0].b.c', 4);
  14039. * console.log(object.a[0].b.c);
  14040. * // => 4
  14041. *
  14042. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14043. * console.log(object.x[0].y.z);
  14044. * // => 5
  14045. */
  14046. function set(object, path, value) {
  14047. return object == null ? object : baseSet(object, path, value);
  14048. }
  14049. /**
  14050. * This method is like `_.set` except that it accepts `customizer` which is
  14051. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14052. * path creation is handled by the method instead. The `customizer` is invoked
  14053. * with three arguments: (nsValue, key, nsObject).
  14054. *
  14055. * **Note:** This method mutates `object`.
  14056. *
  14057. * @static
  14058. * @memberOf _
  14059. * @since 4.0.0
  14060. * @category Object
  14061. * @param {Object} object The object to modify.
  14062. * @param {Array|string} path The path of the property to set.
  14063. * @param {*} value The value to set.
  14064. * @param {Function} [customizer] The function to customize assigned values.
  14065. * @returns {Object} Returns `object`.
  14066. * @example
  14067. *
  14068. * var object = {};
  14069. *
  14070. * _.setWith(object, '[0][1]', 'a', Object);
  14071. * // => { '0': { '1': 'a' } }
  14072. */
  14073. function setWith(object, path, value, customizer) {
  14074. customizer = typeof customizer == 'function' ? customizer : undefined;
  14075. return object == null ? object : baseSet(object, path, value, customizer);
  14076. }
  14077. /**
  14078. * Creates an array of own enumerable string keyed-value pairs for `object`
  14079. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14080. * entries are returned.
  14081. *
  14082. * @static
  14083. * @memberOf _
  14084. * @since 4.0.0
  14085. * @alias entries
  14086. * @category Object
  14087. * @param {Object} object The object to query.
  14088. * @returns {Array} Returns the key-value pairs.
  14089. * @example
  14090. *
  14091. * function Foo() {
  14092. * this.a = 1;
  14093. * this.b = 2;
  14094. * }
  14095. *
  14096. * Foo.prototype.c = 3;
  14097. *
  14098. * _.toPairs(new Foo);
  14099. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14100. */
  14101. var toPairs = createToPairs(keys);
  14102. /**
  14103. * Creates an array of own and inherited enumerable string keyed-value pairs
  14104. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14105. * or set, its entries are returned.
  14106. *
  14107. * @static
  14108. * @memberOf _
  14109. * @since 4.0.0
  14110. * @alias entriesIn
  14111. * @category Object
  14112. * @param {Object} object The object to query.
  14113. * @returns {Array} Returns the key-value pairs.
  14114. * @example
  14115. *
  14116. * function Foo() {
  14117. * this.a = 1;
  14118. * this.b = 2;
  14119. * }
  14120. *
  14121. * Foo.prototype.c = 3;
  14122. *
  14123. * _.toPairsIn(new Foo);
  14124. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14125. */
  14126. var toPairsIn = createToPairs(keysIn);
  14127. /**
  14128. * An alternative to `_.reduce`; this method transforms `object` to a new
  14129. * `accumulator` object which is the result of running each of its own
  14130. * enumerable string keyed properties thru `iteratee`, with each invocation
  14131. * potentially mutating the `accumulator` object. If `accumulator` is not
  14132. * provided, a new object with the same `[[Prototype]]` will be used. The
  14133. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14134. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14135. *
  14136. * @static
  14137. * @memberOf _
  14138. * @since 1.3.0
  14139. * @category Object
  14140. * @param {Object} object The object to iterate over.
  14141. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14142. * @param {*} [accumulator] The custom accumulator value.
  14143. * @returns {*} Returns the accumulated value.
  14144. * @example
  14145. *
  14146. * _.transform([2, 3, 4], function(result, n) {
  14147. * result.push(n *= n);
  14148. * return n % 2 == 0;
  14149. * }, []);
  14150. * // => [4, 9]
  14151. *
  14152. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14153. * (result[value] || (result[value] = [])).push(key);
  14154. * }, {});
  14155. * // => { '1': ['a', 'c'], '2': ['b'] }
  14156. */
  14157. function transform(object, iteratee, accumulator) {
  14158. var isArr = isArray(object),
  14159. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14160. iteratee = getIteratee(iteratee, 4);
  14161. if (accumulator == null) {
  14162. var Ctor = object && object.constructor;
  14163. if (isArrLike) {
  14164. accumulator = isArr ? new Ctor : [];
  14165. }
  14166. else if (isObject(object)) {
  14167. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14168. }
  14169. else {
  14170. accumulator = {};
  14171. }
  14172. }
  14173. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14174. return iteratee(accumulator, value, index, object);
  14175. });
  14176. return accumulator;
  14177. }
  14178. /**
  14179. * Removes the property at `path` of `object`.
  14180. *
  14181. * **Note:** This method mutates `object`.
  14182. *
  14183. * @static
  14184. * @memberOf _
  14185. * @since 4.0.0
  14186. * @category Object
  14187. * @param {Object} object The object to modify.
  14188. * @param {Array|string} path The path of the property to unset.
  14189. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14190. * @example
  14191. *
  14192. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14193. * _.unset(object, 'a[0].b.c');
  14194. * // => true
  14195. *
  14196. * console.log(object);
  14197. * // => { 'a': [{ 'b': {} }] };
  14198. *
  14199. * _.unset(object, ['a', '0', 'b', 'c']);
  14200. * // => true
  14201. *
  14202. * console.log(object);
  14203. * // => { 'a': [{ 'b': {} }] };
  14204. */
  14205. function unset(object, path) {
  14206. return object == null ? true : baseUnset(object, path);
  14207. }
  14208. /**
  14209. * This method is like `_.set` except that accepts `updater` to produce the
  14210. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14211. * is invoked with one argument: (value).
  14212. *
  14213. * **Note:** This method mutates `object`.
  14214. *
  14215. * @static
  14216. * @memberOf _
  14217. * @since 4.6.0
  14218. * @category Object
  14219. * @param {Object} object The object to modify.
  14220. * @param {Array|string} path The path of the property to set.
  14221. * @param {Function} updater The function to produce the updated value.
  14222. * @returns {Object} Returns `object`.
  14223. * @example
  14224. *
  14225. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14226. *
  14227. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14228. * console.log(object.a[0].b.c);
  14229. * // => 9
  14230. *
  14231. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14232. * console.log(object.x[0].y.z);
  14233. * // => 0
  14234. */
  14235. function update(object, path, updater) {
  14236. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14237. }
  14238. /**
  14239. * This method is like `_.update` except that it accepts `customizer` which is
  14240. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14241. * path creation is handled by the method instead. The `customizer` is invoked
  14242. * with three arguments: (nsValue, key, nsObject).
  14243. *
  14244. * **Note:** This method mutates `object`.
  14245. *
  14246. * @static
  14247. * @memberOf _
  14248. * @since 4.6.0
  14249. * @category Object
  14250. * @param {Object} object The object to modify.
  14251. * @param {Array|string} path The path of the property to set.
  14252. * @param {Function} updater The function to produce the updated value.
  14253. * @param {Function} [customizer] The function to customize assigned values.
  14254. * @returns {Object} Returns `object`.
  14255. * @example
  14256. *
  14257. * var object = {};
  14258. *
  14259. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14260. * // => { '0': { '1': 'a' } }
  14261. */
  14262. function updateWith(object, path, updater, customizer) {
  14263. customizer = typeof customizer == 'function' ? customizer : undefined;
  14264. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14265. }
  14266. /**
  14267. * Creates an array of the own enumerable string keyed property values of `object`.
  14268. *
  14269. * **Note:** Non-object values are coerced to objects.
  14270. *
  14271. * @static
  14272. * @since 0.1.0
  14273. * @memberOf _
  14274. * @category Object
  14275. * @param {Object} object The object to query.
  14276. * @returns {Array} Returns the array of property values.
  14277. * @example
  14278. *
  14279. * function Foo() {
  14280. * this.a = 1;
  14281. * this.b = 2;
  14282. * }
  14283. *
  14284. * Foo.prototype.c = 3;
  14285. *
  14286. * _.values(new Foo);
  14287. * // => [1, 2] (iteration order is not guaranteed)
  14288. *
  14289. * _.values('hi');
  14290. * // => ['h', 'i']
  14291. */
  14292. function values(object) {
  14293. return object == null ? [] : baseValues(object, keys(object));
  14294. }
  14295. /**
  14296. * Creates an array of the own and inherited enumerable string keyed property
  14297. * values of `object`.
  14298. *
  14299. * **Note:** Non-object values are coerced to objects.
  14300. *
  14301. * @static
  14302. * @memberOf _
  14303. * @since 3.0.0
  14304. * @category Object
  14305. * @param {Object} object The object to query.
  14306. * @returns {Array} Returns the array of property values.
  14307. * @example
  14308. *
  14309. * function Foo() {
  14310. * this.a = 1;
  14311. * this.b = 2;
  14312. * }
  14313. *
  14314. * Foo.prototype.c = 3;
  14315. *
  14316. * _.valuesIn(new Foo);
  14317. * // => [1, 2, 3] (iteration order is not guaranteed)
  14318. */
  14319. function valuesIn(object) {
  14320. return object == null ? [] : baseValues(object, keysIn(object));
  14321. }
  14322. /*------------------------------------------------------------------------*/
  14323. /**
  14324. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14325. *
  14326. * @static
  14327. * @memberOf _
  14328. * @since 4.0.0
  14329. * @category Number
  14330. * @param {number} number The number to clamp.
  14331. * @param {number} [lower] The lower bound.
  14332. * @param {number} upper The upper bound.
  14333. * @returns {number} Returns the clamped number.
  14334. * @example
  14335. *
  14336. * _.clamp(-10, -5, 5);
  14337. * // => -5
  14338. *
  14339. * _.clamp(10, -5, 5);
  14340. * // => 5
  14341. */
  14342. function clamp(number, lower, upper) {
  14343. if (upper === undefined) {
  14344. upper = lower;
  14345. lower = undefined;
  14346. }
  14347. if (upper !== undefined) {
  14348. upper = toNumber(upper);
  14349. upper = upper === upper ? upper : 0;
  14350. }
  14351. if (lower !== undefined) {
  14352. lower = toNumber(lower);
  14353. lower = lower === lower ? lower : 0;
  14354. }
  14355. return baseClamp(toNumber(number), lower, upper);
  14356. }
  14357. /**
  14358. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14359. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14360. * If `start` is greater than `end` the params are swapped to support
  14361. * negative ranges.
  14362. *
  14363. * @static
  14364. * @memberOf _
  14365. * @since 3.3.0
  14366. * @category Number
  14367. * @param {number} number The number to check.
  14368. * @param {number} [start=0] The start of the range.
  14369. * @param {number} end The end of the range.
  14370. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14371. * @see _.range, _.rangeRight
  14372. * @example
  14373. *
  14374. * _.inRange(3, 2, 4);
  14375. * // => true
  14376. *
  14377. * _.inRange(4, 8);
  14378. * // => true
  14379. *
  14380. * _.inRange(4, 2);
  14381. * // => false
  14382. *
  14383. * _.inRange(2, 2);
  14384. * // => false
  14385. *
  14386. * _.inRange(1.2, 2);
  14387. * // => true
  14388. *
  14389. * _.inRange(5.2, 4);
  14390. * // => false
  14391. *
  14392. * _.inRange(-3, -2, -6);
  14393. * // => true
  14394. */
  14395. function inRange(number, start, end) {
  14396. start = toFinite(start);
  14397. if (end === undefined) {
  14398. end = start;
  14399. start = 0;
  14400. } else {
  14401. end = toFinite(end);
  14402. }
  14403. number = toNumber(number);
  14404. return baseInRange(number, start, end);
  14405. }
  14406. /**
  14407. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14408. * If only one argument is provided a number between `0` and the given number
  14409. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14410. * floats, a floating-point number is returned instead of an integer.
  14411. *
  14412. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14413. * floating-point values which can produce unexpected results.
  14414. *
  14415. * @static
  14416. * @memberOf _
  14417. * @since 0.7.0
  14418. * @category Number
  14419. * @param {number} [lower=0] The lower bound.
  14420. * @param {number} [upper=1] The upper bound.
  14421. * @param {boolean} [floating] Specify returning a floating-point number.
  14422. * @returns {number} Returns the random number.
  14423. * @example
  14424. *
  14425. * _.random(0, 5);
  14426. * // => an integer between 0 and 5
  14427. *
  14428. * _.random(5);
  14429. * // => also an integer between 0 and 5
  14430. *
  14431. * _.random(5, true);
  14432. * // => a floating-point number between 0 and 5
  14433. *
  14434. * _.random(1.2, 5.2);
  14435. * // => a floating-point number between 1.2 and 5.2
  14436. */
  14437. function random(lower, upper, floating) {
  14438. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14439. upper = floating = undefined;
  14440. }
  14441. if (floating === undefined) {
  14442. if (typeof upper == 'boolean') {
  14443. floating = upper;
  14444. upper = undefined;
  14445. }
  14446. else if (typeof lower == 'boolean') {
  14447. floating = lower;
  14448. lower = undefined;
  14449. }
  14450. }
  14451. if (lower === undefined && upper === undefined) {
  14452. lower = 0;
  14453. upper = 1;
  14454. }
  14455. else {
  14456. lower = toFinite(lower);
  14457. if (upper === undefined) {
  14458. upper = lower;
  14459. lower = 0;
  14460. } else {
  14461. upper = toFinite(upper);
  14462. }
  14463. }
  14464. if (lower > upper) {
  14465. var temp = lower;
  14466. lower = upper;
  14467. upper = temp;
  14468. }
  14469. if (floating || lower % 1 || upper % 1) {
  14470. var rand = nativeRandom();
  14471. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14472. }
  14473. return baseRandom(lower, upper);
  14474. }
  14475. /*------------------------------------------------------------------------*/
  14476. /**
  14477. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14478. *
  14479. * @static
  14480. * @memberOf _
  14481. * @since 3.0.0
  14482. * @category String
  14483. * @param {string} [string=''] The string to convert.
  14484. * @returns {string} Returns the camel cased string.
  14485. * @example
  14486. *
  14487. * _.camelCase('Foo Bar');
  14488. * // => 'fooBar'
  14489. *
  14490. * _.camelCase('--foo-bar--');
  14491. * // => 'fooBar'
  14492. *
  14493. * _.camelCase('__FOO_BAR__');
  14494. * // => 'fooBar'
  14495. */
  14496. var camelCase = createCompounder(function(result, word, index) {
  14497. word = word.toLowerCase();
  14498. return result + (index ? capitalize(word) : word);
  14499. });
  14500. /**
  14501. * Converts the first character of `string` to upper case and the remaining
  14502. * to lower case.
  14503. *
  14504. * @static
  14505. * @memberOf _
  14506. * @since 3.0.0
  14507. * @category String
  14508. * @param {string} [string=''] The string to capitalize.
  14509. * @returns {string} Returns the capitalized string.
  14510. * @example
  14511. *
  14512. * _.capitalize('FRED');
  14513. * // => 'Fred'
  14514. */
  14515. function capitalize(string) {
  14516. return upperFirst(toString(string).toLowerCase());
  14517. }
  14518. /**
  14519. * Deburrs `string` by converting
  14520. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14521. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14522. * letters to basic Latin letters and removing
  14523. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14524. *
  14525. * @static
  14526. * @memberOf _
  14527. * @since 3.0.0
  14528. * @category String
  14529. * @param {string} [string=''] The string to deburr.
  14530. * @returns {string} Returns the deburred string.
  14531. * @example
  14532. *
  14533. * _.deburr('déjà vu');
  14534. * // => 'deja vu'
  14535. */
  14536. function deburr(string) {
  14537. string = toString(string);
  14538. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14539. }
  14540. /**
  14541. * Checks if `string` ends with the given target string.
  14542. *
  14543. * @static
  14544. * @memberOf _
  14545. * @since 3.0.0
  14546. * @category String
  14547. * @param {string} [string=''] The string to inspect.
  14548. * @param {string} [target] The string to search for.
  14549. * @param {number} [position=string.length] The position to search up to.
  14550. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14551. * else `false`.
  14552. * @example
  14553. *
  14554. * _.endsWith('abc', 'c');
  14555. * // => true
  14556. *
  14557. * _.endsWith('abc', 'b');
  14558. * // => false
  14559. *
  14560. * _.endsWith('abc', 'b', 2);
  14561. * // => true
  14562. */
  14563. function endsWith(string, target, position) {
  14564. string = toString(string);
  14565. target = baseToString(target);
  14566. var length = string.length;
  14567. position = position === undefined
  14568. ? length
  14569. : baseClamp(toInteger(position), 0, length);
  14570. var end = position;
  14571. position -= target.length;
  14572. return position >= 0 && string.slice(position, end) == target;
  14573. }
  14574. /**
  14575. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14576. * corresponding HTML entities.
  14577. *
  14578. * **Note:** No other characters are escaped. To escape additional
  14579. * characters use a third-party library like [_he_](https://mths.be/he).
  14580. *
  14581. * Though the ">" character is escaped for symmetry, characters like
  14582. * ">" and "/" don't need escaping in HTML and have no special meaning
  14583. * unless they're part of a tag or unquoted attribute value. See
  14584. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14585. * (under "semi-related fun fact") for more details.
  14586. *
  14587. * When working with HTML you should always
  14588. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14589. * XSS vectors.
  14590. *
  14591. * @static
  14592. * @since 0.1.0
  14593. * @memberOf _
  14594. * @category String
  14595. * @param {string} [string=''] The string to escape.
  14596. * @returns {string} Returns the escaped string.
  14597. * @example
  14598. *
  14599. * _.escape('fred, barney, & pebbles');
  14600. * // => 'fred, barney, &amp; pebbles'
  14601. */
  14602. function escape(string) {
  14603. string = toString(string);
  14604. return (string && reHasUnescapedHtml.test(string))
  14605. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14606. : string;
  14607. }
  14608. /**
  14609. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14610. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14611. *
  14612. * @static
  14613. * @memberOf _
  14614. * @since 3.0.0
  14615. * @category String
  14616. * @param {string} [string=''] The string to escape.
  14617. * @returns {string} Returns the escaped string.
  14618. * @example
  14619. *
  14620. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14621. * // => '\[lodash\]\(https://lodash\.com/\)'
  14622. */
  14623. function escapeRegExp(string) {
  14624. string = toString(string);
  14625. return (string && reHasRegExpChar.test(string))
  14626. ? string.replace(reRegExpChar, '\\$&')
  14627. : string;
  14628. }
  14629. /**
  14630. * Converts `string` to
  14631. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14632. *
  14633. * @static
  14634. * @memberOf _
  14635. * @since 3.0.0
  14636. * @category String
  14637. * @param {string} [string=''] The string to convert.
  14638. * @returns {string} Returns the kebab cased string.
  14639. * @example
  14640. *
  14641. * _.kebabCase('Foo Bar');
  14642. * // => 'foo-bar'
  14643. *
  14644. * _.kebabCase('fooBar');
  14645. * // => 'foo-bar'
  14646. *
  14647. * _.kebabCase('__FOO_BAR__');
  14648. * // => 'foo-bar'
  14649. */
  14650. var kebabCase = createCompounder(function(result, word, index) {
  14651. return result + (index ? '-' : '') + word.toLowerCase();
  14652. });
  14653. /**
  14654. * Converts `string`, as space separated words, to lower case.
  14655. *
  14656. * @static
  14657. * @memberOf _
  14658. * @since 4.0.0
  14659. * @category String
  14660. * @param {string} [string=''] The string to convert.
  14661. * @returns {string} Returns the lower cased string.
  14662. * @example
  14663. *
  14664. * _.lowerCase('--Foo-Bar--');
  14665. * // => 'foo bar'
  14666. *
  14667. * _.lowerCase('fooBar');
  14668. * // => 'foo bar'
  14669. *
  14670. * _.lowerCase('__FOO_BAR__');
  14671. * // => 'foo bar'
  14672. */
  14673. var lowerCase = createCompounder(function(result, word, index) {
  14674. return result + (index ? ' ' : '') + word.toLowerCase();
  14675. });
  14676. /**
  14677. * Converts the first character of `string` to lower case.
  14678. *
  14679. * @static
  14680. * @memberOf _
  14681. * @since 4.0.0
  14682. * @category String
  14683. * @param {string} [string=''] The string to convert.
  14684. * @returns {string} Returns the converted string.
  14685. * @example
  14686. *
  14687. * _.lowerFirst('Fred');
  14688. * // => 'fred'
  14689. *
  14690. * _.lowerFirst('FRED');
  14691. * // => 'fRED'
  14692. */
  14693. var lowerFirst = createCaseFirst('toLowerCase');
  14694. /**
  14695. * Pads `string` on the left and right sides if it's shorter than `length`.
  14696. * Padding characters are truncated if they can't be evenly divided by `length`.
  14697. *
  14698. * @static
  14699. * @memberOf _
  14700. * @since 3.0.0
  14701. * @category String
  14702. * @param {string} [string=''] The string to pad.
  14703. * @param {number} [length=0] The padding length.
  14704. * @param {string} [chars=' '] The string used as padding.
  14705. * @returns {string} Returns the padded string.
  14706. * @example
  14707. *
  14708. * _.pad('abc', 8);
  14709. * // => ' abc '
  14710. *
  14711. * _.pad('abc', 8, '_-');
  14712. * // => '_-abc_-_'
  14713. *
  14714. * _.pad('abc', 3);
  14715. * // => 'abc'
  14716. */
  14717. function pad(string, length, chars) {
  14718. string = toString(string);
  14719. length = toInteger(length);
  14720. var strLength = length ? stringSize(string) : 0;
  14721. if (!length || strLength >= length) {
  14722. return string;
  14723. }
  14724. var mid = (length - strLength) / 2;
  14725. return (
  14726. createPadding(nativeFloor(mid), chars) +
  14727. string +
  14728. createPadding(nativeCeil(mid), chars)
  14729. );
  14730. }
  14731. /**
  14732. * Pads `string` on the right side if it's shorter than `length`. Padding
  14733. * characters are truncated if they exceed `length`.
  14734. *
  14735. * @static
  14736. * @memberOf _
  14737. * @since 4.0.0
  14738. * @category String
  14739. * @param {string} [string=''] The string to pad.
  14740. * @param {number} [length=0] The padding length.
  14741. * @param {string} [chars=' '] The string used as padding.
  14742. * @returns {string} Returns the padded string.
  14743. * @example
  14744. *
  14745. * _.padEnd('abc', 6);
  14746. * // => 'abc '
  14747. *
  14748. * _.padEnd('abc', 6, '_-');
  14749. * // => 'abc_-_'
  14750. *
  14751. * _.padEnd('abc', 3);
  14752. * // => 'abc'
  14753. */
  14754. function padEnd(string, length, chars) {
  14755. string = toString(string);
  14756. length = toInteger(length);
  14757. var strLength = length ? stringSize(string) : 0;
  14758. return (length && strLength < length)
  14759. ? (string + createPadding(length - strLength, chars))
  14760. : string;
  14761. }
  14762. /**
  14763. * Pads `string` on the left side if it's shorter than `length`. Padding
  14764. * characters are truncated if they exceed `length`.
  14765. *
  14766. * @static
  14767. * @memberOf _
  14768. * @since 4.0.0
  14769. * @category String
  14770. * @param {string} [string=''] The string to pad.
  14771. * @param {number} [length=0] The padding length.
  14772. * @param {string} [chars=' '] The string used as padding.
  14773. * @returns {string} Returns the padded string.
  14774. * @example
  14775. *
  14776. * _.padStart('abc', 6);
  14777. * // => ' abc'
  14778. *
  14779. * _.padStart('abc', 6, '_-');
  14780. * // => '_-_abc'
  14781. *
  14782. * _.padStart('abc', 3);
  14783. * // => 'abc'
  14784. */
  14785. function padStart(string, length, chars) {
  14786. string = toString(string);
  14787. length = toInteger(length);
  14788. var strLength = length ? stringSize(string) : 0;
  14789. return (length && strLength < length)
  14790. ? (createPadding(length - strLength, chars) + string)
  14791. : string;
  14792. }
  14793. /**
  14794. * Converts `string` to an integer of the specified radix. If `radix` is
  14795. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14796. * hexadecimal, in which case a `radix` of `16` is used.
  14797. *
  14798. * **Note:** This method aligns with the
  14799. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14800. *
  14801. * @static
  14802. * @memberOf _
  14803. * @since 1.1.0
  14804. * @category String
  14805. * @param {string} string The string to convert.
  14806. * @param {number} [radix=10] The radix to interpret `value` by.
  14807. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14808. * @returns {number} Returns the converted integer.
  14809. * @example
  14810. *
  14811. * _.parseInt('08');
  14812. * // => 8
  14813. *
  14814. * _.map(['6', '08', '10'], _.parseInt);
  14815. * // => [6, 8, 10]
  14816. */
  14817. function parseInt(string, radix, guard) {
  14818. if (guard || radix == null) {
  14819. radix = 0;
  14820. } else if (radix) {
  14821. radix = +radix;
  14822. }
  14823. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14824. }
  14825. /**
  14826. * Repeats the given string `n` times.
  14827. *
  14828. * @static
  14829. * @memberOf _
  14830. * @since 3.0.0
  14831. * @category String
  14832. * @param {string} [string=''] The string to repeat.
  14833. * @param {number} [n=1] The number of times to repeat the string.
  14834. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14835. * @returns {string} Returns the repeated string.
  14836. * @example
  14837. *
  14838. * _.repeat('*', 3);
  14839. * // => '***'
  14840. *
  14841. * _.repeat('abc', 2);
  14842. * // => 'abcabc'
  14843. *
  14844. * _.repeat('abc', 0);
  14845. * // => ''
  14846. */
  14847. function repeat(string, n, guard) {
  14848. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14849. n = 1;
  14850. } else {
  14851. n = toInteger(n);
  14852. }
  14853. return baseRepeat(toString(string), n);
  14854. }
  14855. /**
  14856. * Replaces matches for `pattern` in `string` with `replacement`.
  14857. *
  14858. * **Note:** This method is based on
  14859. * [`String#replace`](https://mdn.io/String/replace).
  14860. *
  14861. * @static
  14862. * @memberOf _
  14863. * @since 4.0.0
  14864. * @category String
  14865. * @param {string} [string=''] The string to modify.
  14866. * @param {RegExp|string} pattern The pattern to replace.
  14867. * @param {Function|string} replacement The match replacement.
  14868. * @returns {string} Returns the modified string.
  14869. * @example
  14870. *
  14871. * _.replace('Hi Fred', 'Fred', 'Barney');
  14872. * // => 'Hi Barney'
  14873. */
  14874. function replace() {
  14875. var args = arguments,
  14876. string = toString(args[0]);
  14877. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14878. }
  14879. /**
  14880. * Converts `string` to
  14881. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14882. *
  14883. * @static
  14884. * @memberOf _
  14885. * @since 3.0.0
  14886. * @category String
  14887. * @param {string} [string=''] The string to convert.
  14888. * @returns {string} Returns the snake cased string.
  14889. * @example
  14890. *
  14891. * _.snakeCase('Foo Bar');
  14892. * // => 'foo_bar'
  14893. *
  14894. * _.snakeCase('fooBar');
  14895. * // => 'foo_bar'
  14896. *
  14897. * _.snakeCase('--FOO-BAR--');
  14898. * // => 'foo_bar'
  14899. */
  14900. var snakeCase = createCompounder(function(result, word, index) {
  14901. return result + (index ? '_' : '') + word.toLowerCase();
  14902. });
  14903. /**
  14904. * Splits `string` by `separator`.
  14905. *
  14906. * **Note:** This method is based on
  14907. * [`String#split`](https://mdn.io/String/split).
  14908. *
  14909. * @static
  14910. * @memberOf _
  14911. * @since 4.0.0
  14912. * @category String
  14913. * @param {string} [string=''] The string to split.
  14914. * @param {RegExp|string} separator The separator pattern to split by.
  14915. * @param {number} [limit] The length to truncate results to.
  14916. * @returns {Array} Returns the string segments.
  14917. * @example
  14918. *
  14919. * _.split('a-b-c', '-', 2);
  14920. * // => ['a', 'b']
  14921. */
  14922. function split(string, separator, limit) {
  14923. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14924. separator = limit = undefined;
  14925. }
  14926. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14927. if (!limit) {
  14928. return [];
  14929. }
  14930. string = toString(string);
  14931. if (string && (
  14932. typeof separator == 'string' ||
  14933. (separator != null && !isRegExp(separator))
  14934. )) {
  14935. separator = baseToString(separator);
  14936. if (!separator && hasUnicode(string)) {
  14937. return castSlice(stringToArray(string), 0, limit);
  14938. }
  14939. }
  14940. return string.split(separator, limit);
  14941. }
  14942. /**
  14943. * Converts `string` to
  14944. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14945. *
  14946. * @static
  14947. * @memberOf _
  14948. * @since 3.1.0
  14949. * @category String
  14950. * @param {string} [string=''] The string to convert.
  14951. * @returns {string} Returns the start cased string.
  14952. * @example
  14953. *
  14954. * _.startCase('--foo-bar--');
  14955. * // => 'Foo Bar'
  14956. *
  14957. * _.startCase('fooBar');
  14958. * // => 'Foo Bar'
  14959. *
  14960. * _.startCase('__FOO_BAR__');
  14961. * // => 'FOO BAR'
  14962. */
  14963. var startCase = createCompounder(function(result, word, index) {
  14964. return result + (index ? ' ' : '') + upperFirst(word);
  14965. });
  14966. /**
  14967. * Checks if `string` starts with the given target string.
  14968. *
  14969. * @static
  14970. * @memberOf _
  14971. * @since 3.0.0
  14972. * @category String
  14973. * @param {string} [string=''] The string to inspect.
  14974. * @param {string} [target] The string to search for.
  14975. * @param {number} [position=0] The position to search from.
  14976. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14977. * else `false`.
  14978. * @example
  14979. *
  14980. * _.startsWith('abc', 'a');
  14981. * // => true
  14982. *
  14983. * _.startsWith('abc', 'b');
  14984. * // => false
  14985. *
  14986. * _.startsWith('abc', 'b', 1);
  14987. * // => true
  14988. */
  14989. function startsWith(string, target, position) {
  14990. string = toString(string);
  14991. position = position == null
  14992. ? 0
  14993. : baseClamp(toInteger(position), 0, string.length);
  14994. target = baseToString(target);
  14995. return string.slice(position, position + target.length) == target;
  14996. }
  14997. /**
  14998. * Creates a compiled template function that can interpolate data properties
  14999. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15000. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15001. * properties may be accessed as free variables in the template. If a setting
  15002. * object is given, it takes precedence over `_.templateSettings` values.
  15003. *
  15004. * **Note:** In the development build `_.template` utilizes
  15005. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15006. * for easier debugging.
  15007. *
  15008. * For more information on precompiling templates see
  15009. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15010. *
  15011. * For more information on Chrome extension sandboxes see
  15012. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15013. *
  15014. * @static
  15015. * @since 0.1.0
  15016. * @memberOf _
  15017. * @category String
  15018. * @param {string} [string=''] The template string.
  15019. * @param {Object} [options={}] The options object.
  15020. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15021. * The HTML "escape" delimiter.
  15022. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15023. * The "evaluate" delimiter.
  15024. * @param {Object} [options.imports=_.templateSettings.imports]
  15025. * An object to import into the template as free variables.
  15026. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15027. * The "interpolate" delimiter.
  15028. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15029. * The sourceURL of the compiled template.
  15030. * @param {string} [options.variable='obj']
  15031. * The data object variable name.
  15032. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15033. * @returns {Function} Returns the compiled template function.
  15034. * @example
  15035. *
  15036. * // Use the "interpolate" delimiter to create a compiled template.
  15037. * var compiled = _.template('hello <%= user %>!');
  15038. * compiled({ 'user': 'fred' });
  15039. * // => 'hello fred!'
  15040. *
  15041. * // Use the HTML "escape" delimiter to escape data property values.
  15042. * var compiled = _.template('<b><%- value %></b>');
  15043. * compiled({ 'value': '<script>' });
  15044. * // => '<b>&lt;script&gt;</b>'
  15045. *
  15046. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15047. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15048. * compiled({ 'users': ['fred', 'barney'] });
  15049. * // => '<li>fred</li><li>barney</li>'
  15050. *
  15051. * // Use the internal `print` function in "evaluate" delimiters.
  15052. * var compiled = _.template('<% print("hello " + user); %>!');
  15053. * compiled({ 'user': 'barney' });
  15054. * // => 'hello barney!'
  15055. *
  15056. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15057. * // Disable support by replacing the "interpolate" delimiter.
  15058. * var compiled = _.template('hello ${ user }!');
  15059. * compiled({ 'user': 'pebbles' });
  15060. * // => 'hello pebbles!'
  15061. *
  15062. * // Use backslashes to treat delimiters as plain text.
  15063. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15064. * compiled({ 'value': 'ignored' });
  15065. * // => '<%- value %>'
  15066. *
  15067. * // Use the `imports` option to import `jQuery` as `jq`.
  15068. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15069. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15070. * compiled({ 'users': ['fred', 'barney'] });
  15071. * // => '<li>fred</li><li>barney</li>'
  15072. *
  15073. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15074. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15075. * compiled(data);
  15076. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15077. *
  15078. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15079. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15080. * compiled.source;
  15081. * // => function(data) {
  15082. * // var __t, __p = '';
  15083. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15084. * // return __p;
  15085. * // }
  15086. *
  15087. * // Use custom template delimiters.
  15088. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15089. * var compiled = _.template('hello {{ user }}!');
  15090. * compiled({ 'user': 'mustache' });
  15091. * // => 'hello mustache!'
  15092. *
  15093. * // Use the `source` property to inline compiled templates for meaningful
  15094. * // line numbers in error messages and stack traces.
  15095. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15096. * var JST = {\
  15097. * "main": ' + _.template(mainText).source + '\
  15098. * };\
  15099. * ');
  15100. */
  15101. function template(string, options, guard) {
  15102. // Based on John Resig's `tmpl` implementation
  15103. // (http://ejohn.org/blog/javascript-micro-templating/)
  15104. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15105. var settings = lodash.templateSettings;
  15106. if (guard && isIterateeCall(string, options, guard)) {
  15107. options = undefined;
  15108. }
  15109. string = toString(string);
  15110. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15111. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15112. importsKeys = keys(imports),
  15113. importsValues = baseValues(imports, importsKeys);
  15114. var isEscaping,
  15115. isEvaluating,
  15116. index = 0,
  15117. interpolate = options.interpolate || reNoMatch,
  15118. source = "__p += '";
  15119. // Compile the regexp to match each delimiter.
  15120. var reDelimiters = RegExp(
  15121. (options.escape || reNoMatch).source + '|' +
  15122. interpolate.source + '|' +
  15123. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15124. (options.evaluate || reNoMatch).source + '|$'
  15125. , 'g');
  15126. // Use a sourceURL for easier debugging.
  15127. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15128. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15129. // and escape the comment, thus injecting code that gets evaled.
  15130. var sourceURL = '//# sourceURL=' +
  15131. (hasOwnProperty.call(options, 'sourceURL')
  15132. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15133. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15134. ) + '\n';
  15135. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15136. interpolateValue || (interpolateValue = esTemplateValue);
  15137. // Escape characters that can't be included in string literals.
  15138. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15139. // Replace delimiters with snippets.
  15140. if (escapeValue) {
  15141. isEscaping = true;
  15142. source += "' +\n__e(" + escapeValue + ") +\n'";
  15143. }
  15144. if (evaluateValue) {
  15145. isEvaluating = true;
  15146. source += "';\n" + evaluateValue + ";\n__p += '";
  15147. }
  15148. if (interpolateValue) {
  15149. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15150. }
  15151. index = offset + match.length;
  15152. // The JS engine embedded in Adobe products needs `match` returned in
  15153. // order to produce the correct `offset` value.
  15154. return match;
  15155. });
  15156. source += "';\n";
  15157. // If `variable` is not specified wrap a with-statement around the generated
  15158. // code to add the data object to the top of the scope chain.
  15159. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15160. if (!variable) {
  15161. source = 'with (obj) {\n' + source + '\n}\n';
  15162. }
  15163. // Throw an error if a forbidden character was found in `variable`, to prevent
  15164. // potential command injection attacks.
  15165. else if (reForbiddenIdentifierChars.test(variable)) {
  15166. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15167. }
  15168. // Cleanup code by stripping empty strings.
  15169. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15170. .replace(reEmptyStringMiddle, '$1')
  15171. .replace(reEmptyStringTrailing, '$1;');
  15172. // Frame code as the function body.
  15173. source = 'function(' + (variable || 'obj') + ') {\n' +
  15174. (variable
  15175. ? ''
  15176. : 'obj || (obj = {});\n'
  15177. ) +
  15178. "var __t, __p = ''" +
  15179. (isEscaping
  15180. ? ', __e = _.escape'
  15181. : ''
  15182. ) +
  15183. (isEvaluating
  15184. ? ', __j = Array.prototype.join;\n' +
  15185. "function print() { __p += __j.call(arguments, '') }\n"
  15186. : ';\n'
  15187. ) +
  15188. source +
  15189. 'return __p\n}';
  15190. var result = attempt(function() {
  15191. return Function(importsKeys, sourceURL + 'return ' + source)
  15192. .apply(undefined, importsValues);
  15193. });
  15194. // Provide the compiled function's source by its `toString` method or
  15195. // the `source` property as a convenience for inlining compiled templates.
  15196. result.source = source;
  15197. if (isError(result)) {
  15198. throw result;
  15199. }
  15200. return result;
  15201. }
  15202. /**
  15203. * Converts `string`, as a whole, to lower case just like
  15204. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15205. *
  15206. * @static
  15207. * @memberOf _
  15208. * @since 4.0.0
  15209. * @category String
  15210. * @param {string} [string=''] The string to convert.
  15211. * @returns {string} Returns the lower cased string.
  15212. * @example
  15213. *
  15214. * _.toLower('--Foo-Bar--');
  15215. * // => '--foo-bar--'
  15216. *
  15217. * _.toLower('fooBar');
  15218. * // => 'foobar'
  15219. *
  15220. * _.toLower('__FOO_BAR__');
  15221. * // => '__foo_bar__'
  15222. */
  15223. function toLower(value) {
  15224. return toString(value).toLowerCase();
  15225. }
  15226. /**
  15227. * Converts `string`, as a whole, to upper case just like
  15228. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15229. *
  15230. * @static
  15231. * @memberOf _
  15232. * @since 4.0.0
  15233. * @category String
  15234. * @param {string} [string=''] The string to convert.
  15235. * @returns {string} Returns the upper cased string.
  15236. * @example
  15237. *
  15238. * _.toUpper('--foo-bar--');
  15239. * // => '--FOO-BAR--'
  15240. *
  15241. * _.toUpper('fooBar');
  15242. * // => 'FOOBAR'
  15243. *
  15244. * _.toUpper('__foo_bar__');
  15245. * // => '__FOO_BAR__'
  15246. */
  15247. function toUpper(value) {
  15248. return toString(value).toUpperCase();
  15249. }
  15250. /**
  15251. * Removes leading and trailing whitespace or specified characters from `string`.
  15252. *
  15253. * @static
  15254. * @memberOf _
  15255. * @since 3.0.0
  15256. * @category String
  15257. * @param {string} [string=''] The string to trim.
  15258. * @param {string} [chars=whitespace] The characters to trim.
  15259. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15260. * @returns {string} Returns the trimmed string.
  15261. * @example
  15262. *
  15263. * _.trim(' abc ');
  15264. * // => 'abc'
  15265. *
  15266. * _.trim('-_-abc-_-', '_-');
  15267. * // => 'abc'
  15268. *
  15269. * _.map([' foo ', ' bar '], _.trim);
  15270. * // => ['foo', 'bar']
  15271. */
  15272. function trim(string, chars, guard) {
  15273. string = toString(string);
  15274. if (string && (guard || chars === undefined)) {
  15275. return baseTrim(string);
  15276. }
  15277. if (!string || !(chars = baseToString(chars))) {
  15278. return string;
  15279. }
  15280. var strSymbols = stringToArray(string),
  15281. chrSymbols = stringToArray(chars),
  15282. start = charsStartIndex(strSymbols, chrSymbols),
  15283. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15284. return castSlice(strSymbols, start, end).join('');
  15285. }
  15286. /**
  15287. * Removes trailing whitespace or specified characters from `string`.
  15288. *
  15289. * @static
  15290. * @memberOf _
  15291. * @since 4.0.0
  15292. * @category String
  15293. * @param {string} [string=''] The string to trim.
  15294. * @param {string} [chars=whitespace] The characters to trim.
  15295. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15296. * @returns {string} Returns the trimmed string.
  15297. * @example
  15298. *
  15299. * _.trimEnd(' abc ');
  15300. * // => ' abc'
  15301. *
  15302. * _.trimEnd('-_-abc-_-', '_-');
  15303. * // => '-_-abc'
  15304. */
  15305. function trimEnd(string, chars, guard) {
  15306. string = toString(string);
  15307. if (string && (guard || chars === undefined)) {
  15308. return string.slice(0, trimmedEndIndex(string) + 1);
  15309. }
  15310. if (!string || !(chars = baseToString(chars))) {
  15311. return string;
  15312. }
  15313. var strSymbols = stringToArray(string),
  15314. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15315. return castSlice(strSymbols, 0, end).join('');
  15316. }
  15317. /**
  15318. * Removes leading whitespace or specified characters from `string`.
  15319. *
  15320. * @static
  15321. * @memberOf _
  15322. * @since 4.0.0
  15323. * @category String
  15324. * @param {string} [string=''] The string to trim.
  15325. * @param {string} [chars=whitespace] The characters to trim.
  15326. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15327. * @returns {string} Returns the trimmed string.
  15328. * @example
  15329. *
  15330. * _.trimStart(' abc ');
  15331. * // => 'abc '
  15332. *
  15333. * _.trimStart('-_-abc-_-', '_-');
  15334. * // => 'abc-_-'
  15335. */
  15336. function trimStart(string, chars, guard) {
  15337. string = toString(string);
  15338. if (string && (guard || chars === undefined)) {
  15339. return string.replace(reTrimStart, '');
  15340. }
  15341. if (!string || !(chars = baseToString(chars))) {
  15342. return string;
  15343. }
  15344. var strSymbols = stringToArray(string),
  15345. start = charsStartIndex(strSymbols, stringToArray(chars));
  15346. return castSlice(strSymbols, start).join('');
  15347. }
  15348. /**
  15349. * Truncates `string` if it's longer than the given maximum string length.
  15350. * The last characters of the truncated string are replaced with the omission
  15351. * string which defaults to "...".
  15352. *
  15353. * @static
  15354. * @memberOf _
  15355. * @since 4.0.0
  15356. * @category String
  15357. * @param {string} [string=''] The string to truncate.
  15358. * @param {Object} [options={}] The options object.
  15359. * @param {number} [options.length=30] The maximum string length.
  15360. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15361. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15362. * @returns {string} Returns the truncated string.
  15363. * @example
  15364. *
  15365. * _.truncate('hi-diddly-ho there, neighborino');
  15366. * // => 'hi-diddly-ho there, neighbo...'
  15367. *
  15368. * _.truncate('hi-diddly-ho there, neighborino', {
  15369. * 'length': 24,
  15370. * 'separator': ' '
  15371. * });
  15372. * // => 'hi-diddly-ho there,...'
  15373. *
  15374. * _.truncate('hi-diddly-ho there, neighborino', {
  15375. * 'length': 24,
  15376. * 'separator': /,? +/
  15377. * });
  15378. * // => 'hi-diddly-ho there...'
  15379. *
  15380. * _.truncate('hi-diddly-ho there, neighborino', {
  15381. * 'omission': ' [...]'
  15382. * });
  15383. * // => 'hi-diddly-ho there, neig [...]'
  15384. */
  15385. function truncate(string, options) {
  15386. var length = DEFAULT_TRUNC_LENGTH,
  15387. omission = DEFAULT_TRUNC_OMISSION;
  15388. if (isObject(options)) {
  15389. var separator = 'separator' in options ? options.separator : separator;
  15390. length = 'length' in options ? toInteger(options.length) : length;
  15391. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15392. }
  15393. string = toString(string);
  15394. var strLength = string.length;
  15395. if (hasUnicode(string)) {
  15396. var strSymbols = stringToArray(string);
  15397. strLength = strSymbols.length;
  15398. }
  15399. if (length >= strLength) {
  15400. return string;
  15401. }
  15402. var end = length - stringSize(omission);
  15403. if (end < 1) {
  15404. return omission;
  15405. }
  15406. var result = strSymbols
  15407. ? castSlice(strSymbols, 0, end).join('')
  15408. : string.slice(0, end);
  15409. if (separator === undefined) {
  15410. return result + omission;
  15411. }
  15412. if (strSymbols) {
  15413. end += (result.length - end);
  15414. }
  15415. if (isRegExp(separator)) {
  15416. if (string.slice(end).search(separator)) {
  15417. var match,
  15418. substring = result;
  15419. if (!separator.global) {
  15420. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15421. }
  15422. separator.lastIndex = 0;
  15423. while ((match = separator.exec(substring))) {
  15424. var newEnd = match.index;
  15425. }
  15426. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15427. }
  15428. } else if (string.indexOf(baseToString(separator), end) != end) {
  15429. var index = result.lastIndexOf(separator);
  15430. if (index > -1) {
  15431. result = result.slice(0, index);
  15432. }
  15433. }
  15434. return result + omission;
  15435. }
  15436. /**
  15437. * The inverse of `_.escape`; this method converts the HTML entities
  15438. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15439. * their corresponding characters.
  15440. *
  15441. * **Note:** No other HTML entities are unescaped. To unescape additional
  15442. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15443. *
  15444. * @static
  15445. * @memberOf _
  15446. * @since 0.6.0
  15447. * @category String
  15448. * @param {string} [string=''] The string to unescape.
  15449. * @returns {string} Returns the unescaped string.
  15450. * @example
  15451. *
  15452. * _.unescape('fred, barney, &amp; pebbles');
  15453. * // => 'fred, barney, & pebbles'
  15454. */
  15455. function unescape(string) {
  15456. string = toString(string);
  15457. return (string && reHasEscapedHtml.test(string))
  15458. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15459. : string;
  15460. }
  15461. /**
  15462. * Converts `string`, as space separated words, to upper case.
  15463. *
  15464. * @static
  15465. * @memberOf _
  15466. * @since 4.0.0
  15467. * @category String
  15468. * @param {string} [string=''] The string to convert.
  15469. * @returns {string} Returns the upper cased string.
  15470. * @example
  15471. *
  15472. * _.upperCase('--foo-bar');
  15473. * // => 'FOO BAR'
  15474. *
  15475. * _.upperCase('fooBar');
  15476. * // => 'FOO BAR'
  15477. *
  15478. * _.upperCase('__foo_bar__');
  15479. * // => 'FOO BAR'
  15480. */
  15481. var upperCase = createCompounder(function(result, word, index) {
  15482. return result + (index ? ' ' : '') + word.toUpperCase();
  15483. });
  15484. /**
  15485. * Converts the first character of `string` to upper case.
  15486. *
  15487. * @static
  15488. * @memberOf _
  15489. * @since 4.0.0
  15490. * @category String
  15491. * @param {string} [string=''] The string to convert.
  15492. * @returns {string} Returns the converted string.
  15493. * @example
  15494. *
  15495. * _.upperFirst('fred');
  15496. * // => 'Fred'
  15497. *
  15498. * _.upperFirst('FRED');
  15499. * // => 'FRED'
  15500. */
  15501. var upperFirst = createCaseFirst('toUpperCase');
  15502. /**
  15503. * Splits `string` into an array of its words.
  15504. *
  15505. * @static
  15506. * @memberOf _
  15507. * @since 3.0.0
  15508. * @category String
  15509. * @param {string} [string=''] The string to inspect.
  15510. * @param {RegExp|string} [pattern] The pattern to match words.
  15511. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15512. * @returns {Array} Returns the words of `string`.
  15513. * @example
  15514. *
  15515. * _.words('fred, barney, & pebbles');
  15516. * // => ['fred', 'barney', 'pebbles']
  15517. *
  15518. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15519. * // => ['fred', 'barney', '&', 'pebbles']
  15520. */
  15521. function words(string, pattern, guard) {
  15522. string = toString(string);
  15523. pattern = guard ? undefined : pattern;
  15524. if (pattern === undefined) {
  15525. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15526. }
  15527. return string.match(pattern) || [];
  15528. }
  15529. /*------------------------------------------------------------------------*/
  15530. /**
  15531. * Attempts to invoke `func`, returning either the result or the caught error
  15532. * object. Any additional arguments are provided to `func` when it's invoked.
  15533. *
  15534. * @static
  15535. * @memberOf _
  15536. * @since 3.0.0
  15537. * @category Util
  15538. * @param {Function} func The function to attempt.
  15539. * @param {...*} [args] The arguments to invoke `func` with.
  15540. * @returns {*} Returns the `func` result or error object.
  15541. * @example
  15542. *
  15543. * // Avoid throwing errors for invalid selectors.
  15544. * var elements = _.attempt(function(selector) {
  15545. * return document.querySelectorAll(selector);
  15546. * }, '>_>');
  15547. *
  15548. * if (_.isError(elements)) {
  15549. * elements = [];
  15550. * }
  15551. */
  15552. var attempt = baseRest(function(func, args) {
  15553. try {
  15554. return apply(func, undefined, args);
  15555. } catch (e) {
  15556. return isError(e) ? e : new Error(e);
  15557. }
  15558. });
  15559. /**
  15560. * Binds methods of an object to the object itself, overwriting the existing
  15561. * method.
  15562. *
  15563. * **Note:** This method doesn't set the "length" property of bound functions.
  15564. *
  15565. * @static
  15566. * @since 0.1.0
  15567. * @memberOf _
  15568. * @category Util
  15569. * @param {Object} object The object to bind and assign the bound methods to.
  15570. * @param {...(string|string[])} methodNames The object method names to bind.
  15571. * @returns {Object} Returns `object`.
  15572. * @example
  15573. *
  15574. * var view = {
  15575. * 'label': 'docs',
  15576. * 'click': function() {
  15577. * console.log('clicked ' + this.label);
  15578. * }
  15579. * };
  15580. *
  15581. * _.bindAll(view, ['click']);
  15582. * jQuery(element).on('click', view.click);
  15583. * // => Logs 'clicked docs' when clicked.
  15584. */
  15585. var bindAll = flatRest(function(object, methodNames) {
  15586. arrayEach(methodNames, function(key) {
  15587. key = toKey(key);
  15588. baseAssignValue(object, key, bind(object[key], object));
  15589. });
  15590. return object;
  15591. });
  15592. /**
  15593. * Creates a function that iterates over `pairs` and invokes the corresponding
  15594. * function of the first predicate to return truthy. The predicate-function
  15595. * pairs are invoked with the `this` binding and arguments of the created
  15596. * function.
  15597. *
  15598. * @static
  15599. * @memberOf _
  15600. * @since 4.0.0
  15601. * @category Util
  15602. * @param {Array} pairs The predicate-function pairs.
  15603. * @returns {Function} Returns the new composite function.
  15604. * @example
  15605. *
  15606. * var func = _.cond([
  15607. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15608. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15609. * [_.stubTrue, _.constant('no match')]
  15610. * ]);
  15611. *
  15612. * func({ 'a': 1, 'b': 2 });
  15613. * // => 'matches A'
  15614. *
  15615. * func({ 'a': 0, 'b': 1 });
  15616. * // => 'matches B'
  15617. *
  15618. * func({ 'a': '1', 'b': '2' });
  15619. * // => 'no match'
  15620. */
  15621. function cond(pairs) {
  15622. var length = pairs == null ? 0 : pairs.length,
  15623. toIteratee = getIteratee();
  15624. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15625. if (typeof pair[1] != 'function') {
  15626. throw new TypeError(FUNC_ERROR_TEXT);
  15627. }
  15628. return [toIteratee(pair[0]), pair[1]];
  15629. });
  15630. return baseRest(function(args) {
  15631. var index = -1;
  15632. while (++index < length) {
  15633. var pair = pairs[index];
  15634. if (apply(pair[0], this, args)) {
  15635. return apply(pair[1], this, args);
  15636. }
  15637. }
  15638. });
  15639. }
  15640. /**
  15641. * Creates a function that invokes the predicate properties of `source` with
  15642. * the corresponding property values of a given object, returning `true` if
  15643. * all predicates return truthy, else `false`.
  15644. *
  15645. * **Note:** The created function is equivalent to `_.conformsTo` with
  15646. * `source` partially applied.
  15647. *
  15648. * @static
  15649. * @memberOf _
  15650. * @since 4.0.0
  15651. * @category Util
  15652. * @param {Object} source The object of property predicates to conform to.
  15653. * @returns {Function} Returns the new spec function.
  15654. * @example
  15655. *
  15656. * var objects = [
  15657. * { 'a': 2, 'b': 1 },
  15658. * { 'a': 1, 'b': 2 }
  15659. * ];
  15660. *
  15661. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15662. * // => [{ 'a': 1, 'b': 2 }]
  15663. */
  15664. function conforms(source) {
  15665. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15666. }
  15667. /**
  15668. * Creates a function that returns `value`.
  15669. *
  15670. * @static
  15671. * @memberOf _
  15672. * @since 2.4.0
  15673. * @category Util
  15674. * @param {*} value The value to return from the new function.
  15675. * @returns {Function} Returns the new constant function.
  15676. * @example
  15677. *
  15678. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15679. *
  15680. * console.log(objects);
  15681. * // => [{ 'a': 1 }, { 'a': 1 }]
  15682. *
  15683. * console.log(objects[0] === objects[1]);
  15684. * // => true
  15685. */
  15686. function constant(value) {
  15687. return function() {
  15688. return value;
  15689. };
  15690. }
  15691. /**
  15692. * Checks `value` to determine whether a default value should be returned in
  15693. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15694. * or `undefined`.
  15695. *
  15696. * @static
  15697. * @memberOf _
  15698. * @since 4.14.0
  15699. * @category Util
  15700. * @param {*} value The value to check.
  15701. * @param {*} defaultValue The default value.
  15702. * @returns {*} Returns the resolved value.
  15703. * @example
  15704. *
  15705. * _.defaultTo(1, 10);
  15706. * // => 1
  15707. *
  15708. * _.defaultTo(undefined, 10);
  15709. * // => 10
  15710. */
  15711. function defaultTo(value, defaultValue) {
  15712. return (value == null || value !== value) ? defaultValue : value;
  15713. }
  15714. /**
  15715. * Creates a function that returns the result of invoking the given functions
  15716. * with the `this` binding of the created function, where each successive
  15717. * invocation is supplied the return value of the previous.
  15718. *
  15719. * @static
  15720. * @memberOf _
  15721. * @since 3.0.0
  15722. * @category Util
  15723. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15724. * @returns {Function} Returns the new composite function.
  15725. * @see _.flowRight
  15726. * @example
  15727. *
  15728. * function square(n) {
  15729. * return n * n;
  15730. * }
  15731. *
  15732. * var addSquare = _.flow([_.add, square]);
  15733. * addSquare(1, 2);
  15734. * // => 9
  15735. */
  15736. var flow = createFlow();
  15737. /**
  15738. * This method is like `_.flow` except that it creates a function that
  15739. * invokes the given functions from right to left.
  15740. *
  15741. * @static
  15742. * @since 3.0.0
  15743. * @memberOf _
  15744. * @category Util
  15745. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15746. * @returns {Function} Returns the new composite function.
  15747. * @see _.flow
  15748. * @example
  15749. *
  15750. * function square(n) {
  15751. * return n * n;
  15752. * }
  15753. *
  15754. * var addSquare = _.flowRight([square, _.add]);
  15755. * addSquare(1, 2);
  15756. * // => 9
  15757. */
  15758. var flowRight = createFlow(true);
  15759. /**
  15760. * This method returns the first argument it receives.
  15761. *
  15762. * @static
  15763. * @since 0.1.0
  15764. * @memberOf _
  15765. * @category Util
  15766. * @param {*} value Any value.
  15767. * @returns {*} Returns `value`.
  15768. * @example
  15769. *
  15770. * var object = { 'a': 1 };
  15771. *
  15772. * console.log(_.identity(object) === object);
  15773. * // => true
  15774. */
  15775. function identity(value) {
  15776. return value;
  15777. }
  15778. /**
  15779. * Creates a function that invokes `func` with the arguments of the created
  15780. * function. If `func` is a property name, the created function returns the
  15781. * property value for a given element. If `func` is an array or object, the
  15782. * created function returns `true` for elements that contain the equivalent
  15783. * source properties, otherwise it returns `false`.
  15784. *
  15785. * @static
  15786. * @since 4.0.0
  15787. * @memberOf _
  15788. * @category Util
  15789. * @param {*} [func=_.identity] The value to convert to a callback.
  15790. * @returns {Function} Returns the callback.
  15791. * @example
  15792. *
  15793. * var users = [
  15794. * { 'user': 'barney', 'age': 36, 'active': true },
  15795. * { 'user': 'fred', 'age': 40, 'active': false }
  15796. * ];
  15797. *
  15798. * // The `_.matches` iteratee shorthand.
  15799. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15800. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15801. *
  15802. * // The `_.matchesProperty` iteratee shorthand.
  15803. * _.filter(users, _.iteratee(['user', 'fred']));
  15804. * // => [{ 'user': 'fred', 'age': 40 }]
  15805. *
  15806. * // The `_.property` iteratee shorthand.
  15807. * _.map(users, _.iteratee('user'));
  15808. * // => ['barney', 'fred']
  15809. *
  15810. * // Create custom iteratee shorthands.
  15811. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15812. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15813. * return func.test(string);
  15814. * };
  15815. * });
  15816. *
  15817. * _.filter(['abc', 'def'], /ef/);
  15818. * // => ['def']
  15819. */
  15820. function iteratee(func) {
  15821. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15822. }
  15823. /**
  15824. * Creates a function that performs a partial deep comparison between a given
  15825. * object and `source`, returning `true` if the given object has equivalent
  15826. * property values, else `false`.
  15827. *
  15828. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15829. * partially applied.
  15830. *
  15831. * Partial comparisons will match empty array and empty object `source`
  15832. * values against any array or object value, respectively. See `_.isEqual`
  15833. * for a list of supported value comparisons.
  15834. *
  15835. * **Note:** Multiple values can be checked by combining several matchers
  15836. * using `_.overSome`
  15837. *
  15838. * @static
  15839. * @memberOf _
  15840. * @since 3.0.0
  15841. * @category Util
  15842. * @param {Object} source The object of property values to match.
  15843. * @returns {Function} Returns the new spec function.
  15844. * @example
  15845. *
  15846. * var objects = [
  15847. * { 'a': 1, 'b': 2, 'c': 3 },
  15848. * { 'a': 4, 'b': 5, 'c': 6 }
  15849. * ];
  15850. *
  15851. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15852. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15853. *
  15854. * // Checking for several possible values
  15855. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15856. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15857. */
  15858. function matches(source) {
  15859. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15860. }
  15861. /**
  15862. * Creates a function that performs a partial deep comparison between the
  15863. * value at `path` of a given object to `srcValue`, returning `true` if the
  15864. * object value is equivalent, else `false`.
  15865. *
  15866. * **Note:** Partial comparisons will match empty array and empty object
  15867. * `srcValue` values against any array or object value, respectively. See
  15868. * `_.isEqual` for a list of supported value comparisons.
  15869. *
  15870. * **Note:** Multiple values can be checked by combining several matchers
  15871. * using `_.overSome`
  15872. *
  15873. * @static
  15874. * @memberOf _
  15875. * @since 3.2.0
  15876. * @category Util
  15877. * @param {Array|string} path The path of the property to get.
  15878. * @param {*} srcValue The value to match.
  15879. * @returns {Function} Returns the new spec function.
  15880. * @example
  15881. *
  15882. * var objects = [
  15883. * { 'a': 1, 'b': 2, 'c': 3 },
  15884. * { 'a': 4, 'b': 5, 'c': 6 }
  15885. * ];
  15886. *
  15887. * _.find(objects, _.matchesProperty('a', 4));
  15888. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15889. *
  15890. * // Checking for several possible values
  15891. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15892. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15893. */
  15894. function matchesProperty(path, srcValue) {
  15895. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15896. }
  15897. /**
  15898. * Creates a function that invokes the method at `path` of a given object.
  15899. * Any additional arguments are provided to the invoked method.
  15900. *
  15901. * @static
  15902. * @memberOf _
  15903. * @since 3.7.0
  15904. * @category Util
  15905. * @param {Array|string} path The path of the method to invoke.
  15906. * @param {...*} [args] The arguments to invoke the method with.
  15907. * @returns {Function} Returns the new invoker function.
  15908. * @example
  15909. *
  15910. * var objects = [
  15911. * { 'a': { 'b': _.constant(2) } },
  15912. * { 'a': { 'b': _.constant(1) } }
  15913. * ];
  15914. *
  15915. * _.map(objects, _.method('a.b'));
  15916. * // => [2, 1]
  15917. *
  15918. * _.map(objects, _.method(['a', 'b']));
  15919. * // => [2, 1]
  15920. */
  15921. var method = baseRest(function(path, args) {
  15922. return function(object) {
  15923. return baseInvoke(object, path, args);
  15924. };
  15925. });
  15926. /**
  15927. * The opposite of `_.method`; this method creates a function that invokes
  15928. * the method at a given path of `object`. Any additional arguments are
  15929. * provided to the invoked method.
  15930. *
  15931. * @static
  15932. * @memberOf _
  15933. * @since 3.7.0
  15934. * @category Util
  15935. * @param {Object} object The object to query.
  15936. * @param {...*} [args] The arguments to invoke the method with.
  15937. * @returns {Function} Returns the new invoker function.
  15938. * @example
  15939. *
  15940. * var array = _.times(3, _.constant),
  15941. * object = { 'a': array, 'b': array, 'c': array };
  15942. *
  15943. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15944. * // => [2, 0]
  15945. *
  15946. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15947. * // => [2, 0]
  15948. */
  15949. var methodOf = baseRest(function(object, args) {
  15950. return function(path) {
  15951. return baseInvoke(object, path, args);
  15952. };
  15953. });
  15954. /**
  15955. * Adds all own enumerable string keyed function properties of a source
  15956. * object to the destination object. If `object` is a function, then methods
  15957. * are added to its prototype as well.
  15958. *
  15959. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15960. * avoid conflicts caused by modifying the original.
  15961. *
  15962. * @static
  15963. * @since 0.1.0
  15964. * @memberOf _
  15965. * @category Util
  15966. * @param {Function|Object} [object=lodash] The destination object.
  15967. * @param {Object} source The object of functions to add.
  15968. * @param {Object} [options={}] The options object.
  15969. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15970. * @returns {Function|Object} Returns `object`.
  15971. * @example
  15972. *
  15973. * function vowels(string) {
  15974. * return _.filter(string, function(v) {
  15975. * return /[aeiou]/i.test(v);
  15976. * });
  15977. * }
  15978. *
  15979. * _.mixin({ 'vowels': vowels });
  15980. * _.vowels('fred');
  15981. * // => ['e']
  15982. *
  15983. * _('fred').vowels().value();
  15984. * // => ['e']
  15985. *
  15986. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15987. * _('fred').vowels();
  15988. * // => ['e']
  15989. */
  15990. function mixin(object, source, options) {
  15991. var props = keys(source),
  15992. methodNames = baseFunctions(source, props);
  15993. if (options == null &&
  15994. !(isObject(source) && (methodNames.length || !props.length))) {
  15995. options = source;
  15996. source = object;
  15997. object = this;
  15998. methodNames = baseFunctions(source, keys(source));
  15999. }
  16000. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16001. isFunc = isFunction(object);
  16002. arrayEach(methodNames, function(methodName) {
  16003. var func = source[methodName];
  16004. object[methodName] = func;
  16005. if (isFunc) {
  16006. object.prototype[methodName] = function() {
  16007. var chainAll = this.__chain__;
  16008. if (chain || chainAll) {
  16009. var result = object(this.__wrapped__),
  16010. actions = result.__actions__ = copyArray(this.__actions__);
  16011. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16012. result.__chain__ = chainAll;
  16013. return result;
  16014. }
  16015. return func.apply(object, arrayPush([this.value()], arguments));
  16016. };
  16017. }
  16018. });
  16019. return object;
  16020. }
  16021. /**
  16022. * Reverts the `_` variable to its previous value and returns a reference to
  16023. * the `lodash` function.
  16024. *
  16025. * @static
  16026. * @since 0.1.0
  16027. * @memberOf _
  16028. * @category Util
  16029. * @returns {Function} Returns the `lodash` function.
  16030. * @example
  16031. *
  16032. * var lodash = _.noConflict();
  16033. */
  16034. function noConflict() {
  16035. if (root._ === this) {
  16036. root._ = oldDash;
  16037. }
  16038. return this;
  16039. }
  16040. /**
  16041. * This method returns `undefined`.
  16042. *
  16043. * @static
  16044. * @memberOf _
  16045. * @since 2.3.0
  16046. * @category Util
  16047. * @example
  16048. *
  16049. * _.times(2, _.noop);
  16050. * // => [undefined, undefined]
  16051. */
  16052. function noop() {
  16053. // No operation performed.
  16054. }
  16055. /**
  16056. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16057. * the nth argument from the end is returned.
  16058. *
  16059. * @static
  16060. * @memberOf _
  16061. * @since 4.0.0
  16062. * @category Util
  16063. * @param {number} [n=0] The index of the argument to return.
  16064. * @returns {Function} Returns the new pass-thru function.
  16065. * @example
  16066. *
  16067. * var func = _.nthArg(1);
  16068. * func('a', 'b', 'c', 'd');
  16069. * // => 'b'
  16070. *
  16071. * var func = _.nthArg(-2);
  16072. * func('a', 'b', 'c', 'd');
  16073. * // => 'c'
  16074. */
  16075. function nthArg(n) {
  16076. n = toInteger(n);
  16077. return baseRest(function(args) {
  16078. return baseNth(args, n);
  16079. });
  16080. }
  16081. /**
  16082. * Creates a function that invokes `iteratees` with the arguments it receives
  16083. * and returns their results.
  16084. *
  16085. * @static
  16086. * @memberOf _
  16087. * @since 4.0.0
  16088. * @category Util
  16089. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16090. * The iteratees to invoke.
  16091. * @returns {Function} Returns the new function.
  16092. * @example
  16093. *
  16094. * var func = _.over([Math.max, Math.min]);
  16095. *
  16096. * func(1, 2, 3, 4);
  16097. * // => [4, 1]
  16098. */
  16099. var over = createOver(arrayMap);
  16100. /**
  16101. * Creates a function that checks if **all** of the `predicates` return
  16102. * truthy when invoked with the arguments it receives.
  16103. *
  16104. * Following shorthands are possible for providing predicates.
  16105. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16106. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16107. *
  16108. * @static
  16109. * @memberOf _
  16110. * @since 4.0.0
  16111. * @category Util
  16112. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16113. * The predicates to check.
  16114. * @returns {Function} Returns the new function.
  16115. * @example
  16116. *
  16117. * var func = _.overEvery([Boolean, isFinite]);
  16118. *
  16119. * func('1');
  16120. * // => true
  16121. *
  16122. * func(null);
  16123. * // => false
  16124. *
  16125. * func(NaN);
  16126. * // => false
  16127. */
  16128. var overEvery = createOver(arrayEvery);
  16129. /**
  16130. * Creates a function that checks if **any** of the `predicates` return
  16131. * truthy when invoked with the arguments it receives.
  16132. *
  16133. * Following shorthands are possible for providing predicates.
  16134. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16135. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16136. *
  16137. * @static
  16138. * @memberOf _
  16139. * @since 4.0.0
  16140. * @category Util
  16141. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16142. * The predicates to check.
  16143. * @returns {Function} Returns the new function.
  16144. * @example
  16145. *
  16146. * var func = _.overSome([Boolean, isFinite]);
  16147. *
  16148. * func('1');
  16149. * // => true
  16150. *
  16151. * func(null);
  16152. * // => true
  16153. *
  16154. * func(NaN);
  16155. * // => false
  16156. *
  16157. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16158. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16159. */
  16160. var overSome = createOver(arraySome);
  16161. /**
  16162. * Creates a function that returns the value at `path` of a given object.
  16163. *
  16164. * @static
  16165. * @memberOf _
  16166. * @since 2.4.0
  16167. * @category Util
  16168. * @param {Array|string} path The path of the property to get.
  16169. * @returns {Function} Returns the new accessor function.
  16170. * @example
  16171. *
  16172. * var objects = [
  16173. * { 'a': { 'b': 2 } },
  16174. * { 'a': { 'b': 1 } }
  16175. * ];
  16176. *
  16177. * _.map(objects, _.property('a.b'));
  16178. * // => [2, 1]
  16179. *
  16180. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16181. * // => [1, 2]
  16182. */
  16183. function property(path) {
  16184. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16185. }
  16186. /**
  16187. * The opposite of `_.property`; this method creates a function that returns
  16188. * the value at a given path of `object`.
  16189. *
  16190. * @static
  16191. * @memberOf _
  16192. * @since 3.0.0
  16193. * @category Util
  16194. * @param {Object} object The object to query.
  16195. * @returns {Function} Returns the new accessor function.
  16196. * @example
  16197. *
  16198. * var array = [0, 1, 2],
  16199. * object = { 'a': array, 'b': array, 'c': array };
  16200. *
  16201. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16202. * // => [2, 0]
  16203. *
  16204. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16205. * // => [2, 0]
  16206. */
  16207. function propertyOf(object) {
  16208. return function(path) {
  16209. return object == null ? undefined : baseGet(object, path);
  16210. };
  16211. }
  16212. /**
  16213. * Creates an array of numbers (positive and/or negative) progressing from
  16214. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16215. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16216. * it's set to `start` with `start` then set to `0`.
  16217. *
  16218. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16219. * floating-point values which can produce unexpected results.
  16220. *
  16221. * @static
  16222. * @since 0.1.0
  16223. * @memberOf _
  16224. * @category Util
  16225. * @param {number} [start=0] The start of the range.
  16226. * @param {number} end The end of the range.
  16227. * @param {number} [step=1] The value to increment or decrement by.
  16228. * @returns {Array} Returns the range of numbers.
  16229. * @see _.inRange, _.rangeRight
  16230. * @example
  16231. *
  16232. * _.range(4);
  16233. * // => [0, 1, 2, 3]
  16234. *
  16235. * _.range(-4);
  16236. * // => [0, -1, -2, -3]
  16237. *
  16238. * _.range(1, 5);
  16239. * // => [1, 2, 3, 4]
  16240. *
  16241. * _.range(0, 20, 5);
  16242. * // => [0, 5, 10, 15]
  16243. *
  16244. * _.range(0, -4, -1);
  16245. * // => [0, -1, -2, -3]
  16246. *
  16247. * _.range(1, 4, 0);
  16248. * // => [1, 1, 1]
  16249. *
  16250. * _.range(0);
  16251. * // => []
  16252. */
  16253. var range = createRange();
  16254. /**
  16255. * This method is like `_.range` except that it populates values in
  16256. * descending order.
  16257. *
  16258. * @static
  16259. * @memberOf _
  16260. * @since 4.0.0
  16261. * @category Util
  16262. * @param {number} [start=0] The start of the range.
  16263. * @param {number} end The end of the range.
  16264. * @param {number} [step=1] The value to increment or decrement by.
  16265. * @returns {Array} Returns the range of numbers.
  16266. * @see _.inRange, _.range
  16267. * @example
  16268. *
  16269. * _.rangeRight(4);
  16270. * // => [3, 2, 1, 0]
  16271. *
  16272. * _.rangeRight(-4);
  16273. * // => [-3, -2, -1, 0]
  16274. *
  16275. * _.rangeRight(1, 5);
  16276. * // => [4, 3, 2, 1]
  16277. *
  16278. * _.rangeRight(0, 20, 5);
  16279. * // => [15, 10, 5, 0]
  16280. *
  16281. * _.rangeRight(0, -4, -1);
  16282. * // => [-3, -2, -1, 0]
  16283. *
  16284. * _.rangeRight(1, 4, 0);
  16285. * // => [1, 1, 1]
  16286. *
  16287. * _.rangeRight(0);
  16288. * // => []
  16289. */
  16290. var rangeRight = createRange(true);
  16291. /**
  16292. * This method returns a new empty array.
  16293. *
  16294. * @static
  16295. * @memberOf _
  16296. * @since 4.13.0
  16297. * @category Util
  16298. * @returns {Array} Returns the new empty array.
  16299. * @example
  16300. *
  16301. * var arrays = _.times(2, _.stubArray);
  16302. *
  16303. * console.log(arrays);
  16304. * // => [[], []]
  16305. *
  16306. * console.log(arrays[0] === arrays[1]);
  16307. * // => false
  16308. */
  16309. function stubArray() {
  16310. return [];
  16311. }
  16312. /**
  16313. * This method returns `false`.
  16314. *
  16315. * @static
  16316. * @memberOf _
  16317. * @since 4.13.0
  16318. * @category Util
  16319. * @returns {boolean} Returns `false`.
  16320. * @example
  16321. *
  16322. * _.times(2, _.stubFalse);
  16323. * // => [false, false]
  16324. */
  16325. function stubFalse() {
  16326. return false;
  16327. }
  16328. /**
  16329. * This method returns a new empty object.
  16330. *
  16331. * @static
  16332. * @memberOf _
  16333. * @since 4.13.0
  16334. * @category Util
  16335. * @returns {Object} Returns the new empty object.
  16336. * @example
  16337. *
  16338. * var objects = _.times(2, _.stubObject);
  16339. *
  16340. * console.log(objects);
  16341. * // => [{}, {}]
  16342. *
  16343. * console.log(objects[0] === objects[1]);
  16344. * // => false
  16345. */
  16346. function stubObject() {
  16347. return {};
  16348. }
  16349. /**
  16350. * This method returns an empty string.
  16351. *
  16352. * @static
  16353. * @memberOf _
  16354. * @since 4.13.0
  16355. * @category Util
  16356. * @returns {string} Returns the empty string.
  16357. * @example
  16358. *
  16359. * _.times(2, _.stubString);
  16360. * // => ['', '']
  16361. */
  16362. function stubString() {
  16363. return '';
  16364. }
  16365. /**
  16366. * This method returns `true`.
  16367. *
  16368. * @static
  16369. * @memberOf _
  16370. * @since 4.13.0
  16371. * @category Util
  16372. * @returns {boolean} Returns `true`.
  16373. * @example
  16374. *
  16375. * _.times(2, _.stubTrue);
  16376. * // => [true, true]
  16377. */
  16378. function stubTrue() {
  16379. return true;
  16380. }
  16381. /**
  16382. * Invokes the iteratee `n` times, returning an array of the results of
  16383. * each invocation. The iteratee is invoked with one argument; (index).
  16384. *
  16385. * @static
  16386. * @since 0.1.0
  16387. * @memberOf _
  16388. * @category Util
  16389. * @param {number} n The number of times to invoke `iteratee`.
  16390. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16391. * @returns {Array} Returns the array of results.
  16392. * @example
  16393. *
  16394. * _.times(3, String);
  16395. * // => ['0', '1', '2']
  16396. *
  16397. * _.times(4, _.constant(0));
  16398. * // => [0, 0, 0, 0]
  16399. */
  16400. function times(n, iteratee) {
  16401. n = toInteger(n);
  16402. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16403. return [];
  16404. }
  16405. var index = MAX_ARRAY_LENGTH,
  16406. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16407. iteratee = getIteratee(iteratee);
  16408. n -= MAX_ARRAY_LENGTH;
  16409. var result = baseTimes(length, iteratee);
  16410. while (++index < n) {
  16411. iteratee(index);
  16412. }
  16413. return result;
  16414. }
  16415. /**
  16416. * Converts `value` to a property path array.
  16417. *
  16418. * @static
  16419. * @memberOf _
  16420. * @since 4.0.0
  16421. * @category Util
  16422. * @param {*} value The value to convert.
  16423. * @returns {Array} Returns the new property path array.
  16424. * @example
  16425. *
  16426. * _.toPath('a.b.c');
  16427. * // => ['a', 'b', 'c']
  16428. *
  16429. * _.toPath('a[0].b.c');
  16430. * // => ['a', '0', 'b', 'c']
  16431. */
  16432. function toPath(value) {
  16433. if (isArray(value)) {
  16434. return arrayMap(value, toKey);
  16435. }
  16436. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16437. }
  16438. /**
  16439. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16440. *
  16441. * @static
  16442. * @since 0.1.0
  16443. * @memberOf _
  16444. * @category Util
  16445. * @param {string} [prefix=''] The value to prefix the ID with.
  16446. * @returns {string} Returns the unique ID.
  16447. * @example
  16448. *
  16449. * _.uniqueId('contact_');
  16450. * // => 'contact_104'
  16451. *
  16452. * _.uniqueId();
  16453. * // => '105'
  16454. */
  16455. function uniqueId(prefix) {
  16456. var id = ++idCounter;
  16457. return toString(prefix) + id;
  16458. }
  16459. /*------------------------------------------------------------------------*/
  16460. /**
  16461. * Adds two numbers.
  16462. *
  16463. * @static
  16464. * @memberOf _
  16465. * @since 3.4.0
  16466. * @category Math
  16467. * @param {number} augend The first number in an addition.
  16468. * @param {number} addend The second number in an addition.
  16469. * @returns {number} Returns the total.
  16470. * @example
  16471. *
  16472. * _.add(6, 4);
  16473. * // => 10
  16474. */
  16475. var add = createMathOperation(function(augend, addend) {
  16476. return augend + addend;
  16477. }, 0);
  16478. /**
  16479. * Computes `number` rounded up to `precision`.
  16480. *
  16481. * @static
  16482. * @memberOf _
  16483. * @since 3.10.0
  16484. * @category Math
  16485. * @param {number} number The number to round up.
  16486. * @param {number} [precision=0] The precision to round up to.
  16487. * @returns {number} Returns the rounded up number.
  16488. * @example
  16489. *
  16490. * _.ceil(4.006);
  16491. * // => 5
  16492. *
  16493. * _.ceil(6.004, 2);
  16494. * // => 6.01
  16495. *
  16496. * _.ceil(6040, -2);
  16497. * // => 6100
  16498. */
  16499. var ceil = createRound('ceil');
  16500. /**
  16501. * Divide two numbers.
  16502. *
  16503. * @static
  16504. * @memberOf _
  16505. * @since 4.7.0
  16506. * @category Math
  16507. * @param {number} dividend The first number in a division.
  16508. * @param {number} divisor The second number in a division.
  16509. * @returns {number} Returns the quotient.
  16510. * @example
  16511. *
  16512. * _.divide(6, 4);
  16513. * // => 1.5
  16514. */
  16515. var divide = createMathOperation(function(dividend, divisor) {
  16516. return dividend / divisor;
  16517. }, 1);
  16518. /**
  16519. * Computes `number` rounded down to `precision`.
  16520. *
  16521. * @static
  16522. * @memberOf _
  16523. * @since 3.10.0
  16524. * @category Math
  16525. * @param {number} number The number to round down.
  16526. * @param {number} [precision=0] The precision to round down to.
  16527. * @returns {number} Returns the rounded down number.
  16528. * @example
  16529. *
  16530. * _.floor(4.006);
  16531. * // => 4
  16532. *
  16533. * _.floor(0.046, 2);
  16534. * // => 0.04
  16535. *
  16536. * _.floor(4060, -2);
  16537. * // => 4000
  16538. */
  16539. var floor = createRound('floor');
  16540. /**
  16541. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16542. * `undefined` is returned.
  16543. *
  16544. * @static
  16545. * @since 0.1.0
  16546. * @memberOf _
  16547. * @category Math
  16548. * @param {Array} array The array to iterate over.
  16549. * @returns {*} Returns the maximum value.
  16550. * @example
  16551. *
  16552. * _.max([4, 2, 8, 6]);
  16553. * // => 8
  16554. *
  16555. * _.max([]);
  16556. * // => undefined
  16557. */
  16558. function max(array) {
  16559. return (array && array.length)
  16560. ? baseExtremum(array, identity, baseGt)
  16561. : undefined;
  16562. }
  16563. /**
  16564. * This method is like `_.max` except that it accepts `iteratee` which is
  16565. * invoked for each element in `array` to generate the criterion by which
  16566. * the value is ranked. The iteratee is invoked with one argument: (value).
  16567. *
  16568. * @static
  16569. * @memberOf _
  16570. * @since 4.0.0
  16571. * @category Math
  16572. * @param {Array} array The array to iterate over.
  16573. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16574. * @returns {*} Returns the maximum value.
  16575. * @example
  16576. *
  16577. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16578. *
  16579. * _.maxBy(objects, function(o) { return o.n; });
  16580. * // => { 'n': 2 }
  16581. *
  16582. * // The `_.property` iteratee shorthand.
  16583. * _.maxBy(objects, 'n');
  16584. * // => { 'n': 2 }
  16585. */
  16586. function maxBy(array, iteratee) {
  16587. return (array && array.length)
  16588. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16589. : undefined;
  16590. }
  16591. /**
  16592. * Computes the mean of the values in `array`.
  16593. *
  16594. * @static
  16595. * @memberOf _
  16596. * @since 4.0.0
  16597. * @category Math
  16598. * @param {Array} array The array to iterate over.
  16599. * @returns {number} Returns the mean.
  16600. * @example
  16601. *
  16602. * _.mean([4, 2, 8, 6]);
  16603. * // => 5
  16604. */
  16605. function mean(array) {
  16606. return baseMean(array, identity);
  16607. }
  16608. /**
  16609. * This method is like `_.mean` except that it accepts `iteratee` which is
  16610. * invoked for each element in `array` to generate the value to be averaged.
  16611. * The iteratee is invoked with one argument: (value).
  16612. *
  16613. * @static
  16614. * @memberOf _
  16615. * @since 4.7.0
  16616. * @category Math
  16617. * @param {Array} array The array to iterate over.
  16618. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16619. * @returns {number} Returns the mean.
  16620. * @example
  16621. *
  16622. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16623. *
  16624. * _.meanBy(objects, function(o) { return o.n; });
  16625. * // => 5
  16626. *
  16627. * // The `_.property` iteratee shorthand.
  16628. * _.meanBy(objects, 'n');
  16629. * // => 5
  16630. */
  16631. function meanBy(array, iteratee) {
  16632. return baseMean(array, getIteratee(iteratee, 2));
  16633. }
  16634. /**
  16635. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16636. * `undefined` is returned.
  16637. *
  16638. * @static
  16639. * @since 0.1.0
  16640. * @memberOf _
  16641. * @category Math
  16642. * @param {Array} array The array to iterate over.
  16643. * @returns {*} Returns the minimum value.
  16644. * @example
  16645. *
  16646. * _.min([4, 2, 8, 6]);
  16647. * // => 2
  16648. *
  16649. * _.min([]);
  16650. * // => undefined
  16651. */
  16652. function min(array) {
  16653. return (array && array.length)
  16654. ? baseExtremum(array, identity, baseLt)
  16655. : undefined;
  16656. }
  16657. /**
  16658. * This method is like `_.min` except that it accepts `iteratee` which is
  16659. * invoked for each element in `array` to generate the criterion by which
  16660. * the value is ranked. The iteratee is invoked with one argument: (value).
  16661. *
  16662. * @static
  16663. * @memberOf _
  16664. * @since 4.0.0
  16665. * @category Math
  16666. * @param {Array} array The array to iterate over.
  16667. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16668. * @returns {*} Returns the minimum value.
  16669. * @example
  16670. *
  16671. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16672. *
  16673. * _.minBy(objects, function(o) { return o.n; });
  16674. * // => { 'n': 1 }
  16675. *
  16676. * // The `_.property` iteratee shorthand.
  16677. * _.minBy(objects, 'n');
  16678. * // => { 'n': 1 }
  16679. */
  16680. function minBy(array, iteratee) {
  16681. return (array && array.length)
  16682. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16683. : undefined;
  16684. }
  16685. /**
  16686. * Multiply two numbers.
  16687. *
  16688. * @static
  16689. * @memberOf _
  16690. * @since 4.7.0
  16691. * @category Math
  16692. * @param {number} multiplier The first number in a multiplication.
  16693. * @param {number} multiplicand The second number in a multiplication.
  16694. * @returns {number} Returns the product.
  16695. * @example
  16696. *
  16697. * _.multiply(6, 4);
  16698. * // => 24
  16699. */
  16700. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16701. return multiplier * multiplicand;
  16702. }, 1);
  16703. /**
  16704. * Computes `number` rounded to `precision`.
  16705. *
  16706. * @static
  16707. * @memberOf _
  16708. * @since 3.10.0
  16709. * @category Math
  16710. * @param {number} number The number to round.
  16711. * @param {number} [precision=0] The precision to round to.
  16712. * @returns {number} Returns the rounded number.
  16713. * @example
  16714. *
  16715. * _.round(4.006);
  16716. * // => 4
  16717. *
  16718. * _.round(4.006, 2);
  16719. * // => 4.01
  16720. *
  16721. * _.round(4060, -2);
  16722. * // => 4100
  16723. */
  16724. var round = createRound('round');
  16725. /**
  16726. * Subtract two numbers.
  16727. *
  16728. * @static
  16729. * @memberOf _
  16730. * @since 4.0.0
  16731. * @category Math
  16732. * @param {number} minuend The first number in a subtraction.
  16733. * @param {number} subtrahend The second number in a subtraction.
  16734. * @returns {number} Returns the difference.
  16735. * @example
  16736. *
  16737. * _.subtract(6, 4);
  16738. * // => 2
  16739. */
  16740. var subtract = createMathOperation(function(minuend, subtrahend) {
  16741. return minuend - subtrahend;
  16742. }, 0);
  16743. /**
  16744. * Computes the sum of the values in `array`.
  16745. *
  16746. * @static
  16747. * @memberOf _
  16748. * @since 3.4.0
  16749. * @category Math
  16750. * @param {Array} array The array to iterate over.
  16751. * @returns {number} Returns the sum.
  16752. * @example
  16753. *
  16754. * _.sum([4, 2, 8, 6]);
  16755. * // => 20
  16756. */
  16757. function sum(array) {
  16758. return (array && array.length)
  16759. ? baseSum(array, identity)
  16760. : 0;
  16761. }
  16762. /**
  16763. * This method is like `_.sum` except that it accepts `iteratee` which is
  16764. * invoked for each element in `array` to generate the value to be summed.
  16765. * The iteratee is invoked with one argument: (value).
  16766. *
  16767. * @static
  16768. * @memberOf _
  16769. * @since 4.0.0
  16770. * @category Math
  16771. * @param {Array} array The array to iterate over.
  16772. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16773. * @returns {number} Returns the sum.
  16774. * @example
  16775. *
  16776. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16777. *
  16778. * _.sumBy(objects, function(o) { return o.n; });
  16779. * // => 20
  16780. *
  16781. * // The `_.property` iteratee shorthand.
  16782. * _.sumBy(objects, 'n');
  16783. * // => 20
  16784. */
  16785. function sumBy(array, iteratee) {
  16786. return (array && array.length)
  16787. ? baseSum(array, getIteratee(iteratee, 2))
  16788. : 0;
  16789. }
  16790. /*------------------------------------------------------------------------*/
  16791. // Add methods that return wrapped values in chain sequences.
  16792. lodash.after = after;
  16793. lodash.ary = ary;
  16794. lodash.assign = assign;
  16795. lodash.assignIn = assignIn;
  16796. lodash.assignInWith = assignInWith;
  16797. lodash.assignWith = assignWith;
  16798. lodash.at = at;
  16799. lodash.before = before;
  16800. lodash.bind = bind;
  16801. lodash.bindAll = bindAll;
  16802. lodash.bindKey = bindKey;
  16803. lodash.castArray = castArray;
  16804. lodash.chain = chain;
  16805. lodash.chunk = chunk;
  16806. lodash.compact = compact;
  16807. lodash.concat = concat;
  16808. lodash.cond = cond;
  16809. lodash.conforms = conforms;
  16810. lodash.constant = constant;
  16811. lodash.countBy = countBy;
  16812. lodash.create = create;
  16813. lodash.curry = curry;
  16814. lodash.curryRight = curryRight;
  16815. lodash.debounce = debounce;
  16816. lodash.defaults = defaults;
  16817. lodash.defaultsDeep = defaultsDeep;
  16818. lodash.defer = defer;
  16819. lodash.delay = delay;
  16820. lodash.difference = difference;
  16821. lodash.differenceBy = differenceBy;
  16822. lodash.differenceWith = differenceWith;
  16823. lodash.drop = drop;
  16824. lodash.dropRight = dropRight;
  16825. lodash.dropRightWhile = dropRightWhile;
  16826. lodash.dropWhile = dropWhile;
  16827. lodash.fill = fill;
  16828. lodash.filter = filter;
  16829. lodash.flatMap = flatMap;
  16830. lodash.flatMapDeep = flatMapDeep;
  16831. lodash.flatMapDepth = flatMapDepth;
  16832. lodash.flatten = flatten;
  16833. lodash.flattenDeep = flattenDeep;
  16834. lodash.flattenDepth = flattenDepth;
  16835. lodash.flip = flip;
  16836. lodash.flow = flow;
  16837. lodash.flowRight = flowRight;
  16838. lodash.fromPairs = fromPairs;
  16839. lodash.functions = functions;
  16840. lodash.functionsIn = functionsIn;
  16841. lodash.groupBy = groupBy;
  16842. lodash.initial = initial;
  16843. lodash.intersection = intersection;
  16844. lodash.intersectionBy = intersectionBy;
  16845. lodash.intersectionWith = intersectionWith;
  16846. lodash.invert = invert;
  16847. lodash.invertBy = invertBy;
  16848. lodash.invokeMap = invokeMap;
  16849. lodash.iteratee = iteratee;
  16850. lodash.keyBy = keyBy;
  16851. lodash.keys = keys;
  16852. lodash.keysIn = keysIn;
  16853. lodash.map = map;
  16854. lodash.mapKeys = mapKeys;
  16855. lodash.mapValues = mapValues;
  16856. lodash.matches = matches;
  16857. lodash.matchesProperty = matchesProperty;
  16858. lodash.memoize = memoize;
  16859. lodash.merge = merge;
  16860. lodash.mergeWith = mergeWith;
  16861. lodash.method = method;
  16862. lodash.methodOf = methodOf;
  16863. lodash.mixin = mixin;
  16864. lodash.negate = negate;
  16865. lodash.nthArg = nthArg;
  16866. lodash.omit = omit;
  16867. lodash.omitBy = omitBy;
  16868. lodash.once = once;
  16869. lodash.orderBy = orderBy;
  16870. lodash.over = over;
  16871. lodash.overArgs = overArgs;
  16872. lodash.overEvery = overEvery;
  16873. lodash.overSome = overSome;
  16874. lodash.partial = partial;
  16875. lodash.partialRight = partialRight;
  16876. lodash.partition = partition;
  16877. lodash.pick = pick;
  16878. lodash.pickBy = pickBy;
  16879. lodash.property = property;
  16880. lodash.propertyOf = propertyOf;
  16881. lodash.pull = pull;
  16882. lodash.pullAll = pullAll;
  16883. lodash.pullAllBy = pullAllBy;
  16884. lodash.pullAllWith = pullAllWith;
  16885. lodash.pullAt = pullAt;
  16886. lodash.range = range;
  16887. lodash.rangeRight = rangeRight;
  16888. lodash.rearg = rearg;
  16889. lodash.reject = reject;
  16890. lodash.remove = remove;
  16891. lodash.rest = rest;
  16892. lodash.reverse = reverse;
  16893. lodash.sampleSize = sampleSize;
  16894. lodash.set = set;
  16895. lodash.setWith = setWith;
  16896. lodash.shuffle = shuffle;
  16897. lodash.slice = slice;
  16898. lodash.sortBy = sortBy;
  16899. lodash.sortedUniq = sortedUniq;
  16900. lodash.sortedUniqBy = sortedUniqBy;
  16901. lodash.split = split;
  16902. lodash.spread = spread;
  16903. lodash.tail = tail;
  16904. lodash.take = take;
  16905. lodash.takeRight = takeRight;
  16906. lodash.takeRightWhile = takeRightWhile;
  16907. lodash.takeWhile = takeWhile;
  16908. lodash.tap = tap;
  16909. lodash.throttle = throttle;
  16910. lodash.thru = thru;
  16911. lodash.toArray = toArray;
  16912. lodash.toPairs = toPairs;
  16913. lodash.toPairsIn = toPairsIn;
  16914. lodash.toPath = toPath;
  16915. lodash.toPlainObject = toPlainObject;
  16916. lodash.transform = transform;
  16917. lodash.unary = unary;
  16918. lodash.union = union;
  16919. lodash.unionBy = unionBy;
  16920. lodash.unionWith = unionWith;
  16921. lodash.uniq = uniq;
  16922. lodash.uniqBy = uniqBy;
  16923. lodash.uniqWith = uniqWith;
  16924. lodash.unset = unset;
  16925. lodash.unzip = unzip;
  16926. lodash.unzipWith = unzipWith;
  16927. lodash.update = update;
  16928. lodash.updateWith = updateWith;
  16929. lodash.values = values;
  16930. lodash.valuesIn = valuesIn;
  16931. lodash.without = without;
  16932. lodash.words = words;
  16933. lodash.wrap = wrap;
  16934. lodash.xor = xor;
  16935. lodash.xorBy = xorBy;
  16936. lodash.xorWith = xorWith;
  16937. lodash.zip = zip;
  16938. lodash.zipObject = zipObject;
  16939. lodash.zipObjectDeep = zipObjectDeep;
  16940. lodash.zipWith = zipWith;
  16941. // Add aliases.
  16942. lodash.entries = toPairs;
  16943. lodash.entriesIn = toPairsIn;
  16944. lodash.extend = assignIn;
  16945. lodash.extendWith = assignInWith;
  16946. // Add methods to `lodash.prototype`.
  16947. mixin(lodash, lodash);
  16948. /*------------------------------------------------------------------------*/
  16949. // Add methods that return unwrapped values in chain sequences.
  16950. lodash.add = add;
  16951. lodash.attempt = attempt;
  16952. lodash.camelCase = camelCase;
  16953. lodash.capitalize = capitalize;
  16954. lodash.ceil = ceil;
  16955. lodash.clamp = clamp;
  16956. lodash.clone = clone;
  16957. lodash.cloneDeep = cloneDeep;
  16958. lodash.cloneDeepWith = cloneDeepWith;
  16959. lodash.cloneWith = cloneWith;
  16960. lodash.conformsTo = conformsTo;
  16961. lodash.deburr = deburr;
  16962. lodash.defaultTo = defaultTo;
  16963. lodash.divide = divide;
  16964. lodash.endsWith = endsWith;
  16965. lodash.eq = eq;
  16966. lodash.escape = escape;
  16967. lodash.escapeRegExp = escapeRegExp;
  16968. lodash.every = every;
  16969. lodash.find = find;
  16970. lodash.findIndex = findIndex;
  16971. lodash.findKey = findKey;
  16972. lodash.findLast = findLast;
  16973. lodash.findLastIndex = findLastIndex;
  16974. lodash.findLastKey = findLastKey;
  16975. lodash.floor = floor;
  16976. lodash.forEach = forEach;
  16977. lodash.forEachRight = forEachRight;
  16978. lodash.forIn = forIn;
  16979. lodash.forInRight = forInRight;
  16980. lodash.forOwn = forOwn;
  16981. lodash.forOwnRight = forOwnRight;
  16982. lodash.get = get;
  16983. lodash.gt = gt;
  16984. lodash.gte = gte;
  16985. lodash.has = has;
  16986. lodash.hasIn = hasIn;
  16987. lodash.head = head;
  16988. lodash.identity = identity;
  16989. lodash.includes = includes;
  16990. lodash.indexOf = indexOf;
  16991. lodash.inRange = inRange;
  16992. lodash.invoke = invoke;
  16993. lodash.isArguments = isArguments;
  16994. lodash.isArray = isArray;
  16995. lodash.isArrayBuffer = isArrayBuffer;
  16996. lodash.isArrayLike = isArrayLike;
  16997. lodash.isArrayLikeObject = isArrayLikeObject;
  16998. lodash.isBoolean = isBoolean;
  16999. lodash.isBuffer = isBuffer;
  17000. lodash.isDate = isDate;
  17001. lodash.isElement = isElement;
  17002. lodash.isEmpty = isEmpty;
  17003. lodash.isEqual = isEqual;
  17004. lodash.isEqualWith = isEqualWith;
  17005. lodash.isError = isError;
  17006. lodash.isFinite = isFinite;
  17007. lodash.isFunction = isFunction;
  17008. lodash.isInteger = isInteger;
  17009. lodash.isLength = isLength;
  17010. lodash.isMap = isMap;
  17011. lodash.isMatch = isMatch;
  17012. lodash.isMatchWith = isMatchWith;
  17013. lodash.isNaN = isNaN;
  17014. lodash.isNative = isNative;
  17015. lodash.isNil = isNil;
  17016. lodash.isNull = isNull;
  17017. lodash.isNumber = isNumber;
  17018. lodash.isObject = isObject;
  17019. lodash.isObjectLike = isObjectLike;
  17020. lodash.isPlainObject = isPlainObject;
  17021. lodash.isRegExp = isRegExp;
  17022. lodash.isSafeInteger = isSafeInteger;
  17023. lodash.isSet = isSet;
  17024. lodash.isString = isString;
  17025. lodash.isSymbol = isSymbol;
  17026. lodash.isTypedArray = isTypedArray;
  17027. lodash.isUndefined = isUndefined;
  17028. lodash.isWeakMap = isWeakMap;
  17029. lodash.isWeakSet = isWeakSet;
  17030. lodash.join = join;
  17031. lodash.kebabCase = kebabCase;
  17032. lodash.last = last;
  17033. lodash.lastIndexOf = lastIndexOf;
  17034. lodash.lowerCase = lowerCase;
  17035. lodash.lowerFirst = lowerFirst;
  17036. lodash.lt = lt;
  17037. lodash.lte = lte;
  17038. lodash.max = max;
  17039. lodash.maxBy = maxBy;
  17040. lodash.mean = mean;
  17041. lodash.meanBy = meanBy;
  17042. lodash.min = min;
  17043. lodash.minBy = minBy;
  17044. lodash.stubArray = stubArray;
  17045. lodash.stubFalse = stubFalse;
  17046. lodash.stubObject = stubObject;
  17047. lodash.stubString = stubString;
  17048. lodash.stubTrue = stubTrue;
  17049. lodash.multiply = multiply;
  17050. lodash.nth = nth;
  17051. lodash.noConflict = noConflict;
  17052. lodash.noop = noop;
  17053. lodash.now = now;
  17054. lodash.pad = pad;
  17055. lodash.padEnd = padEnd;
  17056. lodash.padStart = padStart;
  17057. lodash.parseInt = parseInt;
  17058. lodash.random = random;
  17059. lodash.reduce = reduce;
  17060. lodash.reduceRight = reduceRight;
  17061. lodash.repeat = repeat;
  17062. lodash.replace = replace;
  17063. lodash.result = result;
  17064. lodash.round = round;
  17065. lodash.runInContext = runInContext;
  17066. lodash.sample = sample;
  17067. lodash.size = size;
  17068. lodash.snakeCase = snakeCase;
  17069. lodash.some = some;
  17070. lodash.sortedIndex = sortedIndex;
  17071. lodash.sortedIndexBy = sortedIndexBy;
  17072. lodash.sortedIndexOf = sortedIndexOf;
  17073. lodash.sortedLastIndex = sortedLastIndex;
  17074. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17075. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17076. lodash.startCase = startCase;
  17077. lodash.startsWith = startsWith;
  17078. lodash.subtract = subtract;
  17079. lodash.sum = sum;
  17080. lodash.sumBy = sumBy;
  17081. lodash.template = template;
  17082. lodash.times = times;
  17083. lodash.toFinite = toFinite;
  17084. lodash.toInteger = toInteger;
  17085. lodash.toLength = toLength;
  17086. lodash.toLower = toLower;
  17087. lodash.toNumber = toNumber;
  17088. lodash.toSafeInteger = toSafeInteger;
  17089. lodash.toString = toString;
  17090. lodash.toUpper = toUpper;
  17091. lodash.trim = trim;
  17092. lodash.trimEnd = trimEnd;
  17093. lodash.trimStart = trimStart;
  17094. lodash.truncate = truncate;
  17095. lodash.unescape = unescape;
  17096. lodash.uniqueId = uniqueId;
  17097. lodash.upperCase = upperCase;
  17098. lodash.upperFirst = upperFirst;
  17099. // Add aliases.
  17100. lodash.each = forEach;
  17101. lodash.eachRight = forEachRight;
  17102. lodash.first = head;
  17103. mixin(lodash, (function() {
  17104. var source = {};
  17105. baseForOwn(lodash, function(func, methodName) {
  17106. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17107. source[methodName] = func;
  17108. }
  17109. });
  17110. return source;
  17111. }()), { 'chain': false });
  17112. /*------------------------------------------------------------------------*/
  17113. /**
  17114. * The semantic version number.
  17115. *
  17116. * @static
  17117. * @memberOf _
  17118. * @type {string}
  17119. */
  17120. lodash.VERSION = VERSION;
  17121. // Assign default placeholders.
  17122. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17123. lodash[methodName].placeholder = lodash;
  17124. });
  17125. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17126. arrayEach(['drop', 'take'], function(methodName, index) {
  17127. LazyWrapper.prototype[methodName] = function(n) {
  17128. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17129. var result = (this.__filtered__ && !index)
  17130. ? new LazyWrapper(this)
  17131. : this.clone();
  17132. if (result.__filtered__) {
  17133. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17134. } else {
  17135. result.__views__.push({
  17136. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17137. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17138. });
  17139. }
  17140. return result;
  17141. };
  17142. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17143. return this.reverse()[methodName](n).reverse();
  17144. };
  17145. });
  17146. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17147. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17148. var type = index + 1,
  17149. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17150. LazyWrapper.prototype[methodName] = function(iteratee) {
  17151. var result = this.clone();
  17152. result.__iteratees__.push({
  17153. 'iteratee': getIteratee(iteratee, 3),
  17154. 'type': type
  17155. });
  17156. result.__filtered__ = result.__filtered__ || isFilter;
  17157. return result;
  17158. };
  17159. });
  17160. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17161. arrayEach(['head', 'last'], function(methodName, index) {
  17162. var takeName = 'take' + (index ? 'Right' : '');
  17163. LazyWrapper.prototype[methodName] = function() {
  17164. return this[takeName](1).value()[0];
  17165. };
  17166. });
  17167. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17168. arrayEach(['initial', 'tail'], function(methodName, index) {
  17169. var dropName = 'drop' + (index ? '' : 'Right');
  17170. LazyWrapper.prototype[methodName] = function() {
  17171. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17172. };
  17173. });
  17174. LazyWrapper.prototype.compact = function() {
  17175. return this.filter(identity);
  17176. };
  17177. LazyWrapper.prototype.find = function(predicate) {
  17178. return this.filter(predicate).head();
  17179. };
  17180. LazyWrapper.prototype.findLast = function(predicate) {
  17181. return this.reverse().find(predicate);
  17182. };
  17183. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17184. if (typeof path == 'function') {
  17185. return new LazyWrapper(this);
  17186. }
  17187. return this.map(function(value) {
  17188. return baseInvoke(value, path, args);
  17189. });
  17190. });
  17191. LazyWrapper.prototype.reject = function(predicate) {
  17192. return this.filter(negate(getIteratee(predicate)));
  17193. };
  17194. LazyWrapper.prototype.slice = function(start, end) {
  17195. start = toInteger(start);
  17196. var result = this;
  17197. if (result.__filtered__ && (start > 0 || end < 0)) {
  17198. return new LazyWrapper(result);
  17199. }
  17200. if (start < 0) {
  17201. result = result.takeRight(-start);
  17202. } else if (start) {
  17203. result = result.drop(start);
  17204. }
  17205. if (end !== undefined) {
  17206. end = toInteger(end);
  17207. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17208. }
  17209. return result;
  17210. };
  17211. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17212. return this.reverse().takeWhile(predicate).reverse();
  17213. };
  17214. LazyWrapper.prototype.toArray = function() {
  17215. return this.take(MAX_ARRAY_LENGTH);
  17216. };
  17217. // Add `LazyWrapper` methods to `lodash.prototype`.
  17218. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17219. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17220. isTaker = /^(?:head|last)$/.test(methodName),
  17221. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17222. retUnwrapped = isTaker || /^find/.test(methodName);
  17223. if (!lodashFunc) {
  17224. return;
  17225. }
  17226. lodash.prototype[methodName] = function() {
  17227. var value = this.__wrapped__,
  17228. args = isTaker ? [1] : arguments,
  17229. isLazy = value instanceof LazyWrapper,
  17230. iteratee = args[0],
  17231. useLazy = isLazy || isArray(value);
  17232. var interceptor = function(value) {
  17233. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17234. return (isTaker && chainAll) ? result[0] : result;
  17235. };
  17236. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17237. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17238. isLazy = useLazy = false;
  17239. }
  17240. var chainAll = this.__chain__,
  17241. isHybrid = !!this.__actions__.length,
  17242. isUnwrapped = retUnwrapped && !chainAll,
  17243. onlyLazy = isLazy && !isHybrid;
  17244. if (!retUnwrapped && useLazy) {
  17245. value = onlyLazy ? value : new LazyWrapper(this);
  17246. var result = func.apply(value, args);
  17247. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17248. return new LodashWrapper(result, chainAll);
  17249. }
  17250. if (isUnwrapped && onlyLazy) {
  17251. return func.apply(this, args);
  17252. }
  17253. result = this.thru(interceptor);
  17254. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17255. };
  17256. });
  17257. // Add `Array` methods to `lodash.prototype`.
  17258. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17259. var func = arrayProto[methodName],
  17260. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17261. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17262. lodash.prototype[methodName] = function() {
  17263. var args = arguments;
  17264. if (retUnwrapped && !this.__chain__) {
  17265. var value = this.value();
  17266. return func.apply(isArray(value) ? value : [], args);
  17267. }
  17268. return this[chainName](function(value) {
  17269. return func.apply(isArray(value) ? value : [], args);
  17270. });
  17271. };
  17272. });
  17273. // Map minified method names to their real names.
  17274. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17275. var lodashFunc = lodash[methodName];
  17276. if (lodashFunc) {
  17277. var key = lodashFunc.name + '';
  17278. if (!hasOwnProperty.call(realNames, key)) {
  17279. realNames[key] = [];
  17280. }
  17281. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17282. }
  17283. });
  17284. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17285. 'name': 'wrapper',
  17286. 'func': undefined
  17287. }];
  17288. // Add methods to `LazyWrapper`.
  17289. LazyWrapper.prototype.clone = lazyClone;
  17290. LazyWrapper.prototype.reverse = lazyReverse;
  17291. LazyWrapper.prototype.value = lazyValue;
  17292. // Add chain sequence methods to the `lodash` wrapper.
  17293. lodash.prototype.at = wrapperAt;
  17294. lodash.prototype.chain = wrapperChain;
  17295. lodash.prototype.commit = wrapperCommit;
  17296. lodash.prototype.next = wrapperNext;
  17297. lodash.prototype.plant = wrapperPlant;
  17298. lodash.prototype.reverse = wrapperReverse;
  17299. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17300. // Add lazy aliases.
  17301. lodash.prototype.first = lodash.prototype.head;
  17302. if (symIterator) {
  17303. lodash.prototype[symIterator] = wrapperToIterator;
  17304. }
  17305. return lodash;
  17306. });
  17307. /*--------------------------------------------------------------------------*/
  17308. // Export lodash.
  17309. var _ = runInContext();
  17310. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17311. if (true) {
  17312. // Expose Lodash on the global object to prevent errors when Lodash is
  17313. // loaded by a script tag in the presence of an AMD loader.
  17314. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17315. // Use `_.noConflict` to remove Lodash from the global object.
  17316. root._ = _;
  17317. // Define as an anonymous module so, through path mapping, it can be
  17318. // referenced as the "underscore" module.
  17319. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17320. return _;
  17321. }).call(exports, __webpack_require__, exports, module),
  17322. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17323. }
  17324. // Check for `exports` after `define` in case a build optimizer adds it.
  17325. else {}
  17326. }.call(this));
  17327. /***/ }),
  17328. /***/ "./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":
  17329. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17330. !*** ./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 ***!
  17331. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17332. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17333. "use strict";
  17334. __webpack_require__.r(__webpack_exports__);
  17335. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17336. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17337. /* harmony export */ });
  17338. /* 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");
  17339. /* 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__);
  17340. /* 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");
  17341. var options = {};
  17342. options.insert = "head";
  17343. options.singleton = false;
  17344. 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);
  17345. /* 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 || {});
  17346. /***/ }),
  17347. /***/ "./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":
  17348. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17349. !*** ./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 ***!
  17350. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17351. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17352. "use strict";
  17353. __webpack_require__.r(__webpack_exports__);
  17354. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17355. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17356. /* harmony export */ });
  17357. /* 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");
  17358. /* 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__);
  17359. /* 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");
  17360. var options = {};
  17361. options.insert = "head";
  17362. options.singleton = false;
  17363. 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);
  17364. /* 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 || {});
  17365. /***/ }),
  17366. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17367. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17368. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17369. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17370. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17371. "use strict";
  17372. __webpack_require__.r(__webpack_exports__);
  17373. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17374. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17375. /* harmony export */ });
  17376. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17377. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17378. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17379. var options = {};
  17380. options.insert = "head";
  17381. options.singleton = false;
  17382. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17383. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17384. /***/ }),
  17385. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17386. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17387. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17388. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17389. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17390. "use strict";
  17391. __webpack_require__.r(__webpack_exports__);
  17392. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17393. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17394. /* harmony export */ });
  17395. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17396. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17397. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17398. var options = {};
  17399. options.insert = "head";
  17400. options.singleton = false;
  17401. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17402. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17403. /***/ }),
  17404. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17405. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17406. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17407. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17408. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17409. "use strict";
  17410. __webpack_require__.r(__webpack_exports__);
  17411. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17412. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17413. /* harmony export */ });
  17414. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17415. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17416. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17417. var options = {};
  17418. options.insert = "head";
  17419. options.singleton = false;
  17420. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17421. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17422. /***/ }),
  17423. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17424. /*!******************************************************!*\
  17425. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17426. \******************************************************/
  17427. /***/ ((__unused_webpack_module, exports) => {
  17428. "use strict";
  17429. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17430. // runtime helper for setting properties on components
  17431. // in a tree-shakable way
  17432. exports["default"] = (sfc, props) => {
  17433. const target = sfc.__vccOpts || sfc;
  17434. for (const [key, val] of props) {
  17435. target[key] = val;
  17436. }
  17437. return target;
  17438. };
  17439. /***/ }),
  17440. /***/ "./resources/js/components/AppButtonLink.vue":
  17441. /*!***************************************************!*\
  17442. !*** ./resources/js/components/AppButtonLink.vue ***!
  17443. \***************************************************/
  17444. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17445. "use strict";
  17446. __webpack_require__.r(__webpack_exports__);
  17447. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17448. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17449. /* harmony export */ });
  17450. /* harmony import */ var _AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17451. /* harmony import */ var _AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17452. /* 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");
  17453. ;
  17454. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButtonLink.vue"]])
  17455. /* hot reload */
  17456. if (false) {}
  17457. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17458. /***/ }),
  17459. /***/ "./resources/js/components/AppFooter.vue":
  17460. /*!***********************************************!*\
  17461. !*** ./resources/js/components/AppFooter.vue ***!
  17462. \***********************************************/
  17463. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17464. "use strict";
  17465. __webpack_require__.r(__webpack_exports__);
  17466. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17467. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17468. /* harmony export */ });
  17469. /* harmony import */ var _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");
  17470. /* 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");
  17471. /* 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");
  17472. const script = {}
  17473. ;
  17474. 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"]])
  17475. /* hot reload */
  17476. if (false) {}
  17477. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17478. /***/ }),
  17479. /***/ "./resources/js/components/AppMessage.vue":
  17480. /*!************************************************!*\
  17481. !*** ./resources/js/components/AppMessage.vue ***!
  17482. \************************************************/
  17483. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17484. "use strict";
  17485. __webpack_require__.r(__webpack_exports__);
  17486. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17487. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17488. /* harmony export */ });
  17489. /* 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");
  17490. /* 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");
  17491. /* 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");
  17492. ;
  17493. 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"]])
  17494. /* hot reload */
  17495. if (false) {}
  17496. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17497. /***/ }),
  17498. /***/ "./resources/js/components/AppPagination.vue":
  17499. /*!***************************************************!*\
  17500. !*** ./resources/js/components/AppPagination.vue ***!
  17501. \***************************************************/
  17502. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17503. "use strict";
  17504. __webpack_require__.r(__webpack_exports__);
  17505. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17506. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17507. /* harmony export */ });
  17508. /* harmony import */ var _AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0");
  17509. /* harmony import */ var _AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17510. /* 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");
  17511. ;
  17512. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17513. /* hot reload */
  17514. if (false) {}
  17515. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17516. /***/ }),
  17517. /***/ "./resources/js/components/AppSidebar.vue":
  17518. /*!************************************************!*\
  17519. !*** ./resources/js/components/AppSidebar.vue ***!
  17520. \************************************************/
  17521. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17522. "use strict";
  17523. __webpack_require__.r(__webpack_exports__);
  17524. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17525. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17526. /* harmony export */ });
  17527. /* harmony import */ var _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");
  17528. /* 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");
  17529. /* 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");
  17530. /* 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");
  17531. ;
  17532. 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"]])
  17533. /* hot reload */
  17534. if (false) {}
  17535. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17536. /***/ }),
  17537. /***/ "./resources/js/components/AppSubSidebar.vue":
  17538. /*!***************************************************!*\
  17539. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17540. \***************************************************/
  17541. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17542. "use strict";
  17543. __webpack_require__.r(__webpack_exports__);
  17544. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17545. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17546. /* harmony export */ });
  17547. /* 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");
  17548. /* 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");
  17549. /* 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");
  17550. /* 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");
  17551. ;
  17552. 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"]])
  17553. /* hot reload */
  17554. if (false) {}
  17555. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17556. /***/ }),
  17557. /***/ "./resources/js/components/AppTopBar.vue":
  17558. /*!***********************************************!*\
  17559. !*** ./resources/js/components/AppTopBar.vue ***!
  17560. \***********************************************/
  17561. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17562. "use strict";
  17563. __webpack_require__.r(__webpack_exports__);
  17564. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17565. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17566. /* harmony export */ });
  17567. /* 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");
  17568. /* 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");
  17569. /* 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");
  17570. /* 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");
  17571. ;
  17572. 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"]])
  17573. /* hot reload */
  17574. if (false) {}
  17575. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17576. /***/ }),
  17577. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17578. /*!**************************************************!*\
  17579. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17580. \**************************************************/
  17581. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17582. "use strict";
  17583. __webpack_require__.r(__webpack_exports__);
  17584. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17585. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17586. /* harmony export */ });
  17587. /* 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");
  17588. /* 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");
  17589. /* 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");
  17590. /* 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");
  17591. ;
  17592. 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"]])
  17593. /* hot reload */
  17594. if (false) {}
  17595. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17596. /***/ }),
  17597. /***/ "./resources/js/pages/user/Index.vue":
  17598. /*!*******************************************!*\
  17599. !*** ./resources/js/pages/user/Index.vue ***!
  17600. \*******************************************/
  17601. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17602. "use strict";
  17603. __webpack_require__.r(__webpack_exports__);
  17604. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17605. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17606. /* harmony export */ });
  17607. /* harmony import */ var _Index_vue_vue_type_template_id_3aca4497__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=3aca4497 */ "./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497");
  17608. /* 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/user/Index.vue?vue&type=script&setup=true&lang=js");
  17609. /* 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");
  17610. ;
  17611. 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_3aca4497__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/user/Index.vue"]])
  17612. /* hot reload */
  17613. if (false) {}
  17614. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17615. /***/ }),
  17616. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17617. /*!**************************************************************************************!*\
  17618. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17619. \**************************************************************************************/
  17620. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17621. "use strict";
  17622. __webpack_require__.r(__webpack_exports__);
  17623. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17624. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17625. /* harmony export */ });
  17626. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppButtonLink.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17627. /***/ }),
  17628. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17629. /*!***********************************************************************************!*\
  17630. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17631. \***********************************************************************************/
  17632. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17633. "use strict";
  17634. __webpack_require__.r(__webpack_exports__);
  17635. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17636. /* 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"])
  17637. /* harmony export */ });
  17638. /* 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");
  17639. /***/ }),
  17640. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17641. /*!**************************************************************************************!*\
  17642. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17643. \**************************************************************************************/
  17644. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17645. "use strict";
  17646. __webpack_require__.r(__webpack_exports__);
  17647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17648. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17649. /* harmony export */ });
  17650. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppPagination.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17651. /***/ }),
  17652. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17653. /*!***********************************************************************************!*\
  17654. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17655. \***********************************************************************************/
  17656. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17657. "use strict";
  17658. __webpack_require__.r(__webpack_exports__);
  17659. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17660. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17661. /* harmony export */ });
  17662. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17663. /***/ }),
  17664. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17665. /*!**************************************************************************************!*\
  17666. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17667. \**************************************************************************************/
  17668. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17669. "use strict";
  17670. __webpack_require__.r(__webpack_exports__);
  17671. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17672. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17673. /* harmony export */ });
  17674. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17675. /***/ }),
  17676. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17677. /*!**********************************************************************************!*\
  17678. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17679. \**********************************************************************************/
  17680. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17681. "use strict";
  17682. __webpack_require__.r(__webpack_exports__);
  17683. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17684. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17685. /* harmony export */ });
  17686. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17687. /***/ }),
  17688. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17689. /*!*************************************************************************************!*\
  17690. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17691. \*************************************************************************************/
  17692. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17693. "use strict";
  17694. __webpack_require__.r(__webpack_exports__);
  17695. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17696. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17697. /* harmony export */ });
  17698. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17699. /***/ }),
  17700. /***/ "./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js":
  17701. /*!******************************************************************************!*\
  17702. !*** ./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js ***!
  17703. \******************************************************************************/
  17704. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17705. "use strict";
  17706. __webpack_require__.r(__webpack_exports__);
  17707. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17708. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17709. /* harmony export */ });
  17710. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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/user/Index.vue?vue&type=script&setup=true&lang=js");
  17711. /***/ }),
  17712. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17713. /*!*********************************************************************************!*\
  17714. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17715. \*********************************************************************************/
  17716. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17717. "use strict";
  17718. __webpack_require__.r(__webpack_exports__);
  17719. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17720. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render)
  17721. /* harmony export */ });
  17722. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17723. /***/ }),
  17724. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17725. /*!*****************************************************************************************!*\
  17726. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17727. \*****************************************************************************************/
  17728. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17729. "use strict";
  17730. __webpack_require__.r(__webpack_exports__);
  17731. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17732. /* harmony export */ "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)
  17733. /* harmony export */ });
  17734. /* 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");
  17735. /***/ }),
  17736. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17737. /*!******************************************************************************!*\
  17738. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17739. \******************************************************************************/
  17740. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17741. "use strict";
  17742. __webpack_require__.r(__webpack_exports__);
  17743. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17744. /* harmony export */ "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)
  17745. /* harmony export */ });
  17746. /* 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");
  17747. /***/ }),
  17748. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17749. /*!*********************************************************************************!*\
  17750. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17751. \*********************************************************************************/
  17752. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17753. "use strict";
  17754. __webpack_require__.r(__webpack_exports__);
  17755. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17756. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17757. /* harmony export */ });
  17758. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0");
  17759. /***/ }),
  17760. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17761. /*!******************************************************************************************!*\
  17762. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17763. \******************************************************************************************/
  17764. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17765. "use strict";
  17766. __webpack_require__.r(__webpack_exports__);
  17767. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17768. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17769. /* harmony export */ });
  17770. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17771. /***/ }),
  17772. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17773. /*!*********************************************************************************************!*\
  17774. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17775. \*********************************************************************************************/
  17776. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17777. "use strict";
  17778. __webpack_require__.r(__webpack_exports__);
  17779. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17780. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17781. /* harmony export */ });
  17782. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17783. /***/ }),
  17784. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17785. /*!*****************************************************************************************!*\
  17786. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17787. \*****************************************************************************************/
  17788. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17789. "use strict";
  17790. __webpack_require__.r(__webpack_exports__);
  17791. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17792. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17793. /* harmony export */ });
  17794. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17795. /***/ }),
  17796. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17797. /*!********************************************************************************************!*\
  17798. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17799. \********************************************************************************************/
  17800. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17801. "use strict";
  17802. __webpack_require__.r(__webpack_exports__);
  17803. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17804. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17805. /* harmony export */ });
  17806. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17807. /***/ }),
  17808. /***/ "./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497":
  17809. /*!*************************************************************************!*\
  17810. !*** ./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497 ***!
  17811. \*************************************************************************/
  17812. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17813. "use strict";
  17814. __webpack_require__.r(__webpack_exports__);
  17815. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17816. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_3aca4497__WEBPACK_IMPORTED_MODULE_0__.render)
  17817. /* harmony export */ });
  17818. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_3aca4497__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=3aca4497 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/user/Index.vue?vue&type=template&id=3aca4497");
  17819. /***/ }),
  17820. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17821. /*!********************************************************************************************************!*\
  17822. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17823. \********************************************************************************************************/
  17824. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17825. "use strict";
  17826. __webpack_require__.r(__webpack_exports__);
  17827. /* 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");
  17828. /***/ }),
  17829. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17830. /*!*********************************************************************************************************!*\
  17831. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17832. \*********************************************************************************************************/
  17833. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17834. "use strict";
  17835. __webpack_require__.r(__webpack_exports__);
  17836. /* 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");
  17837. /***/ }),
  17838. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17839. /*!************************************************************************************************************!*\
  17840. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17841. \************************************************************************************************************/
  17842. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17843. "use strict";
  17844. __webpack_require__.r(__webpack_exports__);
  17845. /* 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");
  17846. /***/ }),
  17847. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17848. /*!********************************************************************************************************!*\
  17849. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17850. \********************************************************************************************************/
  17851. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17852. "use strict";
  17853. __webpack_require__.r(__webpack_exports__);
  17854. /* 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");
  17855. /***/ }),
  17856. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17857. /*!***********************************************************************************************************!*\
  17858. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17859. \***********************************************************************************************************/
  17860. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17861. "use strict";
  17862. __webpack_require__.r(__webpack_exports__);
  17863. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17864. /***/ })
  17865. }]);